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