Skip to content

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

@jellynoone

Description

@jellynoone

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    in commandsRelates to commands (usually invoked from the command Palette)is enhancement

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions