copyWith method

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

Creates a deep copy of this object and replaces (if non-null) the given values with the old ones.

Implementation

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