getItemWidth static method

double getItemWidth(
  1. double totalWidth
)

Implementation

static double getItemWidth(double totalWidth) {
  double spacing = KLineController.shared.spacing;
  int itemCount = KLineController.shared.itemCount;
  // item width = total width / item count - spacing
  double itemW = totalWidth / itemCount - spacing;
  KLineController.shared.itemWidth = itemW;
  return itemW;
}