flutter_bloc 6.0.6
I try to use BlocBuilder:
Widget build(BuildContext context) {
return BlocBuilder<MovieBloc, MovieEvent>(builder: (context, state) {...});
}
MovieBloc:
class MovieBloc extends Bloc<MovieEvent, MovieState> ....
Received error:
'MovieBloc' doesn't extend 'Cubit<MovieEvent>'.
Try using a type that is or is a subclass of 'Cubit<MovieEvent>'.
Seems like problem in incompatibility implementation
class BlocBuilder<C extends Cubit<S>, S> extends BlocBuilderBase<C, S >
and
abstract class Bloc<Event, State> extends Cubit<State>
in flutter_bloc 6.0.6 and bloc 6.1.0 respectively
Hi @OZ79 馃憢
Thanks for opening an issue!
I think the issue is you're providing incorrect types to BlocBuilder. It should accept the bloc type and the state type:
Widget build(BuildContext context) {
return BlocBuilder<MovieBloc, MovieState>(builder: (context, state) {...});
}
Hope that helps 馃憤
Yes, you are right, my mistake. Thanks.
Most helpful comment
Yes, you are right, my mistake. Thanks.