fix: auto scaling after image is fully loaded after double tapping twice
This commit is contained in:
parent
a9631c09c8
commit
f14b499ffe
1 changed files with 4 additions and 0 deletions
|
@ -54,6 +54,7 @@ class _ZoomableImageState extends State<ZoomableImage>
|
|||
ValueChanged<PhotoViewScaleState>? _scaleStateChangedCallback;
|
||||
bool _isZooming = false;
|
||||
PhotoViewController _photoViewController = PhotoViewController();
|
||||
late PhotoViewScaleStateController _scaleStateController;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
|
@ -68,6 +69,7 @@ class _ZoomableImageState extends State<ZoomableImage>
|
|||
debugPrint("isZooming = $_isZooming, currentState $value");
|
||||
// _logger.info('is reakky zooming $_isZooming with state $value');
|
||||
};
|
||||
_scaleStateController = PhotoViewScaleStateController();
|
||||
super.initState();
|
||||
}
|
||||
|
||||
|
@ -92,6 +94,7 @@ class _ZoomableImageState extends State<ZoomableImage>
|
|||
child: PhotoView(
|
||||
imageProvider: _imageProvider,
|
||||
controller: _photoViewController,
|
||||
scaleStateController: _scaleStateController,
|
||||
scaleStateChangedCallback: _scaleStateChangedCallback,
|
||||
minScale: widget.shouldCover
|
||||
? PhotoViewComputedScale.covered
|
||||
|
@ -281,6 +284,7 @@ class _ZoomableImageState extends State<ZoomableImage>
|
|||
initialPosition: newPosition,
|
||||
initialScale: scale,
|
||||
);
|
||||
_scaleStateController.scaleState = PhotoViewScaleState.zoomedIn;
|
||||
}
|
||||
final bool canUpdateMetadata = _photo.canEditMetaInfo;
|
||||
// forcefully get finalImageInfo is dimensions are not available in metadata
|
||||
|
|
Loading…
Reference in a new issue