getColumnSizeBySegments static method

double getColumnSizeBySegments(
  1. double totalSegments,
  2. List<double?> sizes
)

Calculates the column size based on the total segments and the provided sizes.

Implementation

static double getColumnSizeBySegments(double totalSegments, List<double?> sizes) {
  double size = (sizes.nonNulls.firstOrNull ?? 1);
  if (size > 0) {
    size = (totalSegments / size);
  }
  return size;
}