Skip to content
pubscout

easy_rich_text

2.2.0, released 2 years ago by hyclovechj.top

Easily use RichText with regex patterns without manually splitting strings.

WASM-ready
$ flutter pub add easy_rich_text
Source repository

What it does

The EasyRichText widget allows developers to format text using regular expression patterns defined in a list of EasyRichTextPattern objects. It supports styling, url launching, custom GestureRecognizers, superscripts, subscripts, and inline spans without requiring manual string splitting.

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

Use it when

  • You need to style specific words or patterns inside a larger block of text easily.
  • You want to handle links, emails, or phone numbers inside text with url_launcher integration.
  • You need custom formatting like superscript, subscript, or conditional text matching.

Skip it when

  • You need a complex text rendering engine with advanced layout capabilities beyond styled inline spans.

Strengths

  • Simplifies rich text formatting using regex patterns.
  • Built-in support for URL launching, gesture recognizers, and selectable text.
  • Supports prefix and suffix inline spans like icons.

Weaknesses

  • GestureRecognizer is not working when superscript, subscript, or urlType is set.

Setup

Kind
Flutter widgets
Effort
Low
Code generation
No
Direct dependencies
1
EasyRichText(
  "I want blue font. I want bold font. I want italic font.",
  patternList: [
    EasyRichTextPattern(
      targetString: 'blue',
      style: TextStyle(color: Colors.blue),
    ),
    EasyRichTextPattern(
      targetString: 'bold',
      style: TextStyle(fontWeight: FontWeight.bold),
    ),
  ],
)

Alternatives

Packages that do the same job and could replace easy_rich_text.

  • css_filter

    Apply CSS-like filter effects to any Flutter widget with presets and custom matrices.

Works with

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