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:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user