diagramCardVerbs top-level property
A card's own verbs: thin bindings of its text parts' verbs. They apply to any shape declaring them with the same parts.
Implementation
final List<DiagramVerb> diagramCardVerbs = List.unmodifiable([
DiagramVerb(
id: 'setTitle',
label: 'Title',
symmetry: DiagramVerbSymmetry.setter,
parameters: [DiagramVerbParameter.text('title')],
perform: (call) => call.controller.edits.perform(
[call.id],
'title.setText',
{'text': call.arg<String>('title')},
),
),
DiagramVerb(
id: 'setDescription',
label: 'Description',
symmetry: DiagramVerbSymmetry.setter,
parameters: [DiagramVerbParameter.text('description')],
perform: (call) => call.controller.edits.perform(
[call.id],
'body.setText',
{'text': call.arg<String>('description')},
),
),
DiagramVerb(
id: 'setTag',
label: 'Tag',
description: 'Shows the tag with this text, or hides it without one.',
symmetry: DiagramVerbSymmetry.setter,
parameters: [DiagramVerbParameter.text('tag', isRequired: false)],
perform: (call) => switch (call.optional<String>('tag')) {
null => call.controller.edits.perform(
[call.id],
'removeSlot',
{'slot': 'tag'},
),
final tag => call.controller.edits.perform(
[call.id],
'addSlot',
{'slot': 'tag', 'text': tag},
),
},
),
]);