Repository navigation
☂️ Prepare for Dart 3 #118837
Copy link
Copy link
Closed
Labels
P1High-priority issues at the top of the work listHigh-priority issues at the top of the work listc: tech-debtTechnical debt, code quality, testing, etc.Technical debt, code quality, testing, etc.engineflutter/engine related. See also e: labels.flutter/engine related. See also e: labels.frameworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.toolAffects the "flutter" command-line tool. See also t: labels.Affects the "flutter" command-line tool. See also t: labels.
Description
- Since Dart 3 drops support for non-null-safe code: enable
unnecessary_null_comparisonand clean up code base.- flutter/flutter
- flutter/engine
- Make widgets const that previously couldn't be const because of certain null comparison asserts.
- [tool] Remove "Building with sound null safety" output during
runandbuild#115803 - [tool] Remove option to pass unsound null safety flag in flutter build/run commands #118810 ([flutter_tools] Remove --no-sound-null-safety #3 #123297)
- Class Modifiers
- Identify classes in
dart:uithat need the mixin modifier: None. - Identify classes in
flutter/flutterthat need the mixin modifier: flutter.dev/go/mixin-modifier - Bump Dart SDK constraints and apply mixin modifier where necessary.
- Use class modifiers instead of
Foo._()constructors to prevent extension and instantiation.
- Identify classes in
- patterns/records: enable
invalid_case_patternslint - [tool] Migrate to --suppress-analytics flag #123066
- Update dartdoc to 6.2.0 #123193
- Update lints for Dart 3.0
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
P1High-priority issues at the top of the work listHigh-priority issues at the top of the work listc: tech-debtTechnical debt, code quality, testing, etc.Technical debt, code quality, testing, etc.engineflutter/engine related. See also e: labels.flutter/engine related. See also e: labels.frameworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.toolAffects the "flutter" command-line tool. See also t: labels.Affects the "flutter" command-line tool. See also t: labels.
Activity
[-]☂️ Dart 3 framework changes[/-][+]☂️ Prepare for Dart 3[/+]goderbauer commentedon Jan 26, 2023
Belated null safety dividend: Thanks to Dart 3 removing support for unsafe code we were just able to remove almost 5,000 lines of now unnecessary null comparisons from the
flutter/flutterandflutter/enginecode base. Pretty nice clean-up (see PRs linked to this issue above).goderbauer commentedon Jan 26, 2023
cc @mit-mit Let me know if anything else Dart 3 related comes to mind that we should prepare for in Flutter.
mit-mit commentedon Jan 27, 2023
The only thing I can think of are the CLI messages, but that's already tracked in #115803
goderbauer commentedon Feb 10, 2023
Top-level comment updated with some work that needs to happen for class modifiers.
goderbauer commentedon Mar 13, 2023
Flag flips for the Dart 3 features happened upstream in the Dart SDK with these CLs:
They are part of 3.0.0-325.0.dev. Once that has rolled into Flutter, I'll prepare PRs to bump our Dart SDK lower constraint to 3.0 to enable these features.
goderbauer commentedon Mar 15, 2023
Web engine breaks when bumping it to Dart 3.0, details in #122724. For now, I am excluding the web from the version bump to unblock framework. Not sure yet who can help with debugging this.
goderbauer commentedon Mar 17, 2023
Web compiler bug is fixed. Dart 3.0 is fully enabled for the engine repository now and some class modifiers have been applied to the engine code base to prove that the new feature can be used (flutter-team-archive/engine#40328).
The work to upgrade the flutter/flutter repository to 3.0 is currently blocked on waiting for dart-lang/sdk@7cc2553 to roll in.
cc @jakemac53 @itsjustkevin
goderbauer commentedon Mar 17, 2023
dart-lang/sdk@7cc2553 is tagged with 3.0.0-345.0.dev. Once that version (or something newer) has rolled into Flutter, work can continue here.
goderbauer commentedon Mar 20, 2023
While bumping the framework to 3.0, an issue related to const constructors surfaced: dart-lang/sdk#51800
goderbauer commentedon Mar 21, 2023
And another web compiler issue: dart-lang/sdk#51802
Update dartdoc to 6.2.0
goderbauer commentedon Mar 22, 2023
Tracking issue to clean up the work arounds we had to apply: dart-lang/sdk#51813
goderbauer commentedon Mar 22, 2023
The flutter/flutter repository is now also fully Dart 3 enabled. There are a few follow-ups (see checklist in first post and dart-lang/sdk#51813), but the majority of the work is done here.
Of the remaining work, getting dart-lang/sdk#51823 resolved is probably the most critical, so we can remove the work around for it and avoid future surprises.
github-actions commentedon Apr 27, 2023
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of
flutter doctor -vand a minimal reproduction of the issue.