notifyDocumentChanged method
Notifies document listeners that the content changed. Use this after undo/redo where updateContent must NOT be called (it would create a new undo record).
If affectedIds is provided, only widgets for those node IDs will
rebuild. If null, all widgets rebuild (backward-compatible).
Implementation
void notifyDocumentChanged({Set<String>? affectedIds}) {
_contentVersion++;
_dirtyNodeIds = affectedIds ?? {};
_cachedCursorContainerId = cursor.focusId.isNotEmpty
? findLogicalContainerId(cursor.focusId)
: null;
cachedSelectionKey = null;
cachedSelection = null;
cursor.notifyListeners();
notifyListeners();
WidgetsBinding.instance.addPostFrameCallback((_) {
_dirtyNodeIds.clear();
});
}