diff --git a/assets/local/localization_en.json b/assets/local/localization_en.json index fd0f4b6..597a403 100644 --- a/assets/local/localization_en.json +++ b/assets/local/localization_en.json @@ -32,7 +32,7 @@ "contact.btn":"Contact Us", "contact.title":"Contact Us", "contact.phone.title":"Input Phone Number", - "contact.phone":"Phone Number", + "contact.phone":"Phone number", "contact.phone.confim":"Call {0}?", "contact.phone.empty":"Please enter phone number", "contact.email":"Email", @@ -44,18 +44,18 @@ "contact.google.empty":"Please enter website url", "contact.confrim":"Confirm update contact?", "contact.open.confrim":"Open '{0}'?", - "contact.bank.accounts":"Bank Accounts Info", + "contact.bank.accounts":"Bank accounts info", "contact.address":"Address", - "contact.usa.address":"USA Address", - "contact.mm.address":"Myanmar Address", - "contact.delivery.phone":"Delivery Phone", - "contact.fcs.email":"FCS Email", - "contact.callus":"Call Us", - "contact.findus":"Find Us", - "contact.emailus":"Email Us", - "contact.visitus":"Visit Us", - "contact.usa.phone": "USA Phone", - "contact.mm.phone": "Myanmar Phone", + "contact.usa.address":"USA address", + "contact.mm.address":"Myanmar address", + "contact.delivery.phone":"Delivery phone", + "contact.fcs.email":"FCS email", + "contact.callus":"Call us", + "contact.findus":"Find us", + "contact.emailus":"Email us", + "contact.visitus":"Visit us", + "contact.usa.phone": "USA phone", + "contact.mm.phone": "Myanmar phone", "contact.edit.title":"Edit Contact Us", "Contact End ================================================================":"", @@ -87,9 +87,9 @@ "faq.edit.answer":"Answer", "faq.edit.sn":"S/N", "faq.edit.delete.confirm":"Delete this FAQ?", - "faq.edit.page":"Additional Page", - "faq.edit.page.label.eng":"Page label in English", - "faq.edit.page.label.mm":"Page label in Myanmar", + "faq.edit.page":"Additional page", + "faq.edit.page.label.eng":"Page label in english", + "faq.edit.page.label.mm":"Page label in myanmar", "FAQ End ================================================================":"", "Home Start ================================================================":"", @@ -101,7 +101,7 @@ "Invite Start ================================================================":"", "invite.title":"You need invitation from FCS", "invite.name.enter":"Please enter your name", - "invite.request":"Request Invitation", + "invite.request":"Request invitation", "invite.request.successful":"Successfully requested!", "invite.btn":"Invite", "Invite End ================================================================":"", @@ -119,23 +119,24 @@ "customers.btn": "Customers", "customer.list.title":"Customers", "customer.name":"Name", - "customer.phone":"Phone Number", + "customer.phone":"Phone number", "customer.status":"Status", "customer.fcs.id":"FCS ID", - "customer.invitation.request.confirm":"Accept Customer", + "customer.invitation.request.confirm":"Accept customer", "Customer End ================================================================":"", "Invitation Start ================================================================":"", "invitation.list": "Invitations", "invitation.edit": "Invitation", - "invitation.new": "New Invitation", + "invitation.new": "New invitation", + "invitation.form.title":"New Invitation", "invitation.confirm.delete": "Delete this invitation?", "Invitation End ================================================================":"", "Staff Start ================================================================":"", "staff.title":"Staffs", "staff.list.title":"Staffs", - "staff.new":"New Staff", + "staff.new":"New staff", "staff.form.title":"Staff", "staff.add":"Add", "staff.update":"Update", @@ -150,22 +151,22 @@ "profile.phone": "Phone", "profile.language": "Languages", "profile.logout": "logout", - "profile.currency":"Preferred Currency", - "profile.usa.shipping.address": "USA Shipping Address", + "profile.currency":"Preferred currency", + "profile.usa.shipping.address": "USA shipping address", "profile.logout.confirm":"Are you sure want to logout?", "profile.devices":"Devices", "profile.email":"Email", "profile.privileges":"Privileges", - "profile.default.delivery.address":"Default Delivery Address", + "profile.default.delivery.address":"Default delivery address", "Profile End ================================================================":"", "Package Start ================================================================":"", "package.btn.name":"Track Packages", "package.title":"Packages", - "package.create.title":"New Packages", + "package.create.title":"New packages", "package.create.fcs.id":"FCS ID", - "package.create.name":"Customer Name", - "package.create.phone":"Phone Number", + "package.create.name":"Customer name", + "package.create.phone":"Phone number", "package.tracking.id":"Tracking ID", "package.create.packages":"Complete receiving", "package.create.market":"Market", @@ -177,97 +178,100 @@ "package.edit.complete.process.btn":"Complete processing", "package.edit.procseeing":"Processing", "package.info.title":"Package", - "package.arrival.date":"Arrival Date", - "package.number":"Box Number", + "package.arrival.date":"Arrival date", + "package.number":"Carton number", "package.rate":"Rate", "package.weight":"Weight", "package.amount":"Amount", - "package.delivery.address":"Delivery Address", + "package.delivery.address":"Delivery address", "package.popupmenu.active":"Active Packages", "package.popupmenu.delivered":"Delivered Packages", "Package End ================================================================":"", "Market Start ================================================================":"", "market.edit.title":"Markets", - "market.edit.name":"Market Name", + "market.edit.name":"Market name", "market.remove.confirm":"Remove this market?", "Market End ================================================================":"", "Buy_Online Start ================================================================":"", "buy_online.title":"Buying instructions", - "buy_online":"Buying Instructions", + "buy_online":"Buying instructions", "buy_online.buying_instruction":"See below instructions to add USA shipping address while shoping online", - "buy_online.fullname":"With Full Name", - "buy_online.first.last":"With First Name and Last Name", + "buy_online.fullname":"With full name", + "buy_online.first.last":"With first name and last name", "Buy_Online End ================================================================":"", "Payment Start ================================================================":"", "pm.title":"Payment Methods", - "pm.new":"New Payment Method", + "pm.new":"New payment method", + "pm.form.new":"New Payment Method", "pm.update":"Update Payment Method", - "pm.btn":"Payment Methods", + "pm.btn":"Payment methods", "pm.name":"Name", - "pm.account.name":"Account Name", - "pm.account.no":"Account Number", - "pm.phone":"Phone Number", - "pm.email":"Email Address", + "pm.account.name":"Account name", + "pm.account.no":"Account number", + "pm.phone":"Phone number", + "pm.email":"Email address", "pm.link":"Link", - "pm.add.btn":"Add Payment Method", - "pm.save.btn":"Save Payment Method", - "pm.delete.confirm":"Delete this Payment Method?", + "pm.add.btn":"Add payment method", + "pm.save.btn":"Save payment method", + "pm.delete.confirm":"Delete this payment method?", "pm_.title": "PAYMENT", "pm.date": "Date", "pm.amount": "Amount", - "pm.receipt":"Payment Receipt Amount", - "pm.attachment":"Payment Attachment", - "pm.remaining_balance":"Remaining Balance : ", + "pm.receipt":"Payment receipt amount", + "pm.attachment":"Payment attachment", + "pm.remaining_balance":"Remaining balance : ", "pm.total.amount": "Amount :", "Payment End ================================================================":"", "Message Start ================================================================":"", "message.btn":"Notifications", - "message.view.detail":"View Deatil", + "message.view.detail":"View deatil", "message.hint.input":"Type your message...", "Message End ================================================================":"", "Boxes Start ================================================================":"", - "boxes.name":"Boxes", - "boxes.title":"Boxes", - "boxes.new":"New Box", - "box.edit.title":"Edit Box", + "boxes.name":"Cartons", + "boxes.title":"Cartons", + "boxes.new":"New carton", + "boxes.create.title":"New Carton", + "box.edit.title":"Edit Carton", "box.package.id":"Package ID", "box.package.desc":"Description", "box.package.market":"Market", - "box.add_package":"Add Package", - "box.number":"Box Number", + "box.add_package":"Add package", + "box.number":"Box number", "box.length":"Length", "box.width":"Width", "box.height":"Height", - "box.shipment_info":"Shipment Information", - "box.cargo_type":"Cargo Types", - "box.dimension":"Box Dimension", - "box.delivery_address":"Delivery Address", - "box.fcs_shipment_num":"FCS Shipment Number", + "box.shipment_info":"Shipment information", + "box.cargo_type":"Cargo types", + "box.dimension":"Carton dimension", + "box.delivery_address":"Delivery address", + "box.fcs_shipment_num":"FCS shipment number", "box.fcs.id":"FCS ID", - "box.name":"Customer Name", - "box.phone":"Phone Number", - "box.actual_weight":"Actual Weight", - "box.add_cargo":"Add Cargo", - "box.shipment_weight":"Shipment Weight", - "box.change_address":"Change\nAddress", + "box.name":"Customer name", + "box.phone":"Phone number", + "box.actual_weight":"Actual weight", + "box.add_cargo":"Add cargo", + "box.shipment_weight":"Shipment weight", + "box.change_address":"Change\naddress", "box.status":"Status", - "box.create.btn":"Create New Box", + "box.create.btn":"Create new carton", "box.complete.btn":"Complete packing", "box.deliver.btn":"Deliver", "box.packages":"Packages", "box.tracking.id":"Tracking ID", "box.market":"Market", "box.cargo.save.btn":"Save", + "box.type.title":"Carton Types", "Boxes End ================================================================":"", "Delivery Start ================================================================":"", "delivery.title":"Deliveries", - "delivery":"DELIVERIES", + "delivery":"Deliveries", "Delivery End ================================================================":"", "FCS Shipment Start ================================================================":"", @@ -275,22 +279,22 @@ "FCSshipment.list.title":"FCS Shipments", "FCSshipment.add":"New FCS shipment", "FCSshipment.form.title":"FCS Shipment", - "FCSshipment.number":"FCS Shipment Number", - "FCSshipment.cutoff_date":"Cutoff Date", + "FCSshipment.number":"FCS shipment number", + "FCSshipment.cutoff_date":"Cutoff date", "FCSshipment.ETA":"ETA", - "FCSshipment.departure_date":"Departure Date", - "FCSshipment.shipment_type":"Shipment Type", + "FCSshipment.departure_date":"Departure date", + "FCSshipment.shipment_type":"Shipment type", "FCSshipment.consignee":"Consignee", - "FCSshipment.port_of_loading":"Port of Loading", - "FCSshipment.final_destination":"Final Destination", + "FCSshipment.port_of_loading":"Port of loading", + "FCSshipment.final_destination":"Final destination", "FCSshipment.status":"Status", "FCSshipment.remark":"Remark", - "FCSshipment.commercial_invoice":"Download Commercial Invoice", - "FCSshipment.packing_list":"Download Packing List", + "FCSshipment.commercial_invoice":"Download commercial invoice", + "FCSshipment.packing_list":"Download packing list", "FCSshipment.dms":"Download DMS", - "FCSshipment.cargo_manifest":"Download Cargo Manifest", - "FCSshipment.create":"Create FCS Shipment", - "FCSshipment.update":"Update FCS Shipment", + "FCSshipment.cargo_manifest":"Download cargo manifest", + "FCSshipment.create":"Create FCS shipment", + "FCSshipment.update":"Update FCS shipment", "FCS Shipment End ================================================================":"", "Shipment Start ================================================================":"", @@ -306,38 +310,38 @@ "shipment.location": "Pickup address", "shipment.location_time": "Pickup Location / Time", "shipment.information": "Pickup information", - "shipment.recipient_information": "Recipient Informations", + "shipment.recipient_information": "Recipient informations", "shipment.from":"Ready time", "shipment.to":"Latest time available", - "shipment.box.delivery":"Delivery Address", - "shipment.handling.fee":"Handling Fee/Courier Fee", - "shipment.box.cargo.type":"Cargo Types", + "shipment.box.delivery":"Delivery address", + "shipment.handling.fee":"Handling fee/Courier fee", + "shipment.box.cargo.type":"Cargo types", "shipment.box.dimemsion":"Dimension", "shipment.box.shipment.weight":"Shipment weight", "shipment.box.length":"Length", "shipment.box.width":"Width", "shipment.box.height":"Height", - "shipment.box.add":"Add Box", + "shipment.box.add":"Add carton", "Shipment End ================================================================":"", "Rate Start ================================================================":"", "rate":"Rates", - "rate.title":"RATES", - "rate.edit.title":"EDIT RATES", - "rate.cal.title":"ESTIMATE SHIPPING COST", - "rate.min_weight":"Min Weight for Free delivery within Yangon", + "rate.title":"Rates", + "rate.edit.title":"Edit rates", + "rate.cal.title":"Estimate Shipping Cost", + "rate.min_weight":"Min weight for free delivery within yangon", "rate.delivery_fee":"Delivery fees", - "rate.volumetric_ratio":"Volumetric Ratio", + "rate.volumetric_ratio":"Volumetric ratio", "rate.custom.form.title":"CUSTOM", - "rate.cutom.product_type":"Product Type", + "rate.cutom.product_type":"Product type", "rate.custom.fee":"Fee", "rate.discount.weight":"Weight", - "rate.discount.rate":"Discount Rate", + "rate.discount.rate":"Discount rate", "Rate End ================================================================":"", "Cargo Start ================================================================":"", "cargo.form.title":"Cargo", - "cargo.type":"Cargo Type", + "cargo.type":"Cargo type", "cargo.weight":"Weight", "cargo.rate":"Rate", "cargo.amount":"Amount", @@ -346,34 +350,34 @@ "Invoices Start ================================================================":"", "invoices.btn": "Invoices", "invoices.title": "INVOICES", - "invoices.add":"New Invoice", + "invoices.add":"New invoice", "invoice.form.title":"INVOICE", - "invoice.payment":"Payment Receipt", - "invoice.add_box":"Add Box", - "invoice.add_package":"Add Package", - "invoice.date":"Invoice Date", - "invoice.number":"Invoice Number", - "invoice.customer_name":"Customer Name", + "invoice.payment":"Payment receipt", + "invoice.add_box":"Add carton", + "invoice.add_package":"Add package", + "invoice.date":"Invoice date", + "invoice.number":"Invoice number", + "invoice.customer_name":"Customer name", "invoice.status":"Status", "invoice.amount":"Amount", - "invoice.total":"Total Amount", + "invoice.total":"Total amount", "invoice.balance":"Balance", - "invoice.handling_fee":"Handling Fee", - "invoice.custom_fee":"Custom Fee", - "invoice.custom_fee_desc":"Custom Fee Description", - "invoice.discount":"Discount Code", - "invoice.payment_method":"Payment Method", - "invoice.delivery_fee":"Delivery Fee : ", - "invoice.payment_attachment":"Payment Attachment", - "invoice.box_info":"Box Information", - "invoice.cargo_table":"Cargo Table", - "invoice.btn_create":"Create Invoice", - "invoice.btn_save":"Save Invoice", - "invoice.btn_payment_receipt":"Attachment Payment Receipt", + "invoice.handling_fee":"Handling fee", + "invoice.custom_fee":"Custom fee", + "invoice.custom_fee_desc":"Custom fee description", + "invoice.discount":"Discount code", + "invoice.payment_method":"Payment method", + "invoice.delivery_fee":"Delivery fee : ", + "invoice.payment_attachment":"Payment attachment", + "invoice.box_info":"Carton information", + "invoice.cargo_table":"Cargo table", + "invoice.btn_create":"Create invoice", + "invoice.btn_save":"Save invoice", + "invoice.btn_payment_receipt":"Attachment payment receipt", "invoice.description": "Description", - "invoice.box.cargo_type": "Cargo Types", - "invoice.cargo_type":"Cargo Types", - "invoice.box.number":"Box number", + "invoice.box.cargo_type": "Cargo types", + "invoice.cargo_type":"Cargo types", + "invoice.box.number":"Carton number", "invoice.box.length":"Length", "invoice.box.width":"Width", "invoice.boc.height":"Height", @@ -383,11 +387,11 @@ "Discount Start ================================================================":"", "discount.btn":"Discounts", - "discount.title":"DISCOUNTS", - "discount.new":"New Discount", - "discount.form":"DISCOUNT", + "discount.title":"Discounts", + "discount.new":"New discount", + "discount.form":"Discount", "discount.code":"Code", - "discount.name":"Customer Name", + "discount.name":"Customer name", "discount.amount":"Amount", "discount.status":"Status", "Discount End ================================================================":"", @@ -395,30 +399,31 @@ "delivery_addresses Start ================================================================":"", "delivery_addresses": "Delivery Addresses", "delivery_address": "Delivery Address", - "delivery_address.full_name": "Full Name", - "delivery_address.address_line1": "Address Line 1", - "delivery_address.address_line2": "Address Line 2", + "delivery_address.full_name": "Full name", + "delivery_address.address_line1": "Address line 1", + "delivery_address.address_line2": "Address line 2", "delivery_address.state_region": "State/Region", "delivery_address.city": "City", "delivery_address.country": "Country", - "delivery_address.phonenumber": "Phone Number", - "delivery_address.create": "Create Delivery Address", - "delivery_address.update": "Update Delivery Address", - "delivery_address.new_address":"Add New\nAddress", - "delivery_address.change_address": "Change Address", - "delivery_address.delete.confirm":"Delete this Delivery Address?", + "delivery_address.phonenumber": "Phone number", + "delivery_address.create": "Create delivery address", + "delivery_address.update": "Update delivery address", + "delivery_address.new_address":"Add new\naddress", + "delivery_address.change_address": "Change address", + "delivery_address.delete.confirm":"Delete this delivery address?", "delivery_addresses End ================================================================":"", "Receiving Start ================================================================":"", "receiving.title":"Receivings", "receiving.info":"Receiving", - "receiving.new":"New Receiving", + "receiving.new":"New receiving", + "receiving.create":"New Receiving", "receiving.update":"Update Reveiving", "receiving.tracking.id":"Tracking ID", "receiving.remark":"Remark", "receiving.fcs.id":"FCS ID", - "receiving.name":"Customer Name", - "receiving.phone":"Phone Number", + "receiving.name":"Customer name", + "receiving.phone":"Phone number", "receiving.create_btn":"Complete receiving", "receiving.update_btn":"Update reveiving", "receiving.delete.confirm":"Delete this receiving?", @@ -428,8 +433,8 @@ "processing.title":"Processing", "processing.info.title":"Processing", "processing.tracking.id":"Tracking ID", - "processing.name":"Customer Name", - "processing.phone":"Phone Number", + "processing.name":"Customer name", + "processing.phone":"Phone number", "processing.fcs.id":"FCS ID", "processing.market":"Market", "processing.status":"Status", diff --git a/assets/local/localization_mu.json b/assets/local/localization_mu.json index 8c17fb8..f0c8617 100644 --- a/assets/local/localization_mu.json +++ b/assets/local/localization_mu.json @@ -129,6 +129,7 @@ "invitation.list": "ဖိတ်ကြားမှုများ", "invitation.edit": "ဖိတ်ကြားမှု", "invitation.new": "ဖိတ်ကြားမှု အသစ်", + "invitation.form.title":"ဖိတ်ကြားမှု အသစ်", "invitation.confirm.delete": "ဖိတ်ကြားမှု ဖျက်မလား?", "Invitation End ================================================================":"", @@ -204,6 +205,7 @@ "Payment Start ================================================================":"", "pm.title":"ငွေပေးချေစနစ်များ", "pm.new":"ငွေပေးချေစနစ် အသစ်", + "pm.form.new":"ငွေပေးချေစနစ် အသစ်", "pm.update":"ငွေပေးချေစနစ် ပြင်ဆင်ခြင်း", "pm.btn":"ငွေပေးချေစနစ်များ", "pm.name":"အမည်", @@ -234,6 +236,7 @@ "boxes.name":"သေတ္တာများ", "boxes.title":"Boxes", "boxes.new":"သေတ္တာ အသစ်", + "boxes.create.title":"သေတ္တာ အသစ်", "box.edit.title":"သေတ္တာ ပြင်ဆင်ခြင်း", "box.package.id":"Package ID", "box.package.desc":"Description", @@ -263,6 +266,7 @@ "box.tracking.id":"Tracking ID", "box.market":"အွန်လိုင်စျေးဆိုင်", "box.cargo.save.btn":"သိမ်းဆည်းမည်", + "box.type.title":"သေတ္တာအမျိုးအစားများ", "Boxes End ================================================================":"", "Delivery Start ================================================================":"", @@ -413,6 +417,7 @@ "receiving.title":"လက်ခံခြင်းများ", "receiving.info":"လက်ခံခြင်း", "receiving.new":"လက်ခံခြင်း အသစ်", + "receiving.create":"လက်ခံခြင်း အသစ်", "receiving.update":"လက်ခံခြင်း ပြင်ဆင်ခြင်း", "receiving.tracking.id":"Tracking ID", "receiving.remark":"မှတ်ချက်", diff --git a/lib/domain/constants.dart b/lib/domain/constants.dart index a8d83ca..185d202 100644 --- a/lib/domain/constants.dart +++ b/lib/domain/constants.dart @@ -50,7 +50,12 @@ const privilege_processing = "pr"; const privilege_receiving = "rc"; // Pickup types -const shipment_local_pickup = "Local Pickup"; -const shipment_courier_pickup = "Courier Pickup"; -const shipment_local_dropoff = "Local Drop-off"; -const shipment_courier_dropoff = "Courier Drop-off"; +const shipment_local_pickup = "Local pickup"; +const shipment_courier_pickup = "Courier pickup"; +const shipment_local_dropoff = "Local drop-off"; +const shipment_courier_dropoff = "Courier drop-off"; + +//Carton types +const carton_from_packages = "From packages"; +const carton_from_shipments = "From shipments"; +const carton_mix_box = "Mix box"; diff --git a/lib/pages/box/box_editor.dart b/lib/pages/box/box_editor.dart index 4761a54..1f652a4 100644 --- a/lib/pages/box/box_editor.dart +++ b/lib/pages/box/box_editor.dart @@ -19,7 +19,9 @@ import 'package:fcs/pages/widgets/delivery_address_selection.dart'; import 'package:fcs/pages/widgets/display_text.dart'; import 'package:fcs/pages/widgets/fcs_id_icon.dart'; import 'package:fcs/pages/widgets/input_text.dart'; +import 'package:fcs/pages/widgets/local_radio_buttons.dart'; import 'package:fcs/pages/widgets/local_text.dart'; +import 'package:fcs/pages/widgets/local_title.dart'; import 'package:fcs/pages/widgets/my_data_table.dart'; import 'package:fcs/pages/widgets/progress.dart'; import 'package:fcs/pages/widgets/title_with_add_button.dart'; @@ -32,6 +34,7 @@ import 'package:timeline_list/timeline.dart'; import 'package:timeline_list/timeline_model.dart'; import 'cargo_type_editor.dart'; +import 'model/box_model.dart'; class BoxEditor extends StatefulWidget { final Box box; @@ -52,7 +55,8 @@ class _BoxEditorState extends State { bool isMixBox = false; DeliveryAddress _deliveryAddress = new DeliveryAddress(); User user; - String selectShipmentNumber; + String _selectShipmentNumber; + String _selectedCartonType; List _packages = []; List _cargoTypes = []; double volumetricRatio = 0; @@ -79,7 +83,7 @@ class _BoxEditorState extends State { _box = widget.box; _deliveryAddress = _box.shippingAddress; _cargoTypes = _box.cargoTypes; - selectShipmentNumber = _box.shipmentNumber; + _selectShipmentNumber = _box.shipmentNumber; _widthController.text = _box.width.toString(); _heightController.text = _box.height.toString(); _lengthController.text = _box.length.toString(); @@ -155,38 +159,35 @@ class _BoxEditorState extends State { @override Widget build(BuildContext context) { var languageModel = Provider.of(context); + var boxModel = Provider.of(context); var shipmentBox = Container( - child: Padding( - padding: const EdgeInsets.only(left: 10.0, right: 10), - child: DropdownButtonFormField( - value: selectShipmentNumber, - decoration: InputDecoration( - fillColor: Colors.white, - labelText: - AppTranslations.of(context).text("box.fcs_shipment_num"), - labelStyle: languageModel.isEng - ? TextStyle(fontWeight: FontWeight.w500) - : TextStyle( - fontWeight: FontWeight.w500, fontFamily: "Myanmar3"), - icon: Icon( - Ionicons.ios_airplane, - color: primaryColor, - )), - items: ["A102", "A103", "A201", "A202"] - .map((e) => DropdownMenuItem( - child: Text( - e, - style: TextStyle(color: primaryColor), - ), - value: e)) - .toList(), - onChanged: (value) { - setState(() { - selectShipmentNumber = value; - }); - }, - ))); + child: DropdownButtonFormField( + value: _selectShipmentNumber, + decoration: InputDecoration( + fillColor: Colors.white, + labelText: AppTranslations.of(context).text("box.fcs_shipment_num"), + labelStyle: languageModel.isEng + ? TextStyle(fontWeight: FontWeight.w500) + : TextStyle(fontWeight: FontWeight.w500, fontFamily: "Myanmar3"), + icon: Icon( + Ionicons.ios_airplane, + color: primaryColor, + )), + items: ["A102", "A103", "A201", "A202"] + .map((e) => DropdownMenuItem( + child: Text( + e, + style: TextStyle(color: primaryColor), + ), + value: e)) + .toList(), + onChanged: (value) { + setState(() { + _selectShipmentNumber = value; + }); + }, + )); final mixBox = Container( child: new Row( @@ -215,41 +216,35 @@ class _BoxEditorState extends State { ), ); - final fcsIDBox = Container( - padding: EdgeInsets.only(left: 10), - child: Row( - children: [ - Expanded( - child: DisplayText( - text: user != null ? user.fcsID : "", - labelTextKey: "box.fcs.id", - icon: FcsIDIcon(), - )), - IconButton( - icon: Icon(Icons.search, color: primaryColor), - onPressed: () => searchUser(context, callbackUserSelect: (u) { - setState(() { - this.user = u; - }); - })), - ], - )); + final fcsIDBox = Row( + children: [ + Expanded( + child: DisplayText( + text: user != null ? user.fcsID : "", + labelTextKey: "box.fcs.id", + icon: FcsIDIcon(), + )), + IconButton( + icon: Icon(Icons.search, color: primaryColor), + onPressed: () => searchUser(context, callbackUserSelect: (u) { + setState(() { + this.user = u; + }); + })), + ], + ); - final phoneNumberBox = Container( - padding: EdgeInsets.only(left: 10), - child: DisplayText( - text: user != null ? user.phoneNumber : "", - labelTextKey: "box.phone", - iconData: Icons.phone, - )); + final phoneNumberBox = DisplayText( + text: user != null ? user.phoneNumber : "", + labelTextKey: "box.phone", + iconData: Icons.phone, + ); - final namebox = Container( - padding: EdgeInsets.only(left: 10), - child: DisplayText( - text: user != null ? user.name : "", - labelTextKey: "box.name", - iconData: Icons.person, - )); + final namebox = DisplayText( + text: user != null ? user.name : "", + labelTextKey: "box.name", + iconData: Icons.person, + ); final packageTitle = Container( padding: EdgeInsets.only(right: 10.0, top: 20), @@ -483,7 +478,7 @@ class _BoxEditorState extends State { title: widget.box == null ? LocalText( context, - "boxes.new", + "boxes.create.title", fontSize: 20, color: primaryColor, ) @@ -494,40 +489,37 @@ class _BoxEditorState extends State { color: primaryColor, ), ), - body: ListView( - shrinkWrap: true, - children: [ - widget.box == null - ? Container() - : Center(child: nameWidget(_box.packageNumber)), - SizedBox( - height: 10, - ), - TitleWithAddButton( - titleKey: "box.shipment_info", - ), - shipmentBox, - SizedBox( - height: 10, - ), - fcsIDBox, - phoneNumberBox, - namebox, - mixBox, - SizedBox( - height: 10, - ), - Divider(), - Container( - padding: EdgeInsets.only(top: 10, left: 10), - child: TitleWithAddButton( - iconData: Octicons.package, - titleKey: "box.packages", + body: Padding( + padding: const EdgeInsets.all(10.0), + child: ListView( + shrinkWrap: true, + children: [ + widget.box == null + ? Container() + : Center(child: nameWidget(_box.packageNumber)), + SizedBox( + height: 10, ), - ), - Container( - padding: EdgeInsets.only(left: 10, right: 10), - child: Column( + LocalTitle(textKey: "box.type.title"), + LocalRadioButtons( + values: boxModel.cartonTypes, + selectedValue: _selectedCartonType, + callback: (v) { + print(v); + setState(() { + _selectedCartonType = v; + }); + }), + LocalTitle(textKey: "box.shipment_info"), + shipmentBox, + SizedBox( + height: 10, + ), + fcsIDBox, + namebox, + LocalTitle(textKey: "box.packages"), + + Column( children: [ packageTitle, Divider( @@ -539,110 +531,111 @@ class _BoxEditorState extends State { SizedBox(height: 10), ], ), - ), - Divider(), - Container( - padding: EdgeInsets.only(left: 10), - child: TitleWithAddButton( - iconData: MaterialCommunityIcons.briefcase_check, - titleKey: "box.cargo_type", - onTap: () async { - Cargo cargo = await Navigator.push( - context, BottomUpPageRoute(CargoTypeEditor())); - if (cargo != null) { - setState(() { - _box.cargoTypes.add(cargo); - }); - } - }), - ), - Container( - padding: EdgeInsets.only(left: 10, right: 10), - child: Column( - children: [ - cargoTitle, - Divider( - color: Colors.grey[400], - ), - Column( - children: getCargoRowList(), - ), - SizedBox(height: 10), - ], + Divider(), + Container( + padding: EdgeInsets.only(left: 10), + child: TitleWithAddButton( + iconData: MaterialCommunityIcons.briefcase_check, + titleKey: "box.cargo_type", + onTap: () async { + Cargo cargo = await Navigator.push( + context, BottomUpPageRoute(CargoTypeEditor())); + if (cargo != null) { + setState(() { + _box.cargoTypes.add(cargo); + }); + } + }), ), - ), - Divider(), - SizedBox( - height: 10, - ), - TitleWithAddButton( - titleKey: "box.dimension", - ), - shipmentWeightBox, - widthBox, - heightBox, - lengthBox, - SizedBox(height: 25), - Divider(), - Container( - padding: EdgeInsets.only(left: 10, right: 10), - child: DefaultDeliveryAddress( - deliveryAddress: _deliveryAddress, - onTap: () async { - DeliveryAddress d = await Navigator.push( - context, - BottomUpPageRoute(DeliveryAddressSelection( - deliveryAddress: _deliveryAddress, - )), - ); - if (d == null) return; - setState(() { - this._deliveryAddress = d; - }); - }), - ), - SizedBox(height: 15), - Divider(), - isNew - ? Container() - : Column( - children: [ - Padding( - padding: EdgeInsets.only(top: 10), - child: TitleWithAddButton( - titleKey: "box.status", + Container( + padding: EdgeInsets.only(left: 10, right: 10), + child: Column( + children: [ + cargoTitle, + Divider( + color: Colors.grey[400], + ), + Column( + children: getCargoRowList(), + ), + SizedBox(height: 10), + ], + ), + ), + Divider(), + SizedBox( + height: 10, + ), + TitleWithAddButton( + titleKey: "box.dimension", + ), + shipmentWeightBox, + widthBox, + heightBox, + lengthBox, + SizedBox(height: 25), + Divider(), + Container( + padding: EdgeInsets.only(left: 10, right: 10), + child: DefaultDeliveryAddress( + deliveryAddress: _deliveryAddress, + labelKey: "box.delivery_address", + onTap: () async { + DeliveryAddress d = await Navigator.push( + context, + BottomUpPageRoute(DeliveryAddressSelection( + deliveryAddress: _deliveryAddress, + )), + ); + if (d == null) return; + setState(() { + this._deliveryAddress = d; + }); + }), + ), + SizedBox(height: 15), + Divider(), + isNew + ? Container() + : Column( + children: [ + Padding( + padding: EdgeInsets.only(top: 10), + child: TitleWithAddButton( + titleKey: "box.status", + ), ), - ), - Container( - height: 230, - padding: EdgeInsets.only(left: 10), - child: isNew - ? Container() - : Timeline( - children: _models(), - position: TimelinePosition.Left), - ), - ], - ), - isNew ? Container() : Divider(), - SizedBox( - height: 10, - ), - widget.box == null - ? createBtn - : Container( - child: Column( - children: [ - completeBtn, - widget.box.status == 'Arrived' - ? deliveryBtn - : Container(), - ], - )), - SizedBox( - height: 20, - ), - ], + Container( + height: 230, + padding: EdgeInsets.only(left: 10), + child: isNew + ? Container() + : Timeline( + children: _models(), + position: TimelinePosition.Left), + ), + ], + ), + isNew ? Container() : Divider(), + SizedBox( + height: 10, + ), + widget.box == null + ? createBtn + : Container( + child: Column( + children: [ + completeBtn, + widget.box.status == 'Arrived' + ? deliveryBtn + : Container(), + ], + )), + SizedBox( + height: 20, + ), + ], + ), ), ), ); diff --git a/lib/pages/box/model/box_model.dart b/lib/pages/box/model/box_model.dart index 6cc9939..524625b 100644 --- a/lib/pages/box/model/box_model.dart +++ b/lib/pages/box/model/box_model.dart @@ -1,6 +1,7 @@ import 'dart:async'; import 'package:cloud_firestore/cloud_firestore.dart'; +import 'package:fcs/domain/constants.dart'; import 'package:fcs/domain/entities/box.dart'; import 'package:fcs/domain/entities/cargo.dart'; import 'package:fcs/domain/entities/package.dart'; @@ -295,6 +296,12 @@ class BoxModel extends BaseModel { }); } + List cartonTypes = [ + carton_from_packages, + carton_from_shipments, + carton_mix_box + ]; + void initUser(user) { super.initUser(user); } diff --git a/lib/pages/customer/invitation_create.dart b/lib/pages/customer/invitation_create.dart index 36a4e65..ea85bc8 100644 --- a/lib/pages/customer/invitation_create.dart +++ b/lib/pages/customer/invitation_create.dart @@ -54,7 +54,7 @@ class _InvitationCreateState extends State { ), title: LocalText( context, - "invitation.new", + "invitation.form.title", fontSize: 20, color: primaryColor, ), diff --git a/lib/pages/payment_methods/payment_method_editor.dart b/lib/pages/payment_methods/payment_method_editor.dart index 1f1bba2..8563725 100644 --- a/lib/pages/payment_methods/payment_method_editor.dart +++ b/lib/pages/payment_methods/payment_method_editor.dart @@ -63,7 +63,7 @@ class _PaymentMethodEditorState extends State { ), title: LocalText( context, - isNew ? "pm.new" : "pm.update", + isNew ? "pm.form.new" : "pm.update", fontSize: 20, color: primaryColor, ), diff --git a/lib/pages/receiving/receiving_editor.dart b/lib/pages/receiving/receiving_editor.dart index 3cb8514..c9334ec 100644 --- a/lib/pages/receiving/receiving_editor.dart +++ b/lib/pages/receiving/receiving_editor.dart @@ -143,7 +143,7 @@ class _ReceivingEditorState extends State { backgroundColor: Colors.white, title: LocalText( context, - _isNew ? "receiving.new" : "receiving.update", + _isNew ? "receiving.create" : "receiving.update", fontSize: 20, color: primaryColor, ), diff --git a/lib/pages/shipment/shipment_box_editor.dart b/lib/pages/shipment/shipment_box_editor.dart index 43df1a0..af72644 100644 --- a/lib/pages/shipment/shipment_box_editor.dart +++ b/lib/pages/shipment/shipment_box_editor.dart @@ -127,7 +127,7 @@ class _ShipmentBoxEditorState extends State { backgroundColor: Colors.white, title: LocalText( context, - _isNew ? "boxes.new" : "box.edit.title", + _isNew ? "boxes.create.title" : "box.edit.title", fontSize: 20, color: primaryColor, ),