clone method

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

Deep clones the node.

Implementation

@override
PluralNode clone({required bool keepParent, I18nLocale? locale}) {
  final node = PluralNode(
    path: path,
    rawPath: rawPath,
    modifiers: modifiers,
    comment: comment,
    pluralType: pluralType,
    quantities: quantities.map(
      (key, value) => MapEntry(
        key,
        value.clone(keepParent: keepParent, locale: locale),
      ),
    ),
    paramName: paramName,
    paramType: paramType,
    rich: rich,
  );

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

  return node;
}