randomItemOrNull<T> function
Picks a random item from an Iterable or null if it's empty.
Implementation
T? randomItemOrNull<T>(Iterable<T> pool) =>
pool.isEmpty ? null : pool.elementAtOrNull(_random.nextInt(pool.length));
Picks a random item from an Iterable or null if it's empty.
T? randomItemOrNull<T>(Iterable<T> pool) =>
pool.isEmpty ? null : pool.elementAtOrNull(_random.nextInt(pool.length));