constrainAxis method

double constrainAxis(
  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 on axis.

Implementation

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