Merge branch 'master' of tzw/fcs into master

This commit is contained in:
2020-07-01 07:09:12 +00:00
committed by Gogs
4 changed files with 199 additions and 147 deletions

View File

@@ -56,6 +56,7 @@ class PickUpModel extends BaseModel {
address: '154-19 64th Ave.\nFlushing, NY 11367', address: '154-19 64th Ave.\nFlushing, NY 11367',
handlingFee: 5000, handlingFee: 5000,
isCourier: true, isCourier: true,
radioIndex: 2,
cargoTypes: [ cargoTypes: [
Cargo(type: 'General Cargo', weight: 25), Cargo(type: 'General Cargo', weight: 25),
Cargo(type: 'Medicine', weight: 20), Cargo(type: 'Medicine', weight: 20),
@@ -90,6 +91,7 @@ class PickUpModel extends BaseModel {
date: DateTime(2020, 5, 9), date: DateTime(2020, 5, 9),
address: '154-19 64th Ave.\nFlushing, NY 11367', address: '154-19 64th Ave.\nFlushing, NY 11367',
handlingFee: 5000, handlingFee: 5000,
radioIndex: 3,
cargoTypes: [ cargoTypes: [
Cargo(type: 'General Cargo', weight: 25), Cargo(type: 'General Cargo', weight: 25),
Cargo(type: 'Medicine', weight: 20), Cargo(type: 'Medicine', weight: 20),

View File

@@ -58,8 +58,7 @@ class _PickUpEditorState extends State<PickUpEditor> {
bool isNew; bool isNew;
ShippingAddress _shippingAddress = new ShippingAddress(); ShippingAddress _shippingAddress = new ShippingAddress();
dynamic _currVal = 1; int _currVal = 1;
String _currText = '';
@override @override
void initState() { void initState() {
@@ -74,6 +73,7 @@ class _PickUpEditorState extends State<PickUpEditor> {
_weightEditingController.text = _pickUp.weight.toString(); _weightEditingController.text = _pickUp.weight.toString();
_pickupDate.text = dateFormatter.format(now); _pickupDate.text = dateFormatter.format(now);
_handlingFeeController.text = numberFormatter.format(_pickUp.handlingFee); _handlingFeeController.text = numberFormatter.format(_pickUp.handlingFee);
_currVal = _pickUp.radioIndex;
var mainModel = Provider.of<MainModel>(context, listen: false); var mainModel = Provider.of<MainModel>(context, listen: false);
_recipientNameEditingController.text = mainModel.recipient.name; _recipientNameEditingController.text = mainModel.recipient.name;
@@ -230,6 +230,7 @@ class _PickUpEditorState extends State<PickUpEditor> {
MainModel mainModel = Provider.of<MainModel>(context); MainModel mainModel = Provider.of<MainModel>(context);
var boxModel = Provider.of<BoxModel>(context); var boxModel = Provider.of<BoxModel>(context);
var shipmentModel = Provider.of<ShipmentModel>(context);
return LocalProgress( return LocalProgress(
inAsyncCall: _isLoading, inAsyncCall: _isLoading,
@@ -308,153 +309,200 @@ class _PickUpEditorState extends State<PickUpEditor> {
), ),
], ],
), ),
_currVal == 3
ExpansionTile( ? Container(
title: Text( child: ShippingAddressRow(
'Package Information', shippingAddress: ShippingAddress(
style: TextStyle( fullName: 'Myo Min',
color: primaryColor, fontWeight: FontWeight.bold), addressLine1: '154-19 64th Ave.',
), addressLine2: 'Flushing',
children: <Widget>[ city: 'NY',
Column( state: 'NY',
children: getBoxList(context, boxModel.boxes), phoneNumber: '+1 (292)215-2247'),
),
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,
),
), ),
), )
), : _currVal == 4
SizedBox(height: 10.0), ? Container(
], child: Column(
), children: <Widget>[
ExpansionTile( ShippingAddressRow(
title: Text( shippingAddress:
'Pickup Location / Time', shipmentModel.shippingAddresses[1]),
style: TextStyle( Container(
color: primaryColor, fontWeight: FontWeight.bold), padding: EdgeInsets.only(
), top: 20, bottom: 15, right: 15),
children: <Widget>[ child: Align(
Padding( alignment: Alignment.bottomRight,
padding: const EdgeInsets.only(left: 20.0), child: Container(
child: Column( width: 120,
children: <Widget>[ height: 40,
Row( child: FloatingActionButton.extended(
children: <Widget>[ materialTapTargetSize:
Icon( MaterialTapTargetSize.shrinkWrap,
Icons.location_on, onPressed: () {},
color: primaryColor, icon: Icon(Icons.add),
), label: Text(
Padding( 'Select\nAddress',
padding: const EdgeInsets.all(8.0), style: TextStyle(fontSize: 12),
child: Text('Pickup Address'), ),
), backgroundColor: primaryColor,
], ),
), ),
Padding( ),
padding: const EdgeInsets.only(left: 10.0), ),
child: ShippingAddressRow( ],
shippingAddress: _shippingAddress), ))
), : ExpansionTile(
Container( title: Text(
padding: EdgeInsets.only( 'Package Information',
top: 20, bottom: 15, right: 15), style: TextStyle(
child: Align( color: primaryColor,
alignment: Alignment.bottomRight, fontWeight: FontWeight.bold),
child: Container( ),
width: 120, children: <Widget>[
height: 40, Column(
child: FloatingActionButton.extended( children: getBoxList(context, boxModel.boxes),
materialTapTargetSize: ),
MaterialTapTargetSize.shrinkWrap, Container(
onPressed: () {}, padding: EdgeInsets.only(
icon: Icon(Icons.add), top: 20, bottom: 15, right: 15),
label: Text( child: Align(
'Select\nAddress', alignment: Alignment.bottomRight,
style: TextStyle(fontSize: 12), 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),
],
),
_currVal == 3 || _currVal == 4
? Container()
: ExpansionTile(
title: Text(
'Pickup Location / Time',
style: TextStyle(
color: primaryColor,
fontWeight: FontWeight.bold),
),
children: <Widget>[
Padding(
padding: const EdgeInsets.only(left: 20.0),
child: Column(
children: <Widget>[
Row(
children: <Widget>[
Icon(
Icons.location_on,
color: primaryColor,
),
Padding(
padding: const EdgeInsets.all(8.0),
child: Text('Pickup Address'),
),
],
),
Padding(
padding: const EdgeInsets.only(left: 10.0),
child: ShippingAddressRow(
shippingAddress: _shippingAddress),
),
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,
),
),
),
),
],
),
// child: ExpansionTile(
// leading: Icon(
// Icons.location_on,
// color: primaryColor,
// ),
// title: Text('My Address'),
// children: [
// Padding(
// padding: const EdgeInsets.only(left: 10.0),
// child: ShippingAddressRow(
// shippingAddress: _shippingAddress),
// ),
// 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,
// ),
// ),
// ),
// ),
// ],
// ),
),
widget.pickUp == null
? pickupTime
: widget.pickUp.status == 'Pending'
? pickupTime
: pickupTimeReadOnly,
Padding(
padding: const EdgeInsets.only(left: 20.0),
child: Column(
children: <Widget>[
SizedBox(height: 5),
Container(height: 50.0, child: requestDateBox)
],
), ),
), ),
SizedBox(height: 15.0),
], ],
), ),
// child: ExpansionTile(
// leading: Icon(
// Icons.location_on,
// color: primaryColor,
// ),
// title: Text('My Address'),
// children: [
// Padding(
// padding: const EdgeInsets.only(left: 10.0),
// child: ShippingAddressRow(
// shippingAddress: _shippingAddress),
// ),
// 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,
// ),
// ),
// ),
// ),
// ],
// ),
),
widget.pickUp == null
? pickupTime
: widget.pickUp.status == 'Pending'
? pickupTime
: pickupTimeReadOnly,
Padding(
padding: const EdgeInsets.only(left: 20.0),
child: Column(
children: <Widget>[
SizedBox(height: 5),
Container(height: 50.0, child: requestDateBox)
],
),
),
SizedBox(height: 15.0),
],
),
// ExpansionTile( // ExpansionTile(
// title: Text( // title: Text(
// 'Package Information', // 'Package Information',
@@ -555,7 +603,7 @@ class _PickUpEditorState extends State<PickUpEditor> {
child: Container( child: Container(
width: 250, width: 250,
child: FlatButton( child: FlatButton(
child: Text('Request for pickup'), child: Text('Request for shipment'),
color: primaryColor, color: primaryColor,
textColor: Colors.white, textColor: Colors.white,
onPressed: () { onPressed: () {
@@ -573,7 +621,7 @@ class _PickUpEditorState extends State<PickUpEditor> {
child: Container( child: Container(
width: 250, width: 250,
child: FlatButton( child: FlatButton(
child: Text('Complete Pickup'), child: Text('Complete Shipment'),
color: primaryColor, color: primaryColor,
textColor: Colors.white, textColor: Colors.white,
onPressed: () { onPressed: () {
@@ -587,7 +635,7 @@ class _PickUpEditorState extends State<PickUpEditor> {
child: Container( child: Container(
width: 250, width: 250,
child: FlatButton( child: FlatButton(
child: Text('Assign Pickup'), child: Text('Assign Shipment'),
color: primaryColor, color: primaryColor,
textColor: Colors.white, textColor: Colors.white,
onPressed: () { onPressed: () {
@@ -601,7 +649,7 @@ class _PickUpEditorState extends State<PickUpEditor> {
child: Container( child: Container(
width: 250, width: 250,
child: FlatButton( child: FlatButton(
child: Text('Cancel Pickup'), child: Text('Cancel Shipment'),
color: Colors.grey[600], color: Colors.grey[600],
textColor: Colors.white, textColor: Colors.white,
onPressed: () { onPressed: () {

View File

@@ -14,6 +14,7 @@ class PickUp {
DateTime date; DateTime date;
List<Cargo> cargoTypes; List<Cargo> cargoTypes;
bool isCourier; bool isCourier;
int radioIndex;
PickUp( PickUp(
{this.id, {this.id,
@@ -28,7 +29,8 @@ class PickUp {
this.status, this.status,
this.date, this.date,
this.cargoTypes, this.cargoTypes,
this.isCourier=false}); this.isCourier = false,
this.radioIndex = 1});
int get last => DateTime.now().difference(date).inDays; int get last => DateTime.now().difference(date).inDays;

View File

@@ -1,5 +1,5 @@
class RadioGroup { class RadioGroup {
String text; String text;
dynamic index; int index;
RadioGroup({this.text, this.index}); RadioGroup({this.text, this.index});
} }