mirror of
https://github.com/immich-app/immich
synced 2025-11-07 17:27:20 +00:00
Enable swiping between assets (#381)
Enable swiping between assets (#381) Co-authored-by: Alex <alex.tran1502@gmail.com> Co-authored-by: Malte Kiefer <59220985+MalteKiefer@users.noreply.github.com> Co-authored-by: Matthias Rupp <matthias.rupp@posteo.de>
This commit is contained in:
parent
e8d1f89a47
commit
8c184dc4d4
17 changed files with 436 additions and 240 deletions
|
|
@ -13,8 +13,10 @@ import 'package:openapi/api.dart';
|
|||
|
||||
class ThumbnailImage extends HookConsumerWidget {
|
||||
final AssetResponseDto asset;
|
||||
final List<AssetResponseDto> assetList;
|
||||
|
||||
const ThumbnailImage({Key? key, required this.asset}) : super(key: key);
|
||||
const ThumbnailImage({Key? key, required this.asset, required this.assetList})
|
||||
: super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
|
|
@ -60,29 +62,17 @@ class ThumbnailImage extends HookConsumerWidget {
|
|||
.watch(homePageStateProvider.notifier)
|
||||
.addSingleSelectedItem(asset);
|
||||
} else {
|
||||
if (asset.type == AssetTypeEnum.IMAGE) {
|
||||
AutoRouter.of(context).push(
|
||||
ImageViewerRoute(
|
||||
imageUrl:
|
||||
'${box.get(serverEndpointKey)}/asset/file?aid=${asset.deviceAssetId}&did=${asset.deviceId}&isThumb=false',
|
||||
heroTag: asset.id,
|
||||
thumbnailUrl: thumbnailRequestUrl,
|
||||
asset: asset,
|
||||
),
|
||||
);
|
||||
} else {
|
||||
AutoRouter.of(context).push(
|
||||
VideoViewerRoute(
|
||||
videoUrl:
|
||||
'${box.get(serverEndpointKey)}/asset/file?aid=${asset.deviceAssetId}&did=${asset.deviceId}',
|
||||
asset: asset,
|
||||
),
|
||||
);
|
||||
}
|
||||
AutoRouter.of(context).push(
|
||||
GalleryViewerRoute(
|
||||
assetList: assetList,
|
||||
thumbnailRequestUrl: thumbnailRequestUrl,
|
||||
asset: asset,
|
||||
),
|
||||
);
|
||||
}
|
||||
},
|
||||
onLongPress: () {
|
||||
// Enable multi selecte function
|
||||
// Enable multi select function
|
||||
ref.watch(homePageStateProvider.notifier).enableMultiSelect({asset});
|
||||
HapticFeedback.heavyImpact();
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue