I'm using the image picker in flutter and trying to get the image. Before I select the image it appear like this:
Before Upload Image
After Upload Image
here is the code:
backgroundImage: _pickedImage != null
? Image.file(_pickedImage!) as ImageProvider
: const AssetImage('assets/images/profile-icon.png'),
How should solve this error?
Updated Error
https://codeshare.io/oQpBvX
Use FileImage
instead like so:
backgroundImage: _pickedImage != null
? FileImage(_pickedImage!)
: const AssetImage('assets/images/profile-icon.png'),
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