getBool static method

bool getBool([
  1. double chance = 0.5
])

Gets a random boolean with chance chance.

Implementation

static bool getBool([double chance = 0.5]) {
  return random.nextDouble() < chance;
}