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,
|
cursor: SystemMouseCursors.click,
|
||||||
child: GestureDetector(
|
child: GestureDetector(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
if (authProvider.user?.name == null ||
|
final missing = <String>[
|
||||||
authProvider.user?.name == '') {
|
if (authProvider.user?.name == null ||
|
||||||
NotificationsService.showSnackBarError('Primero completa tu perfil');
|
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);
|
navigateTo(Flurorouter.profileRoute);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user