January 2020
Intermediate to advanced
368 pages
12h 45m
English
Finally, you can use packages that aren’t hosted on Pub. This is good if you’re developing a package or don’t want to open source your package.
To use packages from Git, import packages similarly to the following code example in your pubspec.yaml file:
dependencies:
cool_package:
git: git://github.com/cool_company/cool_packages.git
Or you can use a specific branch of the Git repo:
dependencies:
kittens:
git:
url: git://github.com/munificent/kittens.git
ref: some-branch
And you can use subfolders of a repo (useful if you have mono-repo-style projects):
dependencies:
kittens:
git:
url: git://github.com/munificent/cats.git
path: path/to/kittens
You can tell Pub ...
Read now
Unlock full access