Repository navigation
Crash in DraggableScrollableController.animateTo #125709
Copy link
Copy link
Closed
Labels
P0Critical issues such as a build break or regressionCritical issues such as a build break or regressiona: animationAnimation APIsAnimation APIsc: crashStack traces logged to the consoleStack traces logged to the consolecustomer: chalk (g3)f: scrollingViewports, list views, slivers, etc.Viewports, list views, slivers, etc.frameworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.
Description
b/279930163
Customer reports a crash happening with this stack trace:
flutter: The following _TypeError was thrown while notifying listeners for AnimationController:
flutter: Null check operator used on a null value
flutter:
flutter: When the exception was thrown, this was the stack:
flutter: #0 DraggableScrollableController.animateTo.<anonymous closure> (package:flutter/src/widgets/draggable_scrollable_sheet.dart:135:26)
flutter: #1 AnimationLocalListenersMixin.notifyListeners (package:flutter/src/animation/listener_helpers.dart:161:19)
flutter: #2 AnimationController._tick (package:flutter/src/animation/animation_controller.dart:830:5)
flutter: #3 Ticker._tick (package:flutter/src/scheduler/ticker.dart:249:12)
flutter: #4 SchedulerBinding._invokeFrameCallback (package:flutter/src/scheduler/binding.dart:1289:15)
flutter: #5 SchedulerBinding.handleBeginFrame.<anonymous closure> (package:flutter/src/scheduler/binding.dart:1141:11)
flutter: #6 _LinkedHashMapMixin.forEach (dart:collection-patch/compact_hash.dart:625:13)
flutter: #7 SchedulerBinding.handleBeginFrame (package:flutter/src/scheduler/binding.dart:1139:17)
flutter: #8 SchedulerBinding._handleBeginFrame (package:flutter/src/scheduler/binding.dart:1056:5)
flutter: #9 _invoke1 (dart:ui/hooks.dart:158:13)
flutter: #10 PlatformDispatcher._beginFrame (dart:ui/platform_dispatcher.dart:337:5)
flutter: #11 _beginFrame (dart:ui/hooks.dart:101:31)
I have not been able to reproduce the issue.
In the customer app, the scroll controller is shared across two different DraggableScrollableSheets that are switched out as they expand and collapse.
There is a button at the top of the sheet that triggers the _controller.animateTo in order to collapse and expand it.
There is also a change in the sheets' extents happening in response to scroll notifications that are listening to the sheet.
Similar to #112020
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
P0Critical issues such as a build break or regressionCritical issues such as a build break or regressiona: animationAnimation APIsAnimation APIsc: crashStack traces logged to the consoleStack traces logged to the consolecustomer: chalk (g3)f: scrollingViewports, list views, slivers, etc.Viewports, list views, slivers, etc.frameworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.
Activity
Piinks commentedon Apr 28, 2023
This is the code I have been trying to reproduce with, but this asserts against a shared controller before the sheets are swapped out. I have asked the customer to take a look and provide more information
dnfield commentedon Apr 28, 2023
I have a test case in the linked PR, but I can make this happen by causing
didUpdateWidgetto happen during ananimateTo.dnfield commentedon Apr 28, 2023
We didn't get coverage of that because the existing test that exercised didUpdateWidget called
jumpTo.Fix crasher in DragableScrollableSheet when controller is animating a…
github-actions commentedon May 13, 2023
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of
flutter doctor -vand a minimal reproduction of the issue.