add prompt confirmation and update carton
This commit is contained in:
@@ -166,9 +166,13 @@ class _ShipmentEditorState extends State<ShipmentEditor> {
|
||||
color: primaryColor,
|
||||
),
|
||||
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,
|
||||
@@ -316,4 +320,8 @@ class _ShipmentEditorState extends State<ShipmentEditor> {
|
||||
MainModel mainModel = Provider.of<MainModel>(context, listen: false);
|
||||
launch("${mainModel.setting.courierWebsite}");
|
||||
}
|
||||
|
||||
isDataChanged() {
|
||||
return _shipment.boxes.isNotEmpty;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user