Commit final
This commit is contained in:
@@ -98,7 +98,7 @@ class RouteSimulatorService extends ChangeNotifier {
|
||||
if (diff.inMinutes >= 30 && !state.stoppedAlertSent) {
|
||||
state.stoppedAlertSent = true;
|
||||
_fireAndSave(event:NotifEvent.truckStopped, routeId:state.routeId,
|
||||
title:'⚠️ Camión detenido',
|
||||
title:' Camión detenido',
|
||||
body:'El camión ${state.routeId} lleva +30 min sin moverse. Verifica.',
|
||||
tipo:'CAMION_DETENIDO');
|
||||
}
|
||||
@@ -111,29 +111,29 @@ class RouteSimulatorService extends ChangeNotifier {
|
||||
|
||||
if (idx == 1) {
|
||||
// Ruta iniciada
|
||||
_fireNotif(NotifEvent.routeStart, '¡Ruta Iniciada! 🚛',
|
||||
_fireNotif(NotifEvent.routeStart, '¡Ruta Iniciada! ',
|
||||
'El camión ha salido del Relleno Sanitario rumbo a tu sector. '
|
||||
'Prepara tus bolsas pero espera la señal para sacarlas.', state.routeId);
|
||||
} else if (idx == 2) {
|
||||
// ~30 min — aviso preventivo
|
||||
_fireNotif(NotifEvent.truckApproaching15min, '🕐 El camión se acerca',
|
||||
_fireNotif(NotifEvent.truckApproaching15min, ' El camión se acerca',
|
||||
'Tu camión recolector está en camino. Tendrás otro aviso cuando esté a '
|
||||
'15 minutos. ⚠️ No saques la basura todavía — espera el aviso.', state.routeId);
|
||||
'15 minutos. No saques la basura todavía — espera el aviso.', state.routeId);
|
||||
} else if (idx == 3) {
|
||||
// ~15 min — MOMENTO de sacar la basura
|
||||
_fireNotif(NotifEvent.truckProximity, '⚠️ ¡Saca tus bolsas AHORA!',
|
||||
_fireNotif(NotifEvent.truckProximity, ' ¡Saca tus bolsas AHORA!',
|
||||
'El camión llega en aprox. 15 minutos a tu colonia. '
|
||||
'Este es el momento de sacar tus bolsas a la acera. '
|
||||
'🚫 No persigas ni interceptes la unidad.', state.routeId);
|
||||
'No persigas ni interceptes la unidad.', state.routeId);
|
||||
} else if (idx == total - 2) {
|
||||
// Pasando por la zona
|
||||
_fireNotif(NotifEvent.truckProximity, '✅ El camión está en tu zona',
|
||||
_fireNotif(NotifEvent.truckProximity, ' El camión está en tu zona',
|
||||
'El camión recolector está pasando por tu colonia. '
|
||||
'Si ya sacaste tus bolsas, el servicio está en curso.', state.routeId);
|
||||
} else if (idx == total - 1) {
|
||||
// Servicio finalizado → prompt de reseña
|
||||
state.reviewPromptSent = true;
|
||||
_fireNotif(NotifEvent.reviewPrompt, '🌟 ¿Cómo fue el servicio?',
|
||||
_fireNotif(NotifEvent.reviewPrompt, ' ¿Cómo fue el servicio?',
|
||||
'¡El camión concluyó su jornada! Ayúdanos calificando el servicio '
|
||||
'de recolección de hoy. Tu opinión mejora el servicio.', state.routeId);
|
||||
}
|
||||
@@ -168,7 +168,7 @@ class RouteSimulatorService extends ChangeNotifier {
|
||||
if (state == null) return;
|
||||
state.gpsActive = false;
|
||||
await _fireAndSave(event:NotifEvent.gpsLost, routeId:routeId,
|
||||
title:'📡 GPS Desactivado',
|
||||
title:' GPS Desactivado',
|
||||
body:'Se perdió la señal GPS del camión $routeId.',
|
||||
tipo:'GPS_PERDIDO');
|
||||
notifyListeners();
|
||||
@@ -198,20 +198,20 @@ class RouteSimulatorService extends ChangeNotifier {
|
||||
String getEtaText(String routeId) {
|
||||
final state = _states[routeId];
|
||||
if (state == null) return 'Sin información';
|
||||
if (!state.gpsActive) return '📡 Señal GPS perdida';
|
||||
if (!state.gpsActive) return 'Señal GPS perdida';
|
||||
final route = getRouteById(routeId);
|
||||
if (route == null) return 'Ruta no encontrada';
|
||||
final idx = state.positionIndex;
|
||||
if (idx >= route.positions.length) return '✅ Servicio finalizado';
|
||||
if (idx >= route.positions.length) return ' Servicio finalizado';
|
||||
switch (idx) {
|
||||
case 0: return '🕐 Ruta por iniciar';
|
||||
case 1: return '🚛 Camión en camino — mantén tus bolsas adentro';
|
||||
case 2: return '🚛 Aprox. 30 min — espera el aviso de 15 min';
|
||||
case 3: return '⚠️ ¡15 min! Saca tus bolsas a la acera ahora';
|
||||
case 4: return '🔔 El camión está en tu colonia';
|
||||
case 5: return '✅ Recogiendo basura en tu zona';
|
||||
case 6: return '↩️ Regresando al relleno sanitario';
|
||||
default: return '🏁 Servicio del día finalizado';
|
||||
case 0: return 'Ruta por iniciar';
|
||||
case 1: return ' Camión en camino — mantén tus bolsas adentro';
|
||||
case 2: return ' Aprox. 30 min — espera el aviso de 15 min';
|
||||
case 3: return ' ¡15 min! Saca tus bolsas a la acera ahora';
|
||||
case 4: return ' El camión está en tu colonia';
|
||||
case 5: return 'Recogiendo basura en tu zona';
|
||||
case 6: return 'Regresando al relleno sanitario';
|
||||
default: return ' Servicio del día finalizado';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user