stringToBool function
Implementation
bool? stringToBool(String? str) {
if (str == null) {
return null;
}
if (str.trim().toLowerCase() == 'false') {
return false;
}
if (str.trim().toLowerCase() == 'true') {
return true;
}
return null;
}