fix(escuchar): show the station meta line in the hero

Audit 1.6 (t4 line 62): the Escuchar hero never rendered "genre ·
country · bitrate kbps" between the station name and the visualizer.
Built from fields Emisora already carries (tags/pais/bitrate) — no
new fields, no service calls — omitting gracefully whatever a station
lacks.
This commit is contained in:
2026-07-29 23:34:07 +02:00
parent 9840205a83
commit e1505d7aaa
2 changed files with 104 additions and 0 deletions
+30
View File
@@ -267,6 +267,22 @@ class _EscucharHero extends StatelessWidget {
maxLines: 2,
overflow: TextOverflow.ellipsis,
),
if (_metaEscuchar(emisora) case final meta?) ...[
const SizedBox(height: 4),
Text(
meta,
key: const ValueKey('escuchar-hero-meta'),
style: TextStyle(
fontSize: 12.5,
fontWeight: FontWeight.w600,
color: theme.colorScheme.onSurface.withValues(
alpha: 0.62,
),
),
maxLines: 1,
overflow: TextOverflow.ellipsis,
),
],
const SizedBox(height: 8),
VisualizadorAudio(
estadoStream: estado.estadoStream,
@@ -536,3 +552,17 @@ class _FilaTransporteEscuchar extends StatelessWidget {
: l10n.durationMinutesSeconds(d.inMinutes, s);
}
}
/// Audit 1.6 (t4 line 62): "género · país · kbps" built ONLY from fields
/// [Emisora] already carries (`tags`/`pais`/`bitrate`) — no new fields, no
/// service calls. Whatever a station lacks is omitted gracefully; this
/// never renders a stray leading/trailing/doubled " · ".
String? _metaEscuchar(Emisora emisora) {
final partes = <String>[
if (emisora.generos.isNotEmpty) emisora.generos.first,
if (emisora.pais != null && emisora.pais!.isNotEmpty) emisora.pais!,
if (emisora.bitrate != null && emisora.bitrate! > 0)
'${emisora.bitrate} kbps',
];
return partes.isEmpty ? null : partes.join(' · ');
}