Add the dependency in pubspec.yaml
like
Edit pubspec.yaml in text mode
dependencies:
widget:
git: git@github.com:dart-lang/widget.dart.git
Use the assistant
if you open the pubspec.yaml
file in DartEditor you get a nice assistant
- click
Add...
- Enter name of package: 'widget'
- Change the lookup
Source
fromhosted
togit
- Set
Git ref:
togit@github.com:dart-lang/widget.dart.git
Additional Info:
- You can look up the dependency name in the file
pubspec.yaml
in the widget's GitHub repository undername: widget
- You can copy the git path from the GitHub repository under
SSH clone URL
(above the 'Download ZIP` button)
EDIT
To make this work you need to have the git command line client installed on your local system.
You can download the repository manually
git clone git@github.com:dart-lang/widget.dart.git
and add the following dependency
dependencies:
widget:
git: ../widget.dart
# path: ../widget.dart # would work too
Alternatively you can download the repository from GitHub (Download as ZIP) extract it to your local drive and use a path:
dependency like
dependencies:
widget:
path: ../widget.dart
provided you extracted the ZIP to a sibling folder of your package.
See also https://www.dartlang.org/tools/pub/dependencies#git-packages