1
0
mirror of https://github.com/immich-app/immich.git synced 2025-07-17 15:47:54 +02:00

refactor: user avatar color (#17753)

This commit is contained in:
Jason Rasmussen
2025-04-28 09:54:51 -04:00
committed by GitHub
parent 460d594791
commit ad272333db
30 changed files with 200 additions and 220 deletions

View File

@ -13,6 +13,7 @@ part of openapi.api;
class UserAdminCreateDto {
/// Returns a new [UserAdminCreateDto] instance.
UserAdminCreateDto({
this.avatarColor,
required this.email,
required this.name,
this.notify,
@ -22,6 +23,8 @@ class UserAdminCreateDto {
this.storageLabel,
});
UserAvatarColor? avatarColor;
String email;
String name;
@ -51,6 +54,7 @@ class UserAdminCreateDto {
@override
bool operator ==(Object other) => identical(this, other) || other is UserAdminCreateDto &&
other.avatarColor == avatarColor &&
other.email == email &&
other.name == name &&
other.notify == notify &&
@ -62,6 +66,7 @@ class UserAdminCreateDto {
@override
int get hashCode =>
// ignore: unnecessary_parenthesis
(avatarColor == null ? 0 : avatarColor!.hashCode) +
(email.hashCode) +
(name.hashCode) +
(notify == null ? 0 : notify!.hashCode) +
@ -71,10 +76,15 @@ class UserAdminCreateDto {
(storageLabel == null ? 0 : storageLabel!.hashCode);
@override
String toString() => 'UserAdminCreateDto[email=$email, name=$name, notify=$notify, password=$password, quotaSizeInBytes=$quotaSizeInBytes, shouldChangePassword=$shouldChangePassword, storageLabel=$storageLabel]';
String toString() => 'UserAdminCreateDto[avatarColor=$avatarColor, email=$email, name=$name, notify=$notify, password=$password, quotaSizeInBytes=$quotaSizeInBytes, shouldChangePassword=$shouldChangePassword, storageLabel=$storageLabel]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
if (this.avatarColor != null) {
json[r'avatarColor'] = this.avatarColor;
} else {
// json[r'avatarColor'] = null;
}
json[r'email'] = this.email;
json[r'name'] = this.name;
if (this.notify != null) {
@ -110,6 +120,7 @@ class UserAdminCreateDto {
final json = value.cast<String, dynamic>();
return UserAdminCreateDto(
avatarColor: UserAvatarColor.fromJson(json[r'avatarColor']),
email: mapValueOfType<String>(json, r'email')!,
name: mapValueOfType<String>(json, r'name')!,
notify: mapValueOfType<bool>(json, r'notify'),