toBool function
Implementation
bool? toBool(dynamic s) {
try {
if (s == null) return null;
if (s is bool) return s;
s = s.toString().trim().toLowerCase();
if (s == "true") return true;
if (s == "false") return false;
return null;
} catch (e) {
return null;
}
}