Signed-off-by: dom <githubaccount56556@proton.me>
This commit is contained in:
dom
2026-02-07 11:02:42 +08:00
parent e8145ef65a
commit d253ef468b
6 changed files with 43 additions and 38 deletions

View File

@@ -75,6 +75,17 @@ class InteractiveViewerBoundaryState extends State<InteractiveViewerBoundary>
);
_updateMoveAnimation();
_scaleAnimation = _animateController.drive(
Tween<double>(begin: 1.0, end: 0.25),
);
_opacityAnimation = _animateController.drive(
DecorationTween(
begin: const BoxDecoration(color: Colors.black),
end: const BoxDecoration(color: Colors.transparent),
),
);
}
@override
@@ -86,31 +97,12 @@ class InteractiveViewerBoundaryState extends State<InteractiveViewerBoundary>
void _updateMoveAnimation() {
final double endX = _offset.dx.sign * (_offset.dx.abs() / _offset.dy.abs());
final double endY = _offset.dy.sign;
_slideAnimation = _animateController.drive(
Tween<Offset>(
begin: Offset.zero,
end: Offset(endX, endY),
),
);
_scaleAnimation = _animateController.drive(
Tween<double>(
begin: 1.0,
end: 0.25,
),
);
_opacityAnimation = _animateController.drive(
DecorationTween(
begin: const BoxDecoration(
color: Colors.black,
),
end: const BoxDecoration(
color: Colors.transparent,
),
),
);
}
void _handleDragStart(ScaleStartDetails details) {