toDate method

DateTime? toDate()

Implementation

DateTime? toDate() {
  if (isEmpty) return null;
  try {
    return DateTime.parse(this);
  } catch (_) {
    return null;
  }
}