-
-
Notifications
You must be signed in to change notification settings - Fork 532
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
Changing Theme at runtime #3871
Comments
You mean if you assign it with |
yes |
Here's an example: Hope it helps! |
@f4n0 Your example won't work because of the cascading value. You can't replace it from a child which receives the cascading value. |
so, I have to replace property by property (because I haven't access to the parent)? |
Yes. Or you move the functionality to the parent. |
I will give it a shot! |
I must admit I have completely forgotten that changing the cascaded reference is not allowed. Thanks, @StefanOssendorf for the link. I think we can introduce a new API to the ThemeProvider that can change the theme. Example |
that would be so nice! |
@stsrki let's treat this as a current limitation and as a future feature then? Can you update the issue accordingly? |
Describe the bug
Hi,
I have 2 variables of type "Theme", one containing the dark theme and the other the light one.
I've seen that if I set the theme on the main layout it all works, but If I want to change the theme via cascading parameter it doesn't work as I expected.
The sample from the documentation works as expected, but in my case, I'm assigning another theme to the parameter, and, for some reason, it won't work.
Here's a screenshot
The true branch of the condition won't work, the other works as expected!
Am I missing something?
The text was updated successfully, but these errors were encountered: