diff --git a/lib/src/screens/login.dart b/lib/src/screens/login.dart index d0a8f24..5266a71 100644 --- a/lib/src/screens/login.dart +++ b/lib/src/screens/login.dart @@ -99,8 +99,21 @@ class _LoginScreenState extends State { ), ), const SizedBox(height: 20), - ButtonBottom( - formKey: _formKey, completePhoneNumber: completePhoneNumber), + PrimaryButtom( + onPressed: () { + if (_formKey.currentState!.validate()) { + PhoneAuthController.instance.phoneAuthentication( + completePhoneNumber.trim(), + ); + Get.to( + () => CodeValidationScreen( + phoneNumber: completePhoneNumber.trim(), + ), + ); + } + }, + label: 'Enviar código', + ), const SizedBox(height: 20), const GestureBottom(), const SizedBox(height: 20), @@ -211,9 +224,21 @@ class _LoginScreenState extends State { ), ), const SizedBox(height: 20), - ButtonBottom( - formKey: _formKey, - completePhoneNumber: completePhoneNumber), + PrimaryButtom( + onPressed: () { + if (_formKey.currentState!.validate()) { + PhoneAuthController.instance.phoneAuthentication( + completePhoneNumber.trim(), + ); + Get.to( + () => CodeValidationScreen( + phoneNumber: completePhoneNumber.trim(), + ), + ); + } + }, + label: 'Enviar código', + ), const SizedBox(height: 20), const GestureBottom(), const SizedBox(height: 20), @@ -229,36 +254,6 @@ class _LoginScreenState extends State { } } -class ButtonBottom extends StatelessWidget { - const ButtonBottom({ - super.key, - required GlobalKey formKey, - required this.completePhoneNumber, - }) : _formKey = formKey; - - final GlobalKey _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,