2022-04-24 04:08:45 +02:00
|
|
|
import 'package:collection/collection.dart';
|
|
|
|
|
2022-07-13 14:23:48 +02:00
|
|
|
import 'package:openapi/api.dart';
|
2022-04-24 04:08:45 +02:00
|
|
|
|
|
|
|
class AssetSelectionPageResult {
|
2022-07-13 14:23:48 +02:00
|
|
|
final Set<AssetResponseDto> selectedNewAsset;
|
|
|
|
final Set<AssetResponseDto> 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-07-13 14:23:48 +02:00
|
|
|
Set<AssetResponseDto>? selectedNewAsset,
|
|
|
|
Set<AssetResponseDto>? 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
|
|
|
}
|