visual-space / visual-editor

Rich text editor for Flutter based on Delta format (Quill fork)
MIT License
290 stars 47 forks source link

Sys - Refactor DeltaM Into An Immutable Model #210

Closed CristiSch closed 1 year ago

CristiSch commented 1 year ago

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;
/.../
}