Skip to content

Commit

Permalink
Flutter Update: 2.10.0 - Fix: Looking up a deactivated widget's ances…
Browse files Browse the repository at this point in the history
…tor is unsafe fix (bluefireteam#499)

* Looking up a deactivated widget's ancestor is unsafe fix

* fixed assignment

Co-authored-by: André <andre.boerger@alte-leipziger.de>
  • Loading branch information
2 people authored and T-moz committed Apr 22, 2022
1 parent f9f5574 commit 5b8ff96
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions lib/src/core/photo_view_core.dart
Original file line number Diff line number Diff line change
Expand Up @@ -108,14 +108,10 @@ class PhotoViewCoreState extends State<PhotoViewCore>
double? _scaleBefore;
double? _rotationBefore;

late final AnimationController _scaleAnimationController =
AnimationController(vsync: this)
..addListener(handleScaleAnimation)
..addStatusListener(onAnimationStatus);
late final AnimationController _scaleAnimationController;
Animation<double>? _scaleAnimation;

late final AnimationController _positionAnimationController =
AnimationController(vsync: this)..addListener(handlePositionAnimate);
late final AnimationController _positionAnimationController;
Animation<Offset>? _positionAnimation;

late final AnimationController _rotationAnimationController =
Expand Down Expand Up @@ -261,6 +257,12 @@ class PhotoViewCoreState extends State<PhotoViewCore>
addAnimateOnScaleStateUpdate(animateOnScaleStateUpdate);

cachedScaleBoundaries = widget.scaleBoundaries;

_scaleAnimationController = AnimationController(vsync: this)
..addListener(handleScaleAnimation)
..addStatusListener(onAnimationStatus);
_positionAnimationController = AnimationController(vsync: this)
..addListener(handlePositionAnimate);
}

void animateOnScaleStateUpdate(double prevScale, double nextScale) {
Expand Down

0 comments on commit 5b8ff96

Please sign in to comment.