I have a search input to look up for my Firebase products. At the moment it is only working if the Capital case or lower case in both products and search value are matched. It also work if I type only 1 character. But I would like to improve it.
For example:
- if the user does't write exactly the name,
- or if the the products contains 2 words and user start to type the second word
How can i achieve that?
Container(
height: MediaQuery.of(context).size.height*0.8,
child: FutureBuilder<QuerySnapshot>(
future: _services.userRef.doc(_services.getUserID()).collection('Categories')
.doc(widget.catID).collection('products').orderBy('name')
.startAt([_searchValue]).endAt(['$_searchValue\uf8ff']).get(),
builder: (context, snapshot ){
if (!snapshot.hasData )
return Center(child: CircularProgressIndicator());{
final document = snapshot.data?.docs;
return ListView.builder(shrinkWrap: true,
itemCount: document?.length,
itemBuilder: (context, index) {
return Center(
child: Column(
children: [
Padding(
padding: const EdgeInsets.only(left: 8.0),
child: ListTile( title: Text(document![index]['name']),
onTap: () {