parseOutputBOOL method

bool parseOutputBOOL(
  1. Object? value
)

Implementation

bool parseOutputBOOL(Object? value) {
  if (value == null) return false;
  if (value is bool) return value;

  if (value is num) {
    var n = value.toInt();
    return n >= 1;
  }

  var s = '$value'.trim().toLowerCase();
  return s == 'true' || s == '1' || s == 'yes' || s == 't' || s == 'y';
}