selfprivacy.org.app/lib/logic/cubit/app_settings/app_settings_state.dart

36 lines
1.1 KiB
Dart
Raw Normal View History

2020-12-08 19:26:51 +00:00
part of 'app_settings_cubit.dart';
class AppSettingsState extends Equatable {
const AppSettingsState({
2021-03-15 15:39:44 +00:00
required this.isDarkModeOn,
2023-02-23 14:41:45 +00:00
required this.isAutoDarkModeOn,
required this.isOnboardingShowing,
this.corePalette,
2020-12-08 19:26:51 +00:00
});
final bool isDarkModeOn;
2023-02-23 14:41:45 +00:00
final bool isAutoDarkModeOn;
final bool isOnboardingShowing;
final color_utils.CorePalette? corePalette;
2021-01-06 17:35:57 +00:00
AppSettingsState copyWith({
final bool? isDarkModeOn,
2023-02-23 14:41:45 +00:00
final bool? isAutoDarkModeOn,
final bool? isOnboardingShowing,
final color_utils.CorePalette? corePalette,
}) =>
2021-01-06 17:35:57 +00:00
AppSettingsState(
isDarkModeOn: isDarkModeOn ?? this.isDarkModeOn,
2023-02-23 14:41:45 +00:00
isAutoDarkModeOn: isAutoDarkModeOn ?? this.isAutoDarkModeOn,
isOnboardingShowing: isOnboardingShowing ?? this.isOnboardingShowing,
corePalette: corePalette ?? this.corePalette,
2021-01-06 17:35:57 +00:00
);
2020-12-08 19:26:51 +00:00
color_utils.CorePalette get corePaletteOrDefault =>
corePalette ?? color_utils.CorePalette.of(BrandColors.primary.value);
2020-12-08 19:26:51 +00:00
@override
2023-02-23 14:41:45 +00:00
List<dynamic> get props =>
[isDarkModeOn, isAutoDarkModeOn, isOnboardingShowing, corePalette];
2020-12-08 19:26:51 +00:00
}