minIntrinsicSize method
The smallest width (for columns) or height (for rows) that a track can have.
The type
argument indicates whether this track represents a row or
a column.
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
or maxHeight
of
the incoming constraints for grid, and might be infinite.
The crossAxisSizeForItem
will be provided to assist in calculations if
the cross axis sizing is known.
Implementation
@override
double minIntrinsicSize(
TrackType type,
Iterable<RenderBox> items, {
double Function(RenderBox)? crossAxisSizeForItem,
}) {
crossAxisSizeForItem ??= (_) => double.infinity;
final minContentContributions = items.map(
(item) => _itemMinIntrinsicSizeOnAxis(
item,
measurementAxisForTrackType(type),
crossAxisSizeForItem!(item),
),
);
return max(
minContentContributions,
)!;
}