Flutter › Named Routes & Navigator 2.0 (Router API)

What are named routes in Flutter, and how do they let you navigate to a specific screen simply by referencing a genuinely simple string identifier rather than needing to directly construct that particular widget yourself?

Beginner

Answer

Named routes let you register each individual screen within your app under a genuinely simple, memorable string identifier, such as slash profile or slash checkout, within a centralized routes table typically defined on your MaterialApp, letting you navigate to that particular specific screen elsewhere throughout your app simply by calling Navigator.pushNamed with that exact same matching string, rather than needing to directly construct and reference that particular destination widget's own class directly every single time, which can genuinely help keep your navigation related code considerably cleaner and more centrally organized.
MaterialApp(
  routes: {
    '/profile': (context) => ProfileScreen(),
    '/checkout': (context) => CheckoutScreen(),
  },
)

Navigator.pushNamed(context, '/profile');
Real-world example A large app registers each one of its own genuinely dozens of separate screens under a clearly named, centrally organized route table, letting any given developer navigate to a specific particular screen from anywhere else throughout the app simply by referencing its own simple, memorable route name.

Common follow-ups: How do you actually properly pass specific arguments to a screen when navigating using a named route?;What is the specific practical difference between named routes and the considerably newer Navigator 2.0 Router API?