es (FF built-in "FFUploadedFile" class).
1) Create Custom Widget and name it how you want (in my case - DisplayImage):
2) Define Parameter with exact property as it shows in screenshot below (again, name it how you want, mine is just image):
3) Warning! - Check this option:
In the right menu.
Unless if it would be unchecked FF throw weird "shadow" error:
But after FF will display warning message in Issues, so that's why it's compromise and not proper solution.
4) After, just click on this button to generate temp widget code:
5) Copy and paste code below and replace "Container();" with copied code:
Container(
height: widget.height,
width: widget.width,
child: widget.image != null
? Image.memory(widget.image!.bytes!)
: const SizedBox.shrink(),
);
(if you named parameter differently, change "image" to your parameter's name).
How it looks complete:
6) Now you can just save it and compile (as at 1.1.43 version it works, and possibly it cannot in future)
7) Put this custom widget in your layout (it should be in components tab):
8.1) Set size which you want:
8.2) Warning! - I already created button for uploading. If you don't know how, check FF documentation, it has guide to do it.
Set property of your parameter to output from Source -> Widget State -> Uploaded Local File and confirm it.
And it all done! Now you can see an image which you selected from files.
9) Bonus! - You can edit Container how you want, set bg color to preferred one or even set placeholder image from network or assets, it's just depends from your knowledge of Flutter/dart.
And with latest "State Management" update you can set variable from local page state and it would still work, don't forget to set data from button to page's local variable in actions after uploading. Possibly it can work with list of uploaded files - List<FFUploadedFile>, but I didn't tried. Let community know if it would work. Peace!
Links and source which I used:
https://stackoverflow.com/questions/54030340/convert-a-uint8list-to-image-in-flutter-dart-ui