Unit class
Describes a storage amount unit
While a public constructor is provided you should really consider this as a enum class instead.
Provided values:
- Unit.auto: Default, special, unit, which instructs the formatting code to chose automatically choose the best unit based on the provided inputs.
- Unit.byte: While it is marked as a decimal based unit it does also refer to binary based unit.
Decimal (1000-based multiplier) units
- Unit.kilobyte: 1 KB
- Unit.megabyte: 1 MB
- Unit.gigabyte: 1 GB
- Unit.petabyte: 1 TB
- Unit.exabyte: 1 EB
- Unit.zettabyte: 1 ZB
- Unit.yottabyte: 1 YB
- Unit.kilobyte: 1 KB
Binary (1024-based multiplier) units
- Unit.kibibyte: 1 KiB
- Unit.mebibyte: 1 MiB
- Unit.gibibyte: 1 GiB
- Unit.tebibyte: 1 TiB
- Unit.pebibyte: 1 PiB
- Unit.exbibyte: 1 EiB
- Unit.zebibyte: 1 ZiB
- Unit.yobibyte: 1 YiB
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- multiplier → double
-
final
- name → String
-
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- type → UnitType
-
final
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
Constants
- auto → const Unit
- byte → const Unit
- exabyte → const Unit
- exbibyte → const Unit
- gibibyte → const Unit
- gigabyte → const Unit
- kibibyte → const Unit
- kilobyte → const Unit
- mebibyte → const Unit
- megabyte → const Unit
- pebibyte → const Unit
- petabyte → const Unit
- tebibyte → const Unit
- terabyte → const Unit
- yobibyte → const Unit
- yottabyte → const Unit
- zebibyte → const Unit
- zettabyte → const Unit