Skip to content
pubscout

styled_text

10.0.0, released 4 months ago by amazingsoftworks.com

Text widget with formatted text using tags for easier multilingual styling.

WASM-ready
$ flutter pub add styled_text
Source repository

What it does

Allows formatting parts of text using XML-like tags inside strings. Makes it easy to style specific words, insert icons, handle click actions on parts of text, or embed custom widgets within localized text strings.

AI-written summary of version 10.0.0, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You need to style portions of translated or dynamic text using tags
  • You want to insert interactive links, icons, or widgets directly inside text paragraphs

Skip it when

  • You need complex rich text formatting that does not fit into a string-plus-tags model

Strengths

  • Simplifies handling formatted text in multilingual applications
  • Supports inline widgets, icons, tap handlers, and custom attribute parsers

Weaknesses

  • Relies on parsing XML tags within plain text strings which can be error-prone if escaping is missed

Setup

Kind
Flutter widgets
Effort
Low
Code generation
No
Direct dependencies
2
StyledText(
  text: 'Test: <bold>bold</bold> text.',
  tags: {
    'bold': StyledTextTag(style: TextStyle(fontWeight: FontWeight.bold)),
  },
)

Alternatives

Packages that do the same job and could replace styled_text.

  • auto_size_text

    Pick auto_size_text if your primary requirement is automatically resizing text to fit its container rather than inline tag formatting.

Works with

Packages commonly used together with styled_text: ones it builds on, ones built on it, and its own family.