nc-photos/app/lib/widget/settings/theme/state_event.dart

69 lines
1.3 KiB
Dart
Raw Normal View History

2023-05-28 19:11:34 +02:00
part of '../theme_settings.dart';
@genCopyWith
@toString
class _State {
const _State({
required this.isFollowSystemTheme,
required this.isUseBlackInDarkTheme,
required this.seedColor,
required this.secondarySeedColor,
this.error,
2023-05-28 19:11:34 +02:00
});
@override
String toString() => _$toString();
final bool isFollowSystemTheme;
final bool isUseBlackInDarkTheme;
// workaround analyzer bug where Color type can't be recognized
final int? seedColor;
final int? secondarySeedColor;
final ExceptionEvent? error;
2023-05-28 19:11:34 +02:00
}
abstract class _Event {
const _Event();
}
@toString
class _Init implements _Event {
const _Init();
@override
String toString() => _$toString();
}
2023-05-28 19:11:34 +02:00
@toString
class _SetFollowSystemTheme extends _Event {
const _SetFollowSystemTheme(this.value);
@override
String toString() => _$toString();
final bool value;
}
@toString
class _SetUseBlackInDarkTheme extends _Event {
const _SetUseBlackInDarkTheme(this.value, this.theme);
@override
String toString() => _$toString();
final bool value;
final ThemeData theme;
}
@toString
class _SetThemeColor extends _Event {
const _SetThemeColor(this.primary, this.secondary);
2023-05-28 19:11:34 +02:00
@override
String toString() => _$toString();
final Color? primary;
final Color? secondary;
2023-05-28 19:11:34 +02:00
}