Skip to content

Instantly share code, notes, and snippets.

@mukeshsolanki
Created September 14, 2023 07:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mukeshsolanki/bea2da87facacb1280beaf4ccec5fc99 to your computer and use it in GitHub Desktop.
Save mukeshsolanki/bea2da87facacb1280beaf4ccec5fc99 to your computer and use it in GitHub Desktop.
// Collect the darkModeFlow and convert it to a State
val darkModeState by darkModeFlow.collectAsState(initial = false)
// Display the currently selected theme in your Composable
Text(text = "is the app in dark mode: ${darkModeState.value}")
// Update teh darkMode value
storeDarkMode(true)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment