double constrainHeight([double height = double.INFINITY ])

Returns the height that both satisfies the constraints and is as close as possible to the given height.

Source

double constrainHeight([double height = double.INFINITY]) {
  assert(debugAssertIsValid());
  return height.clamp(minHeight, maxHeight);
}