FButtonStyles.inherit constructor

FButtonStyles.inherit({
  1. required FColorScheme colorScheme,
  2. required FTypography typography,
  3. required FStyle style,
})

Creates a FButtonCustomStyle that inherits its properties from the provided colorScheme, typography, and style.

Implementation

FButtonStyles.inherit({required FColorScheme colorScheme, required FTypography typography, required FStyle style})
    : primary = FButtonCustomStyle(
        enabledBoxDecoration: BoxDecoration(
          borderRadius: style.borderRadius,
          color: colorScheme.primary,
        ),
        disabledBoxDecoration: BoxDecoration(
          borderRadius: style.borderRadius,
          color: colorScheme.primary.withOpacity(0.5),
        ),
        content: FButtonContentStyle.inherit(
          typography: typography,
          enabled: colorScheme.primaryForeground,
          disabled: colorScheme.primaryForeground.withOpacity(0.5),
        ),
        icon: FButtonIconStyle(
          enabledColor: colorScheme.primaryForeground,
          disabledColor: colorScheme.primaryForeground.withOpacity(0.5),
        ),
      ),
      secondary = FButtonCustomStyle(
        enabledBoxDecoration: BoxDecoration(
          borderRadius: style.borderRadius,
          color: colorScheme.secondary,
        ),
        disabledBoxDecoration: BoxDecoration(
          borderRadius: style.borderRadius,
          color: colorScheme.secondary.withOpacity(0.5),
        ),
        content: FButtonContentStyle.inherit(
          typography: typography,
          enabled: colorScheme.secondaryForeground,
          disabled: colorScheme.secondaryForeground.withOpacity(0.5),
        ),
        icon: FButtonIconStyle(
          enabledColor: colorScheme.secondaryForeground,
          disabledColor: colorScheme.secondaryForeground.withOpacity(0.5),
        ),
      ),
      destructive = FButtonCustomStyle(
        enabledBoxDecoration: BoxDecoration(
          borderRadius: style.borderRadius,
          color: colorScheme.destructive,
        ),
        disabledBoxDecoration: BoxDecoration(
          borderRadius: style.borderRadius,
          color: colorScheme.destructive.withOpacity(0.5),
        ),
        content: FButtonContentStyle.inherit(
          typography: typography,
          enabled: colorScheme.destructiveForeground,
          disabled: colorScheme.destructiveForeground.withOpacity(0.5),
        ),
        icon: FButtonIconStyle(
          enabledColor: colorScheme.destructiveForeground,
          disabledColor: colorScheme.destructiveForeground.withOpacity(0.5),
        ),
      ),
      outline = FButtonCustomStyle(
        enabledBoxDecoration: BoxDecoration(
          border: Border.all(
            color: colorScheme.border,
          ),
          borderRadius: style.borderRadius,
          color: colorScheme.background,
        ),
        disabledBoxDecoration: BoxDecoration(
          border: Border.all(color: colorScheme.border.withOpacity(0.5)),
          borderRadius: style.borderRadius,
          color: colorScheme.background,
        ),
        content: FButtonContentStyle.inherit(
          typography: typography,
          enabled: colorScheme.secondaryForeground,
          disabled: colorScheme.secondaryForeground.withOpacity(0.5),
        ),
        icon: FButtonIconStyle(
          enabledColor: colorScheme.secondaryForeground,
          disabledColor: colorScheme.secondaryForeground.withOpacity(0.5),
        ),
      );