WalletConnect / Web3ModalFlutter

The Web3Modal for WalletConnect built using Flutter.
https://pub.dev/packages/web3modal_flutter
Apache License 2.0
27 stars 30 forks source link

lib/home_page.dart:67:17: Error: The getter 'onSessionEventEvent' isn't defined for the class 'W3MService'. #77

Closed maxttor closed 2 months ago

maxttor commented 4 months ago

I'm trying to run this example, but I'm getting an error:

lib/home_page.dart:67:17: Error: The getter 'onSessionEventEvent' isn't defined for the class 'W3MService'.

OmkarSsawant commented 4 months ago

Hello @maxttor , You can initialize dapp the following way and use it .

const meta = const PairingMetadata(
        name: 'Dapp',
        description: 'Web3Modal Dapp',
        url: 'https://www.walletconnect.com/',
        icons: ['https://walletconnect.com/walletconnect-logo.png'],
        redirect: Redirect(
          native: 'dapp://',
          universal: 'https://www.walletconnect.com',
        ),
      );
final dapp = await Web3App.createInstance(
      projectId: projectId,
      metadata: meta
    );

    _web3Service = W3MService(
      projectId: projectId,
      web3App: dapp,
      metadata: meta
    );

You can try the following :


 dapp.onSessionEvent.subscribe((args) {
      ...
    });

Let me know if your issue is solved.

quetool commented 4 months ago

Hello @maxttor! What are you running exactly? I mean, this repo but any particular branch or commit hash? In any case, try replacing that line lib/home_page.dart:67:17 with the following:

_w3mService.web3App?.onSessionEvent.subscribe(_onSessionEvent);