feat: foto de perfil seleccionable desde archivo

- file_picker ^4.6.1 — abre galería/archivos (en Android incluye cámara)
- BD v3: columna foto_path en usuarios, migración onUpgrade
- Usuario modelo: campo fotoPath + copyWith
- UsuariosDao: método updateFoto(id, path)
- PerfilUsuarioPage:
  · Avatar muestra foto si hay, iniciales si no
  · Toque en avatar o ícono cámara → FilePicker → guarda ruta en BD
  · Ícono editar nombre movido junto al texto del nombre

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Pablinux
2026-04-16 03:10:47 -05:00
co-authored by Claude Sonnet 4.6
parent f42467037d
commit 33f0b8aa29
5 changed files with 113 additions and 35 deletions
+7 -2
View File
@@ -5,7 +5,7 @@ import 'package:path/path.dart';
class DatabaseHelper {
static const _dbName = 'sentinel_one.db';
static const _dbVersion = 2;
static const _dbVersion = 3;
DatabaseHelper._();
static final DatabaseHelper instance = DatabaseHelper._();
@@ -67,7 +67,8 @@ class DatabaseHelper {
fecha_inicio TEXT,
fecha_fin TEXT,
activo INTEGER NOT NULL DEFAULT 1,
sincronizado INTEGER NOT NULL DEFAULT 0
sincronizado INTEGER NOT NULL DEFAULT 0,
foto_path TEXT
)
''');
@@ -210,6 +211,10 @@ class DatabaseHelper {
await _createTablesV2(db);
await _seedDataV2(db);
}
if (oldVersion < 3) {
await db.execute(
'ALTER TABLE usuarios ADD COLUMN foto_path TEXT');
}
}
Future<void> _createTablesV2(Database db) async {