tryparse static method

Date? tryparse(
  1. String formattedString
)

Implementation

static Date? tryparse(String formattedString) {
  try {
    return parse(formattedString);
  } on FormatException {
    return null;
  }
}