beforeStart method
Future<void>
beforeStart(
- Keyring keyring, {
- KeyringEVM? keyringEVM,
- WebViewRunner? webView,
- String? jsCode,
- Function? socketDisconnectedAction,
- bool isEVM = false,
This method will be called while App switched to a plugin.
In this method, the plugin will init WalletSDK and start
a webView for running polkadot-js/api
.
Implementation
Future<void> beforeStart(
Keyring keyring, {
KeyringEVM? keyringEVM,
WebViewRunner? webView,
String? jsCode,
Function? socketDisconnectedAction,
bool isEVM = false,
}) async {
await sdk.init(keyring,
keyringEVM: keyringEVM,
webView: webView,
jsCode: jsCode ?? (await loadJSCode()),
socketDisconnectedAction: socketDisconnectedAction,
isEVM: isEVM);
await (isEVM ? onWillStartEVM(keyringEVM!) : onWillStart(keyring));
}