MonthWidgetStyle constructor

MonthWidgetStyle(
  1. BuildContext context,
  2. DateTime month, {
  3. int? startOfWeek,
  4. Decoration? weeksDecoration,
  5. EdgeInsetsGeometry? weeksPadding,
  6. bool? removeIndividualWeekDecorations,
  7. EdgeInsetsGeometry? datePadding,
  8. bool? showDatesFromOtherMonths,
  9. 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,
  );
}