You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When you have a date that is disabled, the disabled style goes before everything. Which is not wanted if you want to have a specific style for today, or for holidays.
I would say that's the expected behavior. If you explicitly disable a given day, then I would expect it to look and behave differently.
If you disable gestures for it, but keep the look of other specific styles, then user might wonder why tapping on this day does nothing, since there are no visual indicators to distinguish it from other days.
Describe the bug
When you have a date that is disabled, the disabled style goes before everything. Which is not wanted if you want to have a specific style for today, or for holidays.
To reproduce
Code sample
` class BugExample extends StatefulWidget { const BugExample({Key? key}) : super(key: key);@OverRide
State createState() => _BugExampleState();
}
class _BugExampleState extends State {
DateTime? selected;
@OverRide
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(automaticallyImplyLeading: true),
body: TableCalendar(
startingDayOfWeek: StartingDayOfWeek.monday,
availableCalendarFormats: {CalendarFormat.month: "Months"},
firstDay: DateTime.now(),
lastDay: DateTime.now().add(const Duration(days: 40)),
focusedDay: selected ?? DateTime.now(),
enabledDayPredicate: (day) => false,
selectedDayPredicate: (day) {
return isSameDay(day, selected);
},
holidayPredicate: (day) =>
isSameDay(day, DateTime.now().add(Duration(days: 2))),
onDaySelected: (selectedDay, focusedDay) {
setState(() {
selected = selectedDay;
});
},
headerStyle: const HeaderStyle(
titleCentered: true,
leftChevronIcon: Icon(
Icons.chevron_left,
color: Colors.white,
),
rightChevronIcon: Icon(
Icons.chevron_right,
color: Colors.white,
),
),
calendarStyle: const CalendarStyle(
isTodayHighlighted: true,
selectedDecoration:
BoxDecoration(shape: BoxShape.circle, color: Colors.yellow),
todayDecoration:
BoxDecoration(shape: BoxShape.circle, color: Colors.green),
todayTextStyle: TextStyle(color: Colors.red)),
),
);
}
}
`
Expected behavior
The disabled style should be last to be applied.
The text was updated successfully, but these errors were encountered: