dtd
4.0.0, released a year ago by tools.dart.dev
Client library for communicating with the Dart Tooling Daemon (DTD).
What it does
Provides a client API to connect and interact with the Dart Tooling Daemon over WebSockets. Enables developer tools to perform workspace file system access, register service methods, and broadcast or listen to tool streams. It facilitates inter-tool communication within IDEs and command-line development environments.
AI-written summary of version 4.0.0, based on the package's README and metadata. Report an inaccuracy
Use it when
- Building custom Dart or Flutter developer tools, IDE extensions, or DevTools plugins.
- Exchanging events or services between development tools running in the same workspace.
- Accessing project workspace files via the standardized Dart Tooling Daemon interface.
Skip it when
- Building standard end-user Flutter applications with no developer tooling integration.
- Operating outside of a Dart development environment that lacks an active DTD instance.
Strengths
- Standardized communication protocol across IDEs (VS Code, IntelliJ) and CLI tooling.
- Supports custom service registration and RPC calls between separate developer tools.
- Provides built-in stream handling and workspace file system access abstractions.
Weaknesses
- Requires an active external DTD process (started via IDE or CLI runner with --print-dtd) during development and runtime.
- Not intended for runtime application logic or end-user features.
Setup
- Kind
- Pure Dart
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 5
Requires obtaining an active DTD URI by copying it from an IDE workspace action or launching an app with the --print-dtd flag.
import 'package:dtd/dtd.dart';
void main() async {
final dtdUri = 'ws://127.0.0.1:62925/';
final client = await DartToolingDaemon.connect(dtdUri);
// Use client to register services or listen to streams
await client.close();
}Works with
Packages commonly used together with dtd: ones it builds on, ones built on it, and its own family.
- web_socket_channeldtd depends on itCross‑platform WebSocket channel wrapper for Dart
- stream_channeldtd depends on itAn abstraction for two-way communication channels based on the Dart Stream class.
- test_apiSame familyThe user facing API for structuring Dart tests and checking expectations.
- shelfSame familyComposable web server middleware for Dart
- shelf_web_socketSame familyShelf handler that upgrades HTTP to WebSocket and provides a WebSocketChannel per connection.
- sseSame familyBidirectional Server Sent Events client and server for Dart.
- dwdsSame familyProxies between the Chrome debug protocol and the Dart VM service protocol.
- build_runnerSame familyA build system for Dart code generation and modular compilation.