From 6637f2f220f06fa330f141a6a6cc16b65547714e Mon Sep 17 00:00:00 2001 From: AYM1607 Date: Wed, 27 Feb 2019 18:40:56 -0600 Subject: [PATCH] Fixed bug where the [folder] parameter was not being properly interpolated into the path, the strin "Folder was being used instead --- lib/src/resources/firebase_storage_provider.dart | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/src/resources/firebase_storage_provider.dart b/lib/src/resources/firebase_storage_provider.dart index 7f5bd0f..19fe424 100644 --- a/lib/src/resources/firebase_storage_provider.dart +++ b/lib/src/resources/firebase_storage_provider.dart @@ -17,15 +17,15 @@ class FirebaseStorageProvider { /// Uploads a given file to the firebase storage bucket. /// /// It returns a [StorageUploadTask] which contains the status of the upload. - /// The [folder] parameter should not start with "/" , it allows the file to - /// be stored at any path in the bucket. + /// The [folder] parameter should not start with "/", but it should end with + /// it. it allows the file to be stored at any path in the bucket. /// The [type] parameter allows you to specify the extension of the file bein /// uploaded, it defaults to png. StorageUploadTask uploadFile(File file, - {String folder, String type = 'png'}) { + {String folder = '', String type = 'png'}) { final String fileId = _uuid.v1(); final StorageReference fileReference = - _storage.child('folder/$fileId.$type'); + _storage.child('$folder/$fileId.$type'); return fileReference.putFile(file); } }