Skip to main content
The Flutter TomTom SDK can navigate in two modes:
  1. In a free-drive mode, where the user can navigate without an active route plan; or
  2. In a route-following mode, where the user follows a calculated route. See Route Planning for more information on how to calculate a route.

Starting a free-drive session

Use the TomtomFlutterNavigationManager class to start a free-drive session:
await TomTomNavigationManager.instance.startNavigation();

Starting a route-following session

Using route plans calculated by our TomtomFlutterRoutePlanner class, you can start a route-following navigation session:
final TomtomFlutterRoutePlannerManager _routePlannerManager =
    TomtomFlutterRoutePlannerManager.instance;
final TomTomNavigationManager _navigationManager =
    TomTomNavigationManager.instance;

// 1. Plan the route
final routePlans =
      await _routePlannerManager.planRoutes(/* route planning options */);

// 2. Start the navigation session
await _navigationManager.startNavigation();

// 3. Set the route plan to follow
await _navigationManager.setActiveRoutePlan(routePlan);

// 4. Change the camera tracking mode to follow route
await _mapManager.setCamera(MapManagerCameraTrackingMode.followRoute);
During an active navigation session, the user will receive turn-by-turn instructions and the map will display the route to follow.

Stopping a navigation session

To stop a navigation session, use the stopNavigation method:
await TomTomNavigationManager.instance.stopNavigation();

Managing device auto-sleep

Most devices are configured to automatically lock after a few minutes, which isn’t ideal while actively navigating. We’ve wrapped native APIs to enable you to control when auto-sleep should be applicable. We recommend turning off auto-sleep after starting a navigation session:
await TomTomNavigationManager.instance.disableAutoSleep();
After finishing a navigation session, you can re-enable it:
await TomTomNavigationManager.instance.enableAutoSleep();