SliverGrid.count constructor Null safety
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:
- GridView.count, the equivalent constructor for GridView widgets.
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));