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

插件详情v1.0.5

pubspec_dependency_sorter

帮助将 Flutter/Dart 的 pubspec.yaml 依赖项按字母顺序排序。

AndroidiOSmacOSWindowsLinux
近 30 天下载
7.2万
喜欢数
43
Pub 分数
115

安装插件

flutter pub add pubspec_dependency_sorter

插件介绍

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

一个用于 Flutter 和 Dart 项目的开发工具,可自动将 pubspec.yaml 文件中的依赖项按字母顺序排序。它确保依赖项列表整洁、一致且易于阅读,从而提高可维护性并减少合并冲突。该工具设计简洁高效,通过命令行界面无缝集成到开发工作流中。支持所有主要平台,包括 Android、iOS、macOS、Windows 和 Linux。

适合场景

  • 保持 pubspec.yaml 文件的整洁
  • 减少团队环境中的合并冲突
  • 自动化依赖项组织
  • 提高项目依赖项的可读性
  • 简化代码审查流程

主要特点

  • 依赖项的字母排序
  • 命令行集成
  • 支持所有 Flutter 平台
  • 简单且轻量
  • 保留现有结构和注释

适合对象

  • Flutter 开发者
  • 基于团队的项目
  • CI/CD 流水线
  • 代码质量自动化
  • 频繁更新依赖项的项目

使用建议

  • 不验证依赖项语法
  • 除非集成到脚本中,否则需要手动执行
  • 可能与其他格式化工具冲突
  • 没有可用的配置选项
  • 仅影响 pubspec.yaml 文件

原始 README

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

Package helps to sort the flutter/dart packages and plugins alphabetically, This makes it easier when managing too many packages and when working with teams

Features

  • sort dependencies
  • prevent dependecy conflicts
  • clean up the pubspec.yaml file

Getting started

Install flutter or dart sdk then depend on the package.

dev_dependencies:
  pubspec_dependency_sorter: ^1.0.4

Usage

To use the package run in your flutter/dart app root directory

   dart run pubspec_dependency_sorter

if your pubspec.yam is located somewhere else use the following command by passing the path of the directory where the pubspec.yaml file is located.

  dart run pubspec_dependency_sorter PATH-TO-YOUR-DIRECTORY

sample output

dependency_sorter sample output

Additional information

Feel free to add features,improvemets and fix bugs then create a PR.

所属分类

依赖

依赖清单 3 项

源码仓库

使用此插件的项目

所在榜单