Pablo
02/18/2025, 10:41 PM_mapState
val to be able to access it on the childrens).
Is this correct? is a good practice to have two UiState stateflows and access both of them on my screen with this?
val uiState by vm.uiState.collectAsStateWithLifecycle()
val mapState by vm.mapState.collectAsStateWithLifecycle()
dorche
02/19/2025, 2:11 PMPablo
02/19/2025, 2:16 PMdata class LinesScreenUiState(
val loading: Boolean = false,
val lines: List<Line> = emptyList(),
val selectedLine: Line? = null
)
private val _uiState = MutableStateFlow<LinesScreenUiState>(LinesScreenUiState(loading = true, lines = emptyList()))
val uiState: StateFlow<LinesScreenUiState> = _uiState
parent:
data class MapState(
val hasLocationPermission: Boolean = false,
val userLocation: LatLng? = null,
val lineSteps: List<Step> = emptyList()
)
protected val _mapState = MutableStateFlow(MapState())
val mapState: StateFlow<MapState> = _mapState
dorche
02/20/2025, 2:32 PM