Home > front end >  What's the use case of TableCell?
What's the use case of TableCell?

Time:04-23

I can show widgets as children of TableRow. They are displayed correctly. What's the use case of TableCell in flutter?

TableRow(children: [
      widget1,
      widget2,
]);

CodePudding user response:

TableCell is a widget that can control how a child of a Table is aligned. 
which means position of a child inside a cell...

Working example :

TableRow(children: [
    TableCell(
    verticalAlignment: TableCellVerticalAlignment.middle,
    child: Text('Soccer',
        style: TextStyle(fontWeight: FontWeight.bold),
        textAlign: TextAlign.center)),Column(children: <Widget>[Text('Ronaldo'), Text('Messi')])

see below document to get more idea about this...

https://medium.com/flutter-community/table-in-flutter-beyond-the-basics-8d31b022b451

  • Related