Gestión de usuarios y avatares en la aplicación. Gestión de traducciones de las palabras.
This commit is contained in:
@@ -1,9 +1,12 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:farolero/l10n/generated/app_localizations.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import '../servicios/servicio_perfil_usuario.dart';
|
||||
import '../tema/componentes_farolero.dart';
|
||||
import '../tema/tema_app.dart';
|
||||
import 'pantalla_ajustes.dart';
|
||||
import 'pantalla_crear_partida.dart';
|
||||
import 'pantalla_historial.dart';
|
||||
import 'pantalla_reglas.dart';
|
||||
import 'pantalla_unirse.dart';
|
||||
|
||||
@@ -13,6 +16,7 @@ class PantallaPrincipal extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final l10n = AppLocalizations.of(context)!;
|
||||
final perfil = context.watch<ServicioPerfilUsuario>().perfil;
|
||||
|
||||
return Scaffold(
|
||||
body: FondoFarolero(
|
||||
@@ -27,18 +31,22 @@ class PantallaPrincipal extends StatelessWidget {
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
const AvatarFarolero(texto: 'A', size: 48),
|
||||
AvatarFarolero(
|
||||
texto: perfil.nombre.substring(0, 1).toUpperCase(),
|
||||
assetPath: perfil.avatarAsset,
|
||||
size: 48,
|
||||
),
|
||||
const SizedBox(width: 10),
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
'Alex',
|
||||
perfil.nombre,
|
||||
style: Theme.of(context).textTheme.titleMedium,
|
||||
),
|
||||
Text(
|
||||
'Nivel 12',
|
||||
'@${perfil.nick}',
|
||||
style: Theme.of(context).textTheme.bodySmall,
|
||||
),
|
||||
const SizedBox(height: 3),
|
||||
@@ -124,7 +132,14 @@ class PantallaPrincipal extends StatelessWidget {
|
||||
child: AccesoFarolero(
|
||||
etiqueta: 'Historial',
|
||||
icono: Icons.history,
|
||||
onPressed: () {},
|
||||
onPressed: () {
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (_) => const PantallaHistorial(),
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 8),
|
||||
|
||||
Reference in New Issue
Block a user