DiagramEditorContext.withSharedModelAndState constructor
DiagramEditorContext.withSharedModelAndState(
Allows you to create DiagramEditorContext with shared model and state from another DiagramEditorContext.
Warning: LinkAttachmentPolicy is used in CanvasModel, so this policy will be shared as well, even if you put new one to PolicySet.
Implementation
DiagramEditorContext.withSharedModelAndState(
DiagramEditorContext oldContext, {
required this.policySet,
}) : _canvasModel = oldContext.canvasModel,
_canvasState = oldContext.canvasState {
policySet.initializePolicy(_getReader(), _getWriter());
}