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

Update Effective Dart Design Guidelines to Reflect Dart 3.0 Class Modifiers #6449

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

MiniPiku
Copy link

This PR updates the Effective Dart Design Guidelines to align with Dart 3.0's introduction of class modifiers. The changes include:

For API Maintainers:

Removed the recommendation to document whether a class supports being extended or used as an interface.

Added guidance to use class modifiers (e.g., final, sealed, interface, mixin) to explicitly define a class's capabilities.

Emphasized that class modifiers should replace manual documentation for enforcing restrictions on extending or implementing classes.

For Users:

Removed guidelines advising users to avoid extending or implementing classes not meant for it, as these restrictions are now enforced by class modifiers in Dart 3.0.

This change ensures the guidelines are up-to-date with Dart's latest features and best practices.

1. Renamed the variable json to data throughout the section.
2. Updated the text to clarify that the example works with deserialized data (e.g., parsed from JSON) rather than raw JSON strings.
3. Ensured consistency in variable naming and explanations.

This update makes the documentation more accurate and avoids misleading readers into thinking that the variable holds a JSON string. If you’re contributing to the Dart documentation, you can submit this change as a pull request to the [site-www repository](https://github.com/dart-lang/site-www)
Update the 'Classes and mixins' section to reflect Dart 3.0’s class modifier features:
- Revise API maintainer guidelines to recommend inal, �ase, etc., over documentation for controlling class extension and implementation.
- Remove obsolete user guidelines ('AVOID extending/implementing') as compiler enforcement via modifiers replaces the need for these.
- Add a note explaining the shift and obsoletion, placed at the section’s start for context.
This aligns the guidelines with modern Dart language capabilities, reducing reliance on docs.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant