super_measurement 1.0.11 copy "super_measurement: ^1.0.11" to clipboard
super_measurement: ^1.0.11 copied to clipboard

Dart package for converting unit measurement

Dart package for converting unit measurement #

Available Unit #

Can be accessed using enum #

AngularSpeed #

  • DegreePerDay => AngularSpeedUnit.degreePerDay
  • DegreePerHour => AngularSpeedUnit.degreePerHour
  • DegreePerMinute => AngularSpeedUnit.degreePerMinute
  • DegreePerSecond => AngularSpeedUnit.degreePerSecond
  • RadianPerDay => AngularSpeedUnit.radianPerDay
  • RadianPerHour => AngularSpeedUnit.radianPerHour
  • RadianPerMinute => AngularSpeedUnit.radianPerMinute
  • RadianPerSecond => AngularSpeedUnit.radianPerSecond
  • RevolutionPerDay => AngularSpeedUnit.revolutionPerDay
  • RevolutionPerHour => AngularSpeedUnit.revolutionPerHour
  • RevolutionPerMinute => AngularSpeedUnit.revolutionPerMinute
  • RevolutionPerSecond => AngularSpeedUnit.revolutionPerSecond

Area #

  • Acres => AreaUnit.acres
  • Hectares => AreaUnit.hectares
  • SquareCentimeters => AreaUnit.squareCentimeters
  • SquareFoot => AreaUnit.squareFoot
  • SquareInches => AreaUnit.squareInches
  • SquareKilometers => AreaUnit.squareKilometers
  • SquareMeters => AreaUnit.squareMeters
  • SquareMiles => AreaUnit.squareMiles
  • SquareYards => AreaUnit.squareYards

DataStorage #

  • Bit => DataStorageUnit.bit
  • Byte => DataStorageUnit.byte
  • Gigabit => DataStorageUnit.gigabit
  • Gigabyte => DataStorageUnit.gigabyte
  • Kilobit => DataStorageUnit.kilobit
  • Kilobyte => DataStorageUnit.kilobyte
  • Megabit => DataStorageUnit.megabit
  • Megabyte => DataStorageUnit.megabyte
  • Terabit => DataStorageUnit.terabit
  • Terabyte => DataStorageUnit.terabyte

DataTransfer #

  • GigabitPerSecond => DataTransferUnit.gigabitPerSecond
  • GigabytePerSecond => DataTransferUnit.gigabytePerSecond
  • KilobitPerSecond => DataTransferUnit.kilobitPerSecond
  • KilobytePerSecond => DataTransferUnit.kilobytePerSecond
  • MegabitPerSecond => DataTransferUnit.megabitPerSecond
  • MegabytePerSecond => DataTransferUnit.megabytePerSecond

Energy #

  • CalorieInternational => EnergyUnit.calorieInternational
  • CalorieNutritional => EnergyUnit.calorieNutritional
  • CalorieThermochemical => EnergyUnit.calorieThermochemical
  • ElectronVolt => EnergyUnit.electronVolt
  • GigaJoule => EnergyUnit.gigaJoule
  • Joule => EnergyUnit.joule
  • KiloJoule => EnergyUnit.kiloJoule
  • KilowattHour => EnergyUnit.kilowattHour
  • MegaJoule => EnergyUnit.megaJoule
  • MegawattHour => EnergyUnit.megawattHour
  • WattHour => EnergyUnit.wattHour

Length #

  • Centimeters => LengthUnit.centimeters
  • Feet => LengthUnit.feet
  • Furlongs => LengthUnit.furlongs
  • Inches => LengthUnit.inches
  • Kilometers => LengthUnit.kilometers
  • Meters => LengthUnit.meters
  • Miles => LengthUnit.miles
  • Millimeters => LengthUnit.millimeters
  • NauticalMiles => LengthUnit.nauticalMiles
  • Yards => LengthUnit.yards

Mass #

  • Carats => MassUnit.carats
  • Grams => MassUnit.grams
  • Kilograms => MassUnit.kilograms
  • Milligrams => MassUnit.milligrams
  • Ounces => MassUnit.ounces
  • Pounds => MassUnit.pounds
  • Quintal => MassUnit.quintal
  • StoneUK => MassUnit.stoneUK
  • TonUK => MassUnit.tonUK
  • TonUS => MassUnit.tonUS
  • Tonne => MassUnit.tonne

Power #

  • Horsepower => PowerUnit.horsepower
  • Kilowatt => PowerUnit.kilowatt
  • Megawatt => PowerUnit.megawatt
  • Milliwatt => PowerUnit.milliwatt
  • Watt => PowerUnit.watt

Pressure #

  • Bar => PressureUnit.bar
  • InchesOfMercury => PressureUnit.inchesOfMercury
  • MillimeterOfMercury => PressureUnit.millimeterOfMercury
  • Pascal => PressureUnit.pascal
  • PoundsPerSquareInch => PressureUnit.poundsPerSquareInch
  • StandardAtmosphere => PressureUnit.standardAtmosphere
  • Torr => PressureUnit.torr

Speed #

  • FootPerHour => SpeedUnit.footPerHour
  • FootPerMinute => SpeedUnit.footPerMinute
  • FootPerSecond => SpeedUnit.footPerSecond
  • KilometerPerHour => SpeedUnit.kilometerPerHour
  • Knot => SpeedUnit.knot
  • Light => SpeedUnit.light
  • MeterPerHour => SpeedUnit.meterPerHour
  • MeterPerMinute => SpeedUnit.meterPerMinute
  • MeterPerSecond => SpeedUnit.meterPerSecond
  • MilesPerHour => SpeedUnit.milesPerHour
  • MilesPerMinute => SpeedUnit.milesPerMinute
  • YardPerMinute => SpeedUnit.yardPerMinute

Time #

  • Day => TimeUnit.day
  • Hour => TimeUnit.hour
  • Millisecond => TimeUnit.millisecond
  • Minute => TimeUnit.minute
  • Second => TimeUnit.second
  • Week => TimeUnit.week
  • Year => TimeUnit.year

Volume #

  • BarrelsImperial => VolumeUnit.barrelsImperial
  • BarrelsUS => VolumeUnit.barrelsUS
  • CubicCentimeters => VolumeUnit.cubicCentimeters
  • CubicFoot => VolumeUnit.cubicFoot
  • CubicInches => VolumeUnit.cubicInches
  • CubicMeters => VolumeUnit.cubicMeters
  • CubicYards => VolumeUnit.cubicYards
  • GallonsImperial => VolumeUnit.gallonsImperial
  • GallonsUS => VolumeUnit.gallonsUS
  • Liters => VolumeUnit.liters
  • Milliliters => VolumeUnit.milliliters

Because the nature of this package, some raw conversion does not resulting in same value, for example:

void main(){
  print([Feet(1), Inches(12)].toInches); // 24.00000000006096
  print([Feet(1), Inches(12)].toInches.withPrecision()); // 24
  print([Feet(1), Inches(12)].toFeet); // 1.9999999999949203
  print([Feet(1), Inches(12)].toFeet.withPrecision()); // 2
  print(Inches(12).toFeet); // 0.9999999999949201
  print(Inches(12).toFeet.withPrecision()); // 1
  print(Inches(12).toInches); // 12
  print(Inches(12).toInches.withPrecision()); // 12
  print(Feet(1).toFeet); // 1
  print(Feet(1).toFeet.withPrecision()); // 1
  print(Feet(1).toInches); // 12.000000000060961
  print(Feet(1).toInches.withPrecision()); // 12
}

Use withPrecision() for more precision

See example for usage #