buildDataColumn method
DataColumn
buildDataColumn(
- BuildContext context,
- Map spec,
- bool sortable,
- StateSetter setState,
- Widget? labelWidget,
Implementation
DataColumn buildDataColumn(BuildContext context, Map spec, bool sortable,
StateSetter setState, Widget? labelWidget) {
final props = spec["properties"] ?? {};
final label = props["label"] ?? spec["name"] ?? "";
final specAlias = props["alias"] ?? label;
return DataColumn(
label: labelWidget ?? Text(Lowder.properties.getText(label, "title")),
numeric: parseBool(props["numeric"]),
tooltip: props["tooltip"],
onSort: !parseBool(props["sortable"], defaultValue: sortable)
? null
: (idx, asc) => setState(() {
sortState["idx"] = idx;
sortState["key"] = specAlias;
sortState["asc"] = asc;
sortState["ascKey"] = asc ? specAlias : null;
sortState["descKey"] = asc ? null : specAlias;
loadPage(page: 1);
}),
);
}