How can I embed a react page or component inside a flutter-web app?

Viewed 286

I want to embed an unhosted react page (or a react component with some fancy 3rd party graph library) inside a flutter-for-web app. Why? I am think the react graph app I have is much nicer than what I can do in flutter (using the existing 3rd party packages) and so it might be good if I could just embed that react stuff inside a flutter-for-web app until I can do in flutter what I already have in react.

There is a flutter package (flutter_inappwebview) that can do this for mobile but I need to do it for a web app. I need to pass data back and forth between the react stuff and the flutter stuff too, so for instance the react graph will take in its data from flutter - not direct from the network or DB - and after drawing its pretty pictures and some user interaction will be able to send data back to my flutter code.

Is this easy? Already done in another package I haven't found yet? I know I can interop with javascript but just using @JS to interact with the react package (along with maybe some redux or maybe another basic state management) solution just sounds like it might be a tricky job.

Thanks

0 Answers
Related