getColumns method

List<GridColumn> getColumns()

Implementation

List<GridColumn> getColumns() {
  if (tableData.isEmpty) return [];
  return tableData[0].keys.map((key) {
    return GridColumn(
      columnName: key,
      width: 120,  // Set a fixed width for each column
      label: Container(
        padding: const EdgeInsets.all(8.0),
        alignment: Alignment.center,
        child: Text(
          key,
          style: GoogleFonts.questrial(
            fontWeight: FontWeight.bold,
          ),
        ),
      ),
    );
  }).toList();
}