copyWith method

  1. @override
Pad copyWith({
  1. double? left,
  2. double? top,
  3. double? right,
  4. double? bottom,
})
override

Creates a copy of this padding but with the given fields replaced with the new values.

IMPORTANT: This will replace the final value of the resulting padding left/right/top/bottom, after applying all, vertical and horizontal. For example:

// Same as Pad(left: 40, right: 40, top: 40, bottom: 10)
Pad(all: 40).copyWith(bottom: 10);

Implementation

@override
Pad copyWith({
  double? left,
  double? top,
  double? right,
  double? bottom,
}) {
  return Pad(
    left: left ?? this.left,
    top: top ?? this.top,
    right: right ?? this.right,
    bottom: bottom ?? this.bottom,
  );
}