So I have a dart program and I want to add a dart package from github, not from the normal way of adding packages using the IDE package manager since the github version has the latest code.
What would be the process to do this?
This works for me in the real world.
name: game
description: A sample web application
dependencies:
browser: any
three:
git:
ref: master
url: 'git://github.com/threeDart/three.dart.git'
The Dart SDK libraries are built in and are identified with the special dart: prefix. For external libraries installed by pub, use the package: prefix. Get the import details for the package’s main library: Go to vector_math’s entry on the Package site. Click the Installing tab.
To use a package, do the following: Create a pubspec (a file named pubspec.yaml that lists package dependencies and includes other metadata, such as a version number). Use pub to get your package’s dependencies. If your Dart code depends on a library in the package, import the library.
The dart pub get command installs the packages in your app’s dependencies list. Each package can contain libraries and other assets. Pub works recursively; if an included package has dependencies, those packages are installed as well.
The Dart SDK libraries are built in and are identified with the special dart: prefix. For external libraries installed by pub, use the package: prefix. Get the import details for the package’s main library: Go to vector_math’s entry on the Package site. Click the Installing tab. Copy the import line.
You can add a dependency to your pubspec.yaml file which points directly to a git url.
For example this pubspec.yaml file adds a dependency to the kittens package:
name: My Dart program
description: Blah
dependencies:
kittens:
git: git://github.com/munificent/kittens.git
For more info see the pubspec.yaml docs.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With