Skip to content

Commit 9a794cf

Browse files
committed
fix: toggle theme mode correctly
- Fixed theme toggle logic
1 parent 91f2528 commit 9a794cf

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

lib/app/bloc/app_bloc.dart

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,11 @@ class AppBloc extends Bloc<AppEvent, AppState> {
3737
) {
3838
emit(
3939
state.copyWith(
40-
themeMode: state.themeMode == ThemeMode.light
41-
? ThemeMode.dark
42-
: ThemeMode.light,
40+
themeMode: state.themeMode == ThemeMode.system
41+
? ThemeMode.system
42+
: state.themeMode == ThemeMode.dark
43+
? ThemeMode.dark
44+
: ThemeMode.light,
4345
),
4446
);
4547
}

0 commit comments

Comments
 (0)