mirror of
https://github.com/immich-app/immich.git
synced 2026-05-18 03:10:24 +03:00
migrate dynamic theme
This commit is contained in:
@@ -4,19 +4,27 @@ import 'package:immich_mobile/constants/colors.dart';
|
||||
class ThemeConfig {
|
||||
final ThemeMode mode;
|
||||
final ImmichColorPreset primaryColor;
|
||||
final bool dynamicTheme;
|
||||
|
||||
const ThemeConfig({this.mode = .system, this.primaryColor = .indigo});
|
||||
const ThemeConfig({this.mode = .system, this.primaryColor = .indigo, this.dynamicTheme = false});
|
||||
|
||||
ThemeConfig copyWith({ThemeMode? mode, ImmichColorPreset? primaryColor}) =>
|
||||
.new(mode: mode ?? this.mode, primaryColor: primaryColor ?? this.primaryColor);
|
||||
ThemeConfig copyWith({ThemeMode? mode, ImmichColorPreset? primaryColor, bool? dynamicTheme}) => .new(
|
||||
mode: mode ?? this.mode,
|
||||
primaryColor: primaryColor ?? this.primaryColor,
|
||||
dynamicTheme: dynamicTheme ?? this.dynamicTheme,
|
||||
);
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) =>
|
||||
identical(this, other) || (other is ThemeConfig && other.mode == mode && other.primaryColor == primaryColor);
|
||||
identical(this, other) ||
|
||||
(other is ThemeConfig &&
|
||||
other.mode == mode &&
|
||||
other.primaryColor == primaryColor &&
|
||||
other.dynamicTheme == dynamicTheme);
|
||||
|
||||
@override
|
||||
int get hashCode => Object.hash(mode, primaryColor);
|
||||
int get hashCode => Object.hash(mode, primaryColor, dynamicTheme);
|
||||
|
||||
@override
|
||||
String toString() => 'ThemeConfig(mode: $mode, primaryColor: $primaryColor)';
|
||||
String toString() => 'ThemeConfig(mode: $mode, primaryColor: $primaryColor, dynamicTheme: $dynamicTheme)';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user