onConnect method
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);