# registerListener method Null safety

void registerListener(

1. ListenerValue func

)

Set an event listener, through which users can get various status notifications from `TRTCCloud`

For more information, please see the definitions in `TRTCCloudListenerEnum` in the `trtc_cloud_listener` file

## Implementation

    void registerListener(ListenerValue func) {
      if (listener == null) {
        listener = TRTCCloudListenerObj(_channel);
      }
      listener!.addListener(func);
    }