SuperSliverList class

Drop-in replacement for SliverList that can handle arbitrary large amount of items with variable extent.

Through listController it SuperSliverList also provides a way to jump to any item in the list, even if the item is not currently visible or has not been laid out.

Inheritance
Available extensions

Constructors

SuperSliverList({Key? key, required SliverChildDelegate delegate, ExtentPrecalculationPolicy? extentPrecalculationPolicy, ListController? listController, ExtentEstimationProvider? extentEstimation, bool delayPopulatingCacheArea = true, bool layoutKeptAliveChildren = false})
const
SuperSliverList.builder({Key? key, required NullableIndexedWidgetBuilder itemBuilder, ChildIndexGetter? findChildIndexCallback, int? itemCount, ExtentPrecalculationPolicy? extentPrecalculationPolicy, ListController? listController, ExtentEstimationProvider? extentEstimation, bool delayPopulatingCacheArea = true, bool layoutKeptAliveChildren = false, bool addAutomaticKeepAlives = true, bool addRepaintBoundaries = true, bool addSemanticIndexes = true})
Creates a SuperSliverList from widget builder.
SuperSliverList.list({Key? key, required List<Widget> children, ExtentPrecalculationPolicy? extentPrecalculationPolicy, ListController? listController, ExtentEstimationProvider? extentEstimation, bool delayPopulatingCacheArea = true, bool layoutKeptAliveChildren = false, bool addAutomaticKeepAlives = true, bool addRepaintBoundaries = true, bool addSemanticIndexes = true})
Creates a SuperSliverList from list of child widgets.
SuperSliverList.separated({Key? key, required NullableIndexedWidgetBuilder itemBuilder, ChildIndexGetter? findChildIndexCallback, required NullableIndexedWidgetBuilder separatorBuilder, ExtentPrecalculationPolicy? extentPrecalculationPolicy, ListController? listController, ExtentEstimationProvider? extentEstimation, bool delayPopulatingCacheArea = true, bool layoutKeptAliveChildren = false, int? itemCount, bool addAutomaticKeepAlives = true, bool addRepaintBoundaries = true, bool addSemanticIndexes = true})
Creates a SuperSliverList from widget builder separated by separator widgets.

Properties

delayPopulatingCacheArea bool
Whether the items in cache area should be built delayed. This is an optimization that kicks in during fast scrolling, when all items are being replaced on every frame. With delayPopulatingCacheArea set to true, the items in cache area are only built after the scrolling slows down.
final
delegate SliverChildDelegate
The delegate that provides the children for this widget.
finalinherited
elHorizontalScroll Widget

Available on Widget, provided by the ElWidgetExt extension

监听鼠标水平滚动(仅限桌面端生效),其后代滚动小部件必须在 widget 层指定 ScrollController
no setter
extentEstimation ExtentEstimationProvider?
Optional method that can be used to override default estimated extent for each item. Initially all extents are estimated and then as the items are laid out, either through scrolling or extentPrecalculationPolicy, the actual extents are calculated and the scroll offset is adjusted to account for the difference between estimated and actual extents.
final
extentPrecalculationPolicy ExtentPrecalculationPolicy?
Optional policy that can be used to asynchronously precalculate the extents of the items in the list. This can be useful allow precise scrolling on small lists where the difference between estimated and actual extents may be noticeable when interacting with the scrollbar. For larger lists precalculating extent has diminishing benefits since the error for each item does not impact the overall scroll position as much.
final
hashCode int
The hash code for this object.
no setterinherited
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
layoutKeptAliveChildren bool
Whether children with keepAlive should be laid out. Setting this to true ensures that layout for kept alive children is maintained and proper paint transform is applied.
final
listController ListController?
When set provides access to extents of individual children. ListController can also be used to jump to a specific item in the list.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

createElement() SliverMultiBoxAdaptorElement
RenderObjectWidgets always inflate to a RenderObjectElement subclass.
override
createRenderObject(BuildContext context) RenderSliverMultiBoxAdaptor
Creates an instance of the RenderObject class that this RenderObjectWidget represents, using the configuration described by this RenderObjectWidget.
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
didUnmountRenderObject(covariant RenderObject renderObject) → void
This method is called when a RenderObject that was previously associated with this widget is removed from the render tree. The provided RenderObject will be of the same type as the one created by this widget's createRenderObject method.
inherited
elScrollbarBehavior(BuildContext context, ElScrollBehavior behavior) Widget

Available on Widget, provided by the ElWidgetExt extension

合并祖先 ElScrollBehavior 的默认配置,如果不需要尊重祖先配置, 请直接使用 ScrollConfiguration 覆盖即可
estimateMaxScrollOffset(SliverConstraints? constraints, int firstIndex, int lastIndex, double leadingScrollOffset, double trailingScrollOffset) double?
Returns an estimate of the max scroll extent for all the children.
inherited
noScrollbarBehavior(BuildContext context, {Key? key, bool? overscroll, Set<PointerDeviceKind>? dragDevices, MultitouchDragStrategy? multitouchDragStrategy, Set<LogicalKeyboardKey>? pointerAxisModifiers, ScrollPhysics? physics, TargetPlatform? platform, ScrollViewKeyboardDismissBehavior? keyboardDismissBehavior, bool enabled = true}) Widget

Available on Widget, provided by the ElWidgetExt extension

不使用祖先提供的默认滚动条,当使用自定义滚动条时请设置此扩展,可以防止与祖先提供的默认滚动条重叠
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
updateRenderObject(BuildContext context, covariant RenderObject renderObject) → void
Copies the configuration described by this RenderObjectWidget to the given RenderObject, which will be of the same type as returned by this object's createRenderObject.
override

Operators

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

Static Properties

layoutBudget SuperSliverListLayoutBudget
getter/setter pair