1
0
Fork 0
mirror of https://github.com/immich-app/immich.git synced 2025-01-07 20:36:48 +01:00
immich/mobile/lib/modules/search/providers/search_page_state.provider.dart
Alex 52bcb46b42
fix(mobile): show places in Search page on mobile (#9085)
* fix(mobile): show map on mobile

* remove ununsed code
2024-04-26 00:49:31 -05:00

29 lines
779 B
Dart

import 'package:hooks_riverpod/hooks_riverpod.dart';
import 'package:immich_mobile/modules/search/models/curated_content.dart';
import 'package:immich_mobile/modules/search/services/search.service.dart';
final getPlacesProvider =
FutureProvider.autoDispose<List<CuratedContent>>((ref) async {
final SearchService searchService = ref.watch(searchServiceProvider);
final exploreData = await searchService.getExploreData();
if (exploreData == null) {
return [];
}
final locations =
exploreData.firstWhere((data) => data.fieldName == "exifInfo.city").items;
final curatedContent = locations
.map(
(l) => CuratedContent(
label: l.value,
id: l.data.id,
),
)
.toList();
return curatedContent;
});