MonthWidgetStyle constructor
MonthWidgetStyle(
- BuildContext context,
- DateTime month, {
- int? startOfWeek,
- Decoration? weeksDecoration,
- EdgeInsetsGeometry? weeksPadding,
- bool? removeIndividualWeekDecorations,
- EdgeInsetsGeometry? datePadding,
- bool? showDatesFromOtherMonths,
- bool? showDatesFromOtherMonthsAsDisabled,
Implementation
factory MonthWidgetStyle(
BuildContext context,
DateTime month, {
int? startOfWeek,
Decoration? weeksDecoration,
EdgeInsetsGeometry? weeksPadding,
bool? removeIndividualWeekDecorations,
EdgeInsetsGeometry? datePadding,
bool? showDatesFromOtherMonths,
bool? showDatesFromOtherMonthsAsDisabled,
}) {
assert(startOfWeek.debugCheckIsValidTimetableDayOfWeek());
assert(month.debugCheckIsValidTimetableMonth());
final theme = context.theme;
removeIndividualWeekDecorations ??= true;
return MonthWidgetStyle.raw(
startOfWeek: startOfWeek ?? DateTime.monday,
weeksDecoration: weeksDecoration ??
(removeIndividualWeekDecorations
? BoxDecoration(
color: theme.colorScheme.brightness.contrastColor
.withOpacity(0.05),
borderRadius: const BorderRadius.all(Radius.circular(4)),
)
: const BoxDecoration()),
weeksPadding: weeksPadding ?? const EdgeInsets.symmetric(vertical: 12),
removeIndividualWeekDecorations: removeIndividualWeekDecorations,
datePadding: datePadding ?? const EdgeInsets.all(4),
showDatesFromOtherMonths: showDatesFromOtherMonths ?? true,
showDatesFromOtherMonthsAsDisabled:
showDatesFromOtherMonthsAsDisabled ?? true,
);
}