addNodeDependency method

void addNodeDependency(
  1. String annotationId,
  2. String nodeId, {
  3. AnnotationBehavior type = AnnotationBehavior.follow,
})

Implementation

void addNodeDependency(
  String annotationId,
  String nodeId, {
  AnnotationBehavior type = AnnotationBehavior.follow,
}) {
  final annotation = _annotations[annotationId];
  if (annotation != null) {
    annotation.addDependency(nodeId);

    // If this is a group, update its bounds immediately
    if (annotation is GroupAnnotation) {
      final dependentNodes = annotation.dependencies
          .map((id) => _parentController.nodes[id])
          .where((node) => node != null)
          .cast<Node<T>>()
          .toList();

      if (dependentNodes.isNotEmpty) {
        _updateGroupAnnotation(annotation, dependentNodes);
      }
    }
  }
}