ByteModel class sealed

Available extensions
Annotations
  • @freezed

Constructors

ByteModel.bytes(double value)
const
factory
ByteModel.create(double bytes)
factory
ByteModel.createFromFile(File file)
factory
ByteModel.gb(double value)
const
factory
ByteModel.kb(double value)
const
factory
ByteModel.mb(double value)
const
factory
ByteModel.tb(double value)
const
factory

Properties

copyWith → $ByteModelCopyWith<ByteModel>
Create a copy of ByteModel with the given fields replaced by the non-null parameter values.
no setterinherited
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
unit String

Available on ByteModel, provided by the ByteModelEx extension

no setter
value double
no setterinherited

Methods

format([int fixed = 1]) String

Available on ByteModel, provided by the ByteModelEx extension

格式化显示大小
map<TResult extends Object?>({required TResult bytes(BytesModel value), required TResult kb(KbModel value), required TResult mb(MbModel value), required TResult gb(GbModel value), required TResult tb(TbModel value)}) → TResult

Available on ByteModel, provided by the ByteModelPatterns extension

A switch-like method, using callbacks.
mapOrNull<TResult extends Object?>({TResult? bytes(BytesModel value)?, TResult? kb(KbModel value)?, TResult? mb(MbModel value)?, TResult? gb(GbModel value)?, TResult? tb(TbModel value)?}) → TResult?

Available on ByteModel, provided by the ByteModelPatterns extension

A variant of map that fallback to returning null.
maybeMap<TResult extends Object?>({TResult bytes(BytesModel value)?, TResult kb(KbModel value)?, TResult mb(MbModel value)?, TResult gb(GbModel value)?, TResult tb(TbModel value)?, required TResult orElse()}) → TResult

Available on ByteModel, provided by the ByteModelPatterns extension

A variant of map that fallback to returning orElse.
maybeWhen<TResult extends Object?>({TResult bytes(double value)?, TResult kb(double value)?, TResult mb(double value)?, TResult gb(double value)?, TResult tb(double value)?, required TResult orElse()}) → TResult

Available on ByteModel, provided by the ByteModelPatterns extension

A variant of when that fallback to an orElse callback.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited
when<TResult extends Object?>({required TResult bytes(double value), required TResult kb(double value), required TResult mb(double value), required TResult gb(double value), required TResult tb(double value)}) → TResult

Available on ByteModel, provided by the ByteModelPatterns extension

A switch-like method, using callbacks.
whenOrNull<TResult extends Object?>({TResult? bytes(double value)?, TResult? kb(double value)?, TResult? mb(double value)?, TResult? gb(double value)?, TResult? tb(double value)?}) → TResult?

Available on ByteModel, provided by the ByteModelPatterns extension

A variant of when that fallback to returning null

Operators

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