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,
|
2024-05-18 16:00:25 +02:00
|
|
|
required this.secondarySeedColor,
|
2023-08-19 18:47:56 +02:00
|
|
|
this.error,
|
2023-05-28 19:11:34 +02:00
|
|
|
});
|
|
|
|
|
|
|
|
@override
|
|
|
|
String toString() => _$toString();
|
|
|
|
|
|
|
|
final bool isFollowSystemTheme;
|
|
|
|
final bool isUseBlackInDarkTheme;
|
2023-07-24 15:06:59 +02:00
|
|
|
// workaround analyzer bug where Color type can't be recognized
|
|
|
|
final int? seedColor;
|
2024-05-18 16:00:25 +02:00
|
|
|
final int? secondarySeedColor;
|
2023-08-19 18:47:56 +02:00
|
|
|
|
|
|
|
final ExceptionEvent? error;
|
2023-05-28 19:11:34 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
abstract class _Event {
|
|
|
|
const _Event();
|
|
|
|
}
|
|
|
|
|
2023-08-19 18:47:56 +02:00
|
|
|
@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
|
2024-05-18 16:00:25 +02:00
|
|
|
class _SetThemeColor extends _Event {
|
|
|
|
const _SetThemeColor(this.primary, this.secondary);
|
2023-05-28 19:11:34 +02:00
|
|
|
|
|
|
|
@override
|
|
|
|
String toString() => _$toString();
|
|
|
|
|
2024-05-18 16:00:25 +02:00
|
|
|
final Color? primary;
|
|
|
|
final Color? secondary;
|
2023-05-28 19:11:34 +02:00
|
|
|
}
|