Open arnleal09 opened 2 months ago
\cc @ditman Any sage advice you can offer here? Thanks :)
From a cursory look at the code (there isn't enough to figure out exactly what's going on), @arnleal09, it seems that the flutter initialization is a bit funky:
_flutter.loader.load
where only one view is added: the body
element
flutter.js
directly, use flutter_bootstrap.js
. Docs. _flutter.loader.loadEntrypoint
that won't set Flutter in multi-view mode.IMO you should start by a smaller app (maybe the ReactJS one here), and build up to add multi-view support.
PS: I'm hijacking this issue to remember ourselves to update the web_embedding samples to work in multi-view mode, thanks for reporting @arnleal09!
From the current documentation, it's not clear how to use the multi-view API in a higher-level framework, like Angular in our web_embedding demo.
We must update the web_embedding sample for Angular:
app.addView
andapp.removeView
in the Angular element lifecycle)Original issue follows
Multiple embedded views on the same page
I am using the example of rendering embebed Flutter widgets in a React web page with NextJs. When I add two on the same page, only one of the views renders. Using print, I can see that the flutter ViewCollection does indeed contain both views, and the target has two different elements with distinct IDs. However, the second view is always the one that gets displayed. There is any limitation to these use? I am using flutter version 3.24.2
other elements
I am making the flutter init in this way and passing the context to the root of all components. When i do navigation for another page the widgets render ok, the only problem is when are two in the same page.