In Flutter, several map providers are available for integrating maps into your app. Here’s an overview of the most popular ones:
🔹 1. Google Maps for Flutter
- Plugin:
google_maps_flutter - Pros:
- Official support by Google.
- Rich features: markers, polygons, polylines, camera control.
- Wide community support.
- Cons:
- Requires an API key and billing setup.
- Not fully open source.
🔹 2. Mapbox
- Plugin:
mapbox_gl - Pros:
- High customization and beautiful map styles.
- 3D terrain, indoor maps, and dynamic styling.
- Cons:
- Requires an API token.
- Slightly steeper learning curve than Google Maps.
🔹 3. OpenStreetMap (OSM)
- Plugins:
flutter_map(uses Leaflet under the hood)osm_flutter
- Pros:
- Free and open source.
- No API key or billing required.
- Good offline map support with some add-ons.
- Cons:
- Fewer built-in features than Google or Mapbox.
- You may need to self-host tiles for large-scale use.
🔹 4. Here Maps
- Plugin:
here_sdk - Pros:
- Good for routing, navigation, and real-time traffic.
- Strong enterprise features.
- Cons:
- Requires SDK download and registration.
- Licensing may apply for commercial use.
🔹 5. TomTom
- Plugin:
tomtom_sdk_map - Pros:
- Traffic data, search, and navigation services.
- Cons:
- Requires API key.
- Less community usage compared to Google or Mapbox.
🔹 6. ArcGIS Maps by Esri
- Plugin:
arcgis_maps_flutter - Pros:
- Geospatial analytics, layers, and GIS capabilities.
- Cons:
- Geared more towards enterprise/GIS apps.
Summary Table:
| Provider | Offline Support | API Key Needed | Licence Cost |
|---|---|---|---|
| Google Maps | Limited | ✔ | Yes (some free tier) |
| Mapbox | Good | ✔ | Free/paid tiers |
| OpenStreetMap | Possible | ✖ | Free (self-host tiles) |
| HERE Maps | Good | ✔ | Yes (free tier available) |
| TomTom | Good | ✔ | Free/paid tiers |
| ArcGIS | Good | ✔ | Commercial license |
What about Huawei phones
Huawei phones, especially recent models without Google Mobile Services (GMS), do not support Google Maps out of the box, so if you want your Flutter app to run well on those devices, you’ll need to consider alternatives.
Here’s how the popular map providers stack up specifically for Huawei devices:
✅ Best Options for Huawei Phones
1. Huawei Map Kit
- Plugin:
huawei_map - Platform: HarmonyOS / Android (with Huawei Mobile Services – HMS)
- Pros:
- Official support for Huawei devices.
- Works well on phones without Google services.
- Provides similar features to Google Maps (markers, polygons, etc.).
- Cons:
- Requires setup in Huawei Developer Console.
- Limited community compared to Google or Mapbox.
- Use if: You want full compatibility with newer Huawei devices and access to Huawei’s APIs.
2. OpenStreetMap via flutter_map
- Plugin:
flutter_map - Pros:
- Fully open source.
- No dependencies on Google or Huawei services.
- Works on any Android or iOS device, including Huawei.
- Cons:
- You need to manage tile sources, caching, and some features manually.
- Use if: You want cross-device compatibility without any proprietary SDKs.
3. Mapbox
- Plugin:
mapbox_gl - Pros:
- Works on Huawei and non-Huawei devices.
- Excellent styling and map features.
- Cons:
- May have minor compatibility issues on older Huawei models.
- Requires API key and subject to pricing.
- Use if: You want a polished alternative to Google Maps with strong visual control.
What about Location Services
When it comes to location services in Flutter, the situation is similar to maps: you need to consider both device compatibility (Google vs. Huawei) and what kind of location functionality your app needs (e.g., foreground, background, geofencing, etc.).
🔍 Flutter Location Services Overview
✅ Cross-Platform Location Plugins
1. location
- Works on Android and iOS.
- Uses Google Play Services where available, but also works without them.
- Features:
- Get current location.
- Listen to location changes.
- Background location (limited on iOS).
- ✅ Works on Huawei phones, even without GMS.
2. geolocator
- Also works on both Android and iOS.
- Features:
- High-accuracy location tracking.
- Distance calculation.
- Location permissions.
- ✅ Supports Huawei, provided location services are enabled in Android OS.
- ❗ May rely on Google Play Services for fused location (not available on newer Huawei phones). Falls back to basic location providers.
📱 Huawei-Specific Location Services
🛰️ Huawei Location Kit
- Plugin:
huawei_location - Requires Huawei Mobile Services (HMS).
- Features:
- Fused location provider (like Google’s).
- Geofencing.
- Activity recognition.
- ✅ Best performance on Huawei devices without GMS.
- ❌ Not available on other Android or iOS devices.
🚫 Not Recommended for Huawei
❌ Plugins that strictly require Google Play Services
- Some location plugins (especially older or less maintained ones) crash or return null results on Huawei phones without GMS.
- Always test on a Huawei device (or emulator with HMS only) to be sure.
✨ Summary Comparison
| Plugin | GMS Required | HMS Support | Huawei Devices | iOS Support | Background Tracking |
|---|---|---|---|---|---|
| location | ❌ (optional) | ✅ (basic) | ✅ Yes | ✅ Yes | ✅ With config |
| geolocator | ❌ (uses fallback) | ❌ (no HMS) | ✅ Yes (basic GPS) | ✅ Yes | ✅ With permission |
| huawei_location | ❌ (uses HMS) | ✅ Native | ✅ Best choice | ❌ No | ✅ Yes |
