diff --git a/assets/local/localization_en.json b/assets/local/localization_en.json index 527c6d5..0385fa4 100644 --- a/assets/local/localization_en.json +++ b/assets/local/localization_en.json @@ -566,7 +566,7 @@ "invoice.add_package":"Add Package", "term":"TERMS", - "term.btn":"Terms of services", + "term.btn":"Terms of service", "customer.list.title":"CUSTOMERS", "customer.form.title":"CUSTOMER", diff --git a/lib/model/invoice_model.dart b/lib/model/invoice_model.dart index 72a062e..b0d2d92 100644 --- a/lib/model/invoice_model.dart +++ b/lib/model/invoice_model.dart @@ -10,7 +10,7 @@ class InvoiceModel extends BaseModel { invoiceDate: DateTime(2020, 4, 5, 12, 30), customerName: 'Ko Nyi', customerPhoneNumber: '+959 888888888', - amount: 5000, + amount: 500, status: 'Pending', packages: [ Package( @@ -36,15 +36,15 @@ class InvoiceModel extends BaseModel { receiverAddress: '1 Bo Yar Nyunt St.\nDagon Tsp, Yangon'), ], receipts: [ - Receipt(amount: 2000, date: DateTime(2020, 6, 1)), - Receipt(amount: 1000, date: DateTime(2020, 6, 16)), + Receipt(amount: 200, date: DateTime(2020, 6, 1)), + Receipt(amount: 100, date: DateTime(2020, 6, 16)), ]), Invoice( invoiceNumber: 'A092(A)-31', invoiceDate: DateTime(2020, 4, 5, 9, 30), customerName: 'Ko Aung Myo', customerPhoneNumber: '+959 444444444', - amount: 3000, + amount: 300, status: 'Paid', packages: [ Package( @@ -69,14 +69,14 @@ class InvoiceModel extends BaseModel { receiverAddress: '2 Shwe Taung Kyar St, Bahan Tsp, Yangon'), ], receipts: [ - Receipt(amount: 2000, date: DateTime(2020, 6, 1)), + Receipt(amount: 200, date: DateTime(2020, 6, 1)), ]), Invoice( invoiceNumber: 'A092(A)-32', invoiceDate: DateTime(2020, 4, 6, 10, 10), customerName: 'Ko Zaw Thu', customerPhoneNumber: '+959 777777777', - amount: 2000, + amount: 200, status: 'Paid', packages: [ Package( @@ -101,17 +101,17 @@ class InvoiceModel extends BaseModel { receiverAddress: '3 Kambzwza St, Bahan Tsp, Yangon'), ], receipts: [ - Receipt(amount: 2000, date: DateTime(2020, 6, 1)), + Receipt(amount: 200, date: DateTime(2020, 6, 1)), ]), Invoice( invoiceNumber: 'A092(A)-33', invoiceDate: DateTime(2020, 4, 6, 12, 15), customerName: 'Ko Myo Min', customerPhoneNumber: '+959 555555555', - amount: 3000, + amount: 300, status: 'Pending', receipts: [ - Receipt(amount: 2000, date: DateTime(2020, 6, 1)), + Receipt(amount: 200, date: DateTime(2020, 6, 1)), ], packages: [ Package( diff --git a/lib/model/pickup_model.dart b/lib/model/pickup_model.dart index b40004c..1ffd1d5 100644 --- a/lib/model/pickup_model.dart +++ b/lib/model/pickup_model.dart @@ -23,7 +23,7 @@ class PickUpModel extends BaseModel { mail: 'admin@fcs.com', facebook: 'https://facebook.com/fcs'); - List radioGroups = [ + List radioGroups1 = [ RadioGroup( text: "FCS Pickup", index: 1, @@ -42,9 +42,33 @@ class PickUpModel extends BaseModel { ), ]; + List get radioGroups { + List radioGroups = [ + RadioGroup( + text: "Local Pickup", + index: 1, + ), + RadioGroup( + text: "Courier Pickup", + index: 2, + ), + RadioGroup( + text: "Local Drop-off", + index: 3, + ), + RadioGroup( + text: "Courier Drop-off", + index: 4, + ), + ]; + return radioGroups; + } + + List get pickups { + List pickups = [ PickUp( - id: "P200412 - 12 Apr 2020", + id: "S200412 - 12 Apr 2020", userName: "Ko Kyaw Nyi", phoneNumber: '+959111111111', fromTime: '1PM', @@ -54,7 +78,7 @@ class PickUpModel extends BaseModel { status: 'Pending', date: DateTime(2020, 5, 1), address: '154-19 64th Ave.\nFlushing, NY 11367', - handlingFee: 5000, + handlingFee: 50, isCourier: true, radioIndex: 2, cargoTypes: [ @@ -63,7 +87,7 @@ class PickUpModel extends BaseModel { Cargo(type: 'Dangerous Cargo', weight: 30) ]), PickUp( - id: "P200125 - 12 May 2020", + id: "S200125 - 12 May 2020", userName: "Ko Kyaw Nyi", phoneNumber: '+959111111111', fromTime: '1PM', @@ -73,14 +97,14 @@ class PickUpModel extends BaseModel { status: 'Confirmed', date: DateTime(2020, 5, 6), address: '154-19 64th Ave.\nFlushing, NY 11367', - handlingFee: 5000, + handlingFee: 50, cargoTypes: [ Cargo(type: 'General Cargo', weight: 25), Cargo(type: 'Medicine', weight: 20), Cargo(type: 'Dangerous Cargo', weight: 30) ]), PickUp( - id: "P200441 - 13 Apr 2020", + id: "S200441 - 13 Apr 2020", userName: "Ko Kyaw Nyi", phoneNumber: '+959111111111', fromTime: '1PM', @@ -90,7 +114,7 @@ class PickUpModel extends BaseModel { status: "Pickuped", date: DateTime(2020, 5, 9), address: '154-19 64th Ave.\nFlushing, NY 11367', - handlingFee: 5000, + handlingFee: 50, radioIndex: 3, cargoTypes: [ Cargo(type: 'General Cargo', weight: 25), @@ -98,7 +122,7 @@ class PickUpModel extends BaseModel { Cargo(type: 'Dangerous Cargo', weight: 30) ]), PickUp( - id: "P200412 - 12 Apr 2020", + id: "S200412 - 12 Apr 2020", userName: "Ko Kyaw Nyi", phoneNumber: '+959111111111', fromTime: '1PM', @@ -108,14 +132,14 @@ class PickUpModel extends BaseModel { status: 'Pickuped', date: DateTime(2020, 5, 15), address: '154-19 64th Ave.\nFlushing, NY 11367', - handlingFee: 5000, + handlingFee: 50, cargoTypes: [ Cargo(type: 'General Cargo', weight: 25), Cargo(type: 'Medicine', weight: 20), Cargo(type: 'Dangerous Cargo', weight: 30) ]), PickUp( - id: "P200125 - 12 May 2020", + id: "S200125 - 12 May 2020", userName: "Ko Kyaw Nyi", phoneNumber: '+959111111111', fromTime: '1PM', @@ -125,14 +149,14 @@ class PickUpModel extends BaseModel { status: 'Pickuped', date: DateTime(2020, 5, 20), address: '154-19 64th Ave.\nFlushing, NY 11367', - handlingFee: 5000, + handlingFee: 50, cargoTypes: [ Cargo(type: 'General Cargo', weight: 25), Cargo(type: 'Medicine', weight: 20), Cargo(type: 'Dangerous Cargo', weight: 30) ]), PickUp( - id: "P200441 - 13 Apr 2020", + id: "S200441 - 13 Apr 2020", userName: "Ko Kyaw Nyi", phoneNumber: '+959111111111', fromTime: '1PM', @@ -142,14 +166,14 @@ class PickUpModel extends BaseModel { status: "Pickuped", date: DateTime(2020, 5, 21), address: '154-19 64th Ave.\nFlushing, NY 11367', - handlingFee: 5000, + handlingFee: 50, cargoTypes: [ Cargo(type: 'General Cargo', weight: 25), Cargo(type: 'Medicine', weight: 20), Cargo(type: 'Dangerous Cargo', weight: 30) ]), PickUp( - id: "P200441 - 10 Apr 2020", + id: "S200441 - 10 Apr 2020", userName: "Ko Kyaw Nyi", phoneNumber: '+959111111111', fromTime: '1PM', @@ -159,14 +183,14 @@ class PickUpModel extends BaseModel { status: "Canceled", date: DateTime(2020, 5, 25), address: '154-19 64th Ave.\nFlushing, NY 11367', - handlingFee: 5000, + handlingFee: 50, cargoTypes: [ Cargo(type: 'General Cargo', weight: 25), Cargo(type: 'Medicine', weight: 20), Cargo(type: 'Dangerous Cargo', weight: 30) ]), PickUp( - id: "P200441 - 6 Apr 2020", + id: "S200441 - 6 Apr 2020", userName: "Ko Kyaw Nyi", phoneNumber: '+959111111111', fromTime: '1PM', @@ -176,7 +200,151 @@ class PickUpModel extends BaseModel { status: "Canceled", date: DateTime(2020, 5, 27), address: '154-19 64th Ave.\nFlushing, NY 11367', - handlingFee: 5000, + handlingFee: 50, + cargoTypes: [ + Cargo(type: 'General Cargo', weight: 25), + Cargo(type: 'Medicine', weight: 20), + Cargo(type: 'Dangerous Cargo', weight: 30) + ]), + ]; + return pickups; + } + + List pickups1 = [ + PickUp( + id: "S200412 - 12 Apr 2020", + userName: "Ko Kyaw Nyi", + phoneNumber: '+959111111111', + fromTime: '1PM', + toTime: '3PM', + numberOfPackage: 5, + weight: 25, + status: 'Pending', + date: DateTime(2020, 5, 1), + address: '154-19 64th Ave.\nFlushing, NY 11367', + handlingFee: 50, + isCourier: true, + radioIndex: 2, + cargoTypes: [ + Cargo(type: 'General Cargo', weight: 25), + Cargo(type: 'Medicine', weight: 20), + Cargo(type: 'Dangerous Cargo', weight: 30) + ]), + PickUp( + id: "S200125 - 12 May 2020", + userName: "Ko Kyaw Nyi", + phoneNumber: '+959111111111', + fromTime: '1PM', + toTime: '3PM', + numberOfPackage: 5, + weight: 25, + status: 'Confirmed', + date: DateTime(2020, 5, 6), + address: '154-19 64th Ave.\nFlushing, NY 11367', + handlingFee: 50, + cargoTypes: [ + Cargo(type: 'General Cargo', weight: 25), + Cargo(type: 'Medicine', weight: 20), + Cargo(type: 'Dangerous Cargo', weight: 30) + ]), + PickUp( + id: "S200441 - 13 Apr 2020", + userName: "Ko Kyaw Nyi", + phoneNumber: '+959111111111', + fromTime: '1PM', + toTime: '3PM', + numberOfPackage: 5, + weight: 25, + status: "Pickuped", + date: DateTime(2020, 5, 9), + address: '154-19 64th Ave.\nFlushing, NY 11367', + handlingFee: 50, + radioIndex: 3, + cargoTypes: [ + Cargo(type: 'General Cargo', weight: 25), + Cargo(type: 'Medicine', weight: 20), + Cargo(type: 'Dangerous Cargo', weight: 30) + ]), + PickUp( + id: "S200412 - 12 Apr 2020", + userName: "Ko Kyaw Nyi", + phoneNumber: '+959111111111', + fromTime: '1PM', + toTime: '3PM', + numberOfPackage: 5, + weight: 25, + status: 'Pickuped', + date: DateTime(2020, 5, 15), + address: '154-19 64th Ave.\nFlushing, NY 11367', + handlingFee: 50, + cargoTypes: [ + Cargo(type: 'General Cargo', weight: 25), + Cargo(type: 'Medicine', weight: 20), + Cargo(type: 'Dangerous Cargo', weight: 30) + ]), + PickUp( + id: "S200125 - 12 May 2020", + userName: "Ko Kyaw Nyi", + phoneNumber: '+959111111111', + fromTime: '1PM', + toTime: '3PM', + numberOfPackage: 5, + weight: 25, + status: 'Pickuped', + date: DateTime(2020, 5, 20), + address: '154-19 64th Ave.\nFlushing, NY 11367', + handlingFee: 50, + cargoTypes: [ + Cargo(type: 'General Cargo', weight: 25), + Cargo(type: 'Medicine', weight: 20), + Cargo(type: 'Dangerous Cargo', weight: 30) + ]), + PickUp( + id: "S200441 - 13 Apr 2020", + userName: "Ko Kyaw Nyi", + phoneNumber: '+959111111111', + fromTime: '1PM', + toTime: '3PM', + numberOfPackage: 5, + weight: 25, + status: "Pickuped", + date: DateTime(2020, 5, 21), + address: '154-19 64th Ave.\nFlushing, NY 11367', + handlingFee: 50, + cargoTypes: [ + Cargo(type: 'General Cargo', weight: 25), + Cargo(type: 'Medicine', weight: 20), + Cargo(type: 'Dangerous Cargo', weight: 30) + ]), + PickUp( + id: "S200441 - 10 Apr 2020", + userName: "Ko Kyaw Nyi", + phoneNumber: '+959111111111', + fromTime: '1PM', + toTime: '3PM', + numberOfPackage: 5, + weight: 25, + status: "Canceled", + date: DateTime(2020, 5, 25), + address: '154-19 64th Ave.\nFlushing, NY 11367', + handlingFee: 50, + cargoTypes: [ + Cargo(type: 'General Cargo', weight: 25), + Cargo(type: 'Medicine', weight: 20), + Cargo(type: 'Dangerous Cargo', weight: 30) + ]), + PickUp( + id: "S200441 - 6 Apr 2020", + userName: "Ko Kyaw Nyi", + phoneNumber: '+959111111111', + fromTime: '1PM', + toTime: '3PM', + numberOfPackage: 5, + weight: 25, + status: "Canceled", + date: DateTime(2020, 5, 27), + address: '154-19 64th Ave.\nFlushing, NY 11367', + handlingFee: 50, cargoTypes: [ Cargo(type: 'General Cargo', weight: 25), Cargo(type: 'Medicine', weight: 20), @@ -219,6 +387,6 @@ class PickUpModel extends BaseModel { @override logout() async { if (listener != null) await listener.cancel(); - pickups = []; + // pickups = []; } } diff --git a/lib/model/shipment_rate_model.dart b/lib/model/shipment_rate_model.dart index 9f80fb9..43e0c25 100644 --- a/lib/model/shipment_rate_model.dart +++ b/lib/model/shipment_rate_model.dart @@ -30,8 +30,8 @@ class ShipmentRateModel extends BaseModel { ]; List discountsByWeight = [ - Discount(weight: 10, discountRate: 3), - Discount(weight: 20, discountRate: 5) + Discount(weight: 50, discountRate: 0.25), + Discount(weight: 100, discountRate: 0.50) ]; int freeDeliveryWeight = 10; diff --git a/lib/model_fcs/box_model.dart b/lib/model_fcs/box_model.dart index 67f8783..c1ea999 100644 --- a/lib/model_fcs/box_model.dart +++ b/lib/model_fcs/box_model.dart @@ -285,7 +285,7 @@ class BoxModel extends BaseModel { return boxes .where((e) => e.status == "Packed" || - e.status == "Received" || + // e.status == "Received" || e.status == "Shipped" || e.status == "Arrived") .toList() diff --git a/lib/pages/home_page.dart b/lib/pages/home_page.dart index 75965a3..700e2b5 100644 --- a/lib/pages/home_page.dart +++ b/lib/pages/home_page.dart @@ -209,8 +209,8 @@ class _HomePageState extends State { owner ? widgets.add(deliveryBtn) : ""; owner ? widgets.add(customersBtn) : ""; customer || owner ? widgets.add(invoicesBtn) : ""; - customer || owner ? widgets.add(paymentMethodBtn) : ""; - customer || owner ? widgets.add(discountBtn) : ""; + owner ? widgets.add(paymentMethodBtn) : ""; + owner ? widgets.add(discountBtn) : ""; // widgets.add(termBtn); return OfflineRedirect( @@ -352,7 +352,7 @@ class _HomePageState extends State { MaterialPageRoute(builder: (_) => Term())); }, child: _buildSmallButton( - "Terms of services", Icons.info_outline), + "Terms of service", Icons.info_outline), ), ], ) diff --git a/lib/pages/home_page_welcome.dart b/lib/pages/home_page_welcome.dart index a769f28..6f37b24 100644 --- a/lib/pages/home_page_welcome.dart +++ b/lib/pages/home_page_welcome.dart @@ -143,7 +143,7 @@ class _HomePageWelcomeState extends State { child: Column( children: [ Padding( - padding: const EdgeInsets.all(100.0), + padding: const EdgeInsets.all(80.0), child: Text( "Welcome!", textAlign: TextAlign.center, @@ -154,7 +154,7 @@ class _HomePageWelcomeState extends State { ), ), Padding( - padding: const EdgeInsets.only(top: 80.0), + padding: const EdgeInsets.only(top: 0.0), child: Text( "Cargo Services", textAlign: TextAlign.center, @@ -260,7 +260,7 @@ class _HomePageWelcomeState extends State { MaterialPageRoute(builder: (_) => Term())); }, child: _buildSmallButton( - "Terms of services", Icons.info_outline), + "Terms of service", Icons.info_outline), ), ], ) diff --git a/lib/pages/invoice/invoce_list.dart b/lib/pages/invoice/invoce_list.dart index eec9a21..ed072bb 100644 --- a/lib/pages/invoice/invoce_list.dart +++ b/lib/pages/invoice/invoce_list.dart @@ -1,4 +1,5 @@ import 'package:fcs/model/invoice_model.dart'; +import 'package:fcs/model/main_model.dart'; import 'package:fcs/model/shipment_model.dart'; import 'package:fcs/model_fcs/package_model.dart'; import 'package:fcs/pages_fcs/package_list_row.dart'; @@ -38,10 +39,12 @@ class _InvoiceListState extends State { @override Widget build(BuildContext context) { + var owner = Provider.of(context).isOwner(); + return LocalProgress( inAsyncCall: _isLoading, child: DefaultTabController( - length: 3, + length: 2, child: Scaffold( appBar: AppBar( centerTitle: true, @@ -65,22 +68,21 @@ class _InvoiceListState extends State { bottom: TabBar( unselectedLabelColor: Colors.grey, tabs: [ - Tab(text: "Boxes"), Tab(text: "Pending"), Tab(text: "Paid"), ], ), ), - floatingActionButton: FloatingActionButton.extended( + floatingActionButton:owner? FloatingActionButton.extended( onPressed: () { _newInvoice(); }, icon: Icon(Icons.add), label: Text(AppTranslations.of(context).text("invoices.add")), backgroundColor: primaryColor, - ), + ):null, body: TabBarView( - children: [_packages(), _pending(), _paided()], + children: [ _pending(), _paided()], )), ), ); diff --git a/lib/pages/invoice/invoice_list_row.dart b/lib/pages/invoice/invoice_list_row.dart index 7de114a..4346531 100644 --- a/lib/pages/invoice/invoice_list_row.dart +++ b/lib/pages/invoice/invoice_list_row.dart @@ -128,23 +128,33 @@ class _InvoiceListRowState extends State { ), ), ), - Padding( - padding: const EdgeInsets.all(0), - child: getStatus(_invoice.status), - ), + // Padding( + // padding: const EdgeInsets.all(0), + // child: getStatus(_invoice.status), + // ), + _invoice.status=="Pending"? Padding( padding: const EdgeInsets.only(left: 10.0), child: InkWell( - child: Icon( - Icons.payment, - color: primaryColor, + child: RaisedButton( + child: Row( + children: [ + Icon( + Icons.payment, + color: primaryColor, + ), + Padding( + padding: const EdgeInsets.only(left:8.0), + child: Text("Payment"), + ) + ], ), - onTap: () { + onPressed: () { Navigator.of(context) .push(BottomUpPageRoute(PaymentPage(invoice: _invoice))); }, - ), - ), + )), + ):Container(), Padding( padding: const EdgeInsets.only(left: 8.0), child: InkWell( diff --git a/lib/pages/invoice/payment_pdf_screen.dart b/lib/pages/invoice/payment_pdf_screen.dart index 15d5a2d..853b375 100644 --- a/lib/pages/invoice/payment_pdf_screen.dart +++ b/lib/pages/invoice/payment_pdf_screen.dart @@ -30,8 +30,7 @@ class _PaymentPDFScreenState extends State return Scaffold( appBar: AppBar( backgroundColor: primaryColor, - title: LocalText(context, 'pdf_view.title', - color: Colors.white, fontSize: 20), + title:Text("Invoice File"), actions: [ IconButton( icon: Icon(Icons.share), @@ -95,21 +94,21 @@ class _PaymentPDFScreenState extends State // ) ], ), - floatingActionButton: FutureBuilder( - future: _controller.future, - builder: (context, AsyncSnapshot snapshot) { - if (snapshot.hasData) { - return FloatingActionButton.extended( - label: Text("Go to ${pages ~/ 2}"), - onPressed: () async { - await snapshot.data.setPage(pages ~/ 2); - }, - ); - } + // floatingActionButton: FutureBuilder( + // future: _controller.future, + // builder: (context, AsyncSnapshot snapshot) { + // if (snapshot.hasData) { + // return FloatingActionButton.extended( + // label: Text("Go to ${pages ~/ 2}"), + // onPressed: () async { + // await snapshot.data.setPage(pages ~/ 2); + // }, + // ); + // } - return Container(); - }, - ), + // return Container(); + // }, + // ), ); } } diff --git a/lib/pages/pickup_box_editor.dart b/lib/pages/pickup_box_editor.dart index d7d8588..dff56db 100644 --- a/lib/pages/pickup_box_editor.dart +++ b/lib/pages/pickup_box_editor.dart @@ -220,7 +220,7 @@ class _PickupBoxEditorState extends State { ), ExpansionTile( title: Text( - 'Address', + 'Shipment Address', style: TextStyle( color: primaryColor, fontWeight: FontWeight.bold), ), diff --git a/lib/pages/pickup_editor.dart b/lib/pages/pickup_editor.dart index fcdbe1c..66feeaf 100644 --- a/lib/pages/pickup_editor.dart +++ b/lib/pages/pickup_editor.dart @@ -11,6 +11,8 @@ import 'package:fcs/vo/shipping_address.dart'; import 'package:fcs/widget/bottom_up_page_route.dart'; import 'package:fcs/widget/fcs_text_field.dart'; import 'package:fcs/widget/fcs_text_field_readonly.dart'; +import 'package:fcs/widget/multi_img_controller.dart'; +import 'package:fcs/widget/multi_img_file.dart'; import 'package:flutter_datetime_picker/flutter_datetime_picker.dart'; import 'package:flutter_icons/flutter_icons.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart'; @@ -35,6 +37,7 @@ class PickUpEditor extends StatefulWidget { class _PickUpEditorState extends State { var dateFormatter = new DateFormat('dd MMM yyyy'); final numberFormatter = new NumberFormat("#,###"); + MultiImgController multiImgController = MultiImgController(); TextEditingController _addressEditingController = new TextEditingController(); TextEditingController _fromTimeEditingController = @@ -273,19 +276,21 @@ class _PickUpEditorState extends State { ? Padding( padding: const EdgeInsets.only(left: 15.0), child: fcsInputReadOnly( - "Courier Fee", FontAwesomeIcons.moneyBill, + "Handling Fee/Courier Fee", + FontAwesomeIcons.moneyBill, controller: _handlingFeeController), ) : Padding( padding: const EdgeInsets.only(left: 15.0), child: fcsInputReadOnly( - "Handling Fee", FontAwesomeIcons.moneyBill, + "Handling Fee/Courier Fee", + FontAwesomeIcons.moneyBill, controller: _handlingFeeController), ), ExpansionTile( title: Text( - 'Shipment Type', + 'Pickup/Drop-off', style: TextStyle( color: primaryColor, fontWeight: FontWeight.bold), ), @@ -313,7 +318,7 @@ class _PickUpEditorState extends State { ? Container( child: ShippingAddressRow( shippingAddress: ShippingAddress( - fullName: 'Myo Min', + fullName: 'FCS Office', addressLine1: '154-19 64th Ave.', addressLine2: 'Flushing', city: 'NY', @@ -324,66 +329,22 @@ class _PickUpEditorState extends State { : _currVal == 4 ? Container( child: Column( - children: [ - ShippingAddressRow( - shippingAddress: - shipmentModel.shippingAddresses[1]), - Container( - padding: EdgeInsets.only( - top: 20, bottom: 15, right: 15), - child: Align( - alignment: Alignment.bottomRight, - child: Container( - width: 120, - height: 40, - child: FloatingActionButton.extended( - materialTapTargetSize: - MaterialTapTargetSize.shrinkWrap, - onPressed: () {}, - icon: Icon(Icons.add), - label: Text( - 'Select\nAddress', - style: TextStyle(fontSize: 12), - ), - backgroundColor: primaryColor, - ), - ), - ), - ), - ], - )) - : ExpansionTile( - title: Text( - 'Package Information', - style: TextStyle( - color: primaryColor, - fontWeight: FontWeight.bold), - ), children: [ - Column( - children: getBoxList(context, boxModel.boxes), - ), Container( padding: EdgeInsets.only( top: 20, bottom: 15, right: 15), child: Align( - alignment: Alignment.bottomRight, + alignment: Alignment.center, child: Container( - width: 120, + width: 350, height: 40, child: FloatingActionButton.extended( materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, - icon: Icon(Icons.add), - onPressed: () { - Navigator.push( - context, - BottomUpPageRoute( - PickupBoxEditor()), - ); - }, + onPressed: () {}, + icon: Icon(Icons.arrow_right), label: Text( - 'Add Package', + 'Visit courier websie for nearest drop-off', style: TextStyle(fontSize: 12), ), backgroundColor: primaryColor, @@ -391,9 +352,50 @@ class _PickUpEditorState extends State { ), ), ), - SizedBox(height: 10.0), ], + )) + : Container(), + + ExpansionTile( + title: Text( + 'Package Information', + style: TextStyle( + color: primaryColor, fontWeight: FontWeight.bold), + ), + children: [ + Column( + children: getBoxList(context, boxModel.boxes), + ), + Container( + padding: + EdgeInsets.only(top: 20, bottom: 15, right: 15), + child: Align( + alignment: Alignment.bottomRight, + child: Container( + width: 120, + height: 40, + child: FloatingActionButton.extended( + materialTapTargetSize: + MaterialTapTargetSize.shrinkWrap, + icon: Icon(Icons.add), + onPressed: () { + Navigator.push( + context, + BottomUpPageRoute(PickupBoxEditor()), + ); + }, + label: Text( + 'Add Package', + style: TextStyle(fontSize: 12), + ), + backgroundColor: primaryColor, ), + ), + ), + ), + SizedBox(height: 10.0), + ], + ), _currVal == 3 || _currVal == 4 ? Container() : ExpansionTile( @@ -592,6 +594,30 @@ class _PickUpEditorState extends State { ) : Container() : Container(), + Padding( + padding: EdgeInsets.only(left: 20), + child: Row( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + padding: EdgeInsets.only(top: 8), + child: Text( + 'Attach Courier Shiping Labels', + style: TextStyle( + color: Colors.black, fontSize: 16), + ), + ), + Container( + padding: EdgeInsets.only(left: 10), + child: MultiImageFile( + enabled: true, + controller: multiImgController, + title: "Receipt File", + )), + ], + ), + ), ], ), ]), @@ -603,7 +629,7 @@ class _PickUpEditorState extends State { child: Container( width: 250, child: FlatButton( - child: Text('Request for shipment'), + child: Text('Create shipment'), color: primaryColor, textColor: Colors.white, onPressed: () { @@ -635,7 +661,7 @@ class _PickUpEditorState extends State { child: Container( width: 250, child: FlatButton( - child: Text('Assign Shipment'), + child: Text('Confirm Shipment'), color: primaryColor, textColor: Colors.white, onPressed: () { diff --git a/lib/pages/shipment_rates_calculate.dart b/lib/pages/shipment_rates_calculate.dart index b16bcee..f30f1eb 100644 --- a/lib/pages/shipment_rates_calculate.dart +++ b/lib/pages/shipment_rates_calculate.dart @@ -99,9 +99,9 @@ class _ShipmentRatesCalState extends State { ), ), _row('Width (inches)', "", "", "10", input: true), - _row('Height', "", "", "10", input: true), - _row('Length', "", "", "10", input: true), - _row('Actual Weight', "", "", "0", input: true), + _row('Height (inches)', "", "", "10", input: true), + _row('Length (inches)', "", "", "10", input: true), + _row('Actual Weight (pounds)', "", "", "0", input: true), Container( padding: EdgeInsets.only(left: 25, top: 15, bottom: 5), child: Row( @@ -174,7 +174,7 @@ class _ShipmentRatesCalState extends State { width: 50, ), Container( - width: 150, + width: 50, child: TextFormField( initialValue: value, textAlign: TextAlign.end, diff --git a/lib/pages_fcs/package_editor.dart b/lib/pages_fcs/package_editor.dart index 3daff77..aefa7bb 100644 --- a/lib/pages_fcs/package_editor.dart +++ b/lib/pages_fcs/package_editor.dart @@ -204,17 +204,33 @@ class _PackageEditorState extends State { padding: const EdgeInsets.only( left: 20.0, right: 20), child: TextFormField( - initialValue: isNew ? "" : "PKG2039", + initialValue: _package.receiverName, decoration: InputDecoration( - fillColor: Colors.white, - labelText: 'Package ID', - hintText: 'Package ID', - filled: true, - icon: Icon(MaterialCommunityIcons.id_card, - color: primaryColor), - ), + fillColor: Colors.white, + labelText: 'Customer Name', + filled: true, + icon: Icon(Feather.user, + color: Colors.white), + suffixIcon: IconButton( + icon: Icon(Icons.search), + onPressed: () {})), ), ), + // Padding( + // padding: const EdgeInsets.only( + // left: 20.0, right: 20), + // child: TextFormField( + // initialValue: isNew ? "" : "PKG2039", + // decoration: InputDecoration( + // fillColor: Colors.white, + // labelText: 'Package ID', + // hintText: 'Package ID', + // filled: true, + // icon: Icon(MaterialCommunityIcons.id_card, + // color: primaryColor), + // ), + // ), + // ), Padding( padding: const EdgeInsets.only( left: 20.0, right: 20), @@ -231,39 +247,24 @@ class _PackageEditorState extends State { ), ), ), - Padding( - padding: const EdgeInsets.only( - left: 20.0, right: 20), - child: TextFormField( - initialValue: _package.receiverName, - decoration: InputDecoration( - fillColor: Colors.white, - labelText: 'Customer Name', - filled: true, - icon: Icon(Feather.user, - color: Colors.white), - suffixIcon: IconButton( - icon: Icon(Icons.search), - onPressed: () {})), - ), - ), - Padding( - padding: const EdgeInsets.only( - left: 20.0, right: 20), - child: TextFormField( - initialValue: isNew ? "" : "", - decoration: InputDecoration( - fillColor: Colors.white, - labelText: 'Pickup ID', - filled: true, - icon: Icon( - MaterialCommunityIcons.directions, - color: primaryColor), - suffixIcon: IconButton( - icon: Icon(Icons.search), - onPressed: () {})), - ), - ), + + // Padding( + // padding: const EdgeInsets.only( + // left: 20.0, right: 20), + // child: TextFormField( + // initialValue: isNew ? "" : "", + // decoration: InputDecoration( + // fillColor: Colors.white, + // labelText: 'Pickup ID', + // filled: true, + // icon: Icon( + // MaterialCommunityIcons.directions, + // color: primaryColor), + // suffixIcon: IconButton( + // icon: Icon(Icons.search), + // onPressed: () {})), + // ), + // ), ], ) : Container(), @@ -362,6 +363,7 @@ class _PackageEditorState extends State { ), ], ), + isNew?Container(): getShippingAddressList(context), isNew ? Container() diff --git a/lib/pages_fcs/package_list_row.dart b/lib/pages_fcs/package_list_row.dart index 616ecbd..c125e9e 100644 --- a/lib/pages_fcs/package_list_row.dart +++ b/lib/pages_fcs/package_list_row.dart @@ -58,7 +58,7 @@ class _PackageListRowtate extends State { Padding( padding: const EdgeInsets.only(left: 8.0), child: new Text( - _package.id == null ? '' : _package.id, + _package.id == null ? '' : _package.trackingID, style: new TextStyle( fontSize: 15.0, color: Colors.black), ), @@ -71,16 +71,16 @@ class _PackageListRowtate extends State { fontSize: 15.0, color: Colors.black), ), ), - Padding( - padding: const EdgeInsets.only(left: 8.0), - child: new Text( - _package.trackingID == null - ? '' - : _package.trackingID, - style: new TextStyle( - fontSize: 15.0, color: Colors.grey), - ), - ), + // Padding( + // padding: const EdgeInsets.only(left: 8.0), + // child: new Text( + // _package.trackingID == null + // ? '' + // : _package.trackingID, + // style: new TextStyle( + // fontSize: 15.0, color: Colors.grey), + // ), + // ), ], ), ), diff --git a/lib/vo/discount.dart b/lib/vo/discount.dart index a22a0d6..b673807 100644 --- a/lib/vo/discount.dart +++ b/lib/vo/discount.dart @@ -4,7 +4,7 @@ class Discount { String status; double amount; int weight; - int discountRate; + double discountRate; Discount( {this.code,