truthful static method Null safety
- dynamic value
Implementation
static bool truthful(value) {
if (value == null) {
return false;
}
if (value == true ||
value == 'true' ||
value == 1 ||
value == '1' ||
value.toString().toLowerCase() == 'yes') {
return true;
}
return false;
}