title: Flutter: How to hide TableRow if the value is null or there is no value
body: <p>I have 2 JSON cases as follows</p>
  
  <p>Case 1: one value of "country" is null</p>
  
  <pre><code>[
    {
      "id": 1,
      "continent": "North America",
      "country": "United States"
    },
    {
      "id": 2,
      "continent": "Europe",
      "country": "Germany"
    },
    {
      "id": 3,
      "continent": "Asia",
      "country": null
    }
  ]
  </code></pre>
  
  <p>Case 2: one of "country" has no value</p>
  
  <pre><code>[
    {
      "id": 1,
      "continent": "North America",
      "country": "United States"
    },
    {
      "id": 2,
      "continent": "Europe",
      "country": "Germany"
    },
    {
      "id": 3,
      "continent": "Asia"
    }
  ]
  </code></pre>
  
  <p>I use <code>TableRow</code> to show "continent" and "country" in <code>Table</code>, </p>
  
  <pre><code>TableRow(children: [
                        TableCell(child: Text(continent.continent)), 
                        TableCell(child: Text(continent.country))])
  </code></pre>
  
  <p>But in case there isn't "country" in List or <code>continent.country == null</code> => I don't want to show that <code>TableRow</code>, so please help me set the conditions for:</p>
  
  <ol>
  <li>Case 1</li>
  <li>Case 2</li>
  <li>Case 1 + Case 2</li>
  </ol>
  
  <p>This is the main file:</p>
  
  <pre><code>import 'package:ask/services/continent_services2.dart';
  import 'package:flutter/material.dart';
  import 'model/continent_model2.dart';
  
  class TableRowDemo extends StatefulWidget {
    TableRowDemo() : super();
  
    @override
    _ContinentPageState createState() =&gt; _ContinentPageState();
  }
  
  class _ContinentPageState extends State&lt;TableRowDemo&gt; {
    List&lt;Continent&gt; _continent;
  
    @override
    void initState() {
      super.initState();
  
      ContinentServices2.getContinent().then((continents) {
        setState(() {
          _continent = continents;
        });
      });
    }
  
    @override
    Widget build(BuildContext context) {
      return Scaffold(
        appBar: AppBar(title: Text('')),
        body: Column(
          children: &lt;Widget&gt;[
            for (Continent continent in _continent)
              SingleChildScrollView(
                child: Table(children: [
                  continent.country == null
                      ? Container() // Error: type 'Container' is not a subtype of type 'TableRow'
                      : TableRow(children: [
                        TableCell(child: Text(continent.continent)),
                        TableCell(child: Text(continent.country))]),
                ]),
              ),
          ],
        ),
      );
    }
  }
  
  </code></pre>