autentificacion por celular
This commit is contained in:
@@ -1,4 +1,7 @@
|
||||
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';
|
||||
|
||||
class CodeValidationScreen extends StatefulWidget {
|
||||
const CodeValidationScreen({super.key});
|
||||
@@ -8,8 +11,11 @@ class CodeValidationScreen extends StatefulWidget {
|
||||
}
|
||||
|
||||
class _CodeValidationScreenState extends State<CodeValidationScreen> {
|
||||
final controller = Get.put(OTPController());
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
var otp;
|
||||
return SafeArea(
|
||||
child: Scaffold(
|
||||
resizeToAvoidBottomInset: false,
|
||||
@@ -76,7 +82,7 @@ class _CodeValidationScreenState extends State<CodeValidationScreen> {
|
||||
child: TextField(
|
||||
decoration: InputDecoration(
|
||||
border: InputBorder.none,
|
||||
hintText: '3102589636',
|
||||
hintText: '+57',
|
||||
suffixIcon: Icon(Icons.edit),
|
||||
),
|
||||
),
|
||||
@@ -102,37 +108,50 @@ class _CodeValidationScreenState extends State<CodeValidationScreen> {
|
||||
),
|
||||
Padding(
|
||||
padding: EdgeInsets.only(bottom: 20),
|
||||
child: TextField(
|
||||
maxLength: 4,
|
||||
child: OtpTextField(
|
||||
numberOfFields: 6,
|
||||
fillColor: Colors.black.withOpacity(0.1),
|
||||
filled: true,
|
||||
keyboardType: TextInputType.number,
|
||||
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: '_ _ _ _',
|
||||
fillColor: Color.fromARGB(255, 239, 239, 239),
|
||||
filled: true,
|
||||
),
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
letterSpacing: 12.0,
|
||||
),
|
||||
onSubmit: (code) {
|
||||
otp = code;
|
||||
OTPController.instance.verifyOTP(otp);
|
||||
},
|
||||
),
|
||||
// child: TextField(
|
||||
// onSubmitted:
|
||||
// maxLength: 6,
|
||||
// keyboardType: TextInputType.number,
|
||||
// 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: '_ _ _ _ _ _',
|
||||
// fillColor: Color.fromARGB(255, 239, 239, 239),
|
||||
// filled: true,
|
||||
// ),
|
||||
// textAlign: TextAlign.center,
|
||||
// style: TextStyle(
|
||||
// letterSpacing: 10.0,
|
||||
// ),
|
||||
// ),
|
||||
),
|
||||
Padding(
|
||||
padding: EdgeInsets.only(bottom: 40),
|
||||
child: Center(
|
||||
child: ElevatedButton(
|
||||
onPressed: () {},
|
||||
onPressed: () {
|
||||
OTPController.instance.verifyOTP(otp);
|
||||
},
|
||||
child: Text(
|
||||
'Validar código',
|
||||
style: TextStyle(
|
||||
|
||||
Reference in New Issue
Block a user