SliverGridDelegateWithMaxCrossAxisExtent constructor

const SliverGridDelegateWithMaxCrossAxisExtent({
  1. required double maxCrossAxisExtent,
  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 tiles that have a maximum cross-axis extent.

The maxCrossAxisExtent, mainAxisExtent, mainAxisSpacing, and crossAxisSpacing arguments must not be negative. The childAspectRatio argument must be greater than zero.

Implementation

const SliverGridDelegateWithMaxCrossAxisExtent({
  required this.maxCrossAxisExtent,
  this.mainAxisSpacing = 0.0,
  this.crossAxisSpacing = 0.0,
  this.childAspectRatio = 1.0,
  this.mainAxisExtent,
}) : assert(maxCrossAxisExtent > 0),
     assert(mainAxisSpacing >= 0),
     assert(crossAxisSpacing >= 0),
     assert(childAspectRatio > 0),
     assert(mainAxisExtent == null || mainAxisExtent >= 0);