2024-01-05 06:20:55 +01:00
|
|
|
import 'package:auto_route/auto_route.dart';
|
2023-03-25 04:44:53 +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-07 06:04:21 +02:00
|
|
|
import 'package:immich_mobile/widgets/asset_grid/immich_asset_grid.dart';
|
2024-05-02 22:59:14 +02:00
|
|
|
import 'package:immich_mobile/providers/search/recently_added_asset.provider.dart';
|
2023-03-25 04:44:53 +01:00
|
|
|
|
2024-01-15 17:50:33 +01:00
|
|
|
@RoutePage()
|
2023-03-25 04:44:53 +01:00
|
|
|
class RecentlyAddedPage extends HookConsumerWidget {
|
|
|
|
const RecentlyAddedPage({super.key});
|
|
|
|
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context, WidgetRef ref) {
|
2024-05-02 22:59:14 +02:00
|
|
|
final recents = ref.watch(recentlyAddedAssetProvider);
|
2023-03-25 04:44:53 +01:00
|
|
|
|
|
|
|
return Scaffold(
|
|
|
|
appBar: AppBar(
|
|
|
|
title: const Text('recently_added_page_title').tr(),
|
|
|
|
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-11-29 05:17:29 +01:00
|
|
|
body: recents.widgetWhen(
|
|
|
|
onData: (searchResponse) => ImmichAssetGrid(
|
2023-03-25 04:44:53 +01:00
|
|
|
assets: searchResponse,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|