Jisho-Study-Tool/lib/bloc/theme/theme_state.dart

27 lines
569 B
Dart
Raw Normal View History

2021-08-08 23:16:54 +02:00
part of 'theme_bloc.dart';
@immutable
abstract class ThemeState {
final bool prefsAreLoaded;
2021-12-04 05:22:58 +01:00
const ThemeState({required this.prefsAreLoaded});
2021-08-08 23:16:54 +02:00
AppTheme get theme;
}
class LightThemeState extends ThemeState {
2021-12-04 05:22:58 +01:00
const LightThemeState({bool prefsAreLoaded = false})
: super(prefsAreLoaded: prefsAreLoaded);
2021-08-08 23:16:54 +02:00
2021-12-01 23:09:53 +01:00
@override
2021-08-08 23:16:54 +02:00
AppTheme get theme => LightTheme();
}
class DarkThemeState extends ThemeState {
2021-12-04 05:22:58 +01:00
const DarkThemeState({bool prefsAreLoaded = false})
: super(prefsAreLoaded: prefsAreLoaded);
2021-08-08 23:16:54 +02:00
2021-12-01 23:09:53 +01:00
@override
2021-08-08 23:16:54 +02:00
AppTheme get theme => DarkTheme();
2021-12-01 23:09:53 +01:00
}