Skip to content

card_collection exception when flinging and scrolling #5864

Closed

Description

@Hixie

I was flinging horizontally and scrolling vertically fast at the same time and got:

I/flutter : ══╡ EXCEPTION CAUGHT BY RENDERING LIBRARY ╞═════════════════════════════════════════════════════════
I/flutter : The following assertion was thrown during performLayout():
I/flutter : Build scheduled during frame.
I/flutter : While the widget tree was being built, laid out, and painted, a new frame was scheduled to rebuild
I/flutter : the widget tree. This might be because setState() was called from a layout or paint callback. If a
I/flutter : change is needed to the widget tree, it should be applied as the tree is being built. Scheduling a
I/flutter : change for the subsequent frame instead results in an interface that lags behind by one frame. If
I/flutter : this was done to make your build dependent on a size measured at layout time, consider using a
I/flutter : LayoutBuilder, CustomSingleChildLayout, or CustomMultiChildLayout. If, on the other hand, the one
I/flutter : frame delay is the desired effect, for example because this is an animation, consider scheduling the
I/flutter : frame in a post-frame callback using SchedulerBinding.addPostFrameCallback or using an
I/flutter : AnimationController to trigger the animation.
I/flutter : When the exception was thrown, this was the stack:
I/flutter : #0      BindingBase&SchedulerBinding&GestureBinding&ServicesBinding&RendererBinding&WidgetsBinding._handleBuildScheduled.<anonymous closure> (package:flutter/src/widgets/binding.dart:199:9)
I/flutter : #2      BindingBase&SchedulerBinding&GestureBinding&ServicesBinding&RendererBinding&WidgetsBinding._handleBuildScheduled (package:flutter/src/widgets/binding.dart:197:12)
I/flutter : #3      BuildOwner.scheduleBuildFor (package:flutter/src/widgets/framework.dart:1467:23)
I/flutter : #4      BuildableElement.markNeedsBuild (package:flutter/src/widgets/framework.dart:2234:11)
I/flutter : #5      State.setState (package:flutter/src/widgets/framework.dart:848:14)
I/flutter : #6      ScrollableState._setScrollOffset (package:flutter/src/widgets/scrollable.dart:385:5)
I/flutter : #7      ScrollableState.scrollTo (package:flutter/src/widgets/scrollable.dart:430:7)
I/flutter : #8      ScrollableState.didUpdateScrollBehavior (package:flutter/src/widgets/scrollable.dart:467:5)
I/flutter : #9      LazyBlock._buildViewport.<anonymous closure> (package:flutter/src/widgets/lazy_block.dart:269:15)
I/flutter : #10     _LazyBlockElement._layout (package:flutter/src/widgets/lazy_block.dart:778:25)
I/flutter : #11     RenderObject.invokeLayoutCallback.<anonymous closure> (package:flutter/src/rendering/object.dart:1644:58)
I/flutter : #12     PipelineOwner._enableMutationsToDirtySubtrees (package:flutter/src/rendering/object.dart:896:15)
I/flutter : #13     RenderObject.invokeLayoutCallback (package:flutter/src/rendering/object.dart:1644:13)
I/flutter : #14     _RenderLazyBlock.performLayout (package:flutter/src/widgets/lazy_block.dart:466:7)
I/flutter : #15     RenderObject._layoutWithoutResize (package:flutter/src/rendering/object.dart:1424:21)
I/flutter : #16     PipelineOwner.flushLayout (package:flutter/src/rendering/object.dart:874:18)
I/flutter : #17     BindingBase&SchedulerBinding&GestureBinding&ServicesBinding&RendererBinding.beginFrame (package:flutter/src/rendering/binding.dart:202:19)
I/flutter : #18     BindingBase&SchedulerBinding&GestureBinding&ServicesBinding&RendererBinding&WidgetsBinding.beginFrame (package:flutter/src/widgets/binding.dart:297:23)
I/flutter : #19     BindingBase&SchedulerBinding&GestureBinding&ServicesBinding&RendererBinding._handlePersistentFrameCallback (package:flutter/src/rendering/binding.dart:147:5)
I/flutter : #20     BindingBase&SchedulerBinding._invokeFrameCallback (package:flutter/src/scheduler/binding.dart:608:15)
I/flutter : #21     BindingBase&SchedulerBinding.handleBeginFrame (package:flutter/src/scheduler/binding.dart:543:9)
I/flutter : #22     _beginFrame (file:///b/build/slave/Linux_Engine/build/src/flutter/lib/ui/hooks.dart:48)
I/flutter : (elided one frame from class _AssertionError)
I/flutter : The following RenderObject was being processed when the exception was fired:
I/flutter :   _RenderLazyBlock NEEDS-LAYOUT
I/flutter : This RenderObject had the following creator information:
I/flutter :   LazyBlockViewport ← ClampOverscrolls ← IgnorePointer ← Listener ← _GestureSemantics ←
I/flutter :   RawGestureDetector-[GlobalKey 371982228] ← Scrollable ← ClampOverscrolls ← CustomPaint ←
I/flutter :   AnimatedBuilder ← ⋯
I/flutter : This RenderObject had the following descendants (showing up to depth 5):
I/flutter :   RenderRepaintBoundary relayoutBoundary=up1
I/flutter :     RenderStack relayoutBoundary=up2
I/flutter :       RenderPadding
I/flutter :         RenderViewport
I/flutter :           RenderConstrainedBox relayoutBoundary=up1
I/flutter :       RenderSemanticsGestureHandler relayoutBoundary=up3
I/flutter :         RenderPointerListener relayoutBoundary=up4
I/flutter :           RenderFractionalTranslation relayoutBoundary=up5
I/flutter :   RenderRepaintBoundary relayoutBoundary=up1
I/flutter :     RenderStack relayoutBoundary=up2
I/flutter :       RenderPadding
I/flutter :         RenderViewport
I/flutter :           RenderConstrainedBox relayoutBoundary=up1
I/flutter :       RenderSemanticsGestureHandler relayoutBoundary=up3
I/flutter :         RenderPointerListener relayoutBoundary=up4
I/flutter :           RenderFractionalTranslation relayoutBoundary=up5
I/flutter :   RenderRepaintBoundary relayoutBoundary=up1
I/flutter :     RenderStack relayoutBoundary=up2
I/flutter :       RenderPadding
I/flutter :         RenderViewport
I/flutter :           RenderConstrainedBox relayoutBoundary=up1
I/flutter :       RenderSemanticsGestureHandler relayoutBoundary=up3
I/flutter :         RenderPointerListener relayoutBoundary=up4
I/flutter :           RenderFractionalTranslation relayoutBoundary=up5
I/flutter :   RenderRepaintBoundary relayoutBoundary=up1
I/flutter :     RenderStack relayoutBoundary=up2
I/flutter :       RenderPadding
I/flutter :         RenderViewport
I/flutter :           RenderConstrainedBox relayoutBoundary=up1
I/flutter : ════════════════════════════════════════════════════════════════════════════════════════════════════

Activity

  1. added
    c: crashStack traces logged to the console
    frameworkflutter/packages/flutter repository. See also f: labels.
    on Sep 14, 2016
  2. added this to the milestone on Sep 14, 2016
  3. self-assigned this
    on Sep 23, 2016
  4. removed their assignment
    on Mar 9, 2017
  5. goderbauer commented on Dec 27, 2018

    @goderbauer
    Member

    I was trying really hard, but couldn't reproduce this anymore on https://github.com/flutter/flutter/blob/master/dev/manual_tests/lib/card_collection.dart. Closing this for now.

  6. github-actions commented on Aug 15, 2021

    @github-actions

    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 -v and a minimal reproduction of the issue.

  7. locked as resolved and limited conversation to collaborators on Aug 15, 2021
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

    c: crashStack traces logged to the consoled: examplesSample code and demosf: scrollingViewports, list views, slivers, etc.frameworkflutter/packages/flutter repository. See also f: labels.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions