optionalDateTime function
The DateTime at key when there is one, null when the field is absent, and
a FormatException when it is present but not a date.
Implementation
DateTime? optionalDateTime(Map<String, dynamic> json, String key, String what) {
if (json[key] == null) return null;
return requireDateTime(json, key, what);
}