UnitOfMeasurement class

Unit of measurement (kilogram, meter, feet, etc.).

Subclasses

Defining your own unit

import 'package:kind/kind.dart';

const UnitOfMeasurement exampleUnit = UnitOfMeasurement(
  name: 'example',
);

Usage in numeric kinds

Subclasses of NumericKind support defining unit of measurement:

import 'package:kind/kind.dart';

const Float64Kind travelDistanceKind = Float64Kind(
  unitOfMeasurement: UnitOfLength.meters,
  min: 0.0,
);
Implemented types
Implementers

Constructors

UnitOfMeasurement.specify({required String identifier})
const

Properties

hashCode int
The hash code for this object.
no setteroverride
identifier String
Identifier of the constant.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

compareTo(UnitOfMeasurement other) int
Compares this object to another object.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
override

Operators

operator ==(Object other) bool
The equality operator.
override

Static Properties

kind Kind<UnitOfMeasurement>
final
values List<UnitOfMeasurement>
All default units.
final