update 15 dec
This commit is contained in:
@@ -43,7 +43,7 @@ class CodeValidationScreen extends StatelessWidget {
|
||||
'Valida el código',
|
||||
style: TextStyle(
|
||||
color: Color(0xFF262626),
|
||||
fontSize: 38.0,
|
||||
fontSize: 30.0,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
|
||||
@@ -77,7 +77,7 @@ class _LoginScreenState extends State<LoginScreen> {
|
||||
'Iniciar sesión',
|
||||
style: TextStyle(
|
||||
color: Color(0xFF262626),
|
||||
fontSize: 38.0,
|
||||
fontSize: 30.0,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
@@ -245,7 +245,7 @@ class _LoginScreenState extends State<LoginScreen> {
|
||||
'Iniciar sesión',
|
||||
style: TextStyle(
|
||||
color: Color(0xFF262626),
|
||||
fontSize: 38.0,
|
||||
fontSize: 30.0,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
|
||||
@@ -66,7 +66,7 @@ class _LoginEmailScreenState extends State<LoginEmailScreen> {
|
||||
'Iniciar sesión',
|
||||
style: TextStyle(
|
||||
color: Color(0xFF262626),
|
||||
fontSize: 38.0,
|
||||
fontSize: 30.0,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
textAlign: TextAlign.right,
|
||||
@@ -295,7 +295,7 @@ class _LoginEmailScreenState extends State<LoginEmailScreen> {
|
||||
'Iniciar sesión',
|
||||
style: TextStyle(
|
||||
color: Color(0xFF262626),
|
||||
fontSize: 38.0,
|
||||
fontSize: 30.0,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
textAlign: TextAlign.right,
|
||||
|
||||
@@ -94,9 +94,12 @@ class _ServiceScreenState extends State<ServiceScreen> {
|
||||
|
||||
getLocationUpdates();
|
||||
|
||||
print('App version: 2 $settings');
|
||||
if (settings == null) {
|
||||
SettingModel.getSettings().then(
|
||||
(SettingModel value) {
|
||||
(SettingModel value) => (value) {
|
||||
print('App version:3 $value');
|
||||
|
||||
if (mounted) {
|
||||
setState(() {
|
||||
settings = value.version;
|
||||
@@ -104,9 +107,7 @@ class _ServiceScreenState extends State<ServiceScreen> {
|
||||
});
|
||||
}
|
||||
},
|
||||
).catchError((error) {
|
||||
print('App version Error al obtener la configuración: $error');
|
||||
});
|
||||
);
|
||||
}
|
||||
|
||||
if (_ciudad == '...') {
|
||||
@@ -1012,19 +1013,23 @@ class _ServiceScreenState extends State<ServiceScreen> {
|
||||
PackageInfo packageInfo = await PackageInfo.fromPlatform();
|
||||
String version = packageInfo.version;
|
||||
|
||||
print('App version: $version');
|
||||
|
||||
if (mounted) {
|
||||
setState(() {
|
||||
appVersion = version;
|
||||
});
|
||||
}
|
||||
|
||||
print('App version: $settings');
|
||||
|
||||
if (settings != null) {
|
||||
_checkForUpdate(settings);
|
||||
}
|
||||
}
|
||||
|
||||
void _checkForUpdate(String? settings) {
|
||||
if (appVersion != settings) {
|
||||
if (appVersion == settings) {
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (context) {
|
||||
|
||||
@@ -52,7 +52,7 @@ class _NewNumberValidationScreenState extends State<NewNumberValidationScreen> {
|
||||
'Valida el código',
|
||||
style: TextStyle(
|
||||
color: Color(0xFF262626),
|
||||
fontSize: 38.0,
|
||||
fontSize: 30.0,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
textAlign: TextAlign.right,
|
||||
|
||||
@@ -140,6 +140,8 @@ class _ProfessionalScreenState extends State<ProfessionalScreen> {
|
||||
SettingModel.getSettings().then(
|
||||
(SettingModel value) => setState(() {
|
||||
settings = value;
|
||||
|
||||
print('initState settings: $settings');
|
||||
}),
|
||||
);
|
||||
}
|
||||
@@ -240,26 +242,53 @@ class _ProfessionalScreenState extends State<ProfessionalScreen> {
|
||||
.map((e) => e.toString())
|
||||
.toList();
|
||||
|
||||
if (widget.profession == data['profesion'] ||
|
||||
widget.profession == '' &&
|
||||
userme?.city == data['city'] &&
|
||||
data['ubicacion'] != null) {
|
||||
Professional professional = Professional(
|
||||
id: user.id,
|
||||
name: data['name'],
|
||||
professionName: data['profesion'],
|
||||
cityName: data['city'],
|
||||
professionalRef: storage.ref().child(_photo),
|
||||
professionalEspecializado: especializaciones,
|
||||
ubicacion: data['ubicacion'] ?? '',
|
||||
realAddress: data['address'] ?? '',
|
||||
latitude: data['latitude'] ?? 0,
|
||||
longitude: data['longitude'] ?? 0,
|
||||
scores: await ScoresModel.scoreTo(user.id, true, true),
|
||||
tarifa: data['tarifa'] ?? 0,
|
||||
token: data['token'] ?? '',
|
||||
);
|
||||
professionals.add(professional);
|
||||
if (settings?.domicilios == false) {
|
||||
if (data['ubicacion'] == 'ambos' ||
|
||||
data['ubicacion'] == 'sitio') {
|
||||
if (widget.profession == data['profesion'] ||
|
||||
(widget.profession == '' &&
|
||||
userme?.city == data['city'] &&
|
||||
data['ubicacion'] != null)) {
|
||||
Professional professional = Professional(
|
||||
id: user.id,
|
||||
name: data['name'],
|
||||
professionName: data['profesion'],
|
||||
cityName: data['city'],
|
||||
professionalRef: storage.ref().child(_photo),
|
||||
professionalEspecializado: especializaciones,
|
||||
ubicacion: data['ubicacion'] ?? '',
|
||||
realAddress: data['address'] ?? '',
|
||||
latitude: data['latitude'] ?? 0,
|
||||
longitude: data['longitude'] ?? 0,
|
||||
scores: await ScoresModel.scoreTo(user.id, true, true),
|
||||
tarifa: data['tarifa'] ?? 0,
|
||||
token: data['token'] ?? '',
|
||||
);
|
||||
professionals.add(professional);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (widget.profession == data['profesion'] ||
|
||||
(widget.profession == '' &&
|
||||
userme?.city == data['city'] &&
|
||||
data['ubicacion'] != null)) {
|
||||
Professional professional = Professional(
|
||||
id: user.id,
|
||||
name: data['name'],
|
||||
professionName: data['profesion'],
|
||||
cityName: data['city'],
|
||||
professionalRef: storage.ref().child(_photo),
|
||||
professionalEspecializado: especializaciones,
|
||||
ubicacion: data['ubicacion'] ?? '',
|
||||
realAddress: data['address'] ?? '',
|
||||
latitude: data['latitude'] ?? 0,
|
||||
longitude: data['longitude'] ?? 0,
|
||||
scores: await ScoresModel.scoreTo(user.id, true, true),
|
||||
tarifa: data['tarifa'] ?? 0,
|
||||
token: data['token'] ?? '',
|
||||
);
|
||||
professionals.add(professional);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -291,13 +291,29 @@ class _ProfileProScreenState extends State<ProfileProScreen> {
|
||||
|
||||
updatePaymentMethods();
|
||||
|
||||
Get.snackbar(
|
||||
'Información actualizada',
|
||||
'Tu información ha sido actualizada con éxito.',
|
||||
snackPosition: SnackPosition.TOP,
|
||||
);
|
||||
if (settings?.domicilios == false && sitioValue == false) {
|
||||
Get.defaultDialog(
|
||||
title: 'Donde vas a dar tu servicio?',
|
||||
middleText:
|
||||
'Si no eliges servicio en sitio, no serás visible para los usuarios.',
|
||||
actions: [
|
||||
ElevatedButton(
|
||||
onPressed: () {
|
||||
Get.back();
|
||||
},
|
||||
child: const Text('Entendido'),
|
||||
),
|
||||
],
|
||||
);
|
||||
} else {
|
||||
Get.snackbar(
|
||||
'Información actualizada',
|
||||
'Tu información ha sido actualizada con éxito.',
|
||||
snackPosition: SnackPosition.TOP,
|
||||
);
|
||||
Navigator.pop(context);
|
||||
}
|
||||
|
||||
Navigator.pop(context);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -472,7 +488,9 @@ class _ProfileProScreenState extends State<ProfileProScreen> {
|
||||
if (settings?.tarifas == true)
|
||||
customSwitch(
|
||||
'Tarifa',
|
||||
tarifaValue,
|
||||
17,
|
||||
false,
|
||||
FontWeight.w500,
|
||||
(value) {
|
||||
tarifaValue = value;
|
||||
},
|
||||
@@ -505,10 +523,11 @@ class _ProfileProScreenState extends State<ProfileProScreen> {
|
||||
height: 12,
|
||||
),
|
||||
if (settings?.domicilios == true)
|
||||
customSwitch(
|
||||
'Servicio a domicilio', domicilioValue, toggleDomicilio),
|
||||
customSwitch('Servicio a domicilio', 17, domicilioValue,
|
||||
FontWeight.w500, toggleDomicilio),
|
||||
const Divider(),
|
||||
customSwitch('Servicio en sitio', sitioValue, toggleSitio),
|
||||
customSwitch('Servicio en sitio', 17, sitioValue, FontWeight.w500,
|
||||
toggleSitio),
|
||||
sitioValue
|
||||
? Padding(
|
||||
padding:
|
||||
@@ -739,7 +758,12 @@ class _ProfileProScreenState extends State<ProfileProScreen> {
|
||||
}
|
||||
|
||||
Widget customSwitch(
|
||||
String text, bool switchValue, ValueChanged<bool> onChanged) {
|
||||
String text,
|
||||
double? size,
|
||||
bool switchValue,
|
||||
FontWeight? bold,
|
||||
ValueChanged<bool> onChanged,
|
||||
) {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 30),
|
||||
child: SizedBox(
|
||||
@@ -749,8 +773,12 @@ class _ProfileProScreenState extends State<ProfileProScreen> {
|
||||
Expanded(
|
||||
child: Text(
|
||||
text,
|
||||
style: const TextStyle(
|
||||
fontSize: 15,
|
||||
style: TextStyle(
|
||||
fontSize: size ??
|
||||
15, // Establece el tamaño predeterminado a 15 si no se proporciona
|
||||
fontWeight: bold ??
|
||||
FontWeight
|
||||
.normal, // Usa negrita si se proporciona, de lo contrario, usa normal
|
||||
color: Colors.black,
|
||||
),
|
||||
),
|
||||
@@ -767,6 +795,36 @@ class _ProfileProScreenState extends State<ProfileProScreen> {
|
||||
),
|
||||
);
|
||||
}
|
||||
// Widget customSwitch(String text, double? size = 15, bool switchValue,
|
||||
// FontWeight bold, ValueChanged<bool> onChanged) {
|
||||
// return Padding(
|
||||
// padding: const EdgeInsets.symmetric(horizontal: 30),
|
||||
// child: SizedBox(
|
||||
// height: 40,
|
||||
// child: Row(
|
||||
// children: [
|
||||
// Expanded(
|
||||
// child: Text(
|
||||
// text,
|
||||
// style: TextStyle(
|
||||
// fontSize: size,
|
||||
// fontWeight: bold,
|
||||
// color: Colors.black,
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// Transform.scale(
|
||||
// scale: 1.2,
|
||||
// child: Switch(
|
||||
// value: switchValue,
|
||||
// onChanged: onChanged,
|
||||
// ),
|
||||
// ),
|
||||
// ],
|
||||
// ),
|
||||
// ),
|
||||
// );
|
||||
// }
|
||||
|
||||
String timeList(Schedule? schedule, BuildContext context) {
|
||||
if (schedule == null) {
|
||||
|
||||
@@ -176,13 +176,29 @@ class _ProfileProWebScreenState extends State<ProfileProWebScreen> {
|
||||
return;
|
||||
}
|
||||
|
||||
Get.snackbar(
|
||||
'Información actualizada',
|
||||
'Tu información a sido actualizada con exito.',
|
||||
snackPosition: SnackPosition.TOP,
|
||||
);
|
||||
if (settings?.domicilios == false && sitioValue == false) {
|
||||
Get.defaultDialog(
|
||||
title: 'Donde vas a dar tu servicio?',
|
||||
middleText:
|
||||
'Si no eliges servicio en sitio, no serás visible para los usuarios.',
|
||||
actions: [
|
||||
ElevatedButton(
|
||||
onPressed: () {
|
||||
Get.back();
|
||||
},
|
||||
child: const Text('Entendido'),
|
||||
),
|
||||
],
|
||||
);
|
||||
} else {
|
||||
Get.snackbar(
|
||||
'Información actualizada',
|
||||
'Tu información ha sido actualizada con éxito.',
|
||||
snackPosition: SnackPosition.TOP,
|
||||
);
|
||||
Navigator.pop(context);
|
||||
}
|
||||
|
||||
Navigator.pop(context);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -79,7 +79,7 @@ class _RegisterScreenState extends State<RegisterScreen> {
|
||||
'Registro',
|
||||
style: TextStyle(
|
||||
color: Color(0xFF262626),
|
||||
fontSize: 38.0,
|
||||
fontSize: 30.0,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
textAlign: TextAlign.right,
|
||||
@@ -428,7 +428,7 @@ class _RegisterScreenState extends State<RegisterScreen> {
|
||||
'Registro',
|
||||
style: TextStyle(
|
||||
color: Color(0xFF262626),
|
||||
fontSize: 38.0,
|
||||
fontSize: 30.0,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
textAlign: TextAlign.right,
|
||||
|
||||
Reference in New Issue
Block a user