Bloc: In flutter_login, logout not working on a new page

Created on 24 Jul 2019  路  2Comments  路  Source: felangel/bloc

The logout function is not working on a new page I created. When I click the logout button it did not redirect to login page.
I check this similar issue but cannot solve it. https://github.com/felangel/bloc/issues/122#issue-416581697
Here is the code: https://github.com/2000calories/flutter_login_test.git
Thanks in advance.
Screenshot_20190724-115802

question

Most helpful comment

Thanks. It works now.

All 2 comments

Hi @2000calories 馃憢
Thanks for opening an issue!

The issue is you鈥檙e pushing settings on top of the root widget when you use Navigator.push so when you dispatch the Logout event you need to also call Navigator.of(context).pop() in order to remove the settings widget from the top of the navigation stack.

Hope that helps!

Thanks. It works now.

Was this page helpful?
0 / 5 - 0 ratings