Turning if chains into shorter switch statements#144977
Merged
auto-submit[bot] merged 16 commits intoflutter:masterfrom Mar 13, 2024
Merged
Turning if chains into shorter switch statements#144977auto-submit[bot] merged 16 commits intoflutter:masterfrom
if chains into shorter switch statements#144977auto-submit[bot] merged 16 commits intoflutter:masterfrom
Conversation
goderbauer
approved these changes
Mar 12, 2024
Member
goderbauer
left a comment
There was a problem hiding this comment.
LGTM with a tiny formatting nit
| setState(() { | ||
| _animationDirection = status; | ||
| }); | ||
| setState(() => _animationDirection = status); |
Member
There was a problem hiding this comment.
In general, we prefer styling setState as a block like it was before. Can you revert this formatting change?
Contributor
Author
There was a problem hiding this comment.
I had a look through the repo and you're right—an overwhelming majority of setState calls use a function body even if there's just one statement.
I was surprised at how many were formatted as a single line without the => syntax:
setState(() { _value = newValue; });I guess now I know to use curly braces in the Flutter repo from now on.
loic-sharma
reviewed
Mar 12, 2024
loic-sharma
approved these changes
Mar 12, 2024
Member
loic-sharma
left a comment
There was a problem hiding this comment.
Thanks for the excellent contribution!
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
Mar 14, 2024
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
Mar 14, 2024
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
Mar 14, 2024
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
Mar 14, 2024
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
Mar 14, 2024
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
Mar 14, 2024
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
Mar 15, 2024
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
Mar 15, 2024
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
Mar 15, 2024
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
Mar 15, 2024
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
Mar 15, 2024
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
Mar 15, 2024
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
Mar 16, 2024
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
Mar 16, 2024
nate-thegrate
added a commit
that referenced
this pull request
May 10, 2024
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
May 14, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request is part of the effort to solve issue #144903.
In the past, my efforts to reduce line length involved refactoring away from switch statements, but unlike yesterday's PR, this one is full of switch statements that make things more concise!