tryParse static method
Returns null if format.parse()
throws.
Implementation
static DateTime? tryParse(String string, DateFormat format) {
if (string.isNotEmpty) {
try {
return format.parse(string);
} catch (e) {
// print('Error parsing date: $e');
}
}
return null;
}