remove sheet zoom in

This commit is contained in:
mertalev 2025-08-07 15:34:13 -04:00
parent a896c5a4dd
commit a25f14e1b9
No known key found for this signature in database
GPG key ID: DF6ABC77AAD98C95

View file

@ -226,10 +226,10 @@ class _AssetViewerState extends ConsumerState<AssetViewer> {
// 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,8 +429,8 @@ 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(
context: ctx, context: ctx,
@ -449,8 +449,8 @@ class _AssetViewerState extends ConsumerState<AssetViewer> {
} }
void _handleSheetClose() { void _handleSheetClose() {
viewController?.animateMultiple(position: Offset.zero); // viewController?.animateMultiple(position: Offset.zero);
viewController?.updateMultiple(scale: initialScale); // viewController?.updateMultiple(scale: initialScale);
ref.read(assetViewerProvider.notifier).setBottomSheet(false); ref.read(assetViewerProvider.notifier).setBottomSheet(false);
sheetCloseController = null; sheetCloseController = null;
shouldPopOnDrag = false; shouldPopOnDrag = false;
@ -515,8 +515,8 @@ class _AssetViewerState extends ConsumerState<AssetViewer> {
heroAttributes: PhotoViewHeroAttributes(tag: '${asset.heroTag}_$heroOffset'), heroAttributes: PhotoViewHeroAttributes(tag: '${asset.heroTag}_$heroOffset'),
filterQuality: FilterQuality.high, filterQuality: FilterQuality.high,
tightMode: true, tightMode: true,
initialScale: PhotoViewComputedScale.contained * 0.999, initialScale: PhotoViewComputedScale.contained,
minScale: PhotoViewComputedScale.contained * 0.999, minScale: PhotoViewComputedScale.contained,
disableScaleGestures: showingBottomSheet, disableScaleGestures: showingBottomSheet,
onDragStart: _onDragStart, onDragStart: _onDragStart,
onDragUpdate: _onDragUpdate, onDragUpdate: _onDragUpdate,
@ -545,9 +545,9 @@ class _AssetViewerState extends ConsumerState<AssetViewer> {
onTapDown: _onTapDown, onTapDown: _onTapDown,
heroAttributes: PhotoViewHeroAttributes(tag: '${asset.heroTag}_$heroOffset'), heroAttributes: PhotoViewHeroAttributes(tag: '${asset.heroTag}_$heroOffset'),
filterQuality: FilterQuality.high, filterQuality: FilterQuality.high,
initialScale: PhotoViewComputedScale.contained * 0.99, initialScale: PhotoViewComputedScale.contained,
maxScale: 1.0, maxScale: 1.0,
minScale: PhotoViewComputedScale.contained * 0.99, minScale: PhotoViewComputedScale.contained,
basePosition: Alignment.center, basePosition: Alignment.center,
child: SizedBox( child: SizedBox(
width: ctx.width, width: ctx.width,