Exact length conversions between metric (meters) and imperial (feet), plus human-readable string formatters.
The convertMetersToFeet / convertFeetToMeters primitives are the bulletproof core: zero dependencies, no opinions about formatting or locale. NaN and infinity inputs PROPAGATE through them unchanged — the multiplication/division contract of IEEE-754 doubles — so callers that must reject non-finite input should guard before calling.
The *ToString formatters are a thin English-only convenience. Apps that
localize unit names should format the raw converted double themselves
rather than parse these strings.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
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
Static Methods
-
convertFeetToMeters(
double feet) → double -
Converts
feetto meters. -
convertMetersToFeet(
double meters) → double -
Converts
metersto feet. -
feetToString(
double feet, {bool useAbbreviations = false, bool showInches = true, int decimalPlaces = 2}) → String -
Formats
feetas a human-readable string. -
metersToString(
double meters, {bool useAbbreviations = false, int decimalPlaces = 2}) → String -
Formats
metersas"1.78 meters"or"1.78 m"withuseAbbreviations.
Constants
- conversionFactor → const double
- Meters → feet multiplier (1 m = 3.280839895 ft). Full precision, defined once so the factor is reviewed and tested in a single place.