FItemContentStyle.inherit constructor

FItemContentStyle.inherit({
  1. required FColors colors,
  2. required FTypography typography,
  3. required Color prefix,
  4. required Color foreground,
  5. required Color mutedForeground,
  6. required EdgeInsetsGeometry suffixedPadding,
  7. required EdgeInsetsGeometry unsuffixedPadding,
})

Creates a FItemContentStyle that inherits its properties.

Implementation

factory FItemContentStyle.inherit({
  required FColors colors,
  required FTypography typography,
  required Color prefix,
  required Color foreground,
  required Color mutedForeground,
  required EdgeInsetsGeometry suffixedPadding,
  required EdgeInsetsGeometry unsuffixedPadding,
}) {
  final disabledMutedForeground = colors.disable(mutedForeground);
  return FItemContentStyle(
    prefixIconStyle: .from(
      IconThemeData(color: prefix, size: typography.md.fontSize),
      variants: {
        [.disabled]: .delta(color: colors.disable(prefix)),
      },
    ),
    titleTextStyle: .from(
      typography.sm.copyWith(color: foreground),
      variants: {
        [.disabled]: .delta(color: colors.disable(foreground)),
      },
    ),
    subtitleTextStyle: .from(
      typography.xs.copyWith(color: mutedForeground),
      variants: {
        [.disabled]: .delta(color: disabledMutedForeground),
      },
    ),
    detailsTextStyle: .from(
      typography.xs.copyWith(color: mutedForeground),
      variants: {
        [.disabled]: .delta(color: disabledMutedForeground),
      },
    ),
    suffixIconStyle: .from(
      IconThemeData(color: mutedForeground, size: typography.md.fontSize),
      variants: {
        [.disabled]: .delta(color: disabledMutedForeground),
      },
    ),
    suffixedPadding: suffixedPadding,
    unsuffixedPadding: unsuffixedPadding,
  );
}