A series of visible changes when switching FlexScheme #39
-
I've been playing with Example3, and noticed when switching to another FlexScheme, the app undergoes through a series of changes with some elements changing colors twice, moreover it happens not simultaneously, but one by one? It should be like that? Is it possible to make the appearance to change at once? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Hi @dannylin108, this is a good and very frequent and relevant question generally in Flutter. It all depends on how you do the state management to provide the ThemeData that FlexColorScheme produces to your application. FlexColorScheme just makes a ThemeData object, which is just as the class name says "data" that describe your theme. Yes if you apply any ThemeData (not just FlexColorScheme made one, Flutter just sees FlexColorScheme ThemeData as normal ThemeData since that is what it makes) in a "none" Flutter suitable way to you MaterialApp, you might very well se multiple rebuilds. The example applications show one way of doing it using the official Google/Flutter skeleton template, but you can of course also do it with plain callbacks, Inherited Widget, Provider and Riverpod and many other options. In later versions and more extended own documentation Web site I plan to offer more example and tutorials on this. If you have some sample repo or can provide an example representing what you do and see now, I can perhaps offer some more concrete suggestions. BR |
Beta Was this translation helpful? Give feedback.
-
This old issue and question does contain an unanswered part since it is not clear how @dannylin108 defined and setup the theme and used it on widgets when playing with example 3. To get deeper into that, a sample application of used experiments would be needed. Generally if theming is done correctly and provided to the app the right way, there are no elements that change colors twice, they animate once, from previous theme to new theme settings. |
Beta Was this translation helpful? Give feedback.
Hi @dannylin108, this is a good and very frequent and relevant question generally in Flutter.
It all depends on how you do the state management to provide the ThemeData that FlexColorScheme produces to your application. FlexColorScheme just makes a ThemeData object, which is just as the class name says "data" that describe your theme. Yes if you apply any ThemeData (not just FlexColorScheme made one, Flutter just sees FlexColorScheme ThemeData as normal ThemeData since that is what it makes) in a "none" Flutter suitable way to you MaterialApp, you might very well se multiple rebuilds.
The example applications show one way of doing it using the official Google/Flutter skeleton template, bu…