clamp method Null safety

  1. @override
EdgeInsetsGeometry clamp(
  1. EdgeInsetsGeometry min,
  2. EdgeInsetsGeometry max
)
override

Returns a new EdgeInsetsGeometry object with all values greater than or equal to min, and less than or equal to max.

Implementation

@override
EdgeInsetsGeometry clamp(EdgeInsetsGeometry min, EdgeInsetsGeometry max) {
  return EdgeInsets.fromLTRB(
    _left.clamp(min._left, max._left),
    _top.clamp(min._top, max._top),
    _right.clamp(min._right, max._right),
    _bottom.clamp(min._bottom, max._bottom),
  );
}