-
Notifications
You must be signed in to change notification settings - Fork 205
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
Partial classes #1810
Comments
This comment was originally written by adrian.avil...@gmail.com You can already split classes in Dart with part files, that would be the equivalent. |
Set owner to @gbracha. |
We've discussed this on the mailing list. You can use parts for large libraries. You can define multiple mixins and combine them. We do not need this extra sugar. Added AsDesigned label. |
Link to misc@ discussion Jan 2013 - https://groups.google.com/a/dartlang.org/d/topic/misc/KTuJ_Z6O1oQ/discussion Mixins are great to encourage reuse, but the there are arguments for partial classes that cannot be covered by mixins: generating code that includes constructors, for instance. For example: // mycode.dart part 'mycode.g.dart'; class Person { // mycode.g.dart partial class Person { toJson() => {'firstName': firstName, 'lastName': lastName}; Added Triaged label. |
Added Accepted label. |
This comment was originally written by hangglide...@gmail.com
|
Not being able to extend classes through partial implementation files is PITA and makes some scenarios really hard to achieve when it comes to autogenerated code. This is even more important to flutter because it doesn't support reflection (or whatever it's called in dart world) and you have either write or autogenerate code (i.e. json (de)serialization). |
@eernstg Thanks for the info, hopefully they will come out with something comparably useful. |
Now this is a duplicate of #252. |
It is, and with that comment, there is a link from #252 to here, so let's close this issue. |
This issue was originally filed by luciandog...@ymail.com
Please implement partial classes in Dart.
The text was updated successfully, but these errors were encountered: