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:
@@ -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(' · ');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user