refreshMonthDataAndController method
void
refreshMonthDataAndController()
Implementation
void refreshMonthDataAndController() {
var selectedYear = yearIndex + data[0][0];
if (dateEnd[0] == dateStart[0]) {
data[1] = List.generate(
dateEnd[1] - dateStart[1] + 1, (index) => index + dateStart[1]);
} else if (selectedYear == dateStart[0]) {
data[1] =
List.generate(12 - dateStart[1] + 1, (index) => index + dateStart[1]);
} else if (selectedYear == dateEnd[0]) {
data[1] = List.generate(dateEnd[1], (index) => index + 1);
} else {
data[1] = List.generate(12, (index) => index + 1);
}
monthFixedExtentScrollController.jumpToItem(
monthIndex > data[1].length - 1 ? data[1].length - 1 : monthIndex);
}