Add search tip to kanji search

This commit is contained in:
Oystein Kristoffer Tveit 2022-01-23 21:00:00 +01:00
parent 6aab6d57bc
commit fd49244b1d
2 changed files with 10 additions and 3 deletions

View File

@ -93,9 +93,17 @@ class _KanjiSearchBodyState extends State<KanjiSearchBody>
AnimatedSizeAndFade( AnimatedSizeAndFade(
fadeDuration: const Duration(milliseconds: 200), fadeDuration: const Duration(milliseconds: 200),
sizeDuration: const Duration(milliseconds: 300), sizeDuration: const Duration(milliseconds: 300),
child: _controller.value == 1 child: (_controller.value == 1 && suggestions.isNotEmpty)
? KanjiGrid(suggestions: suggestions) ? 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(),
), ),
], ],
), ),

View File

@ -53,7 +53,6 @@ class KanjiSearchBarState extends State<KanjiSearchBar> {
onChanged: (text) => onChanged(), onChanged: (text) => onChanged(),
onSubmitted: (_) => {}, onSubmitted: (_) => {},
decoration: InputDecoration( decoration: InputDecoration(
prefixIcon: const Icon(Icons.search),
hintText: 'Search', hintText: 'Search',
border: OutlineInputBorder( border: OutlineInputBorder(
borderRadius: BorderRadius.circular(10.0), borderRadius: BorderRadius.circular(10.0),