isSame method

bool isSame(
  1. GptMarkdownConfig other
)

A method to check if the configuration is the same.

Implementation

bool isSame(GptMarkdownConfig other) {
  return style == other.style &&
      textAlign == other.textAlign &&
      textScaler == other.textScaler &&
      maxLines == other.maxLines &&
      overflow == other.overflow &&
      followLinkColor == other.followLinkColor &&
      scope == other.scope &&
      autolink == other.autolink &&
      blocksRenderDirectly == other.blocksRenderDirectly &&
      // Value types, so comparing them is cheap and a runtime change to any
      // of them regenerates the spans. Getting this wrong is silent: the
      // widget rebuilds with the new config and keeps rendering the old
      // output.
      setEquals(autolinkSchemes, other.autolinkSchemes) &&
      inlineCodeStyle == other.inlineCodeStyle &&
      styleSheet == other.styleSheet &&
      // `InlinePattern` holds a builder closure and has no value equality,
      // so this falls back to element identity. A consumer that rebuilds the
      // list inline pays a regeneration per rebuild — the safe direction.
      listEquals(inlinePatterns, other.inlinePatterns) &&
      listEquals(blockComponents, other.blockComponents) &&
      // Same reasoning: `MarkdownComponent` has no value equality, so these
      // compare by element identity. Swapping a component list at runtime
      // used to be ignored outright.
      listEquals(components, other.components) &&
      listEquals(inlineComponents, other.inlineComponents) &&
      // The rest are closures. They are recreated on every build by any
      // consumer that writes them inline, so comparing them would defeat the
      // cache entirely — a change to one of these needs a key or a remount.
      // latexWorkaround == other.latexWorkaround &&
      // latexBuilder == other.latexBuilder &&
      // sourceTagBuilder == other.sourceTagBuilder &&
      // inlineSourceTagBuilder == other.inlineSourceTagBuilder &&
      // codeBuilder == other.codeBuilder &&
      // orderedListBuilder == other.orderedListBuilder &&
      // unOrderedListBuilder == other.unOrderedListBuilder &&
      // linkBuilder == other.linkBuilder &&
      // inlineLinkBuilder == other.inlineLinkBuilder &&
      // imageBuilder == other.imageBuilder &&
      // inlineCodeBuilder == other.inlineCodeBuilder &&
      // onLinkTap == other.onLinkTap &&
      textDirection == other.textDirection;
}