SliverChildListDelegate constructor

SliverChildListDelegate(List<Widget> children, { bool addAutomaticKeepAlives: true, bool addRepaintBoundaries: true, bool addSemanticIndexes: true, SemanticIndexCallback semanticIndexCallback: _kDefaultSemanticIndexCallback, int semanticIndexOffset: 0 })

Creates a delegate that supplies children for slivers using the given list.

The children, addAutomaticKeepAlives, addRepaintBoundaries, addSemanticIndexes, and semanticIndexCallback arguments must not be null.

If the order of children` never changes, consider using the constant SliverChildListDelegate.fixed constructor.

Implementation

SliverChildListDelegate(
  this.children, {
  this.addAutomaticKeepAlives = true,
  this.addRepaintBoundaries = true,
  this.addSemanticIndexes = true,
  this.semanticIndexCallback = _kDefaultSemanticIndexCallback,
  this.semanticIndexOffset = 0,
}) : assert(children != null),
     assert(addAutomaticKeepAlives != null),
     assert(addRepaintBoundaries != null),
     assert(addSemanticIndexes != null),
     assert(semanticIndexCallback != null),
     _keyToIndex = <Key, int>{null: 0};