viewToModelValue method

  1. @override
DateTime? viewToModelValue(
  1. String? viewValue
)

Returns the value that must be supplied to the control.

Converts value from UI data type to control data type.

Implementation

@override
DateTime? viewToModelValue(String? viewValue) {
  final months = int.tryParse(viewValue ?? '');
  final dobAge = DigitDOBAge(
      years: int.tryParse(existingYear) ?? 0, months: months ?? 0, days: 1);
  return accessor.viewToModelValue(dobAge);
}