This commit is contained in:
Felipe
2023-11-02 18:00:11 -05:00
parent d2e8817103
commit 2993d00f84
4 changed files with 38 additions and 87 deletions
+22 -71
View File
@@ -102,7 +102,11 @@ class _LoginEmailScreenState extends State<LoginEmailScreen> {
child: ElevatedButton(
onPressed: () async {
await AuthenticationRepository.instance
.signInWithGoogle();
.signInWithGoogle()
.then((value) => {
Provider.of<UserProvider>(context)
.initUserProvider()
});
},
style: ElevatedButton.styleFrom(
backgroundColor: const Color(0xFF2BA4EC),
@@ -315,60 +319,6 @@ class _LoginEmailScreenState extends State<LoginEmailScreen> {
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: const 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),
// ],
// )),
// ),
// const Padding(
// padding: EdgeInsets.symmetric(vertical: 5),
// child: Row(
// children: [
// 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(
@@ -453,7 +403,7 @@ class _LoginEmailScreenState extends State<LoginEmailScreen> {
padding: const EdgeInsets.symmetric(vertical: 20),
child: TextButton(
onPressed: () {
// Agrega aquí la lógica para manejar la recuperación de contraseña
Navigator.pushNamed(context, '/resetpassword');
},
child: const Text(
'Olvidé la contraseña',
@@ -554,21 +504,22 @@ class PaddingButtomBottom extends StatelessWidget {
return 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(),
)
.then((value) {
Provider.of<UserProvider>(context).initUserProvider();
});
}
},
label: 'Iniciar'),
),
child: PrimaryButtom(
onPressed: () {
if (_formKey.currentState!.validate()) {
LoginEmailController.instance
.loginUser(
controller.email.text.trim(),
controller.password.text.trim(),
)
.then((value) {
Provider.of<UserProvider>(context, listen: false)
.initUserProvider();
});
}
},
label: 'Iniciar',
)),
);
}
}