I have a stream Builder that collect data from firestore. sometimes with the new user can happen that some fields are still missing because of a new user. I am trying this way: ${snapshot.data.docs[index]['review'] ?? 'No data available'} but nothing returns error it doesnt work. here the full code:
StreamBuilder( stream: FirebaseFirestore.instance.collection('Consultant').snapshots(), builder: (BuildContext context, AsyncSnapshot<QuerySnapshot> snapshot) { return ListView.builder( padding: EdgeInsets.fromLTRB(5, 0, 0, 60), itemCount: snapshot.data.docs.length, itemBuilder: (BuildContext context, int index) { final profile = snapshot.data.docs; return Column( mainAxisAlignment: MainAxisAlignment.center, children: [ Text( snapshot.data.docs[index]['nickName'], I just want to substite the field if it is missing or null