clone method

  1. @override
StringTextNode clone({
  1. required bool keepParent,
  2. I18nLocale? locale,
})
override

Deep clones the node.

Implementation

@override
StringTextNode clone({required bool keepParent, I18nLocale? locale}) {
  final node = StringTextNode(
    path: path,
    rawPath: rawPath,
    modifiers: modifiers,
    locale: locale ?? this.locale,
    types: types,
    raw: raw,
    comment: comment,
    shouldEscape: shouldEscape,
    handleTypes: handleTypes,
    interpolation: interpolation,
    paramCase: paramCase,
  );

  if (keepParent && parent != null) {
    node.setParent(parent!);
  }

  return node;
}