Skip to content

Revert "[pubspec] Bump Dart SDK constraint to ^3.13.0 (#186957)"#187209

Merged
auto-submit[bot] merged 1 commit into
flutter:masterfrom
Piinks:revertDartBump
May 28, 2026
Merged

Revert "[pubspec] Bump Dart SDK constraint to ^3.13.0 (#186957)"#187209
auto-submit[bot] merged 1 commit into
flutter:masterfrom
Piinks:revertDartBump

Conversation

@Piinks

@Piinks Piinks commented May 27, 2026

Copy link
Copy Markdown
Contributor

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-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.

@Piinks Piinks requested a review from a team as a code owner May 27, 2026 21:54
@flutter-dashboard flutter-dashboard Bot added the CICD Run CI/CD label May 27, 2026
@Piinks Piinks requested review from bkonyi and reidbaker and removed request for a team May 27, 2026 21:54

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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(': ^', ': ');

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

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.

Suggested change
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(': ^', ': ');

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

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.

Suggested change
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*\^'), ': ');

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

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.

Suggested change
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)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

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.

Suggested change
.map((final Text text) => text.data)
.map((Text text) => text.data)
References
  1. The Flutter style guide advises against using final for 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) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

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.

Suggested change
ByteData utf8Bytes(final String text) {
ByteData utf8Bytes(String text) {
References
  1. The Flutter style guide advises against using final for local variables and parameters unless necessary to optimize for readability and maintain consistency across the codebase. (link)

@github-actions github-actions Bot added a: tests "flutter test", flutter_test, or one of our tests a: text input Entering text in a text field or keyboard related problems tool Affects the "flutter" command-line tool. See also t: labels. framework flutter/packages/flutter repository. See also f: labels. engine flutter/engine related. See also e: labels. a: accessibility Accessibility, e.g. VoiceOver or TalkBack. (aka a11y) a: internationalization Supporting other languages or locales. (aka i18n) platform-fuchsia Fuchsia code specifically d: api docs Issues with https://api.flutter.dev/ d: examples Sample code and demos platform-web Web applications specifically f: integration_test The flutter/packages/integration_test plugin e: impeller Impeller rendering backend issues and features requests team-ios Owned by iOS platform team flutter-gpu team-fluttergpu Owned by Flutter GPU team labels May 27, 2026
@github-project-automation github-project-automation Bot moved this to 🤔 Needs Triage in Flutter GPU May 27, 2026
@Piinks Piinks added override code freeze Override an active code freeze. autosubmit Merge PR when tree becomes green via auto submit App labels May 27, 2026
@auto-submit auto-submit Bot removed the autosubmit Merge PR when tree becomes green via auto submit App label May 27, 2026
@auto-submit

auto-submit Bot commented May 27, 2026

Copy link
Copy Markdown
Contributor

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.

@Piinks Piinks added the autosubmit Merge PR when tree becomes green via auto submit App label May 28, 2026
@auto-submit auto-submit Bot removed the autosubmit Merge PR when tree becomes green via auto submit App label May 28, 2026
@auto-submit

auto-submit Bot commented May 28, 2026

Copy link
Copy Markdown
Contributor

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.

@Piinks Piinks added the autosubmit Merge PR when tree becomes green via auto submit App label May 28, 2026
@auto-submit auto-submit Bot added this pull request to the merge queue May 28, 2026
Merged via the queue into flutter:master with commit b2e3cc4 May 28, 2026
219 of 222 checks passed
@github-project-automation github-project-automation Bot moved this from 🤔 Needs Triage to ✅ Done in Flutter GPU May 28, 2026
@flutter-dashboard flutter-dashboard Bot removed the autosubmit Merge PR when tree becomes green via auto submit App label May 28, 2026
auto-submit Bot pushed a commit to flutter/packages that referenced this pull request May 28, 2026
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
creatorpiyush pushed a commit to creatorpiyush/packages that referenced this pull request Jun 10, 2026
…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
via-guy pushed a commit to via-guy/flutter that referenced this pull request Jun 26, 2026
…" (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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

a: accessibility Accessibility, e.g. VoiceOver or TalkBack. (aka a11y) a: internationalization Supporting other languages or locales. (aka i18n) a: tests "flutter test", flutter_test, or one of our tests a: text input Entering text in a text field or keyboard related problems CICD Run CI/CD d: api docs Issues with https://api.flutter.dev/ d: examples Sample code and demos e: impeller Impeller rendering backend issues and features requests engine flutter/engine related. See also e: labels. f: integration_test The flutter/packages/integration_test plugin flutter-gpu framework flutter/packages/flutter repository. See also f: labels. override code freeze Override an active code freeze. platform-fuchsia Fuchsia code specifically platform-web Web applications specifically team-fluttergpu Owned by Flutter GPU team team-ios Owned by iOS platform team tool Affects the "flutter" command-line tool. See also t: labels.

Projects

Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

2 participants