Closed haaris94 closed 1 week ago
What platform are you testing this on? Did you try uninstalling the app or clearing the preferences? (This is required in debug mode because if you have changed the theme once using AdaptiveTheme.of(context)
api then that information is stored in storage to be used in sub-sequent runs!)
What platform are you testing this on?
I am testing this on windows desktop in debug mode.
Did you try uninstalling the app or clearing the preferences?
Uninstalling and reinstalling the app launches the app on specified theme mode, but only on first launch. If in the next launch I set the theme from dark to light or vice-versa it does not work.
This is required in debug mode because if you have changed the theme once using AdaptiveTheme.of(context) api then that information is stored in storage to be used in sub-sequent runs!
I have not changed the theme using the AdaptiveTheme.of(context)
api. My app only has Splashscreen, so I was testing theme modes by explicitly setting it in the AdaptiveTheme
wrapper on MaterialApp
.
Passing theme mode in AdaptiveTheme
is only for initial loading. Notice that the property name is called initial
. If you want to change the theme, you change it with AdaptiveTheme.of(context).setThemeMode(mode)
.
What usecase do you have to pass a different mode in initial
property? Or were you just testing it?
Yeah that makes sense. I was just testing how the colors looked in different theme modes. Thank you for clarifying.
The app is starting on dark theme even after setting the initial theme as light mode. If I remove the Adaptive theme code and set the app theme to light mode in Material app it works fine.
Here I have set the app theme explicitly to light mode.
and here is my app theme code