BaseCloner class base

Performs element/value-wise cloning for built-in collections and delegates to ICloneable implementations for custom types.

Supports the following dart:collection types with type preservation:

  • List: including UnmodifiableListView
  • Set: LinkedHashSet, HashSet, UnmodifiableSetView
  • Map: LinkedHashMap, HashMap, UnmodifiableMapView
Implemented types
Implementers

Constructors

BaseCloner(bool doTypedClone)
Creates a BaseCloner with the specified cloning mode.
const

Properties

doTypedClone bool
Enables typed cloning for collections when true.
final
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

builder() IClonerBuilding
Returns a builder for constructing a BaseCloner instance.
override
cloneList<E>(List<E> source) List<E>
Return a deep-cloned List.
override
cloneMap<K, V>(Map<K, V> source) Map<K, dynamic>
Return an untyped Map<K, dynamic> with values deep-cloned.
override
cloneMapTyped<K, V>(Map<K, V> source) Map<K, V>
Return a typed Map<K, V> with values deep-cloned.
override
cloneSet<E>(Set<E> source) Set<E>
Return a deep-cloned Set.
override
cloneValue(dynamic source) → dynamic
Deep-clone source when possible.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited