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

29 lines
574 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;
const ThemeState(this.prefsAreLoaded);
AppTheme get theme;
}
class LightThemeState extends ThemeState {
final bool prefsAreLoaded;
const LightThemeState({this.prefsAreLoaded = false}) : super(prefsAreLoaded);
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 {
final bool prefsAreLoaded;
const DarkThemeState({this.prefsAreLoaded = false}) : super(prefsAreLoaded);
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
}