evita que se pueda enviar info sin numero

This commit is contained in:
Felipe
2023-07-31 15:04:35 -05:00
parent 5b6fe18686
commit 39b49fea15
5 changed files with 60 additions and 13 deletions
+2 -1
View File
@@ -386,7 +386,8 @@ class _DrawerMenuState extends State<DrawerMenu> {
onPressed: () {
if (user?.name == '' ||
user?.city == '' ||
user?.phoneNumber == '') {
user?.phoneNumber == '' ||
user?.phoneNumber == null) {
Get.snackbar(
'Crea tu perfil',
'Para ser profesional primero completa tu perfil.',
@@ -17,6 +17,7 @@ import 'package:prosappco/src/screens/reputacion_pro.dart';
import '../models/scores_model.dart';
import '../screens/configuracion.dart';
import '../screens/support.dart';
import 'package:url_launcher/url_launcher.dart';
class DrawerProfessional extends StatefulWidget {
@override
@@ -28,6 +29,16 @@ class _DrawerProfessionalState extends State<DrawerProfessional> {
UserModel? user;
ScoresModel? scoresModel;
Future<void> _irSugerencias() async {
const url =
'https://admin.prosapp.co/sugerencias '; // Aquí debes poner la URL a la que quieres dirigirte
if (await canLaunch(url)) {
await launch(url);
} else {
throw 'No se pudo abrir la URL $url';
}
}
@override
void initState() {
super.initState();
@@ -199,6 +210,17 @@ class _DrawerProfessionalState extends State<DrawerProfessional> {
style: TextStyle(fontSize: 15),
),
),
ListTile(
onTap: _irSugerencias,
leading: const Icon(
Icons.campaign_outlined,
color: Colors.black,
),
title: const Text(
'Sugerencias',
style: TextStyle(fontSize: 15),
),
),
ListTile(
onTap: () {
Navigator.of(context).push(
+2 -3
View File
@@ -443,11 +443,10 @@ class _ProfileWebScreenState extends State<ProfileWebScreen> {
List<City> filteredCities = snapshot.data!;
return DropdownButtonFormField<String>(
value: _ciudad, // Valor seleccionado actualmente
value: _ciudad,
onChanged: (String? newValue) {
setState(() {
_ciudad =
newValue!; // Actualizar el valor seleccionado
_ciudad = newValue!;
});
},
items: filteredCities.map((City city) {
+12 -9
View File
@@ -48,15 +48,18 @@ class RequestSentScreen extends StatelessWidget {
),
],
),
child: const Row(
children: [
Expanded(
child: Text(
"¡Gracias por proporcionar tu información! Revisaremos los datos proporcionados y, una vez confirmados, podrás convertirte en un profesional registrado en nuestra aplicación. ¡Esperamos contar contigo pronto!",
style: TextStyle(color: Colors.black, fontSize: 14),
),
)
],
child: const SizedBox(
width: 350,
child: Row(
children: [
Expanded(
child: Text(
"¡Gracias por proporcionar tu información! Revisaremos los datos proporcionados y, una vez confirmados, podrás convertirte en un profesional registrado en nuestra aplicación. ¡Esperamos contar contigo pronto!",
style: TextStyle(color: Colors.black, fontSize: 14),
),
)
],
),
),
),
PrimaryButtom(
+22
View File
@@ -192,10 +192,32 @@ class _ServiceScreenState extends State<ServiceScreen> {
BitmapDescriptor? _markerIcon;
String _ciudad = '...';
@override
void initState() {
super.initState();
if (_ciudad == '...') {
AuthenticationRepository.instance
.getCity(uid.toString())
.then((String s) {
if (s.isEmpty) {
FirebaseFirestore.instance.collection('users').doc(uid).set({
'city': 'Cúcuta',
}).then((_) {
setState(() {
_ciudad = 'Cúcuta';
});
});
} else {
setState(() {
_ciudad = s;
});
}
});
}
_saveToken();
if (user == null) {