ProperFilesize class Null safety

Constructors

ProperFilesize()

Properties

hashCode int
The hash code for this object. [...]
read-only, inherited
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent 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

generateHumanReadableFilesize(num size, {Bases base = Bases.Binary, int decimals = 3}) String
Generates a human readable string in xiB or xB from an int size in bytes Provide base (binary/metric) and decimals Defaults to binary units and 3 decimals
parseHumanReadableFilesize(String input) num
Converts a human readable filesize string (either in metric or in binary units) to an integer number of bytes

Constants

basesString → const Map<Bases, String>
Establishes relation between type of Bases and their human readable representation
{Bases.Metric : 'B', Bases.Binary : 'iB'}
basesValue → const Map<Bases, num>
Establishes relation between type of Bases and their logarithmic value
{Bases.Metric : 1000, Bases.Binary : 1024}
units → const List<String>
Available units
['', 'K', 'M', 'G', 'T', 'P', 'E']