Rodrigo Costa
Rodrigo Costa

Reputation: 91

i want to know how i search words or pieces of words in firebase in flutter, like i user comando "like" in mysql?

consider:

CollectionReference _dbCollection = FirebaseFirestore.instance.collection('estoque');
    await _dbCollection.orderBy("descricao").startAt([_itemPesquisaController.text]).endAt(['${_itemPesquisaController.text}\uf8ff'] ).get().then((snaphots) async {
      //print(querySnapshot.docs.length);
      snaphots.docs.forEach((element) async {
        ModelEstoque _registroUsuario =  ModelEstoque();
        _registroUsuario = ModelEstoque.fromJson(element.data()! as Map<String, dynamic>);
        _registroUsuario.id = element.id;
        _registroUsuario.filePath = "";
        print (_itemPesquisaController.text);
        _addItem(_registroUsuario);

        //_addItem(_registroUsuario);

      });
    });

this results only the first world of the text of var, and i want something that results anothers parts of the var like "world" or only a part of the word, like in mysql using "like"

Upvotes: 1

Views: 32

Answers (0)

Related Questions