copyWith method

TextStyle copyWith({
  1. LogicalPixel? fontSize,
  2. Color? color,
  3. LogicalPixel? strokeWidth,
  4. Color? strokeColor,
  5. TextHorizontalAlignment? textHorizontalAlignment,
  6. TextPlacement? textPlacement,
  7. LogicalPixel? textOffset,
  8. Optional<String?>? fontName,
})

Implementation

TextStyle copyWith({
  LogicalPixel? fontSize,
  Color? color,
  LogicalPixel? strokeWidth,
  Color? strokeColor,
  TextHorizontalAlignment? textHorizontalAlignment,
  TextPlacement? textPlacement,
  LogicalPixel? textOffset,
  Optional<String?>? fontName
}) {
  return TextStyle(
    fontSize: fontSize ?? this.fontSize,
    color: color ?? this.color,
    strokeWidth: strokeWidth ?? this.strokeWidth,
    strokeColor: strokeColor ?? this.strokeColor,
    textHorizontalAlignment: textHorizontalAlignment ?? this.textHorizontalAlignment,
    textPlacement: textPlacement ?? this.textPlacement,
    textOffset: textOffset ?? this.textOffset,
    fontName: fontName != null ? fontName.value : this.fontName
  );
}