toBooleanOrNull method

bool? toBooleanOrNull()

Implementation

bool? toBooleanOrNull() {
  String normalized = this.toLowerCase();
  if (normalized == "true") {
    return true;
  }
  if (normalized == "false") {
    return false;
  }
  return null;
}