sliver_text 1.0.0 copy "sliver_text: ^1.0.0" to clipboard
sliver_text: ^1.0.0 copied to clipboard

Text as a sliver. A drop-in Text equivalent for CustomScrollView that needs no SliverToBoxAdapter - with rich text, selection, semantics and gradient fill.

1.0.0 #

SliverText is now a full Text equivalent for slivers, with tests - the package previously shipped an empty test file.

Breaking #

  • Long text wraps instead of being truncated. overflow defaulted to TextOverflow.ellipsis, which collapsed any text longer than one line into a single ellipsized line: the same string measured 800x14 in a SliverText and 800x80 in a Text. The default is now TextOverflow.clip, as in Text.
  • direction renamed to textDirection, and it now defaults to the ambient Directionality instead of hard-coded left-to-right.
  • style is now nullable and merges with the ambient DefaultTextStyle. Previously the widget ignored the surrounding text style entirely.
  • SliverTextAdapter renamed to RenderSliverText; the old name remains as a deprecated alias.

Added #

  • Full Text parameter parity: strutStyle, locale, softWrap, textScaler, semanticsLabel, textWidthBasis, textHeightBehavior and selectionColor.
  • SliverText.rich for InlineSpan trees, including per-span styles and gesture recognizers. WidgetSpan is rejected with an explanatory assert.
  • gradient, painting the glyphs through a gradient via a shader mask. The shader spans the painted bounds of the text rather than its box: a sliver forces its child to the full cross axis extent, so a box-wide shader would spend most of its range on empty space.
  • Text selection inside a SelectionArea.
  • SliverRichText, the low-level sliver counterpart of RichText.
  • debugFillProperties on the widgets and the render object, so the text shows up in the widget inspector.

Fixed #

  • The user's text scale setting is honoured. The paragraph was built without a textScaler, so the widget ignored the accessibility font size completely.
  • maxPaintExtent reports the full extent of the text instead of the part currently painted. While scrolling it fell below scrollExtent, which scrollbars and viewport calculations rely on.
  • The RenderParagraph is created once and updated in place. Every property setter used to build a new one and drop the previous without disposing it.
  • The paragraph is disposed with the render object.
  • The bold-text accessibility setting is applied.

Other #

  • Requires Dart 3.8 / Flutter 3.32; flutter_lints 6.
  • 21 tests covering layout, inherited configuration, the render object lifecycle, rich text, semantics, gradient and selection.

0.0.2 #

  • pubspec update.
  • docs update.

0.0.1 #

  • Initial release.
3
likes
160
points
131
downloads

Documentation

API reference

Publisher

verified publisherbomsamdi.com

Weekly Downloads

Text as a sliver. A drop-in Text equivalent for CustomScrollView that needs no SliverToBoxAdapter - with rich text, selection, semantics and gradient fill.

Repository (GitHub)
View/report issues

Topics

#sliver #text #scrolling #widget #ui

License

MIT (license)

Dependencies

flutter

More

Packages that depend on sliver_text