convertToDateTime method

DateTime convertToDateTime (
  1. {String dateString,
  2. int timeInMillis}
)

Implementation

static DateTime convertToDateTime({String dateString, int timeInMillis})
{
  if(dateString != null) return DateTime.tryParse(dateString);
  return timeInMillis != null ? DateTime.fromMillisecondsSinceEpoch(timeInMillis) : null;
}