opt init recognizer

Signed-off-by: dom <githubaccount56556@proton.me>
This commit is contained in:
dom
2026-02-09 09:44:41 +08:00
parent 0cb07aef1c
commit 32cd3209d0
11 changed files with 28 additions and 27 deletions

View File

@@ -87,11 +87,7 @@ class _InteractiveviewerGalleryState extends State<InteractiveviewerGallery>
late final _tween = Matrix4Tween();
late final _animatable = _tween.chain(CurveTween(curve: Curves.easeOut));
late final _horizontalDragGestureRecognizer =
ImageHorizontalDragGestureRecognizer(
width: 0,
transformationController: _transformationController,
);
late final _horizontalDragGestureRecognizer;
late Offset _doubleTapLocalPosition;
@@ -111,6 +107,11 @@ class _InteractiveviewerGalleryState extends State<InteractiveviewerGallery>
_transformationController = TransformationController();
_horizontalDragGestureRecognizer = ImageHorizontalDragGestureRecognizer(
width: 0,
transformationController: _transformationController,
);
_animationController = AnimationController(
vsync: this,
duration: const Duration(milliseconds: 300),
@@ -246,7 +247,8 @@ class _InteractiveviewerGalleryState extends State<InteractiveviewerGallery>
: _itemBuilder(index, item),
);
},
horizontalDragGestureRecognizer: _horizontalDragGestureRecognizer,
horizontalDragGestureRecognizer: () =>
_horizontalDragGestureRecognizer,
),
),
Positioned(