未定义的名称' flutterabsolutepath'
我正在开发一个扑通移动应用程序,需要通过API上传多个图像。现在,我完成了从画廊挑选图像的部分。下一步是上传图像。为此,我需要图像路径。我知道可以通过使用以下代码行来获得图像路径,但它一直说未定义的名称'FlutterAbSolutePath'如何解决此问题的原因是什么?我正在使用多图像挑战器包。
final filePath =
await FlutterAbsolutePath.getAbsolutePath(image.identifier);
I am developing a flutter mobile application where I need to upload multiple images through an API. Now I completed the part where pick images from the gallery. Next step is to upload the images. To do that I need the image path. I know that image path can be get by using the below code line but it keep saying that Undefined name 'FlutterAbsolutePath' what is the reason how to fix this issue. I am using multi-image-picker package.
final filePath =
await FlutterAbsolutePath.getAbsolutePath(image.identifier);
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您可以为我们提供更多信息甚至代码示例,那真的很好。如果您正在使用此 package ,我强烈建议您将其更改为不再不受欢迎的一个(看看这个: image_picker ;您也可以一次选择多个图像) 。
在提供更多信息之前,您可以查看以下代码,该代码使用 image_picker :
遵循文档的安装步骤后,您可以使用下一个方法获得图像:
我希望我对您有所帮助。愉快的编码! :)
后来的编辑:
这是一个非常基本的幻影应用程序,它可以使用多件式挑选图像创建一个临时文件,我们知道 path 并显示临时文件为了证明正确显示临时文件。
对您来说,最有趣的是getfile()方法,它照顾创建带有摘要图像的1:1的临时文件。
为了创建临时文件,我使用了: path_provider 也请查看以下内容:读写文件
用于许可处理: cermission_handler
我仍然强烈建议您使用其他软件包进行图像选择,因为该摘要已停止:)。
It would be really nice if you could provide us with some more information or even a code sample. In case you are using this package, I would strongly advice you to change it to one that is not discontinued (take a look into this one: image_picker; you can select multiple images at once with this one too).
Until further information is provided you can take a look over the following code that uses the image_picker:
After following the installation steps from the documentation you can get images using the next method:
I hope that I helped you a little bit. Happy coding! :)
Later edit:
Here is a very basic Flutter app that picks an image with multi-picker, creates a temp file for which we know the path and displays the temp file in order to show that the temp file was correctly displayed.
For you, what's of most interest is getFile() method which takes care of creating the temp file that is 1:1 with picked image(s).
For creating the temp file I used: path_provider also take a look into the following: Read and write files
For permission handling: permission_handler
I still strongly suggest that you use other package for image picking as this one is discontinued :).