parseDateTime function
Parses a string into a DateTime.
- Uses DateTime.parse.
- Returns
nullifvalueisnullor empty. - Throws FormatException if the string is not a valid ISO date.
Implementation
DateTime? parseDateTime(String? value) {
if (value != null && value.isNotEmpty) {
return DateTime.parse(value);
}
return null;
}