- web/index.html: lang=es (evita traductor) + cache busting con timestamp en flutter_bootstrap.js - profesional.dart: rate → número, location_preferences → string para coincidir con backend DTO - location_preferences.dart: funciones locationPrefsToString/locationPrefsFromValue - auth_provider.dart: _navigateAfterAuth redirige a setup-city si user.city vacío, método updateCity y linkEmailWithOtp - setup_city_view.dart: nueva vista con GPS + Nominatim para detectar ciudad, campo editable, omitir - email_view.dart: rediseño completo con flujo OTP (paso 1: email+contraseña → paso 2: código recibido en correo) - router + dashboard_handlers: ruta /dashboard/setup-city Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
32 lines
829 B
Dart
32 lines
829 B
Dart
export 'location_preferences.dart';
|
|
|
|
enum LocationPreferences { office, delivery, both }
|
|
|
|
int enumToInt(LocationPreferences state) {
|
|
return state.index;
|
|
}
|
|
|
|
LocationPreferences intToEnum(int value) {
|
|
return LocationPreferences.values[value];
|
|
}
|
|
|
|
String locationPrefsToString(LocationPreferences p) {
|
|
switch (p) {
|
|
case LocationPreferences.office: return 'office';
|
|
case LocationPreferences.delivery: return 'delivery';
|
|
case LocationPreferences.both: return 'both';
|
|
}
|
|
}
|
|
|
|
LocationPreferences locationPrefsFromValue(dynamic v) {
|
|
if (v is int) return intToEnum(v);
|
|
if (v is String) {
|
|
switch (v) {
|
|
case 'delivery': return LocationPreferences.delivery;
|
|
case 'both': return LocationPreferences.both;
|
|
default: return LocationPreferences.office;
|
|
}
|
|
}
|
|
return LocationPreferences.office;
|
|
}
|