tightFor static method

BoxConstraints tightFor(
  1. Axis axis, {
  2. double? cross,
  3. double? main,
})

Creates box constraints that require the given cross or main size.

See also:

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

Implementation

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