Previous episode: 13. Navigate to the Home Page
Next episode: 15. Navigate to the Detail & ReadBook Pages
Get immediate access to this and 4,000+ other videos and books.
Take your career further with a Kodeco Personal Plan. With unlimited access to over 40+ books and
4,000+ professional videos in a single subscription, it's simply the best investment you can make in
your development career.
Now that we are done with the Splash screen, Login screen and Sign up screen, let us start by adding the condition for other screen and the App State Manager. First, we will start with app bar icon button. So, navigate to the widget section and open the custom app bar. Scroll down to the To Do where we are going to add the navigation of our Cart screen and Settings screen. So, we are using provider to call the on Cart Tapped function of the App State Manager and passing true as the value. So, here is the next challenge. just how we are writing the function on Cart Tapped by provider. To go to the Cart screen, let us see if you can write the function to go on the Settings screen. I hope you were able to write the function to go on the Settings screen, but if not, here is how it is done. Scroll down to the settings icon button where we have the on Pressed function, which is navigating to Settings screen. And now, let us use provider to call the on Settings Tapped function. Now, navigate to the Settings screen and you can see that we have two buttons. The one is the logo button and other is My Book screen. Now, let us first tackle the My Book screen button. You are also, we are going to use provider to get the function on My Book Tapped. Now, go to the Cart screen and scroll down to the Checkout button where we have the navigate to Checkout screen function. We will use the navigator to function to navigate to our Checkout screen. Now, that we're done with adding the functions for all the screens, let us now jump to the book RouterDelegate, and add the condition for all these pages. These are the conditions that we have written in our book RouterDelegate. Now, let us see if we can go to the screens that we want. I will reload the app and we will see how it works. So, with Login button, we can go to our home screen. With the on Cart button, we can go to My Cart, with, clicking on the Settings button, we can go to the Settings screen, and My Books will take us to the My Books screen that we have.
All videos. All books.
One low price.
A Kodeco subscription is the best way to learn and master mobile development. Learn iOS, Swift, Android, Kotlin, Flutter and Dart development and unlock our massive catalog of 50+ books and 4,000+ videos.