Browse Source

commit main

master
andrymodeste 4 months ago
parent
commit
79d208b69e
  1. 25
      lib/main.dart

25
lib/main.dart

@ -38,27 +38,10 @@ class MyApp extends StatelessWidget {
child: OrdersManagementScreen(), child: OrdersManagementScreen(),
), ),
// MODIFICATION : Route simple pour le menu // MODIFICATION : Route simple pour le menu
'/menu': (context) => const MainLayout( // '/menu': (context) => const MainLayout(
currentRoute: '/menu', // currentRoute: '/menu',
child: MenuPage(), // Pas de paramètres requis maintenant // child: MenuPage(), // Pas de paramètres requis maintenant
), // ),
},
// onGenerateRoute pour gérer les paramètres optionnels
onGenerateRoute: (settings) {
if (settings.name == '/menu-with-table') {
final args = settings.arguments as Map<String, dynamic>?;
return MaterialPageRoute(
builder: (context) => MainLayout(
currentRoute: '/menu',
child: MenuPage(
tableId: args?['tableId'] ?? 0,
personne: args?['personne'] ?? 1,
),
),
);
}
return null;
}, },
); );
} }

Loading…
Cancel
Save