|
|
|
|
@ -1,6 +1,5 @@
|
|
|
|
|
import 'dart:async';
|
|
|
|
|
|
|
|
|
|
import 'package:doctor_app_flutter/config/config.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/config/size_config.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/core/enum/auth_method_types.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
|
|
|
|
|
@ -48,6 +47,8 @@ class SMSOTP {
|
|
|
|
|
String displayTime = '';
|
|
|
|
|
bool isClosed = false;
|
|
|
|
|
displayDialog(BuildContext context) async {
|
|
|
|
|
double dialogWidth = MediaQuery.of(context).size.width * 0.84;
|
|
|
|
|
double dialogHeight = MediaQuery.of(context).size.height * 0.50;
|
|
|
|
|
return showDialog(
|
|
|
|
|
context: context,
|
|
|
|
|
barrierColor: Colors.black.withOpacity(0.7),
|
|
|
|
|
@ -61,8 +62,8 @@ class SMSOTP {
|
|
|
|
|
}
|
|
|
|
|
return Container(
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
height: MediaQuery.of(context).size.height * 0.50,
|
|
|
|
|
width: MediaQuery.of(context).size.width * 0.84,
|
|
|
|
|
height: dialogHeight,
|
|
|
|
|
width: dialogWidth,
|
|
|
|
|
child: Center(
|
|
|
|
|
child: SingleChildScrollView(
|
|
|
|
|
child: Column(
|
|
|
|
|
@ -71,20 +72,15 @@ class SMSOTP {
|
|
|
|
|
Padding(
|
|
|
|
|
padding: EdgeInsets.all(13),
|
|
|
|
|
child: Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment
|
|
|
|
|
.spaceBetween,
|
|
|
|
|
children: [
|
|
|
|
|
type == AuthMethodTypes.SMS
|
|
|
|
|
? Padding(
|
|
|
|
|
child: Icon(
|
|
|
|
|
DoctorApp.verify_sms_1,
|
|
|
|
|
size: 50,
|
|
|
|
|
),
|
|
|
|
|
padding: EdgeInsets.only(bottom: 20),
|
|
|
|
|
)
|
|
|
|
|
: Padding(
|
|
|
|
|
Padding(
|
|
|
|
|
child: Icon(
|
|
|
|
|
DoctorApp.verify_whtsapp,
|
|
|
|
|
size: 50,
|
|
|
|
|
type == AuthMethodTypes.SMS
|
|
|
|
|
? DoctorApp.verify_sms_1
|
|
|
|
|
: DoctorApp.verify_whtsapp,
|
|
|
|
|
size: dialogWidth * 0.13,
|
|
|
|
|
),
|
|
|
|
|
padding: EdgeInsets.only(bottom: 20),
|
|
|
|
|
),
|
|
|
|
|
@ -96,7 +92,7 @@ class SMSOTP {
|
|
|
|
|
left: 10, right: 10, bottom: 20),
|
|
|
|
|
child: IconButton(
|
|
|
|
|
icon: Icon(Icons.close),
|
|
|
|
|
iconSize: 40,
|
|
|
|
|
iconSize: dialogWidth * 0.13,
|
|
|
|
|
onPressed: () {
|
|
|
|
|
this.isClosed = true;
|
|
|
|
|
Navigator.pop(context);
|
|
|
|
|
@ -129,17 +125,20 @@ class SMSOTP {
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Container(
|
|
|
|
|
width: SizeConfig.realScreenWidth * 0.16,
|
|
|
|
|
width: (dialogWidth / 4) - 20,
|
|
|
|
|
height: 100,
|
|
|
|
|
margin: EdgeInsets.all(5),
|
|
|
|
|
child: TextFormField(
|
|
|
|
|
textInputAction: TextInputAction.next,
|
|
|
|
|
textInputAction: TextInputAction
|
|
|
|
|
.next,
|
|
|
|
|
style: buildTextStyle(),
|
|
|
|
|
autofocus: true,
|
|
|
|
|
maxLength: 1,
|
|
|
|
|
controller: digit1,
|
|
|
|
|
textAlign: TextAlign.center,
|
|
|
|
|
keyboardType: TextInputType.number,
|
|
|
|
|
decoration: buildInputDecoration(context),
|
|
|
|
|
decoration: buildInputDecoration(
|
|
|
|
|
context),
|
|
|
|
|
onSaved: (val) {},
|
|
|
|
|
validator: validateCodeDigit,
|
|
|
|
|
onFieldSubmitted: (_) {
|
|
|
|
|
@ -158,17 +157,20 @@ class SMSOTP {
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
width: SizeConfig.realScreenWidth * 0.16,
|
|
|
|
|
width: dialogWidth / 4 - 30,
|
|
|
|
|
margin: EdgeInsets.all(5),
|
|
|
|
|
child: TextFormField(
|
|
|
|
|
focusNode: focusD2,
|
|
|
|
|
textInputAction: TextInputAction.next,
|
|
|
|
|
textInputAction: TextInputAction
|
|
|
|
|
.next,
|
|
|
|
|
maxLength: 1,
|
|
|
|
|
controller: digit2,
|
|
|
|
|
textAlign: TextAlign.center,
|
|
|
|
|
style: buildTextStyle(),
|
|
|
|
|
keyboardType: TextInputType.number,
|
|
|
|
|
decoration: buildInputDecoration(context),
|
|
|
|
|
keyboardType: TextInputType
|
|
|
|
|
.number,
|
|
|
|
|
decoration: buildInputDecoration(
|
|
|
|
|
context),
|
|
|
|
|
onSaved: (val) {},
|
|
|
|
|
onFieldSubmitted: (_) {
|
|
|
|
|
FocusScope.of(context)
|
|
|
|
|
@ -187,15 +189,17 @@ class SMSOTP {
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
margin: EdgeInsets.all(5),
|
|
|
|
|
width: SizeConfig.realScreenWidth * 0.16,
|
|
|
|
|
width: dialogWidth / 4 - 30,
|
|
|
|
|
child: TextFormField(
|
|
|
|
|
focusNode: focusD3,
|
|
|
|
|
textInputAction: TextInputAction.next,
|
|
|
|
|
textInputAction: TextInputAction
|
|
|
|
|
.next,
|
|
|
|
|
maxLength: 1,
|
|
|
|
|
controller: digit3,
|
|
|
|
|
textAlign: TextAlign.center,
|
|
|
|
|
style: buildTextStyle(),
|
|
|
|
|
keyboardType: TextInputType.number,
|
|
|
|
|
keyboardType: TextInputType
|
|
|
|
|
.number,
|
|
|
|
|
decoration:
|
|
|
|
|
buildInputDecoration(context),
|
|
|
|
|
onSaved: (val) {},
|
|
|
|
|
@ -215,14 +219,15 @@ class SMSOTP {
|
|
|
|
|
validator: validateCodeDigit)),
|
|
|
|
|
Container(
|
|
|
|
|
margin: EdgeInsets.all(5),
|
|
|
|
|
width: SizeConfig.realScreenWidth * 0.16,
|
|
|
|
|
width: dialogWidth / 4 - 30,
|
|
|
|
|
child: TextFormField(
|
|
|
|
|
focusNode: focusD4,
|
|
|
|
|
maxLength: 1,
|
|
|
|
|
textAlign: TextAlign.center,
|
|
|
|
|
style: buildTextStyle(),
|
|
|
|
|
controller: digit4,
|
|
|
|
|
keyboardType: TextInputType.number,
|
|
|
|
|
keyboardType: TextInputType
|
|
|
|
|
.number,
|
|
|
|
|
decoration:
|
|
|
|
|
buildInputDecoration(context),
|
|
|
|
|
onFieldSubmitted: (_) {
|
|
|
|
|
|