{"id":2007,"date":"2022-04-07T08:03:44","date_gmt":"2022-04-07T08:03:44","guid":{"rendered":"https:\/\/mdr.foobrdigital.com\/?p=2007"},"modified":"2022-04-07T08:03:44","modified_gmt":"2022-04-07T08:03:44","slug":"navigate-to-the-second-route-using-navigator-push-method","status":"publish","type":"post","link":"https:\/\/mudassirbackup.infinitycodestudio.com\/index.php\/2022\/04\/07\/navigate-to-the-second-route-using-navigator-push-method\/","title":{"rendered":"Navigate to the second route using Navigator.push() method"},"content":{"rendered":"\n<p>The Navigator.push() method is used to navigate\/switch to a new route\/page\/screen. Here, the\u00a0<strong>push()<\/strong>\u00a0method adds a page\/route on the stack and then manage it by using the\u00a0<strong>Navigator.<\/strong>\u00a0Again we use MaterialPageRoute class that allows transition between the routes using a platform-specific animation. The below code explain the use of the Navigator.push() method.<a href=\"https:\/\/www.javatpoint.com\/flutter-navigation-and-routing#\"><\/a><a href=\"https:\/\/www.javatpoint.com\/flutter-navigation-and-routing#\"><\/a><a href=\"https:\/\/www.javatpoint.com\/flutter-navigation-and-routing#\"><\/a><\/p>\n\n\n\n<p><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/\/ Within the `FirstRoute` widget  \nonPressed: () {  \n  Navigator.push(  \n    context,  \n    MaterialPageRoute(builder: (context) => SecondRoute()),  \n  );  \n}  <\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>The Navigator.push() method is used to navigate\/switch to a new route\/page\/screen. Here, the\u00a0push()\u00a0method adds a page\/route on the stack and then manage it by using the\u00a0Navigator.\u00a0Again we use MaterialPageRoute class that allows transition between the routes using a platform-specific animation. The below code explain the use of the Navigator.push() method.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[80],"tags":[],"_links":{"self":[{"href":"https:\/\/mudassirbackup.infinitycodestudio.com\/index.php\/wp-json\/wp\/v2\/posts\/2007"}],"collection":[{"href":"https:\/\/mudassirbackup.infinitycodestudio.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mudassirbackup.infinitycodestudio.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mudassirbackup.infinitycodestudio.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mudassirbackup.infinitycodestudio.com\/index.php\/wp-json\/wp\/v2\/comments?post=2007"}],"version-history":[{"count":0,"href":"https:\/\/mudassirbackup.infinitycodestudio.com\/index.php\/wp-json\/wp\/v2\/posts\/2007\/revisions"}],"wp:attachment":[{"href":"https:\/\/mudassirbackup.infinitycodestudio.com\/index.php\/wp-json\/wp\/v2\/media?parent=2007"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mudassirbackup.infinitycodestudio.com\/index.php\/wp-json\/wp\/v2\/categories?post=2007"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mudassirbackup.infinitycodestudio.com\/index.php\/wp-json\/wp\/v2\/tags?post=2007"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}