constrainWidth method

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

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

Implementation

/// possible to the given width.
  double constrainWidth([ double width = double.infinity ]) {
return width.clamp(minWidth, maxWidth);
  }