-
Notifications
You must be signed in to change notification settings - Fork 28k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve 'flutter downgrade' error message #154434
Conversation
if (buffer.isEmpty) { | ||
buffer.writeln(); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this extra writeln
call necessary? Is the condition meant to be negated here (I don't know this code).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This adds an extra line between the help text and the list of channel last versions:
To switch to a specific Flutter version, see: https://flutter.dev/to/switch-flutter-version
Channel "master" was previously on: v1.2.3.
Channel "beta" was previously on: v1.0.0.
Without this, the output would be:
To switch to a specific Flutter version, see: https://flutter.dev/to/switch-flutter-version
Channel "master" was previously on: v1.2.3.
Channel "beta" was previously on: v1.0.0.
Is the condition meant to be negated here (I don't know this code).
This condition is intentional. We only want to add this extra new line on the first channel we output, and only if we output at least one channel.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah. understood—thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM—thanks 😃
Explains how to switch to a specific Flutter version. This will be used by the Flutter tool's error message when a user attempts to `flutter downgrade` but has never used the `flutter upgrade` command: flutter/flutter#154434 ## Presubmit checklist - [x] This PR is marked as draft with an explanation if not meant to land until a future stable release. - [x] This PR doesn’t contain automatically generated corrections (Grammarly or similar). - [x] This PR follows the [Google Developer Documentation Style Guidelines](https://developers.google.com/style) — for example, it doesn’t use _i.e._ or _e.g._, and it avoids _I_ and _we_ (first person). - [x] This PR uses [semantic line breaks](https://github.com/dart-lang/site-shared/blob/main/doc/writing-for-dart-and-flutter-websites.md#semantic-line-breaks) of 80 characters or fewer.
autosubmit didn't merge?! CI is green 👀 |
Let's try the good ol' turn it off and on again! |
flutter downgrade
fails if you haven't usedflutter upgrade
:It's not clear what actions a user should take from this error message. Here's the new error message:
Depends on flutter/website#11098
Pre-launch Checklist
///
).If you need help, consider asking for advice on the #hackers-new channel on Discord.