of static method

AnchorKey? of(
  1. Key? parentKey,
  2. StyledElement? id
)

Implementation

static AnchorKey? of(Key? parentKey, StyledElement? id) {
  final key = forId(parentKey, id?.elementId);
  if (key == null || _registry.contains(key)) {
    // Invalid id or already created a key with this id: silently ignore
    return null;
  }
  _registry.add(key);
  return key;
}