title: How to test if json property is present during the build of a Flutter ListView
body: <p>I'm beginner in Flutter and Dart.</p>
  
  <p>I have a local JSON file, read it and I want to display the JSON Data in the ListView.
  But in my JSON data I haven't always all the different properties.
  So when I want to display a text, the value of the property is no existing because the property is not existing (In the case is the Property "description".</p>
  
  <p>How could I solve it ?</p>
  
  <p>Thank you in advance for your help</p>
  
  <p>I tried ternary operator
  I tried with the function containsKey</p>
  
  <p>But maybe I did it wong ?</p>
  
  <p>... json</p>
  
  <pre><code>[
    {
      "createdBy": "bddae0de-320c-41a9-a69b-75793758b7a7",
      "description": "Fhjifgsdsdsd",
      "endDateTime": "1477490400000",
      "hasPicture": "false",
      "isActive": "true",
      "isAdminActive": "true",
      "maxParticipants": "50",
      "startDateTime": "1476799200000",
      "title": "Song Church Story Telling",
      "type": "Music"
    },
    {
      "createdBy": "-KHzgxS6KBqu1rNmJzpT",
      "endDateTime": "1476378000000",
      "hasPicture": "false",
      "isActive": "true",
      "isAdminActive": "true",
      "startDateTime":"1476205200000",
      "title": "Test greg T",
      "titleDate": "Tuesday, 11 Oct 8:00 PM",
      "type": "Games"
    }
  ]
  </code></pre>
  
  <p>...</p>
  
  <p>... flutter</p>
  
  <pre><code>  Widget build(BuildContext context) {
      return new Scaffold(
          appBar: new AppBar(
            title: new Text("Load local JSON file"),
          ),
          body: new Container(
            child: new Center(
              // Use future builder and DefaultAssetBundle to load the local JSON file
              child: new FutureBuilder(
                  future: DefaultAssetBundle.of(context)
                      .loadString('assets/data/ckevents_data.json'),
                  builder: (context, snapshot) {
                    // Decode the JSON
                    var newData = json.decode(snapshot.data.toString());
  
                    return new ListView.builder(
                      // Build the ListView
                      itemBuilder: (BuildContext context, int index) {
                        return new Card(
                          child: new Column(
                            crossAxisAlignment: CrossAxisAlignment.stretch,
                            children: &lt;Widget&gt;[
                              new Text("Title: " + newData[index]['title'],
                                  style: new TextStyle(
                                      fontSize: 20.0, color: Colors.blue)),
                              new Text(
                                  "Description: " +
                                          ((newData[index].containsKey('description')) ? ('') : (newData[index]['description'])),
                                  style: new TextStyle(
                                      fontSize: 10.0, color: Colors.pink)),
                              new Text("Categorie: " + newData[index]['type'],
                                  style: new TextStyle(
                                      fontSize: 15.0, color: Colors.red)),
                              new Text(
                                  "Date: " +
                                      DateTime.fromMillisecondsSinceEpoch(
                                              newData[index]['startDateTime'])
                                          .add(Duration(days: 700))
                                          .toString(),
                                  style: new TextStyle(
                                      fontSize: 10.0, color: Colors.black))
                            ],
                          ),
                        );
                      },
                      itemCount: newData == null ? 0 : newData.length,
                    );
                  }),
            ),
          ));
    }
  }
  </code></pre>
  
  <p>...</p>