I'm trying to load a local image in FlutterFlow from project assets. The image has been correctly uploaded to the project's Assets section (I can see it at URL https://storage.googleapis.com/flutterflow-io-6f20.appspot.com/projects/memory-trainer-h8ppeq/assets/zxb9wbmrx50q/king_of_spades2.png).
I have enabled "download unused project assets" in the project settings.
My goal is to display random images from my local assets.
I tried with this custom function:
String getAssetImage() { return "assets/king_of_spades2.png"; }
or
String getAssetImage() { return "king_of_spades2.png"; }
But I get this error:
โโโก EXCEPTION CAUGHT BY IMAGE RESOURCE SERVICE โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ The following Event object was thrown resolving an image frame: [object Event] When the exception was thrown, this was the stack Image provider: NetworkImage("", scale: 1.0) Image key: NetworkImage("", scale: 1.0) โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
How can I properly load the image from local assets instead of the remote URL?