title: Flutter DataTable from API
body: <p>I have a flutter app that I use to fetch and display data. I get the data from a api and afterwards display it in a datatable. I would like to display the column title once then the data in a list instead of repeating the column title in each data item as shown in the image below<a href="https://i.stack.imgur.com/m0tQc.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/m0tQc.jpg" alt="Screenshot of the app" /></a></p>
  <p>Here is the code for displaying the the data table</p>
  <pre><code>                Expanded(
                      child: ListView.builder(
                          itemCount: loans.results.length,
                          itemBuilder: (context, index) {
                            final y = loans.results[index].customer.firstname +
                                &quot; &quot; +
                                loans.results[index].customer.lastname;
  
                            final x = loans
                                .results[index].loanParticulars.amountApplied;
                            final z = loans.results[index].stage.name;
                            final w =
                                loans.results[index].loanApplicationStatus.name;
  
                            return SingleChildScrollView(
                              scrollDirection: Axis.horizontal,
                              child: DataTable(columnSpacing: 38.0, columns: [
                                DataColumn(label: Text('Name')),
                                DataColumn(label: Text('Amount')),
                                DataColumn(label: Text('Status')),
                                DataColumn(label: Text('Stage')),
                              ], rows: [
                                DataRow(cells: [
                                  DataCell(Container(width: 75, child: Text(y))),
                                  DataCell(Container(child: Text(x))),
                                  DataCell(Container(child: Text(w))),
                                  DataCell(Container(child: Text(z)))
                                ])
                              ]),
                            );
                          }))
                
  </code></pre>