Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a toggle for Light and Dark Themes #5

Open
hitanshu-dhawan opened this issue Oct 10, 2020 · 2 comments
Open

Add a toggle for Light and Dark Themes #5

hitanshu-dhawan opened this issue Oct 10, 2020 · 2 comments
Labels
help wanted Extra attention is needed

Comments

@hitanshu-dhawan
Copy link
Owner

https://material.io/design/color/dark-theme.html#behavior

@hitanshu-dhawan
Copy link
Owner Author

This would require a global state for the light/dark theme boolean.

        setContent {

            val (isLightTheme, setLightTheme) = remember { mutableStateOf(true) }

            McComposeTheme(lightTheme = isLightTheme) {
                HomeScreen {
                    setLightTheme(!isLightTheme)
                }
            }
        }

@hitanshu-dhawan hitanshu-dhawan added the help wanted Extra attention is needed label Jul 3, 2021
@Relive077
Copy link

Hi @hitanshu-dhawan ,

How about using a datastore preferences?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants