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: () { onPressed: () {
if (user?.name == '' || if (user?.name == '' ||
user?.city == '' || user?.city == '' ||
user?.phoneNumber == '') { user?.phoneNumber == '' ||
user?.phoneNumber == null) {
Get.snackbar( Get.snackbar(
'Crea tu perfil', 'Crea tu perfil',
'Para ser profesional primero completa 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 '../models/scores_model.dart';
import '../screens/configuracion.dart'; import '../screens/configuracion.dart';
import '../screens/support.dart'; import '../screens/support.dart';
import 'package:url_launcher/url_launcher.dart';
class DrawerProfessional extends StatefulWidget { class DrawerProfessional extends StatefulWidget {
@override @override
@@ -28,6 +29,16 @@ class _DrawerProfessionalState extends State<DrawerProfessional> {
UserModel? user; UserModel? user;
ScoresModel? scoresModel; 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 @override
void initState() { void initState() {
super.initState(); super.initState();
@@ -199,6 +210,17 @@ class _DrawerProfessionalState extends State<DrawerProfessional> {
style: TextStyle(fontSize: 15), 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( ListTile(
onTap: () { onTap: () {
Navigator.of(context).push( Navigator.of(context).push(
+2 -3
View File
@@ -443,11 +443,10 @@ class _ProfileWebScreenState extends State<ProfileWebScreen> {
List<City> filteredCities = snapshot.data!; List<City> filteredCities = snapshot.data!;
return DropdownButtonFormField<String>( return DropdownButtonFormField<String>(
value: _ciudad, // Valor seleccionado actualmente value: _ciudad,
onChanged: (String? newValue) { onChanged: (String? newValue) {
setState(() { setState(() {
_ciudad = _ciudad = newValue!;
newValue!; // Actualizar el valor seleccionado
}); });
}, },
items: filteredCities.map((City city) { items: filteredCities.map((City city) {
+4 -1
View File
@@ -48,7 +48,9 @@ class RequestSentScreen extends StatelessWidget {
), ),
], ],
), ),
child: const Row( child: const SizedBox(
width: 350,
child: Row(
children: [ children: [
Expanded( Expanded(
child: Text( child: Text(
@@ -59,6 +61,7 @@ class RequestSentScreen extends StatelessWidget {
], ],
), ),
), ),
),
PrimaryButtom( PrimaryButtom(
onPressed: () { onPressed: () {
Navigator.pushReplacementNamed(context, '/servicio'); Navigator.pushReplacementNamed(context, '/servicio');
+22
View File
@@ -192,10 +192,32 @@ class _ServiceScreenState extends State<ServiceScreen> {
BitmapDescriptor? _markerIcon; BitmapDescriptor? _markerIcon;
String _ciudad = '...';
@override @override
void initState() { void initState() {
super.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(); _saveToken();
if (user == null) { if (user == null) {