previousPage method

Future<bool> previousPage()

月份或者星期的上一页

Implementation

Future<bool> previousPage() async {
  if (calendarProvider.expandStatus.value == true) {
    //月视图
    int currentIndex = calendarProvider.calendarConfiguration.monthController.page.toInt();
    if (currentIndex == 0) {
      return false;
    } else {
      calendarProvider.calendarConfiguration.monthController.previousPage(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('298 周视图的变化: $temp');
      calendarProvider.lastClickDateModel = temp;
      return true;
    }
  } else {
    //周视图
    int currentIndex = calendarProvider.calendarConfiguration.weekController.page.toInt();
    if (currentIndex == 0) {
      return false;
    } else {
      calendarProvider.calendarConfiguration.weekController.previousPage(duration: DEFAULT_DURATION, curve: Curves.ease);
      return true;
    }
  }
}