copyWith method

LayoutSize copyWith({
  1. double? width,
  2. double? height,
})

Creates a copy of this size with optionally different width or height.

If width or height is not provided, the current value is retained.

Implementation

LayoutSize copyWith({
  double? width,
  double? height,
}) {
  return LayoutSize(
    width ?? this.width,
    height ?? this.height,
  );
}