discontinuedPackage fluttersdk_dusk has been discontinued and replaced by tapir.

rebind static method

void rebind(
  1. String ref,
  2. RefEntry entry
)

Replaces the entry behind an existing ref with entry, keeping the token and the group that owns it, so a relocated ref is disposed with the snapshot that minted it. The relocated node's id is mapped to ref when no token claims it yet, so the next snapshot reprints the same token for the same control.

No-op for an unknown ref: relocation never mints a token.

Implementation

static void rebind(String ref, RefEntry entry) {
  final RefEntry? current = _entries[ref];
  if (current == null) return;

  _entries[ref] = RefEntry(
    rect: entry.rect,
    element: entry.element,
    groupId: current.groupId,
    isTextField: entry.isTextField,
    node: entry.node,
    renderObject: entry.renderObject,
  );

  final SemanticsNode? node = entry.node;
  if (node == null) return;
  _byNodeId.putIfAbsent(node.id, () => ref);
}