{"id":28919483,"url":"https://github.com/googlemaps/flutter-navigation-sdk","last_synced_at":"2026-01-20T14:01:23.192Z","repository":{"id":243116850,"uuid":"733199494","full_name":"googlemaps/flutter-navigation-sdk","owner":"googlemaps","description":"Google Navigation for Flutter plugin (Beta)","archived":false,"fork":false,"pushed_at":"2026-01-12T17:36:32.000Z","size":1623,"stargazers_count":66,"open_issues_count":77,"forks_count":39,"subscribers_count":32,"default_branch":"main","last_synced_at":"2026-01-12T23:03:29.034Z","etag":null,"topics":["flutter","google-maps-platform","google-navigation","navigation-sdk"],"latest_commit_sha":null,"homepage":"https://pub.dev/packages/google_navigation_flutter","language":"Dart","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/googlemaps.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-12-18T19:36:09.000Z","updated_at":"2026-01-12T17:36:09.000Z","dependencies_parsed_at":"2024-06-06T20:47:23.410Z","dependency_job_id":"ac98509a-a4c6-4d4d-b7d9-4f9a46a4e8c6","html_url":"https://github.com/googlemaps/flutter-navigation-sdk","commit_stats":null,"previous_names":["googlemaps/flutter-navigation-sdk"],"tags_count":19,"template":false,"template_full_name":null,"purl":"pkg:github/googlemaps/flutter-navigation-sdk","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/googlemaps%2Fflutter-navigation-sdk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/googlemaps%2Fflutter-navigation-sdk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/googlemaps%2Fflutter-navigation-sdk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/googlemaps%2Fflutter-navigation-sdk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/googlemaps","download_url":"https://codeload.github.com/googlemaps/flutter-navigation-sdk/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/googlemaps%2Fflutter-navigation-sdk/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28604712,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-20T12:01:53.233Z","status":"ssl_error","status_checked_at":"2026-01-20T12:01:46.545Z","response_time":117,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["flutter","google-maps-platform","google-navigation","navigation-sdk"],"created_at":"2025-06-22T03:41:40.915Z","updated_at":"2026-01-20T14:01:23.186Z","avatar_url":"https://github.com/googlemaps.png","language":"Dart","readme":"# Google Navigation for Flutter (Beta)\n\n**European Economic Area (EEA) developers**\n\nIf your billing address is in the European Economic Area, effective on 8 July 2025, the [Google Maps Platform EEA Terms of Service](https://cloud.google.com/terms/maps-platform/eea) will apply to your use of the Services. Functionality varies by region. [Learn more](https://developers.google.com/maps/comms/eea/faq).\n\n## Description\n\nThis repository contains a Flutter plugin that provides a [Google Navigation](https://developers.google.com/maps/documentation/navigation) widget to Flutter apps targeting Android and iOS.\n\n\u003e [!NOTE]\n\u003e This package is in Beta until it reaches version 1.0. According to [semantic versioning](https://semver.org/#spec-item-4), breaking changes may be introduced before 1.0.\n\n## Requirements\n\n|                                 | Android       | iOS       |\n| ------------------------------- | ------------- | --------- |\n| **Minimum mobile OS supported** | API level 24+ | iOS 16.0+ |\n\n* A Flutter project\n* A Google Cloud project\n  *  If you are a Mobility Services developer, you must contact Sales as described in [Mobility services documentation](https://developers.google.com/maps/documentation/transportation-logistics/mobility).\n  *  If you are not a Mobility Services developer, refer to [Setup Google Cloud Project](https://developers.google.com/maps/documentation/navigation/android-sdk/cloud-setup) for instructions.\n* An [API key](https://console.cloud.google.com/google/maps-apis/credentials) from the project above\n  * The API key must be configured for both Android and iOS. Refer to [Android Using Api Keys](https://developers.google.com/maps/documentation/navigation/android-sdk/get-api-key) and [iOS Using Api Keys](https://developers.google.com/maps/documentation/navigation/ios-sdk/get-api-key) respectively for instructions.\n* If targeting Android, [Google Play Services](https://developers.google.com/android/guides/overview) installed and enabled and minimum Kotlin version 2.0\n* [Attributions and licensing text](https://developers.google.com/maps/documentation/navigation/android-sdk/set-up-project#include_the_required_attributions_in_your_app) added to your app\n\n\u003e [!IMPORTANT]\n\u003e [Apply API restrictions](https://developers.google.com/maps/api-security-best-practices#api-restriction) to the API key to limit usage to \"Navigation SDK, \"Maps SDK for Android\", and \"Maps SDK for iOS\" for enhanced security and cost management. This helps guard against unauthorized use of your API key.\n\n## Installation\n\nTo add the Google Navigation for Flutter package to your project, use the command:\n```\nflutter pub add google_navigation_flutter\n```\n\n### Android\n\nSet the `minSdk` in `android/app/build.gradle`:\n\n```groovy\nandroid {\n    defaultConfig {\n        minSdk 24\n    }\n}\n```\n\nIf `minSdk` is set to less than 34 (API 34), you need to configure desugaring for your Android app.\nTo enable desugaring, add the following configurations to `android/app/build.gradle` file:\n```groovy\nandroid {\n    ...\n    compileOptions {\n        coreLibraryDesugaringEnabled true\n        ...\n    }\n}\n\ndependencies {\n    coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs_nio:2.0.4'\n}\n```\n\n### iOS\n\n1. Open the ios/Podfile config file in your preferred IDE.\n2. Add the following lines to the beginning of this Podfile:\n\n```\n  # Set platform to 16.0 to enable latest Google Maps SDK\n  platform :ios, '16.0'\n```\n3. In Xcode open Info.plist file and add `App registers for location updates` to the list of `Required background modes`\n\n### Set Google Maps API Key\n\nAdd your API key to the Flutter project using [these instructions for the corresponding Android (build.gradle) and iOS (AppDelegate.swift) files](https://developers.google.com/maps/flutter-package/config#step_4_add_your_api_key_to_the_project). The instructions for this step in the google_maps_flutter package documentation apply to the google_navigation_flutter package as well.\n\n  See the example configuration for Secrets Gradle Plugin in the example app's [build.gradle](./example/android/app/build.gradle) file.\n  To securely load your API key, use the [Secrets Gradle Plugin](https://developers.google.com/maps/documentation/android-sdk/secrets-gradle-plugin). This plugin helps manage API keys without exposing them in your app's source code.\n\nFor more details, see [Google Navigation SDK Documentation](https://developers.google.com/maps/documentation/navigation).\n\n## Usage\n\nYou can now add a `GoogleMapsNavigationView` widget to your widget tree.\n\nThe view can be controlled with the `GoogleNavigationViewController` that is passed to via `onViewCreated` callback.\n\nThe `GoogleMapsNavigationView` widget should be used within a widget with a bounded size. Using it\nin an unbounded widget will cause the application to throw a Flutter exception.\n\nYou can also add a bare GoogleMapsMapView that works as a normal map view without navigation functionality.\n\n### Add a navigation view and start a navigation session\n\n```dart\nimport 'package:flutter/material.dart';\nimport 'package:google_navigation_flutter/google_navigation_flutter.dart';\n\nclass NavigationSample extends StatefulWidget {\n  const NavigationSample({super.key});\n\n  @override\n  State\u003cNavigationSample\u003e createState() =\u003e _NavigationSampleState();\n}\n\nclass _NavigationSampleState extends State\u003cNavigationSample\u003e {\n  GoogleNavigationViewController? _navigationViewController;\n  bool _navigationSessionInitialized = false;\n\n  @override\n  void initState() {\n    super.initState();\n    _initializeNavigationSession();\n  }\n\n  Future\u003cvoid\u003e _initializeNavigationSession() async {\n    if (!await GoogleMapsNavigator.areTermsAccepted()) {\n      await GoogleMapsNavigator.showTermsAndConditionsDialog(\n        'Example title',\n        'Example company',\n      );\n    }\n    // Note: make sure user has also granted location permissions before starting navigation session.\n    await GoogleMapsNavigator.initializeNavigationSession(taskRemovedBehavior: TaskRemovedBehavior.continueService);\n    setState(() {\n      _navigationSessionInitialized = true;\n    });\n  }\n\n  @override\n  Widget build(BuildContext context) {\n    return Scaffold(\n      appBar: AppBar(title: const Text('Google Maps Navigation Sample')),\n      body: _navigationSessionInitialized\n          ? GoogleMapsNavigationView(\n              onViewCreated: _onViewCreated,\n              initialNavigationUIEnabledPreference: NavigationUIEnabledPreference.disabled,\n              // Other view initialization settings\n            )\n          : const Center(child: CircularProgressIndicator()),\n    );\n  }\n\n  void _onViewCreated(GoogleNavigationViewController controller) {\n    _navigationViewController = controller;\n    controller.setMyLocationEnabled(true);\n    // Additional setup can be added here.\n  }\n\n  @override\n  void dispose() {\n    if (_navigationSessionInitialized) {\n      GoogleMapsNavigator.cleanup();\n    }\n    super.dispose();\n  }\n}\n```\n\n\u003e [!NOTE]\n\u003e Route calculation is only available after the Navigation SDK has successfully acquired the user's location. If the location is not yet available when trying to set a destination, the SDK will return a NavigationRouteStatus.locationUnavailable status.\n\u003e\n\u003e To avoid this, ensure that the SDK has provided a valid user location before calling the setDestinations function. You can do this by subscribing to the RoadSnappedLocationUpdatedEvent and waiting for the first valid location update.\n\n#### Task Removed Behavior\n\nThe `taskRemovedBehavior` parameter of navigation session initialization defines how the navigation should behave when a task is removed from the recent apps list on Android. It can either:\n\n - `TaskRemovedBehavior.continueService`: Continue running in the background. (default)\n - `TaskRemovedBehavior.quitService`: Shut down immediately.\n\nThis parameter has only an effect on Android.\n\n### Add a map view\n\n```dart\n@override\n  Widget build(BuildContext context) {\n    return Scaffold(\n      appBar: AppBar(title: const Text('Google Maps Navigation Sample')),\n      body: _navigationSessionInitialized\n          ? GoogleMapsMapView(\n              onViewCreated: _onViewCreated,\n              initialCameraPosition: CameraPosition(\n                // Initialize map to user location.\n                target: _userLocation!,\n                zoom: 15,\n              ),\n              // Other view initialization settings\n            )\n          : const Center(child: CircularProgressIndicator()),\n    );\n  }\n\n```\n\n### Using Map IDs\nYou can configure your map by providing a `mapId` parameter during map initialization. Map IDs are created in the [Google Cloud Console](https://console.cloud.google.com/google/maps-apis/studio/maps) and allow you to [enable various Google Maps Platform features](https://developers.google.com/maps/documentation/android-sdk/map-ids/mapid-over#features-available), such as cloud-based map styling.\n\n\u003e [!NOTE]\n\u003e The `mapId` can only be set once during map initialization and cannot be changed afterwards. Both `GoogleMapsMapView` and `GoogleMapsNavigationView` support the `mapId` parameter.\n\nFor `GoogleMapsMapView`:\n\n```dart\nGoogleMapsMapView(\n  mapId: 'YOUR_MAP_ID', // Can only be set during initialization\n  ...\n)\n```\n\nFor `GoogleMapsNavigationView`:\n\n```dart\nGoogleMapsNavigationView(\n  mapId: 'YOUR_MAP_ID', // Can only be set during initialization\n  ...\n)\n```\n\nFor more information about map IDs and how to create them, see the [Google Maps Platform documentation](https://developers.google.com/maps/documentation/get-map-id).\n\nSee the [example](./example) directory for a complete navigation sample app.\n\n### Requesting and handling permissions\n\nThe Google Navigation SDK Flutter plugin offers functionalities that necessitate specific permissions from the mobile operating system. These include, but are not limited to, location services, background execution, and receiving background location updates.\n\n\u003e [!NOTE]\n\u003e The management of these permissions falls outside the scope of the Navigation SDKs for Android and iOS. As a developer integrating these SDKs into your applications, you are responsible for requesting and obtaining the necessary permissions from the users of your app.\n\nYou can see example of handling permissions in the [main.dart](./example/lib/main.dart) file of the example application:\n\n```dart\nPermissionStatus _locationPermissionStatus = PermissionStatus.denied;\n\n// ...\n\n/// Request permission for accessing the device's location.\n///\n/// Android: Fine and Coarse Location\n/// iOS: CoreLocation (Always and WhenInUse)\nFuture\u003cvoid\u003e _requestLocationPermission() async {\n  final PermissionStatus status = await Permission.location.request();\n\n  setState(() {\n    _locationPermissionStatus = status;\n  });\n}\n\n// ...\n\n@override\nWidget build(BuildContext context) {\n  _requestLocationPermission();\n  ...\n}\n```\n\n### Controlling Light and Dark Mode\n\nThe SDK provides two different settings to control the appearance of maps and navigation UI: `mapColorScheme` and `forceNightMode`. Which setting to use depends on whether navigation UI is enabled or disabled.\n\nThese settings can be configured both during initialization and dynamically changed after initialization using the view controllers.\n\n#### For Navigation Views (GoogleMapsNavigationView)\n\n**When navigation UI is enabled:**\n- Use `forceNightMode` (or `initialForceNightMode` during initialization) to control both the navigation UI elements and the map tile colors.\n- The `mapColorScheme` setting is ignored when navigation UI is enabled.\n\n\u003e [!TIP]\n\u003e When navigation guidance is running, it's recommended to use `NavigationForceNightMode.auto` (the default). This allows the Navigation SDK to automatically determine the appropriate day or night mode based on the user's location and local time, which may differ from the device's system settings.\n\n```dart\nGoogleMapsNavigationView(\n  initialForceNightMode: NavigationForceNightMode.auto,\n  initialMapColorScheme: MapColorScheme.dark, // IGNORED when navigation UI is enabled\n)\n```\n\nTo manually force a specific mode:\n```dart\nGoogleMapsNavigationView(\n  initialForceNightMode: NavigationForceNightMode.forceNight,\n)\n```\n\nYou can also change the setting dynamically after initialization:\n\n```dart\n// Change after initialization when navigation UI is enabled\nawait navigationViewController.setForceNightMode(NavigationForceNightMode.forceNight);\n```\n\n**When navigation UI is disabled:**\n- Use `mapColorScheme` (or `initialMapColorScheme` during initialization) to control the map tile colors.\n- The `forceNightMode` setting has no effect when navigation UI is disabled.\n\n```dart\nGoogleMapsNavigationView(\n  initialNavigationUIEnabledPreference: NavigationUIEnabledPreference.disabled,\n  initialMapColorScheme: MapColorScheme.dark, \n  initialForceNightMode: NavigationForceNightMode.forceDay // IGNORED when navigation UI is disabled\n)\n```\n\nYou can also change the setting dynamically after initialization:\n\n```dart\n// Change after initialization when navigation UI is disabled\nawait navigationViewController.setMapColorScheme(MapColorScheme.dark);\n```\n\n#### For Map Views (GoogleMapsMapView)\n\nMap views only support `mapColorScheme` to control the map tile colors:\n\n```dart\nGoogleMapsMapView(\n  initialMapColorScheme: MapColorScheme.dark,\n)\n```\n\nYou can also change the setting dynamically after initialization:\n\n```dart\n// Change after initialization\nawait mapViewController.setMapColorScheme(MapColorScheme.dark);\n```\n\n#### Available Options\n\n- `NavigationForceNightMode`: \n  - `auto` (default and recommended) - SDK determines day/night mode based on user's location and local time\n  - `forceDay` - Force day mode regardless of time or location\n  - `forceNight` - Force night mode regardless of time or location\n- `MapColorScheme`: \n  - `followSystem` (default) - Follow device system settings\n  - `light` - Force light color scheme\n  - `dark` - Force dark color scheme\n\n### Turn-by-Turn Navigation with Step Images\n\nThe SDK can generate maneuver icons and lane guidance images for navigation steps. Enable step image generation when setting up the navigation info listener:\n\n```dart\nGoogleMapsNavigator.setNavInfoListener(\n  _onNavInfoEvent,\n  numNextStepsToPreview: 100,\n  stepImageGenerationOptions: const StepImageGenerationOptions(\n    generateManeuverImages: true,  // Enable maneuver icons\n    generateLaneImages: true,       // Enable lane guidance\n  ),\n);\n```\n\n#### Accessing Step Images\n\nManeuver and lane images are available in the `StepInfo` objects:\n\n```dart\nvoid _onNavInfoEvent(NavInfoEvent event) {\n  final currentStep = event.navInfo.currentStep;\n  final maneuverImage = currentStep?.maneuverImage;  // Turn icons\n  final lanesImage = currentStep?.lanesImage;          // Lane guidance\n}\n```\n\n#### Displaying Images\n\nRetrieve and display images directly from the image registry:\n\n```dart\n// Returns an Image widget ready to display\nfinal image = await getRegisteredImage(step.maneuverImage!);\n\n// Use in your widget tree\nif (image != null) {\n  SizedBox(\n    width: 50,\n    height: 50,\n    child: image,\n  );\n}\n```\n\n#### Clearing Images\n\nClear registered images by type when needed:\n\n```dart\n// Clear maneuver and lane images when stopping navigation\nawait clearRegisteredImages(filter: RegisteredImageType.maneuver);\nawait clearRegisteredImages(filter: RegisteredImageType.lanes);\n```\n\nSee the example app's [turn_by_turn.dart](./example/lib/pages/turn_by_turn.dart) and [custom_navigation_ui.dart](./example/lib/widgets/custom_navigation_ui.dart) for a complete implementation.\n\n## Support for Android Auto and Apple CarPlay\nThis plugin is compatible with both Android Auto and Apple CarPlay infotainment systems. For more details, please refer to the respective platform documentation:\n\n- [Android Auto documentation](./doc/android-auto.md)\n- [CarPlay documentation](./doc/carplay.md)\n\n## Known issues\n\n### Compatibility with other libraries\n\nThis package uses the Google Maps [Navigation SDK](https://mapsplatform.google.com/maps-products/navigation-sdk/) for Android and iOS, which includes a dependency on the `Google Maps SDK`. If your project includes other flutter libraries with `Google Maps SDK` dependencies, you may encounter build errors due to version conflicts. To avoid this, it's recommended to avoid using multiple packages with Google Maps dependencies.\n\n\u003e [!NOTE]\n\u003e This package provides a `GoogleMapsMapView` widget, which can be used as a classic Google Maps view without navigation. See [Add a map view](#add-a-map-view) for details.\n\n## Contributing\n\nSee the [Contributing guide](https://github.com/googlemaps/flutter-navigation-sdk/blob/main/CONTRIBUTING.md).\n\n## Terms of Service\n\nThis library uses Google Maps Platform services. Use of Google Maps Platform services through this library is subject to the [Google Maps Platform Terms of Service](https://cloud.google.com/maps-platform/terms).\n\nThis library is not a Google Maps Platform Core Service. Therefore, the Google Maps Platform Terms of Service (e.g. Technical Support Services, Service Level Agreements, and Deprecation Policy) do not apply to the code in this library.\n\n## Support\n\nThis package is offered via an open source license. It is not governed by the Google Maps Platform Support [Technical Support Services Guidelines](https://cloud.google.com/maps-platform/terms/tssg), the [SLA](https://cloud.google.com/maps-platform/terms/sla), or the [Deprecation Policy](https://cloud.google.com/maps-platform/terms) (however, any Google Maps Platform services used by the library remain subject to the Google Maps Platform Terms of Service).\n\nThis package adheres to [semantic versioning](https://semver.org/) to indicate when backwards-incompatible changes are introduced. Accordingly, while the library is in version 0.x, backwards-incompatible changes may be introduced at any time.\n\nIf you find a bug, or have a feature request, please [file an issue](https://github.com/googlemaps/flutter-navigation-sdk/issues) on GitHub. If you would like to get answers to technical questions from other Google Maps Platform developers, ask through one of our [developer community channels](https://developers.google.com/maps/developer-community). If you'd like to contribute, please check the [Contributing guide](https://github.com/googlemaps/flutter-navigation-sdk/blob/main/CONTRIBUTING.md).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgooglemaps%2Fflutter-navigation-sdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgooglemaps%2Fflutter-navigation-sdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgooglemaps%2Fflutter-navigation-sdk/lists"}