Completo y absoluto cambio de diseño
This commit is contained in:
Binary file not shown.
|
After Width: | Height: | Size: 1.7 MiB |
+30
-11
@@ -6,6 +6,7 @@ import 'package:provider/provider.dart';
|
|||||||
import 'estado/estado_juego.dart';
|
import 'estado/estado_juego.dart';
|
||||||
import 'servicios/servicio_idioma.dart';
|
import 'servicios/servicio_idioma.dart';
|
||||||
import 'servicios/servicio_nearby.dart';
|
import 'servicios/servicio_nearby.dart';
|
||||||
|
import 'tema/componentes_farolero.dart';
|
||||||
import 'tema/tema_app.dart';
|
import 'tema/tema_app.dart';
|
||||||
import 'pantallas/pantalla_principal.dart';
|
import 'pantallas/pantalla_principal.dart';
|
||||||
|
|
||||||
@@ -71,26 +72,44 @@ class PantallaCarga extends StatelessWidget {
|
|||||||
|
|
||||||
if (estado.cargando || estado.banco == null) {
|
if (estado.cargando || estado.banco == null) {
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
body: Center(
|
body: FondoFarolero(
|
||||||
|
intenso: true,
|
||||||
|
child: SafeArea(
|
||||||
|
child: Padding(
|
||||||
|
padding: const EdgeInsets.symmetric(horizontal: 34, vertical: 28),
|
||||||
child: Column(
|
child: Column(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
|
||||||
children: [
|
children: [
|
||||||
const Text('🎭', style: TextStyle(fontSize: 72)),
|
const Spacer(flex: 2),
|
||||||
const SizedBox(height: 24),
|
const Icon(
|
||||||
Text(
|
Icons.lightbulb,
|
||||||
l10n?.appTitle ?? 'Farolero',
|
color: TemaApp.colorNaranja,
|
||||||
style: Theme.of(context).textTheme.headlineLarge,
|
size: 86,
|
||||||
),
|
),
|
||||||
const SizedBox(height: 16),
|
const SizedBox(height: 18),
|
||||||
const CircularProgressIndicator(color: TemaApp.colorAcento),
|
const LogoFarolero(size: 58),
|
||||||
const SizedBox(height: 12),
|
const Spacer(flex: 3),
|
||||||
|
ClipRRect(
|
||||||
|
borderRadius: BorderRadius.circular(4),
|
||||||
|
child: const LinearProgressIndicator(
|
||||||
|
minHeight: 8,
|
||||||
|
color: TemaApp.colorNaranja,
|
||||||
|
backgroundColor: TemaApp.colorSuperficie,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const SizedBox(height: 14),
|
||||||
Text(
|
Text(
|
||||||
l10n?.loadingWords ?? 'Cargando palabras...',
|
l10n?.loadingWords ?? 'Cargando palabras...',
|
||||||
style: Theme.of(context).textTheme.bodyMedium,
|
style: Theme.of(context).textTheme.titleMedium?.copyWith(
|
||||||
|
color: TemaApp.colorDorado,
|
||||||
),
|
),
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
),
|
||||||
|
const Spacer(),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
|
|||||||
import 'package:farolero/l10n/generated/app_localizations.dart';
|
import 'package:farolero/l10n/generated/app_localizations.dart';
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
import '../servicios/servicio_idioma.dart';
|
import '../servicios/servicio_idioma.dart';
|
||||||
|
import '../tema/componentes_farolero.dart';
|
||||||
import '../tema/tema_app.dart';
|
import '../tema/tema_app.dart';
|
||||||
|
|
||||||
class PantallaAjustes extends StatefulWidget {
|
class PantallaAjustes extends StatefulWidget {
|
||||||
@@ -22,7 +23,8 @@ class _PantallaAjustesState extends State<PantallaAjustes> {
|
|||||||
|
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
appBar: AppBar(title: Text(l10n.settingsTitle)),
|
appBar: AppBar(title: Text(l10n.settingsTitle)),
|
||||||
body: SingleChildScrollView(
|
body: FondoFarolero(
|
||||||
|
child: SingleChildScrollView(
|
||||||
padding: const EdgeInsets.all(16),
|
padding: const EdgeInsets.all(16),
|
||||||
child: Column(
|
child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
@@ -135,6 +137,7 @@ class _PantallaAjustesState extends State<PantallaAjustes> {
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import '../modelos/partida.dart';
|
|||||||
import '../modelos/usuario.dart';
|
import '../modelos/usuario.dart';
|
||||||
import '../servicios/servicio_nearby.dart';
|
import '../servicios/servicio_nearby.dart';
|
||||||
import '../servicios/servicio_permisos.dart';
|
import '../servicios/servicio_permisos.dart';
|
||||||
|
import '../tema/componentes_farolero.dart';
|
||||||
import '../tema/tema_app.dart';
|
import '../tema/tema_app.dart';
|
||||||
import 'pantalla_gestor_host.dart';
|
import 'pantalla_gestor_host.dart';
|
||||||
import 'pantalla_lobby_host.dart';
|
import 'pantalla_lobby_host.dart';
|
||||||
@@ -409,11 +410,38 @@ class _PantallaCrearPartidaState extends State<PantallaCrearPartida> {
|
|||||||
|
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
appBar: AppBar(title: Text(l10n.createGame)),
|
appBar: AppBar(title: Text(l10n.createGame)),
|
||||||
body: SingleChildScrollView(
|
body: FondoFarolero(
|
||||||
|
child: SingleChildScrollView(
|
||||||
padding: const EdgeInsets.all(16),
|
padding: const EdgeInsets.all(16),
|
||||||
child: Column(
|
child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
|
PanelFarolero(
|
||||||
|
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 18),
|
||||||
|
child: Row(
|
||||||
|
children: [
|
||||||
|
const Icon(Icons.groups, color: TemaApp.colorNaranja, size: 42),
|
||||||
|
const SizedBox(width: 14),
|
||||||
|
Expanded(
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
'¿Cómo quieres jugar?',
|
||||||
|
style: Theme.of(context).textTheme.titleLarge,
|
||||||
|
),
|
||||||
|
const SizedBox(height: 3),
|
||||||
|
Text(
|
||||||
|
l10n.playersRange,
|
||||||
|
style: Theme.of(context).textTheme.bodyMedium,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const SizedBox(height: 12),
|
||||||
// Modo de juego
|
// Modo de juego
|
||||||
Card(
|
Card(
|
||||||
child: Padding(
|
child: Padding(
|
||||||
@@ -650,6 +678,7 @@ class _PantallaCrearPartidaState extends State<PantallaCrearPartida> {
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ import 'package:flutter/material.dart';
|
|||||||
import 'package:farolero/l10n/generated/app_localizations.dart';
|
import 'package:farolero/l10n/generated/app_localizations.dart';
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
import '../estado/estado_juego.dart';
|
import '../estado/estado_juego.dart';
|
||||||
|
import '../tema/componentes_farolero.dart';
|
||||||
import '../tema/tema_app.dart';
|
import '../tema/tema_app.dart';
|
||||||
import 'pantalla_notas.dart';
|
import 'pantalla_notas.dart';
|
||||||
import 'pantalla_votacion.dart';
|
import 'pantalla_votacion.dart';
|
||||||
@@ -75,7 +76,8 @@ class _PantallaDebateState extends State<PantallaDebate> {
|
|||||||
title: Text(l10n.debateRound(partida.rondaActual)),
|
title: Text(l10n.debateRound(partida.rondaActual)),
|
||||||
automaticallyImplyLeading: false,
|
automaticallyImplyLeading: false,
|
||||||
),
|
),
|
||||||
body: Padding(
|
body: FondoFarolero(
|
||||||
|
child: Padding(
|
||||||
padding: const EdgeInsets.all(16),
|
padding: const EdgeInsets.all(16),
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
@@ -225,6 +227,7 @@ class _PantallaDebateState extends State<PantallaDebate> {
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import '../estado/estado_juego.dart';
|
|||||||
import '../modelos/inicio_partida_multijugador.dart';
|
import '../modelos/inicio_partida_multijugador.dart';
|
||||||
import '../modelos/partida.dart';
|
import '../modelos/partida.dart';
|
||||||
import '../servicios/servicio_nearby.dart';
|
import '../servicios/servicio_nearby.dart';
|
||||||
|
import '../tema/componentes_farolero.dart';
|
||||||
import '../tema/tema_app.dart';
|
import '../tema/tema_app.dart';
|
||||||
import 'pantalla_votacion_cliente.dart';
|
import 'pantalla_votacion_cliente.dart';
|
||||||
import 'pantalla_palabras_cliente.dart';
|
import 'pantalla_palabras_cliente.dart';
|
||||||
@@ -139,7 +140,8 @@ class _PantallaGestorHostState extends State<PantallaGestorHost> {
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
body: Padding(
|
body: FondoFarolero(
|
||||||
|
child: Padding(
|
||||||
padding: const EdgeInsets.all(16),
|
padding: const EdgeInsets.all(16),
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
@@ -165,6 +167,7 @@ class _PantallaGestorHostState extends State<PantallaGestorHost> {
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -674,7 +677,9 @@ class _PantallaRevelarPalabraHostState
|
|||||||
|
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
appBar: AppBar(title: Text(widget.nombre)),
|
appBar: AppBar(title: Text(widget.nombre)),
|
||||||
body: Center(
|
body: FondoFarolero(
|
||||||
|
intenso: true,
|
||||||
|
child: Center(
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsets.all(32),
|
padding: const EdgeInsets.all(32),
|
||||||
child: Column(
|
child: Column(
|
||||||
@@ -726,12 +731,7 @@ class _PantallaRevelarPalabraHostState
|
|||||||
),
|
),
|
||||||
if (!widget.esImpostor) ...[
|
if (!widget.esImpostor) ...[
|
||||||
const SizedBox(height: 12),
|
const SizedBox(height: 12),
|
||||||
Text(
|
TarjetaPalabraFarolero(palabra: widget.palabra),
|
||||||
widget.palabra,
|
|
||||||
style: Theme.of(context).textTheme.headlineLarge
|
|
||||||
?.copyWith(fontSize: 32, color: Colors.white),
|
|
||||||
textAlign: TextAlign.center,
|
|
||||||
),
|
|
||||||
],
|
],
|
||||||
if (widget.esImpostor && widget.pistaActiva) ...[
|
if (widget.esImpostor && widget.pistaActiva) ...[
|
||||||
const SizedBox(height: 12),
|
const SizedBox(height: 12),
|
||||||
@@ -791,6 +791,7 @@ class _PantallaRevelarPalabraHostState
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import 'package:qr_flutter/qr_flutter.dart';
|
|||||||
import 'package:farolero/l10n/generated/app_localizations.dart';
|
import 'package:farolero/l10n/generated/app_localizations.dart';
|
||||||
import '../modelos/usuario.dart';
|
import '../modelos/usuario.dart';
|
||||||
import '../servicios/servicio_nearby.dart';
|
import '../servicios/servicio_nearby.dart';
|
||||||
|
import '../tema/componentes_farolero.dart';
|
||||||
import '../tema/tema_app.dart';
|
import '../tema/tema_app.dart';
|
||||||
|
|
||||||
/// Lobby del host. El host es autoridad de sala y también cliente local.
|
/// Lobby del host. El host es autoridad de sala y también cliente local.
|
||||||
@@ -45,7 +46,8 @@ class _PantallaLobbyHostState extends State<PantallaLobbyHost> {
|
|||||||
},
|
},
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
body: Padding(
|
body: FondoFarolero(
|
||||||
|
child: Padding(
|
||||||
padding: const EdgeInsets.all(24),
|
padding: const EdgeInsets.all(24),
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
@@ -130,6 +132,7 @@ class _PantallaLobbyHostState extends State<PantallaLobbyHost> {
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -176,6 +179,7 @@ class _PantallaLobbyHostState extends State<PantallaLobbyHost> {
|
|||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: color.withValues(alpha: 0.18),
|
color: color.withValues(alpha: 0.18),
|
||||||
borderRadius: BorderRadius.circular(12),
|
borderRadius: BorderRadius.circular(12),
|
||||||
|
border: Border.all(color: color.withValues(alpha: 0.55)),
|
||||||
),
|
),
|
||||||
child: Row(
|
child: Row(
|
||||||
children: [
|
children: [
|
||||||
@@ -202,12 +206,16 @@ class _PantallaLobbyHostState extends State<PantallaLobbyHost> {
|
|||||||
|
|
||||||
return ListTile(
|
return ListTile(
|
||||||
leading: CircleAvatar(
|
leading: CircleAvatar(
|
||||||
backgroundColor: seleccionadoPorMi
|
backgroundColor: Colors.transparent,
|
||||||
|
child: AvatarFarolero(
|
||||||
|
texto: usuario.avatar ?? (usuario.nombre.isEmpty ? '?' : usuario.nombre[0]),
|
||||||
|
color: seleccionadoPorMi
|
||||||
? TemaApp.colorVerde
|
? TemaApp.colorVerde
|
||||||
: seleccionadoPorOtro
|
: seleccionadoPorOtro
|
||||||
? TemaApp.colorNaranja
|
? TemaApp.colorNaranja
|
||||||
: TemaApp.colorTarjeta,
|
: TemaApp.colorAzul,
|
||||||
child: Text(usuario.avatar ?? '👤'),
|
size: 38,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
title: Text(usuario.nombre),
|
title: Text(usuario.nombre),
|
||||||
subtitle: Text(
|
subtitle: Text(
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:farolero/l10n/generated/app_localizations.dart';
|
import 'package:farolero/l10n/generated/app_localizations.dart';
|
||||||
|
import 'package:farolero/tema/componentes_farolero.dart';
|
||||||
import 'package:farolero/tema/tema_app.dart';
|
import 'package:farolero/tema/tema_app.dart';
|
||||||
|
|
||||||
/// Pantalla que ve cada jugador cuando recibe su palabra (modo multidispositivo).
|
/// Pantalla que ve cada jugador cuando recibe su palabra (modo multidispositivo).
|
||||||
@@ -44,8 +45,9 @@ class _PantallaPalabraClienteState extends State<PantallaPalabraCliente> {
|
|||||||
final l10n = AppLocalizations.of(context)!;
|
final l10n = AppLocalizations.of(context)!;
|
||||||
|
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
backgroundColor: TemaApp.colorFondo,
|
body: FondoFarolero(
|
||||||
body: SafeArea(
|
intenso: true,
|
||||||
|
child: SafeArea(
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsets.all(24),
|
padding: const EdgeInsets.all(24),
|
||||||
child: Column(
|
child: Column(
|
||||||
@@ -58,15 +60,18 @@ class _PantallaPalabraClienteState extends State<PantallaPalabraCliente> {
|
|||||||
duration: const Duration(milliseconds: 300),
|
duration: const Duration(milliseconds: 300),
|
||||||
width: double.infinity,
|
width: double.infinity,
|
||||||
padding: const EdgeInsets.symmetric(vertical: 48, horizontal: 24),
|
padding: const EdgeInsets.symmetric(vertical: 48, horizontal: 24),
|
||||||
decoration: BoxDecoration(
|
decoration: TemaApp.decoracionPanel(
|
||||||
color: _palabraVisible
|
color: _palabraVisible
|
||||||
? TemaApp.colorAcento
|
? TemaApp.colorSuperficie
|
||||||
: TemaApp.colorTarjeta,
|
: TemaApp.colorTarjeta,
|
||||||
borderRadius: BorderRadius.circular(24),
|
borderColor: _palabraVisible
|
||||||
|
? TemaApp.colorNaranja
|
||||||
|
: TemaApp.colorBorde,
|
||||||
|
).copyWith(
|
||||||
boxShadow: _palabraVisible
|
boxShadow: _palabraVisible
|
||||||
? [
|
? [
|
||||||
BoxShadow(
|
BoxShadow(
|
||||||
color: TemaApp.colorAcento.withValues(alpha: 0.4),
|
color: TemaApp.colorNaranja.withValues(alpha: 0.32),
|
||||||
blurRadius: 24,
|
blurRadius: 24,
|
||||||
spreadRadius: 2,
|
spreadRadius: 2,
|
||||||
),
|
),
|
||||||
@@ -83,15 +88,15 @@ class _PantallaPalabraClienteState extends State<PantallaPalabraCliente> {
|
|||||||
size: 32,
|
size: 32,
|
||||||
),
|
),
|
||||||
const SizedBox(height: 16),
|
const SizedBox(height: 16),
|
||||||
Text(
|
_palabraVisible
|
||||||
_palabraVisible ? widget.palabra : '???',
|
? TarjetaPalabraFarolero(palabra: widget.palabra)
|
||||||
|
: const Text(
|
||||||
|
'???',
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 32,
|
fontSize: 32,
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
color: _palabraVisible
|
color: TemaApp.colorTextoSecundario,
|
||||||
? Colors.white
|
|
||||||
: TemaApp.colorTextoSecundario,
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
@@ -164,6 +169,7 @@ class _PantallaPalabraClienteState extends State<PantallaPalabraCliente> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:farolero/l10n/generated/app_localizations.dart';
|
import 'package:farolero/l10n/generated/app_localizations.dart';
|
||||||
import 'package:farolero/modelos/inicio_partida_multijugador.dart';
|
import 'package:farolero/modelos/inicio_partida_multijugador.dart';
|
||||||
|
import 'package:farolero/tema/componentes_farolero.dart';
|
||||||
import 'package:farolero/tema/tema_app.dart';
|
import 'package:farolero/tema/tema_app.dart';
|
||||||
|
|
||||||
/// Reveal secuencial para clientes que manejan uno o varios jugadores.
|
/// Reveal secuencial para clientes que manejan uno o varios jugadores.
|
||||||
@@ -44,8 +45,9 @@ class _PantallaPalabrasClienteState extends State<PantallaPalabrasCliente> {
|
|||||||
final actual = _actual;
|
final actual = _actual;
|
||||||
|
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
backgroundColor: TemaApp.colorFondo,
|
body: FondoFarolero(
|
||||||
body: SafeArea(
|
intenso: true,
|
||||||
|
child: SafeArea(
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsets.all(24),
|
padding: const EdgeInsets.all(24),
|
||||||
child: Column(
|
child: Column(
|
||||||
@@ -71,8 +73,11 @@ class _PantallaPalabrasClienteState extends State<PantallaPalabrasCliente> {
|
|||||||
horizontal: 24,
|
horizontal: 24,
|
||||||
),
|
),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: _visible ? TemaApp.colorAcento : TemaApp.colorTarjeta,
|
color: _visible ? TemaApp.colorSuperficie : TemaApp.colorTarjeta,
|
||||||
borderRadius: BorderRadius.circular(24),
|
borderRadius: BorderRadius.circular(8),
|
||||||
|
border: Border.all(
|
||||||
|
color: _visible ? TemaApp.colorNaranja : TemaApp.colorBorde,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
@@ -82,18 +87,17 @@ class _PantallaPalabrasClienteState extends State<PantallaPalabrasCliente> {
|
|||||||
size: 32,
|
size: 32,
|
||||||
),
|
),
|
||||||
const SizedBox(height: 16),
|
const SizedBox(height: 16),
|
||||||
|
if (_visible && !actual.esImpostor)
|
||||||
|
TarjetaPalabraFarolero(palabra: actual.palabra ?? '')
|
||||||
|
else
|
||||||
Text(
|
Text(
|
||||||
_visible
|
_visible ? l10n.youAreImpostor : '???',
|
||||||
? (actual.esImpostor
|
|
||||||
? l10n.youAreImpostor
|
|
||||||
: actual.palabra ?? '')
|
|
||||||
: '???',
|
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 32,
|
fontSize: 32,
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
color: _visible
|
color: _visible
|
||||||
? Colors.white
|
? TemaApp.colorDorado
|
||||||
: TemaApp.colorTextoSecundario,
|
: TemaApp.colorTextoSecundario,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -123,6 +127,7 @@ class _PantallaPalabrasClienteState extends State<PantallaPalabrasCliente> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:farolero/l10n/generated/app_localizations.dart';
|
import 'package:farolero/l10n/generated/app_localizations.dart';
|
||||||
|
import '../tema/componentes_farolero.dart';
|
||||||
import '../tema/tema_app.dart';
|
import '../tema/tema_app.dart';
|
||||||
import 'pantalla_ajustes.dart';
|
import 'pantalla_ajustes.dart';
|
||||||
import 'pantalla_crear_partida.dart';
|
import 'pantalla_crear_partida.dart';
|
||||||
@@ -14,113 +15,47 @@ class PantallaPrincipal extends StatelessWidget {
|
|||||||
final l10n = AppLocalizations.of(context)!;
|
final l10n = AppLocalizations.of(context)!;
|
||||||
|
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
body: SafeArea(
|
body: FondoFarolero(
|
||||||
|
intenso: true,
|
||||||
|
child: SafeArea(
|
||||||
child: Center(
|
child: Center(
|
||||||
child: SingleChildScrollView(
|
child: SingleChildScrollView(
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 32, vertical: 24),
|
padding: const EdgeInsets.symmetric(horizontal: 24, vertical: 18),
|
||||||
|
child: ConstrainedBox(
|
||||||
|
constraints: const BoxConstraints(maxWidth: 420),
|
||||||
child: Column(
|
child: Column(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
|
||||||
children: [
|
children: [
|
||||||
// Logo
|
Row(
|
||||||
Container(
|
children: [
|
||||||
width: 120,
|
const AvatarFarolero(texto: 'A', size: 48),
|
||||||
height: 120,
|
const SizedBox(width: 10),
|
||||||
decoration: BoxDecoration(
|
Expanded(
|
||||||
shape: BoxShape.circle,
|
child: Column(
|
||||||
gradient: const LinearGradient(
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
colors: [TemaApp.colorAcento, TemaApp.colorNaranja],
|
children: [
|
||||||
begin: Alignment.topLeft,
|
Text(
|
||||||
end: Alignment.bottomRight,
|
'Alex',
|
||||||
|
style: Theme.of(context).textTheme.titleMedium,
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
'Nivel 12',
|
||||||
|
style: Theme.of(context).textTheme.bodySmall,
|
||||||
|
),
|
||||||
|
const SizedBox(height: 3),
|
||||||
|
ClipRRect(
|
||||||
|
borderRadius: BorderRadius.circular(4),
|
||||||
|
child: LinearProgressIndicator(
|
||||||
|
value: 0.68,
|
||||||
|
minHeight: 4,
|
||||||
|
color: TemaApp.colorPurpura,
|
||||||
|
backgroundColor: Colors.black.withValues(alpha: 0.45),
|
||||||
),
|
),
|
||||||
boxShadow: [
|
|
||||||
BoxShadow(
|
|
||||||
color: TemaApp.colorAcento.withValues(alpha: 0.4),
|
|
||||||
blurRadius: 30,
|
|
||||||
spreadRadius: 5,
|
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
child: const Center(
|
|
||||||
child: Text(
|
|
||||||
'🎭',
|
|
||||||
style: TextStyle(fontSize: 56),
|
|
||||||
),
|
),
|
||||||
),
|
IconButton.filledTonal(
|
||||||
),
|
tooltip: l10n.settings,
|
||||||
const SizedBox(height: 24),
|
|
||||||
|
|
||||||
// Título
|
|
||||||
Text(
|
|
||||||
l10n.appTitle,
|
|
||||||
style: Theme.of(context).textTheme.headlineLarge?.copyWith(
|
|
||||||
fontSize: 36,
|
|
||||||
letterSpacing: 1.2,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
const SizedBox(height: 8),
|
|
||||||
Text(
|
|
||||||
l10n.subtitle,
|
|
||||||
style: Theme.of(context).textTheme.bodyMedium?.copyWith(
|
|
||||||
fontSize: 16,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
const SizedBox(height: 48),
|
|
||||||
|
|
||||||
// Botones
|
|
||||||
SizedBox(
|
|
||||||
width: double.infinity,
|
|
||||||
child: ElevatedButton.icon(
|
|
||||||
onPressed: () {
|
|
||||||
Navigator.push(
|
|
||||||
context,
|
|
||||||
MaterialPageRoute(
|
|
||||||
builder: (_) => const PantallaCrearPartida(),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
},
|
|
||||||
icon: const Text('🎮', style: TextStyle(fontSize: 20)),
|
|
||||||
label: Text(l10n.createGame),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
const SizedBox(height: 16),
|
|
||||||
|
|
||||||
SizedBox(
|
|
||||||
width: double.infinity,
|
|
||||||
child: OutlinedButton.icon(
|
|
||||||
onPressed: () {
|
|
||||||
Navigator.push(
|
|
||||||
context,
|
|
||||||
MaterialPageRoute(
|
|
||||||
builder: (_) => const PantallaUnirse(),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
},
|
|
||||||
icon: const Text('📱', style: TextStyle(fontSize: 20)),
|
|
||||||
label: Text(l10n.joinGame),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
const SizedBox(height: 16),
|
|
||||||
|
|
||||||
SizedBox(
|
|
||||||
width: double.infinity,
|
|
||||||
child: OutlinedButton.icon(
|
|
||||||
onPressed: () {
|
|
||||||
Navigator.push(
|
|
||||||
context,
|
|
||||||
MaterialPageRoute(
|
|
||||||
builder: (_) => const PantallaReglas(),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
},
|
|
||||||
icon: const Text('📖', style: TextStyle(fontSize: 20)),
|
|
||||||
label: Text(l10n.howToPlay),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
const SizedBox(height: 16),
|
|
||||||
|
|
||||||
SizedBox(
|
|
||||||
width: double.infinity,
|
|
||||||
child: OutlinedButton.icon(
|
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
Navigator.push(
|
Navigator.push(
|
||||||
context,
|
context,
|
||||||
@@ -129,20 +64,104 @@ class PantallaPrincipal extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
icon: const Icon(Icons.settings, size: 20),
|
icon: const Icon(Icons.settings),
|
||||||
label: Text(l10n.settings),
|
|
||||||
),
|
),
|
||||||
|
],
|
||||||
),
|
),
|
||||||
const SizedBox(height: 48),
|
const SizedBox(height: 38),
|
||||||
|
const LogoFarolero(size: 70),
|
||||||
|
const SizedBox(height: 12),
|
||||||
Text(
|
Text(
|
||||||
l10n.playersRange,
|
l10n.subtitle,
|
||||||
style: Theme.of(context).textTheme.bodyMedium?.copyWith(
|
style: Theme.of(context).textTheme.bodyMedium?.copyWith(
|
||||||
fontSize: 12,
|
color: TemaApp.colorTexto,
|
||||||
|
fontSize: 15,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const SizedBox(height: 54),
|
||||||
|
BotonFarolero(
|
||||||
|
texto: 'Jugar',
|
||||||
|
icono: Icons.play_arrow,
|
||||||
|
onPressed: () {
|
||||||
|
Navigator.push(
|
||||||
|
context,
|
||||||
|
MaterialPageRoute(
|
||||||
|
builder: (_) => const PantallaCrearPartida(),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
const SizedBox(height: 12),
|
||||||
|
BotonFarolero.secundario(
|
||||||
|
texto: l10n.joinGame,
|
||||||
|
icono: Icons.bolt,
|
||||||
|
onPressed: () {
|
||||||
|
Navigator.push(
|
||||||
|
context,
|
||||||
|
MaterialPageRoute(
|
||||||
|
builder: (_) => const PantallaUnirse(),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
const SizedBox(height: 12),
|
||||||
|
BotonFarolero.oscuro(
|
||||||
|
texto: l10n.howToPlay,
|
||||||
|
icono: Icons.question_mark,
|
||||||
|
onPressed: () {
|
||||||
|
Navigator.push(
|
||||||
|
context,
|
||||||
|
MaterialPageRoute(
|
||||||
|
builder: (_) => const PantallaReglas(),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
const SizedBox(height: 18),
|
||||||
|
Row(
|
||||||
|
children: [
|
||||||
|
Expanded(
|
||||||
|
child: AccesoFarolero(
|
||||||
|
etiqueta: 'Historial',
|
||||||
|
icono: Icons.history,
|
||||||
|
onPressed: () {},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const SizedBox(width: 8),
|
||||||
|
Expanded(
|
||||||
|
child: AccesoFarolero(
|
||||||
|
etiqueta: 'Logros',
|
||||||
|
icono: Icons.emoji_events,
|
||||||
|
onPressed: () {},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const SizedBox(width: 8),
|
||||||
|
Expanded(
|
||||||
|
child: AccesoFarolero(
|
||||||
|
etiqueta: 'Ranking',
|
||||||
|
icono: Icons.bar_chart,
|
||||||
|
onPressed: () {},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const SizedBox(width: 8),
|
||||||
|
Expanded(
|
||||||
|
child: AccesoFarolero(
|
||||||
|
etiqueta: 'Tienda',
|
||||||
|
icono: Icons.storefront,
|
||||||
|
onPressed: () {},
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
const SizedBox(height: 28),
|
||||||
|
Text(
|
||||||
|
l10n.playersRange,
|
||||||
|
style: Theme.of(context).textTheme.bodySmall,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:farolero/l10n/generated/app_localizations.dart';
|
import 'package:farolero/l10n/generated/app_localizations.dart';
|
||||||
|
import '../tema/componentes_farolero.dart';
|
||||||
import '../tema/tema_app.dart';
|
import '../tema/tema_app.dart';
|
||||||
|
|
||||||
class PantallaReglas extends StatelessWidget {
|
class PantallaReglas extends StatelessWidget {
|
||||||
@@ -11,36 +12,96 @@ class PantallaReglas extends StatelessWidget {
|
|||||||
|
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
appBar: AppBar(title: Text(l10n.rulesTitle)),
|
appBar: AppBar(title: Text(l10n.rulesTitle)),
|
||||||
body: SingleChildScrollView(
|
body: FondoFarolero(
|
||||||
|
child: SingleChildScrollView(
|
||||||
padding: const EdgeInsets.all(16),
|
padding: const EdgeInsets.all(16),
|
||||||
child: Column(
|
child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
_seccion(context, l10n.rulesWhatIsTitle, l10n.rulesWhatIsBody),
|
_seccion(
|
||||||
_seccion(context, l10n.rulesHowToPlayTitle, l10n.rulesHowToPlayBody),
|
context,
|
||||||
_seccion(context, l10n.rulesWhoWinsTitle, l10n.rulesWhoWinsBody),
|
1,
|
||||||
_seccion(context, l10n.rulesTipsPlayersTitle, l10n.rulesTipsPlayersBody),
|
Icons.person_search,
|
||||||
_seccion(context, l10n.rulesTipsImpostorTitle, l10n.rulesTipsImpostorBody),
|
l10n.rulesWhatIsTitle,
|
||||||
_seccion(context, l10n.rulesModesTitle, l10n.rulesModesBody),
|
l10n.rulesWhatIsBody,
|
||||||
|
),
|
||||||
|
_seccion(
|
||||||
|
context,
|
||||||
|
2,
|
||||||
|
Icons.chat_bubble,
|
||||||
|
l10n.rulesHowToPlayTitle,
|
||||||
|
l10n.rulesHowToPlayBody,
|
||||||
|
),
|
||||||
|
_seccion(
|
||||||
|
context,
|
||||||
|
3,
|
||||||
|
Icons.how_to_vote,
|
||||||
|
l10n.rulesWhoWinsTitle,
|
||||||
|
l10n.rulesWhoWinsBody,
|
||||||
|
),
|
||||||
|
_seccion(
|
||||||
|
context,
|
||||||
|
4,
|
||||||
|
Icons.lightbulb,
|
||||||
|
l10n.rulesTipsPlayersTitle,
|
||||||
|
l10n.rulesTipsPlayersBody,
|
||||||
|
),
|
||||||
|
_seccion(
|
||||||
|
context,
|
||||||
|
5,
|
||||||
|
Icons.theater_comedy,
|
||||||
|
l10n.rulesTipsImpostorTitle,
|
||||||
|
l10n.rulesTipsImpostorBody,
|
||||||
|
),
|
||||||
|
_seccion(
|
||||||
|
context,
|
||||||
|
6,
|
||||||
|
Icons.devices,
|
||||||
|
l10n.rulesModesTitle,
|
||||||
|
l10n.rulesModesBody,
|
||||||
|
),
|
||||||
_ejemplo(context, l10n.rulesExampleTitle, l10n.rulesExampleBody),
|
_ejemplo(context, l10n.rulesExampleTitle, l10n.rulesExampleBody),
|
||||||
const SizedBox(height: 32),
|
const SizedBox(height: 32),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget _seccion(BuildContext context, String titulo, String contenido) {
|
Widget _seccion(
|
||||||
|
BuildContext context,
|
||||||
|
int numero,
|
||||||
|
IconData icono,
|
||||||
|
String titulo,
|
||||||
|
String contenido,
|
||||||
|
) {
|
||||||
return Padding(
|
return Padding(
|
||||||
padding: const EdgeInsets.only(bottom: 16),
|
padding: const EdgeInsets.only(bottom: 16),
|
||||||
child: Card(
|
child: PanelFarolero(
|
||||||
child: Padding(
|
padding: const EdgeInsets.all(12),
|
||||||
padding: const EdgeInsets.all(16),
|
child: Row(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Container(
|
||||||
|
width: 54,
|
||||||
|
height: 54,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: TemaApp.colorNaranja.withValues(alpha: 0.16),
|
||||||
|
borderRadius: BorderRadius.circular(8),
|
||||||
|
border: Border.all(color: TemaApp.colorNaranja),
|
||||||
|
),
|
||||||
|
child: Icon(icono, color: TemaApp.colorNaranja, size: 30),
|
||||||
|
),
|
||||||
|
const SizedBox(width: 12),
|
||||||
|
Expanded(
|
||||||
child: Column(
|
child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Text(titulo,
|
Text(
|
||||||
style: Theme.of(context).textTheme.titleLarge),
|
'$numero. ${titulo.toUpperCase()}',
|
||||||
|
style: Theme.of(context).textTheme.titleLarge,
|
||||||
|
),
|
||||||
const SizedBox(height: 8),
|
const SizedBox(height: 8),
|
||||||
Text(contenido,
|
Text(contenido,
|
||||||
style: Theme.of(context).textTheme.bodyLarge?.copyWith(
|
style: Theme.of(context).textTheme.bodyLarge?.copyWith(
|
||||||
@@ -49,6 +110,8 @@ class PantallaReglas extends StatelessWidget {
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -56,10 +119,9 @@ class PantallaReglas extends StatelessWidget {
|
|||||||
Widget _ejemplo(BuildContext context, String titulo, String contenido) {
|
Widget _ejemplo(BuildContext context, String titulo, String contenido) {
|
||||||
return Padding(
|
return Padding(
|
||||||
padding: const EdgeInsets.only(bottom: 16),
|
padding: const EdgeInsets.only(bottom: 16),
|
||||||
child: Card(
|
child: PanelFarolero(
|
||||||
color: TemaApp.colorNaranja.withValues(alpha: 0.15),
|
color: TemaApp.colorNaranja.withValues(alpha: 0.15),
|
||||||
child: Padding(
|
borderColor: TemaApp.colorNaranja,
|
||||||
padding: const EdgeInsets.all(16),
|
|
||||||
child: Column(
|
child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
@@ -75,7 +137,6 @@ class PantallaReglas extends StatelessWidget {
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ import 'package:farolero/l10n/generated/app_localizations.dart';
|
|||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
import '../estado/estado_juego.dart';
|
import '../estado/estado_juego.dart';
|
||||||
import '../modelos/partida.dart';
|
import '../modelos/partida.dart';
|
||||||
|
import '../tema/componentes_farolero.dart';
|
||||||
import '../tema/tema_app.dart';
|
import '../tema/tema_app.dart';
|
||||||
import 'pantalla_adivinanza.dart';
|
import 'pantalla_adivinanza.dart';
|
||||||
import 'pantalla_debate.dart';
|
import 'pantalla_debate.dart';
|
||||||
@@ -62,7 +63,8 @@ class _PantallaResultadoState extends State<PantallaResultado>
|
|||||||
title: Text(l10n.result),
|
title: Text(l10n.result),
|
||||||
automaticallyImplyLeading: false,
|
automaticallyImplyLeading: false,
|
||||||
),
|
),
|
||||||
body: Center(
|
body: FondoFarolero(
|
||||||
|
child: Center(
|
||||||
child: SingleChildScrollView(
|
child: SingleChildScrollView(
|
||||||
padding: const EdgeInsets.all(32),
|
padding: const EdgeInsets.all(32),
|
||||||
child: Column(
|
child: Column(
|
||||||
@@ -175,6 +177,7 @@ class _PantallaResultadoState extends State<PantallaResultado>
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import '../modelos/inicio_partida_multijugador.dart';
|
|||||||
import '../modelos/usuario.dart';
|
import '../modelos/usuario.dart';
|
||||||
import '../servicios/servicio_nearby.dart';
|
import '../servicios/servicio_nearby.dart';
|
||||||
import '../servicios/servicio_permisos.dart';
|
import '../servicios/servicio_permisos.dart';
|
||||||
|
import '../tema/componentes_farolero.dart';
|
||||||
import '../tema/tema_app.dart';
|
import '../tema/tema_app.dart';
|
||||||
import 'pantalla_palabra_cliente.dart';
|
import 'pantalla_palabra_cliente.dart';
|
||||||
import 'pantalla_palabras_cliente.dart';
|
import 'pantalla_palabras_cliente.dart';
|
||||||
@@ -323,14 +324,19 @@ class _PantallaUnirseState extends State<PantallaUnirse> {
|
|||||||
Widget _buildFormularioNombre(BuildContext context, AppLocalizations l10n) {
|
Widget _buildFormularioNombre(BuildContext context, AppLocalizations l10n) {
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
appBar: AppBar(title: Text(l10n.joinGameTitle)),
|
appBar: AppBar(title: Text(l10n.joinGameTitle)),
|
||||||
body: Padding(
|
body: FondoFarolero(
|
||||||
|
child: Padding(
|
||||||
padding: const EdgeInsets.all(32),
|
padding: const EdgeInsets.all(32),
|
||||||
child: Form(
|
child: Form(
|
||||||
key: _formKey,
|
key: _formKey,
|
||||||
child: Column(
|
child: Column(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
const Text('📱', style: TextStyle(fontSize: 64)),
|
const Icon(
|
||||||
|
Icons.bluetooth_searching,
|
||||||
|
color: TemaApp.colorAzul,
|
||||||
|
size: 70,
|
||||||
|
),
|
||||||
const SizedBox(height: 24),
|
const SizedBox(height: 24),
|
||||||
Text(
|
Text(
|
||||||
l10n.joinGameTitle,
|
l10n.joinGameTitle,
|
||||||
@@ -373,6 +379,7 @@ class _PantallaUnirseState extends State<PantallaUnirse> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -399,7 +406,8 @@ class _PantallaUnirseState extends State<PantallaUnirse> {
|
|||||||
},
|
},
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
body: Padding(
|
body: FondoFarolero(
|
||||||
|
child: Padding(
|
||||||
padding: const EdgeInsets.all(24),
|
padding: const EdgeInsets.all(24),
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
@@ -495,6 +503,7 @@ class _PantallaUnirseState extends State<PantallaUnirse> {
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -610,7 +619,8 @@ class _PantallaUnirseState extends State<PantallaUnirse> {
|
|||||||
},
|
},
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
body: SingleChildScrollView(
|
body: FondoFarolero(
|
||||||
|
child: SingleChildScrollView(
|
||||||
padding: const EdgeInsets.all(24),
|
padding: const EdgeInsets.all(24),
|
||||||
child: Column(
|
child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
@@ -679,6 +689,7 @@ class _PantallaUnirseState extends State<PantallaUnirse> {
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ import 'package:farolero/l10n/generated/app_localizations.dart';
|
|||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
import '../estado/estado_juego.dart';
|
import '../estado/estado_juego.dart';
|
||||||
import '../modelos/palabra.dart';
|
import '../modelos/palabra.dart';
|
||||||
|
import '../tema/componentes_farolero.dart';
|
||||||
import '../tema/tema_app.dart';
|
import '../tema/tema_app.dart';
|
||||||
import 'pantalla_debate.dart';
|
import 'pantalla_debate.dart';
|
||||||
|
|
||||||
@@ -31,7 +32,8 @@ class _PantallaVerPalabraState extends State<PantallaVerPalabra> {
|
|||||||
title: Text(l10n.seeYourWord),
|
title: Text(l10n.seeYourWord),
|
||||||
automaticallyImplyLeading: false,
|
automaticallyImplyLeading: false,
|
||||||
),
|
),
|
||||||
body: Padding(
|
body: FondoFarolero(
|
||||||
|
child: Padding(
|
||||||
padding: const EdgeInsets.all(16),
|
padding: const EdgeInsets.all(16),
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
@@ -111,6 +113,7 @@ class _PantallaVerPalabraState extends State<PantallaVerPalabra> {
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -169,7 +172,9 @@ class _PantallaRevelarPalabraState extends State<_PantallaRevelarPalabra> {
|
|||||||
|
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
appBar: AppBar(title: Text(widget.nombre)),
|
appBar: AppBar(title: Text(widget.nombre)),
|
||||||
body: Center(
|
body: FondoFarolero(
|
||||||
|
intenso: true,
|
||||||
|
child: Center(
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsets.all(32),
|
padding: const EdgeInsets.all(32),
|
||||||
child: Column(
|
child: Column(
|
||||||
@@ -225,17 +230,7 @@ class _PantallaRevelarPalabraState extends State<_PantallaRevelarPalabra> {
|
|||||||
),
|
),
|
||||||
if (!widget.esImpostor) ...[
|
if (!widget.esImpostor) ...[
|
||||||
const SizedBox(height: 12),
|
const SizedBox(height: 12),
|
||||||
Text(
|
TarjetaPalabraFarolero(palabra: widget.palabra),
|
||||||
widget.palabra,
|
|
||||||
style: Theme.of(context)
|
|
||||||
.textTheme
|
|
||||||
.headlineLarge
|
|
||||||
?.copyWith(
|
|
||||||
fontSize: 32,
|
|
||||||
color: Colors.white,
|
|
||||||
),
|
|
||||||
textAlign: TextAlign.center,
|
|
||||||
),
|
|
||||||
],
|
],
|
||||||
if (widget.esImpostor && widget.pistaActiva) ...[
|
if (widget.esImpostor && widget.pistaActiva) ...[
|
||||||
const SizedBox(height: 12),
|
const SizedBox(height: 12),
|
||||||
@@ -324,6 +319,7 @@ class _PantallaRevelarPalabraState extends State<_PantallaRevelarPalabra> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
|
|||||||
import 'package:farolero/l10n/generated/app_localizations.dart';
|
import 'package:farolero/l10n/generated/app_localizations.dart';
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
import '../estado/estado_juego.dart';
|
import '../estado/estado_juego.dart';
|
||||||
|
import '../tema/componentes_farolero.dart';
|
||||||
import '../tema/tema_app.dart';
|
import '../tema/tema_app.dart';
|
||||||
import 'pantalla_resultado.dart';
|
import 'pantalla_resultado.dart';
|
||||||
|
|
||||||
@@ -58,7 +59,8 @@ class _PantallaVotacionState extends State<PantallaVotacion> {
|
|||||||
title: Text(l10n.voting),
|
title: Text(l10n.voting),
|
||||||
automaticallyImplyLeading: false,
|
automaticallyImplyLeading: false,
|
||||||
),
|
),
|
||||||
body: Padding(
|
body: FondoFarolero(
|
||||||
|
child: Padding(
|
||||||
padding: const EdgeInsets.all(16),
|
padding: const EdgeInsets.all(16),
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
@@ -163,6 +165,7 @@ class _PantallaVotacionState extends State<PantallaVotacion> {
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -174,7 +177,8 @@ class _PantallaVotacionState extends State<PantallaVotacion> {
|
|||||||
title: Text(l10n.votingComplete),
|
title: Text(l10n.votingComplete),
|
||||||
automaticallyImplyLeading: false,
|
automaticallyImplyLeading: false,
|
||||||
),
|
),
|
||||||
body: Center(
|
body: FondoFarolero(
|
||||||
|
child: Center(
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsets.all(32),
|
padding: const EdgeInsets.all(32),
|
||||||
child: Column(
|
child: Column(
|
||||||
@@ -216,6 +220,7 @@ class _PantallaVotacionState extends State<PantallaVotacion> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,426 @@
|
|||||||
|
import 'dart:math' as math;
|
||||||
|
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:google_fonts/google_fonts.dart';
|
||||||
|
|
||||||
|
import 'tema_app.dart';
|
||||||
|
|
||||||
|
class FondoFarolero extends StatelessWidget {
|
||||||
|
final Widget child;
|
||||||
|
final bool intenso;
|
||||||
|
|
||||||
|
const FondoFarolero({
|
||||||
|
super.key,
|
||||||
|
required this.child,
|
||||||
|
this.intenso = false,
|
||||||
|
});
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return DecoratedBox(
|
||||||
|
decoration: const BoxDecoration(gradient: TemaApp.gradienteFondo),
|
||||||
|
child: CustomPaint(
|
||||||
|
painter: _FondoFaroleroPainter(intenso: intenso),
|
||||||
|
child: child,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class PanelFarolero extends StatelessWidget {
|
||||||
|
final Widget child;
|
||||||
|
final EdgeInsetsGeometry padding;
|
||||||
|
final EdgeInsetsGeometry? margin;
|
||||||
|
final Color? color;
|
||||||
|
final Color? borderColor;
|
||||||
|
|
||||||
|
const PanelFarolero({
|
||||||
|
super.key,
|
||||||
|
required this.child,
|
||||||
|
this.padding = const EdgeInsets.all(16),
|
||||||
|
this.margin,
|
||||||
|
this.color,
|
||||||
|
this.borderColor,
|
||||||
|
});
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Container(
|
||||||
|
width: double.infinity,
|
||||||
|
margin: margin,
|
||||||
|
padding: padding,
|
||||||
|
decoration: TemaApp.decoracionPanel(color: color, borderColor: borderColor),
|
||||||
|
child: child,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class LogoFarolero extends StatelessWidget {
|
||||||
|
final double size;
|
||||||
|
|
||||||
|
const LogoFarolero({super.key, this.size = 64});
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Stack(
|
||||||
|
alignment: Alignment.center,
|
||||||
|
children: [
|
||||||
|
Positioned(
|
||||||
|
top: 0,
|
||||||
|
child: Icon(
|
||||||
|
Icons.lightbulb,
|
||||||
|
color: TemaApp.colorDorado.withValues(alpha: 0.32),
|
||||||
|
size: size * 0.82,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
'FAROLERO',
|
||||||
|
style: GoogleFonts.bangers(
|
||||||
|
fontSize: size,
|
||||||
|
color: TemaApp.colorNaranja,
|
||||||
|
letterSpacing: 0,
|
||||||
|
shadows: const [
|
||||||
|
Shadow(offset: Offset(3, 4), blurRadius: 0, color: Color(0xFF5E1205)),
|
||||||
|
Shadow(offset: Offset(0, 0), blurRadius: 16, color: Color(0xFFFFC247)),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class BotonFarolero extends StatelessWidget {
|
||||||
|
final String texto;
|
||||||
|
final IconData icono;
|
||||||
|
final VoidCallback? onPressed;
|
||||||
|
final LinearGradient gradient;
|
||||||
|
final Color foreground;
|
||||||
|
|
||||||
|
const BotonFarolero({
|
||||||
|
super.key,
|
||||||
|
required this.texto,
|
||||||
|
required this.icono,
|
||||||
|
required this.onPressed,
|
||||||
|
this.gradient = TemaApp.gradientePrimario,
|
||||||
|
this.foreground = Colors.black,
|
||||||
|
});
|
||||||
|
|
||||||
|
const BotonFarolero.secundario({
|
||||||
|
super.key,
|
||||||
|
required this.texto,
|
||||||
|
required this.icono,
|
||||||
|
required this.onPressed,
|
||||||
|
}) : gradient = const LinearGradient(
|
||||||
|
colors: [TemaApp.colorPurpura, Color(0xFF2B1736)],
|
||||||
|
begin: Alignment.topCenter,
|
||||||
|
end: Alignment.bottomCenter,
|
||||||
|
),
|
||||||
|
foreground = Colors.white;
|
||||||
|
|
||||||
|
const BotonFarolero.oscuro({
|
||||||
|
super.key,
|
||||||
|
required this.texto,
|
||||||
|
required this.icono,
|
||||||
|
required this.onPressed,
|
||||||
|
}) : gradient = const LinearGradient(
|
||||||
|
colors: [Color(0xFF151F27), Color(0xFF090E13)],
|
||||||
|
begin: Alignment.topCenter,
|
||||||
|
end: Alignment.bottomCenter,
|
||||||
|
),
|
||||||
|
foreground = TemaApp.colorTexto;
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
final habilitado = onPressed != null;
|
||||||
|
|
||||||
|
return Material(
|
||||||
|
color: Colors.transparent,
|
||||||
|
child: InkWell(
|
||||||
|
borderRadius: BorderRadius.circular(8),
|
||||||
|
onTap: onPressed,
|
||||||
|
child: Ink(
|
||||||
|
height: 54,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
gradient: habilitado
|
||||||
|
? gradient
|
||||||
|
: const LinearGradient(
|
||||||
|
colors: [TemaApp.colorTarjeta, TemaApp.colorSuperficie],
|
||||||
|
),
|
||||||
|
borderRadius: BorderRadius.circular(8),
|
||||||
|
border: Border.all(
|
||||||
|
color: habilitado
|
||||||
|
? TemaApp.colorDorado.withValues(alpha: 0.74)
|
||||||
|
: TemaApp.colorBorde,
|
||||||
|
),
|
||||||
|
boxShadow: [
|
||||||
|
BoxShadow(
|
||||||
|
color: Colors.black.withValues(alpha: 0.34),
|
||||||
|
blurRadius: 14,
|
||||||
|
offset: const Offset(0, 8),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
child: Row(
|
||||||
|
children: [
|
||||||
|
SizedBox(
|
||||||
|
width: 58,
|
||||||
|
child: Icon(icono, color: foreground, size: 28),
|
||||||
|
),
|
||||||
|
Expanded(
|
||||||
|
child: Text(
|
||||||
|
texto.toUpperCase(),
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
style: Theme.of(context).textTheme.titleMedium?.copyWith(
|
||||||
|
color: foreground,
|
||||||
|
fontSize: 18,
|
||||||
|
fontWeight: FontWeight.w800,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const SizedBox(width: 58),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class AccesoFarolero extends StatelessWidget {
|
||||||
|
final String etiqueta;
|
||||||
|
final IconData icono;
|
||||||
|
final VoidCallback onPressed;
|
||||||
|
|
||||||
|
const AccesoFarolero({
|
||||||
|
super.key,
|
||||||
|
required this.etiqueta,
|
||||||
|
required this.icono,
|
||||||
|
required this.onPressed,
|
||||||
|
});
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Material(
|
||||||
|
color: Colors.transparent,
|
||||||
|
child: InkWell(
|
||||||
|
borderRadius: BorderRadius.circular(8),
|
||||||
|
onTap: onPressed,
|
||||||
|
child: Ink(
|
||||||
|
height: 66,
|
||||||
|
decoration: TemaApp.decoracionPanel(color: TemaApp.colorSuperficie),
|
||||||
|
child: Column(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
children: [
|
||||||
|
Icon(icono, color: TemaApp.colorNaranja, size: 22),
|
||||||
|
const SizedBox(height: 5),
|
||||||
|
Text(
|
||||||
|
etiqueta.toUpperCase(),
|
||||||
|
maxLines: 1,
|
||||||
|
overflow: TextOverflow.ellipsis,
|
||||||
|
style: Theme.of(context).textTheme.bodySmall?.copyWith(
|
||||||
|
color: TemaApp.colorDorado,
|
||||||
|
fontSize: 11,
|
||||||
|
fontWeight: FontWeight.w700,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class TarjetaPalabraFarolero extends StatelessWidget {
|
||||||
|
final String palabra;
|
||||||
|
|
||||||
|
const TarjetaPalabraFarolero({super.key, required this.palabra});
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Container(
|
||||||
|
width: double.infinity,
|
||||||
|
padding: const EdgeInsets.symmetric(horizontal: 18, vertical: 28),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: const Color(0xFFC48642),
|
||||||
|
borderRadius: BorderRadius.circular(8),
|
||||||
|
border: Border.all(color: const Color(0xFF6B3519), width: 2),
|
||||||
|
boxShadow: [
|
||||||
|
BoxShadow(
|
||||||
|
color: TemaApp.colorNaranja.withValues(alpha: 0.28),
|
||||||
|
blurRadius: 24,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
child: Text(
|
||||||
|
palabra.toUpperCase(),
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
style: GoogleFonts.oswald(
|
||||||
|
color: const Color(0xFF1B0C05),
|
||||||
|
fontSize: 42,
|
||||||
|
fontWeight: FontWeight.w900,
|
||||||
|
letterSpacing: 0,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class AvatarFarolero extends StatelessWidget {
|
||||||
|
final String texto;
|
||||||
|
final Color color;
|
||||||
|
final double size;
|
||||||
|
|
||||||
|
const AvatarFarolero({
|
||||||
|
super.key,
|
||||||
|
required this.texto,
|
||||||
|
this.color = TemaApp.colorNaranja,
|
||||||
|
this.size = 40,
|
||||||
|
});
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Container(
|
||||||
|
width: size,
|
||||||
|
height: size,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
shape: BoxShape.circle,
|
||||||
|
gradient: RadialGradient(
|
||||||
|
colors: [color.withValues(alpha: 0.9), TemaApp.colorSuperficie],
|
||||||
|
),
|
||||||
|
border: Border.all(color: TemaApp.colorDorado, width: 2),
|
||||||
|
),
|
||||||
|
child: Center(
|
||||||
|
child: Text(
|
||||||
|
texto,
|
||||||
|
style: TextStyle(
|
||||||
|
color: TemaApp.colorTexto,
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
fontSize: size * 0.36,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class _FondoFaroleroPainter extends CustomPainter {
|
||||||
|
final bool intenso;
|
||||||
|
|
||||||
|
const _FondoFaroleroPainter({required this.intenso});
|
||||||
|
|
||||||
|
@override
|
||||||
|
void paint(Canvas canvas, Size size) {
|
||||||
|
final paint = Paint()..isAntiAlias = true;
|
||||||
|
final alto = size.height;
|
||||||
|
final ancho = size.width;
|
||||||
|
|
||||||
|
paint.color = const Color(0xFF152845).withValues(alpha: intenso ? 0.34 : 0.22);
|
||||||
|
canvas.drawCircle(Offset(ancho * 0.78, alto * 0.16), 18, paint);
|
||||||
|
|
||||||
|
paint.color = const Color(0xFF07101A).withValues(alpha: 0.82);
|
||||||
|
final colinas = Path()
|
||||||
|
..moveTo(0, alto * 0.34)
|
||||||
|
..quadraticBezierTo(ancho * 0.28, alto * 0.21, ancho * 0.55, alto * 0.33)
|
||||||
|
..quadraticBezierTo(ancho * 0.82, alto * 0.43, ancho, alto * 0.26)
|
||||||
|
..lineTo(ancho, alto)
|
||||||
|
..lineTo(0, alto)
|
||||||
|
..close();
|
||||||
|
canvas.drawPath(colinas, paint);
|
||||||
|
|
||||||
|
_dibujarCasas(canvas, size, paint);
|
||||||
|
_dibujarFarol(canvas, size, paint);
|
||||||
|
|
||||||
|
paint.shader = RadialGradient(
|
||||||
|
colors: [
|
||||||
|
TemaApp.colorNaranja.withValues(alpha: intenso ? 0.26 : 0.16),
|
||||||
|
Colors.transparent,
|
||||||
|
],
|
||||||
|
).createShader(Rect.fromCircle(center: Offset(ancho * 0.52, alto * 0.36), radius: 160));
|
||||||
|
canvas.drawCircle(Offset(ancho * 0.52, alto * 0.36), 160, paint);
|
||||||
|
paint.shader = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
void _dibujarCasas(Canvas canvas, Size size, Paint paint) {
|
||||||
|
final alto = size.height;
|
||||||
|
final ancho = size.width;
|
||||||
|
paint.color = const Color(0xFF020407).withValues(alpha: 0.72);
|
||||||
|
|
||||||
|
for (var i = 0; i < 5; i++) {
|
||||||
|
final w = ancho * (0.16 + i * 0.018);
|
||||||
|
final h = alto * (0.18 + (i % 2) * 0.05);
|
||||||
|
final x = -30 + i * ancho * 0.24;
|
||||||
|
final y = alto * (0.72 - i * 0.02);
|
||||||
|
final casa = Rect.fromLTWH(x, y - h, w, h);
|
||||||
|
canvas.drawRect(casa, paint);
|
||||||
|
final tejado = Path()
|
||||||
|
..moveTo(x - 8, y - h)
|
||||||
|
..lineTo(x + w * 0.48, y - h - 38)
|
||||||
|
..lineTo(x + w + 8, y - h)
|
||||||
|
..close();
|
||||||
|
canvas.drawPath(tejado, paint);
|
||||||
|
|
||||||
|
final ventana = Paint()
|
||||||
|
..color = TemaApp.colorNaranja.withValues(alpha: 0.38)
|
||||||
|
..isAntiAlias = true;
|
||||||
|
for (var j = 0; j < 2; j++) {
|
||||||
|
canvas.drawRRect(
|
||||||
|
RRect.fromRectAndRadius(
|
||||||
|
Rect.fromLTWH(x + 18 + j * 34, y - h + 36, 12, 22),
|
||||||
|
const Radius.circular(2),
|
||||||
|
),
|
||||||
|
ventana,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void _dibujarFarol(Canvas canvas, Size size, Paint paint) {
|
||||||
|
final alto = size.height;
|
||||||
|
final ancho = size.width;
|
||||||
|
final centro = Offset(ancho * 0.5, alto * 0.28);
|
||||||
|
final glow = Paint()
|
||||||
|
..shader = RadialGradient(
|
||||||
|
colors: [
|
||||||
|
TemaApp.colorNaranja.withValues(alpha: 0.44),
|
||||||
|
Colors.transparent,
|
||||||
|
],
|
||||||
|
).createShader(Rect.fromCircle(center: centro, radius: 92));
|
||||||
|
canvas.drawCircle(centro, 92, glow);
|
||||||
|
|
||||||
|
paint
|
||||||
|
..shader = null
|
||||||
|
..style = PaintingStyle.stroke
|
||||||
|
..strokeWidth = 3
|
||||||
|
..color = const Color(0xFF050507).withValues(alpha: 0.82);
|
||||||
|
canvas.drawArc(
|
||||||
|
Rect.fromCircle(center: centro.translate(0, -16), radius: 35),
|
||||||
|
math.pi,
|
||||||
|
math.pi,
|
||||||
|
false,
|
||||||
|
paint,
|
||||||
|
);
|
||||||
|
paint.style = PaintingStyle.fill;
|
||||||
|
canvas.drawRRect(
|
||||||
|
RRect.fromRectAndRadius(
|
||||||
|
Rect.fromCenter(center: centro, width: 38, height: 54),
|
||||||
|
const Radius.circular(5),
|
||||||
|
),
|
||||||
|
paint,
|
||||||
|
);
|
||||||
|
paint.color = TemaApp.colorNaranja.withValues(alpha: 0.82);
|
||||||
|
canvas.drawRRect(
|
||||||
|
RRect.fromRectAndRadius(
|
||||||
|
Rect.fromCenter(center: centro, width: 21, height: 34),
|
||||||
|
const Radius.circular(4),
|
||||||
|
),
|
||||||
|
paint,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
bool shouldRepaint(covariant _FondoFaroleroPainter oldDelegate) {
|
||||||
|
return oldDelegate.intenso != intenso;
|
||||||
|
}
|
||||||
|
}
|
||||||
+138
-40
@@ -2,114 +2,212 @@ import 'package:flutter/material.dart';
|
|||||||
import 'package:google_fonts/google_fonts.dart';
|
import 'package:google_fonts/google_fonts.dart';
|
||||||
|
|
||||||
class TemaApp {
|
class TemaApp {
|
||||||
static const colorFondo = Color(0xFF121212);
|
static const colorFondo = Color(0xFF05080D);
|
||||||
static const colorSuperficie = Color(0xFF1E1E1E);
|
static const colorFondoAzul = Color(0xFF0A1520);
|
||||||
static const colorTarjeta = Color(0xFF2A2A2A);
|
static const colorSuperficie = Color(0xFF0D151C);
|
||||||
static const colorAcento = Color(0xFFE53935); // Rojo impostor
|
static const colorTarjeta = Color(0xFF121B23);
|
||||||
static const colorAcentoClaro = Color(0xFFFF6F61);
|
static const colorBorde = Color(0xFF263947);
|
||||||
static const colorNaranja = Color(0xFFFF9800);
|
static const colorAcento = Color(0xFFC02824);
|
||||||
static const colorVerde = Color(0xFF4CAF50);
|
static const colorAcentoClaro = Color(0xFFF06A1A);
|
||||||
|
static const colorNaranja = Color(0xFFF49A13);
|
||||||
|
static const colorDorado = Color(0xFFFFCE55);
|
||||||
|
static const colorPurpura = Color(0xFF65306E);
|
||||||
|
static const colorAzul = Color(0xFF235BCE);
|
||||||
|
static const colorVerde = Color(0xFF61B944);
|
||||||
static const colorTexto = Color(0xFFFFFFFF);
|
static const colorTexto = Color(0xFFFFFFFF);
|
||||||
static const colorTextoSecundario = Color(0xFFB0B0B0);
|
static const colorTextoSecundario = Color(0xFFC2B9AA);
|
||||||
|
|
||||||
|
static const gradientePrimario = LinearGradient(
|
||||||
|
colors: [Color(0xFFFFB11A), Color(0xFFE87A08)],
|
||||||
|
begin: Alignment.topCenter,
|
||||||
|
end: Alignment.bottomCenter,
|
||||||
|
);
|
||||||
|
|
||||||
|
static const gradientePeligro = LinearGradient(
|
||||||
|
colors: [Color(0xFFC02824), Color(0xFF741112)],
|
||||||
|
begin: Alignment.topCenter,
|
||||||
|
end: Alignment.bottomCenter,
|
||||||
|
);
|
||||||
|
|
||||||
|
static const gradienteFondo = LinearGradient(
|
||||||
|
colors: [Color(0xFF09131E), Color(0xFF030507)],
|
||||||
|
begin: Alignment.topCenter,
|
||||||
|
end: Alignment.bottomCenter,
|
||||||
|
);
|
||||||
|
|
||||||
static ThemeData obtenerTema() {
|
static ThemeData obtenerTema() {
|
||||||
|
final base = ThemeData.dark(useMaterial3: true);
|
||||||
|
final cuerpo = GoogleFonts.robotoCondensedTextTheme(base.textTheme);
|
||||||
|
|
||||||
return ThemeData(
|
return ThemeData(
|
||||||
useMaterial3: true,
|
useMaterial3: true,
|
||||||
brightness: Brightness.dark,
|
brightness: Brightness.dark,
|
||||||
scaffoldBackgroundColor: colorFondo,
|
scaffoldBackgroundColor: colorFondo,
|
||||||
colorScheme: const ColorScheme.dark(
|
colorScheme: const ColorScheme.dark(
|
||||||
primary: colorAcento,
|
primary: colorNaranja,
|
||||||
secondary: colorNaranja,
|
secondary: colorNaranja,
|
||||||
surface: colorSuperficie,
|
surface: colorSuperficie,
|
||||||
error: colorAcento,
|
error: colorAcento,
|
||||||
|
onPrimary: Colors.black,
|
||||||
|
onSurface: colorTexto,
|
||||||
),
|
),
|
||||||
textTheme: GoogleFonts.poppinsTextTheme(
|
textTheme: cuerpo.copyWith(
|
||||||
const TextTheme(
|
|
||||||
headlineLarge: TextStyle(
|
headlineLarge: TextStyle(
|
||||||
|
fontFamily: GoogleFonts.oswald().fontFamily,
|
||||||
color: colorTexto,
|
color: colorTexto,
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
fontSize: 28,
|
fontSize: 30,
|
||||||
|
letterSpacing: 0,
|
||||||
),
|
),
|
||||||
headlineMedium: TextStyle(
|
headlineMedium: TextStyle(
|
||||||
|
fontFamily: GoogleFonts.oswald().fontFamily,
|
||||||
color: colorTexto,
|
color: colorTexto,
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
fontSize: 22,
|
fontSize: 22,
|
||||||
|
letterSpacing: 0,
|
||||||
),
|
),
|
||||||
titleLarge: TextStyle(
|
titleLarge: TextStyle(
|
||||||
color: colorTexto,
|
fontFamily: GoogleFonts.oswald().fontFamily,
|
||||||
fontWeight: FontWeight.w600,
|
color: colorDorado,
|
||||||
|
fontWeight: FontWeight.w700,
|
||||||
fontSize: 18,
|
fontSize: 18,
|
||||||
|
letterSpacing: 0,
|
||||||
),
|
),
|
||||||
titleMedium: TextStyle(
|
titleMedium: TextStyle(
|
||||||
|
fontFamily: GoogleFonts.oswald().fontFamily,
|
||||||
color: colorTexto,
|
color: colorTexto,
|
||||||
fontWeight: FontWeight.w500,
|
fontWeight: FontWeight.w600,
|
||||||
fontSize: 16,
|
fontSize: 16,
|
||||||
|
letterSpacing: 0,
|
||||||
),
|
),
|
||||||
bodyLarge: TextStyle(color: colorTexto, fontSize: 16),
|
bodyLarge: const TextStyle(color: colorTexto, fontSize: 16),
|
||||||
bodyMedium: TextStyle(color: colorTextoSecundario, fontSize: 14),
|
bodyMedium: const TextStyle(color: colorTextoSecundario, fontSize: 14),
|
||||||
),
|
bodySmall: const TextStyle(color: colorTextoSecundario, fontSize: 12),
|
||||||
),
|
),
|
||||||
cardTheme: CardThemeData(
|
cardTheme: CardThemeData(
|
||||||
color: colorTarjeta,
|
color: colorTarjeta.withValues(alpha: 0.82),
|
||||||
elevation: 4,
|
elevation: 0,
|
||||||
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(16)),
|
margin: EdgeInsets.zero,
|
||||||
|
shape: RoundedRectangleBorder(
|
||||||
|
borderRadius: BorderRadius.circular(8),
|
||||||
|
side: const BorderSide(color: colorBorde),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
elevatedButtonTheme: ElevatedButtonThemeData(
|
elevatedButtonTheme: ElevatedButtonThemeData(
|
||||||
style: ElevatedButton.styleFrom(
|
style: ElevatedButton.styleFrom(
|
||||||
backgroundColor: colorAcento,
|
backgroundColor: colorNaranja,
|
||||||
foregroundColor: colorTexto,
|
foregroundColor: Colors.black,
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 32, vertical: 16),
|
disabledBackgroundColor: colorTarjeta,
|
||||||
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(12)),
|
disabledForegroundColor: colorTextoSecundario,
|
||||||
textStyle: GoogleFonts.poppins(
|
padding: const EdgeInsets.symmetric(horizontal: 24, vertical: 15),
|
||||||
fontWeight: FontWeight.w600,
|
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(8)),
|
||||||
|
textStyle: GoogleFonts.oswald(
|
||||||
|
fontWeight: FontWeight.w700,
|
||||||
fontSize: 16,
|
fontSize: 16,
|
||||||
|
letterSpacing: 0,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
outlinedButtonTheme: OutlinedButtonThemeData(
|
outlinedButtonTheme: OutlinedButtonThemeData(
|
||||||
style: OutlinedButton.styleFrom(
|
style: OutlinedButton.styleFrom(
|
||||||
foregroundColor: colorTexto,
|
foregroundColor: colorTexto,
|
||||||
side: const BorderSide(color: colorAcento),
|
side: const BorderSide(color: colorBorde),
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 32, vertical: 16),
|
padding: const EdgeInsets.symmetric(horizontal: 24, vertical: 15),
|
||||||
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(12)),
|
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(8)),
|
||||||
|
textStyle: GoogleFonts.oswald(
|
||||||
|
fontWeight: FontWeight.w700,
|
||||||
|
fontSize: 16,
|
||||||
|
letterSpacing: 0,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
inputDecorationTheme: InputDecorationTheme(
|
inputDecorationTheme: InputDecorationTheme(
|
||||||
filled: true,
|
filled: true,
|
||||||
fillColor: colorTarjeta,
|
fillColor: const Color(0xFF0B1117),
|
||||||
border: OutlineInputBorder(
|
border: OutlineInputBorder(
|
||||||
borderRadius: BorderRadius.circular(12),
|
borderRadius: BorderRadius.circular(8),
|
||||||
borderSide: BorderSide.none,
|
borderSide: const BorderSide(color: colorBorde),
|
||||||
|
),
|
||||||
|
enabledBorder: OutlineInputBorder(
|
||||||
|
borderRadius: BorderRadius.circular(8),
|
||||||
|
borderSide: const BorderSide(color: colorBorde),
|
||||||
),
|
),
|
||||||
focusedBorder: OutlineInputBorder(
|
focusedBorder: OutlineInputBorder(
|
||||||
borderRadius: BorderRadius.circular(12),
|
borderRadius: BorderRadius.circular(8),
|
||||||
borderSide: const BorderSide(color: colorAcento),
|
borderSide: const BorderSide(color: colorNaranja),
|
||||||
),
|
),
|
||||||
labelStyle: const TextStyle(color: colorTextoSecundario),
|
labelStyle: const TextStyle(color: colorTextoSecundario),
|
||||||
hintStyle: const TextStyle(color: colorTextoSecundario),
|
hintStyle: const TextStyle(color: colorTextoSecundario),
|
||||||
),
|
),
|
||||||
appBarTheme: AppBarTheme(
|
appBarTheme: AppBarTheme(
|
||||||
backgroundColor: colorFondo,
|
backgroundColor: colorFondo,
|
||||||
foregroundColor: colorTexto,
|
foregroundColor: colorNaranja,
|
||||||
|
centerTitle: true,
|
||||||
elevation: 0,
|
elevation: 0,
|
||||||
titleTextStyle: GoogleFonts.poppins(
|
titleTextStyle: GoogleFonts.oswald(
|
||||||
color: colorTexto,
|
color: colorDorado,
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
fontSize: 20,
|
fontSize: 20,
|
||||||
|
letterSpacing: 0,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
dividerTheme: const DividerThemeData(color: colorBorde, thickness: 1),
|
||||||
|
listTileTheme: const ListTileThemeData(
|
||||||
|
iconColor: colorNaranja,
|
||||||
|
textColor: colorTexto,
|
||||||
|
subtitleTextStyle: TextStyle(color: colorTextoSecundario),
|
||||||
|
),
|
||||||
|
segmentedButtonTheme: SegmentedButtonThemeData(
|
||||||
|
style: ButtonStyle(
|
||||||
|
backgroundColor: WidgetStateProperty.resolveWith((states) {
|
||||||
|
if (states.contains(WidgetState.selected)) return colorNaranja;
|
||||||
|
return colorSuperficie;
|
||||||
|
}),
|
||||||
|
foregroundColor: WidgetStateProperty.resolveWith((states) {
|
||||||
|
if (states.contains(WidgetState.selected)) return Colors.black;
|
||||||
|
return colorTexto;
|
||||||
|
}),
|
||||||
|
side: const WidgetStatePropertyAll(BorderSide(color: colorBorde)),
|
||||||
|
shape: WidgetStatePropertyAll(
|
||||||
|
RoundedRectangleBorder(borderRadius: BorderRadius.circular(8)),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
switchTheme: SwitchThemeData(
|
switchTheme: SwitchThemeData(
|
||||||
thumbColor: WidgetStateProperty.resolveWith((states) {
|
thumbColor: WidgetStateProperty.resolveWith((states) {
|
||||||
if (states.contains(WidgetState.selected)) return colorAcento;
|
if (states.contains(WidgetState.selected)) return colorNaranja;
|
||||||
return colorTextoSecundario;
|
return colorTextoSecundario;
|
||||||
}),
|
}),
|
||||||
trackColor: WidgetStateProperty.resolveWith((states) {
|
trackColor: WidgetStateProperty.resolveWith((states) {
|
||||||
if (states.contains(WidgetState.selected)) {
|
if (states.contains(WidgetState.selected)) {
|
||||||
return colorAcento.withValues(alpha: 0.5);
|
return colorNaranja.withValues(alpha: 0.5);
|
||||||
}
|
}
|
||||||
return colorTarjeta;
|
return colorTarjeta;
|
||||||
}),
|
}),
|
||||||
),
|
),
|
||||||
|
snackBarTheme: SnackBarThemeData(
|
||||||
|
backgroundColor: colorTarjeta,
|
||||||
|
contentTextStyle: cuerpo.bodyMedium?.copyWith(color: colorTexto),
|
||||||
|
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(8)),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
static BoxDecoration decoracionPanel({
|
||||||
|
Color? color,
|
||||||
|
Color? borderColor,
|
||||||
|
}) {
|
||||||
|
return BoxDecoration(
|
||||||
|
color: color ?? colorTarjeta.withValues(alpha: 0.84),
|
||||||
|
borderRadius: BorderRadius.circular(8),
|
||||||
|
border: Border.all(color: borderColor ?? colorBorde),
|
||||||
|
boxShadow: [
|
||||||
|
BoxShadow(
|
||||||
|
color: Colors.black.withValues(alpha: 0.35),
|
||||||
|
blurRadius: 18,
|
||||||
|
offset: const Offset(0, 10),
|
||||||
|
),
|
||||||
|
],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,6 +4,6 @@ import 'package:farolero/main.dart';
|
|||||||
void main() {
|
void main() {
|
||||||
testWidgets('App carga correctamente', (WidgetTester tester) async {
|
testWidgets('App carga correctamente', (WidgetTester tester) async {
|
||||||
await tester.pumpWidget(const FaroleroApp());
|
await tester.pumpWidget(const FaroleroApp());
|
||||||
expect(find.text('El Impostor'), findsOneWidget);
|
expect(find.text('FAROLERO'), findsOneWidget);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user