randomDouble function

double randomDouble({
  1. double? max,
})

Generates a non-negative random floating point value uniformly distributed in the range from 0.0, inclusive, to 1.0, exclusive.

Implementation

double randomDouble({double? max}) => Random().nextDouble() * (max ?? 1);