Data Table in flutter


Flutter comes with its own UI toolkit full of many widgets that do various things. One such widget Flutter offers is the DataTable widget to display tabular data structures. The Data Table in flutter is very flexible compared to the native platform-specific list views.

For Mobile app developers, displaying data is an everyday task. We also need to display data in tables by laying out all the rows & columns with appropriate needed space for the same. Data tables are easy to understand. It also helps users to categorize the data. Data Table in flutter also helps to show & understand more data in less space.

Let’s check how can we implement DataTable in flutter.

Add Data Table Widget:

Create a Data table by adding a Data Table widget & add decoration using the Table Border widget.

Define Data Columns:

Add Data columns in the Data Table column property:

Define rows & data cells:

Create Data rows and add data cells to them.

We can use its different properties for different purposes. I want to select the row by tapping on it. Let’s check how can we select a row.

Show selected row:

selected: It’s a property that takes a boolean value & shows if the row is selected or not.

onSelectChanged: It is called when the user selects or unselects a selectable row

Define an integer selectedIndex:

Add condition on selected property & change selectedIndex value onSelectChanged.


Full code:



This is how we create Data Tables in flutter.

Thanks for reading this article ❤

If I got something wrong 🙈, let me know in the comments. I would love to improve.

For more interesting blogs check out here –

Reference link:

. . .

Leave a Comment

Your email address will not be published. Required fields are marked*

Be the first to comment.


All communication is done through a ticket system. I appreciate the regular almost daily updates of what is being worked on, and communicating changes or updates is easy through this system. Mobikul's response timeframe is quick.

Josh Arnold

Josh Arnold

Owner, Shop ATV Escape

Talk to Sales


Live Chat
Start a Project

    Message Sent!

    If you have more details or questions, you can reply to the received confirmation email.

    Back to Home