add prompt confirmation and update carton
This commit is contained in:
@@ -127,9 +127,13 @@ class _FAQEditorState extends State<FAQEditor> {
|
||||
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();
|
||||
});
|
||||
}
|
||||
},
|
||||
),
|
||||
backgroundColor: Colors.white,
|
||||
@@ -240,4 +244,15 @@ class _FAQEditorState extends State<FAQEditor> {
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
isDataChanged() {
|
||||
return _sn.text != "" ||
|
||||
_engQ.text != "" ||
|
||||
_engA.text != "" ||
|
||||
_mmQ.text != "" ||
|
||||
_mmA.text != "" ||
|
||||
_pageLabelEng.text != "" ||
|
||||
_pageLabelMm.text != "" ||
|
||||
_pageLink != info;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user