From ca2400f0d49be3084a3d04a0707fc781487d39ec Mon Sep 17 00:00:00 2001 From: freetlab Date: Thu, 30 Jul 2026 12:40:59 +0200 Subject: [PATCH] fix(favoritos): restyle the dashed custom-station CTA to spec Tier 4 visual fidelity, audit 4.5 (t4 line 235): the border and the label/icon now use the prototype's two DIFFERENT opacities (rgba(255,255,255,.16) stroke vs rgba(242,247,250,.6) text/icon, previously one shared 50% colour for both), padding is a uniform 14 instead of symmetric(18,16), and the icon is a plain add glyph at 20px instead of add_circle_outline_rounded. --- lib/pantallas/pantalla_favoritos.dart | 25 ++++++++++++++----- test/pantallas/pantalla_favoritos_test.dart | 27 +++++++++++++++++++++ 2 files changed, 46 insertions(+), 6 deletions(-) diff --git a/lib/pantallas/pantalla_favoritos.dart b/lib/pantallas/pantalla_favoritos.dart index 854073c..35b8306 100644 --- a/lib/pantallas/pantalla_favoritos.dart +++ b/lib/pantallas/pantalla_favoritos.dart @@ -474,24 +474,37 @@ class _CtaEmisoraPersonalizada extends StatelessWidget { @override Widget build(BuildContext context) { final l10n = AppLocalizations.of(context); - final color = Theme.of( + // Audit 4.5 (t4 line 235): the border and the label/icon are TWO + // different opacities in the prototype — `rgba(255,255,255,.16)` for + // the dashed stroke, `rgba(242,247,250,.6)` for the text/icon — not one + // shared 50% colour for both. + final colorBorde = Colors.white.withValues(alpha: 0.16); + final colorTexto = Theme.of( context, - ).colorScheme.onSurface.withValues(alpha: 0.5); + ).colorScheme.onSurface.withValues(alpha: 0.6); return CustomPaint( - painter: _DashedBorderPainter(color: color), + painter: _DashedBorderPainter(color: colorBorde), child: Material( color: Colors.transparent, child: InkWell( borderRadius: BorderRadius.circular(16), onTap: onTap, child: Padding( - padding: const EdgeInsets.symmetric(vertical: 18, horizontal: 16), + key: const Key('custom-station-cta-padding'), + padding: const EdgeInsets.all(14), child: Row( mainAxisAlignment: MainAxisAlignment.center, children: [ - Icon(Icons.add_circle_outline_rounded, color: color), + Icon(Icons.add_rounded, size: 20, color: colorTexto), const SizedBox(width: 8), - Text(l10n.customStationsAddCta, style: TextStyle(color: color)), + Text( + l10n.customStationsAddCta, + style: TextStyle( + fontSize: 13.5, + fontWeight: FontWeight.w800, + color: colorTexto, + ), + ), ], ), ), diff --git a/test/pantallas/pantalla_favoritos_test.dart b/test/pantallas/pantalla_favoritos_test.dart index 2729f89..a061589 100644 --- a/test/pantallas/pantalla_favoritos_test.dart +++ b/test/pantallas/pantalla_favoritos_test.dart @@ -102,6 +102,33 @@ void main() { await tester.pump(const Duration(milliseconds: 100)); } + group('visual fidelity (audit 4.5): dashed custom-station CTA', () { + testWidgets( + 'padding is 14 all around, the icon is a plain add glyph at 20px, ' + 'and the label is 13.5px/w800 (t4 line 235)', + (tester) async { + final estado = await crearEstadoVacio(); + addTearDown(estado.dispose); + await tester.pumpWidget(buildScreen(estado)); + await pumpStable(tester); + + final padding = tester.widget( + find.byKey(const Key('custom-station-cta-padding')), + ); + expect(padding.padding, const EdgeInsets.all(14)); + + expect(find.byIcon(Icons.add_circle_outline_rounded), findsNothing); + final icon = tester.widget(find.byIcon(Icons.add_rounded)); + expect(icon.size, 20); + + final l10n = lookupAppLocalizations(const Locale('en')); + final texto = tester.widget(find.text(l10n.customStationsAddCta)); + expect(texto.style?.fontSize, 13.5); + expect(texto.style?.fontWeight, FontWeight.w800); + }, + ); + }); + // ── EstadoRadio: new state surface (state-layer, not widget-layer) ─────── test('listaFavoritosManual returns favorites in stored order, NOT re-sorted '