merge method

Returns a new text style that is a combination of this style and the given other style.

Implementation

MarkdownStyleSheet merge(MarkdownStyleSheet? other) {
  if (other == null) {
    return this;
  }
  return copyWith(
    a: a!.merge(other.a),
    p: p!.merge(other.p),
    pPadding: other.pPadding,
    code: code!.merge(other.code),
    h1: h1!.merge(other.h1),
    h1Padding: other.h1Padding,
    h2: h2!.merge(other.h2),
    h2Padding: other.h2Padding,
    h3: h3!.merge(other.h3),
    h3Padding: other.h3Padding,
    h4: h4!.merge(other.h4),
    h4Padding: other.h4Padding,
    h5: h5!.merge(other.h5),
    h5Padding: other.h5Padding,
    h6: h6!.merge(other.h6),
    h6Padding: other.h6Padding,
    em: em!.merge(other.em),
    strong: strong!.merge(other.strong),
    del: del!.merge(other.del),
    blockquote: blockquote!.merge(other.blockquote),
    img: img!.merge(other.img),
    checkbox: checkbox!.merge(other.checkbox),
    blockSpacing: other.blockSpacing,
    listIndent: other.listIndent,
    listBullet: listBullet!.merge(other.listBullet),
    listBulletPadding: other.listBulletPadding,
    tableHead: tableHead!.merge(other.tableHead),
    tableBody: tableBody!.merge(other.tableBody),
    tableHeadAlign: other.tableHeadAlign,
    tableBorder: other.tableBorder,
    tableColumnWidth: other.tableColumnWidth,
    tableCellsPadding: other.tableCellsPadding,
    tableCellsDecoration: other.tableCellsDecoration,
    tableVerticalAlignment: other.tableVerticalAlignment,
    blockquotePadding: other.blockquotePadding,
    blockquoteDecoration: other.blockquoteDecoration,
    codeblockPadding: other.codeblockPadding,
    codeblockDecoration: other.codeblockDecoration,
    horizontalRuleDecoration: other.horizontalRuleDecoration,
    textAlign: other.textAlign,
    h1Align: other.h1Align,
    h2Align: other.h2Align,
    h3Align: other.h3Align,
    h4Align: other.h4Align,
    h5Align: other.h5Align,
    h6Align: other.h6Align,
    unorderedListAlign: other.unorderedListAlign,
    orderedListAlign: other.orderedListAlign,
    blockquoteAlign: other.blockquoteAlign,
    codeblockAlign: other.codeblockAlign,
    textScaleFactor: other.textScaleFactor,
    // Only one of textScaler and textScaleFactor can be passed. If
    // other.textScaleFactor is non-null, then the sheet was created with a
    // textScaleFactor and the textScaler was derived from that, so should be
    // ignored so that the textScaleFactor continues to be set.
    textScaler: other.textScaleFactor == null ? other.textScaler : null,
  );
}