switchNetwork method

  1. @override
Future<bool> switchNetwork({
  1. required String chainId,
})
override

Implementation

@override
Future<bool> switchNetwork({required String chainId}) async {
  if (_serviceNotReady) {
    throw Exception('Service is not ready');
  }
  //
  await _awaitReadyness.future;
  _switchNetworkCompleter = Completer<bool>();
  await _switchNetwork(chainId);
  return await _switchNetworkCompleter.future;
}