coerceAtMost method

Size coerceAtMost (
  1. Size maximum
)

Ensures that this Size is not larger than the specified maximum in any axis.

Implementation

Size coerceAtMost(Size maximum) {
  return Size(
    width.coerceAtMost(maximum.width),
    height.coerceAtMost(maximum.height),
  );
}