Limpieza de peso de imágenes

This commit is contained in:
2026-05-11 20:30:59 +02:00
parent 928cbd8a1d
commit e7c5b08ec0
94 changed files with 181 additions and 246 deletions
+1 -1
View File
@@ -58,7 +58,7 @@ class _PantallaAdivinanzaState extends State<PantallaAdivinanza> {
subtitulo: l10n.ifCorrectImpostorsWin,
color: TemaApp.colorAcento,
trailing: Image.asset(
'assets/ui/premium/vote_danger_glow.png',
'assets/ui/generated/meta/result_verdict_art.webp',
width: 42,
height: 42,
opacity: const AlwaysStoppedAnimation(0.64),
+1 -1
View File
@@ -644,7 +644,7 @@ class _CrearPartidaHeader extends StatelessWidget {
AspectRatio(
aspectRatio: 2,
child: Image.asset(
'assets/ui/generated/create_game/create_game_header_art.png',
'assets/ui/generated/create_game/create_game_header_art.webp',
fit: BoxFit.contain,
opacity: const AlwaysStoppedAnimation(0.96),
),
+1 -1
View File
@@ -103,7 +103,7 @@ class _PantallaDebateState extends State<PantallaDebate> {
children: [
Positioned.fill(
child: Image.asset(
'assets/ui/premium/timer_ring_glow.png',
'assets/ui/generated/gameplay/gameplay_phase_emblem.webp',
fit: BoxFit.contain,
opacity: const AlwaysStoppedAnimation(0.36),
),
+1 -1
View File
@@ -183,7 +183,7 @@ class _PantallaDebateClienteState extends State<PantallaDebateCliente> {
children: [
Positioned.fill(
child: Image.asset(
'assets/ui/premium/timer_ring_glow.png',
'assets/ui/generated/gameplay/gameplay_phase_emblem.webp',
fit: BoxFit.contain,
opacity: const AlwaysStoppedAnimation(0.42),
),
+75 -80
View File
@@ -125,51 +125,49 @@ class _PantallaFinPartidaState extends State<PantallaFinPartida> {
? TemaApp.colorVerde
: TemaApp.colorAcento,
),
Transform.translate(
offset: const Offset(0, -18),
child: Column(
children: [
if (_progreso == null)
const _TarjetaRecompensaCargando()
else
_TarjetaProgresoGamificacion(progreso: _progreso!),
const SizedBox(height: 18),
_TarjetaSecreto(
palabra: partida.palabraSecreta,
categoria: BancoPalabras.nombreBonitoCategoria(
partida.categoriaReal,
l10n,
),
const SizedBox(height: 12),
Column(
children: [
if (_progreso == null)
const _TarjetaRecompensaCargando()
else
_TarjetaProgresoGamificacion(progreso: _progreso!),
const SizedBox(height: 18),
_TarjetaSecreto(
palabra: partida.palabraSecreta,
categoria: BancoPalabras.nombreBonitoCategoria(
partida.categoriaReal,
l10n,
),
const SizedBox(height: 18),
_TarjetaImpostores(
titulo: impostores.length == 1
? l10n.theImpostorWas
: l10n.theImpostorsWere,
impostores: impostores,
),
const SizedBox(height: 18),
if (partida.historialVotaciones.isNotEmpty)
_TarjetaHistorialVotos(partida: partida, l10n: l10n),
const SizedBox(height: 24),
_BotonesFinPartida(
estado: estado,
onPrincipal: () async {
await context.read<ServicioNearby>().desconectar();
estado.limpiar();
if (!context.mounted) return;
Navigator.pushAndRemoveUntil(
context,
MaterialPageRoute(
builder: (_) => const PantallaPrincipal(),
),
(route) => false,
);
},
),
const SizedBox(height: 16),
],
),
),
const SizedBox(height: 18),
_TarjetaImpostores(
titulo: impostores.length == 1
? l10n.theImpostorWas
: l10n.theImpostorsWere,
impostores: impostores,
),
const SizedBox(height: 18),
if (partida.historialVotaciones.isNotEmpty)
_TarjetaHistorialVotos(partida: partida, l10n: l10n),
const SizedBox(height: 24),
_BotonesFinPartida(
estado: estado,
onPrincipal: () async {
await context.read<ServicioNearby>().desconectar();
estado.limpiar();
if (!context.mounted) return;
Navigator.pushAndRemoveUntil(
context,
MaterialPageRoute(
builder: (_) => const PantallaPrincipal(),
),
(route) => false,
);
},
),
const SizedBox(height: 16),
],
),
],
),
@@ -231,7 +229,7 @@ class _HeroResultado extends StatelessWidget {
alignment: Alignment.center,
children: [
SizedBox(
height: 420,
height: 548,
width: double.infinity,
child: CustomPaint(painter: _HeroCinematicoPainter(color: color)),
),
@@ -267,7 +265,7 @@ class _HeroResultado extends StatelessWidget {
alignment: Alignment.center,
children: [
Image.asset(
'assets/ui/generated/final_rewards/cinematic_burst.png',
'assets/ui/generated/final_rewards/cinematic_burst.webp',
width: 260,
height: 260,
fit: BoxFit.contain,
@@ -310,17 +308,22 @@ class _HeroResultado extends StatelessWidget {
)
.shimmer(delay: 700.ms, duration: 1500.ms),
const SizedBox(height: 12),
Text(
'$apertura$tituloLimpio!',
textAlign: TextAlign.center,
style: Theme.of(context).textTheme.headlineMedium?.copyWith(
color: color,
fontSize: 34,
fontWeight: FontWeight.w900,
letterSpacing: 1.2,
shadows: [
Shadow(color: color.withValues(alpha: 0.90), blurRadius: 24),
],
Padding(
padding: const EdgeInsets.symmetric(horizontal: 16),
child: Text(
'$apertura$tituloLimpio!',
maxLines: 2,
overflow: TextOverflow.ellipsis,
textAlign: TextAlign.center,
style: Theme.of(context).textTheme.headlineMedium?.copyWith(
color: color,
fontSize: 32,
fontWeight: FontWeight.w900,
letterSpacing: 1.0,
shadows: [
Shadow(color: color.withValues(alpha: 0.90), blurRadius: 24),
],
),
),
).animate().fadeIn(delay: 180.ms).slideY(begin: 0.25),
],
@@ -730,7 +733,7 @@ class _MedallaDesbloqueada extends StatelessWidget {
alignment: Alignment.center,
children: [
Image.asset(
'assets/rewards/medal_unlock_burst.png',
'assets/rewards/medal_unlock_burst.webp',
width: 82,
height: 82,
fit: BoxFit.cover,
@@ -943,30 +946,22 @@ class _BotonesFinPartida extends StatelessWidget {
final l10n = AppLocalizations.of(context)!;
return Column(
children: [
SizedBox(
width: double.infinity,
height: 56,
child: ElevatedButton.icon(
onPressed: () {
estado.revancha();
Navigator.pushReplacement(
context,
MaterialPageRoute(builder: (_) => const PantallaVerPalabra()),
);
},
icon: const Icon(Icons.replay),
label: Text(l10n.rematch),
),
BotonFarolero(
texto: l10n.rematch,
icono: Icons.replay,
onPressed: () {
estado.revancha();
Navigator.pushReplacement(
context,
MaterialPageRoute(builder: (_) => const PantallaVerPalabra()),
);
},
),
const SizedBox(height: 12),
SizedBox(
width: double.infinity,
height: 56,
child: OutlinedButton.icon(
onPressed: onPrincipal,
icon: const Icon(Icons.home),
label: Text(l10n.mainMenu),
),
BotonFarolero.oscuro(
texto: l10n.mainMenu,
icono: Icons.home,
onPressed: onPrincipal,
),
],
);
+15 -19
View File
@@ -209,24 +209,20 @@ class _PantallaFinPartidaOnlineState extends State<PantallaFinPartidaOnline> {
),
),
const SizedBox(height: 24),
SizedBox(
width: double.infinity,
height: 56,
child: OutlinedButton.icon(
onPressed: () async {
await context.read<ServicioNearby>().desconectar();
if (!context.mounted) return;
Navigator.pushAndRemoveUntil(
context,
MaterialPageRoute(
builder: (_) => const PantallaPrincipal(),
),
(route) => false,
);
},
icon: const Icon(Icons.home),
label: Text(l10n.mainMenu),
),
BotonFarolero.oscuro(
texto: l10n.mainMenu,
icono: Icons.home,
onPressed: () async {
await context.read<ServicioNearby>().desconectar();
if (!context.mounted) return;
Navigator.pushAndRemoveUntil(
context,
MaterialPageRoute(
builder: (_) => const PantallaPrincipal(),
),
(route) => false,
);
},
),
],
),
@@ -277,7 +273,7 @@ class _ResultadoOnlineHero extends StatelessWidget {
child: Column(
children: [
Image.asset(
'assets/ui/generated/final_rewards/cinematic_burst.png',
'assets/ui/generated/final_rewards/cinematic_burst.webp',
height: 250,
fit: BoxFit.contain,
opacity: const AlwaysStoppedAnimation(0.95),
+2 -2
View File
@@ -80,7 +80,7 @@ class _PantallaLobbyHostState extends State<PantallaLobbyHost> {
Positioned.fill(
child: IgnorePointer(
child: Image.asset(
'assets/ui/generated/join_lobby/qr_frame.png',
'assets/ui/generated/join_lobby/qr_frame.webp',
fit: BoxFit.contain,
),
),
@@ -418,7 +418,7 @@ class _LobbySignalArt extends StatelessWidget {
height: 104,
width: double.infinity,
child: Image.asset(
'assets/ui/generated/join_lobby/signal_art.png',
'assets/ui/generated/join_lobby/signal_art.webp',
fit: BoxFit.contain,
opacity: const AlwaysStoppedAnimation(0.90),
),
+5 -5
View File
@@ -31,7 +31,7 @@ class PantallaPrincipal extends StatelessWidget {
children: [
Positioned.fill(
child: Image.asset(
'assets/ui/generated/main/main_atmosphere_bg.png',
'assets/ui/generated/main/main_atmosphere_bg.webp',
fit: BoxFit.cover,
alignment: Alignment.center,
),
@@ -291,16 +291,16 @@ class _HeroInicioPremium extends StatelessWidget {
children: [
Positioned.fill(
child: Image.asset(
'assets/ui/premium/lantern_radial_glow.png',
'assets/ui/generated/main/main_lantern_hero.webp',
fit: BoxFit.contain,
opacity: const AlwaysStoppedAnimation(0.48),
opacity: const AlwaysStoppedAnimation(0.18),
),
),
Column(
mainAxisSize: MainAxisSize.min,
children: [
Image.asset(
'assets/ui/generated/main/main_lantern_hero.png',
'assets/ui/generated/main/main_lantern_hero.webp',
width: heroSize,
height: heroSize,
fit: BoxFit.contain,
@@ -455,7 +455,7 @@ class _BotonInicioPremium extends StatelessWidget {
children: [
Positioned.fill(
child: Image.asset(
'assets/ui/premium/card_sheen_overlay.png',
'assets/ui/generated/main/main_cta_frame.webp',
fit: BoxFit.cover,
opacity: AlwaysStoppedAnimation(hero ? 0.20 : 0.14),
),
+28 -46
View File
@@ -283,68 +283,50 @@ class _PantallaResultadoState extends State<PantallaResultado>
final partida = estado.partida;
if (partida == null) return const SizedBox.shrink();
// Comprobar si la partida terminó
final finPartida = estado.comprobarFinPartida();
if (finPartida) {
return SizedBox(
width: double.infinity,
height: 56,
child: ElevatedButton.icon(
onPressed: () {
Navigator.pushReplacement(
context,
MaterialPageRoute(builder: (_) => const PantallaFinPartida()),
);
},
icon: const Icon(Icons.emoji_events),
label: Text(l10n.seeEndResult),
),
return BotonFarolero(
texto: l10n.seeEndResult,
icono: Icons.emoji_events,
onPressed: () {
Navigator.pushReplacement(
context,
MaterialPageRoute(builder: (_) => const PantallaFinPartida()),
);
},
);
}
// Si era impostor, puede intentar adivinar
if (widget.resultado.eraImpostor) {
return Column(
children: [
SizedBox(
width: double.infinity,
height: 56,
child: OutlinedButton.icon(
onPressed: () {
Navigator.pushReplacement(
context,
MaterialPageRoute(
builder: (_) => const PantallaAdivinanza(),
),
);
},
icon: const Text('🎯', style: TextStyle(fontSize: 18)),
label: Text(l10n.impostorGuessWord),
),
BotonFarolero.oscuro(
texto: l10n.impostorGuessWord,
icono: Icons.gps_fixed,
onPressed: () {
Navigator.pushReplacement(
context,
MaterialPageRoute(
builder: (_) => const PantallaAdivinanza(),
),
);
},
),
const SizedBox(height: 12),
SizedBox(
width: double.infinity,
height: 56,
child: ElevatedButton.icon(
onPressed: () => _siguienteRonda(context, estado),
icon: const Icon(Icons.skip_next),
label: Text(l10n.nextRound),
),
BotonFarolero(
texto: l10n.nextRound,
icono: Icons.skip_next,
onPressed: () => _siguienteRonda(context, estado),
),
],
);
}
return SizedBox(
width: double.infinity,
height: 56,
child: ElevatedButton.icon(
onPressed: () => _siguienteRonda(context, estado),
icon: const Icon(Icons.skip_next),
label: Text(l10n.nextRound),
),
return BotonFarolero(
texto: l10n.nextRound,
icono: Icons.skip_next,
onPressed: () => _siguienteRonda(context, estado),
);
}
@@ -33,7 +33,7 @@ class PantallaSeleccionModoJuego extends StatelessWidget {
).animate().fadeIn(duration: 320.ms).slideY(begin: -0.12),
const SizedBox(height: 34),
_ModoCard(
marcoAsset: 'assets/ui/generated/mode/mode_single_card_frame.png',
marcoAsset: 'assets/ui/generated/mode/mode_single_card_frame.webp',
icono: Icons.phone_android_rounded,
titulo: l10n.singleDevice,
subtitulo: l10n.singleDeviceSubtitle,
@@ -50,7 +50,7 @@ class PantallaSeleccionModoJuego extends StatelessWidget {
).animate().fadeIn(delay: 120.ms).slideX(begin: -0.08),
const SizedBox(height: 16),
_ModoCard(
marcoAsset: 'assets/ui/generated/mode/mode_multi_card_frame.png',
marcoAsset: 'assets/ui/generated/mode/mode_multi_card_frame.webp',
icono: Icons.devices_rounded,
titulo: l10n.multiDevice,
subtitulo: l10n.multiDeviceSubtitle,
@@ -93,7 +93,7 @@ class _ModoHero extends StatelessWidget {
SizedBox(
height: 230,
child: Image.asset(
'assets/ui/generated/mode/mode_duel_hero.png',
'assets/ui/generated/mode/mode_duel_hero.webp',
fit: BoxFit.contain,
opacity: const AlwaysStoppedAnimation(0.95),
),
@@ -186,13 +186,6 @@ class _ModoCard extends StatelessWidget {
opacity: AlwaysStoppedAnimation(destacado ? 0.22 : 0.18),
),
),
Positioned.fill(
child: Image.asset(
'assets/ui/premium/card_sheen_overlay.png',
fit: BoxFit.cover,
opacity: AlwaysStoppedAnimation(destacado ? 0.28 : 0.18),
),
),
Padding(
padding: const EdgeInsets.fromLTRB(18, 18, 14, 18),
child: Row(
+1 -1
View File
@@ -942,7 +942,7 @@ class _JoinLobbySignalArt extends StatelessWidget {
height: height,
width: double.infinity,
child: Image.asset(
'assets/ui/generated/join_lobby/signal_art.png',
'assets/ui/generated/join_lobby/signal_art.webp',
fit: BoxFit.contain,
opacity: const AlwaysStoppedAnimation(0.94),
),
+1 -1
View File
@@ -114,7 +114,7 @@ class _PantallaVotacionState extends State<PantallaVotacion> {
subtitulo: l10n.selectOnePlayer,
color: TemaApp.colorAcento,
trailing: Image.asset(
'assets/ui/premium/vote_danger_glow.png',
'assets/ui/generated/meta/result_verdict_art.webp',
width: 42,
height: 42,
opacity: const AlwaysStoppedAnimation(0.64),
+1 -1
View File
@@ -141,7 +141,7 @@ class _PantallaVotacionClienteState extends State<PantallaVotacionCliente> {
subtitulo: l10n.selectOnePlayer,
color: TemaApp.colorAcento,
trailing: Image.asset(
'assets/ui/premium/vote_danger_glow.png',
'assets/ui/generated/meta/result_verdict_art.webp',
width: 42,
height: 42,
opacity: const AlwaysStoppedAnimation(0.64),