fix errors

This commit is contained in:
Sai Naw Wun
2020-10-22 04:14:53 +06:30
parent 2021f74872
commit e5540c5491
32 changed files with 1069 additions and 811 deletions

View File

@@ -490,7 +490,7 @@ class _CartonEditorState extends State<CartonEditor> {
showMsgDialog(context, "Error", "Invalid delivery address");
return;
}
if (isSmallBag && _mixCarton == null) {
if (isSmallBag && _mixCarton == null && _isNew) {
showMsgDialog(context, "Error", "Invalid mix carton");
return;
}
@@ -507,7 +507,9 @@ class _CartonEditorState extends State<CartonEditor> {
carton.width = w;
carton.height = h;
carton.deliveryAddress = _deliveryAddress;
carton.cartons = _carton.cartons.where((c) => c.isChecked).toList();
carton.cartons = _carton.cartons == null
? []
: _carton.cartons.where((c) => c.isChecked).toList();
setState(() {
_isLoading = true;
});