flutter_html_css_border_radius 0.3.0
flutter_html_css_border_radius: ^0.3.0 copied to clipboard
A flutter_html extension that renders the CSS border-radius properties, including the per-corner and logical corner longhands.
0.3.0 #
- This package now builds on
flutter_html_css_coreandflutter_html_css_colorinstead of carrying its own private copies of the same logic. Rendering is unchanged except where noted below. - The border colour parser is replaced by
flutter_html_css_color'sparseCssColorValue. The old table hard-coded six colour names, and one of them was wrong:greenwas0xFF00FF00(that is CSSlime) and is now the correct0xFF008000per the CSS colour spec. Aborderorborder-colorwritten asgreenrenders differently after this update. The new parser also reads all 148 CSS named colours,hsl()/hsla(),hwb(), and 8-digit hex (#rrggbbaa), where the old table only read hex and a comma-separatedrgb()/rgba(). - Length parsing (
px,em,rem,pt, bare numbers) now goes throughCssLengthfromflutter_html_css_core. The%to9999"pill" sentinel used for a border-radius percentage stays exactly as before; that mapping is this package's own policy and is not part of the core length parser. - Declaration splitting (
style="a: b; c: d"to a property map) now goes throughsplitDeclarations, which is quote- and parenthesis-aware and strips a trailing!important(including! importantwith a space, which the old hand-rolled splitter did not strip at all, so a declaration written with!importantused to fail to parse; it now parses correctly). This is a behavior widening, not a rendering change for a style that never used!important.
0.2.0 #
- Renamed from
flutter_html_css_border_radius_extensionon pub.dev. The old package stays published and is marked discontinued with this one as its replacement. Class names are unchanged.
0.1.2 #
emandremno longer multiply by a hard-coded 16.emnow uses the element's own computed font size andremthe newrootFontSizeargument, which defaults toflutter_html's root font size of 14. The border width and the margin are still read at thepreStylingstep, but only the raw declaration travels from there: both are now resolved at thebuildingstep, whereflutter_htmlhas already turned a relative font size into pixels. Sizes change for anyone already shipping these units. Aborder-radius: 0.5remwas 8 px and is now 7 px, and0.5emon an element rendering at 20 px was 8 px and is now 10 px.kFlutterHtmlDefaultFontSizeis not exported. It was only ever in the working tree, so nothing shipped with it and there is nothing to deprecate. Four packages in the family declared the same value under that name, which made importing any two of them an ambiguous import. The fallback basis is now a library-private constant. If you want the root font size as a symbol, usekFlutterHtmlRootFontSizefromflutter_html_css_font_size, orFontSize.medium.valuefromflutter_htmlitself.- The README moved to the family style: the
silent-failure caveat is in the opening paragraph, the registration-order trap
and
wrapIfHasAnyClassare under one "Before you register it" heading with the working arrangement shown as code, and Limitations is explicit that a rounded element still needs a renderer for its tag. - Added
.pubignore. It is a verbatim copy of.gitignoreplusdoc/(empty today, reserved for long-form notes), because.pubignorereplaces.gitignorerather than extending it, and a short one letbuild/into an archive once.
0.1.1 #
extraTagsis deprecated: it has no effect, and never had. [matches] is style-driven, so an element carryingborder-radiusin its inline style is handled whatever its tag; andflutter_html3.0.0 consults an extension'ssupportedTagsin exactly one place, the base class's defaultmatches, which this class overrides entirely. It will be removed in 1.0.0.- The "Non-standard tags" section of
example/example.mdwas wrong. It implied passingextraTags: {'v-card'}made a<v-card>render with rounded corners. It does not: with no built-in renderer for that tag,prepareFromExtensionyields anEmptyContentElementand the element renders nothing at all, not merely nothing rounded. Measured, with and without the argument, in both cases. The section now shows theTagExtensionthat actually makes it work. - The advice to list this extension after a utility-class extension stays,
but the reason given for it was wrong, and
wrapIfHasAnyClasswas under-explained.flutter_htmlprepares the element tree before any extension expands a class intostyle="", so this extension wraps every classed element speculatively and reads the radius at build time; that is whatwrapIfHasAnyClassis for, and setting it tofalseloses class-driven rounding in either order. Listing this extension last is a separate matter: both extensions run at thepreStylingstep in registration order, and listed first this one cannot extractborderandmargin, so a bordered element renders a square border around a rounded clip. Measured, and documented in the README, the example, and the field's dartdoc.
0.1.0 #
- Initial release: adds a
flutter_htmlextension that appliesborder-radius(shorthand, per-corner, and logical corner properties) from an element's inline style, preserving borders and margins.