fix: soporte visible + perfil con vinculacion de correo

- Setting.fromDocument con valores por defecto (null-safe)
- SettingsProvider crea Setting vacio si el backend falla
- support_view: guard para settings null
- profile_view: seccion 'Acceso con correo' con toggle,
  campos email/password/confirmar, envia OTP, verifica codigo

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Lizandro Guarnizo
2026-06-27 09:34:39 -05:00
co-authored by Claude Sonnet 4.6
parent bfa494b7fe
commit 8372e19d9f
4 changed files with 341 additions and 55 deletions
+4 -1
View File
@@ -14,10 +14,13 @@ class SettingsProvider extends ChangeNotifier {
getSettings() async {
try {
final data = await _api.get('/settings');
settings = Setting.fromDocument(data as Map<String, dynamic>);
if (data != null) {
settings = Setting.fromDocument(data as Map<String, dynamic>);
}
} catch (e) {
print('Error obteniendo los settings: $e');
} finally {
settings ??= Setting.fromDocument({});
isLoading = false;
notifyListeners();
}