The new version cloud_firestore: ^4.5.1 allows filter by "or" and "and" by this way:
Future<List> getListModelos() async {
List objetoList1 = [];
Query<Map<String, dynamic>> collectionReferenceObjetoList1 =
db.collection('/modelos').where(
Filter.and(
Filter("name", isEqualTo: "John"),
Filter("id", isEqualTo: "01"),
),
);
QuerySnapshot queryObjetoList1 = await collectionReferenceObjetoList1.get();
queryObjetoList1.docs.forEach((documento) {
objetoList1.add(documento.data());
});
return objetoList1;
}
I found this helpfull info here: How to add an OR condition to flutter Firebase queries
But, when trying "isEqualTo" + "isNotEqualTo" the query not returns nothing:
db.collection('/modelos').where(
Filter.and(
Filter("name", isEqualTo: "John"),
Filter("id", isNotEqualTo: "null"),
),
);
Is there any way or suggestion to query from Flutter to Firebase that allow "select where isEqual and isNotEqual"?