update_flutter_3.24_pharmacy_ntervention
Sultan khan 1 year ago
parent 53aa39cab9
commit 415b2174e7

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

Loading…
Cancel
Save