I followed a YouTube tutorial to see how to use a dropdown menu to select and save a theme using shared_preferences and it worked flawlessly actually, so i thought maybe i can use and implement the same code (almost same actually) to select the colorScheme and eventually this is what i came up with:
theme: ThemeData(colorScheme: provider.seedColor)
darkTheme: ThemeData(colorScheme: provider.seedColor)
but for the theming to stay working, i need to set the theme like this:
theme: ThemeData.light()
darkTheme: ThemeData.dark()
but this way the colorScheme won’t be set, so i use copyWith() this way:
theme: ThemeData.light().copyWith(colorScheme: provider.seedColor)
darkTheme: ThemeData.dark().copyWith(colorScheme: provider.seedColor)
but it’s not looking the same as if i was using the first method:
theme: ThemeData(colorScheme: provider.seedColor)
darkTheme: ThemeData(colorScheme: provider.seedColor)
now you might not understand much without looking at the code so here:
IMPORTANT NOTE: if you want to run the app, try creating the HomePage() class specified in the code and creating a button for the settings page.
Please help and hanks in advance!