inside of a build method:
return BlocBuilder<UserCubit, UserState>(
bloc: UserCubit("firstName", "lastName"),
builder: (BuildContext blocContext, UserState state) {
print(BlocProvider.of<UserCubit>(blocContext).user.fullName); // error here
});
error:
BlocProvider.of() called with a context that does not contain a UserCubit.
which is obviously not the case...
the question is, how can I access the cubit in case of BlocBuilder/BlocConsumer where bloc attribute is not null.