Bloc: yield state

Created on 15 May 2020  路  3Comments  路  Source: felangel/bloc

Where is that variable state declared? where does it come from?, each time I use it in my code state is not defined and honestly cannot figure it out. Can you please enlighten me?

https://github.com/felangel/bloc/blob/f73e12f4c215c0b74a30b1112784cf4768c6b64f/examples/flutter_form_validation/lib/bloc/my_form_bloc.dart#L37

question

Most helpful comment

Oh my gosh, I'm using: flutter_bloc: ^2.0.1

All 3 comments

Hi @hackerunet 馃憢
Thanks for opening an issue!

state is a property on all blocs which gives you the current bloc state at the moment in time. What version of bloc are you using?

Hi @hackerunet 馃憢

state is a property declared on the bloc itself. You might be using an older version of the package where it was named currentState. I'd recommend you update your bloc and flutter_bloc packages to latest version which is 4.0.0.

Hope that helps you 馃憤

Oh my gosh, I'm using: flutter_bloc: ^2.0.1

Was this page helpful?
0 / 5 - 0 ratings