This commit is contained in:
Hamza Aleghwairyeen
2024-04-03 01:59:19 +03:00
parent cf3704612f
commit 087b102d9a
3 changed files with 11 additions and 7 deletions

View File

@@ -109,9 +109,9 @@ class MapDriverController extends GetxController {
CameraUpdate.newLatLng(Get.find<LocationController>().myLocation), CameraUpdate.newLatLng(Get.find<LocationController>().myLocation),
); );
// Set up a timer or interval to trigger the marker update every 3 seconds. // Set up a timer or interval to trigger the marker update every 3 seconds.
timer = Timer.periodic(const Duration(seconds: 1), (_) { // timer = Timer.periodic(const Duration(seconds: 1), (_) {
updateMarker(); // updateMarker();
}); // });
} }
void changeStatusDriver() { void changeStatusDriver() {
@@ -598,6 +598,7 @@ class MapDriverController extends GetxController {
progressTimerRideBegin = i / durationOfRide; progressTimerRideBegin = i / durationOfRide;
remainingTimeTimerRideBegin = durationOfRide - i; remainingTimeTimerRideBegin = durationOfRide - i;
remainingTimeTimerRideBegin < 60 ? driverEndPage = 160 : 100; remainingTimeTimerRideBegin < 60 ? driverEndPage = 160 : 100;
updateMarker();
if (remainingTimeTimerRideBegin < 120) { if (remainingTimeTimerRideBegin < 120) {
// to make driver available on last 2 minute in his trip // to make driver available on last 2 minute in his trip
box.write(BoxName.statusDriverLocation, 'off'); box.write(BoxName.statusDriverLocation, 'off');
@@ -828,7 +829,7 @@ class MapDriverController extends GetxController {
late Duration durationToAdd; late Duration durationToAdd;
int hours = 0; int hours = 0;
int minutes = 0; int minutes = 0;
late String carType = ''; late String carType;
late String kazan; late String kazan;
@override @override
void onInit() async { void onInit() async {

View File

@@ -16,12 +16,14 @@ 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 =
Get.put(MapDriverController());
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
Get.put(MapDriverController()); // Get.put(MapDriverController());
return MyScafolld( return MyScafolld(
title: Get.find<MapDriverController>().carType, title: 'Map Passenger'.tr + mapDriverController.carType,
body: [ body: [
GoogleDriverMap(locationController: locationController), GoogleDriverMap(locationController: locationController),
const PassengerInfoWindow(), const PassengerInfoWindow(),

View File

@@ -70,7 +70,8 @@ GetBuilder<MapDriverController> driverEndRideBar() {
Text(mapDriverController.price.toStringAsFixed(0)), Text(mapDriverController.price.toStringAsFixed(0)),
], ],
), ),
mapDriverController.carType == 'Free Ride' mapDriverController.carType == 'Free Ride' ||
mapDriverController.carType == 'Comfort'
? Row( ? Row(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [