theme work
This commit is contained in:
@@ -1,30 +1,14 @@
|
||||
part of 'theme_bloc.dart';
|
||||
|
||||
enum ThemeStatus { initial, success }
|
||||
|
||||
enum AppTheme {
|
||||
dark(name: 'dark'),
|
||||
light(name: 'light'),
|
||||
system(name: 'system');
|
||||
|
||||
final String name;
|
||||
|
||||
const AppTheme({required this.name});
|
||||
}
|
||||
|
||||
class ThemeState extends Equatable {
|
||||
const ThemeState({required this.status, required this.appTheme});
|
||||
const ThemeState({required this.themeMode});
|
||||
|
||||
final ThemeStatus status;
|
||||
final AppTheme appTheme;
|
||||
final ThemeMode themeMode;
|
||||
|
||||
@override
|
||||
List<Object?> get props => [status, appTheme];
|
||||
List<Object?> get props => [themeMode];
|
||||
|
||||
ThemeState copyWith({ThemeStatus? status, AppTheme? appTheme}) {
|
||||
return ThemeState(
|
||||
status: status ?? this.status,
|
||||
appTheme: appTheme ?? this.appTheme,
|
||||
);
|
||||
ThemeState copyWith({ThemeMode? themeMode}) {
|
||||
return ThemeState(themeMode: themeMode ?? this.themeMode);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user