feat(connectivity): restyle offline and reconnect banners

Tint the mini player's reconnecting/error sub-states with the
offlineAccent token (added in WU1, unused until now): the status
label, the reconnect spinner, and the error retry icon now read as
visually distinct "connectivity trouble" states instead of blending
into the ordinary loading/paused look. Plain buffering keeps the
default colour, confirmed by a dedicated regression test.

Verify-first gate (task 16.1): ControladorReconexion.intentos exists,
but ServicioAudio never surfaces it past a debug log line, and its
estadoStream only carries the EstadoReproduccion enum. Adding an
attempt-count label would require a getter/stream on
servicio_audio.dart, one of the files this change must keep at an
empty diff against main. Ship the restyle without the counter, per
the risk register's own fallback.

WU16.
This commit is contained in:
2026-07-29 14:43:34 +02:00
parent dc21732027
commit 862197ab48
3 changed files with 168 additions and 17 deletions
+25 -6
View File
@@ -129,20 +129,31 @@ class _MiniReproductorState extends State<MiniReproductor> {
EstadoReproduccion.detenido;
final activo =
s == EstadoReproduccion.reproduciendo;
// WU16: reconectando/error are
// "connectivity trouble" states —
// tinted with offlineAccent so they
// read as visually distinct from
// ordinary loading/paused/stopped.
final conexionEnProblema =
s ==
EstadoReproduccion.reconectando ||
s == EstadoReproduccion.error;
return Text(
_labelEstado(l10n, s),
style: Theme.of(
context,
).textTheme.bodySmall?.copyWith(
color:
activo
conexionEnProblema
? t.offlineAccent
: activo
? t.warmCoral
: Theme.of(context)
.colorScheme
.onSurface
.withValues(alpha: 0.7),
fontWeight:
activo
(activo || conexionEnProblema)
? FontWeight.w600
: FontWeight.w400,
),
@@ -173,12 +184,20 @@ class _MiniReproductorState extends State<MiniReproductor> {
// cargando (spinner), never as the error/retry affordance.
if (s == EstadoReproduccion.cargando ||
s == EstadoReproduccion.reconectando) {
return const SizedBox(
// WU16: only the reconectando sub-state gets the offline
// accent — plain cargando (e.g. the very first play)
// keeps the default spinner colour, since it is not a
// connectivity problem.
final reconectando = s == EstadoReproduccion.reconectando;
return SizedBox(
width: 48,
height: 48,
child: Padding(
padding: EdgeInsets.all(12),
child: CircularProgressIndicator(strokeWidth: 2),
padding: const EdgeInsets.all(12),
child: CircularProgressIndicator(
strokeWidth: 2,
color: reconectando ? t.offlineAccent : null,
),
),
);
}
@@ -187,7 +206,7 @@ class _MiniReproductorState extends State<MiniReproductor> {
final emisoraActual = estado.emisoraActual;
return IconButton(
tooltip: l10n.retryAction,
icon: const Icon(Icons.refresh_rounded),
icon: Icon(Icons.refresh_rounded, color: t.offlineAccent),
onPressed:
emisoraActual != null
? () => estado.reproducir(emisoraActual)