withStyle method
- @Deprecated('This style is not anymore maintained and will be deleted in next major update (4.0).')
Text
withStyle(
{ - double fontSize = 16,
- FontWeight? fontWeight,
- Color color = textPrimaryColor,
- FontStyle? fontStyle,
- Paint? foreground,
- double? wordSpacing,
- Color? backgroundColor,
- Color? decorationColor,
- TextDecoration? textDecoration,
- TextDecorationStyle? decorationStyle,
- double? decorationThickness,
- List<Shadow>? shadows,
- double? letterSpacing,
- Locale? locale,
- TextBaseline? textBaseline,
- Paint? background,
- String? fontFamily,
- List<String>? fontFamilyFallback,
- List<FontFeature>? fontFeatures,
- String? debugLabel,
- double? height,
- bool? inherit,
})
Implementation
@Deprecated(
'This style is not anymore maintained and will be deleted in next major update (4.0).',
)
Text withStyle({
double fontSize = 16,
FontWeight? fontWeight,
Color color = textPrimaryColor,
FontStyle? fontStyle,
Paint? foreground,
double? wordSpacing,
Color? backgroundColor,
Color? decorationColor,
TextDecoration? textDecoration,
TextDecorationStyle? decorationStyle,
double? decorationThickness,
List<Shadow>? shadows,
double? letterSpacing,
Locale? locale,
TextBaseline? textBaseline,
Paint? background,
String? fontFamily,
List<String>? fontFamilyFallback,
List<FontFeature>? fontFeatures,
String? debugLabel,
double? height,
bool? inherit,
}) {
final style = TextStyle().copyWith(
color: color,
fontWeight: fontWeight,
fontSize: fontSize,
fontStyle: fontStyle,
foreground: foreground,
wordSpacing: wordSpacing,
backgroundColor: backgroundColor,
decorationColor: decorationColor,
decoration: textDecoration,
decorationStyle: decorationStyle,
decorationThickness: decorationThickness,
shadows: shadows,
letterSpacing: letterSpacing,
locale: locale,
textBaseline: textBaseline,
background: background,
fontFamily: fontFamily,
fontFamilyFallback: fontFamilyFallback,
fontFeatures: fontFeatures,
debugLabel: debugLabel,
height: height,
inherit: inherit,
);
return Text(
data!,
style: style,
textAlign: textAlign,
strutStyle: strutStyle,
softWrap: softWrap,
semanticsLabel: semanticsLabel,
locale: this.locale,
overflow: overflow,
textWidthBasis: textWidthBasis,
textDirection: textDirection,
textScaleFactor: textScaleFactor,
maxLines: maxLines,
);
}