dateFromJson static method
Implementation
static DateTime? dateFromJson(Map<String, dynamic> json, String attribute,
{DateTime? defaultValue}) {
try {
return json[attribute] != null
? DateTime.parse(json[attribute]).toLocal()
: defaultValue;
} catch (e) {
throw Exception('Error while parsing $attribute[$e]');
}
}