humanizer library

A Dart library to convert values into human-friendly Strings.

Classes

ApproximateTimeTransformation
A transformation to convert a Duration representing an offset of time into an approximate, human-friendly description.
Area
A unit of measurement representing a two-dimensional area.
AreaFormat
Allows an Area to be formatted.
AreaRate
Represents a rate of change in Area.
AreaRateFormat
Allows an AreaRate to be formatted.
AreaRateTransformation
A transformation to convert an AreaRate to a human-readable String by using an AreaRateFormat.
AreaTransformation
A transformation to convert an Area to a human-readable String by using an AreaFormat.
AreaUnits
Provides convenience sets of commonly used AreaUnits.
CardinalWordsTransformation
A transformation to convert an input int into cardinal form.
FunctionTransformation<T, U>
A Transformation that invokes a given function of type TransformationFunction.
InformationRate
Represents a rate of transfer of InformationSize.
InformationRateFormat
Allows an InformationRate to be formatted.
InformationRateTransformation
A transformation to convert an InformationRate to a human-readable String by using an InformationRateFormat.
InformationSize
A unit of measurement representing information size.
InformationSizeFormat
Allows an InformationSize to be formatted.
InformationSizeTransformation
A transformation to convert an InformationSize to a human-readable String by using an InformationSizeFormat.
InformationUnits
Provides convenience sets of commonly used InformationUnits.
Length
A unit of measurement representing a one-dimensional length.
LengthFormat
Allows a Length to be formatted.
LengthRate
Represents a rate of change in Length (a.k.a. a speed).
LengthRateFormat
Allows a LengthRate to be formatted.
LengthRateTransformation
A transformation to convert a LengthRate to a human-readable String by using a LengthRateFormat.
LengthTransformation
A transformation to convert a Length to a human-readable String by using a LengthFormat.
LengthUnits
Provides convenience sets of commonly used LengthUnits.
OrdinalNumericalTransformation
A transformation to convert an input int into numerical ordinal form.
OrdinalWordsTransformation
A transformation to convert an input int into word ordinal form.
PluralityTransformation
A transformation to convert the plural form of an input String.
Quantity
A unit of measurement representing a dimensionless quantity (a.k.a. "bare", "pure", or "scalar" quantity). This means it is a quantity that has no corresponding physical dimension associated with it.
QuantityFormat
Allows a Quantity to be formatted.
QuantityRate
Represents a rate of change in Quantity.
QuantityRateFormat
Allows a QuantityRate to be formatted.
QuantityRateTransformation
A transformation to convert a QuantityRate to a human-readable String by using a QuantityRateFormat.
QuantityTransformation
A transformation to convert a Quantity to a human-readable String by using a QuantityFormat.
QuantityUnits
Provides convenience sets of commonly used QuantityUnits.
RateUnits
Provides convenience sets of commonly used RateUnits.
SymbolName
Represents the name of a symbol.
SymbolToHumanizedNameTransformation
A transformation to convert a SymbolName into a human-friendly representation. The symbol's name can be camel-, pascal-, snake-, or kebab-cased.
Temperature
A unit of measurement representing a temperature.
TemperatureFormat
Allows a Length to be formatted.
TemperatureRate
Represents a rate of change in Temperature.
TemperatureRateFormat
Allows a TemperatureRate to be formatted.
TemperatureRateTransformation
A transformation to convert a TemperatureRate to a human-readable String by using a TemperatureRateFormat.
TemperatureTransformation
A transformation to convert a Temperature to a human-readable String by using a TemperatureFormat.
TemperatureUnits
Provides convenience sets of commonly used TemperatureUnits.
Time
A unit of measurement representing time.
TimeFormat
Allows a Time to be formatted.
TimeRate
Represents a rate of change in Time.
TimeRateFormat
Allows a TimeRate to be formatted.
TimeRateTransformation
A transformation to convert a TimeRate to a human-readable String by using a TimeRateFormat.
TimeTransformation
A transformation to convert a Time to a human-readable String by using a TimeFormat.
TimeUnits
Provides convenience sets of commonly used TimeUnits.
ToSentenceCaseTransformation
A transformation to convert a String into sentence case.
ToTitleCaseTransformation
A transformation to convert a String into title case.
Transformation<T, U>
Facilitates transforming a value of type T to type U.
TruncateToFixedLengthTransformation
A transformation to convert a String into a truncated variant that contains at most length characters.
TruncateToFixedNonWhitespaceLengthTransformation
A transformation to convert a String into a truncated variant that contains at most length non-whitespace characters.
TruncateToFixedWordLengthTransformation
A transformation to convert a String into a truncated variant that contains at most length words.
UnitOfMeasurement<TUnit, TValue extends UnitOfMeasurement<TUnit, dynamic>>
Base class for units of measurement.
UnitOfMeasurementFormat<TValue, TUnit>
Base class for unit of measurement formats.
UnitOfMeasurementRate<TValue extends UnitOfMeasurement>
Base class for a unit of measurement rate.
Volume
A unit of measurement representing a three-dimensional volume.
VolumeFormat
Allows a Volume to be formatted.
VolumeRate
Represents a rate of change in Volume.
VolumeRateFormat
Allows a VolumeRate to be formatted.
VolumeRateTransformation
A transformation to convert a VolumeRate to a human-readable String by using a VolumeRateFormat.
VolumeTransformation
A transformation to convert a Volume to a human-readable String by using a VolumeFormat.
VolumeUnits
Provides convenience sets of commonly used VolumeUnits.
Weight
A unit of measurement representing a weight.
WeightFormat
Allows a Weight to be formatted.
WeightRate
Represents a rate of change in Weight.
WeightRateFormat
Allows a WeightRate to be formatted.
WeightRateTransformation
A transformation to convert a WeightRate to a human-readable String by using a WeightRateFormat.
WeightTransformation
A transformation to convert a Weight to a human-readable String by using a WeightFormat.
WeightUnits
Provides convenience sets of commonly used WeightUnits.

Enums

AreaUnit
Defines supported units of area.
Granularity
Defines levels of granularity a DateTime can be humanized by a ApproximateTimeTransformation.
InformationUnit
Defines supported units of information.
LengthUnit
Defines supported units of length.
Plurality
Defines possible plurality values.
QuantityUnit
Defines supported units for dimensionless quantities.
RateUnit
Defines valid units for rates.
TemperatureUnit
Defines supported units of temperature.
TimeUnit
Defines supported units of time.
TruncateAt
Defines possible locations to truncate a String.
VolumeUnit
Defines supported units of volume.
WeightUnit
Defines supported units of weight.

Extensions

ApproximateTimeExtensions on Duration
Provides humanizing extensions on Duration.
AreaUnitExtensions on AreaUnit
Contains extensions for AreaUnit.
CardinalExtensions on int
Provides cardinal-related extensions on int.
EnumExtensions on Enum
Provides symbol-related humanizing extensions on Enum.
InformationUnitExtensions on InformationUnit
Contains extensions for InformationUnit.
LengthUnitExtensions on LengthUnit
Contains extensions for LengthUnit.
OrdinalExtensions on int
Provides ordinal-related extensions on int.
PluralityExtensions on String
Provides plurality-related extension methods on String.
QuantityUnitExtensions on QuantityUnit
Contains extensions for QuantityUnit.
RateUnitExtensions on RateUnit
Defines extensions on RateUnit.
StringCasingExtensions on String
Provides casing-related extension methods on String.
StringTruncateExtensions on String
Provides truncation-related extensions on String.
SymbolNameExtensions on SymbolName
Provides humanizing extensions on SymbolName.
TemperatureUnitExtensions on TemperatureUnit
Contains extensions for TemperatureUnit.
TimeUnitExtensions on TimeUnit
Contains extensions for TimeUnit.
TransformationExtensions on Transformation<T, U>
Provides useful extensions against Transformation.
UnitsOfMeasurementIntExtensions on int
Provides extensions on int related to units of measurement.
UnitsOfMeasurementQuantityExtensions on Quantity
Provides extensions on Quantity related to units of measurement.
UnitsOfMeasurementRationalExtensions on Rational
Provides extensions on Rational related to units of measurement.
VolumeUnitExtensions on VolumeUnit
Contains extensions for VolumeUnit.
WeightUnitExtensions on WeightUnit
Contains extensions for WeightUnit.

Constants

defaultRatePattern → const String
The default pattern used to format rated unit of measurement values.
defaultValuePattern → const String
The default pattern used to format unit of measurement values.

Typedefs

TransformationFunction<T, U> = U Function(T input, String locale)
A definition for functions that can be passed into FunctionTransformation.