Skip to content
pubscout

dtd

4.0.0, released a year ago by tools.dart.dev

Client library for communicating with the Dart Tooling Daemon (DTD).

WASM-readyQuiet but busy
$ flutter pub add dtd
Source repository

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.