add FCS UI

This commit is contained in:
Thinzar Win
2020-12-01 19:02:21 +06:30
parent a2c9e41f55
commit 230e6f9e66
24 changed files with 2121 additions and 245 deletions

View File

@@ -59,6 +59,9 @@ class _FcsShipmentEditorState extends State<FcsShipmentEditor> {
_consigneeController.text = _shipment.consignee;
_portController.text = _shipment.port;
_destinationController.text = _shipment.destination;
}else{
var mainModel = Provider.of<MainModel>(context,listen: false);
_currentShipmentType =mainModel.setting.shipmentTypes[0];
}
}
@@ -113,11 +116,11 @@ class _FcsShipmentEditorState extends State<FcsShipmentEditor> {
iconData: Icons.date_range,
controller: _cutoffDateController,
),
InputDate(
labelTextKey: "FCSshipment.departure_date",
iconData: Icons.date_range,
controller: _departureDateControler,
),
// InputDate(
// labelTextKey: "FCSshipment.departure_date",
// iconData: Icons.date_range,
// controller: _departureDateControler,
// ),
InputDate(
labelTextKey: "FCSshipment.ETA",
iconData: Icons.date_range,
@@ -184,13 +187,13 @@ class _FcsShipmentEditorState extends State<FcsShipmentEditor> {
try {
var cutoffDate = _cutoffDateController.text;
var arrivalDate = _arrivalDateController.text;
var depDate = _departureDateControler.text;
// var depDate = _departureDateControler.text;
fcsShipment.cutoffDate =
cutoffDate == "" ? null : dateFormatter.parse(cutoffDate);
fcsShipment.arrivalDate =
arrivalDate == "" ? null : dateFormatter.parse(arrivalDate);
fcsShipment.departureDate =
depDate == "" ? null : dateFormatter.parse(depDate);
// fcsShipment.departureDate =
// depDate == "" ? null : dateFormatter.parse(depDate);
} catch (e) {
showMsgDialog(context, "Error", e.toString()); // shold never happen
}
@@ -214,10 +217,10 @@ class _FcsShipmentEditorState extends State<FcsShipmentEditor> {
await showMsgDialog(context, "Error", "Invalid ETA date!");
return false;
}
if (fcsShipment.departureDate == null) {
await showMsgDialog(context, "Error", "Invalid departure date!");
return false;
}
// if (fcsShipment.departureDate == null) {
// await showMsgDialog(context, "Error", "Invalid departure date!");
// return false;
// }
return true;
}