Skip to content

Instantly share code, notes, and snippets.

@egorikftp

egorikftp/new.kt Secret

Created Aug 22, 2021
Embed
What would you like to do?
//initialization with extension
private val dataStore: DataStore<Preferences> = context.dataStore
val selectedThemeFlow = dataStore.data
.map { it[stringPreferencesKey(name = "pref_dark_mode")] }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment