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,