From 2c8185558600f70a22272d72241be816ab6a8f07 Mon Sep 17 00:00:00 2001 From: Juan Felipe Duarte <70235683+DuarteJFelipe@users.noreply.github.com> Date: Tue, 28 Mar 2023 00:28:02 -0500 Subject: [PATCH] screen login email --- lib/main.dart | 4 +- lib/src/screens/login_email.dart | 248 +++++++++++++++++++++++++++++++ lib/src/screens/welcome.dart | 1 + 3 files changed, 252 insertions(+), 1 deletion(-) create mode 100644 lib/src/screens/login_email.dart create mode 100644 lib/src/screens/welcome.dart diff --git a/lib/main.dart b/lib/main.dart index 675e337..719efe7 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -2,6 +2,7 @@ import 'package:flutter/material.dart'; import 'package:prosappco/src/provider/google_sign.dart'; import 'package:prosappco/src/screens/login.dart'; import 'package:firebase_core/firebase_core.dart'; +import 'package:prosappco/src/screens/login_email.dart'; import 'package:provider/provider.dart'; void main() async { @@ -19,6 +20,7 @@ class MyApp extends StatelessWidget { theme: ThemeData(fontFamily: 'Poppins'), debugShowCheckedModeBanner: false, title: 'ProsApp', - home: LoginScreen(), + // home: LoginScreen(), + home: LoginEmailScreen(), )); } diff --git a/lib/src/screens/login_email.dart b/lib/src/screens/login_email.dart new file mode 100644 index 0000000..cbd632d --- /dev/null +++ b/lib/src/screens/login_email.dart @@ -0,0 +1,248 @@ +import 'package:flutter/material.dart'; +import 'package:font_awesome_flutter/font_awesome_flutter.dart'; +import 'package:prosappco/src/provider/google_sign.dart'; +import 'package:provider/provider.dart'; +// import 'package:font_awesome_flutter/font_awesome_flutter.dart'; +// import 'package:prosappco/src/provider/google_sign.dart'; +// import 'package:provider/provider.dart'; + +class LoginEmailScreen extends StatefulWidget { + const LoginEmailScreen({super.key}); + + @override + State createState() => _LoginEmailScreenState(); +} + +class _LoginEmailScreenState extends State { + bool _obscureText = true; + + @override + Widget build(BuildContext context) { + return SafeArea( + child: Scaffold( + resizeToAvoidBottomInset: false, + backgroundColor: Color(0xFFD6F4FF), + body: Stack( + children: [ + Container( + margin: const EdgeInsets.only(top: 170), + width: double.infinity, + height: 800, + decoration: const BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.only( + topRight: Radius.circular(50), + topLeft: Radius.circular(50))), + ), + Container( + margin: const EdgeInsets.only(top: 40, left: 30), + child: const Image( + image: AssetImage('images/logo_prosapp.png'), + width: 180, + height: 100, + // width: MediaQuery.of(context).size.width / 2, + ), + ), + Container( + padding: const EdgeInsets.symmetric(horizontal: 0, vertical: 20), + margin: const EdgeInsets.only( + top: 180, + left: 25, + ), + child: Row( + children: [ + IconButton( + icon: Icon( + Icons.arrow_back, + size: 30, + ), + onPressed: () {}, + ), + Text( + 'Iniciar sesión', + 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: 270, left: 50, right: 50), + child: Column(children: [ + Padding( + padding: EdgeInsets.only(bottom: 20), + child: ElevatedButton( + onPressed: () { + final provider = Provider.of(context, + listen: false); + provider.googleLogin(); + }, + 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 + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + SizedBox(width: 5), // Espacio entre el icono y el texto + Text( + 'Entrar con Google ', + style: TextStyle( + color: Colors.white, + fontWeight: FontWeight.bold, + fontSize: 18, + ), + ), // Texto del botón + FaIcon(FontAwesomeIcons.google), // Icono del botón + ], + )), + ), + 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( + alignment: Alignment.topLeft, + child: Text('Email', + style: TextStyle( + fontSize: 18.0, color: Color(0xFF65676B))), + )), + const Padding( + padding: EdgeInsets.only(bottom: 20), + child: TextField( + 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)), + ), + ), + 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: EdgeInsets.only(bottom: 50), + child: TextField( + 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_off : Icons.visibility, + color: Colors.grey, + ), + onPressed: () { + setState(() { + _obscureText = !_obscureText; + }); + }, + ), + ), + ), + ), + Padding( + padding: const EdgeInsets.only(bottom: 40), + child: Center( + child: ElevatedButton( + onPressed: () {}, + child: Text( + 'Iniciar', + 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 + ), + )), + ), + RichText( + text: const TextSpan( + style: TextStyle( + fontSize: 16.0, + color: Color(0xFF65676B), + fontFamily: 'Poppins'), + children: [ + TextSpan(text: 'No estas registrado? '), + TextSpan( + text: 'Registrarse', + style: TextStyle( + color: Color(0xFF2BA4EC), + fontWeight: FontWeight.w600)), + ], + ), + ) + ]), + ), + ], + ), + )); + } +} diff --git a/lib/src/screens/welcome.dart b/lib/src/screens/welcome.dart new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/lib/src/screens/welcome.dart @@ -0,0 +1 @@ +