mirror of
https://github.com/GitJournal/GitJournal.git
synced 2025-07-01 20:43:20 +08:00
HighlightText: Show the actual term
Not what we are searching for. This is going to get really messy when I implement proper searching which takes accents and text normalization into account.
This commit is contained in:
@ -44,16 +44,14 @@ class HighlightedText extends StatelessWidget {
|
|||||||
);
|
);
|
||||||
|
|
||||||
var before = text.substring(0, i);
|
var before = text.substring(0, i);
|
||||||
|
var term = text.substring(i, i + highlightText.length);
|
||||||
var after = text.substring(i + highlightText.length);
|
var after = text.substring(i + highlightText.length);
|
||||||
|
|
||||||
return RichText(
|
return RichText(
|
||||||
text: TextSpan(
|
text: TextSpan(
|
||||||
children: [
|
children: [
|
||||||
TextSpan(text: before, style: style),
|
TextSpan(text: before, style: style),
|
||||||
TextSpan(
|
TextSpan(text: term, style: highlightStyle),
|
||||||
text: highlightText,
|
|
||||||
style: highlightStyle,
|
|
||||||
),
|
|
||||||
TextSpan(text: after, style: style),
|
TextSpan(text: after, style: style),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
Reference in New Issue
Block a user