parse static method
Parses a string into DateTime. Returns null if invalid.
Implementation
static DateTime? parse(String? value) {
if (value == null) return null;
try {
return DateTime.parse(value);
} catch (_) {
try {
return DateFormat('yyyy-MM-dd HH:mm:ss').parseStrict(value);
} catch (_) {
return null;
}
}
}