2024-01-05 05:20:55 +00:00
|
|
|
import 'package:auto_route/auto_route.dart';
|
2023-02-05 03:25:11 +00:00
|
|
|
import 'package:easy_localization/easy_localization.dart';
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
2024-09-22 13:24:08 +00:00
|
|
|
import 'package:immich_mobile/providers/favorite.provider.dart';
|
2024-05-02 20:59:14 +00:00
|
|
|
import 'package:immich_mobile/providers/multiselect.provider.dart';
|
2024-05-07 04:04:21 +00:00
|
|
|
import 'package:immich_mobile/widgets/asset_grid/multiselect_grid.dart';
|
2023-02-05 03:25:11 +00:00
|
|
|
|
2024-01-15 16:50:33 +00:00
|
|
|
@RoutePage()
|
2023-02-05 03:25:11 +00:00
|
|
|
class FavoritesPage extends HookConsumerWidget {
|
2024-01-27 16:14:32 +00:00
|
|
|
const FavoritesPage({super.key});
|
2023-02-05 03:25:11 +00:00
|
|
|
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context, WidgetRef ref) {
|
|
|
|
AppBar buildAppBar() {
|
|
|
|
return AppBar(
|
|
|
|
leading: IconButton(
|
2024-05-14 19:07:31 +00:00
|
|
|
onPressed: () => context.maybePop(),
|
2023-02-05 03:25:11 +00:00
|
|
|
icon: const Icon(Icons.arrow_back_ios_rounded),
|
|
|
|
),
|
|
|
|
centerTitle: true,
|
|
|
|
automaticallyImplyLeading: false,
|
|
|
|
title: const Text(
|
|
|
|
'favorites_page_title',
|
|
|
|
).tr(),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
return Scaffold(
|
2023-12-07 15:38:22 +00:00
|
|
|
appBar: ref.watch(multiselectProvider) ? null : buildAppBar(),
|
|
|
|
body: MultiselectGrid(
|
|
|
|
renderListProvider: favoriteAssetsProvider,
|
|
|
|
favoriteEnabled: true,
|
|
|
|
editEnabled: true,
|
|
|
|
unfavorite: true,
|
|
|
|
),
|
2023-02-05 03:25:11 +00:00
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|