computeEnabledPages method
Implementation
Future<void> computeEnabledPages(DateTime date) async {
// in the case of a click on the next or previous page, the dat will be identical
DateTime newDate = _computeFirstDateOfCalendarFormat(date, _calendarFormat);
previousPageEnabled = widget.firstDay == null ||
!(newDate.isBefore(widget.firstDay!) ||
newDate.isAtSameMomentAs(widget.firstDay!));
DateTime nextFuturDate =
_computeLastDateOfCalendarFormat(newDate, _calendarFormat);
nextPageEnabled = widget.lastDay == null ||
!(nextFuturDate.isAfter(widget.lastDay!) ||
nextFuturDate.isAtSameMomentAs(widget.lastDay!));
}