copyWithStyle method

WrappedText copyWithStyle(
  1. WrappedTextDataBuilder<TextStyle> style
)

Creates a copy of this WrappedText with an updated style.

The provided style builder is merged with the existing style.

Parameters:

  • style (WrappedTextDataBuilder<TextStyle>, required): New style builder to merge.

Implementation

WrappedText copyWithStyle(WrappedTextDataBuilder<TextStyle> style) {
  return WrappedText(
    wrapper: wrapper,
    style: (context, theme) =>
        style(context, theme).merge(this.style?.call(context, theme)),
    textAlign: textAlign,
    softWrap: softWrap,
    overflow: overflow,
    maxLines: maxLines,
    textWidthBasis: textWidthBasis,
    child: child,
  );
}