-
Notifications
You must be signed in to change notification settings - Fork 6k
[web] Provide convenient default factories for platform views #43828
Conversation
ditman
left a comment
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.
This looks great! I think that if we exposed the constants of the default factory names from package:ui_web, the implementation would be slightly more robust (one less thing to have to worry about I guess?)
|
|
||
| typedef _DefaultFactoryParams = Map<Object?, Object?>; | ||
|
|
||
| extension on _DefaultFactoryParams { |
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.
What a wacky syntax we can get with extensions, I love it (in small doses) xD
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.
I actually removed this because I was able to do the same thing using the existing readX extensions:
engine/lib/web_ui/lib/src/engine/util.dart
Line 560 in e590b24
| extension JsonExtensions on Map<dynamic, dynamic> { |
|
@ditman this is ready for a re-review! |
ditman
left a comment
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.
Small comment about encapsulating the currently global consts inside the class that "owns" them, as static finals, if possible!
…131339) flutter/engine@ba83c14...faf1121 2023-07-26 [email protected] Roll Skia from 5ace549dfae6 to ca48e45a0262 (4 revisions) (flutter/engine#44038) 2023-07-26 [email protected] [web] Provide convenient default factories for platform views (flutter/engine#43828) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-engine-flutter-autoroll Please CC [email protected],[email protected],[email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
| /// | ||
| /// There's no need to register this view type with [PlatformViewRegistry] | ||
| /// because it is registered by default. | ||
| static const String defaultVisibleViewType = '_default_document_create_element_visible'; |
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.
…lutter#131339) flutter/engine@ba83c14...faf1121 2023-07-26 [email protected] Roll Skia from 5ace549dfae6 to ca48e45a0262 (4 revisions) (flutter/engine#44038) 2023-07-26 [email protected] [web] Provide convenient default factories for platform views (flutter/engine#43828) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-engine-flutter-autoroll Please CC [email protected],[email protected],[email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
…lutter#131339) flutter/engine@ba83c14...faf1121 2023-07-26 [email protected] Roll Skia from 5ace549dfae6 to ca48e45a0262 (4 revisions) (flutter/engine#44038) 2023-07-26 [email protected] [web] Provide convenient default factories for platform views (flutter/engine#43828) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-engine-flutter-autoroll Please CC [email protected],[email protected],[email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
This wraps up the platform view improvements discussed in #127030. - Splits `HtmlElementView` into 2 files that are conditionally imported. - The non-web version can be instantiated but it throws if it ends up being built in a widget tree. - Out-of-the-box view factories that create visible & invisible DOM elements given a `tagName` parameter. - New `HtmlElementView.fromTagName()` constructor that uses the default factories to create DOM elements. - Tests covering the new API. Depends on flutter/engine#43828 Fixes #127030
…r#43828) Convenient default factories for creating DOM element from a given tag name. Required by flutter/flutter#130513 Part of flutter/flutter#127030

Convenient default factories for creating DOM element from a given tag name.
Required by flutter/flutter#130513
Part of flutter/flutter#127030