uploadFileDeferred method

Future<FileAttachment> uploadFileDeferred(
  1. String path,
  2. Stream<Uint8List> dataStream,
  3. int size, {
  4. String? mimeType,
})

Implementation

Future<FileAttachment> uploadFileDeferred(String path, Stream<Uint8List> dataStream, int size, {String? mimeType}) async {
  final room = this.room;
  if (room == null) {
    throw StateError('File uploads require a room storage provider.');
  }
  final uploader = MeshagentFileUpload.deferred(room: room, path: path, dataStream: dataStream, size: size, mimeType: mimeType);

  uploader.addListener(notifyListeners);

  _attachmentUploads.add(uploader);
  notifyListeners();

  return uploader;
}