mirror of
https://github.com/GitJournal/GitJournal.git
synced 2025-07-01 04:07:53 +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 term = text.substring(i, i + highlightText.length);
|
||||
var after = text.substring(i + highlightText.length);
|
||||
|
||||
return RichText(
|
||||
text: TextSpan(
|
||||
children: [
|
||||
TextSpan(text: before, style: style),
|
||||
TextSpan(
|
||||
text: highlightText,
|
||||
style: highlightStyle,
|
||||
),
|
||||
TextSpan(text: term, style: highlightStyle),
|
||||
TextSpan(text: after, style: style),
|
||||
],
|
||||
),
|
||||
|
Reference in New Issue
Block a user