toBool static method

bool toBool(
  1. String? value
)

Implementation

static bool toBool(String? value) {
  if (value == null) return false;

  final v = value.toLowerCase().trim();
  if (v == 'true' || v == '1' || v == 'yes') return true;
  if (v == 'false' || v == '0' || v == 'no') return false;

  return false; // unknown or invalid value
}