goToDate method

dynamic goToDate (
  1. {@required DateTime dateTime,
  2. Duration duration,
  3. Curve curve: Curves.bounceInOut}
)

scroll to special day in month / week

it will do animate while duration is not null

Implementation

goToDate({
  @required DateTime dateTime,
  Duration duration,
  Curve curve = Curves.bounceInOut
}) {
  int index;
  if (isMinimal) {
    index = _getWeekIndexOfDate(dateTime);
  } else {
    index = _getIndexOfDate(dateTime.year, dateTime.month);
  }

  if (duration != null) {
    _pageController.animateToPage(
      index,
      duration: duration,
      curve: curve
    );
  } else {
    _pageController.jumpToPage(index);
  }
}