Skip to content

Commit

Permalink
fix: use external search controller to fix it being used after disposed
Browse files Browse the repository at this point in the history
  • Loading branch information
maelchiotti committed Apr 27, 2024
1 parent 583a7eb commit 773390a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/common/navigation/app_bars/search_sort_app_bar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ class SearchSortAppBar extends ConsumerStatefulWidget {
}

class _SearchAppBarState extends ConsumerState<SearchSortAppBar> {
final searchController = SearchController();

final provider = RouterRoute.currentRoute == RouterRoute.notes ? notesProvider : binProvider;

SortMethod sortMethod = SortMethod.methodFromPreferences();
Expand Down Expand Up @@ -125,6 +127,7 @@ class _SearchAppBarState extends ConsumerState<SearchSortAppBar> {

return SearchAnchor(
viewHintText: localizations.tooltip_search,
searchController: searchController,
builder: (context, controller) {
return IconButton(
onPressed: () => controller.openView(),
Expand Down

0 comments on commit 773390a

Please sign in to comment.