Hello, in this video, I'm going to show you how to do some custom routing. So we're going to show you how to navigate between pages with named routes. So instead of constantly doing first screen class, or second screen class or whatever is called tomorrow is split into separate file the Nagas method. That's what we're going to fix in this video, what we can do is is set in the routes and the benefit of that is one, you can name the class whatever you want, and you can constantly be raining obviously shouldn't be renaming the class but if you have two routes, which is you know, stayed the same, plus you can have a bit more of a descriptive name in the root member class you want it to be called something slightly different. And if you come from a web development background, this will feel right at home for you.
So what we want to do in the CLI talk and what we are going to put next Initial route missing something I'm missing. First of all inside of here we need to have an exterior lap. Instead, we would usually create like the first screen class and that's what we would invoke but inside of here, title demo, we are going to have the initial route. And this is gonna be fourth class, it's basically going to be the homepage. And we are going to have loops, curly braces in here, we're going to have the initial router for slash and we specify it on on text, and then the arrow operator and we'll say the screen and then any other routes, we just put comma, then the group name so close last second for a second. routes and context.
Whatever the class is called, that's it. Now to actually navigate to it to navigate from is still you know, dot pop context that to then turn to navigate to it, you do navigator. dot push name to the context and then you name it before slash, I mean, colon, speech marks, similar speech marks, quotation marks, and the second semicolon. And if we do a hot restart, for clicking on screen, printing running slow, obviously should be the slide. There you go, but we're using me. So this just refers to whatever this is pointing to.
Obviously your classes can be more complex than this. But apart from that, really all you need to Now if you have any questions, feel free to call me and message analgesia. I look forward to seeing you in the next video.