FItemStyles.inherit constructor

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

Creates a FItemStyles that inherits its properties.

Implementation

factory FItemStyles.inherit({
  required FColors colors,
  required FTypography typography,
  required FStyle style,
  required bool touch,
}) {
  final primary = FItemStyle.inherit(colors: colors, typography: typography, style: style, touch: touch);

  return FItemStyles(
    FVariants.from(
      primary,
      variants: {
        [.primary]: primary,
        [.destructive]: .delta(
          contentStyle: FItemContentStyle.inherit(
            colors: colors,
            typography: typography,
            prefix: colors.destructive,
            foreground: colors.destructive,
            mutedForeground: colors.destructive,
            touch: touch,
          ),
          rawContentStyle: FRawItemContentStyle.inherit(
            colors: colors,
            typography: typography,
            prefix: colors.primary,
            color: colors.primary,
            touch: touch,
          ),
        ),
      },
    ),
  );
}