Skip to content

Conversation

@ktakayama
Copy link
Contributor

@ktakayama ktakayama commented May 7, 2022

Changes only documentation.

This sample code has compile error on my machine.

$ flutter --version
Flutter 2.10.5 • channel stable • https://github.com/flutter/flutter.git
Framework • revision 5464c5bac7 (3 weeks ago) • 2022-04-18 09:55:37 -0700
Engine • revision 57d3bac3dd
Tools • Dart 2.16.2 • DevTools 2.9.2

Pre-launch Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I read and followed the Flutter Style Guide, including Features we expect every widget to implement.
  • I signed the CLA.
  • I listed at least one issue that this PR fixes in the description above.
  • I updated/added relevant documentation (doc comments with ///).
  • I added new tests to check the change I am making, or this PR is test-exempt.
  • All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel on Discord.

@flutter-dashboard flutter-dashboard bot added f: material design flutter/packages/flutter/material repository. framework flutter/packages/flutter repository. See also f: labels. labels May 7, 2022
@google-cla
Copy link

google-cla bot commented May 7, 2022

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.

@ktakayama
Copy link
Contributor Author

I signed CLA

Copy link
Member

@goderbauer goderbauer May 9, 2022

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:

/// {@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?

@goderbauer
Copy link
Member

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:

// Examples can assume:
// class Cat { }

@ktakayama
Copy link
Contributor Author

ktakayama commented May 10, 2022

Thank you.
I'll try it later.

@ktakayama ktakayama force-pushed the patch-1 branch 2 times, most recently from 7881862 to ce43be5 Compare May 10, 2022 08:12
Copy link
Member

@goderbauer goderbauer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@justinmc justinmc left a 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 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

f: material design flutter/packages/flutter/material repository. framework flutter/packages/flutter repository. See also f: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants