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(
    _monthTimelineState != null,
    'MonthTimelineController is not attached to any DatePicker View.',
  );

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