action<S> static method

DiagramProperty<S, Null> action<S>(
  1. String key, {
  2. required String label,
  3. String? verb,
  4. Map<String, Object?> args(
    1. S subject
    )?,
  5. S update(
    1. S subject
    )?,
  6. DiagramPropertyGroup group = DiagramPropertyGroup.general,
  7. DiagramIcon? icon,
  8. bool visible(
    1. S subject
    )?,
  9. bool enabled(
    1. S subject
    )?,
  10. String editLabel(
    1. Null value
    )?,
})

A command, such as "Clear formatting", shown as a button, or as an icon button with an icon.

Implementation

static DiagramProperty<S, Null> action<S>(
  String key, {
  required String label,
  String? verb,
  Map<String, Object?> Function(S subject)? args,
  S Function(S subject)? update,
  DiagramPropertyGroup group = DiagramPropertyGroup.general,
  DiagramIcon? icon,
  bool Function(S subject)? visible,
  bool Function(S subject)? enabled,
  String Function(Null value)? editLabel,
}) => DiagramProperty._(
  key,
  label: label,
  presentation: const DiagramActionPresentation._(),
  read: (_) => null,
  verb: verb,
  args: args == null ? null : (subject, _) => args(subject),
  update: update == null ? null : (subject, _) => update(subject),
  group: group,
  icon: icon,
  visible: visible,
  enabled: enabled,
  editLabel: editLabel,
);