add method
Inserts an authored record exactly as supplied, through registry validation and the diagram's change hook. Does not infer registry creation defaults.
Implementation
EditResult add(DiagramElement element, {bool select = true}) =>
store.edits.dispatch(
DiagramTransaction(
label: 'Add element',
steps: [
InsertElementsStep([element]),
],
selectionAfter: select
? ElementSelection({element.id})
: store.state.selection,
),
);