flutter_html_class_to_css 0.2.0 copy "flutter_html_class_to_css: ^0.2.0" to clipboard
flutter_html_class_to_css: ^0.2.0 copied to clipboard

Plumbing for flutter_html extensions that translate an element's class attribute into inline CSS.

0.2.0 #

  • Renamed from flutter_html_class_to_css_converter_extension on pub.flutter-io.cn. The old package stays published and is marked discontinued with this one as its replacement. Class names are unchanged.

0.1.1 #

  • New diagnostic: an element whose classes a resolver claimed, on a tag flutter_html 3.0.0 cannot render, is now named once per parsed document through FlutterError.reportError. Reported, never thrown, same channel as the sibling packages' unsupported-class reports. Silence it with reportUnrenderableTags: false on the constructor.
  • Why this needed a diagnostic at all: flutter_html renders an element only if something claims it at the preparing step. If nothing does, prepareFromExtension returns an EmptyContentElement and the element and its whole subtree render nothing, with no error and no warning. Inlining CSS onto that element changes nothing. table, video, audio, iframe, input, svg, math and every custom element like v-card are all in that bucket.
  • reportUnrenderableTags is a separate flag from a subclass's own unsupported-class report on purpose. The class report fires on ordinary markup and gets silenced as routine noise; this one fires only when a subtree vanishes. One flag for both would let the loud report silence the quiet one.
  • The report stays quiet once you register a TagExtension for the tag. It re-runs prepareFromExtension's own check against the registered extensions rather than trusting a static list, so doing the fix it asks for actually turns it off.
  • New public API: kFlutterHtmlRenderableTags (the 70 tags flutter_html 3.0.0's built-ins claim), isFlutterHtmlRenderableTag, UnrenderableTagsException, UnrenderableTagReporter, ClassToInlineCssExtension.recordUnrenderableTag for subclasses that override beforeStyle, and debugResetUnrenderableTagReporting for tests. The tag set lives here so bootstrap and vuetify do not each carry a copy, which means this has to reach pub.flutter-io.cn before flutter_html_bootstrap 0.1.2 and flutter_html_vuetify 0.1.1.
  • example/example.md was wrong about supportedTags. It said passing it "registers non-standard tag names so flutter_html does not discard them". It does not: flutter_html reads supportedTags only in the default HtmlExtension.matches, which this class overrides. Measured: a subclass listing v-card still renders nothing. The section now shows the TagExtension that works.
  • Docs pass across the README, the example and the dartdoc, to the family style. The 70-tag list, the four measured cases and the re-derivation recipe moved to doc/renderable-tags.md, which .pubignore keeps out of the archive.

0.1.0 #

  • Initial release.
  • ClassListCssResolver: interface for mapping an ordered list of CSS classes to inline CSS declarations.
  • ClassToInlineCssExtension: an HtmlExtension base class that runs during flutter_html's preStyling step, merges resolver output into the element's style="" attribute, and is a no-op for elements with no matching classes.
0
likes
160
points
62
downloads

Documentation

API reference

Publisher

verified publisherchaosworld.cc

Weekly Downloads

Plumbing for flutter_html extensions that translate an element's class attribute into inline CSS.

Repository (GitLab)
View/report issues
Contributing

Topics

#flutter-html #css #html #extension #utility-classes

License

MPL-2.0 (license)

Dependencies

flutter, flutter_html, html

More

Packages that depend on flutter_html_class_to_css