Fix stuck loading after save on profile and schedule views

- Remove fp.clear() from profile initState: if profesional is already
  loaded (e.g. navigating from schedule page) the form renders instantly
  without a spinner; if null the Consumer already shows the spinner.
- Add .catchError() so the spinner always resolves even on API failure.
- Remove redundant GET /professionals/me reload inside updateProfesionalProfileInfo:
  data is already correct from copyProfesionalWith, so the save button
  no longer waits for an extra round-trip after the PATCH.
- Wrap save button in try/finally so _saving always resets to false.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Lizandro Guarnizo
2026-07-12 19:44:52 -05:00
co-authored by Claude Sonnet 4.6
parent fd7b57fd35
commit 4698454cfc
2 changed files with 19 additions and 17 deletions
@@ -97,11 +97,6 @@ class ProfessionalFormProvider with ChangeNotifier {
NotificationsService.showSnackbar('Error al guardar: $e');
return false;
}
try {
final data = await _api.get('/professionals/me');
profesional = Profesional.fromDocument(data as Map<String, dynamic>);
notifyListeners();
} catch (_) {}
NotificationsService.showSnackbar('Información actualizada');
return true;
}