SliverGridDelegateWithFixedCrossAxisCount constructor Null safety

const SliverGridDelegateWithFixedCrossAxisCount(
  1. {required int crossAxisCount,
  2. double mainAxisSpacing = 0.0,
  3. double crossAxisSpacing = 0.0,
  4. double childAspectRatio = 1.0,
  5. double? mainAxisExtent}
)

Creates a delegate that makes grid layouts with a fixed number of tiles in the cross axis.

All of the arguments except mainAxisExtent must not be null. The mainAxisSpacing, mainAxisExtent and crossAxisSpacing arguments must not be negative. The crossAxisCount and childAspectRatio arguments must be greater than zero.

Implementation

const SliverGridDelegateWithFixedCrossAxisCount({
  required this.crossAxisCount,
  this.mainAxisSpacing = 0.0,
  this.crossAxisSpacing = 0.0,
  this.childAspectRatio = 1.0,
  this.mainAxisExtent,
}) : assert(crossAxisCount != null && crossAxisCount > 0),
     assert(mainAxisSpacing != null && mainAxisSpacing >= 0),
     assert(crossAxisSpacing != null && crossAxisSpacing >= 0),
     assert(childAspectRatio != null && childAspectRatio > 0);