From d81b2ac3ab7d04a6ecc1217251d1d05fcf421946 Mon Sep 17 00:00:00 2001 From: Vishesh Handa Date: Mon, 7 Sep 2020 17:40:12 +0200 Subject: [PATCH] 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. --- lib/widgets/highlighted_text.dart | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/widgets/highlighted_text.dart b/lib/widgets/highlighted_text.dart index 4c866171..8a62f18d 100644 --- a/lib/widgets/highlighted_text.dart +++ b/lib/widgets/highlighted_text.dart @@ -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), ], ),