|
|
|
|
@ -61,7 +61,7 @@ class SMSOTP {
|
|
|
|
|
displayDialog(BuildContext context) async {
|
|
|
|
|
double dialogWidth = MediaQuery.of(context).size.width * 0.90;
|
|
|
|
|
double dialogInputWidth = (dialogWidth / 4) - (SizeConfig.isWidthLarge ? SizeConfig.getWidthMultiplier(width: dialogWidth) * 4.5 : 20);
|
|
|
|
|
double dialogHeight = SizeConfig.isHeightVeryShort ? MediaQuery.of(context).size.height * 0.50 : MediaQuery.of(context).size.height * 0.40;
|
|
|
|
|
double dialogHeight = SizeConfig.isHeightVeryShort ? MediaQuery.of(context).size.height * 0.60 : MediaQuery.of(context).size.height * 0.50;
|
|
|
|
|
return showDialog(
|
|
|
|
|
context: context,
|
|
|
|
|
builder: (ctx) => Center(
|
|
|
|
|
@ -137,7 +137,7 @@ class SMSOTP {
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Container(
|
|
|
|
|
width: dialogInputWidth,
|
|
|
|
|
height: SizeConfig.getHeightMultiplier(height: dialogHeight) * 30,
|
|
|
|
|
height: SizeConfig.getHeightMultiplier(height: dialogHeight) * 25,
|
|
|
|
|
margin: EdgeInsets.symmetric(vertical: 2, horizontal: 5),
|
|
|
|
|
child: TextFormField(
|
|
|
|
|
textInputAction: TextInputAction.next,
|
|
|
|
|
@ -164,7 +164,7 @@ class SMSOTP {
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
width: dialogInputWidth,
|
|
|
|
|
height: SizeConfig.getHeightMultiplier(height: dialogHeight) * 30,
|
|
|
|
|
height: SizeConfig.getHeightMultiplier(height: dialogHeight) * 25,
|
|
|
|
|
margin: EdgeInsets.symmetric(vertical: 2, horizontal: 5),
|
|
|
|
|
child: TextFormField(
|
|
|
|
|
focusNode: focusD2,
|
|
|
|
|
@ -194,7 +194,7 @@ class SMSOTP {
|
|
|
|
|
Container(
|
|
|
|
|
margin: EdgeInsets.symmetric(vertical: 2, horizontal: 5),
|
|
|
|
|
width: dialogInputWidth,
|
|
|
|
|
height: SizeConfig.getHeightMultiplier(height: dialogHeight) * 30,
|
|
|
|
|
height: SizeConfig.getHeightMultiplier(height: dialogHeight) * 25,
|
|
|
|
|
child: TextFormField(
|
|
|
|
|
focusNode: focusD3,
|
|
|
|
|
textInputAction: TextInputAction.next,
|
|
|
|
|
@ -222,7 +222,7 @@ class SMSOTP {
|
|
|
|
|
Container(
|
|
|
|
|
margin: EdgeInsets.symmetric(vertical: 2, horizontal: 5),
|
|
|
|
|
width: dialogInputWidth,
|
|
|
|
|
height: SizeConfig.getHeightMultiplier(height: dialogHeight) * 30,
|
|
|
|
|
height: SizeConfig.getHeightMultiplier(height: dialogHeight) * 25,
|
|
|
|
|
child: TextFormField(
|
|
|
|
|
focusNode: focusD4,
|
|
|
|
|
maxLength: 1,
|
|
|
|
|
@ -264,6 +264,7 @@ class SMSOTP {
|
|
|
|
|
fontSize: SizeConfig.getTextMultiplierBasedOnWidth(width: dialogWidth) * 3.5,
|
|
|
|
|
)
|
|
|
|
|
]),
|
|
|
|
|
SizedBox(height: 10,),
|
|
|
|
|
Column(children: [
|
|
|
|
|
CloudflareTurnstile(
|
|
|
|
|
siteKey: '0x4AAAAAAAkmbvEy63pcxBBt',
|
|
|
|
|
@ -274,6 +275,7 @@ class SMSOTP {
|
|
|
|
|
setState(() {
|
|
|
|
|
print("Cloudflare token: $token");
|
|
|
|
|
_token = token;
|
|
|
|
|
checkValue();
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
// onTokenRecived: (token) {
|
|
|
|
|
@ -341,7 +343,7 @@ class SMSOTP {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
checkValue() async {
|
|
|
|
|
if (verifyAccountForm.currentState!.validate()) {
|
|
|
|
|
if (verifyAccountForm.currentState!.validate() && _token !=null) {
|
|
|
|
|
// if (digit1.text.isNotEmpty && digit2.text.isNotEmpty && digit3.text.isNotEmpty && digit4.text.isNotEmpty) {
|
|
|
|
|
onSuccess(digit1.text.toString() + digit2.text.toString() + digit3.text.toString() + digit4.text.toString());
|
|
|
|
|
this.isClosed = true;
|
|
|
|
|
|