disconnect method

  1. @override
Future<bool> disconnect()
override

Implementation

@override
Future<bool> disconnect() async {
  if (!isEnabled.value || !isReady.value) return false;
  _disconnect = Completer<bool>();
  if (!isConnected.value) {
    _resetTimeOut();
    _disconnect.complete(true);
    return (await _disconnect.future);
  }
  final message = SignOut().toString();
  await _webViewController.runJavaScript('sendW3Message($message)');
  return (await _disconnect.future);
}