Last active
June 19, 2020 08:19
-
-
Save ChrisMarxDev/732328f8c614e848019d4050a33cc8fc to your computer and use it in GitHub Desktop.
Initialize a web3client for Flutter
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:http/http.dart'; | |
import 'package:web3dart/web3dart.dart'; | |
class _MyHomePageState extends State<MyHomePage> { | |
Client httpClient; | |
Web3Client ethClient; | |
@override | |
void initState() { | |
super.initState(); | |
httpClient = new Client(); | |
ethClient = new Web3Client("http://localhost:8545", httpClient); | |
} | |
// rest of class | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment