creationRule property

DiagramCreationRule? get creationRule

Read-only rule evaluation; retained callbacks respect disposal.

Implementation

DiagramCreationRule? get creationRule {
  _controller._requireAlive();
  return _controller.diagram._rules.canCreate == null
      ? null
      : (element) {
          _controller._requireAlive();
          final rule = _controller.diagram._rules.canCreate;
          return rule == null
              ? const EditResult.allow()
              : _controller._evaluate(() => rule(element));
        };
}