EvRoutePreferencesProvider

Provider of EV route preferences.

Implement this interface to supply EV route preferences from your application's settings or configuration. The preferences are used during route calculation to configure charging stop selection.

Example implementation:

class MyEvRoutePreferencesProvider(
private val settingsRepository: SettingsRepository
) : EvRoutePreferencesProvider {
override fun invoke(): StateFlow<EvRoutePreferences> = combineStates(
settingsRepository.preferredOperators,
settingsRepository.avoidedStations,
) { preferred, avoided ->
EvRoutePreferences.Builder()
.preferOperators(preferred)
.avoidStationIds(avoided)
.build()
}
}

Functions

Link copied to clipboard
abstract operator fun invoke(): StateFlow<EvRoutePreferences>

Returns a Flow that emits EvRoutePreferences whenever they change.