TrackSize class
Represents the size of a grid track in a grid layout.
Use the static members to create different types of track sizes:
- TrackSize for fixed sizes using Units.
- TrackSize.fr for fractional sizes.
- TrackSize.minmax for specifying minimum and maximum sizes.
- TrackSize.fitContent for fitting content within a specified size.
- TrackSize.minContent for minimum content size.
- TrackSize.maxContent for maximum content size.
- TrackSize.auto for automatic sizing.
Read more: MDN Grid Tracks
Constructors
- TrackSize(Unit value)
-
Creates a track size with a fixed
value.constfactory - TrackSize.fitContent(Unit value)
-
Creates a track size that fits content within the specified
value.constfactory - TrackSize.fr(double value)
-
Creates a track size that is a fraction of the available space.
constfactory
- TrackSize.minmax(TrackSize min, TrackSize max)
-
Creates a track size that defines a size range greater than or equal to
minand less than or equal tomax. If max is smaller than min, then max is ignored and the function is treated as min. As a maximum, a flex value sets the track's flex factor. It is invalid as a minimum.constfactory
Properties
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Constants
- auto → const TrackSize
- A track size that is automatically determined. In most cases, this behaves similarly to minmax(min-content,max-content).
- maxContent → const TrackSize
- A track size representing the largest maximal content contribution of the grid items occupying the grid track.
- minContent → const TrackSize
- A track size representing the largest minimal content contribution of the grid items occupying the grid track.