Truck Profile
This example demonstrates how to create a Flutter app that displays a truck profile and calculates routes using Maps SDK for Flutter. Users can modify truck parameters and visualize routes on the map.
How It Works
The example app demonstrates the following features:
- Display a map.
- Fill truck details in a truck profile panel.
- Calculate a route based on the truck’s profile and visualize them on the map.
UI and Map Integration
Main Screen with Truck Profile
This code sets up the main screen with a map and functionality for modifying the truck profile and calculating routes.
Route Calculation
This code handles the route calculation based on the truck’s profile and updates the UI with the calculated routes.
Version 2.26.0 introduces options for caravan routes, allowing you to specify vehicle dimensions without being limited to truck routes.
The transportMode
field is essential for distinguishing a caravan from a truck.
If RouteTransportMode
is not set to lorry
, the routing may direct you onto roads restricted for lorries.
Truck Profile Modification
This dialog allows users to modify the truck profile parameters and returns the updated profile.