@override
   Widget build(BuildContext context) {
     return CupertinoApp(
       home: const HomePage(),
       // The [routes] property defines the available named routes
       // and the widgets to build when navigating to those routes.
       routes: {
         detailsPageRouteName: (context) => const DetailsPage(),
       },
     );
   }
 }
 

    The following sample generates a list of persons using
mockPersons(). Tapping a person pushes the person’s detail page
to the Navigator using pushNamed().

    
 
   
     Test in DartPad
   
   
     View on GitHub