mirror of
https://github.com/immich-app/immich.git
synced 2026-05-18 03:10:24 +03:00
migrate primary color
This commit is contained in:
@@ -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)';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user