diff --git a/lib/draggable_scrollbar.dart b/lib/draggable_scrollbar.dart index 93e3a69..ffffb55 100755 --- a/lib/draggable_scrollbar.dart +++ b/lib/draggable_scrollbar.dart @@ -20,7 +20,7 @@ typedef Text LabelTextBuilder(double offsetY); /// for quick navigation of the BoxScrollView. class DraggableScrollbar extends StatefulWidget { /// The view that will be scrolled with the scroll thumb - final BoxScrollView child; + final Widget child; /// A function that builds a thumb using the current configuration final ScrollThumbBuilder scrollThumbBuilder; @@ -67,7 +67,6 @@ class DraggableScrollbar extends StatefulWidget { this.labelConstraints, }) : assert(controller != null), assert(scrollThumbBuilder != null), - assert(child.scrollDirection == Axis.vertical), super(key: key); DraggableScrollbar.rrect({ @@ -83,8 +82,7 @@ class DraggableScrollbar extends StatefulWidget { this.scrollbarTimeToFade = const Duration(milliseconds: 600), this.labelTextBuilder, this.labelConstraints, - }) : assert(child.scrollDirection == Axis.vertical), - scrollThumbBuilder = + }) : scrollThumbBuilder = _thumbRRectBuilder(scrollThumbKey, alwaysVisibleScrollThumb), super(key: key); @@ -101,8 +99,7 @@ class DraggableScrollbar extends StatefulWidget { this.scrollbarTimeToFade = const Duration(milliseconds: 600), this.labelTextBuilder, this.labelConstraints, - }) : assert(child.scrollDirection == Axis.vertical), - scrollThumbBuilder = + }) : scrollThumbBuilder = _thumbArrowBuilder(scrollThumbKey, alwaysVisibleScrollThumb), super(key: key); @@ -119,8 +116,7 @@ class DraggableScrollbar extends StatefulWidget { this.scrollbarTimeToFade = const Duration(milliseconds: 600), this.labelTextBuilder, this.labelConstraints, - }) : assert(child.scrollDirection == Axis.vertical), - scrollThumbBuilder = _thumbSemicircleBuilder( + }) : scrollThumbBuilder = _thumbSemicircleBuilder( heightScrollThumb * 0.6, scrollThumbKey, alwaysVisibleScrollThumb), super(key: key);