这是indexloc提供的服务,不要输入任何密码
Skip to content

update build doc string to advocate avoiding doing tasks other than b… #58213

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

Merged
merged 3 commits into from
Jun 4, 2020

Conversation

chunhtai
Copy link
Contributor

…uilding a widget

Description

title said it all

Related Issues

Fixes #16218

Tests

I added the following tests:

doc only change

Checklist

Before you create this PR confirm that it meets all requirements listed below by checking the relevant checkboxes ([x]). This will ensure a smooth and quick review process.

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I signed the CLA.
  • I read and followed the Flutter Style Guide, including Features we expect every widget to implement.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I updated/added relevant documentation (doc comments with ///).
  • All existing and new tests are passing.
  • The analyzer (flutter analyze --flutter-repo) does not report any problems on my PR.
  • I am willing to follow-up on review comments in a timely manner.

Breaking Change

Did any tests fail when you ran them? Please read Handling breaking changes.

@fluttergithubbot
Copy link
Contributor

It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact Hixie on the #hackers channel in Chat.

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing.

@fluttergithubbot fluttergithubbot added the framework flutter/packages/flutter repository. See also f: labels. label May 29, 2020
@chunhtai chunhtai added the d: api docs Issues with https://api.flutter.dev/ label May 29, 2020
Comment on lines 475 to 476
/// This builder can get called arbitrarily and should not do anything beyond
/// building a widget.
Copy link
Member

Choose a reason for hiding this comment

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

Should we just say:

This builder must only return a widget and should not have any side effects as it may be called multiple times.

@@ -686,6 +689,9 @@ class FutureBuilder<T> extends StatefulWidget {
/// the value to which the future completed. If it completed with an error,
/// [AsyncSnapshot.hasError] will be true and [AsyncSnapshot.error] will be
/// set to the error object.
///
/// This builder can get called arbitrarily and should not do anything beyond
Copy link
Member

Choose a reason for hiding this comment

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

same.

/// The framework calls this method when this widget is inserted into the tree
/// in a given [BuildContext] and when the dependencies of this widget change
/// (e.g., an [InheritedWidget] referenced by this widget changes). However,
/// these are not the only place this method gets called. This method can be
Copy link
Member

Choose a reason for hiding this comment

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

Maybe say something around that it could potentially be called every frame and should not have any side effects.

@@ -1325,6 +1330,11 @@ abstract class State<T extends StatefulWidget> with Diagnosticable {
/// * After calling [deactivate] and then reinserting the [State] object into
/// the tree at another location.
///
/// These are not the only place this method gets called. This method can be
Copy link
Member

Choose a reason for hiding this comment

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

Same here.

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 after comments are resolved.

Comment on lines 668 to 669
/// method can potentially be called in every frames, and you should keep in
/// mind that it should not have any side effects beyond building a widget.
Copy link
Member

Choose a reason for hiding this comment

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

per style guide: avoid empty phrases:

Suggested change
/// method can potentially be called in every frames, and you should keep in
/// mind that it should not have any side effects beyond building a widget.
/// method can potentially be called in every frames and should not have any
/// side effects beyond building a widget.

@@ -1325,6 +1328,9 @@ abstract class State<T extends StatefulWidget> with Diagnosticable {
/// * After calling [deactivate] and then reinserting the [State] object into
/// the tree at another location.
///
/// This method can potentially be called in every frames, and you should keep
Copy link
Member

Choose a reason for hiding this comment

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

same as above.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
d: api docs Issues with https://api.flutter.dev/ framework flutter/packages/flutter repository. See also f: labels.
Projects
None yet
4 participants