onSetNodeValue method

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

Implementation

void onSetNodeValue(int? id, Map<String, dynamic> params) {
  if (DebugFlags.enableDevToolsLogs) {
    devToolsLogger.finer('[DevTools] DOM.setNodeValue nodeId=${params['nodeId']}');
  }
  int? nodeId = params['nodeId'];
  String? value = params['value'];
  final ctx = dbgContext;
  if (nodeId == null || ctx == null) return;
  final targetId = ctx.getTargetIdByNodeId(nodeId);
  Node? node;
  if (targetId != null) {
    node = ctx.getBindingObject(Pointer.fromAddress(targetId)) as Node?;
  }
  if (node is TextNode && value != null) {
    node.data = value;
  }
  sendToFrontend(id, null);
}