preCalculateSteps static method

List<double> preCalculateSteps(
  1. double start,
  2. double end,
  3. int count
)

Pre-calculate step values for loops

Implementation

static List<double> preCalculateSteps(double start, double end, int count) {
  final step = (end - start) / count;
  return List.generate(count + 1, (i) => start + step * i);
}