PublicTransportRouteViewModel

Provides all necessary data and actions for rendering and controlling the public transport route card in the RouteEditor.

This ViewModel encapsulates the business logic and state for displaying a detailed multi-modal itinerary, including walking segments, public transport legs, intermediate stops, and interactive controls (e.g., expanding stops, starting navigation).

Inheritors

Properties

Link copied to clipboard
abstract val departure: DepartureInfo

Information about the starting point of the route.

Link copied to clipboard

Detailed information about the final destination, including the stop, address, and arrival time.

Link copied to clipboard

Timezone of the route's destination point.

Link copied to clipboard
abstract val isStopsListExpanded: StateFlow<Boolean>

Indicates whether the list of intermediate stops is currently expanded (visible) or collapsed (hidden).

Link copied to clipboard
abstract val routeSegments: StateFlow<List<RouteSegment>>

Ordered list of route segments that together form the complete journey. Each element represents a contiguous part of the route between two points. The sequence follows chronological order from departure to arrival.

Link copied to clipboard
abstract val totalDuration: Duration

Total travel duration from start to end of the route. Excludes waiting times and transfer times.

Link copied to clipboard
abstract val totalFare: FareInfo?

Total fare for the entire journey. Includes both the amount and the currency for proper formatting.

Functions

Link copied to clipboard
abstract fun onBackButtonClick()

Handles the user action of clicking the "Back" button in the route card.

Link copied to clipboard
abstract fun onStartNavigation()

Handles the user action of starting navigation along the currently selected public transport route.

Link copied to clipboard
abstract fun onWalkNavigatorClick()

Handles the user action of clicking the "Pedestrian Navigator" button.

Link copied to clipboard
abstract fun setStopsListExpanded(value: Boolean)

Update state of the intermediate stops list.