mirror of
https://github.com/immich-app/immich
synced 2025-11-07 17:27:20 +00:00
re-assign initial state on page change
This commit is contained in:
parent
a25f14e1b9
commit
dfd9ed988e
1 changed files with 6 additions and 5 deletions
|
|
@ -223,13 +223,14 @@ class _AssetViewerState extends ConsumerState<AssetViewer> {
|
||||||
void _onPageChanged(int index, PhotoViewControllerBase? controller) {
|
void _onPageChanged(int index, PhotoViewControllerBase? controller) {
|
||||||
_onAssetChanged(index);
|
_onAssetChanged(index);
|
||||||
viewController = controller;
|
viewController = controller;
|
||||||
|
initialPhotoViewState = controller?.value ?? initialPhotoViewState;
|
||||||
|
|
||||||
// If the bottom sheet is showing, we need to adjust scale the asset to
|
// If the bottom sheet is showing, we need to adjust scale the asset to
|
||||||
// emulate the zoom effect
|
// emulate the zoom effect
|
||||||
// if (showingBottomSheet) {
|
if (showingBottomSheet) {
|
||||||
// initialScale = controller?.scale;
|
initialScale = controller?.scale;
|
||||||
// controller?.scale = _getScaleForBottomSheet;
|
// controller?.scale = _getScaleForBottomSheet;
|
||||||
// }
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void _onDragStart(
|
void _onDragStart(
|
||||||
|
|
@ -429,7 +430,7 @@ class _AssetViewerState extends ConsumerState<AssetViewer> {
|
||||||
|
|
||||||
void _openBottomSheet(BuildContext ctx, {double extent = _kBottomSheetMinimumExtent}) {
|
void _openBottomSheet(BuildContext ctx, {double extent = _kBottomSheetMinimumExtent}) {
|
||||||
ref.read(assetViewerProvider.notifier).setBottomSheet(true);
|
ref.read(assetViewerProvider.notifier).setBottomSheet(true);
|
||||||
// initialScale = viewController?.scale;
|
initialScale = viewController?.scale;
|
||||||
// viewController?.updateMultiple(scale: _getScaleForBottomSheet);
|
// viewController?.updateMultiple(scale: _getScaleForBottomSheet);
|
||||||
previousExtent = _kBottomSheetMinimumExtent;
|
previousExtent = _kBottomSheetMinimumExtent;
|
||||||
sheetCloseController = showBottomSheet(
|
sheetCloseController = showBottomSheet(
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue