From f343ebb2a726f8d54c683bec63edff10abaecf90 Mon Sep 17 00:00:00 2001 From: Denis Beketsky Date: Mon, 22 Jul 2019 23:02:59 +0300 Subject: [PATCH] fixed updateRenderObject type definitions --- lib/render.dart | 2 +- lib/widget.dart | 15 ++++++++------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/lib/render.dart b/lib/render.dart index 8d27751..b7ab0f0 100644 --- a/lib/render.dart +++ b/lib/render.dart @@ -156,7 +156,7 @@ class StickyListItemRenderObject extends RenderStack { } bool get _scrollDirectionVertical => - [AxisDirection.up, AxisDirection.down].contains(_scrollable.axisDirection); + [AxisDirection.up, AxisDirection.down].contains(scrollable.axisDirection); bool get _alignmentStart { if (_scrollDirectionVertical) { diff --git a/lib/widget.dart b/lib/widget.dart index 3a77644..1e4c046 100644 --- a/lib/widget.dart +++ b/lib/widget.dart @@ -406,14 +406,15 @@ class StickyListItem extends Stack { @override @mustCallSuper - void updateRenderObject( - BuildContext context, StickyListItemRenderObject renderObject) { + void updateRenderObject(BuildContext context, RenderStack renderObject) { super.updateRenderObject(context, renderObject); - renderObject - ..scrollable = _getScrollableState(context) - ..itemIndex = itemIndex - ..streamSink = streamSink - ..minOffsetProvider = minOffsetProvider; + if (renderObject is StickyListItemRenderObject) { + renderObject + ..scrollable = _getScrollableState(context) + ..itemIndex = itemIndex + ..streamSink = streamSink + ..minOffsetProvider = minOffsetProvider; + } } }