title: Flutter Datatable - Empty container slowing loading time
body: <p>I am building an app where family details - divided into 3 sections - are displayed into 3 different data tables on the same page. The issue is before loading the page which will display the 3 data tables, an exception was caught, after which the page will load and display the 3 data tables properly with the correct data as well.</p>
  <pre><code>════════ Exception caught by widgets library ═══════════════════════════════════
  The following NoSuchMethodError was thrown building SecondPage(dirty, dependencies: [MediaQuery], state: _SecondPageState#eba94):
  The method 'map' was called on null.
  Receiver: null
  Tried calling: map&lt;DataRow&gt;(Closure: (AdultDetails) =&gt; DataRow)
  
  The relevant error-causing widget was
      SecondPage 
  </code></pre>
  <p>Code having widget SecondPage:</p>
  <pre><code> children:&lt;Widget&gt;[
                    Container(
                        height: 50,
                        child: Row(
                          mainAxisSize: MainAxisSize.min,
                          children: &lt;Widget&gt;[
                          Expanded(
                              child: OutlineButton(
                                  onPressed: () {
                                    Navigator.push(
                                      context,
                                      MaterialPageRoute(
                                          builder: (context) =&gt;
                                           SecondPage(widget.familyRef)),
                                    );
                                  }, 
  </code></pre>
  <p>To hide the exception, I passed empty containers to each data tables.</p>
  <pre><code>class SecondPage extends StatefulWidget {
    //final String adultid;
    final String familyRef;
  
    SecondPage(this.familyRef);
    @override
    _SecondPageState createState() =&gt; _SecondPageState();
  }
  ...
  Container(
                width: MediaQuery.of(context).size.width,
                child: FittedBox(
                  child: DataTable(
                    headingRowHeight: 50,
                    dataRowHeight: 50,
                    //columnSpacing: 10,
                    dividerThickness: 1,
                    columns: [
                      DataColumn(
                        label: Text(
                          &quot;First Name&quot;,
                          textAlign: TextAlign.center,
                          overflow: TextOverflow.ellipsis,
                        ),
                        numeric: false,
                        tooltip: &quot;&quot;,
                      ),
                      DataColumn(
                        label: Center(
                            child: Text(
                          &quot;Update&quot;,
                          textAlign: TextAlign.center,
                          overflow: TextOverflow.ellipsis,
                        )),
                        numeric: false,
                        tooltip: &quot;&quot;,
                      ),
                    ],
            rows: list1?.map(
                        (item) =&gt; DataRow(cells: [
                          DataCell(
                            Text(item.pensionerName.toString()),
                          ),
  
                         DataCell(OutlineButton(
                              child: Text(&quot;Update&quot;),
                              onPressed: () {
                                Route route = MaterialPageRoute(
                                    builder: (context) =&gt; UpdateAdult(
                                        widget.familyRef,
                                        item.adultid,
                                        ));
                                Navigator.push(context, route);
                              },
                            ))
                          ]),
                      )?.toList() ?? [],
                ),
  </code></pre>
  <p>It worked for me - The <em>The method 'map' was called on null.</em> error screen does not show up but now each data table takes around 3 secs to load. What can I do to improve the loading performance? Your help will be much appreciated.</p>