ScrollablePositionedList.separated constructor
const
ScrollablePositionedList.separated({
- required int itemCount,
- required IndexedWidgetBuilder itemBuilder,
- required IndexedWidgetBuilder? separatorBuilder,
- Key? key,
- bool shrinkWrap = false,
- ItemScrollController? itemScrollController,
- ItemPositionsListener? itemPositionsListener,
- ScrollOffsetController? scrollOffsetController,
- ScrollOffsetListener? scrollOffsetListener,
- int initialScrollIndex = 0,
- double initialAlignment = 0,
- Axis scrollDirection = Axis.vertical,
- bool reverse = false,
- ScrollPhysics? physics,
- int? semanticChildCount,
- EdgeInsets? padding,
- bool addSemanticIndexes = true,
- bool addAutomaticKeepAlives = true,
- bool addRepaintBoundaries = true,
- double? minCacheExtent,
- ScrollController? scrollController,
- dynamic onScrollEnd(
- bool isBottomReached
- required dynamic onScroll(
- ScrollPosition scrollPosition
Create a ScrollablePositionedList whose items are provided by
itemBuilder
and separators provided by separatorBuilder
.
Implementation
const ScrollablePositionedList.separated({
required this.itemCount,
required this.itemBuilder,
required this.separatorBuilder,
Key? key,
this.shrinkWrap = false,
this.itemScrollController,
ItemPositionsListener? itemPositionsListener,
this.scrollOffsetController,
ScrollOffsetListener? scrollOffsetListener,
this.initialScrollIndex = 0,
this.initialAlignment = 0,
this.scrollDirection = Axis.vertical,
this.reverse = false,
this.physics,
this.semanticChildCount,
this.padding,
this.addSemanticIndexes = true,
this.addAutomaticKeepAlives = true,
this.addRepaintBoundaries = true,
this.minCacheExtent,
this.scrollController,
this.onScrollEnd, required this.onScroll,
})
: assert(itemBuilder != null),
assert(separatorBuilder != null),
itemPositionsNotifier = itemPositionsListener as ItemPositionsNotifier?,
scrollOffsetNotifier = scrollOffsetListener as ScrollOffsetNotifier?,
super(key: key);