-
-
Notifications
You must be signed in to change notification settings - Fork 214
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using Image.asset
with renderFlutterWidget
doesn't render Image
#178
Comments
Hey Dario! So in principle displaying Images using |
I still encounter the same issue when using |
Hmmm, could you try if try something like the following to make sure the precached ImageProvider is the one used for the widget? final imgProvider = AssetImage('name');
await precacheImage(imgProvider);
HomeWidget.renderFlutterWidget(Image(image: imgProvider)); Reading a bit through the documentation from |
Did not work either. Just the hack of calling |
This solves my problem |
I think another way could be to add a bit of delay in the capture process. This is for example how the screenshot package handles this. I will provide an option to define this in |
This problem arises due to the image loading being async. So the correct solution would be to do the equivalent of |
Hi Anton,
first of all thank you really much for your package :)
I am using
HomeWidget.renderFlutterWidget
to render an image of my Widget which usesImage.asset
. For some reason the images are created but they are empty (148B) and some are rendered normally (7,2kB).The Images in the Flutter assets exist and I don't get any exceptions. When I am using another Widget than
Image.asset
the Images are being rendered and stored correctly. It seems to me thatRenderView
has a problem withImage.asset
Widget.The text was updated successfully, but these errors were encountered: