toBoolOrNull method

bool? toBoolOrNull()

Implementation

bool? toBoolOrNull() {
  final lowerCaseStr = toLowerCase();
  if (lowerCaseStr == 'true') return true;
  if (lowerCaseStr == 'false') return false;
  return toIntOrNull() != null && toIntOrNull()! > 0;
}