finish confirmation page

merge-requests/879/head
Elham Rababh 4 years ago
parent 5567b31daf
commit cf498de70f

@ -27,7 +27,7 @@ class BaseAppClient {
Function(String error, int statusCode) onFailure, Function(String error, int statusCode) onFailure,
bool isAllowAny = false, bool isAllowAny = false,
bool isLiveCare = false, bool isLiveCare = false,
bool isFallLanguage=false}) async { bool isFallLanguage = false}) async {
String url; String url;
if (isLiveCare) if (isLiveCare)
url = BASE_URL_LIVE_CARE + endPoint; url = BASE_URL_LIVE_CARE + endPoint;
@ -40,14 +40,17 @@ class BaseAppClient {
String token = await sharedPref.getString(TOKEN); String token = await sharedPref.getString(TOKEN);
if (profile != null) { if (profile != null) {
DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile); DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile);
if (body['DoctorID'] == null) body['DoctorID'] = doctorProfile?.doctorID; if (body['DoctorID'] == null)
body['DoctorID'] = doctorProfile?.doctorID;
if (body['DoctorID'] == "") body['DoctorID'] = null; if (body['DoctorID'] == "") body['DoctorID'] = null;
if (body['EditedBy'] == null) body['EditedBy'] = doctorProfile?.doctorID; if (body['EditedBy'] == null)
body['EditedBy'] = doctorProfile?.doctorID;
if (body['ProjectID'] == null) { if (body['ProjectID'] == null) {
body['ProjectID'] = doctorProfile?.projectID; body['ProjectID'] = doctorProfile?.projectID;
} }
if (body['ClinicID'] == null) body['ClinicID'] = doctorProfile?.clinicID; if (body['ClinicID'] == null)
body['ClinicID'] = doctorProfile?.clinicID;
} }
if (body['DoctorID'] == '') { if (body['DoctorID'] == '') {
body['DoctorID'] = null; body['DoctorID'] = null;
@ -59,7 +62,7 @@ class BaseAppClient {
body['TokenID'] = token ?? ''; body['TokenID'] = token ?? '';
} }
// body['TokenID'] = "@dm!n" ?? ''; // body['TokenID'] = "@dm!n" ?? '';
if(!isFallLanguage) { if (!isFallLanguage) {
String lang = await sharedPref.getString(APP_Language); String lang = await sharedPref.getString(APP_Language);
if (lang != null && lang == 'ar') if (lang != null && lang == 'ar')
body['LanguageID'] = 1; body['LanguageID'] = 1;
@ -69,22 +72,29 @@ class BaseAppClient {
body['stamp'] = DateTime.now().toIso8601String(); body['stamp'] = DateTime.now().toIso8601String();
// if(!body.containsKey("IPAdress")) // if(!body.containsKey("IPAdress"))
body['IPAdress'] = IP_ADDRESS; body['IPAdress'] = IP_ADDRESS;
if (body['VersionID'] == null) {
body['VersionID'] = VERSION_ID; body['VersionID'] = VERSION_ID;
}
if (body['Channel'] == null) {
body['Channel'] = CHANNEL; body['Channel'] = CHANNEL;
}
body['SessionID'] = SESSION_ID; body['SessionID'] = SESSION_ID;
body['IsLoginForDoctorApp'] = IS_LOGIN_FOR_DOCTOR_APP; body['IsLoginForDoctorApp'] = IS_LOGIN_FOR_DOCTOR_APP;
body['PatientOutSA'] = body['PatientOutSA'] ?? 0; // PATIENT_OUT_SA; body['PatientOutSA'] = body['PatientOutSA'] ?? 0; // PATIENT_OUT_SA;
if (body['VidaAuthTokenID'] == null) { if (body['VidaAuthTokenID'] == null) {
body['VidaAuthTokenID'] = await sharedPref.getString(VIDA_AUTH_TOKEN_ID); body['VidaAuthTokenID'] =
await sharedPref.getString(VIDA_AUTH_TOKEN_ID);
} }
if (body['VidaRefreshTokenID'] == null) { if (body['VidaRefreshTokenID'] == null) {
body['VidaRefreshTokenID'] = await sharedPref.getString(VIDA_REFRESH_TOKEN_ID); body['VidaRefreshTokenID'] =
await sharedPref.getString(VIDA_REFRESH_TOKEN_ID);
} }
int projectID = await sharedPref.getInt(PROJECT_ID); int projectID = await sharedPref.getInt(PROJECT_ID);
if (projectID == 2 || projectID == 3) if (projectID == 2 || projectID == 3)
body['PatientOutSA'] = true; body['PatientOutSA'] = true;
else if ((body.containsKey('facilityId') && body['facilityId'] == 2 || body['facilityId'] == 3) || else if ((body.containsKey('facilityId') && body['facilityId'] == 2 ||
body['facilityId'] == 3) ||
body['ProjectID'] == 2 || body['ProjectID'] == 2 ||
body['ProjectID'] == 3) body['ProjectID'] == 3)
body['PatientOutSA'] = true; body['PatientOutSA'] = true;
@ -98,21 +108,28 @@ class BaseAppClient {
var asd2; var asd2;
if (await Helpers.checkConnection()) { if (await Helpers.checkConnection()) {
final response = await http.post(url, final response = await http.post(url,
body: json.encode(body), headers: {'Content-Type': 'application/json', 'Accept': 'application/json'}); body: json.encode(body),
headers: {
'Content-Type': 'application/json',
'Accept': 'application/json'
});
final int statusCode = response.statusCode; final int statusCode = response.statusCode;
if (statusCode < 200 || statusCode >= 400) { if (statusCode < 200 || statusCode >= 400) {
onFailure(Helpers.generateContactAdminMsg(), statusCode); onFailure(Helpers.generateContactAdminMsg(), statusCode);
} else { } else {
var parsed = json.decode(response.body.toString()); var parsed = json.decode(response.body.toString());
if (parsed['ErrorType'] == 4) { if (parsed['ErrorType'] == 4) {
helpers.navigateToUpdatePage(parsed['ErrorEndUserMessage'], parsed['AndroidLink'], parsed['IOSLink']); helpers.navigateToUpdatePage(parsed['ErrorEndUserMessage'],
parsed['AndroidLink'], parsed['IOSLink']);
} }
if (parsed['IsAuthenticated'] != null && !parsed['IsAuthenticated']) { if (parsed['IsAuthenticated'] != null && !parsed['IsAuthenticated']) {
if (body['OTP_SendType'] != null) { if (body['OTP_SendType'] != null) {
onFailure(getError(parsed), statusCode); onFailure(getError(parsed), statusCode);
} else if (!isAllowAny) { } else if (!isAllowAny) {
await Provider.of<AuthenticationViewModel>(AppGlobal.CONTEX, listen: false).logout(); await Provider.of<AuthenticationViewModel>(AppGlobal.CONTEX,
listen: false)
.logout();
Helpers.showErrorToast('Your session expired Please login again'); Helpers.showErrorToast('Your session expired Please login again');
locator<NavigationService>().pushNamedAndRemoveUntil(ROOT); locator<NavigationService>().pushNamedAndRemoveUntil(ROOT);
@ -147,10 +164,14 @@ class BaseAppClient {
String url = BASE_URL + endPoint; String url = BASE_URL + endPoint;
try { try {
Map<String, String> headers = {'Content-Type': 'application/json', 'Accept': 'application/json'}; Map<String, String> headers = {
'Content-Type': 'application/json',
'Accept': 'application/json'
};
String token = await sharedPref.getString(TOKEN); String token = await sharedPref.getString(TOKEN);
var languageID = await sharedPref.getStringWithDefaultValue(APP_Language, 'en'); var languageID =
await sharedPref.getStringWithDefaultValue(APP_Language, 'en');
body['SetupID'] = body.containsKey('SetupID') body['SetupID'] = body.containsKey('SetupID')
? body['SetupID'] != null ? body['SetupID'] != null
? body['SetupID'] ? body['SetupID']
@ -170,7 +191,8 @@ class BaseAppClient {
: PATIENT_OUT_SA_PATIENT_REQ; : PATIENT_OUT_SA_PATIENT_REQ;
if (body.containsKey('isDentalAllowedBackend')) { if (body.containsKey('isDentalAllowedBackend')) {
body['isDentalAllowedBackend'] = body.containsKey('isDentalAllowedBackend') body['isDentalAllowedBackend'] =
body.containsKey('isDentalAllowedBackend')
? body['isDentalAllowedBackend'] != null ? body['isDentalAllowedBackend'] != null
? body['isDentalAllowedBackend'] ? body['isDentalAllowedBackend']
: IS_DENTAL_ALLOWED_BACKEND : IS_DENTAL_ALLOWED_BACKEND
@ -196,7 +218,9 @@ class BaseAppClient {
: PATIENT_TYPE_ID; : PATIENT_TYPE_ID;
body['TokenID'] = body.containsKey('TokenID') ? body['TokenID'] : token; body['TokenID'] = body.containsKey('TokenID') ? body['TokenID'] : token;
body['PatientID'] = body['PatientID'] != null ? body['PatientID'] : patient.patientId ?? patient.patientMRN; body['PatientID'] = body['PatientID'] != null
? body['PatientID']
: patient.patientId ?? patient.patientMRN;
body['PatientOutSA'] = 0; //user['OutSA']; //TODO change it body['PatientOutSA'] = 0; //user['OutSA']; //TODO change it
body['SessionID'] = SESSION_ID; //getSe body['SessionID'] = SESSION_ID; //getSe
@ -209,9 +233,11 @@ class BaseAppClient {
print("URL : $url"); print("URL : $url");
print("Body : ${json.encode(body)}"); print("Body : ${json.encode(body)}");
var asd = json.encode(body);
var asd2;
if (await Helpers.checkConnection()) { if (await Helpers.checkConnection()) {
final response = await http.post(url.trim(), body: json.encode(body), headers: headers); final response = await http.post(url.trim(),
body: json.encode(body), headers: headers);
final int statusCode = response.statusCode; final int statusCode = response.statusCode;
print("statusCode :$statusCode"); print("statusCode :$statusCode");
if (statusCode < 200 || statusCode >= 400 || json == null) { if (statusCode < 200 || statusCode >= 400 || json == null) {
@ -223,7 +249,8 @@ class BaseAppClient {
onSuccess(parsed, statusCode); onSuccess(parsed, statusCode);
} else { } else {
if (parsed['ErrorType'] == 4) { if (parsed['ErrorType'] == 4) {
helpers.navigateToUpdatePage(parsed['ErrorEndUserMessage'], parsed['AndroidLink'], parsed['IOSLink']); helpers.navigateToUpdatePage(parsed['ErrorEndUserMessage'],
parsed['AndroidLink'], parsed['IOSLink']);
} }
if (parsed['IsAuthenticated'] == null) { if (parsed['IsAuthenticated'] == null) {
if (parsed['isSMSSent'] == true) { if (parsed['isSMSSent'] == true) {
@ -239,20 +266,28 @@ class BaseAppClient {
onFailure(getError(parsed), statusCode); onFailure(getError(parsed), statusCode);
} }
} }
} else if (parsed['MessageStatus'] == 1 || parsed['SMSLoginRequired'] == true) { } else if (parsed['MessageStatus'] == 1 ||
parsed['SMSLoginRequired'] == true) {
onSuccess(parsed, statusCode); onSuccess(parsed, statusCode);
} else if (parsed['MessageStatus'] == 2 && parsed['IsAuthenticated']) { } else if (parsed['MessageStatus'] == 2 &&
parsed['IsAuthenticated']) {
if (parsed['SameClinicApptList'] != null) { if (parsed['SameClinicApptList'] != null) {
onSuccess(parsed, statusCode); onSuccess(parsed, statusCode);
} else { } else {
if (parsed['message'] == null && parsed['ErrorEndUserMessage'] == null) { if (parsed['message'] == null &&
parsed['ErrorEndUserMessage'] == null) {
if (parsed['ErrorSearchMsg'] == null) { if (parsed['ErrorSearchMsg'] == null) {
onFailure("Server Error found with no available message", statusCode); onFailure("Server Error found with no available message",
statusCode);
} else { } else {
onFailure(parsed['ErrorSearchMsg'], statusCode); onFailure(parsed['ErrorSearchMsg'], statusCode);
} }
} else { } else {
onFailure(parsed['message'] ?? parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], statusCode); onFailure(
parsed['message'] ??
parsed['ErrorEndUserMessage'] ??
parsed['ErrorMessage'],
statusCode);
} }
} }
} else { } else {
@ -262,7 +297,9 @@ class BaseAppClient {
if (parsed['message'] != null) { if (parsed['message'] != null) {
onFailure(parsed['message'] ?? parsed['message'], statusCode); onFailure(parsed['message'] ?? parsed['message'], statusCode);
} else { } else {
onFailure(parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], statusCode); onFailure(
parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'],
statusCode);
} }
} }
} }
@ -285,8 +322,12 @@ class BaseAppClient {
if (parsed["ValidationErrors"]["ValidationErrors"] != null && if (parsed["ValidationErrors"]["ValidationErrors"] != null &&
parsed["ValidationErrors"]["ValidationErrors"].length != 0) { parsed["ValidationErrors"]["ValidationErrors"].length != 0) {
for (var i = 0; i < parsed["ValidationErrors"]["ValidationErrors"].length; i++) { for (var i = 0;
error = error + parsed["ValidationErrors"]["ValidationErrors"][i]["Messages"][0] + "\n"; i < parsed["ValidationErrors"]["ValidationErrors"].length;
i++) {
error = error +
parsed["ValidationErrors"]["ValidationErrors"][i]["Messages"][0] +
"\n";
} }
} }
} }

@ -373,8 +373,8 @@ const GET_ADMISSION_ORDERS =
///Patient Registration Services ///Patient Registration Services
const CHECK_PATIENT_FOR_REGISTRATION = const CHECK_PATIENT_FOR_REGISTRATION =
"Services/Authentication.svc/REST/CheckPatientForRegisteration"; "Services/Authentication.svc/REST/CheckPatientForRegisteration";
const SEND_ACTIVATION_CODE_BY_OTP_NOT_TYPE = const SEND_ACTIVATION_CODE_BY_OTP_NOT_TYPE_FOR_REGISTRATION =
"Services/Authentication.svc/REST/SendActivationCodebyOTPNotificationType"; "Services/Authentication.svc/REST/SendActivationCodebyOTPNotificationTypeForRegistration";
const CHECK_ACTIVATION_CODE_FOR_PATIENT = const CHECK_ACTIVATION_CODE_FOR_PATIENT =
"Services/Authentication.svc/REST/CheckActivationCode"; "Services/Authentication.svc/REST/CheckActivationCode";
const PATIENT_REGISTRATION = "Services/Authentication.svc/REST/PatientRegistration"; const PATIENT_REGISTRATION = "Services/Authentication.svc/REST/PatientRegistration";

@ -16,7 +16,7 @@ class SendActivationCodeByOTPNotificationTypeForRegistrationModel {
int channel; int channel;
String iPAdress; String iPAdress;
String generalid; String generalid;
bool patientOutSA; int patientOutSA;
Null sessionID; Null sessionID;
bool isDentalAllowedBackend; bool isDentalAllowedBackend;
int deviceTypeID; int deviceTypeID;

@ -10,13 +10,16 @@ import 'package:doctor_app_flutter/core/viewModel/PatientRegistrationViewModel.d
class PatientRegistrationService extends BaseService { class PatientRegistrationService extends BaseService {
GetPatientInfoResponseModel getPatientInfoResponseModel; GetPatientInfoResponseModel getPatientInfoResponseModel;
String logInTokenID;
checkPatientForRegistration( checkPatientForRegistration(
CheckPatientForRegistrationModel registrationModel) async { CheckPatientForRegistrationModel registrationModel) async {
hasError = false; hasError = false;
await baseAppClient.post(CHECK_PATIENT_FOR_REGISTRATION, await baseAppClient.post(CHECK_PATIENT_FOR_REGISTRATION,
onSuccess: (dynamic response, int statusCode) {}, onSuccess: (dynamic response, int statusCode) {
onFailure: (String error, int statusCode) { //TODO Elham* fix it
logInTokenID = "OjEi/qgRekGICZm5/a4jbQ=="; //response["LogInTokenID"];
}, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
super.error = error; super.error = error;
}, body: registrationModel.toJson()); }, body: registrationModel.toJson());
@ -39,24 +42,39 @@ class PatientRegistrationService extends BaseService {
{SendActivationCodeByOTPNotificationTypeForRegistrationModel {SendActivationCodeByOTPNotificationTypeForRegistrationModel
registrationModel, registrationModel,
int otpType, int otpType,
PatientRegistrationViewModel user, PatientRegistrationViewModel model,
CheckPatientForRegistrationModel CheckPatientForRegistrationModel
checkPatientForRegistrationModel}) async { checkPatientForRegistrationModel}) async {
registrationModel = registrationModel =
SendActivationCodeByOTPNotificationTypeForRegistrationModel( SendActivationCodeByOTPNotificationTypeForRegistrationModel(
oTPSendType: otpType, oTPSendType: otpType,
patientIdentificationID: patientIdentificationID: checkPatientForRegistrationModel
checkPatientForRegistrationModel.patientIdentificationID, .patientIdentificationID,
patientMobileNumber: checkPatientForRegistrationModel.patientMobileNumber, patientMobileNumber: checkPatientForRegistrationModel
.patientMobileNumber,
zipCode: checkPatientForRegistrationModel.zipCode, zipCode: checkPatientForRegistrationModel.zipCode,
patientOutSA: false, patientOutSA: 0,
healthId: "30000018540264", healthId: model.getPatientInfoResponseModel.healthId,
dOB: checkPatientForRegistrationModel.dOB, dOB: checkPatientForRegistrationModel.dOB,
isRegister: checkPatientForRegistrationModel.isRegister, isRegister: checkPatientForRegistrationModel.isRegister,
isHijri: checkPatientForRegistrationModel.isHijri, isHijri: checkPatientForRegistrationModel.isHijri,
); sessionID: null,
generalid: GENERAL_ID,
isDentalAllowedBackend: false,
projectOutSA: 0,
searchType: 1,
versionID: 7.1,
channel: 3,
nationalID:
model.checkPatientForRegistrationModel.patientIdentificationID,
patientID: 0,
mobileNo: model.checkPatientForRegistrationModel.patientMobileNumber
.toString(),
loginType: otpType,
logInTokenID: logInTokenID);
hasError = false; hasError = false;
await baseAppClient.post(SEND_ACTIVATION_CODE_BY_OTP_NOT_TYPE, await baseAppClient.post(SEND_ACTIVATION_CODE_BY_OTP_NOT_TYPE_FOR_REGISTRATION,
onSuccess: (dynamic response, int statusCode) { onSuccess: (dynamic response, int statusCode) {
registrationModel = registrationModel =
SendActivationCodeByOTPNotificationTypeForRegistrationModel.fromJson( SendActivationCodeByOTPNotificationTypeForRegistrationModel.fromJson(

@ -399,7 +399,8 @@ class _HomeScreenState extends State<HomeScreen> {
patientCards.add(HomePatientCard( patientCards.add(HomePatientCard(
backgroundColor: backgroundColors[colorIndex], backgroundColor: backgroundColors[colorIndex],
backgroundIconColor: backgroundIconColors[colorIndex], backgroundIconColor: backgroundIconColors[colorIndex],
cardIconImage: 'assets/images/patient_register.png', //TODO Elham* match the of the icon
cardIcon: DoctorApp.arrival_patients,
textColor: textColors[colorIndex], textColor: textColors[colorIndex],
text: TranslationBase.of(context).registerNewPatient, text: TranslationBase.of(context).registerNewPatient,
onTap: () { onTap: () {

@ -39,12 +39,12 @@ class _RegisterSearchPatientPageState extends State<RegisterSearchPatientPage> {
bool isSubmitted = false; bool isSubmitted = false;
TextEditingController _phoneController = TextEditingController(); TextEditingController _phoneController = TextEditingController(text: "508079569");
TextEditingController _phoneCode = TextEditingController(text: "966"); TextEditingController _phoneCode = TextEditingController(text: "966");
String phoneError; String phoneError;
TextEditingController _idController = TextEditingController(); TextEditingController _idController = TextEditingController(text: "1062938285");
String idError; String idError;
DateTime _birthDate; DateTime _birthDate;
@ -292,7 +292,7 @@ class _RegisterSearchPatientPageState extends State<RegisterSearchPatientPage> {
isFormValid() { isFormValid() {
if(_phoneController.text!=null &&_phoneController.text.isNotEmpty&& _idController.text!=null &&_idController.text.isNotEmpty) { if(_phoneController.text!=null &&_phoneController.text.isNotEmpty&& _idController.text!=null &&_idController.text.isNotEmpty &&_birthDate!=null) {
return true; return true;
} }
return false; return false;

@ -1,7 +1,9 @@
import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/model/PatientRegistration/CheckPatientForRegistrationModel.dart'; import 'package:doctor_app_flutter/core/model/PatientRegistration/CheckPatientForRegistrationModel.dart';
import 'package:doctor_app_flutter/core/viewModel/PatientRegistrationViewModel.dart'; import 'package:doctor_app_flutter/core/viewModel/PatientRegistrationViewModel.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/util/helpers.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
@ -13,6 +15,7 @@ import 'package:hexcolor/hexcolor.dart';
class ActivationPage extends StatefulWidget { class ActivationPage extends StatefulWidget {
final PatientRegistrationViewModel model; final PatientRegistrationViewModel model;
final Function changePageViewIndex; final Function changePageViewIndex;
ActivationPage({this.model, this.changePageViewIndex}); ActivationPage({this.model, this.changePageViewIndex});
@override @override
@ -22,6 +25,7 @@ class ActivationPage extends StatefulWidget {
class _ActivationPageState extends State<ActivationPage> { class _ActivationPageState extends State<ActivationPage> {
bool isSendOtp = false; bool isSendOtp = false;
final verifyAccountForm = GlobalKey<FormState>(); final verifyAccountForm = GlobalKey<FormState>();
TextStyle buildTextStyle() { TextStyle buildTextStyle() {
return TextStyle( return TextStyle(
fontSize: SizeConfig.textMultiplier * 3, fontSize: SizeConfig.textMultiplier * 3,
@ -74,13 +78,14 @@ class _ActivationPageState extends State<ActivationPage> {
Expanded( Expanded(
child: InkWell( child: InkWell(
onTap: () async { onTap: () async {
setState(() { // setState(() {
isSendOtp = true; // isSendOtp = true;
}); // });
//
await widget.model // await widget.model
.sendActivationCodeByOTPNotificationType( // .sendActivationCodeByOTPNotificationType(
otpType: 1); // otpType: 1);
await sendActivationCode(1);
}, },
child: Container( child: Container(
height: height:
@ -130,10 +135,7 @@ class _ActivationPageState extends State<ActivationPage> {
Expanded( Expanded(
child: InkWell( child: InkWell(
onTap: () async { onTap: () async {
isSendOtp = false; await sendActivationCode(2);
await widget.model
.sendActivationCodeByOTPNotificationType(
otpType: 1, user: widget.model);
}, },
child: Container( child: Container(
height: height:
@ -442,7 +444,17 @@ class _ActivationPageState extends State<ActivationPage> {
fontColor: Colors.white, fontColor: Colors.white,
fontSize: 2.0, fontSize: 2.0,
onPressed: () async { onPressed: () async {
//widget.model.checkActivationCode(), GifLoaderDialogUtils.showMyDialog(context);
await widget.model.checkActivationCode("${digit1.text}${digit2.text}${digit3.text}${digit4.text}");
if (widget.model.state == ViewState.ErrorLocal) {
Helpers.showErrorToast(widget.model.error);
//TODO Elham* remove this
widget.changePageViewIndex(2);
GifLoaderDialogUtils.hideDialog(context);
} else {
GifLoaderDialogUtils.hideDialog(context);
widget.changePageViewIndex(2);
}
}, },
), ),
), ),
@ -453,6 +465,21 @@ class _ActivationPageState extends State<ActivationPage> {
: null); : null);
} }
sendActivationCode(type) async {
GifLoaderDialogUtils.showMyDialog(context);
await widget.model.sendActivationCodeByOTPNotificationType(otpType: type);
if (widget.model.state == ViewState.ErrorLocal) {
Helpers.showErrorToast(widget.model.error);
GifLoaderDialogUtils.hideDialog(context);
// TODO Elham* retuen the else
// } else {
setState(() {
isSendOtp = true;
});
}
}
InputDecoration buildInputDecoration(BuildContext context) { InputDecoration buildInputDecoration(BuildContext context) {
return InputDecoration( return InputDecoration(
counterText: " ", counterText: " ",

Loading…
Cancel
Save