handleGetMatchedStylesForNode method

void handleGetMatchedStylesForNode(
  1. int? id,
  2. Map<String, dynamic> params
)

Implementation

void handleGetMatchedStylesForNode(int? id, Map<String, dynamic> params) {
  final ctx = dbgContext;
  if (ctx == null) {
    sendToFrontend(id, null);
    return;
  }
  int? targetId = ctx.getTargetIdByNodeId(params['nodeId']);
  if (targetId == null) {
    sendToFrontend(id, null);
    return;
  }
  BindingObject? element = ctx.getBindingObject(Pointer.fromAddress(targetId));
  if (element is Element) {
    MatchedStyles matchedStyles = MatchedStyles(
      inlineStyle: buildMatchedStyle(element),
    );
    sendToFrontend(id, matchedStyles);
  }
}