Currently the DeltaM model in delta.model.dart is not immutable. The class is tightly coupled with the _modificationCount parameter which is mutable. Ideally, the class should be a pure immutable model and the only method to modify the value has to be using shallow or deep cloning.
class DeltaM {
late final List<OperationM> operations;
int _modificationCount = 0;
/.../
}
Currently the
DeltaM
model in delta.model.dart is not immutable. The class is tightly coupled with the_modificationCount
parameter which is mutable. Ideally, the class should be a pure immutable model and the only method to modify the value has to be using shallow or deep cloning.