strToDate function

DateTime strToDate(
  1. String day, {
  2. String pattern = "yyyy/MM/dd",
})

Implementation

DateTime strToDate(String day, {String pattern = "yyyy/MM/dd"}) {
  final fromFormatter = DateFormat(pattern);

  return fromFormatter.parse(day);
}