'can multiple holidays display using table_calendar on flutter?
I have upgraded table_calendar to the current latest version (3.0.3). now it will change many methods. Now I need to add multiple holidays in the same. how can I do this? I tried this as the following method, but it will display only one day.
TableCalendar(
...
holidayPredicate: (day) => _getHolidays(day),
...
)
_getHolidays(day){
return day == DateTime.utc(2021,12,02);
}
I need to pass a list of holidays here. but this support only one day.
it gives an error as The return type 'List<dynamic>' isn't a 'bool', as required by the closure's context. when I try to pass the list.
are there any alternative methods on table_calendar or any suggestions to fix this issue? I cannot use eventLoader because I already use it to mark some events on the calendar.
Solution 1:[1]
I think you should using your _getHolidays method to process other day list. It will return true/false whether the day is holiday or not.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Abach |
