register static method
Implementation
static void register(BuildContext context, AttachDocument item) {
final binding = context.binding;
if (binding is! ServerAppBinding) {
// Return early in component tests.
return;
}
final adapter = _attach[binding] ??= AttachAdapter();
binding.addRenderAdapter(adapter);
final entry = adapter.targetElements[item.target] ??= (attributes: {}, children: []);
if (item.attributes case final itemAttributes?) {
entry.attributes.addAll(itemAttributes);
}
if (item.children != null) {
binding.addRenderAdapter(_AttachChildrenAdapter(adapter, item.target, context as Element));
}
}