constrainCrossAxis method

double constrainCrossAxis(
  1. Axis axis, [
  2. double extent = double.infinity
])

Returns the value that both satisfies the constraints and is as close as possible to the given extent crossing axis.

Implementation

double constrainCrossAxis(Axis axis, [double extent = double.infinity]) {
  return axis == Axis.vertical
      ? constrainWidth(extent)
      : constrainHeight(extent);
}