mirror of
https://github.com/immich-app/immich
synced 2025-11-07 17:27:20 +00:00
Implemented delete asset on device and on database (#22)
* refactor serving file function asset service * Remove PhotoViewer for now since it creates a problem in 2.10 * Added error message for wrong decode file and logo for failed to load file * Fixed error when read stream cannot be created and crash server * Added method to get all assets as a raw array * Implemented cleaner way of grouping image * Implemented operation to delete assets in the database * Implemented delete on database operation * Implemented delete on device operation * Fixed issue display wrong information when the auto backup is enabled after deleting all assets
This commit is contained in:
parent
051c958c8b
commit
897d49f734
22 changed files with 518 additions and 10617 deletions
|
|
@ -1,10 +1,15 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
||||
import 'package:immich_mobile/modules/home/providers/asset.provider.dart';
|
||||
import 'package:immich_mobile/modules/home/providers/home_page_state.provider.dart';
|
||||
|
||||
class DeleteDialog extends StatelessWidget {
|
||||
class DeleteDialog extends ConsumerWidget {
|
||||
const DeleteDialog({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final homePageState = ref.watch(homePageStateProvider);
|
||||
|
||||
return AlertDialog(
|
||||
backgroundColor: Colors.grey[200],
|
||||
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(10)),
|
||||
|
|
@ -21,7 +26,12 @@ class DeleteDialog extends StatelessWidget {
|
|||
),
|
||||
),
|
||||
TextButton(
|
||||
onPressed: () {},
|
||||
onPressed: () {
|
||||
ref.watch(assetProvider.notifier).deleteAssets(homePageState.selectedItems);
|
||||
ref.watch(homePageStateProvider.notifier).disableMultiSelect();
|
||||
|
||||
Navigator.of(context).pop();
|
||||
},
|
||||
child: Text(
|
||||
"Delete",
|
||||
style: TextStyle(color: Colors.red[400]),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue