117 lines
3.3 KiB
Dart
117 lines
3.3 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:go_router/go_router.dart';
|
|
|
|
// Feature screens
|
|
import 'package:inou_app/features/static/landing_page.dart';
|
|
import 'package:inou_app/features/static/security_page.dart';
|
|
import 'package:inou_app/features/static/privacy_page.dart';
|
|
import 'package:inou_app/features/static/faq_page.dart';
|
|
import 'package:inou_app/features/static/dpa_page.dart';
|
|
import 'package:inou_app/features/static/connect_page.dart';
|
|
import 'package:inou_app/features/static/invite_page.dart';
|
|
import 'package:inou_app/features/auth/login_page.dart';
|
|
import 'package:inou_app/features/auth/signup_page.dart';
|
|
import 'package:inou_app/features/dashboard/dashboard.dart';
|
|
import 'package:inou_app/design/screens/styleguide_screen.dart';
|
|
|
|
/// App route definitions
|
|
class AppRoutes {
|
|
// Static pages
|
|
static const String landing = '/';
|
|
static const String security = '/security';
|
|
static const String privacy = '/privacy';
|
|
static const String faq = '/faq';
|
|
static const String dpa = '/dpa';
|
|
static const String connect = '/connect';
|
|
static const String invite = '/invite';
|
|
|
|
// Auth pages
|
|
static const String login = '/login';
|
|
static const String signup = '/signup';
|
|
static const String forgotPassword = '/forgot-password';
|
|
|
|
// Authenticated pages (deep pages)
|
|
static const String dashboard = '/dashboard';
|
|
static const String dossier = '/dossier/:id';
|
|
static const String profile = '/profile';
|
|
|
|
// Dev
|
|
static const String styleguide = '/styleguide';
|
|
}
|
|
|
|
/// GoRouter configuration
|
|
final GoRouter appRouter = GoRouter(
|
|
initialLocation: '/',
|
|
routes: [
|
|
// Static pages
|
|
GoRoute(
|
|
path: '/',
|
|
builder: (context, state) => const LandingPage(),
|
|
),
|
|
GoRoute(
|
|
path: '/security',
|
|
builder: (context, state) => const SecurityPage(),
|
|
),
|
|
GoRoute(
|
|
path: '/privacy',
|
|
builder: (context, state) => const PrivacyPage(),
|
|
),
|
|
GoRoute(
|
|
path: '/faq',
|
|
builder: (context, state) => const FaqPage(),
|
|
),
|
|
GoRoute(
|
|
path: '/dpa',
|
|
builder: (context, state) => const DpaPage(),
|
|
),
|
|
GoRoute(
|
|
path: '/connect',
|
|
builder: (context, state) => const ConnectPage(),
|
|
),
|
|
GoRoute(
|
|
path: '/invite',
|
|
builder: (context, state) => const InvitePage(),
|
|
),
|
|
|
|
// Auth pages
|
|
GoRoute(
|
|
path: '/login',
|
|
builder: (context, state) => const LoginPage(),
|
|
),
|
|
GoRoute(
|
|
path: '/signup',
|
|
builder: (context, state) => const SignupPage(),
|
|
),
|
|
|
|
// Authenticated pages
|
|
GoRoute(
|
|
path: '/dashboard',
|
|
builder: (context, state) => const DashboardPage(),
|
|
),
|
|
GoRoute(
|
|
path: '/dossier/:id',
|
|
builder: (context, state) {
|
|
final dossierId = state.pathParameters['id']!;
|
|
return DossierPage(dossierId: dossierId);
|
|
},
|
|
),
|
|
|
|
// Dev
|
|
GoRoute(
|
|
path: '/styleguide',
|
|
builder: (context, state) => const StyleguideScreen(),
|
|
),
|
|
],
|
|
errorBuilder: (context, state) => const LandingPage(),
|
|
);
|
|
|
|
/// Legacy route generator for MaterialApp (deprecated, use GoRouter)
|
|
@Deprecated('Use appRouter with GoRouter instead')
|
|
Route<dynamic>? generateRoute(RouteSettings settings) {
|
|
// Keep for backwards compatibility if needed
|
|
return MaterialPageRoute(
|
|
builder: (_) => const LandingPage(),
|
|
settings: settings,
|
|
);
|
|
}
|