fix(ci): resolve premium UI analyzer errors
This commit is contained in:
@@ -9,7 +9,7 @@ import 'pluri_glass_surface.dart';
|
||||
import 'pluri_icon.dart';
|
||||
import 'visualizador_audio.dart';
|
||||
|
||||
/// Barra inferior persistente con controles básicos de reproducción.
|
||||
/// Barra inferior persistente con controles básicos de reproducción.
|
||||
/// Toca la barra para abrir PantallaReproductor completa.
|
||||
class MiniReproductor extends StatelessWidget {
|
||||
const MiniReproductor({super.key});
|
||||
@@ -26,9 +26,17 @@ class MiniReproductor extends StatelessWidget {
|
||||
return SafeArea(
|
||||
top: false,
|
||||
child: Padding(
|
||||
padding: EdgeInsets.fromLTRB(t.spacingMd, t.spacingSm, t.spacingMd, t.spacingSm),
|
||||
padding: EdgeInsets.fromLTRB(
|
||||
t.spacingMd,
|
||||
t.spacingSm,
|
||||
t.spacingMd,
|
||||
t.spacingSm,
|
||||
),
|
||||
child: PluriGlassSurface(
|
||||
padding: EdgeInsets.symmetric(horizontal: t.spacingSm, vertical: t.spacingXs),
|
||||
padding: EdgeInsets.symmetric(
|
||||
horizontal: t.spacingSm,
|
||||
vertical: t.spacingXs,
|
||||
),
|
||||
borderRadius: BorderRadius.circular(999),
|
||||
child: Row(
|
||||
children: [
|
||||
@@ -67,27 +75,37 @@ class MiniReproductor extends StatelessWidget {
|
||||
children: [
|
||||
Text(
|
||||
emisora.nombre,
|
||||
style: Theme.of(context).textTheme.titleSmall?.copyWith(
|
||||
fontWeight: FontWeight.w700,
|
||||
),
|
||||
style: Theme.of(context)
|
||||
.textTheme
|
||||
.titleSmall
|
||||
?.copyWith(fontWeight: FontWeight.w700),
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
StreamBuilder<EstadoReproduccion>(
|
||||
stream: estado.estadoStream,
|
||||
builder: (context, snapshot) {
|
||||
final s = snapshot.data ?? EstadoReproduccion.detenido;
|
||||
final activo = s == EstadoReproduccion.reproduciendo;
|
||||
final s =
|
||||
snapshot.data ??
|
||||
EstadoReproduccion.detenido;
|
||||
final activo =
|
||||
s == EstadoReproduccion.reproduciendo;
|
||||
return Text(
|
||||
_labelEstado(s),
|
||||
style: Theme.of(context).textTheme.bodySmall?.copyWith(
|
||||
color: activo
|
||||
? t.warmCoral
|
||||
: Theme.of(context)
|
||||
.colorScheme
|
||||
.onSurface
|
||||
.withValues(alpha: 0.7),
|
||||
fontWeight: activo ? FontWeight.w600 : FontWeight.w400,
|
||||
style: Theme.of(
|
||||
context,
|
||||
).textTheme.bodySmall?.copyWith(
|
||||
color:
|
||||
activo
|
||||
? t.warmCoral
|
||||
: Theme.of(context)
|
||||
.colorScheme
|
||||
.onSurface
|
||||
.withValues(alpha: 0.7),
|
||||
fontWeight:
|
||||
activo
|
||||
? FontWeight.w600
|
||||
: FontWeight.w400,
|
||||
),
|
||||
);
|
||||
},
|
||||
@@ -128,16 +146,28 @@ class MiniReproductor extends StatelessWidget {
|
||||
return IconButton(
|
||||
tooltip: 'Reintentar',
|
||||
icon: const Icon(Icons.refresh_rounded),
|
||||
onPressed: emisoraActual != null ? () => estado.reproducir(emisoraActual) : null,
|
||||
constraints: const BoxConstraints.tightFor(width: 48, height: 48),
|
||||
onPressed:
|
||||
emisoraActual != null
|
||||
? () => estado.reproducir(emisoraActual)
|
||||
: null,
|
||||
constraints: const BoxConstraints.tightFor(
|
||||
width: 48,
|
||||
height: 48,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
return Semantics(
|
||||
button: true,
|
||||
label: s == EstadoReproduccion.reproduciendo ? 'Pausar' : 'Reproducir',
|
||||
label:
|
||||
s == EstadoReproduccion.reproduciendo
|
||||
? 'Pausar'
|
||||
: 'Reproducir',
|
||||
child: IconButton(
|
||||
tooltip: s == EstadoReproduccion.reproduciendo ? 'Pausar' : 'Reproducir',
|
||||
tooltip:
|
||||
s == EstadoReproduccion.reproduciendo
|
||||
? 'Pausar'
|
||||
: 'Reproducir',
|
||||
icon: Icon(
|
||||
s == EstadoReproduccion.reproduciendo
|
||||
? Icons.pause_circle_filled_rounded
|
||||
@@ -145,7 +175,10 @@ class MiniReproductor extends StatelessWidget {
|
||||
color: t.electricMagenta,
|
||||
),
|
||||
onPressed: estado.togglePlay,
|
||||
constraints: const BoxConstraints.tightFor(width: 48, height: 48),
|
||||
constraints: const BoxConstraints.tightFor(
|
||||
width: 48,
|
||||
height: 48,
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
@@ -162,7 +195,7 @@ class MiniReproductor extends StatelessWidget {
|
||||
EstadoReproduccion.cargando => 'Conectando...',
|
||||
EstadoReproduccion.reproduciendo => 'En directo',
|
||||
EstadoReproduccion.pausado => 'Pausado',
|
||||
EstadoReproduccion.error => 'Error de conexión',
|
||||
EstadoReproduccion.error => 'Error de conexión',
|
||||
EstadoReproduccion.detenido => 'Detenido',
|
||||
};
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ import 'pluri_glass_surface.dart';
|
||||
import 'pluri_icon.dart';
|
||||
|
||||
/// Tarjeta compacta para mostrar una emisora en listas y grids.
|
||||
/// Incluye botón de favorito visible en ambos modos.
|
||||
/// Incluye botón de favorito visible en ambos modos.
|
||||
class TarjetaEmisora extends StatefulWidget {
|
||||
final Emisora emisora;
|
||||
final VoidCallback? onTap;
|
||||
@@ -37,12 +37,16 @@ class _TarjetaEmisoraState extends State<TarjetaEmisora> {
|
||||
final esFav = await estado.toggleFavorito(widget.emisora);
|
||||
if (mounted) setState(() => _toggling = false);
|
||||
if (mounted) {
|
||||
ScaffoldMessenger.of(context).showSnackBar(SnackBar(
|
||||
content: Text(esFav
|
||||
? '${widget.emisora.nombre} añadida a favoritos'
|
||||
: '${widget.emisora.nombre} eliminada de favoritos'),
|
||||
duration: const Duration(seconds: 2),
|
||||
));
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
SnackBar(
|
||||
content: Text(
|
||||
esFav
|
||||
? '${widget.emisora.nombre} añadida a favoritos'
|
||||
: '${widget.emisora.nombre} eliminada de favoritos',
|
||||
),
|
||||
duration: const Duration(seconds: 2),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -54,7 +58,9 @@ class _TarjetaEmisoraState extends State<TarjetaEmisora> {
|
||||
label: 'Emisora ${widget.emisora.nombre}',
|
||||
child: PluriGlassSurface(
|
||||
padding: EdgeInsets.zero,
|
||||
borderRadius: BorderRadius.circular(widget.esCompacta ? t.radiusMd : t.radiusLg),
|
||||
borderRadius: BorderRadius.circular(
|
||||
widget.esCompacta ? t.radiusMd : t.radiusLg,
|
||||
),
|
||||
child: Material(
|
||||
color: Colors.transparent,
|
||||
child: InkWell(
|
||||
@@ -73,12 +79,14 @@ class _TarjetaEmisoraState extends State<TarjetaEmisora> {
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
AspectRatio(
|
||||
aspectRatio: 1,
|
||||
child: _logo(60),
|
||||
),
|
||||
AspectRatio(aspectRatio: 1, child: _logo(60)),
|
||||
Padding(
|
||||
padding: EdgeInsets.fromLTRB(t.spacingMd, t.spacingSm, t.spacingMd, t.spacingMd),
|
||||
padding: EdgeInsets.fromLTRB(
|
||||
t.spacingMd,
|
||||
t.spacingSm,
|
||||
t.spacingMd,
|
||||
t.spacingMd,
|
||||
),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
@@ -96,10 +104,9 @@ class _TarjetaEmisoraState extends State<TarjetaEmisora> {
|
||||
child: Text(
|
||||
widget.emisora.pais!,
|
||||
style: Theme.of(context).textTheme.bodySmall?.copyWith(
|
||||
color: Theme.of(context)
|
||||
.colorScheme
|
||||
.onSurface
|
||||
.withValues(alpha: 0.72),
|
||||
color: Theme.of(
|
||||
context,
|
||||
).colorScheme.onSurface.withValues(alpha: 0.72),
|
||||
),
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
@@ -121,12 +128,16 @@ class _TarjetaEmisoraState extends State<TarjetaEmisora> {
|
||||
|
||||
Widget _buildCompacta() {
|
||||
final t = context.pluriTokens;
|
||||
final subtitulo = [widget.emisora.pais, widget.emisora.idioma]
|
||||
.where((s) => s != null && s.isNotEmpty)
|
||||
.join(' · ');
|
||||
final subtitulo = [
|
||||
widget.emisora.pais,
|
||||
widget.emisora.idioma,
|
||||
].where((s) => s != null && s.isNotEmpty).join(' · ');
|
||||
|
||||
return Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: t.spacingSm, vertical: t.spacingXs),
|
||||
padding: EdgeInsets.symmetric(
|
||||
horizontal: t.spacingSm,
|
||||
vertical: t.spacingXs,
|
||||
),
|
||||
child: Row(
|
||||
children: [
|
||||
ClipRRect(
|
||||
@@ -141,7 +152,9 @@ class _TarjetaEmisoraState extends State<TarjetaEmisora> {
|
||||
children: [
|
||||
Text(
|
||||
widget.emisora.nombre,
|
||||
style: Theme.of(context).textTheme.titleSmall?.copyWith(fontWeight: FontWeight.w700),
|
||||
style: Theme.of(
|
||||
context,
|
||||
).textTheme.titleSmall?.copyWith(fontWeight: FontWeight.w700),
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
@@ -150,10 +163,11 @@ class _TarjetaEmisoraState extends State<TarjetaEmisora> {
|
||||
subtitulo,
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: Theme.of(context)
|
||||
.textTheme
|
||||
.bodySmall
|
||||
?.copyWith(color: Theme.of(context).colorScheme.onSurface.withValues(alpha: 0.72)),
|
||||
style: Theme.of(context).textTheme.bodySmall?.copyWith(
|
||||
color: Theme.of(
|
||||
context,
|
||||
).colorScheme.onSurface.withValues(alpha: 0.72),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -167,26 +181,37 @@ class _TarjetaEmisoraState extends State<TarjetaEmisora> {
|
||||
Widget _botonFavorito({required bool mini}) {
|
||||
final t = context.pluriTokens;
|
||||
final esFavorito = context.select<EstadoRadio, bool>(
|
||||
(estado) => estado.listaFavoritos.any((e) => e.uuid == widget.emisora.uuid),
|
||||
(estado) =>
|
||||
estado.listaFavoritos.any((e) => e.uuid == widget.emisora.uuid),
|
||||
);
|
||||
|
||||
final icono = mini
|
||||
? Icon(
|
||||
esFavorito ? Icons.favorite_rounded : Icons.favorite_outline_rounded,
|
||||
color: esFavorito ? t.warmCoral : Colors.white.withValues(alpha: 0.82),
|
||||
size: 18,
|
||||
)
|
||||
: PluriIcon(
|
||||
glyph: PluriIconGlyph.favorites,
|
||||
variant: esFavorito ? PluriIconVariant.activeGlow : PluriIconVariant.outline,
|
||||
size: 20,
|
||||
semanticLabel: esFavorito ? 'Quitar de favoritos' : 'Añadir a favoritos',
|
||||
);
|
||||
final icono =
|
||||
mini
|
||||
? Icon(
|
||||
esFavorito
|
||||
? Icons.favorite_rounded
|
||||
: Icons.favorite_outline_rounded,
|
||||
color:
|
||||
esFavorito
|
||||
? t.warmCoral
|
||||
: Colors.white.withValues(alpha: 0.82),
|
||||
size: 18,
|
||||
)
|
||||
: PluriIcon(
|
||||
glyph: PluriIconGlyph.favorites,
|
||||
variant:
|
||||
esFavorito
|
||||
? PluriIconVariant.activeGlow
|
||||
: PluriIconVariant.outline,
|
||||
size: 20,
|
||||
semanticLabel:
|
||||
esFavorito ? 'Quitar de favoritos' : 'Añadir a favoritos',
|
||||
);
|
||||
|
||||
return Semantics(
|
||||
button: true,
|
||||
toggled: esFavorito,
|
||||
label: esFavorito ? 'Quitar de favoritos' : 'Añadir a favoritos',
|
||||
label: esFavorito ? 'Quitar de favoritos' : 'Añadir a favoritos',
|
||||
child: Material(
|
||||
color: mini ? t.glassSurface : Colors.transparent,
|
||||
shape: const CircleBorder(),
|
||||
@@ -264,9 +289,16 @@ class TarjetaEmisoraShimmer extends StatelessWidget {
|
||||
child: Container(color: theme.colorScheme.surfaceContainerHighest),
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
Container(height: 14, color: theme.colorScheme.surfaceContainerHighest),
|
||||
Container(
|
||||
height: 14,
|
||||
color: theme.colorScheme.surfaceContainerHighest,
|
||||
),
|
||||
const SizedBox(height: 4),
|
||||
Container(height: 12, width: 60, color: theme.colorScheme.surfaceContainerHighest),
|
||||
Container(
|
||||
height: 12,
|
||||
width: 60,
|
||||
color: theme.colorScheme.surfaceContainerHighest,
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user