Merge branch 'master' of tzw/fcs into master
This commit is contained in:
@@ -13,6 +13,7 @@
|
|||||||
"btn.ok": "Ok",
|
"btn.ok": "Ok",
|
||||||
"feet":"Feet",
|
"feet":"Feet",
|
||||||
"inch":"Inch",
|
"inch":"Inch",
|
||||||
|
"back.button_confirm":"Are you sure you want to continue without saving changes?",
|
||||||
"Buttons End ================================================================":"",
|
"Buttons End ================================================================":"",
|
||||||
|
|
||||||
"Offline Start ================================================================":"",
|
"Offline Start ================================================================":"",
|
||||||
|
|||||||
@@ -12,6 +12,7 @@
|
|||||||
"btn.ok": "အိုကေ",
|
"btn.ok": "အိုကေ",
|
||||||
"feet":"ပေ",
|
"feet":"ပေ",
|
||||||
"inch":"လက်မ",
|
"inch":"လက်မ",
|
||||||
|
"back.button_confirm":"Are you sure you want to continue without saving changes?",
|
||||||
"Buttons End ================================================================":"",
|
"Buttons End ================================================================":"",
|
||||||
|
|
||||||
"Offline Start ================================================================":"",
|
"Offline Start ================================================================":"",
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import 'package:fcs/domain/entities/cargo_type.dart';
|
import 'package:fcs/domain/entities/cargo_type.dart';
|
||||||
import 'package:fcs/helpers/theme.dart';
|
import 'package:fcs/helpers/theme.dart';
|
||||||
|
import 'package:fcs/pages/main/util.dart';
|
||||||
import 'package:fcs/pages/widgets/local_text.dart';
|
import 'package:fcs/pages/widgets/local_text.dart';
|
||||||
import 'package:fcs/pages/widgets/my_data_table.dart';
|
import 'package:fcs/pages/widgets/my_data_table.dart';
|
||||||
import 'package:flutter/cupertino.dart';
|
import 'package:flutter/cupertino.dart';
|
||||||
@@ -25,6 +26,8 @@ class CargoTable extends StatefulWidget {
|
|||||||
|
|
||||||
class _CargoTableState extends State<CargoTable> {
|
class _CargoTableState extends State<CargoTable> {
|
||||||
double totalWeight = 0;
|
double totalWeight = 0;
|
||||||
|
List<CargoType> _cargos = [];
|
||||||
|
double remainingWeight = 0;
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return MyDataTable(
|
return MyDataTable(
|
||||||
@@ -54,12 +57,13 @@ class _CargoTableState extends State<CargoTable> {
|
|||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
double _total = 0;
|
|
||||||
var rows = widget.cargoTypes.map((c) {
|
var rows = widget.cargoTypes.map((c) {
|
||||||
_total += c.weight;
|
|
||||||
|
|
||||||
return MyDataRow(
|
return MyDataRow(
|
||||||
onSelectChanged: (bool selected) async {
|
onSelectChanged: (bool selected) async {
|
||||||
|
if (this.totalWeight <= 0) {
|
||||||
|
showMsgDialog(context, "Error", "Please insert total weight");
|
||||||
|
return;
|
||||||
|
}
|
||||||
CargoType cargo = await Navigator.push<CargoType>(
|
CargoType cargo = await Navigator.push<CargoType>(
|
||||||
context,
|
context,
|
||||||
CupertinoPageRoute(
|
CupertinoPageRoute(
|
||||||
@@ -67,6 +71,12 @@ class _CargoTableState extends State<CargoTable> {
|
|||||||
cargo: c,
|
cargo: c,
|
||||||
)));
|
)));
|
||||||
if (widget.onAdd != null) widget.onAdd(cargo);
|
if (widget.onAdd != null) widget.onAdd(cargo);
|
||||||
|
if (cargo == null) return;
|
||||||
|
|
||||||
|
this._cargos.add(cargo);
|
||||||
|
if (this.remainingWeight <= 0) return;
|
||||||
|
this.remainingWeight -= cargo.weight;
|
||||||
|
print("this.remainingWeight>>>${this.remainingWeight}");
|
||||||
},
|
},
|
||||||
cells: [
|
cells: [
|
||||||
MyDataCell(new Text(
|
MyDataCell(new Text(
|
||||||
@@ -104,6 +114,7 @@ class _CargoTableState extends State<CargoTable> {
|
|||||||
if (_t == null) return;
|
if (_t == null) return;
|
||||||
setState(() {
|
setState(() {
|
||||||
totalWeight = _t;
|
totalWeight = _t;
|
||||||
|
remainingWeight = _t;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
cells: [
|
cells: [
|
||||||
|
|||||||
@@ -351,7 +351,11 @@ class _CartonEditorState extends State<CartonEditor> {
|
|||||||
centerTitle: true,
|
centerTitle: true,
|
||||||
leading: new IconButton(
|
leading: new IconButton(
|
||||||
icon: new Icon(CupertinoIcons.back, color: primaryColor, size: 30),
|
icon: new Icon(CupertinoIcons.back, color: primaryColor, size: 30),
|
||||||
onPressed: () => Navigator.of(context).pop(),
|
onPressed: () {
|
||||||
|
showConfirmDialog(context, "back.button_confirm", () {
|
||||||
|
Navigator.of(context).pop();
|
||||||
|
});
|
||||||
|
},
|
||||||
),
|
),
|
||||||
shadowColor: Colors.transparent,
|
shadowColor: Colors.transparent,
|
||||||
backgroundColor: Colors.white,
|
backgroundColor: Colors.white,
|
||||||
|
|||||||
@@ -139,7 +139,11 @@ class _CartonSizeEditorState extends State<CartonSizeEditor> {
|
|||||||
leading: new IconButton(
|
leading: new IconButton(
|
||||||
icon:
|
icon:
|
||||||
new Icon(CupertinoIcons.back, color: primaryColor, size: 30),
|
new Icon(CupertinoIcons.back, color: primaryColor, size: 30),
|
||||||
onPressed: () => Navigator.of(context).pop(),
|
onPressed: () {
|
||||||
|
showConfirmDialog(context, "back.button_confirm", () {
|
||||||
|
Navigator.of(context).pop();
|
||||||
|
});
|
||||||
|
},
|
||||||
),
|
),
|
||||||
shadowColor: Colors.transparent,
|
shadowColor: Colors.transparent,
|
||||||
backgroundColor: Colors.white,
|
backgroundColor: Colors.white,
|
||||||
|
|||||||
@@ -81,9 +81,12 @@ class _ContactEditorState extends State<ContactEditor> {
|
|||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
centerTitle: true,
|
centerTitle: true,
|
||||||
leading: new IconButton(
|
leading: new IconButton(
|
||||||
icon: new Icon(CupertinoIcons.back, color: primaryColor),
|
icon: new Icon(CupertinoIcons.back, color: primaryColor),
|
||||||
onPressed: () => Navigator.of(context).pop(),
|
onPressed: () {
|
||||||
),
|
showConfirmDialog(context, "back.button_confirm", () {
|
||||||
|
Navigator.of(context).pop();
|
||||||
|
});
|
||||||
|
}),
|
||||||
shadowColor: Colors.transparent,
|
shadowColor: Colors.transparent,
|
||||||
backgroundColor: Colors.white,
|
backgroundColor: Colors.white,
|
||||||
title: LocalText(
|
title: LocalText(
|
||||||
|
|||||||
@@ -51,7 +51,11 @@ class _InvitationCreateState extends State<InvitationCreate> {
|
|||||||
CupertinoIcons.back,
|
CupertinoIcons.back,
|
||||||
color: primaryColor,
|
color: primaryColor,
|
||||||
),
|
),
|
||||||
onPressed: () => Navigator.of(context).pop(),
|
onPressed: () {
|
||||||
|
showConfirmDialog(context, "back.button_confirm", () {
|
||||||
|
Navigator.of(context).pop();
|
||||||
|
});
|
||||||
|
},
|
||||||
),
|
),
|
||||||
title: LocalText(
|
title: LocalText(
|
||||||
context,
|
context,
|
||||||
|
|||||||
@@ -237,7 +237,11 @@ class _DeliveryInfoState extends State<DeliveryInfo> {
|
|||||||
centerTitle: true,
|
centerTitle: true,
|
||||||
leading: new IconButton(
|
leading: new IconButton(
|
||||||
icon: new Icon(CupertinoIcons.back, color: primaryColor, size: 30),
|
icon: new Icon(CupertinoIcons.back, color: primaryColor, size: 30),
|
||||||
onPressed: () => Navigator.of(context).pop(),
|
onPressed: () {
|
||||||
|
showConfirmDialog(context, "back.button_confirm", () {
|
||||||
|
Navigator.of(context).pop();
|
||||||
|
});
|
||||||
|
},
|
||||||
),
|
),
|
||||||
shadowColor: Colors.transparent,
|
shadowColor: Colors.transparent,
|
||||||
backgroundColor: Colors.white,
|
backgroundColor: Colors.white,
|
||||||
|
|||||||
@@ -106,7 +106,11 @@ class _DeliveryAddressEditorState extends State<DeliveryAddressEditor> {
|
|||||||
centerTitle: true,
|
centerTitle: true,
|
||||||
leading: new IconButton(
|
leading: new IconButton(
|
||||||
icon: new Icon(CupertinoIcons.back, color: primaryColor),
|
icon: new Icon(CupertinoIcons.back, color: primaryColor),
|
||||||
onPressed: () => Navigator.of(context).pop(),
|
onPressed: () {
|
||||||
|
showConfirmDialog(context, "back.button_confirm", () {
|
||||||
|
Navigator.of(context).pop();
|
||||||
|
});
|
||||||
|
},
|
||||||
),
|
),
|
||||||
backgroundColor: Colors.white,
|
backgroundColor: Colors.white,
|
||||||
shadowColor: Colors.transparent,
|
shadowColor: Colors.transparent,
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ class _DiscountEditorState extends State<DiscountEditor> {
|
|||||||
if (widget.discount != null) {
|
if (widget.discount != null) {
|
||||||
_discount = widget.discount;
|
_discount = widget.discount;
|
||||||
_codeController.text = _discount.code;
|
_codeController.text = _discount.code;
|
||||||
_amountController.text = _discount.amount.toString();
|
_amountController.text = _discount.amount.toStringAsFixed(2);
|
||||||
_statusController.text = _discount.status;
|
_statusController.text = _discount.status;
|
||||||
customerName = widget.discount.customerName;
|
customerName = widget.discount.customerName;
|
||||||
customerId = widget.discount.customerId;
|
customerId = widget.discount.customerId;
|
||||||
@@ -97,7 +97,11 @@ class _DiscountEditorState extends State<DiscountEditor> {
|
|||||||
),
|
),
|
||||||
leading: new IconButton(
|
leading: new IconButton(
|
||||||
icon: new Icon(CupertinoIcons.back),
|
icon: new Icon(CupertinoIcons.back),
|
||||||
onPressed: () => Navigator.of(context).pop(),
|
onPressed: () {
|
||||||
|
showConfirmDialog(context, "back.button_confirm", () {
|
||||||
|
Navigator.of(context).pop();
|
||||||
|
});
|
||||||
|
},
|
||||||
),
|
),
|
||||||
backgroundColor: primaryColor,
|
backgroundColor: primaryColor,
|
||||||
actions: [
|
actions: [
|
||||||
|
|||||||
@@ -80,7 +80,7 @@ class DiscountListRow extends StatelessWidget {
|
|||||||
child: Row(
|
child: Row(
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
new Text(
|
new Text(
|
||||||
"${discount.amount ?? ''}",
|
"${discount.amount.toStringAsFixed(2) ?? ''}",
|
||||||
style:
|
style:
|
||||||
new TextStyle(fontSize: 15.0, color: Colors.grey),
|
new TextStyle(fontSize: 15.0, color: Colors.grey),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -126,7 +126,11 @@ class _FAQEditorState extends State<FAQEditor> {
|
|||||||
centerTitle: true,
|
centerTitle: true,
|
||||||
leading: new IconButton(
|
leading: new IconButton(
|
||||||
icon: new Icon(CupertinoIcons.back, color: primaryColor),
|
icon: new Icon(CupertinoIcons.back, color: primaryColor),
|
||||||
onPressed: () => Navigator.of(context).pop(),
|
onPressed: () {
|
||||||
|
showConfirmDialog(context, "back.button_confirm", () {
|
||||||
|
Navigator.of(context).pop();
|
||||||
|
});
|
||||||
|
},
|
||||||
),
|
),
|
||||||
backgroundColor: Colors.white,
|
backgroundColor: Colors.white,
|
||||||
shadowColor: Colors.transparent,
|
shadowColor: Colors.transparent,
|
||||||
|
|||||||
@@ -59,9 +59,9 @@ class _FcsShipmentEditorState extends State<FcsShipmentEditor> {
|
|||||||
_consigneeController.text = _shipment.consignee;
|
_consigneeController.text = _shipment.consignee;
|
||||||
_portController.text = _shipment.port;
|
_portController.text = _shipment.port;
|
||||||
_destinationController.text = _shipment.destination;
|
_destinationController.text = _shipment.destination;
|
||||||
}else{
|
} else {
|
||||||
var mainModel = Provider.of<MainModel>(context,listen: false);
|
var mainModel = Provider.of<MainModel>(context, listen: false);
|
||||||
_currentShipmentType =mainModel.setting.shipmentTypes[0];
|
_currentShipmentType = mainModel.setting.shipmentTypes[0];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -93,7 +93,11 @@ class _FcsShipmentEditorState extends State<FcsShipmentEditor> {
|
|||||||
shadowColor: Colors.transparent,
|
shadowColor: Colors.transparent,
|
||||||
leading: new IconButton(
|
leading: new IconButton(
|
||||||
icon: new Icon(CupertinoIcons.back, color: primaryColor),
|
icon: new Icon(CupertinoIcons.back, color: primaryColor),
|
||||||
onPressed: () => Navigator.of(context).pop(),
|
onPressed: () {
|
||||||
|
showConfirmDialog(context, "back.button_confirm", () {
|
||||||
|
Navigator.of(context).pop();
|
||||||
|
});
|
||||||
|
},
|
||||||
),
|
),
|
||||||
backgroundColor: Colors.white,
|
backgroundColor: Colors.white,
|
||||||
title: LocalText(
|
title: LocalText(
|
||||||
|
|||||||
@@ -315,7 +315,11 @@ class _InvoiceEditorState extends State<InvoiceEditor> {
|
|||||||
centerTitle: true,
|
centerTitle: true,
|
||||||
leading: new IconButton(
|
leading: new IconButton(
|
||||||
icon: new Icon(CupertinoIcons.back, color: primaryColor),
|
icon: new Icon(CupertinoIcons.back, color: primaryColor),
|
||||||
onPressed: () => Navigator.of(context).pop(),
|
onPressed: () {
|
||||||
|
showConfirmDialog(context, "back.button_confirm", () {
|
||||||
|
Navigator.of(context).pop();
|
||||||
|
});
|
||||||
|
},
|
||||||
),
|
),
|
||||||
backgroundColor: Colors.white,
|
backgroundColor: Colors.white,
|
||||||
shadowColor: Colors.transparent,
|
shadowColor: Colors.transparent,
|
||||||
|
|||||||
@@ -91,7 +91,11 @@ class _PackageEditorPageState extends State<PackageEditorPage> {
|
|||||||
centerTitle: true,
|
centerTitle: true,
|
||||||
leading: new IconButton(
|
leading: new IconButton(
|
||||||
icon: new Icon(CupertinoIcons.back, color: primaryColor, size: 30),
|
icon: new Icon(CupertinoIcons.back, color: primaryColor, size: 30),
|
||||||
onPressed: () => Navigator.of(context).pop(),
|
onPressed: () {
|
||||||
|
showConfirmDialog(context, "back.button_confirm", () {
|
||||||
|
Navigator.of(context).pop();
|
||||||
|
});
|
||||||
|
},
|
||||||
),
|
),
|
||||||
shadowColor: Colors.transparent,
|
shadowColor: Colors.transparent,
|
||||||
backgroundColor: Colors.white,
|
backgroundColor: Colors.white,
|
||||||
|
|||||||
@@ -60,7 +60,11 @@ class _PaymentMethodEditorState extends State<PaymentMethodEditor> {
|
|||||||
centerTitle: true,
|
centerTitle: true,
|
||||||
leading: new IconButton(
|
leading: new IconButton(
|
||||||
icon: new Icon(CupertinoIcons.back, color: primaryColor),
|
icon: new Icon(CupertinoIcons.back, color: primaryColor),
|
||||||
onPressed: () => Navigator.of(context).pop(),
|
onPressed: () {
|
||||||
|
showConfirmDialog(context, "back.button_confirm", () {
|
||||||
|
Navigator.of(context).pop();
|
||||||
|
});
|
||||||
|
},
|
||||||
),
|
),
|
||||||
title: LocalText(
|
title: LocalText(
|
||||||
context,
|
context,
|
||||||
|
|||||||
@@ -117,7 +117,11 @@ class _ProcessingEditEditorState extends State<ProcessingEditEditor> {
|
|||||||
centerTitle: true,
|
centerTitle: true,
|
||||||
leading: new IconButton(
|
leading: new IconButton(
|
||||||
icon: new Icon(CupertinoIcons.back, color: primaryColor, size: 30),
|
icon: new Icon(CupertinoIcons.back, color: primaryColor, size: 30),
|
||||||
onPressed: () => Navigator.of(context).pop(),
|
onPressed: () {
|
||||||
|
showConfirmDialog(context, "back.button_confirm", () {
|
||||||
|
Navigator.of(context).pop();
|
||||||
|
});
|
||||||
|
},
|
||||||
),
|
),
|
||||||
shadowColor: Colors.transparent,
|
shadowColor: Colors.transparent,
|
||||||
backgroundColor: Colors.white,
|
backgroundColor: Colors.white,
|
||||||
|
|||||||
@@ -171,7 +171,11 @@ class _ProcesingEditorState extends State<ProcesingEditor> {
|
|||||||
leading: new IconButton(
|
leading: new IconButton(
|
||||||
icon:
|
icon:
|
||||||
new Icon(CupertinoIcons.back, color: primaryColor, size: 30),
|
new Icon(CupertinoIcons.back, color: primaryColor, size: 30),
|
||||||
onPressed: () => Navigator.of(context).pop(),
|
onPressed: () {
|
||||||
|
showConfirmDialog(context, "back.button_confirm", () {
|
||||||
|
Navigator.of(context).pop();
|
||||||
|
});
|
||||||
|
},
|
||||||
),
|
),
|
||||||
shadowColor: Colors.transparent,
|
shadowColor: Colors.transparent,
|
||||||
backgroundColor: Colors.white,
|
backgroundColor: Colors.white,
|
||||||
|
|||||||
@@ -59,7 +59,11 @@ class _ProfileCurrencyEditState extends State<ProfileCurrencyEdit> {
|
|||||||
size: 35,
|
size: 35,
|
||||||
color: primaryColor,
|
color: primaryColor,
|
||||||
),
|
),
|
||||||
onPressed: () => Navigator.of(context).pop(),
|
onPressed: () {
|
||||||
|
showConfirmDialog(context, "back.button_confirm", () {
|
||||||
|
Navigator.of(context).pop();
|
||||||
|
});
|
||||||
|
},
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
body: Column(
|
body: Column(
|
||||||
|
|||||||
@@ -74,7 +74,11 @@ class _ProfileEditState extends State<ProfileEdit> {
|
|||||||
size: 35,
|
size: 35,
|
||||||
color: primaryColor,
|
color: primaryColor,
|
||||||
),
|
),
|
||||||
onPressed: () => Navigator.of(context).pop(),
|
onPressed: () {
|
||||||
|
showConfirmDialog(context, "back.button_confirm", () {
|
||||||
|
Navigator.of(context).pop();
|
||||||
|
});
|
||||||
|
},
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
body: Column(
|
body: Column(
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ class _CargoEditorState extends State<CargoEditor> {
|
|||||||
if (widget.cargo != null) {
|
if (widget.cargo != null) {
|
||||||
_cargo = widget.cargo;
|
_cargo = widget.cargo;
|
||||||
_descController.text = _cargo.name;
|
_descController.text = _cargo.name;
|
||||||
_rateController.text = _cargo.rate.toString();
|
_rateController.text = _cargo.rate.toStringAsFixed(2);
|
||||||
} else {
|
} else {
|
||||||
_isNew = true;
|
_isNew = true;
|
||||||
}
|
}
|
||||||
@@ -60,7 +60,11 @@ class _CargoEditorState extends State<CargoEditor> {
|
|||||||
centerTitle: true,
|
centerTitle: true,
|
||||||
leading: new IconButton(
|
leading: new IconButton(
|
||||||
icon: new Icon(CupertinoIcons.back),
|
icon: new Icon(CupertinoIcons.back),
|
||||||
onPressed: () => Navigator.of(context).pop(),
|
onPressed: () {
|
||||||
|
showConfirmDialog(context, "back.button_confirm", () {
|
||||||
|
Navigator.of(context).pop();
|
||||||
|
});
|
||||||
|
},
|
||||||
),
|
),
|
||||||
backgroundColor: primaryColor,
|
backgroundColor: primaryColor,
|
||||||
title: Text(AppTranslations.of(context).text("cargo.form.title")),
|
title: Text(AppTranslations.of(context).text("cargo.form.title")),
|
||||||
|
|||||||
@@ -75,8 +75,8 @@ class _CargoTypeListState extends State<CargoTypeList> {
|
|||||||
)));
|
)));
|
||||||
},
|
},
|
||||||
child: Container(
|
child: Container(
|
||||||
child: _row(cargo.name, "\$ " + cargo.rate.toString(),
|
child: _row(cargo.name,
|
||||||
'per pound'),
|
"\$ " + cargo.rate.toStringAsFixed(2), 'per pound'),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}),
|
}),
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ class _CustomEditorState extends State<CustomEditor> {
|
|||||||
if (widget.custom != null) {
|
if (widget.custom != null) {
|
||||||
_custom = widget.custom;
|
_custom = widget.custom;
|
||||||
_productController.text = _custom.productType;
|
_productController.text = _custom.productType;
|
||||||
_feeController.text = _custom.fee.toString();
|
_feeController.text = _custom.fee.toStringAsFixed(2);
|
||||||
} else {
|
} else {
|
||||||
_isNew = true;
|
_isNew = true;
|
||||||
}
|
}
|
||||||
@@ -63,7 +63,11 @@ class _CustomEditorState extends State<CustomEditor> {
|
|||||||
icon: new Icon(
|
icon: new Icon(
|
||||||
CupertinoIcons.back,
|
CupertinoIcons.back,
|
||||||
),
|
),
|
||||||
onPressed: () => Navigator.of(context).pop(),
|
onPressed: () {
|
||||||
|
showConfirmDialog(context, "back.button_confirm", () {
|
||||||
|
Navigator.of(context).pop();
|
||||||
|
});
|
||||||
|
},
|
||||||
),
|
),
|
||||||
backgroundColor: primaryColor,
|
backgroundColor: primaryColor,
|
||||||
title:
|
title:
|
||||||
|
|||||||
@@ -88,7 +88,7 @@ class _CustomListState extends State<CustomList> {
|
|||||||
},
|
},
|
||||||
child: Container(
|
child: Container(
|
||||||
child: _row(
|
child: _row(
|
||||||
custom.productType, "\$ " + custom.fee.toString()),
|
custom.productType, "\$ " + custom.fee.toStringAsFixed(2)),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}),
|
}),
|
||||||
|
|||||||
@@ -62,7 +62,11 @@ class _DiscountByWeightEditorState extends State<DiscountByWeightEditor> {
|
|||||||
centerTitle: true,
|
centerTitle: true,
|
||||||
leading: new IconButton(
|
leading: new IconButton(
|
||||||
icon: new Icon(CupertinoIcons.back),
|
icon: new Icon(CupertinoIcons.back),
|
||||||
onPressed: () => Navigator.of(context).pop(),
|
onPressed: () {
|
||||||
|
showConfirmDialog(context, "back.button_confirm", () {
|
||||||
|
Navigator.of(context).pop();
|
||||||
|
});
|
||||||
|
},
|
||||||
),
|
),
|
||||||
backgroundColor: primaryColor,
|
backgroundColor: primaryColor,
|
||||||
title: Text(AppTranslations.of(context).text("discount.new")),
|
title: Text(AppTranslations.of(context).text("discount.new")),
|
||||||
|
|||||||
@@ -138,10 +138,12 @@ class _ShipmentRatesState extends State<ShipmentRates> {
|
|||||||
color: Colors.grey,
|
color: Colors.grey,
|
||||||
),
|
),
|
||||||
_row("Free delivery within Yangon \nfor shipments over",
|
_row("Free delivery within Yangon \nfor shipments over",
|
||||||
"${rate.freeDeliveryWeight}", "pounds"),
|
"${rate.freeDeliveryWeight.toStringAsFixed(2)}", "pounds"),
|
||||||
_row("Delivery fees", "\$ ${rate.deliveryFee}",
|
_row("Delivery fees", "\$ ${rate.deliveryFee.toStringAsFixed(2)}",
|
||||||
"below ${rate.freeDeliveryWeight} pounds"),
|
"below ${rate.freeDeliveryWeight.toStringAsFixed(2)} pounds"),
|
||||||
_row("Volumetric Ratio", "${rate.volumetricRatio}",
|
_row(
|
||||||
|
"Volumetric Ratio",
|
||||||
|
"${rate.volumetricRatio.toStringAsFixed(2)}",
|
||||||
"in3 per pound"),
|
"in3 per pound"),
|
||||||
Divider(
|
Divider(
|
||||||
color: Colors.grey,
|
color: Colors.grey,
|
||||||
@@ -179,7 +181,8 @@ class _ShipmentRatesState extends State<ShipmentRates> {
|
|||||||
List<Widget> getCargoWidget(List<CargoType> cargos) {
|
List<Widget> getCargoWidget(List<CargoType> cargos) {
|
||||||
return cargos.map((cargo) {
|
return cargos.map((cargo) {
|
||||||
return Container(
|
return Container(
|
||||||
child: _row(cargo.name, "\$ " + cargo.rate.toString(), 'per pound'),
|
child: _row(
|
||||||
|
cargo.name, "\$ " + cargo.rate.toStringAsFixed(2), 'per pound'),
|
||||||
);
|
);
|
||||||
}).toList();
|
}).toList();
|
||||||
}
|
}
|
||||||
@@ -187,7 +190,7 @@ class _ShipmentRatesState extends State<ShipmentRates> {
|
|||||||
List<Widget> getCustonWidget(List<CustomDuty> customs) {
|
List<Widget> getCustonWidget(List<CustomDuty> customs) {
|
||||||
return customs.map((c) {
|
return customs.map((c) {
|
||||||
return Container(
|
return Container(
|
||||||
child: _row(c.productType, "\$ " + c.fee.toString(), ''),
|
child: _row(c.productType, "\$ " + c.fee.toStringAsFixed(2), ''),
|
||||||
);
|
);
|
||||||
}).toList();
|
}).toList();
|
||||||
}
|
}
|
||||||
@@ -197,7 +200,7 @@ class _ShipmentRatesState extends State<ShipmentRates> {
|
|||||||
return discounts.map((d) {
|
return discounts.map((d) {
|
||||||
return Container(
|
return Container(
|
||||||
child: _row("${d.weight.toStringAsFixed(2)} lb",
|
child: _row("${d.weight.toStringAsFixed(2)} lb",
|
||||||
"\$ " + d.discount.toString(), ''),
|
"\$ " + d.discount.toStringAsFixed(2), ''),
|
||||||
);
|
);
|
||||||
}).toList();
|
}).toList();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ import 'package:fcs/domain/entities/carton.dart';
|
|||||||
import 'package:fcs/domain/entities/cargo_type.dart';
|
import 'package:fcs/domain/entities/cargo_type.dart';
|
||||||
import 'package:fcs/domain/entities/rate.dart';
|
import 'package:fcs/domain/entities/rate.dart';
|
||||||
import 'package:fcs/helpers/theme.dart';
|
import 'package:fcs/helpers/theme.dart';
|
||||||
|
import 'package:fcs/pages/main/util.dart';
|
||||||
import 'package:fcs/pages/rates/model/shipment_rate_model.dart';
|
import 'package:fcs/pages/rates/model/shipment_rate_model.dart';
|
||||||
import 'package:fcs/pages/widgets/display_text.dart';
|
import 'package:fcs/pages/widgets/display_text.dart';
|
||||||
import 'package:fcs/pages/widgets/input_text.dart';
|
import 'package:fcs/pages/widgets/input_text.dart';
|
||||||
@@ -46,7 +47,7 @@ class _ShipmentRatesCalState extends State<ShipmentRatesCal> {
|
|||||||
_lengthController.text = '12';
|
_lengthController.text = '12';
|
||||||
_widthController.text = '12';
|
_widthController.text = '12';
|
||||||
_heightController.text = '12';
|
_heightController.text = '12';
|
||||||
_actualWeightCtl.text = "10";
|
_actualWeightCtl.text = "10.00";
|
||||||
_calShipmentWeight();
|
_calShipmentWeight();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -141,7 +142,11 @@ class _ShipmentRatesCalState extends State<ShipmentRatesCal> {
|
|||||||
centerTitle: true,
|
centerTitle: true,
|
||||||
leading: new IconButton(
|
leading: new IconButton(
|
||||||
icon: new Icon(CupertinoIcons.back, color: primaryColor),
|
icon: new Icon(CupertinoIcons.back, color: primaryColor),
|
||||||
onPressed: () => Navigator.of(context).pop(),
|
onPressed: () {
|
||||||
|
showConfirmDialog(context, "back.button_confirm", () {
|
||||||
|
Navigator.of(context).pop();
|
||||||
|
});
|
||||||
|
},
|
||||||
),
|
),
|
||||||
backgroundColor: Colors.white,
|
backgroundColor: Colors.white,
|
||||||
shadowColor: Colors.transparent,
|
shadowColor: Colors.transparent,
|
||||||
@@ -163,7 +168,7 @@ class _ShipmentRatesCalState extends State<ShipmentRatesCal> {
|
|||||||
LocalText(context, "rate.delivery_fee",
|
LocalText(context, "rate.delivery_fee",
|
||||||
color: primaryColor, fontSize: 16),
|
color: primaryColor, fontSize: 16),
|
||||||
Text(
|
Text(
|
||||||
':\$ $_deliveryFee',
|
':\$ ${_deliveryFee.toStringAsFixed(2)}',
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: primaryColor,
|
color: primaryColor,
|
||||||
fontSize: 16,
|
fontSize: 16,
|
||||||
|
|||||||
@@ -38,8 +38,8 @@ class _ShipmentRatesEditState extends State<ShipmentRatesEdit> {
|
|||||||
Rate rate = shipmentRateModel.rate;
|
Rate rate = shipmentRateModel.rate;
|
||||||
|
|
||||||
_minWeight.text = rate.freeDeliveryWeight?.toStringAsFixed(2) ?? "";
|
_minWeight.text = rate.freeDeliveryWeight?.toStringAsFixed(2) ?? "";
|
||||||
_deliveryFee.text = rate.deliveryFee?.toString() ?? "";
|
_deliveryFee.text = rate.deliveryFee?.toStringAsFixed(2) ?? "";
|
||||||
_volumetricRatio.text = rate.volumetricRatio?.toString() ?? "";
|
_volumetricRatio.text = rate.volumetricRatio?.toStringAsFixed(2) ?? "";
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@@ -73,7 +73,11 @@ class _ShipmentRatesEditState extends State<ShipmentRatesEdit> {
|
|||||||
icon: new Icon(
|
icon: new Icon(
|
||||||
CupertinoIcons.back,
|
CupertinoIcons.back,
|
||||||
),
|
),
|
||||||
onPressed: () => Navigator.of(context).pop(),
|
onPressed: () {
|
||||||
|
showConfirmDialog(context, "back.button_confirm", () {
|
||||||
|
Navigator.of(context).pop();
|
||||||
|
});
|
||||||
|
},
|
||||||
),
|
),
|
||||||
backgroundColor: primaryColor,
|
backgroundColor: primaryColor,
|
||||||
title: Text(AppTranslations.of(context).text("rate.edit.title")),
|
title: Text(AppTranslations.of(context).text("rate.edit.title")),
|
||||||
|
|||||||
@@ -149,7 +149,11 @@ class _ReceivingEditorState extends State<ReceivingEditor> {
|
|||||||
leading: new IconButton(
|
leading: new IconButton(
|
||||||
icon:
|
icon:
|
||||||
new Icon(CupertinoIcons.back, color: primaryColor, size: 30),
|
new Icon(CupertinoIcons.back, color: primaryColor, size: 30),
|
||||||
onPressed: () => Navigator.of(context).pop(),
|
onPressed: () {
|
||||||
|
showConfirmDialog(context, "back.button_confirm", () {
|
||||||
|
Navigator.of(context).pop();
|
||||||
|
});
|
||||||
|
},
|
||||||
),
|
),
|
||||||
shadowColor: Colors.transparent,
|
shadowColor: Colors.transparent,
|
||||||
backgroundColor: Colors.white,
|
backgroundColor: Colors.white,
|
||||||
|
|||||||
@@ -165,7 +165,11 @@ class _ShipmentEditorState extends State<ShipmentEditor> {
|
|||||||
CupertinoIcons.back,
|
CupertinoIcons.back,
|
||||||
color: primaryColor,
|
color: primaryColor,
|
||||||
),
|
),
|
||||||
onPressed: () => Navigator.of(context).pop(),
|
onPressed: () {
|
||||||
|
showConfirmDialog(context, "back.button_confirm", () {
|
||||||
|
Navigator.of(context).pop();
|
||||||
|
});
|
||||||
|
},
|
||||||
),
|
),
|
||||||
shadowColor: Colors.transparent,
|
shadowColor: Colors.transparent,
|
||||||
backgroundColor: Colors.white,
|
backgroundColor: Colors.white,
|
||||||
|
|||||||
@@ -171,10 +171,13 @@ class _StaffEditorState extends State<StaffEditor> {
|
|||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
centerTitle: true,
|
centerTitle: true,
|
||||||
leading: new IconButton(
|
leading: new IconButton(
|
||||||
icon:
|
icon: new Icon(CupertinoIcons.back,
|
||||||
new Icon(CupertinoIcons.back, color: primaryColor, size: 30),
|
color: primaryColor, size: 30),
|
||||||
onPressed: () => Navigator.of(context).pop(),
|
onPressed: () {
|
||||||
),
|
showConfirmDialog(context, "back.button_confirm", () {
|
||||||
|
Navigator.of(context).pop();
|
||||||
|
});
|
||||||
|
}),
|
||||||
shadowColor: Colors.transparent,
|
shadowColor: Colors.transparent,
|
||||||
backgroundColor: Colors.white,
|
backgroundColor: Colors.white,
|
||||||
title: LocalText(
|
title: LocalText(
|
||||||
|
|||||||
@@ -76,7 +76,11 @@ class _TermEditState extends State<TermEdit> {
|
|||||||
color: primaryColor,
|
color: primaryColor,
|
||||||
size: 30,
|
size: 30,
|
||||||
),
|
),
|
||||||
onPressed: () => Navigator.of(context).pop(),
|
onPressed: () {
|
||||||
|
showConfirmDialog(context, "back.button_confirm", () {
|
||||||
|
Navigator.of(context).pop();
|
||||||
|
});
|
||||||
|
},
|
||||||
),
|
),
|
||||||
shadowColor: Colors.transparent,
|
shadowColor: Colors.transparent,
|
||||||
backgroundColor: Colors.white,
|
backgroundColor: Colors.white,
|
||||||
|
|||||||
Reference in New Issue
Block a user