FFXUploadTask class
An in-flight upload: awaitable like a Future<FFXFile>, with progress
and cancel.
final task = cloud.storage.upload(collection: 'photos', name: 'a.jpg',
contentType: 'image/jpeg', bytes: bytes);
task.progress.listen((p) => setState(() => fraction = p.fraction));
final file = await task;
Transient byte-transfer failures are retried in place against the same file record (no duplicate records). cancel aborts the transfer; the task then completes with FFXCancelledError and the server's pending file record is collected by the unreferenced-file reaper.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- isCancelled → bool
-
no setter
-
progress
→ Stream<
FFXUploadProgress> -
Progress events, ending when the task completes either way.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
asStream(
) → Stream< FFXFile> -
Creates a Stream containing the result of this future.
override
-
cancel(
) → void - Requests cancellation. Safe to call at any time; a no-op once the upload has completed.
-
catchError(
Function onError, {bool test(Object error)?}) → Future< FFXFile> -
Handles errors emitted by this Future.
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
then<
R> (FutureOr< R> onValue(FFXFile value), {Function? onError}) → Future<R> -
Register callbacks to be called when this future completes.
override
-
timeout(
Duration timeLimit, {FutureOr< FFXFile> onTimeout()?}) → Future<FFXFile> -
Stop waiting for this future after
timeLimithas passed.override -
toString(
) → String -
A string representation of this object.
inherited
-
whenComplete(
FutureOr< void> action()) → Future<FFXFile> -
Registers a function to be called when this future completes.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited