You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Now Cubit extends Bloc, contrary to the previous Bloc extends Cubit introduced in 6.0.0. It doesn't cause any issues for me and I actually noticed this by accident after migrating my app to null safety, and flutter_bloc to 7.0.0-nullsafety - I am experimenting with a change and was looking for the cubit parameter in a BlocBuilder that is now gone. I looked into migration.md and there isn't written anything about it yet. I understand that the 7.0.0 version isn't final yet so I'm just making sure this doesn't get forgotten in all the work that is necessary for null safety support.
As a side question: why this change, how is it beneficial for the hierarchy to be reversed? Does it make something possible that wasn't before? It has disadvantages, it does introduce a weird API for Cubit in which the user can actually call add (with null only, I guess) but it will always fail due to an error throw by Cubit.mapEventToState.
The text was updated successfully, but these errors were encountered:
cubit parameter for BlocBuilder is now changed to bloc, which accepts both a Bloc and a Cubit since the latter extends the former. As of why this change was introduced, I don't know, but 7.0.0 is still a prerelease I think.
@dawidd6 Yes I am aware of that, I checked the code. I just wanted to make sure the migration docs get updated, and also wanted to ask about the rationale - I am a big fan of BLoC and this library, it is a vital part of my apps, and I like to understand things. I haven't found any issue relating to it, hence the question.
I haven't forgotten about the migration guide but there are still several changes that may or may not land before a stable release can be published and we'll be sure to have the migration guide ready before v7.0.0 is released 👍
Regarding your second question, I was just working on a proposal to hopefully address this and several other issues at #2235. I would love your feedback/thoughts and thanks as always for being an extremely valuable member of the community! 🙏
Describe the bug
Now
Cubit extends Bloc
, contrary to the previousBloc extends Cubit
introduced in 6.0.0. It doesn't cause any issues for me and I actually noticed this by accident after migrating my app to null safety, and flutter_bloc to 7.0.0-nullsafety - I am experimenting with a change and was looking for thecubit
parameter in aBlocBuilder
that is now gone. I looked into migration.md and there isn't written anything about it yet. I understand that the 7.0.0 version isn't final yet so I'm just making sure this doesn't get forgotten in all the work that is necessary for null safety support.As a side question: why this change, how is it beneficial for the hierarchy to be reversed? Does it make something possible that wasn't before? It has disadvantages, it does introduce a weird API for
Cubit
in which the user can actually calladd
(withnull
only, I guess) but it will always fail due to an error throw byCubit.mapEventToState
.The text was updated successfully, but these errors were encountered: