/measurement

dart library for measurements

Primary LanguageDartMIT LicenseMIT

measurement

Dart CI - deploy

Dart library for handling units and values

Installation

pub.dev/measurement

Usage

See

Common utilities

DistanceConversion.convertValue(
    DistanceUnit.KILOMETRES, DistanceUnit.YARD, 1.34) // 1465.4374

Modelling distance and conversion

Distance distance = Distance(1.34, DistanceUnit.KILOMETRES);
distance.getValue(DistanceUnit.METRES); // 1340
distance.convert(DistanceUnit.METRES);  // Distance(1340, DistanceUnit.METRES)

Design

Default

To avoid confusion among developers, there is no default unit for a measurement. Unit must be consciously supplied. If unit is known before hand, to avoid calculation measurements can be standardized.

Functional programming

Conversions are as far as possible generated before hand, best during compilation. Functions are looked up with O(1) complexity.

Contribution

package,

For help getting started with Flutter, view our online documentation, which offers tutorials, samples, guidance on mobile development, and a full API reference.