Skip to content

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

@fe60

Description

@fe60

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions