add prompt confirmation and update carton
This commit is contained in:
@@ -52,9 +52,13 @@ class _InvitationCreateState extends State<InvitationCreate> {
|
||||
color: primaryColor,
|
||||
),
|
||||
onPressed: () {
|
||||
showConfirmDialog(context, "back.button_confirm", () {
|
||||
if (isDataChanged()) {
|
||||
showConfirmDialog(context, "back.button_confirm", () {
|
||||
Navigator.of(context).pop();
|
||||
});
|
||||
} else {
|
||||
Navigator.of(context).pop();
|
||||
});
|
||||
}
|
||||
},
|
||||
),
|
||||
title: LocalText(
|
||||
@@ -166,4 +170,10 @@ class _InvitationCreateState extends State<InvitationCreate> {
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
isDataChanged() {
|
||||
String userName = _nameController.text;
|
||||
String phoneNumber = _phoneController.text;
|
||||
return userName != "" || phoneNumber != "";
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user