login por celular fixeado
This commit is contained in:
@@ -2,20 +2,18 @@ import 'package:flutter/material.dart';
|
||||
import 'package:flutter_otp_text_field/flutter_otp_text_field.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:prosappco/src/controllers/otp_controller.dart';
|
||||
import 'package:prosappco/src/controllers/phone_auth_controller.dart';
|
||||
|
||||
class CodeValidationScreen extends StatefulWidget {
|
||||
const CodeValidationScreen({super.key});
|
||||
class CodeValidationScreen extends StatelessWidget {
|
||||
CodeValidationScreen({super.key, this.phoneNumber});
|
||||
String? phoneNumber;
|
||||
|
||||
@override
|
||||
State<CodeValidationScreen> createState() => _CodeValidationScreenState();
|
||||
}
|
||||
|
||||
class _CodeValidationScreenState extends State<CodeValidationScreen> {
|
||||
final controller = Get.put(OTPController());
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
var otp;
|
||||
|
||||
return SafeArea(
|
||||
child: Scaffold(
|
||||
resizeToAvoidBottomInset: false,
|
||||
@@ -80,18 +78,27 @@ class _CodeValidationScreenState extends State<CodeValidationScreen> {
|
||||
children: [
|
||||
Expanded(
|
||||
child: TextField(
|
||||
onChanged: (value) {
|
||||
phoneNumber = value;
|
||||
},
|
||||
controller:
|
||||
TextEditingController(text: phoneNumber ?? ''),
|
||||
decoration: InputDecoration(
|
||||
border: InputBorder.none,
|
||||
hintText: '+57',
|
||||
hintText: '',
|
||||
suffixIcon: Icon(Icons.edit),
|
||||
),
|
||||
),
|
||||
),
|
||||
TextButton(
|
||||
onPressed: () {
|
||||
// Acción a realizar cuando se hace clic en el texto
|
||||
},
|
||||
child: Text('Reenviar código'),
|
||||
onPressed: () {
|
||||
if (phoneNumber!.isNotEmpty) {
|
||||
PhoneAuthController.instance.phoneAuthentication(
|
||||
phoneNumber!,
|
||||
);
|
||||
}
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user