FFormFieldStyle.inherit constructor
FFormFieldStyle.inherit({
- required FColors colors,
- required FTypography typography,
- required bool touch,
Creates a FFormFieldStyle that inherits its properties.
Implementation
factory FFormFieldStyle.inherit({required FColors colors, required FTypography typography, required bool touch}) {
final textStyle = touch ? typography.xs : typography.sm;
return FFormFieldStyle(
labelTextStyle: FVariants.from(
textStyle.copyWith(color: colors.foreground, fontWeight: .w500),
variants: {
[.error]: .delta(color: colors.error),
[.disabled]: .delta(color: colors.disable(colors.foreground)),
[.disabled.and(.error)]: .delta(color: colors.disable(colors.error)),
},
),
descriptionTextStyle: FVariants.from(
textStyle.copyWith(color: colors.mutedForeground),
variants: {
[.disabled]: .delta(color: colors.disable(colors.mutedForeground)),
},
),
errorTextStyle: FVariants.from(
textStyle.copyWith(color: colors.error),
variants: {
[.disabled]: .delta(color: colors.disable(colors.error)),
},
),
);
}