fix: require city and phone (not just name) before switching to pro mode
Aligns the profile-completeness gate in the sidebar with the mobile app, and reports which specific field is missing instead of a generic message.
This commit is contained in:
@@ -179,9 +179,20 @@ class Sidebar extends StatelessWidget {
|
||||
cursor: SystemMouseCursors.click,
|
||||
child: GestureDetector(
|
||||
onTap: () {
|
||||
if (authProvider.user?.name == null ||
|
||||
authProvider.user?.name == '') {
|
||||
NotificationsService.showSnackBarError('Primero completa tu perfil');
|
||||
final missing = <String>[
|
||||
if (authProvider.user?.name == null ||
|
||||
authProvider.user?.name == '')
|
||||
'nombre',
|
||||
if (authProvider.user?.city == null ||
|
||||
authProvider.user?.city == '')
|
||||
'ciudad',
|
||||
if (authProvider.user?.phone == null ||
|
||||
authProvider.user?.phone == '')
|
||||
'teléfono',
|
||||
];
|
||||
if (missing.isNotEmpty) {
|
||||
NotificationsService.showSnackBarError(
|
||||
'Completa tu perfil: falta ${missing.join(', ')}');
|
||||
navigateTo(Flurorouter.profileRoute);
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user