HighlightedString class final
Highlighted string as a list of tokens.
Example
const string = 'This <em>John</em> Doe looks like <em>John</em>athan.';
final highlighted = HighlightedString.of(string);
highlighted
should contain the following tokens :
tokens: [
HighlightToken{content: 'This' , highlighted: false},
HighlightToken{content: 'John', highlighted: true},
HighlightToken{content: 'Doe looks like' , highlighted: false},
HighlightToken{content: 'John', highlighted: true},
HighlightToken{content: 'athan.', highlighted: false},
]
- Available Extensions
Constructors
- HighlightedString.of(String string, {String preTag = '<em>', String postTag = '</em>', bool inverted = false})
-
Creates HighlightedString instance.
factory
Properties
- hashCode → int
-
The hash code for this object.
no setteroverride
- original → String
-
Original highlighted string.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
tokens
→ Iterable<
HighlightableToken> -
List of highlightable tokens.
final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
override