core library

Core cloning API and contracts for the Cloner library.

This library provides the primary entry point for cloning operations:

Difference from base.dart:

  • core.dart exports the high-level Cloner API for most use cases
  • base.dart exports BaseCloner and ICloning for custom implementations

For most applications, import this library:

import 'package:cloner/core.dart';

final cloned = Cloner.cloneValue(original, doTypedClone: true);

To customize cloning behavior, see base.dart for implementing ICloning.

Classes

Cloner
Provides access to the global cloning implementation.
ICloneable<T extends Object>
Contracts used by Cloner and collection helpers.
ICopyable<T extends Object>
Use for a shallow, element-wise copy.

Exceptions / Errors

CircularReferenceCloneException
Thrown when a circular reference is detected during cloning.
LimitExceededException
Thrown when some limit is exceeded.
UnsupportedTypedCloneException
Thrown when typed cloning encounters an unsupported nested structure.