Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
bernhardfrenking opened this issue Apr 4, 2021 · 1 comment · Fixed by #17
Closed

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

bernhardfrenking opened this issue Apr 4, 2021 · 1 comment · Fixed by #17
Labels
bug Something isn't working

Comments

@bernhardfrenking
Copy link
Contributor

bernhardfrenking commented Apr 4, 2021

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
Copy link
Owner

Available in 2.1.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
2 participants