minus method

Pad minus({
  1. double? left,
  2. double? top,
  3. double? right,
  4. double? bottom,
  5. double? all = 0,
  6. double? vertical = 0,
  7. double? horizontal = 0,
})

Creates a copy of this padding, minus the given parameters.

Example:

// Same as Pad(all: 40, top: -10)
Pad(all: 40).minus(top: 10);

Implementation

Pad minus({
  double? left,
  double? top,
  double? right,
  double? bottom,
  double? all = 0,
  double? vertical = 0,
  double? horizontal = 0,
}) {
  return Pad(
    left: this.left - (left ?? 0),
    top: this.top - (top ?? 0),
    right: this.right - (right ?? 0),
    bottom: this.bottom - (bottom ?? 0),
    all: (all != null) ? -all : 0,
    vertical: (vertical != null) ? -vertical : 0,
    horizontal: (horizontal != null) ? -horizontal : 0,
  );
}