NavigationDashboardViewModel
ViewModel interface for managing the navigation dashboard state and user interactions.
Responsible for:
Managing free roam mode state
Handling audio mode settings for navigation instructions
Tracking remaining route information (distance and time)
Managing show route and finish navigation handlers
Thread Safety
This ViewModel is not thread-safe and must only be accessed from the Main thread.
All methods must be called from the Main (UI) thread
All StateFlow properties emit values on the Main thread
Concurrent access from multiple threads may lead to undefined behavior
Inheritors
Properties
Observable state of audio navigation instructions. Indicates whether audio is on, off, or unavailable for the current route.
Observable state containing navigation dashboard information. Can be RemainingInfo with route details or IndoorInfo with floor/organization data. Null when navigation information is unavailable.
Observable handler for finishing the navigation session. This handler is invoked when the user chooses to end navigation.
Observable state indicating whether navigation is in free roam mode. In free roam mode, the user follows a route without turn-by-turn navigation guidance.
Observable state of indicates whether minimap is visible during navigation.
Observable handler for showing the route on the map. This handler is invoked when the user taps the "Show Route" button. Only available when not in free roam mode.
Observable handler for showing the minimap during navigation.
Functions
Handles audio button clicks to toggle navigation voice instructions. Toggles between On and Off states when audio is available.
Sets the handler to be invoked when the user chooses to finish navigation.
Sets the handler to be invoked when the user taps the "Show Route" button. The handler will only be active when not in free roam mode.
Handles minimap button clicks to toggle its visibility during navigation.