fix(ci): resolve premium UI analyzer errors
This commit is contained in:
@@ -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