Resumen de fin de partida espectacular
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -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),
|
||||||
child: Column(
|
decoration: BoxDecoration(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
gradient: LinearGradient(
|
||||||
children: [
|
colors: [
|
||||||
Text('Tu progreso', style: Theme.of(context).textTheme.titleMedium),
|
const Color(0xFF111B28).withValues(alpha: 0.96),
|
||||||
const SizedBox(height: 12),
|
const Color(0xFF180D22).withValues(alpha: 0.94),
|
||||||
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),
|
|
||||||
],
|
|
||||||
],
|
],
|
||||||
|
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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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:
|
||||||
|
|||||||
Reference in New Issue
Block a user