DateTime? dateFromJson(Object? json) { if (json == null) { return null; } else { return DateFormat('yyyy-MM-dd').parse(json as String); } }