fix center
This commit is contained in:
+254
-259
@@ -335,270 +335,265 @@ class _LoginEmailScreenState extends State<LoginEmailScreen> {
|
|||||||
),
|
),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Container(
|
child: Container(
|
||||||
|
padding: EdgeInsets.symmetric(horizontal: width * 0.07),
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
height: height,
|
height: height,
|
||||||
child: SingleChildScrollView(
|
child: Column(
|
||||||
padding: EdgeInsets.symmetric(horizontal: width * 0.07),
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
child: Column(
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
children: [
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
Row(
|
||||||
children: [
|
children: <Widget>[
|
||||||
Row(
|
IconButton(
|
||||||
children: <Widget>[
|
icon: const Icon(
|
||||||
IconButton(
|
Icons.arrow_back,
|
||||||
icon: const Icon(
|
size: 30,
|
||||||
Icons.arrow_back,
|
|
||||||
size: 30,
|
|
||||||
),
|
|
||||||
onPressed: () {
|
|
||||||
Navigator.pop(context);
|
|
||||||
},
|
|
||||||
),
|
),
|
||||||
SizedBox(width: width * 0.01),
|
onPressed: () {
|
||||||
const Text(
|
Navigator.pop(context);
|
||||||
'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),
|
|
||||||
child: Column(children: [
|
|
||||||
Padding(
|
|
||||||
padding: const EdgeInsets.only(bottom: 20),
|
|
||||||
child: ElevatedButton(
|
|
||||||
onPressed: () async {
|
|
||||||
await AuthenticationRepository.instance
|
|
||||||
.signInWithGoogle();
|
|
||||||
},
|
|
||||||
style: ElevatedButton.styleFrom(
|
|
||||||
backgroundColor: const Color(0xFF2BA4EC),
|
|
||||||
shape: RoundedRectangleBorder(
|
|
||||||
borderRadius: BorderRadius.circular(50),
|
|
||||||
),
|
|
||||||
elevation: 0,
|
|
||||||
minimumSize: const Size(230, 60),
|
|
||||||
),
|
|
||||||
child: Row(
|
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
|
||||||
children: const [
|
|
||||||
Text(
|
|
||||||
'Entrar con Google ',
|
|
||||||
style: TextStyle(
|
|
||||||
color: Colors.white,
|
|
||||||
fontWeight: FontWeight.bold,
|
|
||||||
fontSize: 18,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
SizedBox(width: 5),
|
|
||||||
FaIcon(FontAwesomeIcons.google),
|
|
||||||
],
|
|
||||||
)),
|
|
||||||
),
|
|
||||||
Padding(
|
|
||||||
padding: const EdgeInsets.symmetric(vertical: 5),
|
|
||||||
child: Row(
|
|
||||||
children: const [
|
|
||||||
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: const EdgeInsets.only(bottom: 20),
|
|
||||||
child: TextFormField(
|
|
||||||
controller: controller.email,
|
|
||||||
validator: (String? value) {
|
|
||||||
if (value == null || value.isEmpty) {
|
|
||||||
return 'Por favor ingrese un email';
|
|
||||||
}
|
|
||||||
final RegExp emailRegExp = RegExp(
|
|
||||||
r'^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$');
|
|
||||||
if (!emailRegExp.hasMatch(value)) {
|
|
||||||
return 'Por favor ingrese un email válido';
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
},
|
|
||||||
decoration: const InputDecoration(
|
|
||||||
border: OutlineInputBorder(
|
|
||||||
borderSide:
|
|
||||||
BorderSide(color: Color(0xFFECECEC)),
|
|
||||||
borderRadius: BorderRadius.all(
|
|
||||||
Radius.circular(50),
|
|
||||||
)),
|
|
||||||
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),
|
|
||||||
)),
|
|
||||||
errorBorder: OutlineInputBorder(
|
|
||||||
borderSide: BorderSide(
|
|
||||||
color:
|
|
||||||
Color.fromARGB(255, 184, 0, 0)),
|
|
||||||
borderRadius: BorderRadius.all(
|
|
||||||
Radius.circular(50),
|
|
||||||
)),
|
|
||||||
hintText: 'Hello@gmail.com',
|
|
||||||
fillColor: Color.fromARGB(255, 239, 239, 239),
|
|
||||||
filled: true,
|
|
||||||
prefixIcon: Icon(Icons.email_outlined),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
const Padding(
|
|
||||||
padding: EdgeInsets.only(bottom: 5),
|
|
||||||
child: Align(
|
|
||||||
alignment: Alignment.topLeft,
|
|
||||||
child: Text('Password',
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 18.0,
|
|
||||||
color: Color(0xFF65676B))),
|
|
||||||
)),
|
|
||||||
Padding(
|
|
||||||
padding: const EdgeInsets.only(bottom: 50),
|
|
||||||
child: TextFormField(
|
|
||||||
controller: controller.password,
|
|
||||||
obscureText: _obscureText,
|
|
||||||
validator: (value) {
|
|
||||||
if (value == null || value.isEmpty) {
|
|
||||||
return 'Por favor ingrese una contraseña';
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
},
|
|
||||||
decoration: InputDecoration(
|
|
||||||
enabledBorder: const OutlineInputBorder(
|
|
||||||
borderSide:
|
|
||||||
BorderSide(color: Color(0xFFECECEC)),
|
|
||||||
borderRadius: BorderRadius.all(
|
|
||||||
Radius.circular(50),
|
|
||||||
)),
|
|
||||||
focusedBorder: const OutlineInputBorder(
|
|
||||||
borderSide:
|
|
||||||
BorderSide(color: Color(0xFFECECEC)),
|
|
||||||
borderRadius: BorderRadius.all(
|
|
||||||
Radius.circular(50),
|
|
||||||
)),
|
|
||||||
border: const OutlineInputBorder(
|
|
||||||
borderSide:
|
|
||||||
BorderSide(color: Color(0xFFECECEC)),
|
|
||||||
borderRadius: BorderRadius.all(
|
|
||||||
Radius.circular(50),
|
|
||||||
)),
|
|
||||||
errorBorder: const OutlineInputBorder(
|
|
||||||
borderSide: BorderSide(
|
|
||||||
color:
|
|
||||||
Color.fromARGB(255, 184, 0, 0)),
|
|
||||||
borderRadius: BorderRadius.all(
|
|
||||||
Radius.circular(50),
|
|
||||||
)),
|
|
||||||
hintText: 'Contraseña',
|
|
||||||
fillColor:
|
|
||||||
const Color.fromARGB(255, 239, 239, 239),
|
|
||||||
filled: true,
|
|
||||||
prefixIcon: const 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: const TextStyle(
|
|
||||||
fontSize: 16.0,
|
|
||||||
color: Color(0xFF65676B),
|
|
||||||
fontFamily: 'Poppins',
|
|
||||||
),
|
|
||||||
children: [
|
|
||||||
const TextSpan(text: 'No estas registrado? '),
|
|
||||||
WidgetSpan(
|
|
||||||
child: GestureDetector(
|
|
||||||
onTap: () {
|
|
||||||
Navigator.pushReplacementNamed(
|
|
||||||
context, '/register');
|
|
||||||
},
|
|
||||||
child: const Text(
|
|
||||||
'Registrarse',
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 16.0,
|
|
||||||
color: Color(0xFF2BA4EC),
|
|
||||||
fontWeight: FontWeight.w600,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
)
|
|
||||||
]),
|
|
||||||
),
|
),
|
||||||
|
SizedBox(width: width * 0.01),
|
||||||
|
const 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),
|
||||||
|
child: Column(children: [
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsets.only(bottom: 20),
|
||||||
|
child: ElevatedButton(
|
||||||
|
onPressed: () async {
|
||||||
|
await AuthenticationRepository.instance
|
||||||
|
.signInWithGoogle();
|
||||||
|
},
|
||||||
|
style: ElevatedButton.styleFrom(
|
||||||
|
backgroundColor: const Color(0xFF2BA4EC),
|
||||||
|
shape: RoundedRectangleBorder(
|
||||||
|
borderRadius: BorderRadius.circular(50),
|
||||||
|
),
|
||||||
|
elevation: 0,
|
||||||
|
minimumSize: const Size(230, 60),
|
||||||
|
),
|
||||||
|
child: Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
children: const [
|
||||||
|
Text(
|
||||||
|
'Entrar con Google ',
|
||||||
|
style: TextStyle(
|
||||||
|
color: Colors.white,
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
fontSize: 18,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SizedBox(width: 5),
|
||||||
|
FaIcon(FontAwesomeIcons.google),
|
||||||
|
],
|
||||||
|
)),
|
||||||
|
),
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsets.symmetric(vertical: 5),
|
||||||
|
child: Row(
|
||||||
|
children: const [
|
||||||
|
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: const EdgeInsets.only(bottom: 20),
|
||||||
|
child: TextFormField(
|
||||||
|
controller: controller.email,
|
||||||
|
validator: (String? value) {
|
||||||
|
if (value == null || value.isEmpty) {
|
||||||
|
return 'Por favor ingrese un email';
|
||||||
|
}
|
||||||
|
final RegExp emailRegExp =
|
||||||
|
RegExp(r'^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$');
|
||||||
|
if (!emailRegExp.hasMatch(value)) {
|
||||||
|
return 'Por favor ingrese un email válido';
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
},
|
||||||
|
decoration: const InputDecoration(
|
||||||
|
border: OutlineInputBorder(
|
||||||
|
borderSide:
|
||||||
|
BorderSide(color: Color(0xFFECECEC)),
|
||||||
|
borderRadius: BorderRadius.all(
|
||||||
|
Radius.circular(50),
|
||||||
|
)),
|
||||||
|
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),
|
||||||
|
)),
|
||||||
|
errorBorder: OutlineInputBorder(
|
||||||
|
borderSide: BorderSide(
|
||||||
|
color: Color.fromARGB(255, 184, 0, 0)),
|
||||||
|
borderRadius: BorderRadius.all(
|
||||||
|
Radius.circular(50),
|
||||||
|
)),
|
||||||
|
hintText: 'Hello@gmail.com',
|
||||||
|
fillColor: Color.fromARGB(255, 239, 239, 239),
|
||||||
|
filled: true,
|
||||||
|
prefixIcon: Icon(Icons.email_outlined),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const Padding(
|
||||||
|
padding: EdgeInsets.only(bottom: 5),
|
||||||
|
child: Align(
|
||||||
|
alignment: Alignment.topLeft,
|
||||||
|
child: Text('Password',
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 18.0,
|
||||||
|
color: Color(0xFF65676B))),
|
||||||
|
)),
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsets.only(bottom: 50),
|
||||||
|
child: TextFormField(
|
||||||
|
controller: controller.password,
|
||||||
|
obscureText: _obscureText,
|
||||||
|
validator: (value) {
|
||||||
|
if (value == null || value.isEmpty) {
|
||||||
|
return 'Por favor ingrese una contraseña';
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
},
|
||||||
|
decoration: InputDecoration(
|
||||||
|
enabledBorder: const OutlineInputBorder(
|
||||||
|
borderSide:
|
||||||
|
BorderSide(color: Color(0xFFECECEC)),
|
||||||
|
borderRadius: BorderRadius.all(
|
||||||
|
Radius.circular(50),
|
||||||
|
)),
|
||||||
|
focusedBorder: const OutlineInputBorder(
|
||||||
|
borderSide:
|
||||||
|
BorderSide(color: Color(0xFFECECEC)),
|
||||||
|
borderRadius: BorderRadius.all(
|
||||||
|
Radius.circular(50),
|
||||||
|
)),
|
||||||
|
border: const OutlineInputBorder(
|
||||||
|
borderSide:
|
||||||
|
BorderSide(color: Color(0xFFECECEC)),
|
||||||
|
borderRadius: BorderRadius.all(
|
||||||
|
Radius.circular(50),
|
||||||
|
)),
|
||||||
|
errorBorder: const OutlineInputBorder(
|
||||||
|
borderSide: BorderSide(
|
||||||
|
color: Color.fromARGB(255, 184, 0, 0)),
|
||||||
|
borderRadius: BorderRadius.all(
|
||||||
|
Radius.circular(50),
|
||||||
|
)),
|
||||||
|
hintText: 'Contraseña',
|
||||||
|
fillColor:
|
||||||
|
const Color.fromARGB(255, 239, 239, 239),
|
||||||
|
filled: true,
|
||||||
|
prefixIcon: const 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: const TextStyle(
|
||||||
|
fontSize: 16.0,
|
||||||
|
color: Color(0xFF65676B),
|
||||||
|
fontFamily: 'Poppins',
|
||||||
|
),
|
||||||
|
children: [
|
||||||
|
const TextSpan(text: 'No estas registrado? '),
|
||||||
|
WidgetSpan(
|
||||||
|
child: GestureDetector(
|
||||||
|
onTap: () {
|
||||||
|
Navigator.pushReplacementNamed(
|
||||||
|
context, '/register');
|
||||||
|
},
|
||||||
|
child: const Text(
|
||||||
|
'Registrarse',
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 16.0,
|
||||||
|
color: Color(0xFF2BA4EC),
|
||||||
|
fontWeight: FontWeight.w600,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
)
|
||||||
|
]),
|
||||||
),
|
),
|
||||||
],
|
),
|
||||||
),
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
+248
-257
@@ -361,291 +361,282 @@ class _RegisterScreenState extends State<RegisterScreen> {
|
|||||||
),
|
),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Container(
|
child: Container(
|
||||||
|
padding: EdgeInsets.symmetric(horizontal: width * 0.07),
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
height: height,
|
height: height,
|
||||||
child: SingleChildScrollView(
|
child: Column(
|
||||||
padding: EdgeInsets.symmetric(horizontal: width * 0.07),
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
child: Column(
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
children: [
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
Container(
|
||||||
children: [
|
padding: const EdgeInsets.symmetric(
|
||||||
Container(
|
horizontal: 0, vertical: 20),
|
||||||
padding: const EdgeInsets.symmetric(
|
child: Row(
|
||||||
horizontal: 0, vertical: 20),
|
children: <Widget>[
|
||||||
child: Row(
|
IconButton(
|
||||||
children: <Widget>[
|
icon: const Icon(
|
||||||
IconButton(
|
Icons.arrow_back,
|
||||||
icon: const Icon(
|
size: 30,
|
||||||
Icons.arrow_back,
|
|
||||||
size: 30,
|
|
||||||
),
|
|
||||||
onPressed: () {
|
|
||||||
Navigator.pop(context);
|
|
||||||
},
|
|
||||||
),
|
),
|
||||||
SizedBox(width: width * 0.01),
|
onPressed: () {
|
||||||
const Text(
|
Navigator.pop(context);
|
||||||
'Registro',
|
},
|
||||||
style: TextStyle(
|
),
|
||||||
color: Color(0xFF262626),
|
SizedBox(width: width * 0.01),
|
||||||
fontSize: 38.0,
|
const Text(
|
||||||
fontWeight: FontWeight.bold,
|
'Registro',
|
||||||
),
|
style: TextStyle(
|
||||||
textAlign: TextAlign.right,
|
color: Color(0xFF262626),
|
||||||
|
fontSize: 38.0,
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
),
|
),
|
||||||
],
|
textAlign: TextAlign.right,
|
||||||
),
|
),
|
||||||
|
],
|
||||||
),
|
),
|
||||||
Container(
|
),
|
||||||
padding: const EdgeInsets.symmetric(
|
Container(
|
||||||
horizontal: 0, vertical: 20),
|
padding: const EdgeInsets.symmetric(
|
||||||
child: Column(
|
horizontal: 0, vertical: 20),
|
||||||
children: [
|
child: Column(
|
||||||
Padding(
|
children: [
|
||||||
padding: const EdgeInsets.only(bottom: 20),
|
Padding(
|
||||||
child: ElevatedButton(
|
padding: const EdgeInsets.only(bottom: 20),
|
||||||
onPressed: () async {
|
child: ElevatedButton(
|
||||||
await AuthenticationRepository.instance
|
onPressed: () async {
|
||||||
.signInWithGoogle();
|
await AuthenticationRepository.instance
|
||||||
},
|
.signInWithGoogle();
|
||||||
style: ElevatedButton.styleFrom(
|
},
|
||||||
backgroundColor: const Color(0xFF2BA4EC),
|
style: ElevatedButton.styleFrom(
|
||||||
shape: RoundedRectangleBorder(
|
backgroundColor: const Color(0xFF2BA4EC),
|
||||||
borderRadius: BorderRadius.circular(50),
|
shape: RoundedRectangleBorder(
|
||||||
),
|
borderRadius: BorderRadius.circular(50),
|
||||||
elevation: 0,
|
|
||||||
minimumSize: const Size(230, 60),
|
|
||||||
),
|
),
|
||||||
child: Row(
|
elevation: 0,
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
minimumSize: const Size(230, 60),
|
||||||
children: const [
|
),
|
||||||
Text(
|
child: Row(
|
||||||
'Entrar con Google ',
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
style: TextStyle(
|
children: const [
|
||||||
color: Colors.white,
|
Text(
|
||||||
fontWeight: FontWeight.bold,
|
'Entrar con Google ',
|
||||||
fontSize: 18,
|
style: TextStyle(
|
||||||
),
|
color: Colors.white,
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
fontSize: 18,
|
||||||
),
|
),
|
||||||
SizedBox(width: 5),
|
|
||||||
FaIcon(FontAwesomeIcons.google),
|
|
||||||
],
|
|
||||||
)),
|
|
||||||
),
|
|
||||||
Padding(
|
|
||||||
padding: const EdgeInsets.symmetric(vertical: 0),
|
|
||||||
child: Row(
|
|
||||||
children: const <Widget>[
|
|
||||||
Expanded(
|
|
||||||
child: Divider(
|
|
||||||
color: Colors.black38,
|
|
||||||
thickness: 1,
|
|
||||||
),
|
),
|
||||||
|
SizedBox(width: 5),
|
||||||
|
FaIcon(FontAwesomeIcons.google),
|
||||||
|
],
|
||||||
|
)),
|
||||||
|
),
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsets.symmetric(vertical: 0),
|
||||||
|
child: Row(
|
||||||
|
children: const <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: [
|
||||||
|
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(
|
||||||
padding:
|
padding: const EdgeInsets.only(bottom: 18),
|
||||||
EdgeInsets.symmetric(horizontal: 10),
|
child: TextFormField(
|
||||||
child: Text("ó"),
|
controller: controller.email,
|
||||||
),
|
validator: (String? value) {
|
||||||
Expanded(
|
if (value == null || value.isEmpty) {
|
||||||
child: Divider(
|
return 'Por favor ingrese un email';
|
||||||
color: Colors.black38,
|
}
|
||||||
thickness: 1,
|
final RegExp emailRegExp = RegExp(
|
||||||
),
|
r'^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$');
|
||||||
),
|
if (!emailRegExp.hasMatch(value)) {
|
||||||
],
|
return 'Por favor ingrese un email válido';
|
||||||
),
|
}
|
||||||
),
|
return null;
|
||||||
Form(
|
},
|
||||||
key: _formKey,
|
decoration: const InputDecoration(
|
||||||
child: Column(
|
border: OutlineInputBorder(
|
||||||
children: [
|
borderSide: BorderSide(
|
||||||
const Padding(
|
color: Color(0xFFECECEC)),
|
||||||
padding: EdgeInsets.only(bottom: 5),
|
borderRadius: BorderRadius.all(
|
||||||
child: Align(
|
Radius.circular(50),
|
||||||
alignment: Alignment.topLeft,
|
)),
|
||||||
child: Text('Email',
|
enabledBorder: OutlineInputBorder(
|
||||||
style: TextStyle(
|
borderSide: BorderSide(
|
||||||
fontSize: 18.0,
|
color: Color(0xFFECECEC)),
|
||||||
color: Color(0xFF65676B))),
|
borderRadius: BorderRadius.all(
|
||||||
)),
|
Radius.circular(50),
|
||||||
Padding(
|
)),
|
||||||
padding:
|
focusedBorder: OutlineInputBorder(
|
||||||
const EdgeInsets.only(bottom: 18),
|
borderSide: BorderSide(
|
||||||
child: TextFormField(
|
color: Color(0xFFECECEC)),
|
||||||
controller: controller.email,
|
borderRadius: BorderRadius.all(
|
||||||
validator: (String? value) {
|
Radius.circular(50),
|
||||||
if (value == null || value.isEmpty) {
|
)),
|
||||||
return 'Por favor ingrese un email';
|
errorBorder: OutlineInputBorder(
|
||||||
}
|
|
||||||
final RegExp emailRegExp = RegExp(
|
|
||||||
r'^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$');
|
|
||||||
if (!emailRegExp.hasMatch(value)) {
|
|
||||||
return 'Por favor ingrese un email válido';
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
},
|
|
||||||
decoration: const InputDecoration(
|
|
||||||
border: OutlineInputBorder(
|
|
||||||
borderSide: BorderSide(
|
|
||||||
color: Color(0xFFECECEC)),
|
|
||||||
borderRadius: BorderRadius.all(
|
|
||||||
Radius.circular(50),
|
|
||||||
)),
|
|
||||||
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),
|
|
||||||
)),
|
|
||||||
errorBorder: OutlineInputBorder(
|
|
||||||
borderSide: BorderSide(
|
|
||||||
color: Color.fromARGB(
|
|
||||||
255, 184, 0, 0)),
|
|
||||||
borderRadius: BorderRadius.all(
|
|
||||||
Radius.circular(50),
|
|
||||||
)),
|
|
||||||
hintText: 'Hello@gmail.com',
|
|
||||||
fillColor: Color.fromARGB(
|
|
||||||
255, 239, 239, 239),
|
|
||||||
filled: true,
|
|
||||||
prefixIcon:
|
|
||||||
Icon(Icons.email_outlined)),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
const Padding(
|
|
||||||
padding: EdgeInsets.only(bottom: 5),
|
|
||||||
child: Align(
|
|
||||||
alignment: Alignment.topLeft,
|
|
||||||
child: Text('Password',
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 18.0,
|
|
||||||
color: Color(0xFF65676B))),
|
|
||||||
)),
|
|
||||||
Padding(
|
|
||||||
padding:
|
|
||||||
const EdgeInsets.only(bottom: 25),
|
|
||||||
child: TextFormField(
|
|
||||||
controller: controller.password,
|
|
||||||
obscureText: _obscureText,
|
|
||||||
validator: (value) {
|
|
||||||
if (value == null || value.isEmpty) {
|
|
||||||
return 'Por favor ingrese una contraseña';
|
|
||||||
}
|
|
||||||
if (value.length <= 6) {
|
|
||||||
return 'Contraseña muy corta';
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
},
|
|
||||||
decoration: InputDecoration(
|
|
||||||
errorBorder: const OutlineInputBorder(
|
|
||||||
borderSide: BorderSide(
|
borderSide: BorderSide(
|
||||||
color: Color.fromARGB(
|
color: Color.fromARGB(
|
||||||
255, 184, 0, 0)),
|
255, 184, 0, 0)),
|
||||||
borderRadius: BorderRadius.all(
|
borderRadius: BorderRadius.all(
|
||||||
Radius.circular(50),
|
Radius.circular(50),
|
||||||
)),
|
)),
|
||||||
enabledBorder:
|
hintText: 'Hello@gmail.com',
|
||||||
const OutlineInputBorder(
|
fillColor: Color.fromARGB(
|
||||||
borderSide: BorderSide(
|
|
||||||
color: Color(0xFFECECEC)),
|
|
||||||
borderRadius:
|
|
||||||
BorderRadius.all(
|
|
||||||
Radius.circular(50),
|
|
||||||
)),
|
|
||||||
border: const OutlineInputBorder(
|
|
||||||
borderSide: BorderSide(
|
|
||||||
color: Color(0xFFECECEC)),
|
|
||||||
borderRadius: BorderRadius.all(
|
|
||||||
Radius.circular(50),
|
|
||||||
)),
|
|
||||||
focusedBorder:
|
|
||||||
const OutlineInputBorder(
|
|
||||||
borderSide: BorderSide(
|
|
||||||
color: Color(0xFFECECEC)),
|
|
||||||
borderRadius:
|
|
||||||
BorderRadius.all(
|
|
||||||
Radius.circular(50),
|
|
||||||
)),
|
|
||||||
hintText: 'Contraseña',
|
|
||||||
fillColor: const Color.fromARGB(
|
|
||||||
255, 239, 239, 239),
|
255, 239, 239, 239),
|
||||||
filled: true,
|
filled: true,
|
||||||
prefixIcon:
|
prefixIcon:
|
||||||
const Icon(Icons.lock_outline),
|
Icon(Icons.email_outlined)),
|
||||||
suffixIcon: IconButton(
|
|
||||||
icon: Icon(
|
|
||||||
_obscureText
|
|
||||||
? Icons.visibility
|
|
||||||
: Icons.visibility_off,
|
|
||||||
color: Colors.grey,
|
|
||||||
),
|
|
||||||
onPressed: () {
|
|
||||||
setState(() {
|
|
||||||
_obscureText = !_obscureText;
|
|
||||||
});
|
|
||||||
},
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
],
|
),
|
||||||
)),
|
const Padding(
|
||||||
Padding(
|
padding: EdgeInsets.only(bottom: 5),
|
||||||
padding: const EdgeInsets.only(bottom: 25),
|
child: Align(
|
||||||
child: Center(
|
alignment: Alignment.topLeft,
|
||||||
child: PrimaryButtom(
|
child: Text('Password',
|
||||||
onPressed: () {
|
style: TextStyle(
|
||||||
if (_formKey.currentState!.validate()) {
|
fontSize: 18.0,
|
||||||
RegisterController.instance.registerUser(
|
color: Color(0xFF65676B))),
|
||||||
controller.email.text.trim(),
|
)),
|
||||||
controller.password.text.trim(),
|
Padding(
|
||||||
);
|
padding: const EdgeInsets.only(bottom: 25),
|
||||||
}
|
child: TextFormField(
|
||||||
},
|
controller: controller.password,
|
||||||
label: 'Registrarme',
|
obscureText: _obscureText,
|
||||||
),
|
validator: (value) {
|
||||||
),
|
if (value == null || value.isEmpty) {
|
||||||
),
|
return 'Por favor ingrese una contraseña';
|
||||||
RichText(
|
}
|
||||||
text: TextSpan(
|
if (value.length <= 6) {
|
||||||
style: const TextStyle(
|
return 'Contraseña muy corta';
|
||||||
fontSize: 16.0,
|
}
|
||||||
color: Color(0xFF65676B),
|
return null;
|
||||||
fontFamily: 'Poppins',
|
|
||||||
),
|
|
||||||
children: [
|
|
||||||
const TextSpan(text: 'Ya estas registrado? '),
|
|
||||||
WidgetSpan(
|
|
||||||
child: GestureDetector(
|
|
||||||
onTap: () {
|
|
||||||
Navigator.pushReplacementNamed(
|
|
||||||
context, '/login');
|
|
||||||
},
|
},
|
||||||
child: const Text(
|
decoration: InputDecoration(
|
||||||
'Iniciar Sesión',
|
errorBorder: const OutlineInputBorder(
|
||||||
style: TextStyle(
|
borderSide: BorderSide(
|
||||||
fontSize: 16.0,
|
color: Color.fromARGB(
|
||||||
color: Color(0xFF2BA4EC),
|
255, 184, 0, 0)),
|
||||||
fontWeight: FontWeight.w600,
|
borderRadius: BorderRadius.all(
|
||||||
|
Radius.circular(50),
|
||||||
|
)),
|
||||||
|
enabledBorder: const OutlineInputBorder(
|
||||||
|
borderSide: BorderSide(
|
||||||
|
color: Color(0xFFECECEC)),
|
||||||
|
borderRadius: BorderRadius.all(
|
||||||
|
Radius.circular(50),
|
||||||
|
)),
|
||||||
|
border: const OutlineInputBorder(
|
||||||
|
borderSide: BorderSide(
|
||||||
|
color: Color(0xFFECECEC)),
|
||||||
|
borderRadius: BorderRadius.all(
|
||||||
|
Radius.circular(50),
|
||||||
|
)),
|
||||||
|
focusedBorder: const OutlineInputBorder(
|
||||||
|
borderSide: BorderSide(
|
||||||
|
color: Color(0xFFECECEC)),
|
||||||
|
borderRadius: BorderRadius.all(
|
||||||
|
Radius.circular(50),
|
||||||
|
)),
|
||||||
|
hintText: 'Contraseña',
|
||||||
|
fillColor: const Color.fromARGB(
|
||||||
|
255, 239, 239, 239),
|
||||||
|
filled: true,
|
||||||
|
prefixIcon:
|
||||||
|
const 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: const TextStyle(
|
||||||
|
fontSize: 16.0,
|
||||||
|
color: Color(0xFF65676B),
|
||||||
|
fontFamily: 'Poppins',
|
||||||
|
),
|
||||||
|
children: [
|
||||||
|
const TextSpan(text: 'Ya estas registrado? '),
|
||||||
|
WidgetSpan(
|
||||||
|
child: GestureDetector(
|
||||||
|
onTap: () {
|
||||||
|
Navigator.pushReplacementNamed(
|
||||||
|
context, '/login');
|
||||||
|
},
|
||||||
|
child: const Text(
|
||||||
|
'Iniciar Sesión',
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 16.0,
|
||||||
|
color: Color(0xFF2BA4EC),
|
||||||
|
fontWeight: FontWeight.w600,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
)
|
||||||
|
],
|
||||||
),
|
),
|
||||||
],
|
),
|
||||||
),
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
Reference in New Issue
Block a user