getWidestWidthInAColumn function

double getWidestWidthInAColumn(
  1. Matrix matrix,
  2. double defaultCellWidth,
  3. int x
)

Implementation

double getWidestWidthInAColumn(Matrix matrix, double defaultCellWidth, int x) {
  double acc = 0;
  for (var y = 0; y < matrix.height(); y++) {
    final cell = matrix.getByCoords(x, y);
    acc = max(
        acc,
        cell == null
            ? defaultCellWidth
            : cell.all.fold(
                0,
                (prev, node) =>
                    node.size == null ? defaultCellWidth : node.size!.width));
  }
  return acc;
}