register method

void register(
  1. HintTargetRegistration registration
)

Implementation

void register(HintTargetRegistration registration) {
  final existing = _byId[registration.id];
  if (existing != null && !identical(existing, registration)) {
    onWarning?.call(
      "hintful: duplicate target id '${registration.id}'"
      ' — newest registration wins',
    );
  }
  _byId[registration.id] = registration;
  _notifyChanged();
}