toDate method
Convert DateString to DateTime Object
Implementation
DateTime? toDate() {
try {
final DateTime st = DateTime.parse(this);
return st;
// ignore: unused_catch_clause
} on FormatException catch (e) {
return null;
}
}