update shipment and carton

This commit is contained in:
tzw
2021-09-13 09:51:55 +06:30
parent a6617ae7e2
commit d3c43c1b85
9 changed files with 49 additions and 44 deletions

View File

@@ -144,9 +144,9 @@ class _CartonInfoState extends State<CartonInfo> {
}
_calShipmentWeight() {
double l = double.parse(_lengthController.text);
double w = double.parse(_widthController.text);
double h = double.parse(_heightController.text);
double l = double.tryParse(_lengthController.text) ?? 0;
double w = double.tryParse(_widthController.text) ?? 0;
double h = double.tryParse(_heightController.text) ?? 0;
setState(() {
shipmentWeight = l * w * h / volumetricRatio;
});
@@ -412,7 +412,7 @@ class _CartonInfoState extends State<CartonInfo> {
_box!.mixCartons = _box!.mixCartons;
bool? updated = await Navigator.push<bool>(
context,
CupertinoPageRoute(builder: (context) => CartonEditor(box: _box)),
CupertinoPageRoute(builder: (context) => CartonEditor(carton: _box)),
);
if (updated ?? false) {
var cartonModel = Provider.of<CartonModel>(context, listen: false);