3/30/2
This commit is contained in:
@@ -500,7 +500,9 @@ update ui for totla results
|
||||
isRideFinished = true;
|
||||
isRideStarted = false;
|
||||
isPriceWindow = false;
|
||||
|
||||
if (cartype == 'Comfort') {
|
||||
totalCost = (price * rideTimerFromBegin).toString();
|
||||
}
|
||||
box.write(BoxName.statusDriverLocation, 'off');
|
||||
// changeRideToBeginToPassenger();
|
||||
await CRUD().post(link: AppLink.updateRides, payload: {
|
||||
@@ -586,6 +588,8 @@ update ui for totla results
|
||||
}
|
||||
}
|
||||
|
||||
int rideTimerFromBegin = 0;
|
||||
double price = 0;
|
||||
void rideIsBeginPassengerTimer() async {
|
||||
// print('mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm');
|
||||
// print(durationOfRideValue);
|
||||
@@ -593,6 +597,12 @@ update ui for totla results
|
||||
update();
|
||||
for (int i = 0; i <= durationOfRide; i++) {
|
||||
await Future.delayed(const Duration(seconds: 1));
|
||||
recentDistanceToDash = Get.find<LocationController>().totalDistance;
|
||||
rideTimerFromBegin = i;
|
||||
price = rideTimerFromBegin ~/ 60 +
|
||||
(recentDistanceToDash * 4); //todo from kazan
|
||||
price = (price * .10) + price;
|
||||
speed = Get.find<LocationController>().speed;
|
||||
progressTimerRideBegin = i / durationOfRide;
|
||||
remainingTimeTimerRideBegin = durationOfRide - i;
|
||||
remainingTimeTimerRideBegin < 60 ? driverEndPage = 160 : 100;
|
||||
@@ -646,6 +656,7 @@ update ui for totla results
|
||||
|
||||
double recentDistanceToDash = 0;
|
||||
double recentAngelToMarker = 0;
|
||||
double speed = 0;
|
||||
void updateMarker() async {
|
||||
// Remove the existing marker with the ID `MyLocation`.
|
||||
markers.remove(MarkerId('MyLocation'));
|
||||
@@ -884,6 +895,7 @@ LIMIT
|
||||
late Duration durationToAdd;
|
||||
int hours = 0;
|
||||
int minutes = 0;
|
||||
late String cartype;
|
||||
@override
|
||||
void onInit() async {
|
||||
mapAPIKEY = await storage.read(key: BoxName.mapAPIKEY);
|
||||
@@ -915,6 +927,7 @@ LIMIT
|
||||
step4 = Get.arguments['step4'];
|
||||
passengerWalletBurc = Get.arguments['passengerWalletBurc'];
|
||||
timeOfOrder = Get.arguments['timeOfOrder'];
|
||||
cartype = Get.arguments['carType'];
|
||||
|
||||
var coords = passengerLocation.split(',');
|
||||
var coordDestination = passengerDestination.split(',');
|
||||
|
||||
@@ -466,8 +466,8 @@ class MapPassengerController extends GetxController {
|
||||
|
||||
void sendWhatsapp(String to) async {
|
||||
// Get the driver's phone number.
|
||||
String driverPhone =
|
||||
dataCarsLocationByPassenger['message'][carsOrder]['phone'].toString();
|
||||
// String driverPhone =
|
||||
// dataCarsLocationByPassenger['message'][carsOrder]['phone'].toString();
|
||||
|
||||
// Format the message.
|
||||
String message =
|
||||
@@ -845,6 +845,7 @@ class MapPassengerController extends GetxController {
|
||||
box.read(BoxName.email).toString(),
|
||||
startNameAddress,
|
||||
endNameAddress,
|
||||
box.read(BoxName.carType),
|
||||
];
|
||||
print(body);
|
||||
FirebaseMessagesController().sendNotificationToDriverMapPolyline(
|
||||
@@ -920,6 +921,7 @@ class MapPassengerController extends GetxController {
|
||||
box.read(BoxName.email).toString(),
|
||||
startNameAddress,
|
||||
endNameAddress,
|
||||
box.read(BoxName.carType),
|
||||
];
|
||||
print('driversToken');
|
||||
print(driversToken);
|
||||
|
||||
@@ -27,6 +27,7 @@ class PassengerLocationMapPage extends StatelessWidget {
|
||||
const PassengerInfoWindow(),
|
||||
driverEndRideBar(),
|
||||
const SosConnect(),
|
||||
speedCircle(),
|
||||
const GoogleMapApp(),
|
||||
PricesWindow(),
|
||||
],
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import 'package:SEFER/controller/functions/location_controller.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
@@ -17,7 +18,7 @@ GetBuilder<MapDriverController> driverEndRideBar() {
|
||||
decoration: AppStyle.boxDecoration,
|
||||
height: mapDriverController.remainingTimeTimerRideBegin < 60
|
||||
? mapDriverController.driverEndPage = 160
|
||||
: 100,
|
||||
: 120,
|
||||
width: 240,
|
||||
child: Column(
|
||||
children: [
|
||||
@@ -54,11 +55,14 @@ GetBuilder<MapDriverController> driverEndRideBar() {
|
||||
],
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
children: [
|
||||
Text(mapDriverController.recentAngelToMarker
|
||||
.toStringAsFixed(0)),
|
||||
Text(mapDriverController.recentDistanceToDash
|
||||
.toStringAsFixed(0))
|
||||
Text(
|
||||
'Timer is ${mapDriverController.rideTimerFromBegin.toStringAsFixed(0)}'),
|
||||
Text(
|
||||
'Distance is ${mapDriverController.recentDistanceToDash.toStringAsFixed(0)}'),
|
||||
Text(
|
||||
'Price is ${mapDriverController.price.toStringAsFixed(0)}')
|
||||
],
|
||||
),
|
||||
mapDriverController.remainingTimeTimerRideBegin < 60
|
||||
@@ -102,3 +106,25 @@ GetBuilder<MapDriverController> driverEndRideBar() {
|
||||
))
|
||||
: const SizedBox());
|
||||
}
|
||||
|
||||
GetBuilder<MapDriverController> speedCircle() {
|
||||
return GetBuilder<MapDriverController>(
|
||||
builder: (mapDriverController) => mapDriverController.isRideStarted
|
||||
? Positioned(
|
||||
// left: 5,
|
||||
bottom: 25,
|
||||
right: 5,
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
shape: BoxShape.circle,
|
||||
color: AppColor.redColor,
|
||||
border: Border.all(width: 1)),
|
||||
height: 60,
|
||||
width: 60,
|
||||
child: Text(
|
||||
mapDriverController.speed.toStringAsFixed(0),
|
||||
style: AppStyle.number,
|
||||
),
|
||||
))
|
||||
: const SizedBox());
|
||||
}
|
||||
|
||||
@@ -84,7 +84,7 @@ class OrderRequestPage extends StatelessWidget {
|
||||
title: 'Order Details'.tr,
|
||||
body: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16),
|
||||
padding: const EdgeInsets.symmetric(horizontal: 6),
|
||||
child: ListView(
|
||||
// crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
@@ -200,59 +200,49 @@ class OrderRequestPage extends StatelessWidget {
|
||||
width: Get.width * .9,
|
||||
decoration: AppStyle.boxDecoration1,
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
Column(
|
||||
children: [
|
||||
Column(
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
const Icon(
|
||||
Icons.arrow_circle_up,
|
||||
color: AppColor.greenColor,
|
||||
),
|
||||
Text(
|
||||
myList[12] + ' ' + ' (${myList[11]}) ',
|
||||
style: AppStyle.title,
|
||||
),
|
||||
],
|
||||
const Icon(
|
||||
Icons.arrow_circle_up,
|
||||
color: AppColor.greenColor,
|
||||
),
|
||||
Text(
|
||||
myList[29],
|
||||
myList[12] + ' ' + ' (${myList[11]}) ',
|
||||
style: AppStyle.title,
|
||||
),
|
||||
],
|
||||
),
|
||||
Text(
|
||||
myList[29],
|
||||
style: AppStyle.title,
|
||||
),
|
||||
],
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
Column(
|
||||
children: [
|
||||
Column(
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
const Icon(
|
||||
Icons.arrow_circle_up,
|
||||
color: AppColor.greenColor,
|
||||
),
|
||||
Text(
|
||||
myList[5] + ' ' + ' (${myList[4]}) ',
|
||||
style: AppStyle.title,
|
||||
),
|
||||
],
|
||||
const Icon(
|
||||
Icons.arrow_circle_up,
|
||||
color: AppColor.greenColor,
|
||||
),
|
||||
Text(
|
||||
myList[30],
|
||||
myList[5] + ' ' + ' (${myList[4]}) ',
|
||||
style: AppStyle.title,
|
||||
),
|
||||
],
|
||||
),
|
||||
Text(
|
||||
myList[30],
|
||||
style: AppStyle.title,
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
@@ -361,6 +351,7 @@ class OrderRequestPage extends StatelessWidget {
|
||||
'passengerWalletBurc': myList[26].toString(),
|
||||
'timeOfOrder': DateTime.now().toString(),
|
||||
'totalPassenger': myList[2].toString(),
|
||||
'carType':myList[31].toString(),
|
||||
});
|
||||
},
|
||||
),
|
||||
|
||||
@@ -434,6 +434,7 @@ class OrderSpeedRequest extends StatelessWidget {
|
||||
'passengerWalletBurc': myList[26].toString(),
|
||||
'timeOfOrder': DateTime.now().toString(),
|
||||
'totalPassenger': myList[2].toString(),
|
||||
'carType': myList[31].toString(),
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
@@ -146,29 +146,47 @@ class GoogleMapPassengerWidget extends StatelessWidget {
|
||||
markers: {
|
||||
if (controller.statusRide != 'Apply' ||
|
||||
!controller.rideTimerBegin)
|
||||
for (var carLocation in controller.carLocationsModels)
|
||||
for (var i = 0;
|
||||
controller
|
||||
.dataCarsLocationByPassenger['message'].length;
|
||||
i++)
|
||||
Marker(
|
||||
// anchor: const Offset(4, 4),
|
||||
position: LatLng(
|
||||
carLocation.latitude,
|
||||
carLocation.longitude,
|
||||
),
|
||||
double.parse(controller
|
||||
.datadriverCarsLocationToPassengerAfterApplied[
|
||||
'message'][i]['latitude']),
|
||||
double.parse(controller
|
||||
.datadriverCarsLocationToPassengerAfterApplied[
|
||||
'message'][i]['longitude'])),
|
||||
icon: controller.carIcon,
|
||||
markerId: MarkerId(carLocation.toString()),
|
||||
rotation: carLocation.heading,
|
||||
), ///////////////////
|
||||
markerId: MarkerId(controller
|
||||
.datadriverCarsLocationToPassengerAfterApplied[
|
||||
'message'][i]['longitude']
|
||||
.toString()),
|
||||
rotation: double.parse(controller
|
||||
.datadriverCarsLocationToPassengerAfterApplied[
|
||||
'message'][i]['heading']),
|
||||
),
|
||||
// controller.carMarrkerAplied,
|
||||
if (controller.statusRide == 'Apply')
|
||||
for (var carLocation
|
||||
in controller.driverCarsLocationToPassengerAfterApplied)
|
||||
Marker(
|
||||
// anchor: const Offset(4, 4),
|
||||
position: carLocation,
|
||||
icon: controller.carIcon,
|
||||
rotation: double.parse(controller
|
||||
.datadriverCarsLocationToPassengerAfterApplied[
|
||||
'message'][0]['latitude']),
|
||||
markerId: MarkerId(carLocation.toString())),
|
||||
// for (var carLocation
|
||||
// in controller.driverCarsLocationToPassengerAfterApplied)
|
||||
Marker(
|
||||
// anchor: const Offset(4, 4),
|
||||
position: LatLng(
|
||||
double.parse(controller.datadriverCarsLocationToPassengerAfterApplied['message']
|
||||
[0]['latitude']),
|
||||
double.parse(controller.datadriverCarsLocationToPassengerAfterApplied['message']
|
||||
[0]['longitude'])), //carLocation,
|
||||
icon: controller.carIcon,
|
||||
rotation: double.parse(
|
||||
controller.datadriverCarsLocationToPassengerAfterApplied['message']
|
||||
[0]['heading']),
|
||||
markerId: MarkerId(controller
|
||||
.datadriverCarsLocationToPassengerAfterApplied['message']
|
||||
[0]['longitude']
|
||||
.toString())),
|
||||
for (int i = 1;
|
||||
i < controller.coordinatesWithoutEmpty.length - 1;
|
||||
i++)
|
||||
|
||||
Reference in New Issue
Block a user