@@ -714,12 +714,13 @@ class _CupertinoDragGestureDetectorState<T> extends State<_CupertinoDragGestureD
714
714
_CupertinoDragGestureController <T >? _dragGestureController;
715
715
716
716
late VerticalDragGestureRecognizer _recognizer;
717
- _UpDragAnimationControllerProvider ? provider ;
717
+ _UpDragAnimationControllerProvider ? upDragController ;
718
718
719
719
@override
720
720
void initState () {
721
721
super .initState ();
722
- provider ?? = _UpDragAnimationControllerProvider .maybeOf (context);
722
+ assert (upDragController == null );
723
+ upDragController = _UpDragAnimationControllerProvider .maybeOf (context);
723
724
_recognizer =
724
725
VerticalDragGestureRecognizer (debugOwner: this )
725
726
..onStart = _handleDragStart
@@ -753,18 +754,15 @@ class _CupertinoDragGestureDetectorState<T> extends State<_CupertinoDragGestureD
753
754
void _handleDragUpdate (DragUpdateDetails details) {
754
755
assert (mounted);
755
756
assert (_dragGestureController != null );
756
- _dragGestureController! .dragUpdate (
757
- details.primaryDelta! ,
758
- provider! .controller,
759
- );
757
+ _dragGestureController! .dragUpdate (details.primaryDelta! , upDragController! .controller);
760
758
}
761
759
762
760
void _handleDragEnd (DragEndDetails details) {
763
761
assert (mounted);
764
762
assert (_dragGestureController != null );
765
763
_dragGestureController! .dragEnd (
766
764
details.velocity.pixelsPerSecond.dy / context.size! .height,
767
- provider ! .controller,
765
+ upDragController ! .controller,
768
766
);
769
767
_dragGestureController = null ;
770
768
}
@@ -773,7 +771,7 @@ class _CupertinoDragGestureDetectorState<T> extends State<_CupertinoDragGestureD
773
771
assert (mounted);
774
772
// This can be called even if start is not called, paired with the "down" event
775
773
// that we don't consider here.
776
- _dragGestureController? .dragEnd (0.0 , provider ! .controller);
774
+ _dragGestureController? .dragEnd (0.0 , upDragController ! .controller);
777
775
_dragGestureController = null ;
778
776
}
779
777
0 commit comments