clamp method

SizeUnit clamp({
  1. SizeUnit min = const _FixedSize(0),
  2. SizeUnit max = const _FixedSize(double.infinity),
})

Constrains this size unit within the specified min and max bounds.

Implementation

SizeUnit clamp({
  SizeUnit min = const _FixedSize(0),
  SizeUnit max = const _FixedSize(double.infinity),
}) {
  return _ConstrainedSize(
    size: this,
    min: min,
    max: max,
  );
}