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

Having issue in connecting to the metamask wallet from the flutter application. #112

Closed sethitanay closed 4 weeks ago

sethitanay commented 1 month ago

I am trying to connect my flutter mobile application with the metamask mobile application using web3modal_flutter and walletconnect. Basically, I am trying to interact with the smart contract and also want to pass the arguments for the functions that are required. Connecting on Sepolia test network. using: web3modal_flutter: ^3.1.1-beta02 walletconnect_flutter_v2: ^2.1.11 this is my code for the file:

import 'package:flutter/material.dart';
import 'package:web3modal_flutter/web3modal_flutter.dart';
import 'package:flutter/services.dart';
import 'package:voter_booth/utils/constants.dart';
import 'package:web3dart/web3dart.dart';

class AddCandidateScreen extends StatefulWidget {
  const AddCandidateScreen({super.key});

  @override
  State<AddCandidateScreen> createState() => _AddCandidateScreenState();
}

class _AddCandidateScreenState extends State<AddCandidateScreen> {
  late TextEditingController nameController;
  late TextEditingController partyController;
  late TextEditingController educationController;
  late W3MService _w3mService;

  @override
  void initState() async {
    super.initState();
    _w3mService = W3MService(
      projectId: '001b66692e8d25adb3d5f7d189550651',
      metadata: const PairingMetadata(
        name: 'W3m Flutter',
        description: 'Web3Modal Flutter Example',
        url: 'https://www.walletconnect.com/',
        icons: ['https://walletconnect.com/walletconnect-logo.png'],
        redirect: Redirect(
          native: 'flutterdapp://',
          universal: 'https://www.walletconnect.com',
        ),
      ),
      includedWalletIds: {
        'c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96', // Coinbase Wallet
      },
      excludedWalletIds: {
        '4622a2b2d6af1c9844944291e5e7351a6aa24cd7b23099efac1b2fd875da31a0', // Trust
        'fd20dc426fb37566d803205b19bbc1d4096b248ac04548e3cfb6b3a38bd033aa', // Coinbase Wallet
      },
    );
    await _w3mService.init();
    nameController = TextEditingController();
    partyController = TextEditingController();
    educationController = TextEditingController();
  }

  Future<void> callWriteFunction0() async {
    String abi = await rootBundle.loadString('assets/abi.json');
    String contractAddress = contractAddress1;

    // Create DeployedContract object using contract's ABI and address
    try {
      final deployedContract = DeployedContract(
        ContractAbi.fromJson(abi, 'Voting'),
        EthereumAddress.fromHex(contractAddress),
      );

      await _w3mService.launchConnectedWallet();
      await _w3mService.requestWriteContract(
          topic: _w3mService.session!.topic.toString(),
          // make sure to add eip155: as a prefix before adding your chain id
          // eg: eip155:80001
          chainId: 'eip155:11155111',
          // make sure to chaine the rpcUrl before proceeding
          rpcUrl:
              'https://eth-sepolia.g.alchemy.com/v2/Is7xCCuFmVXsJ1RvScVGEiCMggxETN7U',
          deployedContract: deployedContract,
          functionName: 'addCandidate',
          parameters: [
            nameController.text,
            partyController.text,
            educationController.text
          ],
          transaction: Transaction(
            from: EthereumAddress.fromHex(
                '0x17AEd66b741580B4079a086241680807669a42E2'),
          ));
    } catch (e) {
      print(e);
    }
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text('Add Candidate'),
      ),
      body: Padding(
        padding: const EdgeInsets.all(16.0),
        child: Card(
          child: Padding(
            padding: const EdgeInsets.all(16.0),
            child: Column(
              crossAxisAlignment: CrossAxisAlignment.stretch,
              children: [
                TextFormField(
                  controller: nameController,
                  decoration:
                      const InputDecoration(labelText: 'Candidate Name'),
                ),
                const SizedBox(height: 16),
                TextFormField(
                  controller: partyController,
                  decoration: const InputDecoration(labelText: 'Party'),
                ),
                const SizedBox(height: 16),
                TextFormField(
                  controller: educationController,
                  decoration: const InputDecoration(
                      labelText: 'Education Qualification'),
                ),
                const SizedBox(height: 16),
                ElevatedButton(
                  onPressed: () {
                    callWriteFunction0();
                  },
                  child: const Text('Add Candidate'),
                ),
              ],
            ),
          ),
        ),
      ),
    );
  }
}

After entering all the data when I press the add candidate button then the terminal status is as follows:

D/EGL_emulation( 5937): app_time_stats: avg=388.37ms min=7.60ms max=2716.08ms count=9
I/flutter ( 5937): RelayClient Internal: Connecting to relay
I/flutter ( 5937): RelayClient Internal: Disconnecting from relay
D/EGL_emulation( 5937): app_time_stats: avg=1456.49ms min=91.30ms max=3509.12ms count=3
I/flutter ( 5937): Signed JWT: eyJhbGciOiJFZERTQSIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJkaWQ6a2V5Ono2TWtmV2hRSmdwb21BczdVOXlyd2IzUTlZbTZRZVlUZFFLVXFBcjZId3dhTGI1ZSIsInN1YiI6IjM2YjE0NmZiOTZkMGI4NTU2MzNkMjRjNmU0ZTkzZjIwYzI3ZDQ3YWQ3NTIxNjc5Y2UxYjE1ODk3YjhlMTYyM2QiLCJhdWQiOiJ3c3M6Ly9yZWxheS53YWxsZXRjb25uZWN0LmNvbSIsImlhdCI6MTcxMzM0MDExNSwiZXhwIjoxNzEzNDI2NTE1fQ.MUG6umhsjBhU99mdtg-cutGCPFAGggG8pjXLH7haV8L4Z-Pb9dh-0hZHlmfofVPbIIkdj-OVB-Fhpo1-OVbvAQ
I/flutter ( 5937): Initializing WebSocket with wss://relay.walletconnect.com?auth=eyJhbGciOiJFZERTQSIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJkaWQ6a2V5Ono2TWtmV2hRSmdwb21BczdVOXlyd2IzUTlZbTZRZVlUZFFLVXFBcjZId3dhTGI1ZSIsInN1YiI6IjM2YjE0NmZiOTZkMGI4NTU2MzNkMjRjNmU0ZTkzZjIwYzI3ZDQ3YWQ3NTIxNjc5Y2UxYjE1ODk3YjhlMTYyM2QiLCJhdWQiOiJ3c3M6Ly9yZWxheS53YWxsZXRjb25uZWN0LmNvbSIsImlhdCI6MTcxMzM0MDExNSwiZXhwIjoxNzEzNDI2NTE1fQ.MUG6umhsjBhU99mdtg-cutGCPFAGggG8pjXLH7haV8L4Z-Pb9dh-0hZHlmfofVPbIIkdj-OVB-Fhpo1-OVbvAQ&projectId=001b66692e8d25adb3d5f7d189550651&ua=wc-2%2FFlutter-2.2.2%2Fandroid-SE1B.240122.005%2Fandroid&origin=com.example.voter_booth
I/flutter ( 5937): [ExplorerService] init()
I/flutter ( 5937): [ExplorerService] _fetchListings() https://api.web3modal.com/getWallets?page=1&entries=1&include=c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96&platform=android {page: 1, entries: 1, include: c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96, platform: android}
I/flutter ( 5937): [ExplorerService] _fetchListings() https://api.web3modal.com/getWallets?page=1&entries=48&include=c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96&exclude=4622a2b2d6af1c9844944291e5e7351a6aa24cd7b23099efac1b2fd875da31a0%2Cfd20dc426fb37566d803205b19bbc1d4096b248ac04548e3cfb6b3a38bd033aa%2Cc57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96&platform=android {page: 1, entries: 48, include: c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96, exclude: 4622a2b2d6af1c9844944291e5e7351a6aa24cd7b23099efac1b2fd875da31a0,fd20dc426fb37566d803205b19bbc1d4096b248ac04548e3cfb6b3a38bd033aa,c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96, platform: android}
I/flutter ( 5937): [ExplorerService] _updateRecentWalletId c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96 null
I/flutter ( 5937): [ExplorerService] init() done
I/flutter ( 5937): [W3MService] initialized
D/InputMethodManager( 5937): showSoftInput() view=io.flutter.embedding.android.FlutterView{3de7d56 VFE...... .F....ID 0,0-1344,2944 WalletConnect/WalletConnectModalFlutter#1 aid=1073741824} flags=0 reason=SHOW_SOFT_INPUT
D/EGL_emulation( 5937): app_time_stats: avg=25978.94ms min=4681.61ms max=47276.27ms count=2
D/EGL_emulation( 5937): app_time_stats: avg=13393.45ms min=30.97ms max=39783.54ms count=3
D/InsetsController( 5937): show(ime(), fromIme=true)
D/EGL_emulation( 5937): app_time_stats: avg=1213.12ms min=1213.12ms max=1213.12ms count=1
D/EGL_emulation( 5937): app_time_stats: avg=219.90ms min=28.04ms max=522.00ms count=6
D/InputMethodManager( 5937): showSoftInput() view=io.flutter.embedding.android.FlutterView{3de7d56 VFE...... .F...... 0,0-1344,2944 WalletConnect/WalletConnectModalFlutter#1 aid=1073741824} flags=0 reason=SHOW_SOFT_INPUT
D/InsetsController( 5937): show(ime(), fromIme=true)
D/InputMethodManager( 5937): showSoftInput() view=io.flutter.embedding.android.FlutterView{3de7d56 VFE...... .F...... 0,0-1344,2944 WalletConnect/WalletConnectModalFlutter#1 aid=1073741824} flags=0 reason=SHOW_SOFT_INPUT
I/TextInputPlugin( 5937): Composing region changed by the framework. Restarting the input method.
W/IInputConnectionWrapper( 5937): getTextAfterCursor on inactive InputConnection
W/IInputConnectionWrapper( 5937): getSelectedText on inactive InputConnection
W/IInputConnectionWrapper( 5937): getTextBeforeCursor on inactive InputConnection
W/IInputConnectionWrapper( 5937): getTextAfterCursor on inactive InputConnection
W/IInputConnectionWrapper( 5937): getSelectedText on inactive InputConnection
D/InsetsController( 5937): show(ime(), fromIme=true)
D/InsetsController( 5937): show(ime(), fromIme=true)
D/InputMethodManager( 5937): showSoftInput() view=io.flutter.embedding.android.FlutterView{3de7d56 VFE...... .F...... 0,0-1344,2944 WalletConnect/WalletConnectModalFlutter#1 aid=1073741824} flags=0 reason=SHOW_SOFT_INPUT
I/TextInputPlugin( 5937): Composing region changed by the framework. Restarting the input method.
W/IInputConnectionWrapper( 5937): getTextBeforeCursor on inactive InputConnection
D/InsetsController( 5937): show(ime(), fromIme=true)
W/IInputConnectionWrapper( 5937): getTextAfterCursor on inactive InputConnection
W/IInputConnectionWrapper( 5937): getSelectedText on inactive InputConnection
D/InputMethodManager( 5937): showSoftInput() view=io.flutter.embedding.android.FlutterView{3de7d56 VFE...... .F...... 0,0-1344,2944 WalletConnect/WalletConnectModalFlutter#1 aid=1073741824} flags=0 reason=SHOW_SOFT_INPUT
D/InsetsController( 5937): show(ime(), fromIme=true)
D/InsetsController( 5937): show(ime(), fromIme=true)
D/EGL_emulation( 5937): app_time_stats: avg=122.84ms min=13.91ms max=369.03ms count=10
D/InputMethodManager( 5937): showSoftInput() view=io.flutter.embedding.android.FlutterView{3de7d56 VFE...... .F...... 0,0-1344,2944 WalletConnect/WalletConnectModalFlutter#1 aid=1073741824} flags=0 reason=SHOW_SOFT_INPUT
I/TextInputPlugin( 5937): Composing region changed by the framework. Restarting the input method.
W/IInputConnectionWrapper( 5937): setComposingRegion on inactive InputConnection
W/IInputConnectionWrapper( 5937): getTextBeforeCursor on inactive InputConnection
D/InsetsController( 5937): show(ime(), fromIme=true)
W/IInputConnectionWrapper( 5937): getTextAfterCursor on inactive InputConnection
W/IInputConnectionWrapper( 5937): getSelectedText on inactive InputConnection
D/InsetsController( 5937): show(ime(), fromIme=true)
D/EGL_emulation( 5937): app_time_stats: avg=307.26ms min=123.28ms max=487.95ms count=4
D/InputMethodManager( 5937): showSoftInput() view=io.flutter.embedding.android.FlutterView{3de7d56 VFE...... .F...... 0,0-1344,2944 WalletConnect/WalletConnectModalFlutter#1 aid=1073741824} flags=0 reason=SHOW_SOFT_INPUT
W/IInputConnectionWrapper( 5937): getTextBeforeCursor on inactive InputConnection
W/IInputConnectionWrapper( 5937): getTextAfterCursor on inactive InputConnection
W/IInputConnectionWrapper( 5937): getSelectedText on inactive InputConnection
D/InsetsController( 5937): show(ime(), fromIme=true)
D/InsetsController( 5937): show(ime(), fromIme=true)
D/EGL_emulation( 5937): app_time_stats: avg=175.58ms min=48.55ms max=500.09ms count=7
D/InputMethodManager( 5937): showSoftInput() view=io.flutter.embedding.android.FlutterView{3de7d56 VFE...... .F...... 0,0-1344,2944 WalletConnect/WalletConnectModalFlutter#1 aid=1073741824} flags=0 reason=SHOW_SOFT_INPUT
D/InsetsController( 5937): show(ime(), fromIme=true)
D/InputMethodManager( 5937): showSoftInput() view=io.flutter.embedding.android.FlutterView{3de7d56 VFE...... .F...... 0,0-1344,2944 WalletConnect/WalletConnectModalFlutter#1 aid=1073741824} flags=0 reason=SHOW_SOFT_INPUT
I/TextInputPlugin( 5937): Composing region changed by the framework. Restarting the input method.
D/InsetsController( 5937): show(ime(), fromIme=true)
W/IInputConnectionWrapper( 5937): getTextBeforeCursor on inactive InputConnection
W/IInputConnectionWrapper( 5937): getTextAfterCursor on inactive InputConnection
W/IInputConnectionWrapper( 5937): getSelectedText on inactive InputConnection
D/InsetsController( 5937): show(ime(), fromIme=true)
D/InputMethodManager( 5937): showSoftInput() view=io.flutter.embedding.android.FlutterView{3de7d56 VFE...... .F...... 0,0-1344,2944 WalletConnect/WalletConnectModalFlutter#1 aid=1073741824} flags=0 reason=SHOW_SOFT_INPUT
I/TextInputPlugin( 5937): Composing region changed by the framework. Restarting the input method.
W/IInputConnectionWrapper( 5937): getSelectedText on inactive InputConnection
D/InsetsController( 5937): show(ime(), fromIme=true)
W/IInputConnectionWrapper( 5937): getTextBeforeCursor on inactive InputConnection
W/IInputConnectionWrapper( 5937): getTextAfterCursor on inactive InputConnection
W/IInputConnectionWrapper( 5937): getSelectedText on inactive InputConnection
D/EGL_emulation( 5937): app_time_stats: avg=254.06ms min=68.64ms max=498.81ms count=5
D/InsetsController( 5937): show(ime(), fromIme=true)
D/EGL_emulation( 5937): app_time_stats: avg=286.32ms min=52.63ms max=494.33ms count=4
D/InputMethodManager( 5937): showSoftInput() view=io.flutter.embedding.android.FlutterView{3de7d56 VFE...... .F...... 0,0-1344,2944 WalletConnect/WalletConnectModalFlutter#1 aid=1073741824} flags=0 reason=SHOW_SOFT_INPUT
W/IInputConnectionWrapper( 5937): getTextBeforeCursor on inactive InputConnection
W/IInputConnectionWrapper( 5937): getTextAfterCursor on inactive InputConnection
W/IInputConnectionWrapper( 5937): getSelectedText on inactive InputConnection
D/InsetsController( 5937): show(ime(), fromIme=true)
D/InsetsController( 5937): show(ime(), fromIme=true)
D/InputMethodManager( 5937): showSoftInput() view=io.flutter.embedding.android.FlutterView{3de7d56 VFE...... .F...... 0,0-1344,2944 WalletConnect/WalletConnectModalFlutter#1 aid=1073741824} flags=0 reason=SHOW_SOFT_INPUT
D/InsetsController( 5937): show(ime(), fromIme=true)
D/EGL_emulation( 5937): app_time_stats: avg=141.48ms min=8.23ms max=471.32ms count=9
D/InputMethodManager( 5937): showSoftInput() view=io.flutter.embedding.android.FlutterView{3de7d56 VFE...... .F...... 0,0-1344,2944 WalletConnect/WalletConnectModalFlutter#1 aid=1073741824} flags=0 reason=SHOW_SOFT_INPUT
I/TextInputPlugin( 5937): Composing region changed by the framework. Restarting the input method.
D/InsetsController( 5937): show(ime(), fromIme=true)
W/IInputConnectionWrapper( 5937): getTextBeforeCursor on inactive InputConnection
W/IInputConnectionWrapper( 5937): getTextAfterCursor on inactive InputConnection
W/IInputConnectionWrapper( 5937): getSelectedText on inactive InputConnection
D/InsetsController( 5937): show(ime(), fromIme=true)
D/InputMethodManager( 5937): showSoftInput() view=io.flutter.embedding.android.FlutterView{3de7d56 VFE...... .F...... 0,0-1344,2944 WalletConnect/WalletConnectModalFlutter#1 aid=1073741824} flags=0 reason=SHOW_SOFT_INPUT
I/TextInputPlugin( 5937): Composing region changed by the framework. Restarting the input method.
W/IInputConnectionWrapper( 5937): getTextAfterCursor on inactive InputConnection
W/IInputConnectionWrapper( 5937): getSelectedText on inactive InputConnection
D/InsetsController( 5937): show(ime(), fromIme=true)
W/IInputConnectionWrapper( 5937): getTextBeforeCursor on inactive InputConnection
W/IInputConnectionWrapper( 5937): getTextAfterCursor on inactive InputConnection
W/IInputConnectionWrapper( 5937): getSelectedText on inactive InputConnection
D/InsetsController( 5937): show(ime(), fromIme=true)
D/InputMethodManager( 5937): showSoftInput() view=io.flutter.embedding.android.FlutterView{3de7d56 VFE...... .F...... 0,0-1344,2944 WalletConnect/WalletConnectModalFlutter#1 aid=1073741824} flags=0 reason=SHOW_SOFT_INPUT
I/TextInputPlugin( 5937): Composing region changed by the framework. Restarting the input method.
W/IInputConnectionWrapper( 5937): getSelectedText on inactive InputConnection
W/IInputConnectionWrapper( 5937): getTextBeforeCursor on inactive InputConnection
D/InsetsController( 5937): show(ime(), fromIme=true)
W/IInputConnectionWrapper( 5937): getTextAfterCursor on inactive InputConnection
W/IInputConnectionWrapper( 5937): getSelectedText on inactive InputConnection
D/InsetsController( 5937): show(ime(), fromIme=true)
D/EGL_emulation( 5937): app_time_stats: avg=172.52ms min=58.95ms max=481.62ms count=6
D/InputMethodManager( 5937): showSoftInput() view=io.flutter.embedding.android.FlutterView{3de7d56 VFE...... .F...... 0,0-1344,2944 WalletConnect/WalletConnectModalFlutter#1 aid=1073741824} flags=0 reason=SHOW_SOFT_INPUT
I/TextInputPlugin( 5937): Composing region changed by the framework. Restarting the input method.
W/IInputConnectionWrapper( 5937): getTextBeforeCursor on inactive InputConnection
W/IInputConnectionWrapper( 5937): getTextAfterCursor on inactive InputConnection
W/IInputConnectionWrapper( 5937): getSelectedText on inactive InputConnection
D/InsetsController( 5937): show(ime(), fromIme=true)
D/InsetsController( 5937): show(ime(), fromIme=true)
D/EGL_emulation( 5937): app_time_stats: avg=280.96ms min=66.29ms max=505.21ms count=4
I/flutter ( 5937): Null check operator used on a null value
D/EGL_emulation( 5937): app_time_stats: avg=19.51ms min=4.36ms max=202.80ms count=35
D/EGL_emulation( 5937): app_time_stats: avg=499.84ms min=499.76ms max=499.92ms count=2
D/EGL_emulation( 5937): app_time_stats: avg=500.21ms min=499.43ms max=501.00ms count=2
D/EGL_emulation( 5937): app_time_stats: avg=499.77ms min=499.09ms max=500.33ms count=3
D/EGL_emulation( 5937): app_time_stats: avg=505.62ms min=497.09ms max=517.80ms count=3
D/EGL_emulation( 5937): app_time_stats: avg=493.75ms min=482.52ms max=500.32ms count=3
I/flutter ( 5937): Null check operator used on a null value
quetool commented 1 month ago

Hello @sethitanay!

dependency_overrides:
  walletconnect_flutter_v2: 2.2.2

Please follow documentation (there's a handy video at the bottom) and get back it you still have issues. https://docs.walletconnect.com/web3modal/flutter/installation

sethitanay commented 4 weeks ago

Hi, thank you for your reply. I have written the connection logic in a separate file. Below I have given the code of both my files. The application runs and Metamask is opened whenever the connect button is pressed. However, whenever a writeContract or readContract transaction is initiated, Metamask opens up as expected, but the transaction confirmation pop-up is not being displayed.

Code for connection logic file:

import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
import 'package:web3modal_flutter/web3modal_flutter.dart';

class MetamaskConnector extends StatefulWidget {
  const MetamaskConnector({super.key});

  @override
  State<MetamaskConnector> createState() => _MetamaskConnectorState();
}

class _MetamaskConnectorState extends State<MetamaskConnector> {
  late W3MService _w3mService;
  @override

  void initState(){
    super.initState();
    W3MChainPresets.chains.putIfAbsent(_chainId, () => _sepoliaChain);
    _w3mService = W3MService(
      projectId: '001b66692e8d25adb3d5f7d189550651',
      metadata: const PairingMetadata(
        name: 'W3m Flutter',
        description: 'Web3Modal Flutter Example',
        url: 'https://www.walletconnect.com/',
        icons: ['https://walletconnect.com/walletconnect-logo.png'],
        redirect: Redirect(
          native: 'flutterdapp://',
          universal: 'https://www.walletconnect.com',
        ),
      ),
      includedWalletIds : {
        'c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96',// Coinbase Wallet
      },
      excludedWalletIds : {
        '4622a2b2d6af1c9844944291e5e7351a6aa24cd7b23099efac1b2fd875da31a0', // Trust
        'fd20dc426fb37566d803205b19bbc1d4096b248ac04548e3cfb6b3a38bd033aa', // Coinbase Wallet
      },
    );
    _w3mService.init();
  }

  @override
  Widget build(BuildContext context) {
    return Center(
      child: Column(
        crossAxisAlignment: CrossAxisAlignment.center,
        mainAxisAlignment: MainAxisAlignment.center,
        children: [
          W3MNetworkSelectButton(service: _w3mService),
          W3MConnectWalletButton(service: _w3mService),
        ],
      ),
    );
  }
}

const _chainId = "11155111";

final _sepoliaChain = W3MChainInfo(
    chainName: 'Sepolia',
    chainId: _chainId,
    namespace: 'eip155:$_chainId',
    tokenName: 'ETH',
    rpcUrl: 'https://eth-sepolia.g.alchemy.com/v2/Is7xCCuFmVXsJ1RvScVGEiCMggxETN7U',
    blockExplorer: W3MBlockExplorer(
        name: 'Sepolia Explorer',
        url: 'https://sepolia.etherscan.io/'
    )
);

File in which I am trying to implement write function:

import 'package:flutter/material.dart';
import 'package:web3modal_flutter/web3modal_flutter.dart';
import 'package:flutter/services.dart';
import 'package:voter_booth/utils/constants.dart';

class AuthorizeVoterScreen extends StatefulWidget {
  const AuthorizeVoterScreen({super.key});

  @override
  State<AuthorizeVoterScreen> createState() => _AuthorizeVoterScreenState();
}

class _AuthorizeVoterScreenState extends State<AuthorizeVoterScreen> {
  late TextEditingController nameController;
  late TextEditingController addressController;
  late TextEditingController ageController;
  late TextEditingController genderController;
  late W3MService _w3mService;

  @override
  void initState() {
    super.initState();
    try {
      _w3mService = W3MService(
        projectId: '001b66692e8d25adb3d5f7d189550651',
        metadata: const PairingMetadata(
          name: 'W3m Flutter',
          description: 'Web3Modal Flutter Example',
          url: 'https://www.walletconnect.com/',
          icons: ['https://walletconnect.com/walletconnect-logo.png'],
          redirect: Redirect(
            native: 'flutterdapp://',
            universal: 'https://www.walletconnect.com',
          ),
        ),
        includedWalletIds: {
          'c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96',
          // Metamask Wallet
        },
        excludedWalletIds: {
          '4622a2b2d6af1c9844944291e5e7351a6aa24cd7b23099efac1b2fd875da31a0', // Trust
          'fd20dc426fb37566d803205b19bbc1d4096b248ac04548e3cfb6b3a38bd033aa', // Coinbase Wallet
        },
      );
      _w3mService.init();
    } catch (e) {
      print("Error initializing _w3mService: $e");
      // Handle initialization error gracefully
    }
    nameController = TextEditingController();
    addressController = TextEditingController();
    ageController = TextEditingController();
    genderController = TextEditingController();
  }

  Future<void> callWriteFunction1() async {
    print("_w3mService: $_w3mService");
    String abi = await rootBundle.loadString('assets/abi.json');
    String contractAddress = contractAddress1;
    try {
      final deployedContract = DeployedContract(
        ContractAbi.fromJson(abi, 'Voting'),
        EthereumAddress.fromHex(contractAddress),
      );

      await _w3mService.launchConnectedWallet();
      print("Session: ${_w3mService.session}");
      if (_w3mService.session != null) {
        await _w3mService.requestWriteContract(
          topic: _w3mService.session!.topic.toString(),
          chainId: 'eip155:11155111',
          rpcUrl:
          'https://eth-sepolia.g.alchemy.com/v2/Is7xCCuFmVXsJ1RvScVGEiCMggxETN7U',
          deployedContract: deployedContract,
          functionName: 'authorizeVoter',
          parameters: [
            addressController.text,
            nameController.text,
            ageController.text,
            genderController.text
          ],
          transaction: Transaction(),
        );
      } else {
        print("Session is null");
      }
    } catch (e) {
      print("Error calling write function: $e");
    }
    }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text('Authorize Voter'),
      ),
      body: Padding(
        padding: const EdgeInsets.all(16.0),
        child: Card(
          child: Padding(
            padding: const EdgeInsets.all(16.0),
            child: Column(
              crossAxisAlignment: CrossAxisAlignment.stretch,
              children: [
                TextFormField(
                  controller: nameController,
                  decoration: const InputDecoration(labelText: 'Voter Name'),
                ),
                const SizedBox(height: 16),
                TextFormField(
                  controller: addressController,
                  decoration:
                  const InputDecoration(labelText: 'Voter Address'),
                ),
                const SizedBox(height: 16),
                TextFormField(
                  controller: ageController,
                  decoration: const InputDecoration(labelText: 'Age'),
                  keyboardType: TextInputType.number,
                ),
                const SizedBox(height: 16),
                TextFormField(
                  controller: genderController,
                  decoration: const InputDecoration(labelText: 'Gender'),
                ),
                const SizedBox(height: 16),
                ElevatedButton(
                  onPressed: () {
                    callWriteFunction1();
                  },
                  child: const Text('Authorize Voter'),
                ),
              ],
            ),
          ),
        ),
      ),
    );
  }
}

Dependencies: walletconnect_flutter_v2: ^2.2.2 web3modal_flutter: ^3.1.2 dependency_overrides: walletconnect_flutter_v2: 2.2.2

Terminal Status:

Launching lib\main.dart on Redmi Note 9 Pro Max in debug mode...
Running Gradle task 'assembleDebug'...
√  Built build\app\outputs\flutter-apk\app-debug.apk.
Debug service listening on ws://127.0.0.1:55132/RE9kVPUrlPY=/ws
Syncing files to device Redmi Note 9 Pro Max...
W/DynamiteModule(31666): Local module descriptor class for com.google.android.gms.providerinstaller.dynamite not found.
I/DynamiteModule(31666): Considering local module com.google.android.gms.providerinstaller.dynamite:0 and remote module com.google.android.gms.providerinstaller.dynamite:0
W/ProviderInstaller(31666): Failed to load providerinstaller module: No acceptable module com.google.android.gms.providerinstaller.dynamite found. Local version is 0 and remote version is 0.
W/ziparchive(31666): Unable to open '/system/framework/org.apache.http.legacy.dm': No such file or directory
W/ziparchive(31666): Unable to open '/system/framework/org.apache.http.legacy.dm': No such file or directory
D/nativeloader(31666): Configuring clns-6 for other apk /system/framework/org.apache.http.legacy.jar. target_sdk_version=34, uses_libraries=ALL, library_path=/data/app/~~sNV6WKXnEoSJSkEnNwBGuQ==/com.google.android.gms-zOnO6dNgQqodvqrwyZPOBQ==/lib/arm64:/data/app/~~sNV6WKXnEoSJSkEnNwBGuQ==/com.google.android.gms-zOnO6dNgQqodvqrwyZPOBQ==/base.apk!/lib/arm64-v8a, permitted_path=/data:/mnt/expand:/data/user/0/com.google.android.gms
D/nativeloader(31666): Extending system_exposed_libraries: libvraudio_client.qti.so:libbinauralrenderer_wrapper.qti.so:libhoaeffects.qti.so:libQOC.qti.so:libcamera_algoup_jni.xiaomi.so:libcamera_mianode_jni.xiaomi.so:libupdateprof.qti.so:libthermalclient.qti.so:libQOC.qti.so:libdiag_system.qti.so:libqape.qti.so:libqesdk_ndk_platform.qti.so:liblistenjni.qti.so
W/ziparchive(31666): Unable to open '/system/framework/com.android.media.remotedisplay.dm': No such file or directory
W/ziparchive(31666): Unable to open '/system/framework/com.android.media.remotedisplay.dm': No such file or directory
D/nativeloader(31666): Configuring clns-7 for other apk /system/framework/com.android.media.remotedisplay.jar. target_sdk_version=34, uses_libraries=ALL, library_path=/data/app/~~sNV6WKXnEoSJSkEnNwBGuQ==/com.google.android.gms-zOnO6dNgQqodvqrwyZPOBQ==/lib/arm64:/data/app/~~sNV6WKXnEoSJSkEnNwBGuQ==/com.google.android.gms-zOnO6dNgQqodvqrwyZPOBQ==/base.apk!/lib/arm64-v8a, permitted_path=/data:/mnt/expand:/data/user/0/com.google.android.gms
D/nativeloader(31666): Extending system_exposed_libraries: libvraudio_client.qti.so:libbinauralrenderer_wrapper.qti.so:libhoaeffects.qti.so:libQOC.qti.so:libcamera_algoup_jni.xiaomi.so:libcamera_mianode_jni.xiaomi.so:libupdateprof.qti.so:libthermalclient.qti.so:libQOC.qti.so:libdiag_system.qti.so:libqape.qti.so:libqesdk_ndk_platform.qti.so:liblistenjni.qti.so
W/ple.voter_boot(31666): Loading /data/misc/apexdata/com.android.art/dalvik-cache/arm64/system@framework@com.android.location.provider.jar@classes.odex non-executable as it requires an image which we failed to load
D/nativeloader(31666): Configuring clns-8 for other apk /system/framework/com.android.location.provider.jar. target_sdk_version=34, uses_libraries=ALL, library_path=/data/app/~~sNV6WKXnEoSJSkEnNwBGuQ==/com.google.android.gms-zOnO6dNgQqodvqrwyZPOBQ==/lib/arm64:/data/app/~~sNV6WKXnEoSJSkEnNwBGuQ==/com.google.android.gms-zOnO6dNgQqodvqrwyZPOBQ==/base.apk!/lib/arm64-v8a, permitted_path=/data:/mnt/expand:/data/user/0/com.google.android.gms
D/nativeloader(31666): Extending system_exposed_libraries: libvraudio_client.qti.so:libbinauralrenderer_wrapper.qti.so:libhoaeffects.qti.so:libQOC.qti.so:libcamera_algoup_jni.xiaomi.so:libcamera_mianode_jni.xiaomi.so:libupdateprof.qti.so:libthermalclient.qti.so:libQOC.qti.so:libdiag_system.qti.so:libqape.qti.so:libqesdk_ndk_platform.qti.so:liblistenjni.qti.so
D/nativeloader(31666): Configuring clns-9 for other apk /data/app/~~sNV6WKXnEoSJSkEnNwBGuQ==/com.google.android.gms-zOnO6dNgQqodvqrwyZPOBQ==/base.apk. target_sdk_version=34, uses_libraries=, library_path=/data/app/~~sNV6WKXnEoSJSkEnNwBGuQ==/com.google.android.gms-zOnO6dNgQqodvqrwyZPOBQ==/lib/arm64:/data/app/~~sNV6WKXnEoSJSkEnNwBGuQ==/com.google.android.gms-zOnO6dNgQqodvqrwyZPOBQ==/base.apk!/lib/arm64-v8a, permitted_path=/data:/mnt/expand:/data/user/0/com.google.android.gms
V/NativeCrypto(31666): Registering com/google/android/gms/org/conscrypt/NativeCrypto's 305 native methods...
W/ple.voter_boot(31666): Accessing hidden method Ljava/security/spec/ECParameterSpec;->getCurveName()Ljava/lang/String; (unsupported, reflection, allowed)
I/ProviderInstaller(31666): Installed default security provider GmsCore_OpenSSL
W/ple.voter_boot(31666): Accessing hidden field Ljava/net/Socket;->impl:Ljava/net/SocketImpl; (unsupported, reflection, allowed)
E/ple.voter_boot(31666): open libmigui.so failed! dlopen - dlopen failed: library "libmigui.so" not found
W/ple.voter_boot(31666): Accessing hidden method Ljava/security/spec/ECParameterSpec;->setCurveName(Ljava/lang/String;)V (unsupported, reflection, allowed)
D/DecorView[](31666): onWindowFocusChanged hasWindowFocus true
[GETX] Instance "GetMaterialController" has been created
[GETX] Instance "GetMaterialController" has been initialized
[GETX] REPLACE ROUTE /
[GETX] NEW ROUTE null
D/DecorView[](31666): getWindowModeFromSystem  windowmode is 1
D/DecorView[](31666): updateDecorCaptionStatus displayWindowDecor is false
I/flutter (31666): RelayClient Internal: Connecting to relay
I/flutter (31666): RelayClient Internal: Disconnecting from relay
I/flutter (31666): Signed JWT: eyJhbGciOiJFZERTQSIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJkaWQ6a2V5Ono2TWt0NVl6NHNONzZ2MUVvM3lFS3k4U2oxR1Y0dDF1QjRUYkozQUpFcDRibnJObSIsInN1YiI6ImRiZmNiMWRhODc1ZGI1YTRkYWZmYzkyNzUzYWI0YWZiZGQ0NDA5NDYyYjUxNTM4NTkxNDRlZmM2Mzc0MmY4YjYiLCJhdWQiOiJ3c3M6Ly9yZWxheS53YWxsZXRjb25uZWN0LmNvbSIsImlhdCI6MTcxMzU4MDMwMiwiZXhwIjoxNzEzNjY2NzAyfQ.cIdAbC_fEXcXxdu0lX6Qr9QV0mKFKTRmb0S1sMTyY0ViEd0CRq4lqsVmb42DKcRL5GLGou2nun7nXJRinLjMAQ
I/flutter (31666): Initializing WebSocket with wss://relay.walletconnect.com?auth=eyJhbGciOiJFZERTQSIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJkaWQ6a2V5Ono2TWt0NVl6NHNONzZ2MUVvM3lFS3k4U2oxR1Y0dDF1QjRUYkozQUpFcDRibnJObSIsInN1YiI6ImRiZmNiMWRhODc1ZGI1YTRkYWZmYzkyNzUzYWI0YWZiZGQ0NDA5NDYyYjUxNTM4NTkxNDRlZmM2Mzc0MmY4YjYiLCJhdWQiOiJ3c3M6Ly9yZWxheS53YWxsZXRjb25uZWN0LmNvbSIsImlhdCI6MTcxMzU4MDMwMiwiZXhwIjoxNzEzNjY2NzAyfQ.cIdAbC_fEXcXxdu0lX6Qr9QV0mKFKTRmb0S1sMTyY0ViEd0CRq4lqsVmb42DKcRL5GLGou2nun7nXJRinLjMAQ&projectId=001b66692e8d25adb3d5f7d189550651&ua=wc-2%2FFlutter-2.2.2%2Fandroid-SKQ1.211019.001+test-keys%2Fandroid&origin=com.example.voter_booth
I/flutter (31666): [ExplorerService] init()
I/flutter (31666): [ExplorerService] _fetchListings() https://api.web3modal.com/getWallets?page=1&entries=1&include=c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96&platform=android {page: 1, entries: 1, include: c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96, platform: android}
I/flutter (31666): [ExplorerService] _fetchListings() https://api.web3modal.com/getWallets?page=1&entries=48&include=c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96&exclude=4622a2b2d6af1c9844944291e5e7351a6aa24cd7b23099efac1b2fd875da31a0%2Cfd20dc426fb37566d803205b19bbc1d4096b248ac04548e3cfb6b3a38bd033aa%2Cc57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96&platform=android {page: 1, entries: 48, include: c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96, exclude: 4622a2b2d6af1c9844944291e5e7351a6aa24cd7b23099efac1b2fd875da31a0,fd20dc426fb37566d803205b19bbc1d4096b248ac04548e3cfb6b3a38bd033aa,c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96, platform: android}
I/flutter (31666): [ExplorerService] _updateRecentWalletId c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96 null
I/flutter (31666): [ExplorerService] init() done
I/flutter (31666): [W3MService] initialized
I/flutter (31666): [W3MService] set chain eip155:11155111
I/flutter (31666): [W3MService] Connecting to WalletConnect, required namespaces: {}, optional namespaces: {eip155: RequiredNamespace(chains: [eip155:1, eip155:42161, eip155:137, eip155:43114, eip155:56, eip155:10, eip155:250, eip155:9001, eip155:4689, eip155:1088, eip155:11155111], methods: [eth_sendTransaction, personal_sign, eth_accounts, eth_requestAccounts, eth_sendRawTransaction, eth_sign, eth_signTransaction, eth_signTypedData, eth_signTypedData_v3, eth_signTypedData_v4, wallet_switchEthereumChain, wallet_addEthereumChain, wallet_getPermissions, wallet_requestPermissions, wallet_registerOnboarding, wallet_watchAsset, wallet_scanQRCode], events: [chainChanged, accountsChanged, message, disconnect, connect])}
I/flutter (31666): pairing sendRequest, id: 1713580370003642 topic: 20d144fcf5fb5f8d152f6a03d96c770e109be1521de03a0c1b5a85457c6065fe, method: wc_sessionPropose, params: WcSessionProposeRequest(relays: [Instance of 'Relay'], requiredNamespaces: {}, optionalNamespaces: {eip155: RequiredNamespace(chains: [eip155:1, eip155:42161, eip155:137, eip155:43114, eip155:56, eip155:10, eip155:250, eip155:9001, eip155:4689, eip155:1088, eip155:11155111], methods: [eth_sendTransaction, personal_sign, eth_accounts, eth_requestAccounts, eth_sendRawTransaction, eth_sign, eth_signTransaction, eth_signTypedData, eth_signTypedData_v3, eth_signTypedData_v4, wallet_switchEthereumChain, wallet_addEthereumChain, wallet_getPermissions, wallet_requestPermissions, wallet_registerOnboarding, wallet_watchAsset, wallet_scanQRCode], events: [chainChanged, accountsChanged, message, disconnect, connect])}, sessionProperties: null, proposer: ConnectionMetadata(publicKey: 1023f7f1c65fdfd8a7df1d0f9ca4c2c35b97e9ab720803f6f3b10ef11ce3ec01, metadata: PairingMetadata
I/flutter (31666): [CoreUtils] Encoded WC URL: wc%3A20d144fcf5fb5f8d152f6a03d96c770e109be1521de03a0c1b5a85457c6065fe%402%3Frelay-protocol%3Dirn%26symKey%3D17efe1cd61a25c09eab14b00f6adbeb6975016f55b7c6d7fcff965e50c877dcd%26methods%3D%255Bwc_sessionPropose%252Cwc_sessionRequest%255D%252C%255Bwc_authRequest%255D
D/DecorView[](31666): onWindowFocusChanged hasWindowFocus false
I/FA      (31666): Application backgrounded at: timestamp_millis: 1713580370441
I/flutter (31666): Handling Publish Message: 20d144fcf5fb5f8d152f6a03d96c770e109be1521de03a0c1b5a85457c6065fe, ADvy2YLXMD7yZohivuG/jZ90wsd/rquyq8JpetBYS3r9AcxHyMxiZxHDBbu/kyiyy4iRKaojB5fFpJCc0P1eaU49v/G60SonF0k9EApsTbbVWiuqstHYTgAAdjHXcUQEZXIL2KdYrM4ZqUY2puwrl6YgpA4JLTP6e1FVIcvLbB9GB7lHe4L9qpQb5WVZneBOnGsv8+C9COWUymrccxInaG46wloBR2dn4soF9R/yAbwT1C/GEEkHWI19CSp3URvLTag=
I/flutter (31666): Pairing _onMessageEvent, Received data: {id: 1713580370003642, jsonrpc: 2.0, result: {relay: {protocol: irn}, responderPublicKey: b888632ac8d1e11e4824b505709349e45ee930d3cc9d683d8164b0b9e3600e2b}}
D/AppScoutStateMachine(31666): 31666-ScoutStateMachinecreated
D/SurfaceView(31666): UPDATE Surface(name=SurfaceView[com.example.voter_booth/com.example.voter_booth.MainActivity])/@0x5317f2c, mIsProjectionMode = false
I/OpenGLRenderer(31666): Davey! duration=20929ms; Flags=1, FrameTimelineVsyncId=1979634, IntendedVsync=33416768581227, Vsync=33416768581227, InputEventId=0, HandleInputStart=33416772206209, AnimationStart=33416772217980, PerformTraversalsStart=33416772227512, DrawStart=33416775681626, FrameDeadline=33416801914559, FrameInterval=33416772134126, FrameStartTime=16666666, SyncQueued=33416777286470, SyncStart=33416777381105, IssueDrawCommandsStart=33416777737720, SwapBuffers=33416784032668, FrameCompleted=33437697875941, DequeueBufferDuration=1894583, QueueBufferDuration=2578230, GpuCompleted=33437697875941, SwapBuffersCompleted=33416787254334, DisplayPresentTime=0, 
D/DecorView[](31666): onWindowFocusChanged hasWindowFocus true
I/flutter (31666): Handling Publish Message: 3ec4abce023f36b2e808db72f54afc18e5888a60d4630675b0e7d2fc7d558ac8, AC/VVFf/U55rBL9CR/jrugNRTNKdwe3mX7tqKhB6NaY/pvRCw9CUdbcXDXbNEmmgf3Nw+iB3dHmfaQ11eHneauSfxJU+JFhJBoeUJHdoMTFzgizMkXXOf7dT+BJ57RS82U97qrUIFp0KWi2CdnGdfWIaJg8Y0QOe4Dg3YUhptvJyeDBmr/jAb9sRzJaREo0me540rLPTESnTvLEmCcVqvD0vySuL/sjP60InMXV9vF1VGfH8TKaJoxEy8JPLsz0xK9uYpruqbnab4RGYBsNB4MJZFak3dJDkGfYSW44YscNDdcCGgY+BODmuYgAmHwEMsltQIxm4LghsCBcVlMLEd2IRc2b71fiQELXGyiQXcU8f7VRMgdO/4Z2GGT9Z7OFQESGeg0RDQeBWTR7gkShf0TdQuOcIpKOsDiIksOBASesa8lBFCtH8PaQQP9U/5kyzEA0bDGlP/JtIyIiYIcdtpKPDfXuuY6DwhT6nXAWI+xcJqNE50zeaGlK7ChJ+KMxoY8SFS2/7J52CyU4NZYGwsWyfy4WAFMgvBWE2iJV1ayzdsQHjFhRXkDP9Ql/y+DLUsbeHbvrPy4RRyQa7nuy8Yp0x+Z586ovf0nFlqr10bXOSDXCwFcPM0tLAl7zXEau/yjVrSgTlxO/U1m9tyMwedCLz+Tb7QnyVt59kFkXC0XgPiTNmVlzl9v5KySUUkT08lHHpTT5Yo8gM3VLWbbo0RGEQmfVUSH15QQgFMtl45y76OvHT1IvDzp19iJ9sF89hWCHCE0tEgsSUTNVEJLaK5i878sfirMy78CxQPswFoG6WQLmykdQQ+mZFVDT61UgubIXGp+hqV/giUHdIvebLKMqzfe2hJkoYoqfbQCaHE/y8jh9NxTSCwn3LnC22YZPYRxROenhI/xl+vp6jnMsigltsO2XjKBkYn74
I/flutter (31666): Pairing _onMessageEvent, Received data: {id: 1713580374956837, jsonrpc: 2.0, method: wc_sessionSettle, params: {relay: {protocol: irn}, namespaces: {eip155: {accounts: [eip155:11155111:0x17aed66b741580b4079a086241680807669a42e2], chains: [eip155:11155111], methods: [eth_sendTransaction, personal_sign, eth_sendTransaction, personal_sign, eth_accounts, eth_requestAccounts, eth_sendRawTransaction, eth_sign, eth_signTransaction, eth_signTypedData, eth_signTypedData_v3, eth_signTypedData_v4, wallet_switchEthereumChain, wallet_addEthereumChain, wallet_getPermissions, wallet_requestPermissions, wallet_registerOnboarding, wallet_watchAsset, wallet_scanQRCode], events: [chainChanged, accountsChanged]}}, requiredNamespaces: {eip155: {methods: [eth_sendTransaction, personal_sign, eth_sendTransaction, personal_sign, eth_accounts, eth_requestAccounts, eth_sendRawTransaction, eth_sign, eth_signTransaction, eth_signTypedData, eth_signTypedData_v3, eth_signTypedData_v4, wallet_switchEthereumChain, wallet_addEthereumChain, w
I/flutter (31666): pairing sendResult, id: 1713580374956837 topic: 3ec4abce023f36b2e808db72f54afc18e5888a60d4630675b0e7d2fc7d558ac8, method: wc_sessionSettle, result: true
I/flutter (31666): [ExplorerService] _updateRecentWalletId c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96 {listing: {id: c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96, name: MetaMask, homepage: https://metamask.io/, image_id: 5195e9db-94d8-4579-6f11-ef553be95100, order: 10, mobile_link: metamask://, desktop_link: null, webapp_link: null, app_store: https://apps.apple.com/us/app/metamask/id1438144202, play_store: https://play.google.com/store/apps/details?id=io.metamask, rdns: io.metamask, injected: [{namespace: eip155, injected_id: isMetaMask}]}, installed: true, recent: true}
I/flutter (31666): [W3MService] Connected with session {topic: 3ec4abce023f36b2e808db72f54afc18e5888a60d4630675b0e7d2fc7d558ac8, pairingTopic: 20d144fcf5fb5f8d152f6a03d96c770e109be1521de03a0c1b5a85457c6065fe, relay: {protocol: irn, data: null}, expiry: 1714185174, acknowledged: true, controller: b888632ac8d1e11e4824b505709349e45ee930d3cc9d683d8164b0b9e3600e2b, namespaces: {eip155: {accounts: [eip155:11155111:0x17aed66b741580b4079a086241680807669a42e2], methods: [eth_sendTransaction, personal_sign, eth_sendTransaction, personal_sign, eth_accounts, eth_requestAccounts, eth_sendRawTransaction, eth_sign, eth_signTransaction, eth_signTypedData, eth_signTypedData_v3, eth_signTypedData_v4, wallet_switchEthereumChain, wallet_addEthereumChain, wallet_getPermissions, wallet_requestPermissions, wallet_registerOnboarding, wallet_watchAsset, wallet_scanQRCode], events: [chainChanged, accountsChanged]}}, requiredNamespaces: {eip155: {chains: [eip155:11155111], methods: [eth_sendTransaction, personal_sign, eth_sendTransaction, personal_sign,
I/flutter (31666): [W3MService] onSessionConnect: SessionConnect(session: SessionData(topic: 3ec4abce023f36b2e808db72f54afc18e5888a60d4630675b0e7d2fc7d558ac8, pairingTopic: 20d144fcf5fb5f8d152f6a03d96c770e109be1521de03a0c1b5a85457c6065fe, relay: Instance of 'Relay', expiry: 1714185174, acknowledged: true, controller: b888632ac8d1e11e4824b505709349e45ee930d3cc9d683d8164b0b9e3600e2b, namespaces: {eip155: Namespace(accounts: [eip155:11155111:0x17aed66b741580b4079a086241680807669a42e2], methods: [eth_sendTransaction, personal_sign, eth_sendTransaction, personal_sign, eth_accounts, eth_requestAccounts, eth_sendRawTransaction, eth_sign, eth_signTransaction, eth_signTypedData, eth_signTypedData_v3, eth_signTypedData_v4, wallet_switchEthereumChain, wallet_addEthereumChain, wallet_getPermissions, wallet_requestPermissions, wallet_registerOnboarding, wallet_watchAsset, wallet_scanQRCode], events: [chainChanged, accountsChanged])}, requiredNamespaces: {eip155: RequiredNamespace(chains: [eip155:11155111], methods: [eth_sendTransaction, pe
I/flutter (31666): [W3MService] _loadAccountData
I/flutter (31666): [W3MService] account data laoded
I/flutter (31666): RelayClient Internal: Connecting to relay
I/flutter (31666): RelayClient Internal: Connecting to relay
I/flutter (31666): RelayClient Internal: Disconnecting from relay
I/flutter (31666): RelayClient Internal: Disconnecting from relay
I/flutter (31666): Signed JWT: eyJhbGciOiJFZERTQSIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJkaWQ6a2V5Ono2TWt0NVl6NHNONzZ2MUVvM3lFS3k4U2oxR1Y0dDF1QjRUYkozQUpFcDRibnJObSIsInN1YiI6IjcyMGU2N2M3NjNjYjdmOGY2MzBkNGJmOTRlNGEwMTllMGRmOTNmMjkyZjFmNjUxZGRhZjA2YmU5YTFmYjk1YmYiLCJhdWQiOiJ3c3M6Ly9yZWxheS53YWxsZXRjb25uZWN0LmNvbSIsImlhdCI6MTcxMzU4MDMyOCwiZXhwIjoxNzEzNjY2NzI4fQ.QYn-7jGJevNko_j401IIlM81k6neDKE19xLAZgfPBdlKmaL0CgjP72s0ii12bLTtDuEepveiiq_4u7Gv2EzbAg
I/flutter (31666): Signed JWT: eyJhbGciOiJFZERTQSIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJkaWQ6a2V5Ono2TWt0NVl6NHNONzZ2MUVvM3lFS3k4U2oxR1Y0dDF1QjRUYkozQUpFcDRibnJObSIsInN1YiI6IjcyMGU2N2M3NjNjYjdmOGY2MzBkNGJmOTRlNGEwMTllMGRmOTNmMjkyZjFmNjUxZGRhZjA2YmU5YTFmYjk1YmYiLCJhdWQiOiJ3c3M6Ly9yZWxheS53YWxsZXRjb25uZWN0LmNvbSIsImlhdCI6MTcxMzU4MDMyOCwiZXhwIjoxNzEzNjY2NzI4fQ.QYn-7jGJevNko_j401IIlM81k6neDKE19xLAZgfPBdlKmaL0CgjP72s0ii12bLTtDuEepveiiq_4u7Gv2EzbAg
I/flutter (31666): Initializing WebSocket with wss://relay.walletconnect.com?auth=eyJhbGciOiJFZERTQSIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJkaWQ6a2V5Ono2TWt0NVl6NHNONzZ2MUVvM3lFS3k4U2oxR1Y0dDF1QjRUYkozQUpFcDRibnJObSIsInN1YiI6IjcyMGU2N2M3NjNjYjdmOGY2MzBkNGJmOTRlNGEwMTllMGRmOTNmMjkyZjFmNjUxZGRhZjA2YmU5YTFmYjk1YmYiLCJhdWQiOiJ3c3M6Ly9yZWxheS53YWxsZXRjb25uZWN0LmNvbSIsImlhdCI6MTcxMzU4MDMyOCwiZXhwIjoxNzEzNjY2NzI4fQ.QYn-7jGJevNko_j401IIlM81k6neDKE19xLAZgfPBdlKmaL0CgjP72s0ii12bLTtDuEepveiiq_4u7Gv2EzbAg&projectId=001b66692e8d25adb3d5f7d189550651&ua=wc-2%2FFlutter-2.2.2%2Fandroid-SKQ1.211019.001+test-keys%2Fandroid&origin=com.example.voter_booth
I/flutter (31666): Initializing WebSocket with wss://relay.walletconnect.com?auth=eyJhbGciOiJFZERTQSIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJkaWQ6a2V5Ono2TWt0NVl6NHNONzZ2MUVvM3lFS3k4U2oxR1Y0dDF1QjRUYkozQUpFcDRibnJObSIsInN1YiI6IjcyMGU2N2M3NjNjYjdmOGY2MzBkNGJmOTRlNGEwMTllMGRmOTNmMjkyZjFmNjUxZGRhZjA2YmU5YTFmYjk1YmYiLCJhdWQiOiJ3c3M6Ly9yZWxheS53YWxsZXRjb25uZWN0LmNvbSIsImlhdCI6MTcxMzU4MDMyOCwiZXhwIjoxNzEzNjY2NzI4fQ.QYn-7jGJevNko_j401IIlM81k6neDKE19xLAZgfPBdlKmaL0CgjP72s0ii12bLTtDuEepveiiq_4u7Gv2EzbAg&projectId=001b66692e8d25adb3d5f7d189550651&ua=wc-2%2FFlutter-2.2.2%2Fandroid-SKQ1.211019.001+test-keys%2Fandroid&origin=com.example.voter_booth
I/flutter (31666): [ExplorerService] init()
I/flutter (31666): [ExplorerService] init()
D/InputMethodManager(31666): showSoftInput() view=io.flutter.embedding.android.FlutterView{7c12d43 VFE...... .F....ID 0,0-1080,2356 #1 aid=1073741824} flags=0 reason=SHOW_SOFT_INPUT
I/OpenGLRenderer(31666): Davey! duration=31987ms; Flags=0, FrameTimelineVsyncId=-1, IntendedVsync=33418262754178, Vsync=33418262760584, InputEventId=0, HandleInputStart=33418262786886, AnimationStart=33418262790480, PerformTraversalsStart=33418262793344, DrawStart=33418271659490, FrameDeadline=-9223372036838109143, FrameInterval=33418262760584, FrameStartTime=16666666, SyncQueued=33418271940584, SyncStart=33418271980844, IssueDrawCommandsStart=33418272017980, SwapBuffers=33418273226001, FrameCompleted=33450250130468, DequeueBufferDuration=639895, QueueBufferDuration=1027343, GpuCompleted=33450250130468, SwapBuffersCompleted=33418274636417, DisplayPresentTime=0, 
D/InputConnectionAdaptor(31666): The input method toggled cursor monitoring on
D/InsetsController(31666): show(ime(), fromIme=true)
I/flutter (31666): [ExplorerService] _fetchListings() https://api.web3modal.com/getWallets?page=1&entries=1&include=c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96&platform=android {page: 1, entries: 1, include: c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96, platform: android}
I/flutter (31666): [ExplorerService] _fetchListings() https://api.web3modal.com/getWallets?page=1&entries=1&include=c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96&platform=android {page: 1, entries: 1, include: c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96, platform: android}
I/flutter (31666): [ExplorerService] _fetchListings() https://api.web3modal.com/getWallets?page=1&entries=48&include=c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96&exclude=4622a2b2d6af1c9844944291e5e7351a6aa24cd7b23099efac1b2fd875da31a0%2Cfd20dc426fb37566d803205b19bbc1d4096b248ac04548e3cfb6b3a38bd033aa%2Cc57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96&platform=android {page: 1, entries: 48, include: c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96, exclude: 4622a2b2d6af1c9844944291e5e7351a6aa24cd7b23099efac1b2fd875da31a0,fd20dc426fb37566d803205b19bbc1d4096b248ac04548e3cfb6b3a38bd033aa,c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96, platform: android}
I/flutter (31666): [ExplorerService] _fetchListings() https://api.web3modal.com/getWallets?page=1&entries=48&include=c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96&exclude=4622a2b2d6af1c9844944291e5e7351a6aa24cd7b23099efac1b2fd875da31a0%2Cfd20dc426fb37566d803205b19bbc1d4096b248ac04548e3cfb6b3a38bd033aa%2Cc57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96&platform=android {page: 1, entries: 48, include: c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96, exclude: 4622a2b2d6af1c9844944291e5e7351a6aa24cd7b23099efac1b2fd875da31a0,fd20dc426fb37566d803205b19bbc1d4096b248ac04548e3cfb6b3a38bd033aa,c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96, platform: android}
I/flutter (31666): [ExplorerService] _updateRecentWalletId c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96 {listing: {id: c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96, name: MetaMask, homepage: https://metamask.io/, image_id: 5195e9db-94d8-4579-6f11-ef553be95100, order: 10, mobile_link: metamask://, desktop_link: null, webapp_link: null, app_store: https://apps.apple.com/us/app/metamask/id1438144202, play_store: https://play.google.com/store/apps/details?id=io.metamask, rdns: io.metamask, injected: [{namespace: eip155, injected_id: isMetaMask}]}, installed: true, recent: true}
I/flutter (31666): [ExplorerService] _updateRecentWalletId c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96 {listing: {id: c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96, name: MetaMask, homepage: https://metamask.io/, image_id: 5195e9db-94d8-4579-6f11-ef553be95100, order: 10, mobile_link: metamask://, desktop_link: null, webapp_link: null, app_store: https://apps.apple.com/us/app/metamask/id1438144202, play_store: https://play.google.com/store/apps/details?id=io.metamask, rdns: io.metamask, injected: [{namespace: eip155, injected_id: isMetaMask}]}, installed: true, recent: true}
I/flutter (31666): [ExplorerService] init() done
I/flutter (31666): [ExplorerService] init() done
I/flutter (31666): [W3MService] set chain eip155:11155111
I/flutter (31666): [W3MService] set chain eip155:11155111
I/flutter (31666): [W3MService] initialized
I/flutter (31666): [W3MService] initialized
I/flutter (31666): [W3MService] _loadAccountData
I/flutter (31666): [W3MService] _loadAccountData
D/InputMethodManager(31666): showSoftInput() view=io.flutter.embedding.android.FlutterView{7c12d43 VFE...... .F...... 0,0-1080,2356 #1 aid=1073741824} flags=0 reason=SHOW_SOFT_INPUT
D/InsetsController(31666): show(ime(), fromIme=true)
D/InputMethodManager(31666): showSoftInput() view=io.flutter.embedding.android.FlutterView{7c12d43 VFE...... .F...... 0,0-1080,2356 #1 aid=1073741824} flags=0 reason=SHOW_SOFT_INPUT
D/InsetsController(31666): show(ime(), fromIme=true)
D/InputMethodManager(31666): showSoftInput() view=io.flutter.embedding.android.FlutterView{7c12d43 VFE...... .F...... 0,0-1080,2356 #1 aid=1073741824} flags=0 reason=SHOW_SOFT_INPUT
D/InsetsController(31666): show(ime(), fromIme=true)
D/InputMethodManager(31666): showSoftInput() view=io.flutter.embedding.android.FlutterView{7c12d43 VFE...... .F...... 0,0-1080,2356 #1 aid=1073741824} flags=0 reason=SHOW_SOFT_INPUT
D/InsetsController(31666): show(ime(), fromIme=true)
D/InputMethodManager(31666): showSoftInput() view=io.flutter.embedding.android.FlutterView{7c12d43 VFE...... .F...... 0,0-1080,2356 #1 aid=1073741824} flags=0 reason=SHOW_SOFT_INPUT
D/InsetsController(31666): show(ime(), fromIme=true)
D/InputMethodManager(31666): showSoftInput() view=io.flutter.embedding.android.FlutterView{7c12d43 VFE...... .F...... 0,0-1080,2356 #1 aid=1073741824} flags=0 reason=SHOW_SOFT_INPUT
D/InsetsController(31666): show(ime(), fromIme=true)
D/InputMethodManager(31666): showSoftInput() view=io.flutter.embedding.android.FlutterView{7c12d43 VFE...... .F...... 0,0-1080,2356 #1 aid=1073741824} flags=0 reason=SHOW_SOFT_INPUT
D/InsetsController(31666): show(ime(), fromIme=true)
D/InputMethodManager(31666): showSoftInput() view=io.flutter.embedding.android.FlutterView{7c12d43 VFE...... .F...... 0,0-1080,2356 #1 aid=1073741824} flags=0 reason=SHOW_SOFT_INPUT
D/InsetsController(31666): show(ime(), fromIme=true)
D/InputMethodManager(31666): showSoftInput() view=io.flutter.embedding.android.FlutterView{7c12d43 VFE...... .F...... 0,0-1080,2356 #1 aid=1073741824} flags=0 reason=SHOW_SOFT_INPUT
D/InsetsController(31666): show(ime(), fromIme=true)
D/InputMethodManager(31666): showSoftInput() view=io.flutter.embedding.android.FlutterView{7c12d43 VFE...... .F...... 0,0-1080,2356 #1 aid=1073741824} flags=0 reason=SHOW_SOFT_INPUT
D/InsetsController(31666): show(ime(), fromIme=true)
I/flutter (31666): [W3MService] account data laoded
I/flutter (31666): [W3MService] account data laoded
D/InputMethodManager(31666): showSoftInput() view=io.flutter.embedding.android.FlutterView{7c12d43 VFE...... .F...... 0,0-1080,2356 #1 aid=1073741824} flags=0 reason=SHOW_SOFT_INPUT
D/InputConnectionAdaptor(31666): The input method toggled cursor monitoring on
D/InputConnectionAdaptor(31666): The input method toggled cursor monitoring off
D/InputConnectionAdaptor(31666): The input method toggled cursor monitoring on
D/InsetsController(31666): show(ime(), fromIme=true)
D/InsetsController(31666): show(ime(), fromIme=true)
D/InputMethodManager(31666): showSoftInput() view=io.flutter.embedding.android.FlutterView{7c12d43 VFE...... .F...... 0,0-1080,2356 #1 aid=1073741824} flags=0 reason=SHOW_SOFT_INPUT
D/InsetsController(31666): show(ime(), fromIme=true)
D/InputMethodManager(31666): showSoftInput() view=io.flutter.embedding.android.FlutterView{7c12d43 VFE...... .F...... 0,0-1080,2356 #1 aid=1073741824} flags=0 reason=SHOW_SOFT_INPUT
D/InputConnectionAdaptor(31666): The input method toggled cursor monitoring on
D/InputConnectionAdaptor(31666): The input method toggled cursor monitoring off
D/InputConnectionAdaptor(31666): The input method toggled cursor monitoring on
D/InsetsController(31666): show(ime(), fromIme=true)
D/InsetsController(31666): show(ime(), fromIme=true)
D/InputMethodManager(31666): showSoftInput() view=io.flutter.embedding.android.FlutterView{7c12d43 VFE...... .F...... 0,0-1080,2356 #1 aid=1073741824} flags=0 reason=SHOW_SOFT_INPUT
D/InsetsController(31666): show(ime(), fromIme=true)
D/InputMethodManager(31666): showSoftInput() view=io.flutter.embedding.android.FlutterView{7c12d43 VFE...... .F...... 0,0-1080,2356 #1 aid=1073741824} flags=0 reason=SHOW_SOFT_INPUT
D/InsetsController(31666): show(ime(), fromIme=true)
D/InputMethodManager(31666): showSoftInput() view=io.flutter.embedding.android.FlutterView{7c12d43 VFE...... .F...... 0,0-1080,2356 #1 aid=1073741824} flags=0 reason=SHOW_SOFT_INPUT
D/InputConnectionAdaptor(31666): The input method toggled cursor monitoring on
D/InputConnectionAdaptor(31666): The input method toggled cursor monitoring off
D/InputConnectionAdaptor(31666): The input method toggled cursor monitoring on
D/InsetsController(31666): show(ime(), fromIme=true)
D/InsetsController(31666): show(ime(), fromIme=true)
D/InputMethodManager(31666): showSoftInput() view=io.flutter.embedding.android.FlutterView{7c12d43 VFE...... .F...... 0,0-1080,2356 #1 aid=1073741824} flags=0 reason=SHOW_SOFT_INPUT
D/InsetsController(31666): show(ime(), fromIme=true)
D/InputMethodManager(31666): showSoftInput() view=io.flutter.embedding.android.FlutterView{7c12d43 VFE...... .F...... 0,0-1080,2356 #1 aid=1073741824} flags=0 reason=SHOW_SOFT_INPUT
D/InsetsController(31666): show(ime(), fromIme=true)
D/InputMethodManager(31666): showSoftInput() view=io.flutter.embedding.android.FlutterView{7c12d43 VFE...... .F...... 0,0-1080,2356 #1 aid=1073741824} flags=0 reason=SHOW_SOFT_INPUT
D/InsetsController(31666): show(ime(), fromIme=true)
D/InputMethodManager(31666): showSoftInput() view=io.flutter.embedding.android.FlutterView{7c12d43 VFE...... .F...... 0,0-1080,2356 #1 aid=1073741824} flags=0 reason=SHOW_SOFT_INPUT
D/InsetsController(31666): show(ime(), fromIme=true)
I/flutter (31666): _w3mService: Instance of 'W3MService'
I/flutter (31666): [CoreUtils] Encoded WC URL: metamask%3A%2F%2F
I/flutter (31666): [CoreUtils] Encoded WC URL: metamask%3A%2F%2F
I/flutter (31666): Session: Instance of 'W3MSession'
I/flutter (31666): Error calling write function: Null check operator used on a null value
D/DecorView[](31666): onWindowFocusChanged hasWindowFocus false
I/FA      (31666): Application backgrounded at: timestamp_millis: 1713580401504
Application finished.

Here is the video of the application:

https://github.com/WalletConnect/Web3ModalFlutter/assets/135817498/5af756db-4cd7-41ee-9683-ce699c8d332b

quetool commented 4 weeks ago

Hello @sethitanay ! Thanks for the detailed response. Btw, if you use dependency_overrides

dependency_overrides:
   walletconnect_flutter_v2: 2.2.2

You don't need to add the same dependency in main dependencies This is what you need:

dependencies:
   web3modal_flutter: ^3.1.2

dependency_overrides:
   walletconnect_flutter_v2: 2.2.2

That being said, do you see the same issues with other wallets? I can't not help to much without the ABI file and the contract address but I see Error calling write function: Null check operator used on a null value so I would say you are missing the from value in your Transaction. Can you try this?

await _w3mService.requestWriteContract(
  topic: _w3mService.session!.topic.toString(),
  chainId: 'eip155:11155111',
  rpcUrl:
      'https://eth-sepolia.g.alchemy.com/v2/Is7xCCuFmVXsJ1RvScVGEiCMggxETN7U',
  deployedContract: deployedContract,
  functionName: 'authorizeVoter',
  parameters: [
    addressController.text,
    nameController.text,
    ageController.text,
    genderController.text
  ],
  transaction: Transaction(
    from: EthereumAddress.fromHex(_w3mService.session!.address!),
  ),
);
sethitanay commented 4 weeks ago

I did the changes as suggested by you but still my problem is not solved.

abi.json:

abi.json.txt

contract address: 0xe391ddD24b24eC381347406AB7F16e1a6359Ae10 Error:

D/DecorView[](19347): getWindowModeFromSystem  windowmode is 1
D/DecorView[](19347): updateDecorCaptionStatus displayWindowDecor is false
I/flutter (19347): RelayClient Internal: Connecting to relay
I/flutter (19347): RelayClient Internal: Disconnecting from relay
I/flutter (19347): Signed JWT: eyJhbGciOiJFZERTQSIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJkaWQ6a2V5Ono2TWtpTURBQjhDOEhaY003Z1VTUDRXU0c5M1lmZ3dtNFNvUFltMUcyMjF2UnFQVCIsInN1YiI6ImUzMWI1ZGMxYTJhMzk5NTE1NmM4OTJmYjAzNWNiM2Y1NDM2ZGMyOGE4OTJmMDY2NWM0YjFhMWZhZTJjNDc2ZDMiLCJhdWQiOiJ3c3M6Ly9yZWxheS53YWxsZXRjb25uZWN0LmNvbSIsImlhdCI6MTcxMzcwMjQ5OCwiZXhwIjoxNzEzNzg4ODk4fQ.cYQ_DHCo7UBx7KuSasYIEM7krb0bv2JnssJW-A37-O-dCryLA28u8v55w3Qx_ahVS847AUFa9bvtecekpnceAg
I/flutter (19347): Initializing WebSocket with wss://relay.walletconnect.com?auth=eyJhbGciOiJFZERTQSIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJkaWQ6a2V5Ono2TWtpTURBQjhDOEhaY003Z1VTUDRXU0c5M1lmZ3dtNFNvUFltMUcyMjF2UnFQVCIsInN1YiI6ImUzMWI1ZGMxYTJhMzk5NTE1NmM4OTJmYjAzNWNiM2Y1NDM2ZGMyOGE4OTJmMDY2NWM0YjFhMWZhZTJjNDc2ZDMiLCJhdWQiOiJ3c3M6Ly9yZWxheS53YWxsZXRjb25uZWN0LmNvbSIsImlhdCI6MTcxMzcwMjQ5OCwiZXhwIjoxNzEzNzg4ODk4fQ.cYQ_DHCo7UBx7KuSasYIEM7krb0bv2JnssJW-A37-O-dCryLA28u8v55w3Qx_ahVS847AUFa9bvtecekpnceAg&projectId=001b66692e8d25adb3d5f7d189550651&ua=wc-2%2FFlutter-2.2.2%2Fandroid-SKQ1.211019.001+test-keys%2Fandroid&origin=com.example.voter_booth
I/flutter (19347): [ExplorerService] init()
I/flutter (19347): RelayClient Internal: Connecting to relay
I/flutter (19347): RelayClient Internal: Connecting to relay
I/flutter (19347): RelayClient Internal: Disconnecting from relay
I/flutter (19347): RelayClient Internal: Disconnecting from relay
I/flutter (19347): Signed JWT: eyJhbGciOiJFZERTQSIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJkaWQ6a2V5Ono2TWtpTURBQjhDOEhaY003Z1VTUDRXU0c5M1lmZ3dtNFNvUFltMUcyMjF2UnFQVCIsInN1YiI6IjY4NjRmYThlNDRiYjE1Y2UzNzUyMGM3NjljODUwNDk0YTU1YTA5NDc1MTY3NTg5ZDRkNmJjZGZkM2Q3YjMxNDAiLCJhdWQiOiJ3c3M6Ly9yZWxheS53YWxsZXRjb25uZWN0LmNvbSIsImlhdCI6MTcxMzcwMjUwMCwiZXhwIjoxNzEzNzg4OTAwfQ.o0CIWsY85sFH6AKg2Gm6fYl-OeOhPDdLkqD50GEy8IVU0yPlRiriL6e7YQxRv6bszKSSABaq-yeUbl6gzTJiDQ
I/flutter (19347): Signed JWT: eyJhbGciOiJFZERTQSIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJkaWQ6a2V5Ono2TWtpTURBQjhDOEhaY003Z1VTUDRXU0c5M1lmZ3dtNFNvUFltMUcyMjF2UnFQVCIsInN1YiI6IjY4NjRmYThlNDRiYjE1Y2UzNzUyMGM3NjljODUwNDk0YTU1YTA5NDc1MTY3NTg5ZDRkNmJjZGZkM2Q3YjMxNDAiLCJhdWQiOiJ3c3M6Ly9yZWxheS53YWxsZXRjb25uZWN0LmNvbSIsImlhdCI6MTcxMzcwMjUwMCwiZXhwIjoxNzEzNzg4OTAwfQ.o0CIWsY85sFH6AKg2Gm6fYl-OeOhPDdLkqD50GEy8IVU0yPlRiriL6e7YQxRv6bszKSSABaq-yeUbl6gzTJiDQ
I/flutter (19347): Initializing WebSocket with wss://relay.walletconnect.com?auth=eyJhbGciOiJFZERTQSIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJkaWQ6a2V5Ono2TWtpTURBQjhDOEhaY003Z1VTUDRXU0c5M1lmZ3dtNFNvUFltMUcyMjF2UnFQVCIsInN1YiI6IjY4NjRmYThlNDRiYjE1Y2UzNzUyMGM3NjljODUwNDk0YTU1YTA5NDc1MTY3NTg5ZDRkNmJjZGZkM2Q3YjMxNDAiLCJhdWQiOiJ3c3M6Ly9yZWxheS53YWxsZXRjb25uZWN0LmNvbSIsImlhdCI6MTcxMzcwMjUwMCwiZXhwIjoxNzEzNzg4OTAwfQ.o0CIWsY85sFH6AKg2Gm6fYl-OeOhPDdLkqD50GEy8IVU0yPlRiriL6e7YQxRv6bszKSSABaq-yeUbl6gzTJiDQ&projectId=001b66692e8d25adb3d5f7d189550651&ua=wc-2%2FFlutter-2.2.2%2Fandroid-SKQ1.211019.001+test-keys%2Fandroid&origin=com.example.voter_booth
I/flutter (19347): Initializing WebSocket with wss://relay.walletconnect.com?auth=eyJhbGciOiJFZERTQSIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJkaWQ6a2V5Ono2TWtpTURBQjhDOEhaY003Z1VTUDRXU0c5M1lmZ3dtNFNvUFltMUcyMjF2UnFQVCIsInN1YiI6IjY4NjRmYThlNDRiYjE1Y2UzNzUyMGM3NjljODUwNDk0YTU1YTA5NDc1MTY3NTg5ZDRkNmJjZGZkM2Q3YjMxNDAiLCJhdWQiOiJ3c3M6Ly9yZWxheS53YWxsZXRjb25uZWN0LmNvbSIsImlhdCI6MTcxMzcwMjUwMCwiZXhwIjoxNzEzNzg4OTAwfQ.o0CIWsY85sFH6AKg2Gm6fYl-OeOhPDdLkqD50GEy8IVU0yPlRiriL6e7YQxRv6bszKSSABaq-yeUbl6gzTJiDQ&projectId=001b66692e8d25adb3d5f7d189550651&ua=wc-2%2FFlutter-2.2.2%2Fandroid-SKQ1.211019.001+test-keys%2Fandroid&origin=com.example.voter_booth
I/flutter (19347): [ExplorerService] init()
I/flutter (19347): [ExplorerService] init()
I/flutter (19347): [ExplorerService] _fetchListings() https://api.web3modal.com/getWallets?page=1&entries=1&include=c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96&platform=android {page: 1, entries: 1, include: c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96, platform: android}
I/flutter (19347): [ExplorerService] _fetchListings() https://api.web3modal.com/getWallets?page=1&entries=1&include=c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96&platform=android {page: 1, entries: 1, include: c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96, platform: android}
I/flutter (19347): [ExplorerService] _fetchListings() https://api.web3modal.com/getWallets?page=1&entries=48&include=c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96&exclude=4622a2b2d6af1c9844944291e5e7351a6aa24cd7b23099efac1b2fd875da31a0%2Cfd20dc426fb37566d803205b19bbc1d4096b248ac04548e3cfb6b3a38bd033aa%2Cc57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96&platform=android {page: 1, entries: 48, include: c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96, exclude: 4622a2b2d6af1c9844944291e5e7351a6aa24cd7b23099efac1b2fd875da31a0,fd20dc426fb37566d803205b19bbc1d4096b248ac04548e3cfb6b3a38bd033aa,c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96, platform: android}
I/flutter (19347): [ExplorerService] _fetchListings() https://api.web3modal.com/getWallets?page=1&entries=48&include=c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96&exclude=4622a2b2d6af1c9844944291e5e7351a6aa24cd7b23099efac1b2fd875da31a0%2Cfd20dc426fb37566d803205b19bbc1d4096b248ac04548e3cfb6b3a38bd033aa%2Cc57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96&platform=android {page: 1, entries: 48, include: c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96, exclude: 4622a2b2d6af1c9844944291e5e7351a6aa24cd7b23099efac1b2fd875da31a0,fd20dc426fb37566d803205b19bbc1d4096b248ac04548e3cfb6b3a38bd033aa,c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96, platform: android}
I/flutter (19347): [ExplorerService] _updateRecentWalletId c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96 {listing: {id: c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96, name: MetaMask, homepage: https://metamask.io/, image_id: 5195e9db-94d8-4579-6f11-ef553be95100, order: 10, mobile_link: metamask://, desktop_link: null, webapp_link: null, app_store: https://apps.apple.com/us/app/metamask/id1438144202, play_store: https://play.google.com/store/apps/details?id=io.metamask, rdns: io.metamask, injected: [{namespace: eip155, injected_id: isMetaMask}]}, installed: true, recent: false}
I/flutter (19347): [ExplorerService] _updateRecentWalletId c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96 {listing: {id: c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96, name: MetaMask, homepage: https://metamask.io/, image_id: 5195e9db-94d8-4579-6f11-ef553be95100, order: 10, mobile_link: metamask://, desktop_link: null, webapp_link: null, app_store: https://apps.apple.com/us/app/metamask/id1438144202, play_store: https://play.google.com/store/apps/details?id=io.metamask, rdns: io.metamask, injected: [{namespace: eip155, injected_id: isMetaMask}]}, installed: true, recent: false}
I/flutter (19347): [ExplorerService] init() done
I/flutter (19347): [ExplorerService] init() done
I/flutter (19347): [W3MService] set chain eip155:11155111
I/flutter (19347): [W3MService] set chain eip155:11155111
I/flutter (19347): [W3MService] initialized
I/flutter (19347): [W3MService] initialized
I/flutter (19347): [W3MService] _loadAccountData
I/flutter (19347): [W3MService] _loadAccountData
I/flutter (19347): [ExplorerService] _fetchListings() https://api.web3modal.com/getWallets?page=1&entries=1&include=c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96&platform=android {page: 1, entries: 1, include: c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96, platform: android}
I/flutter (19347): [ExplorerService] _fetchListings() https://api.web3modal.com/getWallets?page=1&entries=1&include=c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96&platform=android {page: 1, entries: 1, include: c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96, platform: android}
I/flutter (19347): [ExplorerService] _fetchListings() https://api.web3modal.com/getWallets?page=1&entries=48&include=c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96&exclude=4622a2b2d6af1c9844944291e5e7351a6aa24cd7b23099efac1b2fd875da31a0%2Cfd20dc426fb37566d803205b19bbc1d4096b248ac04548e3cfb6b3a38bd033aa%2Cc57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96&platform=android {page: 1, entries: 48, include: c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96, exclude: 4622a2b2d6af1c9844944291e5e7351a6aa24cd7b23099efac1b2fd875da31a0,fd20dc426fb37566d803205b19bbc1d4096b248ac04548e3cfb6b3a38bd033aa,c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96, platform: android}
I/flutter (19347): [ExplorerService] _fetchListings() https://api.web3modal.com/getWallets?page=1&entries=48&include=c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96&exclude=4622a2b2d6af1c9844944291e5e7351a6aa24cd7b23099efac1b2fd875da31a0%2Cfd20dc426fb37566d803205b19bbc1d4096b248ac04548e3cfb6b3a38bd033aa%2Cc57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96&platform=android {page: 1, entries: 48, include: c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96, exclude: 4622a2b2d6af1c9844944291e5e7351a6aa24cd7b23099efac1b2fd875da31a0,fd20dc426fb37566d803205b19bbc1d4096b248ac04548e3cfb6b3a38bd033aa,c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96, platform: android}
I/flutter (19347): [ExplorerService] _updateRecentWalletId c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96 {listing: {id: c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96, name: MetaMask, homepage: https://metamask.io/, image_id: 5195e9db-94d8-4579-6f11-ef553be95100, order: 10, mobile_link: metamask://, desktop_link: null, webapp_link: null, app_store: https://apps.apple.com/us/app/metamask/id1438144202, play_store: https://play.google.com/store/apps/details?id=io.metamask, rdns: io.metamask, injected: [{namespace: eip155, injected_id: isMetaMask}]}, installed: true, recent: false}
I/flutter (19347): [ExplorerService] _updateRecentWalletId c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96 {listing: {id: c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96, name: MetaMask, homepage: https://metamask.io/, image_id: 5195e9db-94d8-4579-6f11-ef553be95100, order: 10, mobile_link: metamask://, desktop_link: null, webapp_link: null, app_store: https://apps.apple.com/us/app/metamask/id1438144202, play_store: https://play.google.com/store/apps/details?id=io.metamask, rdns: io.metamask, injected: [{namespace: eip155, injected_id: isMetaMask}]}, installed: true, recent: false}
I/flutter (19347): [ExplorerService] init() done
I/flutter (19347): [ExplorerService] init() done
I/flutter (19347): [W3MService] set chain eip155:11155111
I/flutter (19347): [W3MService] set chain eip155:11155111
I/flutter (19347): [W3MService] initialized
I/flutter (19347): [W3MService] initialized
I/flutter (19347): [W3MService] _loadAccountData
I/flutter (19347): [W3MService] _loadAccountData
I/flutter (19347): [W3MService] account data laoded
I/flutter (19347): [W3MService] account data laoded
I/flutter (19347): [W3MService] account data laoded
I/flutter (19347): [W3MService] account data laoded
W/FirebaseAuth(19347): [SmsRetrieverHelper] Timed out waiting for SMS.
I/flutter (19347): RelayClient Internal: Connecting to relay
I/flutter (19347): RelayClient Internal: Connecting to relay
I/flutter (19347): RelayClient Internal: Connecting to relay
I/flutter (19347): RelayClient Internal: Disconnecting from relay
I/flutter (19347): RelayClient Internal: Disconnecting from relay
I/flutter (19347): RelayClient Internal: Disconnecting from relay
I/flutter (19347): Signed JWT: eyJhbGciOiJFZERTQSIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJkaWQ6a2V5Ono2TWtpTURBQjhDOEhaY003Z1VTUDRXU0c5M1lmZ3dtNFNvUFltMUcyMjF2UnFQVCIsInN1YiI6IjlhNDgzNDQyMGUwMjllNzgyZTRhYWQ2NDg1MDc4OGI4YTg5MGY0MGYyNzMwZjY2N2JiMTEzMzI4YThmYWUwMjIiLCJhdWQiOiJ3c3M6Ly9yZWxheS53YWxsZXRjb25uZWN0LmNvbSIsImlhdCI6MTcxMzcwMjUwNiwiZXhwIjoxNzEzNzg4OTA2fQ.BtO4tLuYbUBfhl4mxYCoPBSHsoDS_qw0pcnCLGsKfX_YWw58aCzYGt1U7GZyhB6KUdSJamOULDdLHt69vhM4BA
I/flutter (19347): Signed JWT: eyJhbGciOiJFZERTQSIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJkaWQ6a2V5Ono2TWtpTURBQjhDOEhaY003Z1VTUDRXU0c5M1lmZ3dtNFNvUFltMUcyMjF2UnFQVCIsInN1YiI6IjlhNDgzNDQyMGUwMjllNzgyZTRhYWQ2NDg1MDc4OGI4YTg5MGY0MGYyNzMwZjY2N2JiMTEzMzI4YThmYWUwMjIiLCJhdWQiOiJ3c3M6Ly9yZWxheS53YWxsZXRjb25uZWN0LmNvbSIsImlhdCI6MTcxMzcwMjUwNiwiZXhwIjoxNzEzNzg4OTA2fQ.BtO4tLuYbUBfhl4mxYCoPBSHsoDS_qw0pcnCLGsKfX_YWw58aCzYGt1U7GZyhB6KUdSJamOULDdLHt69vhM4BA
I/flutter (19347): Signed JWT: eyJhbGciOiJFZERTQSIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJkaWQ6a2V5Ono2TWtpTURBQjhDOEhaY003Z1VTUDRXU0c5M1lmZ3dtNFNvUFltMUcyMjF2UnFQVCIsInN1YiI6IjlhNDgzNDQyMGUwMjllNzgyZTRhYWQ2NDg1MDc4OGI4YTg5MGY0MGYyNzMwZjY2N2JiMTEzMzI4YThmYWUwMjIiLCJhdWQiOiJ3c3M6Ly9yZWxheS53YWxsZXRjb25uZWN0LmNvbSIsImlhdCI6MTcxMzcwMjUwNiwiZXhwIjoxNzEzNzg4OTA2fQ.BtO4tLuYbUBfhl4mxYCoPBSHsoDS_qw0pcnCLGsKfX_YWw58aCzYGt1U7GZyhB6KUdSJamOULDdLHt69vhM4BA
I/flutter (19347): Initializing WebSocket with wss://relay.walletconnect.com?auth=eyJhbGciOiJFZERTQSIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJkaWQ6a2V5Ono2TWtpTURBQjhDOEhaY003Z1VTUDRXU0c5M1lmZ3dtNFNvUFltMUcyMjF2UnFQVCIsInN1YiI6IjlhNDgzNDQyMGUwMjllNzgyZTRhYWQ2NDg1MDc4OGI4YTg5MGY0MGYyNzMwZjY2N2JiMTEzMzI4YThmYWUwMjIiLCJhdWQiOiJ3c3M6Ly9yZWxheS53YWxsZXRjb25uZWN0LmNvbSIsImlhdCI6MTcxMzcwMjUwNiwiZXhwIjoxNzEzNzg4OTA2fQ.BtO4tLuYbUBfhl4mxYCoPBSHsoDS_qw0pcnCLGsKfX_YWw58aCzYGt1U7GZyhB6KUdSJamOULDdLHt69vhM4BA&projectId=001b66692e8d25adb3d5f7d189550651&ua=wc-2%2FFlutter-2.2.2%2Fandroid-SKQ1.211019.001+test-keys%2Fandroid&origin=com.example.voter_booth
I/flutter (19347): Initializing WebSocket with wss://relay.walletconnect.com?auth=eyJhbGciOiJFZERTQSIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJkaWQ6a2V5Ono2TWtpTURBQjhDOEhaY003Z1VTUDRXU0c5M1lmZ3dtNFNvUFltMUcyMjF2UnFQVCIsInN1YiI6IjlhNDgzNDQyMGUwMjllNzgyZTRhYWQ2NDg1MDc4OGI4YTg5MGY0MGYyNzMwZjY2N2JiMTEzMzI4YThmYWUwMjIiLCJhdWQiOiJ3c3M6Ly9yZWxheS53YWxsZXRjb25uZWN0LmNvbSIsImlhdCI6MTcxMzcwMjUwNiwiZXhwIjoxNzEzNzg4OTA2fQ.BtO4tLuYbUBfhl4mxYCoPBSHsoDS_qw0pcnCLGsKfX_YWw58aCzYGt1U7GZyhB6KUdSJamOULDdLHt69vhM4BA&projectId=001b66692e8d25adb3d5f7d189550651&ua=wc-2%2FFlutter-2.2.2%2Fandroid-SKQ1.211019.001+test-keys%2Fandroid&origin=com.example.voter_booth
I/flutter (19347): Initializing WebSocket with wss://relay.walletconnect.com?auth=eyJhbGciOiJFZERTQSIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJkaWQ6a2V5Ono2TWtpTURBQjhDOEhaY003Z1VTUDRXU0c5M1lmZ3dtNFNvUFltMUcyMjF2UnFQVCIsInN1YiI6IjlhNDgzNDQyMGUwMjllNzgyZTRhYWQ2NDg1MDc4OGI4YTg5MGY0MGYyNzMwZjY2N2JiMTEzMzI4YThmYWUwMjIiLCJhdWQiOiJ3c3M6Ly9yZWxheS53YWxsZXRjb25uZWN0LmNvbSIsImlhdCI6MTcxMzcwMjUwNiwiZXhwIjoxNzEzNzg4OTA2fQ.BtO4tLuYbUBfhl4mxYCoPBSHsoDS_qw0pcnCLGsKfX_YWw58aCzYGt1U7GZyhB6KUdSJamOULDdLHt69vhM4BA&projectId=001b66692e8d25adb3d5f7d189550651&ua=wc-2%2FFlutter-2.2.2%2Fandroid-SKQ1.211019.001+test-keys%2Fandroid&origin=com.example.voter_booth
I/flutter (19347): [ExplorerService] init()
I/flutter (19347): [ExplorerService] init()
I/flutter (19347): [ExplorerService] init()
D/InputMethodManager(19347): showSoftInput() view=io.flutter.embedding.android.FlutterView{36a7ea0 VFE...... .F...... 0,0-1080,2356 #1 aid=1073741824} flags=0 reason=SHOW_SOFT_INPUT
D/InputConnectionAdaptor(19347): The input method toggled cursor monitoring on
D/InsetsController(19347): show(ime(), fromIme=true)
D/InputMethodManager(19347): showSoftInput() view=io.flutter.embedding.android.FlutterView{36a7ea0 VFE...... .F...... 0,0-1080,2356 #1 aid=1073741824} flags=0 reason=SHOW_SOFT_INPUT
D/InsetsController(19347): show(ime(), fromIme=true)
I/flutter (19347): [ExplorerService] _fetchListings() https://api.web3modal.com/getWallets?page=1&entries=1&include=c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96&platform=android {page: 1, entries: 1, include: c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96, platform: android}
I/flutter (19347): [ExplorerService] _fetchListings() https://api.web3modal.com/getWallets?page=1&entries=1&include=c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96&platform=android {page: 1, entries: 1, include: c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96, platform: android}
I/flutter (19347): [ExplorerService] _fetchListings() https://api.web3modal.com/getWallets?page=1&entries=1&include=c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96&platform=android {page: 1, entries: 1, include: c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96, platform: android}
D/InputMethodManager(19347): showSoftInput() view=io.flutter.embedding.android.FlutterView{36a7ea0 VFE...... .F...... 0,0-1080,2356 #1 aid=1073741824} flags=0 reason=SHOW_SOFT_INPUT
D/InsetsController(19347): show(ime(), fromIme=true)
D/InputMethodManager(19347): showSoftInput() view=io.flutter.embedding.android.FlutterView{36a7ea0 VFE...... .F...... 0,0-1080,2356 #1 aid=1073741824} flags=0 reason=SHOW_SOFT_INPUT
D/InsetsController(19347): show(ime(), fromIme=true)
I/flutter (19347): [ExplorerService] _fetchListings() https://api.web3modal.com/getWallets?page=1&entries=48&include=c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96&exclude=4622a2b2d6af1c9844944291e5e7351a6aa24cd7b23099efac1b2fd875da31a0%2Cfd20dc426fb37566d803205b19bbc1d4096b248ac04548e3cfb6b3a38bd033aa%2Cc57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96&platform=android {page: 1, entries: 48, include: c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96, exclude: 4622a2b2d6af1c9844944291e5e7351a6aa24cd7b23099efac1b2fd875da31a0,fd20dc426fb37566d803205b19bbc1d4096b248ac04548e3cfb6b3a38bd033aa,c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96, platform: android}
I/flutter (19347): [ExplorerService] _fetchListings() https://api.web3modal.com/getWallets?page=1&entries=48&include=c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96&exclude=4622a2b2d6af1c9844944291e5e7351a6aa24cd7b23099efac1b2fd875da31a0%2Cfd20dc426fb37566d803205b19bbc1d4096b248ac04548e3cfb6b3a38bd033aa%2Cc57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96&platform=android {page: 1, entries: 48, include: c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96, exclude: 4622a2b2d6af1c9844944291e5e7351a6aa24cd7b23099efac1b2fd875da31a0,fd20dc426fb37566d803205b19bbc1d4096b248ac04548e3cfb6b3a38bd033aa,c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96, platform: android}
I/flutter (19347): [ExplorerService] _fetchListings() https://api.web3modal.com/getWallets?page=1&entries=48&include=c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96&exclude=4622a2b2d6af1c9844944291e5e7351a6aa24cd7b23099efac1b2fd875da31a0%2Cfd20dc426fb37566d803205b19bbc1d4096b248ac04548e3cfb6b3a38bd033aa%2Cc57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96&platform=android {page: 1, entries: 48, include: c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96, exclude: 4622a2b2d6af1c9844944291e5e7351a6aa24cd7b23099efac1b2fd875da31a0,fd20dc426fb37566d803205b19bbc1d4096b248ac04548e3cfb6b3a38bd033aa,c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96, platform: android}
I/flutter (19347): [ExplorerService] _updateRecentWalletId c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96 {listing: {id: c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96, name: MetaMask, homepage: https://metamask.io/, image_id: 5195e9db-94d8-4579-6f11-ef553be95100, order: 10, mobile_link: metamask://, desktop_link: null, webapp_link: null, app_store: https://apps.apple.com/us/app/metamask/id1438144202, play_store: https://play.google.com/store/apps/details?id=io.metamask, rdns: io.metamask, injected: [{namespace: eip155, injected_id: isMetaMask}]}, installed: true, recent: false}
I/flutter (19347): [ExplorerService] _updateRecentWalletId c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96 {listing: {id: c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96, name: MetaMask, homepage: https://metamask.io/, image_id: 5195e9db-94d8-4579-6f11-ef553be95100, order: 10, mobile_link: metamask://, desktop_link: null, webapp_link: null, app_store: https://apps.apple.com/us/app/metamask/id1438144202, play_store: https://play.google.com/store/apps/details?id=io.metamask, rdns: io.metamask, injected: [{namespace: eip155, injected_id: isMetaMask}]}, installed: true, recent: false}
I/flutter (19347): [ExplorerService] _updateRecentWalletId c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96 {listing: {id: c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96, name: MetaMask, homepage: https://metamask.io/, image_id: 5195e9db-94d8-4579-6f11-ef553be95100, order: 10, mobile_link: metamask://, desktop_link: null, webapp_link: null, app_store: https://apps.apple.com/us/app/metamask/id1438144202, play_store: https://play.google.com/store/apps/details?id=io.metamask, rdns: io.metamask, injected: [{namespace: eip155, injected_id: isMetaMask}]}, installed: true, recent: false}
I/flutter (19347): [ExplorerService] init() done
I/flutter (19347): [ExplorerService] init() done
I/flutter (19347): [ExplorerService] init() done
I/flutter (19347): [W3MService] set chain eip155:11155111
I/flutter (19347): [W3MService] set chain eip155:11155111
I/flutter (19347): [W3MService] set chain eip155:11155111
I/flutter (19347): [W3MService] initialized
I/flutter (19347): [W3MService] initialized
I/flutter (19347): [W3MService] initialized
I/flutter (19347): [W3MService] _loadAccountData
I/flutter (19347): [W3MService] _loadAccountData
I/flutter (19347): [W3MService] _loadAccountData
D/InputMethodManager(19347): showSoftInput() view=io.flutter.embedding.android.FlutterView{36a7ea0 VFE...... .F...... 0,0-1080,2356 #1 aid=1073741824} flags=0 reason=SHOW_SOFT_INPUT
D/InsetsController(19347): show(ime(), fromIme=true)
D/InputMethodManager(19347): showSoftInput() view=io.flutter.embedding.android.FlutterView{36a7ea0 VFE...... .F...... 0,0-1080,2356 #1 aid=1073741824} flags=0 reason=SHOW_SOFT_INPUT
D/InsetsController(19347): show(ime(), fromIme=true)
D/InputMethodManager(19347): showSoftInput() view=io.flutter.embedding.android.FlutterView{36a7ea0 VFE...... .F...... 0,0-1080,2356 #1 aid=1073741824} flags=0 reason=SHOW_SOFT_INPUT
D/InsetsController(19347): show(ime(), fromIme=true)
D/InputMethodManager(19347): showSoftInput() view=io.flutter.embedding.android.FlutterView{36a7ea0 VFE...... .F...... 0,0-1080,2356 #1 aid=1073741824} flags=0 reason=SHOW_SOFT_INPUT
D/InsetsController(19347): show(ime(), fromIme=true)
D/InputMethodManager(19347): showSoftInput() view=io.flutter.embedding.android.FlutterView{36a7ea0 VFE...... .F...... 0,0-1080,2356 #1 aid=1073741824} flags=0 reason=SHOW_SOFT_INPUT
D/InputConnectionAdaptor(19347): The input method toggled cursor monitoring on
I/flutter (19347): [W3MService] account data laoded
I/flutter (19347): [W3MService] account data laoded
I/flutter (19347): [W3MService] account data laoded
D/InputConnectionAdaptor(19347): The input method toggled cursor monitoring off
D/InputConnectionAdaptor(19347): The input method toggled cursor monitoring on
D/InsetsController(19347): show(ime(), fromIme=true)
D/InsetsController(19347): show(ime(), fromIme=true)
D/InputMethodManager(19347): showSoftInput() view=io.flutter.embedding.android.FlutterView{36a7ea0 VFE...... .F...... 0,0-1080,2356 #1 aid=1073741824} flags=0 reason=SHOW_SOFT_INPUT
D/InsetsController(19347): show(ime(), fromIme=true)
D/InputMethodManager(19347): showSoftInput() view=io.flutter.embedding.android.FlutterView{36a7ea0 VFE...... .F...... 0,0-1080,2356 #1 aid=1073741824} flags=0 reason=SHOW_SOFT_INPUT
D/InsetsController(19347): show(ime(), fromIme=true)
D/InputMethodManager(19347): showSoftInput() view=io.flutter.embedding.android.FlutterView{36a7ea0 VFE...... .F...... 0,0-1080,2356 #1 aid=1073741824} flags=0 reason=SHOW_SOFT_INPUT
D/InputConnectionAdaptor(19347): The input method toggled cursor monitoring on
D/InputConnectionAdaptor(19347): The input method toggled cursor monitoring off
D/InputConnectionAdaptor(19347): The input method toggled cursor monitoring on
D/InsetsController(19347): show(ime(), fromIme=true)
D/InsetsController(19347): show(ime(), fromIme=true)
D/InputMethodManager(19347): showSoftInput() view=io.flutter.embedding.android.FlutterView{36a7ea0 VFE...... .F...... 0,0-1080,2356 #1 aid=1073741824} flags=0 reason=SHOW_SOFT_INPUT
D/InsetsController(19347): show(ime(), fromIme=true)
D/InputMethodManager(19347): showSoftInput() view=io.flutter.embedding.android.FlutterView{36a7ea0 VFE...... .F...... 0,0-1080,2356 #1 aid=1073741824} flags=0 reason=SHOW_SOFT_INPUT
D/InsetsController(19347): show(ime(), fromIme=true)
D/InputMethodManager(19347): showSoftInput() view=io.flutter.embedding.android.FlutterView{36a7ea0 VFE...... .F...... 0,0-1080,2356 #1 aid=1073741824} flags=0 reason=SHOW_SOFT_INPUT
D/InputConnectionAdaptor(19347): The input method toggled cursor monitoring on
D/InputConnectionAdaptor(19347): The input method toggled cursor monitoring off
D/InputConnectionAdaptor(19347): The input method toggled cursor monitoring on
D/InsetsController(19347): show(ime(), fromIme=true)
D/InsetsController(19347): show(ime(), fromIme=true)
D/InputMethodManager(19347): showSoftInput() view=io.flutter.embedding.android.FlutterView{36a7ea0 VFE...... .F...... 0,0-1080,2356 #1 aid=1073741824} flags=0 reason=SHOW_SOFT_INPUT
D/InsetsController(19347): show(ime(), fromIme=true)
D/InputMethodManager(19347): showSoftInput() view=io.flutter.embedding.android.FlutterView{36a7ea0 VFE...... .F...... 0,0-1080,2356 #1 aid=1073741824} flags=0 reason=SHOW_SOFT_INPUT
D/InsetsController(19347): show(ime(), fromIme=true)
D/InputMethodManager(19347): showSoftInput() view=io.flutter.embedding.android.FlutterView{36a7ea0 VFE...... .F...... 0,0-1080,2356 #1 aid=1073741824} flags=0 reason=SHOW_SOFT_INPUT
D/InsetsController(19347): show(ime(), fromIme=true)
D/InputMethodManager(19347): showSoftInput() view=io.flutter.embedding.android.FlutterView{36a7ea0 VFE...... .F...... 0,0-1080,2356 #1 aid=1073741824} flags=0 reason=SHOW_SOFT_INPUT
D/InsetsController(19347): show(ime(), fromIme=true)
I/flutter (19347): _w3mService: Instance of 'W3MService'
I/flutter (19347): [CoreUtils] Encoded WC URL: metamask%3A%2F%2F
I/flutter (19347): [CoreUtils] Encoded WC URL: metamask%3A%2F%2F
I/flutter (19347): [CoreUtils] Encoded WC URL: metamask%3A%2F%2F
I/flutter (19347): Session: Instance of 'W3MSession'
I/flutter (19347): Error calling write function: type 'String' is not a subtype of type 'EthereumAddress' of 'data'
D/DecorView[](19347): onWindowFocusChanged hasWindowFocus false
I/FA      (19347): Application backgrounded at: timestamp_millis: 1713702580898

authorizevoter.dart:

import 'package:flutter/material.dart';
import 'package:web3modal_flutter/web3modal_flutter.dart';
import 'package:flutter/services.dart';
import 'package:voter_booth/utils/constants.dart';

class AuthorizeVoterScreen extends StatefulWidget {
  const AuthorizeVoterScreen({super.key});

  @override
  State<AuthorizeVoterScreen> createState() => _AuthorizeVoterScreenState();
}

class _AuthorizeVoterScreenState extends State<AuthorizeVoterScreen> {
  late TextEditingController nameController;
  late TextEditingController addressController;
  late TextEditingController ageController;
  late TextEditingController genderController;
  late W3MService _w3mService;

  @override
  void initState() {
    super.initState();
    try {
      _w3mService = W3MService(
        projectId: '001b66692e8d25adb3d5f7d189550651',
        metadata: const PairingMetadata(
          name: 'W3m Flutter',
          description: 'Web3Modal Flutter Example',
          url: 'https://www.walletconnect.com/',
          icons: ['https://walletconnect.com/walletconnect-logo.png'],
          redirect: Redirect(
            native: 'flutterdapp://',
            universal: 'https://www.walletconnect.com',
          ),
        ),
        includedWalletIds: {
          'c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96',
          // Metamask Wallet
        },
        excludedWalletIds: {
          '4622a2b2d6af1c9844944291e5e7351a6aa24cd7b23099efac1b2fd875da31a0', // Trust
          'fd20dc426fb37566d803205b19bbc1d4096b248ac04548e3cfb6b3a38bd033aa', // Coinbase Wallet
        },
      );
      _w3mService.init();
    } catch (e) {
      print("Error initializing _w3mService: $e");
      // Handle initialization error gracefully
    }
    nameController = TextEditingController();
    addressController = TextEditingController();
    ageController = TextEditingController();
    genderController = TextEditingController();
  }

  Future<void> callWriteFunction1() async {
    print("_w3mService: $_w3mService");
    String abi = await rootBundle.loadString('assets/abi.json');
    try {
      final deployedContract = DeployedContract(
        ContractAbi.fromJson(abi, 'Voting'),
        EthereumAddress.fromHex('0xe391ddD24b24eC381347406AB7F16e1a6359Ae10'),
      );

      await _w3mService.launchConnectedWallet();
      print("Session: ${_w3mService.session}");
      if (_w3mService.session != null) {
        await _w3mService.requestWriteContract(
          topic: _w3mService.session!.topic.toString(),
          chainId: 'eip155:11155111',
          rpcUrl:
          'https://eth-sepolia.g.alchemy.com/v2/Is7xCCuFmVXsJ1RvScVGEiCMggxETN7U',
          deployedContract: deployedContract,
          functionName: 'authorizeVoter',
          parameters: [
            addressController.text,
            nameController.text,
            ageController.text,
            genderController.text
          ],
          transaction: Transaction(
            from: EthereumAddress.fromHex(_w3mService.session!.address!)
          ),
        );
      } else {
        print("Session is null");
      }
    } catch (e) {
      print("Error calling write function: $e");
    }
    }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text('Authorize Voter'),
      ),
      body: Padding(
        padding: const EdgeInsets.all(16.0),
        child: Card(
          child: Padding(
            padding: const EdgeInsets.all(16.0),
            child: Column(
              crossAxisAlignment: CrossAxisAlignment.stretch,
              children: [
                TextFormField(
                  controller: nameController,
                  decoration: const InputDecoration(labelText: 'Voter Name'),
                ),
                const SizedBox(height: 16),
                TextFormField(
                  controller: addressController,
                  decoration:
                  const InputDecoration(labelText: 'Voter Address'),
                ),
                const SizedBox(height: 16),
                TextFormField(
                  controller: ageController,
                  decoration: const InputDecoration(labelText: 'Age'),
                  keyboardType: TextInputType.number,
                ),
                const SizedBox(height: 16),
                TextFormField(
                  controller: genderController,
                  decoration: const InputDecoration(labelText: 'Gender'),
                ),
                const SizedBox(height: 16),
                ElevatedButton(
                  onPressed: () {
                    callWriteFunction1();
                  },
                  child: const Text('Authorize Voter'),
                ),
              ],
            ),
          ),
        ),
      ),
    );
  }
}

metamaskconnector.dart:

import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
import 'package:web3modal_flutter/web3modal_flutter.dart';

class MetamaskConnector extends StatefulWidget {
  const MetamaskConnector({super.key});

  @override
  State<MetamaskConnector> createState() => _MetamaskConnectorState();
}

class _MetamaskConnectorState extends State<MetamaskConnector> {
  late W3MService _w3mService;
  @override

  void initState(){
    super.initState();
    W3MChainPresets.chains.putIfAbsent(_chainId, () => _sepoliaChain);
    _w3mService = W3MService(
      projectId: '001b66692e8d25adb3d5f7d189550651',
      metadata: const PairingMetadata(
        name: 'W3m Flutter',
        description: 'Web3Modal Flutter Example',
        url: 'https://www.walletconnect.com/',
        icons: ['https://walletconnect.com/walletconnect-logo.png'],
        redirect: Redirect(
          native: 'flutterdapp://',
          universal: 'https://www.walletconnect.com',
        ),
      ),
      includedWalletIds : {
        'c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96',// Coinbase Wallet
      },
      excludedWalletIds : {
        '4622a2b2d6af1c9844944291e5e7351a6aa24cd7b23099efac1b2fd875da31a0', // Trust
        'fd20dc426fb37566d803205b19bbc1d4096b248ac04548e3cfb6b3a38bd033aa', // Coinbase Wallet
      },
    );
    _w3mService.init();
  }

  @override
  Widget build(BuildContext context) {
    return Center(
      child: Column(
        crossAxisAlignment: CrossAxisAlignment.center,
        mainAxisAlignment: MainAxisAlignment.center,
        children: [
          W3MNetworkSelectButton(service: _w3mService),
          W3MConnectWalletButton(service: _w3mService),
        ],
      ),
    );
  }
}

const _chainId = "11155111";

final _sepoliaChain = W3MChainInfo(
    chainName: 'Sepolia',
    chainId: _chainId,
    namespace: 'eip155:$_chainId',
    tokenName: 'ETH',
    rpcUrl: 'https://eth-sepolia.g.alchemy.com/v2/Is7xCCuFmVXsJ1RvScVGEiCMggxETN7U',
    blockExplorer: W3MBlockExplorer(
        name: 'Sepolia Explorer',
        url: 'https://sepolia.etherscan.io/'
    )
);
quetool commented 4 weeks ago

Hello @sethitanay! A few things....

  1. You need to await the init() method of _w3mService, and since this can not be don in initState() because, like I said before, that function shouldn't be async, you should find a better way of initializing W3MService(), check the sample app.
  2. You are initializing _w3mService TWICE. On your MetamaskConnector and AuthorizeVoterScreen, why? You shouldn't do that.
  3. If you use includedWalletIds you don't need to use excludedWalletIds
  4. You are passing the wrong parameters to the contract function. Like I said, Transaction object should have the from value (and you have added it) but the parameters you are passing are not of the type requested by the contract function. You are passing ALL STRINGS while your contract function is defined as follows (type address, type string, type uint256, type string):
{
  "inputs": [
    {
      "internalType": "address",
      "name": "_voterAddress",
      "type": "address"
    },
    {
      "internalType": "string",
      "name": "_name",
      "type": "string"
    },
    {
      "internalType": "uint256",
      "name": "_age",
      "type": "uint256"
    },
    {
      "internalType": "string",
      "name": "_gender",
      "type": "string"
    }
  ],
  "name": "authorizeVoter",
  "outputs": [],
  "stateMutability": "nonpayable",
  "type": "function"
},

therefor this is completely wrong:

parameters: [
            addressController.text,
            nameController.text,
            ageController.text,
            genderController.text
          ],

Here it is a complete working example of your code (tested it with Zerion Wallet):

import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:web3modal_flutter/services/w3m_service/i_w3m_service.dart';

import 'package:web3modal_flutter/web3modal_flutter.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});
  @override
  Widget build(BuildContext context) {
    return const MaterialApp(
      title: 'Flutter Demo',
      home: MetamaskConnector(),
    );
  }
}

class MetamaskConnector extends StatefulWidget {
  const MetamaskConnector({super.key});

  @override
  State<MetamaskConnector> createState() => _MetamaskConnectorState();
}

class _MetamaskConnectorState extends State<MetamaskConnector> {
  late W3MService _w3mService;
  @override
  void initState() {
    super.initState();
    W3MChainPresets.chains.putIfAbsent(_chainId, () => _sepoliaChain);
    _initialize();
  }

  Future<void> _initialize() async {
    _w3mService = W3MService(
      projectId: '001b66692e8d25adb3d5f7d189550651',
      metadata: const PairingMetadata(
        name: 'W3m Flutter',
        description: 'Web3Modal Flutter Example',
        url: 'https://www.walletconnect.com/',
        icons: ['https://walletconnect.com/walletconnect-logo.png'],
        redirect: Redirect(
          native: 'flutterdapp://',
          universal: 'https://www.walletconnect.com',
        ),
      ),
      includedWalletIds: {
        'c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96', // Metamask
      },
    );
    await _w3mService.init();
    setState(() {});
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Center(
        child: Column(
          crossAxisAlignment: CrossAxisAlignment.center,
          mainAxisAlignment: MainAxisAlignment.center,
          children: [
            W3MNetworkSelectButton(service: _w3mService),
            W3MConnectWalletButton(service: _w3mService),
            if (_w3mService.isConnected)
              ElevatedButton(
                onPressed: () {
                  Navigator.push(
                    context,
                    MaterialPageRoute(
                      fullscreenDialog: true,
                      builder: (context) => AuthorizeVoterScreen(
                        w3mService: _w3mService,
                      ),
                    ),
                  );
                },
                child: const Text('Authorize Voter'),
              ),
          ],
        ),
      ),
    );
  }
}

const _chainId = "11155111";

final _sepoliaChain = W3MChainInfo(
    chainName: 'Sepolia',
    chainId: _chainId,
    namespace: 'eip155:$_chainId',
    tokenName: 'ETH',
    rpcUrl:
        'https://eth-sepolia.g.alchemy.com/v2/Is7xCCuFmVXsJ1RvScVGEiCMggxETN7U',
    blockExplorer: W3MBlockExplorer(
        name: 'Sepolia Explorer', url: 'https://sepolia.etherscan.io/'));

class AuthorizeVoterScreen extends StatefulWidget {
  final IW3MService w3mService;
  const AuthorizeVoterScreen({super.key, required this.w3mService});

  @override
  State<AuthorizeVoterScreen> createState() => _AuthorizeVoterScreenState();
}

class _AuthorizeVoterScreenState extends State<AuthorizeVoterScreen> {
  late TextEditingController nameController;
  late TextEditingController addressController;
  late TextEditingController ageController;
  late TextEditingController genderController;
  late IW3MService _w3mService;

  @override
  void initState() {
    super.initState();
    _w3mService = widget.w3mService;
    nameController = TextEditingController();
    addressController = TextEditingController();
    ageController = TextEditingController();
    genderController = TextEditingController();
  }

  Future<void> callWriteFunction1() async {
    print("_w3mService: $_w3mService");
    String abi = await rootBundle.loadString('lib/services/issue112.abi.json');
    String contractAddress = '0xe391ddD24b24eC381347406AB7F16e1a6359Ae10';
    try {
      final deployedContract = DeployedContract(
        ContractAbi.fromJson(abi, 'Voting'),
        EthereumAddress.fromHex(contractAddress),
      );

      await _w3mService.launchConnectedWallet();
      print("Session: ${_w3mService.session}");
      if (_w3mService.session != null) {
        await _w3mService.requestWriteContract(
          topic: _w3mService.session!.topic.toString(),
          chainId: 'eip155:11155111',
          rpcUrl:
              'https://eth-sepolia.g.alchemy.com/v2/Is7xCCuFmVXsJ1RvScVGEiCMggxETN7U',
          deployedContract: deployedContract,
          functionName: 'authorizeVoter',
          parameters: [
            EthereumAddress.fromHex(addressController.text),
            nameController.text,
            BigInt.from(int.parse(ageController.text)),
            genderController.text
          ],
          transaction: Transaction(
            from: EthereumAddress.fromHex(_w3mService.session!.address!),
          ),
        );
      } else {
        print("Session is null");
      }
    } catch (e) {
      print("Error calling write function: $e");
    }
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text('Authorize Voter'),
      ),
      body: Padding(
        padding: const EdgeInsets.all(16.0),
        child: Card(
          child: Padding(
            padding: const EdgeInsets.all(16.0),
            child: Column(
              crossAxisAlignment: CrossAxisAlignment.stretch,
              children: [
                TextFormField(
                  controller: nameController,
                  decoration: const InputDecoration(labelText: 'Voter Name'),
                ),
                const SizedBox(height: 16),
                TextFormField(
                  controller: addressController,
                  decoration: const InputDecoration(labelText: 'Voter Address'),
                ),
                const SizedBox(height: 16),
                TextFormField(
                  controller: ageController,
                  decoration: const InputDecoration(labelText: 'Age'),
                  keyboardType: TextInputType.number,
                ),
                const SizedBox(height: 16),
                TextFormField(
                  controller: genderController,
                  decoration: const InputDecoration(labelText: 'Gender'),
                ),
                const SizedBox(height: 16),
                ElevatedButton(
                  onPressed: () {
                    callWriteFunction1();
                  },
                  child: const Text('Authorize Voter'),
                ),
              ],
            ),
          ),
        ),
      ),
    );
  }
}

Hope this help!