update processing

This commit is contained in:
Thinzar Win
2020-12-02 20:55:00 +06:30
parent 8e73ba2d8b
commit 42bb217c2c
26 changed files with 589 additions and 250 deletions

View File

@@ -82,7 +82,8 @@ class _DiscountByWeightListState extends State<DiscountByWeightList> {
discountByWeight: discountByWeight)));
},
child: Container(
child: _row("${discountByWeight.weight.toString()} lb",
child: _row(
"${discountByWeight.weight.toStringAsFixed(2)} lb",
"\$ " + discountByWeight.discount.toString()),
),
);

View File

@@ -31,7 +31,7 @@ class _DiscountByWeightEditorState extends State<DiscountByWeightEditor> {
super.initState();
if (widget.discountByWeight != null) {
_discountByWeight = widget.discountByWeight;
_weightController.text = _discountByWeight.weight.toString();
_weightController.text = _discountByWeight.weight.toStringAsFixed(2);
_discountController.text = _discountByWeight.discount.toString();
_isNew = false;
} else {

View File

@@ -196,8 +196,8 @@ class _ShipmentRatesState extends State<ShipmentRates> {
if (discounts == null) return [];
return discounts.map((d) {
return Container(
child: _row(
"${d.weight.toString()} lb", "\$ " + d.discount.toString(), ''),
child: _row("${d.weight.toStringAsFixed(2)} lb",
"\$ " + d.discount.toString(), ''),
);
}).toList();
}

View File

@@ -37,7 +37,7 @@ class _ShipmentRatesEditState extends State<ShipmentRatesEdit> {
Provider.of<ShipmentRateModel>(context, listen: false);
Rate rate = shipmentRateModel.rate;
_minWeight.text = rate.freeDeliveryWeight?.toString() ?? "";
_minWeight.text = rate.freeDeliveryWeight?.toStringAsFixed(2) ?? "";
_deliveryFee.text = rate.deliveryFee?.toString() ?? "";
_volumetricRatio.text = rate.volumetricRatio?.toString() ?? "";
}