isBool function
Returns true if value
is bool. Can be a bool as string too.
Implementation
bool isBool(Object? value) {
if (value == null) return false;
if (value is bool) return true;
var s = value.toString().toLowerCase();
return _regexpBool.hasMatch(s);
}