|
|
|
|
@ -94,27 +94,29 @@ class LoginScreenState extends State<LoginScreen> {
|
|
|
|
|
LocaleKeys.welcomeToDrSulaiman.tr(context: context).toText32(isBold: true, color: AppColors.textColor ),
|
|
|
|
|
SizedBox(height: 32.h),
|
|
|
|
|
Localizations.override(context: context, locale: Locale('en', 'US'), child: Container()), // Force English locale for this widget
|
|
|
|
|
TextInputWidget(
|
|
|
|
|
labelText: LocaleKeys.nationalIdFileNumber.tr(context: context),
|
|
|
|
|
hintText: "xxxxxxxxx",
|
|
|
|
|
controller: authVm.nationalIdController,
|
|
|
|
|
focusNode: _nationalIdFocusNode,
|
|
|
|
|
keyboardType: TextInputType.number,
|
|
|
|
|
isEnable: true,
|
|
|
|
|
prefix: null,
|
|
|
|
|
autoFocus: true,
|
|
|
|
|
isAllowRadius: true,
|
|
|
|
|
isBorderAllowed: false,
|
|
|
|
|
isAllowLeadingIcon: true,
|
|
|
|
|
padding: EdgeInsets.symmetric(vertical: 8.h, horizontal: 10.h),
|
|
|
|
|
leadingIcon: AppAssets.student_card,
|
|
|
|
|
errorMessage: authVm.nationalIdError,
|
|
|
|
|
hasError: authVm.nationalIdError != null,
|
|
|
|
|
fontFamily: "Poppins",
|
|
|
|
|
onChange: (value) {
|
|
|
|
|
// Clear error when user starts typing
|
|
|
|
|
authVm.clearNationalIdError();
|
|
|
|
|
},
|
|
|
|
|
ClarityUnmask(
|
|
|
|
|
child: TextInputWidget(
|
|
|
|
|
labelText: LocaleKeys.nationalIdFileNumber.tr(context: context),
|
|
|
|
|
hintText: "xxxxxxxxx",
|
|
|
|
|
controller: authVm.nationalIdController,
|
|
|
|
|
focusNode: _nationalIdFocusNode,
|
|
|
|
|
keyboardType: TextInputType.number,
|
|
|
|
|
isEnable: true,
|
|
|
|
|
prefix: null,
|
|
|
|
|
autoFocus: true,
|
|
|
|
|
isAllowRadius: true,
|
|
|
|
|
isBorderAllowed: false,
|
|
|
|
|
isAllowLeadingIcon: true,
|
|
|
|
|
padding: EdgeInsets.symmetric(vertical: 8.h, horizontal: 10.h),
|
|
|
|
|
leadingIcon: AppAssets.student_card,
|
|
|
|
|
errorMessage: authVm.nationalIdError,
|
|
|
|
|
hasError: authVm.nationalIdError != null,
|
|
|
|
|
fontFamily: "Poppins",
|
|
|
|
|
onChange: (value) {
|
|
|
|
|
// Clear error when user starts typing
|
|
|
|
|
authVm.clearNationalIdError();
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
SizedBox(height: 16.h),
|
|
|
|
|
CustomButton(
|
|
|
|
|
@ -205,65 +207,67 @@ class LoginScreenState extends State<LoginScreen> {
|
|
|
|
|
child: SingleChildScrollView(
|
|
|
|
|
child: Consumer<AuthenticationViewModel>(
|
|
|
|
|
builder: (context, authVm, child) {
|
|
|
|
|
return GenericBottomSheet(
|
|
|
|
|
countryCode: authVm.selectedCountrySignup.countryCode,
|
|
|
|
|
initialPhoneNumber: "",
|
|
|
|
|
textController: phoneNumberController,
|
|
|
|
|
isEnableCountryDropdown: true,
|
|
|
|
|
onCountryChange: (country) {
|
|
|
|
|
authVm.onCountryChange(country);
|
|
|
|
|
// Clear error when country changes
|
|
|
|
|
authVm.clearPhoneNumberError();
|
|
|
|
|
},
|
|
|
|
|
onChange: (value) {
|
|
|
|
|
authVm.onPhoneNumberChange(value);
|
|
|
|
|
// Clear error when user starts typing
|
|
|
|
|
authVm.clearPhoneNumberError();
|
|
|
|
|
},
|
|
|
|
|
phoneNumberError: authVm.phoneNumberError,
|
|
|
|
|
buttons: [
|
|
|
|
|
if (authVm.selectedCountrySignup != CountryEnum.others)
|
|
|
|
|
return ClarityUnmask(
|
|
|
|
|
child: GenericBottomSheet(
|
|
|
|
|
countryCode: authVm.selectedCountrySignup.countryCode,
|
|
|
|
|
initialPhoneNumber: "",
|
|
|
|
|
textController: phoneNumberController,
|
|
|
|
|
isEnableCountryDropdown: true,
|
|
|
|
|
onCountryChange: (country) {
|
|
|
|
|
authVm.onCountryChange(country);
|
|
|
|
|
// Clear error when country changes
|
|
|
|
|
authVm.clearPhoneNumberError();
|
|
|
|
|
},
|
|
|
|
|
onChange: (value) {
|
|
|
|
|
authVm.onPhoneNumberChange(value);
|
|
|
|
|
// Clear error when user starts typing
|
|
|
|
|
authVm.clearPhoneNumberError();
|
|
|
|
|
},
|
|
|
|
|
phoneNumberError: authVm.phoneNumberError,
|
|
|
|
|
buttons: [
|
|
|
|
|
if (authVm.selectedCountrySignup != CountryEnum.others)
|
|
|
|
|
Padding(
|
|
|
|
|
padding: EdgeInsets.only(bottom: 10.h),
|
|
|
|
|
child: CustomButton(
|
|
|
|
|
text: LocaleKeys.sendOTPSMS.tr(context: context),
|
|
|
|
|
onPressed: () async {
|
|
|
|
|
validatePhoneAndProceed(OTPTypeEnum.sms);
|
|
|
|
|
},
|
|
|
|
|
backgroundColor: AppColors.primaryRedColor,
|
|
|
|
|
borderColor: AppColors.primaryRedBorderColor,
|
|
|
|
|
textColor: Colors.white,
|
|
|
|
|
iconColor: Colors.white,
|
|
|
|
|
icon: AppAssets.message,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
if (authVm.selectedCountrySignup != CountryEnum.others)
|
|
|
|
|
Row(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
|
|
|
children: [
|
|
|
|
|
Padding(
|
|
|
|
|
padding: EdgeInsets.symmetric(horizontal: 8.h),
|
|
|
|
|
child: LocaleKeys.oR.tr(context: context).toText16(color: AppColors.textColor),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
Padding(
|
|
|
|
|
padding: EdgeInsets.only(bottom: 10.h),
|
|
|
|
|
padding: EdgeInsets.only(bottom: 10.h, top: 10.h),
|
|
|
|
|
child: CustomButton(
|
|
|
|
|
text: LocaleKeys.sendOTPSMS.tr(context: context),
|
|
|
|
|
text: LocaleKeys.sendOTPWHATSAPP.tr(context: context),
|
|
|
|
|
onPressed: () async {
|
|
|
|
|
validatePhoneAndProceed(OTPTypeEnum.sms);
|
|
|
|
|
validatePhoneAndProceed(OTPTypeEnum.whatsapp);
|
|
|
|
|
},
|
|
|
|
|
backgroundColor: AppColors.primaryRedColor,
|
|
|
|
|
borderColor: AppColors.primaryRedBorderColor,
|
|
|
|
|
textColor: Colors.white,
|
|
|
|
|
iconColor: Colors.white,
|
|
|
|
|
icon: AppAssets.message,
|
|
|
|
|
backgroundColor: AppColors.whiteColor,
|
|
|
|
|
borderColor: AppColors.textColor,
|
|
|
|
|
textColor: AppColors.textColor,
|
|
|
|
|
icon: AppAssets.whatsapp,
|
|
|
|
|
iconColor: null,
|
|
|
|
|
applyThemeColor: false,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
if (authVm.selectedCountrySignup != CountryEnum.others)
|
|
|
|
|
Row(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
|
|
|
children: [
|
|
|
|
|
Padding(
|
|
|
|
|
padding: EdgeInsets.symmetric(horizontal: 8.h),
|
|
|
|
|
child: LocaleKeys.oR.tr(context: context).toText16(color: AppColors.textColor),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
Padding(
|
|
|
|
|
padding: EdgeInsets.only(bottom: 10.h, top: 10.h),
|
|
|
|
|
child: CustomButton(
|
|
|
|
|
text: LocaleKeys.sendOTPWHATSAPP.tr(context: context),
|
|
|
|
|
onPressed: () async {
|
|
|
|
|
validatePhoneAndProceed(OTPTypeEnum.whatsapp);
|
|
|
|
|
},
|
|
|
|
|
backgroundColor: AppColors.whiteColor,
|
|
|
|
|
borderColor: AppColors.textColor,
|
|
|
|
|
textColor: AppColors.textColor,
|
|
|
|
|
icon: AppAssets.whatsapp,
|
|
|
|
|
iconColor: null,
|
|
|
|
|
applyThemeColor: false,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
|