otp screen & register Uae & resend Activation Code.

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

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

@ -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"
}

@ -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

@ -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(

@ -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<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);
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<String, dynamic>);
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.
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']);
}
}

@ -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';
}

@ -44,20 +44,24 @@ class _RegisterNew extends State<RegisterNewStep2> {
Widget build(BuildContext context) {
AppState appState = getIt.get<AppState>();
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: <Widget>[
LocaleKeys.personalDetailsVerification.tr().toText26(color: AppColors.textColor, weight: FontWeight.w600, letterSpacing: -2),
SizedBox(height: 24.h),
Directionality(
textDirection: Directionality.of(context),
child: Container(
@ -67,7 +71,8 @@ class _RegisterNew extends State<RegisterNewStep2> {
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()}"),
hintText:
authVM!.isUserFromUAE() ? LocaleKeys.enterNameHere.tr() : ("${appState.getNHICUserData.firstNameEn!.toUpperCase()} ${appState.getNHICUserData.lastNameEn!.toUpperCase()}"),
controller: authVM!.isUserFromUAE() ? authVM!.nameController : null,
isEnable: true,
prefix: null,
@ -76,8 +81,9 @@ class _RegisterNew extends State<RegisterNewStep2> {
keyboardType: TextInputType.text,
isAllowLeadingIcon: true,
isReadOnly: authVM!.isUserFromUAE() ? false : true,
leadingIcon: AppAssets.user_circle)
.paddingSymmetrical(0.h, 16.h),
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<RegisterNewStep2> {
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<RegisterNewStep2> {
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<RegisterNewStep2> {
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<RegisterNewStep2> {
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<RegisterNewStep2> {
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<RegisterNewStep2> {
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<RegisterNewStep2> {
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<RegisterNewStep2> {
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<RegisterNewStep2> {
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<RegisterNewStep2> {
),
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(

@ -18,9 +18,10 @@ class DropdownWidget extends StatelessWidget {
final bool hasSelectionCustomIcon;
final String? selectionCustomIcon;
final String? leadingIcon;
final Color? labelColor;
const DropdownWidget({
Key? key,
const DropdownWidget(
{Key? key,
required this.labelText,
required this.hintText,
required this.dropdownItems,
@ -33,14 +34,15 @@ class DropdownWidget extends StatelessWidget {
this.hasSelectionCustomIcon = false,
this.selectionCustomIcon,
this.leadingIcon,
}) : super(key: key);
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,
),

@ -41,12 +41,13 @@ class TextInputWidget extends StatelessWidget {
final num? fontSize;
final bool? isWalletAmountInput;
final Widget? suffix;
final Color? labelColor;
// final List<Country> countryList;
// final Function(Country)? onCountryChange;
TextInputWidget({
super.key,
TextInputWidget(
{super.key,
required this.labelText,
required this.hintText,
this.controller,
@ -71,6 +72,7 @@ class TextInputWidget extends StatelessWidget {
this.fontSize = 14,
this.isWalletAmountInput = false,
this.suffix,
this.labelColor
// this.countryList = const [],
// this.onCountryChange,
});
@ -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,
),

Loading…
Cancel
Save