computeHeaderCellHeight method Null safety

  1. @protected
double computeHeaderCellHeight(
  1. GridColumn column,
  2. TextStyle textStyle
)

Calculates the height of the header cell based on the GridColumn.columnName.

class CustomColumnSizer extends ColumnSizer {
@override
 double computeHeaderCellHeight(GridColumn column,
     TextStyle textStyle) {
  TextStyle style = textStyle;
  if (column.columnName == 'Name')
   style = TextStyle(fontSize: 20, fontStyle: FontStyle.italic);
 return super.computeHeaderCellHeight(column, style);
}
}

The auto size is calculated based on default TextStyle of the datagrid.

Implementation

@protected
double computeHeaderCellHeight(GridColumn column, TextStyle textStyle) {
  return _measureCellHeight(
      column,
      grid_helper.getHeaderIndex(_dataGridStateDetails!()),
      column.columnName,
      textStyle);
}