DeepMergeStrategy class
A MergeStrategy that flattens nested maps recursively, joining keys with
pathSeparator (default '.').
Every scalar leaf — at any depth — becomes its own CRDT record, so concurrent edits to distinct leaves anywhere in the document all survive. Lists are treated as atomic leaves (no element-level merging).
Field names must not contain pathSeparator, because it encodes the
nesting path: a literal "a.b" key would be indistinguishable from a b
nested under a, and the document read back would not be the one
written. The constraint is enforced — fields throws ArgumentError on
the first write of an offending document, so nothing silently corrupts.
Documents with dotted keys (i18n keys, config paths, hostnames) belong on
ShallowMergeStrategy, or on a DeepMergeStrategy with a separator that
cannot occur in your keys.
- Implemented types
Constructors
- DeepMergeStrategy({String pathSeparator = '.'})
-
Creates a recursive merge strategy.
const
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- pathSeparator → String
-
The separator used to join nested keys into a flat path.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
fields(
Map< String, dynamic> document) → Iterable<FieldSpec> -
Decomposes
documentinto the CRDT records it should be stored as.override -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
typeAt(
String path) → CrdtType -
The CrdtType this strategy assigns to the field at
path.override -
unflatten(
Iterable< FieldValue> rows) → Map<String, dynamic> -
Rebuilds the document map from its live field
rows(path → value), the inverse of fields.override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited