v0.4.0
converter
Uma biblioteca Dart para conversão entre diferentes unidades de medida para várias quantidades
22Curtidas 20,5 milDownloads em 30 dias160Pontos Pub
AndroidiOSWebmacOSWindowsLinux
Uma biblioteca Dart para conversão entre diferentes unidades de medida para várias quantidades.
^2.0.0^2.0.0^1.14.4Texto original em inglês. Visite o GitHub para a versão atual.
Version Build Status Coverage Status License
A Dart library for converting between different units of measurement for various quantities
See example/main.dart
Lengthfinal Length l1 = Length(2, 'm'); // 2 metres
final Length l2 = Length(37, 'cm'); // 37 centimetres
final Length l3 = Length(3.7, 'dm'); // 3.7 decimetres
final num l2ValueInInches = l2.valueIn('in');
// l2ValueInInches ~= 14.566929
final Length sum = l1 + l2;
// sum == 2370 millimetres
final Length difference = l1 - l2;
// difference ~= 5.347769 feet
final bool l1EQl2 = l1 == l2;
// l1EQl2 == false
final bool l2EQl3 = l2 == l3;
// l2EQl3 == true
final bool l1GTl2 = l1 > l2;
// l1GTl2 == true
final bool l1LTEl2 = l1 <= l2;
// l1LTEl2 == false
Timefinal Time t1 = Time.si(86400); // 86400 seconds
final Time t2 = Time(24, 'h'); // 24 hours
final Time t3 = Time(1500, 'min'); // 1500 minutes
final num t3ValueInDays = t3.valueIn('d');
// t3ValueInDays ~= 1.041667
final Time sum = t1 + t2;
// sum == 2880 minutes
final Time difference = t3 - t2;
// difference == 3600 seconds
final bool t1EQt2 = t1 == t2;
// t1EQt2 == true
final bool t2EQt3 = t2 == t3;
// t2EQt3 == false
final bool t3GTt2 = t3 > t2;
// t3GTt2 == true
final bool t3LTEt2 = t3 <= t2;
// t3LTEt2 == false
Lengthm - metre (SI)dm - decimetrecm - centimetremm - millimetreµm - micrometrenm - nanometredam - decametrehm - hectometrekm - kilometreMm - megametreGm - gigametreÅ - ångströmin - inchft - footyd - yardmi - milenmi - nautical mileMasskg - kilogram (SI)hg - hectogramdag - decagramg - gramdg - decigramcg - centigrammg - milligramµg - microgramng - nanogramMg - megagramGg - gigagramoz - ouncelb - poundt - tonne or metric tonlong-ton | ton - long ton or imperial tonshort-ton - short tonTimes - second (SI)ds - decisecondcs - centisecondms - millisecondµs - microsecondns - nanoseconddas - decasecondhs - hectosecondks - kilosecondMs - megasecondGs - gigasecondmin - minuteh - hourd - daywk - weekfn - fortnightmo - monthy - yeardec - decadec - centuryElectricCurrentA - ampere (SI)mA - milliamperekA - kiloamperestatA - statampereabA | Bi - abampere or biotTemperatureK - kelvin (SI)C - degree CelsiusF - degree FahrenheitR - degree RankineAccelerationm/s2 - metre per second squared (SI)cm/s2 | gal - centimetre per second squared or galileoft/s2 - foot per second squaredg - standard gravityAream2 - square metre (SI)dm2 - square decimetrecm2 - square centimetremm2 - square millimetreµm2 - square micrometredam2 - square decametrehm2 | ha - square hectometre or hectarekm2 - square kilometreMm2 - square megametrein2 - square inchft2 - square footmi2 - square mileac - acreElectricChargeC - coulomb (SI)mC - millicoulombµC - microcoulombnC - nanocoulombAh - ampere hourmAh - milliampere hourstatC | Fr - statcoulomb or franklinabC - abcoulombForceN - newton (SI)dyn - dynegf - gram-forcekgf - kilogram-forcelbf - pound-forcepdl - poundalFrequencyHz - hertz (SI)kHz - kilohertzMHz - megahertzGHz - gigahertzTHz - terahertzrad/s - radian per seconddeg/s - degree per secondrpm - revolutions per minutePlaneAnglerad - radian (SI)mrad - milliradiandeg - degreearcmin - arcminutearcsec - arcsecondgrad - gradianSolidAnglesr - steradian (SI)deg2 - square degreeSpeedm/s - metre per second (SI)km/h - kilometre per hourft/s - foot per secondmi/h - mile per hourkn - knotVolumem3 | kl - cubic metre or kilolitre (SI)dm3 | l - cubic decimetre or litrecm3 | ml - cubic centimetre or millilitremm3 | µl - cubic millimetre or microlitredam3 | Ml - cubic decametre or megalitrehm3 | Gl - cubic hectometre or gigalitrekm3 | Tl - cubic kilometre or teralitrein3 - cubic inchft3 - cubic footmi3 - cubic milegal - gallonqt - quartpt - pintfl-oz - fluid ouncetbsp - tablespoontsp - teaspoonSee documentation for more