animateToDate method

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

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

Implementation

void animateToDate(DateTime date,
    {Duration duration = const Duration(milliseconds: 500),
    Curve curve = Curves.linear}) {
  _animateToOffset(_targetOffsetForDate(date), duration, curve);
}