UploadState class

Union class to hold various UploadState of a attachment.

Implementers
Annotations
  • @freezed

Constructors

UploadState.failed({required String error})
Failed state of the union
const
factory
UploadState.fromJson(Map<String, dynamic> json)
Creates a new instance from a json
factory
UploadState.inProgress({required int uploaded, required int total})
InProgress state of the union
const
factory
UploadState.preparing()
Preparing state of the union
const
factory
UploadState.success()
Success state of the union
const
factory

Properties

hashCode int
The hash code for this object.
no setterinherited
isFailed bool
Returns true if state is Failed
no setter
isInProgress bool
Returns true if state is InProgress
no setter
isPreparing bool
Returns true if state is Preparing
no setter
isSuccess bool
Returns true if state is Success
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

map<TResult extends Object?>({required TResult preparing(Preparing value), required TResult inProgress(InProgress value), required TResult success(Success value), required TResult failed(Failed value)}) → TResult
inherited
mapOrNull<TResult extends Object?>({TResult? preparing(Preparing value)?, TResult? inProgress(InProgress value)?, TResult? success(Success value)?, TResult? failed(Failed value)?}) → TResult?
inherited
maybeMap<TResult extends Object?>({TResult preparing(Preparing value)?, TResult inProgress(InProgress value)?, TResult success(Success value)?, TResult failed(Failed value)?, required TResult orElse()}) → TResult
inherited
maybeWhen<TResult extends Object?>({TResult preparing()?, TResult inProgress(int uploaded, int total)?, TResult success()?, TResult failed(String error)?, required TResult orElse()}) → TResult
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() Map<String, dynamic>
inherited
toString() String
A string representation of this object.
inherited
when<TResult extends Object?>({required TResult preparing(), required TResult inProgress(int uploaded, int total), required TResult success(), required TResult failed(String error)}) → TResult
inherited
whenOrNull<TResult extends Object?>({TResult? preparing()?, TResult? inProgress(int uploaded, int total)?, TResult? success()?, TResult? failed(String error)?}) → TResult?
inherited

Operators

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