1

Let’s say I have a flutter module that provides a widget let's call it InterestingWidget. On the other side I have a native mobile application (ios/android) that displays a rotating cube with OpenGL. I would like to display the InterestingWidget on a face of the cube. Does this sound possible ?

Flutter seems to be able to render a widget to image ( Creating raw image from Widget or Canvas it seems there are problems with camerapreview or video widgets thought), so this step sounds possible.

I'm not sure if this can be done when the Widget is not in the rendering pipe though, the widget would need to render only on image.

Then we need to convert that image to opengltexture on native ios/android side, that sounds possible too with a bit of work.

And finally, I'm not sure about the interactivity, how to send simulated touches to the widget when user touches the face of the cube where the widget is rendered.

jptsetung
  • 9,064
  • 3
  • 43
  • 55
  • With which part do you have problems with? [Rendering a flutter widget to an image](https://stackoverflow.com/questions/41957086/creating-raw-image-from-widget-or-canvas) or displaying an image in OpenGL. Btw.: On mobile devices you are using [tag:opengl-es] and not desktop-[tag:openg]. – BDL Apr 24 '20 at 15:05
  • Thx, flutter seems to be able to render a widget to image (it seems there are problems with camerapreview or video widgets thought), so this step sounds possible. I'm not sure if this can be done when the Widget is not in the rendering pipe though, the widget would need to render only on image. Then we need to convert that image to opengltexture on native ios/android side, that sounds possible too. And finally, I'm not sure about the interactivity, how to send simulated touches to the widget when user touches the face of the cube where the widget is rendered. – jptsetung Apr 24 '20 at 16:11
  • So your question is actually not about rendering but about interacting with that rendered widget. I suggest that you edit your question to reflect that. About performance: Depends on how long the flutter->image part takes and on how large the widget is. I guess the only way to know is to try it out for your setup – BDL Apr 24 '20 at 16:21

0 Answers0