2025-11-13 15:16:00 +01:00
|
|
|
import 'package:auth/src/login/presentation/loading_google_screen.dart';
|
|
|
|
|
import 'package:auth/src/sign_up/signup_screen.dart';
|
2025-11-21 15:28:46 +01:00
|
|
|
import 'package:design_system/design_system.dart';
|
2025-11-13 15:16:00 +01:00
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
|
|
|
|
import 'package:navigation/navigation.dart';
|
|
|
|
|
|
|
|
|
|
class LoginScreen extends ConsumerWidget {
|
|
|
|
|
final NavigationContract navigationContract;
|
|
|
|
|
|
|
|
|
|
const LoginScreen({super.key, required this.navigationContract});
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context, WidgetRef ref) {
|
|
|
|
|
bool passwordVisible = true;
|
|
|
|
|
return Scaffold(
|
|
|
|
|
body: Expanded(
|
|
|
|
|
child: Center(
|
|
|
|
|
child: Container(
|
|
|
|
|
margin: EdgeInsets.all(30),
|
|
|
|
|
child: Column(
|
|
|
|
|
spacing: 10,
|
|
|
|
|
children: [
|
|
|
|
|
Icon(Icons.check, color: Color(0xFF329e95), size: 50),
|
|
|
|
|
Text(
|
|
|
|
|
"¡Te damos la bienvenida!",
|
|
|
|
|
style: TextStyle(fontSize: 30, fontWeight: FontWeight.bold),
|
|
|
|
|
),
|
2025-11-21 15:28:46 +01:00
|
|
|
CustomTextField(
|
|
|
|
|
hint: "Nombre de usuario",
|
|
|
|
|
label: "Nombre de usuario",
|
2025-11-13 15:16:00 +01:00
|
|
|
),
|
2025-11-21 15:28:46 +01:00
|
|
|
CustomTextField(
|
|
|
|
|
showPassword: passwordVisible,
|
|
|
|
|
label: "Contraseña",
|
|
|
|
|
hint: "********"
|
2025-11-13 15:16:00 +01:00
|
|
|
),
|
|
|
|
|
TextButton(
|
|
|
|
|
onPressed: () =>
|
|
|
|
|
navigationContract.pushTo('/recover_password'),
|
|
|
|
|
child: Text("¿Has olvidado la contraseña?"),
|
|
|
|
|
),
|
|
|
|
|
FilledButton(
|
2025-11-17 00:15:31 +01:00
|
|
|
onPressed: () => navigationContract.pushTo('/main/home'),
|
2025-11-13 15:16:00 +01:00
|
|
|
child: Text("Iniciar sesión"),
|
|
|
|
|
),
|
|
|
|
|
Stack(children: [Divider(), Text("o continúa con")]),
|
|
|
|
|
Row(
|
|
|
|
|
spacing: 20,
|
|
|
|
|
children: [
|
|
|
|
|
OutlinedButton(
|
|
|
|
|
onPressed: () => Navigator.push(
|
|
|
|
|
context,
|
|
|
|
|
MaterialPageRoute(
|
|
|
|
|
builder: (_) => LoadingGoogleScreen(),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
child: Text("Google", semanticsLabel: "Google"),
|
|
|
|
|
),
|
|
|
|
|
OutlinedButton(
|
|
|
|
|
onPressed: () => {},
|
|
|
|
|
child: Icon(Icons.apple, semanticLabel: "Apple"),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
Text("¿No tienes cuenta?"),
|
|
|
|
|
TextButton(
|
|
|
|
|
onPressed: () => Navigator.push(
|
|
|
|
|
context,
|
|
|
|
|
MaterialPageRoute(builder: (_) => SignupScreen()),
|
|
|
|
|
),
|
|
|
|
|
child: Text("Crear una ahora"),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|