-
Notifications
You must be signed in to change notification settings - Fork 12
Add simple web support #18
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Amazing! 🎉
appRunner.runApp().then(function(flutterApp) { | ||
flutterApp.addView({hostElement: document.querySelector("#left")}); | ||
flutterApp.addView({hostElement: document.querySelector("#right")}); | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For my own understanding: The screenshot in the PR description shows 3 views, this only adds two. Is the screenshot just outdated? Or does the web engine still utilize the implicit view as third view? If its the implicit view, what div is that one rendered into?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The engine always creates an implicit view (which always has id 0
). It creates the element which hosts the flutter app dynamically once the app starts. I don't think we currently allow creating an app without creating the implicit view.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense. We currently do the same on the other desktop platforms with plans to add a flag to disable the implicit view.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We'll definitely disable the implicit view when multiViewEnabled: true
:P
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The implicit view actually covers the two added views (try the widgets_counter.dart
example). It just happens to work here because the app is mostly transparent.
Here, disabling the implicit view and making sure things actually run: flutter/engine#48505
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And we need this too: #19
FYI this won't work with main Flutter until flutter/flutter#139103 lands |
The underlying engine bits have made it into the framework |
Adds support for web in the multiview playground.