toDate method

DateTime? toDate()

Converts the current text value of the controller to a DateTime object.

Returns null if the text is blank or cannot be parsed as a date.

Implementation

DateTime? toDate() {
  return text.toDate();
}