Closed yagizdo closed 2 years ago
@yagizdo This is not a bug. Its an expected behavior. AdaptiveTheme
supports 3 theme modes: Light
, dart
and System
. Calling AdaptiveTheme. toggleThemeMode()
goes through all 3.
So, for example, your OS is running in light mode and you are also on light mode in the app and then if you toggle theme mode, it may go from light
-> system
mode where system mode also is light so you see no change. Then when you toggle again, it may go to dark mode and you see the change.
It seems that you wanna toggle between only light
and dark
, not the system
. So, instead of calling toggleThemeMode()
do this:
final manager = AdaptiveTheme.of(context);
if(manager.mode.isLight){
manager.setDark();
}else {
manager.setLight();
}
@yagizdo This is not a bug. Its an expected behavior.
AdaptiveTheme
supports 3 theme modes:Light
,dart
andSystem
. CallingAdaptiveTheme. toggleThemeMode()
goes through all 3.So, for example, your OS is running in light mode and you are also on light mode in the app and then if you toggle theme mode, it may go from
light
->system
mode where system mode also is light so you see no change. Then when you toggle again, it may go to dark mode and you see the change.It seems that you wanna toggle between only
light
anddark
, not thesystem
. So, instead of callingtoggleThemeMode()
do this:final manager = AdaptiveTheme.of(context); if(manager.mode.isLight){ manager.setDark(); }else { manager.setLight(); }
Oh okay I get it. Sorry my bad @BirjuVachhani
@yagizdo Np. Glad I could help😊
Describe the bug Thank you for preparing such a package first of all. When I assign the toggletheme code to the icon button, it does not detect some clicks. It works when I click it again.
When I first open the application, the theme does not change at the first click. It changes when I click it for the second time. Nothing happens on the first click.
Smartphone
Bug Video :
https://user-images.githubusercontent.com/31064552/177759508-d0773155-ed0c-44f7-9323-6a58b26ff256.mp4
Codes :
app.dart
homeView.dart