fix carton
This commit is contained in:
@@ -62,11 +62,11 @@ class _ProcesingEditorState extends State<ProcesingEditor> {
|
||||
)),
|
||||
IconButton(
|
||||
icon: Icon(Icons.search, color: primaryColor),
|
||||
onPressed: () => searchUser(context, callbackUserSelect: (u) {
|
||||
onPressed: () => searchUser(context, onUserSelect: (u) {
|
||||
setState(() {
|
||||
this.consignee = u;
|
||||
});
|
||||
})),
|
||||
}, popPage: true)),
|
||||
],
|
||||
);
|
||||
|
||||
@@ -104,11 +104,11 @@ class _ProcesingEditorState extends State<ProcesingEditor> {
|
||||
)),
|
||||
IconButton(
|
||||
icon: Icon(Icons.search, color: primaryColor),
|
||||
onPressed: () => searchUser(context, callbackUserSelect: (u) {
|
||||
onPressed: () => searchUser(context, onUserSelect: (u) {
|
||||
setState(() {
|
||||
this.sender = u;
|
||||
});
|
||||
})),
|
||||
}, popPage: true)),
|
||||
],
|
||||
);
|
||||
|
||||
@@ -148,7 +148,8 @@ class _ProcesingEditorState extends State<ProcesingEditor> {
|
||||
),
|
||||
onPressed: () async {
|
||||
if (this.consignee == null) {
|
||||
showMsgDialog(context, "Warning", "Please select 'Consignee'");
|
||||
showMsgDialog(
|
||||
context, "Warning", "Please select 'Consignee'");
|
||||
return;
|
||||
}
|
||||
Package _package = await Navigator.push<Package>(
|
||||
@@ -181,13 +182,7 @@ class _ProcesingEditorState extends State<ProcesingEditor> {
|
||||
icon:
|
||||
new Icon(CupertinoIcons.back, color: primaryColor, size: 30),
|
||||
onPressed: () {
|
||||
if (isDataChanged()) {
|
||||
showConfirmDialog(context, "back.button_confirm", () {
|
||||
Navigator.of(context).pop();
|
||||
});
|
||||
} else {
|
||||
Navigator.of(context).pop();
|
||||
}
|
||||
Navigator.of(context).pop();
|
||||
},
|
||||
),
|
||||
shadowColor: Colors.transparent,
|
||||
@@ -290,16 +285,4 @@ class _ProcesingEditorState extends State<ProcesingEditor> {
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
isDataChanged() {
|
||||
if (_isNew) {
|
||||
return this.packages.isNotEmpty || consignee != null || sender != null;
|
||||
} else {
|
||||
Processing _processing = Processing(
|
||||
userID: consignee.fcsID,
|
||||
fcsID: sender.fcsID,
|
||||
packages: this.packages);
|
||||
return widget.processing.isChangedForEdit(_processing);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user