uploadData method

Future<String?> uploadData(
  1. String fileName,
  2. dynamic image
)

Implementation

Future<String?> uploadData(String fileName, dynamic image) async {
  var task;
  if (image is Uint8List)
    task = _storageRepository.uploadByteData(['ChatPictures', fileName], image);
  else if (image is io.File) {
    task = _storageRepository.uploadFile(['ChatPictures', fileName], image);
  } // else if (image is Blob) {
  else
    task = _storageRepository.uploadBlob(['ChatPictures', fileName], image);
  // }
  // if (task == null) return null;

  var t = await task;
  return await t.ref.getDownloadURL();
}