6/9/3
This commit is contained in:
@@ -53,7 +53,7 @@ android {
|
|||||||
applicationId "com.sefer_driver"
|
applicationId "com.sefer_driver"
|
||||||
// You can update the following values to match your application needs.
|
// You can update the following values to match your application needs.
|
||||||
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
|
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
|
||||||
minSdkVersion 22
|
minSdkVersion 23
|
||||||
targetSdkVersion flutter.targetSdkVersion
|
targetSdkVersion flutter.targetSdkVersion
|
||||||
versionCode 30
|
versionCode 30
|
||||||
versionName '1.5.30'
|
versionName '1.5.30'
|
||||||
|
|||||||
@@ -18,19 +18,17 @@ void launchCommunication(
|
|||||||
case 'phone':
|
case 'phone':
|
||||||
url = 'tel:$contactInfo';
|
url = 'tel:$contactInfo';
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'sms':
|
case 'sms':
|
||||||
url = 'sms:$contactInfo?body=$message';
|
url = 'sms:$contactInfo?body=${Uri.encodeComponent(message)}';
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'whatsapp':
|
case 'whatsapp':
|
||||||
url = 'https://api.whatsapp.com/send?phone=$contactInfo&text=$message';
|
url =
|
||||||
|
'https://api.whatsapp.com/send?phone=$contactInfo&text=${Uri.encodeComponent(message)}';
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'email':
|
case 'email':
|
||||||
url = 'mailto:$contactInfo?subject=Subject&body=$message';
|
url =
|
||||||
|
'mailto:$contactInfo?subject=Subject&body=${Uri.encodeComponent(message)}';
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
print('Method not supported on iOS');
|
print('Method not supported on iOS');
|
||||||
return;
|
return;
|
||||||
@@ -40,19 +38,27 @@ void launchCommunication(
|
|||||||
case 'phone':
|
case 'phone':
|
||||||
url = 'tel:$contactInfo';
|
url = 'tel:$contactInfo';
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'sms':
|
case 'sms':
|
||||||
url = 'sms:$contactInfo?body=$message';
|
url = 'sms:$contactInfo?body=${Uri.encodeComponent(message)}';
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'whatsapp':
|
case 'whatsapp':
|
||||||
url = 'whatsapp://send?phone=$contactInfo&text=$message';
|
// Check if WhatsApp is installed
|
||||||
|
final bool whatsappInstalled =
|
||||||
|
await canLaunchUrl(Uri.parse('whatsapp://'));
|
||||||
|
if (whatsappInstalled) {
|
||||||
|
url =
|
||||||
|
'whatsapp://send?phone=$contactInfo&text=${Uri.encodeComponent(message)}';
|
||||||
|
} else {
|
||||||
|
print('WhatsApp is not installed on this device.');
|
||||||
|
// Provide an alternative action, such as opening the WhatsApp Web API
|
||||||
|
url =
|
||||||
|
'https://api.whatsapp.com/send?phone=$contactInfo&text=${Uri.encodeComponent(message)}';
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'email':
|
case 'email':
|
||||||
url = 'mailto:$contactInfo?subject=Subject&body=$message';
|
url =
|
||||||
|
'mailto:$contactInfo?subject=Subject&body=${Uri.encodeComponent(message)}';
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
print('Method not supported on Android');
|
print('Method not supported on Android');
|
||||||
return;
|
return;
|
||||||
@@ -62,8 +68,10 @@ void launchCommunication(
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
print('Launching URL: $url');
|
||||||
|
|
||||||
if (await canLaunchUrl(Uri.parse(url))) {
|
if (await canLaunchUrl(Uri.parse(url))) {
|
||||||
launchUrl(Uri.parse(url));
|
await launchUrl(Uri.parse(url));
|
||||||
} else {
|
} else {
|
||||||
print('Could not launch $url');
|
print('Could not launch $url');
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -97,8 +97,8 @@ class MapDriverController extends GetxController {
|
|||||||
String? mapAPIKEY;
|
String? mapAPIKEY;
|
||||||
final zones = <Zone>[];
|
final zones = <Zone>[];
|
||||||
String canelString = 'yet';
|
String canelString = 'yet';
|
||||||
late LatLng latLngpassengerLocation;
|
LatLng latLngPassengerLocation = LatLng(0, 0);
|
||||||
late LatLng latLngPassengerDestination;
|
late LatLng latLngPassengerDestination = LatLng(0, 0);
|
||||||
|
|
||||||
void onMapCreated(GoogleMapController controller) async {
|
void onMapCreated(GoogleMapController controller) async {
|
||||||
myLocation = Get.find<LocationController>().location as LatLng;
|
myLocation = Get.find<LocationController>().location as LatLng;
|
||||||
@@ -136,8 +136,8 @@ class MapDriverController extends GetxController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Future openGoogleMapFromDriverToPassenger() async {
|
Future openGoogleMapFromDriverToPassenger() async {
|
||||||
var endLat = latLngpassengerLocation.latitude;
|
var endLat = latLngPassengerLocation.latitude;
|
||||||
var endLng = latLngpassengerLocation.longitude;
|
var endLng = latLngPassengerLocation.longitude;
|
||||||
|
|
||||||
var startLat = Get.find<LocationController>().myLocation.latitude;
|
var startLat = Get.find<LocationController>().myLocation.latitude;
|
||||||
var startLng = Get.find<LocationController>().myLocation.longitude;
|
var startLng = Get.find<LocationController>().myLocation.longitude;
|
||||||
@@ -365,8 +365,8 @@ class MapDriverController extends GetxController {
|
|||||||
|
|
||||||
calculateDistanceBetweenDriverAndPassengerLocation() {
|
calculateDistanceBetweenDriverAndPassengerLocation() {
|
||||||
double distance2 = Geolocator.distanceBetween(
|
double distance2 = Geolocator.distanceBetween(
|
||||||
latLngpassengerLocation.latitude,
|
latLngPassengerLocation.latitude,
|
||||||
latLngpassengerLocation.longitude,
|
latLngPassengerLocation.longitude,
|
||||||
Get.find<LocationController>().myLocation.latitude,
|
Get.find<LocationController>().myLocation.latitude,
|
||||||
Get.find<LocationController>().myLocation.longitude,
|
Get.find<LocationController>().myLocation.longitude,
|
||||||
);
|
);
|
||||||
@@ -843,19 +843,11 @@ class MapDriverController extends GetxController {
|
|||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
|
|
||||||
late Duration durationToAdd;
|
argumentLoading() async {
|
||||||
int hours = 0;
|
|
||||||
int minutes = 0;
|
|
||||||
late String carType;
|
|
||||||
late String kazan;
|
|
||||||
late String startNameLocation;
|
|
||||||
late String endNameLocation;
|
|
||||||
@override
|
|
||||||
void onInit() async {
|
|
||||||
mapAPIKEY = await storage.read(key: BoxName.mapAPIKEY);
|
|
||||||
// Get the passenger location from the arguments.
|
|
||||||
passengerLocation = Get.arguments['passengerLocation'];
|
passengerLocation = Get.arguments['passengerLocation'];
|
||||||
|
print(passengerLocation);
|
||||||
passengerDestination = Get.arguments['passengerDestination'];
|
passengerDestination = Get.arguments['passengerDestination'];
|
||||||
|
print(passengerDestination);
|
||||||
duration = Get.arguments['Duration'];
|
duration = Get.arguments['Duration'];
|
||||||
totalCost = Get.arguments['totalCost'];
|
totalCost = Get.arguments['totalCost'];
|
||||||
passengerId = Get.arguments['passengerId'];
|
passengerId = Get.arguments['passengerId'];
|
||||||
@@ -886,22 +878,29 @@ class MapDriverController extends GetxController {
|
|||||||
startNameLocation = Get.arguments['startNameLocation'];
|
startNameLocation = Get.arguments['startNameLocation'];
|
||||||
endNameLocation = Get.arguments['endNameLocation'];
|
endNameLocation = Get.arguments['endNameLocation'];
|
||||||
|
|
||||||
var coords = passengerLocation.split(',');
|
// var coords = passengerLocation.toString().split(',');
|
||||||
var coordDestination = passengerDestination.split(',');
|
// var coordDestination = passengerDestination.toString().split(',');
|
||||||
|
|
||||||
// Parse to double
|
// Parse to double
|
||||||
double latPassengerLocation = double.parse(coords[0]);
|
double latPassengerLocation =
|
||||||
double lngPassengerLocation = double.parse(coords[1]);
|
double.parse(passengerLocation.toString().split(',')[0]);
|
||||||
double latPassengerDestination = double.parse(coordDestination[0]);
|
double lngPassengerLocation =
|
||||||
double lngPassengerDestination = double.parse(coordDestination[1]);
|
double.parse(passengerLocation.toString().split(',')[1]);
|
||||||
latLngpassengerLocation =
|
double latPassengerDestination =
|
||||||
|
double.parse(passengerDestination.toString().split(',')[0]);
|
||||||
|
double lngPassengerDestination =
|
||||||
|
double.parse(passengerDestination.toString().split(',')[1]);
|
||||||
|
latLngPassengerLocation =
|
||||||
LatLng(latPassengerLocation, lngPassengerLocation);
|
LatLng(latPassengerLocation, lngPassengerLocation);
|
||||||
latLngPassengerDestination =
|
latLngPassengerDestination =
|
||||||
LatLng(latPassengerDestination, lngPassengerDestination);
|
LatLng(latPassengerDestination, lngPassengerDestination);
|
||||||
String lat = Get.find<LocationController>().myLocation.latitude.toString();
|
String lat = Get.find<LocationController>().myLocation.latitude.toString();
|
||||||
String lng = Get.find<LocationController>().myLocation.longitude.toString();
|
String lng = Get.find<LocationController>().myLocation.longitude.toString();
|
||||||
String origin = '$lat,$lng';
|
String origin = '$lat,$lng';
|
||||||
|
print('latLngpassengerLocation $latLngPassengerLocation');
|
||||||
|
print('latLngPassengerDestination $latLngPassengerDestination');
|
||||||
// Set the origin and destination coordinates for the Google Maps directions request.
|
// Set the origin and destination coordinates for the Google Maps directions request.
|
||||||
|
Future.delayed(const Duration(seconds: 1));
|
||||||
getMap(origin, passengerLocation);
|
getMap(origin, passengerLocation);
|
||||||
isHaveSteps == 'haveSteps'
|
isHaveSteps == 'haveSteps'
|
||||||
? (
|
? (
|
||||||
@@ -911,6 +910,22 @@ class MapDriverController extends GetxController {
|
|||||||
step4 == '' ? await getMapDestination(step3, step4) : () {},
|
step4 == '' ? await getMapDestination(step3, step4) : () {},
|
||||||
)
|
)
|
||||||
: await getMapDestination(passengerLocation, passengerDestination);
|
: await getMapDestination(passengerLocation, passengerDestination);
|
||||||
|
update();
|
||||||
|
}
|
||||||
|
|
||||||
|
late Duration durationToAdd;
|
||||||
|
int hours = 0;
|
||||||
|
int minutes = 0;
|
||||||
|
late String carType;
|
||||||
|
late String kazan;
|
||||||
|
late String startNameLocation;
|
||||||
|
late String endNameLocation;
|
||||||
|
|
||||||
|
@override
|
||||||
|
void onInit() async {
|
||||||
|
mapAPIKEY = await storage.read(key: BoxName.mapAPIKEY);
|
||||||
|
// Get the passenger location from the arguments.
|
||||||
|
await argumentLoading();
|
||||||
addCustomCarIcon();
|
addCustomCarIcon();
|
||||||
addCustomPassengerIcon();
|
addCustomPassengerIcon();
|
||||||
addCustomStartIcon();
|
addCustomStartIcon();
|
||||||
|
|||||||
@@ -120,14 +120,14 @@ class OrderRequestController extends GetxController {
|
|||||||
|
|
||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
// if (remainingTimeSpeed == 0) {
|
if (remainingTimeSpeed == 0) {
|
||||||
// if (applied == false) {
|
if (applied == false) {
|
||||||
// print('applied=========================');
|
print('applied=========================');
|
||||||
// print(applied);
|
print(applied);
|
||||||
// Get.back();
|
Get.back();
|
||||||
// // refuseOrder(box.read(BoxName.driverID), orderID);
|
// refuseOrder(box.read(BoxName.driverID), orderID);
|
||||||
// }
|
}
|
||||||
// }
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void refuseOrder(
|
void refuseOrder(
|
||||||
|
|||||||
355
lib/controller/home/captin/speed_map_controller.dart
Normal file
355
lib/controller/home/captin/speed_map_controller.dart
Normal file
@@ -0,0 +1,355 @@
|
|||||||
|
import 'dart:async';
|
||||||
|
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:get/get.dart';
|
||||||
|
import 'package:google_maps_flutter/google_maps_flutter.dart';
|
||||||
|
import 'package:google_polyline_algorithm/google_polyline_algorithm.dart';
|
||||||
|
|
||||||
|
import '../../../constant/api_key.dart';
|
||||||
|
import '../../../constant/box_name.dart';
|
||||||
|
import '../../../constant/colors.dart';
|
||||||
|
import '../../../constant/links.dart';
|
||||||
|
import '../../../main.dart';
|
||||||
|
import '../../functions/crud.dart';
|
||||||
|
import '../../functions/location_controller.dart';
|
||||||
|
import 'home_captain_controller.dart';
|
||||||
|
|
||||||
|
class SpeedMapController extends GetxController {
|
||||||
|
bool isLoading = true;
|
||||||
|
final formKey1 = GlobalKey<FormState>();
|
||||||
|
final sosEmergincyNumberCotroller = TextEditingController();
|
||||||
|
List data = [];
|
||||||
|
List dataDestination = [];
|
||||||
|
LatLngBounds? boundsData;
|
||||||
|
double mpg = 0;
|
||||||
|
BitmapDescriptor carIcon = BitmapDescriptor.defaultMarker;
|
||||||
|
BitmapDescriptor passengerIcon = BitmapDescriptor.defaultMarker;
|
||||||
|
BitmapDescriptor startIcon = BitmapDescriptor.defaultMarker;
|
||||||
|
BitmapDescriptor endIcon = BitmapDescriptor.defaultMarker;
|
||||||
|
final List<LatLng> polylineCoordinates = [];
|
||||||
|
final List<LatLng> polylineCoordinatesDestination = [];
|
||||||
|
List<Polyline> polyLines = [];
|
||||||
|
List<Polyline> polyLinesDestination = [];
|
||||||
|
Set<Marker> markers = {};
|
||||||
|
late String passengerLocation;
|
||||||
|
late String passengerDestination;
|
||||||
|
late String step0;
|
||||||
|
late String step1;
|
||||||
|
late String step2;
|
||||||
|
late String step3;
|
||||||
|
late String step4;
|
||||||
|
late String passengerWalletBurc;
|
||||||
|
late String timeOfOrder;
|
||||||
|
late String duration;
|
||||||
|
late String totalCost;
|
||||||
|
late String distance;
|
||||||
|
late String passengerName;
|
||||||
|
late String passengerEmail;
|
||||||
|
late String totalPassenger;
|
||||||
|
late String passengerPhone;
|
||||||
|
late String rideId;
|
||||||
|
late String isHaveSteps;
|
||||||
|
late String paymentAmount;
|
||||||
|
late String paymentMethod;
|
||||||
|
late String passengerId;
|
||||||
|
late String driverId;
|
||||||
|
late String tokenPassenger;
|
||||||
|
late String durationToPassenger;
|
||||||
|
late String walletChecked;
|
||||||
|
late String direction;
|
||||||
|
late String carType;
|
||||||
|
late String kazan;
|
||||||
|
late String startNameLocation;
|
||||||
|
late String endNameLocation;
|
||||||
|
late String durationOfRideValue;
|
||||||
|
late String status;
|
||||||
|
String stringRemainingTimeToPassenger = '';
|
||||||
|
|
||||||
|
String stringRemainingTimeWaitingPassenger = '';
|
||||||
|
late Duration durationToAdd;
|
||||||
|
int hours = 0;
|
||||||
|
int minutes = 0;
|
||||||
|
int timeWaitingPassenger = 5; //5 miniute
|
||||||
|
bool isPassengerInfoWindow = false;
|
||||||
|
bool isBtnRideBegin = false;
|
||||||
|
bool isArrivedSend = true;
|
||||||
|
bool isdriverWaitTimeEnd = false;
|
||||||
|
bool isRideFinished = false;
|
||||||
|
bool isRideStarted = false;
|
||||||
|
bool isPriceWindow = false;
|
||||||
|
double passengerInfoWindowHeight = Get.height * .38;
|
||||||
|
double driverEndPage = 100;
|
||||||
|
double progress = 0;
|
||||||
|
double progressToPassenger = 0;
|
||||||
|
double progressInPassengerLocationFromDriver = 0;
|
||||||
|
bool isRideBegin = false;
|
||||||
|
int progressTimerToShowPassengerInfoWindowFromDriver = 25;
|
||||||
|
int remainingTimeToShowPassengerInfoWindowFromDriver = 25;
|
||||||
|
int remainingTimeToPassenger = 60;
|
||||||
|
int remainingTimeInPassengerLocatioWait = 60;
|
||||||
|
bool isDriverNearPassengerStart = false;
|
||||||
|
GoogleMapController? mapController;
|
||||||
|
late LatLng myLocation;
|
||||||
|
int remainingTimeTimerRideBegin = 60;
|
||||||
|
String stringRemainingTimeRideBegin = '';
|
||||||
|
String stringRemainingTimeRideBegin1 = '';
|
||||||
|
double progressTimerRideBegin = 0;
|
||||||
|
late Timer timer;
|
||||||
|
String? mapAPIKEY;
|
||||||
|
final zones = <Zone>[];
|
||||||
|
String canelString = 'yet';
|
||||||
|
late LatLng latLngPassengerLocation;
|
||||||
|
late LatLng latLngPassengerDestination;
|
||||||
|
void clearPolyline() {
|
||||||
|
polyLines = [];
|
||||||
|
polyLinesDestination = [];
|
||||||
|
polylineCoordinates.clear();
|
||||||
|
polylineCoordinatesDestination.clear();
|
||||||
|
update();
|
||||||
|
}
|
||||||
|
|
||||||
|
argumentLoading() async {
|
||||||
|
passengerLocation = Get.arguments['passengerLocation'];
|
||||||
|
print(passengerLocation);
|
||||||
|
passengerDestination = Get.arguments['passengerDestination'];
|
||||||
|
print(passengerDestination);
|
||||||
|
duration = Get.arguments['Duration'];
|
||||||
|
totalCost = Get.arguments['totalCost'];
|
||||||
|
passengerId = Get.arguments['passengerId'];
|
||||||
|
driverId = Get.arguments['driverId'];
|
||||||
|
distance = Get.arguments['Distance'];
|
||||||
|
passengerName = Get.arguments['name'];
|
||||||
|
passengerEmail = Get.arguments['email'];
|
||||||
|
totalPassenger = Get.arguments['totalPassenger'];
|
||||||
|
passengerPhone = Get.arguments['phone'];
|
||||||
|
walletChecked = Get.arguments['WalletChecked'];
|
||||||
|
tokenPassenger = Get.arguments['tokenPassenger'];
|
||||||
|
direction = Get.arguments['direction'];
|
||||||
|
durationToPassenger = Get.arguments['DurationToPassenger'];
|
||||||
|
rideId = Get.arguments['rideId'];
|
||||||
|
durationOfRideValue = Get.arguments['durationOfRideValue'];
|
||||||
|
paymentAmount = Get.arguments['paymentAmount'];
|
||||||
|
paymentMethod = Get.arguments['paymentMethod'];
|
||||||
|
isHaveSteps = Get.arguments['isHaveSteps'];
|
||||||
|
step0 = Get.arguments['step0'];
|
||||||
|
step1 = Get.arguments['step1'];
|
||||||
|
step2 = Get.arguments['step2'];
|
||||||
|
step3 = Get.arguments['step3'];
|
||||||
|
step4 = Get.arguments['step4'];
|
||||||
|
passengerWalletBurc = Get.arguments['passengerWalletBurc'];
|
||||||
|
timeOfOrder = Get.arguments['timeOfOrder'];
|
||||||
|
carType = Get.arguments['carType'];
|
||||||
|
kazan = Get.arguments['kazan'];
|
||||||
|
startNameLocation = Get.arguments['startNameLocation'];
|
||||||
|
endNameLocation = Get.arguments['endNameLocation'];
|
||||||
|
|
||||||
|
// var coords = passengerLocation.toString().split(',');
|
||||||
|
// var coordDestination = passengerDestination.toString().split(',');
|
||||||
|
|
||||||
|
// Parse to double
|
||||||
|
double latPassengerLocation =
|
||||||
|
double.parse(passengerLocation.toString().split(',')[0]);
|
||||||
|
double lngPassengerLocation =
|
||||||
|
double.parse(passengerLocation.toString().split(',')[1]);
|
||||||
|
double latPassengerDestination =
|
||||||
|
double.parse(passengerDestination.toString().split(',')[0]);
|
||||||
|
double lngPassengerDestination =
|
||||||
|
double.parse(passengerDestination.toString().split(',')[1]);
|
||||||
|
latLngPassengerLocation =
|
||||||
|
LatLng(latPassengerLocation, lngPassengerLocation);
|
||||||
|
latLngPassengerDestination =
|
||||||
|
LatLng(latPassengerDestination, lngPassengerDestination);
|
||||||
|
String lat = Get.find<LocationController>().myLocation.latitude.toString();
|
||||||
|
String lng = Get.find<LocationController>().myLocation.longitude.toString();
|
||||||
|
String origin = '$lat,$lng';
|
||||||
|
print('latLngpassengerLocation $latLngPassengerLocation');
|
||||||
|
print('latLngPassengerDestination $latLngPassengerDestination');
|
||||||
|
// Set the origin and destination coordinates for the Google Maps directions request.
|
||||||
|
Future.delayed(const Duration(seconds: 1));
|
||||||
|
getMap(origin, passengerLocation);
|
||||||
|
isHaveSteps == 'haveSteps'
|
||||||
|
? (
|
||||||
|
await getMapDestination(step0, step1),
|
||||||
|
await getMapDestination(step1, step2),
|
||||||
|
step3 == '' ? await getMapDestination(step2, step3) : () {},
|
||||||
|
step4 == '' ? await getMapDestination(step3, step4) : () {},
|
||||||
|
)
|
||||||
|
: await getMapDestination(passengerLocation, passengerDestination);
|
||||||
|
update();
|
||||||
|
}
|
||||||
|
|
||||||
|
double distanceBetweenDriverAndPassengerWhenConfirm = 0;
|
||||||
|
getMap(String origin, destination) async {
|
||||||
|
isLoading = false;
|
||||||
|
|
||||||
|
update();
|
||||||
|
|
||||||
|
var url =
|
||||||
|
('${AppLink.googleMapsLink}directions/json?&language=${box.read(BoxName.lang)}&avoid=tolls|ferries&destination=$destination&origin=$origin&key=${AK.mapAPIKEY}');
|
||||||
|
|
||||||
|
var response = await CRUD().getGoogleApi(link: url, payload: {});
|
||||||
|
data = response['routes'][0]['legs'];
|
||||||
|
print(data);
|
||||||
|
distanceBetweenDriverAndPassengerWhenConfirm =
|
||||||
|
(data[0]['distance']['value']) / 1000;
|
||||||
|
final points =
|
||||||
|
decodePolyline(response["routes"][0]["overview_polyline"]["points"]);
|
||||||
|
for (int i = 0; i < points.length; i++) {
|
||||||
|
double lat = points[i][0].toDouble();
|
||||||
|
double lng = points[i][1].toDouble();
|
||||||
|
polylineCoordinates.add(LatLng(lat, lng));
|
||||||
|
}
|
||||||
|
if (polyLines.isNotEmpty) {
|
||||||
|
clearPolyline();
|
||||||
|
var polyline = Polyline(
|
||||||
|
polylineId: PolylineId(response["routes"][0]["summary"]),
|
||||||
|
points: polylineCoordinates,
|
||||||
|
width: 10,
|
||||||
|
color: AppColor.blueColor,
|
||||||
|
);
|
||||||
|
polyLines.add(polyline);
|
||||||
|
// rideConfirm = false;
|
||||||
|
update();
|
||||||
|
} else {
|
||||||
|
var polyline = Polyline(
|
||||||
|
polylineId: PolylineId(response["routes"][0]["summary"]),
|
||||||
|
points: polylineCoordinates,
|
||||||
|
width: 10,
|
||||||
|
color: AppColor.blueColor,
|
||||||
|
);
|
||||||
|
// final dataBounds = response["routes"][0]["bounds"];
|
||||||
|
|
||||||
|
// updateCameraFromBoundsAfterGetMap(dataBounds);
|
||||||
|
|
||||||
|
// Fit the camera to the bounds
|
||||||
|
|
||||||
|
polyLines.add(polyline);
|
||||||
|
// rideConfirm = false;
|
||||||
|
// Define the northeast and southwest coordinates
|
||||||
|
final bounds = response["routes"][0]["bounds"];
|
||||||
|
LatLng northeast =
|
||||||
|
LatLng(bounds['northeast']['lat'], bounds['northeast']['lng']);
|
||||||
|
LatLng southwest =
|
||||||
|
LatLng(bounds['southwest']['lat'], bounds['southwest']['lng']);
|
||||||
|
|
||||||
|
// Create the LatLngBounds object
|
||||||
|
LatLngBounds boundsData =
|
||||||
|
LatLngBounds(northeast: northeast, southwest: southwest);
|
||||||
|
|
||||||
|
// Fit the camera to the bounds
|
||||||
|
var cameraUpdate = CameraUpdate.newLatLngBounds(boundsData, 140);
|
||||||
|
mapController!.animateCamera(cameraUpdate);
|
||||||
|
update();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
getMapDestination(String origin, destination) async {
|
||||||
|
var url =
|
||||||
|
('${AppLink.googleMapsLink}directions/json?&language=${box.read(BoxName.lang)}&avoid=tolls|ferries&destination=$destination&origin=$origin&key=${AK.mapAPIKEY}');
|
||||||
|
|
||||||
|
var response = await CRUD().getGoogleApi(link: url, payload: {});
|
||||||
|
dataDestination = response['routes'][0]['legs'];
|
||||||
|
// print(data);
|
||||||
|
final points =
|
||||||
|
decodePolyline(response["routes"][0]["overview_polyline"]["points"]);
|
||||||
|
for (int i = 0; i < points.length; i++) {
|
||||||
|
double lat = points[i][0].toDouble();
|
||||||
|
double lng = points[i][1].toDouble();
|
||||||
|
polylineCoordinatesDestination.add(LatLng(lat, lng));
|
||||||
|
}
|
||||||
|
if (polyLinesDestination.isNotEmpty) {
|
||||||
|
// clearPolyline();
|
||||||
|
var polyline = Polyline(
|
||||||
|
polylineId: PolylineId(response["routes"][0]["summary"]),
|
||||||
|
points: polylineCoordinatesDestination,
|
||||||
|
width: 10,
|
||||||
|
color: AppColor.redColor,
|
||||||
|
);
|
||||||
|
polyLinesDestination.add(polyline);
|
||||||
|
// rideConfirm = false;
|
||||||
|
update();
|
||||||
|
} else {
|
||||||
|
var polyline = Polyline(
|
||||||
|
polylineId: PolylineId(response["routes"][0]["summary"]),
|
||||||
|
points: polylineCoordinatesDestination,
|
||||||
|
width: 10,
|
||||||
|
color: AppColor.redColor,
|
||||||
|
);
|
||||||
|
// final dataBounds = response["routes"][0]["bounds"];
|
||||||
|
|
||||||
|
// updateCameraFromBoundsAfterGetMap(dataBounds);
|
||||||
|
// polyLinesDestination.add(polyline);
|
||||||
|
// rideConfirm = false;
|
||||||
|
// Define the northeast and southwest coordinates
|
||||||
|
|
||||||
|
update();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void startTimerToShowPassengerInfoWindowFromDriver() async {
|
||||||
|
isPassengerInfoWindow = true;
|
||||||
|
for (int i = 0; i <= int.parse(durationToPassenger); i++) {
|
||||||
|
await Future.delayed(const Duration(seconds: 1));
|
||||||
|
progressToPassenger = i / int.parse(durationToPassenger);
|
||||||
|
remainingTimeToPassenger = int.parse(durationToPassenger) - i;
|
||||||
|
if (remainingTimeToPassenger == 0) {
|
||||||
|
isBtnRideBegin = true;
|
||||||
|
print(isBtnRideBegin);
|
||||||
|
update();
|
||||||
|
}
|
||||||
|
print(isBtnRideBegin);
|
||||||
|
print(remainingTimeToPassenger);
|
||||||
|
|
||||||
|
int minutes = (remainingTimeToPassenger / 60).floor();
|
||||||
|
int seconds = remainingTimeToPassenger % 60;
|
||||||
|
stringRemainingTimeToPassenger =
|
||||||
|
'$minutes:${seconds.toString().padLeft(2, '0')}';
|
||||||
|
|
||||||
|
update();
|
||||||
|
}
|
||||||
|
// update();
|
||||||
|
// startTimerToShowDriverToPassengerDuration();
|
||||||
|
}
|
||||||
|
|
||||||
|
void onMapCreated(GoogleMapController controller) async {
|
||||||
|
myLocation = Get.find<LocationController>().location as LatLng;
|
||||||
|
myLocation = myLocation;
|
||||||
|
mapController = controller;
|
||||||
|
controller.getVisibleRegion();
|
||||||
|
controller.animateCamera(
|
||||||
|
CameraUpdate.newLatLng(Get.find<LocationController>().myLocation),
|
||||||
|
);
|
||||||
|
update();
|
||||||
|
// Set up a timer or interval to trigger the marker update every 3 seconds.
|
||||||
|
timer = Timer.periodic(const Duration(seconds: 1), (_) {
|
||||||
|
// updateMarker();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
void onInit() async {
|
||||||
|
mapAPIKEY = await storage.read(key: BoxName.mapAPIKEY);
|
||||||
|
// Get the passenger location from the arguments.
|
||||||
|
await argumentLoading();
|
||||||
|
// addCustomCarIcon();
|
||||||
|
// addCustomPassengerIcon();
|
||||||
|
// addCustomStartIcon();
|
||||||
|
// addCustomEndIcon();
|
||||||
|
// updateMarker();
|
||||||
|
// updateLocation();
|
||||||
|
startTimerToShowPassengerInfoWindowFromDriver();
|
||||||
|
durationToAdd = Duration(seconds: int.parse(duration));
|
||||||
|
hours = durationToAdd.inHours;
|
||||||
|
minutes = (durationToAdd.inMinutes % 60).round();
|
||||||
|
calculateConsumptionFuel();
|
||||||
|
// cancelCheckRidefromPassenger();
|
||||||
|
// checkIsDriverNearPassenger();
|
||||||
|
super.onInit();
|
||||||
|
}
|
||||||
|
|
||||||
|
calculateConsumptionFuel() {
|
||||||
|
mpg = Get.find<HomeCaptainController>().fuelPrice /
|
||||||
|
12; //todo in register car add mpg in box
|
||||||
|
update();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -4,7 +4,11 @@ class MyTranslation extends Translations {
|
|||||||
@override
|
@override
|
||||||
Map<String, Map<String, String>> get keys => {
|
Map<String, Map<String, String>> get keys => {
|
||||||
"ar": {
|
"ar": {
|
||||||
"No data yet!": "ccc",
|
"Special Order": "طلب خاص",
|
||||||
|
"Speed Order": "طلب سريع",
|
||||||
|
"No data yet!": "لا توجد بيانات حتى الآن!",
|
||||||
|
"You Refused 3 Rides this Day that is the reason \nSee you Tomorrow!":
|
||||||
|
"لقد رفضت 3 رحلات اليوم وهذا هو السبب \nأراك غدًا!",
|
||||||
"fromBudget": "من الميزانية",
|
"fromBudget": "من الميزانية",
|
||||||
"You must restart the app to change the language.":
|
"You must restart the app to change the language.":
|
||||||
"يجب إعادة تشغيل التطبيق لتغيير اللغة",
|
"يجب إعادة تشغيل التطبيق لتغيير اللغة",
|
||||||
|
|||||||
@@ -16,11 +16,11 @@ import 'mapDriverWidgets/sos_connect.dart';
|
|||||||
class PassengerLocationMapPage extends StatelessWidget {
|
class PassengerLocationMapPage extends StatelessWidget {
|
||||||
PassengerLocationMapPage({super.key});
|
PassengerLocationMapPage({super.key});
|
||||||
final LocationController locationController = Get.put(LocationController());
|
final LocationController locationController = Get.put(LocationController());
|
||||||
final MapDriverController mapDriverController =
|
// final MapDriverController mapDriverController =
|
||||||
Get.put(MapDriverController());
|
// Get.put(MapDriverController());
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
// Get.put(MapDriverController());
|
Get.put(MapDriverController());
|
||||||
|
|
||||||
return MyScafolld(
|
return MyScafolld(
|
||||||
title: 'Map Passenger'.tr,
|
title: 'Map Passenger'.tr,
|
||||||
@@ -31,7 +31,7 @@ class PassengerLocationMapPage extends StatelessWidget {
|
|||||||
const SosConnect(),
|
const SosConnect(),
|
||||||
speedCircle(),
|
speedCircle(),
|
||||||
const GoogleMapApp(),
|
const GoogleMapApp(),
|
||||||
PricesWindow(),
|
const PricesWindow(),
|
||||||
],
|
],
|
||||||
isleading: false);
|
isleading: false);
|
||||||
}
|
}
|
||||||
|
|||||||
92
lib/views/home/Captin/driver_map_speed.dart
Normal file
92
lib/views/home/Captin/driver_map_speed.dart
Normal file
@@ -0,0 +1,92 @@
|
|||||||
|
import 'package:SEFER/constant/style.dart';
|
||||||
|
import 'package:SEFER/controller/home/captin/speed_map_controller.dart';
|
||||||
|
import 'package:SEFER/views/home/Captin/mapDriverWidgets/speed_google_map.dart';
|
||||||
|
import 'package:SEFER/views/widgets/elevated_btn.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:get/get.dart';
|
||||||
|
import 'package:SEFER/controller/home/captin/map_driver_controller.dart';
|
||||||
|
import 'package:SEFER/views/widgets/my_scafold.dart';
|
||||||
|
|
||||||
|
import '../../../controller/functions/location_controller.dart';
|
||||||
|
import '../../Rate/rate_passenger.dart';
|
||||||
|
import 'mapDriverWidgets/driver_end_ride_bar.dart';
|
||||||
|
import 'mapDriverWidgets/google_driver_map_page.dart';
|
||||||
|
import 'mapDriverWidgets/google_map_app.dart';
|
||||||
|
import 'mapDriverWidgets/passenger_info_window.dart';
|
||||||
|
import 'mapDriverWidgets/sos_connect.dart';
|
||||||
|
|
||||||
|
class DriverSpeedLocationMapPage extends StatelessWidget {
|
||||||
|
DriverSpeedLocationMapPage({super.key});
|
||||||
|
final LocationController locationController = Get.put(LocationController());
|
||||||
|
// final MapDriverController mapDriverController =
|
||||||
|
// Get.put(MapDriverController());
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
Get.put(SpeedMapController())
|
||||||
|
.startTimerToShowPassengerInfoWindowFromDriver();
|
||||||
|
Get.find<SpeedMapController>().argumentLoading();
|
||||||
|
Get.put(MapDriverController());
|
||||||
|
|
||||||
|
return MyScafolld(
|
||||||
|
title: 'Map Passenger'.tr,
|
||||||
|
body: [
|
||||||
|
SpeedGoogleDriverMap(locationController: locationController),
|
||||||
|
const PassengerInfoWindow(),
|
||||||
|
driverEndRideBar(),
|
||||||
|
const SosConnect(),
|
||||||
|
speedCircle(),
|
||||||
|
const GoogleMapApp(),
|
||||||
|
const PricesWindow(),
|
||||||
|
],
|
||||||
|
isleading: false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class PricesWindow extends StatelessWidget {
|
||||||
|
const PricesWindow({
|
||||||
|
super.key,
|
||||||
|
});
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return GetBuilder<MapDriverController>(builder: (mapDriverController) {
|
||||||
|
return mapDriverController.isPriceWindow
|
||||||
|
? Positioned(
|
||||||
|
bottom: Get.height * 1.2,
|
||||||
|
// top: Get.height * 3,
|
||||||
|
left: Get.height * 1,
|
||||||
|
right: Get.height * 1,
|
||||||
|
child: Container(
|
||||||
|
height: Get.height * 3,
|
||||||
|
decoration: AppStyle.boxDecoration1,
|
||||||
|
child: Column(
|
||||||
|
children: [
|
||||||
|
Container(
|
||||||
|
decoration: AppStyle.boxDecoration1,
|
||||||
|
child: Padding(
|
||||||
|
padding: const EdgeInsets.all(3),
|
||||||
|
child: Text(
|
||||||
|
'Total Price is '.tr,
|
||||||
|
style: AppStyle.headTitle2,
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
),
|
||||||
|
)),
|
||||||
|
const SizedBox(
|
||||||
|
height: 20,
|
||||||
|
),
|
||||||
|
MyElevatedButton(
|
||||||
|
title: 'ok'.tr,
|
||||||
|
onPressed: () =>
|
||||||
|
Get.to(() => RatePassenger(), arguments: {
|
||||||
|
'rideId': mapDriverController.rideId,
|
||||||
|
'passengerId': mapDriverController.passengerId,
|
||||||
|
'driverId': mapDriverController.driverId
|
||||||
|
}))
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
)
|
||||||
|
: const SizedBox();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -16,7 +16,7 @@ class GoogleDriverMap extends StatelessWidget {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
// Get.put(MapDriverController());
|
Get.put(MapDriverController());
|
||||||
return Padding(
|
return Padding(
|
||||||
padding: const EdgeInsets.all(8.0),
|
padding: const EdgeInsets.all(8.0),
|
||||||
child: GetBuilder<MapDriverController>(
|
child: GetBuilder<MapDriverController>(
|
||||||
@@ -54,8 +54,8 @@ class GoogleDriverMap extends StatelessWidget {
|
|||||||
visible: true,
|
visible: true,
|
||||||
polylineId: const PolylineId('route1'),
|
polylineId: const PolylineId('route1'),
|
||||||
points: controller.polylineCoordinates,
|
points: controller.polylineCoordinates,
|
||||||
color: AppColor.greenColor,
|
color: AppColor.yellowColor,
|
||||||
width: 3,
|
width: 4,
|
||||||
),
|
),
|
||||||
Polyline(
|
Polyline(
|
||||||
zIndex: 2,
|
zIndex: 2,
|
||||||
@@ -67,7 +67,7 @@ class GoogleDriverMap extends StatelessWidget {
|
|||||||
polylineId: const PolylineId('route'),
|
polylineId: const PolylineId('route'),
|
||||||
points: controller.polylineCoordinatesDestination,
|
points: controller.polylineCoordinatesDestination,
|
||||||
color: AppColor.primaryColor,
|
color: AppColor.primaryColor,
|
||||||
width: 2,
|
width: 4,
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
markers: {
|
markers: {
|
||||||
@@ -79,7 +79,7 @@ class GoogleDriverMap extends StatelessWidget {
|
|||||||
rotation: locationController.heading),
|
rotation: locationController.heading),
|
||||||
Marker(
|
Marker(
|
||||||
markerId: MarkerId('start'.tr),
|
markerId: MarkerId('start'.tr),
|
||||||
position: controller.latLngpassengerLocation,
|
position: controller.latLngPassengerLocation,
|
||||||
draggable: true,
|
draggable: true,
|
||||||
icon: controller.startIcon,
|
icon: controller.startIcon,
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -21,10 +21,10 @@ class GoogleMapApp extends StatelessWidget {
|
|||||||
child: IconButton(
|
child: IconButton(
|
||||||
onPressed: () async {
|
onPressed: () async {
|
||||||
var startLat = Get.find<MapDriverController>()
|
var startLat = Get.find<MapDriverController>()
|
||||||
.latLngpassengerLocation
|
.latLngPassengerLocation
|
||||||
.latitude;
|
.latitude;
|
||||||
var startLng = Get.find<MapDriverController>()
|
var startLng = Get.find<MapDriverController>()
|
||||||
.latLngpassengerLocation
|
.latLngPassengerLocation
|
||||||
.longitude;
|
.longitude;
|
||||||
|
|
||||||
var endLat = Get.find<MapDriverController>()
|
var endLat = Get.find<MapDriverController>()
|
||||||
|
|||||||
97
lib/views/home/Captin/mapDriverWidgets/speed_google_map.dart
Normal file
97
lib/views/home/Captin/mapDriverWidgets/speed_google_map.dart
Normal file
@@ -0,0 +1,97 @@
|
|||||||
|
import 'package:SEFER/controller/home/captin/speed_map_controller.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:get/get.dart';
|
||||||
|
import 'package:google_maps_flutter/google_maps_flutter.dart';
|
||||||
|
|
||||||
|
import '../../../../constant/colors.dart';
|
||||||
|
import '../../../../controller/functions/location_controller.dart';
|
||||||
|
|
||||||
|
class SpeedGoogleDriverMap extends StatelessWidget {
|
||||||
|
const SpeedGoogleDriverMap({
|
||||||
|
super.key,
|
||||||
|
required this.locationController,
|
||||||
|
});
|
||||||
|
|
||||||
|
final LocationController locationController;
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
Get.put(SpeedMapController());
|
||||||
|
return Padding(
|
||||||
|
padding: const EdgeInsets.all(8.0),
|
||||||
|
child: GetBuilder<SpeedMapController>(
|
||||||
|
builder: (controller) => GoogleMap(
|
||||||
|
onMapCreated: controller.onMapCreated,
|
||||||
|
initialCameraPosition: CameraPosition(
|
||||||
|
// bearing: 45,
|
||||||
|
target: locationController.myLocation,
|
||||||
|
zoom: 16,
|
||||||
|
tilt: 40,
|
||||||
|
),
|
||||||
|
onCameraMoveStarted: () {},
|
||||||
|
onCameraMove: (position) {
|
||||||
|
locationController.myLocation = position.target;
|
||||||
|
controller.mapController!
|
||||||
|
.animateCamera(CameraUpdate.newCameraPosition(position));
|
||||||
|
},
|
||||||
|
minMaxZoomPreference: const MinMaxZoomPreference(6, 18),
|
||||||
|
myLocationEnabled: true,
|
||||||
|
compassEnabled: true,
|
||||||
|
mapType: MapType.normal,
|
||||||
|
trafficEnabled: true,
|
||||||
|
buildingsEnabled: true,
|
||||||
|
mapToolbarEnabled: true,
|
||||||
|
zoomControlsEnabled: true,
|
||||||
|
fortyFiveDegreeImageryEnabled: true,
|
||||||
|
zoomGesturesEnabled: true,
|
||||||
|
polylines: {
|
||||||
|
Polyline(
|
||||||
|
zIndex: 2,
|
||||||
|
consumeTapEvents: true,
|
||||||
|
geodesic: true,
|
||||||
|
endCap: Cap.buttCap,
|
||||||
|
startCap: Cap.buttCap,
|
||||||
|
visible: true,
|
||||||
|
polylineId: const PolylineId('route1'),
|
||||||
|
points: controller.polylineCoordinates,
|
||||||
|
color: AppColor.yellowColor,
|
||||||
|
width: 4,
|
||||||
|
),
|
||||||
|
Polyline(
|
||||||
|
zIndex: 2,
|
||||||
|
consumeTapEvents: true,
|
||||||
|
geodesic: true,
|
||||||
|
endCap: Cap.buttCap,
|
||||||
|
startCap: Cap.buttCap,
|
||||||
|
visible: true,
|
||||||
|
polylineId: const PolylineId('route'),
|
||||||
|
points: controller.polylineCoordinatesDestination,
|
||||||
|
color: AppColor.primaryColor,
|
||||||
|
width: 4,
|
||||||
|
),
|
||||||
|
},
|
||||||
|
markers: {
|
||||||
|
Marker(
|
||||||
|
markerId: MarkerId('MyLocation'.tr),
|
||||||
|
position: locationController.myLocation,
|
||||||
|
draggable: true,
|
||||||
|
icon: controller.carIcon,
|
||||||
|
rotation: locationController.heading),
|
||||||
|
Marker(
|
||||||
|
markerId: MarkerId('start'.tr),
|
||||||
|
position: controller.latLngPassengerLocation,
|
||||||
|
draggable: true,
|
||||||
|
icon: controller.startIcon,
|
||||||
|
),
|
||||||
|
Marker(
|
||||||
|
markerId: MarkerId('end'.tr),
|
||||||
|
position: controller.latLngPassengerDestination,
|
||||||
|
draggable: true,
|
||||||
|
icon: controller.endIcon,
|
||||||
|
),
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -82,7 +82,7 @@ class OrderRequestPage extends StatelessWidget {
|
|||||||
// orderRequestController.calculateConsumptionFuel();
|
// orderRequestController.calculateConsumptionFuel();
|
||||||
|
|
||||||
return MyScafolld(
|
return MyScafolld(
|
||||||
title: 'Order Details'.tr,
|
title: 'Special Order'.tr,
|
||||||
body: [
|
body: [
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 6),
|
padding: const EdgeInsets.symmetric(horizontal: 6),
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ import 'dart:convert';
|
|||||||
|
|
||||||
import 'package:SEFER/controller/functions/tts.dart';
|
import 'package:SEFER/controller/functions/tts.dart';
|
||||||
import 'package:SEFER/controller/home/captin/home_captain_controller.dart';
|
import 'package:SEFER/controller/home/captin/home_captain_controller.dart';
|
||||||
|
import 'package:SEFER/views/home/Captin/driver_map_speed.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:SEFER/constant/box_name.dart';
|
import 'package:SEFER/constant/box_name.dart';
|
||||||
@@ -90,7 +91,7 @@ class OrderSpeedRequest extends StatelessWidget {
|
|||||||
// }
|
// }
|
||||||
|
|
||||||
return MyScafolld(
|
return MyScafolld(
|
||||||
title: 'Order Details'.tr,
|
title: 'Speed Order'.tr,
|
||||||
body: [
|
body: [
|
||||||
ListView(
|
ListView(
|
||||||
// crossAxisAlignment: CrossAxisAlignment.start,
|
// crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
@@ -336,6 +337,7 @@ class OrderSpeedRequest extends StatelessWidget {
|
|||||||
}));
|
}));
|
||||||
} else if (jsonDecode(res)['status'] == "success") {
|
} else if (jsonDecode(res)['status'] == "success") {
|
||||||
box.write(BoxName.statusDriverLocation, 'on');
|
box.write(BoxName.statusDriverLocation, 'on');
|
||||||
|
orderRequestController.changeApplied();
|
||||||
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(),
|
||||||
@@ -359,40 +361,75 @@ class OrderSpeedRequest extends StatelessWidget {
|
|||||||
bodyToPassenger,
|
bodyToPassenger,
|
||||||
);
|
);
|
||||||
Get.back();
|
Get.back();
|
||||||
Get.to(() => PassengerLocationMapPage(), arguments: {
|
|
||||||
'passengerLocation': myList[0].toString(),
|
print(
|
||||||
'passengerDestination': myList[1].toString(),
|
'Arguments passed to PassengerLocationMapPage:');
|
||||||
'Duration': myList[4].toString(),
|
print('Passenger Location: ${myList[0]}');
|
||||||
'totalCost': myList[26].toString(),
|
print('Passenger Destination: ${myList[1]}');
|
||||||
'Distance': myList[5].toString(),
|
print('Duration: ${myList[4]}');
|
||||||
'name': myList[8].toString(),
|
print('Total Cost: ${myList[26]}');
|
||||||
'phone': myList[10].toString(),
|
print('Distance: ${myList[5]}');
|
||||||
'email': myList[28].toString(),
|
print('Name: ${myList[8]}');
|
||||||
'WalletChecked': myList[13].toString(),
|
print('Phone: ${myList[10]}');
|
||||||
'tokenPassenger': myList[9].toString(),
|
print('Email: ${myList[28]}');
|
||||||
'direction':
|
print('Wallet Checked: ${myList[13]}');
|
||||||
'https://www.google.com/maps/dir/${myList[0]}/${myList[1]}/',
|
print('Token Passenger: ${myList[9]}');
|
||||||
'DurationToPassenger': myList[15].toString(),
|
print('Direction: ${myList[29]}');
|
||||||
'rideId': myList[16].toString(),
|
print('Duration To Passenger: ${myList[15]}');
|
||||||
'passengerId': myList[7].toString(),
|
print('Ride ID: ${myList[16]}');
|
||||||
'driverId': myList[18].toString(),
|
print('Passenger ID: ${myList[7]}');
|
||||||
'durationOfRideValue': myList[19].toString(),
|
print('Driver ID: ${myList[18]}');
|
||||||
'paymentAmount': myList[2].toString(),
|
print('Duration Of Ride Value: ${myList[19]}');
|
||||||
'paymentMethod': myList[13].toString() == 'true'
|
print('Payment Amount: ${myList[2]}');
|
||||||
? 'visa'
|
print(
|
||||||
: 'cash',
|
'Payment Method: ${myList[13] == 'true' ? 'visa' : 'cash'}');
|
||||||
'isHaveSteps': myList[20].toString(),
|
print('Is Have Steps: ${myList[20]}');
|
||||||
'step0': myList[21].toString(),
|
print('Step 0: ${myList[21]}');
|
||||||
'step1': myList[22].toString(),
|
print('Step 1: ${myList[22]}');
|
||||||
'step2': myList[23].toString(),
|
print('Step 2: ${myList[23]}');
|
||||||
'step3': myList[24].toString(),
|
print('Step 3: ${myList[24]}');
|
||||||
'step4': myList[25].toString(),
|
print('Step 4: ${myList[25]}');
|
||||||
'passengerWalletBurc': myList[26].toString(),
|
print('Passenger Wallet Burc: ${myList[26]}');
|
||||||
'timeOfOrder': DateTime.now().toString(),
|
print('Time Of Order: ${myList[30]}');
|
||||||
'totalPassenger': myList[2].toString(),
|
print('Total Passenger: ${myList[2]}');
|
||||||
'carType': myList[31].toString(),
|
print('Car Type: ${myList[31]}');
|
||||||
'kazan': myList[32].toString(),
|
print('Kazan: ${myList[32]}');
|
||||||
});
|
|
||||||
|
Get.to(() => DriverSpeedLocationMapPage(),
|
||||||
|
arguments: {
|
||||||
|
'passengerLocation': myList[0].toString(),
|
||||||
|
'passengerDestination': myList[1].toString(),
|
||||||
|
'Duration': myList[4].toString(),
|
||||||
|
'totalCost': myList[26].toString(),
|
||||||
|
'Distance': myList[5].toString(),
|
||||||
|
'name': myList[8].toString(),
|
||||||
|
'phone': myList[10].toString(),
|
||||||
|
'email': myList[28].toString(),
|
||||||
|
'WalletChecked': myList[13].toString(),
|
||||||
|
'tokenPassenger': myList[9].toString(),
|
||||||
|
'direction':
|
||||||
|
'https://www.google.com/maps/dir/${myList[0]}/${myList[1]}/',
|
||||||
|
'DurationToPassenger': myList[15].toString(),
|
||||||
|
'rideId': myList[16].toString(),
|
||||||
|
'passengerId': myList[7].toString(),
|
||||||
|
'driverId': myList[18].toString(),
|
||||||
|
'durationOfRideValue': myList[19].toString(),
|
||||||
|
'paymentAmount': myList[2].toString(),
|
||||||
|
'paymentMethod': myList[13].toString() == 'true'
|
||||||
|
? 'visa'
|
||||||
|
: 'cash',
|
||||||
|
'isHaveSteps': myList[20].toString(),
|
||||||
|
'step0': myList[21].toString(),
|
||||||
|
'step1': myList[22].toString(),
|
||||||
|
'step2': myList[23].toString(),
|
||||||
|
'step3': myList[24].toString(),
|
||||||
|
'step4': myList[25].toString(),
|
||||||
|
'passengerWalletBurc': myList[26].toString(),
|
||||||
|
'timeOfOrder': DateTime.now().toString(),
|
||||||
|
'totalPassenger': myList[2].toString(),
|
||||||
|
'carType': myList[31].toString(),
|
||||||
|
'kazan': myList[32].toString(),
|
||||||
|
});
|
||||||
}
|
}
|
||||||
// });
|
// });
|
||||||
// Get.back();
|
// Get.back();
|
||||||
|
|||||||
Reference in New Issue
Block a user