TextHighlighter class

A class to highlight the occurrences of a list of tokens within a string. By default, matches are only highlighted at the start of words, and matching is case-insensitive.

Constructors

TextHighlighter({bool caseSensitive = false, bool matchFromStartOfWord = true})
const

Properties

caseSensitive bool
final
hashCode int
The hash code for this object.
no setterinherited
matchFromStartOfWord bool
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

getMarkers(String text, List<String?> tokens) List<int>
Mark the start of each occurrence of each token with a number equal to the length of the token.
highlight(String text, List<String?> tokens) List<HighlightedTextSegment>
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited