Display WeekdayIndicatorStyle only for current month
Opened this issue · 2 comments
Deleted user commented
How to apply style to WeekdayIndicatorStyle so that style is applied only to current month and not previous/next months?
Expecting style for WeekdayIndicator to display differently only for current month (August) and not other months)
But style for weekday is applied to all months not only current month:
JonasWanke commented
That's not possible using only the style provider. You can, however, override MonthWidget
's weekDayBuilder
and return a WeekdayIndicator
with any style you want (not tested):
MonthWidget(
month,
// This is always called with days in the current week. By adding a week
// when we're not showing the current month, the current week day is not
// highlighted.
weekDayBuilder: (context, weekDay) => WeekdayIndicator(
month == DateTimeTimetable.currentMonth()
? weekDay
: weekDay + DateTime.daysPerWeek.days,
),
)
Deleted user commented
@JonasWanke Thank you this worked great!