getDateTime static method
get DateTime By DateStr.
Implementation
static DateTime? getDateTime(String dateStr, {bool? isUtc}) {
DateTime? dateTime = DateTime.tryParse(dateStr);
if (isUtc != null) {
if (isUtc) {
dateTime = dateTime?.toUtc();
} else {
dateTime = dateTime?.toLocal();
}
}
return dateTime;
}