Giter Club home page Giter Club logo

web3modalflutter's Introduction

WalletConnect.com

WalletConnect Web3Modal

WalletConnect Web3Modal implementation for Flutter
Simple, intuitive wallet login. With this drop-in UI SDK, enable any wallet's users to seamlessly log in to your app and enjoy a smooth, unified experience.

Documentation

For a full reference please check the Official Documentation

Example

Please check the example folder for the example.

Run the example app

$ cd example then
$ flutter run --dart-define=PROJECT_ID={YOUR_PROJECT_ID}

Useful Commands

If you are cloning this repo do the following inside the root folder

$ flutter pub get to get dependencies

$ dart run build_runner build --delete-conflicting-outputs to generate files

do the same inside example folder

web3modalflutter's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

web3modalflutter's Issues

The Wallets are not being retrieved either via iOS or android

Describe the bug
The wallet icons are not being generated for some reason, after selecting the network:
gdh7G6A

To Reproduce
Steps to reproduce the behavior:

  1. Build, and launch the app, on either iOS, or android, emulator or native.
  2. Click on select the network, and pick a network.
  3. Then it will switch to the select a wallet screen, and it will all be blank.
  4. See error

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
gdh7G6A

Desktop (please complete the following information):

  • OS: NA
  • Browser: NA
  • Version: NA

Smartphone (please complete the following information):

  • Device: [iPhone 6.2.2]
  • OS: [iOS, android]
  • Browser NA
  • Version [3.0.0-beta06]

Additional context
This is the stack trace from the iOS emulator:

2023-10-21 23:28:41.694144-0700 Runner[3144:41620] flutter: \^[[38;5;196m│ ⛔ [ExplorerService] Error fetching native apps data<…>
2023-10-21 23:28:41.694723-0700 Runner[3144:41620] flutter: \^[[38;5;196m└───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────<…>
2023-10-21 23:28:41.700775-0700 Runner[3144:41620] [VERBOSE-2:dart_vm_initializer.cc(41)] Unhandled Exception: Exception: FormatException: Unexpected character (at character 1)
Forbidden
^

#0      ExplorerService._fetchNativeAppData (package:web3modal_flutter/services/explorer_service/explorer_service.dart:163:7)
<asynchronous suspension>
#1      ExplorerService._fetchInstalledListings (package:web3modal_flutter/services/explorer_service/explorer_service.dart:168:30)
<asynchronous suspension>
#2      ExplorerService.init (package:web3modal_flutter/services/explorer_service/explorer_service.dart:84:26)
<asynchronous suspension>

and this is the stack trace from the android emulator:

E/flutter: [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: Exception: FormatException: Unexpected character (at character 1)
    Forbidden
    ^
    
    #0      ExplorerService._fetchNativeAppData (package:web3modal_flutter/services/explorer_service/explorer_service.dart:163:7)
    <asynchronous suspension>
    #1      ExplorerService._fetchInstalledListings (package:web3modal_flutter/services/explorer_service/explorer_service.dart:168:30)
    <asynchronous suspension>
    #2      ExplorerService.init (package:web3modal_flutter/services/explorer_service/explorer_service.dart:84:26)
    <asynchronous suspension>

The wallets does not show up in the bottom sheet and show grey screen instead

Describe the bug

Fatal Exception: io.flutter.plugins.firebase.crashlytics.FlutterError: RangeError (end): Invalid value: Not in inclusive range 0..2: 4. Error thrown building Widget.
       at ListBase.getRange(dart:collection)
       at _WalletsListShortPageState.build.<fn>(wallets_list_short_page.dart:58)
       at _ExplorerServiceItemsListenerState.build.<fn>.<fn>(explorer_service_items_listener.dart:43)
       at _ValueListenableBuilderState.build(value_listenable_builder.dart:186)
       at StatefulElement.build(framework.dart:5409)
       at ComponentElement.performRebuild(framework.dart:5297)
       at StatefulElement.performRebuild(framework.dart:5462)
       at Element.rebuild(framework.dart:5016)
       at BuildOwner.buildScope(framework.dart:2779)
       at WidgetsBinding.drawFrame(binding.dart:916)
       at RendererBinding._handlePersistentFrameCallback(binding.dart:360)
       at SchedulerBinding._invokeFrameCallback(binding.dart:1297)
       at SchedulerBinding.handleDrawFrame(binding.dart:1227)
       at SchedulerBinding._handleDrawFrame(binding.dart:1085)

To Reproduce
Steps to reproduce the behavior:

  1. Initialize WalletConnect SDK as Getit service'
  2. Launch the app
  3. See error

Expected behavior
No error to be seen of such kind

Screenshots
image (1)

Smartphone (please complete the following information):

  • Device: [OnePluse 8 Pro, Oppo F9, Xiaomi Mi A1]
  • OS: [ Android 13, Android 10, Android 11]
  • Browser [e.g. stock browser, safari]

Additional context
Add any other context about the problem here.

Can't connect to wallet

I'm using the latest stable version of Web3ModalFlutter
After connecting to a network, whenever I want to connect to wallet it returns this error

TimeoutException after 0:00:00.000000: Future not completed

and won't send the connection request to the wallet, it first happened with Metamask wallet and then I installed Trustwallet because I thought it was a problem on Metamask's end Apparently it's Flutter problem

Smartphone (please complete the following information):**
using google pixel 7 emulator
Android 11

smart contract interaction

hello how can i use it with web3dart to interact with smartcontract ?
i want to sign transaction from connected wallet previously i was using walletconnect_dart and walletconnect_qrcode_modal_dart
to connect and sign transaction but now v1 is closed so how to use this package for same work.

How can I check selected wallet of user after connecting

After connecting, I want to check the user's current connected wallet.

Web3modal can't send transactions with Metamask, so I want to check what the user's connected wallet is. I can throw them an alert dialogue if it's a meta mask. We still do not support this function.

WalletConnect V2 Migration

The depreciation of V1 on 28th has rendered lots of dApps useless and their users are complaining. Is there a way that we devs can contribute towards the migration in order to hasten this process? This is a package by us for us therefore the faster we get it up and running the faster the products are back in business

Overflows and No Material Widget Found errors

Environment

Testing out with example app and web3modal_flutter: ^1.2.1, Flutter 3.12.0-1.1.pre • channel beta on web chrome.

Problem

Overflow on desktop horizontal view:
image

No Material Widget Found errors:
image

Error Logs:

══╡ EXCEPTION CAUGHT BY WIDGETS LIBRARY ╞═══════════════════════════════════════════════════════════
The following assertion was thrown building _InkResponseStateWidget(gestures: [tap], mouseCursor:
null, clipped to BoxShape.rectangle, dirty, state: _InkResponseState#6bbfc):
No Material widget found.
_InkResponseStateWidget widgets require a Material widget ancestor within the closest
LookupBoundary.
In Material Design, most widgets are conceptually "printed" on a sheet of material. In Flutter's
material library, that material is represented by the Material widget. It is the Material widget
that renders ink splashes, for instance. Because of this, many material library widgets require that
there be a Material widget in the tree above them.
To introduce a Material widget, you can either directly include one, or use a widget that contains
Material itself, such as a Card, Dialog, Drawer, or Scaffold.
The specific widget that could not find a Material ancestor was:
  _InkResponseStateWidget
The ancestors of this widget were:
  ...
  InkWell
  GridListItem-[<'Zerion'>]
  RepaintBoundary
  IndexedSemantics
  _SelectionKeepAlive
  ...
The relevant error-causing widget was:
MaterialApp
When the exception was thrown, this was the stack:
dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/errors.dart 294:49      throw_
packages/flutter/src/material/debug.dart 38:7                                     <fn>
packages/flutter/src/material/debug.dart 62:12                                    debugCheckHasMaterial
packages/flutter/src/material/ink_well.dart 675:12                                debugCheckContext
packages/flutter/src/material/ink_well.dart 1268:36                               build
packages/flutter/src/widgets/framework.dart 5198:27                               build
packages/flutter/src/widgets/framework.dart 5086:15                               performRebuild
packages/flutter/src/widgets/framework.dart 5251:11                               performRebuild
packages/flutter/src/widgets/framework.dart 4805:7                                rebuild
packages/flutter/src/widgets/framework.dart 5068:5                                [_firstBuild]
packages/flutter/src/widgets/framework.dart 5242:11                               [_firstBuild]
packages/flutter/src/widgets/framework.dart 5062:5                                mount
packages/flutter/src/widgets/framework.dart 3971:15                               inflateWidget
packages/flutter/src/widgets/framework.dart 3708:18                               updateChild
packages/flutter/src/widgets/framework.dart 5111:16                               performRebuild
packages/flutter/src/widgets/framework.dart 4805:7                                rebuild
packages/flutter/src/widgets/framework.dart 5068:5                                [_firstBuild]
packages/flutter/src/widgets/framework.dart 5062:5                                mount
packages/flutter/src/widgets/framework.dart 3971:15                               inflateWidget
packages/flutter/src/widgets/framework.dart 3708:18                               updateChild
packages/flutter/src/widgets/framework.dart 5111:16                               performRebuild
packages/flutter/src/widgets/framework.dart 4805:7                                rebuild
packages/flutter/src/widgets/framework.dart 5068:5                                [_firstBuild]
packages/flutter/src/widgets/framework.dart 5062:5                                mount
packages/flutter/src/widgets/framework.dart 3971:15                               inflateWidget
packages/flutter/src/widgets/framework.dart 3708:18                               updateChild
packages/flutter/src/widgets/framework.dart 6435:14                               mount
packages/flutter/src/widgets/framework.dart 3971:15                               inflateWidget
packages/flutter/src/widgets/framework.dart 3708:18                               updateChild
packages/flutter/src/widgets/framework.dart 6435:14                               mount
packages/flutter/src/widgets/framework.dart 3971:15                               inflateWidget
packages/flutter/src/widgets/framework.dart 3708:18                               updateChild
packages/flutter/src/widgets/framework.dart 5111:16                               performRebuild
packages/flutter/src/widgets/framework.dart 5251:11                               performRebuild
packages/flutter/src/widgets/framework.dart 4805:7                                rebuild
packages/flutter/src/widgets/framework.dart 5068:5                                [_firstBuild]
packages/flutter/src/widgets/framework.dart 5242:11                               [_firstBuild]
packages/flutter/src/widgets/framework.dart 5062:5                                mount
packages/flutter/src/widgets/framework.dart 3971:15                               inflateWidget
packages/flutter/src/widgets/framework.dart 3708:18                               updateChild
packages/flutter/src/widgets/framework.dart 5111:16                               performRebuild
packages/flutter/src/widgets/framework.dart 4805:7                                rebuild
packages/flutter/src/widgets/framework.dart 5068:5                                [_firstBuild]
packages/flutter/src/widgets/framework.dart 5062:5                                mount
packages/flutter/src/widgets/framework.dart 3971:15                               inflateWidget
packages/flutter/src/widgets/framework.dart 3708:18                               updateChild
packages/flutter/src/widgets/framework.dart 5111:16                               performRebuild
packages/flutter/src/widgets/framework.dart 4805:7                                rebuild
packages/flutter/src/widgets/framework.dart 5068:5                                [_firstBuild]
packages/flutter/src/widgets/framework.dart 5062:5                                mount
packages/flutter/src/widgets/framework.dart 3971:15                               inflateWidget
packages/flutter/src/widgets/framework.dart 3708:18                               updateChild
packages/flutter/src/widgets/framework.dart 5111:16                               performRebuild
packages/flutter/src/widgets/framework.dart 5251:11                               performRebuild
packages/flutter/src/widgets/framework.dart 4805:7                                rebuild
packages/flutter/src/widgets/framework.dart 5068:5                                [_firstBuild]
packages/flutter/src/widgets/framework.dart 5242:11                               [_firstBuild]
packages/flutter/src/widgets/framework.dart 5062:5                                mount
packages/flutter/src/widgets/framework.dart 3971:15                               inflateWidget
packages/flutter/src/widgets/framework.dart 3708:18                               updateChild
packages/flutter/src/widgets/framework.dart 5111:16                               performRebuild
packages/flutter/src/widgets/framework.dart 4805:7                                rebuild
packages/flutter/src/widgets/framework.dart 5068:5                                [_firstBuild]
packages/flutter/src/widgets/framework.dart 5062:5                                mount
packages/flutter/src/widgets/framework.dart 3971:15                               inflateWidget
packages/flutter/src/widgets/framework.dart 3708:18                               updateChild
packages/flutter/src/widgets/sliver.dart 857:37                                   updateChild
packages/flutter/src/widgets/sliver.dart 842:20                                   <fn>
packages/flutter/src/widgets/framework.dart 2720:19                               buildScope
packages/flutter/src/widgets/sliver.dart 834:5                                    createChild
packages/flutter/src/rendering/sliver_multi_box_adaptor.dart 351:23               <fn>
packages/flutter/src/rendering/object.dart 2506:59                                <fn>
packages/flutter/src/rendering/object.dart 1062:15                                [_enableMutationsToDirtySubtrees]
packages/flutter/src/rendering/object.dart 2506:7                                 invokeLayoutCallback
packages/flutter/src/rendering/sliver_multi_box_adaptor.dart 340:5                [_createOrObtainChild]
packages/flutter/src/rendering/sliver_multi_box_adaptor.dart 426:5                addInitialChild
packages/flutter/src/rendering/sliver_grid.dart 593:12                            performLayout
packages/flutter/src/rendering/object.dart 2395:7                                 layout
packages/flutter/src/rendering/sliver_padding.dart 139:5                          performLayout
packages/flutter/src/rendering/sliver_padding.dart 361:11                         performLayout
packages/flutter/src/rendering/object.dart 2395:7                                 layout
packages/flutter/src/rendering/viewport.dart 534:12                               layoutChildSequence
packages/flutter/src/rendering/viewport.dart 1511:12                              [_attemptLayout]
packages/flutter/src/rendering/viewport.dart 1420:20                              performLayout
packages/flutter/src/rendering/object.dart 2395:7                                 layout
packages/flutter/src/rendering/box.dart 2385:11                                   layout
packages/flutter/src/rendering/proxy_box.dart 104:21                              <fn>
packages/flutter/src/rendering/object.dart 2395:7                                 layout
packages/flutter/src/rendering/box.dart 2385:11                                   layout
packages/flutter/src/rendering/proxy_box.dart 104:21                              <fn>
packages/flutter/src/rendering/object.dart 2395:7                                 layout
packages/flutter/src/rendering/box.dart 2385:11                                   layout
packages/flutter/src/rendering/proxy_box.dart 104:21                              <fn>
packages/flutter/src/rendering/object.dart 2395:7                                 layout
packages/flutter/src/rendering/box.dart 2385:11                                   layout
packages/flutter/src/rendering/proxy_box.dart 104:21                              <fn>
packages/flutter/src/rendering/object.dart 2395:7                                 layout
packages/flutter/src/rendering/box.dart 2385:11                                   layout
packages/flutter/src/rendering/proxy_box.dart 104:21                              <fn>
packages/flutter/src/rendering/object.dart 2395:7                                 layout
packages/flutter/src/rendering/box.dart 2385:11                                   layout
packages/flutter/src/rendering/proxy_box.dart 104:21                              <fn>
packages/flutter/src/rendering/object.dart 2395:7                                 layout
packages/flutter/src/rendering/box.dart 2385:11                                   layout
packages/flutter/src/rendering/proxy_box.dart 104:21                              <fn>
packages/flutter/src/rendering/object.dart 2395:7                                 layout
packages/flutter/src/rendering/box.dart 2385:11                                   layout
packages/flutter/src/rendering/proxy_box.dart 104:21                              <fn>
packages/flutter/src/rendering/custom_paint.dart 554:11                           performLayout
packages/flutter/src/rendering/object.dart 2395:7                                 layout
packages/flutter/src/rendering/box.dart 2385:11                                   layout
packages/flutter/src/rendering/proxy_box.dart 104:21                              <fn>
packages/flutter/src/rendering/object.dart 2395:7                                 layout
packages/flutter/src/rendering/box.dart 2385:11                                   layout
packages/flutter/src/rendering/proxy_box.dart 104:21                              <fn>
packages/flutter/src/rendering/object.dart 2395:7                                 layout
packages/flutter/src/rendering/box.dart 2385:11                                   layout
packages/flutter/src/rendering/proxy_box.dart 104:21                              <fn>
packages/flutter/src/rendering/object.dart 2395:7                                 layout
packages/flutter/src/rendering/box.dart 2385:11                                   layout
packages/flutter/src/rendering/proxy_box.dart 104:21                              <fn>
packages/flutter/src/rendering/object.dart 2395:7                                 layout
packages/flutter/src/rendering/box.dart 2385:11                                   layout
packages/flutter/src/rendering/proxy_box.dart 104:21                              <fn>
packages/flutter/src/rendering/object.dart 2395:7                                 layout
packages/flutter/src/rendering/box.dart 2385:11                                   layout
packages/flutter/src/rendering/shifted_box.dart 238:5                             performLayout
packages/flutter/src/rendering/object.dart 2395:7                                 layout
packages/flutter/src/rendering/box.dart 2385:11                                   layout
packages/flutter/src/rendering/proxy_box.dart 279:7                               performLayout
packages/flutter/src/rendering/object.dart 2395:7                                 layout
packages/flutter/src/rendering/box.dart 2385:11                                   layout
packages/flutter/src/rendering/layout_helper.dart 52:10                           layoutChild
packages/flutter/src/rendering/flex.dart 808:43                                   [_computeSizes]
packages/flutter/src/rendering/flex.dart 903:32                                   performLayout
packages/flutter/src/rendering/object.dart 2395:7                                 layout
packages/flutter/src/rendering/box.dart 2385:11                                   layout
packages/flutter/src/rendering/layout_helper.dart 52:10                           layoutChild
packages/flutter/src/rendering/flex.dart 808:43                                   [_computeSizes]
packages/flutter/src/rendering/flex.dart 903:32                                   performLayout
packages/flutter/src/rendering/object.dart 2395:7                                 layout
packages/flutter/src/rendering/box.dart 2385:11                                   layout
packages/flutter/src/rendering/animated_size.dart 210:5                           performLayout
packages/flutter/src/rendering/object.dart 2395:7                                 layout
packages/flutter/src/rendering/box.dart 2385:11                                   layout
packages/flutter/src/rendering/proxy_box.dart 104:21                              <fn>
packages/flutter/src/rendering/object.dart 2395:7                                 layout
packages/flutter/src/rendering/box.dart 2385:11                                   layout
packages/flutter/src/rendering/proxy_box.dart 104:21                              <fn>
packages/flutter/src/rendering/object.dart 2395:7                                 layout
packages/flutter/src/rendering/box.dart 2385:11                                   layout
packages/flutter/src/rendering/layout_helper.dart 52:10                           layoutChild
packages/flutter/src/rendering/stack.dart 580:43                                  [_computeSize]
packages/flutter/src/rendering/stack.dart 607:12                                  performLayout
packages/flutter/src/rendering/object.dart 2395:7                                 layout
packages/flutter/src/rendering/box.dart 2385:11                                   layout
packages/flutter/src/rendering/shifted_box.dart 238:5                             performLayout
packages/flutter/src/rendering/object.dart 2395:7                                 layout
packages/flutter/src/rendering/box.dart 2385:11                                   layout
packages/flutter/src/rendering/proxy_box.dart 104:21                              <fn>
packages/flutter/src/rendering/object.dart 2395:7                                 layout
packages/flutter/src/rendering/box.dart 2385:11                                   layout
packages/flutter/src/rendering/layout_helper.dart 52:10                           layoutChild
packages/flutter/src/rendering/flex.dart 808:43                                   [_computeSizes]
packages/flutter/src/rendering/flex.dart 903:32                                   performLayout
packages/flutter/src/rendering/object.dart 2395:7                                 layout
packages/flutter/src/rendering/box.dart 2385:11                                   layout
packages/flutter/src/rendering/shifted_box.dart 238:5                             performLayout
packages/flutter/src/rendering/object.dart 2395:7                                 layout
packages/flutter/src/rendering/box.dart 2385:11                                   layout
packages/flutter/src/rendering/proxy_box.dart 104:21                              <fn>
packages/flutter/src/rendering/proxy_box.dart 1431:11                             performLayout
packages/flutter/src/rendering/object.dart 2395:7                                 layout
packages/flutter/src/rendering/box.dart 2385:11                                   layout
packages/flutter/src/rendering/proxy_box.dart 104:21                              <fn>
packages/flutter/src/rendering/object.dart 2395:7                                 layout
packages/flutter/src/rendering/box.dart 2385:11                                   layout
packages/flutter/src/rendering/shifted_box.dart 238:5                             performLayout
packages/flutter/src/rendering/object.dart 2395:7                                 layout
packages/flutter/src/rendering/box.dart 2385:11                                   layout
packages/flutter/src/rendering/shifted_box.dart 238:5                             performLayout
packages/flutter/src/rendering/object.dart 2395:7                                 layout
packages/flutter/src/rendering/box.dart 2385:11                                   layout
packages/flutter/src/rendering/proxy_box.dart 104:21                              <fn>
packages/flutter/src/rendering/object.dart 2395:7                                 layout
packages/flutter/src/rendering/box.dart 2385:11                                   layout
packages/flutter/src/rendering/proxy_box.dart 104:21                              <fn>
packages/flutter/src/rendering/object.dart 2395:7                                 layout
packages/flutter/src/rendering/box.dart 2385:11                                   layout
packages/flutter/src/rendering/proxy_box.dart 104:21                              <fn>
packages/flutter/src/rendering/object.dart 2395:7                                 layout
packages/flutter/src/rendering/box.dart 2385:11                                   layout
packages/flutter/src/rendering/proxy_box.dart 104:21                              <fn>
packages/flutter/src/rendering/object.dart 2395:7                                 layout
packages/flutter/src/rendering/box.dart 2385:11                                   layout
packages/flutter/src/rendering/proxy_box.dart 104:21                              <fn>
packages/flutter/src/rendering/object.dart 2395:7                                 layout
packages/flutter/src/rendering/box.dart 2385:11                                   layout
packages/flutter/src/rendering/proxy_box.dart 104:21                              <fn>
packages/flutter/src/rendering/object.dart 2395:7                                 layout
packages/flutter/src/rendering/box.dart 2385:11                                   layout
packages/flutter/src/rendering/proxy_box.dart 104:21                              <fn>
packages/flutter/src/rendering/proxy_box.dart 3732:13                             performLayout
packages/flutter/src/rendering/object.dart 2395:7                                 layout
packages/flutter/src/rendering/box.dart 2385:11                                   layout
packages/flutter/src/rendering/proxy_box.dart 104:21                              <fn>
packages/flutter/src/rendering/object.dart 2395:7                                 layout
packages/flutter/src/rendering/box.dart 2385:11                                   layout
packages/flutter/src/widgets/overlay.dart 838:14                                  performLayout
packages/flutter/src/rendering/object.dart 2234:7                                 [_layoutWithoutResize]
packages/flutter/src/rendering/object.dart 1016:17                                flushLayout
packages/flutter/src/rendering/binding.dart 492:19                                drawFrame
packages/flutter/src/widgets/binding.dart 918:13                                  drawFrame
packages/flutter/src/rendering/binding.dart 358:5                                 [_handlePersistentFrameCallback]
packages/flutter/src/scheduler/binding.dart 1297:15                               [_invokeFrameCallback]
packages/flutter/src/scheduler/binding.dart 1227:9                                handleDrawFrame
packages/flutter/src/scheduler/binding.dart 1085:5                                [_handleDrawFrame]
lib/_engine/engine/platform_dispatcher.dart 1324:13                               invoke
lib/_engine/engine/platform_dispatcher.dart 278:5                                 invokeOnDrawFrame
lib/_engine/engine/initialization.dart 185:45                                     <fn>
dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/operations.dart 570:37  _checkAndCall
dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/operations.dart 575:39  dcall
════════════════════════════════════════════════════════════════════════════════════════════════════

Proposed Fixes

  1. The current Web3Modal spawned up by showDialog is just a container, not a Dialog which results in the second error. Consider wrapping it with Dialog
  2. Wrap the container with SingleChildScrollView or add size constraints to the Container
    https://github.com/WalletConnect/Web3ModalFlutter/blob/b569f62d13197cbf09c9a7db7a790d0ab2811c4d/lib/widgets/walletconnect_modal.dart#L92C5-L96C12

Value is not increasing

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:

  1. Go to 'HomePage'
  2. Click on 'etc user send transaction'
  3. Even if you change the value in eip155.dart, it is still stuck on 0.0000001 in metamask'
  4. See error

Expected behavior
It should change according to the value

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Smartphone (please complete the following information):

  • Device: Pixel 7pro
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

Unable to send (personal_sign) requests to some wallet applications on Android

Describe the bug
I am using web3modal_flutter in my Flutter application.
I am having issues with the following user actions:

  1. User connects with the walletconnect web3 modal
  2. After the user connects the app sends a "personal_sign" request
  3. This error is thrown upon trying to send the personal_signrequest:
    PlatformException (PlatformException(ACTIVITY_NOT_FOUND, No Activity found to handle intent { trust:// }, null, null))
  4. The request is not actuallysent, due to the error and user cannot sign it.

I am encountering this issue on Android with the following wallet applications:

  • Trust Wallet
  • 1inch

I am NOT encountering this issue on:

  • Metamask
  • Rainbow Wallet

Moreover I am NOT encountering this issue with any wallet on iOS, that I have tried so far. Including Trust Wallet and 1inch.

I have not tried other wallet apps so far.

Moreover, I am unsure if this error would also appear for requests other than personal_sign.

To Reproduce
Steps to reproduce the behavior:

  1. Use Web3Modal to connect user with Trust Wallet (or 1inch)
  2. Send a personal_sign request

Expected behavior
personal_sign request (and all other requests) are sent correctly to Trust Wallet, 1inch wallet (and others) on Android

Screenshots
If applicable, add screenshots to help explain your problem.

Smartphone (please complete the following information):

  • Device: Redmi Note 11
  • OS: Android
  • Version 11

Additional context
I have tested with two separate Android devices and encountered exactly the same problem.
I believe this affects all requests sent to the wallet, however I have only tried it with personal_sign

Connect only one type of Wallet

I'm trying to enable connect only MetaMask Wallet in my dApp, but the new version of WalletModal doesn't support this option. It seems "includedWalletIds" include not only the selected Wallets (in my case:

final Set<String> includedWalletIds = {
  'c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96', // MetaMask
};

"excludedWalletIds" seems work, but V3 doesn't have the option exclude ALL other Wallets (like in V2:

recommendedWalletIds: {
      'c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96', // MetaMask
    },
excludedWalletState: ExcludedWalletState.all,

Do you plan any similar options?
Thanks...

Error: Type 'EventArgs' not found. with web3modal_flutter: ^3.1.0

Getting below issue while using web3modal_flutter: ^3.1.0 in my Project.

Could not build the precompiled application for the device.

Error (Xcode): ../../../.pub-cache/hosted/pub.dev/web3modal_flutter-3.1.0/lib/services/w3m_service/i_w3m_service.dart:22:35: Error: Type 'EventArgs' not found.

Lost SharedPreference data when disconnected from wallet

Describe the bug
When I disconnect from the wallet, the data stored in SharedPreference is lost.
Can you please consider making it so that the data is not lost even if the session with the wallet is disconnected?

To Reproduce
Steps to reproduce the behavior:

  1. Use the example app in the repository.
  2. Modify the _MyHomePageState class as follows:
--- a/example/lib/home_page.dart
+++ b/example/lib/home_page.dart
@@ -1,3 +1,5 @@
+import 'dart:async';
+
 import 'package:flutter/material.dart';

 import 'package:web3modal_flutter/web3modal_flutter.dart';
@@ -22,10 +24,26 @@ class MyHomePage extends StatefulWidget {
 class _MyHomePageState extends State<MyHomePage> {
   late W3MService _w3mService;

+  String _sp = "";
+
+  // Retrieve data from SharedPreference
+  Future<void> reloadPreference(Timer timer) async {
+    final SharedPreferences prefs = await SharedPreferences.getInstance();
+    setState(() {
+      _sp = prefs.getString('preference_test') ?? 'key not found.';
+    });
+  }
+
   @override
   void initState() {
     super.initState();
     _initializeService();
+    // Periodically retrieve data from SharedPreference.
+    Timer.periodic(const Duration(seconds: 3), reloadPreference);
+    // Save data in SharedPreference only once at initialization
+    SharedPreferences.getInstance().then((prefs) {
+      prefs.setString('preference_test', 'value saved');
+    });
   }

   void _initializeService() async {
@@ -141,6 +159,7 @@ class _MyHomePageState extends State<MyHomePage> {
                 color: Web3ModalTheme.colorsOf(context).foreground100,
               ),
             ),
+            Text(_sp),
             _ButtonsView(w3mService: _w3mService),
             const Divider(height: 0.0, color: Colors.transparent),
             _ConnectedView(w3mService: _w3mService)
  1. Build & run.
  2. After confirming that the value saved text appears above the Select network button, click the Select network button.
  3. Select a network wallet and connect to the wallet.
  4. After returning to the example app, click the Disconnect button.
  5. The data saved in SharedPreference will disappear and the text above the Select network button will change to key not found..

Expected behavior
The data stored in SharedPreference should not disappear even after the wallet is disconnected.

Desktop (please complete the following information):
Unconfirmed

Smartphone (please complete the following information):

  • Device: FCG01
  • OS: Android13

How to access connectResponse in the latest release 3.1.0?

Hi Team,

I have upgraded the package to the latest release 3.1.0 where I found we removed the public parameter connectResponse and we have done other changes as well...

I found we do assign the value to connectResponse in the buildConnectionUri and then we are calling _awaitConnectionCallback method but over here we are not storing the 'await connectResponse.session.futureanywhere which is needed to me. If we done changes related to to_currentSessionthen we should assign the value to it in the_awaitConnectionCallback`.

I am stuck here in the production release please let me know the solution for the same using which I can fix the issues.

Richer examples, Metamask Connection, integration with Web3Dart

in another issue @contrastpro have provided a working example for metamask connection
WalletConnect/WalletConnectFlutterV2#113 (comment)

and @4xMafole provided an example for integration with web3 dart library
WalletConnect/WalletConnectFlutterV2#122 (comment)

Can it be integrated into the examples so new users would easily find it and also it would be maintained in case of API changes?

Taken from tihs issue, created by @makinghappen

Executing a transaction with web3modal_flutter doesn't popup the wallet for transaction confirmation automatically.

Describe the bug
When using web3modal_flutter, the app connects to the wallet without issues. However, when attempting to execute a transaction, it fails to automatically prompt the wallet (tested with Metamask and Trust Wallet) interface for transaction confirmation. Instead, the transaction confirmation modal only appears in Metamask when manually navigating back to the wallet app from my application.

To Reproduce
Steps to reproduce the behaviour:

  1. Open the app and connect to the wallet using web3modal_flutter.
  2. Attempt to initiate a transaction.
  3. Observe that the Metamask or Trust Wallet interface does not automatically pop up for transaction confirmation.
  4. Manually navigate back to the Metamask app and notice the transaction confirmation modal is present.

Expected behaviour
I expected the Metamask or Trust Wallet interface to automatically pop up for transaction confirmation when a transaction is initiated from the app.

Smartphone (please complete the following information):

  • Device: One Plus 7T Pro
  • OS: Android 12
  • Browser: Oxygen OS
  • Version: 12.1

Example for web build doesn't load wallet

Describe the bug
The example connects properly to my wallet when I run the android build. But when I run the web build, the connect wallet button times out and stays on a spinning icon. It doesn't load the wallets or give an option for a QR code. There is no error message, just a warning "The platformViewRegistry getter is deprecated and will be removed in a future release. Please import it from dart:ui_web instead."

To Reproduce
Steps to reproduce the behavior:

  1. Shut down android emulator
  2. Open the terminal at the example folder lib/main.dart
  3. flutter run --dart-define=PROJECT_ID=...
  4. Select Chrome
  5. Press Connect Wallet

Expected behavior
Show wallet options to connect.

Screenshots
1
2
3

Desktop (please complete the following information):

  • OS: windows 11
  • Browser: chrome
  • Version: 118.0.5993.72

Web compatibility

Hello

why pub.dev says the https://pub.dev/packages/web3modal_flutter lib is not web compatible ?
thx

run example failed with flutter version 3.13.6


Because every version of web3modal_flutter from path depends on walletconnect_flutter_v2 ^2.1.12 and no versions of walletconnect_flutter_v2 match >2.1.12 <3.0.0, every version of web3modal_flutter from path requires
  walletconnect_flutter_v2 2.1.12.
And because walletconnect_flutter_v2 2.1.12 depends on web_socket_channel ^2.4.2, every version of web3modal_flutter from path requires web_socket_channel ^2.4.2.
Because web_socket_channel 2.4.2 requires SDK version ^3.2.0 and no versions of web_socket_channel match >2.4.2 <3.0.0, web_socket_channel ^2.4.2 is forbidden.
Thus, web3modal_flutter from path is forbidden.
So, because walletconnect_flutter_dapp depends on web3modal_flutter from path, version solving failed.

flutter version 3.13.6 ,run example failed

Example app, `_fetchNativeAppData()` error when performing GET request

Describe the bug
I'm trying to run the example application within the project.
I've cloned the repo, run flutter pub get and read the instructions in the README.md file inside the example folder.

When I run the example project, the _fetchNativeAppData() method from explorer_service.dart is called.
It successfully retrieves headers, the uri and proceed with the GET request to the endpoint.

The request does not fail, but it simply returns "Forbidden" string.

This seems to cause the json decode to fail and crash with this log:

I/flutter (29476): ┌───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
I/flutter (29476): │ FormatException: Unexpected character (at character 1)
I/flutter (29476): │ Forbidden
I/flutter (29476): │ ^
I/flutter (29476): │ 
I/flutter (29476): ├┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄
I/flutter (29476): │ #0   _ChunkedJsonParser.fail (dart:convert-patch/convert_patch.dart:1383:5)
I/flutter (29476): │ #1   _ChunkedJsonParser.parseNumber (dart:convert-patch/convert_patch.dart:1250:9)
I/flutter (29476): │ #2   _ChunkedJsonParser.parse (dart:convert-patch/convert_patch.dart:915:22)
I/flutter (29476): │ #3   _parseJson (dart:convert-patch/convert_patch.dart:35:10)
I/flutter (29476): │ #4   JsonDecoder.convert (dart:convert/json.dart:610:36)
I/flutter (29476): │ #5   JsonCodec.decode (dart:convert/json.dart:216:41)
I/flutter (29476): │ #6   jsonDecode (dart:convert/json.dart:155:10)
I/flutter (29476): │ #7   ExplorerService._fetchNativeAppData (package:web3modal_flutter/services/explorer_service/explorer_service.dart:164:9)
I/flutter (29476): ├┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄
I/flutter (29476): │ ⛔ [ExplorerService] Error fetching native apps data
I/flutter (29476): └───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────

I read about a similar issue here.
I still opened this since it seems to be a different problem.

To Reproduce
Simply move into the example folder and run:
flutter run --dart-define=PROJECT_ID={PROJECT_ID}

Expected behavior
I would expect the endpoint to return the data, or the app to handle the error.
But of course I understand this is just an example app.
I'm just looking to run the app.

Smartphone:

  • Device: Oneplus 6T

doesn't handle multichain connection

trust-wallet app support chains like [eip155:1,eip155:56,eip155:137 ,...].
why in your web3modal only could be connected with eip155:1 .
I try to get wallets information with Cloud Explorer API but in it's response trust-wallet chains has only eip155:1 .
what can I do to handle this issue ?

[feature] Add custom headers to explorer-api request

What problem does this new feature solve?

Adds user-agent and referer headers in explorer-api requests

Describe the solution you'd like

  • user-agent that follows the pattern <web3modal version>/<core sdk version>/<operating system>
  • referer containing the name provided in the sdk metadata (with no spaces)

example:

headers: {
 user-agent: 'w3m-flutter-1.0.0/flutter-core-1.5.7/ios-16.5',
 referer: 'ExampleAppName'
}

Migrate Web3Modal to new v3 styles and de-couple it completely from WalletConnectModalFlutter package

We want to change the style of current Web3Modal and migrate it to v3 Design while at the same time removing completely the dependency from WalletConnectModal as they should be 2 separate packages

Tasks

[Epic] Milestone 2

Implementation Path

This is intended as an overview of critical path work for the Web3Modal Flutter SDK, from which we can break out concrete and more detailed individual issues. The list may change and reorder as we see necessary during the development process.

Features

  • Account view
  • Show balance in Account view
  • Show chain info in Account view
  • Adapt views to Light/Dark theme mode
  • Show errors/messages in internal toasts
  • Improve Connect Button
  • Chain select in Account View
  • Update docs

Next steps

TBD

[Epic] Milestone 1

Implementation Path

This is intended as an overview of critical path work for the Web3Modal Flutter SDK, from which we can break out concrete and more detailed individual issues. The list may change and reorder as we see necessary during the development process.

Features

Next steps

#2

Example doesn't compile

Thank you for this lib.
When i try to clone the project, I have some issues in the example project:

  • Web3ModalTheme and Web3ModalConnect don't exist in the project
  • import are not ok. We should haveimport 'package:web3modal_flutter/walletconnect_modal_flutter.dart'; instead of import 'package:web3modal_flutter/web3modal_flutter.dart';

Unable To Send Transactions

Describe the bug
I am Developing a application that can interact with a locally developed smart contract . The Connection and normal method contract calling works but I did not found any implementation for send transaction . In documentation it said to use the web3dart , but this requires private key to be stored in app . So I am trying this since 2 days now to just send the transaction using the session got from this plugin and tried many ways to do it but any of them did not work . Also looked at example app of this repo and tried to figure out, but is not working .Below are approches and their undesired outputs. I would really appreciate the response as soon as possible.

To Reproduce
Steps to reproduce the behavior:

  1. Run your own Smart Contract Locally and start node and deploy
  2. Setup web3modal_flutter as said in docs
  3. Try to call a method that is not just view and can also be payable
  4. See error or undesired behaviour

Expected behavior
Output should be transaction Id as it ,when done using web3dart . When done only using web3dart output is fine.But Real Wallet needs to be connected.

Screenshots/Codes and Outputs

 function registerDeveloper(
        bytes32 _name,
        bytes32 _profile_photo_ipfs,
        bytes32[] memory _techstack,
        bytes32 _profession
    )
    public returns (bool ){...}

Approches:

using Just web3dart (which works):

 return await _ethClient.sendTransaction(
        _mCreds,
        Transaction.callContract(
            contract: _contract,
            function: _registerDeveloper,
            parameters: [
              name.bytes32,
              profilePhotoIpfs.bytes32,
              techstack.map((e) => e.bytes32).toList(),
              profession.bytes32
            ]),
        chainId: 31337);

But when using wallet Credentials to pass in method sendTransaction. According to this solution

A2:

    var credentials = WalletConnectEthereumCredentials(
      wcClient: dapp,
      session: session,
    );
    final max = await _ethClient.estimateGas(
      data: _registerDeveloper.encodeCall( [
        name.bytes32,
        profilePhotoIpfs.bytes32,
        techstack.map((e) => e.bytes32).toList(),
        profession.bytes32
      ])
    );
    debugPrint(max.toString());

    var txn =  Transaction.callContract(
        contract: _contract,
        function: _registerDeveloper,
        maxGas: max.toInt(),
        parameters: [
          name.bytes32,
          profilePhotoIpfs.bytes32,
          techstack.map((e) => e.bytes32).toList(),
          profession.bytes32
        ]);



    var r  =  await _ethClient.sendTransaction(
        credentials,
       txn);
    debugPrint(r);

    return r;

A3:
using how it was called in example :

    final Transaction t = Transaction.callContract(  contract: _contract,
        function: _registerDeveloper,
        parameters: [
          name.bytes32,
          profilePhotoIpfs.bytes32,
          techstack.map((e) => e.bytes32).toList(),
          profession.bytes32
        ]);

debugPrint("---------------------------------------------------------------------------------");
    var s =  await  EIP155.ethSendTransaction(
        w3mService: _dapp,
        topic: topic,
        chainId: chainId,
        transaction: EthereumTransaction(
            from: from,
            to: _contract.address.hex,
          data: c.hex.encode(List<int>.from(t.data!))
          , value: "0x"),
        method: EIP155UIMethods.ethSendTransaction.name);
    debugPrint(s);
    return s;

The behaviour of above A2 & A3 is different the transaction is getting stuck , the control does not reach down to print s even after some minutes . When Direct web3dart send-transaction takes 2-3 secs. In case of A2 the maxgas is printed but r does not

Desktop (please complete the following information):

  • OS: Windows 11
  • Browser :chrome
  • Version : Version 120.0.6099.217 (Official Build) (64-bit)

Smartphone (please complete the following information):(Emulator)

  • Device: Pixel7Pro
  • OS: Android
  • SDK: API 34

How I can get multiple value from requestReadContract function?

Describe the bug
I try to read smart contract with requestReadContract,, for single value response is good.. but, for multiple value i just get response 1 value

Expected behavior
my expectation return list of value => [maxCap,lockedPeriod,apy ,rewardPercent,totalStaked]
My ABI:
"name": "pools",
"outputs": [
{"internalType": "uint256", "name": "maxCap", "type": "uint256"},
{"internalType": "uint256", "name": "lockedPeriod", "type": "uint256"},
{"internalType": "uint256", "name": "apy", "type": "uint256"},
{"internalType": "uint256", "name": "rewardPercent", "type": "uint256"},
{"internalType": "uint256", "name": "totalStaked", "type": "uint256"}
],

Actual behavior
I just get single response => result: 10000000000000000000000000 (value of maxCap)

smart contract interaction getting issue

Reference link used this #6

After clicking on confirm button getting below message

result = {_Map} size = 4
0 = {map entry} "code" -> 4001
1 = {map entry} "line" -> 64
2 = {map entry} "column" -> 331
3 = {map entry} "sourceURL" -> "index.android.bundle"

unexpected Char. foridden

Please am getting the following error below.

_Exception (Exception: FormatException: Unexpected character (at character 1)
Forbidden
^
)

image

includedWalletIds option causing an exception

Describe the bug
When providing a includedWalletIds option that includes the Metamask and Uniswap Wallet ids it results in an error. If you provide an includedWalletIds option of just Metamask it instead returns all the regular featured options and not just Metamask.

To Reproduce
Steps to reproduce the behavior:

  1. Configure includedWalletIds with the following values
{
    'c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96', // MetaMask
    'c03dfee351b6fcc421b4494ea33b9d4b92a984f87aa76d1663bb28705e95034a', // Uniswap
  };
  1. Include this option in your W3MService
W3MService(web3App: web3App, includedWalletIds: featuredWalletIds);
  1. See error

Expected behavior
A clear way to set a list of included wallet options and be able to provide any wallet option without it crashing.

Screenshots
If applicable, add screenshots to help explain your problem.

Smartphone (please complete the following information):

  • Device: iPhone 13 Pro Max
  • OS: iOS 17.0.3

Additional context
Stack

════════ Exception caught by widgets library ═══════════════════════════════════
The following RangeError was thrown building ValueListenableBuilder<List<W3MWalletInfo>>(dirty, state: _ValueListenableBuilderState<List<W3MWalletInfo>>#143a1):
RangeError (end): Invalid value: Not in inclusive range 0..2: 4

The relevant error-causing widget was
MaterialApp
main.dart:94
When the exception was thrown, this was the stack
#0      RangeError.checkValidRange (dart:core/errors.dart:365:9)
#1      ListBase.getRange (dart:collection/list.dart:356:16)
#2      _WalletsListShortPageState.build.<anonymous closure>
#3      _ExplorerServiceItemsListenerState.build.<anonymous closure>.<anonymous closure>
explorer_service_items_listener.dart:43
#4      _ValueListenableBuilderState.build
value_listenable_builder.dart:186
#5      StatefulElement.build
framework.dart:5409
#6      ComponentElement.performRebuild
framework.dart:5297
#7      StatefulElement.performRebuild
framework.dart:5462
#8      Element.rebuild
framework.dart:5016
#9      BuildOwner.buildScope
framework.dart:2779
#10     WidgetsBinding.drawFrame
binding.dart:916
#11     RendererBinding._handlePersistentFrameCallback
binding.dart:360
#12     SchedulerBinding._invokeFrameCallback
binding.dart:1297
#13     SchedulerBinding.handleDrawFrame
binding.dart:1227
#14     SchedulerBinding._handleDrawFrame
binding.dart:1085
#15     _invoke (dart:ui/hooks.dart:170:13)
#16     PlatformDispatcher._drawFrame (dart:ui/platform_dispatcher.dart:401:5)
#17     _drawFrame (dart:ui/hooks.dart:140:31)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.