-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
[Discussion] Add Cubit Flutter Widgets? #1560
Comments
The associated PR (#1559) has been undrafted and is ready for review/consideration. 😄 Please vote thumbs up/down on the to let everyone know how you'd feel about these changes. |
I think we should consider renaming cubit to something more similar to bloc. Maybe what we currently know as a cubit, should become a bloc, and the more powerful bloc (currently named bloc) should be renamed to something else. Someone in the community has suggested Overall, this change feels like the better direction to me instead of fully splitting bloc and cubit again. |
Just dumping some thoughts here as I was thinking (for a good while) about a thumbsup or thumbsdown. I have the feeling the current naming can add something to the learning curve. With the current implementation you need to be aware of the "internals" that Bloc extends Cubit to fully understand the BlocBuilder etc classes and their public interfaces. As an example I can quite easily relate because of naming that "SportsCar" is a "Car" but not that a "Bloc" is a "Cubit". Just to add an alternative idea. Since we are talking about the bloc package that facilitates the bloc architecture it makes sense to me that (just like the car analogy) Bloc would be the base class and classes that implement different ways to achieve that extend that class. That way having BlocBuilders etc with a bloc argument make for a consistent public interface. |
I do not like the idea of having these extra |
Is using a different named param (cubit: rather than bloc:) technically required for the package? If it is not then I would agree with @Jomik that having |
Given the feedback observed on this thread, the community does not seem to have a clear consensus. My recommendation in that case would be to continue with the existing convention and wait to see if a better naming strategy surfaces, something that clearly resonates with a big majority. |
Hello, check #1570 |
@CurrySenpai replied and closed in favor of keeping this discussion in one place. |
@zepfietje see #1570 (comment) for why I would prefer not to rename |
@felangel, I understand your second point in that comment. However, for that same reason it's kind of strange to have widgets like If we'd like to be 100% consistent, I'd suggest one of the following. Either merging them as I suggested in my previous comment, despite the technical differences. Or fully separating them as the original issue description suggested. Still open for any other solutions though. |
I don't feel there is a need to change the Bloc name to something else (especially EventBloc😆) |
Are there any similarities or understandings between bloc project and this riverpod project (that is successor of provider)? Will both eventually move towards solving a fundamental problem? When I migrated from |
@omidraha provider/riverpod are used to make objects available throughout a Flutter application. Bloc currently uses |
Closing this for now since the majority of the feedback was in favor of keeping the API as is (or even potentially reverting back to using |
Question
Do you like the current API in v6.0.0 of
flutter_bloc
whereBlocBuilder
,BlocListener
, etc... are compatible with both blocs and cubits?Current Usage
Blocs
Cubits
Introduce Cubit Flutter Widgets
Or would you prefer to have
Cubit
versions of each widget (CubitBuilder
,CubitListener
, etc...)?Blocs
Cubits
Please give this issue a 👍 if you would prefer to have
Cubit
versions of allflutter_bloc
widgets in v7.0.0 offlutter_bloc
.Please give this issue a 👎 if you would prefer to keep things as is and have one set of widgets that works with both blocs and cubits.
If you have an alternative proposal feel free to leave a comment 😄
Additional Context
The text was updated successfully, but these errors were encountered: