import 'package:flutter/material.dart'; import 'package:go_router/go_router.dart'; import 'package:sino_med_cloud/features/main_tab_page.dart'; import 'package:sino_med_cloud/l10n/app_localizations.dart'; import '../features/auth/presentation/login_page.dart'; import '../features/MediaTestPage/presentation/media_test_page.dart'; import '../core/network/pages/no_network_page.dart'; class AppRouter { static final router = GoRouter( routes: [ GoRoute( path: '/', builder: (context, state) => const LoginPage(), ), GoRoute( path: '/mainTab', builder: (context, state) => const MainTabPage(), ), GoRoute( path: '/mediaTest', builder: (context, state) => const MediaTestPage(), ), GoRoute( path: '/noNetwork', builder: (context, state) => const NoNetworkPage(), ), ], errorBuilder: (context, state) { final l10n = AppLocalizations.of(context)!; return Scaffold( appBar: AppBar( title: Text(l10n.pageNotFound), ), body: Center( child: Column( mainAxisAlignment: MainAxisAlignment.center, children: [ const Icon( Icons.error_outline, size: 64, color: Colors.grey, ), const SizedBox(height: 16), Text( l10n.pageNotFoundWithUri(state.uri.toString()), style: const TextStyle(fontSize: 16), ), const SizedBox(height: 16), ElevatedButton( onPressed: () => context.go('/'), child: Text(l10n.returnHome), ), ], ), ), ); }, ); }