搜索插件、代码仓与 APP 分类

dcdg 封面
插件详情v4.1.0

dcdg

一个工具,可自动从 Dart 包生成类图(如 UML)。

AndroidiOSmacOSWindowsLinux
近 30 天下载
444
喜欢数
179
Pub 分数
120

安装插件

flutter pub add dcdg

插件介绍

基于插件公开信息、社区数据与项目使用情况整理的选型参考。

dcdg 是一个开发者工具,可自动从 Dart 包生成类图(如 UML)。它分析 Dart 代码的结构,以可视化类、它们之间的关系以及继承层次,有助于理解复杂的代码库。适用于文档编写、新员工入职或设计评审,支持 Android、iOS、macOS、Windows 和 Linux 等多个平台。该工具通过 Flutter pub 集成,是开源项目,托管在 GitHub 上。

适合场景

  • 代码库文档
  • 新开发人员入职
  • 设计可视化
  • 重构规划
  • 技术文档

主要特点

  • 自动生成UML图
  • 支持多平台项目
  • 开源且可扩展
  • 与 Flutter pub 集成
  • 可视化类关系

适合对象

  • Dart 开发人员
  • 团队文档
  • 大型代码库
  • 软件架构师
  • 教育用途

使用建议

  • 需要 Dart 代码分析
  • 输出质量取决于代码结构
  • 非实时更新
  • 有限的自定义选项
  • 最适合静态分析

原始 README

以下为关联源码仓库的 README 原文快照,最新内容请访问源码仓库。

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.

所属分类

依赖

依赖清单 3 项

源码仓库

使用此插件的项目

暂无相关数据。