diff --git a/CHANGELOG.md b/CHANGELOG.md index 537e033..e7fe3c6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +## [1.2.2] - 2019-06-22 + +**Bug fixes** + +- fixed type definition for render object [#10](https://github.com/TatsuUkraine/flutter_sticky_infinite_list/issues/10) + ## [1.2.1] - 2019-06-21 - shorten package description 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; + } } } diff --git a/pubspec.yaml b/pubspec.yaml index 2976549..e564cbd 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -5,7 +5,7 @@ description: >- Can be customized or with config options or with override. -version: 1.2.1 +version: 1.2.2 author: TatsuUkraine homepage: https://github.com/TatsuUkraine/flutter_sticky_infinite_list repository: https://github.com/TatsuUkraine/flutter_sticky_infinite_list