This commit is contained in:
Hamza Aleghwairyeen
2024-03-30 13:28:23 +03:00
parent c853d89037
commit 6e417cbb75
7 changed files with 111 additions and 59 deletions

View File

@@ -27,6 +27,7 @@ class PassengerLocationMapPage extends StatelessWidget {
const PassengerInfoWindow(),
driverEndRideBar(),
const SosConnect(),
speedCircle(),
const GoogleMapApp(),
PricesWindow(),
],

View File

@@ -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());
}

View File

@@ -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(),
});
},
),

View File

@@ -434,6 +434,7 @@ class OrderSpeedRequest extends StatelessWidget {
'passengerWalletBurc': myList[26].toString(),
'timeOfOrder': DateTime.now().toString(),
'totalPassenger': myList[2].toString(),
'carType': myList[31].toString(),
});
}
});

View File

@@ -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++)