diff --git a/lib/src/features/search/presentation/pages/search_page.dart b/lib/src/features/search/presentation/pages/search_page.dart index e09529737..7e5216c3b 100644 --- a/lib/src/features/search/presentation/pages/search_page.dart +++ b/lib/src/features/search/presentation/pages/search_page.dart @@ -207,12 +207,11 @@ class _SearchPageState extends State with AutomaticKeepAliveClientMi }, ), ], - child: BlocSelector( - selector: (state) => state.focusSearchId, - builder: (context, focusSearchId) { - if (focusSearchId > _previousFocusSearchId) { + child: BlocBuilder( + builder: (context, searchState) { + if (searchState.focusSearchId > _previousFocusSearchId) { searchTextFieldFocus.requestFocus(); - _previousFocusSearchId = focusSearchId; + _previousFocusSearchId = searchState.focusSearchId; } return Scaffold( @@ -282,7 +281,7 @@ class _SearchPageState extends State with AutomaticKeepAliveClientMi controller: _searchFiltersScrollController, child: Row( children: [ - if (context.read().state.viewingAll) ...[ + if (searchState.viewingAll) ...[ ThunderActionChip( backgroundColor: theme.colorScheme.primaryContainer.withValues(alpha: 0.25), trailingIcon: Icons.close_rounded, @@ -459,7 +458,7 @@ class _SearchPageState extends State with AutomaticKeepAliveClientMi ), Padding( padding: const EdgeInsets.only(top: 60), - child: _getSearchBody(context, context.read().state, account.instance), + child: _getSearchBody(context, searchState, account.instance), ), ], ),