uploadFile method

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

Implementation

Future<FileAttachment> uploadFile(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(room: room, path: path, dataStream: dataStream, size: size, mimeType: mimeType);
  uploader.addListener(notifyListeners);

  _attachmentUploads.add(uploader);
  notifyListeners();

  return uploader;
}