• Mouad Debbar's avatar
    [web] Don't crash on `const HtmlElementView()` (#128965) · fc8856eb
    Mouad Debbar authored
    Previously, when the code contained `const HtmlElementView()` it would break even if it's guarded by `if (kIsWeb)`.
    
    This PR makes it such that `const HtmlElementView()` is allowed but it still throws if it gets inserted into the widget tree by mistake on non-web platforms.
    
    One improvement we can make in the future is to have a conditional import:
    - `_html_element_view_web.dart` that contains the real `HtmlElementView` that can only be instantiated on web.
    - `_html_element_view_io.dart` that contains a stub with an unimplemented `build()` method.
    
    Fixes https://github.com/flutter/flutter/issues/43532
    fc8856eb
Name
Last commit
Last update
.github Loading commit data...
.vscode Loading commit data...
bin Loading commit data...
dev Loading commit data...
examples Loading commit data...
packages Loading commit data...
.ci.yaml Loading commit data...
.cirrus.yml Loading commit data...
.gitattributes Loading commit data...
.gitignore Loading commit data...
AUTHORS Loading commit data...
CODEOWNERS Loading commit data...
CODE_OF_CONDUCT.md Loading commit data...
CONTRIBUTING.md Loading commit data...
LICENSE Loading commit data...
PATENT_GRANT Loading commit data...
README.md Loading commit data...
TESTOWNERS Loading commit data...
analysis_options.yaml Loading commit data...
dartdoc_options.yaml Loading commit data...
flutter_console.bat Loading commit data...