|
|
|
|
@ -71,7 +71,7 @@ class InformationPage extends StatelessWidget {
|
|
|
|
|
),
|
|
|
|
|
FractionallySizedBox(
|
|
|
|
|
widthFactor: MediaQuery.of(context).orientation ==
|
|
|
|
|
Orientation.portrait
|
|
|
|
|
Orientation.portrait
|
|
|
|
|
? 0.9
|
|
|
|
|
: 0.98,
|
|
|
|
|
child: Container(
|
|
|
|
|
@ -168,39 +168,18 @@ class InformationPage extends StatelessWidget {
|
|
|
|
|
Padding(
|
|
|
|
|
padding: const EdgeInsets.only(top: 75.0),
|
|
|
|
|
child: Container(
|
|
|
|
|
width: MediaQuery
|
|
|
|
|
.of(context)
|
|
|
|
|
.size
|
|
|
|
|
.width * 1.0,
|
|
|
|
|
height: MediaQuery
|
|
|
|
|
.of(context)
|
|
|
|
|
.orientation ==
|
|
|
|
|
Orientation.portrait
|
|
|
|
|
? MediaQuery
|
|
|
|
|
.of(context)
|
|
|
|
|
.size
|
|
|
|
|
.height * 0.70
|
|
|
|
|
: MediaQuery
|
|
|
|
|
.of(context)
|
|
|
|
|
.size
|
|
|
|
|
.height * 1.7,
|
|
|
|
|
margin: EdgeInsets.only(
|
|
|
|
|
top: MediaQuery
|
|
|
|
|
.of(context)
|
|
|
|
|
.orientation ==
|
|
|
|
|
width: MediaQuery.of(context).size.width * 1.0,
|
|
|
|
|
height: MediaQuery.of(context).orientation ==
|
|
|
|
|
Orientation.portrait
|
|
|
|
|
? MediaQuery
|
|
|
|
|
.of(context)
|
|
|
|
|
.size
|
|
|
|
|
.width * 0.23
|
|
|
|
|
: MediaQuery
|
|
|
|
|
.of(context)
|
|
|
|
|
.size
|
|
|
|
|
.width * 0.13),
|
|
|
|
|
? MediaQuery.of(context).size.height * 0.70
|
|
|
|
|
: MediaQuery.of(context).size.height * 1.7,
|
|
|
|
|
margin: EdgeInsets.only(
|
|
|
|
|
top: MediaQuery.of(context).orientation ==
|
|
|
|
|
Orientation.portrait
|
|
|
|
|
? MediaQuery.of(context).size.width * 0.23
|
|
|
|
|
: MediaQuery.of(context).size.width * 0.13),
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
color: Theme
|
|
|
|
|
.of(context)
|
|
|
|
|
.scaffoldBackgroundColor,
|
|
|
|
|
color: Theme.of(context).scaffoldBackgroundColor,
|
|
|
|
|
borderRadius: BorderRadius.only(
|
|
|
|
|
topLeft: Radius.circular(45),
|
|
|
|
|
topRight: Radius.circular(45)),
|
|
|
|
|
@ -209,142 +188,98 @@ class InformationPage extends StatelessWidget {
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: MediaQuery
|
|
|
|
|
.of(context)
|
|
|
|
|
.orientation ==
|
|
|
|
|
Orientation.portrait
|
|
|
|
|
? MediaQuery
|
|
|
|
|
.of(context)
|
|
|
|
|
.size
|
|
|
|
|
.height *
|
|
|
|
|
0.10
|
|
|
|
|
: MediaQuery
|
|
|
|
|
.of(context)
|
|
|
|
|
.size
|
|
|
|
|
.height *
|
|
|
|
|
0.29,
|
|
|
|
|
height: MediaQuery.of(context).orientation ==
|
|
|
|
|
Orientation.portrait
|
|
|
|
|
? MediaQuery.of(context).size.height * 0.10
|
|
|
|
|
: MediaQuery.of(context).size.height * 0.29,
|
|
|
|
|
//MediaQuery.of(context).size.width * 0.005,
|
|
|
|
|
),
|
|
|
|
|
Padding(
|
|
|
|
|
padding: MediaQuery
|
|
|
|
|
.of(context)
|
|
|
|
|
.orientation ==
|
|
|
|
|
Orientation.portrait
|
|
|
|
|
padding: MediaQuery.of(context).orientation ==
|
|
|
|
|
Orientation.portrait
|
|
|
|
|
? EdgeInsets.only(top: 60.0)
|
|
|
|
|
: EdgeInsets.only(top: 15.0),
|
|
|
|
|
child: Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
DeliveryInfoButton(
|
|
|
|
|
btnColor:
|
|
|
|
|
Colors.white, //Color(0xffED1C24),
|
|
|
|
|
btnColor: Colors.white, //Color(0xffED1C24),
|
|
|
|
|
btnIcon: Icon(DriverApp.location_1,
|
|
|
|
|
size: MediaQuery
|
|
|
|
|
.of(context)
|
|
|
|
|
.orientation ==
|
|
|
|
|
Orientation.portrait
|
|
|
|
|
size: MediaQuery.of(context)
|
|
|
|
|
.orientation ==
|
|
|
|
|
Orientation.portrait
|
|
|
|
|
? 50
|
|
|
|
|
: 90,
|
|
|
|
|
color: Color(0xffED1C24)),
|
|
|
|
|
btnName: TranslationBase
|
|
|
|
|
.of(context)
|
|
|
|
|
.location,
|
|
|
|
|
btnName:
|
|
|
|
|
TranslationBase.of(context).location,
|
|
|
|
|
btnFunction: () {
|
|
|
|
|
MapsLauncher.launchCoordinates(
|
|
|
|
|
item.latitude, item.longitude);
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
DeliveryInfoButton(
|
|
|
|
|
btnColor:
|
|
|
|
|
Colors.white, //Color(0xFF61B260),
|
|
|
|
|
btnColor: Colors.white, //Color(0xFF61B260),
|
|
|
|
|
btnIcon: Icon(
|
|
|
|
|
DriverApp.whatsapp,
|
|
|
|
|
size: MediaQuery
|
|
|
|
|
.of(context)
|
|
|
|
|
.orientation ==
|
|
|
|
|
Orientation.portrait
|
|
|
|
|
? 50
|
|
|
|
|
: 90,
|
|
|
|
|
size:
|
|
|
|
|
MediaQuery.of(context).orientation ==
|
|
|
|
|
Orientation.portrait
|
|
|
|
|
? 50
|
|
|
|
|
: 90,
|
|
|
|
|
color: Color(0xFF5EA34A),
|
|
|
|
|
),
|
|
|
|
|
btnName: 'Whatsapp',
|
|
|
|
|
btnFunction: () {},
|
|
|
|
|
),
|
|
|
|
|
DeliveryInfoButton(
|
|
|
|
|
btnColor:
|
|
|
|
|
Colors.white, //Color(0xFFFCB657),
|
|
|
|
|
btnColor: Colors.white, //Color(0xFFFCB657),
|
|
|
|
|
btnIcon: Icon(
|
|
|
|
|
DriverApp.message,
|
|
|
|
|
size: MediaQuery
|
|
|
|
|
.of(context)
|
|
|
|
|
.orientation ==
|
|
|
|
|
Orientation.portrait
|
|
|
|
|
? 50
|
|
|
|
|
: 90,
|
|
|
|
|
size:
|
|
|
|
|
MediaQuery.of(context).orientation ==
|
|
|
|
|
Orientation.portrait
|
|
|
|
|
? 50
|
|
|
|
|
: 90,
|
|
|
|
|
color: Color(0xffFFA540),
|
|
|
|
|
),
|
|
|
|
|
btnName:
|
|
|
|
|
TranslationBase
|
|
|
|
|
.of(context)
|
|
|
|
|
.sms,
|
|
|
|
|
btnName: TranslationBase.of(context).sms,
|
|
|
|
|
btnFunction: () {},
|
|
|
|
|
),
|
|
|
|
|
DeliveryInfoButton(
|
|
|
|
|
btnColor: Colors
|
|
|
|
|
.white,
|
|
|
|
|
btnColor: Colors.white,
|
|
|
|
|
//Theme.of(context).primaryColor,
|
|
|
|
|
btnIcon: Icon(
|
|
|
|
|
DriverApp.call,
|
|
|
|
|
size: MediaQuery
|
|
|
|
|
.of(context)
|
|
|
|
|
.orientation ==
|
|
|
|
|
Orientation.portrait
|
|
|
|
|
? 50
|
|
|
|
|
: 90,
|
|
|
|
|
color: Theme
|
|
|
|
|
.of(context)
|
|
|
|
|
.primaryColor,
|
|
|
|
|
size:
|
|
|
|
|
MediaQuery.of(context).orientation ==
|
|
|
|
|
Orientation.portrait
|
|
|
|
|
? 50
|
|
|
|
|
: 90,
|
|
|
|
|
color: Theme.of(context).primaryColor,
|
|
|
|
|
),
|
|
|
|
|
btnName:
|
|
|
|
|
TranslationBase
|
|
|
|
|
.of(context)
|
|
|
|
|
.call,
|
|
|
|
|
btnName: TranslationBase.of(context).call,
|
|
|
|
|
btnFunction: () =>
|
|
|
|
|
launch(
|
|
|
|
|
"tel://" + item.mobileNumber),
|
|
|
|
|
launch("tel://" + item.mobileNumber),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height:
|
|
|
|
|
MediaQuery
|
|
|
|
|
.of(context)
|
|
|
|
|
.size
|
|
|
|
|
.width * 0.08,
|
|
|
|
|
height: MediaQuery.of(context).size.width * 0.08,
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
margin: EdgeInsets.only(
|
|
|
|
|
left: MediaQuery
|
|
|
|
|
.of(context)
|
|
|
|
|
.size
|
|
|
|
|
.width *
|
|
|
|
|
0.05,
|
|
|
|
|
right: MediaQuery
|
|
|
|
|
.of(context)
|
|
|
|
|
.size
|
|
|
|
|
.width *
|
|
|
|
|
0.05,
|
|
|
|
|
left: MediaQuery.of(context).size.width * 0.05,
|
|
|
|
|
right: MediaQuery.of(context).size.width * 0.05,
|
|
|
|
|
),
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment:
|
|
|
|
|
CrossAxisAlignment.start,
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Padding(
|
|
|
|
|
padding: const EdgeInsets.only(left: 8),
|
|
|
|
|
child: Text(
|
|
|
|
|
TranslationBase
|
|
|
|
|
.of(context)
|
|
|
|
|
TranslationBase.of(context)
|
|
|
|
|
.packageContent,
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
fontWeight: FontWeight.w900,
|
|
|
|
|
@ -352,21 +287,15 @@ class InformationPage extends StatelessWidget {
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height:
|
|
|
|
|
MediaQuery
|
|
|
|
|
.of(context)
|
|
|
|
|
.size
|
|
|
|
|
.width *
|
|
|
|
|
height: MediaQuery.of(context).size.width *
|
|
|
|
|
0.05,
|
|
|
|
|
),
|
|
|
|
|
Padding(
|
|
|
|
|
padding:
|
|
|
|
|
const EdgeInsets.only(left: 10),
|
|
|
|
|
padding: const EdgeInsets.only(left: 10),
|
|
|
|
|
child: Column(
|
|
|
|
|
children: List.generate(
|
|
|
|
|
item.itemsQuantitiesList != null
|
|
|
|
|
? item.itemsQuantitiesList
|
|
|
|
|
.length
|
|
|
|
|
? item.itemsQuantitiesList.length
|
|
|
|
|
: 0, (index) {
|
|
|
|
|
return packageContent(
|
|
|
|
|
packageName: item
|
|
|
|
|
@ -385,29 +314,21 @@ class InformationPage extends StatelessWidget {
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height:
|
|
|
|
|
MediaQuery
|
|
|
|
|
.of(context)
|
|
|
|
|
.size
|
|
|
|
|
.width * 0.1,
|
|
|
|
|
height: MediaQuery.of(context).size.width * 0.1,
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
margin: MediaQuery
|
|
|
|
|
.of(context)
|
|
|
|
|
.orientation ==
|
|
|
|
|
Orientation.portrait
|
|
|
|
|
margin: MediaQuery.of(context).orientation ==
|
|
|
|
|
Orientation.portrait
|
|
|
|
|
? EdgeInsets.all(8.0)
|
|
|
|
|
: EdgeInsets.symmetric(horizontal: 12.0),
|
|
|
|
|
child: SecondaryButton(
|
|
|
|
|
label: TranslationBase
|
|
|
|
|
.of(context)
|
|
|
|
|
.clientReached,
|
|
|
|
|
label:
|
|
|
|
|
TranslationBase.of(context).clientReached,
|
|
|
|
|
onTap: () {
|
|
|
|
|
showDeliveryOptions(model);
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
@ -421,6 +342,7 @@ class InformationPage extends StatelessWidget {
|
|
|
|
|
deliveryTime: item.orderCreatedOn,
|
|
|
|
|
longitude: item.longitude,
|
|
|
|
|
latitude: item.latitude,
|
|
|
|
|
distanceInKilometers: item.distanceInKilometers,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
@ -437,19 +359,13 @@ class InformationPage extends StatelessWidget {
|
|
|
|
|
this._orderStatus = orderStatus;
|
|
|
|
|
switch (orderStatus) {
|
|
|
|
|
case 3:
|
|
|
|
|
orderStatusText = TranslationBase
|
|
|
|
|
.of(context)
|
|
|
|
|
.delivered;
|
|
|
|
|
orderStatusText = TranslationBase.of(context).delivered;
|
|
|
|
|
break;
|
|
|
|
|
case 4:
|
|
|
|
|
orderStatusText = TranslationBase
|
|
|
|
|
.of(context)
|
|
|
|
|
.deliveredAccepted;
|
|
|
|
|
orderStatusText = TranslationBase.of(context).deliveredAccepted;
|
|
|
|
|
break;
|
|
|
|
|
case 5:
|
|
|
|
|
orderStatusText = TranslationBase
|
|
|
|
|
.of(context)
|
|
|
|
|
.deliveredRejected;
|
|
|
|
|
orderStatusText = TranslationBase.of(context).deliveredRejected;
|
|
|
|
|
break;
|
|
|
|
|
case 6:
|
|
|
|
|
orderStatusText = TranslationBase.of(context).canceled;
|
|
|
|
|
@ -470,11 +386,11 @@ class InformationPage extends StatelessWidget {
|
|
|
|
|
|
|
|
|
|
updateOrderStatus(BuildContext context, OrdersViewModel model) async {
|
|
|
|
|
UpdateOrderStatusRequestModel updateOrderStatusRequestModel =
|
|
|
|
|
UpdateOrderStatusRequestModel(
|
|
|
|
|
deliveryOrderID: item.orderID,
|
|
|
|
|
deliveryOrderStatus: _orderStatus,
|
|
|
|
|
rejectionReason: "NO Reason",
|
|
|
|
|
cancleReason: "");
|
|
|
|
|
UpdateOrderStatusRequestModel(
|
|
|
|
|
deliveryOrderID: item.orderID,
|
|
|
|
|
deliveryOrderStatus: _orderStatus,
|
|
|
|
|
rejectionReason: "NO Reason",
|
|
|
|
|
cancleReason: "");
|
|
|
|
|
await model.updateOrderStatus(updateOrderStatusRequestModel);
|
|
|
|
|
if (model.state == ViewState.ErrorLocal) {
|
|
|
|
|
Utils.showErrorToast(model.error);
|
|
|
|
|
|