toBool property

bool get toBool

toBool: convert a string to bool ('true' == true, 'false' == false, '1' == true, '0' == false)

Implementation

bool get toBool {
  if (isNull) return false;
  if (toLower == "true") return true;
  if (toLower == "false") return false;
  if (this is num) return (this as num).toBool;
  return false;
}