Skip to content

Conversation

ebenjs
Copy link

@ebenjs ebenjs commented Dec 14, 2023

This PR is targeting issue #7122

We're used to having the ability to easily install packages by copying the install code and pasting it directly into the console. This is especially helpful when you need to quickly install a package. Popular platforms like https://www.npmjs.com/package/axios, https://crates.io/crates/http, and https://pypi.org/project/http1/ all employ this design.

Currently, there's something similar in the header section of the package page after the package name. However, this command only allows you to copy text that's intended to be pasted in the pubspec.yml file and manually run 'pub get install.'

Therefore, I suggest adding this feature as it would be a time-saving feature for all developers.

Here is a screenshot

Screenshot from 2023-12-14 16-28-44

  • I’ve reviewed the contributor guide and applied the relevant portions to this PR.
Contribution guidelines:

Note that many Dart repos have a weekly cadence for reviewing PRs - please allow for some latency before initial review feedback.

@isoos
Copy link
Collaborator

isoos commented Dec 15, 2023

Note: I've pushed this to the staging site:
https://isoos-dot-dartlang-pub-dev.appspot.com/packages/email_validator

I find the gray background a bit off in the sidebar, I think we should look for a more blended-in design.

/cc @jonasfj @szakarias @sigurdm

@Levi-Lesches
Copy link

I like the concept -- a lot of packages know they have an installation tab but still include the command on the front page because it's what people will see first. But I think longer package names will be cut off if used on the sidebar. What about here?

image

@sigurdm
Copy link
Contributor

sigurdm commented Sep 22, 2025

We could have the copy button open a drop down, so you could copy either for the pubspec or the command line.

Something like

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants