quire-io / scroll-to-index

scroll to index with fixed/variable row height inside Flutter scrollable widget
MIT License
518 stars 105 forks source link

Version 1.0.3 not working (version 1.0.2 is) #20

Closed b-cancel closed 4 years ago

b-cancel commented 4 years ago

The error I get is below right now I have a CustomScrollView, with multiple AutoScrollTags with SliverStickyHeaders inside of them from the flutter_sticky_header plugin

════════ Exception caught by widgets library ═══════════════════════════════════
The following assertion was thrown building DecoratedBoxTransition(animation: kAlwaysDismissedAnimation➩DecorationTween(BoxDecoration → BoxDecoration)➩BoxDecoration, state: _AnimatedState#59212):
A RenderViewport expected a child of type RenderSliver but received a child of type RenderDecoratedBox.

RenderObjects expect specific types of children because they coordinate with their children during layout and paint. For example, a RenderSliver cannot be the child of a RenderBox because a RenderSliver does not understand the RenderBox layout protocol.
The RenderViewport that expected a RenderSliver child was created by: Viewport ← IgnorePointer-[GlobalKey#77f73] ← Semantics ← _PointerListener ← Listener ← _GestureSemantics ← RawGestureDetector-[LabeledGlobalKey<RawGestureDetectorState>#ee4d1] ← _PointerListener ← Listener ← _ScrollableScope ← _ScrollSemantics-[GlobalKey#be6c5] ← RepaintBoundary ← ⋯
The RenderDecoratedBox that did not match the expected child type was created by: DecoratedBox ← DecoratedBoxTransition ← AutoScrollTag-[<0>] ← ExpandableTile ← Viewport ← IgnorePointer-[GlobalKey#77f73] ← Semantics ← _PointerListener ← Listener ← _GestureSemantics ← RawGestureDetector-[LabeledGlobalKey<RawGestureDetectorState>#ee4d1] ← _PointerListener ← ⋯
The relevant error-causing widget was
    AutoScrollTag-[<0>] 
lib\…\expandableTile\expandableTile.dart:51
When the exception was thrown, this was the stack
#0      ContainerRenderObjectMixin.debugValidateChild.<anonymous closure> 
package:flutter/…/rendering/object.dart:3037
#1      ContainerRenderObjectMixin.debugValidateChild 
package:flutter/…/rendering/object.dart:3064
#2      MultiChildRenderObjectElement.insertChildRenderObject 
package:flutter/…/widgets/framework.dart:5808
#3      RenderObjectElement.attachRenderObject 
package:flutter/…/widgets/framework.dart:5591
#4      RenderObjectElement.mount 
package:flutter/…/widgets/framework.dart:5331
...
════════════════════════════════════════════════════════════════════════════════

flutter doctor results are all green

jerrywell commented 4 years ago

the latest version is 1.0.5. you can try to upgrade it.

can you provide your flutter version and minimal reproduce sample?