Flutter – yield from callback function

Posted by Andre Scott | Updated on

You need to create other event, and dispatch this event in your callback function, then you can do what you want in the function that filter your events.

I don’t know what is the purpose of your BLoC, but the name of this event depends on the use case, it can be UpdateFormUpdateStateLoggedIn,LoggedOut, etc. You will find the most descriptive name for your use case.

Remember that you can also create this event with parameters, for example UpdateForm (bool isLoggedIn), and yield different states according to your conditions.

For the example, the name of this event is OtherEvent.

If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.

Related Questions & Answers