feat: perfil BD, historial sesiones, UX login y config Android
- Perfil conectado a BD: nombre real, edición con iniciales auto - Historial de sesiones: nueva página con duración y badge activa - Ayuda y soporte navega a MensajeriaPage - InicioPage: nombre real desde BD, click avatar → tab perfil - Login: foco automático, Enter = ingresar, click card = foco - ApplicationId: net.siaxsystem.sentinelone en todos los manifests - Linux: libsqlite3-dev requerido en CMakeLists, error amigable en app - BD ruta Linux corregida a ~/.local/share/sentinel_one/ Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 4.6
parent
1184ab5fe2
commit
3e2294faf6
@@ -1,6 +1,7 @@
|
||||
import 'dart:async';
|
||||
import 'package:flutter/material.dart';
|
||||
import '../theme.dart';
|
||||
import '../db/dao/usuarios_dao.dart';
|
||||
import 'mensageria_page.dart';
|
||||
|
||||
// ─── Datos del banner ─────────────────────────────────────────────────────────
|
||||
@@ -106,7 +107,8 @@ const _eventos = [
|
||||
|
||||
// ─── Página ───────────────────────────────────────────────────────────────────
|
||||
class InicioPage extends StatefulWidget {
|
||||
const InicioPage({Key? key}) : super(key: key);
|
||||
final VoidCallback? onGoToPerfil;
|
||||
const InicioPage({Key? key, this.onGoToPerfil}) : super(key: key);
|
||||
|
||||
@override
|
||||
State<InicioPage> createState() => _InicioPageState();
|
||||
@@ -118,6 +120,17 @@ class _InicioPageState extends State<InicioPage>
|
||||
final _pageController = PageController();
|
||||
Timer? _bannerTimer;
|
||||
|
||||
String _nombreUsuario = 'Usuario';
|
||||
|
||||
Future<void> _cargarUsuario() async {
|
||||
try {
|
||||
final u = await UsuariosDao().getById(1);
|
||||
if (mounted && u != null) {
|
||||
setState(() => _nombreUsuario = u.nombre);
|
||||
}
|
||||
} catch (_) {}
|
||||
}
|
||||
|
||||
late final AnimationController _panicCtrl;
|
||||
late final Animation<double> _pingScale;
|
||||
late final Animation<double> _pingOpacity;
|
||||
@@ -125,6 +138,7 @@ class _InicioPageState extends State<InicioPage>
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
_cargarUsuario();
|
||||
// Auto-avance del banner cada 4 segundos
|
||||
_bannerTimer = Timer.periodic(const Duration(seconds: 4), (_) {
|
||||
final next = (_bannerPage + 1) % _banners.length;
|
||||
@@ -194,14 +208,16 @@ class _InicioPageState extends State<InicioPage>
|
||||
style:
|
||||
appLabel(size: 11, color: AppColors.onSurfaceVariant)),
|
||||
const SizedBox(height: 2),
|
||||
Text('Juan Díaz',
|
||||
Text(_nombreUsuario,
|
||||
style: appHeadline(
|
||||
size: 20,
|
||||
weight: FontWeight.w800,
|
||||
color: AppColors.onSurface)),
|
||||
]),
|
||||
// Avatar
|
||||
Stack(clipBehavior: Clip.none, children: [
|
||||
// Avatar — click navega al perfil
|
||||
GestureDetector(
|
||||
onTap: widget.onGoToPerfil,
|
||||
child: Stack(clipBehavior: Clip.none, children: [
|
||||
Container(
|
||||
width: 52,
|
||||
height: 52,
|
||||
@@ -233,6 +249,7 @@ class _InicioPageState extends State<InicioPage>
|
||||
),
|
||||
),
|
||||
]),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
|
||||
Reference in New Issue
Block a user