Skip to content

how to use Riverpod with searchDelegate ? #2236

Answered by praisegeek
Aboidrees asked this question in Q&A
Discussion options

You must be logged in to vote
// inside SearchDelegate
@override
 Widget buildResults(BuildContext context) {
        // Create a RiverPod ConsumerWidget 
        return SearchResultView(query: query)
 }
 
 // Access state, api services etc.. e.g ref.read(appProvider.notifier).getLocations(query) 
 class SearchResultView extends ConsumerWidget {
    ...
 }

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by Aboidrees
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants