|
@@ -8,11 +8,13 @@ import 'package:flutter/services.dart';
|
|
import 'package:flutter_hooks/flutter_hooks.dart' hide Store;
|
|
import 'package:flutter_hooks/flutter_hooks.dart' hide Store;
|
|
import 'package:fluttertoast/fluttertoast.dart';
|
|
import 'package:fluttertoast/fluttertoast.dart';
|
|
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
|
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
|
|
|
+import 'package:immich_mobile/modules/asset_viewer/providers/asset_stack.provider.dart';
|
|
import 'package:immich_mobile/modules/asset_viewer/providers/show_controls.provider.dart';
|
|
import 'package:immich_mobile/modules/asset_viewer/providers/show_controls.provider.dart';
|
|
import 'package:immich_mobile/modules/asset_viewer/providers/video_player_controls_provider.dart';
|
|
import 'package:immich_mobile/modules/asset_viewer/providers/video_player_controls_provider.dart';
|
|
import 'package:immich_mobile/modules/album/ui/add_to_album_bottom_sheet.dart';
|
|
import 'package:immich_mobile/modules/album/ui/add_to_album_bottom_sheet.dart';
|
|
import 'package:immich_mobile/modules/asset_viewer/providers/image_viewer_page_state.provider.dart';
|
|
import 'package:immich_mobile/modules/asset_viewer/providers/image_viewer_page_state.provider.dart';
|
|
import 'package:immich_mobile/modules/asset_viewer/providers/video_player_value_provider.dart';
|
|
import 'package:immich_mobile/modules/asset_viewer/providers/video_player_value_provider.dart';
|
|
|
|
+import 'package:immich_mobile/modules/asset_viewer/services/asset_stack.service.dart';
|
|
import 'package:immich_mobile/modules/asset_viewer/ui/advanced_bottom_sheet.dart';
|
|
import 'package:immich_mobile/modules/asset_viewer/ui/advanced_bottom_sheet.dart';
|
|
import 'package:immich_mobile/modules/asset_viewer/ui/exif_bottom_sheet.dart';
|
|
import 'package:immich_mobile/modules/asset_viewer/ui/exif_bottom_sheet.dart';
|
|
import 'package:immich_mobile/modules/asset_viewer/ui/top_control_app_bar.dart';
|
|
import 'package:immich_mobile/modules/asset_viewer/ui/top_control_app_bar.dart';
|
|
@@ -44,6 +46,7 @@ class GalleryViewerPage extends HookConsumerWidget {
|
|
final int totalAssets;
|
|
final int totalAssets;
|
|
final int initialIndex;
|
|
final int initialIndex;
|
|
final int heroOffset;
|
|
final int heroOffset;
|
|
|
|
+ final bool showStack;
|
|
|
|
|
|
GalleryViewerPage({
|
|
GalleryViewerPage({
|
|
super.key,
|
|
super.key,
|
|
@@ -51,6 +54,7 @@ class GalleryViewerPage extends HookConsumerWidget {
|
|
required this.loadAsset,
|
|
required this.loadAsset,
|
|
required this.totalAssets,
|
|
required this.totalAssets,
|
|
this.heroOffset = 0,
|
|
this.heroOffset = 0,
|
|
|
|
+ this.showStack = false,
|
|
}) : controller = PageController(initialPage: initialIndex);
|
|
}) : controller = PageController(initialPage: initialIndex);
|
|
|
|
|
|
final PageController controller;
|
|
final PageController controller;
|
|
@@ -77,8 +81,17 @@ class GalleryViewerPage extends HookConsumerWidget {
|
|
final isFromTrash = isTrashEnabled &&
|
|
final isFromTrash = isTrashEnabled &&
|
|
navStack.length > 2 &&
|
|
navStack.length > 2 &&
|
|
navStack.elementAt(navStack.length - 2).name == TrashRoute.name;
|
|
navStack.elementAt(navStack.length - 2).name == TrashRoute.name;
|
|
|
|
+ final stackIndex = useState(-1);
|
|
|
|
+ final stack = showStack && currentAsset.stackCount > 0
|
|
|
|
+ ? ref.watch(assetStackStateProvider(currentAsset))
|
|
|
|
+ : <Asset>[];
|
|
|
|
+ final stackElements = showStack ? [currentAsset, ...stack] : <Asset>[];
|
|
|
|
|
|
- Asset asset() => currentAsset;
|
|
|
|
|
|
+ Asset asset() => stackIndex.value == -1
|
|
|
|
+ ? currentAsset
|
|
|
|
+ : stackElements.elementAt(stackIndex.value);
|
|
|
|
+
|
|
|
|
+ bool isParent = stackIndex.value == -1 || stackIndex.value == 0;
|
|
|
|
|
|
useEffect(
|
|
useEffect(
|
|
() {
|
|
() {
|
|
@@ -165,19 +178,28 @@ class GalleryViewerPage extends HookConsumerWidget {
|
|
padding: EdgeInsets.only(
|
|
padding: EdgeInsets.only(
|
|
bottom: MediaQuery.of(context).viewInsets.bottom,
|
|
bottom: MediaQuery.of(context).viewInsets.bottom,
|
|
),
|
|
),
|
|
- child: ExifBottomSheet(asset: currentAsset),
|
|
|
|
|
|
+ child: ExifBottomSheet(asset: asset()),
|
|
);
|
|
);
|
|
},
|
|
},
|
|
);
|
|
);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ void removeAssetFromStack() {
|
|
|
|
+ if (stackIndex.value > 0 && showStack) {
|
|
|
|
+ ref
|
|
|
|
+ .read(assetStackStateProvider(currentAsset).notifier)
|
|
|
|
+ .removeChild(stackIndex.value - 1);
|
|
|
|
+ stackIndex.value = stackIndex.value - 1;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
void handleDelete(Asset deleteAsset) async {
|
|
void handleDelete(Asset deleteAsset) async {
|
|
Future<bool> onDelete(bool force) async {
|
|
Future<bool> onDelete(bool force) async {
|
|
final isDeleted = await ref.read(assetProvider.notifier).deleteAssets(
|
|
final isDeleted = await ref.read(assetProvider.notifier).deleteAssets(
|
|
{deleteAsset},
|
|
{deleteAsset},
|
|
force: force,
|
|
force: force,
|
|
);
|
|
);
|
|
- if (isDeleted) {
|
|
|
|
|
|
+ if (isDeleted && isParent) {
|
|
if (totalAssets == 1) {
|
|
if (totalAssets == 1) {
|
|
// Handle only one asset
|
|
// Handle only one asset
|
|
AutoRouter.of(context).pop();
|
|
AutoRouter.of(context).pop();
|
|
@@ -195,14 +217,17 @@ class GalleryViewerPage extends HookConsumerWidget {
|
|
// Asset is trashed
|
|
// Asset is trashed
|
|
if (isTrashEnabled && !isFromTrash) {
|
|
if (isTrashEnabled && !isFromTrash) {
|
|
final isDeleted = await onDelete(false);
|
|
final isDeleted = await onDelete(false);
|
|
- // Can only trash assets stored in server. Local assets are always permanently removed for now
|
|
|
|
- if (context.mounted && isDeleted && deleteAsset.isRemote) {
|
|
|
|
- ImmichToast.show(
|
|
|
|
- durationInSecond: 1,
|
|
|
|
- context: context,
|
|
|
|
- msg: 'Asset trashed',
|
|
|
|
- gravity: ToastGravity.BOTTOM,
|
|
|
|
- );
|
|
|
|
|
|
+ if (isDeleted) {
|
|
|
|
+ // Can only trash assets stored in server. Local assets are always permanently removed for now
|
|
|
|
+ if (context.mounted && deleteAsset.isRemote && isParent) {
|
|
|
|
+ ImmichToast.show(
|
|
|
|
+ durationInSecond: 1,
|
|
|
|
+ context: context,
|
|
|
|
+ msg: 'Asset trashed',
|
|
|
|
+ gravity: ToastGravity.BOTTOM,
|
|
|
|
+ );
|
|
|
|
+ }
|
|
|
|
+ removeAssetFromStack();
|
|
}
|
|
}
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
@@ -211,7 +236,14 @@ class GalleryViewerPage extends HookConsumerWidget {
|
|
showDialog(
|
|
showDialog(
|
|
context: context,
|
|
context: context,
|
|
builder: (BuildContext _) {
|
|
builder: (BuildContext _) {
|
|
- return DeleteDialog(onDelete: () => onDelete(true));
|
|
|
|
|
|
+ return DeleteDialog(
|
|
|
|
+ onDelete: () async {
|
|
|
|
+ final isDeleted = await onDelete(true);
|
|
|
|
+ if (isDeleted) {
|
|
|
|
+ removeAssetFromStack();
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ );
|
|
},
|
|
},
|
|
);
|
|
);
|
|
}
|
|
}
|
|
@@ -268,7 +300,11 @@ class GalleryViewerPage extends HookConsumerWidget {
|
|
ref
|
|
ref
|
|
.watch(assetProvider.notifier)
|
|
.watch(assetProvider.notifier)
|
|
.toggleArchive([asset], !asset.isArchived);
|
|
.toggleArchive([asset], !asset.isArchived);
|
|
- AutoRouter.of(context).pop();
|
|
|
|
|
|
+ if (isParent) {
|
|
|
|
+ AutoRouter.of(context).pop();
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ removeAssetFromStack();
|
|
}
|
|
}
|
|
|
|
|
|
handleUpload(Asset asset) {
|
|
handleUpload(Asset asset) {
|
|
@@ -385,7 +421,186 @@ class GalleryViewerPage extends HookConsumerWidget {
|
|
);
|
|
);
|
|
}
|
|
}
|
|
|
|
|
|
- buildBottomBar() {
|
|
|
|
|
|
+ Widget buildStackedChildren() {
|
|
|
|
+ return ListView.builder(
|
|
|
|
+ shrinkWrap: true,
|
|
|
|
+ scrollDirection: Axis.horizontal,
|
|
|
|
+ itemCount: stackElements.length,
|
|
|
|
+ itemBuilder: (context, index) {
|
|
|
|
+ final assetId = stackElements.elementAt(index).remoteId;
|
|
|
|
+ return Padding(
|
|
|
|
+ padding: const EdgeInsets.only(right: 10),
|
|
|
|
+ child: GestureDetector(
|
|
|
|
+ onTap: () => stackIndex.value = index,
|
|
|
|
+ child: Container(
|
|
|
|
+ width: 40,
|
|
|
|
+ decoration: BoxDecoration(
|
|
|
|
+ color: Colors.white,
|
|
|
|
+ borderRadius: BorderRadius.circular(6),
|
|
|
|
+ border: index == stackIndex.value
|
|
|
|
+ ? Border.all(
|
|
|
|
+ color: Colors.white,
|
|
|
|
+ width: 2,
|
|
|
|
+ )
|
|
|
|
+ : null,
|
|
|
|
+ ),
|
|
|
|
+ child: ClipRRect(
|
|
|
|
+ borderRadius: BorderRadius.circular(4),
|
|
|
|
+ child: CachedNetworkImage(
|
|
|
|
+ fit: BoxFit.cover,
|
|
|
|
+ imageUrl:
|
|
|
|
+ '${Store.get(StoreKey.serverEndpoint)}/asset/thumbnail/$assetId',
|
|
|
|
+ httpHeaders: {
|
|
|
|
+ "Authorization":
|
|
|
|
+ "Bearer ${Store.get(StoreKey.accessToken)}",
|
|
|
|
+ },
|
|
|
|
+ errorWidget: (context, url, error) =>
|
|
|
|
+ const Icon(Icons.image_not_supported_outlined),
|
|
|
|
+ ),
|
|
|
|
+ ),
|
|
|
|
+ ),
|
|
|
|
+ ),
|
|
|
|
+ );
|
|
|
|
+ },
|
|
|
|
+ );
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ void showStackActionItems() {
|
|
|
|
+ showModalBottomSheet<void>(
|
|
|
|
+ context: context,
|
|
|
|
+ enableDrag: false,
|
|
|
|
+ builder: (BuildContext ctx) {
|
|
|
|
+ return SafeArea(
|
|
|
|
+ child: Padding(
|
|
|
|
+ padding: const EdgeInsets.only(top: 24.0),
|
|
|
|
+ child: Column(
|
|
|
|
+ mainAxisSize: MainAxisSize.min,
|
|
|
|
+ children: [
|
|
|
|
+ if (!isParent)
|
|
|
|
+ ListTile(
|
|
|
|
+ leading: const Icon(
|
|
|
|
+ Icons.bookmark_border_outlined,
|
|
|
|
+ size: 24,
|
|
|
|
+ ),
|
|
|
|
+ onTap: () async {
|
|
|
|
+ await ref
|
|
|
|
+ .read(assetStackServiceProvider)
|
|
|
|
+ .updateStackParent(
|
|
|
|
+ currentAsset,
|
|
|
|
+ stackElements.elementAt(stackIndex.value),
|
|
|
|
+ );
|
|
|
|
+ Navigator.pop(ctx);
|
|
|
|
+ AutoRouter.of(context).pop();
|
|
|
|
+ },
|
|
|
|
+ title: const Text(
|
|
|
|
+ "viewer_stack_use_as_main_asset",
|
|
|
|
+ style: TextStyle(fontWeight: FontWeight.bold),
|
|
|
|
+ ).tr(),
|
|
|
|
+ ),
|
|
|
|
+ ListTile(
|
|
|
|
+ leading: const Icon(
|
|
|
|
+ Icons.copy_all_outlined,
|
|
|
|
+ size: 24,
|
|
|
|
+ ),
|
|
|
|
+ onTap: () async {
|
|
|
|
+ if (isParent) {
|
|
|
|
+ await ref
|
|
|
|
+ .read(assetStackServiceProvider)
|
|
|
|
+ .updateStackParent(
|
|
|
|
+ currentAsset,
|
|
|
|
+ stackElements
|
|
|
|
+ .elementAt(1), // Next asset as parent
|
|
|
|
+ );
|
|
|
|
+ // Remove itself from stack
|
|
|
|
+ await ref.read(assetStackServiceProvider).updateStack(
|
|
|
|
+ stackElements.elementAt(1),
|
|
|
|
+ childrenToRemove: [currentAsset],
|
|
|
|
+ );
|
|
|
|
+ Navigator.pop(ctx);
|
|
|
|
+ AutoRouter.of(context).pop();
|
|
|
|
+ } else {
|
|
|
|
+ await ref.read(assetStackServiceProvider).updateStack(
|
|
|
|
+ currentAsset,
|
|
|
|
+ childrenToRemove: [
|
|
|
|
+ stackElements.elementAt(stackIndex.value),
|
|
|
|
+ ],
|
|
|
|
+ );
|
|
|
|
+ removeAssetFromStack();
|
|
|
|
+ Navigator.pop(ctx);
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ title: const Text(
|
|
|
|
+ "viewer_remove_from_stack",
|
|
|
|
+ style: TextStyle(fontWeight: FontWeight.bold),
|
|
|
|
+ ).tr(),
|
|
|
|
+ ),
|
|
|
|
+ ListTile(
|
|
|
|
+ leading: const Icon(
|
|
|
|
+ Icons.filter_none_outlined,
|
|
|
|
+ size: 18,
|
|
|
|
+ ),
|
|
|
|
+ onTap: () async {
|
|
|
|
+ await ref.read(assetStackServiceProvider).updateStack(
|
|
|
|
+ currentAsset,
|
|
|
|
+ childrenToRemove: stack,
|
|
|
|
+ );
|
|
|
|
+ Navigator.pop(ctx);
|
|
|
|
+ AutoRouter.of(context).pop();
|
|
|
|
+ },
|
|
|
|
+ title: const Text(
|
|
|
|
+ "viewer_unstack",
|
|
|
|
+ style: TextStyle(fontWeight: FontWeight.bold),
|
|
|
|
+ ).tr(),
|
|
|
|
+ ),
|
|
|
|
+ ],
|
|
|
|
+ ),
|
|
|
|
+ ),
|
|
|
|
+ );
|
|
|
|
+ },
|
|
|
|
+ );
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ Widget buildBottomBar() {
|
|
|
|
+ // !!!! itemsList and actionlist should always be in sync
|
|
|
|
+ final itemsList = [
|
|
|
|
+ BottomNavigationBarItem(
|
|
|
|
+ icon: Icon(
|
|
|
|
+ Platform.isAndroid ? Icons.share_rounded : Icons.ios_share_rounded,
|
|
|
|
+ ),
|
|
|
|
+ label: 'control_bottom_app_bar_share'.tr(),
|
|
|
|
+ tooltip: 'control_bottom_app_bar_share'.tr(),
|
|
|
|
+ ),
|
|
|
|
+ asset().isArchived
|
|
|
|
+ ? BottomNavigationBarItem(
|
|
|
|
+ icon: const Icon(Icons.unarchive_rounded),
|
|
|
|
+ label: 'control_bottom_app_bar_unarchive'.tr(),
|
|
|
|
+ tooltip: 'control_bottom_app_bar_unarchive'.tr(),
|
|
|
|
+ )
|
|
|
|
+ : BottomNavigationBarItem(
|
|
|
|
+ icon: const Icon(Icons.archive_outlined),
|
|
|
|
+ label: 'control_bottom_app_bar_archive'.tr(),
|
|
|
|
+ tooltip: 'control_bottom_app_bar_archive'.tr(),
|
|
|
|
+ ),
|
|
|
|
+ if (stack.isNotEmpty)
|
|
|
|
+ BottomNavigationBarItem(
|
|
|
|
+ icon: const Icon(Icons.burst_mode_outlined),
|
|
|
|
+ label: 'control_bottom_app_bar_stack'.tr(),
|
|
|
|
+ tooltip: 'control_bottom_app_bar_stack'.tr(),
|
|
|
|
+ ),
|
|
|
|
+ BottomNavigationBarItem(
|
|
|
|
+ icon: const Icon(Icons.delete_outline),
|
|
|
|
+ label: 'control_bottom_app_bar_delete'.tr(),
|
|
|
|
+ tooltip: 'control_bottom_app_bar_delete'.tr(),
|
|
|
|
+ ),
|
|
|
|
+ ];
|
|
|
|
+
|
|
|
|
+ List<Function(int)> actionslist = [
|
|
|
|
+ (_) => shareAsset(),
|
|
|
|
+ (_) => handleArchive(asset()),
|
|
|
|
+ if (stack.isNotEmpty) (_) => showStackActionItems(),
|
|
|
|
+ (_) => handleDelete(asset()),
|
|
|
|
+ ];
|
|
|
|
+
|
|
return IgnorePointer(
|
|
return IgnorePointer(
|
|
ignoring: !ref.watch(showControlsProvider),
|
|
ignoring: !ref.watch(showControlsProvider),
|
|
child: AnimatedOpacity(
|
|
child: AnimatedOpacity(
|
|
@@ -393,6 +608,17 @@ class GalleryViewerPage extends HookConsumerWidget {
|
|
opacity: ref.watch(showControlsProvider) ? 1.0 : 0.0,
|
|
opacity: ref.watch(showControlsProvider) ? 1.0 : 0.0,
|
|
child: Column(
|
|
child: Column(
|
|
children: [
|
|
children: [
|
|
|
|
+ if (stack.isNotEmpty)
|
|
|
|
+ Padding(
|
|
|
|
+ padding: const EdgeInsets.only(
|
|
|
|
+ left: 10,
|
|
|
|
+ bottom: 30,
|
|
|
|
+ ),
|
|
|
|
+ child: SizedBox(
|
|
|
|
+ height: 40,
|
|
|
|
+ child: buildStackedChildren(),
|
|
|
|
+ ),
|
|
|
|
+ ),
|
|
Visibility(
|
|
Visibility(
|
|
visible: !asset().isImage && !isPlayingMotionVideo.value,
|
|
visible: !asset().isImage && !isPlayingMotionVideo.value,
|
|
child: Container(
|
|
child: Container(
|
|
@@ -421,44 +647,10 @@ class GalleryViewerPage extends HookConsumerWidget {
|
|
selectedLabelStyle: const TextStyle(color: Colors.black),
|
|
selectedLabelStyle: const TextStyle(color: Colors.black),
|
|
showSelectedLabels: false,
|
|
showSelectedLabels: false,
|
|
showUnselectedLabels: false,
|
|
showUnselectedLabels: false,
|
|
- items: [
|
|
|
|
- BottomNavigationBarItem(
|
|
|
|
- icon: Icon(
|
|
|
|
- Platform.isAndroid
|
|
|
|
- ? Icons.share_rounded
|
|
|
|
- : Icons.ios_share_rounded,
|
|
|
|
- ),
|
|
|
|
- label: 'control_bottom_app_bar_share'.tr(),
|
|
|
|
- tooltip: 'control_bottom_app_bar_share'.tr(),
|
|
|
|
- ),
|
|
|
|
- asset().isArchived
|
|
|
|
- ? BottomNavigationBarItem(
|
|
|
|
- icon: const Icon(Icons.unarchive_rounded),
|
|
|
|
- label: 'control_bottom_app_bar_unarchive'.tr(),
|
|
|
|
- tooltip: 'control_bottom_app_bar_unarchive'.tr(),
|
|
|
|
- )
|
|
|
|
- : BottomNavigationBarItem(
|
|
|
|
- icon: const Icon(Icons.archive_outlined),
|
|
|
|
- label: 'control_bottom_app_bar_archive'.tr(),
|
|
|
|
- tooltip: 'control_bottom_app_bar_archive'.tr(),
|
|
|
|
- ),
|
|
|
|
- BottomNavigationBarItem(
|
|
|
|
- icon: const Icon(Icons.delete_outline),
|
|
|
|
- label: 'control_bottom_app_bar_delete'.tr(),
|
|
|
|
- tooltip: 'control_bottom_app_bar_delete'.tr(),
|
|
|
|
- ),
|
|
|
|
- ],
|
|
|
|
|
|
+ items: itemsList,
|
|
onTap: (index) {
|
|
onTap: (index) {
|
|
- switch (index) {
|
|
|
|
- case 0:
|
|
|
|
- shareAsset();
|
|
|
|
- break;
|
|
|
|
- case 1:
|
|
|
|
- handleArchive(asset());
|
|
|
|
- break;
|
|
|
|
- case 2:
|
|
|
|
- handleDelete(asset());
|
|
|
|
- break;
|
|
|
|
|
|
+ if (index < actionslist.length) {
|
|
|
|
+ actionslist[index].call(index);
|
|
}
|
|
}
|
|
},
|
|
},
|
|
),
|
|
),
|
|
@@ -504,6 +696,7 @@ class GalleryViewerPage extends HookConsumerWidget {
|
|
final next = currentIndex.value < value ? value + 1 : value - 1;
|
|
final next = currentIndex.value < value ? value + 1 : value - 1;
|
|
precacheNextImage(next);
|
|
precacheNextImage(next);
|
|
currentIndex.value = value;
|
|
currentIndex.value = value;
|
|
|
|
+ stackIndex.value = -1;
|
|
HapticFeedback.selectionClick();
|
|
HapticFeedback.selectionClick();
|
|
},
|
|
},
|
|
loadingBuilder: (context, event, index) {
|
|
loadingBuilder: (context, event, index) {
|
|
@@ -544,10 +737,11 @@ class GalleryViewerPage extends HookConsumerWidget {
|
|
: webPThumbnail;
|
|
: webPThumbnail;
|
|
},
|
|
},
|
|
builder: (context, index) {
|
|
builder: (context, index) {
|
|
- final asset = loadAsset(index);
|
|
|
|
- final ImageProvider provider = finalImageProvider(asset);
|
|
|
|
|
|
+ final a =
|
|
|
|
+ index == currentIndex.value ? asset() : loadAsset(index);
|
|
|
|
+ final ImageProvider provider = finalImageProvider(a);
|
|
|
|
|
|
- if (asset.isImage && !isPlayingMotionVideo.value) {
|
|
|
|
|
|
+ if (a.isImage && !isPlayingMotionVideo.value) {
|
|
return PhotoViewGalleryPageOptions(
|
|
return PhotoViewGalleryPageOptions(
|
|
onDragStart: (_, details, __) =>
|
|
onDragStart: (_, details, __) =>
|
|
localPosition = details.localPosition,
|
|
localPosition = details.localPosition,
|
|
@@ -558,13 +752,13 @@ class GalleryViewerPage extends HookConsumerWidget {
|
|
},
|
|
},
|
|
imageProvider: provider,
|
|
imageProvider: provider,
|
|
heroAttributes: PhotoViewHeroAttributes(
|
|
heroAttributes: PhotoViewHeroAttributes(
|
|
- tag: asset.id + heroOffset,
|
|
|
|
|
|
+ tag: a.id + heroOffset,
|
|
),
|
|
),
|
|
filterQuality: FilterQuality.high,
|
|
filterQuality: FilterQuality.high,
|
|
tightMode: true,
|
|
tightMode: true,
|
|
minScale: PhotoViewComputedScale.contained,
|
|
minScale: PhotoViewComputedScale.contained,
|
|
errorBuilder: (context, error, stackTrace) => ImmichImage(
|
|
errorBuilder: (context, error, stackTrace) => ImmichImage(
|
|
- asset,
|
|
|
|
|
|
+ a,
|
|
fit: BoxFit.contain,
|
|
fit: BoxFit.contain,
|
|
),
|
|
),
|
|
);
|
|
);
|
|
@@ -575,7 +769,7 @@ class GalleryViewerPage extends HookConsumerWidget {
|
|
onDragUpdate: (_, details, __) =>
|
|
onDragUpdate: (_, details, __) =>
|
|
handleSwipeUpDown(details),
|
|
handleSwipeUpDown(details),
|
|
heroAttributes: PhotoViewHeroAttributes(
|
|
heroAttributes: PhotoViewHeroAttributes(
|
|
- tag: asset.id + heroOffset,
|
|
|
|
|
|
+ tag: a.id + heroOffset,
|
|
),
|
|
),
|
|
filterQuality: FilterQuality.high,
|
|
filterQuality: FilterQuality.high,
|
|
maxScale: 1.0,
|
|
maxScale: 1.0,
|
|
@@ -584,7 +778,7 @@ class GalleryViewerPage extends HookConsumerWidget {
|
|
child: VideoViewerPage(
|
|
child: VideoViewerPage(
|
|
onPlaying: () => isPlayingVideo.value = true,
|
|
onPlaying: () => isPlayingVideo.value = true,
|
|
onPaused: () => isPlayingVideo.value = false,
|
|
onPaused: () => isPlayingVideo.value = false,
|
|
- asset: asset,
|
|
|
|
|
|
+ asset: a,
|
|
isMotionVideo: isPlayingMotionVideo.value,
|
|
isMotionVideo: isPlayingMotionVideo.value,
|
|
placeholder: Image(
|
|
placeholder: Image(
|
|
image: provider,
|
|
image: provider,
|