toString method

  1. @override
String toString()
override

Convert a Complex object (number) to a String representation

Examples

print(Complex(real: 2.0, imaginary: 2.0));

var str = Complex(real: 4.0, imaginary: 4.0).toString();

print(str);

/* output:
Complex(real: 2.0, imaginary: 2.0)
Complex(real: 4.0, imaginary: 4.0)
*/

Implementation

@override
String toString() {
  return '\n    Complex(real: $real, imaginary: $imaginary)';
}