update cartion editor for package

This commit is contained in:
tzw
2024-02-06 17:45:36 +06:30
parent 3767ba76dc
commit 3a91b49a1a
10 changed files with 563 additions and 109 deletions

View File

@@ -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;