Revert "[pubspec] Bump Dart SDK constraint to ^3.13.0 (#186957)"#187209
Conversation
This reverts commit df8cb09.
There was a problem hiding this comment.
Code Review
This pull request lowers the Dart SDK version constraints across numerous pubspec files in the repository and updates several linter rules in analysis_options.yaml. Feedback is provided regarding regressions in dependency pinning logic, where replacing a negative lookbehind regex with a simple string replacement incorrectly modifies the SDK constraint, and style guide violations concerning the unnecessary use of the final keyword for local variables and parameters.
| Future<void> _pinDependencies(File pubspecFile) async { | ||
| final String oldPubspec = await pubspecFile.readAsString(); | ||
| final String newPubspec = oldPubspec.replaceAll(RegExp(r'(?<!sdk):\s*\^'), ': '); | ||
| final String newPubspec = oldPubspec.replaceAll(': ^', ': '); |
There was a problem hiding this comment.
Reverting this change to use a simple string replacement ': ^' will cause _pinDependencies to incorrectly match and modify the Dart SDK constraint (e.g., changing sdk: ^3.10.0-0 to sdk: 3.10.0-0). This pins the SDK to an exact version, which will cause pub get to fail on CI/local environments running newer SDK versions. We should keep the negative lookbehind regex to avoid modifying the SDK constraint.
| final String newPubspec = oldPubspec.replaceAll(': ^', ': '); | |
| final String newPubspec = oldPubspec.replaceAll(RegExp(r'(?<!sdk):\s*\^'), ': '); |
| Future<void> _pinDependencies(File pubspecFile) async { | ||
| final String oldPubspec = await pubspecFile.readAsString(); | ||
| final String newPubspec = oldPubspec.replaceAll(RegExp(r'(?<!sdk):\s*\^'), ': '); | ||
| final String newPubspec = oldPubspec.replaceAll(': ^', ': '); |
There was a problem hiding this comment.
Reverting this change to use a simple string replacement ': ^' will cause _pinDependencies to incorrectly match and modify the Dart SDK constraint (e.g., changing sdk: ^3.10.0-0 to sdk: 3.10.0-0). This pins the SDK to an exact version, which will cause pub get to fail on CI/local environments running newer SDK versions. We should keep the negative lookbehind regex to avoid modifying the SDK constraint.
| final String newPubspec = oldPubspec.replaceAll(': ^', ': '); | |
| final String newPubspec = oldPubspec.replaceAll(RegExp(r'(?<!sdk):\s*\^'), ': '); |
| expect(pubspecFile, exists); | ||
| final String oldPubspec = await pubspecFile.readAsString(); | ||
| final String newPubspec = oldPubspec.replaceAll(RegExp(r'(?<!sdk):\s*\^'), ': '); | ||
| final String newPubspec = oldPubspec.replaceAll(RegExp(r':\s*\^'), ': '); |
There was a problem hiding this comment.
Reverting this change to use a regex that matches any colon followed by a caret will cause pinDependencies to incorrectly match and modify the Dart SDK constraint (e.g., changing sdk: ^3.10.0-0 to sdk: 3.10.0-0). This pins the SDK to an exact version, which will cause pub get to fail on CI/local environments running newer SDK versions. We should keep the negative lookbehind regex to avoid modifying the SDK constraint.
| final String newPubspec = oldPubspec.replaceAll(RegExp(r':\s*\^'), ': '); | |
| final String newPubspec = oldPubspec.replaceAll(RegExp(r'(?<!sdk):\s*\^'), ': '); |
| final Iterable<Text> texts = tester.widgetList<Text>(find.byType(Text)); | ||
| final List<String?> labels = texts.map((Text text) => text.data).toList(); | ||
| final List<String?> labels = texts | ||
| .map((final Text text) => text.data) |
There was a problem hiding this comment.
The Flutter style guide advises against using final for local variables and parameters unless necessary. Reverting this parameter declaration to use final introduces a style guide violation.
| .map((final Text text) => text.data) | |
| .map((Text text) => text.data) |
References
- The Flutter style guide advises against using
finalfor local variables and parameters unless necessary to optimize for readability and maintain consistency across the codebase. (link)
| /// Helper method to turn a [String] into a [ByteData] containing the | ||
| /// text of the string encoded as UTF-8. | ||
| ByteData utf8Bytes(String text) { | ||
| ByteData utf8Bytes(final String text) { |
There was a problem hiding this comment.
The Flutter style guide advises against using final for local variables and parameters unless necessary. Reverting this parameter declaration to use final introduces a style guide violation.
| ByteData utf8Bytes(final String text) { | |
| ByteData utf8Bytes(String text) { |
References
- The Flutter style guide advises against using
finalfor local variables and parameters unless necessary to optimize for readability and maintain consistency across the codebase. (link)
|
autosubmit label was removed for flutter/flutter/187209, because - The status or check suite Linux windows_host_engine has failed. Please fix the issues identified (or deflake) before re-applying this label. |
|
autosubmit label was removed for flutter/flutter/187209, because - The status or check suite Windows framework_tests_misc_leak_tracking has failed. Please fix the issues identified (or deflake) before re-applying this label. |
flutter/flutter@c8f2f16...e70534d 2026-05-28 30870216+gaaclarke@users.noreply.github.com Linux glyph gamma correction (flutter/flutter#187122) 2026-05-28 chris@bracken.jp [iOS] Eliminate strong retain cycle from VSyncClient (flutter/flutter#187164) 2026-05-28 katelovett@google.com Revert "[pubspec] Bump Dart SDK constraint to ^3.13.0 (#186957)" (flutter/flutter#187209) 2026-05-28 engine-flutter-autoroll@skia.org Roll Skia from f1b8ba877c07 to 32acea791248 (3 revisions) (flutter/flutter#187220) 2026-05-27 engine-flutter-autoroll@skia.org Roll Fuchsia Linux SDK from k9EizfEGJO4WwQN9-... to SBpmmPxqx3lAvGojE... (flutter/flutter#187211) 2026-05-27 bdero@google.com [Impeller] Add block-compressed texture format support (BC, ETC2, ASTC) (flutter/flutter#187077) 2026-05-27 katelovett@google.com Disable analyzer (flutter/flutter#187205) 2026-05-27 bdero@google.com [Flutter GPU] Add explicit draw counts (reland) (flutter/flutter#187192) 2026-05-27 bdero@google.com [Flutter GPU] Inject per-backend defines into shader bundle compilation (flutter/flutter#187081) 2026-05-27 engine-flutter-autoroll@skia.org Roll Skia from fa944af10f91 to f1b8ba877c07 (13 revisions) (flutter/flutter#187194) 2026-05-27 47866232+chunhtai@users.noreply.github.com Fixes bug when changing accessibilityFocusBlockType doesn't update ch… (flutter/flutter#186596) 2026-05-27 137456488+flutter-pub-roller-bot@users.noreply.github.com Roll pub packages (flutter/flutter#187191) 2026-05-27 kevmoo@users.noreply.github.com [web, tool] Support recompiling shaders and unify asset processing (2nd try) (flutter/flutter#186902) 2026-05-27 robert.ancell@canonical.com Fix crash if FlView is destroyed during a draw. (flutter/flutter#186848) 2026-05-27 engine-flutter-autoroll@skia.org Roll Packages from fc795e5 to 4b424d7 (4 revisions) (flutter/flutter#187174) 2026-05-27 15619084+vashworth@users.noreply.github.com Stop prefetching Swift packages in pub get (flutter/flutter#187113) 2026-05-27 jesswon@google.com Update CI with newer android sdk package (flutter/flutter#187143) 2026-05-27 jason-simmons@users.noreply.github.com Add a tag to the Linux platform properties in .ci.yaml that specifies x64 CPUs (flutter/flutter#187124) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-packages Please CC boetger@google.com,stuartmorgan@google.com on the revert to ensure that a human is aware of the problem. To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
…r#11799) flutter/flutter@c8f2f16...e70534d 2026-05-28 30870216+gaaclarke@users.noreply.github.com Linux glyph gamma correction (flutter/flutter#187122) 2026-05-28 chris@bracken.jp [iOS] Eliminate strong retain cycle from VSyncClient (flutter/flutter#187164) 2026-05-28 katelovett@google.com Revert "[pubspec] Bump Dart SDK constraint to ^3.13.0 (#186957)" (flutter/flutter#187209) 2026-05-28 engine-flutter-autoroll@skia.org Roll Skia from f1b8ba877c07 to 32acea791248 (3 revisions) (flutter/flutter#187220) 2026-05-27 engine-flutter-autoroll@skia.org Roll Fuchsia Linux SDK from k9EizfEGJO4WwQN9-... to SBpmmPxqx3lAvGojE... (flutter/flutter#187211) 2026-05-27 bdero@google.com [Impeller] Add block-compressed texture format support (BC, ETC2, ASTC) (flutter/flutter#187077) 2026-05-27 katelovett@google.com Disable analyzer (flutter/flutter#187205) 2026-05-27 bdero@google.com [Flutter GPU] Add explicit draw counts (reland) (flutter/flutter#187192) 2026-05-27 bdero@google.com [Flutter GPU] Inject per-backend defines into shader bundle compilation (flutter/flutter#187081) 2026-05-27 engine-flutter-autoroll@skia.org Roll Skia from fa944af10f91 to f1b8ba877c07 (13 revisions) (flutter/flutter#187194) 2026-05-27 47866232+chunhtai@users.noreply.github.com Fixes bug when changing accessibilityFocusBlockType doesn't update ch… (flutter/flutter#186596) 2026-05-27 137456488+flutter-pub-roller-bot@users.noreply.github.com Roll pub packages (flutter/flutter#187191) 2026-05-27 kevmoo@users.noreply.github.com [web, tool] Support recompiling shaders and unify asset processing (2nd try) (flutter/flutter#186902) 2026-05-27 robert.ancell@canonical.com Fix crash if FlView is destroyed during a draw. (flutter/flutter#186848) 2026-05-27 engine-flutter-autoroll@skia.org Roll Packages from fc795e5 to 4b424d7 (4 revisions) (flutter/flutter#187174) 2026-05-27 15619084+vashworth@users.noreply.github.com Stop prefetching Swift packages in pub get (flutter/flutter#187113) 2026-05-27 jesswon@google.com Update CI with newer android sdk package (flutter/flutter#187143) 2026-05-27 jason-simmons@users.noreply.github.com Add a tag to the Linux platform properties in .ci.yaml that specifies x64 CPUs (flutter/flutter#187124) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-packages Please CC boetger@google.com,stuartmorgan@google.com on the revert to ensure that a human is aware of the problem. To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
…" (flutter#187209) This reverts commit df8cb09. - flutter#186957 - Reason for revert: this bumped the framework to an unstable version of Dart and made additional changes beyond the version bump. Attempting to cleanly revert and then will follow up with a bump to 3.12. - Should help (not entirely) with flutter#187204 ## Pre-launch Checklist - [x] I read the [Contributor Guide] and followed the process outlined there for submitting PRs. - [x] I read the [AI contribution guidelines] and understand my responsibilities, or I am not using AI tools. - [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. If you need help, consider asking for advice on the #hackers-new channel on [Discord]. If this change needs to override an active code freeze, provide a comment explaining why. The code freeze workflow can be overridden by code reviewers. See pinned issues for any active code freezes with guidance. **Note**: The Flutter team is currently trialing the use of [Gemini Code Assist for GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code). Comments from the `gemini-code-assist` bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed. <!-- Links --> [Contributor Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview [AI contribution guidelines]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#ai-contribution-guidelines [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/ [flutter/tests]: https://github.com/flutter/tests [breaking change policy]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes [Discord]: https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md [Data Driven Fixes]: https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
This reverts commit df8cb09.
Pre-launch Checklist
///).If you need help, consider asking for advice on the #hackers-new channel on Discord.
If this change needs to override an active code freeze, provide a comment explaining why. The code freeze workflow can be overridden by code reviewers. See pinned issues for any active code freezes with guidance.
Note: The Flutter team is currently trialing the use of Gemini Code Assist for GitHub. Comments from the
gemini-code-assistbot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed.