constrainWidth method

double constrainWidth ([double width = double.infinity ])

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

Implementation

double constrainWidth([double width = double.infinity]) {
  assert(debugAssertIsValid());
  return width.clamp(minWidth, maxWidth);
}