From b144d1707a2a62b16eccfa5b119f0b9c9322a050 Mon Sep 17 00:00:00 2001 From: Hamza-Ayed Date: Thu, 2 May 2024 12:19:05 +0300 Subject: [PATCH] 5/2/driver2 --- lib/main.dart | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/lib/main.dart b/lib/main.dart index c46f526..bd836a2 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -1,6 +1,7 @@ import 'dart:io'; import 'package:SEFER/controller/payment/paymob/paymob_response.dart'; +import 'package:SEFER/views/widgets/elevated_btn.dart'; import 'package:firebase_core/firebase_core.dart'; import 'package:firebase_messaging/firebase_messaging.dart'; import 'package:flutter/material.dart'; @@ -40,13 +41,6 @@ Future backgroundMessageHandler(RemoteMessage message) async { FirebaseMessagesController().fireBaseTitles(message); } -// @pragma('vm:entry-point') -// Future backgroundLocation() async { -// await LocationBackgroundController().startBackLocation().then((location) { -// print('This is current Location ${location.toMap()}'); -// }); -// } - void main() async { WidgetsFlutterBinding.ensureInitialized(); WakelockPlus.enable(); @@ -63,9 +57,17 @@ void main() async { print(Get.deviceLocale!.countryCode); Stripe.publishableKey = AK.publishableKey; - if (box.read(BoxName.driverID) != null) { - Get.put(LocationBackgroundController()); - } + // if (box.read(BoxName.driverID) != null) { + Get.defaultDialog( + title: 'Gps required', + middleText: '', + confirm: MyElevatedButton( + title: 'ok'.tr, + onPressed: () { + Get.put(LocationBackgroundController()); + })); + + // } if (Platform.isAndroid || Platform.isIOS) { await Firebase.initializeApp( options: DefaultFirebaseOptions.currentPlatform,