You've already forked immich
mirror of
https://github.com/immich-app/immich.git
synced 2025-07-16 07:24:40 +02:00
refactor(mobile): entities and models (#9182)
* refactor(mobile): entities * store entity * refactor: models * remove domain * save all * bad refactor
This commit is contained in:
65
mobile/lib/models/backup/error_upload_asset.model.dart
Normal file
65
mobile/lib/models/backup/error_upload_asset.model.dart
Normal file
@ -0,0 +1,65 @@
|
||||
import 'package:photo_manager/photo_manager.dart';
|
||||
|
||||
class ErrorUploadAsset {
|
||||
final String id;
|
||||
final DateTime fileCreatedAt;
|
||||
final String fileName;
|
||||
final String fileType;
|
||||
final AssetEntity asset;
|
||||
final String errorMessage;
|
||||
|
||||
const ErrorUploadAsset({
|
||||
required this.id,
|
||||
required this.fileCreatedAt,
|
||||
required this.fileName,
|
||||
required this.fileType,
|
||||
required this.asset,
|
||||
required this.errorMessage,
|
||||
});
|
||||
|
||||
ErrorUploadAsset copyWith({
|
||||
String? id,
|
||||
DateTime? fileCreatedAt,
|
||||
String? fileName,
|
||||
String? fileType,
|
||||
AssetEntity? asset,
|
||||
String? errorMessage,
|
||||
}) {
|
||||
return ErrorUploadAsset(
|
||||
id: id ?? this.id,
|
||||
fileCreatedAt: fileCreatedAt ?? this.fileCreatedAt,
|
||||
fileName: fileName ?? this.fileName,
|
||||
fileType: fileType ?? this.fileType,
|
||||
asset: asset ?? this.asset,
|
||||
errorMessage: errorMessage ?? this.errorMessage,
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'ErrorUploadAsset(id: $id, fileCreatedAt: $fileCreatedAt, fileName: $fileName, fileType: $fileType, asset: $asset, errorMessage: $errorMessage)';
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
if (identical(this, other)) return true;
|
||||
|
||||
return other is ErrorUploadAsset &&
|
||||
other.id == id &&
|
||||
other.fileCreatedAt == fileCreatedAt &&
|
||||
other.fileName == fileName &&
|
||||
other.fileType == fileType &&
|
||||
other.asset == asset &&
|
||||
other.errorMessage == errorMessage;
|
||||
}
|
||||
|
||||
@override
|
||||
int get hashCode {
|
||||
return id.hashCode ^
|
||||
fileCreatedAt.hashCode ^
|
||||
fileName.hashCode ^
|
||||
fileType.hashCode ^
|
||||
asset.hashCode ^
|
||||
errorMessage.hashCode;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user