Advertisement
antasofa

Flutter Routing

Jun 14th, 2023
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Dart 0.66 KB | Source Code | 0 0
  1. onGenerateRoute: (RouteSettings routeSettings) {
  2.             return MaterialPageRoute<void>(
  3.               settings: routeSettings,
  4.               builder: (BuildContext context) {
  5.                 switch (routeSettings.name) {
  6.                   case SettingsView.routeName:
  7.                     return SettingsView(controller: settingsController);
  8.                   case SampleItemDetailsView.routeName:
  9.                     return const SampleItemDetailsView();
  10.                   case SampleItemListView.routeName:
  11.                   default:
  12.                     return const SampleItemListView();
  13.                 }
  14.               },
  15.             );
  16.           },
Tags: flutter
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement