moveToNextMonth method

void moveToNextMonth(
  1. {bool needAnimation = false,
  2. Duration duration = const Duration(milliseconds: 500),
  3. Curve curve = Curves.ease}
)

Implementation

void moveToNextMonth(
    {bool needAnimation = false,
    Duration duration = const Duration(milliseconds: 500),
    Curve curve = Curves.ease}) {
  //    如果当前显示的是周视图的话,需要计算出第一个月的index后,调用weekController
  if (calendarProvider.expandStatus.value == false) {
    int currentMonth = weekList[calendarProvider
            .calendarConfiguration.weekController.page
            .toInt()]
        .month;
    for (int i = calendarProvider.calendarConfiguration.weekController.page
            .toInt();
        i < weekList.length;
        i++) {
      if (weekList[i].month != currentMonth) {
        calendarProvider.calendarConfiguration.weekController.jumpToPage(i);
        break;
      }
    }
    return;
  }

  if ((calendarProvider.calendarConfiguration.monthController.page.toInt() +
          1) >=
      monthList.length) {
    LogUtil.log(TAG: this.runtimeType, message: "moveToNextMonth:当前是最后一个月份");
    return;
  }
  DateTime targetDateTime = monthList[calendarProvider
              .calendarConfiguration.monthController.page
              .toInt() +
          1]
      .getDateTime();
  moveToCalendar(
      targetDateTime.year, targetDateTime.month, targetDateTime.day,
      needAnimation: needAnimation, duration: duration, curve: curve);
}