onConnect method
dynamic
onConnect(
- void listener()
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() listener) => on('connect', listener);