add prompt confirmation and update carton
This commit is contained in:
@@ -118,9 +118,13 @@ class _ProcessingEditEditorState extends State<ProcessingEditEditor> {
|
||||
leading: new IconButton(
|
||||
icon: new Icon(CupertinoIcons.back, color: primaryColor, size: 30),
|
||||
onPressed: () {
|
||||
showConfirmDialog(context, "back.button_confirm", () {
|
||||
if (isDataChanged()) {
|
||||
showConfirmDialog(context, "back.button_confirm", () {
|
||||
Navigator.of(context).pop();
|
||||
});
|
||||
} else {
|
||||
Navigator.of(context).pop();
|
||||
});
|
||||
}
|
||||
},
|
||||
),
|
||||
shadowColor: Colors.transparent,
|
||||
@@ -261,4 +265,12 @@ class _ProcessingEditEditorState extends State<ProcessingEditEditor> {
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
isDataChanged() {
|
||||
return _user.fcsID != "" ||
|
||||
selectedMarket != "" ||
|
||||
_descCtl.text != "" ||
|
||||
_remarkCtl.text != "" ||
|
||||
multiImgController.getAddedFile.isNotEmpty;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user