WeekdayIndicatorStyle constructor

WeekdayIndicatorStyle(
  1. BuildContext context,
  2. DateTime date, {
  3. Decoration? decoration,
  4. EdgeInsetsGeometry? padding,
  5. TextStyle? textStyle,
  6. String? label,
})

Implementation

factory WeekdayIndicatorStyle(
  BuildContext context,
  DateTime date, {
  Decoration? decoration,
  EdgeInsetsGeometry? padding,
  TextStyle? textStyle,
  String? label,
}) {
  assert(date.debugCheckIsValidTimetableDate());

  final theme = context.theme;
  return WeekdayIndicatorStyle.raw(
    decoration: decoration ?? const BoxDecoration(),
    padding: padding ?? EdgeInsets.zero,
    textStyle: textStyle ??
        theme.textTheme.bodySmall!.copyWith(
          color: date.isToday
              ? theme.colorScheme.primary
              : theme.colorScheme.background.mediumEmphasisOnColor,
        ),
    label: label ??
        () {
          context.dependOnTimetableLocalizations();
          return DateFormat('EEE').format(date);
        }(),
  );
}