randomRange static method

double randomRange(
  1. num min,
  2. num max
)

Returns a pseudo-random double number between parameters min and max. Doesn't check for errors: Parameters can not be null; And min > max.

Implementation

@pragma("vm:prefer-inline")
static double randomRange(num min, num max) {
  return min.toDouble() + random() * (max.toDouble() - min.toDouble());
}