102 lines
7.8 KiB
Dart
102 lines
7.8 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:go_router/go_router.dart';
|
|
import '../screens/booking/booking_screen.dart';
|
|
import '../screens/login/login_screen.dart';
|
|
import '../screens/dashboard/dashboard_screen.dart';
|
|
import '../screens/members/members_screen.dart';
|
|
import '../screens/placeholder_screen.dart';
|
|
import '../widgets/app_shell.dart';
|
|
|
|
final appRouter = GoRouter(
|
|
initialLocation: '/dashboard', // TODO: restaurar '/login' antes de producción
|
|
routes: [
|
|
GoRoute(
|
|
path: '/login',
|
|
builder: (context, state) => const LoginScreen(),
|
|
),
|
|
ShellRoute(
|
|
builder: (context, state, child) => AppShell(child: child),
|
|
routes: [
|
|
GoRoute(path: '/dashboard', builder: (context, state) => const DashboardScreen()),
|
|
|
|
// Abonados
|
|
GoRoute(path: '/abonados', builder: (_, __) => const MembersScreen()),
|
|
GoRoute(path: '/abonados/pre', builder: (_, s) => PlaceholderScreen(title: 'Pre-inscripciones', route: s.matchedLocation)),
|
|
GoRoute(path: '/abonados/nuevo', builder: (_, s) => PlaceholderScreen(title: 'Añadir abonado', route: s.matchedLocation)),
|
|
|
|
// Cursos
|
|
GoRoute(path: '/cursos', builder: (_, s) => PlaceholderScreen(title: 'Cursos', route: s.matchedLocation)),
|
|
|
|
// Alumnos
|
|
GoRoute(path: '/alumnos', builder: (_, s) => PlaceholderScreen(title: 'Alumnos', route: s.matchedLocation)),
|
|
GoRoute(path: '/alumnos/altas', builder: (_, s) => PlaceholderScreen(title: 'Altas', route: s.matchedLocation)),
|
|
GoRoute(path: '/alumnos/bajas', builder: (_, s) => PlaceholderScreen(title: 'Bajas', route: s.matchedLocation)),
|
|
|
|
// Reservas
|
|
GoRoute(path: '/reservas', builder: (_, __) => const BookingScreen()),
|
|
GoRoute(path: '/reservas-salas', builder: (_, s) => PlaceholderScreen(title: 'Reservas Salas', route: s.matchedLocation)),
|
|
|
|
// Consultas
|
|
GoRoute(path: '/consultas', builder: (_, s) => PlaceholderScreen(title: 'Consultas', route: s.matchedLocation)),
|
|
|
|
// Caja
|
|
GoRoute(path: '/caja', builder: (_, s) => PlaceholderScreen(title: 'Caja', route: s.matchedLocation)),
|
|
|
|
// Recibos
|
|
GoRoute(path: '/recibos/abonado', builder: (_, s) => PlaceholderScreen(title: 'Recibos por abonado', route: s.matchedLocation)),
|
|
GoRoute(path: '/recibos/actividad', builder: (_, s) => PlaceholderScreen(title: 'Recibos por actividad', route: s.matchedLocation)),
|
|
|
|
// Remesas
|
|
GoRoute(path: '/remesas', builder: (_, s) => PlaceholderScreen(title: 'Administrar remesas', route: s.matchedLocation)),
|
|
GoRoute(path: '/remesas/especial', builder: (_, s) => PlaceholderScreen(title: 'Remesa especial', route: s.matchedLocation)),
|
|
|
|
// Listados
|
|
GoRoute(path: '/listados/mensual', builder: (_, s) => PlaceholderScreen(title: 'Listado mensual', route: s.matchedLocation)),
|
|
GoRoute(path: '/listados/cobros-cursos', builder: (_, s) => PlaceholderScreen(title: 'Cobros por cursos', route: s.matchedLocation)),
|
|
GoRoute(path: '/listados/totales-curso', builder: (_, s) => PlaceholderScreen(title: 'Totales por curso', route: s.matchedLocation)),
|
|
GoRoute(path: '/listados/cobros-empleado', builder: (_, s) => PlaceholderScreen(title: 'Cobros por empleado', route: s.matchedLocation)),
|
|
GoRoute(path: '/listados/cobros', builder: (_, s) => PlaceholderScreen(title: 'Cobros', route: s.matchedLocation)),
|
|
GoRoute(path: '/listados/devueltos', builder: (_, s) => PlaceholderScreen(title: 'Recibos devueltos', route: s.matchedLocation)),
|
|
GoRoute(path: '/listados/bajas', builder: (_, s) => PlaceholderScreen(title: 'Listado de bajas', route: s.matchedLocation)),
|
|
GoRoute(path: '/listados/altas', builder: (_, s) => PlaceholderScreen(title: 'Listado de altas', route: s.matchedLocation)),
|
|
GoRoute(path: '/listados/altas-bajas', builder: (_, s) => PlaceholderScreen(title: 'Altas-bajas por mes', route: s.matchedLocation)),
|
|
GoRoute(path: '/listados/csv', builder: (_, s) => PlaceholderScreen(title: 'Ficheros CSV', route: s.matchedLocation)),
|
|
GoRoute(path: '/listados/impagadas', builder: (_, s) => PlaceholderScreen(title: 'Impagadas', route: s.matchedLocation)),
|
|
GoRoute(path: '/listados/impagadas-total', builder: (_, s) => PlaceholderScreen(title: 'Impagadas totales', route: s.matchedLocation)),
|
|
GoRoute(path: '/listados/retenidos', builder: (_, s) => PlaceholderScreen(title: 'Retenidos', route: s.matchedLocation)),
|
|
GoRoute(path: '/listados/sin-cuenta', builder: (_, s) => PlaceholderScreen(title: 'Sin cuenta', route: s.matchedLocation)),
|
|
GoRoute(path: '/listados/cursos-completos', builder: (_, s) => PlaceholderScreen(title: 'Cursos completos', route: s.matchedLocation)),
|
|
GoRoute(path: '/listados/registros-empleado', builder: (_, s) => PlaceholderScreen(title: 'Registros por empleado', route: s.matchedLocation)),
|
|
|
|
// Utilidades
|
|
GoRoute(path: '/utilidades/movimientos', builder: (_, s) => PlaceholderScreen(title: 'Movimientos de Caja', route: s.matchedLocation)),
|
|
GoRoute(path: '/utilidades/cerrar-caja', builder: (_, s) => PlaceholderScreen(title: 'Cerrar caja', route: s.matchedLocation)),
|
|
GoRoute(path: '/utilidades/tickets', builder: (_, s) => PlaceholderScreen(title: 'Últimos tickets', route: s.matchedLocation)),
|
|
GoRoute(path: '/utilidades/parametros', builder: (_, s) => PlaceholderScreen(title: 'Parámetros', route: s.matchedLocation)),
|
|
GoRoute(path: '/utilidades/cuotas', builder: (_, s) => PlaceholderScreen(title: 'Modificar Cuotas', route: s.matchedLocation)),
|
|
GoRoute(path: '/utilidades/elim-caja', builder: (_, s) => PlaceholderScreen(title: 'Eliminación R. de Caja', route: s.matchedLocation)),
|
|
GoRoute(path: '/utilidades/festivos', builder: (_, s) => PlaceholderScreen(title: 'Festivos', route: s.matchedLocation)),
|
|
GoRoute(path: '/utilidades/celebraciones', builder: (_, s) => PlaceholderScreen(title: 'Celebraciones', route: s.matchedLocation)),
|
|
GoRoute(path: '/utilidades/horarios', builder: (_, s) => PlaceholderScreen(title: 'Horarios pistas', route: s.matchedLocation)),
|
|
GoRoute(path: '/utilidades/contadores', builder: (_, s) => PlaceholderScreen(title: 'Contadores', route: s.matchedLocation)),
|
|
GoRoute(path: '/utilidades/actividades', builder: (_, s) => PlaceholderScreen(title: 'Actividades', route: s.matchedLocation)),
|
|
GoRoute(path: '/utilidades/tablas', builder: (_, s) => PlaceholderScreen(title: 'Tablas', route: s.matchedLocation)),
|
|
GoRoute(path: '/utilidades/impresoras', builder: (_, s) => PlaceholderScreen(title: 'Impresoras', route: s.matchedLocation)),
|
|
GoRoute(path: '/utilidades/carnet-printer', builder: (_, s) => PlaceholderScreen(title: 'Impresora CARNETS', route: s.matchedLocation)),
|
|
GoRoute(path: '/utilidades/sorteo', builder: (_, s) => PlaceholderScreen(title: 'Sorteo abonados', route: s.matchedLocation)),
|
|
|
|
// Admin / sistema
|
|
GoRoute(path: '/usuarios', builder: (_, s) => PlaceholderScreen(title: 'Usuarios', route: s.matchedLocation)),
|
|
GoRoute(path: '/tornos', builder: (_, s) => PlaceholderScreen(title: 'Tornos', route: s.matchedLocation)),
|
|
GoRoute(path: '/tornos/top', builder: (_, s) => PlaceholderScreen(title: 'Top usuarios', route: s.matchedLocation)),
|
|
GoRoute(path: '/tornos/gym', builder: (_, s) => PlaceholderScreen(title: 'Tornos (gym)', route: s.matchedLocation)),
|
|
GoRoute(path: '/tornos/activos', builder: (_, s) => PlaceholderScreen(title: 'Usuarios en sala', route: s.matchedLocation)),
|
|
GoRoute(path: '/registro', builder: (_, s) => PlaceholderScreen(title: 'Registro', route: s.matchedLocation)),
|
|
GoRoute(path: '/permisos', builder: (_, s) => PlaceholderScreen(title: 'Permisos', route: s.matchedLocation)),
|
|
],
|
|
),
|
|
],
|
|
errorBuilder: (_, state) => Scaffold(
|
|
body: Center(child: Text('Ruta no encontrada: ${state.uri}')),
|
|
),
|
|
);
|