Support URLs and paths in Add Dependency command
See original GitHub issueI am using v3.27.2
of the extension and I searched for a similar issue but I didn’t find anything related.
Currently, the auto-completion about dependencies just works in pubspec.yaml
but I think it can be better to add the dependencies in import (for tired guys can be the best solution).
At this time the process for using a package is: (expect its kind - local, hosted on pub server or as a dev dep)
- Adding dependencies in
pubspec.yaml
- Runnin
pub get
to fetch the package and other related configs - import it and use it
But I suggest a new way (I am not sure this feature can be implemented in extension or not let me know).
For example, we want to add a dependency in the dependency
section in pubspec.yaml
what we should do is:
- import the package with this syntax
import 'dep:<package_name | git_remote_repo | local/path/to/package>';
auto completion works as same logic as used inpubspec.yaml
(with some modification) crtl + .
click onfetch package
- then
pub add <package_name> --<associated_switch>
will run and do all configurations
Note: as dev dependency we can use import 'dev:<package_name | git_remote_repo | local/path/to/package>';
Issue Analytics
- State:
- Created 2 years ago
- Comments:12 (12 by maintainers)
Top Results From Across the Web
Adding package dependencies to your app - Apple Developer
To add a package dependency to your Xcode project, select File > Swift Packages > Add Package Dependency and enter its repository URL....
Read more >Managing dependencies - The Go Programming Language
To track and manage the dependencies you add, you begin by putting your code in its own module. This creates a go.mod file...
Read more >package.json - npm Docs
Users can use the npm fund subcommand to list the funding URLs of all dependencies of their project, direct and indirect. A shortcut...
Read more >cargo add - The Cargo Book
This command can add or modify dependencies. The source for the dependency can be specified with: crate @ version: Fetch from a registry...
Read more >Add build dependencies - Android Developers
To add a dependency to your project, specify a dependency configuration such as implementation in the dependencies block of your module's build.gradle file....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@EhsanAramide it’s not problem at all, I understand how things are. I’ll work on this for the next release - thank you for your effort in starting this though! 😃
You’re welcome to have a go if you want 😃
The way I was thinking it would work is that we insert two new items in the picklist, one for URLs and one for paths. Select the path option would open the folder picker and let you browser to the folder, and picking URL would just give an input box that is validated as a URL. Then the results just get passed to
pub add
the same way the package name would.