From fd49244b1d432d2fa2fedace4f038f335b930dde Mon Sep 17 00:00:00 2001 From: h7x4 Date: Sun, 23 Jan 2022 21:00:00 +0100 Subject: [PATCH] Add search tip to kanji search --- lib/components/kanji/kanji_search_body.dart | 12 ++++++++++-- .../kanji/kanji_search_body/kanji_search_bar.dart | 1 - 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/lib/components/kanji/kanji_search_body.dart b/lib/components/kanji/kanji_search_body.dart index 7d36752..e4046b7 100644 --- a/lib/components/kanji/kanji_search_body.dart +++ b/lib/components/kanji/kanji_search_body.dart @@ -93,9 +93,17 @@ class _KanjiSearchBodyState extends State AnimatedSizeAndFade( fadeDuration: const Duration(milliseconds: 200), sizeDuration: const Duration(milliseconds: 300), - child: _controller.value == 1 + child: (_controller.value == 1 && suggestions.isNotEmpty) ? KanjiGrid(suggestions: suggestions) - : const KanjiSearchOptionsBar(), + : (_controller.value == 1) + ? const Text( + 'Type a kanji to start searching', + style: TextStyle( + fontSize: 16, + color: Colors.grey, + ), + ) + : const KanjiSearchOptionsBar(), ), ], ), diff --git a/lib/components/kanji/kanji_search_body/kanji_search_bar.dart b/lib/components/kanji/kanji_search_body/kanji_search_bar.dart index c919115..4483fdc 100644 --- a/lib/components/kanji/kanji_search_body/kanji_search_bar.dart +++ b/lib/components/kanji/kanji_search_body/kanji_search_bar.dart @@ -53,7 +53,6 @@ class KanjiSearchBarState extends State { onChanged: (text) => onChanged(), onSubmitted: (_) => {}, decoration: InputDecoration( - prefixIcon: const Icon(Icons.search), hintText: 'Search', border: OutlineInputBorder( borderRadius: BorderRadius.circular(10.0),