I am new in flutter just want to know using which widget i can create ui like given in below image.
Thanks,
First, we need to add a Table widget in the body. Next, we have to add TableRow(s) in children of the table widget. Since the table widget has multiple rows, so we use children, not child. Finally, we need to add TableCell(s) in children of TableRow widget.
Table widget is used to display items in a table layout. There is no need to use Rows and Columns to create a table. If we have multiple rows with the same width of columns then Table widget is the right approach.
dynamicTable. add(TableRow( children: [ Text("test1"), Text("test2"), Text("test3"), ] ));
Flutter has a Table class for this (but you can also do it using simple Row + Column combo).
Here's the link to the Table docs: Flutter Table
Here's a simple example to get you started:
Container(
color: Colors.white,
padding: EdgeInsets.all(20.0),
child: Table(
border: TableBorder.all(color: Colors.black),
children: [
TableRow(children: [
Text('Cell 1'),
Text('Cell 2'),
Text('Cell 3'),
]),
TableRow(children: [
Text('Cell 4'),
Text('Cell 5'),
Text('Cell 6'),
])
],
),
)
You can use DataTable widget. This sample shows how to display a DataTable with three columns: name, age, and role.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With