SliverList.list constructor

SliverList.list({
  1. Key? key,
  2. required List<Widget> children,
  3. bool addAutomaticKeepAlives = true,
  4. bool addRepaintBoundaries = true,
  5. bool addSemanticIndexes = true,
})

A sliver that places multiple box children in a linear array along the main axis.

This constructor uses a list of Widgets to build the sliver.

The addAutomaticKeepAlives argument corresponds to the SliverChildBuilderDelegate.addAutomaticKeepAlives property. The addRepaintBoundaries argument corresponds to the SliverChildBuilderDelegate.addRepaintBoundaries property. The addSemanticIndexes argument corresponds to the SliverChildBuilderDelegate.addSemanticIndexes property.

This example, which would be provided in CustomScrollView.slivers, shows a list containing two Text widgets:
link
SliverList.list(
  children: const <Widget>[
    Text('Hello'),
    Text('World!'),
  ],
);

Implementation

SliverList.list({
  super.key,
  required List<Widget> children,
  bool addAutomaticKeepAlives = true,
  bool addRepaintBoundaries = true,
  bool addSemanticIndexes = true,
}) : super(delegate: SliverChildListDelegate(
       children,
       addAutomaticKeepAlives: addAutomaticKeepAlives,
       addRepaintBoundaries: addRepaintBoundaries,
       addSemanticIndexes: addSemanticIndexes,
     ));