mirror of
https://github.com/immich-app/immich.git
synced 2026-03-10 12:17:56 +03:00
feat(mobile): multiselect for search & person page (#6016)
* feat(mobile): multiselect for search & person page * merge main --------- Co-authored-by: Alex Tran <alex.tran1502@gmail.com>
This commit is contained in:
committed by
GitHub
parent
ad09896f58
commit
56cde0438c
@@ -1,5 +1,6 @@
|
||||
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
||||
import 'package:immich_mobile/modules/asset_viewer/providers/render_list.provider.dart';
|
||||
import 'package:immich_mobile/modules/home/ui/asset_grid/asset_grid_data_structure.dart';
|
||||
import 'package:immich_mobile/modules/search/models/search_result_page_state.model.dart';
|
||||
|
||||
import 'package:immich_mobile/modules/search/services/search.service.dart';
|
||||
@@ -13,12 +14,13 @@ class SearchResultPageNotifier extends StateNotifier<SearchResultPageState> {
|
||||
isError: false,
|
||||
isLoading: true,
|
||||
isSuccess: false,
|
||||
isClip: false,
|
||||
),
|
||||
);
|
||||
|
||||
final SearchService _searchService;
|
||||
|
||||
void search(String searchTerm, {bool clipEnable = true}) async {
|
||||
Future<void> search(String searchTerm, {bool clipEnable = true}) async {
|
||||
state = state.copyWith(
|
||||
searchResult: [],
|
||||
isError: false,
|
||||
@@ -37,6 +39,7 @@ class SearchResultPageNotifier extends StateNotifier<SearchResultPageState> {
|
||||
isError: false,
|
||||
isLoading: false,
|
||||
isSuccess: true,
|
||||
isClip: clipEnable,
|
||||
);
|
||||
} else {
|
||||
state = state.copyWith(
|
||||
@@ -44,6 +47,7 @@ class SearchResultPageNotifier extends StateNotifier<SearchResultPageState> {
|
||||
isError: true,
|
||||
isLoading: false,
|
||||
isSuccess: false,
|
||||
isClip: clipEnable,
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -55,7 +59,11 @@ final searchResultPageProvider =
|
||||
return SearchResultPageNotifier(ref.watch(searchServiceProvider));
|
||||
});
|
||||
|
||||
final searchRenderListProvider = FutureProvider((ref) {
|
||||
final assets = ref.watch(searchResultPageProvider).searchResult;
|
||||
return ref.watch(renderListProvider(assets));
|
||||
final searchRenderListProvider = Provider((ref) {
|
||||
final result = ref.watch(searchResultPageProvider);
|
||||
return ref.watch(
|
||||
renderListProviderWithGrouping(
|
||||
(result.searchResult, result.isClip ? GroupAssetsBy.none : null),
|
||||
),
|
||||
);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user