This commit is contained in:
Juan Felipe Duarte
2023-06-05 14:11:36 -05:00
parent 99b8f4f898
commit 3733fbc297
+98 -108
View File
@@ -97,62 +97,12 @@ class _LoginScreenState extends State<LoginScreen> {
),
),
const SizedBox(height: 20),
PrimaryButtom(
onPressed: () {
if (_formKey.currentState!.validate()) {
PhoneAuthController.instance.phoneAuthentication(
completePhoneNumber.trim(),
);
Get.to(
() => CodeValidationScreen(
phoneNumber: completePhoneNumber.trim(),
),
);
}
},
label: 'Enviar código',
),
ButtonBottom(
formKey: _formKey, completePhoneNumber: completePhoneNumber),
const SizedBox(height: 20),
GestureDetector(
onTap: () {
Navigator.pushNamed(context, '/login');
},
child: const Text(
'Entrar con correo electronico',
style: TextStyle(
fontSize: 15.0, color: Color(0xFF65676B),
decoration: TextDecoration.underline, // Subrayado
),
),
),
const GestureBottom(),
const SizedBox(height: 20),
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.pushNamed(context, '/register');
},
child: const Text(
'Registrarse',
style: TextStyle(
fontSize: 16.0,
color: Color(0xFF2BA4EC),
fontWeight: FontWeight.w600,
),
),
),
),
],
),
),
const RichTxTBottom(),
const SizedBox(height: 20),
],
);
@@ -256,62 +206,13 @@ class _LoginScreenState extends State<LoginScreen> {
),
),
const SizedBox(height: 20),
PrimaryButtom(
onPressed: () {
if (_formKey.currentState!.validate()) {
PhoneAuthController.instance.phoneAuthentication(
completePhoneNumber.trim(),
);
Get.to(
() => CodeValidationScreen(
phoneNumber: completePhoneNumber.trim(),
),
);
}
},
label: 'Enviar código',
),
ButtonBottom(
formKey: _formKey,
completePhoneNumber: completePhoneNumber),
const SizedBox(height: 20),
GestureDetector(
onTap: () {
Navigator.pushNamed(context, '/login');
},
child: const Text(
'Entrar con correo electronico',
style: TextStyle(
fontSize: 15.0, color: Color(0xFF65676B),
decoration: TextDecoration.underline, // Subrayado
),
),
),
const GestureBottom(),
const SizedBox(height: 20),
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.pushNamed(context, '/register');
},
child: const Text(
'Registrarse',
style: TextStyle(
fontSize: 16.0,
color: Color(0xFF2BA4EC),
fontWeight: FontWeight.w600,
),
),
),
),
],
),
),
const RichTxTBottom(),
],
),
),
@@ -322,3 +223,92 @@ class _LoginScreenState extends State<LoginScreen> {
);
}
}
class ButtonBottom extends StatelessWidget {
const ButtonBottom({
super.key,
required GlobalKey<FormState> formKey,
required this.completePhoneNumber,
}) : _formKey = formKey;
final GlobalKey<FormState> _formKey;
final String completePhoneNumber;
@override
Widget build(BuildContext context) {
return PrimaryButtom(
onPressed: () {
if (_formKey.currentState!.validate()) {
PhoneAuthController.instance.phoneAuthentication(
completePhoneNumber.trim(),
);
Get.to(
() => CodeValidationScreen(
phoneNumber: completePhoneNumber.trim(),
),
);
}
},
label: 'Enviar código',
);
}
}
class GestureBottom extends StatelessWidget {
const GestureBottom({
super.key,
});
@override
Widget build(BuildContext context) {
return GestureDetector(
onTap: () {
Navigator.pushNamed(context, '/login');
},
child: const Text(
'Entrar con correo electronico',
style: TextStyle(
fontSize: 15.0, color: Color(0xFF65676B),
decoration: TextDecoration.underline, // Subrayado
),
),
);
}
}
class RichTxTBottom extends StatelessWidget {
const RichTxTBottom({
super.key,
});
@override
Widget build(BuildContext context) {
return 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.pushNamed(context, '/register');
},
child: const Text(
'Registrarse',
style: TextStyle(
fontSize: 16.0,
color: Color(0xFF2BA4EC),
fontWeight: FontWeight.w600,
),
),
),
),
],
),
);
}
}