fix(widgets): share station-art fallback across every surface
TarjetaEmisora had the only good fallback for a station with no artwork -- a deterministic pick from 4 bundled illustrations with a gradient/glyph last resort. FilaEmisoraPlana's flat rows, the Escuchar hero, the "Tus emisoras" grid cell, the mini player and the full player each had their own, separate, flat primaryContainer square instead. Extract the good fallback into PluriStationArtFallback and use it from every one of those call sites. The selection formula (asset order, codeUnits-sum modulo) is preserved exactly, since navegacion_auto.dart mirrors the same formula independently for Android Auto's own drawable rotation.
This commit is contained in:
@@ -15,6 +15,7 @@ import '../widgets/pluri_glass_surface.dart';
|
||||
import '../widgets/pluri_layout.dart';
|
||||
import '../widgets/pluri_premium_widgets.dart';
|
||||
import '../widgets/pluri_sleep_timer_sheet.dart';
|
||||
import '../widgets/pluri_station_art_fallback.dart';
|
||||
import '../widgets/visualizador_audio.dart';
|
||||
|
||||
import 'pantalla_reproductor.dart';
|
||||
@@ -568,9 +569,9 @@ class _ArteEscuchar extends StatelessWidget {
|
||||
imageUrl: emisora.favicon!,
|
||||
fit: BoxFit.cover,
|
||||
placeholder: (_, __) => _shimmerCuadrado(theme),
|
||||
errorWidget: (_, __, ___) => _iconoFallback(theme),
|
||||
errorWidget: (_, __, ___) => _iconoFallback(),
|
||||
)
|
||||
: _iconoFallback(theme),
|
||||
: _iconoFallback(),
|
||||
),
|
||||
),
|
||||
);
|
||||
@@ -582,14 +583,11 @@ class _ArteEscuchar extends StatelessWidget {
|
||||
child: Container(color: theme.colorScheme.surfaceContainerHighest),
|
||||
);
|
||||
|
||||
Widget _iconoFallback(ThemeData theme) => Container(
|
||||
color: theme.colorScheme.primaryContainer,
|
||||
child: Icon(
|
||||
Icons.radio_rounded,
|
||||
size: 36,
|
||||
color: theme.colorScheme.onPrimaryContainer,
|
||||
),
|
||||
);
|
||||
// Issue 6 (feedback-pruebas): was a flat `primaryContainer` square with a
|
||||
// bare `radio_rounded` icon — now the same shared fallback every other
|
||||
// surface uses.
|
||||
Widget _iconoFallback() =>
|
||||
PluriStationArtFallback(seed: emisora.uuid, iconSize: 36);
|
||||
}
|
||||
|
||||
/// The hero's transport row — favorite / EQ toggle / stop / play-pause
|
||||
@@ -909,10 +907,10 @@ class _CeldaTusEmisoras extends StatelessWidget {
|
||||
imageUrl: emisora.favicon!,
|
||||
fit: BoxFit.cover,
|
||||
placeholder: (_, __) => _shimmer(theme),
|
||||
errorWidget: (_, __, ___) => _iconoFallback(theme),
|
||||
errorWidget: (_, __, ___) => _iconoFallback(),
|
||||
);
|
||||
}
|
||||
return _iconoFallback(theme);
|
||||
return _iconoFallback();
|
||||
}
|
||||
|
||||
Widget _shimmer(ThemeData theme) => shimmer.Shimmer.fromColors(
|
||||
@@ -921,12 +919,9 @@ class _CeldaTusEmisoras extends StatelessWidget {
|
||||
child: Container(color: theme.colorScheme.surfaceContainerHighest),
|
||||
);
|
||||
|
||||
Widget _iconoFallback(ThemeData theme) => Container(
|
||||
color: theme.colorScheme.primaryContainer,
|
||||
child: Icon(
|
||||
Icons.radio_rounded,
|
||||
size: 20,
|
||||
color: theme.colorScheme.onPrimaryContainer,
|
||||
),
|
||||
);
|
||||
// Issue 6 (feedback-pruebas): was a flat `primaryContainer` square with a
|
||||
// bare `radio_rounded` icon — now the same shared fallback every other
|
||||
// surface uses.
|
||||
Widget _iconoFallback() =>
|
||||
PluriStationArtFallback(seed: emisora.uuid, iconSize: 20);
|
||||
}
|
||||
|
||||
@@ -20,6 +20,7 @@ import '../widgets/ecualizador_widget.dart';
|
||||
import '../widgets/pluri_glass_surface.dart';
|
||||
import '../widgets/pluri_premium_widgets.dart';
|
||||
import '../widgets/pluri_push_scaffold.dart';
|
||||
import '../widgets/pluri_station_art_fallback.dart';
|
||||
import '../widgets/visualizador_audio.dart';
|
||||
|
||||
/// WU14: restructured onto [PluriPushScaffold] (design ADR-2) — this screen
|
||||
@@ -291,10 +292,10 @@ class _ArteReproductor extends StatelessWidget {
|
||||
imageUrl: emisora.favicon!,
|
||||
fit: BoxFit.cover,
|
||||
placeholder: (_, __) => _shimmer(theme),
|
||||
errorWidget: (_, __, ___) => _iconoFallback(theme),
|
||||
errorWidget: (_, __, ___) => _iconoFallback(),
|
||||
)
|
||||
else
|
||||
_iconoFallback(theme),
|
||||
_iconoFallback(),
|
||||
if (cargando)
|
||||
Container(
|
||||
color: Colors.black45,
|
||||
@@ -333,14 +334,11 @@ class _ArteReproductor extends StatelessWidget {
|
||||
child: Container(color: theme.colorScheme.surfaceContainerHighest),
|
||||
);
|
||||
|
||||
Widget _iconoFallback(ThemeData theme) => Container(
|
||||
color: theme.colorScheme.primaryContainer,
|
||||
child: Icon(
|
||||
Icons.radio_rounded,
|
||||
size: 80,
|
||||
color: theme.colorScheme.onPrimaryContainer,
|
||||
),
|
||||
);
|
||||
// Issue 6 (feedback-pruebas): was a flat `primaryContainer` square with a
|
||||
// bare `radio_rounded` icon — now the same shared fallback every other
|
||||
// surface uses.
|
||||
Widget _iconoFallback() =>
|
||||
PluriStationArtFallback(seed: emisora.uuid, iconSize: 80);
|
||||
}
|
||||
|
||||
/// Audit 2.2 (t4 lines 108-109): a full-bleed blurred backdrop of the
|
||||
|
||||
Reference in New Issue
Block a user