Understanding the principles of moving along routes in Flutter


I have routes:


and the transitions were made:

'/home' -> '/home/nav_one' -> '/home/nav_one/nav_two' -> '/home/contacts/description'

Where will the command return: Navigator.pop():
To '/home/nav_one/nav_two' or '/home/contacts'?

If in the first option, then why do we write these same routes, for the sake of ease of reading and understanding?


Assuming that these are the route names and that you’ve been Navigator.pushNamed()ing the screens the answer is,

To '/home/nav_one/nav_two'

These route names are just identifiers so you can name them like,


for your own convenience.

Answered By – happy_san

Answer Checked By – Timothy Miller (FlutterFixes Admin)

Leave a Reply

Your email address will not be published. Required fields are marked *