computeHeaderAutoFitExtents<CellDataType extends SwayzeCellData> function
Future<Map<int, double> >
computeHeaderAutoFitExtents<CellDataType extends SwayzeCellData>({
- required BuildContext context,
- required Axis axis,
- required Iterable<
int> headerPositions, - required SwayzeTableDataController<
SwayzeController> tableDataController, - required CellDelegate<
CellDataType> cellDelegate, - required MatrixMapReadOnly<
CellDataType> cellMatrix, - required SwayzeStyle style,
- required String headerLabelFor(
- int headerPosition
Implementation
Future<Map<int, double>> computeHeaderAutoFitExtents<CellDataType extends SwayzeCellData>({
required BuildContext context,
required Axis axis,
required Iterable<int> headerPositions,
required SwayzeTableDataController tableDataController,
required CellDelegate<CellDataType> cellDelegate,
required MatrixMapReadOnly<CellDataType> cellMatrix,
required SwayzeStyle style,
required String Function(int headerPosition) headerLabelFor,
}) async {
final result = <int, double>{};
for (final headerPosition in headerPositions) {
if (!context.mounted) {
break;
}
final extent = await computeHeaderAutoFitExtent<CellDataType>(
context: context,
axis: axis,
headerPosition: headerPosition,
tableDataController: tableDataController,
cellDelegate: cellDelegate,
cellMatrix: cellMatrix,
style: style,
headerLabel: headerLabelFor(headerPosition),
);
if (extent != null) {
result[headerPosition] = extent;
}
}
return result;
}