animateToSelection method

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

This function will animate the Timeline to the currently selected Date

Implementation

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

  // animate to the current date
  _datePickerState!._controller.animateTo(
      _calculateDateOffset(_datePickerState!._currentDate!),
      duration: duration,
      curve: curve);
}