mirror of
https://github.com/immich-app/immich.git
synced 2025-08-11 09:16:31 -04:00
* chore: bump dart sdk to 3.8 * chore: make build * make pigeon * chore: format files --------- Co-authored-by: shenlong-tanwen <139912620+shalong-tanwen@users.noreply.github.com>
30 lines
880 B
Dart
30 lines
880 B
Dart
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;
|
|
|
|
const SearchResult({required this.assets, this.nextPage});
|
|
|
|
int get totalAssets => assets.length;
|
|
|
|
SearchResult copyWith({List<BaseAsset>? assets, int? nextPage}) {
|
|
return SearchResult(assets: assets ?? this.assets, nextPage: nextPage ?? this.nextPage);
|
|
}
|
|
|
|
@override
|
|
String toString() => 'SearchResult(assets: $assets, nextPage: $nextPage)';
|
|
|
|
@override
|
|
bool operator ==(covariant SearchResult other) {
|
|
if (identical(this, other)) return true;
|
|
final listEquals = const DeepCollectionEquality().equals;
|
|
|
|
return listEquals(other.assets, assets) && other.nextPage == nextPage;
|
|
}
|
|
|
|
@override
|
|
int get hashCode => assets.hashCode ^ nextPage.hashCode;
|
|
}
|