Complex.fromMap constructor

Complex.fromMap(
  1. Map<String, Map<String, dynamic>>? m
)

Constructs an instance, applying the values in map m. See toJson for the expected format.

Implementation

Complex.fromMap(Map<String, Map<String, dynamic>>? m)
    : real = (m?.containsKey('real') == true)
          ? Real.fromMap(m?['real'])
          : Double.zero,
      imaginary = m?.containsKey('real') ?? false
          ? Imaginary.constant(Real.fromMap(m?['imag']))
          : const Imaginary.constant(Integer.zero);