Ejemplo: subir a firebase storage flutter
Future<String> uploadFile(File _image) async { StorageReference storageReference = FirebaseStorage.instance .ref() .child('sightings/${Path.basename(_image.path)}'); StorageUploadTask uploadTask = storageReference.putFile(_image); await uploadTask.onComplete; print('File Uploaded'); String returnURL; await storageReference.getDownloadURL().then((fileURL) { returnURL = fileURL; }); return returnURL;}
¡Haz clic para puntuar esta entrada!
(Votos: 0 Promedio: 0)