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:
co-authored by
Claude Sonnet 4.6
parent
bfa494b7fe
commit
8372e19d9f
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user