Flutter Navigator 2.0

Nov 8 2022 Dart 2.17.3, Flutter 3.0.2, Android Studio 2020.3

Part 3: Use the Navigation

17. Logout & Handle Back-Button

Episode complete

Play next episode

Next
Save for later
About this episode
See forum comments
Cinema mode Mark complete Download course materials
Previous episode: 16. Go to the Previous Page Next episode: 18. Learn Deep Links

This video Logout & Handle Back-Button was last updated on Nov 8 2022

Heads up... You've reached locked video content where the transcript will be shown as obfuscated text.

You can unlock the rest of this video course, and our entire catalogue of books and videos, with a kodeco.com Professional subscription.

Episode - 17 Logout & Handle Back-Button

Now that we are done with the navigation of the pages. Let us now write the logout function. in the settings page on the logout button pressed add the following code.


 Provider.of<BookManager>(context, listen: false)
     .bookTapped(-1);
 Provider.of<AppStateManager>(context, listen: false)
     .onMyBookTapped(false);
 Provider.of<AppStateManager>(context, listen: false)
     .onCartTapped(false);
 Provider.of<AppStateManager>(context, listen: false)
     .onSettingTapped(false);
 Provider.of<AppStateManager>(context, listen: false).logout();

backButtonDispatcher: RootBackButtonDispatcher(),