migrate primary color

This commit is contained in:
shenlong-tanwen
2026-05-03 21:16:46 +07:00
parent 6fdb841732
commit 68a718fab4
12 changed files with 41 additions and 46 deletions
@@ -1,18 +1,22 @@
import 'package:flutter/material.dart';
import 'package:immich_mobile/constants/colors.dart';
class ThemeConfig {
final ThemeMode mode;
final ImmichColorPreset primaryColor;
const ThemeConfig({this.mode = .system});
const ThemeConfig({this.mode = .system, this.primaryColor = .indigo});
ThemeConfig copyWith({ThemeMode? mode}) => .new(mode: mode ?? this.mode);
ThemeConfig copyWith({ThemeMode? mode, ImmichColorPreset? primaryColor}) =>
.new(mode: mode ?? this.mode, primaryColor: primaryColor ?? this.primaryColor);
@override
bool operator ==(Object other) => identical(this, other) || (other is ThemeConfig && other.mode == mode);
bool operator ==(Object other) =>
identical(this, other) || (other is ThemeConfig && other.mode == mode && other.primaryColor == primaryColor);
@override
int get hashCode => mode.hashCode;
int get hashCode => Object.hash(mode, primaryColor);
@override
String toString() => 'ThemeConfig(mode: $mode)';
String toString() => 'ThemeConfig(mode: $mode, primaryColor: $primaryColor)';
}