moveToNextMonth method
void
moveToNextMonth({})
Implementation
void moveToNextMonth(
{bool needAnimation = false,
Duration duration = const Duration(milliseconds: 500),
Curve curve = Curves.ease}) {
// 如果当前显示的是周视图的话,需要计算出第一个月的index后,调用weekController
if (calendarLogic.expandStatus.value == false) {
int currentMonth = weekList[calendarLogic
.calendarConfiguration.weekController!.page!
.toInt()]
.month;
for (int i = calendarLogic.calendarConfiguration.weekController!.page!
.toInt();
i < weekList.length;
i++) {
if (weekList[i].month != currentMonth) {
calendarLogic.calendarConfiguration.weekController!.jumpToPage(i);
break;
}
}
return;
}
if ((calendarLogic.calendarConfiguration.monthController!.page!.toInt() +
1) >=
monthList.length) {
LogUtil.log(TAG: this.runtimeType, message: "moveToNextMonth:当前是最后一个月份");
return;
}
DateTime targetDateTime = monthList[calendarLogic
.calendarConfiguration.monthController!.page!
.toInt() +
1]
.getDateTime();
moveToCalendar(
targetDateTime.year, targetDateTime.month, targetDateTime.day,
needAnimation: needAnimation, duration: duration, curve: curve);
}