Fix search bug where header would be null

pull/6/head
Oystein Kristoffer Tveit 2021-03-05 22:40:20 +01:00
parent 4dfb42f4b6
commit a179efc710
1 changed files with 2 additions and 2 deletions

View File

@ -7,7 +7,7 @@ class JapaneseHeader extends StatelessWidget {
@override
Widget build(BuildContext context) {
final hasFurigana = (word.word != null);
final hasFurigana = (word.word != null && word.reading != null);
return Container(
alignment: Alignment.centerLeft,
@ -15,7 +15,7 @@ class JapaneseHeader extends StatelessWidget {
child: Column(
children: [
(hasFurigana) ? Text(word.reading) : Text(''),
(hasFurigana) ? Text(word.word) : Text(word.reading),
(hasFurigana) ? Text(word.word) : Text(word.reading ?? word.word),
],
),
);