checkDaySelected method
Implementation
void checkDaySelected(DateTime startDate, DateTime endDate) {
var middleDate = startDate;
if (!startDate.isSameDate(endDate)) {
middleDate = startDate.add(
Duration(days: (endDate.difference(startDate).inDays / 2).floor()));
}
if (!middleDate.isSameMonth(DateTime(currentYear, currentMonth))) {
currentYear = middleDate.year;
currentMonth = middleDate.month;
setState(() {});
}
}