FCalendarHeaderStyle.inherit constructor

FCalendarHeaderStyle.inherit({
  1. required FColors colors,
  2. required FTypography typography,
  3. required FIcons icons,
  4. required FStyle style,
  5. required bool touch,
})

Creates a FCalendarHeaderStyle that inherits its properties.

Implementation

factory FCalendarHeaderStyle.inherit({
  required FColors colors,
  required FTypography typography,
  required FIcons icons,
  required FStyle style,
  required bool touch,
}) {
  final buttons = FButtonStyles.inherit(colors: colors, typography: typography, style: style, touch: touch);
  final headerTextStyle = (touch ? typography.display.md : typography.display.sm).copyWith(
    color: colors.foreground,
    fontWeight: .w500,
  );
  return FCalendarHeaderStyle(
    headerDecoration: .from(
      ShapeDecoration(shape: RoundedSuperellipseBorder(borderRadius: style.borderRadius.md)),
      variants: {
        [.hovered, .pressed]: .shapeDelta(color: colors.secondary),
      },
    ),
    headerTextStyle: .all(headerTextStyle),
    toggleIconStyle: .all(IconThemeData(color: colors.mutedForeground, size: headerTextStyle.fontSize)),
    headerFocusedOutlineStyle: style.focusedOutlineStyle,
    buttonStyle: touch ? buttons.ghost.md : buttons.ghost.xs,
    toggleIcon: icons.chevronRight,
    previousIcon: icons.chevronLeft,
    nextIcon: icons.chevronRight,
  );
}