fix(buscar): rebuild the offline banner with offlineAccent

Audit 13.1 (t4 line 641): the banner rendered wifi_off in
colorScheme.error (red) inside a generic glass card. Rebuilt using
offlineAccent (#E8879A) — a token that existed since Tier 1 with no
consumer — for the tint, border and icon, plus the prototype's title/
detail layout and a restyled Retry chip. New offlineBannerTitle key
translated to all 13 locales.
This commit is contained in:
2026-07-29 23:40:38 +02:00
parent e1505d7aaa
commit 684e8e8ff9
29 changed files with 329 additions and 175 deletions
+69 -13
View File
@@ -7,6 +7,7 @@ import '../estado/estado_radio.dart';
import '../l10n/gen/app_localizations.dart';
import '../modelos/emisora.dart';
import '../tema/pluri_animate.dart';
import '../tema/pluriwave_theme.dart';
import '../widgets/pluri_glass_surface.dart';
import '../widgets/pluri_icon.dart';
import '../widgets/pluri_layout.dart';
@@ -847,26 +848,81 @@ class _PantallaBuscarState extends State<PantallaBuscar> {
);
}
// Audit 13.1 (t4 line 641): the prototype's offline banner is a
// rgba(207,102,121,X) tinted card — this consolidates on the ONE
// `offlineAccent` token (`#E8879A`) the proposal named for this exact
// banner (`pluriwave_tokens.dart:77`), which existed unused until now,
// rather than introducing a second near-identical raw hex for the tint.
Widget _errorBanner(
BuildContext context,
String error,
ThemeData theme,
AppLocalizations l10n,
) {
final tokens = context.pluriTokens;
return Padding(
padding: const EdgeInsets.all(16),
child: PluriGlassSurface(
padding: const EdgeInsets.all(12),
child: Row(
children: [
Icon(Icons.wifi_off, color: theme.colorScheme.error),
const SizedBox(width: 8),
Expanded(child: Text(error)),
TextButton(
onPressed: () => context.read<EstadoRadio>().cargarPopulares(),
child: Text(l10n.retryAction),
),
],
padding: const EdgeInsets.symmetric(horizontal: 16),
child: DecoratedBox(
key: const ValueKey('offline-banner'),
decoration: BoxDecoration(
color: tokens.offlineAccent.withValues(alpha: 0.14),
borderRadius: BorderRadius.circular(16),
border: Border.all(
color: tokens.offlineAccent.withValues(alpha: 0.4),
),
),
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 15, vertical: 13),
child: Row(
children: [
Icon(Icons.wifi_off, size: 22, color: tokens.offlineAccent),
const SizedBox(width: 11),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
Text(
l10n.offlineBannerTitle,
style: const TextStyle(
fontSize: 13.5,
fontWeight: FontWeight.w800,
),
),
Text(
error,
style: TextStyle(
fontSize: 11.5,
color: theme.colorScheme.onSurface.withValues(
alpha: 0.65,
),
),
),
],
),
),
const SizedBox(width: 8),
TextButton(
style: TextButton.styleFrom(
backgroundColor: Colors.white.withValues(alpha: 0.1),
foregroundColor: theme.colorScheme.onSurface,
padding: const EdgeInsets.symmetric(
horizontal: 12,
vertical: 7,
),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10),
),
textStyle: const TextStyle(
fontSize: 12,
fontWeight: FontWeight.w800,
),
),
onPressed: () => context.read<EstadoRadio>().cargarPopulares(),
child: Text(l10n.retryAction),
),
],
),
),
),
);