Length constructor

Length({
  1. num? value,
  2. String? unit,
  3. Uri? system,
  4. String? code,
})

Constructs a new Length with optional value, unit, system, and code.

Implementation

Length({
  num? value,
  String? unit,
  Uri? system,
  String? code,
}) : this.fromJson(
        JsonObject({
          if (value != null) valueField.name: JsonNumber(value),
          if (unit != null) unitField.name: JsonString(unit),
          if (system != null) systemField.name: JsonString(system.toString()),
          if (code != null) codeField.name: JsonString(code),
        }),
      );