FTileContentStyle.inherit constructor

FTileContentStyle.inherit({
  1. required FColors colors,
  2. required FTypography typography,
  3. required Color prefix,
  4. required Color foreground,
  5. required Color mutedForeground,
})

Creates a FTileContentStyle that inherits its properties.

Implementation

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