This commit is contained in:
Felipe
2023-09-01 09:11:25 -05:00
parent 9e408af634
commit 8d3c18a892
2 changed files with 42 additions and 74 deletions
+39 -65
View File
@@ -33,9 +33,7 @@ class ServiceScreen extends StatefulWidget {
State<ServiceScreen> createState() => _ServiceScreenState();
}
class _ServiceScreenState extends State<ServiceScreen> {
void _saveToken() async {
FirebaseMessaging messaging = FirebaseMessaging.instance;
@@ -51,8 +49,6 @@ class _ServiceScreenState extends State<ServiceScreen> {
}
}
Future<void> sendPushNotification(String pro) async {
try {
http.Response response = await http.post(
@@ -73,7 +69,7 @@ class _ServiceScreenState extends State<ServiceScreen> {
'click_action': 'FLUTTER_NOTIFICATION_CLICK',
'id': '1',
'status': 'done',
'screen':'solicitud'
'screen': 'solicitud'
},
'to': pro
},
@@ -206,7 +202,6 @@ class _ServiceScreenState extends State<ServiceScreen> {
@override
void initState() {
super.initState();
if (_ciudad == '...') {
AuthenticationRepository.instance
@@ -716,61 +711,6 @@ class _ServiceScreenState extends State<ServiceScreen> {
},
),
),
Padding(
padding:
const EdgeInsets.only(top: 22, left: 100, right: 25),
child: Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(50),
color: Colors.white,
boxShadow: [
BoxShadow(
color: Colors.grey.withOpacity(0.4),
spreadRadius: 1,
blurRadius: 2,
offset: const Offset(1, 2),
),
],
),
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 20),
child: TextFormField(
onTap: () async {
final String? serviceType = await Navigator.push(
context,
CupertinoPageRoute(
builder: (BuildContext context) {
return const ServiceTypeScreen();
},
),
) as String?;
if (serviceType != null) {
setState(() {
_serviceType = serviceType;
_serviceTypeController.text = _serviceType;
});
}
},
controller: _serviceTypeController,
style: const TextStyle(
color: Colors.black87,
fontWeight: FontWeight.w600,
),
readOnly: true,
decoration: InputDecoration(
hintText:
_serviceType == '' ? 'Servicio' : _serviceType,
hintStyle: const TextStyle(
color: Colors.black87,
fontWeight: FontWeight.w600),
border: InputBorder.none,
enabledBorder: InputBorder.none,
),
),
),
),
),
],
),
Container(
@@ -784,6 +724,41 @@ class _ServiceScreenState extends State<ServiceScreen> {
child: Form(
child: Column(
children: [
TextFormField(
onTap: () async {
final String? serviceType =
await Navigator.push(
context,
CupertinoPageRoute(
builder: (BuildContext context) {
return const ServiceTypeScreen();
},
),
) as String?;
if (serviceType != null) {
setState(() {
_serviceType = serviceType;
_serviceTypeController.text = _serviceType;
});
}
},
controller: _serviceTypeController,
style: const TextStyle(
color: Colors.black87,
fontWeight: FontWeight.w600,
),
readOnly: true,
decoration: InputDecoration(
hintText: _serviceType == ''
? 'Servicio'
: _serviceType,
border: InputBorder.none,
enabledBorder: InputBorder.none,
),
),
const SizedBox(height: 15),
Column(
children: [
TextFormField(
@@ -811,11 +786,10 @@ class _ServiceScreenState extends State<ServiceScreen> {
profesional.name.toString();
professionalId = profesional.id;
print(profesional);
if (profesional.token != '') {
professionalToken =
profesional.token!;
print(professionalToken);
}
professionalTarifa =
@@ -877,7 +851,7 @@ class _ServiceScreenState extends State<ServiceScreen> {
placeAutoComplete(modifiedValue);
},
),
Container(
SizedBox(
height: _placesList.isNotEmpty
? 200
: 0, // Ajusta la altura según tus necesidades
@@ -900,7 +874,7 @@ class _ServiceScreenState extends State<ServiceScreen> {
final newCoordinates = LatLng(
selectedLatitude, selectedLongitude);
googleMapController?.animateCamera(
googleMapController.animateCamera(
CameraUpdate.newLatLng(newCoordinates),
);
+3 -9
View File
@@ -19,9 +19,7 @@ class SsupportStateScreen extends State<SupportScreen> {
final String body = '';
Future<void> _sendWhatsapp(String? number) async {
final _whatsappUrl =
'https://wa.me/$number?text=${Uri.parse('Hola! soy usuario de Prosapp y quisiera conocer mas sobre esta app')}';
final _whatsappUrl = 'https://api.whatsapp.com/send?phone=$number&text=Hola%21+soy+usuario+de+Prosapp+y+quisiera+conocer+mas+sobre+esta+app+%F0%9F%98%81';
if (!await launch(_whatsappUrl)) {
throw Exception('Could not launch $_whatsappUrl');
}
@@ -39,14 +37,10 @@ class SsupportStateScreen extends State<SupportScreen> {
}
void _sendEmailWeb(String recipients) async {
final email =
'mailto:$recipients?subject=${Uri.encodeComponent(recipients)}&body=${Uri.encodeComponent(body)}';
final email = 'mailto:$recipients?subject=${Uri.encodeComponent(recipients)}&body=${Uri.encodeComponent(body)}';
if (await canLaunch(email)) {
await launch(email);
} else {
// No se pudo abrir el cliente de correo electrónico
// Puedes mostrar un diálogo o realizar otra acción en este caso
}
} else {}
}
@override