flutter_html_vuetify 0.2.0
flutter_html_vuetify: ^0.2.0 copied to clipboard
A flutter_html extension that inlines Vuetify utility classes as CSS.
0.2.0 #
- Renamed from
flutter_html_vuetify_extensionon 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.2 #
- One more companion extension is recognised:
flutter_html_css_text_metrics(CssTextMetricsHtmlExtension), forletter-spacing,word-spacingandtext-decoration-thickness. Eight companions in total. - What comes alive: the
letter-spacingon twelve of the thirteentext-*typography classes.text-h5is the one that states none. Registered alongsideflutter_html_css_font_size, the whole typography scale now renders as written, andtext-h4and its siblings leave the report entirely instead of being named for a declaration nothing could restore. - A data addition to
knownCompanionExtensions, with no new dependency: detection is by class name, as before. The property set is copied verbatim from that package'skCssTextMetricsProperties, soword-spacingandtext-decoration-thicknessare listed although no Vuetify class emits either.font-familyis absent there and here:flutter_htmlparses it already. isSupportedClassandunsupportedClassesare unchanged. Both answer for bareflutter_html, and 618 classes still render nothing without a companion.
0.1.1 #
- New diagnostic, for a different failure than the class one: an element whose
Vuetify classes this package resolved, on a tag
flutter_html3.0.0 cannot render, is now named once per parsed document. Same channel asUnsupportedVuetifyClassesException: handed toFlutterError.reportError, never thrown. Gate it withreportUnrenderableTags: false. - This one bites Vuetify markup hardest, because
<v-card>and friends are exactly the tags nothing claims.prepareFromExtensionhands back anEmptyContentElementand the element and its whole subtree render nothing, silently. Inliningpa-4onto it was always pointless. supportedTagsstill listsv-card,v-btn,v-icon,v-col,v-rowandv-container, and its dartdoc now says what that set is: a declaration of intent, not a filter.flutter_htmlreadssupportedTagsonly in the defaultHtmlExtension.matches, which this class overrides. There is a test that pins it: the set listsv-card, and<v-card>still renders nothing.example/example.mdused to document the set as a feature.reportUnrenderableTagsis deliberately not folded intoreportUnsupportedClasses. The class report fires on ordinary Vuetify markup, so people turn it off; the tag report only fires when something disappeared. One flag would let the loud one silence the quiet one.- The report goes quiet once you register the
TagExtensionit asked for. It re-runsprepareFromExtension's own check against the registered extensions instead of trusting a static list. - This needs
flutter_html_class_to_css0.1.1, wherekFlutterHtmlRenderableTagsand the reporter live so the two utility packages do not each carry a copy of the 70-tag set. Release order is converter 0.1.1, thenflutter_html_bootstrap0.1.2, then this.UnrenderableTagsExceptionandkFlutterHtmlRenderableTagsare re-exported here, so reading a report needs no direct dependency on the converter. - Docs pass to the family style. The category table, the companion table and the
size-constraints note moved to
doc/unsupported-classes.md, linked by absolute URL so it works from pub.flutter-io.cn; the README gained the tag trap. New.pubignoreis a verbatim copy of.gitignoreplusdoc/, because.pubignorereplaces.gitignorerather than extending it. border-opacity-*resolving to nothing is by design, not a gap. Upstream the class compiles to--v-border-opacityalone, a custom property only theborder*classes read back throughborder-color, so on its own it renders nothing in Vuetify either. The invariants test pins the six classes exactly.- Four more companion extensions are recognised in
knownCompanionExtensions:CssEffectsHtmlExtensionfromflutter_html_css_effects, foropacity,box-shadowandvisibility.CssSizeConstraintsHtmlExtensionfromflutter_html_css_size_constraints, formax-width,min-width,max-heightandmin-height.CssInteractionHtmlExtensionfromflutter_html_css_interaction, forcursor,pointer-eventsanduser-select.CssTextOverflowHtmlExtensionfromflutter_html_css_text_overflow, fortext-overflow,white-spaceand-webkit-line-clamp.
- Registering one of them stops this package from suppressing the CSS that
companion renders, and stops it from reporting the classes that resolve to it.
In practice that brings back
elevation-0..elevation-24andopacity-0..opacity-100with the effects extension, everycursor-*class with the interaction extension, andtext-truncate,text-no-wrapandtext-pre-wrapwith the text-overflow extension. No class in this package resolves to a size constraint, so that entry unlocks nothing today. - This only takes effect if the companion package is a dependency and listed in
the same
Html(extensions: [...]), afterVuetifyHtmlExtension(). Naming it inpubspec.yamlalone changes nothing. - Detection is by class name, so a companion that renames its extension class goes undetected and its properties are dropped and reported again.
- Docs correction. The README explained the border-radius companion's ordering
requirement with the wrong reason. There are two independent requirements.
Its
wrapIfHasAnyClassmust stay at the defaulttrue, becauseflutter_htmlprepares the element tree before this extension expands a class intostyle="", so the companion never seesrounded-*at prepare time in any order. Listing it after this extension is separate, and is what lets it extractborderandmargin. Listed first it still clips, but aborderon a rounded element renders square around the clip. VuetifyCompanionExtensiongained an optionalsummary, describing in prose which Vuetify classes each companion brings back. It is documentation for anyone readingknownCompanionExtensions; nothing parses it and it does not appear in the report.CssFlexHtmlExtensionfromflutter_html_css_flexis recognised as well, and it is the one companion that needed more than a table entry.displayis dropped by value:flutter_htmlparses the property and reads every keyword outside its five asDisplay.inline, so a widened property set gets adisplaydeclaration as far as the value check and no further. An entry now carries adisplayValuesset beside itspropertiesset, and that value set travels with the property set through_isRenderableand into the report.- What it brings back:
d-flex,d-inline-flex, everyflex-*,justify-*,align-*,align-content-*andorder-*class, andga-*. Thed-*-table*classes stay dropped, because nothing rendersdisplay: table, and they are still named in the report. - Nothing changes for an app that does not register it.
display: flexis dropped exactly as in 0.1.0, and for the same reason. UnsupportedVuetifyClassesExceptiongaineddroppedDisplayValuesandunrenderableDisplayValues, andcompanionRemediescredits a companion fordisplayon the value that was dropped rather than on the property. Without that, a document whose only offender wasd-sm-tablewould have been told to register the flex extension, which renders notable. The report text names the companion for the values it does render and says plainly which values nothing renders.- Two dartdoc comments were wrong and are fixed. The one on
VuetifyCompanionExtensionsaid a flex companion could not work because_isRenderablereturns from itsdisplaybranch before reading the widened property set. It does not: it reads the property set first and then judges the value, which is a different mechanism with the same outcome. The one onknownCompanionExtensionssaid adding such a companion needs a code change; the code change is now in place, so a second one is a data addition. CssFontSizeHtmlExtensionfromflutter_html_css_font_sizeis recognised, and it needed the same kind of code change for the same kind of reason.font-sizeis a propertyflutter_htmlparses and then drops by value:ExpressionMapping.expressionToFontSizehas itsrembranch commented out. Every class of thetext-h1totext-overlinescale states its size inrem, so none of them has ever rendered at the size it names, and the model said nothing because it read properties and not values.- An entry now carries a
fontSizeUnitsset beside itsdisplayValuesset, and that third set travels with the other two._isRenderable,_yieldsRenderableCssand_supportedCssForpass one_SupportedCssrecord instead of two loose sets, so a widened property set can no longer be handed round without its value sets. Listingfont-sizein a companion'spropertiesalone still changes nothing, by design, and there is a test for that trap. flutterHtmlUnrenderableFontSizeUnitsis stated as what does not render, the opposite way round fromflutterHtmlSupportedDisplayValues. The asymmetry is measured. An unknowndisplaykeyword becomesDisplay.inline, so only an allowlist is safe there. An unknown length unit reachesexpressionToFontSize'sLengthTermbranch, which reads the number and ignores the unit, sofont-size: 12ptrenders at 12. The three tokens that render nothing arerem,smallerandlarger.isSupportedClassandunsupportedClassesdo not move.text-h4still renders itsfont-weightand itsline-height, and "at least one declaration renders" is still the rule, so the set stays at 618. A class that renders part of what it says needs the report, not that set, and the dartdoc on both now says so.- So the report learned to name a partial.
UnsupportedVuetifyClassesExceptiongainedpartialClassesandpartiallyDroppedProperties,companionRemediesandunrenderablePropertiesread the whole-and-partial union, and the text carries a second paragraph for them. Before this, a class that rendered anything at all left the report entirely, which is how a page of headings came to render at body size with nothing said about it anywhere. - That makes the report louder than 0.1.0. Every
text-*typography class loses itsletter-spacingunder bareflutter_html, so a document full of typography now reports where it did not.text-truncatewith the text-overflow companion registered is the other new case: it renders the ellipsis and thenowrapand still loses itsoverflow: hidden.reportUnsupportedClasses: falsesilences the lot, as before. - Registering the font-size companion stops the
rembeing dropped, so the declaration reachesstyle=""for that extension to resolve at thepreProcessingstep. Order does not matter there: it reads the inline style after this extension has written it.letter-spacingstill has no renderer and stays in the report. - Nothing changes for an app that does not register it, except the report. The
same
remvalue was dropped in 0.1.0, byflutter_htmlrather than here.
0.1.0 #
- Initial release: a
flutter_htmlextension that inlines Vuetify utility classes (borders, rounded corners, cursor, display, spacing, elevation, and typography) as CSS understood byflutter_html. - Declarations
flutter_htmlcannot render are suppressed rather than inlined. This matters beyond tidiness:d-flexresolves todisplay: flex, whichflutter_htmlmaps toDisplay.inline, turning block elements inline. - Unsupported classes are reported once per parsed document via
FlutterError.reportError. They are never thrown, so they reach the debug console and crash reporters such as Sentry without interrupting rendering. Gate withreportUnsupportedClasses. - A registered companion extension (currently only
CssBorderRadiusHtmlExtension) widens what counts as supported, so its properties are inlined instead of dropped. - Public API for introspecting coverage:
isSupportedClass(),unsupportedClasses,flutterHtmlSupportedProperties,flutterHtmlSupportedDisplayValues,knownCompanionExtensions,VuetifyCompanionExtensionandUnsupportedVuetifyClassesException.