copyWith method
Returns a copy of this FTypography with the given properties replaced.
const typography = FTypography(
defaultFontFamily: 'packages/forui/my-font',
sm: TextStyle(fontSize: 10),
base: TextStyle(fontSize: 20),
);
final copy = typography.copyWith(defaultFontFamily: 'packages/forui/another-font');
print(copy.defaultFontFamily); // 'packages/forui/another-font'
print(copy.sm.fontSize); // 10
print(copy.base.fontSize); // 20
Implementation
@useResult
FTypography copyWith({
String? defaultFontFamily,
TextStyle? xs,
TextStyle? sm,
TextStyle? base,
TextStyle? lg,
TextStyle? xl,
TextStyle? xl2,
TextStyle? xl3,
TextStyle? xl4,
TextStyle? xl5,
TextStyle? xl6,
TextStyle? xl7,
TextStyle? xl8,
}) =>
FTypography(
defaultFontFamily: defaultFontFamily ?? this.defaultFontFamily,
xs: xs ?? this.xs,
sm: sm ?? this.sm,
base: base ?? this.base,
lg: lg ?? this.lg,
xl: xl ?? this.xl,
xl2: xl2 ?? this.xl2,
xl3: xl3 ?? this.xl3,
xl4: xl4 ?? this.xl4,
xl5: xl5 ?? this.xl5,
xl6: xl6 ?? this.xl6,
xl7: xl7 ?? this.xl7,
xl8: xl8 ?? this.xl8,
);