Resumen de fin de partida espectacular
This commit is contained in:
@@ -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),
|
||||
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),
|
||||
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),
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 10),
|
||||
Text('${progreso.despues.fuego}%'),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
Text(
|
||||
progreso.incrementoFuego >= 0
|
||||
? '+${progreso.incrementoFuego}% de fuego'
|
||||
: '${progreso.incrementoFuego}% de fuego',
|
||||
style: Theme.of(context).textTheme.bodySmall,
|
||||
),
|
||||
if (nuevas.isNotEmpty) ...[
|
||||
const SizedBox(height: 12),
|
||||
Text('Nuevas medallas',
|
||||
style: Theme.of(context).textTheme.bodyMedium),
|
||||
const SizedBox(height: 6),
|
||||
MedallasCompactasFarolero(ids: nuevas, max: nuevas.length),
|
||||
],
|
||||
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: [
|
||||
Row(
|
||||
children: [
|
||||
const Icon(Icons.local_fire_department,
|
||||
color: TemaApp.colorNaranja),
|
||||
const SizedBox(width: 8),
|
||||
Expanded(
|
||||
child: Text(
|
||||
'RECOMPENSAS DE PARTIDA',
|
||||
style: Theme.of(context).textTheme.titleMedium?.copyWith(
|
||||
color: TemaApp.colorDorado,
|
||||
fontWeight: FontWeight.w900,
|
||||
letterSpacing: 1,
|
||||
),
|
||||
),
|
||||
),
|
||||
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.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?.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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user