falsy function

dynamic falsy({
  1. Set? pool,
})

Return a random falsy value (false, null, 0, ''). usages falsy() falsy({ pool: {null, '', 0} })

Implementation

dynamic falsy({
  /// The default pool can be changed to better meet the needs:
  Set<dynamic>? pool,
}) {
  if (pool != null) {
    return pool.toList()[Random().nextInt(_falsyValues.length)];
  }
  return _falsyValues.toList()[Random().nextInt(_falsyValues.length)];
}