más mejoras
This commit is contained in:
@@ -49,142 +49,154 @@ class _PantallaLobbyHostState extends State<PantallaLobbyHost> {
|
||||
),
|
||||
body: FondoFarolero(
|
||||
intenso: true,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(24),
|
||||
child: Column(
|
||||
children: [
|
||||
const _LobbySignalArt(),
|
||||
const SizedBox(height: 12),
|
||||
EncabezadoFarolero(
|
||||
icono: Icons.wifi_tethering,
|
||||
titulo: widget.nombreSala,
|
||||
subtitulo: l10n.scanToJoin,
|
||||
),
|
||||
const SizedBox(height: 14),
|
||||
PanelFarolero(
|
||||
padding: const EdgeInsets.fromLTRB(16, 18, 16, 16),
|
||||
child: Column(
|
||||
children: [
|
||||
SizedBox(
|
||||
width: 236,
|
||||
height: 236,
|
||||
child: Stack(
|
||||
alignment: Alignment.center,
|
||||
child: SafeArea(
|
||||
top: false,
|
||||
child: SingleChildScrollView(
|
||||
padding: const EdgeInsets.fromLTRB(20, 20, 20, 24),
|
||||
child: Center(
|
||||
child: ConstrainedBox(
|
||||
constraints: const BoxConstraints(maxWidth: 480),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: [
|
||||
const _LobbySignalArt(),
|
||||
const SizedBox(height: 12),
|
||||
EncabezadoFarolero(
|
||||
icono: Icons.wifi_tethering,
|
||||
titulo: widget.nombreSala,
|
||||
subtitulo: l10n.scanToJoin,
|
||||
),
|
||||
const SizedBox(height: 14),
|
||||
PanelFarolero(
|
||||
padding: const EdgeInsets.fromLTRB(18, 20, 18, 18),
|
||||
child: Column(
|
||||
children: [
|
||||
Positioned.fill(
|
||||
child: IgnorePointer(
|
||||
child: Image.asset(
|
||||
'assets/ui/generated/join_lobby/qr_frame.png',
|
||||
fit: BoxFit.contain,
|
||||
),
|
||||
),
|
||||
),
|
||||
Container(
|
||||
width: 178,
|
||||
height: 178,
|
||||
padding: const EdgeInsets.all(8),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: TemaApp.colorNaranja.withValues(alpha: 0.18),
|
||||
blurRadius: 24,
|
||||
SizedBox(
|
||||
width: 268,
|
||||
height: 268,
|
||||
child: Stack(
|
||||
alignment: Alignment.center,
|
||||
children: [
|
||||
Positioned.fill(
|
||||
child: IgnorePointer(
|
||||
child: Image.asset(
|
||||
'assets/ui/generated/join_lobby/qr_frame.png',
|
||||
fit: BoxFit.contain,
|
||||
),
|
||||
),
|
||||
),
|
||||
Container(
|
||||
width: 210,
|
||||
height: 210,
|
||||
padding: const EdgeInsets.all(14),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
borderRadius: BorderRadius.circular(16),
|
||||
border: Border.all(
|
||||
color: TemaApp.colorDorado.withValues(alpha: 0.42),
|
||||
width: 2,
|
||||
),
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: TemaApp.colorNaranja.withValues(alpha: 0.20),
|
||||
blurRadius: 24,
|
||||
),
|
||||
],
|
||||
),
|
||||
child: QrImageView(
|
||||
data: nearby.generarDatosQR(widget.nombreSala),
|
||||
version: QrVersions.auto,
|
||||
size: 182,
|
||||
backgroundColor: Colors.white,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
child: QrImageView(
|
||||
data: nearby.generarDatosQR(widget.nombreSala),
|
||||
version: QrVersions.auto,
|
||||
size: 162,
|
||||
backgroundColor: Colors.white,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
Text(
|
||||
l10n.scanThisCodeFromAnotherPhone,
|
||||
style: Theme.of(context).textTheme.bodyMedium,
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
Text(
|
||||
l10n.scanThisCodeFromAnotherPhone,
|
||||
style: Theme.of(context).textTheme.bodyMedium,
|
||||
textAlign: TextAlign.center,
|
||||
const SizedBox(height: 16),
|
||||
_buildResumenSala(
|
||||
context,
|
||||
l10n,
|
||||
seleccionados,
|
||||
nearby.jugadores.length,
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
Card(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(12),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: Text(
|
||||
l10n.gameUsers,
|
||||
style: Theme.of(context).textTheme.titleLarge,
|
||||
),
|
||||
),
|
||||
IconButton.filledTonal(
|
||||
onPressed: () => _crearNuevoUsuario(context),
|
||||
icon: const Icon(Icons.person_add),
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
if (usuarios.isEmpty)
|
||||
SizedBox(
|
||||
height: 96,
|
||||
child: Center(child: Text(l10n.waitingForPlayers)),
|
||||
)
|
||||
else
|
||||
ListView.builder(
|
||||
shrinkWrap: true,
|
||||
physics: const NeverScrollableScrollPhysics(),
|
||||
itemCount: usuarios.length,
|
||||
itemBuilder: (context, index) => _buildUsuarioTile(
|
||||
context,
|
||||
l10n,
|
||||
usuarios[index],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
if (!puedeIniciar)
|
||||
Text(
|
||||
_mensajeValidacion(validacionInicio?.codigo, l10n),
|
||||
style: Theme.of(context)
|
||||
.textTheme
|
||||
.bodyMedium
|
||||
?.copyWith(color: TemaApp.colorNaranja),
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
BotonFarolero(
|
||||
texto: _iniciando ? l10n.starting : l10n.startGame,
|
||||
icono: Icons.play_arrow,
|
||||
onPressed: puedeIniciar && !_iniciando
|
||||
? () {
|
||||
setState(() => _iniciando = true);
|
||||
widget.onIniciar();
|
||||
}
|
||||
: null,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
_buildResumenSala(
|
||||
context,
|
||||
l10n,
|
||||
seleccionados,
|
||||
nearby.jugadores.length,
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
Expanded(
|
||||
child: Card(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(12),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: Text(
|
||||
l10n.gameUsers,
|
||||
style: Theme.of(context).textTheme.titleLarge,
|
||||
),
|
||||
),
|
||||
IconButton.filledTonal(
|
||||
onPressed: () => _crearNuevoUsuario(context),
|
||||
icon: const Icon(Icons.person_add),
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
Expanded(
|
||||
child: usuarios.isEmpty
|
||||
? Center(child: Text(l10n.waitingForPlayers))
|
||||
: ListView.builder(
|
||||
itemCount: usuarios.length,
|
||||
itemBuilder: (context, index) =>
|
||||
_buildUsuarioTile(
|
||||
context,
|
||||
l10n,
|
||||
usuarios[index],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
if (!puedeIniciar)
|
||||
Text(
|
||||
_mensajeValidacion(validacionInicio?.codigo, l10n),
|
||||
style: Theme.of(context)
|
||||
.textTheme
|
||||
.bodyMedium
|
||||
?.copyWith(color: TemaApp.colorNaranja),
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
SizedBox(
|
||||
width: double.infinity,
|
||||
child: BotonFarolero(
|
||||
texto: _iniciando ? l10n.starting : l10n.startGame,
|
||||
icono: Icons.play_arrow,
|
||||
onPressed: puedeIniciar && !_iniciando
|
||||
? () {
|
||||
setState(() => _iniciando = true);
|
||||
widget.onIniciar();
|
||||
}
|
||||
: null,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -276,8 +288,10 @@ class _PantallaLobbyHostState extends State<PantallaLobbyHost> {
|
||||
usuario.estaSeleccionado && usuario.clienteIdSeleccionado != miClientId;
|
||||
|
||||
return ListTile(
|
||||
leading: CircleAvatar(
|
||||
backgroundColor: Colors.transparent,
|
||||
minLeadingWidth: 58,
|
||||
leading: SizedBox(
|
||||
width: 58,
|
||||
height: 58,
|
||||
child: AvatarFarolero(
|
||||
texto: usuario.nombre.isEmpty ? '?' : usuario.nombre[0],
|
||||
assetPath: usuario.avatar,
|
||||
@@ -286,7 +300,7 @@ class _PantallaLobbyHostState extends State<PantallaLobbyHost> {
|
||||
: seleccionadoPorOtro
|
||||
? TemaApp.colorNaranja
|
||||
: TemaApp.colorAzul,
|
||||
size: 38,
|
||||
size: 48,
|
||||
fuego: usuario.fuego,
|
||||
medallas: usuario.medallas,
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user