Search packages, repositories and app categories

dcdg cover
Package detailsv4.1.0

dcdg

A tool to automatically generate class diagrams (like UML) from a Dart package.

AndroidiOSmacOSWindowsLinux
30-day downloads
444
Likes
179
Pub points
120

Install package

flutter pub add dcdg

Package Overview

Package selection guidance compiled from public package information, community data, and project usage.

dcdg is a developer tool that automatically generates class diagrams, such as UML, from Dart packages. It analyzes the structure of Dart code to visualize classes, their relationships, and inheritance hierarchies, aiding in understanding complex codebases. Ideal for documentation, onboarding, or design review, it supports multiple platforms including Android, iOS, macOS, Windows, and Linux. The tool integrates via Flutter pub and is open-source, hosted on GitHub.

Use cases

  • Codebase documentation
  • Onboarding new developers
  • Design visualization
  • Refactoring planning
  • Technical documentation

Key features

  • Automatic UML diagram generation
  • Supports multi-platform projects
  • Open-source and extensible
  • Integrates with Flutter pub
  • Visualizes class relationships

Suitable for

  • Dart developers
  • Team documentation
  • Large codebases
  • Software architects
  • Educational purposes

Considerations

  • Requires Dart code analysis
  • Output quality depends on code structure
  • Not real-time updates
  • Limited customization options
  • Best for static analysis

Original README

Original README snapshot from the linked source repository. Visit the repository for the latest content.

Build Status

Dart Class Diagram Generator

A small command line utility to generate a class (UML or similar) diagram from a Dart package.

Examples

Below is a UML diagram of the dcdg source code, created with dcdg. You can find the PlantUML source in the example/ directory.

Example UML Diagram

Installation

Install from pub:

dart pub global activate dcdg

Install from clone:

dart pub global activate -s path .

Usage

From inside a Dart package directory:

dart pub global run dcdg

This will dump a PlantUML file to stdout. You can save it to a file instead with the -o option.

If you'd like to create a Mermaid file instead, pass the -b option with mermaid as its argument:

dart pub global run dcdg -b mermaid

See --help for more options, including ways to filter what ends up in the output. You can find the help contents in USAGE.txt as well.

Examples

There are test fixtures in test/fixtures/. Each Dart package in this directory contains various (fake) classes. Try running DCDG against these fixtures to familiarize yourself with how it works.

Contributing

Pull requests are welcome! It is intended to be reasonably straightforward to add a new output format. Take a look at the DOT format implementation in lib/src/builders for an example.

If you have found a bug or have a feature request please open an issue.

Development

Format code using the tool/format.sh script. It will have a non-zero exit code if the formatting changed. That's fine, it does that so it can be used in CI.

Run the full test suite (including unit and functional tests) with tool/check.sh.

If you change the user interface or add features you should run tool/docs.sh to regenerate documentation and other resources. This script requires PlantUML.

Categories

Dependencies

Dependency list 3 items

Source repository

Projects using this package

No data available yet.