Skip to content

Commit

Permalink
feat: add search mode to search hint text
Browse files Browse the repository at this point in the history
  • Loading branch information
Moseco committed Jul 17, 2024
1 parent e9d61c3 commit 87a71f3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
9 changes: 7 additions & 2 deletions lib/ui/views/search/search_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import 'package:flutter/services.dart';
import 'package:flutter_hooks/flutter_hooks.dart';
import 'package:keyboard_actions/keyboard_actions.dart';
import 'package:sagase/app/app.locator.dart';
import 'package:sagase/services/dictionary_service.dart';
import 'package:sagase/ui/widgets/kanji_list_item_large.dart';
import 'package:sagase_dictionary/sagase_dictionary.dart';
import 'package:sagase/ui/widgets/hand_writing_canvas.dart';
Expand Down Expand Up @@ -259,7 +260,9 @@ class _SearchTextField extends ViewModelWidget<SearchViewModel> {
),
],
decoration: InputDecoration(
hintText: 'Search',
hintText: viewModel.searchFilter == SearchFilter.vocab
? 'Search vocab'
: 'Search kanji',
contentPadding: const EdgeInsets.symmetric(
horizontal: 24,
),
Expand Down Expand Up @@ -318,7 +321,9 @@ class _SearchTextField extends ViewModelWidget<SearchViewModel> {
),
],
decoration: InputDecoration(
hintText: 'Search',
hintText: viewModel.searchFilter == SearchFilter.vocab
? 'Search vocab'
: 'Search kanji',
contentPadding: const EdgeInsets.symmetric(
horizontal: 24,
),
Expand Down
1 change: 1 addition & 0 deletions lib/ui/views/search/search_viewmodel.dart
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ class SearchViewModel extends FutureViewModel {
SearchHistoryItem? _currentSearchHistoryItem;

SearchFilter _searchFilter = SearchFilter.vocab;
SearchFilter get searchFilter => _searchFilter;

bool _promptAnalysis = false;
bool get promptAnalysis => _promptAnalysis;
Expand Down

0 comments on commit 87a71f3

Please sign in to comment.