num random(num ratio)

Source

static num random(num ratio) {
  if (ratio == 0.0 || ratio == 1.0) return ratio;
  return _random.nextDouble();
}