Norbert515 / dynamic_theme

Dynamically changing your theme without hassle
MIT License
322 stars 68 forks source link

Not every occurence of accentColor and primaryColor is changed #39

Open dvorapa opened 4 years ago

dvorapa commented 4 years ago

When changing theme using this package, not everything is changed properly, e.g. FloatingActionButtons remain with the old color. My code:

DynamicTheme.of(context).setThemeData(Theme.of(context).copyWith(
  primaryColor: Colors.red,
  accentColor: Colors.red
));
SebastienBtr commented 4 years ago

use primarySwatch instead of primaryColor

dvorapa commented 4 years ago

Changing primarySwatch leaves these things blue, that's why I use primaryColor.

SebastienBtr commented 4 years ago

it works fine for me with primarySwatch

dvorapa commented 4 years ago

If you need to have more advanced theme and not just two-color theme, primarySwatch is not a viable option. Flutter docs then recommend using these two instead.