simolus3 / web3dart

Ethereum library, written in Dart.
MIT License
442 stars 273 forks source link

How to use Flutter Web3Dart to implement web browser loading dApp? #163

Closed EvnLi closed 3 years ago

simolus3 commented 3 years ago

So you just want to use web3dart in a Flutter web app? You can use the browser library for use it in Ethereum-enabled browsers. You can also use it in any other browser if you supply your own Ethereum node to connect to, web3dart is not platform-specific.

EvnLi commented 3 years ago

It is not a web page. I want to realize the DAPP browser through WebView in the APP application. I have not found relevant information for a long time, is there any way to achieve it? Thank you very much!

EvnLi commented 3 years ago

Similar common dApp browsers include Mist, Metamask, Coinbase Wallet, Trust Wallet, ImToken, Status, Cipher, etc

simolus3 commented 3 years ago

Which webview package are you using? Can you inject arbitrary JavaScript into the page shown in your webview (or force shown pages to add a JS library you control)?

EvnLi commented 3 years ago

flutter_inappwebview,Browsers are built with Similar common dApp including Mist, Metamask. Browsers are built with flutter_inappWebView. Browsers are built with Similar common dApp including Mist, Metamask. Coinbase Wallet, Trust Wallet, IMToken, Status, Cipher, etc. By entering the address of the DAPP project, you can authorize your own Wallet account information. In fact, it is just how to realize the DAPP browser

simolus3 commented 3 years ago

You can use addJavaScriptHandler to add a custom callback that can be called in the website you're showing. This callback could be used to execute an Ethereum rpc call. Then, you can use injectJavascriptFileFromAsset to inject a JavaScript file implementing window.ethereum over that custom injected callback.

EvnLi commented 3 years ago

Thank you very much!

windswrold commented 3 years ago

@EvnLi Can you please consult how to use Flutter Web3Dart to implement web browser loading dApp?

athlona64 commented 3 years ago

@EvnLi Can you please consult how to use Flutter Web3Dart to implement web browser loading dApp?