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

Classes and mixins section of Design chapter of Effective Dart should be rewritten accounting class modifiers feature of Dart 3.0 #6437

Open
1 task done
ViktorVoloshko opened this issue Feb 19, 2025 · 1 comment · May be fixed by #6438
Labels
a.effective-dart Relates to the best practices explained in Effective Dart d.enhancement Improves docs with specific ask e1-hours Can complete in < 8 hours of normal, not dedicated, work from.page-issue Reported in a reader-filed concern p2-medium Necessary but not urgent concern. Resolve when possible.

Comments

@ViktorVoloshko
Copy link
Contributor

ViktorVoloshko commented Feb 19, 2025

Page URL

https://dart.dev/effective-dart/design#classes-and-mixins

Page source

https://github.com/dart-lang/site-www/tree/main/src/content/effective-dart/design.md

Describe the problem

Guidelines

  • DO document if your class supports being extended
  • DO document if your class supports being used as an interface
    Don't take into account class modifiers: https://dart.dev/language/modifier-reference
    This also affects other guidelines
  • AVOID extending a class that isn't intended to be subclassed
  • AVOID implementing a class that isn't intended to be an interface

Since Dart 3.0 limiting user's ability to extend/implement a class with class modifiers is a language feature, no need to be explicit in docs.

Expected fix

Change guidelines for API maintainers so that if a class not meant to be extended/implemented, they should use according class modifiers.

Remove guidelines for users since those are obsolete if API makes use of class modifiers.

Additional context

No response

I would like to fix this problem.

  • I will try and fix this problem on dart.dev.
@ViktorVoloshko ViktorVoloshko added the from.page-issue Reported in a reader-filed concern label Feb 19, 2025
@ViktorVoloshko ViktorVoloshko changed the title Classes and mixins section should be rewritten accounting class modifiers feature of Dart 3.0 Classes and mixins section of Design chapter of Effective Dart should be rewritten accounting class modifiers feature of Dart 3.0 Feb 19, 2025
@parlough parlough added d.enhancement Improves docs with specific ask a.effective-dart Relates to the best practices explained in Effective Dart p2-medium Necessary but not urgent concern. Resolve when possible. e1-hours Can complete in < 8 hours of normal, not dedicated, work labels Feb 21, 2025
@MiniPiku
Copy link

The issue have been fixed
kindly review the PR and suggest any necessary changes if needed :
#6449

Thank you

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 d.enhancement Improves docs with specific ask e1-hours Can complete in < 8 hours of normal, not dedicated, work from.page-issue Reported in a reader-filed concern p2-medium Necessary but not urgent concern. Resolve when possible.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants