Assuming that I'm running my own instance of pub-dartlang
for a private pub feed; how do I indicate in pubspec.yaml
which packages come from the private feed vs pub.dartlang.org?
You can use dependency_overrides to temporarily override all references to a dependency.
Open the console, move to the root of your project (the same folder as the pubspec file) and run flutter format . if you haven't already. Run the flutter pub publish command. Type 'y' when prompted and then open the link generated by the console to confirm and validate your package publish.
Run flutter pub get in the terminal, or click Packages get in IntelliJ or Android Studio. Run the app (or stop and restart it, if it was already running before adding the plugin). Click Show Flutter homepage. You should see the default browser open on the device, displaying the homepage for flutter.
Some of pub's dependencies are downloaded to the pub cache. By default, this directory is located under . pub-cache in your home directory (on macOS and Linux), or in %LOCALAPPDATA%\Pub\Cache (on Windows). (The precise location of the cache may vary depending on the Windows version.)
You can set the environment variable PUB_HOSTED_URL
so it points to your custom pub repo server. This way pub
loads all packages which don't have a server specified from this server.
You can define exceptions in pubspec.yaml
like
dependencies:
transmogrify:
hosted:
name: transmogrify
url: http://some-package-server.com
see https://www.dartlang.org/tools/pub/dependencies.html for more details.
There is another package that seems to provide a custom Pub repo https://pub.dartlang.org/packages/pub_proxy_server
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