getPropertyFromEnum function
Implementation
Property? getPropertyFromEnum(dynamic propertyEnum) {
return switch (propertyEnum.runtimeType) {
const (AMOUNT_OF_SUBSTANCE) => AmountOfSubstance(),
const (ANGLE) => Angle(),
const (AREA) => Area(),
const (DENSITY) => Density(),
const (DIGITAL_DATA) => DigitalData(),
const (ENERGY) => Energy(),
const (FORCE) => Force(),
const (FUEL_CONSUMPTION) => FuelConsumption(),
const (ILLUMINANCE) => Illuminance(),
const (LENGTH) => Length(),
const (MASS) => Mass(),
const (MOLAR_MASS) => MolarMass(),
const (MOLAR_VOLUME) => MolarVolume(),
const (POWER) => Power(),
const (PRESSURE) => Pressure(),
const (RECIPROCAL_OF_MOLAR_MASS) => ReciprocalOfMolarMass(),
const (SHOE_SIZE) => ShoeSize(),
const (SI_PREFIXES) => SIPrefixes(),
const (SPEED) => Speed(),
const (TEMPERATURE) => Temperature(),
const (TIME) => Time(),
const (TORQUE) => Torque(),
const (VOLUME) => Volume(),
_ => () {
assert(false, "${propertyEnum.runtimeType} is not a valid enum type");
return null;
}()
} as Property?;
}