Bloc: Casting error on LoginEvent

Created on 31 Jul 2019  路  3Comments  路  Source: felangel/bloc

Hello,

...BlocBuilder<LoginEvent, LoginState>(
bloc: _loginBloc,
builder: (
BuildContext context,
LoginState state,
)...

The error given is as follows:
LoginEvent does not extend Bloc
The argument type LoginBloc cannot be assigned to the parameter type LoginEvent

I've checked everything and I'm really stumped as to why I'm getting this error.

Most helpful comment

@zmabies your syntax is not very correct
You should use

BlocBuilder<LoginBloc, LoginState>(
            builder: (BuildContext context, LoginState loginState) {

All 3 comments

@zmabies your syntax is not very correct
You should use

BlocBuilder<LoginBloc, LoginState>(
            builder: (BuildContext context, LoginState loginState) {

@amreniouinnovent thanks!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

craiglabenz picture craiglabenz  路  3Comments

krusek picture krusek  路  3Comments

shawnchan2014 picture shawnchan2014  路  3Comments

RobPFarley picture RobPFarley  路  3Comments

abinvp picture abinvp  路  3Comments