add prompt confirmation and update carton
This commit is contained in:
@@ -61,9 +61,13 @@ class _PaymentMethodEditorState extends State<PaymentMethodEditor> {
|
||||
leading: new IconButton(
|
||||
icon: new Icon(CupertinoIcons.back, 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(
|
||||
@@ -214,4 +218,13 @@ class _PaymentMethodEditorState extends State<PaymentMethodEditor> {
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
isDataChanged() {
|
||||
return _nameController.text != "" ||
|
||||
_accountNameController.text != "" ||
|
||||
_accountNumberController.text != "" ||
|
||||
_phoneController.text != "" ||
|
||||
_mailController.text != "" ||
|
||||
_linkController.text != "";
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user