-
-
Notifications
You must be signed in to change notification settings - Fork 226
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
why 'A freezed union cannot have private constructors'? #744
Comments
Because it's not possible to have private named parameters. So freezed cannot generate something like |
But what if it would be accessible in when/map/etc but we could NOT create instance of it? Again for events it looks not bad, but maybe I miss something |
I mean generator looks for constructors names with _ and instead of creating |
We could, yes. In that case, they might as well be public |
@rrousselGit I understand that some api will leak but at least we could forbid the construction of models. So we could create instances of models within library only |
You could annotate the constructor with That would achieve roughly the same thing. |
Yeap, thx, I think that's enough for my case |
Closing in favor of #925 |
Is your feature request related to a problem? Please describe.
I use flutter bloc and freezed for events. but some of them are used internally in bloc only so it would be very useful if it could be possible to hide them.
Is there some explanation why this made like that? Maybe it causes any problems?
The text was updated successfully, but these errors were encountered: