Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit eadbf99

Browse filesBrowse files
committed
Addressing nits
1 parent 5cdc7eb commit eadbf99
Copy full SHA for eadbf99

File tree

Expand file treeCollapse file tree

1 file changed

+6
-8
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+6
-8
lines changed

‎packages/flutter/lib/src/cupertino/sheet.dart

Copy file name to clipboardExpand all lines: packages/flutter/lib/src/cupertino/sheet.dart
+6-8Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -714,12 +714,13 @@ class _CupertinoDragGestureDetectorState<T> extends State<_CupertinoDragGestureD
714714
_CupertinoDragGestureController<T>? _dragGestureController;
715715

716716
late VerticalDragGestureRecognizer _recognizer;
717-
_UpDragAnimationControllerProvider? provider;
717+
_UpDragAnimationControllerProvider? upDragController;
718718

719719
@override
720720
void initState() {
721721
super.initState();
722-
provider ??= _UpDragAnimationControllerProvider.maybeOf(context);
722+
assert(upDragController == null);
723+
upDragController = _UpDragAnimationControllerProvider.maybeOf(context);
723724
_recognizer =
724725
VerticalDragGestureRecognizer(debugOwner: this)
725726
..onStart = _handleDragStart
@@ -753,18 +754,15 @@ class _CupertinoDragGestureDetectorState<T> extends State<_CupertinoDragGestureD
753754
void _handleDragUpdate(DragUpdateDetails details) {
754755
assert(mounted);
755756
assert(_dragGestureController != null);
756-
_dragGestureController!.dragUpdate(
757-
details.primaryDelta!,
758-
provider!.controller,
759-
);
757+
_dragGestureController!.dragUpdate(details.primaryDelta!, upDragController!.controller);
760758
}
761759

762760
void _handleDragEnd(DragEndDetails details) {
763761
assert(mounted);
764762
assert(_dragGestureController != null);
765763
_dragGestureController!.dragEnd(
766764
details.velocity.pixelsPerSecond.dy / context.size!.height,
767-
provider!.controller,
765+
upDragController!.controller,
768766
);
769767
_dragGestureController = null;
770768
}
@@ -773,7 +771,7 @@ class _CupertinoDragGestureDetectorState<T> extends State<_CupertinoDragGestureD
773771
assert(mounted);
774772
// This can be called even if start is not called, paired with the "down" event
775773
// that we don't consider here.
776-
_dragGestureController?.dragEnd(0.0, provider!.controller);
774+
_dragGestureController?.dragEnd(0.0, upDragController!.controller);
777775
_dragGestureController = null;
778776
}
779777

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.