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