Last updated:
0 purchases
simple google maps flutter
A clone of google_maps_flutter but use simple_platform_view instead of AndroidView for performance optimization
Getting started #
Please check the simple_platform_view package before using this package, as simple_platform_view comes with several drawbacks that need to be considered beforehand.
Usage #
Platform
Status
Android
✅
iOS
❌
Download the custom engine
simple_platform_view requires modifications to the engine itself. Therefore, to run it on Android, you need to use a modified version of Flutter.
Download the custom Flutter version Here.
Unzip the downloaded flutter.zip file.
Run the following command to download the custom engine artifacts for the first time:
$ path_to_custom_version/flutter/bin/flutter doctor
copied to clipboard
Then use it same as a normal Flutter installation:
$ path_to_custom_version/flutter/bin/flutter build apk
copied to clipboard
Add the following dependency to your pubspec.yaml file:
dependencies:
google_maps_flutter:
simple_google_maps_flutter:
copied to clipboard
Android:
Replace the default GoogleMapsFlutterPlatform.instance with the modified version:
import 'package:simple_google_maps_flutter/simple_google_maps_flutter.dart';
@override
void initState() {
super.initState();
if (Platform.isAndroid) {
SimpleGoogleMapsFlutterAndroid.registerWith();
}
}
copied to clipboard
If you are using Google Map inside a scroll view, add this to your MaterialApp to prevent issues with StretchingOverscrollIndicator:
import 'package:simple_platform_view/simple_platform_view.dart';
@override
Widget build(BuildContext context) {
return MaterialApp(
// Fix StretchingOverscrollIndicator issues
scrollBehavior: SimplePlatformViewScrollBehavior(),
);
}
copied to clipboard
Other usage is just like google_maps_flutter package
iOS:
iOS is not supported
Demo
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.