A delegate that supplies children for slivers using a builder callback.

Many slivers lazily construct their box children to avoid creating more children than are visible through the Viewport. This delegate provides children using an IndexedWidgetBuilder callback, so that the children do not even have to be built until they are displayed.

The widgets returned from the builder callback are automatically wrapped in AutomaticKeepAlive widgets if addAutomaticKeepAlives is true (the default) and in RepaintBoundary widgets if addRepaintBoundaries is true (also the default).

See also:

Inheritance

Constructors

SliverChildBuilderDelegate(IndexedWidgetBuilder builder, { int childCount, bool addAutomaticKeepAlives: true, bool addRepaintBoundaries: true })
Creates a delegate that supplies children for slivers using the given builder callback. [...]
const

Properties

addAutomaticKeepAlives bool
Whether to wrap each child in an AutomaticKeepAlive. [...]
final
addRepaintBoundaries bool
Whether to wrap each child in a RepaintBoundary. [...]
final
builder IndexedWidgetBuilder
Called to build children for the sliver. [...]
final
childCount int
The total number of children this delegate can provide. [...]
final
estimatedChildCount int
Returns an estimate of the number of children this delegate will build. [...]
read-only
hashCode int
The hash code for this object. [...]
read-only, inherited
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited

Methods

build(BuildContext context, int index) Widget
Returns the child with the given index. [...]
shouldRebuild(SliverChildBuilderDelegate oldDelegate) bool
Called whenever a new instance of the child delegate class is provided to the sliver. [...]
debugFillDescription(List<String> description) → void
Add additional information to the given description for use by toString.
@mustCallSuper, @protected, inherited
didFinishLayout(int firstIndex, int lastIndex) → void
Called at the end of layout to indicate that layout is now complete. [...]
inherited
estimateMaxScrollOffset(int firstIndex, int lastIndex, double leadingScrollOffset, double trailingScrollOffset) double
Returns an estimate of the max scroll extent for all the children. [...]
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
toString() String
Returns a string representation of this object.
inherited

Operators

operator ==(other) bool
The equality operator. [...]
inherited