-
Notifications
You must be signed in to change notification settings - Fork 29.7k
fix compile error in the example code #103261
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
Conversation
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). For more information, open the CLA check for this pull request. |
|
I signed CLA |
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.
To ensure that we never break this example code again, it would be best to wrap this in a {@tool snippet} section similarly to how it is done here:
flutter/packages/flutter/lib/src/animation/animation.dart
Lines 109 to 123 in 8560d91
| /// {@tool snippet} | |
| /// | |
| /// Given an [AnimationController] `_controller`, the following code creates | |
| /// an `Animation<Alignment>` that swings from top left to top right as the | |
| /// controller goes from 0.0 to 1.0: | |
| /// | |
| /// ```dart | |
| /// Animation<Alignment> _alignment1 = _controller.drive( | |
| /// AlignmentTween( | |
| /// begin: Alignment.topLeft, | |
| /// end: Alignment.topRight, | |
| /// ), | |
| /// ); | |
| /// ``` | |
| /// {@end-tool} |
That way, this example gets analyzed by the analyzer and doesn't break that easily. Would you be up for refactoring that?
|
To fix one of the analyzer errors you probably need to create an "Examples can assume:" section and add _throwShotAway to it, similar to how it is done here: flutter/packages/flutter/lib/src/foundation/annotations.dart Lines 5 to 6 in e7b7ebc
|
|
Thank you. |
7881862 to
ce43be5
Compare
goderbauer
left a comment
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
justinmc
left a comment
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 for the fix 👍
Changes only documentation.
This sample code has compile error on my machine.
Pre-launch Checklist
///).If you need help, consider asking for advice on the #hackers-new channel on Discord.