first static method
Returns the first date in the list of dates, ignoring null values.
Implementation
static DateTime? first(Iterable<DateTime?>? dates) {
if (dates == null) return null;
final filteredDates = dates.whereType<DateTime>();
if (filteredDates.isEmpty) return null;
return filteredDates.reduce((a, b) => a.isBefore(b) ? a : b);
}