copyWith method

  1. @override
TextStyle copyWith({
  1. bool? inherit,
  2. Color? color,
  3. Color? backgroundColor,
  4. String? fontFamily,
  5. List<String>? fontFamilyFallback,
  6. double? fontSize,
  7. FontWeight? fontWeight,
  8. FontStyle? fontStyle,
  9. double? letterSpacing,
  10. double? wordSpacing,
  11. TextBaseline? textBaseline,
  12. double? height,
  13. TextLeadingDistribution? leadingDistribution,
  14. Locale? locale,
  15. Paint? foreground,
  16. Paint? background,
  17. List<Shadow>? shadows,
  18. List<FontFeature>? fontFeatures,
  19. List<FontVariation>? fontVariations,
  20. TextDecoration? decoration,
  21. Color? decorationColor,
  22. TextDecorationStyle? decorationStyle,
  23. double? decorationThickness,
  24. String? debugLabel,
  25. TextOverflow? overflow,
  26. String? package,
})
override

Creates a copy of this text style but with the given fields replaced with the new values.

One of color or foreground must be null, and if this has foreground specified it will be given preference over any color parameter.

One of backgroundColor or background must be null, and if this has background specified it will be given preference over any backgroundColor parameter.

Implementation

@override
TextStyle copyWith({
  bool? inherit,
  Color? color,
  Color? backgroundColor,
  String? fontFamily,
  List<String>? fontFamilyFallback,
  double? fontSize,
  FontWeight? fontWeight,
  FontStyle? fontStyle,
  double? letterSpacing,
  double? wordSpacing,
  TextBaseline? textBaseline,
  double? height,
  ui.TextLeadingDistribution? leadingDistribution,
  Locale? locale,
  Paint? foreground,
  Paint? background,
  List<ui.Shadow>? shadows,
  List<ui.FontFeature>? fontFeatures,
  List<ui.FontVariation>? fontVariations,
  TextDecoration? decoration,
  Color? decorationColor,
  TextDecorationStyle? decorationStyle,
  double? decorationThickness,
  String? debugLabel,
  TextOverflow? overflow,
  String? package,
}) {
  return textStyle.copyWith(
    inherit: inherit,
    color: color,
    backgroundColor: backgroundColor,
    fontFamily: fontFamily,
    fontFamilyFallback: fontFamilyFallback,
    fontSize: fontSize,
    fontWeight: fontWeight,
    fontStyle: fontStyle,
    letterSpacing: letterSpacing,
    wordSpacing: wordSpacing,
    textBaseline: textBaseline,
    height: height,
    leadingDistribution: leadingDistribution,
    locale: locale,
    foreground: foreground,
    background: background,
    shadows: shadows,
    fontFeatures: fontFeatures,
    fontVariations: fontVariations,
    decoration: decoration,
    decorationColor: decorationColor,
    decorationStyle: decorationStyle,
    decorationThickness: decorationThickness,
    debugLabel: debugLabel,
    overflow: overflow,
    package: package,
  );
}