从画廊或相机挑选后,如何将图像永久保存在颤抖上?设置挑选的图像时,我会遇到此错误
Am getting this error when am setting the picked image, future dynamic is not a subtype of string.
This is how am setting the image
This is how am saving the image path using shared preferences
Where could I have gone wrong?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
那是因为getImagePathfromsharedPreferences不返回字符串?,它返回未来,
您要么在initstate中处理异步任务,要么使用FutureBuilder
请确保设置getimagePathfromsharedPreferences的返回类型
我将使用FutureBuilder:我将使用FutureBuilder:
that's because getImagePathFromSharedPreferences doesn't return String?, it returns a Future
you either handle the async task in the initState or use a FutureBuilder
make sure to set the return type of getImagePathFromSharedPreferences
I'm gonna use FutureBuilder: