2025-07-18 04:25:25 +08:00
|
|
|
import 'package:collection/collection.dart';
|
|
|
|
|
import 'package:immich_mobile/domain/models/asset/base_asset.model.dart';
|
|
|
|
|
|
|
|
|
|
class SearchResult {
|
|
|
|
|
final List<BaseAsset> assets;
|
|
|
|
|
final int? nextPage;
|
|
|
|
|
|
2026-03-04 17:27:11 +00:00
|
|
|
const SearchResult({required this.assets, this.nextPage});
|
2025-07-18 04:25:25 +08:00
|
|
|
|
|
|
|
|
@override
|
2026-03-04 17:27:11 +00:00
|
|
|
String toString() => 'SearchResult(assets: ${assets.length}, nextPage: $nextPage)';
|
2025-07-18 04:25:25 +08:00
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
bool operator ==(covariant SearchResult other) {
|
2026-05-12 00:47:24 +07:00
|
|
|
if (identical(this, other)) {
|
|
|
|
|
return true;
|
|
|
|
|
}
|
2025-07-18 04:25:25 +08:00
|
|
|
final listEquals = const DeepCollectionEquality().equals;
|
|
|
|
|
|
2026-03-04 17:27:11 +00:00
|
|
|
return listEquals(other.assets, assets) && other.nextPage == nextPage;
|
2025-07-18 04:25:25 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@override
|
2026-03-04 17:27:11 +00:00
|
|
|
int get hashCode => assets.hashCode ^ nextPage.hashCode;
|
2025-07-18 04:25:25 +08:00
|
|
|
}
|