Files
prosappweb/lib/router/router.dart
T
Lizandro GuarnizoandClaude Sonnet 4.6 0711d30f07 feat: 6 mejoras simultáneas en prosappweb
- web/index.html: lang=es (evita traductor) + cache busting con timestamp en flutter_bootstrap.js
- profesional.dart: rate → número, location_preferences → string para coincidir con backend DTO
- location_preferences.dart: funciones locationPrefsToString/locationPrefsFromValue
- auth_provider.dart: _navigateAfterAuth redirige a setup-city si user.city vacío, método updateCity y linkEmailWithOtp
- setup_city_view.dart: nueva vista con GPS + Nominatim para detectar ciudad, campo editable, omitir
- email_view.dart: rediseño completo con flujo OTP (paso 1: email+contraseña → paso 2: código recibido en correo)
- router + dashboard_handlers: ruta /dashboard/setup-city

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-28 11:34:51 -05:00

213 lines
6.4 KiB
Dart

import 'package:prosapp_web_app/router/admin_handlers.dart';
import 'package:prosapp_web_app/router/dashboard_handlers.dart';
import 'package:prosapp_web_app/router/no_page_found_handlers.dart';
import 'package:fluro/fluro.dart';
class Flurorouter {
static final FluroRouter router = FluroRouter();
static String rootRoute = "/";
// Auth Router
static String phoneLoginRoute = "/auth/phone_login";
static String loginRoute = "/auth/login";
static String registerRoute = "/auth/register";
// Dashboard
static String dashboardRoute = "/dashboard";
static String supportRoute = "/dashboard/support";
// Onboarding
static String setupNameRoute = "/dashboard/setup-name";
static String setupCityRoute = "/dashboard/setup-city";
// Users
static String profileRoute = "/dashboard/profile";
static String phoneRoute = "/dashboard/phone";
static String emailRoute = "/dashboard/email";
static String userServicesRoute = "/dashboard/user/services";
static String userServicesHistoryRoute = "/dashboard/user/services/history";
static String userServiceRoute = "/dashboard/user/service/:uid";
static String calendarRoute = "/dashboard/calendar/:uid";
static String requestProfessionalRoute = "/dashboard/request/professional";
static String userRatingRoute = "/dashboard/user/service/:serviceId/rating/:professionalId";
static String professionalRatingRoute = "/dashboard/professional/service/:serviceId/rating/:userId";
static String userChatRoute = "/dashboard/user/service/:serviceId/chat/:professionalId";
static String professionalChatRoute = "/dashboard/professional/service/:serviceId/chat/:userId";
// Professionals
static String professionalProfileRoute = "/dashboard/professional/profile";
static String professionalScheduleRoute = "/dashboard/professional/schedule";
static String professionalServicesRoute = "/dashboard/professional/services";
static String professionalServicesRequestsRoute =
"/dashboard/professional/requests";
static String professionalServicesHistoryRoute =
"/dashboard/professional/services/history";
static String professionalServiceRoute =
"/dashboard/professional/service/:uid";
static String professionalsRoute = "/dashboard/professionals";
static String professionalCalendarRoute = "/dashboard/professional/calendar";
static void configureRoutes() {
// Auth Routes
router.define(
rootRoute,
handler: AdminHandlers.phone,
transitionType: TransitionType.none,
);
router.define(
phoneLoginRoute,
handler: AdminHandlers.phone,
transitionType: TransitionType.none,
);
router.define(
loginRoute,
handler: AdminHandlers.login,
transitionType: TransitionType.none,
);
router.define(
registerRoute,
handler: AdminHandlers.register,
transitionType: TransitionType.none,
);
// Onboarding
router.define(
setupNameRoute,
handler: DashboardHandlers.setupName,
transitionType: TransitionType.none,
);
router.define(
setupCityRoute,
handler: DashboardHandlers.setupCity,
transitionType: TransitionType.none,
);
// Dashboard Routes
router.define(
dashboardRoute,
handler: DashboardHandlers.dashboard,
transitionType: TransitionType.none,
);
router.define(
supportRoute,
handler: DashboardHandlers.support,
transitionType: TransitionType.none,
);
// users
router.define(
profileRoute,
handler: DashboardHandlers.profile,
transitionType: TransitionType.none,
);
router.define(
phoneRoute,
handler: DashboardHandlers.phone,
transitionType: TransitionType.none,
);
router.define(
emailRoute,
handler: DashboardHandlers.email,
transitionType: TransitionType.none,
);
router.define(
professionalsRoute,
handler: DashboardHandlers.professionals,
transitionType: TransitionType.none,
);
router.define(
userServicesRoute,
handler: DashboardHandlers.userServices,
transitionType: TransitionType.none,
);
router.define(
userServicesHistoryRoute,
handler: DashboardHandlers.userServicesHistory,
transitionType: TransitionType.none,
);
router.define(
userServiceRoute,
handler: DashboardHandlers.userService,
transitionType: TransitionType.none,
);
router.define(
professionalServiceRoute,
handler: DashboardHandlers.professionalService,
transitionType: TransitionType.none,
);
router.define(
userRatingRoute,
handler: DashboardHandlers.userRating,
transitionType: TransitionType.none,
);
router.define(
professionalRatingRoute,
handler: DashboardHandlers.professionalRating,
transitionType: TransitionType.none,
);
router.define(
userChatRoute,
handler: DashboardHandlers.userChat,
transitionType: TransitionType.none,
);
router.define(
professionalChatRoute,
handler: DashboardHandlers.professionalChat,
transitionType: TransitionType.none,
);
router.define(
calendarRoute,
handler: DashboardHandlers.calendar,
transitionType: TransitionType.none,
);
router.define(
requestProfessionalRoute,
handler: DashboardHandlers.requestProfessional,
transitionType: TransitionType.none,
);
// profesionals
router.define(
professionalProfileRoute,
handler: DashboardHandlers.professionalProfile,
transitionType: TransitionType.none,
);
router.define(
professionalScheduleRoute,
handler: DashboardHandlers.professionalSchedule,
transitionType: TransitionType.none,
);
router.define(
professionalServicesRoute,
handler: DashboardHandlers.professionalServices,
transitionType: TransitionType.none,
);
router.define(
professionalServicesRequestsRoute,
handler: DashboardHandlers.professionalServicesRequests,
transitionType: TransitionType.none,
);
router.define(
professionalServicesHistoryRoute,
handler: DashboardHandlers.professionalServicesHistory,
transitionType: TransitionType.none,
);
router.define(
professionalCalendarRoute,
handler: DashboardHandlers.professionalCalendar,
transitionType: TransitionType.none,
);
// 404
router.notFoundHandler = NoPageFoundHandlers.noPageFound;
}
}