Finally got the solution.
Flutter package firebase_storage: ^3.0.6 has no method called listAll(). Only able to get single file/image download url using getDownloadURL() method from firebase storage.
Recently (19 hours ago, 16th Oct 2019) flutter team has added this functionality to get all files and folders using listAll() method. Below is the git link.
https://github.com/FirebaseExtended/flutterfire/pull/232
Need to use package in pubspec.yaml like below :
firebase_storage:
git:
url: git://github.com/danysz/flutterfire.git
ref: master
path: packages/firebase_storage
This is temporary solution until they update this package version firebase_storage: ^3.0.6
Example Code :
void getFirebaseImageFolder() {
final StorageReference storageRef =
FirebaseStorage.instance.ref().child('Gallery').child('Images');
storageRef.listAll().then((result) {
print("result is $result");
});
}
Hope it will be useful for many people. Happy coding!
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…