Bloc: Bloc login example, `LoggedIn` event resets the state?

Created on 28 Dec 2018  路  2Comments  路  Source: felangel/bloc

Hi,
I am pretty much sure this state is confusing. Shouldn't this be if LoggedOut or something?

https://github.com/felangel/bloc/blob/ef0860e3aaf552a8aebb09610f16ef611cef9dd0/examples/flutter_login/lib/login/login_bloc.dart#L36

Thank you for your effort, just making sure I am not missing something here 馃憤

question

All 2 comments

@moga111 thanks for asking and I apologize for the confusion. This is actually correct as is because when a user has successfully logged in we need to reset the LoginPage state to avoid dispatching multiple events. Let me know if that helps clarify things.

Hello @felangel, thanks for calrifying. I took a deep look again and now its clear. I really appreciate your quick response.

All good and thanks again.

Was this page helpful?
0 / 5 - 0 ratings