Skip to content

Bump Dart SDK minimums to Dart 3.11.0.#9848

Merged
srawlins merged 6 commits into
flutter:masterfrom
srawlins:bump-sdk
Jun 2, 2026
Merged

Bump Dart SDK minimums to Dart 3.11.0.#9848
srawlins merged 6 commits into
flutter:masterfrom
srawlins:bump-sdk

Conversation

@srawlins
Copy link
Copy Markdown
Contributor

@srawlins srawlins commented Jun 2, 2026

Bumping the minimum Dart SDK for each package exposes us to the use_null_aware_elements lint rule, allowing for little cleanups.

@srawlins srawlins requested review from a team, bkonyi and kenzieschmoll as code owners June 2, 2026 17:33
Copy link
Copy Markdown
Contributor

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

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 updates the Dart SDK constraint to ^3.11.0 across multiple packages, updates various dependencies in pubspec.lock, and refactors map and list literals to use the new null-aware element syntax. Feedback is provided regarding an unnecessary null-aware operator (?) in fake_isolate_manager.dart because _selectedIsolate is statically inferred as non-nullable.

final value = _selectedIsolate.value;
_isolates ??= ValueNotifier([if (value != null) value]);
return _isolates!;
return _isolates ??= ValueNotifier([?_selectedIsolate.value]);
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

[CONCERN] Statically, _selectedIsolate is inferred as ValueNotifier<IsolateRef> (non-nullable) because it is initialized with a non-null value and has no explicit type arguments. Therefore, _selectedIsolate.value is non-nullable, making the null-aware operator ? unnecessary here.

If _selectedIsolate is intended to be nullable (matching the ValueListenable<IsolateRef?> return type of selectedIsolate), you should explicitly type it as ValueNotifier<IsolateRef?> on line 23. Otherwise, you can remove the ? operator from _selectedIsolate.value in the list literal.

Suggested change
return _isolates ??= ValueNotifier([?_selectedIsolate.value]);
return _isolates ??= ValueNotifier([_selectedIsolate.value]);
References
  1. Maintainability: Code should be easy to understand and modify. Avoiding unnecessary null-aware operators on non-nullable types prevents confusion and potential compiler/lint warnings. (link)

Comment thread packages/devtools_app/pubspec.yaml Outdated
Copy link
Copy Markdown
Member

@kenzieschmoll kenzieschmoll left a comment

Choose a reason for hiding this comment

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

we need to update package versions and add changelog entries for these changes since this will change the backwards compatibility of all the published DevTools packages

Comment thread packages/devtools_app/release_notes/NEXT_RELEASE_NOTES.md Outdated
@srawlins srawlins merged commit e5134ff into flutter:master Jun 2, 2026
50 of 51 checks passed
description: Package of shared Dart structures between devtools_app, dds, and other tools.

version: 13.0.1
version: 13.0.2-dev
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

this should be -wip to match the changelog

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants