Length constructor

Length({
  1. dynamic m,
  2. dynamic km,
  3. dynamic mm,
  4. dynamic ua,
  5. dynamic NM,
  6. double uncert = 0.0,
})

Constructs a Length with meters (m), kilometers (km), millimeters (mm), astronomical units (ua) or nautical miles (NM). Optionally specify a relative standard uncertainty.

Implementation

Length(
    {dynamic m,
    dynamic km,
    dynamic mm,
    dynamic ua,
    // ignore:non_constant_identifier_names
    dynamic NM,
    double uncert = 0.0})
    : super(
          m ?? (km ?? (mm ?? (ua ?? (NM ?? 0.0)))),
          km != null
              ? Length.kilometers
              : (mm != null
                  ? Length.millimeters
                  : (ua != null
                      ? Length.astronomicalUnits
                      : (NM != null ? Length.nauticalMiles : Length.meters))),
          uncert);