text_highlight_codespark 2.2.0
text_highlight_codespark: ^2.2.0 copied to clipboard
Flutter widget for highlighting rich text — single query, multiple queries with per-term colors, regex patterns, tappable spans, and rounded-corner styling.
Changelog #
All notable changes to this project will be documented in this file.
2.2.0 - 2026-08-06 #
Added #
matchWordonHighlightQuery.single/.multiple— matches whole words only (\bboundaries), so'dart'no longer matches inside'dartboard'.selectableflag — renders withSelectableText.richso users can select and copy highlighted text (plain spans only; incompatible withborderRadius).HighlightText.buildSpans(...)static helper — returns a list ofTextSpans for composing highlighted text inside your ownRichText/Text.richtrees.onTapIndexed(String matchedText, int matchIndex)— likeonTapbut also reports the 0-based match index.- Layout passthrough for
strutStyle,textDirection,locale,textScaler,textWidthBasis,textHeightBehavior,selectionColor, andsemanticsLabel.
Fixed #
- Overlapping queries in
.multiplemode (e.g.'text'and'highlight text') now match longest-first instead of always preferring the shorter term.
Other #
- Repaired CI workflow: runs on
main, uses stable Flutter, and gates publishing behind format, analyze, test, and publish dry-run checks.
2.1.0 - 2026-06-10 #
Added #
- Comprehensive
///dartdoc comments on all public classes, constructors, and fields — visible on hover in VS Code and rendered on pub.dev. repositoryandissue_trackerfields inpubspec.yamlfor better pub.dev discoverability.topicsfield (text,search,ui,widget,regex) for pub.dev topic search.- Platform declarations (
android,ios,linux,macos,web,windows) for full platform support scoring. - Overhauled
README.mdwith author attribution, pub.dev badges, comprehensive code examples for all modes, and an API reference table. - Updated example app showcasing all eight usage scenarios with a sectioned
ListView.
2.0.0 - 2026-06-10 #
Breaking Changes #
- Replaced the three-constructor API (
HighlightText,HighlightText.multiple,HighlightText.regex) with a singleHighlightTextwidget that takes aHighlightQueryparameter. caseSensitiveis nowbool(non-nullable, defaults tofalse) instead ofbool?.
Added #
HighlightQuerysealed class with.single,.multiple, and.regexconstructors — clean, type-safe, no unused fields.- Per-query colors in
.multiplemode viaMap<String, Color>? colorsonHighlightQuery.multiple. onTapcallback — fires with the matched string when a highlighted span is tapped.borderRadius— renders highlighted spans with rounded corners using aWidgetSpan+Container.textAlign,maxLines,overflow,softWrap— passed through to the underlyingText.rich.- Proper disposal of
TapGestureRecognizerinstances viaStatefulWidget.
Fixed #
matchedTextStylewas silently ignored in.regexmode — now correctly applied.- Queries in
.multiplemode are now regex-escaped, preventing crashes on inputs like"c++"or"(text)".
1.0.1 - 2024-06-25 #
Fixed #
- Updated homepage URL to GitHub repository.
- Documentation: Included comprehensive examples, comments and usage instructions in the
README.mdfile.
1.0.0 - 2024-06-25 #
Added #
- Initial release of
HighlightTextpackage. - Feature to highlight single query within the source text.
- Support for case-sensitive search for single query.
- Support for custom text styles for matched and unmatched text.
- Multiple queries highlighting with the
HighlightText.multipleconstructor. - Regex highlighting with the
HighlightText.regexconstructor. caseSensitiveparameter for both single and multiple queries.- Examples and usage instructions in the
README.md.
