FHeaderStyles.inherit constructor

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

Creates a FHeaderStyles that inherits its properties.

Implementation

factory FHeaderStyles.inherit({
  required FColors colors,
  required FTypography typography,
  required FStyle style,
  required bool touch,
}) {
  final constraints = BoxConstraints(minHeight: touch ? 62 : 54);
  final root = FHeaderStyle(
    systemOverlayStyle: colors.systemOverlayStyle,
    titleTextStyle: typography.xl2.copyWith(color: colors.foreground, fontWeight: .w700, height: 1),
    actionStyle: .inherit(colors: colors, style: style, size: typography.xl2.fontSize ?? 30, padding: const .all(7)),
    padding: style.pagePadding.copyWith(bottom: 10),
    constraints: constraints,
  );

  return FHeaderStyles(
    FVariants(
      root,
      variants: {
        [.root]: root,
        [.nested]: FHeaderStyle(
          systemOverlayStyle: colors.systemOverlayStyle,
          titleTextStyle: typography.xl.copyWith(color: colors.foreground, fontWeight: .w600, height: 1),
          actionStyle: .inherit(
            colors: colors,
            style: style,
            size: typography.xl.fontSize ?? 22,
            padding: .all(touch ? 11 : 8),
          ),
          padding: style.pagePadding.copyWith(bottom: 10),
          constraints: constraints,
        ),
      },
    ),
  );
}