From 0aa864313f8503dbc9e6e80da5047db83e39dd03 Mon Sep 17 00:00:00 2001 From: Thinzar Win Date: Wed, 1 Jul 2020 08:29:51 +0630 Subject: [PATCH] update shipment --- lib/model/pickup_model.dart | 2 - lib/pages/pickup_editor.dart | 110 ++++++++++++++++++++++------------- 2 files changed, 71 insertions(+), 41 deletions(-) diff --git a/lib/model/pickup_model.dart b/lib/model/pickup_model.dart index 5e8a947..b40004c 100644 --- a/lib/model/pickup_model.dart +++ b/lib/model/pickup_model.dart @@ -74,8 +74,6 @@ class PickUpModel extends BaseModel { date: DateTime(2020, 5, 6), address: '154-19 64th Ave.\nFlushing, NY 11367', handlingFee: 5000, - isCourier: true, - radioIndex: 4, cargoTypes: [ Cargo(type: 'General Cargo', weight: 25), Cargo(type: 'Medicine', weight: 20), diff --git a/lib/pages/pickup_editor.dart b/lib/pages/pickup_editor.dart index 2cc2bed..fcdbe1c 100644 --- a/lib/pages/pickup_editor.dart +++ b/lib/pages/pickup_editor.dart @@ -230,7 +230,7 @@ class _PickUpEditorState extends State { MainModel mainModel = Provider.of(context); var boxModel = Provider.of(context); - // var shipmentModel = Provider.of(context); + var shipmentModel = Provider.of(context); return LocalProgress( inAsyncCall: _isLoading, @@ -321,48 +321,80 @@ class _PickUpEditorState extends State { phoneNumber: '+1 (292)215-2247'), ), ) - : 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), + : _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, + 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, + ), ), - backgroundColor: primaryColor, ), ), - ), + SizedBox(height: 10.0), + ], ), - SizedBox(height: 10.0), - ], - ), - _currVal == 3 + _currVal == 3 || _currVal == 4 ? Container() : ExpansionTile( title: Text(