@@ -81,100 +81,101 @@ class EmailVerificationScreen extends StatelessWidget {
81
81
flex: 1 ,
82
82
child: SizedBox (
83
83
height: UiSizes .height_60,
84
- ),
85
- OtpTextField (
86
- autoFocus: true ,
87
- numberOfFields: 6 ,
88
- showFieldAsBox: true ,
89
- keyboardType: TextInputType .number,
90
- filled: true ,
91
- fillColor: Theme .of (context).colorScheme.secondary,
92
- borderWidth: 1 ,
93
- contentPadding: EdgeInsets .zero,
94
- borderColor: Colors .transparent,
95
- enabledBorderColor: Colors .transparent,
96
- focusedBorderColor: Theme .of (context).colorScheme.primary,
97
- // runs when every text-field is filled
98
- onSubmit: (String verificationCode) async {
99
- loadingDialog (context);
100
- emailVerifyController.isVerifying.value = true ;
101
- await emailVerifyController.verifyOTP (verificationCode);
102
-
103
- if (emailVerifyController.responseVerify.responseBody ==
104
- '{"message":"null"}' ) {
105
- String result =
106
- await emailVerifyController.checkVerificationStatus ();
107
- if (result == "true" ) {
108
- customSnackbar (
109
- "Verification Complete" ,
110
- "Congratulations you have verified your Email" ,
111
- LogType .success,
112
- );
84
+ child: OtpTextField (
85
+ autoFocus: true ,
86
+ numberOfFields: 6 ,
87
+ showFieldAsBox: true ,
88
+ keyboardType: TextInputType .number,
89
+ filled: true ,
90
+ fillColor: Theme .of (context).colorScheme.secondary,
91
+ borderWidth: 1 ,
92
+ contentPadding: EdgeInsets .zero,
93
+ borderColor: Colors .transparent,
94
+ enabledBorderColor: Colors .transparent,
95
+ focusedBorderColor: Theme .of (context).colorScheme.primary,
96
+ // runs when every text-field is filled
97
+ onSubmit: (String verificationCode) async {
98
+ loadingDialog (context);
99
+ emailVerifyController.isVerifying.value = true ;
100
+ await emailVerifyController.verifyOTP (verificationCode);
113
101
114
- SemanticsService .announce (
115
- "Congratulations you have verified your Email" ,
116
- TextDirection .ltr,
117
- );
118
- await emailVerifyController.setVerified ();
119
- if (emailVerifyController
120
- .responseSetVerified.responseBody ==
102
+ if (emailVerifyController.responseVerify.responseBody ==
121
103
'{"message":"null"}' ) {
122
- emailVerifyController.isVerifying.value = false ;
104
+ String result = await emailVerifyController
105
+ .checkVerificationStatus ();
106
+ if (result == "true" ) {
107
+ customSnackbar (
108
+ "Verification Complete" ,
109
+ "Congratulations you have verified your Email" ,
110
+ LogType .success,
111
+ );
112
+
113
+ SemanticsService .announce (
114
+ "Congratulations you have verified your Email" ,
115
+ TextDirection .ltr,
116
+ );
117
+ await emailVerifyController.setVerified ();
118
+ if (emailVerifyController
119
+ .responseSetVerified.responseBody ==
120
+ '{"message":"null"}' ) {
121
+ emailVerifyController.isVerifying.value = false ;
123
122
124
- // Close loading dialog
125
- Get .back ();
123
+ // Close loading dialog
124
+ Get .back ();
126
125
127
- controller.authStateController.setUserProfileData ();
128
- Get .offAllNamed (AppRoutes .tabview);
129
- } else {
130
- emailVerifyController.isVerifying.value = false ;
126
+ controller.authStateController.setUserProfileData ();
127
+ Get .offAllNamed (AppRoutes .tabview);
128
+ } else {
129
+ emailVerifyController.isVerifying.value = false ;
130
+
131
+ // Close loading dialog
132
+ Get .back ();
133
+
134
+ customSnackbar (
135
+ 'Oops' ,
136
+ emailVerifyController
137
+ .responseSetVerified.responseBody,
138
+ LogType .error,
139
+ );
140
+
141
+ SemanticsService .announce (
142
+ emailVerifyController
143
+ .responseSetVerified.responseBody,
144
+ TextDirection .ltr,
145
+ );
146
+ }
147
+ } else {
148
+ emailVerifyController.isVerifying.value = false ;
131
149
132
- // Close loading dialog
133
- Get .back ();
150
+ // Close loading dialog
151
+ Get .back ();
134
152
153
+ customSnackbar (
154
+ "Verification Failed" ,
155
+ "OTP mismatch occurred please try again" ,
156
+ LogType .error,
157
+ );
158
+
159
+ SemanticsService .announce (
160
+ "OTP mismatch occurred please try again" ,
161
+ TextDirection .ltr,
162
+ );
163
+ }
164
+ } else {
135
165
customSnackbar (
136
166
'Oops' ,
137
- emailVerifyController
138
- .responseSetVerified.responseBody,
167
+ emailVerifyController.responseVerify.responseBody,
139
168
LogType .error,
140
169
);
141
170
142
171
SemanticsService .announce (
143
- emailVerifyController
144
- .responseSetVerified.responseBody,
172
+ emailVerifyController.responseVerify.responseBody,
145
173
TextDirection .ltr,
146
174
);
147
175
}
148
- } else {
149
- emailVerifyController.isVerifying.value = false ;
150
-
151
- // Close loading dialog
152
- Get .back ();
153
-
154
- customSnackbar (
155
- "Verification Failed" ,
156
- "OTP mismatch occurred please try again" ,
157
- LogType .error,
158
- );
159
-
160
- SemanticsService .announce (
161
- "OTP mismatch occurred please try again" ,
162
- TextDirection .ltr,
163
- );
164
- }
165
- } else {
166
- customSnackbar (
167
- 'Oops' ,
168
- emailVerifyController.responseVerify.responseBody,
169
- LogType .error,
170
- );
171
-
172
- SemanticsService .announce (
173
- emailVerifyController.responseVerify.responseBody,
174
- TextDirection .ltr,
175
- );
176
- }
177
- },
176
+ },
177
+ ),
178
+ ),
178
179
),
179
180
SizedBox (
180
181
height: UiSizes .height_60,
0 commit comments