mar
mar

Reputation: 21

Show results of search in Firebase

I am developing an application using data from Firebase. I have a ListView with the same Containers containing different data from Firebase.
I want to do a search so that I can easily find Containers with the phrase entered. I used CupertinoSearchTextField and have a search field in the AppBar.
I made an Extract Widget, here is what it looks like now:

class Search extends StatelessWidget {
  Search({
super.key,
  });

  final searchController = TextEditingController();

  @override
  Widget build(BuildContext context) {
    return CupertinoSearchTextField(
      controller: searchController,
      onChanged: (value) {if (value =     FirebaseFirestore.instance.collection('events').doc('category')     {});},
      autocorrect: true,
    );
  }
}

I want the app to check if this typed phrase (value) is in the data in Firebase.
I have an error there, but I want to ask if I am even following the right path.
I've heard that you need to use SetState, just don't know how to do it yet. Thanks in advance for your help!

Upvotes: 0

Views: 17

Answers (0)

Related Questions