uploadFile method

Future uploadFile(
  1. String path,
  2. File file
)

Upload given file to the provided path returns the downloadUrl for the uploaded file.

Implementation

Future<dynamic> uploadFile(String path, File file) async {
  Reference ref = _storage.ref().child(path);
  UploadTask uploadTask = ref.putFile(file);
  await uploadTask;
  return ref.getDownloadURL();
}