- Navbar: hoverColor tenue por tema (azul/blanco) en vez del gris por defecto de Flutter web - SettingsProvider: lazy:false + timeout 10s para evitar spinner gris permanente en soporte - SupportView: muestra contenido con defaults inmediatamente sin bloquear en isLoading - Modelo Profesional: campos rethus_code y rethus_validated - ProfessionalFormProvider: soporte para rethus_code en copyProfesionalWith - RequestProfessionalView: campo RETHUS opcional en formulario + fix color dropdown profesión Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
29 lines
748 B
Dart
29 lines
748 B
Dart
import 'package:flutter/material.dart';
|
|
import 'package:prosapp_web_app/models/setting.dart';
|
|
import 'package:prosapp_web_app/services/api_service.dart';
|
|
|
|
class SettingsProvider extends ChangeNotifier {
|
|
Setting? settings;
|
|
bool isLoading = true;
|
|
final _api = ApiService.instance;
|
|
|
|
SettingsProvider() {
|
|
getSettings();
|
|
}
|
|
|
|
getSettings() async {
|
|
try {
|
|
final data = await _api.get('/settings').timeout(const Duration(seconds: 10));
|
|
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();
|
|
}
|
|
}
|
|
}
|