SliverGrid.count constructor

SliverGrid.count({
  1. Key? key,
  2. required int crossAxisCount,
  3. double mainAxisSpacing = 0.0,
  4. double crossAxisSpacing = 0.0,
  5. double childAspectRatio = 1.0,
  6. List<Widget> children = const <Widget>[],
})

Creates a sliver that places multiple box children in a two dimensional arrangement with a fixed number of tiles in the cross axis.

Uses a SliverGridDelegateWithFixedCrossAxisCount as the gridDelegate, and a SliverChildListDelegate as the delegate.

See also:

Implementation

SliverGrid.count({
  super.key,
  required int crossAxisCount,
  double mainAxisSpacing = 0.0,
  double crossAxisSpacing = 0.0,
  double childAspectRatio = 1.0,
  List<Widget> children = const <Widget>[],
}) : gridDelegate = SliverGridDelegateWithFixedCrossAxisCount(
       crossAxisCount: crossAxisCount,
       mainAxisSpacing: mainAxisSpacing,
       crossAxisSpacing: crossAxisSpacing,
       childAspectRatio: childAspectRatio,
     ),
     super(delegate: SliverChildListDelegate(children));