getNetworkId method
Returns the id of the network the client is currently connected to.
In a non-private network, the network ids usually correspond to the following networks: 1: Ethereum Mainnet 2: Morden Testnet (deprecated) 3: Ropsten Testnet 4: Rinkeby Testnet 42: Kovan Testnet
Implementation
Future<int> getNetworkId() {
return makeRPCCall<String>('net_version').then(int.parse);
}