FileChan class

Implementation of AnonFilesClientBase for https://filechan.org/.

Usage:

final FileChan fileChan = FileChan();
await for (final AnonFileUploadEvent event
    in fileChan.upload(bytes: bytes, filename: filename)) {
  print('Event: $event');
}
Inheritance

Constructors

FileChan({String apiUploadUrl = kApiUploadUrl})

Properties

apiUploadUrl String
The target upload URL endpoint, you can override it through the constructor or by extending this class.
finalinherited
hashCode int
The hash code for this object.
no setterinherited
id String
Identifies the current client, generally used to differ between the several API domains.
finalinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

defaultUploadResponseJsonMapper(Map<String, dynamic> json) AnonFileUploadResponse
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited
uploadFileBytes({required Stream<Uint8List> byteStream, required String filename, required int length, MultipartRequestClient? multipartRequestClient, AnonFileUploadResponse? mapResponseJson(Map<String, dynamic>)?}) Future<AnonFileUploadResponse?>
Upload a given file bytes with a given filename and return the response as a Future.
inherited
uploadFileBytesWithProgress({required Stream<Uint8List> byteStream, required String filename, required int length, MultipartRequestClient? multipartRequestClient, AnonFileUploadResponse? mapResponseJson(Map<String, dynamic>)?}) Stream<AnonFileUploadEvent>
Upload a given file bytes with a given filename and return the response as a Stream.
inherited

Operators

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

Constants

kApiUploadUrl → const String