tryCastToBool method

bool? tryCastToBool()

Implementation

bool? tryCastToBool() {
  if (this == null) {
    return null;
  }
  if (this is bool) {
    return this as bool;
  }
  return this.toString().trim().toBoolean();
}