diff --git a/lib/servicios/servicio_timer.dart b/lib/servicios/servicio_timer.dart index 0e8b26a..1b1e9b8 100644 --- a/lib/servicios/servicio_timer.dart +++ b/lib/servicios/servicio_timer.dart @@ -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); + // } }); }