DensityUnit enum
Represents units of density.
This enum implements the Unit interface to provide conversion capabilities and a display symbol for each density unit. All conversion factors are pre-calculated in the constructor relative to Kilogram per Cubic Meter (kg/m³).
- Inheritance
- Implemented types
- Available extensions
Values
- kilogramPerCubicMeter → const DensityUnit
-
Kilogram per Cubic Meter (kg/m³), the SI derived unit of density.
const DensityUnit(DensityFactors.kilogramPerCubicMeter, 'kg/m³') - gramPerCubicCentimeter → const DensityUnit
-
Gram per Cubic Centimeter (g/cm³), a common CGS unit of density.
const DensityUnit(DensityFactors.gramPerCubicCentimeter, 'g/cm³') - gramPerMilliliter → const DensityUnit
-
Gram per Milliliter (g/mL), equivalent to g/cm³, often used for liquids.
const DensityUnit(DensityFactors.gramPerMilliliter, 'g/mL')
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- index → int
-
A numeric identifier for the enumerated value.
no setterinherited
- name → String
-
Available on Enum, provided by the EnumName extension
The name of the enum value.no setter - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- symbol → String
-
A human-readable symbol or abbreviation for the unit.
final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Constants
-
values
→ const List<
DensityUnit> - A constant List of the values in this enum, in order of their declaration.