Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR DART

use search delegate flutter firebase

Widget buildSuggestions(BuildContext context) {
  return StreamBuilder(
    stream: Firestore.instance.collection('todos').snapshots(),
    builder: (context, snapshot) {
      if (!snapshot.hasData) return new Text('Loading...');

      final results =
          snapshot.data.documents.where((a) => a['title'].contains(query));

      return ListView(
        children: results.map<Widget>((a) => Text(a['title'])).toList(),
      );
    },
  );
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #search #delegate #flutter #firebase
ADD COMMENT
Topic
Name
7+8 =