|
|
|
|
@ -1,10 +1,18 @@
|
|
|
|
|
import 'dart:convert';
|
|
|
|
|
import 'dart:io';
|
|
|
|
|
|
|
|
|
|
import 'package:android_intent/android_intent.dart';
|
|
|
|
|
import 'package:driverapp/app-icons/driver_app_icons.dart';
|
|
|
|
|
import 'package:driverapp/config/config.dart';
|
|
|
|
|
import 'package:driverapp/core/enum/viewstate.dart';
|
|
|
|
|
import 'package:driverapp/core/model/orders/pending_orders_req_model.dart';
|
|
|
|
|
import 'package:driverapp/core/model/orders/pending_orders_res_model.dart';
|
|
|
|
|
import 'package:driverapp/core/model/orders/update_order_status_request_model.dart';
|
|
|
|
|
import 'package:driverapp/core/service/delivery_tracking_services.dart';
|
|
|
|
|
import 'package:driverapp/core/viewModels/orders_view_model.dart';
|
|
|
|
|
import 'package:driverapp/locator.dart';
|
|
|
|
|
import 'package:driverapp/pages/base/base_view.dart';
|
|
|
|
|
import 'package:driverapp/uitl/app_shared_preferences.dart';
|
|
|
|
|
import 'package:driverapp/uitl/translations_delegate_base.dart';
|
|
|
|
|
import 'package:driverapp/uitl/utils.dart';
|
|
|
|
|
import 'package:driverapp/widgets/bottom_sheet/action_sheet_button.dart';
|
|
|
|
|
@ -19,136 +27,31 @@ import 'package:flutter/cupertino.dart';
|
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
import 'package:hexcolor/hexcolor.dart';
|
|
|
|
|
import 'package:maps_launcher/maps_launcher.dart';
|
|
|
|
|
import 'package:shared_preferences/shared_preferences.dart';
|
|
|
|
|
import 'package:url_launcher/url_launcher.dart';
|
|
|
|
|
|
|
|
|
|
import 'delivery_confirmed_page.dart';
|
|
|
|
|
|
|
|
|
|
// ignore: must_be_immutable
|
|
|
|
|
class InformationPage extends StatelessWidget {
|
|
|
|
|
|
|
|
|
|
class InformationPage extends StatefulWidget {
|
|
|
|
|
final PendingOrdersRes item;
|
|
|
|
|
InformationPage({this.item});
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
State<StatefulWidget> createState() => _InformationPageState();
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// ignore: must_be_immutable
|
|
|
|
|
class _InformationPageState extends State<InformationPage> {
|
|
|
|
|
int _orderStatus;
|
|
|
|
|
PendingOrdersRes _item;
|
|
|
|
|
bool _isDeliveryStarted = false;
|
|
|
|
|
|
|
|
|
|
InformationPage({this.item});
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
showDeliveryOptions(OrdersViewModel model) {
|
|
|
|
|
showModalBottomSheet(
|
|
|
|
|
backgroundColor: Colors.white,
|
|
|
|
|
shape: RoundedRectangleBorder(
|
|
|
|
|
borderRadius: BorderRadius.only(
|
|
|
|
|
topLeft: Radius.circular(50.0),
|
|
|
|
|
topRight: Radius.circular(50.0),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
isScrollControlled: true,
|
|
|
|
|
context: context,
|
|
|
|
|
builder: (BuildContext bc) {
|
|
|
|
|
return FractionallySizedBox(
|
|
|
|
|
heightFactor: 0.35,
|
|
|
|
|
child: ListView(
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Container(
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
borderRadius: BorderRadius.only(
|
|
|
|
|
topLeft: Radius.circular(50.0),
|
|
|
|
|
topRight: Radius.circular(50.0),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
child: Column(
|
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 10,
|
|
|
|
|
),
|
|
|
|
|
Center(
|
|
|
|
|
child: Texts(
|
|
|
|
|
TranslationBase.of(context).selectAction,
|
|
|
|
|
color: Colors.black,
|
|
|
|
|
fontSize: 22,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 10,
|
|
|
|
|
),
|
|
|
|
|
FractionallySizedBox(
|
|
|
|
|
widthFactor: MediaQuery.of(context).orientation ==
|
|
|
|
|
Orientation.portrait
|
|
|
|
|
? 0.9
|
|
|
|
|
: 0.98,
|
|
|
|
|
child: Container(
|
|
|
|
|
height: MediaQuery.of(context).size.height * 0.45,
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
borderRadius: BorderRadius.only(
|
|
|
|
|
topLeft: Radius.circular(50.0),
|
|
|
|
|
topRight: Radius.circular(50.0),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
width: double.infinity,
|
|
|
|
|
child: ListView(
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Column(
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 3,
|
|
|
|
|
child: Container(
|
|
|
|
|
color: Hexcolor("#D5D5D5"),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 15,
|
|
|
|
|
),
|
|
|
|
|
ActionSheetButton(
|
|
|
|
|
label:
|
|
|
|
|
TranslationBase.of(context).delivered,
|
|
|
|
|
icon: DriverApp.deliverd_icon,
|
|
|
|
|
onTap: () {
|
|
|
|
|
selectAction(context, 2, model);
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
SizedBox(height: 15),
|
|
|
|
|
// ActionSheetButton(
|
|
|
|
|
// label: TranslationBase.of(context)
|
|
|
|
|
// .deliveredAccepted,
|
|
|
|
|
// icon: DriverApp.not_available,
|
|
|
|
|
// onTap: () {
|
|
|
|
|
// selectAction(context, 4, model);
|
|
|
|
|
// },
|
|
|
|
|
// ),
|
|
|
|
|
// SizedBox(height: 15),
|
|
|
|
|
ActionSheetButton(
|
|
|
|
|
label: TranslationBase.of(context)
|
|
|
|
|
.deliveredRejected,
|
|
|
|
|
icon: DriverApp.rejected_icon,
|
|
|
|
|
onTap: () {
|
|
|
|
|
selectAction(context, 3, model);
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
SizedBox(height: 15),
|
|
|
|
|
// ActionSheetButton(
|
|
|
|
|
// label: TranslationBase.of(context).canceled,
|
|
|
|
|
// icon: DriverApp.not_reachable_icon,
|
|
|
|
|
// onTap: () {
|
|
|
|
|
// selectAction(context, 6, model);
|
|
|
|
|
// },
|
|
|
|
|
// ),
|
|
|
|
|
// SizedBox(height: 15),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
_item = widget.item;
|
|
|
|
|
|
|
|
|
|
return BaseView<OrdersViewModel>(
|
|
|
|
|
builder: (_, model, w) => AppScaffold(
|
|
|
|
|
@ -175,12 +78,12 @@ class InformationPage extends StatelessWidget {
|
|
|
|
|
child: Container(
|
|
|
|
|
width: MediaQuery.of(context).size.width * 1.0,
|
|
|
|
|
height: MediaQuery.of(context).orientation ==
|
|
|
|
|
Orientation.portrait
|
|
|
|
|
Orientation.portrait
|
|
|
|
|
? MediaQuery.of(context).size.height * 0.70
|
|
|
|
|
: MediaQuery.of(context).size.height * 1.7,
|
|
|
|
|
margin: EdgeInsets.only(
|
|
|
|
|
top: MediaQuery.of(context).orientation ==
|
|
|
|
|
Orientation.portrait
|
|
|
|
|
Orientation.portrait
|
|
|
|
|
? MediaQuery.of(context).size.width * 0.23
|
|
|
|
|
: MediaQuery.of(context).size.width * 0.13),
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
@ -192,88 +95,53 @@ class InformationPage extends StatelessWidget {
|
|
|
|
|
child: Column(
|
|
|
|
|
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,
|
|
|
|
|
//MediaQuery.of(context).size.width * 0.005,
|
|
|
|
|
),
|
|
|
|
|
Padding(
|
|
|
|
|
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),
|
|
|
|
|
btnIcon: Icon(DriverApp.location_1,
|
|
|
|
|
size: MediaQuery.of(context)
|
|
|
|
|
.orientation ==
|
|
|
|
|
Orientation.portrait
|
|
|
|
|
? 50
|
|
|
|
|
: 90,
|
|
|
|
|
color: Color(0xffED1C24)),
|
|
|
|
|
btnName:
|
|
|
|
|
TranslationBase.of(context).location,
|
|
|
|
|
btnFunction: () {
|
|
|
|
|
MapsLauncher.launchCoordinates(
|
|
|
|
|
item.latitude, item.longitude);
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
//TODO: return it back when it needed
|
|
|
|
|
// DeliveryInfoButton(
|
|
|
|
|
// btnColor: Colors.white, //Color(0xFF61B260),
|
|
|
|
|
// btnIcon: Icon(
|
|
|
|
|
// DriverApp.whatsapp,
|
|
|
|
|
// size:
|
|
|
|
|
// MediaQuery.of(context).orientation ==
|
|
|
|
|
// Orientation.portrait
|
|
|
|
|
// ? 50
|
|
|
|
|
// : 90,
|
|
|
|
|
// color: Color(0xFF5EA34A),
|
|
|
|
|
// ),
|
|
|
|
|
// btnName: 'Whatsapp',
|
|
|
|
|
// btnFunction: () {},
|
|
|
|
|
// ),
|
|
|
|
|
// DeliveryInfoButton(
|
|
|
|
|
// btnColor: Colors.white, //Color(0xFFFCB657),
|
|
|
|
|
// btnIcon: Icon(
|
|
|
|
|
// DriverApp.message,
|
|
|
|
|
// size:
|
|
|
|
|
// MediaQuery.of(context).orientation ==
|
|
|
|
|
// Orientation.portrait
|
|
|
|
|
// ? 50
|
|
|
|
|
// : 90,
|
|
|
|
|
// color: Color(0xffFFA540),
|
|
|
|
|
// ),
|
|
|
|
|
// btnName: TranslationBase.of(context).sms,
|
|
|
|
|
// btnFunction: () {},
|
|
|
|
|
// ),
|
|
|
|
|
DeliveryInfoButton(
|
|
|
|
|
btnColor: Colors.white,
|
|
|
|
|
//Theme.of(context).primaryColor,
|
|
|
|
|
btnIcon: Icon(
|
|
|
|
|
DriverApp.call,
|
|
|
|
|
size:
|
|
|
|
|
MediaQuery.of(context).orientation ==
|
|
|
|
|
Orientation.portrait
|
|
|
|
|
Visibility(
|
|
|
|
|
visible: _isDeliveryStarted,
|
|
|
|
|
child: Padding(
|
|
|
|
|
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),
|
|
|
|
|
btnIcon: Icon(DriverApp.location_1,
|
|
|
|
|
size: MediaQuery.of(context)
|
|
|
|
|
.orientation ==
|
|
|
|
|
Orientation.portrait
|
|
|
|
|
? 50
|
|
|
|
|
: 90,
|
|
|
|
|
color: Theme.of(context).primaryColor,
|
|
|
|
|
color: Color(0xffED1C24)),
|
|
|
|
|
btnName:
|
|
|
|
|
TranslationBase.of(context).location,
|
|
|
|
|
btnFunction: () {
|
|
|
|
|
openMapIntent(_item);
|
|
|
|
|
// MapsLauncher.launchCoordinates(
|
|
|
|
|
// _item.latitude, _item.longitude);
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
btnName: TranslationBase.of(context).call,
|
|
|
|
|
btnFunction: () =>
|
|
|
|
|
launch("tel://" + item.mobileNumber),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
DeliveryInfoButton(
|
|
|
|
|
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,
|
|
|
|
|
),
|
|
|
|
|
btnName: TranslationBase.of(context).call,
|
|
|
|
|
btnFunction: () =>
|
|
|
|
|
launch("tel://" + _item.mobileNumber),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: MediaQuery.of(context).size.width * 0.08,
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
margin: EdgeInsets.only(
|
|
|
|
|
left: MediaQuery.of(context).size.width * 0.05,
|
|
|
|
|
@ -300,15 +168,15 @@ class InformationPage extends StatelessWidget {
|
|
|
|
|
padding: const EdgeInsets.only(left: 10),
|
|
|
|
|
child: Column(
|
|
|
|
|
children: List.generate(
|
|
|
|
|
item.itemsQuantitiesList != null
|
|
|
|
|
? item.itemsQuantitiesList.length
|
|
|
|
|
_item.itemsQuantitiesList != null
|
|
|
|
|
? _item.itemsQuantitiesList.length
|
|
|
|
|
: 0, (index) {
|
|
|
|
|
return packageContent(
|
|
|
|
|
packageName: item
|
|
|
|
|
packageName: _item
|
|
|
|
|
.itemsQuantitiesList[index]
|
|
|
|
|
.itemName
|
|
|
|
|
.toString(),
|
|
|
|
|
packageCount: item
|
|
|
|
|
packageCount: _item
|
|
|
|
|
.itemsQuantitiesList[index]
|
|
|
|
|
.quantity
|
|
|
|
|
.toString(),
|
|
|
|
|
@ -324,14 +192,19 @@ class InformationPage extends StatelessWidget {
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
margin: MediaQuery.of(context).orientation ==
|
|
|
|
|
Orientation.portrait
|
|
|
|
|
Orientation.portrait
|
|
|
|
|
? EdgeInsets.all(8.0)
|
|
|
|
|
: EdgeInsets.symmetric(horizontal: 12.0),
|
|
|
|
|
child: SecondaryButton(
|
|
|
|
|
label:
|
|
|
|
|
TranslationBase.of(context).clientReached,
|
|
|
|
|
TranslationBase.of(context).clientReached,
|
|
|
|
|
onTap: () {
|
|
|
|
|
showDeliveryOptions(model);
|
|
|
|
|
locator<DeliveryTrackingServices>()
|
|
|
|
|
.initiateOrderDelivery(_item.orderID)
|
|
|
|
|
.then((results){
|
|
|
|
|
setState(() => _isDeliveryStarted = true);
|
|
|
|
|
// showDeliveryOptions(model);
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
@ -340,16 +213,16 @@ class InformationPage extends StatelessWidget {
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
CustomerBriefCard(
|
|
|
|
|
customerOrderId: item.orderID,
|
|
|
|
|
pharmacyOrderId: item.ePharmacyOrderNo,
|
|
|
|
|
customerFirstName: item.firstName,
|
|
|
|
|
customerLastName: item.lastName,
|
|
|
|
|
mobileNo: item.mobileNumber,
|
|
|
|
|
totalPayment: item.amount,
|
|
|
|
|
deliveryTime: item.orderCreatedOn,
|
|
|
|
|
longitude: item.longitude,
|
|
|
|
|
latitude: item.latitude,
|
|
|
|
|
distanceInKilometers: item.distanceInKilometers,
|
|
|
|
|
customerOrderId: _item.orderID,
|
|
|
|
|
pharmacyOrderId: _item.ePharmacyOrderNo,
|
|
|
|
|
customerFirstName: _item.firstName,
|
|
|
|
|
customerLastName: _item.lastName,
|
|
|
|
|
mobileNo: _item.mobileNumber,
|
|
|
|
|
totalPayment: _item.amount,
|
|
|
|
|
deliveryTime: _item.orderCreatedOn,
|
|
|
|
|
longitude: _item.longitude,
|
|
|
|
|
latitude: _item.latitude,
|
|
|
|
|
distanceInKilometers: _item.distanceInKilometers,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
@ -361,6 +234,128 @@ class InformationPage extends StatelessWidget {
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
showDeliveryOptions(OrdersViewModel model) {
|
|
|
|
|
showModalBottomSheet(
|
|
|
|
|
backgroundColor: Colors.white,
|
|
|
|
|
shape: RoundedRectangleBorder(
|
|
|
|
|
borderRadius: BorderRadius.only(
|
|
|
|
|
topLeft: Radius.circular(50.0),
|
|
|
|
|
topRight: Radius.circular(50.0),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
isScrollControlled: true,
|
|
|
|
|
context: context,
|
|
|
|
|
builder: (BuildContext bc) {
|
|
|
|
|
return FractionallySizedBox(
|
|
|
|
|
heightFactor: 0.35,
|
|
|
|
|
child: ListView(
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Container(
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
borderRadius: BorderRadius.only(
|
|
|
|
|
topLeft: Radius.circular(50.0),
|
|
|
|
|
topRight: Radius.circular(50.0),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
child: Column(
|
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 10,
|
|
|
|
|
),
|
|
|
|
|
Center(
|
|
|
|
|
child: Texts(
|
|
|
|
|
TranslationBase.of(context).selectAction,
|
|
|
|
|
color: Colors.black,
|
|
|
|
|
fontSize: 22,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 10,
|
|
|
|
|
),
|
|
|
|
|
FractionallySizedBox(
|
|
|
|
|
widthFactor: MediaQuery.of(context).orientation ==
|
|
|
|
|
Orientation.portrait
|
|
|
|
|
? 0.9
|
|
|
|
|
: 0.98,
|
|
|
|
|
child: Container(
|
|
|
|
|
height: MediaQuery.of(context).size.height * 0.45,
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
borderRadius: BorderRadius.only(
|
|
|
|
|
topLeft: Radius.circular(50.0),
|
|
|
|
|
topRight: Radius.circular(50.0),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
width: double.infinity,
|
|
|
|
|
child: ListView(
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Column(
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 3,
|
|
|
|
|
child: Container(
|
|
|
|
|
color: HexColor("#D5D5D5"),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 15,
|
|
|
|
|
),
|
|
|
|
|
ActionSheetButton(
|
|
|
|
|
label:
|
|
|
|
|
TranslationBase.of(context).delivered,
|
|
|
|
|
icon: DriverApp.deliverd_icon,
|
|
|
|
|
onTap: () {
|
|
|
|
|
selectAction(context, 2, model);
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
SizedBox(height: 15),
|
|
|
|
|
// ActionSheetButton(
|
|
|
|
|
// label: TranslationBase.of(context)
|
|
|
|
|
// .deliveredAccepted,
|
|
|
|
|
// icon: DriverApp.not_available,
|
|
|
|
|
// onTap: () {
|
|
|
|
|
// selectAction(context, 4, model);
|
|
|
|
|
// },
|
|
|
|
|
// ),
|
|
|
|
|
// SizedBox(height: 15),
|
|
|
|
|
ActionSheetButton(
|
|
|
|
|
label: TranslationBase.of(context)
|
|
|
|
|
.deliveredRejected,
|
|
|
|
|
icon: DriverApp.rejected_icon,
|
|
|
|
|
onTap: () {
|
|
|
|
|
selectAction(context, 3, model);
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
SizedBox(height: 15),
|
|
|
|
|
// ActionSheetButton(
|
|
|
|
|
// label: TranslationBase.of(context).canceled,
|
|
|
|
|
// icon: DriverApp.not_reachable_icon,
|
|
|
|
|
// onTap: () {
|
|
|
|
|
// selectAction(context, 6, model);
|
|
|
|
|
// },
|
|
|
|
|
// ),
|
|
|
|
|
// SizedBox(height: 15),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
selectAction(BuildContext context, orderStatus, OrdersViewModel model) {
|
|
|
|
|
String orderStatusText;
|
|
|
|
|
this._orderStatus = orderStatus;
|
|
|
|
|
@ -397,11 +392,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);
|
|
|
|
|
@ -420,9 +415,28 @@ class InformationPage extends StatelessWidget {
|
|
|
|
|
context,
|
|
|
|
|
MaterialPageRoute(
|
|
|
|
|
builder: (context) =>
|
|
|
|
|
DeliveryConfirmedPage(item),
|
|
|
|
|
DeliveryConfirmedPage(_item),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
openMapIntent(PendingOrdersRes order) async{
|
|
|
|
|
Utils.getLocation().then((locationData){
|
|
|
|
|
if(locationData != null){
|
|
|
|
|
var url = "https://www.google.com/maps/dir/?api=1&destination=24.701833,46.697642&travelmode=driving&dir_action=navigate";
|
|
|
|
|
if (Platform.isAndroid) {
|
|
|
|
|
var intent = AndroidIntent(action: 'action_view',data: url,package: 'com.google.android.apps.maps');
|
|
|
|
|
intent.launch();
|
|
|
|
|
}else {
|
|
|
|
|
print(url);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Start updating server wit your current location
|
|
|
|
|
locator<DeliveryTrackingServices>().startLocationUpdate(order.orderID);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|