if chains → switch expressions (#147793)

Previous "if-chains" pull requests:
- https://github.com/flutter/flutter/pull/144905
- https://github.com/flutter/flutter/pull/144977
- https://github.com/flutter/flutter/pull/145194
- https://github.com/flutter/flutter/pull/146293
- https://github.com/flutter/flutter/pull/147472

<br>

I think this one should be enough to wrap things up!

fixes https://github.com/flutter/flutter/issues/144903

---------

Co-authored-by: Victor Sanni <victorsanniay@gmail.com>
This commit is contained in:
Nate
2024-05-10 00:55:48 -06:00
committed by GitHub
parent c90e18c6f5
commit 4734d80f22
33 changed files with 194 additions and 297 deletions

View File

@@ -255,16 +255,14 @@ class StartContext extends Context {
if (atBranchPoint) {
return ReleaseType.BETA_INITIAL;
}
if (releaseChannel == 'stable') {
if (lastVersion.type == VersionType.stable) {
return ReleaseType.STABLE_HOTFIX;
} else {
return ReleaseType.STABLE_INITIAL;
}
if (releaseChannel != 'stable') {
return ReleaseType.BETA_HOTFIX;
}
return ReleaseType.BETA_HOTFIX;
return switch (lastVersion.type) {
VersionType.stable => ReleaseType.STABLE_HOTFIX,
VersionType.development || VersionType.gitDescribe || VersionType.latest => ReleaseType.STABLE_INITIAL,
};
}
Future<void> run() async {