diff --git a/lib/main.dart b/lib/main.dart index 1ebf812d6..43c82a9bc 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -16,6 +16,8 @@ import 'package:hive/hive.dart'; import 'package:hive_flutter/hive_flutter.dart'; import 'package:provider/provider.dart'; import 'package:shared_preferences/shared_preferences.dart'; +import 'package:google_maps_flutter_android/google_maps_flutter_android.dart'; +import 'package:google_maps_flutter_platform_interface/google_maps_flutter_platform_interface.dart'; late bool showOnboardingScreen; @@ -26,6 +28,16 @@ void main() async { WidgetsFlutterBinding.ensureInitialized(); await Firebase.initializeApp(); + AndroidMapRenderer mapRenderer = AndroidMapRenderer.platformDefault; +// ยทยทยท + final GoogleMapsFlutterPlatform mapsImplementation = + GoogleMapsFlutterPlatform.instance; + if (mapsImplementation is GoogleMapsFlutterAndroid) { + WidgetsFlutterBinding.ensureInitialized(); + mapRenderer = await mapsImplementation + .initializeWithRenderer(AndroidMapRenderer.latest); + } + /// Record zoned errors - https://firebase.flutter.dev/docs/crashlytics/usage#zoned-errors runZonedGuarded>(() async { /// Enable crash analytics - https://firebase.flutter.dev/docs/crashlytics/usage#toggle-crashlytics-collection diff --git a/pubspec.lock b/pubspec.lock index 186fb8e7b..d863b7e85 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -535,14 +535,28 @@ packages: name: google_maps_flutter url: "https://pub.dartlang.org" source: hosted - version: "2.0.6" + version: "2.2.2" + google_maps_flutter_android: + dependency: transitive + description: + name: google_maps_flutter_android + url: "https://pub.dartlang.org" + source: hosted + version: "2.4.0" + google_maps_flutter_ios: + dependency: transitive + description: + name: google_maps_flutter_ios + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.12" google_maps_flutter_platform_interface: dependency: transitive description: name: google_maps_flutter_platform_interface url: "https://pub.dartlang.org" source: hosted - version: "2.1.7" + version: "2.2.4" graphs: dependency: transitive description: @@ -1149,4 +1163,4 @@ packages: version: "3.1.1" sdks: dart: ">=2.18.0 <3.0.0" - flutter: ">=2.12.0" + flutter: ">=3.0.0" diff --git a/pubspec.yaml b/pubspec.yaml index 1b9020844..6dc87f836 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -26,7 +26,7 @@ dependencies: flutter_secure_storage: 5.0.2 flutter_sticky_header: 0.6.0 get: 4.1.4 - google_maps_flutter: 2.0.6 + google_maps_flutter: 2.2.2 hive: 2.0.4 hive_flutter: 1.0.0 intl: 0.17.0