If you want to let the row vary in a predictable way only changing based on the actual height of the contents of the row, you can do this by NOT setting dataRowHeight
, which is deprecated anyway, but instead setting dataRowMinHeight
and dataRowMaxHeight
to different values. If you set those differently, then each row's height will be driven by its own contents within the bounds of the defined min and max.
If you are looking instead to define a variable row height based on some independent thing (like every odd row tall and every even row short or whatever), that is not possible with DataTable
.
DataTable
calculates an effectiveDataRowMinHeight
and effectiveDataRowMaxHeight
from either a given dataRowHeight
, given dataRowMinHeight
and dataRowMaxHeight
, or values from the Theme or some other automatic constants. Then, DataTable
uses that effective min and max for every cell in the table. Inside DataTable
's build()
method, at one point, it runs its own _buildDataCell()
method on each cell in each row. In that method, it applies the same min and max to each cell.
Then, when each table's row is laid out, it will set the same height for all cells in that row based on the min and max they all have and the desired height for each.
*edited to clarify that the min and max heights need to be set to different values for this to work as intended.