update carton from packages

This commit is contained in:
2021-01-08 17:13:51 +06:30
parent f0662ff1d0
commit 32b8c5ae93
17 changed files with 321 additions and 371 deletions

View File

@@ -44,7 +44,8 @@ class _ShipmentRatesEditState extends State<ShipmentRatesEdit> {
_minWeight.text = rate.freeDeliveryWeight?.toStringAsFixed(2) ?? "";
_deliveryFee.text = rate.deliveryFee?.toStringAsFixed(2) ?? "";
_volumetricRatio.text = rate.volumetricRatio?.toStringAsFixed(2) ?? "";
_diffDiscountWeight.text = rate.diffDiscountWeight?.toStringAsFixed(2) ?? "";
_diffDiscountWeight.text =
rate.diffDiscountWeight?.toStringAsFixed(2) ?? "";
_diffWeightRate.text = rate.diffWeightRate?.toStringAsFixed(2) ?? "";
}
@@ -162,120 +163,4 @@ class _ShipmentRatesEditState extends State<ShipmentRatesEdit> {
);
return rate.isChangedForEdit(_rate);
}
List<MyDataRow> getCargoRows(List<CargoType> cargos) {
return cargos.map((r) {
return MyDataRow(
onSelectChanged: (selected) {
Navigator.push(
context,
CupertinoPageRoute(builder: (context) => CargoEditor(cargo: r)),
);
},
cells: [
MyDataCell(
new Text(
r.name,
style: textStyle,
),
),
MyDataCell(
new Text(
r.rate.toString(),
style: textStyle,
),
),
MyDataCell(IconButton(icon: Icon(Icons.delete), onPressed: null)),
],
);
}).toList();
}
List<MyDataRow> getCustomsRows(List<CustomDuty> customs) {
return customs.map((c) {
return MyDataRow(
onSelectChanged: (selected) {
Navigator.push(
context,
CupertinoPageRoute(builder: (context) => CustomEditor(custom: c)),
);
},
cells: [
MyDataCell(
new Text(
c.productType,
style: textStyle,
),
),
MyDataCell(
new Text(
c.fee.toString(),
style: textStyle,
),
),
MyDataCell(IconButton(icon: Icon(Icons.delete), onPressed: null)),
],
);
}).toList();
}
List<MyDataRow> getDiscounts(List<DiscountByWeight> discounts) {
return discounts.map((d) {
return MyDataRow(
onSelectChanged: (selected) {
// Navigator.push(
// context,
// CupertinoPageRoute(builder: (context) => CargoEditor(rate: r)),
// );
},
cells: [
MyDataCell(
new Text(
"${d.weight} lb",
style: textStyle,
),
),
MyDataCell(
Center(
child: new Text(
d.discount.toString(),
style: textStyle,
),
),
),
MyDataCell(IconButton(icon: Icon(Icons.delete), onPressed: null)),
],
);
}).toList();
}
_row(String desc, String price, String unit) {
return Container(
padding: EdgeInsets.only(left: 25, top: 5, bottom: 5),
child: Row(
children: <Widget>[
Text('$desc ', style: TextStyle(fontSize: 15)),
Spacer(),
Column(
crossAxisAlignment: CrossAxisAlignment.end,
children: <Widget>[
Padding(
padding: const EdgeInsets.only(bottom: 3.0),
child: Text(
'$price',
style: TextStyle(color: primaryColor, fontSize: 14),
),
),
Text(
'$unit',
style: TextStyle(color: Colors.grey, fontSize: 14),
),
],
),
SizedBox(
width: 50,
),
],
));
}
}