google-developer-training/basic-android-kotlin-compose-training-dessert-release

Save Preferences Locally with DataStore - private property _uiState in starter code but not in description

Opened this issue · 0 comments

fe60 commented

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

  1. 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.