dispatchObjectCreated method

void dispatchObjectCreated({
  1. required String library,
  2. required String className,
  3. required Object object,
})

Create ObjectCreated and invoke dispatchObjectEvent if there are listeners.

This method is more efficient than dispatchObjectEvent if the event object is not created yet.

Implementation

void dispatchObjectCreated({
  required String library,
  required String className,
  required Object object,
}) {
  if (!hasListeners) {
    return;
  }
  dispatchObjectEvent(ObjectCreated(
    library: library,
    className: className,
    object: object,
  ));
}