decode static method

bool? decode(
  1. dynamic element
)

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;
}