Repository navigation
Description
Steps to reproduce
I have a SingleChildScrollView nested inside a PageView. Using ScrollController, I first listen to when each scroll ends, then call ScrollController.jumpTo() to "snap" to a specified position. If interrupted in certain ways, Flutter throws an exception. This only happens when SingleChildScrollView is inside the PageView.
To reproduce:
- Scroll down by "flicking" cursor (allowing scroll event to slow to a stop by itself)
- Before the scroll naturally stops, either:
- Stop the scroll by holding down, or:
- Swipe horizontally to go to next page in PageView
- Exception will be thrown
This issue does not seem to affect the app's performance, no crashing occurs. Only an exception is thrown. I noticed that this behaviour is similar to a previous issue. Could a similar fix to be implemented?
Expected results
Ideally no exception should occur.
Actual results
This exception is thrown:
'package:flutter/src/widgets/scrollable.dart': Failed assertion: line 906 pos 12: '_hold == null': is not true.
Successive scrolls can cause this similar exception to be thrown, but only after the above exception happens first (never occurs by itself):
'package:flutter/src/widgets/scrollable.dart': Failed assertion: line 864 pos 12: '_hold == null': is not true.
Code sample
Screenshots or Video
No response
Logs
Logs
======== Exception caught by gesture ===============================================================
The following assertion was thrown while handling a gesture:
'package:flutter/src/widgets/scrollable.dart': Failed assertion: line 906 pos 12: '_hold == null': is not true.
Either the assertion indicates an error in the framework itself, or we should provide substantially more information in this error message to help you determine and fix the underlying cause.
In either case, please report this assertion by filing a bug on GitHub:
https://github.com/flutter/flutter/issues/new?template=02_bug.yml
When the exception was thrown, this was the stack:
#2 ScrollableState._handleDragCancel (package:flutter/src/widgets/scrollable.dart:906:12)
#3 GestureRecognizer.invokeCallback (package:flutter/src/gestures/recognizer.dart:345:24)
#4 DragGestureRecognizer._checkCancel (package:flutter/src/gestures/monodrag.dart:902:7)
#5 DragGestureRecognizer.didStopTrackingLastPointer (package:flutter/src/gestures/monodrag.dart:761:9)
#6 OneSequenceGestureRecognizer.stopTrackingPointer (package:flutter/src/gestures/recognizer.dart:540:9)
#7 DragGestureRecognizer._giveUpPointer (package:flutter/src/gestures/monodrag.dart:773:5)
#8 DragGestureRecognizer.handleEvent (package:flutter/src/gestures/monodrag.dart:725:7)
#9 PointerRouter._dispatch (package:flutter/src/gestures/pointer_router.dart:97:12)
#10 PointerRouter._dispatchEventToRoutes.<anonymous closure> (package:flutter/src/gestures/pointer_router.dart:143:9)
#11 _LinkedHashMapMixin.forEach (dart:_compact_hash:764:13)
#12 PointerRouter._dispatchEventToRoutes (package:flutter/src/gestures/pointer_router.dart:141:18)
#13 PointerRouter.route (package:flutter/src/gestures/pointer_router.dart:131:7)
#14 GestureBinding.handleEvent (package:flutter/src/gestures/binding.dart:530:19)
#15 GestureBinding.dispatchEvent (package:flutter/src/gestures/binding.dart:499:22)
#16 RendererBinding.dispatchEvent (package:flutter/src/rendering/binding.dart:473:11)
#17 GestureBinding._handlePointerEventImmediately (package:flutter/src/gestures/binding.dart:437:7)
#18 GestureBinding.handlePointerEvent (package:flutter/src/gestures/binding.dart:394:5)
#19 GestureBinding._flushPointerEventQueue (package:flutter/src/gestures/binding.dart:341:7)
#20 GestureBinding._handlePointerDataPacket (package:flutter/src/gestures/binding.dart:308:9)
#21 _invoke1 (dart:ui/hooks.dart:347:13)
#22 PlatformDispatcher._dispatchPointerDataPacket (dart:ui/platform_dispatcher.dart:467:7)
#23 _dispatchPointerDataPacket (dart:ui/hooks.dart:282:31)
(elided 2 frames from class _AssertionError)
Handler: "onCancel"
Recognizer: VerticalDragGestureRecognizer#f430e
start behavior: start
====================================================================================================Flutter Doctor output
Doctor output
[✓] Flutter (Channel stable, 3.32.6, on macOS 14.2.1 23C71 darwin-arm64, locale en-AU) [2.5s]
• Flutter version 3.32.6 on channel stable at /Users/tcheric/dev/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 077b4a4ce1 (7 days ago), 2025-07-08 13:31:08 -0700
• Engine revision 72f2b18bb0
• Dart version 3.8.1
• DevTools version 2.45.1
[✓] Android toolchain - develop for Android devices (Android SDK version 35.0.0) [4.8s]
• Android SDK at /Users/tcheric/Library/Android/sdk
• Platform android-35, build-tools 35.0.0
• Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
This is the JDK bundled with the latest Android Studio installation on this machine.
To manually set the JDK path, use: `flutter config --jdk-dir="path/to/jdk"`.
• Java version OpenJDK Runtime Environment (build 21.0.3+-79915917-b509.11)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 15.4) [3.5s]
• Xcode at /Applications/Xcode.app/Contents/Developer
• Build 15F31d
• CocoaPods version 1.16.2
[✓] Chrome - develop for the web [12ms]
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 2024.2) [11ms]
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 21.0.3+-79915917-b509.11)
[✓] VS Code (version 1.85.1) [10ms]
• VS Code at /Users/tcheric/Downloads/Visual Studio Code.app/Contents
• Flutter extension can be installed from:
🔨 https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter
[✓] VS Code (version 1.95.3) [10ms]
• VS Code at /Users/tcheric/Downloads/Visual Studio Code 2.app/Contents
• Flutter extension can be installed from:
🔨 https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter
[✓] Connected device (3 available) [13.2s]
• sdk gphone64 arm64 (mobile) • emulator-5554 • android-arm64 • Android 15 (API 35) (emulator)
• macOS (desktop) • macos • darwin-arm64 • macOS 14.2.1 23C71 darwin-arm64
• Chrome (web) • chrome • web-javascript • Google Chrome 138.0.7204.101
[✓] Network resources [1,795ms]
• All expected network resources are available.
• No issues found!
Activity
darshankawar commentedon Jul 16, 2025
Thanks for the report. I was able to replicate the reported behavior. The exception occurs after dragging the screen with red background color and while it is on screen, scroll horizontal to open next page.
console error log
flutter-triage-bot commentedon Jul 29, 2025
This issue is missing a priority label. Please set a priority label when adding the
triaged-frameworklabel.Don't keep a hold that user code already disposed
test: stop skipping the two Flutter assertions the app now avoids (CU…