2022-04-24 04:08:45 +02:00
|
|
|
import 'package:collection/collection.dart';
|
2022-11-08 19:00:24 +02:00
|
|
|
import 'package:immich_mobile/shared/models/asset.dart';
|
2022-04-24 04:08:45 +02:00
|
|
|
|
|
|
|
class AssetSelectionPageResult {
|
2022-11-08 19:00:24 +02:00
|
|
|
final Set<Asset> selectedNewAsset;
|
|
|
|
final Set<Asset> selectedAdditionalAsset;
|
2022-04-24 04:08:45 +02:00
|
|
|
final bool isAlbumExist;
|
|
|
|
|
|
|
|
AssetSelectionPageResult({
|
|
|
|
required this.selectedNewAsset,
|
|
|
|
required this.selectedAdditionalAsset,
|
|
|
|
required this.isAlbumExist,
|
|
|
|
});
|
|
|
|
|
|
|
|
AssetSelectionPageResult copyWith({
|
2022-11-08 19:00:24 +02:00
|
|
|
Set<Asset>? selectedNewAsset,
|
|
|
|
Set<Asset>? selectedAdditionalAsset,
|
2022-04-24 04:08:45 +02:00
|
|
|
bool? isAlbumExist,
|
|
|
|
}) {
|
|
|
|
return AssetSelectionPageResult(
|
|
|
|
selectedNewAsset: selectedNewAsset ?? this.selectedNewAsset,
|
2022-06-25 22:12:47 +02:00
|
|
|
selectedAdditionalAsset:
|
|
|
|
selectedAdditionalAsset ?? this.selectedAdditionalAsset,
|
2022-04-24 04:08:45 +02:00
|
|
|
isAlbumExist: isAlbumExist ?? this.isAlbumExist,
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
@override
|
|
|
|
String toString() =>
|
|
|
|
'AssetSelectionPageResult(selectedNewAsset: $selectedNewAsset, selectedAdditionalAsset: $selectedAdditionalAsset, isAlbumExist: $isAlbumExist)';
|
|
|
|
|
|
|
|
@override
|
|
|
|
bool operator ==(Object other) {
|
|
|
|
if (identical(this, other)) return true;
|
|
|
|
final setEquals = const DeepCollectionEquality().equals;
|
|
|
|
|
|
|
|
return other is AssetSelectionPageResult &&
|
|
|
|
setEquals(other.selectedNewAsset, selectedNewAsset) &&
|
|
|
|
setEquals(other.selectedAdditionalAsset, selectedAdditionalAsset) &&
|
|
|
|
other.isAlbumExist == isAlbumExist;
|
|
|
|
}
|
|
|
|
|
|
|
|
@override
|
2022-06-25 22:12:47 +02:00
|
|
|
int get hashCode =>
|
|
|
|
selectedNewAsset.hashCode ^
|
|
|
|
selectedAdditionalAsset.hashCode ^
|
|
|
|
isAlbumExist.hashCode;
|
2022-04-24 04:08:45 +02:00
|
|
|
}
|