buildDataColumns method

List<DataColumn> buildDataColumns(
  1. BuildContext context,
  2. StateSetter setState
)

Implementation

List<DataColumn> buildDataColumns(
    BuildContext context, StateSetter setState) {
  final columns = <DataColumn>[];
  final columnsSpec = widgets["columns"];
  final childrenSpec = widgets["children"];
  final sortable = parseBool(props["sortable"]);

  if (columnsSpec != null && columnsSpec.length == childrenSpec?.length) {
    for (var childSpec in columnsSpec) {
      final widget =
          Lowder.widgets.buildWidget(context, childSpec, state, null);
      columns.add(
          buildDataColumn(context, childSpec, sortable, setState, widget));
    }
  } else {
    for (var childSpec in childrenSpec) {
      columns
          .add(buildDataColumn(context, childSpec, sortable, setState, null));
    }
  }
  return columns;
}