What would be the best way to actually deploy dart code that has pubspec.yaml dependencies? A common thing I've done in the past was to create demos and deploy to github pages. Now that pub uses symbolic links the dependencies do not get pushed to github. Also wondering if this should be a bug to file for pub, being able to deploy with dependencies.
Every pub package needs some metadata so it can specify its dependencies. Pub packages that are shared with others also need to provide some other information so users can discover them. All of this metadata goes in the package's pubspec: a file named pubspec.
The pubspec is written in YAML, which is human readable, but be aware that white space (tabs v spaces) matters. The pubspec file specifies dependencies that the project requires, such as particular packages (and their versions), fonts, or image files.
For application packages, we recommend that you commit the pubspec. lock file. Versioning the pubspec. lock file ensures changes to transitive dependencies are explicit.
yaml" file is inside "test" folder, while you're running the "flutter pub get" command inside the "mobile" folder. Try moving that file from inside of "test" folder to the "mobile" folder; where your "lib", "ios", "android" folders are. Then only "flutter pub get" command will work.
We aren't there yet, but pub will in the future support a deploy
command. That will do things like run dart2js and concatenate/minify your code. It will also physically bring in all of your dependencies so you don't have symlinks. The end result will be a single directory that contains everything your package needs to run.
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