This commit is contained in:
Hamza-Ayed
2023-11-20 01:29:27 +03:00
parent 63a6420531
commit 64cdc55845
13 changed files with 261 additions and 89 deletions

View File

@@ -59,6 +59,7 @@ class MapDriverController extends GetxController {
String stringRemainingTimeRideBegin = '';
double progressTimerRideBegin = 0;
late Timer timer;
String? mapAPIKEY;
void onMapCreated(GoogleMapController controller) {
LocationController locationController = Get.find<LocationController>();
@@ -315,7 +316,7 @@ class MapDriverController extends GetxController {
update();
var url =
('${AppLink.googleMapsLink}directions/json?&language=en&avoid=tolls|ferries&destination=$destination&origin=$origin&key=${AppCredintials.mapAPIKEY}');
('${AppLink.googleMapsLink}directions/json?&language=en&avoid=tolls|ferries&destination=$destination&origin=$origin&key=${mapAPIKEY}');
var response = await CRUD().getGoogleApi(link: url, payload: {});
data = response['routes'][0]['legs'];
@@ -359,7 +360,8 @@ class MapDriverController extends GetxController {
}
@override
void onInit() {
void onInit() async {
mapAPIKEY = await storage.read(key: BoxName.mapAPIKEY);
// Get the passenger location from the arguments.
passengerLocation = Get.arguments['passengerLocation'];
duration = Get.arguments['Duration'];