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:farolero/l10n/generated/app_localizations.dart';
import 'package:flutter/material.dart';
import 'package:flutter_animate/flutter_animate.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import '../modelos/inicio_partida_multijugador.dart'; import '../modelos/inicio_partida_multijugador.dart';
import '../modelos/gamificacion_usuario.dart'; import '../modelos/gamificacion_usuario.dart';
@@ -290,50 +291,98 @@ class _TarjetaProgresoGamificacion extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final nuevas = progreso.nuevasMedallas; final nuevas = progreso.nuevasMedallas;
return Card( return Container(
child: Padding( width: double.infinity,
padding: const EdgeInsets.all(20), 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( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Text('Tu progreso', style: Theme.of(context).textTheme.titleMedium),
const SizedBox(height: 12),
Row( Row(
children: [ children: [
const Text('🔥', style: TextStyle(fontSize: 24)), const Icon(Icons.local_fire_department,
const SizedBox(width: 10), color: TemaApp.colorNaranja),
const SizedBox(width: 8),
Expanded( Expanded(
child: ClipRRect( child: Text(
borderRadius: BorderRadius.circular(6), 'RECOMPENSAS DE PARTIDA',
child: LinearProgressIndicator( style: Theme.of(context).textTheme.titleMedium?.copyWith(
value: progreso.despues.fuego / 100, color: TemaApp.colorDorado,
minHeight: 8, fontWeight: FontWeight.w900,
color: TemaApp.colorNaranja, letterSpacing: 1,
backgroundColor: Colors.black.withValues(alpha: 0.35),
), ),
), ),
), ),
const SizedBox(width: 10), Text(
Text('${progreso.despues.fuego}%'), 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), const SizedBox(height: 8),
Text( Text(
progreso.incrementoFuego >= 0 '${progreso.despues.fuego}% de fuego',
? '+${progreso.incrementoFuego}% de fuego'
: '${progreso.incrementoFuego}% de fuego',
style: Theme.of(context).textTheme.bodySmall, style: Theme.of(context).textTheme.bodySmall,
), ),
if (nuevas.isNotEmpty) ...[ if (nuevas.isNotEmpty) ...[
const SizedBox(height: 12), const SizedBox(height: 12),
Text('Nuevas medallas', Text(
style: Theme.of(context).textTheme.bodyMedium), 'NUEVAS MEDALLAS',
style: Theme.of(context).textTheme.bodyMedium?.copyWith(
color: TemaApp.colorDorado,
fontWeight: FontWeight.w800,
),
),
const SizedBox(height: 6), const SizedBox(height: 6),
MedallasCompactasFarolero(ids: nuevas, max: nuevas.length), 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 google_fonts: ^6.2.1
nearby_connections: ^4.0.0 nearby_connections: ^4.0.0
permission_handler: ^12.0.1 permission_handler: ^12.0.1
flutter_animate: ^4.5.2
confetti: ^0.8.0
dev_dependencies: dev_dependencies:
flutter_test: flutter_test: