plus method

Pad plus({
  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, plus the given parameters.

Example:

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

Implementation

Pad plus({
  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 ?? 0,
    vertical: vertical ?? 0,
    horizontal: horizontal ?? 0,
  );
}