getLinksForComponent method
- String componentId
Implementation
List<Link> getLinksForComponent(String componentId) {
final links = <Link>[];
final node = document.getNodeById(componentId);
Element? curr = node?.parent;
while (curr != null) {
if (curr is Context) {
links.addAll(curr.getLinks());
}
curr = curr.parent;
}
final bodyLinks = document.body.getLinks();
for (var l in bodyLinks) {
if (!links.contains(l)) {
links.add(l);
}
}
return links;
}