Is it possible to define the size of the rows in flutter?
code:
Table(
border: TableBorder.all(color: Colors.white30),
defaultVerticalAlignment:
TableCellVerticalAlignment.middle,
children: [
TableRow(
decoration: BoxDecoration(
color: Colors.blueGrey,
borderRadius: BorderRadius.only(
topLeft: Radius.circular(12),
topRight: Radius.circular(12),
),
),
children: [
// header da coluna
for (var header in [
"Id produção",
"Id funcionário",
"Cod Referencia",
"Quantidade",
"Hora Incial",
"Hora Final",
"Obs"
])
TableCell(
verticalAlignment:
TableCellVerticalAlignment.middle,
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Text(
header,
style: TextStyle(
color: Colors.white,
),
textAlign: TextAlign.center,
),
),
),
],
),
I have looked if it can be done by any attribute but didn’t found yet.
2
Answers
One way to achieve this is by wrapping the content of each
TableCell
in aContainer
and setting the height of theContainer
.By define
columnWidths
you can set width in table,For more information about
Table
Happy Coding!!