This commit is contained in:
Juan Felipe Duarte
2023-04-02 23:27:43 -05:00
parent fb16e276f5
commit f74da665a8
7 changed files with 600 additions and 277 deletions
+15 -1
View File
@@ -3,6 +3,10 @@ import 'package:get/get.dart';
import 'package:prosappco/src/authentication/authentication_repository.dart'; import 'package:prosappco/src/authentication/authentication_repository.dart';
import 'package:prosappco/src/screens/login.dart'; import 'package:prosappco/src/screens/login.dart';
import 'package:firebase_core/firebase_core.dart'; import 'package:firebase_core/firebase_core.dart';
import 'package:prosappco/src/screens/login_email.dart';
import 'package:prosappco/src/screens/profile.dart';
import 'package:prosappco/src/screens/register.dart';
import 'package:prosappco/src/screens/welcome.dart';
import 'firebase_options.dart'; import 'firebase_options.dart';
void main() async { void main() async {
@@ -22,7 +26,17 @@ class MyApp extends StatelessWidget {
theme: ThemeData(fontFamily: 'Poppins'), theme: ThemeData(fontFamily: 'Poppins'),
debugShowCheckedModeBanner: false, debugShowCheckedModeBanner: false,
title: 'ProsApp', title: 'ProsApp',
home: const LoginScreen(), initialRoute: '/',
routes: {
'/': (context) => LoginScreen(),
'/login': (context) => LoginEmailScreen(),
'/welcome': (context) => WelcomeScreen(),
'/profile': (context) => ProfileScreen(),
'/register': (context) => RegisterScreen(),
},
onGenerateRoute: (settings) {
throw Exception('Ruta desconocida: ${settings.name}');
},
); );
} }
} }
@@ -133,27 +133,27 @@ class AuthenticationRepository extends GetxController {
} }
Future<String> getName(String uid) async { Future<String> getName(String uid) async {
String city = 'error'; String name = '...';
CollectionReference collectionUsers = try {
FirebaseFirestore.instance.collection('users'); final snapshot =
DocumentSnapshot snapshot = await collectionUsers.doc(uid).get(); await FirebaseFirestore.instance.collection('users').doc(uid).get();
final Map<String, dynamic>? data = snapshot.data();
final Map<String, dynamic> doc = snapshot.data() as Map<String, dynamic>; name = data?['name'] ?? '...';
if (doc['name'] != null) { } catch (e) {
city = doc['name']; print('Error getting name: $e');
} }
return city; return name;
} }
Future<String> getCity(String uid) async { Future<String> getCity(String uid) async {
String city = 'error'; String city = '...';
CollectionReference collectionUsers = try {
FirebaseFirestore.instance.collection('users'); final snapshot =
DocumentSnapshot snapshot = await collectionUsers.doc(uid).get(); await FirebaseFirestore.instance.collection('users').doc(uid).get();
final Map<String, dynamic>? data = snapshot.data();
final Map<String, dynamic> doc = snapshot.data() as Map<String, dynamic>; city = data?['city'] ?? '...';
if (doc['city'] != null) { } catch (e) {
city = doc['city']; print('Error getting city: $e');
} }
return city; return city;
} }
+2 -10
View File
@@ -156,11 +156,7 @@ class _LoginScreenState extends State<LoginScreen> {
padding: EdgeInsets.only(bottom: 27), padding: EdgeInsets.only(bottom: 27),
child: GestureDetector( child: GestureDetector(
onTap: () { onTap: () {
Navigator.push( Navigator.pushNamed(context, '/login');
context,
MaterialPageRoute(
builder: (context) => LoginEmailScreen()),
);
}, },
child: Text( child: Text(
'Entrar con correo electronico', 'Entrar con correo electronico',
@@ -183,11 +179,7 @@ class _LoginScreenState extends State<LoginScreen> {
WidgetSpan( WidgetSpan(
child: GestureDetector( child: GestureDetector(
onTap: () { onTap: () {
Navigator.push( Navigator.pushNamed(context, '/register');
context,
MaterialPageRoute(
builder: (context) => RegisterScreen()),
);
}, },
child: Text( child: Text(
'Registrarse', 'Registrarse',
+2 -5
View File
@@ -252,11 +252,8 @@ class _LoginEmailScreenState extends State<LoginEmailScreen> {
WidgetSpan( WidgetSpan(
child: GestureDetector( child: GestureDetector(
onTap: () { onTap: () {
Navigator.push( Navigator.pushReplacementNamed(
context, context, '/register');
MaterialPageRoute(
builder: (context) => RegisterScreen()),
);
}, },
child: Text( child: Text(
'Registrarse', 'Registrarse',
+363
View File
@@ -0,0 +1,363 @@
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:intl_phone_field/countries.dart';
import 'package:prosappco/src/authentication/authentication_repository.dart';
import 'package:prosappco/src/controllers/add_name_email_city.dart';
import 'package:prosappco/src/screens/welcome.dart';
class ProfileScreen extends StatefulWidget {
const ProfileScreen({super.key});
@override
State<ProfileScreen> createState() => _ProfileScreenState();
}
class _ProfileScreenState extends State<ProfileScreen> {
final uid = AuthenticationRepository.instance.getCurrentUserUid();
final _formKey = GlobalKey<FormState>();
final controller = Get.put(NameEmailCityController());
var _nombre = '...';
var _ciudad = '...';
@override
void initState() {
super.initState();
if (_nombre == '...') {
AuthenticationRepository.instance
.getName(uid.toString())
.then((String s) => setState(() {
_nombre = s;
}));
}
if (_ciudad == '...') {
AuthenticationRepository.instance
.getCity(uid.toString())
.then((String s) => setState(() {
_ciudad = s;
}));
}
}
Widget build(BuildContext context) {
String name = _nombre.toString();
String city = _ciudad.toString();
return SafeArea(
child: Scaffold(
resizeToAvoidBottomInset: false,
appBar: AppBar(
backgroundColor: Colors.white,
iconTheme: IconThemeData(
color: Colors.black,
),
title: Text(
'Perfil',
style: TextStyle(
color: Colors.black,
),
)),
drawer: Drawer(
child: ListView(
padding: EdgeInsets.zero,
children: [
Column(
children: [
Column(
children: [
Container(
child: Builder(builder: (context) {
return ListTile(
onTap: () {
Scaffold.of(context).openEndDrawer();
},
title: Text('$name',
style: TextStyle(fontWeight: FontWeight.bold)),
subtitle: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
AuthenticationRepository.instance
.getCurrentUserPhone()
.toString(),
style: TextStyle(fontSize: 12),
),
Text(
'$city',
style: TextStyle(fontSize: 12),
),
],
),
leading: Container(
width: 60,
height: 60,
decoration: BoxDecoration(
color: Color(0xFF2BA4EC),
borderRadius: BorderRadius.circular(50),
),
child: Icon(
Icons.person,
color: Colors.white,
size: 55,
),
),
trailing: Icon(Icons.keyboard_arrow_right,
color: Colors.black),
contentPadding: EdgeInsets.symmetric(
vertical: 20, horizontal: 16),
);
}),
),
], // padding: const EdgeInsets.only(top: 20, bottom: 15),
),
Divider(height: 0, color: Colors.grey),
Column(
children: [
ListTile(
onTap: () {},
leading: Icon(
Icons.history,
color: Colors.black,
),
title: Text(
'Mis servicios',
style: TextStyle(fontSize: 15),
),
),
Builder(builder: (context) {
return ListTile(
onTap: () {
Scaffold.of(context).openEndDrawer();
},
leading: Icon(
Icons.person_outline,
color: Colors.black,
),
title: Text(
'Mi perfil',
style: TextStyle(fontSize: 15),
),
);
}),
ListTile(
onTap: () {},
leading: Icon(
Icons.construction_outlined,
color: Colors.black,
),
title: Text(
'Configuración',
style: TextStyle(fontSize: 15),
),
),
ListTile(
onTap: () {},
leading: Icon(
Icons.question_mark_rounded,
color: Colors.black,
),
title: Text(
'Soporte',
style: TextStyle(fontSize: 15),
),
),
ListTile(
onTap: () {},
leading: Icon(
Icons.messenger_outline,
color: Colors.black,
),
title: Text(
'Mensajes',
style: TextStyle(fontSize: 15),
),
),
ListTile(
onTap: () {
Navigator.pushReplacementNamed(context, '/welcome');
},
trailing: Icon(
Icons.keyboard_arrow_right,
color: Colors.white,
),
title: Text(
'Solicitar servicio',
style: TextStyle(
color: Colors.white,
fontSize: 17,
fontWeight: FontWeight.bold),
),
tileColor: Color(0xFF2BA4EC),
contentPadding:
EdgeInsets.symmetric(vertical: 5, horizontal: 16),
),
],
),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
'Prosapp',
style: TextStyle(fontSize: 10, color: Colors.grey[700]),
),
Padding(
padding:
const EdgeInsets.only(top: 7, left: 3, right: 3),
child: Text(
'®',
style:
TextStyle(fontSize: 25, color: Colors.grey[700]),
),
),
Text(
'todos los derechos reservados',
style: TextStyle(fontSize: 10, color: Colors.grey[700]),
),
],
),
],
),
Padding(
padding: const EdgeInsets.only(top: 200),
child: Row(
children: [
SizedBox(width: 10),
ElevatedButton(
onPressed: () {
AuthenticationRepository.instance.logout();
},
child: Icon(
Icons.logout_outlined,
color: Colors.red,
size: 35,
),
style: ElevatedButton.styleFrom(
primary: Colors.white,
shape: CircleBorder(),
elevation: 3,
minimumSize: Size(45, 45),
),
),
SizedBox(width: 5),
ElevatedButton(
onPressed: () {},
child: Text(
'Modo profesional',
style: TextStyle(
color: Colors.white,
fontSize: 15,
),
),
style: ElevatedButton.styleFrom(
primary: Color(0xFF2BA4EC),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(50),
),
elevation: 0,
minimumSize: Size(200, 45),
),
),
],
),
),
],
),
),
body: Center(
child: Column(
children: [
Container(
margin: EdgeInsets.symmetric(vertical: 50),
width: 100,
height: 100,
decoration: BoxDecoration(
color: Color(0xFF2BA4EC),
borderRadius: BorderRadius.circular(50),
),
child: Icon(
Icons.person,
color: Colors.white,
size: 90,
),
),
Container(
width: 300,
padding: EdgeInsets.only(top: 0),
child: Form(
key: _formKey,
child: Column(
children: [
TextFormField(
controller: controller.name,
decoration: InputDecoration(
prefixIcon: Icon(Icons.person_outline),
hintText: 'Nombre'),
),
SizedBox(
height:
20.0), // Agrega espacio vertical entre los TextFormFields
TextFormField(
controller: controller.email,
decoration: InputDecoration(
prefixIcon: Icon(Icons.email_outlined),
hintText: 'Email'),
),
SizedBox(
height:
20.0), // Agrega espacio vertical entre los TextFormFields
TextFormField(
controller: controller.city,
decoration: InputDecoration(
prefixIcon: Icon(Icons.near_me),
hintText: 'Ciudad'),
),
SizedBox(
height:
20.0), // Agrega espacio vertical entre los TextFormFields
TextFormField(
controller: controller.name,
decoration: InputDecoration(
prefixIcon: Icon(Icons.phone_android),
suffixIcon: Icon(Icons.edit_outlined),
hintText: '+57'),
),
],
)),
),
Container(
alignment: Alignment.bottomCenter,
margin: EdgeInsets.only(top: 170),
child: ElevatedButton(
onPressed: () {
// AuthenticationRepository.instance.addNameAndEmail(
// uid,
// controller.name.text.trim(),
// controller.email.text.trim(),
// controller.city.text.trim(),
// );
},
child: Text(
'Guardar',
style: TextStyle(
color: Colors.white,
fontWeight: FontWeight.bold,
fontSize: 17,
),
),
style: ElevatedButton.styleFrom(
primary: Color(0xFF2BA4EC),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(50),
),
elevation: 0,
minimumSize: Size(200, 50),
),
)),
],
),
),
),
);
}
}
+2 -6
View File
@@ -78,7 +78,7 @@ class _RegisterScreenState extends State<RegisterScreen> {
), ),
Container( Container(
padding: const EdgeInsets.symmetric(horizontal: 0, vertical: 20), padding: const EdgeInsets.symmetric(horizontal: 0, vertical: 20),
margin: const EdgeInsets.only(top: 190, left: 50, right: 50), margin: const EdgeInsets.only(top: 200, left: 50, right: 50),
child: Column(children: [ child: Column(children: [
Padding( Padding(
padding: EdgeInsets.only(bottom: 20), padding: EdgeInsets.only(bottom: 20),
@@ -289,11 +289,7 @@ class _RegisterScreenState extends State<RegisterScreen> {
WidgetSpan( WidgetSpan(
child: GestureDetector( child: GestureDetector(
onTap: () { onTap: () {
Navigator.push( Navigator.pushReplacementNamed(context, '/login');
context,
MaterialPageRoute(
builder: (context) => LoginScreen()),
);
}, },
child: Text( child: Text(
'Iniciar Sesión', 'Iniciar Sesión',
+199 -238
View File
@@ -4,6 +4,7 @@ import 'package:get/get.dart';
import 'package:prosappco/src/authentication/authentication_repository.dart'; import 'package:prosappco/src/authentication/authentication_repository.dart';
import 'package:cloud_firestore/cloud_firestore.dart'; import 'package:cloud_firestore/cloud_firestore.dart';
import 'package:prosappco/src/controllers/add_name_email_city.dart'; import 'package:prosappco/src/controllers/add_name_email_city.dart';
import 'package:prosappco/src/screens/profile.dart';
class WelcomeScreen extends StatefulWidget { class WelcomeScreen extends StatefulWidget {
const WelcomeScreen({super.key}); const WelcomeScreen({super.key});
@@ -16,257 +17,235 @@ class _WelcomeScreenState extends State<WelcomeScreen> {
final uid = AuthenticationRepository.instance.getCurrentUserUid(); final uid = AuthenticationRepository.instance.getCurrentUserUid();
final _formKey = GlobalKey<FormState>(); final _formKey = GlobalKey<FormState>();
final controller = Get.put(NameEmailCityController()); final controller = Get.put(NameEmailCityController());
var _nombre = 'Cargando...'; var _nombre = '...';
var _ciudad = '...'; var _ciudad = '...';
@override @override
void initState() { void initState() {
super.initState(); super.initState();
if (_nombre == 'Cargando...') { // if (_nombre == '...') {
AuthenticationRepository.instance // AuthenticationRepository.instance
.getName(uid.toString()) // .getName(uid.toString())
.then((String s) => setState(() { // .then((String s) => setState(() {
_nombre = s; // _nombre = s;
})); // }));
} // }
if (_ciudad == '...') { // if (_ciudad == '...') {
AuthenticationRepository.instance // AuthenticationRepository.instance
.getCity(uid.toString()) // .getCity(uid.toString())
.then((String s) => setState(() { // .then((String s) => setState(() {
_ciudad = s; // _ciudad = s;
})); // }));
} // }
} }
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
String name = _nombre.toString(); String name = 'Felipe el du';
String city = _ciudad.toString(); String city = 'Felipe el du';
// String name = _nombre.toString();
// String city = _ciudad.toString();
return SafeArea( return SafeArea(
child: Scaffold( child: Scaffold(
drawer: Drawer( drawer: Drawer(
child: Column( child: ListView(
padding: EdgeInsets.zero,
children: [ children: [
Container( Column(
color: Colors.white, children: [
child: Column( Column(
children: [ children: [
Padding( Container(
padding: const EdgeInsets.only(top: 20, bottom: 20), child: ListTile(
child: Row( onTap: () {
children: [ Navigator.pushNamed(context, '/profile');
Padding( },
padding: const EdgeInsets.only(left: 20, right: 20), title: Text('$name',
child: Container( style: TextStyle(fontWeight: FontWeight.bold)),
width: 60, subtitle: Column(
height: 60, crossAxisAlignment: CrossAxisAlignment.start,
decoration: BoxDecoration(
color: Color(0xFF2BA4EC),
borderRadius: BorderRadius.circular(50),
),
child: Icon(
Icons.person,
size: 50,
color: Colors.white,
),
),
),
Column(
children: [ children: [
Text( Text(
'$name', 'friki',
style: TextStyle( // AuthenticationRepository.instance
fontWeight: FontWeight.bold, fontSize: 12), // .getCurrentUserPhone()
), // .toString(),
Text( style: TextStyle(fontSize: 12),
AuthenticationRepository.instance
.getCurrentUserPhone()
.toString(),
style: TextStyle(fontSize: 10),
), ),
Text( Text(
'$city', '$city',
style: TextStyle(fontSize: 10), style: TextStyle(fontSize: 12),
), ),
], ],
), ),
SizedBox(width: 85), leading: Container(
Icon( width: 60,
Icons.keyboard_arrow_right_outlined, height: 60,
color: Color(0xFF2BA4EC), decoration: BoxDecoration(
), color: Color(0xFF2BA4EC),
], borderRadius: BorderRadius.circular(50),
), ),
), child: Icon(
Container( Icons.person,
height: 1.0,
color: Colors.grey.withOpacity(0.1),
),
Container(
height: 2.0,
decoration: BoxDecoration(
boxShadow: [
BoxShadow(
color: Colors.grey.withOpacity(0.2),
spreadRadius: 1,
blurRadius: 2,
offset: Offset(0, 1),
),
],
),
),
Container(
padding: EdgeInsets.all(20),
width: double.infinity,
child: Row(
children: [
Icon(Icons.history),
SizedBox(width: 10),
Text('Mis servicios'),
],
),
),
Container(
padding: EdgeInsets.all(20),
width: double.infinity,
child: Row(
children: [
Icon(Icons.person_outline),
SizedBox(width: 10),
Text("Mi perfil"),
],
),
),
Container(
padding: EdgeInsets.all(20),
width: double.infinity,
child: Row(
children: [
Icon(Icons.construction_outlined),
SizedBox(width: 10),
Text(
"Configuración",
),
],
),
),
Container(
padding: EdgeInsets.all(20),
width: double.infinity,
child: Row(
children: [
Icon(Icons.question_mark_rounded),
SizedBox(width: 10),
Text("Soporte"),
],
),
),
Container(
padding: EdgeInsets.all(20),
width: double.infinity,
child: Row(
children: [
Icon(Icons.messenger_outline),
SizedBox(width: 10),
Text("Mensajes"),
],
),
),
Container(
padding: EdgeInsets.all(20),
width: double.infinity,
color: Color(0xFF2BA4EC),
child: Row(
children: [
Text(
"Solicitar servicio",
style: TextStyle(
fontWeight: FontWeight.bold,
color: Colors.white, color: Colors.white,
fontSize: 15, size: 55,
), ),
), ),
SizedBox(width: 105), trailing: Icon(Icons.keyboard_arrow_right,
Icon( color: Colors.black),
Icons.keyboard_arrow_right_outlined, contentPadding:
color: Colors.white, EdgeInsets.symmetric(vertical: 20, horizontal: 16),
), ),
],
), ),
), ], // padding: const EdgeInsets.only(top: 20, bottom: 15),
Row( ),
mainAxisAlignment: MainAxisAlignment.center, Divider(height: 0, color: Colors.grey),
children: [ Column(
Text(
'Prosapp',
style: TextStyle(fontSize: 10, color: Colors.grey[700]),
),
Padding(
padding:
const EdgeInsets.only(top: 7, left: 3, right: 3),
child: Text(
'®',
style:
TextStyle(fontSize: 25, color: Colors.grey[700]),
),
),
Text(
'todos los derechos reservados',
style: TextStyle(fontSize: 10, color: Colors.grey[700]),
),
],
),
],
),
),
Align(
alignment: Alignment.bottomRight,
child: Padding(
padding: const EdgeInsets.only(top: 120),
child: Row(
children: [ children: [
SizedBox(width: 10), ListTile(
ElevatedButton( onTap: () {},
onPressed: () { leading: Icon(
AuthenticationRepository.instance.logout(); Icons.history,
}, color: Colors.black,
child: Transform.rotate(
angle: 180 * 3.1416 / 180,
child: Icon(
Icons.logout_outlined,
color: Colors.red,
size: 35,
),
), ),
style: ElevatedButton.styleFrom( title: Text(
primary: Colors.white, 'Mis servicios',
shape: CircleBorder(), style: TextStyle(fontSize: 15),
elevation: 3,
minimumSize: Size(45, 45),
), ),
), ),
SizedBox(width: 5), ListTile(
ElevatedButton( onTap: () {
onPressed: () {}, Navigator.pushNamed(context, '/profile');
child: Text( },
'Modo profesional', leading: Icon(
style: TextStyle( Icons.person_outline,
color: Colors.black,
),
title: Text(
'Mi perfil',
style: TextStyle(fontSize: 15),
),
),
ListTile(
onTap: () {},
leading: Icon(
Icons.construction_outlined,
color: Colors.black,
),
title: Text(
'Configuración',
style: TextStyle(fontSize: 15),
),
),
ListTile(
onTap: () {},
leading: Icon(
Icons.question_mark_rounded,
color: Colors.black,
),
title: Text(
'Soporte',
style: TextStyle(fontSize: 15),
),
),
ListTile(
onTap: () {},
leading: Icon(
Icons.messenger_outline,
color: Colors.black,
),
title: Text(
'Mensajes',
style: TextStyle(fontSize: 15),
),
),
Builder(builder: (BuildContext context) {
return ListTile(
onTap: () {
Scaffold.of(context).openEndDrawer();
},
trailing: Icon(
Icons.keyboard_arrow_right,
color: Colors.white, color: Colors.white,
fontSize: 15,
), ),
), title: Text(
style: ElevatedButton.styleFrom( 'Solicitar servicio',
primary: Color(0xFF2BA4EC), style: TextStyle(
shape: RoundedRectangleBorder( color: Colors.white,
borderRadius: BorderRadius.circular(50), fontSize: 17,
fontWeight: FontWeight.bold),
), ),
elevation: 0, tileColor: Color(0xFF2BA4EC),
minimumSize: Size(200, 45), contentPadding:
EdgeInsets.symmetric(vertical: 5, horizontal: 16),
);
}),
],
),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
'Prosapp',
style: TextStyle(fontSize: 10, color: Colors.grey[700]),
),
Padding(
padding: const EdgeInsets.only(top: 7, left: 3, right: 3),
child: Text(
'®',
style: TextStyle(fontSize: 25, color: Colors.grey[700]),
), ),
), ),
Text(
'todos los derechos reservados',
style: TextStyle(fontSize: 10, color: Colors.grey[700]),
),
], ],
), ),
],
),
Padding(
padding: const EdgeInsets.only(top: 200),
child: Row(
children: [
SizedBox(width: 10),
ElevatedButton(
onPressed: () {
AuthenticationRepository.instance.logout();
},
child: Icon(
Icons.logout_outlined,
color: Colors.red,
size: 35,
),
style: ElevatedButton.styleFrom(
primary: Colors.white,
shape: CircleBorder(),
elevation: 3,
minimumSize: Size(45, 45),
),
),
SizedBox(width: 5),
ElevatedButton(
onPressed: () {},
child: Text(
'Modo profesional',
style: TextStyle(
color: Colors.white,
fontSize: 15,
),
),
style: ElevatedButton.styleFrom(
primary: Color(0xFF2BA4EC),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(50),
),
elevation: 0,
minimumSize: Size(200, 45),
),
),
],
), ),
), ),
], ],
@@ -340,24 +319,6 @@ class _WelcomeScreenState extends State<WelcomeScreen> {
), ),
), ),
), ),
Container(
padding: const EdgeInsets.only(top: 370),
child: Form(
key: _formKey,
child: Column(
children: [
TextField(
controller: controller.name,
),
TextField(
controller: controller.email,
),
TextField(
controller: controller.city,
),
],
)),
),
Container( Container(
padding: const EdgeInsets.symmetric(horizontal: 0, vertical: 20), padding: const EdgeInsets.symmetric(horizontal: 0, vertical: 20),
margin: const EdgeInsets.only(top: 280, left: 50, right: 50), margin: const EdgeInsets.only(top: 280, left: 50, right: 50),
@@ -367,12 +328,12 @@ class _WelcomeScreenState extends State<WelcomeScreen> {
child: Center( child: Center(
child: ElevatedButton( child: ElevatedButton(
onPressed: () { onPressed: () {
AuthenticationRepository.instance.addNameAndEmail( // AuthenticationRepository.instance.addNameAndEmail(
uid, // uid,
controller.name.text.trim(), // controller.name.text.trim(),
controller.email.text.trim(), // controller.email.text.trim(),
controller.city.text.trim(), // controller.city.text.trim(),
); // );
}, },
child: Text( child: Text(
'Solicitar un servicio', 'Solicitar un servicio',