tarifas y delivery
This commit is contained in:
@@ -391,48 +391,100 @@ class _UserMapScreenState extends State<UserMapScreen> {
|
||||
// tODO: Crear servicio
|
||||
if (serviceLocationPreference ==
|
||||
ServiceLocationPreferences.office) {
|
||||
context.read<ServiceBloc>().add(
|
||||
CreateService(
|
||||
professionalId: profesionalSeleccionado!
|
||||
.professionalInfo.id,
|
||||
userId: state.user!.id,
|
||||
address: profesionalSeleccionado!
|
||||
.professionalInfo.address,
|
||||
aditionalAddress: profesionalSeleccionado!
|
||||
.professionalInfo.aditionalAddress,
|
||||
latitude: profesionalSeleccionado!
|
||||
.professionalInfo.latitude,
|
||||
longitude: profesionalSeleccionado!
|
||||
.professionalInfo.longitude,
|
||||
day: fechaSeleccionada.toString(),
|
||||
createdAt: Timestamp.now(),
|
||||
description: _observationController.text,
|
||||
range1Hour1: horaSeleccionada!,
|
||||
range1Hour2: horaSeleccionada!.add(hour: 2),
|
||||
rate: '0',
|
||||
location: serviceLocationPreference!,
|
||||
),
|
||||
);
|
||||
if (settings?.tarifas == true) {
|
||||
context.read<ServiceBloc>().add(
|
||||
CreateService(
|
||||
professionalId: profesionalSeleccionado!
|
||||
.professionalInfo.id,
|
||||
userId: state.user!.id,
|
||||
address: profesionalSeleccionado!
|
||||
.professionalInfo.address,
|
||||
aditionalAddress: profesionalSeleccionado!
|
||||
.professionalInfo.aditionalAddress,
|
||||
latitude: profesionalSeleccionado!
|
||||
.professionalInfo.latitude,
|
||||
longitude: profesionalSeleccionado!
|
||||
.professionalInfo.longitude,
|
||||
day: fechaSeleccionada.toString(),
|
||||
createdAt: Timestamp.now(),
|
||||
description: _observationController.text,
|
||||
range1Hour1: horaSeleccionada!,
|
||||
range1Hour2:
|
||||
horaSeleccionada!.add(hour: 2),
|
||||
rate: profesionalSeleccionado!
|
||||
.professionalInfo.rate,
|
||||
location: serviceLocationPreference!,
|
||||
),
|
||||
);
|
||||
} else {
|
||||
context.read<ServiceBloc>().add(
|
||||
CreateService(
|
||||
professionalId: profesionalSeleccionado!
|
||||
.professionalInfo.id,
|
||||
userId: state.user!.id,
|
||||
address: profesionalSeleccionado!
|
||||
.professionalInfo.address,
|
||||
aditionalAddress: profesionalSeleccionado!
|
||||
.professionalInfo.aditionalAddress,
|
||||
latitude: profesionalSeleccionado!
|
||||
.professionalInfo.latitude,
|
||||
longitude: profesionalSeleccionado!
|
||||
.professionalInfo.longitude,
|
||||
day: fechaSeleccionada.toString(),
|
||||
createdAt: Timestamp.now(),
|
||||
description: _observationController.text,
|
||||
range1Hour1: horaSeleccionada!,
|
||||
range1Hour2:
|
||||
horaSeleccionada!.add(hour: 2),
|
||||
rate: '0',
|
||||
location: serviceLocationPreference!,
|
||||
),
|
||||
);
|
||||
}
|
||||
} 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!,
|
||||
),
|
||||
);
|
||||
if (settings?.tarifas == true) {
|
||||
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: profesionalSeleccionado!
|
||||
.professionalInfo.rate,
|
||||
location: serviceLocationPreference!,
|
||||
),
|
||||
);
|
||||
} else {
|
||||
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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user