decode static method

DateTime? decode(
  1. dynamic element
)

Implementation

static DateTime? decode(dynamic element) {
  if (element == null) {
    return null;
  }
  if (element is! String) {
    return null;
  }
  try {
    return DateTime.parse(element);
  } catch (e) {
    return null;
  }
}