randomDouble function

double randomDouble([
  1. double min = 0,
  2. double max = 999999
])

Generates a random double between the specified min and max values.

Implementation

double randomDouble([double min = 0, double max = 999999]) {
  var n = min.compareAndSwap(max);
  min = n.first;
  max = n.last;
  return min + _random.nextDouble() * (max - min);
}