This commit is contained in:
Juan Felipe Duarte
2023-04-14 08:53:10 -05:00
parent 232ca3df46
commit 86e3b47693
6 changed files with 1021 additions and 980 deletions
+142 -131
View File
@@ -15,148 +15,159 @@ class CodeValidationScreen extends StatelessWidget {
var otp; var otp;
return SafeArea( return SafeArea(
child: Scaffold( child: Scaffold(
resizeToAvoidBottomInset: false, backgroundColor: const Color(0xFFD6F4FF),
backgroundColor: Color(0xFFD6F4FF), body: SingleChildScrollView(
body: Stack( reverse: true,
children: [ child: Stack(
Container( children: [
margin: const EdgeInsets.only(top: 280), Container(
width: double.infinity, margin: const EdgeInsets.only(top: 280),
height: 600, width: double.infinity,
decoration: const BoxDecoration( height: MediaQuery.of(context).size.height / 1.5,
color: Colors.white, decoration: const BoxDecoration(
borderRadius: BorderRadius.only( color: Colors.white,
topRight: Radius.circular(50), borderRadius: BorderRadius.only(
topLeft: Radius.circular(50))), topRight: Radius.circular(50),
), topLeft: Radius.circular(50))),
Container( ),
margin: const EdgeInsets.only(top: 120, left: 70, right: 70), Container(
child: const Image(image: AssetImage('images/logo_prosapp.png')), margin: const EdgeInsets.only(top: 120, left: 70, right: 70),
), child:
Container( const Image(image: AssetImage('images/logo_prosapp.png')),
padding: const EdgeInsets.symmetric(horizontal: 0, vertical: 20), ),
margin: const EdgeInsets.only(top: 280, left: 25), Container(
child: Row( padding:
children: <Widget>[ const EdgeInsets.symmetric(horizontal: 0, vertical: 20),
IconButton( margin: const EdgeInsets.only(top: 280, left: 25),
icon: Icon(
Icons.arrow_back,
size: 30,
),
onPressed: () {
Navigator.pop(context);
},
),
Text(
'Validar código',
style: TextStyle(
color: Color(0xFF262626),
fontSize: 38.0,
fontWeight: FontWeight.bold,
),
textAlign: TextAlign.right,
),
],
),
),
Container(
padding: const EdgeInsets.symmetric(horizontal: 0, vertical: 20),
margin: const EdgeInsets.only(top: 350, left: 50, right: 50),
child: Column(children: [
const Padding(
padding: EdgeInsets.only(bottom: 5),
child: Align(
alignment: Alignment.topLeft,
child: Text('Numero de celular',
style: TextStyle(
fontSize: 18.0, color: Color(0xFF65676B))),
)),
Padding(
padding: EdgeInsets.only(bottom: 20),
child: Row( child: Row(
children: [ children: <Widget>[
Expanded( IconButton(
child: TextField( icon: Icon(
onChanged: (value) { Icons.arrow_back,
phoneNumber = value; size: 30,
},
controller:
TextEditingController(text: phoneNumber ?? ''),
decoration: InputDecoration(
border: InputBorder.none,
hintText: '',
suffixIcon: Icon(Icons.edit),
),
), ),
),
TextButton(
child: Text('Reenviar código'),
onPressed: () { onPressed: () {
if (phoneNumber!.isNotEmpty) { Navigator.pop(context);
PhoneAuthController.instance.phoneAuthentication(
phoneNumber!,
);
}
}, },
), ),
Text(
'Validar código',
style: TextStyle(
color: Color(0xFF262626),
fontSize: 38.0,
fontWeight: FontWeight.bold,
),
textAlign: TextAlign.right,
),
], ],
), ),
), ),
Align( Container(
alignment: Alignment.topLeft, padding:
child: Padding( const EdgeInsets.symmetric(horizontal: 0, vertical: 20),
padding: const EdgeInsets.only(bottom: 5), margin: const EdgeInsets.only(top: 350, left: 50, right: 50),
child: Text('Codigo', child: Column(
textAlign: TextAlign.left, children: [
style: const Padding(
TextStyle(fontSize: 18.0, color: Color(0xFF65676B))), padding: EdgeInsets.only(bottom: 5),
child: Align(
alignment: Alignment.topLeft,
child: Text('Numero de celular',
style: TextStyle(
fontSize: 18.0, color: Color(0xFF65676B))),
)),
Padding(
padding: EdgeInsets.only(bottom: 20),
child: Row(
children: [
Expanded(
child: TextField(
onChanged: (value) {
phoneNumber = value;
},
controller: TextEditingController(
text: phoneNumber ?? ''),
decoration: InputDecoration(
border: InputBorder.none,
hintText: '',
suffixIcon: Icon(Icons.edit),
),
),
),
TextButton(
child: Text('Reenviar código'),
onPressed: () {
if (phoneNumber!.isNotEmpty) {
PhoneAuthController.instance
.phoneAuthentication(
phoneNumber!,
);
}
},
),
],
),
),
Align(
alignment: Alignment.topLeft,
child: Padding(
padding: const EdgeInsets.only(bottom: 5),
child: Text('Codigo',
textAlign: TextAlign.left,
style: TextStyle(
fontSize: 18.0, color: Color(0xFF65676B))),
),
),
Padding(
padding: EdgeInsets.only(bottom: 20),
child: OtpTextField(
numberOfFields: 6,
focusedBorderColor: Colors.blue,
fillColor: Colors.black.withOpacity(0.1),
filled: true,
keyboardType: TextInputType.number,
onSubmit: (code) {
otp = code;
OTPController.instance.verifyOTP(otp);
},
),
),
Padding(
padding: EdgeInsets.only(bottom: 40),
child: Center(
child: ElevatedButton(
onPressed: () {
OTPController.instance.verifyOTP(otp);
},
child: Text(
'Validar código',
style: TextStyle(
color: Colors.white,
fontWeight: FontWeight.bold,
fontSize: 18,
),
),
style: ElevatedButton.styleFrom(
primary: Color(0xFF2BA4EC), // Color del botón
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(
50), // Bordes redondeados
),
elevation: 0,
minimumSize:
Size(230, 60), // Tamaño mínimo del botón
),
),
),
),
],
), ),
), ),
Padding( ],
padding: EdgeInsets.only(bottom: 20),
child: OtpTextField(
numberOfFields: 6,
focusedBorderColor: Colors.blue,
fillColor: Colors.black.withOpacity(0.1),
filled: true,
keyboardType: TextInputType.number,
onSubmit: (code) {
otp = code;
OTPController.instance.verifyOTP(otp);
},
),
),
Padding(
padding: EdgeInsets.only(bottom: 40),
child: Center(
child: ElevatedButton(
onPressed: () {
OTPController.instance.verifyOTP(otp);
},
child: Text(
'Validar código',
style: TextStyle(
color: Colors.white,
fontWeight: FontWeight.bold,
fontSize: 18,
),
),
style: ElevatedButton.styleFrom(
primary: Color(0xFF2BA4EC), // Color del botón
shape: RoundedRectangleBorder(
borderRadius:
BorderRadius.circular(50), // Bordes redondeados
),
elevation: 0,
minimumSize: Size(230, 60), // Tamaño mínimo del botón
),
)),
),
]),
), ),
], ),
), ),
)); );
} }
} }
+146 -134
View File
@@ -23,153 +23,165 @@ class _LoginScreenState extends State<LoginScreen> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return SafeArea( return SafeArea(
child: Scaffold( child: Scaffold(
resizeToAvoidBottomInset: false, backgroundColor: const Color(0xFFD6F4FF),
backgroundColor: Color(0xFFD6F4FF), body: SingleChildScrollView(
body: Stack( reverse: true,
children: [ child: Stack(
Container( children: [
margin: const EdgeInsets.only(top: 280), Container(
width: double.infinity, margin: const EdgeInsets.only(top: 280),
height: 600, width: double.infinity,
decoration: const BoxDecoration( height: MediaQuery.of(context).size.height / 1.5,
color: Colors.white, decoration: const BoxDecoration(
borderRadius: BorderRadius.only( color: Colors.white,
topRight: Radius.circular(50), borderRadius: BorderRadius.only(
topLeft: Radius.circular(50))), topRight: Radius.circular(50),
), topLeft: Radius.circular(50))),
Container(
margin: const EdgeInsets.only(top: 120, left: 70, right: 70),
child: const Image(image: AssetImage('images/logo_prosapp.png')),
),
Container(
padding: const EdgeInsets.symmetric(horizontal: 0, vertical: 20),
margin: const EdgeInsets.only(top: 280, left: 30, right: 50),
child: Column(children: const [
Align(
alignment: Alignment.topLeft,
child: Text(
'Iniciar sesión',
style: TextStyle(
color: Color(0xFF262626),
fontSize: 38.0,
fontWeight: FontWeight.bold,
),
),
), ),
]), Container(
), margin: const EdgeInsets.only(top: 120, left: 70, right: 70),
Container( child:
padding: const EdgeInsets.symmetric(horizontal: 0, vertical: 20), const Image(image: AssetImage('images/logo_prosapp.png')),
margin: const EdgeInsets.only(top: 350, left: 50, right: 50), ),
child: Column(children: [ Container(
const Padding( padding:
padding: EdgeInsets.only(bottom: 5), const EdgeInsets.symmetric(horizontal: 0, vertical: 20),
child: Align( margin: const EdgeInsets.only(top: 280, left: 30, right: 50),
child: Column(children: const [
Align(
alignment: Alignment.topLeft, alignment: Alignment.topLeft,
child: Text('Numero de celular', child: Text(
style: TextStyle( 'Iniciar sesión',
fontSize: 18.0, color: Color(0xFF65676B))), style: TextStyle(
)), color: Color(0xFF262626),
Form( fontSize: 38.0,
key: _formKey, fontWeight: FontWeight.bold,
child: Padding( ),
padding: EdgeInsets.only(bottom: 5),
child: IntlPhoneField(
controller: controller.phoneNo,
initialCountryCode: 'CO',
onChanged: (phoneNo) {
completePhoneNumber = phoneNo.completeNumber;
},
decoration: InputDecoration(
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: Color(0xFFECECEC)),
borderRadius: BorderRadius.all(
Radius.circular(50),
)),
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(color: Color(0xFFECECEC)),
borderRadius: BorderRadius.all(
Radius.circular(50),
)),
fillColor: Color.fromARGB(255, 239, 239, 239),
filled: true,
), ),
), ),
), ]),
), ),
const Padding( Container(
padding: EdgeInsets.only(bottom: 30), padding:
child: Text('Un código será enviado a este numero de celular.', const EdgeInsets.symmetric(horizontal: 0, vertical: 20),
textAlign: TextAlign.center, margin: const EdgeInsets.only(top: 350, left: 50, right: 50),
style: TextStyle(fontSize: 13.0, color: Color(0xFF65676B))), child: Column(
),
Padding(
padding: const EdgeInsets.only(bottom: 30),
child: Center(
child: PrimaryButtom(
onPressed: () {
if (_formKey.currentState!.validate()) {
PhoneAuthController.instance.phoneAuthentication(
completePhoneNumber.trim(),
);
Get.to(
() => CodeValidationScreen(
phoneNumber: completePhoneNumber.trim(),
),
);
}
},
label: 'Enviar código',
),
),
),
Padding(
padding: EdgeInsets.only(bottom: 27),
child: GestureDetector(
onTap: () {
Navigator.pushNamed(context, '/login');
},
child: Text(
'Entrar con correo electronico',
style: TextStyle(
fontSize: 15.0, color: Color(0xFF65676B),
decoration: TextDecoration.underline, // Subrayado
),
),
),
),
RichText(
text: TextSpan(
style: TextStyle(
fontSize: 16.0,
color: Color(0xFF65676B),
fontFamily: 'Poppins',
),
children: [ children: [
TextSpan(text: 'No estas registrado? '), const Padding(
WidgetSpan( padding: EdgeInsets.only(bottom: 5),
child: GestureDetector( child: Align(
onTap: () { alignment: Alignment.topLeft,
Navigator.pushNamed(context, '/register'); child: Text('Numero de celular',
}, style: TextStyle(
child: Text( fontSize: 18.0, color: Color(0xFF65676B))),
'Registrarse', )),
style: TextStyle( Form(
fontSize: 16.0, key: _formKey,
color: Color(0xFF2BA4EC), child: Padding(
fontWeight: FontWeight.w600, padding: EdgeInsets.only(bottom: 5),
child: IntlPhoneField(
controller: controller.phoneNo,
initialCountryCode: 'CO',
onChanged: (phoneNo) {
completePhoneNumber = phoneNo.completeNumber;
},
decoration: InputDecoration(
enabledBorder: OutlineInputBorder(
borderSide:
BorderSide(color: Color(0xFFECECEC)),
borderRadius: BorderRadius.all(
Radius.circular(50),
)),
focusedBorder: OutlineInputBorder(
borderSide:
BorderSide(color: Color(0xFFECECEC)),
borderRadius: BorderRadius.all(
Radius.circular(50),
)),
fillColor: Color.fromARGB(255, 239, 239, 239),
filled: true,
), ),
), ),
), ),
), ),
const Padding(
padding: EdgeInsets.only(bottom: 30),
child: Text(
'Un código será enviado a este numero de celular.',
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 13.0, color: Color(0xFF65676B))),
),
Padding(
padding: const EdgeInsets.only(bottom: 30),
child: Center(
child: PrimaryButtom(
onPressed: () {
if (_formKey.currentState!.validate()) {
PhoneAuthController.instance.phoneAuthentication(
completePhoneNumber.trim(),
);
Get.to(
() => CodeValidationScreen(
phoneNumber: completePhoneNumber.trim(),
),
);
}
},
label: 'Enviar código',
),
),
),
Padding(
padding: EdgeInsets.only(bottom: 27),
child: GestureDetector(
onTap: () {
Navigator.pushNamed(context, '/login');
},
child: Text(
'Entrar con correo electronico',
style: TextStyle(
fontSize: 15.0, color: Color(0xFF65676B),
decoration: TextDecoration.underline, // Subrayado
),
),
),
),
RichText(
text: TextSpan(
style: TextStyle(
fontSize: 16.0,
color: Color(0xFF65676B),
fontFamily: 'Poppins',
),
children: [
TextSpan(text: 'No estas registrado? '),
WidgetSpan(
child: GestureDetector(
onTap: () {
Navigator.pushNamed(context, '/register');
},
child: Text(
'Registrarse',
style: TextStyle(
fontSize: 16.0,
color: Color(0xFF2BA4EC),
fontWeight: FontWeight.w600,
),
),
),
),
],
),
)
], ],
), ),
) ),
]), ],
), ),
], ),
), ),
)); );
} }
} }
+222 -219
View File
@@ -30,238 +30,241 @@ class _LoginEmailScreenState extends State<LoginEmailScreen> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return SafeArea( return SafeArea(
child: Scaffold( child: Scaffold(
resizeToAvoidBottomInset: false,
backgroundColor: Color(0xFFD6F4FF), backgroundColor: Color(0xFFD6F4FF),
body: Stack( body: SingleChildScrollView(
children: [ reverse: true,
Container( child: Stack(
margin: const EdgeInsets.only(top: 130), children: [
width: double.infinity, Container(
height: 800, margin: const EdgeInsets.only(top: 130),
decoration: const BoxDecoration( width: double.infinity,
color: Colors.white, height: 700,
borderRadius: BorderRadius.only( decoration: const BoxDecoration(
topRight: Radius.circular(50), color: Colors.white,
topLeft: Radius.circular(50))), borderRadius: BorderRadius.only(
), topRight: Radius.circular(50),
Container( topLeft: Radius.circular(50))),
margin: const EdgeInsets.only(top: 20, left: 30),
child: const Image(
image: AssetImage('images/logo_prosapp.png'),
width: 180,
height: 100,
), ),
), Container(
Container( margin: const EdgeInsets.only(top: 20, left: 30),
padding: const EdgeInsets.symmetric(horizontal: 0, vertical: 20), child: const Image(
margin: const EdgeInsets.only( image: AssetImage('images/logo_prosapp.png'),
top: 125, width: 180,
left: 25, height: 100,
),
), ),
child: Row( Container(
children: <Widget>[
IconButton(
icon: Icon(
Icons.arrow_back,
size: 30,
),
onPressed: () {
Navigator.pop(context);
},
),
Text(
'Iniciar sesión',
style: TextStyle(
color: Color(0xFF262626),
fontSize: 38.0,
fontWeight: FontWeight.bold,
),
textAlign: TextAlign.right,
),
],
),
),
Form(
key: _formKey,
child: Container(
padding: const EdgeInsets.symmetric(horizontal: 0, vertical: 20), padding: const EdgeInsets.symmetric(horizontal: 0, vertical: 20),
margin: const EdgeInsets.only(top: 210, left: 50, right: 50), margin: const EdgeInsets.only(
child: Column(children: [ top: 125,
Padding( left: 25,
padding: EdgeInsets.only(bottom: 20), ),
child: ElevatedButton( child: Row(
onPressed: () async { children: <Widget>[
await AuthenticationRepository.instance IconButton(
.signInWithGoogle(); icon: Icon(
}, Icons.arrow_back,
style: ElevatedButton.styleFrom( size: 30,
primary: Color(0xFF2BA4EC),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(50),
),
elevation: 0,
minimumSize: Size(230, 60),
),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
'Entrar con Google ',
style: TextStyle(
color: Colors.white,
fontWeight: FontWeight.bold,
fontSize: 18,
),
),
SizedBox(width: 5),
FaIcon(FontAwesomeIcons.google),
],
)),
),
Padding(
padding: EdgeInsets.symmetric(vertical: 5),
child: Row(
children: <Widget>[
Expanded(
child: Divider(
color: Colors.black38,
thickness: 1,
),
),
Padding(
padding: EdgeInsets.symmetric(horizontal: 10),
child: Text("ó"),
),
Expanded(
child: Divider(
color: Colors.black38,
thickness: 1,
),
),
],
),
),
const Padding(
padding: EdgeInsets.only(bottom: 5),
child: Align(
alignment: Alignment.topLeft,
child: Text('Email',
style: TextStyle(
fontSize: 18.0, color: Color(0xFF65676B))),
)),
Padding(
padding: EdgeInsets.only(bottom: 20),
child: TextFormField(
controller: controller.email,
decoration: InputDecoration(
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: Color(0xFFECECEC)),
borderRadius: BorderRadius.all(
Radius.circular(50),
)),
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(color: Color(0xFFECECEC)),
borderRadius: BorderRadius.all(
Radius.circular(50),
)),
hintText: 'Hello@gmail.com',
fillColor: Color.fromARGB(255, 239, 239, 239),
filled: true,
prefixIcon: Icon(Icons.email_outlined),
), ),
onPressed: () {
Navigator.pop(context);
},
), ),
), Text(
Padding( 'Iniciar sesión',
padding: EdgeInsets.only(bottom: 5),
child: Align(
alignment: Alignment.topLeft,
child: Text('Password',
style: TextStyle(
fontSize: 18.0, color: Color(0xFF65676B))),
)),
Padding(
padding: EdgeInsets.only(bottom: 50),
child: TextFormField(
controller: controller.password,
obscureText: _obscureText,
decoration: InputDecoration(
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: Color(0xFFECECEC)),
borderRadius: BorderRadius.all(
Radius.circular(50),
)),
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(color: Color(0xFFECECEC)),
borderRadius: BorderRadius.all(
Radius.circular(50),
)),
hintText: 'Contraseña',
fillColor: Color.fromARGB(255, 239, 239, 239),
filled: true,
prefixIcon: Icon(Icons.lock_outline),
suffixIcon: IconButton(
icon: Icon(
_obscureText
? Icons.visibility
: Icons.visibility_off,
color: Colors.grey,
),
onPressed: () {
setState(() {
_obscureText = !_obscureText;
});
},
),
),
),
),
Padding(
padding: const EdgeInsets.only(bottom: 40),
child: Center(
child: PrimaryButtom(
onPressed: () {
if (_formKey.currentState!.validate()) {
LoginEmailController.instance.loginUser(
controller.email.text.trim(),
controller.password.text.trim(),
);
}
},
label: 'Iniciar'),
),
),
RichText(
text: TextSpan(
style: TextStyle( style: TextStyle(
fontSize: 16.0, color: Color(0xFF262626),
color: Color(0xFF65676B), fontSize: 38.0,
fontFamily: 'Poppins', fontWeight: FontWeight.bold,
), ),
children: [ textAlign: TextAlign.right,
TextSpan(text: 'No estas registrado? '), ),
WidgetSpan( ],
child: GestureDetector( ),
onTap: () { ),
Navigator.pushReplacementNamed( Form(
context, '/register'); key: _formKey,
}, child: Container(
child: Text( padding:
'Registrarse', const EdgeInsets.symmetric(horizontal: 0, vertical: 20),
margin: const EdgeInsets.only(top: 210, left: 50, right: 50),
child: Column(children: [
Padding(
padding: EdgeInsets.only(bottom: 20),
child: ElevatedButton(
onPressed: () async {
await AuthenticationRepository.instance
.signInWithGoogle();
},
style: ElevatedButton.styleFrom(
primary: Color(0xFF2BA4EC),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(50),
),
elevation: 0,
minimumSize: Size(230, 60),
),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
'Entrar con Google ',
style: TextStyle(
color: Colors.white,
fontWeight: FontWeight.bold,
fontSize: 18,
),
),
SizedBox(width: 5),
FaIcon(FontAwesomeIcons.google),
],
)),
),
Padding(
padding: EdgeInsets.symmetric(vertical: 5),
child: Row(
children: <Widget>[
Expanded(
child: Divider(
color: Colors.black38,
thickness: 1,
),
),
Padding(
padding: EdgeInsets.symmetric(horizontal: 10),
child: Text("ó"),
),
Expanded(
child: Divider(
color: Colors.black38,
thickness: 1,
),
),
],
),
),
const Padding(
padding: EdgeInsets.only(bottom: 5),
child: Align(
alignment: Alignment.topLeft,
child: Text('Email',
style: TextStyle( style: TextStyle(
fontSize: 16.0, fontSize: 18.0, color: Color(0xFF65676B))),
color: Color(0xFF2BA4EC), )),
fontWeight: FontWeight.w600, Padding(
padding: EdgeInsets.only(bottom: 20),
child: TextFormField(
controller: controller.email,
decoration: InputDecoration(
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: Color(0xFFECECEC)),
borderRadius: BorderRadius.all(
Radius.circular(50),
)),
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(color: Color(0xFFECECEC)),
borderRadius: BorderRadius.all(
Radius.circular(50),
)),
hintText: 'Hello@gmail.com',
fillColor: Color.fromARGB(255, 239, 239, 239),
filled: true,
prefixIcon: Icon(Icons.email_outlined),
),
),
),
Padding(
padding: EdgeInsets.only(bottom: 5),
child: Align(
alignment: Alignment.topLeft,
child: Text('Password',
style: TextStyle(
fontSize: 18.0, color: Color(0xFF65676B))),
)),
Padding(
padding: EdgeInsets.only(bottom: 50),
child: TextFormField(
controller: controller.password,
obscureText: _obscureText,
decoration: InputDecoration(
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: Color(0xFFECECEC)),
borderRadius: BorderRadius.all(
Radius.circular(50),
)),
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(color: Color(0xFFECECEC)),
borderRadius: BorderRadius.all(
Radius.circular(50),
)),
hintText: 'Contraseña',
fillColor: Color.fromARGB(255, 239, 239, 239),
filled: true,
prefixIcon: Icon(Icons.lock_outline),
suffixIcon: IconButton(
icon: Icon(
_obscureText
? Icons.visibility
: Icons.visibility_off,
color: Colors.grey,
),
onPressed: () {
setState(() {
_obscureText = !_obscureText;
});
},
),
),
),
),
Padding(
padding: const EdgeInsets.only(bottom: 40),
child: Center(
child: PrimaryButtom(
onPressed: () {
if (_formKey.currentState!.validate()) {
LoginEmailController.instance.loginUser(
controller.email.text.trim(),
controller.password.text.trim(),
);
}
},
label: 'Iniciar'),
),
),
RichText(
text: TextSpan(
style: TextStyle(
fontSize: 16.0,
color: Color(0xFF65676B),
fontFamily: 'Poppins',
),
children: [
TextSpan(text: 'No estas registrado? '),
WidgetSpan(
child: GestureDetector(
onTap: () {
Navigator.pushReplacementNamed(
context, '/register');
},
child: Text(
'Registrarse',
style: TextStyle(
fontSize: 16.0,
color: Color(0xFF2BA4EC),
fontWeight: FontWeight.w600,
),
), ),
), ),
), ),
), ],
], ),
), )
) ]),
]), ),
), ),
), ],
], ),
), ),
)); ));
} }
+174 -168
View File
@@ -5,6 +5,7 @@ import 'package:firebase_auth/firebase_auth.dart';
import 'package:firebase_storage/firebase_storage.dart'; import 'package:firebase_storage/firebase_storage.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:get/get_connect/http/src/utils/utils.dart';
import 'package:prosappco/src/authentication/authentication_repository.dart'; import 'package:prosappco/src/authentication/authentication_repository.dart';
import 'package:prosappco/src/components/photo_view.dart'; import 'package:prosappco/src/components/photo_view.dart';
import 'package:prosappco/src/components/pop_appbar.dart'; import 'package:prosappco/src/components/pop_appbar.dart';
@@ -453,198 +454,201 @@ class ProfessionalProfileScreenState extends State<ProfessionalProfileScreen> {
final User? user = FirebaseAuth.instance.currentUser; final User? user = FirebaseAuth.instance.currentUser;
String profession = _profession.toString(); String profession = _profession.toString();
double _space = 10; double _space = 10;
return SafeArea( return SafeArea(
child: Scaffold( child: Scaffold(
resizeToAvoidBottomInset: false,
appBar: PopAppbar( appBar: PopAppbar(
onPressed: () { onPressed: () {
Navigator.pop(context); Navigator.pop(context);
}, },
label: 'Perfil profesional'), label: 'Perfil profesional'),
body: Center( body: SingleChildScrollView(
child: Column( reverse: true,
children: [ child: Center(
GestureDetector( child: Column(
onTap: () { children: [
_showChoiceDialog(context); GestureDetector(
}, onTap: () {
child: Container( _showChoiceDialog(context);
margin: const EdgeInsets.symmetric(vertical: 25), },
child: (imagen_to_upload != null) child: Container(
? LocalPhoto( margin: const EdgeInsets.symmetric(vertical: 25),
file: imagen_to_upload!, child: (imagen_to_upload != null)
) ? LocalPhoto(
: ReferencePhoto( file: imagen_to_upload!,
ref: storage.ref().child(_photo), )
size: 100, : ReferencePhoto(
sizeCircle: 100, ref: storage.ref().child(_photo),
), size: 100,
sizeCircle: 100,
),
),
), ),
), Container(
Container( width: 300,
width: 300, padding: const EdgeInsets.only(top: 0),
padding: const EdgeInsets.only(top: 0), child: Form(
child: Form( key: _formKey,
key: _formKey, child: Column(
child: Column( children: [
children: [ TextFormField(
TextFormField( controller: _cedulaController,
controller: _cedulaController, decoration: InputDecoration(
decoration: InputDecoration( prefixIcon: Icon(Icons.person_outline),
prefixIcon: Icon(Icons.person_outline), hintText: 'Cedula (Obligatorio)'),
hintText: 'Cedula (Obligatorio)'), ),
), SizedBox(height: _space),
SizedBox(height: _space), ElevatedButton(
ElevatedButton( onPressed: () {
onPressed: () { _showChoiceDialogCedula(context);
_showChoiceDialogCedula(context); },
}, child: Row(
child: Row( mainAxisAlignment: MainAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center, children: [
children: [ Text(
Text( 'Cedula',
'Cedula', style: TextStyle(
style: TextStyle( color: Color(0xFF2BA4EC),
color: Color(0xFF2BA4EC), fontSize: 17,
fontSize: 17, ),
), ),
SizedBox(width: 15),
Icon(
image_cedula != null
? Icons.check
: Icons.file_upload_outlined,
color: Color(0xFF2BA4EC),
size: 30,
),
],
),
style: ElevatedButton.styleFrom(
backgroundColor: Color(0xFFD6F4FF),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(50),
), ),
SizedBox(width: 15), elevation: 0,
Icon( minimumSize: Size(250, 50),
image_cedula != null
? Icons.check
: Icons.file_upload_outlined,
color: Color(0xFF2BA4EC),
size: 30,
),
],
),
style: ElevatedButton.styleFrom(
backgroundColor: Color(0xFFD6F4FF),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(50),
), ),
elevation: 0,
minimumSize: Size(250, 50),
), ),
), SizedBox(height: _space),
SizedBox(height: _space), TextFormField(
TextFormField( readOnly: true,
readOnly: true, onTap: () async {
onTap: () async { final String? profesion =
final String? profesion = (await Navigator.pushNamed( (await Navigator.pushNamed(
context, '/profession')) as String?; context, '/profession')) as String?;
if (profesion != null) { if (profesion != null) {
setState(() {
_profession = profesion;
});
}
},
decoration: InputDecoration(
prefixIcon:
const Icon(Icons.assignment_ind_rounded),
suffixIcon: const Icon(Icons.arrow_drop_down),
hintStyle: profession == ''
? const TextStyle()
: const TextStyle(color: Colors.black87),
hintText: profession == ''
? 'Profesión (Obligatorio)'
: profession),
),
SizedBox(height: _space),
ElevatedButton(
onPressed: () {
_showChoiceDialogCertificado(context);
},
style: ElevatedButton.styleFrom(
backgroundColor: const Color(0xFFD6F4FF),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(50),
),
elevation: 0,
minimumSize: const Size(250, 50),
),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
const Text(
'Certificado profesional',
style: TextStyle(
color: Color(0xFF2BA4EC),
fontSize: 17,
),
),
const SizedBox(width: 15),
Icon(
image_certificado != null
? Icons.check
: Icons.file_upload_outlined,
color: const Color(0xFF2BA4EC),
size: 30,
),
],
),
),
SizedBox(height: _space),
TextFormField(
controller: _especializacionController,
decoration: const InputDecoration(
prefixIcon: Icon(Icons.assignment_ind_rounded),
hintText: 'Especialización'),
),
SizedBox(height: _space),
ElevatedButton(
onPressed: () async {
final images = await getImage(3);
setState(() { setState(() {
_profession = profesion; images_especializacion =
images.map((e) => File(e!.path)).toList();
}); });
} },
}, style: ElevatedButton.styleFrom(
decoration: InputDecoration( backgroundColor: const Color(0xFFD6F4FF),
prefixIcon: shape: RoundedRectangleBorder(
const Icon(Icons.assignment_ind_rounded), borderRadius: BorderRadius.circular(50),
suffixIcon: const Icon(Icons.arrow_drop_down), ),
hintStyle: profession == '' elevation: 0,
? const TextStyle() minimumSize: const Size(250, 50),
: const TextStyle(color: Colors.black87),
hintText: profession == ''
? 'Profesión (Obligatorio)'
: profession),
),
SizedBox(height: _space),
ElevatedButton(
onPressed: () {
_showChoiceDialogCertificado(context);
},
style: ElevatedButton.styleFrom(
backgroundColor: const Color(0xFFD6F4FF),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(50),
), ),
elevation: 0, child: Row(
minimumSize: const Size(250, 50), mainAxisAlignment: MainAxisAlignment.center,
), children: [
child: Row( const Text(
mainAxisAlignment: MainAxisAlignment.center, 'Especialización',
children: [ style: TextStyle(
const Text( color: Color(0xFF2BA4EC),
'Certificado profesional', fontSize: 17,
style: TextStyle( ),
color: Color(0xFF2BA4EC),
fontSize: 17,
), ),
), const SizedBox(width: 15),
const SizedBox(width: 15), Icon(
Icon( images_especializacion.isEmpty
image_certificado != null ? Icons.file_upload_outlined
? Icons.check : Icons.check,
: Icons.file_upload_outlined, color: const Color(0xFF2BA4EC),
color: const Color(0xFF2BA4EC), size: 30,
size: 30, ),
), ],
],
),
),
SizedBox(height: _space),
TextFormField(
controller: _especializacionController,
decoration: const InputDecoration(
prefixIcon: Icon(Icons.assignment_ind_rounded),
hintText: 'Especialización'),
),
SizedBox(height: _space),
ElevatedButton(
onPressed: () async {
final images = await getImage(3);
setState(() {
images_especializacion =
images.map((e) => File(e!.path)).toList();
});
},
style: ElevatedButton.styleFrom(
backgroundColor: const Color(0xFFD6F4FF),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(50),
), ),
elevation: 0,
minimumSize: const Size(250, 50),
), ),
child: Row( ],
mainAxisAlignment: MainAxisAlignment.center, )),
children: [ ),
const Text( Container(
'Especialización',
style: TextStyle(
color: Color(0xFF2BA4EC),
fontSize: 17,
),
),
const SizedBox(width: 15),
Icon(
images_especializacion.isEmpty
? Icons.file_upload_outlined
: Icons.check,
color: const Color(0xFF2BA4EC),
size: 30,
),
],
),
),
],
)),
),
Container(
alignment: Alignment.bottomCenter, alignment: Alignment.bottomCenter,
margin: const EdgeInsets.only(top: 120, right: 70, left: 70), margin: const EdgeInsets.only(
top: 80, right: 70, left: 70, bottom: 30),
child: ElevatedButton( child: ElevatedButton(
onPressed: () { onPressed: () {
sendInfo(); sendInfo();
}, },
style: ElevatedButton.styleFrom( style: ElevatedButton.styleFrom(
backgroundColor: Color(0xFF2BA4EC), backgroundColor: const Color(0xFF2BA4EC),
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(50), borderRadius: BorderRadius.circular(50),
), ),
@@ -670,8 +674,10 @@ class ProfessionalProfileScreenState extends State<ProfessionalProfileScreen> {
), ),
], ],
), ),
)), ),
], ),
],
),
), ),
), ),
)); ));
+120 -115
View File
@@ -350,7 +350,6 @@ class _ProfileScreenState extends State<ProfileScreen> {
return SafeArea( return SafeArea(
child: Scaffold( child: Scaffold(
resizeToAvoidBottomInset: false,
appBar: AppBar( appBar: AppBar(
backgroundColor: Colors.white, backgroundColor: Colors.white,
iconTheme: const IconThemeData( iconTheme: const IconThemeData(
@@ -369,120 +368,123 @@ class _ProfileScreenState extends State<ProfileScreen> {
userPhoneNumber: user?.phoneNumber ?? '', userPhoneNumber: user?.phoneNumber ?? '',
userCity: city, userCity: city,
userState: state), userState: state),
body: Center( body: SingleChildScrollView(
child: Column( reverse: true,
children: [ child: Center(
GestureDetector( child: Column(
onTap: () { children: [
_showChoiceDialog(context); GestureDetector(
}, onTap: () {
child: Container( _showChoiceDialog(context);
margin: const EdgeInsets.symmetric(vertical: 50), },
child: (imagen_to_upload != null) child: Container(
? LocalPhoto( margin: const EdgeInsets.symmetric(vertical: 50),
file: imagen_to_upload!, child: (imagen_to_upload != null)
) ? LocalPhoto(
: ReferencePhoto( file: imagen_to_upload!,
ref: storage.ref().child(_photo), )
)), : ReferencePhoto(
), ref: storage.ref().child(_photo),
Container( )),
width: 300, ),
padding: const EdgeInsets.only(top: 0), Container(
child: Form( width: 300,
key: _formKey, padding: const EdgeInsets.only(top: 0),
child: Column( child: Form(
children: [ key: _formKey,
TextFormField( child: Column(
controller: _nameController, children: [
decoration: const InputDecoration( TextFormField(
prefixIcon: Icon(Icons.person_outline), controller: _nameController,
hintText: 'Nombre (Obligatorio)'), decoration: const InputDecoration(
), prefixIcon: Icon(Icons.person_outline),
const SizedBox( hintText: 'Nombre (Obligatorio)'),
height: ),
20.0), // Agrega espacio vertical entre los TextFormFields const SizedBox(
_email != null height:
? TextFormField( 20.0), // Agrega espacio vertical entre los TextFormFields
onTap: () { _email != null
Navigator.pushNamed( ? TextFormField(
context, '/nuevaPassword'); onTap: () {
}, Navigator.pushNamed(
readOnly: true, context, '/nuevaPassword');
controller: _emailController, },
decoration: const InputDecoration( readOnly: true,
prefixIcon: Icon(Icons.email_outlined), controller: _emailController,
hintText: 'Email (Obligatorio)'), decoration: const InputDecoration(
) prefixIcon: Icon(Icons.email_outlined),
: TextFormField( hintText: 'Email (Obligatorio)'),
controller: _emailController, )
decoration: const InputDecoration( : TextFormField(
prefixIcon: Icon(Icons.email_outlined), controller: _emailController,
hintText: 'Email (Obligatorio)'), decoration: const InputDecoration(
), prefixIcon: Icon(Icons.email_outlined),
const SizedBox(height: 20.0), hintText: 'Email (Obligatorio)'),
_email != null ),
? const SizedBox.shrink() const SizedBox(height: 20.0),
: TextFormField( _email != null
controller: _passwordController, ? const SizedBox.shrink()
obscureText: _obscureText, : TextFormField(
decoration: InputDecoration( controller: _passwordController,
prefixIcon: const Icon(Icons.lock_outline), obscureText: _obscureText,
suffixIcon: IconButton( decoration: InputDecoration(
icon: Icon( prefixIcon:
_obscureText const Icon(Icons.lock_outline),
? Icons.visibility suffixIcon: IconButton(
: Icons.visibility_off, icon: Icon(
color: Colors.grey, _obscureText
? Icons.visibility
: Icons.visibility_off,
color: Colors.grey,
),
onPressed: () {
setState(() {
_obscureText = !_obscureText;
});
},
), ),
onPressed: () { hintText: 'Contraseña (Obligatorio)'),
setState(() { ),
_obscureText = !_obscureText; _email != null
}); ? const SizedBox.shrink()
}, : const SizedBox(height: 20.0),
), TextFormField(
hintText: 'Contraseña (Obligatorio)'), readOnly: true,
), onTap: () async {
_email != null final String? ciudad =
? const SizedBox.shrink() (await Navigator.pushNamed(context, '/city'))
: const SizedBox(height: 20.0), as String?;
TextFormField(
readOnly: true,
onTap: () async {
final String? ciudad =
(await Navigator.pushNamed(context, '/city'))
as String?;
if (ciudad != null) { if (ciudad != null) {
setState(() { setState(() {
_ciudad = ciudad as String; _ciudad = ciudad as String;
}); });
} }
}, },
decoration: InputDecoration( decoration: InputDecoration(
prefixIcon: Icon(Icons.near_me), prefixIcon: Icon(Icons.near_me),
suffixIcon: Icon(Icons.arrow_drop_down), suffixIcon: Icon(Icons.arrow_drop_down),
hintStyle: city == '' hintStyle: city == ''
? TextStyle() ? TextStyle()
: TextStyle(color: Colors.black87), : TextStyle(color: Colors.black87),
hintText: city == '' ? 'Ciudad' : '$city'), hintText: city == '' ? 'Ciudad' : '$city'),
), ),
const SizedBox(height: 20.0), const SizedBox(height: 20.0),
TextFormField( TextFormField(
controller: _phoneNumberController, controller: _phoneNumberController,
readOnly: true, readOnly: true,
onTap: () { onTap: () {
Navigator.pushNamed(context, '/newNumber'); Navigator.pushNamed(context, '/newNumber');
}, },
decoration: InputDecoration( decoration: InputDecoration(
prefixIcon: Icon(Icons.phone_android), prefixIcon: Icon(Icons.phone_android),
suffixIcon: Icon(Icons.edit_outlined), suffixIcon: Icon(Icons.edit_outlined),
hintText: '+57'), hintText: '+57'),
), ),
], ],
)), )),
), ),
Container( Container(
alignment: Alignment.bottomCenter, alignment: Alignment.bottomCenter,
margin: EdgeInsets.only(top: 100), margin: EdgeInsets.only(top: 100),
child: ElevatedButton( child: ElevatedButton(
@@ -505,8 +507,11 @@ class _ProfileScreenState extends State<ProfileScreen> {
elevation: 0, elevation: 0,
minimumSize: Size(200, 50), minimumSize: Size(200, 50),
), ),
)), ),
], padding: EdgeInsets.only(bottom: 30),
),
],
),
), ),
), ),
), ),
+217 -213
View File
@@ -26,135 +26,171 @@ class _RegisterScreenState extends State<RegisterScreen> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return SafeArea( return SafeArea(
child: Scaffold( child: Scaffold(
resizeToAvoidBottomInset: false, backgroundColor: const Color(0xFFD6F4FF),
backgroundColor: Color(0xFFD6F4FF),
body: GestureDetector( body: GestureDetector(
onTap: () => FocusScope.of(context).unfocus(), onTap: () => FocusScope.of(context).unfocus(),
child: Stack( child: SingleChildScrollView(
children: [ reverse: true,
Container( child: Stack(
margin: const EdgeInsets.only(top: 130), children: [
width: double.infinity, Container(
height: 800, margin: const EdgeInsets.only(top: 130),
decoration: const BoxDecoration( width: double.infinity,
color: Colors.white, height: 700,
borderRadius: BorderRadius.only( decoration: const BoxDecoration(
topRight: Radius.circular(50), color: Colors.white,
topLeft: Radius.circular(50))), borderRadius: BorderRadius.only(
), topRight: Radius.circular(50),
Container( topLeft: Radius.circular(50))),
margin: const EdgeInsets.only(top: 20, left: 30),
child: const Image(
image: AssetImage('images/logo_prosapp.png'),
width: 180,
height: 100,
), ),
), Container(
Container( margin: const EdgeInsets.only(top: 20, left: 30),
padding: const EdgeInsets.symmetric(horizontal: 0, vertical: 20), child: const Image(
margin: const EdgeInsets.only( image: AssetImage('images/logo_prosapp.png'),
top: 125, width: 180,
left: 25, height: 100,
),
), ),
child: Row( Container(
children: <Widget>[ padding:
IconButton( const EdgeInsets.symmetric(horizontal: 0, vertical: 20),
icon: Icon( margin: const EdgeInsets.only(
Icons.arrow_back, top: 125,
size: 30, left: 25,
), ),
onPressed: () { child: Row(
Navigator.pop(context); children: <Widget>[
}, IconButton(
), icon: Icon(
Text( Icons.arrow_back,
'Registro', size: 30,
style: TextStyle(
color: Color(0xFF262626),
fontSize: 38.0,
fontWeight: FontWeight.bold,
),
textAlign: TextAlign.right,
),
],
),
),
Container(
padding: const EdgeInsets.symmetric(horizontal: 0, vertical: 20),
margin: const EdgeInsets.only(top: 200, left: 50, right: 50),
child: Column(children: [
Padding(
padding: EdgeInsets.only(bottom: 20),
child: ElevatedButton(
onPressed: () async {
await AuthenticationRepository.instance
.signInWithGoogle();
},
style: ElevatedButton.styleFrom(
primary: Color(0xFF2BA4EC),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(50),
),
elevation: 0,
minimumSize: Size(230, 60),
), ),
child: Row( onPressed: () {
mainAxisAlignment: MainAxisAlignment.center, Navigator.pop(context);
},
),
Text(
'Registro',
style: TextStyle(
color: Color(0xFF262626),
fontSize: 38.0,
fontWeight: FontWeight.bold,
),
textAlign: TextAlign.right,
),
],
),
),
Container(
padding:
const EdgeInsets.symmetric(horizontal: 0, vertical: 20),
margin: const EdgeInsets.only(top: 200, left: 50, right: 50),
child: Column(children: [
Padding(
padding: EdgeInsets.only(bottom: 20),
child: ElevatedButton(
onPressed: () async {
await AuthenticationRepository.instance
.signInWithGoogle();
},
style: ElevatedButton.styleFrom(
primary: Color(0xFF2BA4EC),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(50),
),
elevation: 0,
minimumSize: Size(230, 60),
),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
'Entrar con Google ',
style: TextStyle(
color: Colors.white,
fontWeight: FontWeight.bold,
fontSize: 18,
),
),
SizedBox(width: 5),
FaIcon(FontAwesomeIcons.google),
],
)),
),
Padding(
padding: EdgeInsets.symmetric(vertical: 0),
child: Row(
children: <Widget>[
Expanded(
child: Divider(
color: Colors.black38,
thickness: 1,
),
),
Padding(
padding: EdgeInsets.symmetric(horizontal: 10),
child: Text("ó"),
),
Expanded(
child: Divider(
color: Colors.black38,
thickness: 1,
),
),
],
),
),
Form(
key: _formKey,
child: Column(
children: [ children: [
Text( const Padding(
'Entrar con Google ', padding: EdgeInsets.only(bottom: 5),
style: TextStyle( child: Align(
color: Colors.white, alignment: Alignment.topLeft,
fontWeight: FontWeight.bold, child: Text('Email',
fontSize: 18, style: TextStyle(
fontSize: 18.0,
color: Color(0xFF65676B))),
)),
Padding(
padding: EdgeInsets.only(bottom: 18),
child: TextFormField(
controller: controller.email,
decoration: InputDecoration(
enabledBorder: OutlineInputBorder(
borderSide:
BorderSide(color: Color(0xFFECECEC)),
borderRadius: BorderRadius.all(
Radius.circular(50),
)),
focusedBorder: OutlineInputBorder(
borderSide:
BorderSide(color: Color(0xFFECECEC)),
borderRadius: BorderRadius.all(
Radius.circular(50),
)),
hintText: 'Hello@gmail.com',
fillColor: Color.fromARGB(255, 239, 239, 239),
filled: true,
prefixIcon: Icon(Icons.email_outlined)),
), ),
), ),
SizedBox(width: 5), const Padding(
FaIcon(FontAwesomeIcons.google), padding: EdgeInsets.only(bottom: 5),
], child: Align(
)), alignment: Alignment.topLeft,
), child: Text('Password',
Padding( style: TextStyle(
padding: EdgeInsets.symmetric(vertical: 0), fontSize: 18.0,
child: Row( color: Color(0xFF65676B))),
children: <Widget>[ )),
Expanded( Padding(
child: Divider( padding: const EdgeInsets.only(bottom: 25),
color: Colors.black38, child: TextFormField(
thickness: 1, controller: controller.password,
), obscureText: _obscureText,
), decoration: InputDecoration(
Padding(
padding: EdgeInsets.symmetric(horizontal: 10),
child: Text("ó"),
),
Expanded(
child: Divider(
color: Colors.black38,
thickness: 1,
),
),
],
),
),
Form(
key: _formKey,
child: Column(
children: [
const Padding(
padding: EdgeInsets.only(bottom: 5),
child: Align(
alignment: Alignment.topLeft,
child: Text('Email',
style: TextStyle(
fontSize: 18.0,
color: Color(0xFF65676B))),
)),
Padding(
padding: EdgeInsets.only(bottom: 18),
child: TextFormField(
controller: controller.email,
decoration: InputDecoration(
enabledBorder: OutlineInputBorder( enabledBorder: OutlineInputBorder(
borderSide: borderSide:
BorderSide(color: Color(0xFFECECEC)), BorderSide(color: Color(0xFFECECEC)),
@@ -167,107 +203,75 @@ class _RegisterScreenState extends State<RegisterScreen> {
borderRadius: BorderRadius.all( borderRadius: BorderRadius.all(
Radius.circular(50), Radius.circular(50),
)), )),
hintText: 'Hello@gmail.com', hintText: 'Contraseña',
fillColor: Color.fromARGB(255, 239, 239, 239), fillColor: Color.fromARGB(255, 239, 239, 239),
filled: true, filled: true,
prefixIcon: Icon(Icons.email_outlined)), prefixIcon: Icon(Icons.lock_outline),
), suffixIcon: IconButton(
), icon: Icon(
const Padding( _obscureText
padding: EdgeInsets.only(bottom: 5), ? Icons.visibility
child: Align( : Icons.visibility_off,
alignment: Alignment.topLeft, color: Colors.grey,
child: Text('Password', ),
style: TextStyle( onPressed: () {
fontSize: 18.0, setState(() {
color: Color(0xFF65676B))), _obscureText = !_obscureText;
)), });
Padding( },
padding: const EdgeInsets.only(bottom: 25),
child: TextFormField(
controller: controller.password,
obscureText: _obscureText,
decoration: InputDecoration(
enabledBorder: OutlineInputBorder(
borderSide:
BorderSide(color: Color(0xFFECECEC)),
borderRadius: BorderRadius.all(
Radius.circular(50),
)),
focusedBorder: OutlineInputBorder(
borderSide:
BorderSide(color: Color(0xFFECECEC)),
borderRadius: BorderRadius.all(
Radius.circular(50),
)),
hintText: 'Contraseña',
fillColor: Color.fromARGB(255, 239, 239, 239),
filled: true,
prefixIcon: Icon(Icons.lock_outline),
suffixIcon: IconButton(
icon: Icon(
_obscureText
? Icons.visibility
: Icons.visibility_off,
color: Colors.grey,
), ),
onPressed: () { ),
setState(() { ),
_obscureText = !_obscureText; ),
}); ],
}, )),
Padding(
padding: const EdgeInsets.only(bottom: 25),
child: Center(
child: PrimaryButtom(
onPressed: () {
if (_formKey.currentState!.validate()) {
RegisterController.instance.registerUser(
controller.email.text.trim(),
controller.password.text.trim(),
);
}
},
label: 'Registrarme',
),
),
),
RichText(
text: TextSpan(
style: TextStyle(
fontSize: 16.0,
color: Color(0xFF65676B),
fontFamily: 'Poppins',
),
children: [
TextSpan(text: 'Ya estas registrado? '),
WidgetSpan(
child: GestureDetector(
onTap: () {
Navigator.pushReplacementNamed(context, '/login');
},
child: Text(
'Iniciar Sesión',
style: TextStyle(
fontSize: 16.0,
color: Color(0xFF2BA4EC),
fontWeight: FontWeight.w600,
), ),
), ),
), ),
), ),
], ],
)),
Padding(
padding: const EdgeInsets.only(bottom: 25),
child: Center(
child: PrimaryButtom(
onPressed: () {
if (_formKey.currentState!.validate()) {
RegisterController.instance.registerUser(
controller.email.text.trim(),
controller.password.text.trim(),
);
}
},
label: 'Registrarme',
), ),
), )
), ]),
RichText( ),
text: TextSpan( ],
style: TextStyle( ),
fontSize: 16.0,
color: Color(0xFF65676B),
fontFamily: 'Poppins',
),
children: [
TextSpan(text: 'Ya estas registrado? '),
WidgetSpan(
child: GestureDetector(
onTap: () {
Navigator.pushReplacementNamed(context, '/login');
},
child: Text(
'Iniciar Sesión',
style: TextStyle(
fontSize: 16.0,
color: Color(0xFF2BA4EC),
fontWeight: FontWeight.w600,
),
),
),
),
],
),
)
]),
),
],
), ),
), ),
)); ));