-
Notifications
You must be signed in to change notification settings - Fork 31
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
refactor: Make bloc implementations private #1342
Conversation
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.
I think that the interfaces should be sealed.
- I don't like interface classes with constructors/factories
- We prevent our users to extend these interfaces.
Long term the concrete implementations should not contain private fields as the classes themselves are already private. You already did so for the TimerBloc. But please not in this PR as it's already large enoguh :)
packages/neon_framework/lib/src/blocs/login_check_server_status.dart
Outdated
Show resolved
Hide resolved
How should I fix it?
Agreed, I didn't do it to keep the diff more readable. |
a sealed class can no longer have the interface modifier :) |
But that doesn't make the factories go away, no? I thought you saw that as a problem too. |
I'm fine with them :) |
Making the classes sealed prevents us from creating mocks (at least with mocktail) :/ I think we should still go for it as we shouldn't need to have mocks for blocs once we untangle them. |
3911cbc
to
e3da727
Compare
I haven't tried it yet and don't know if it would help but |
0cd0bc2
to
c1e02f4
Compare
I'll review this later today |
Signed-off-by: jld3103 <[email protected]>
c1e02f4
to
8fc3cd0
Compare
Some places accessed parts of Blocs that should have been in the interface. Now it is no longer possible to do that.