From 30c27340cacb4a82be96327b40daac175c7c93bd Mon Sep 17 00:00:00 2001 From: tzw Date: Thu, 3 Apr 2025 11:41:04 +0630 Subject: [PATCH] update cargo type input for carton --- lib/main_dev.dart | 4 ++-- lib/pages/carton/cargo_widget.dart | 7 ++++--- lib/pages/carton/carton_package_editor.dart | 3 ++- lib/pages/carton/carton_package_form.dart | 3 ++- 4 files changed, 10 insertions(+), 7 deletions(-) diff --git a/lib/main_dev.dart b/lib/main_dev.dart index dfe3f4a..aecddb9 100644 --- a/lib/main_dev.dart +++ b/lib/main_dev.dart @@ -19,8 +19,8 @@ Future main() async { Config( flavor: Flavor.DEV, color: Colors.blue, - apiURL: "http://192.168.100.150:9090", - // apiURL: "https://asia-northeast1-fcs-dev1.cloudfunctions.net/API13", + // apiURL: "http://192.168.100.150:9090", + apiURL: "https://asia-northeast1-fcs-dev1.cloudfunctions.net/API13", level: Level.ALL); runApp(App(title: "FCS - Dev")); } diff --git a/lib/pages/carton/cargo_widget.dart b/lib/pages/carton/cargo_widget.dart index b6810b6..d7ecbb9 100644 --- a/lib/pages/carton/cargo_widget.dart +++ b/lib/pages/carton/cargo_widget.dart @@ -18,8 +18,8 @@ import 'surcharge_item_addition.dart'; typedef OnPrevious = Function(List cargoTypes, List customDuties, double totalWeight); -typedef OnContinue = Function( - List cargoTypes, List customDuties); +typedef OnContinue = Function(List cargoTypes, + List customDuties, double totalWeight); class CargoWidget extends StatefulWidget { final User sender; @@ -408,7 +408,8 @@ class _CargoWidgetState extends State { context, "Error", "Please add the right cargo type weight"); return; } - widget.onContinue!(_cargoTypes, _surchareItems); + widget.onContinue!( + _cargoTypes, _surchareItems, double.tryParse(totalCtl.text) ?? 0); } }, ); diff --git a/lib/pages/carton/carton_package_editor.dart b/lib/pages/carton/carton_package_editor.dart index 15ba3fc..7652cbd 100644 --- a/lib/pages/carton/carton_package_editor.dart +++ b/lib/pages/carton/carton_package_editor.dart @@ -255,8 +255,9 @@ class _CartonPackageEditorState extends State { cargoTypes: _cargoTypes, surchargeItems: _surchareItems, totalWeight: _totalWeight, - onContinue: (cargoTypes, customDuties) { + onContinue: (cargoTypes, customDuties, totalWeight) { setState(() { + _totalWeight = totalWeight; _cargoTypes = List.from(cargoTypes); _surchareItems = List.from(customDuties); currentStep += 1; diff --git a/lib/pages/carton/carton_package_form.dart b/lib/pages/carton/carton_package_form.dart index 7ae4785..e0266ea 100644 --- a/lib/pages/carton/carton_package_form.dart +++ b/lib/pages/carton/carton_package_form.dart @@ -190,8 +190,9 @@ class _CartonPackageFormState extends State { cargoTypes: _cargoTypes, surchargeItems: _surchareItems, totalWeight: _totalWeight, - onContinue: (cargoTypes, customDuties) { + onContinue: (cargoTypes, customDuties, totalWeight) { setState(() { + _totalWeight = totalWeight; _cargoTypes = List.from(cargoTypes); _surchareItems = List.from(customDuties); currentStep += 1;