Fixed bug where the [folder] parameter was not being properly interpolated into the path, the strin "Folder was being used instead
This commit is contained in:
parent
ac5f4906d1
commit
9992e26264
1 changed files with 4 additions and 4 deletions
|
|
@ -17,15 +17,15 @@ class FirebaseStorageProvider {
|
||||||
/// Uploads a given file to the firebase storage bucket.
|
/// Uploads a given file to the firebase storage bucket.
|
||||||
///
|
///
|
||||||
/// It returns a [StorageUploadTask] which contains the status of the upload.
|
/// It returns a [StorageUploadTask] which contains the status of the upload.
|
||||||
/// The [folder] parameter should not start with "/" , it allows the file to
|
/// The [folder] parameter should not start with "/", but it should end with
|
||||||
/// be stored at any path in the bucket.
|
/// 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
|
/// The [type] parameter allows you to specify the extension of the file bein
|
||||||
/// uploaded, it defaults to png.
|
/// uploaded, it defaults to png.
|
||||||
StorageUploadTask uploadFile(File file,
|
StorageUploadTask uploadFile(File file,
|
||||||
{String folder, String type = 'png'}) {
|
{String folder = '', String type = 'png'}) {
|
||||||
final String fileId = _uuid.v1();
|
final String fileId = _uuid.v1();
|
||||||
final StorageReference fileReference =
|
final StorageReference fileReference =
|
||||||
_storage.child('folder/$fileId.$type');
|
_storage.child('$folder/$fileId.$type');
|
||||||
return fileReference.putFile(file);
|
return fileReference.putFile(file);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue