nextPage method

Future<bool> nextPage()

月份或者星期的下一页 true:成功 false:是最后一页

Implementation

Future<bool> nextPage() async {
  if (calendarProvider.expandStatus.value == true) {
    //月视图
    int currentIndex =
        calendarProvider.calendarConfiguration.monthController.page.toInt();
    if (monthList.length - 1 == currentIndex) {
      return false;
    } else {
      calendarProvider.calendarConfiguration.monthController
          .nextPage(duration: DEFAULT_DURATION, curve: Curves.ease);
      calendarProvider.calendarConfiguration.monthChangeListeners
          .forEach((listener) {
        listener(monthList[currentIndex + 1].year,
            monthList[currentIndex + 1].month);
      });

      DateModel temp = new DateModel();
      temp.year = monthList[currentIndex].year;
      temp.month = monthList[currentIndex].month;
      temp.day = monthList[currentIndex].day + 14;
      print('341 周视图的变化: $temp');
      calendarProvider.lastClickDateModel = temp;
      return true;
    }
  } else {
    //周视图
    int currentIndex =
        calendarProvider.calendarConfiguration.weekController.page.toInt();
    if (weekList.length - 1 == currentIndex) {
      return false;
    } else {
      calendarProvider.calendarConfiguration.weekController
          .nextPage(duration: DEFAULT_DURATION, curve: Curves.ease);
      return true;
    }
  }
}