Android Basics with Compose
Unit 6: Data persistence
Store and access data using keys with DataStore
Save preferences locally with DataStore
6. Use the UserPreferencesRepository
In which task and step of the codelab can this issue be found?
section Read the layout preference, step 1
Describe the problem
- Delete the code that initializes the
uiState property to MutableStateFlow(DessertReleaseUiState).
In the starter code uiState is initialized by assigning _uiState, which is initialized to to MutableStateFlow(DessertReleaseUiState).
|
private val _uiState = MutableStateFlow(DessertReleaseUiState()) |
|
|
|
// UI states access for various [DessertReleaseUiState] |
|
val uiState: StateFlow<DessertReleaseUiState> = _uiState |
According to the solution code in branch main, the _uiState property needs to be removed from the starter branch.
Android Basics with Compose
Unit 6: Data persistence
Store and access data using keys with DataStore
Save preferences locally with DataStore
6. Use the UserPreferencesRepository
In which task and step of the codelab can this issue be found?
section Read the layout preference, step 1
Describe the problem
In the
startercodeuiStateis initialized by assigning_uiState, which is initialized to toMutableStateFlow(DessertReleaseUiState).basic-android-kotlin-compose-training-dessert-release/app/src/main/java/com/example/dessertrelease/ui/DessertReleaseViewModel.kt
Lines 31 to 34 in c34aef0
According to the solution code in branch
main, the_uiStateproperty needs to be removed from thestarterbranch.