CsafeIntegerWithUnits class

Represents a "Integer plus Unit specifier" type from the CSAFE spec

This builds on top of IntegerWithUnits by adding shortcuts for different common units, a concrete implementation of toBytes and other helper methods

Inheritance

Constructors

CsafeIntegerWithUnits(dynamic value, dynamic unit, {int byteLength = 3})
CsafeIntegerWithUnits.fromBytes(Uint8List bytes, {Endian inputEndian = Endian.little})
CsafeIntegerWithUnits.kilometers(dynamic value, {int byteLength = 3})
CsafeIntegerWithUnits.meters(dynamic value, {int byteLength = 3})
CsafeIntegerWithUnits.watts(dynamic value, {int byteLength = 3})

Properties

byteLength int
no setterinherited
hashCode int
The hash code for this object.
no setterinherited
props List<Object?>
The list of properties that will be used to determine whether two instances are equal.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
stringify bool?
If set to true, the toString method will be overridden to output this instance's props.
no setterinherited
unit CsafeUnits
finalinherited
value int
finalinherited

Methods

matchesType(UnitType type) bool
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toBytes() Uint8List
override
toString() String
A string representation of this object.
inherited

Operators

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