DataTable (Flutter Widget of the Week)
Why Stack Overflow recommends it
Stack Overflow users link it when answering how to show tabular data or headers in Flutter, as a quick official walkthrough of the DataTable widget and its options like sorting.
Recommended by 3 people across 3 different months, 2020 to 2021.
What it is
A 1m28s entry in the Flutter team's Widget of the Week series covering DataTable, the widget for showing tabular data. It explains defining columns and rows and how cells size themselves automatically. Presented by the official Flutter channel.
What people said
Recommends Ferdinand · 2020-10 · Stack Overflow · on “How to display data from MySQL database in table format in flutter application?”
In place of tablerow use DataTable, it will automatically size itself, it has column and row children so its probably the best way to display your data, check this youtube vide out [this video]
Recommends Aakash kondhalkar · 2021-01 · Stack Overflow · on “how to create data table in flutter?”
It's easy to create the table structure you want, flutter has a great widget to arrange data in the table its called DataTable [LINK] DataTable has many features you need. Check out this video on how to use DataTable: [this video] I think DataTable is enough you don't need any package.
Recommends Kab Agouda · 2021-02 · Stack Overflow · on “Flutter : How to add a Header Row to a ListView”
Use DataTable [LINK] widget ! That widget allows you to build a table. Code : DataTable(columns: [], rows: [],) Example : DataTable( columns: [ DataColumn(label: Text('Lang.')), DataColumn(label: Text('Year')), ], rows: [ DataRow(cells: [DataCell(Text('Dart')), DataCell(Text('2010'))]), DataRow(cells: [DataCell(Text('Go')), DataCell(Text('2009'))]), DataRow(cells: [DataCell(Text('PHP')), DataCell(Text('1994'))]), DataRow(cells: [DataCell(Text('Java')), DataCell(Text('1995'))]), ], ) Output: [LINK] You can learn more about DataTable [LINK] by watching this official video [this video] or by visiting flutter.dev [LINK]
Cites Wehid Behrami · 2020-08 · Stack Overflow · on “Best way to create a screen contains details in flutter”
there are two widget in flutter to organize your data 1- Table [LINK] document [LINK] 2- DataTable [this video] document [LINK] check witch one is better for your UI [LINK] class SimInformation extends StatelessWidget { @override Widget build(BuildContext context) { return Padding( padding: const EdgeInsets.all(8.0), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: <Widget>[ Text('Sim information', style: TextStyle(fontWeight: FontWeight.bold),), DataTable( columns: [ DataColumn(label: Text('Sim operator')), DataColumn(label: Row( children: <Widget>[ Text('Vodafone'), Image.asset('assets/images/vodafone.png', width: 30, height: 30,) ], )), ], rows: [ DataRow(cells: [ DataCel
Cites SeriForte · 2020-10 · Stack Overflow · on “Flutter DataTable sort icon not showing”
The sort icon in a Flutter DataTable is not showing and I'm not sure if it is a bug, or if my code is wrong. According to DataTable (Flutter Widget of the Week) [this video] I just have to add sortColumnIndex: 0 inside the DataTable() What I expect: [LINK] What I get: [LINK] This is the Code I'm using: import 'package:flutter/material.dart'; void main() { runApp(MyApp()); } class MyApp extends StatelessWidget { @override Widget build(BuildContext context) { return MaterialApp( title: 'Flutter DataTable', home: DataScreen(), ); } } class DataScreen extends StatelessWidget { @override Widget build(BuildContext context) { return Scaffold( body: Center( child: DataTable( sortColumnIndex: 0, sortAscen
Cites Doc · 2021-05 · Stack Overflow · on “How to add more than 5 columns in flutter using datatable”
[this video] Wrap your DataTable in SingleChildScrollView for handling the overflow. You might need 2; one for vertical scroll and one for horizontal scroll. SingleChildScrollView scrollDirection: Axis.vertical child: SingleChildScrollView scrollDirection: Axis.horizontal child: DataTable