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

插件详情v2.17.1

build_runner

用于 Dart 代码生成和模块化编译的构建系统。

macOSWindowsLinux
近 30 天下载
768万
喜欢数
2370
Pub 分数
160

安装插件

flutter pub add build_runner

插件介绍

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

Build_runner 是一个专为 Dart 设计的构建系统,旨在自动化代码生成和模块化编译。它与 Dart 生态系统集成,可执行根据注解、配置文件或其他输入生成代码的构建器。通过采用声明式配置模型,它能够实现高效且增量式的构建,并支持广泛的用例,包括 JSON 序列化、依赖注入以及自定义代码生成。在大型项目中尤其有用,因为手动维护生成的代码容易出错且耗时。

适合场景

  • 自动化代码生成
  • JSON 序列化
  • 依赖注入设置
  • 自定义构建器集成
  • 增量编译

主要特点

  • 声明式构建配置
  • 对多个构建器的支持
  • 增量构建执行
  • 可扩展的插件架构
  • 与 pub 包管理器集成

适合对象

  • 大型 Dart 项目
  • 代码生成工作流程
  • 团队开发环境
  • CI/CD 流水线
  • 使用注解进行代码生成的开发者

使用建议

  • 需要了解构建配置
  • 可能增加初始设置的复杂性
  • 性能取决于构建器的效率
  • 不适合简单的单次脚本
  • 需要适当的依赖管理

原始 README

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

Questions? Suggestions? Found a bug? Please file an issue or start a discussion.

Code generation for Flutter and Dart packages.

See the build_runner package documentation for how to use build_runner builders in your package to add serialization, data classes, data binding, dependency injection, mocking and more.

See the build package documentation to create your own builder.

This repo also hosts the following builders and packages for use by builders.

所属分类

依赖

依赖清单 30 项

源码仓库

使用此插件的项目

所在榜单