Skip to content

Instantly share code, notes, and snippets.

@egorikftp

egorikftp/new.kt Secret

Created August 22, 2021 19:42
Show Gist options
  • Save egorikftp/e9781ecfb0643bd2a102e68d7789416a to your computer and use it in GitHub Desktop.
Save egorikftp/e9781ecfb0643bd2a102e68d7789416a to your computer and use it in GitHub Desktop.
//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