animateToDate method

void animateToDate(
  1. DateTime date, {
  2. dynamic duration = const Duration(milliseconds: 500),
  3. dynamic curve = Curves.linear,
})

This function will animate to any date that is passed as a parameter In case a date is out of range nothing will happen

Implementation

void animateToDate(DateTime date,
    {duration = const Duration(milliseconds: 500), curve = Curves.linear}) {
  assert(_datePickerState != null,
      'DatePickerController is not attached to any DatePicker View.');

  _datePickerState!._controller.animateTo(_calculateDateOffset(date),
      duration: duration, curve: curve);
}