I have a problem with a load dynamically an Asset image.
I have an image and I'm trying to load with:
new AssetImage(img_path)
The img_path is:
/storage/emulated/0/WhatsApp/Media/WhatsApp Images/test.jpg
And it return:
(27161): Another exception was thrown: Unable to load asset: /storage/emulated/0/WhatsApp/Media/WhatsApp Images/test.jpg
If i try to move my file for example in
/storage/emulated/0/WhatsApp/Media/test.jpg
It works.
But not if I change name of my file with space for example:
/storage/emulated/0/WhatsApp/Media/test with space.jpg
So I guess that It can be a problem with a space in path.
How can I solve this?
I assume this is what you actually want
new FileImage(
new File('/storage/emulated/0/WhatsApp/Media/WhatsApp Images/test.jpg')
)
See also https://docs.flutter.io/flutter/painting/FileImage-class.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With