copyWith method

  1. @override
DocumentStyle copyWith(
  1. covariant DocumentStyle other
)
override

Creates a new FlameTextStyle, preferring the properties of other if present, falling back to the properties of this.

Implementation

@override
DocumentStyle copyWith(DocumentStyle other) {
  return DocumentStyle(
    width: other.width ?? width,
    height: other.height ?? height,
    padding: other.padding,
    text: FlameTextStyle.merge(_text, other.text),
    boldText: FlameTextStyle.merge(_boldText, other.boldText),
    italicText: FlameTextStyle.merge(_italicText, other.italicText),
    background: merge(background, other.background) as BackgroundStyle?,
    paragraph: merge(paragraph, other.paragraph) as BlockStyle?,
    header1: merge(header1, other.header1) as BlockStyle?,
    header2: merge(header2, other.header2) as BlockStyle?,
    header3: merge(header3, other.header3) as BlockStyle?,
    header4: merge(header4, other.header4) as BlockStyle?,
    header5: merge(header5, other.header5) as BlockStyle?,
    header6: merge(header6, other.header6) as BlockStyle?,
  );
}