### fixes#136139
<br>
<details open> <summary><b>getting sentimental in the PR description</b> (click to collapse)<br><br></summary>
The past 7 months have been quite the journeyâI made some huge blunders and some huge accomplishmentsâa very fun time overall.
I really appreciate the people who took the time to perform code review for my refactoring shenanigans: **christopherfujino**, **andrewkolos**, **LongCatIsLooong**, **gspencergoog**, **loic-sharma**, **Piinks**, **bernaferrari**, **bartekpacia**, **bleroux**, **kevmoo**, **rakudrama**, **XilaiZhang**, **QuncCccccc**, **MominRaza**, and **victorsanni**.
And a huge shoutout to 2 individuals:
- @justinmc, for offering to sponsor me for commit access (words could not describe my excitement)
- @goderbauer, for being super duper proactive and consistent with code review
<br>
</details>
This pull request makes 13 "switch statements â switch expressions" PRs in total, reducing the LOC in this repo by **1,974**!
From now on, I'll make sure to request a test exemption for each refactoring PR ð
This PR is step 12 in the journey to solve issue #136139 and make the
entire Flutter repo more readable.
Most of it involves implementing switch expressions, and there's also a
few other random things that I wanted to clean up a bit.
[A previous PR](https://github.com/flutter/flutter/pull/144279) implemented `const` constructors in the `Remote` class, so I wanted to follow up and use those constructors in the appropriate places.
This pull request aims for improved readability, based on issue #146600.
```dart
// before
Set<Color> _distinctVisibleColors() {
final Set<Color> distinctVisibleColors = <Color>{};
if (top.style != BorderStyle.none) {
distinctVisibleColors.add(top.color);
}
if (right.style != BorderStyle.none) {
distinctVisibleColors.add(right.color);
}
if (bottom.style != BorderStyle.none) {
distinctVisibleColors.add(bottom.color);
}
if (left.style != BorderStyle.none) {
distinctVisibleColors.add(left.color);
}
return distinctVisibleColors;
}
// after
Set<Color> _distinctVisibleColors() {
return <Color>{
if (top.style != BorderStyle.none) top.color,
if (right.style != BorderStyle.none) right.color,
if (bottom.style != BorderStyle.none) bottom.color,
if (left.style != BorderStyle.none) left.color,
};
}
```
Most of the repo should be covered in this PR (aside from `flutter_tools/`, since there was a lot going on in there).
Originally, my aim was just to refactor (as per usual), but while messing around with the `TableBorder.symmetric` constructor, I realized that `borderRadius` was missing!
This pull request makes a few class constructors more efficient, and it fixes#144277 by adding the missing parameter.
<br>
This pull request fixes#143803 by taking advantage of Dart's null-aware operators.
And unlike `switch` expressions ([9 PRs](https://github.com/flutter/flutter/pull/143634) and counting), the Flutter codebase is already fantastic when it comes to null-aware coding. After refactoring the entire repo, all the changes involving `?.` and `??` can fit into a single pull request.
I previously made a PR (#136140) that used `switch` expressions to make some parts of the Flutter codebase easier to understand. It was assigned to the framework team, and @christopherfujino let me know that it was too large to effectively review and recommended breaking it up into smaller pull requests.
Here's a PR that only targets files in the `dev/` directory. Hopefully this will be easier to work with!
(solves issue https://github.com/flutter/flutter/issues/136139)
Context: https://github.com/flutter/flutter/issues/131862
This PR injects a "realm" component to the storage base URL when the contents of the file `bin/internal/engine.realm` is non-empty.
As documented in the PR, when the realm is `flutter_archives_v2`, and `bin/internal/engine.version` contains the commit hash for a commit in a `flutter/engine` PR, then the artifacts pulled by the tool will be the artifacts built by the presubmit checks for the PR.
This works for everything but the following two cases:
1. Fuchsia artifacts are not uploaded to CIPD by the Fuchsia presubmit builds.
2. Web artifacts are not uploaded to gstatic by the web engine presubmit builds.
For (1), the flutter/flutter presubmit `fuchsia_precache` is driven by a shell script outside of the repo. It will fail when the `engine.version` and `engine.realm` don't point to a post-submit engine commit.
For (2), the flutter/flutter web presubmit tests that refer to artifacts in gstatic hang when the artifacts aren't found, so this PR skips them.
Fixes https://github.com/flutter/flutter/issues/129744
This change:
1. re-enables the Linux packages_autoroller
2. ensures we redact the token from appearing in any logs (in local testing I realized some failure logs might still expose the token)
What actually fixed authentication however was creating and uploading a new GitHub personal access token, not this change.
It's currently failing post-submit because being marked `bringup` it is running in the try pool, which does not have permissions to access the cloud KMS. However, I ran a LED build in the prod pool that succeeded:
3a8f128c35/+/build.proto
* readability refactor
* update post-submits
Update post submit testing status location from LUCI to cocoon. Conductor users will still have to use navigation to pick the correct repository and release candidate to monitor.
* e0f736dab Set error handler (flutter/engine#33402)
* dcd596a99 Roll Dart SDK from 381855557df2 to f3bf9025c141 (1 revision) (flutter/engine#33411)
* 5c2a16e07 Roll Fuchsia Linux SDK from F0_B8WVKY... to IZ7_b83xC... (flutter/engine#33415)
* 4958a245a Roll dart sdk to 1bdb83bddf96c41cc046810c697a2c80bfaaaf19 (flutter/engine#33416)
* d2fd3d852 Roll Fuchsia Mac SDK from t_ky8l6nb... to egBfZMmTP... (flutter/engine#33417)
* d58fc83f1 Roll Dart SDK from 1bdb83bddf96 to 0bc104c3e959 (1 revision) (flutter/engine#33419)
* 8ab172029 Roll Skia from 0a5146ca3ffd to 16fa353926b8 (28 revisions) (flutter/engine#33420)
* Remove fraction translation
* Update codesign.dart
Co-authored-by: Jonah Williams <jonahwilliams@google.com>
* c4b899f63 Roll dart sdk to 7b24ff4d92e2d2136020fc5bedadfe7025861510 (flutter/engine#33309)
* 7956603cc [web] Migrate Flutter Web DOM usage to JS static interop - 12. (flutter/engine#33241)
* 1d0c2ae6f Roll Skia from 1e43dce386c9 to f6e31bf1dcfb (6 revisions) (flutter/engine#33320)
* ed5a2fef0 Roll Skia from f6e31bf1dcfb to 69fecd6c2d85 (1 revision) (flutter/engine#33322)
* 10e0e1534 Revert "[web] Migrate Flutter Web DOM usage to JS static interop - 12. (#33241)" (flutter/engine#33321)
* fix local tests
Co-authored-by: Jonah Williams <jonahwilliams@google.com>