From the course: Flutter Essential Training: Build for Multiple Platforms
Unlock the full course today
Join today to access over 24,900 courses taught by industry experts.
Replacing routes using Navigator - Flutter Tutorial
From the course: Flutter Essential Training: Build for Multiple Platforms
Replacing routes using Navigator
- [Instructor] Do you know what is wrong with our navigation logic? Let me show you, Here I'm writing my name and then I'm logging in. Now, if I navigate to chat page from login I will be able to go back to the login page from this back button created right here. Or maybe I can just slide back in if I'm on iOS device and if you're using Android you can do the same via the hardware back button. Now, in most cases, this probably makes sense. However, right now we are navigating from login page to chat page, and once the login has been successful this route should be removed from the stack completely and be replaced with chat page. So instead of pushing a route on top of login we should just replace this chat route with the login route. So it's not possible for the user to go back casually like that after a successful login. So now navigator has a push and replacement method that pushes a route replacing the current route.…
Contents
-
-
-
-
-
-
What is state?1m 55s
-
(Locked)
Writing your first stateful widget7m 17s
-
(Locked)
Widget variables vs. state variables3m 26s
-
(Locked)
When to use stateless or stateful?1m 51s
-
(Locked)
Lifecycle of a stateful widget3m 44s
-
(Locked)
Stateful hot reload3m 22s
-
(Locked)
Learning about buttons6m 50s
-
(Locked)
Taps and gesture detection3m 47s
-
(Locked)
Getting inputs from the user7m 40s
-
(Locked)
Validating user inputs7m 55s
-
(Locked)
Creating multiline text fields6m 46s
-
(Locked)
Navigating from one screen to another5m 41s
-
(Locked)
Passing data with navigation2m 7s
-
(Locked)
Navigating via named routes4m 8s
-
(Locked)
Replacing routes using Navigator5m 16s
-
-
-
-
-