无法将mp3上传到Firebase存储

问题描述

我正在使用Flutter file_picker_web获取mp3文件,但是一旦尝试将其上传到Firebase存储中,就会收到一个奇怪的错误消息。

══╡ EXCEPTION CAUGHT BY GESTURE ╞═══════════════════════════════════════════════════════════════════
The following TypeErrorImpl was thrown while handling a gesture:
Expected a value of type 'File',but got one of type 'File$'
RaisedButton(
     onpressed: () {
          final StorageReference firebaseStorageRef = FirebaseStorage.instance.ref().child(_fileName);
          final StorageUploadTask task = firebaseStorageRef.putFile(_file,StorageMetadata(contentType: 'audio/mp3'));
          ...
     },);

在putFile()方法上失败。 我从未见过这种错误。它首先显示它无法处理手势,但是出现File $不是File的问题。我什至不知道File $是什么。我试图用Google搜索它,但在飞镖文档或Flutter中找不到任何内容

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)