updateWithLinkParams method

  1. @override
void updateWithLinkParams({
  1. required Map<String, Set<String>> linkParamMap,
  2. required Map<String, String> paramTypeMap,
})
override

Updates content, params and paramTypeMap according to the new linked parameters

Implementation

@override
void updateWithLinkParams({
  required Map<String, Set<String>> linkParamMap,
  required Map<String, String> paramTypeMap,
}) {
  _paramTypeMap.addAll(paramTypeMap);
  _params.addAll(linkParamMap.values.expand((e) => e));

  // build a temporary TextNode to get the updated content
  final temp = RichTextNode(
    path: path,
    rawPath: rawPath,
    modifiers: modifiers,
    raw: raw,
    comment: comment,
    shouldEscape: shouldEscape,
    interpolation: interpolation,
    paramCase: paramCase,
    linkParamMap: linkParamMap,
  );

  _spans = temp.spans;
}