diff --git a/assets/local/localization_en.json b/assets/local/localization_en.json index 1e70412..da7bde5 100644 --- a/assets/local/localization_en.json +++ b/assets/local/localization_en.json @@ -339,8 +339,10 @@ "FCSshipment.cargo_manifest":"Download cargo manifest", "FCSshipment.create":"Create new shipment", "FCSshipment.update":"Update shipment", - "FCSshipment.ship.btn":"Ship", + "FCSshipment.ship.btn":"Ship this shipment", "FCSshipment.ship.confirm":"Confirm ship?", + "FCSshipment.cancel.btn":"Cancel this shipment", + "FCSshipment.cancel.confirm":"Cancel this shipment?", "FCSshipment.popupmenu.all":"All shipments", "FCSshipment.popupmenu.active":"Active shipments", "FCSshipment.popupmenu.shipped":"Shipped shipments", diff --git a/assets/local/localization_mu.json b/assets/local/localization_mu.json index 4c05a45..cd7111f 100644 --- a/assets/local/localization_mu.json +++ b/assets/local/localization_mu.json @@ -338,8 +338,10 @@ "FCSshipment.cargo_manifest":"ကုန်ပစ္စည်းကိုဒေါင်းမည်", "FCSshipment.create":"တင်ပို့ခြင်းအသစ်ပြုလုပ်မည်", "FCSshipment.update":"တင်ပို့ခြင်းပြုပြင်မည်", - "FCSshipment.ship.btn":"Ship", + "FCSshipment.ship.btn":"Ship this shipment", "FCSshipment.ship.confirm":"Confirm ship?", + "FCSshipment.cancel.btn":"Cancel this shipment", + "FCSshipment.cancel.confirm":"Cancel this shipment?", "FCSshipment.popupmenu.all":"All shipments", "FCSshipment.popupmenu.active":"Active shipments", "FCSshipment.popupmenu.shipped":"Shipped shipments", diff --git a/lib/helpers/theme.dart b/lib/helpers/theme.dart index 0db1578..a3104b2 100644 --- a/lib/helpers/theme.dart +++ b/lib/helpers/theme.dart @@ -8,6 +8,7 @@ const buttonColor = const Color(0xFFFFFFFF); const buttonBkColor = const Color(0xFF268944); const labelColor = const Color(0xFF757575); var dividerColor = Colors.grey.shade400; +const dangerColor= const Color(0xffff0606); const TextStyle labelStyle = TextStyle(fontSize: 20, color: labelColor, fontWeight: FontWeight.w500); diff --git a/lib/pages/fcs_shipment/fcs_shipment_info.dart b/lib/pages/fcs_shipment/fcs_shipment_info.dart index 8faa94e..356e3f5 100644 --- a/lib/pages/fcs_shipment/fcs_shipment_info.dart +++ b/lib/pages/fcs_shipment/fcs_shipment_info.dart @@ -73,11 +73,6 @@ class _FcsShipmentInfoState extends State { @override Widget build(BuildContext context) { - // final shipmentNumberBox = DisplayText( - // text: _shipmentNumberController.text, - // labelTextKey: "FCSshipment.number", - // iconData: Ionicons.ios_airplane, - // ); final cutoffDateDBox = DisplayText( text: _cutoffDateController.text, labelTextKey: "FCSshipment.cutoff_date", @@ -99,12 +94,6 @@ class _FcsShipmentInfoState extends State { iconData: Octicons.package, ); - // final departureDateBox = DisplayText( - // text: _departureDateControler.text, - // labelTextKey: "FCSshipment.departure_date", - // iconData: Icons.date_range, - // ); - final shipTypeBox = DisplayText( text: _shipmentTypeControler.text, labelTextKey: "FCSshipment.shipment_type", @@ -132,19 +121,34 @@ class _FcsShipmentInfoState extends State { final statusBox = DisplayText( text: _statusController.text, labelTextKey: "FCSshipment.status", - iconData: Ionicons.md_chevron_back_circle_outline, + iconData: Feather.clock, ); - final shipBtn = LocalButton( - textKey: "FCSshipment.ship.btn", - callBack: _ship, + final shipBtn = Padding( + padding: const EdgeInsets.symmetric(horizontal: 30), + child: LocalButton( + textKey: "FCSshipment.ship.btn", + callBack: _ship, + ), + ); + + final cancelBtn = Padding( + padding: const EdgeInsets.symmetric(horizontal: 30), + child: LocalButton( + color: dangerColor, + textKey: "FCSshipment.cancel.btn", + callBack: () { + showConfirmDialog(context, "FCSshipment.cancel.confirm", () {}); + }, + ), ); return LocalProgress( inAsyncCall: _isLoading, child: Scaffold( appBar: LocalAppBar( - titleWidget: Text(_shipmentNumberController.text,style:TextStyle(fontSize: 20,color: primaryColor)), + titleWidget: Text(_shipmentNumberController.text, + style: TextStyle(fontSize: 20, color: primaryColor)), backgroundColor: Colors.white, labelColor: primaryColor, arrowColor: primaryColor, @@ -156,60 +160,46 @@ class _FcsShipmentInfoState extends State { //menuPopWidget(context) ], ), - // appBar: AppBar( - // centerTitle: true, - // leading: new IconButton( - // icon: new Icon(CupertinoIcons.back, color: primaryColor, size: 30), - // onPressed: () => Navigator.of(context).pop(), - // ), - // shadowColor: Colors.transparent, - // backgroundColor: Colors.white, - // title: LocalText( - // context, - // "FCSshipment.form.title", - // fontSize: 20, - // color: primaryColor, - // ), - // actions: [ - // IconButton( - // icon: Icon(Icons.edit, color: primaryColor), - // onPressed: _edit, - // ), - // menuPopWidget(context) - // ], - // ), body: Card( elevation: 0, - child: Column( - children: [ - Expanded( - child: Padding( - padding: const EdgeInsets.all(10.0), - child: ListView(children: [ - //shipmentNumberBox, - statusBox, - Row(mainAxisAlignment: MainAxisAlignment.end, - children:[Expanded(child: cutoffDateDBox,flex: 2,), - Expanded(child: etaBox,), - ]), - // departureDateBox, - Row(children: [ Expanded(child: cartonBox,flex: 2,), - Flexible(child: packageBox),],), - - shipTypeBox, - consigneeBox, - portBox, - destinationBox, - - _fcsShipment?.status == fcs_shipment_confirmed_status - ? shipBtn - : Container(), - SizedBox( - height: 20, - ) - ]), - )), - ], + child: Padding( + padding: const EdgeInsets.all(10.0), + child: ListView(children: [ + statusBox, + Row(mainAxisAlignment: MainAxisAlignment.end, children: [ + Expanded( + child: cutoffDateDBox, + flex: 2, + ), + Flexible( + child: etaBox, + ), + ]), + Row( + children: [ + Expanded( + child: cartonBox, + flex: 2, + ), + Flexible(child: packageBox), + ], + ), + shipTypeBox, + consigneeBox, + portBox, + destinationBox, + const SizedBox(height: 30), + _fcsShipment?.status == fcs_shipment_confirmed_status + ? shipBtn + : Container(), + _fcsShipment?.status == fcs_shipment_confirmed_status + ? Container( + padding: EdgeInsets.only(top: 3), child: cancelBtn) + : Container(), + SizedBox( + height: 20, + ) + ]), ), ), ),