Add your own map apps, ship only the maps you use, and launch them in one line.
Maps are now MapApp objects instead of enum values. Subclass MapApp to
add any map app without forking the plugin. Only the maps you reference are
compiled into your app, so URL schemes, package names, and icons of unused
maps never touch your binary. And discovery results are directly launchable:
maps.first.show().
See MIGRATION.md for the full 5.x → 6.0 guide.
New Features:
- Custom maps: subclass
MapAppto add any map app (regional, proprietary,
internal) without forking the plugin. Works everywhere a built-in map does,
including discovery and launching. - Tree-shakeable maps: referencing
MapApp.wazecompiles in only Waze's
code, strings, and icon. Unreferenced maps are stripped completely from
release binaries, verified by scanning AOT snapshots. - Launchable discovery results:
final maps = await request.getSupportedMaps([...])
thenmaps.first.show(). No more request/mapType plumbing in pickers. - Misconfiguration warning (iOS): debug builds print a warning when a map
passed to discovery is missing fromLSApplicationQueriesSchemes, naming
the exact scheme to add. Previously indistinguishable from "not installed". - Official app icons: 256×256 PNG icons sourced from iTunes and Google Play
Store APIs, embedded asUint8List. Noflutter_svgdependency needed.
Rundart run tool/fetch_icons.dartto refresh. - Generic native layer: iOS/Android detection is driven entirely from
Dart. The native code has zero map-specific knowledge.
Breaking Changes:
MapTypeenum →MapAppobjects:MapType.google→MapApp.google.
Dot-shorthand call sites likeshow(map: .google)compile unchanged.- Discovery takes an explicit list:
getSupportedMaps()→
getSupportedMaps([.apple, .google, .waze]),getAvailableMaps()→
getAvailableMaps(myMaps). UseMapApp.allfor every supported map (this
opts out of tree shaking). - Icons are PNG bytes, not SVG assets:
SvgPicture.asset(map.icon)→
Image.memory(map.iconBytes). No extra dependencies needed.flutter_svg
is no longer required. SupportedMap:map.mapType→map.map(aMapApp),
map.displayName→map.name. Entries returned by a request are directly
launchable viamap.show().- Persisted map names:
MapType.values.byName(saved)→
myMaps.firstWhere((m) => m.id == saved).MapApp.idmatches the old
enum names, so stored preferences keep working. - Removed maps:
truckmeister(discontinued by Flitsmeister) and
spedionNavigation(integrated module in the SPEDION fleet app, not a
standalone map) have been removed. Use the customMapAppsubclass feature
to add them back if needed.
What's Changed
- v6: custom maps, treeshaking, new icons by @mattermoran in #226
Full Changelog: v5.0.1...v6.0.0