Я пытался загрузить изображение в магазин Firebase, используя библиотеку Средство выбора изображений,
Но в консоли отображается формат application/octet-stream, из-за чего изображение не видно. Есть ли способ преобразовать этот формат в изображение в самом дротике при загрузке.
Либо передайте расширение файла имени файла при загрузке
FirebaseStorage.instance
.ref()
.child(path)
.child('image.jpg');
или передать метаданные
FirebaseStorage.instance
.ref()
.child(path)
.child('image');
imageStore.putFile(file, StorageMetadata(contentType: 'image/jpeg'));
https://firebase.google.com/docs/storage/web/upload-files#add_file_metadata
Add File Metadata
When uploading a file, you can also specify metadata for that file. This metadata contains typical file metadata properties such as name, size, and contentType (commonly referred to as MIME type). Cloud Storage automatically infers the content type from the file extension where the file is stored on disk, but if you specify a contentType in the metadata it will override the auto-detected type. If no contentType metadata is specified and the file doesn't have a file extension, Cloud Storage defaults to the type application/octet-stream. More information on file metadata can be found in the Use File Metadata section.