Skip to content

Instantly share code, notes, and snippets.

@ChrisMarxDev
Last active June 19, 2020 08:19
Show Gist options
  • Save ChrisMarxDev/732328f8c614e848019d4050a33cc8fc to your computer and use it in GitHub Desktop.
Save ChrisMarxDev/732328f8c614e848019d4050a33cc8fc to your computer and use it in GitHub Desktop.
Initialize a web3client for Flutter
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