Skip to content
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

Effective Dart "DO type annotate fields and top-level variables ..." example uses a method #6118

Open
srawlins opened this issue Sep 30, 2024 · 1 comment
Labels
a.effective-dart Relates to the best practices explained in Effective Dart

Comments

@srawlins
Copy link
Member

The bad example, and the first example, under "DO type annotate fields and top-level variables if the type isn't obvious
"
use a method, and don't contain a field or top-level variable anywhere.

And none of the text in the rule can really apply to methods, unless you maybe count a method with an expression body (=> ...) as "having" an "obvious type".

@srawlins srawlins added the a.effective-dart Relates to the best practices explained in Effective Dart label Sep 30, 2024
@srawlins
Copy link
Member Author

Or looked at the other way, maybe the method example, specifically the return type, hints that the text of the rule should be changed to include methods ("DO type annotate fields, top-level variables, enum values, functions, methods, constructors, and typedefs ...")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a.effective-dart Relates to the best practices explained in Effective Dart
Projects
None yet
Development

No branches or pull requests

1 participant