petitspas/frontend/lib/navigation/app_router.dart

26 lines
775 B
Dart
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import 'package:flutter/material.dart';
import 'package:go_router/go_router.dart';
import '../screens/auth/login_screen.dart';
import '../screens/home/home_screen.dart';
class AppRouter {
static const String login = '/login';
static const String home = '/home';
static Route<dynamic> generateRoute(RouteSettings settings) {
switch (settings.name) {
case login:
return MaterialPageRoute(builder: (_) => const LoginScreen());
case home:
return MaterialPageRoute(builder: (_) => const HomeScreen());
default:
return MaterialPageRoute(
builder: (_) => Scaffold(
body: Center(
child: Text('Route non définie: ${settings.name}'),
),
),
);
}
}
}