3/30/1
This commit is contained in:
@@ -53,6 +53,7 @@ class AppLink {
|
|||||||
static String getRideStatusFromStartApp =
|
static String getRideStatusFromStartApp =
|
||||||
"$ride/rides/getRideStatusFromStartApp.php";
|
"$ride/rides/getRideStatusFromStartApp.php";
|
||||||
static String updateRides = "$ride/rides/update.php";
|
static String updateRides = "$ride/rides/update.php";
|
||||||
|
static String updateStausFromSpeed = "$ride/rides/updateStausFromSpeed.php";
|
||||||
static String deleteRides = "$ride/rides/delete.php";
|
static String deleteRides = "$ride/rides/delete.php";
|
||||||
|
|
||||||
//-----------------DriverPayment------------------
|
//-----------------DriverPayment------------------
|
||||||
@@ -63,7 +64,6 @@ class AppLink {
|
|||||||
static String getKazanPercent = "$ride/kazan/get.php";
|
static String getKazanPercent = "$ride/kazan/get.php";
|
||||||
static String addKazanPercent = "$ride/kazan/add.php";
|
static String addKazanPercent = "$ride/kazan/add.php";
|
||||||
|
|
||||||
|
|
||||||
////-----------------DriverPayment------------------
|
////-----------------DriverPayment------------------
|
||||||
static String addDriverpayment = "$ride/payment/add.php";
|
static String addDriverpayment = "$ride/payment/add.php";
|
||||||
static String addDriverPaymentPoints = "$ride/driverPayment/add.php";
|
static String addDriverPaymentPoints = "$ride/driverPayment/add.php";
|
||||||
|
|||||||
@@ -83,7 +83,9 @@ class OrderRequestPage extends StatelessWidget {
|
|||||||
return MyScafolld(
|
return MyScafolld(
|
||||||
title: 'Order Details'.tr,
|
title: 'Order Details'.tr,
|
||||||
body: [
|
body: [
|
||||||
ListView(
|
Padding(
|
||||||
|
padding: const EdgeInsets.symmetric(horizontal: 16),
|
||||||
|
child: ListView(
|
||||||
// crossAxisAlignment: CrossAxisAlignment.start,
|
// crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
// SizedBox(height: 200, child: Text(pointsList.toString())),
|
// SizedBox(height: 200, child: Text(pointsList.toString())),
|
||||||
@@ -103,8 +105,8 @@ class OrderRequestPage extends StatelessWidget {
|
|||||||
markers: {
|
markers: {
|
||||||
Marker(
|
Marker(
|
||||||
markerId: MarkerId('MyLocation'.tr),
|
markerId: MarkerId('MyLocation'.tr),
|
||||||
position:
|
position: LatLng(
|
||||||
LatLng(latPassengerLocation, lngPassengerLocation),
|
latPassengerLocation, lngPassengerLocation),
|
||||||
draggable: true,
|
draggable: true,
|
||||||
icon: startIcon),
|
icon: startIcon),
|
||||||
Marker(
|
Marker(
|
||||||
@@ -199,6 +201,7 @@ class OrderRequestPage extends StatelessWidget {
|
|||||||
decoration: AppStyle.boxDecoration1,
|
decoration: AppStyle.boxDecoration1,
|
||||||
child: Column(
|
child: Column(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Row(
|
Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
@@ -267,34 +270,6 @@ class OrderRequestPage extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
// Padding(
|
|
||||||
// padding: const EdgeInsets.all(8.0),
|
|
||||||
// child: RichText(
|
|
||||||
// text: TextSpan(
|
|
||||||
// text: 'Duration To Passenger is '.tr,
|
|
||||||
// style: AppStyle.title,
|
|
||||||
// children: [
|
|
||||||
// TextSpan(
|
|
||||||
// text: myList[11].toString(),
|
|
||||||
// style: AppStyle.headTitle2),
|
|
||||||
// ],
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// Padding(
|
|
||||||
// padding: const EdgeInsets.all(8.0),
|
|
||||||
// child: RichText(
|
|
||||||
// text: TextSpan(
|
|
||||||
// text: 'Distance To Passenger is '.tr,
|
|
||||||
// style: AppStyle.title,
|
|
||||||
// children: [
|
|
||||||
// TextSpan(
|
|
||||||
// text: myList[12].toString(),
|
|
||||||
// style: AppStyle.headTitle2),
|
|
||||||
// ],
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.all(4),
|
padding: const EdgeInsets.all(4),
|
||||||
child: Container(
|
child: Container(
|
||||||
@@ -312,36 +287,6 @@ class OrderRequestPage extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
// Padding(
|
|
||||||
// padding: const EdgeInsets.all(8.0),
|
|
||||||
// child: RichText(
|
|
||||||
// text: TextSpan(
|
|
||||||
// text: 'Distance from Passenger to destination is '.tr,
|
|
||||||
// style: AppStyle.title,
|
|
||||||
// children: [
|
|
||||||
// TextSpan(
|
|
||||||
// text: myList[5].toString(),
|
|
||||||
// style: AppStyle.headTitle2),
|
|
||||||
// TextSpan(text: ' KM'.tr, style: AppStyle.title),
|
|
||||||
// ]),
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// Padding(
|
|
||||||
// padding: const EdgeInsets.all(8.0),
|
|
||||||
// child: RichText(
|
|
||||||
// text: TextSpan(
|
|
||||||
// text: 'Duration of Trip is '.tr,
|
|
||||||
// style: AppStyle.title,
|
|
||||||
// children: [
|
|
||||||
// TextSpan(
|
|
||||||
// text: hours > 1
|
|
||||||
// ? '${'Your Ride Duration is '.tr}$hours${' H and'.tr} $minutes m'
|
|
||||||
// : '${'Your Ride Duration is '.tr} $minutes m',
|
|
||||||
// style: AppStyle.title),
|
|
||||||
// TextSpan(text: ' Minutes'.tr, style: AppStyle.title),
|
|
||||||
// ]),
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.all(8.0),
|
padding: const EdgeInsets.all(8.0),
|
||||||
child: Row(
|
child: Row(
|
||||||
@@ -362,7 +307,8 @@ class OrderRequestPage extends StatelessWidget {
|
|||||||
'order_id': body.toString(),
|
'order_id': body.toString(),
|
||||||
'status': 'Apply'
|
'status': 'Apply'
|
||||||
});
|
});
|
||||||
await CRUD().post(link: AppLink.updateRides, payload: {
|
await CRUD()
|
||||||
|
.post(link: AppLink.updateRides, payload: {
|
||||||
'id': myList[16],
|
'id': myList[16],
|
||||||
'rideTimeStart': DateTime.now().toString(),
|
'rideTimeStart': DateTime.now().toString(),
|
||||||
'status': 'Apply',
|
'status': 'Apply',
|
||||||
@@ -403,8 +349,9 @@ class OrderRequestPage extends StatelessWidget {
|
|||||||
'driverId': myList[18].toString(),
|
'driverId': myList[18].toString(),
|
||||||
'durationOfRideValue': myList[19].toString(),
|
'durationOfRideValue': myList[19].toString(),
|
||||||
'paymentAmount': myList[2].toString(),
|
'paymentAmount': myList[2].toString(),
|
||||||
'paymentMethod':
|
'paymentMethod': myList[13].toString() == 'true'
|
||||||
myList[13].toString() == 'true' ? 'visa' : 'cash',
|
? 'visa'
|
||||||
|
: 'cash',
|
||||||
'isHaveSteps': myList[20].toString(),
|
'isHaveSteps': myList[20].toString(),
|
||||||
'step0': myList[21].toString(),
|
'step0': myList[21].toString(),
|
||||||
'step1': myList[22].toString(),
|
'step1': myList[22].toString(),
|
||||||
@@ -465,6 +412,7 @@ class OrderRequestPage extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
|
),
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
isleading: true);
|
isleading: true);
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
import 'dart:convert';
|
||||||
|
|
||||||
import 'package:SEFER/controller/home/captin/home_captain_controller.dart';
|
import 'package:SEFER/controller/home/captin/home_captain_controller.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
@@ -33,6 +35,8 @@ class OrderSpeedRequest extends StatelessWidget {
|
|||||||
orderRequestController.startTimer(myList[6].toString(), body.toString());
|
orderRequestController.startTimer(myList[6].toString(), body.toString());
|
||||||
var coords = myList[0].split(',');
|
var coords = myList[0].split(',');
|
||||||
var coordDestination = myList[1].split(',');
|
var coordDestination = myList[1].split(',');
|
||||||
|
BitmapDescriptor startIcon = BitmapDescriptor.defaultMarker;
|
||||||
|
BitmapDescriptor endIcon = BitmapDescriptor.defaultMarker;
|
||||||
|
|
||||||
// Parse to double
|
// Parse to double
|
||||||
double latPassengerLocation = double.parse(coords[0]);
|
double latPassengerLocation = double.parse(coords[0]);
|
||||||
@@ -58,18 +62,35 @@ class OrderSpeedRequest extends StatelessWidget {
|
|||||||
southwest: LatLng(minLatitude, minLongitude),
|
southwest: LatLng(minLatitude, minLongitude),
|
||||||
northeast: LatLng(maxLatitude, maxLongitude),
|
northeast: LatLng(maxLatitude, maxLongitude),
|
||||||
);
|
);
|
||||||
|
// void addCustomStartIcon() async {
|
||||||
|
// Create the marker with the resized image
|
||||||
|
|
||||||
|
ImageConfiguration config = ImageConfiguration(
|
||||||
|
size: const Size(25, 25), devicePixelRatio: Get.pixelRatio);
|
||||||
|
BitmapDescriptor.fromAssetImage(config, 'assets/images/A.png',
|
||||||
|
mipmaps: false)
|
||||||
|
.then((value) {
|
||||||
|
startIcon = value;
|
||||||
|
});
|
||||||
|
ImageConfiguration config1 = ImageConfiguration(
|
||||||
|
size: const Size(25, 25), devicePixelRatio: Get.pixelRatio);
|
||||||
|
BitmapDescriptor.fromAssetImage(config1, 'assets/images/b.png',
|
||||||
|
mipmaps: false)
|
||||||
|
.then((value) {
|
||||||
|
endIcon = value;
|
||||||
|
});
|
||||||
|
// }
|
||||||
|
|
||||||
return MyScafolld(
|
return MyScafolld(
|
||||||
title: 'Order Details Speed'.tr,
|
title: 'Order Details'.tr,
|
||||||
body: [
|
body: [
|
||||||
Container(
|
ListView(
|
||||||
color: AppColor.accentColor,
|
// crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
child: Column(
|
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
|
||||||
children: [
|
children: [
|
||||||
// SizedBox(height: 200, child: Text(pointsList.toString())),
|
// SizedBox(height: 200, child: Text(pointsList.toString())),
|
||||||
// Text(message.notification!.body.toString()),
|
// Text(message.notification!.body.toString()),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
height: 200,
|
height: Get.height * .2,
|
||||||
child: GoogleMap(
|
child: GoogleMap(
|
||||||
initialCameraPosition: CameraPosition(
|
initialCameraPosition: CameraPosition(
|
||||||
zoom: 12,
|
zoom: 12,
|
||||||
@@ -86,17 +107,13 @@ class OrderSpeedRequest extends StatelessWidget {
|
|||||||
position:
|
position:
|
||||||
LatLng(latPassengerLocation, lngPassengerLocation),
|
LatLng(latPassengerLocation, lngPassengerLocation),
|
||||||
draggable: true,
|
draggable: true,
|
||||||
icon: BitmapDescriptor.defaultMarkerWithHue(
|
icon: startIcon),
|
||||||
BitmapDescriptor.hueGreen),
|
|
||||||
),
|
|
||||||
Marker(
|
Marker(
|
||||||
markerId: MarkerId('Destination'.tr),
|
markerId: MarkerId('Destination'.tr),
|
||||||
position: LatLng(
|
position: LatLng(
|
||||||
latPassengerDestination, lngPassengerDestination),
|
latPassengerDestination, lngPassengerDestination),
|
||||||
draggable: true,
|
draggable: true,
|
||||||
icon: BitmapDescriptor.defaultMarkerWithHue(
|
icon: endIcon),
|
||||||
BitmapDescriptor.hueBlue),
|
|
||||||
),
|
|
||||||
},
|
},
|
||||||
polylines: {
|
polylines: {
|
||||||
Polyline(
|
Polyline(
|
||||||
@@ -156,62 +173,132 @@ class OrderSpeedRequest extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
||||||
Padding(
|
Container(
|
||||||
|
decoration: AppStyle.boxDecoration1,
|
||||||
|
child: Padding(
|
||||||
padding: const EdgeInsets.all(8.0),
|
padding: const EdgeInsets.all(8.0),
|
||||||
child: RichText(
|
child: Text(
|
||||||
text: TextSpan(
|
double.parse(myList[2]).toStringAsFixed(2),
|
||||||
text: 'Passenger Name is '.tr,
|
style: AppStyle.headTitle2,
|
||||||
style: AppStyle.title,
|
)
|
||||||
|
// RichText(
|
||||||
|
// text: TextSpan(
|
||||||
|
// text: 'Total From Passenger is '.tr,
|
||||||
|
// style: AppStyle.title,
|
||||||
|
// children: [
|
||||||
|
// TextSpan(
|
||||||
|
// text: double.parse(myList[2]).toStringAsFixed(2),
|
||||||
|
// style: AppStyle.headTitle2),
|
||||||
|
// ],
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
height: Get.height * .15,
|
||||||
|
width: Get.width * .9,
|
||||||
|
decoration: AppStyle.boxDecoration1,
|
||||||
|
child: Column(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
TextSpan(text: myList[8], style: AppStyle.headTitle2),
|
Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
|
children: [
|
||||||
|
Column(
|
||||||
|
children: [
|
||||||
|
Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
const Icon(
|
||||||
|
Icons.arrow_circle_up,
|
||||||
|
color: AppColor.greenColor,
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
myList[12] + ' ' + ' (${myList[11]}) ',
|
||||||
|
style: AppStyle.title,
|
||||||
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
Text(
|
||||||
|
myList[29],
|
||||||
|
style: AppStyle.title,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
|
children: [
|
||||||
|
Column(
|
||||||
|
children: [
|
||||||
|
Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
const Icon(
|
||||||
|
Icons.arrow_circle_up,
|
||||||
|
color: AppColor.greenColor,
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
myList[5] + ' ' + ' (${myList[4]}) ',
|
||||||
|
style: AppStyle.title,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
myList[30],
|
||||||
|
style: AppStyle.title,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.all(8.0),
|
padding: const EdgeInsets.all(8.0),
|
||||||
child: RichText(
|
child: RichText(
|
||||||
text: TextSpan(
|
text: TextSpan(
|
||||||
text: 'Total From Passenger is '.tr,
|
text: 'Passenger Name is '.tr,
|
||||||
style: AppStyle.title,
|
style: AppStyle.subtitle,
|
||||||
children: [
|
children: [
|
||||||
TextSpan(
|
TextSpan(text: myList[8], style: AppStyle.title),
|
||||||
text: double.parse(myList[2]).toStringAsFixed(2),
|
|
||||||
style: AppStyle.headTitle2),
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
// Padding(
|
||||||
|
// padding: const EdgeInsets.all(8.0),
|
||||||
|
// child: RichText(
|
||||||
|
// text: TextSpan(
|
||||||
|
// text: 'Duration To Passenger is '.tr,
|
||||||
|
// style: AppStyle.title,
|
||||||
|
// children: [
|
||||||
|
// TextSpan(
|
||||||
|
// text: myList[11].toString(),
|
||||||
|
// style: AppStyle.headTitle2),
|
||||||
|
// ],
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
// Padding(
|
||||||
|
// padding: const EdgeInsets.all(8.0),
|
||||||
|
// child: RichText(
|
||||||
|
// text: TextSpan(
|
||||||
|
// text: 'Distance To Passenger is '.tr,
|
||||||
|
// style: AppStyle.title,
|
||||||
|
// children: [
|
||||||
|
// TextSpan(
|
||||||
|
// text: myList[12].toString(),
|
||||||
|
// style: AppStyle.headTitle2),
|
||||||
|
// ],
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.all(8.0),
|
padding: const EdgeInsets.all(4),
|
||||||
child: RichText(
|
|
||||||
text: TextSpan(
|
|
||||||
text: 'Duration To Passenger is '.tr,
|
|
||||||
style: AppStyle.title,
|
|
||||||
children: [
|
|
||||||
TextSpan(
|
|
||||||
text: myList[11].toString(),
|
|
||||||
style: AppStyle.headTitle2),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Padding(
|
|
||||||
padding: const EdgeInsets.all(8.0),
|
|
||||||
child: RichText(
|
|
||||||
text: TextSpan(
|
|
||||||
text: 'Distance To Passenger is '.tr,
|
|
||||||
style: AppStyle.title,
|
|
||||||
children: [
|
|
||||||
TextSpan(
|
|
||||||
text: myList[12].toString(),
|
|
||||||
style: AppStyle.headTitle2),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Padding(
|
|
||||||
padding: const EdgeInsets.all(8.0),
|
|
||||||
child: Container(
|
child: Container(
|
||||||
color: AppColor.deepPurpleAccent,
|
color: AppColor.deepPurpleAccent,
|
||||||
child: RichText(
|
child: RichText(
|
||||||
@@ -227,36 +314,36 @@ class OrderSpeedRequest extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Padding(
|
// Padding(
|
||||||
padding: const EdgeInsets.all(8.0),
|
// padding: const EdgeInsets.all(8.0),
|
||||||
child: RichText(
|
// child: RichText(
|
||||||
text: TextSpan(
|
// text: TextSpan(
|
||||||
text: 'Distance from Passenger to destination is '.tr,
|
// text: 'Distance from Passenger to destination is '.tr,
|
||||||
style: AppStyle.title,
|
// style: AppStyle.title,
|
||||||
children: [
|
// children: [
|
||||||
TextSpan(
|
// TextSpan(
|
||||||
text: myList[5].toString(),
|
// text: myList[5].toString(),
|
||||||
style: AppStyle.headTitle2),
|
// style: AppStyle.headTitle2),
|
||||||
TextSpan(text: ' KM'.tr, style: AppStyle.title),
|
// TextSpan(text: ' KM'.tr, style: AppStyle.title),
|
||||||
]),
|
// ]),
|
||||||
),
|
// ),
|
||||||
),
|
// ),
|
||||||
Padding(
|
// Padding(
|
||||||
padding: const EdgeInsets.all(8.0),
|
// padding: const EdgeInsets.all(8.0),
|
||||||
child: RichText(
|
// child: RichText(
|
||||||
text: TextSpan(
|
// text: TextSpan(
|
||||||
text: 'Duration of Trip is '.tr,
|
// text: 'Duration of Trip is '.tr,
|
||||||
style: AppStyle.title,
|
// style: AppStyle.title,
|
||||||
children: [
|
// children: [
|
||||||
TextSpan(
|
// TextSpan(
|
||||||
text: hours > 1
|
// text: hours > 1
|
||||||
? '${'Your Ride Duration is '.tr}$hours${' H and'.tr} $minutes m'
|
// ? '${'Your Ride Duration is '.tr}$hours${' H and'.tr} $minutes m'
|
||||||
: '${'Your Ride Duration is '.tr} $minutes m',
|
// : '${'Your Ride Duration is '.tr} $minutes m',
|
||||||
style: AppStyle.title),
|
// style: AppStyle.title),
|
||||||
TextSpan(text: ' Minutes'.tr, style: AppStyle.title),
|
// TextSpan(text: ' Minutes'.tr, style: AppStyle.title),
|
||||||
]),
|
// ]),
|
||||||
),
|
// ),
|
||||||
),
|
// ),
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.all(8.0),
|
padding: const EdgeInsets.all(8.0),
|
||||||
child: Row(
|
child: Row(
|
||||||
@@ -272,21 +359,33 @@ class OrderSpeedRequest extends StatelessWidget {
|
|||||||
await CRUD().postFromDialogue(
|
await CRUD().postFromDialogue(
|
||||||
link: AppLink.addDriverOrder,
|
link: AppLink.addDriverOrder,
|
||||||
payload: {
|
payload: {
|
||||||
'driver_id': box.read(
|
'driver_id': myList[6].toString(),
|
||||||
BoxName.driverID), //myList[6].toString(),
|
|
||||||
// box.read(BoxName.driverID).toString(),
|
// box.read(BoxName.driverID).toString(),
|
||||||
'order_id':
|
'order_id': body.toString(),
|
||||||
myList[16].toString(), //body.toString(),
|
|
||||||
'status': 'Apply'
|
'status': 'Apply'
|
||||||
});
|
});
|
||||||
await CRUD()
|
await CRUD()
|
||||||
.post(link: AppLink.updateRides, payload: {
|
.post(link: AppLink.updateStausFromSpeed, payload: {
|
||||||
'id': myList[16],
|
'id': myList[16],
|
||||||
'rideTimeStart': DateTime.now().toString(),
|
'rideTimeStart': DateTime.now().toString(),
|
||||||
'status': 'Apply',
|
'status': 'Apply',
|
||||||
'driver_id': box.read(BoxName.driverID),
|
'driver_id': box.read(BoxName.driverID),
|
||||||
});
|
}).then((value) {
|
||||||
// Get.back();
|
var json = jsonDecode(value);
|
||||||
|
if (json['message'] ==
|
||||||
|
"This ride is already taken by another driver.") {
|
||||||
|
Get.defaultDialog(
|
||||||
|
title:
|
||||||
|
"This ride is already taken by another driver."
|
||||||
|
.tr,
|
||||||
|
middleText: '',
|
||||||
|
titleStyle: AppStyle.title,
|
||||||
|
middleTextStyle: AppStyle.title,
|
||||||
|
confirm: MyElevatedButton(
|
||||||
|
title: 'Ok'.tr,
|
||||||
|
onPressed: () => Get.back()));
|
||||||
|
} else if (json['message'] ==
|
||||||
|
"Ride data updated successfully") {
|
||||||
List<String> bodyToPassenger = [
|
List<String> bodyToPassenger = [
|
||||||
box.read(BoxName.driverID).toString(),
|
box.read(BoxName.driverID).toString(),
|
||||||
box.read(BoxName.nameDriver).toString(),
|
box.read(BoxName.nameDriver).toString(),
|
||||||
@@ -295,14 +394,15 @@ class OrderSpeedRequest extends StatelessWidget {
|
|||||||
// print(bodyToPassenger);
|
// print(bodyToPassenger);
|
||||||
FirebaseMessagesController()
|
FirebaseMessagesController()
|
||||||
.sendNotificationToPassengerToken(
|
.sendNotificationToPassengerToken(
|
||||||
'Apply Ride',
|
'Apply Ride', 'your ride is applied'.tr,
|
||||||
'The ${box.read(BoxName.nameDriver)} ${'accepted your order'.tr}',
|
// arguments['DriverList'][9].toString(),
|
||||||
arguments['DriverList'][9].toString(),
|
arguments['DriverList'][9].toString(),
|
||||||
// box.read(BoxName.tokenDriver).toString(),
|
// box.read(BoxName.tokenDriver).toString(),
|
||||||
bodyToPassenger,
|
bodyToPassenger,
|
||||||
);
|
);
|
||||||
Get.back();
|
Get.back();
|
||||||
Get.to(() => PassengerLocationMapPage(), arguments: {
|
Get.to(() => PassengerLocationMapPage(),
|
||||||
|
arguments: {
|
||||||
'passengerLocation': myList[0].toString(),
|
'passengerLocation': myList[0].toString(),
|
||||||
'passengerDestination': myList[1].toString(),
|
'passengerDestination': myList[1].toString(),
|
||||||
'Duration': myList[4].toString(),
|
'Duration': myList[4].toString(),
|
||||||
@@ -321,7 +421,8 @@ class OrderSpeedRequest extends StatelessWidget {
|
|||||||
'driverId': myList[18].toString(),
|
'driverId': myList[18].toString(),
|
||||||
'durationOfRideValue': myList[19].toString(),
|
'durationOfRideValue': myList[19].toString(),
|
||||||
'paymentAmount': myList[2].toString(),
|
'paymentAmount': myList[2].toString(),
|
||||||
'paymentMethod': myList[13].toString() == 'true'
|
'paymentMethod':
|
||||||
|
myList[13].toString() == 'true'
|
||||||
? 'visa'
|
? 'visa'
|
||||||
: 'cash',
|
: 'cash',
|
||||||
'isHaveSteps': myList[20].toString(),
|
'isHaveSteps': myList[20].toString(),
|
||||||
@@ -334,31 +435,53 @@ class OrderSpeedRequest extends StatelessWidget {
|
|||||||
'timeOfOrder': DateTime.now().toString(),
|
'timeOfOrder': DateTime.now().toString(),
|
||||||
'totalPassenger': myList[2].toString(),
|
'totalPassenger': myList[2].toString(),
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
// Get.back();
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
GetBuilder<OrderRequestController>(
|
GetBuilder<OrderRequestController>(
|
||||||
builder: (timerController) {
|
builder: (timerController) {
|
||||||
|
final isNearEnd = timerController.remainingTime <=
|
||||||
|
5; // Define a threshold for "near end"
|
||||||
|
|
||||||
return Stack(
|
return Stack(
|
||||||
alignment: Alignment.center,
|
alignment: Alignment.center,
|
||||||
children: [
|
children: [
|
||||||
CircularProgressIndicator(
|
CircularProgressIndicator(
|
||||||
value: timerController.progressSpeed,
|
value: timerController.progress,
|
||||||
// Set the color based on the "isNearEnd" condition
|
// Set the color based on the "isNearEnd" condition
|
||||||
color: Colors.blue,
|
color: isNearEnd ? Colors.red : Colors.blue,
|
||||||
),
|
),
|
||||||
Text(
|
Text(
|
||||||
'${timerController.remainingTimeSpeed}',
|
'${timerController.remainingTime}',
|
||||||
style: AppStyle.number,
|
style: AppStyle.number,
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
MyElevatedButton(
|
||||||
|
title: 'Refuse Order'.tr,
|
||||||
|
onPressed: () async {
|
||||||
|
Get.defaultDialog(
|
||||||
|
title: 'Reject Order'.tr,
|
||||||
|
titleStyle: AppStyle.title,
|
||||||
|
middleText:
|
||||||
|
'You can decline a request without any cost'.tr,
|
||||||
|
middleTextStyle: AppStyle.title,
|
||||||
|
confirm: MyElevatedButton(
|
||||||
|
title: 'Ok'.tr,
|
||||||
|
onPressed: () {
|
||||||
|
Get.back();
|
||||||
|
}));
|
||||||
|
},
|
||||||
|
kolor: AppColor.redColor,
|
||||||
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
),
|
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
isleading: true);
|
isleading: true);
|
||||||
|
|||||||
Reference in New Issue
Block a user