GcsResumableFileUploader class final
Uploads a file to a Google Cloud Storage resumable upload session in
chunks of chunkSize bytes. A chunk that fails with a transient error is
resumed from the offset the storage reports, up to maxRetries attempts
without progress. A request with no send progress for timeout fails with
DioExceptionType.sendTimeout.
Constructors
- GcsResumableFileUploader(String uploadDescription, {Dio? dio, Duration? timeout, int chunkSize = defaultChunkSize, int maxRetries = defaultMaxRetries, Duration retryDelay(int attempt)?})
-
timeoutbounds connecting, the response wait, and time without send progress.chunkSizemust be a multiple of chunkSizeUnit.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
upload(
Stream< List< stream, int length, {UploadProgressCallback? onProgress}) → Future<int> >bool> -
Reads
streaminto memory, then uploads it. Returns true when the storage finalized the file. -
uploadByteData(
ByteData byteData, {UploadProgressCallback? onProgress}) → Future< bool> - Uploads a file contained by a ByteData object, returns true if successful.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Constants
- chunkSizeUnit → const int
- GCS requires chunk sizes in multiples of 256 KiB.
- defaultChunkSize → const int
- Default chunk size.
- defaultMaxRetries → const int
- Default consecutive failed attempts before giving up.