decode static method
Implementation
static bool? decode(dynamic element) {
if (element == null) {
return null;
}
if (element is bool) {
return element;
}
if (element is String) {
if (element.toLowerCase() == 'true') {
return true;
} else if (element.toLowerCase() == 'false') {
return false;
}
}
return null;
}