Ratio constructor

Ratio({
  1. Quantity? numerator,
  2. Quantity? denominator,
})

Constructs a new Ratio with optional numerator and denominator.

Implementation

Ratio({
  Quantity? numerator,
  Quantity? denominator,
}) : this.fromJson(
        JsonObject({
          if (numerator != null) numeratorField.name: numerator.json,
          if (denominator != null) denominatorField.name: denominator.json,
        }),
      );