toDate method

DateTime? toDate({
  1. required String format,
})

Transfor String to DateTime

Implementation

DateTime? toDate({required String format}) {
  if (isNotNullOrEmpty) {
    return DateFormat(format).parse(this);
  } else {
    return null;
  }
}