Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a setting to run "pub get" with "--offline" #3924

Closed
jellynoone opened this issue Apr 13, 2022 · 2 comments
Closed

Add a setting to run "pub get" with "--offline" #3924

jellynoone opened this issue Apr 13, 2022 · 2 comments
Labels
in commands Relates to commands (usually invoked from the command Palette) is enhancement
Milestone

Comments

@jellynoone
Copy link

jellynoone commented Apr 13, 2022

Is your feature request related to a problem? Please describe.
Personally, I more or less work offline, and with a constant set of external dependencies or path defined. Currently, if I save the pubspec.yaml file it runs dart pub get which fails because there is no network access, however all of my dependencies are already on disk and manually running dart pub get --offline works just fine.

Describe the solution you'd like
The plugin could:

  1. Offer a setting where you could configure to run dart pub get --offline by default
  2. Check the internet connection when saving the pubspec.yaml file, and if there is no connection, run the offline variant. And possibly show an info / warning message if fetching --offline.

Personally, the second option makes the most sense to me and would fit my use case the best.

Describe alternatives you've considered
Using the command line, but if I save the pubspec.yaml file the command has already begun running.

@DanTup
Copy link
Member

DanTup commented Apr 20, 2022

I don't know if there's a great way for us to reliably detect if we're offline across all platforms, although there's an existing setting to use --offline with Flutter: New Project so I think making that setting more generic and using it for both probably makes sense.

@DanTup DanTup added this to the v3.40.0 milestone Apr 20, 2022
@DanTup DanTup added the in commands Relates to commands (usually invoked from the command Palette) label Apr 20, 2022
@DanTup DanTup changed the title Use offline mode pub get flag when there is no network access Add a setting to run "pub get" with "--offline" Apr 20, 2022
@DanTup DanTup closed this as completed in caf4556 Apr 20, 2022
@jellynoone
Copy link
Author

Aha, makes sense!

Thank you for addressing this so quickly!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in commands Relates to commands (usually invoked from the command Palette) is enhancement
Projects
None yet
Development

No branches or pull requests

2 participants