i have a FutureBuilder with a ListView.builder. Inside that i want to show a container with a text only if a FIELD from the document exists. I have tried the following from the documentation and from multiple stack answers but no succes.
snapshot.data.docs[index].data()["Field"]!=null
?
Container(
child: Text("Null check works");
)
:Container()
snapshot.data.docs[index].data().containsKey("Field") ?
Container(
child: Text("Null check works");
)
:Container()
If i try to null check the field inside a function separately and print a text to confirm if the field is or not null, it works, but when i try to null check a field as above, it doesnt work. Did anyone have this problem?