Resumen de fin de partida espectacular

This commit is contained in:
2026-05-10 02:07:08 +02:00
parent 20e48239db
commit 28554207ef
3 changed files with 894 additions and 302 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -1,5 +1,6 @@
import 'package:flutter/material.dart';
import 'package:farolero/l10n/generated/app_localizations.dart';
import 'package:flutter/material.dart';
import 'package:flutter_animate/flutter_animate.dart';
import 'package:provider/provider.dart';
import '../modelos/inicio_partida_multijugador.dart';
import '../modelos/gamificacion_usuario.dart';
@@ -290,50 +291,98 @@ class _TarjetaProgresoGamificacion extends StatelessWidget {
@override
Widget build(BuildContext context) {
final nuevas = progreso.nuevasMedallas;
return Card(
child: Padding(
padding: const EdgeInsets.all(20),
return Container(
width: double.infinity,
padding: const EdgeInsets.all(18),
decoration: BoxDecoration(
gradient: LinearGradient(
colors: [
const Color(0xFF111B28).withValues(alpha: 0.96),
const Color(0xFF180D22).withValues(alpha: 0.94),
],
begin: Alignment.topLeft,
end: Alignment.bottomRight,
),
borderRadius: BorderRadius.circular(22),
border: Border.all(color: TemaApp.colorDorado.withValues(alpha: 0.52)),
boxShadow: [
BoxShadow(
color: TemaApp.colorNaranja.withValues(alpha: 0.18),
blurRadius: 32,
offset: const Offset(0, 16),
),
],
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text('Tu progreso', style: Theme.of(context).textTheme.titleMedium),
const SizedBox(height: 12),
Row(
children: [
const Text('🔥', style: TextStyle(fontSize: 24)),
const SizedBox(width: 10),
const Icon(Icons.local_fire_department,
color: TemaApp.colorNaranja),
const SizedBox(width: 8),
Expanded(
child: ClipRRect(
borderRadius: BorderRadius.circular(6),
child: LinearProgressIndicator(
value: progreso.despues.fuego / 100,
minHeight: 8,
color: TemaApp.colorNaranja,
backgroundColor: Colors.black.withValues(alpha: 0.35),
child: Text(
'RECOMPENSAS DE PARTIDA',
style: Theme.of(context).textTheme.titleMedium?.copyWith(
color: TemaApp.colorDorado,
fontWeight: FontWeight.w900,
letterSpacing: 1,
),
),
),
const SizedBox(width: 10),
Text('${progreso.despues.fuego}%'),
Text(
progreso.incrementoFuego >= 0
? '+${progreso.incrementoFuego}'
: '${progreso.incrementoFuego}',
style: Theme.of(context).textTheme.titleMedium?.copyWith(
color: TemaApp.colorDorado,
fontWeight: FontWeight.w900,
),
),
],
),
const SizedBox(height: 12),
TweenAnimationBuilder<double>(
tween: Tween(
begin: progreso.antes.fuego.clamp(0, 100) / 100,
end: progreso.despues.fuego.clamp(0, 100) / 100,
),
duration: const Duration(milliseconds: 1300),
curve: Curves.easeOutCubic,
builder: (context, value, _) => ClipRRect(
borderRadius: BorderRadius.circular(999),
child: LinearProgressIndicator(
value: value.clamp(0.0, 1.0).toDouble(),
minHeight: 18,
backgroundColor: Colors.black.withValues(alpha: 0.35),
valueColor: const AlwaysStoppedAnimation(TemaApp.colorNaranja),
),
),
),
const SizedBox(height: 8),
Text(
progreso.incrementoFuego >= 0
? '+${progreso.incrementoFuego}% de fuego'
: '${progreso.incrementoFuego}% de fuego',
'${progreso.despues.fuego}% de fuego',
style: Theme.of(context).textTheme.bodySmall,
),
if (nuevas.isNotEmpty) ...[
const SizedBox(height: 12),
Text('Nuevas medallas',
style: Theme.of(context).textTheme.bodyMedium),
Text(
'NUEVAS MEDALLAS',
style: Theme.of(context).textTheme.bodyMedium?.copyWith(
color: TemaApp.colorDorado,
fontWeight: FontWeight.w800,
),
),
const SizedBox(height: 6),
MedallasCompactasFarolero(ids: nuevas, max: nuevas.length),
],
],
),
),
);
)
.animate()
.fadeIn(duration: 360.ms)
.slideY(begin: 0.12)
.shimmer(delay: 700.ms, duration: 1200.ms);
}
}

View File

@@ -19,6 +19,8 @@ dependencies:
google_fonts: ^6.2.1
nearby_connections: ^4.0.0
permission_handler: ^12.0.1
flutter_animate: ^4.5.2
confetti: ^0.8.0
dev_dependencies:
flutter_test: