merge-update-with-lab-changes
Aamir Muhammad 7 months ago committed by haroon amjad
parent 80b8084a7f
commit c3b8ec6067

File diff suppressed because one or more lines are too long

@ -21,8 +21,8 @@ var PACKAGES_ORDERS = '/api/orders';
var PACKAGES_ORDER_HISTORY = '/api/orders/items'; var PACKAGES_ORDER_HISTORY = '/api/orders/items';
var PACKAGES_TAMARA_OPT = '/api/orders/paymentoptions/tamara'; var PACKAGES_TAMARA_OPT = '/api/orders/paymentoptions/tamara';
// var BASE_URL = 'http://10.50.100.198:2018/'; // var BASE_URL = 'http://10.50.100.198:2018/';
var BASE_URL = 'https://uat.hmgwebservices.com/'; // var BASE_URL = 'https://uat.hmgwebservices.com/';
// var BASE_URL = 'https://hmgwebservices.com/'; var BASE_URL = 'https://hmgwebservices.com/';
// var BASE_URL = 'http://10.201.204.103/'; // var BASE_URL = 'http://10.201.204.103/';
// var BASE_URL = 'https://orash.cloudsolutions.com.sa/'; // var BASE_URL = 'https://orash.cloudsolutions.com.sa/';
// var BASE_URL = 'https://vidauat.cloudsolutions.com.sa/'; // var BASE_URL = 'https://vidauat.cloudsolutions.com.sa/';

@ -2334,7 +2334,7 @@ const Map localizedValues = {
"prepareToElevate": {"en": "Prepared to elevate your health and well-being?", "ar": "هل أنت مستعد لتحسين صحتك ورفاهتك؟"}, "prepareToElevate": {"en": "Prepared to elevate your health and well-being?", "ar": "هل أنت مستعد لتحسين صحتك ورفاهتك؟"},
"alreadyHaveAccount": {"en": "Already have an account?", "ar": "هل لديك حساب بالفعل؟"}, "alreadyHaveAccount": {"en": "Already have an account?", "ar": "هل لديك حساب بالفعل؟"},
"loginNow": {"en": "Login Now", "ar": "تسجيل الدخول الآن"}, "loginNow": {"en": "Login Now", "ar": "تسجيل الدخول الآن"},
"guest": {"en": "Guest", "ar":"ضيف"}, "guest": {"en": "Guest", "ar":"زائر"},
"switchAccount": {"en": "Switch Account", "ar":"تبديل الحساب"}, "switchAccount": {"en": "Switch Account", "ar":"تبديل الحساب"},
"allSet": {"en": "All Set! Now you can login with Face ID or Biometric", "ar":"جاهز! الآن يمكنك تسجيل الدخول باستخدام Face ID / Biometric أو البصمة"}, "allSet": {"en": "All Set! Now you can login with Face ID or Biometric", "ar":"جاهز! الآن يمكنك تسجيل الدخول باستخدام Face ID / Biometric أو البصمة"},
"enableQuickLogin": {"en": "Enable Quick Login", "ar":"تمكين تسجيل الدخول السريع"}, "enableQuickLogin": {"en": "Enable Quick Login", "ar":"تمكين تسجيل الدخول السريع"},

@ -95,8 +95,8 @@ class _ExceptionBottomSheetState extends State<ExceptionBottomSheet> {
child: CustomButton( child: CustomButton(
text: widget.showCancel ? TranslationBase.of(context).confirm : TranslationBase.of(context).ok, text: widget.showCancel ? TranslationBase.of(context).confirm : TranslationBase.of(context).ok,
onPressed: widget.onOkPressed, onPressed: widget.onOkPressed,
backgroundColor: CustomColors.bgRedColor, backgroundColor: CustomColors.bgGreenColor,
borderColor: CustomColors.bgRedBorderColor, borderColor: CustomColors.bgGreenColor,
textColor: Colors.white, textColor: Colors.white,
icon: "assets/images/svg/confirm.svg", icon: "assets/images/svg/confirm.svg",
), ),

@ -74,7 +74,7 @@ class _RegisterNew extends State<RegisterNew> {
CheckUserStatusResponse? nHICData; CheckUserStatusResponse? nHICData;
final int loginType = LoginType.loginType; final int loginType = LoginType.loginType;
late String mobileNo; String mobileNo = '';
var loginTokenID; var loginTokenID;
// String countryCode = '966'; // String countryCode = '966';
@ -322,6 +322,18 @@ class _RegisterNew extends State<RegisterNew> {
// Utils.showErrorToast(TranslationBase.of(context).pleaseEnterNationalId); // Utils.showErrorToast(TranslationBase.of(context).pleaseEnterNationalId);
return; return;
} }
if (nationalIDorFile != null && !Utils.validateIqama(nationalIDorFile.text)) {
context.showBottomSheet(
child: ExceptionBottomSheet(
message: "Please enter correct national id",
showCancel: false,
onOkPressed: () {
Navigator.of(context).pop();
},
),
);
return;
}
if (selectedCountry == null || selectedCountry.countryCode.isEmpty) { if (selectedCountry == null || selectedCountry.countryCode.isEmpty) {
context.showBottomSheet( context.showBottomSheet(
child: ExceptionBottomSheet( child: ExceptionBottomSheet(
@ -384,8 +396,33 @@ class _RegisterNew extends State<RegisterNew> {
child: CustomButton( child: CustomButton(
text: TranslationBase.of(context).sendOTPSMS, text: TranslationBase.of(context).sendOTPSMS,
onPressed: () { onPressed: () {
int? val = Utils.onOtpBtnPressed(OTPType.sms, mobileNo, context); if (mobileNo.isEmpty) {
registerUser(val); context.showBottomSheet(
child: ExceptionBottomSheet(
message: "Please enter mobile number",
showCancel: false,
onOkPressed: () {
Navigator.of(context).pop();
},
),
);
}
//
// else if (mobileNo.length < 8) {
// context.showBottomSheet(
// child: ExceptionBottomSheet(
// message: "Please enter correct mobile number",
// showCancel: false,
// onOkPressed: () {
// Navigator.of(context).pop();
// },
// ),
// );
// }
else {
registerUser(1);
}
}, },
backgroundColor: CustomColors.bgRedColor, backgroundColor: CustomColors.bgRedColor,
borderColor: CustomColors.bgRedBorderColor, borderColor: CustomColors.bgRedBorderColor,
@ -414,8 +451,31 @@ class _RegisterNew extends State<RegisterNew> {
child: CustomButton( child: CustomButton(
text: TranslationBase.of(context).sendOTPWHATSAPP, text: TranslationBase.of(context).sendOTPWHATSAPP,
onPressed: () { onPressed: () {
int? val = Utils.onOtpBtnPressed(OTPType.whatsapp, mobileNo, context); if (mobileNo.isEmpty) {
registerUser(val); context.showBottomSheet(
child: ExceptionBottomSheet(
message: "Please enter mobile number",
showCancel: false,
onOkPressed: () {
Navigator.of(context).pop();
},
),
);
} else if (mobileNo.length < 9) {
context.showBottomSheet(
child: ExceptionBottomSheet(
message: "Please enter correct mobile number",
showCancel: false,
onOkPressed: () {
Navigator.of(context).pop();
},
),
);
} else {
registerUser(4);
}
// int? val = Utils.onOtpBtnPressed(OTPType.whatsapp, mobileNo, context);
// registerUser(val);
}, },
backgroundColor: Colors.white, backgroundColor: Colors.white,
borderColor: Color(0xFF2E3039), borderColor: Color(0xFF2E3039),
@ -555,22 +615,24 @@ class _RegisterNew extends State<RegisterNew> {
checkPatientForRegistration({required CheckPatientForRegistration registrationData, type}) { checkPatientForRegistration({required CheckPatientForRegistration registrationData, type}) {
int languageID = Provider.of<ProjectViewModel>(context, listen: false).isArabic ? 1 : 2; int languageID = Provider.of<ProjectViewModel>(context, listen: false).isArabic ? 1 : 2;
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
authService.checkPatientForRegisteration(registrationData, languageID).then((response) => { authService
// Keep loader active, continue to next step .checkPatientForRegisteration(registrationData, languageID)
checkUserStatus(response, registrationData, type) .then((response) => {
}).catchError((err) { // Keep loader active, continue to next step
checkUserStatus(response, registrationData, type)
})
.catchError((err) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
// context.showBottomSheet(
context.showBottomSheet( // child: ExceptionBottomSheet(
child: ExceptionBottomSheet( // showCancel: true,
showCancel: true, // message: err,
message: err, // onOkPressed: () {
onOkPressed: () { // Navigator.of(context).pop();
Navigator.of(context).pop(); // Navigator.of(context).push(FadePage(page: RegisterNew()));
Navigator.of(context).push(FadePage(page: RegisterNew())); // },
}, // ),
), // );
);
}); });
} }
@ -580,12 +642,13 @@ class _RegisterNew extends State<RegisterNew> {
var nRequest = request.toJson(); var nRequest = request.toJson();
nRequest['LogInTokenID'] = response['LogInTokenID']; nRequest['LogInTokenID'] = response['LogInTokenID'];
if (response['hasFile'] == true) { if (response['hasFile'] == true) {
GifLoaderDialogUtils.hideDialog(context);
context.showBottomSheet( context.showBottomSheet(
child: ExceptionBottomSheet( child: ExceptionBottomSheet(
message: response['ErrorEndUserMessage'], message: response['ErrorEndUserMessage'],
showCancel: true, showCancel: true,
onOkPressed: () { onOkPressed: () {
AlertDialogBox.closeAlertDialog(context); // AlertDialogBox.closeAlertDialog(context);
sharedPref.setObject(REGISTER_DATA_FOR_LOGIIN, nRequest); sharedPref.setObject(REGISTER_DATA_FOR_LOGIIN, nRequest);
setState(() { setState(() {
isSkipRegistration = true; isSkipRegistration = true;
@ -604,7 +667,7 @@ class _RegisterNew extends State<RegisterNew> {
sharedPref.setObject(REGISTER_DATA_FOR_LOGIIN, nRequest); sharedPref.setObject(REGISTER_DATA_FOR_LOGIIN, nRequest);
sharedPref.setString(LOGIN_TOKEN_ID, response['LogInTokenID']); sharedPref.setString(LOGIN_TOKEN_ID, response['LogInTokenID']);
if (request.patientOutSA == 0) { if (request.patientOutSA == 0) {
this.chekUserData(response['LogInTokenID'], type); // ظ ; this.chekUserData(response['LogInTokenID'], type);
} else { } else {
sendActivationCode(type, response['LogInTokenID'], null, isSkipRegistration); sendActivationCode(type, response['LogInTokenID'], null, isSkipRegistration);
} }
@ -613,6 +676,7 @@ class _RegisterNew extends State<RegisterNew> {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
// if (response['ErrorCode'] == '-986') { // if (response['ErrorCode'] == '-986') {
//AppToast.showErrorToast(message: response); //AppToast.showErrorToast(message: response);
GifLoaderDialogUtils.hideDialog(context);
context.showBottomSheet( context.showBottomSheet(
child: ExceptionBottomSheet( child: ExceptionBottomSheet(
message: response, message: response,
@ -694,13 +758,13 @@ class _RegisterNew extends State<RegisterNew> {
request.patientIdentificationID = nationalIDorFile.text; request.patientIdentificationID = nationalIDorFile.text;
} }
request.isHijri = isHijri ?? 0; request.isHijri = isHijri ?? 0;
if (skipRegistration) { if (skipRegistration) {
// Keep existing loader active, don't show new one // Keep existing loader active, don't show new one
var req = getCommonRequest(type: type); var req = getCommonRequest(type: type);
req.logInTokenID = ""; req.logInTokenID = "";
var request = CheckPatientAuthenticationReq.fromJson(req.toJson()); var request = CheckPatientAuthenticationReq.fromJson(req.toJson());
authService.checkPatientAuthentication(request).then((value) async { authService.checkPatientAuthentication(request).then((value) async {
if (value['isSMSSent']) { if (value['isSMSSent']) {
sharedPref.setString(LOGIN_TOKEN_ID, value['LogInTokenID']); sharedPref.setString(LOGIN_TOKEN_ID, value['LogInTokenID']);

@ -80,7 +80,7 @@ class _WelcomeLogin extends State<WelcomeLogin> {
late ToDoCountProviderModel toDoProvider; late ToDoCountProviderModel toDoProvider;
late int selectedOption =1; late int selectedOption = 1;
bool onlySMSBox = false; bool onlySMSBox = false;
@ -90,7 +90,6 @@ class _WelcomeLogin extends State<WelcomeLogin> {
late int isHijri; late int isHijri;
var healthId; var healthId;
@override @override
void initState() { void initState() {
isLoading = true; isLoading = true;

@ -32,6 +32,7 @@ class CustomColors {
static const Color bgRedColor = Color(0xFFED1C2B); static const Color bgRedColor = Color(0xFFED1C2B);
static const Color bgRedBorderColor = Color(0xFFED1C2B); static const Color bgRedBorderColor = Color(0xFFED1C2B);
static const Color bgRedLightColor = Color(0xFFFEE9EA); static const Color bgRedLightColor = Color(0xFFFEE9EA);
static const Color bgGreenColor = Color(0xFF18C273);

@ -81,7 +81,7 @@ enum MaritalStatusType { single, married, divorced, widowed }
class Utils { class Utils {
static int? onOtpBtnPressed(OTPType type, String? phoneNumber, BuildContext context) { static int? onOtpBtnPressed(OTPType type, String? phoneNumber, BuildContext context) {
if (phoneNumber == null || phoneNumber.isEmpty) { if (phoneNumber == null || phoneNumber.isEmpty || phoneNumber.length < 9) {
context.showBottomSheet( context.showBottomSheet(
child: ExceptionBottomSheet( child: ExceptionBottomSheet(
message: "Please enter your phone number.", message: "Please enter your phone number.",

Loading…
Cancel
Save