maxIntrinsicSize method

  1. @override
double maxIntrinsicSize(
  1. TrackType type,
  2. Iterable<RenderBox> items, {
  3. required double crossAxisSizeForItem(
    1. RenderBox
    ),
})
override

The ideal cross axis size of this track. This must be equal to or greater than the minIntrinsicSize for the same type. The track might be bigger than this size, e.g. if the track is flexible or if the grid's size ends up being forced to be bigger than the sum of all the maxIntrinsicSize values.

The type argument indicates whether this track represents a row or a column. If vertical, this function returns a width. If horizontal, a height.

The items argument is an iterable that provides all the items in the grid for this track. Walking the items is by definition O(N), so algorithms that do that should be considered expensive.

The measurementAxisMaxSize argument is the maxWidth (for column tracks) or maxHeight (for row tracks) of the incoming constraints for the grid, and might be infinite.

The crossAxisSizeForItem will be provided to assist in calculations if the cross axis sizing is known.

Implementation

@override
double maxIntrinsicSize(
  TrackType type,
  Iterable<RenderBox> items, {
  required double Function(RenderBox) crossAxisSizeForItem,
}) {
  return sizeInPx;
}