copyWith method

Creates a copy of this WrappedText with modified properties.

Each parameter is a builder function that, if provided, will replace the corresponding property in the new instance. If a parameter is null, the existing property value is retained.

Parameters:

  • style (ValueGetter<WrappedTextDataBuilder<TextStyle>?>?, optional): New style builder.
  • textAlign (ValueGetter<WrappedTextDataBuilder<TextAlign>?>?, optional): New text alignment builder.
  • softWrap (ValueGetter<WrappedTextDataBuilder<bool>?>?, optional): New soft wrap builder.
  • overflow (ValueGetter<WrappedTextDataBuilder<TextOverflow>?>?, optional): New overflow handling builder.
  • maxLines (ValueGetter<WrappedTextDataBuilder<int>?>?, optional): New max lines builder.
  • textWidthBasis (ValueGetter<WrappedTextDataBuilder<TextWidthBasis>?>?, optional): New text width basis builder.
  • wrapper (ValueGetter<WidgetTextWrapper?>?, optional): New container wrapper function.
  • child (ValueGetter<Widget>?, optional): New child widget.

Implementation

WrappedText copyWith({
  ValueGetter<WrappedTextDataBuilder<TextStyle>?>? style,
  ValueGetter<WrappedTextDataBuilder<TextAlign>?>? textAlign,
  ValueGetter<WrappedTextDataBuilder<bool>?>? softWrap,
  ValueGetter<WrappedTextDataBuilder<TextOverflow>?>? overflow,
  ValueGetter<WrappedTextDataBuilder<int>?>? maxLines,
  ValueGetter<WrappedTextDataBuilder<TextWidthBasis>?>? textWidthBasis,
  ValueGetter<WidgetTextWrapper?>? wrapper,
  ValueGetter<Widget>? child,
}) {
  return WrappedText(
    wrapper: wrapper == null ? this.wrapper : wrapper(),
    style: style == null ? this.style : style(),
    textAlign: textAlign == null ? this.textAlign : textAlign(),
    softWrap: softWrap == null ? this.softWrap : softWrap(),
    overflow: overflow == null ? this.overflow : overflow(),
    maxLines: maxLines == null ? this.maxLines : maxLines(),
    textWidthBasis:
        textWidthBasis == null ? this.textWidthBasis : textWidthBasis(),
    child: child == null ? this.child : child(),
  );
}