tightenMaxSize method

BoxConstraints tightenMaxSize(
  1. Size? size
)

Returns new box constraints that tightens the max width and max height to the given size.

Implementation

BoxConstraints tightenMaxSize(Size? size) {
  if (size == null) return this;
  return copyWith(
    maxWidth: clampDouble(size.width, minWidth, maxWidth),
    maxHeight: clampDouble(size.height, minHeight, maxHeight),
  );
}