rich_text_controller
3.0.1, released 2 years ago by micazi.dev
An extended text editing controller supporting different inline styles for custom regex patterns.
What it does
Extends Flutter's text editing controller to allow dynamic inline text styling using custom regular expression patterns. It provides interactive callbacks for matched text, IME composition support, and performance optimizations via regex caching.
AI-written summary of version 3.0.1, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need to highlight specific patterns like hashtags or mentions inside a TextField.
- You want custom inline styling and tap actions for text matching regex rules.
Skip it when
- You are just displaying static rich text without text editing capabilities.
- You need a full-featured markdown or rich text editor component rather than basic regex highlighting.
Strengths
- Custom regex pattern styling
- Interactive callbacks for user interaction with matched text
- IME composition support for languages like Japanese and Chinese
Weaknesses
- Limited to regex-based inline styling within a text input controller
- Not a complete WYSIWYG or markdown editor suite
Setup
- Kind
- Flutter widgets
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 1
TextField(
controller: RichTextController(
text: '',
targetMatches: [
MatchTargetItem(
textStyle: TextStyle(color: Colors.blue, fontWeight: FontWeight.bold),
regex: RegExp(r'#[a-zA-Z0-9_]+'),
),
],
),
)Alternatives
Packages that do the same job and could replace rich_text_controller.
- extended_text_field
Extended text field to quickly build inline images, @mentions, custom backgrounds and selection tools.
77Compare - v_chat_mention_controller
Flutter text editing controller for styled mentions, debounced user search, and markup.
58Compare - flutter_masked_text2
Masked and money text input controllers for Flutter text fields.
50Compare - regexpattern
Flutter collection of regex patterns for string validation.
48Compare