boolean method

bool boolean([
  1. double probability = 0.5
])

Generates a random boolean with the given probability of being true.

Implementation

bool boolean([double probability = 0.5]) {
  return _random.nextDouble() < probability;
}