google_maps_widget 2.0.0 copy "google_maps_widget: ^2.0.0" to clipboard
google_maps_widget: ^2.0.0 copied to clipboard

A Flutter package which can be used to make polylines(route) from a source to a destination, and also handle a driver's realtime location (if any) on the map.

2.0.0 - 2026-08-09 #

  • BREAKING: Routes now come from the Google Routes API instead of the legacy Directions API, which Google no longer allows to be enabled on new Cloud projects. Enable the Routes API on your key. Because it reports distance and duration numerically rather than as localized text, totalDistanceCallback now receives an int of metres and totalTimeCallback a Duration, and DirectionsException is now RoutesApiException. Format the values for display yourself so they match your app's locale.
  • BREAKING: Raised the minimum SDK to Flutter 3.38.0 / Dart 3.10.0, required by google_maps_flutter 2.18.0. See the migration guide.
  • BREAKING: Raised the platform minimums that come with the newer google_maps_flutter: Android minSdk 24 and Gradle 8.7.0 or newer, iOS deployment target 14.0. The migration guide lists the exact versions to change.
  • FIX: Changing sourceLatLng or destinationLatLng and rebuilding now updates the markers and recalculates the route. Previously the coordinates were only read once, so the only way to move the route was the setSourceLatLng / setDestinationLatLng methods on the state.
  • FIX: Bug where updating the source or destination could leave the previous route drawn on the map, because the old and new polylines shared an id and only one of them survived.
  • FIX: Crash (setState() called after dispose()) when the widget was removed from the tree while a marker image or a route was still loading.
  • FIX: The map controller is no longer disposed twice, which could throw when the widget was disposed.
  • FIX: Hiding the driver marker by setting isVisible to false now removes it from the map instead of leaving the last one stranded.
  • FIX: Crash when the routing API returned whole-number coordinates.
  • FIX: A failing route request no longer throws an uncaught exception; the map still renders without the route.
  • Added onError, called with a RoutesApiException when a route cannot be fetched. A key without the Routes API enabled, or a project without billing, was previously indistinguishable from the map simply not working. Errors are also logged to the console in debug builds.
  • Added style and colorScheme for theming the map, which is how dark mode is applied. style takes a Google Maps style JSON and can be changed at any time, so the map follows an in-app light/dark toggle; deciding which style to show is left to you. colorScheme uses Google's built-in schemes but is only read when the map is created, so it cannot follow a runtime toggle.
  • Added the remaining GoogleMap passthrough parameters: clusterManagers, groundOverlays, heatmaps, markerType, fortyFiveDegreeImageryEnabled, fullscreenControlEnabled, mapTypeControlEnabled, streetViewControlEnabled, webCameraControlEnabled, webCameraControlPosition and webGestureHandling.
  • Route requests now time out instead of hanging indefinitely, and reuse a single client. Added routesConnectTimeout and routesReceiveTimeout to configure the limits, both defaulting to 15 seconds.
  • Updated dependencies: google_maps_flutter to 2.18.0, dio to 5.11.0, flutter_lints to 6.0.0.
  • Added a test suite covering route parsing and error handling.
  • Updated the example app to demonstrate dark mode, error handling, declarative source updates, and the route's total distance and time.
  • FIX: The example app's iOS target never called GMSServices.provideAPIKey, so the map could not render on iOS whatever key was set. The call lived in an AppDelegate.m that was not part of the Xcode project and imported a header that did not exist; it has been removed and the key is now provided from the AppDelegate.swift that actually builds.
  • The example app no longer needs the API key committed. Put it in a gitignored example/.env and run with --dart-define-from-file=.env, which covers the Dart code, the Android manifest and the iOS Info.plist from one entry, the last through a build phase that decodes DART_DEFINES. Checked-in VS Code launch configurations read the same file, so pressing F5 needs no setup. All three fall back to a PASTE_GOOGLE_MAPS_API_KEY_HERE placeholder.
  • The example README now covers the requirements, how to get a key, and how to build and run on each platform.
  • Documented where the API key is needed, and why an application restricted key cannot authorise the Routes API call.
  • Added a screenshot to the package listing, so pub.dev now shows a thumbnail in search results and a gallery on the package page.
  • README: dropped the popularity and code size badges, which had stopped being useful, added a downloads badge, and added links to the author's portfolio and other packages.
  • README: the screenshots are now served from this repository instead of GitHub's attachment CDN, which was outside the repo's control and could have gone stale.

1.0.8 - 2026-07-28 #

  • Maintenance release; no user-facing changes.

1.0.7 - 2026-07-27 #

  • Added GitHub Actions CI to automate version bumps, changelog updates, tagging and pub.dev publishing.

1.0.6 - 2025-01-26 #

  • FIX: Bug where assetMarkerSize in MarkerIconInfo does not apply if icon is passed.
  • Fix Dart static analysis warnings
  • Updated README.md
  • Updated example app
  • Updated dependencies

1.0.5+1 - 2022-10-25 #

  • Updated README.md

1.0.5 - 2022-10-25 #

  • BREAKING: MarkerIconInfo inputs are now non-nullable
  • BREAKING: Added properties onTapMarker, onTapInfoWindow, infoWindowTitle and isVisible to MarkerIconInfo, and removed corresponding params for source, destination, driver from GoogleMapsWidget
  • Changed internal implementation of the widget
  • Added layoutDirection property
  • Added onPolylineUpdate callback
  • Exposed state class to allow updating source/destination lat lng, or interacting with google maps con directly
  • Updated a dependency to the latest release
  • Updated example app
  • Updated README.md

1.0.4 - 2022-06-15 #

  • Added updatePolylinesOnDriverLocUpdate to update directions based on current driver location
  • Updated dependencies
  • Updated example app
  • Updated README.md

1.0.3 - 2022-06-14 #

  • Added rotation and anchor to MarkerIconInfo
  • Updated README.md

1.0.2 - 2022-06-07 #

  • Updated dependencies
  • Updated linter warnings

1.0.1 - 2022-01-26 #

  • Updated license
  • Updated README.md

1.0.0 - 2022-01-26 #

  • Added linter and updated code accordingly
  • Updated dependencies
  • Removed unused dependencies
  • Updated README.md

0.0.9 - 2021-10-06 #

  • Fixed issue #2

0.0.8 - 2021-05-12 #

  • Fixed key parameter

0.0.7 - 2021-04-18 #

  • Set of markers can be passed to show on the map (apart from the source/destination/driver markers).
  • Set of polylines can be passed to show on the map apart from the one created between source and destination.
  • Added the option to not render the created markers and polylines.

0.0.6 - 2021-04-14 #

  • Updated README.md

0.0.5 - 2021-04-13 #

  • Added web support

0.0.4 - 2021-04-13 #

  • Added dart doc comments
  • Updated package description.
  • Updated README.
  • Updated example app

0.0.3 - 2021-04-12 #

  • Updated package description.

0.0.2 - 2021-04-12 #

  • Minor readme fixes.
  • Added package description.

0.0.1 - 2021-04-11 #

  • A Google Maps helper widget which can be used to draw route from a given source latitude and longitude. The route is customizable in terms of color and width.
  • The plugin also offers realtime location tracking for a driver(if any) and shows a marker on the map which updates everytimes the driver's location changes.
  • The markers are customizable and on tap callbacks are implemented that give the current location and a lot of parameters which can be explored.
131
likes
160
points
1.5k
downloads
screenshot

Documentation

Documentation
API reference

Publisher

verified publisherrithikbhandari.dev

Weekly Downloads

A Flutter package which can be used to make polylines(route) from a source to a destination, and also handle a driver's realtime location (if any) on the map.

Repository (GitHub)
View/report issues

Topics

#flutter #widget #google #google-maps #google-maps-flutter

License

MIT (license)

Dependencies

dio, flutter, google_maps_flutter

More

Packages that depend on google_maps_widget