mirror of
https://github.com/immich-app/immich.git
synced 2024-11-17 19:08:49 -07:00
40a8115101
* Fixed app not resuming backup after closing and reopening the app * Fixed cosmetic effect of backup button doesn't change state right away after pressing start backup * Fixed grammar * Fixed deep copy problem that cause incorrect asset count when backing up * Format code
58 lines
1.5 KiB
Dart
58 lines
1.5 KiB
Dart
import 'dart:convert';
|
|
|
|
class UploadProfileImageResponse {
|
|
final String userId;
|
|
final String profileImagePath;
|
|
UploadProfileImageResponse({
|
|
required this.userId,
|
|
required this.profileImagePath,
|
|
});
|
|
|
|
UploadProfileImageResponse copyWith({
|
|
String? userId,
|
|
String? profileImagePath,
|
|
}) {
|
|
return UploadProfileImageResponse(
|
|
userId: userId ?? this.userId,
|
|
profileImagePath: profileImagePath ?? this.profileImagePath,
|
|
);
|
|
}
|
|
|
|
Map<String, dynamic> toMap() {
|
|
final result = <String, dynamic>{};
|
|
|
|
result.addAll({'userId': userId});
|
|
result.addAll({'profileImagePath': profileImagePath});
|
|
|
|
return result;
|
|
}
|
|
|
|
factory UploadProfileImageResponse.fromMap(Map<String, dynamic> map) {
|
|
return UploadProfileImageResponse(
|
|
userId: map['userId'] ?? '',
|
|
profileImagePath: map['profileImagePath'] ?? '',
|
|
);
|
|
}
|
|
|
|
String toJson() => json.encode(toMap());
|
|
|
|
factory UploadProfileImageResponse.fromJson(String source) =>
|
|
UploadProfileImageResponse.fromMap(json.decode(source));
|
|
|
|
@override
|
|
String toString() =>
|
|
'UploadProfileImageReponse(userId: $userId, profileImagePath: $profileImagePath)';
|
|
|
|
@override
|
|
bool operator ==(Object other) {
|
|
if (identical(this, other)) return true;
|
|
|
|
return other is UploadProfileImageResponse &&
|
|
other.userId == userId &&
|
|
other.profileImagePath == profileImagePath;
|
|
}
|
|
|
|
@override
|
|
int get hashCode => userId.hashCode ^ profileImagePath.hashCode;
|
|
}
|