animateToEvent method

Future<void> animateToEvent(
  1. CalendarEventData<T> event, {
  2. Duration? duration,
  3. Curve? curve,
})

Animate to page which contains given events and make event tile visible to user.

Arguments duration and curve will override default values provided as DayView.pageTransitionDuration and DayView.pageTransitionCurve respectively.

Actual duration will be 2 times the given duration.

Ex, If provided duration is 200 milliseconds then this function will take 200 milliseconds for animate to page then 200 milliseconds for scroll to event tile.

Implementation

Future<void> animateToEvent(CalendarEventData<T> event,
    {Duration? duration, Curve? curve}) async {
  await animateToDate(event.date, duration: duration, curve: curve);
  await _scrollConfiguration.setScrollEvent(
    event: event,
    duration: duration ?? widget.pageTransitionDuration,
    curve: curve ?? widget.pageTransitionCurve,
  );
}