Repository navigation
[flutter_tools] forward --offline flag to pub.get in update-packages - #193619
Merged
Merged
Conversation
When running `flutter update-packages --offline`, the offline flag was parsed and used to validate incompatible option combinations, but was not forwarded to the underlying `pub.get` invocations. Forward the parameter so that pub does not attempt network operations in offline environments. Fixes flutter#193423
Contributor
There was a problem hiding this comment.
Code Review
This pull request adds support for the --offline flag in the update-packages command, propagating the offline setting to all internal pub get calls. It also updates the test suite to verify that the offline flag is correctly passed. There are no review comments, and I have no feedback to provide.
chingjun
approved these changes
Oct 2, 2026
This was referenced Oct 3, 2026
7 of 11 tasks
Member
|
Reason for revert: info • Use 'const' with the constructor to improve performance. Try adding the 'const' keyword to the constructor invocation • packages/flutter_tools/test/commands.shard/hermetic/update_packages_test.dart:315:24 • prefer_const_constructors |
Contributor
|
Successfully created revert PR: #193808 |
9 tasks done
dayanruben
pushed a commit
to dayanruben/flutter
that referenced
this pull request
Oct 5, 2026
…ackages (flutter#193808) Reverts: [[flutter_tools] forward --offline flag to pub.get in update-packages](flutter#193619) Initiated by: @cbracken Reason for reverting: info • Use 'const' with the constructor to improve performance. Try adding the 'const' keyword to the constructor invocation • packages/flutter_tools/test/commands.shard/hermetic/update_packages_test.dart:315:24 • prefer_const_constructors Original PR Author: @bkonyi Reviewed By: @chingjun The original PR description is provided below: When running `flutter update-packages --offline`, the `--offline` flag was parsed and used to validate incompatible option combinations (such as `--force-upgrade` and `--cherry-pick-package`), but was not forwarded to the underlying `pub.get` invocations. Forward `offline` through `_pubGet` to `pub.get` so that `pub` does not attempt network operations in offline environments. Fixes flutter#193423 ## Pre-launch Checklist - [x] I read the [Contributor Guide] and followed the process outlined there for submitting PRs. - [x] I read the [Tree Hygiene] wiki page, which explains my responsibilities. - [x] I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement]. - [x] I signed the [CLA]. - [x] I listed at least one issue that this PR fixes in the description above. - [x] I updated/added relevant documentation (doc comments with `///`). - [x] I added new tests to check the change I am making, or this PR is [test-exempt]. - [x] I followed the [breaking change policy] and added [Data Driven Fixes] where supported. - [x] All existing and new tests are passing.
This was referenced Oct 5, 2026
9 tasks done
This was referenced Oct 5, 2026
This was referenced Oct 7, 2026
opensource-fork-sync Bot
pushed a commit
to cla7aye15I4nd/opensource-flutter__flutter
that referenced
this pull request
Oct 23, 2026
…ackages" (flutter#193838) Relands flutter#193619 (reverted in flutter#193808) with `const` added to `DelegatingToolContext()` in `update_packages_test.dart` to satisfy `prefer_const_constructors`. When running `flutter update-packages --offline`, the `--offline` flag was parsed and used to validate incompatible option combinations (such as `--force-upgrade` and `--cherry-pick-package`), but was not forwarded to the underlying `pub.get` invocations. Read `boolArg(_keyOffline)` in `_pubGet` and forward it to `pub.get` so that `pub` does not attempt network operations in offline environments. Fixes flutter#193423 ## Pre-launch Checklist - [x] I read the [Contributor Guide] and followed the process outlined there for submitting PRs. - [x] I read the [Tree Hygiene] wiki page, which explains my responsibilities. - [x] I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement]. - [x] I signed the [CLA]. - [x] I listed at least one issue that this PR fixes in the description above. - [x] I updated/added relevant documentation (doc comments with `///`). - [x] I added new tests to check the change I am making, or this PR is [test-exempt]. - [x] I followed the [breaking change policy] and added [Data Driven Fixes] where supported. - [x] All existing and new tests are passing. [Contributor Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview [Tree Hygiene]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md [test-exempt]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests [Flutter Style Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md [Features we expect every widget to implement]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement [CLA]: https://cla.developers.google.com/ [breaking change policy]: https://flutter.dev/to/breaking-changes [Data Driven Fixes]: https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
suryaKommana2662
pushed a commit
to suryaKommana2662/flutter
that referenced
this pull request
Oct 29, 2026
…lutter#193619) When running `flutter update-packages --offline`, the `--offline` flag was parsed and used to validate incompatible option combinations (such as `--force-upgrade` and `--cherry-pick-package`), but was not forwarded to the underlying `pub.get` invocations. Forward `offline` through `_pubGet` to `pub.get` so that `pub` does not attempt network operations in offline environments. Fixes flutter#193423 ## Pre-launch Checklist - [x] I read the [Contributor Guide] and followed the process outlined there for submitting PRs. - [x] I read the [Tree Hygiene] wiki page, which explains my responsibilities. - [x] I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement]. - [x] I signed the [CLA]. - [x] I listed at least one issue that this PR fixes in the description above. - [x] I updated/added relevant documentation (doc comments with `///`). - [x] I added new tests to check the change I am making, or this PR is [test-exempt]. - [x] I followed the [breaking change policy] and added [Data Driven Fixes] where supported. - [x] All existing and new tests are passing.
suryaKommana2662
pushed a commit
to suryaKommana2662/flutter
that referenced
this pull request
Oct 29, 2026
…ackages (flutter#193808) Reverts: [[flutter_tools] forward --offline flag to pub.get in update-packages](flutter#193619) Initiated by: @cbracken Reason for reverting: info • Use 'const' with the constructor to improve performance. Try adding the 'const' keyword to the constructor invocation • packages/flutter_tools/test/commands.shard/hermetic/update_packages_test.dart:315:24 • prefer_const_constructors Original PR Author: @bkonyi Reviewed By: @chingjun The original PR description is provided below: When running `flutter update-packages --offline`, the `--offline` flag was parsed and used to validate incompatible option combinations (such as `--force-upgrade` and `--cherry-pick-package`), but was not forwarded to the underlying `pub.get` invocations. Forward `offline` through `_pubGet` to `pub.get` so that `pub` does not attempt network operations in offline environments. Fixes flutter#193423 ## Pre-launch Checklist - [x] I read the [Contributor Guide] and followed the process outlined there for submitting PRs. - [x] I read the [Tree Hygiene] wiki page, which explains my responsibilities. - [x] I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement]. - [x] I signed the [CLA]. - [x] I listed at least one issue that this PR fixes in the description above. - [x] I updated/added relevant documentation (doc comments with `///`). - [x] I added new tests to check the change I am making, or this PR is [test-exempt]. - [x] I followed the [breaking change policy] and added [Data Driven Fixes] where supported. - [x] All existing and new tests are passing.
suryaKommana2662
pushed a commit
to suryaKommana2662/flutter
that referenced
this pull request
Oct 29, 2026
…ackages" (flutter#193838) Relands flutter#193619 (reverted in flutter#193808) with `const` added to `DelegatingToolContext()` in `update_packages_test.dart` to satisfy `prefer_const_constructors`. When running `flutter update-packages --offline`, the `--offline` flag was parsed and used to validate incompatible option combinations (such as `--force-upgrade` and `--cherry-pick-package`), but was not forwarded to the underlying `pub.get` invocations. Read `boolArg(_keyOffline)` in `_pubGet` and forward it to `pub.get` so that `pub` does not attempt network operations in offline environments. Fixes flutter#193423 ## Pre-launch Checklist - [x] I read the [Contributor Guide] and followed the process outlined there for submitting PRs. - [x] I read the [Tree Hygiene] wiki page, which explains my responsibilities. - [x] I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement]. - [x] I signed the [CLA]. - [x] I listed at least one issue that this PR fixes in the description above. - [x] I updated/added relevant documentation (doc comments with `///`). - [x] I added new tests to check the change I am making, or this PR is [test-exempt]. - [x] I followed the [breaking change policy] and added [Data Driven Fixes] where supported. - [x] All existing and new tests are passing. [Contributor Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview [Tree Hygiene]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md [test-exempt]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests [Flutter Style Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md [Features we expect every widget to implement]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement [CLA]: https://cla.developers.google.com/ [breaking change policy]: https://flutter.dev/to/breaking-changes [Data Driven Fixes]: https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When running
flutter update-packages --offline, the--offlineflag was parsed and used to validate incompatible option combinations (such as--force-upgradeand--cherry-pick-package), but was not forwarded to the underlyingpub.getinvocations. Forwardofflinethrough_pubGettopub.getso thatpubdoes not attempt network operations in offline environments.Fixes #193423
Pre-launch Checklist
///).