Improve setters and getters examples on 'Methods' page #5759
Labels
a.language
Relates to the Dart language tour
e2-days
Can complete in < 5 days of normal, not dedicated, work
from.page-issue
Reported in a reader-filed concern
p2-medium
Necessary but not urgent concern. Resolve when possible.
Page URL
https://dart.dev/language/methods/
Page source
https://github.com/dart-lang/site-www/tree/main/src/content/language/methods.md
Describe the problem
At
https://dart.dev/language/methods#getters-and-setters
we read about getters and setters but the text feels much too short and the example could be extended (the example code also does not really tell a good story, IMHO).
Suggesting more examples to illustrate various setter/getter "do's" and "don'ts" (including one involving a final field that creates a recursive call, see below) that tell a more structured story. Especially for people coming from Java (like me) this is helpful.
Note on terms: I am using "synthetic field" for a setter/getter that simulates the presence of field, not sure whether this is the correct term.
Here we go:
Expected fix
No response
Additional context
No response
I would like to fix this problem.
The text was updated successfully, but these errors were encountered: