I am new to flutter and I builtt an application for the web where contractors will use it to take photos of their work and upload them so our team can review them. Currently, I have it going into fire storage. They type in their work order number then can access gallery or photo and select it and hit upload and it goes to firestorage.
I want to build another page where our team can type in the work order number and it pulls all photos. I store them in FBS with path = '$workOrder/$dateTime'; I know you cant really use firebase storage for that and its best to run a query for all the URLs for the images in a database.
I can't find much on using firestore to grab photos.
but I'm a beginner and looking to learn any advice on how to approach this would be appreciated.
(i know its better to just do ios or android but I want to do flutter web)
below is how I am uploading it to FB
Future<PickedFile> pickImage() async {
try {
return await ImagePicker().getImage(source: ImageSource.gallery, imageQuality: 10);
} catch (error) {
print('error loading image : $error');
return null;
}
}
uploadPhotos(PickedFile pickedFile) async {
final dateTime = DateTime.now();
final workOrder = double.parse(workOrderNumber.value.text);
final path = '$workOrder/$dateTime';
var fileByte = await pickedFile.readAsBytes();
setState(() {
_uploadTask = fb
.storage()
.refFromURL('****')
.child(path)
.put(fileByte, fb.UploadMetadata(contentType: 'image/png'));
});
question from:
https://stackoverflow.com/questions/65949402/how-to-download-images-from-firebase-cloud-firestore-forbebase-storage 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…