update cartion editor for package
This commit is contained in:
@@ -35,11 +35,18 @@ class _CustomDutyAdditionState extends State<CustomDutyAddition> {
|
||||
shipmentRateModel.rate.customDuties.map((e) => e.clone()).toList();
|
||||
|
||||
for (var p in customDuties) {
|
||||
p.qty = 0;
|
||||
if (widget.customDuties.any((e) => e.id == p.id)) {
|
||||
p.isChecked = true;
|
||||
} else {
|
||||
p.isChecked = false;
|
||||
}
|
||||
|
||||
widget.customDuties.forEach((vp) {
|
||||
if (p.id == vp.id) {
|
||||
p.qty = vp.qty;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if (mounted) {
|
||||
@@ -87,6 +94,7 @@ class _CustomDutyAdditionState extends State<CustomDutyAddition> {
|
||||
callBack: () {
|
||||
List<CargoType> _cargos =
|
||||
customDuties.where((c) => c.isChecked).toList();
|
||||
|
||||
if (_cargos.isEmpty) {
|
||||
showMsgDialog(context, 'Error', "Please select the cargo type");
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user