tightForFinite static method

BoxConstraints tightForFinite(
  1. Axis axis, {
  2. double cross = double.infinity,
  3. double main = double.infinity,
})

Creates box constraints that require the given cross or main size, except if they are infinite.

See also:

  • axisTightFor, which is similar but instead of being tight if the value is not infinite, is tight if the value is non-null.

Implementation

static BoxConstraints tightForFinite(
  Axis axis, {
  double cross = double.infinity,
  double main = double.infinity,
}) {
  return axis == Axis.vertical
      ? BoxConstraints.tightForFinite(width: cross, height: main)
      : BoxConstraints.tightForFinite(width: main, height: cross);
}