on<T> method

void on<T>(
  1. String eventName,
  2. OnEvent<T> callback
)

Registers event subscriptions. https://docs.walletconnect.com/client-api#register-event-subscription Supported events: connect, disconnect, session_request, session_update

Implementation

void on<T>(String eventName, OnEvent<T> callback) {
  _eventBus
      .on<Event<T>>()
      .where((event) => event.name == eventName)
      .listen((event) => callback(event.data));
}