kdsuneraavinash / theme_provider

Easy to use, customizable and pluggable Theme Provider.
https://pub.dartlang.org/packages/theme_provider
MIT License
152 stars 28 forks source link

Custom themes are not working #11

Closed codesimar closed 4 years ago

codesimar commented 4 years ago

I added new AppTheme in the themes: property. But it keeps showing default dark() and light() themes. Even I tried to edit default theme constructs with .copywith() method. But it's not even making changes in the default themes. I think AppTheme isn't picking up properties through .copywith() method.

kdsuneraavinash commented 4 years ago

Can you provide a code segment with the bug? I'm not entirely sure I understand your problem.

codesimar commented 4 years ago

If I create a new theme, It will not work. It will keep using only default light() and dark() themes.

themes: [ AppTheme.light(), AppTheme.dark(), AppTheme( id: "custom_theme", description: "This is desc", data: ThemeData( primaryColor: Colors.black, accentColor: Colors.red, ), ), ],

onPressed: () { ThemeProvider.controllerOf(context).nextTheme();

codesimar commented 4 years ago

It shows no error, but it shows the same default light theme in place of this custom theme AppTheme( id: "custom_theme", description: "This is desc", data: ThemeData( primaryColor: Colors.black, accentColor: Colors.red, ), ),

codesimar commented 4 years ago

Sorry, my bad. I found the mistake. I was using backgroundColor: in place of scaffoldBackgroundColor to change the background color of the app. It's working fine now. Thanks for this great package. Please discard this issue.