2022-05-29 05:35:45 +02:00
|
|
|
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());
|
|
|
|
|
2022-06-25 22:12:47 +02:00
|
|
|
factory UploadProfileImageResponse.fromJson(String source) =>
|
|
|
|
UploadProfileImageResponse.fromMap(json.decode(source));
|
2022-05-29 05:35:45 +02:00
|
|
|
|
|
|
|
@override
|
2022-06-25 22:12:47 +02:00
|
|
|
String toString() =>
|
|
|
|
'UploadProfileImageReponse(userId: $userId, profileImagePath: $profileImagePath)';
|
2022-05-29 05:35:45 +02:00
|
|
|
|
|
|
|
@override
|
|
|
|
bool operator ==(Object other) {
|
|
|
|
if (identical(this, other)) return true;
|
|
|
|
|
2022-06-25 22:12:47 +02:00
|
|
|
return other is UploadProfileImageResponse &&
|
|
|
|
other.userId == userId &&
|
|
|
|
other.profileImagePath == profileImagePath;
|
2022-05-29 05:35:45 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
@override
|
|
|
|
int get hashCode => userId.hashCode ^ profileImagePath.hashCode;
|
|
|
|
}
|