scrollTo method

void scrollTo(
  1. DateTime dateTime, [
  2. bool isEnableAnimation = true
])

scroll to specific date's position isEnableAnimation default set as true, jump with animation

Implementation

void scrollTo(DateTime dateTime, [bool isEnableAnimation = true]) {
  if (isWithinRange(dateTime) && realStartDate != null) {
    int index = dateTime.difference(realStartDate!).inDays;
    _scrollToSpecificDateByIndex(index);
  } else {
    //out of range do nothing
  }
}