get data in StreamBuilder from firestore

I have a stream and want to get data from it,if I try to display the data in a ListTile then I get to load only 2 values out of 4. If I use listView, the data is not loaded at all

Below I wrote 2 ways I tried to display the data, but I get to display everything you need without errors

1 method:  
Widget _carList() {
    if (customers != null) {
      return StreamBuilder(
        stream: customers,
        builder: (context, snapshot) {
          if ( != null) {
            return ListView.builder(
              padding: EdgeInsets.all(5.0),
              itemBuilder: (context, i) {
                return new ListTile(
                  title: Text([i].data['pickedDay']),
                  subtitle: Text([i].data['pickedTime']),
                  onTap: () {
                  onLongPress: () {
    } else {
      return Text('Loading, Please wait..');

This is the data i get with firestore                   
'pickedDay': this.pickedDay,
'pickedTime': this.pickedTime,
'service': this.service,
'phoneNumber': this.phoneNumber
UPDATE:  i wrote another one option:
2 method: ListTile(
                  title: Column(children: <Widget>[Text([i].data['pickedDay']),
                  subtitle: Column(children: <Widget>[Text([i].data['service']),
but it display only 2 notes out of 4
[enter image description here][1]
how do I display everything normally?


1 answer

  • answered 2019-06-17 14:46 Megadec

    Check for null values in your records.

    return new ListTile(
                          title:[i].data['pickedDay'] == null ? 
                          Text('No Data') :