Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Show dart pub add --dev for development-only packages

Closed
#9,502 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
35/100
Issue type
Feature
Clarity
Needs clarification
Activity status
Quiet
Tech stack
dart
Domain
web-dev

Research direction

Start by locating the Install tab implementation and the package metadata used to generate its commands. Review how package authors could indicate development-only usage and confirm the supported dart pub add syntax; done means the generated instructions use the development form for marked packages while regular packages remain unchanged.

Written by the indexing model from the issue text.

Description

Type: enhancement

Summary

Some packages are intended to be used only as development dependencies, such as code generators, linters, and testing tools.

However, the Install tab on pub.dev always generates a regular install command, for example:

dart pub add build_runner

This can mislead users into adding development-only packages to dependencies instead of dev_dependencies.

Examples

Examples of packages that are typically added as development dependencies:

  • build_runner
  • flutter_lints
  • test
  • riverpod_generator

For these packages, the recommended command would instead be:

dart pub add dev:build_runner

(or the equivalent command for the current supported syntax).

Proposal

Allow package authors to indicate that a package is intended to be installed as a development dependency.

pub.dev could then generate the appropriate install command automatically for those packages.

This would only affect the generated installation instructions and would not prevent users from installing the package as a regular dependency if they intentionally choose to do so.

Motivation

Many beginners simply copy and paste the generated command from the Install tab.

Providing the recommended command would help users follow best practices and reduce accidental misuse of development-only packages.

Dominant language
Dart
Stars
944
Forks
183
Avg merge
1d 2h
Merged PRs (30d)
85

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from dart-lang/pub-dev

All issues in dart-lang/pub-dev

Similar issues

More Dart issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.