BirjuVachhani / adaptive_theme

Easiest way to add support for light and dark theme in your flutter app.
https://pub.dev/packages/adaptive_theme
Apache License 2.0
464 stars 37 forks source link

get theme and get darkTheme returns the same theme dependend on mode #16

Closed bernhardfrenking closed 3 years ago

bernhardfrenking commented 3 years ago

Retrieving the ThemeData with get theme and get darkTheme will return not the expected themes of light theme and dark theme, instead both return the "active" theme.

To Reproduce Compare AdaptiveTheme.of(context).theme with AdaptiveTheme.of(context).darkTheme;.

Expected behavior theme returns the light theme and darkTheme returns the dark theme.

Responsible Code from adaptive_theme.dart, which is cousing this behaviour:

  @override
  ThemeData get theme => preferences.mode.isDark ? _darkTheme : _theme;

  @override
  ThemeData get darkTheme => preferences.mode.isLight ? _theme : _darkTheme;
BirjuVachhani commented 3 years ago

Available in 2.1.0