This commit is contained in:
Felipe
2024-04-17 10:48:30 -05:00
parent afb6ff3ddd
commit 8cefe5ba13
+19
View File
@@ -388,6 +388,7 @@ class _UserMapScreenState extends State<UserMapScreen> {
onPressed: isLoading
? null
: () {
// tODO: Crear servicio
if (serviceLocationPreference ==
ServiceLocationPreferences.office) {
context.read<ServiceBloc>().add(
@@ -414,6 +415,24 @@ class _UserMapScreenState extends State<UserMapScreen> {
);
} else if (serviceLocationPreference ==
ServiceLocationPreferences.delivery) {
context.read<ServiceBloc>().add(
CreateService(
professionalId: profesionalSeleccionado!
.professionalInfo.id,
userId: state.user!.id,
address: _addressController.text,
aditionalAddress: '',
latitude: 0,
longitude: 0,
day: fechaSeleccionada.toString(),
createdAt: Timestamp.now(),
description: _observationController.text,
range1Hour1: horaSeleccionada!,
range1Hour2: horaSeleccionada!.add(hour: 2),
rate: '0',
location: serviceLocationPreference!,
),
);
} else {
// TODO: error inesperado
}