Skip to content

'package:flutter/src/widgets/scrollable.dart': Failed assertion: line 906 pos 12: '_hold == null': is not true. #172174

Description

@tcheric

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:

  1. Scroll down by "flicking" cursor (allowing scroll event to slow to a stop by itself)
  2. Before the scroll naturally stops, either:
  • Stop the scroll by holding down, or:
  • Swipe horizontally to go to next page in PageView
  1. 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

Github repo: https://github.com/tcheric/flutter-scrollable-exception/

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

  1. added
    in triage
    on Jul 16, 2025
  2. darshankawar commented on Jul 16, 2025

    @darshankawar
    Member

    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
    
    A Dart VM Service on iPhone 16 Pro Max is available at:
    http://127.0.0.1:59692/OjJezFCF3AQ=/
    The Flutter DevTools debugger and profiler on iPhone 16 Pro Max is available at:
    http://127.0.0.1:9102?uri=http://127.0.0.1:59692/OjJezFCF3AQ=/
    
    ══╡ 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:904:7)
    #5      DragGestureRecognizer.didStopTrackingLastPointer
    (package:flutter/src/gestures/monodrag.dart:761:9)
    #6      OneSequenceGestureRecognizer.stopTrackingPointer
    (package:flutter/src/gestures/recognizer.dart:539:9)
    #7      DragGestureRecognizer._giveUpPointer
    (package:flutter/src/gestures/monodrag.dart:773:5)
    #8      DragGestureRecognizer.rejectGesture
    (package:flutter/src/gestures/monodrag.dart:749:5)
    #9      GestureArenaManager._resolveInFavorOf
    (package:flutter/src/gestures/arena.dart:285:24)
    #10     GestureArenaManager._resolve
    (package:flutter/src/gestures/arena.dart:239:11)
    #11     GestureArenaEntry.resolve
    (package:flutter/src/gestures/arena.dart:55:12)
    #12     OneSequenceGestureRecognizer.resolve
    (package:flutter/src/gestures/recognizer.dart:451:13)
    #13     DragGestureRecognizer.handleEvent
    (package:flutter/src/gestures/monodrag.dart:709:15)
    #14     PointerRouter._dispatch
    (package:flutter/src/gestures/pointer_router.dart:97:12)
    #15     PointerRouter._dispatchEventToRoutes.<anonymous closure>
    (package:flutter/src/gestures/pointer_router.dart:142:9)
    #16     _LinkedHashMapMixin.forEach (dart:_compact_hash:764:13)
    #17     PointerRouter._dispatchEventToRoutes
    (package:flutter/src/gestures/pointer_router.dart:140:18)
    #18     PointerRouter.route
    (package:flutter/src/gestures/pointer_router.dart:130:7)
    #19     GestureBinding.handleEvent
    (package:flutter/src/gestures/binding.dart:528:19)
    #20     GestureBinding.dispatchEvent
    (package:flutter/src/gestures/binding.dart:498:22)
    #21     RendererBinding.dispatchEvent
    (package:flutter/src/rendering/binding.dart:473:11)
    #22     GestureBinding._handlePointerEventImmediately
    (package:flutter/src/gestures/binding.dart:437:7)
    #23     GestureBinding.handlePointerEvent
    (package:flutter/src/gestures/binding.dart:394:5)
    #24     GestureBinding._flushPointerEventQueue
    (package:flutter/src/gestures/binding.dart:341:7)
    #25     GestureBinding._handlePointerDataPacket
    (package:flutter/src/gestures/binding.dart:308:9)
    #26     _invoke1 (dart:ui/hooks.dart:346:13)
    #27     PlatformDispatcher._dispatchPointerDataPacket
    (dart:ui/platform_dispatcher.dart:467:7)
    #28     _dispatchPointerDataPacket (dart:ui/hooks.dart:281:31)
    (elided 2 frames from class _AssertionError)
    
    Handler: "onCancel"
    Recognizer:
      VerticalDragGestureRecognizer#fd8ef
    ════════════════════════════════════════════════════════════════════════════════
    ════════════════════
    
    
    stable : 3.32.6
    master : 3.33.0-1.0.pre-985
    
  3. added
    framework
    team-framework
    a: error message
    has reproducible steps
    found in release: 3.32
    found in release: 3.33
    f: scrolling
    and removed
    in triage
    on Jul 16, 2025
  4. added
    triaged-framework
    on Jul 29, 2025
  5. removed
    triaged-framework
    on Jul 29, 2025
  6. flutter-triage-bot commented on Jul 29, 2025

    @flutter-triage-bot

    This issue is missing a priority label. Please set a priority label when adding the triaged-framework label.

  7. added
    P2
    triaged-framework
    on Aug 5, 2025
  8. added a commit that references this issue on Oct 19, 2026
    56325ee
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2a: error messagef: scrollingfound in release: 3.32found in release: 3.33frameworkhas reproducible stepsteam-frameworktriaged-framework

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions