controlCalendar method

void controlCalendar({
  1. required int number,
})

Implementation

void controlCalendar({required int number}) {
  int calcMonthValue = monthValue['value'] + number;
  int calcYearValue = yearValue['value'] + number;
  setState(() {
    if (calcMonthValue > 12) {
      calcMonthValue = 1;
      setCalcYearValue(calcYearValue: calcYearValue);
    } else if (calcMonthValue < 1) {
      calcMonthValue = 12;
      setCalcYearValue(calcYearValue: calcYearValue);
    }
    monthValue =
        findValue(list: widget.monthLabelList, value: calcMonthValue);
    setCalendar();
  });
  monthDropdown.currentState!.setDefaultValue(defaultValue: monthValue);
}