onConnect method

dynamic onConnect(
  1. void listener(
    1. ConnectInfo connectInfo
    )
)

Add a listener to be triggered for each connect event.

This event is emitted when it first becomes able to submit RPC requests to a chain.

We recommend using a connect event handler and the Ethereum.isConnected method in order to determine when/if the provider is connected.

Implementation

onConnect(void Function(ConnectInfo connectInfo) listener) =>
    on('connect', listener);