2024-01-05 05:20:55 +00:00
|
|
|
import 'package:auto_route/auto_route.dart';
|
2023-03-23 11:08:14 -04:00
|
|
|
import 'package:easy_localization/easy_localization.dart';
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
2023-11-29 04:17:29 +00:00
|
|
|
import 'package:immich_mobile/extensions/asyncvalue_extensions.dart';
|
2024-04-30 21:36:40 -05:00
|
|
|
import 'package:immich_mobile/models/search/search_curated_content.model.dart';
|
2024-05-02 15:59:14 -05:00
|
|
|
import 'package:immich_mobile/providers/search/search_page_state.provider.dart';
|
2024-05-06 23:04:21 -05:00
|
|
|
import 'package:immich_mobile/widgets/search/explore_grid.dart';
|
2023-03-23 11:08:14 -04:00
|
|
|
|
2024-01-15 16:50:33 +00:00
|
|
|
@RoutePage()
|
2024-04-30 22:14:33 -05:00
|
|
|
class AllPlacesPage extends HookConsumerWidget {
|
|
|
|
const AllPlacesPage({super.key});
|
2023-03-23 11:08:14 -04:00
|
|
|
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context, WidgetRef ref) {
|
2024-04-30 21:36:40 -05:00
|
|
|
AsyncValue<List<SearchCuratedContent>> places =
|
2024-04-30 22:14:33 -05:00
|
|
|
ref.watch(getAllPlacesProvider);
|
2023-03-23 11:08:14 -04:00
|
|
|
|
|
|
|
return Scaffold(
|
|
|
|
appBar: AppBar(
|
2023-11-20 08:58:03 -06:00
|
|
|
title: const Text(
|
2023-03-23 11:08:14 -04:00
|
|
|
'curated_location_page_title',
|
|
|
|
).tr(),
|
2023-03-24 23:44:53 -04:00
|
|
|
leading: IconButton(
|
2024-05-14 19:07:31 +00:00
|
|
|
onPressed: () => context.maybePop(),
|
2023-03-24 23:44:53 -04:00
|
|
|
icon: const Icon(Icons.arrow_back_ios_rounded),
|
|
|
|
),
|
2023-03-23 11:08:14 -04:00
|
|
|
),
|
2024-04-26 00:49:31 -05:00
|
|
|
body: places.widgetWhen(
|
|
|
|
onData: (data) => ExploreGrid(
|
|
|
|
curatedContent: data,
|
2023-03-23 11:08:14 -04:00
|
|
|
),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|