otp screen & register Uae & resend Activation Code.

pull/45/head
aamir-csol 1 month ago
parent b9b0dfd1fa
commit 5de8314f3f

@ -817,13 +817,14 @@
"news": "أخبار", "news": "أخبار",
"ready": "جاهز", "ready": "جاهز",
"enterValidNationalId": "الرجاء إدخال رقم الهوية الوطنية أو رقم الملف الصحيح", "enterValidNationalId": "الرجاء إدخال رقم الهوية الوطنية أو رقم الملف الصحيح",
"enterValidPhoneNumber": "الرجاء إدخال رقم هاتف صالح" "enterValidPhoneNumber": "الرجاء إدخال رقم هاتف صالح",
"medicalCentersWithCount": "{count} مراكز طبية", "medicalCentersWithCount": "{count} مراكز طبية",
"medicalCenters": "مراكز طبية", "medicalCenters": "مراكز طبية",
"hospitalsWithCount": "{count} مستشفيات", "hospitalsWithCount": "{count} مستشفيات",
"selectRegion": "اختر المنطقة", "selectRegion": "اختر المنطقة",
"selectFacility": "اختر المرافق", "selectFacility": "اختر المرافق",
"selectFacilitiesSubTitle": "يرجى اختيار المرفق للموعد", "selectFacilitiesSubTitle": "يرجى اختيار المرفق للموعد",
"selectHospitalSubTitle": "يرجى اختيار المستشفى للموعد" "selectHospitalSubTitle": "يرجى اختيار المستشفى للموعد",
"iAcceptThe" : "أوافق على" "iAcceptThe" : "أوافق على",
"personalDetailsVerification": "التحقق من التفاصيل الشخصية",
} }

@ -821,5 +821,7 @@
"selectFacilitiesSubTitle": "Please select the facility for the appointment", "selectFacilitiesSubTitle": "Please select the facility for the appointment",
"selectHospitalSubTitle": "Please select the hospital for the appointment", "selectHospitalSubTitle": "Please select the hospital for the appointment",
"news": "News", "news": "News",
"iAcceptThe" : "I Accept the" "iAcceptThe" : "I Accept the",
"personalDetailsVerification": "Personal Details Verification"
} }

@ -723,7 +723,7 @@ const DEACTIVATE_ACCOUNT = 'Services/Patients.svc/REST/PatientAppleActivation_In
class ApiConsts { class ApiConsts {
static const maxSmallScreen = 660; static const maxSmallScreen = 660;
static AppEnvironmentTypeEnum appEnvironmentType = AppEnvironmentTypeEnum.uat; static AppEnvironmentTypeEnum appEnvironmentType = AppEnvironmentTypeEnum.prod;
// static String baseUrl = 'https://uat.hmgwebservices.com/'; // HIS API URL UAT // static String baseUrl = 'https://uat.hmgwebservices.com/'; // HIS API URL UAT

@ -221,10 +221,15 @@ extension EmailValidator on String {
style: TextStyle(height: 23 / 24, color: color ?? AppColors.blackColor, fontSize: 24.fSize, letterSpacing: -1, fontWeight: isBold ? FontWeight.bold : FontWeight.normal), style: TextStyle(height: 23 / 24, color: color ?? AppColors.blackColor, fontSize: 24.fSize, letterSpacing: -1, fontWeight: isBold ? FontWeight.bold : FontWeight.normal),
); );
Widget toText26({Color? color, bool isBold = false, double? height, bool isCenter = false}) => Text( Widget toText26({Color? color, bool isBold = false, double? height, bool isCenter = false, FontWeight? weight, double? letterSpacing}) => Text(
this, this,
textAlign: isCenter ? TextAlign.center : null, textAlign: isCenter ? TextAlign.center : null,
style: TextStyle(height: height ?? 23 / 26, color: color ?? AppColors.blackColor, fontSize: 26.fSize, letterSpacing: -1, fontWeight: isBold ? FontWeight.bold : FontWeight.normal), style: TextStyle(
height: height ?? 23 / 26,
color: color ?? AppColors.blackColor,
fontSize: 26.fSize,
letterSpacing: letterSpacing ?? -1,
fontWeight: weight ?? (isBold ? FontWeight.bold : FontWeight.normal)),
); );
Widget toText28({Color? color, bool isBold = false, double? height, bool isCenter = false}) => Text( Widget toText28({Color? color, bool isBold = false, double? height, bool isCenter = false}) => Text(

@ -161,6 +161,10 @@ class AuthenticationViewModel extends ChangeNotifier {
notifyListeners(); notifyListeners();
} }
void clearEmailInput() {
emailController.text = "";
}
void onUAEUserCountrySelection(String? value) { void onUAEUserCountrySelection(String? value) {
pickedCountryByUAEUser = countriesList!.firstWhere((element) => element.name == value); pickedCountryByUAEUser = countriesList!.firstWhere((element) => element.name == value);
notifyListeners(); notifyListeners();
@ -676,21 +680,27 @@ class AuthenticationViewModel extends ChangeNotifier {
} }
Future<void> onRegistrationComplete() async { Future<void> onRegistrationComplete() async {
LoaderBottomSheet.showLoader(); // LoaderBottomSheet.showLoader();
LoadingUtils.showFullScreenLoader(loadingText: "Setting up your medical file.\nMay take a moment.");
var request = RequestUtils.getUserSignupCompletionRequest(fullName: nameController.text, emailAddress: emailController.text, gender: genderType, maritalStatus: maritalStatus); var request = RequestUtils.getUserSignupCompletionRequest(fullName: nameController.text, emailAddress: emailController.text, gender: genderType, maritalStatus: maritalStatus);
final resultEither = await _authenticationRepo.registerUser(registrationPayloadDataModelRequest: request); final resultEither = await _authenticationRepo.registerUser(registrationPayloadDataModelRequest: request);
resultEither.fold((failure) async => await _errorHandlerService.handleError(failure: failure), (apiResponse) async { resultEither.fold((failure) async => await _errorHandlerService.handleError(failure: failure), (apiResponse) async {
if (apiResponse.data is String) { if (apiResponse.data is String) {
//TODO: This Section Need to Be Testing. //TODO: This Section Need to Be Testing.
LoadingUtils.hideFullScreenLoader();
_dialogService.showExceptionBottomSheet(message: apiResponse.data, onOkPressed: () {}, onCancelPressed: () {}); _dialogService.showExceptionBottomSheet(message: apiResponse.data, onOkPressed: () {}, onCancelPressed: () {});
//TODO: Here We Need to Show a Dialog Of Something in the case of Fail With OK and Cancel and the Display Variable WIll be result. //TODO: Here We Need to Show a Dialog Of Something in the case of Fail With OK and Cancel and the Display Variable WIll be result.
} else { } else {
print(apiResponse.data as Map<String, dynamic>); LoadingUtils.hideFullScreenLoader();
if (apiResponse.data["MessageStatus"] == 1) { if (apiResponse.data["MessageStatus"] == 1) {
LoaderBottomSheet.hideLoader(); LoadingUtils.showFullScreenLoader(isSuccessDialog: true);
//TODO: Here We Need to Show a Dialog Of Something in the case of Success. //TODO: Here We Need to Show a Dialog Of Something in the case of Success.
await clearDefaultInputValues(); // This will Clear All Default Values Of User. await clearDefaultInputValues(); // This will Clear All Default Values Of User.
_navigationService.pushAndReplace(AppRoutes.loginScreen); Future.delayed(Duration(seconds: 1), () {
LoadingUtils.hideFullScreenLoader();
_navigationService.pushAndReplace(AppRoutes.loginScreen);
});
} }
} }
}); });
@ -738,6 +748,8 @@ class AuthenticationViewModel extends ChangeNotifier {
} else { } else {
//TODO: Here Hide Loader And Show TOAST //TODO: Here Hide Loader And Show TOAST
//TODO: if (response['ErrorCode'] == '-986') Toast With OK, And Show response as Output. //TODO: if (response['ErrorCode'] == '-986') Toast With OK, And Show response as Output.
LoaderBottomSheet.hideLoader();
_dialogService.showErrorBottomSheet(message: response['ErrorMessage']);
} }
} }

@ -816,7 +816,6 @@ abstract class LocaleKeys {
static const ready = 'ready'; static const ready = 'ready';
static const enterValidNationalId = 'enterValidNationalId'; static const enterValidNationalId = 'enterValidNationalId';
static const enterValidPhoneNumber = 'enterValidPhoneNumber'; static const enterValidPhoneNumber = 'enterValidPhoneNumber';
static const iAcceptThe = 'iAcceptThe';
static const medicalCentersWithCount = 'medicalCentersWithCount'; static const medicalCentersWithCount = 'medicalCentersWithCount';
static const medicalCenters = 'medicalCenters'; static const medicalCenters = 'medicalCenters';
static const hospitalsWithCount = 'hospitalsWithCount'; static const hospitalsWithCount = 'hospitalsWithCount';
@ -824,4 +823,7 @@ abstract class LocaleKeys {
static const selectFacility = 'selectFacility'; static const selectFacility = 'selectFacility';
static const selectFacilitiesSubTitle = 'selectFacilitiesSubTitle'; static const selectFacilitiesSubTitle = 'selectFacilitiesSubTitle';
static const selectHospitalSubTitle = 'selectHospitalSubTitle'; static const selectHospitalSubTitle = 'selectHospitalSubTitle';
static const iAcceptThe = 'iAcceptThe';
static const personalDetailsVerification = 'personalDetailsVerification';
} }

@ -44,20 +44,24 @@ class _RegisterNew extends State<RegisterNewStep2> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
AppState appState = getIt.get<AppState>(); AppState appState = getIt.get<AppState>();
return Scaffold( return Scaffold(
backgroundColor: AppColors.bgScaffoldColor,
appBar: CustomAppBar( appBar: CustomAppBar(
onBackPressed: () { onBackPressed: () {
Navigator.of(context).pop(); Navigator.of(context).pop();
// authVM!.clearDefaultInputValues(); // authVM!.clearDefaultInputValues();
authVM!.clearEmailInput();
}, },
onLanguageChanged: (lang) {}, onLanguageChanged: (lang) {},
hideLogoAndLang: true, hideLogoAndLang: true,
), ),
body: SingleChildScrollView( body: SingleChildScrollView(
reverse: false, reverse: false,
padding: EdgeInsets.only(left: 24.h, right: 24.h, top: 24.h), padding: EdgeInsets.only(left: 24.h, right: 24.h, top: 0.h),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
LocaleKeys.personalDetailsVerification.tr().toText26(color: AppColors.textColor, weight: FontWeight.w600, letterSpacing: -2),
SizedBox(height: 24.h),
Directionality( Directionality(
textDirection: Directionality.of(context), textDirection: Directionality.of(context),
child: Container( child: Container(
@ -66,18 +70,20 @@ class _RegisterNew extends State<RegisterNewStep2> {
child: Column( child: Column(
children: [ children: [
TextInputWidget( TextInputWidget(
labelText: authVM!.isUserFromUAE() ? LocaleKeys.fullName.tr() : LocaleKeys.name.tr(), labelText: authVM!.isUserFromUAE() ? LocaleKeys.fullName.tr() : LocaleKeys.name.tr(),
hintText: authVM!.isUserFromUAE() ? LocaleKeys.enterNameHere.tr() : ("${appState.getNHICUserData.firstNameEn!.toUpperCase()} ${appState.getNHICUserData.lastNameEn!.toUpperCase()}"), hintText:
controller: authVM!.isUserFromUAE() ? authVM!.nameController : null, authVM!.isUserFromUAE() ? LocaleKeys.enterNameHere.tr() : ("${appState.getNHICUserData.firstNameEn!.toUpperCase()} ${appState.getNHICUserData.lastNameEn!.toUpperCase()}"),
isEnable: true, controller: authVM!.isUserFromUAE() ? authVM!.nameController : null,
prefix: null, isEnable: true,
isAllowRadius: false, prefix: null,
isBorderAllowed: false, isAllowRadius: false,
keyboardType: TextInputType.text, isBorderAllowed: false,
isAllowLeadingIcon: true, keyboardType: TextInputType.text,
isReadOnly: authVM!.isUserFromUAE() ? false : true, isAllowLeadingIcon: true,
leadingIcon: AppAssets.user_circle) isReadOnly: authVM!.isUserFromUAE() ? false : true,
.paddingSymmetrical(0.h, 16.h), leadingIcon: AppAssets.user_circle,
labelColor: AppColors.textColor,
).paddingSymmetrical(0.h, 16.h),
Divider(height: 1, color: AppColors.greyColor), Divider(height: 1, color: AppColors.greyColor),
TextInputWidget( TextInputWidget(
labelText: LocaleKeys.nationalIdNumber.tr(), labelText: LocaleKeys.nationalIdNumber.tr(),
@ -89,6 +95,7 @@ class _RegisterNew extends State<RegisterNewStep2> {
isBorderAllowed: false, isBorderAllowed: false,
isAllowLeadingIcon: true, isAllowLeadingIcon: true,
isReadOnly: true, isReadOnly: true,
labelColor: AppColors.textColor,
leadingIcon: AppAssets.student_card) leadingIcon: AppAssets.student_card)
.paddingSymmetrical(0.h, 16.h), .paddingSymmetrical(0.h, 16.h),
Divider(height: 1, color: AppColors.greyColor), Divider(height: 1, color: AppColors.greyColor),
@ -108,6 +115,7 @@ class _RegisterNew extends State<RegisterNewStep2> {
isBorderAllowed: false, isBorderAllowed: false,
hasSelectionCustomIcon: true, hasSelectionCustomIcon: true,
isAllowRadius: false, isAllowRadius: false,
labelColor: AppColors.textColor,
padding: const EdgeInsets.only(top: 8, bottom: 8, left: 0, right: 0), padding: const EdgeInsets.only(top: 8, bottom: 8, left: 0, right: 0),
selectionCustomIcon: AppAssets.arrow_down, selectionCustomIcon: AppAssets.arrow_down,
leadingIcon: AppAssets.user_full, leadingIcon: AppAssets.user_full,
@ -124,6 +132,7 @@ class _RegisterNew extends State<RegisterNewStep2> {
isAllowLeadingIcon: true, isAllowLeadingIcon: true,
isReadOnly: authVM!.isUserFromUAE() ? false : true, isReadOnly: authVM!.isUserFromUAE() ? false : true,
leadingIcon: AppAssets.user_full, leadingIcon: AppAssets.user_full,
labelColor: AppColors.textColor,
onChange: (value) {}) onChange: (value) {})
.paddingSymmetrical(0.h, 16.h), .paddingSymmetrical(0.h, 16.h),
Divider(height: 1, color: AppColors.greyColor), Divider(height: 1, color: AppColors.greyColor),
@ -143,6 +152,7 @@ class _RegisterNew extends State<RegisterNewStep2> {
isBorderAllowed: false, isBorderAllowed: false,
hasSelectionCustomIcon: true, hasSelectionCustomIcon: true,
isAllowRadius: false, isAllowRadius: false,
labelColor: AppColors.textColor,
padding: const EdgeInsets.only(top: 8, bottom: 8, left: 0, right: 0), padding: const EdgeInsets.only(top: 8, bottom: 8, left: 0, right: 0),
selectionCustomIcon: AppAssets.arrow_down, selectionCustomIcon: AppAssets.arrow_down,
leadingIcon: AppAssets.smart_phone, leadingIcon: AppAssets.smart_phone,
@ -160,6 +170,7 @@ class _RegisterNew extends State<RegisterNewStep2> {
isBorderAllowed: false, isBorderAllowed: false,
isAllowLeadingIcon: true, isAllowLeadingIcon: true,
isReadOnly: true, isReadOnly: true,
labelColor: AppColors.textColor,
leadingIcon: AppAssets.smart_phone, leadingIcon: AppAssets.smart_phone,
onChange: (value) {}) onChange: (value) {})
.paddingSymmetrical(0.h, 16.h), .paddingSymmetrical(0.h, 16.h),
@ -190,6 +201,7 @@ class _RegisterNew extends State<RegisterNewStep2> {
onChange: authVM.onUAEUserCountrySelection, onChange: authVM.onUAEUserCountrySelection,
isBorderAllowed: false, isBorderAllowed: false,
hasSelectionCustomIcon: true, hasSelectionCustomIcon: true,
labelColor: AppColors.textColor,
isAllowRadius: false, isAllowRadius: false,
padding: const EdgeInsets.only(top: 8, bottom: 8, left: 0, right: 0), padding: const EdgeInsets.only(top: 8, bottom: 8, left: 0, right: 0),
selectionCustomIcon: AppAssets.arrow_down, selectionCustomIcon: AppAssets.arrow_down,
@ -208,6 +220,7 @@ class _RegisterNew extends State<RegisterNewStep2> {
isBorderAllowed: false, isBorderAllowed: false,
isAllowLeadingIcon: true, isAllowLeadingIcon: true,
isReadOnly: true, isReadOnly: true,
labelColor: AppColors.textColor,
leadingIcon: AppAssets.globe, leadingIcon: AppAssets.globe,
onChange: (value) {}) onChange: (value) {})
.paddingSymmetrical(0.h, 16.h), .paddingSymmetrical(0.h, 16.h),
@ -224,6 +237,7 @@ class _RegisterNew extends State<RegisterNewStep2> {
isAllowRadius: false, isAllowRadius: false,
isBorderAllowed: false, isBorderAllowed: false,
isAllowLeadingIcon: true, isAllowLeadingIcon: true,
labelColor: AppColors.textColor,
isReadOnly: true, isReadOnly: true,
leadingIcon: AppAssets.call) leadingIcon: AppAssets.call)
.paddingSymmetrical(0.h, 16.h), .paddingSymmetrical(0.h, 16.h),
@ -240,6 +254,7 @@ class _RegisterNew extends State<RegisterNewStep2> {
isBorderAllowed: false, isBorderAllowed: false,
isAllowLeadingIcon: true, isAllowLeadingIcon: true,
isReadOnly: true, isReadOnly: true,
labelColor: AppColors.textColor,
leadingIcon: AppAssets.birthday_cake, leadingIcon: AppAssets.birthday_cake,
selectionType: null, selectionType: null,
).paddingSymmetrical(0.h, 16.h), ).paddingSymmetrical(0.h, 16.h),
@ -269,12 +284,12 @@ class _RegisterNew extends State<RegisterNewStep2> {
), ),
Expanded( Expanded(
child: CustomButton( child: CustomButton(
backgroundColor: AppColors.lightGreenColor, backgroundColor: AppColors.primaryRedColor,
borderColor: AppColors.lightGreenColor, borderColor: AppColors.primaryRedColor,
textColor: AppColors.textGreenColor, textColor: AppColors.whiteColor,
text: LocaleKeys.confirm.tr(), text: LocaleKeys.confirm.tr(),
icon: AppAssets.confirm, icon: AppAssets.confirm,
iconColor: AppColors.textGreenColor, iconColor: AppColors.whiteColor,
onPressed: () { onPressed: () {
if (appState.getUserRegistrationPayload.zipCode != CountryEnum.saudiArabia.countryCode) { if (appState.getUserRegistrationPayload.zipCode != CountryEnum.saudiArabia.countryCode) {
if (ValidationUtils.validateUaeRegistration( if (ValidationUtils.validateUaeRegistration(

@ -18,29 +18,31 @@ class DropdownWidget extends StatelessWidget {
final bool hasSelectionCustomIcon; final bool hasSelectionCustomIcon;
final String? selectionCustomIcon; final String? selectionCustomIcon;
final String? leadingIcon; final String? leadingIcon;
final Color? labelColor;
const DropdownWidget({ const DropdownWidget(
Key? key, {Key? key,
required this.labelText, required this.labelText,
required this.hintText, required this.hintText,
required this.dropdownItems, required this.dropdownItems,
this.selectedValue, this.selectedValue,
this.onChange, this.onChange,
this.isEnable = true, this.isEnable = true,
this.isBorderAllowed = true, this.isBorderAllowed = true,
this.isAllowRadius = true, this.isAllowRadius = true,
this.padding, this.padding,
this.hasSelectionCustomIcon = false, this.hasSelectionCustomIcon = false,
this.selectionCustomIcon, this.selectionCustomIcon,
this.leadingIcon, this.leadingIcon,
}) : super(key: key); this.labelColor})
: super(key: key);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
Widget content = Column( Widget content = Column(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [_buildLabelText(), _buildDropdown(context)], children: [_buildLabelText(labelColor), _buildDropdown(context)],
); );
return Container( return Container(
@ -75,13 +77,13 @@ class DropdownWidget extends StatelessWidget {
child: Utils.buildSvgWithAssets(icon: leadingIcon!)); child: Utils.buildSvgWithAssets(icon: leadingIcon!));
} }
Widget _buildLabelText() { Widget _buildLabelText(Color? labelColor) {
return Text( return Text(
labelText, labelText,
style: TextStyle( style: TextStyle(
fontSize: 12.fSize, fontSize: 12.fSize,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
color: Color(0xff898A8D), color: labelColor ?? Color(0xff898A8D),
letterSpacing: -0.2, letterSpacing: -0.2,
height: 18 / 12, height: 18 / 12,
), ),

@ -41,39 +41,41 @@ class TextInputWidget extends StatelessWidget {
final num? fontSize; final num? fontSize;
final bool? isWalletAmountInput; final bool? isWalletAmountInput;
final Widget? suffix; final Widget? suffix;
final Color? labelColor;
// final List<Country> countryList; // final List<Country> countryList;
// final Function(Country)? onCountryChange; // final Function(Country)? onCountryChange;
TextInputWidget({ TextInputWidget(
super.key, {super.key,
required this.labelText, required this.labelText,
required this.hintText, required this.hintText,
this.controller, this.controller,
this.onChange, this.onChange,
this.onCalendarTypeChanged, this.onCalendarTypeChanged,
this.prefix, this.prefix,
this.isEnable = true, this.isEnable = true,
this.isBorderAllowed = true, this.isBorderAllowed = true,
this.isAllowRadius = true, this.isAllowRadius = true,
this.isReadOnly = false, this.isReadOnly = false,
this.keyboardType = TextInputType.number, this.keyboardType = TextInputType.number,
this.focusNode, this.focusNode,
this.autoFocus = false, this.autoFocus = false,
this.padding, this.padding,
this.isAllowLeadingIcon = false, this.isAllowLeadingIcon = false,
this.leadingIcon, this.leadingIcon,
this.isCountryDropDown = false, this.isCountryDropDown = false,
this.hasError = false, this.hasError = false,
this.errorMessage, this.errorMessage,
this.onCountryChange, this.onCountryChange,
this.selectionType, this.selectionType,
this.fontSize = 14, this.fontSize = 14,
this.isWalletAmountInput = false, this.isWalletAmountInput = false,
this.suffix, this.suffix,
// this.countryList = const [], this.labelColor
// this.onCountryChange, // this.countryList = const [],
}); // this.onCountryChange,
});
final FocusNode _focusNode = FocusNode(); final FocusNode _focusNode = FocusNode();
@ -135,7 +137,7 @@ class TextInputWidget extends StatelessWidget {
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
_buildLabelText().paddingOnly(right: (appState.getLanguageCode() == "ar" ? 10 : 0)), _buildLabelText(labelColor).paddingOnly(right: (appState.getLanguageCode() == "ar" ? 10 : 0)),
_buildTextField(context), _buildTextField(context),
], ],
), ),
@ -206,13 +208,13 @@ class TextInputWidget extends StatelessWidget {
); );
} }
Widget _buildLabelText() { Widget _buildLabelText(Color? labelColor) {
return Text( return Text(
labelText, labelText,
style: TextStyle( style: TextStyle(
fontSize: 12.fSize, fontSize: 12.fSize,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
color: AppColors.inputLabelTextColor, color: labelColor ?? AppColors.inputLabelTextColor,
letterSpacing: -0.2, letterSpacing: -0.2,
height: 18 / 12, height: 18 / 12,
), ),

Loading…
Cancel
Save