webthree
2.7.6, released 2 years ago by devopsdao.com
A Web3 library for Dart to interact with Ethereum nodes via HTTP or WebSocket.
What it does
It allows Dart and Flutter developers to connect to local or remote Ethereum nodes, call contract functions, listen for contract events, manage credentials, and send signed transactions. It also includes support for custom credentials providers like WalletConnect and Metamask, alongside ABI-based code generation.
AI-written summary of version 2.7.6, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need to interact with Ethereum or EVM-compatible blockchains in a Dart/Flutter application.
- You want to generate Dart bindings from smart contract ABIs using build_runner.
- You require custom credential providers like MetaMask or WalletConnect.
Skip it when
- You need support for non-Ethereum blockchains that this library does not cover.
- You prefer a strictly lightweight library without external build dependencies.
Strengths
- Supports connecting to Ethereum nodes via HTTP and WebSocket.
- Built-in smart contract ABI code generator for type-safe interactions.
- Supports WalletConnect and Metamask integrations.
Weaknesses
- Some advanced solidity types might have limited support.
- Requires build_runner configuration for code generation features.
Setup
- Kind
- Pure Dart
- Effort
- Medium
- Code generation
- Yes (build_runner)
- Direct dependencies
- 18
Requires adding contract ABI JSON files and running build_runner for code generation if using smart contract bindings.
import 'package:http/http.dart';
import 'package:webthree/webthree.dart';
var apiUrl = "http://localhost:7545";
var httpClient = Client();
var ethClient = Web3Client(apiUrl, httpClient);
var credentials = EthPrivateKey.fromHex("0x...");
var address = await credentials.address;
EtherAmount balance = ethClient.getBalance(address);Alternatives
Packages that do the same job and could replace webthree.
- web3dart
WebThree is a fork of web3dart; you may choose the original package depending on your stability or maintenance preferences.
79Compare - blockchain_utils
Provides a comprehensive set of cryptographic and serialization utilities for multi-chain blockchain development.
72Compare
Works with
Packages commonly used together with webthree: ones it builds on, ones built on it, and its own family.
- uuidwebthree depends on itGenerates and parses RFC‑4122/9562 UUIDs (v1‑v8) for Dart.
- dart_stylewebthree depends on itProvides an API and CLI to format Dart source code automatically.
- typed_datawebthree depends on itUtility functions and classes for easier work with dart:typed_data lists.
- code_builderwebthree depends on itA fluent, builder-based library for generating valid Dart code programmatically.
- built_collectionwebthree depends on itImmutable collections based on SDK collections with builder pattern.
- convertwebthree depends on itEncoders and decoders for converting between different data representations.
- stream_channelwebthree depends on itAn abstraction for two-way communication channels based on the Dart Stream class.
- stream_transformwebthree depends on itExtension methods adding common stream transform operators