ScrollablePositionedList class

A scrollable list that can jump or animate to an item by index and reports which items are visible, with the API of scrollable_positioned_list.

It is a single CustomScrollView around a SuperSliverList: the list has a real ScrollController (so a Scrollbar works), jumps are resolved exactly during layout before paint, and only the items around a target are built.

Inheritance

Constructors

ScrollablePositionedList({Key? key, required int itemCount, required IndexedWidgetBuilder itemBuilder, ChildIndexGetter? findChildIndexCallback, ItemScrollController? itemScrollController, bool shrinkWrap = false, ItemPositionsListener? itemPositionsListener, bool notifyPositionsOnRebuild = true, ScrollOffsetController? scrollOffsetController, ScrollOffsetListener? scrollOffsetListener, int initialScrollIndex = 0, double initialAlignment = 0, double initialOffset = 0, TargetRectResolver? initialTargetRectResolver, Axis scrollDirection = Axis.vertical, bool reverse = false, ScrollPhysics? physics, int? semanticChildCount, EdgeInsets? padding, bool addSemanticIndexes = true, bool addAutomaticKeepAlives = true, bool addRepaintBoundaries = true, double? minCacheExtent, double cacheExtentScreens = _defaultCacheExtentScreens, bool jumpToDistantItems = false, ScrollController? scrollController, ListController? listController, ItemExtentEstimator? estimateExtent, Object? estimationKey, CrossAxisLayoutKey? crossAxisLayoutKey, bool restorePosition = false, OverscrollToTarget overscrollToTarget = OverscrollToTarget.matchScrollablePositionedList})
Same as ScrollablePositionedList.builder.
const
ScrollablePositionedList.builder({Key? key, required int itemCount, required IndexedWidgetBuilder itemBuilder, ChildIndexGetter? findChildIndexCallback, ItemScrollController? itemScrollController, bool shrinkWrap = false, ItemPositionsListener? itemPositionsListener, bool notifyPositionsOnRebuild = true, ScrollOffsetController? scrollOffsetController, ScrollOffsetListener? scrollOffsetListener, int initialScrollIndex = 0, double initialAlignment = 0, double initialOffset = 0, TargetRectResolver? initialTargetRectResolver, Axis scrollDirection = Axis.vertical, bool reverse = false, ScrollPhysics? physics, int? semanticChildCount, EdgeInsets? padding, bool addSemanticIndexes = true, bool addAutomaticKeepAlives = true, bool addRepaintBoundaries = true, double? minCacheExtent, double cacheExtentScreens = _defaultCacheExtentScreens, bool jumpToDistantItems = false, ScrollController? scrollController, ListController? listController, ItemExtentEstimator? estimateExtent, Object? estimationKey, CrossAxisLayoutKey? crossAxisLayoutKey, bool restorePosition = false, OverscrollToTarget overscrollToTarget = OverscrollToTarget.matchScrollablePositionedList})
Creates a list whose items are built by itemBuilder.
const
ScrollablePositionedList.separated({Key? key, required int itemCount, required IndexedWidgetBuilder itemBuilder, ChildIndexGetter? findChildIndexCallback, required IndexedWidgetBuilder separatorBuilder, ItemScrollController? itemScrollController, bool shrinkWrap = false, ItemPositionsListener? itemPositionsListener, bool notifyPositionsOnRebuild = true, ScrollOffsetController? scrollOffsetController, ScrollOffsetListener? scrollOffsetListener, int initialScrollIndex = 0, double initialAlignment = 0, double initialOffset = 0, TargetRectResolver? initialTargetRectResolver, Axis scrollDirection = Axis.vertical, bool reverse = false, ScrollPhysics? physics, int? semanticChildCount, EdgeInsets? padding, bool addSemanticIndexes = true, bool addAutomaticKeepAlives = true, bool addRepaintBoundaries = true, double? minCacheExtent, double cacheExtentScreens = _defaultCacheExtentScreens, bool jumpToDistantItems = false, ScrollController? scrollController, ListController? listController, ItemExtentEstimator? estimateExtent, Object? estimationKey, CrossAxisLayoutKey? crossAxisLayoutKey, double estimatedSeparatorExtent = 0, bool restorePosition = false, OverscrollToTarget overscrollToTarget = OverscrollToTarget.matchScrollablePositionedList})
Creates a list whose items are built by itemBuilder, with a separator built by separatorBuilder between consecutive items.
const

Properties

addAutomaticKeepAlives → bool
See SliverChildBuilderDelegate.addAutomaticKeepAlives.
final
addRepaintBoundaries → bool
See SliverChildBuilderDelegate.addRepaintBoundaries.
final
addSemanticIndexes → bool
See SliverChildBuilderDelegate.addSemanticIndexes.
final
cacheExtentScreens → double
Cache extent before and after the viewport, in viewport lengths.
final
crossAxisLayoutKey → CrossAxisLayoutKey?
Maps the item width (after padding) to a value that changes whenever item heights may change; see SuperSliverList.crossAxisLayoutKey. In a separated list it applies to the separators as well.
final
estimatedSeparatorExtent → double
Estimated extent of a separator in a ScrollablePositionedList.separated list.
final
estimateExtent → ItemExtentEstimator?
Estimates item extents before they are laid out. Good estimates make the scrollbar steadier; jumps are exact either way. החלפת ה-callback אינה מרעננת הערכות: לשינוי הנתונים עדכנו estimationKey.
final
estimationKey → Object?
שינוי המפתח מחליף בהערכה חדשה את מידות כל הפריטים, גם את אלה שנמדדו, והפריטים הפרוסים נמדדים מחדש. רוחב חדש (כש-crossAxisLayoutKey משתנה או חסר) ורענון מפורש של ListController עושים זאת גם בלעדיו.
final
findChildIndexCallback → ChildIndexGetter?
מאתר את האינדקס החדש של פריט לפי מפתחו ושומר את מצבו בסידור מחדש. גם ברשימה מופרדת מחזירים אינדקס פריט, ללא המפרידים שביניהם.
final
hashCode → int
The hash code for this object.
no setterinherited
initialAlignment → double
Fraction of the viewport where the leading edge of the item at initialScrollIndex is placed. See ItemScrollController.jumpTo.
final
initialOffset → double
Pixels added to initialAlignment.
final
initialScrollIndex → int
Index of the item shown first, placed at initialAlignment.
final
initialTargetRectResolver → TargetRectResolver?
מיישר אזור בתוך הפריט לפני הציור הראשון, לפי חוזה ItemScrollController.jumpTo. שחזור מ־PageStorage מקבל קדימות על פני היעד ההתחלתי הזה.
final
itemBuilder → IndexedWidgetBuilder
Builds the item at 0 <= index < itemCount.
final
itemCount → int
Number of items itemBuilder can build.
final
itemPositionsListener → ItemPositionsListener?
Receives the positions of the visible items after every frame in which they changed.
final
itemScrollController → ItemScrollController?
Jumps or scrolls to items.
final
jumpToDistantItems → bool
Accepted for compatibility and ignored: distant items are always reached by a jump to near the item followed by a short animation.
final
key → Key?
Controls how one widget replaces another widget in the tree.
finalinherited
listController → ListController?
בקר ליבת הרשימה; בקרה על מחזור חייו נשארת בידי מי שסיפק אותו. בלעדיו הרשימה יוצרת בקר פנימי ומשחררת אותו בפירוקה.
final
minCacheExtent → double?
Lower bound for the cache extent in pixels.
final
notifyPositionsOnRebuild → bool
Whether itemPositionsListener is notified after every rebuild of the list, even when no position changed, as in scrollable_positioned_list.
final
overscrollToTarget → OverscrollToTarget
Whether ItemScrollController.jumpTo, ItemScrollController.scrollTo and the initial position may leave blank space where the content does not reach. The default reproduces scrollable_positioned_list; OverscrollToTarget.always lets every target land exactly, for example the last item at the top of the viewport.
final
padding → EdgeInsets?
Space around the items.
final
physics → ScrollPhysics?
See ScrollView.physics.
final
restorePosition → bool
Whether the visible item is saved to PageStorage and restored when the list is recreated. Off by default; initialScrollIndex is used then.
final
reverse → bool
See ScrollView.reverse.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
scrollController → ScrollController?
Scroll controller of the list. When null the list creates one, which is available as ItemScrollController.scrollController.
final
scrollDirection → Axis
See ScrollView.scrollDirection.
final
scrollOffsetController → ScrollOffsetController?
Scrolls by a number of pixels.
final
scrollOffsetListener → ScrollOffsetListener?
Receives scroll offset changes.
final
semanticChildCount → int?
See ScrollView.semanticChildCount. Defaults to itemCount.
final
separatorBuilder → IndexedWidgetBuilder?
Builds the separator after the item at 0 <= index < itemCount - 1.
final
shrinkWrap → bool
See ScrollView.shrinkWrap.
final

Methods

createElement() → StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() → State<ScrollablePositionedList>
Creates the mutable state for this widget at a given location in the tree.
override
debugDescribeChildren() → List<DiagnosticsNode>
Returns a list of DiagnosticsNode objects describing this node's children.
inherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toDiagnosticsNode({String? name, DiagnosticsTreeStyle? style}) → DiagnosticsNode
Returns a debug representation of the object that is used by debugging tools and by DiagnosticsNode.toStringDeep.
inherited
toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) → String
A string representation of this object.
inherited
toStringDeep({String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) → String
Returns a string representation of this node and its descendants.
inherited
toStringShallow({String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) → String
Returns a one-line detailed description of the object.
inherited
toStringShort() → String
A short, textual description of this widget.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited