diff --git a/assets/langs/ar-SA.json b/assets/langs/ar-SA.json index 4504325..08ef65c 100644 --- a/assets/langs/ar-SA.json +++ b/assets/langs/ar-SA.json @@ -817,13 +817,14 @@ "news": "أخبار", "ready": "جاهز", "enterValidNationalId": "الرجاء إدخال رقم الهوية الوطنية أو رقم الملف الصحيح", - "enterValidPhoneNumber": "الرجاء إدخال رقم هاتف صالح" + "enterValidPhoneNumber": "الرجاء إدخال رقم هاتف صالح", "medicalCentersWithCount": "{count} مراكز طبية", "medicalCenters": "مراكز طبية", "hospitalsWithCount": "{count} مستشفيات", "selectRegion": "اختر المنطقة", "selectFacility": "اختر المرافق", "selectFacilitiesSubTitle": "يرجى اختيار المرفق للموعد", - "selectHospitalSubTitle": "يرجى اختيار المستشفى للموعد" - "iAcceptThe" : "أوافق على" + "selectHospitalSubTitle": "يرجى اختيار المستشفى للموعد", + "iAcceptThe" : "أوافق على", + "personalDetailsVerification": "التحقق من التفاصيل الشخصية", } \ No newline at end of file diff --git a/assets/langs/en-US.json b/assets/langs/en-US.json index b3c1ffb..b8506f4 100644 --- a/assets/langs/en-US.json +++ b/assets/langs/en-US.json @@ -821,5 +821,7 @@ "selectFacilitiesSubTitle": "Please select the facility for the appointment", "selectHospitalSubTitle": "Please select the hospital for the appointment", "news": "News", - "iAcceptThe" : "I Accept the" + "iAcceptThe" : "I Accept the", + "personalDetailsVerification": "Personal Details Verification" + } \ No newline at end of file diff --git a/lib/core/api_consts.dart b/lib/core/api_consts.dart index 6c9a835..bd2eb71 100644 --- a/lib/core/api_consts.dart +++ b/lib/core/api_consts.dart @@ -723,7 +723,7 @@ const DEACTIVATE_ACCOUNT = 'Services/Patients.svc/REST/PatientAppleActivation_In class ApiConsts { 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 diff --git a/lib/extensions/string_extensions.dart b/lib/extensions/string_extensions.dart index 509385c..41b604f 100644 --- a/lib/extensions/string_extensions.dart +++ b/lib/extensions/string_extensions.dart @@ -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), ); - 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, 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( diff --git a/lib/features/authentication/authentication_view_model.dart b/lib/features/authentication/authentication_view_model.dart index 0b76716..3c05b52 100644 --- a/lib/features/authentication/authentication_view_model.dart +++ b/lib/features/authentication/authentication_view_model.dart @@ -161,6 +161,10 @@ class AuthenticationViewModel extends ChangeNotifier { notifyListeners(); } + void clearEmailInput() { + emailController.text = ""; + } + void onUAEUserCountrySelection(String? value) { pickedCountryByUAEUser = countriesList!.firstWhere((element) => element.name == value); notifyListeners(); @@ -676,21 +680,27 @@ class AuthenticationViewModel extends ChangeNotifier { } Future 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); final resultEither = await _authenticationRepo.registerUser(registrationPayloadDataModelRequest: request); resultEither.fold((failure) async => await _errorHandlerService.handleError(failure: failure), (apiResponse) async { if (apiResponse.data is String) { //TODO: This Section Need to Be Testing. + LoadingUtils.hideFullScreenLoader(); _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. } else { - print(apiResponse.data as Map); + LoadingUtils.hideFullScreenLoader(); 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. 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 { //TODO: Here Hide Loader And Show TOAST //TODO: if (response['ErrorCode'] == '-986') Toast With OK, And Show response as Output. + LoaderBottomSheet.hideLoader(); + _dialogService.showErrorBottomSheet(message: response['ErrorMessage']); } } diff --git a/lib/generated/locale_keys.g.dart b/lib/generated/locale_keys.g.dart index 5f587c9..85c4d6d 100644 --- a/lib/generated/locale_keys.g.dart +++ b/lib/generated/locale_keys.g.dart @@ -816,7 +816,6 @@ abstract class LocaleKeys { static const ready = 'ready'; static const enterValidNationalId = 'enterValidNationalId'; static const enterValidPhoneNumber = 'enterValidPhoneNumber'; - static const iAcceptThe = 'iAcceptThe'; static const medicalCentersWithCount = 'medicalCentersWithCount'; static const medicalCenters = 'medicalCenters'; static const hospitalsWithCount = 'hospitalsWithCount'; @@ -824,4 +823,7 @@ abstract class LocaleKeys { static const selectFacility = 'selectFacility'; static const selectFacilitiesSubTitle = 'selectFacilitiesSubTitle'; static const selectHospitalSubTitle = 'selectHospitalSubTitle'; + static const iAcceptThe = 'iAcceptThe'; + static const personalDetailsVerification = 'personalDetailsVerification'; + } diff --git a/lib/presentation/authentication/register_step2.dart b/lib/presentation/authentication/register_step2.dart index f31909f..23ea7ae 100644 --- a/lib/presentation/authentication/register_step2.dart +++ b/lib/presentation/authentication/register_step2.dart @@ -44,20 +44,24 @@ class _RegisterNew extends State { Widget build(BuildContext context) { AppState appState = getIt.get(); return Scaffold( + backgroundColor: AppColors.bgScaffoldColor, appBar: CustomAppBar( onBackPressed: () { Navigator.of(context).pop(); // authVM!.clearDefaultInputValues(); + authVM!.clearEmailInput(); }, onLanguageChanged: (lang) {}, hideLogoAndLang: true, ), body: SingleChildScrollView( 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( crossAxisAlignment: CrossAxisAlignment.start, children: [ + LocaleKeys.personalDetailsVerification.tr().toText26(color: AppColors.textColor, weight: FontWeight.w600, letterSpacing: -2), + SizedBox(height: 24.h), Directionality( textDirection: Directionality.of(context), child: Container( @@ -66,18 +70,20 @@ class _RegisterNew extends State { child: Column( children: [ TextInputWidget( - labelText: authVM!.isUserFromUAE() ? LocaleKeys.fullName.tr() : LocaleKeys.name.tr(), - hintText: authVM!.isUserFromUAE() ? LocaleKeys.enterNameHere.tr() : ("${appState.getNHICUserData.firstNameEn!.toUpperCase()} ${appState.getNHICUserData.lastNameEn!.toUpperCase()}"), - controller: authVM!.isUserFromUAE() ? authVM!.nameController : null, - isEnable: true, - prefix: null, - isAllowRadius: false, - isBorderAllowed: false, - keyboardType: TextInputType.text, - isAllowLeadingIcon: true, - isReadOnly: authVM!.isUserFromUAE() ? false : true, - leadingIcon: AppAssets.user_circle) - .paddingSymmetrical(0.h, 16.h), + labelText: authVM!.isUserFromUAE() ? LocaleKeys.fullName.tr() : LocaleKeys.name.tr(), + hintText: + authVM!.isUserFromUAE() ? LocaleKeys.enterNameHere.tr() : ("${appState.getNHICUserData.firstNameEn!.toUpperCase()} ${appState.getNHICUserData.lastNameEn!.toUpperCase()}"), + controller: authVM!.isUserFromUAE() ? authVM!.nameController : null, + isEnable: true, + prefix: null, + isAllowRadius: false, + isBorderAllowed: false, + keyboardType: TextInputType.text, + isAllowLeadingIcon: true, + isReadOnly: authVM!.isUserFromUAE() ? false : true, + leadingIcon: AppAssets.user_circle, + labelColor: AppColors.textColor, + ).paddingSymmetrical(0.h, 16.h), Divider(height: 1, color: AppColors.greyColor), TextInputWidget( labelText: LocaleKeys.nationalIdNumber.tr(), @@ -89,6 +95,7 @@ class _RegisterNew extends State { isBorderAllowed: false, isAllowLeadingIcon: true, isReadOnly: true, + labelColor: AppColors.textColor, leadingIcon: AppAssets.student_card) .paddingSymmetrical(0.h, 16.h), Divider(height: 1, color: AppColors.greyColor), @@ -108,6 +115,7 @@ class _RegisterNew extends State { isBorderAllowed: false, hasSelectionCustomIcon: true, isAllowRadius: false, + labelColor: AppColors.textColor, padding: const EdgeInsets.only(top: 8, bottom: 8, left: 0, right: 0), selectionCustomIcon: AppAssets.arrow_down, leadingIcon: AppAssets.user_full, @@ -124,6 +132,7 @@ class _RegisterNew extends State { isAllowLeadingIcon: true, isReadOnly: authVM!.isUserFromUAE() ? false : true, leadingIcon: AppAssets.user_full, + labelColor: AppColors.textColor, onChange: (value) {}) .paddingSymmetrical(0.h, 16.h), Divider(height: 1, color: AppColors.greyColor), @@ -143,6 +152,7 @@ class _RegisterNew extends State { isBorderAllowed: false, hasSelectionCustomIcon: true, isAllowRadius: false, + labelColor: AppColors.textColor, padding: const EdgeInsets.only(top: 8, bottom: 8, left: 0, right: 0), selectionCustomIcon: AppAssets.arrow_down, leadingIcon: AppAssets.smart_phone, @@ -160,6 +170,7 @@ class _RegisterNew extends State { isBorderAllowed: false, isAllowLeadingIcon: true, isReadOnly: true, + labelColor: AppColors.textColor, leadingIcon: AppAssets.smart_phone, onChange: (value) {}) .paddingSymmetrical(0.h, 16.h), @@ -190,6 +201,7 @@ class _RegisterNew extends State { onChange: authVM.onUAEUserCountrySelection, isBorderAllowed: false, hasSelectionCustomIcon: true, + labelColor: AppColors.textColor, isAllowRadius: false, padding: const EdgeInsets.only(top: 8, bottom: 8, left: 0, right: 0), selectionCustomIcon: AppAssets.arrow_down, @@ -208,6 +220,7 @@ class _RegisterNew extends State { isBorderAllowed: false, isAllowLeadingIcon: true, isReadOnly: true, + labelColor: AppColors.textColor, leadingIcon: AppAssets.globe, onChange: (value) {}) .paddingSymmetrical(0.h, 16.h), @@ -224,6 +237,7 @@ class _RegisterNew extends State { isAllowRadius: false, isBorderAllowed: false, isAllowLeadingIcon: true, + labelColor: AppColors.textColor, isReadOnly: true, leadingIcon: AppAssets.call) .paddingSymmetrical(0.h, 16.h), @@ -240,6 +254,7 @@ class _RegisterNew extends State { isBorderAllowed: false, isAllowLeadingIcon: true, isReadOnly: true, + labelColor: AppColors.textColor, leadingIcon: AppAssets.birthday_cake, selectionType: null, ).paddingSymmetrical(0.h, 16.h), @@ -269,12 +284,12 @@ class _RegisterNew extends State { ), Expanded( child: CustomButton( - backgroundColor: AppColors.lightGreenColor, - borderColor: AppColors.lightGreenColor, - textColor: AppColors.textGreenColor, + backgroundColor: AppColors.primaryRedColor, + borderColor: AppColors.primaryRedColor, + textColor: AppColors.whiteColor, text: LocaleKeys.confirm.tr(), icon: AppAssets.confirm, - iconColor: AppColors.textGreenColor, + iconColor: AppColors.whiteColor, onPressed: () { if (appState.getUserRegistrationPayload.zipCode != CountryEnum.saudiArabia.countryCode) { if (ValidationUtils.validateUaeRegistration( diff --git a/lib/widgets/dropdown/dropdown_widget.dart b/lib/widgets/dropdown/dropdown_widget.dart index 2a0cad3..f093f0b 100644 --- a/lib/widgets/dropdown/dropdown_widget.dart +++ b/lib/widgets/dropdown/dropdown_widget.dart @@ -18,29 +18,31 @@ class DropdownWidget extends StatelessWidget { final bool hasSelectionCustomIcon; final String? selectionCustomIcon; final String? leadingIcon; + final Color? labelColor; - const DropdownWidget({ - Key? key, - required this.labelText, - required this.hintText, - required this.dropdownItems, - this.selectedValue, - this.onChange, - this.isEnable = true, - this.isBorderAllowed = true, - this.isAllowRadius = true, - this.padding, - this.hasSelectionCustomIcon = false, - this.selectionCustomIcon, - this.leadingIcon, - }) : super(key: key); + const DropdownWidget( + {Key? key, + required this.labelText, + required this.hintText, + required this.dropdownItems, + this.selectedValue, + this.onChange, + this.isEnable = true, + this.isBorderAllowed = true, + this.isAllowRadius = true, + this.padding, + this.hasSelectionCustomIcon = false, + this.selectionCustomIcon, + this.leadingIcon, + this.labelColor}) + : super(key: key); @override Widget build(BuildContext context) { Widget content = Column( mainAxisSize: MainAxisSize.min, crossAxisAlignment: CrossAxisAlignment.start, - children: [_buildLabelText(), _buildDropdown(context)], + children: [_buildLabelText(labelColor), _buildDropdown(context)], ); return Container( @@ -75,13 +77,13 @@ class DropdownWidget extends StatelessWidget { child: Utils.buildSvgWithAssets(icon: leadingIcon!)); } - Widget _buildLabelText() { + Widget _buildLabelText(Color? labelColor) { return Text( labelText, style: TextStyle( fontSize: 12.fSize, fontWeight: FontWeight.w500, - color: Color(0xff898A8D), + color: labelColor ?? Color(0xff898A8D), letterSpacing: -0.2, height: 18 / 12, ), diff --git a/lib/widgets/input_widget.dart b/lib/widgets/input_widget.dart index c11ae65..fa2d873 100644 --- a/lib/widgets/input_widget.dart +++ b/lib/widgets/input_widget.dart @@ -41,39 +41,41 @@ class TextInputWidget extends StatelessWidget { final num? fontSize; final bool? isWalletAmountInput; final Widget? suffix; + final Color? labelColor; // final List countryList; // final Function(Country)? onCountryChange; - TextInputWidget({ - super.key, - required this.labelText, - required this.hintText, - this.controller, - this.onChange, - this.onCalendarTypeChanged, - this.prefix, - this.isEnable = true, - this.isBorderAllowed = true, - this.isAllowRadius = true, - this.isReadOnly = false, - this.keyboardType = TextInputType.number, - this.focusNode, - this.autoFocus = false, - this.padding, - this.isAllowLeadingIcon = false, - this.leadingIcon, - this.isCountryDropDown = false, - this.hasError = false, - this.errorMessage, - this.onCountryChange, - this.selectionType, - this.fontSize = 14, - this.isWalletAmountInput = false, - this.suffix, - // this.countryList = const [], - // this.onCountryChange, - }); + TextInputWidget( + {super.key, + required this.labelText, + required this.hintText, + this.controller, + this.onChange, + this.onCalendarTypeChanged, + this.prefix, + this.isEnable = true, + this.isBorderAllowed = true, + this.isAllowRadius = true, + this.isReadOnly = false, + this.keyboardType = TextInputType.number, + this.focusNode, + this.autoFocus = false, + this.padding, + this.isAllowLeadingIcon = false, + this.leadingIcon, + this.isCountryDropDown = false, + this.hasError = false, + this.errorMessage, + this.onCountryChange, + this.selectionType, + this.fontSize = 14, + this.isWalletAmountInput = false, + this.suffix, + this.labelColor + // this.countryList = const [], + // this.onCountryChange, + }); final FocusNode _focusNode = FocusNode(); @@ -135,7 +137,7 @@ class TextInputWidget extends StatelessWidget { mainAxisSize: MainAxisSize.min, crossAxisAlignment: CrossAxisAlignment.start, children: [ - _buildLabelText().paddingOnly(right: (appState.getLanguageCode() == "ar" ? 10 : 0)), + _buildLabelText(labelColor).paddingOnly(right: (appState.getLanguageCode() == "ar" ? 10 : 0)), _buildTextField(context), ], ), @@ -206,13 +208,13 @@ class TextInputWidget extends StatelessWidget { ); } - Widget _buildLabelText() { + Widget _buildLabelText(Color? labelColor) { return Text( labelText, style: TextStyle( fontSize: 12.fSize, fontWeight: FontWeight.w500, - color: AppColors.inputLabelTextColor, + color: labelColor ?? AppColors.inputLabelTextColor, letterSpacing: -0.2, height: 18 / 12, ),