parse method Null safety

DateTime parse(
  1. String inputString,
  2. [bool utc = false]
)

Given user input, attempt to parse the inputString into the anticipated format, treating it as being in the local timezone.

If inputString does not match our format, throws a FormatException. This will accept dates whose values are not strictly valid, or strings with additional characters (including whitespace) after a valid date. For stricter parsing, use parseStrict.

Implementation

DateTime parse(String inputString, [bool utc = false]) =>
    _parse(inputString, utc: utc, strict: false);