-
Notifications
You must be signed in to change notification settings - Fork 715
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
docs: Mixins can have abstract methods #5043
Conversation
@@ -135,7 +135,7 @@ wrapping them with methods, all without changing client code. | |||
|
|||
Instance, getter, and setter methods can be abstract, defining an | |||
interface but leaving its implementation up to other classes. | |||
Abstract methods can only exist in [abstract classes][]. | |||
Abstract methods can only exist in [abstract classes][] or [mixins][]. | |||
|
|||
To make a method abstract, use a semicolon (;) instead of a method body: | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
May be useful to add a simple code example of an abstract getter in a mixin, but maybe that could be left to the mixins docs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea. I think you're right though that it should be on the mixin page. It can potentially be added as part of #4871 :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this, looks good to me!
@@ -135,7 +135,7 @@ wrapping them with methods, all without changing client code. | |||
|
|||
Instance, getter, and setter methods can be abstract, defining an | |||
interface but leaving its implementation up to other classes. | |||
Abstract methods can only exist in [abstract classes][]. | |||
Abstract methods can only exist in [abstract classes][] or [mixins][]. | |||
|
|||
To make a method abstract, use a semicolon (;) instead of a method body: | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea. I think you're right though that it should be on the mixin page. It can potentially be added as part of #4871 :)
See #4767 (comment)
Contribution guidelines:
dart format
.<?code-excerpt
need to be updated in their source.dart
file as well.