copyWith method

Complex copyWith({
  1. double? real,
  2. double? imaginary,
})

Creates a deep copy of this object with the given fields replaced with the new values.

Implementation

Complex copyWith({
  double? real,
  double? imaginary,
}) =>
    Complex(
      real ?? this.real,
      imaginary ?? this.imaginary,
    );