UploadState class Null safety

Union class to hold various UploadState of a attachment.

Implementers
Annotations

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.
read-only, inherited
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited

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
@optionalTypeArgs, inherited
mapOrNull<TResult extends Object?>({TResult preparing(Preparing value)?, TResult inProgress(InProgress value)?, TResult success(Success value)?, TResult failed(Failed value)?}) → TResult?
@optionalTypeArgs, 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
@optionalTypeArgs, inherited
maybeWhen<TResult extends Object?>({TResult preparing()?, TResult inProgress(int uploaded, int total)?, TResult success()?, TResult failed(String error)?, required TResult orElse()}) → TResult
@optionalTypeArgs, inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent 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
@optionalTypeArgs, inherited
whenOrNull<TResult extends Object?>({TResult preparing()?, TResult inProgress(int uploaded, int total)?, TResult success()?, TResult failed(String error)?}) → TResult?
@optionalTypeArgs, inherited

Operators

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