Skip to content
pubscout

highlightable

1.0.5, released 5 years ago by theiskaa.com

A Flutter widget that highlights characters or words in a text based on patterns or word lists.

WASM-ready
$ flutter pub add highlightable
Source repository

What it does

HighlightText displays a string and applies a different style to parts that match a regular‑expression pattern or a list of words. It supports case‑sensitivity, full‑word detection and custom text styles for both normal and highlighted portions.

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

Use it when

  • You need simple inline highlighting of numbers, keywords, or custom patterns in static text.
  • You want a lightweight solution without pulling in a full rich‑text editor.

Skip it when

  • You require interactive editing or selection of highlighted text.
  • You need complex rich‑text features like embedded widgets or markdown rendering.

Strengths

  • Easy to integrate with a single widget
  • Supports regex and word‑list highlighting
  • Customizable normal and highlighted TextStyle
  • Works across all Flutter platforms

Weaknesses

  • Limited to highlighting only, no editing capabilities
  • May have performance impact on very large texts
  • No built‑in support for tap callbacks on highlighted spans

Setup

Kind
Flutter widgets
Effort
Low
Code generation
No
Direct dependencies
0
HighlightText(
  'Only numbers: [1, 25, 50] will be highlighted',
  highlight: const Highlight(pattern: r'\d'),
);

Alternatives

Packages that do the same job and could replace highlightable.

  • re_editor

    A lightweight text and code editor widget for Flutter with syntax highlighting and folding.

  • simple_rich_text

    Display formatted rich text using simple characters like asterisks and slashes.

  • see_more

    Expandable text widget with trim, linkify, annotations, fade, and programmatic control

  • flutter_decorated_text

    A widget to style and interact with parts of a text string based on predefined rules.

Works with

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