FCalendarMonthStyles.inherit constructor
FCalendarMonthStyles.inherit({
- required FColors colors,
- required FTypography typography,
- required FStyle style,
Creates a FCalendarMonthStyles that inherits its properties.
Implementation
factory FCalendarMonthStyles.inherit({
required FColors colors,
required FTypography typography,
required FStyle style,
}) {
final base = FCalendarMonthStyle(
textStyle: typography.body.sm.copyWith(color: colors.foreground),
decoration: ShapeDecoration(shape: RoundedSuperellipseBorder(borderRadius: style.borderRadius.md)),
);
final focused = BorderSide(color: colors.primary, width: style.borderWidth);
return FCalendarMonthStyles(
FVariants.from(
base,
variants: {
[.focused]: .delta(
decoration: .shapeDelta(
shape: RoundedSuperellipseBorder(side: focused, borderRadius: style.borderRadius.md),
),
),
[.focused.and(.hovered), .focused.and(.pressed)]: .delta(
textStyle: .delta(color: colors.secondaryForeground),
decoration: .shapeDelta(
color: colors.secondary,
shape: RoundedSuperellipseBorder(side: focused, borderRadius: style.borderRadius.md),
),
),
[.hovered, .pressed]: .delta(
textStyle: .delta(color: colors.secondaryForeground),
decoration: .shapeDelta(color: colors.secondary),
),
//
[.disabled]: .delta(textStyle: .delta(color: colors.disable(colors.mutedForeground))),
//
[.today]: .delta(textStyle: .delta(decoration: () => .underline)),
[.today.and(.hovered), .today.and(.pressed)]: .delta(
textStyle: .delta(color: colors.secondaryForeground, decoration: () => .underline),
decoration: .shapeDelta(color: colors.secondary),
),
[.today.and(.focused)]: .delta(
textStyle: .delta(decoration: () => .underline),
decoration: .shapeDelta(
shape: RoundedSuperellipseBorder(side: focused, borderRadius: style.borderRadius.md),
),
),
[.today.and(.focused).and(.hovered), .today.and(.focused).and(.pressed)]: .delta(
textStyle: .delta(color: colors.secondaryForeground, decoration: () => .underline),
decoration: .shapeDelta(
color: colors.secondary,
shape: RoundedSuperellipseBorder(side: focused, borderRadius: style.borderRadius.md),
),
),
[.today.and(.disabled)]: .delta(
textStyle: .delta(color: colors.disable(colors.mutedForeground), decoration: () => .underline),
),
},
),
);
}