viewToModelValue method
Returns the value that must be supplied to the control.
Converts value from UI data type to control data type.
Implementation
@override
DateTime? viewToModelValue(viewValue) {
return viewValue == null || viewValue.trim().isEmpty
? null
: dateTimeFormat.parse(viewValue);
}