RandomEffectController.uniform constructor

RandomEffectController.uniform(
  1. DurationEffectController child, {
  2. required double min,
  3. required double max,
  4. Random? random,
})

Factory constructor that uses a random variable uniformly distributed on [min, max).

Implementation

factory RandomEffectController.uniform(
  DurationEffectController child, {
  required double min,
  required double max,
  Random? random,
}) {
  assert(min >= 0, 'Min value cannot be negative: $min');
  assert(min < max, 'Max value must exceed min: max=$max, min=$min');
  return RandomEffectController(
    child,
    _UniformRandomVariable(min, max, random),
  );
}