fix. Solución a que no se detenga la música
All checks were successful
Build & Deploy Pluriwave / Análisis de código (push) Successful in 9s
Build & Deploy Pluriwave / Build APK + AAB release (push) Successful in 1m56s

This commit is contained in:
Javier Bautista Fernández
2026-04-07 12:30:41 +02:00
parent 0dc554e5fb
commit a8425d65bc

View File

@@ -2,7 +2,7 @@ import 'dart:async';
import 'servicio_audio.dart';
/// Opciones predefinidas de timer en minutos.
const opcionesTimer = [15, 30, 60, 90];
const opcionesTimer = [3, 5, 10, 15, 30, 60, 90, 120, 180];
/// Servicio de auto-apagado de la radio.
///
@@ -48,12 +48,25 @@ class ServicioTimer {
if (restante <= Duration.zero) {
_tiempoRestante = Duration.zero;
_controller.add(_tiempoRestante);
_timer?.cancel();
_timer = null;
_activo = false;
_iniciarFadeOut();
cancelar(detenerAudio: false);
} else {
_tiempoRestante = restante;
_controller.add(_tiempoRestante);
}
// if (restante <= Duration.zero) {
// _tiempoRestante = Duration.zero;
// _controller.add(_tiempoRestante);
// _iniciarFadeOut();
// cancelar(detenerAudio: false);
// } else {
// _tiempoRestante = restante;
// _controller.add(_tiempoRestante);
// }
});
}