|
|
|
|
@ -66,7 +66,7 @@ class _RegisterNew extends State<RegisterNew> {
|
|
|
|
|
final nationalIDorFile = TextEditingController();
|
|
|
|
|
final phoneController = TextEditingController();
|
|
|
|
|
AppointmentRateViewModel appointmentRateViewModel = locator<AppointmentRateViewModel>();
|
|
|
|
|
|
|
|
|
|
final FocusNode myFocusNode = FocusNode();
|
|
|
|
|
Country selectedCountry = Country.saudiArabia;
|
|
|
|
|
OTPType? otpType;
|
|
|
|
|
bool isTermsAccepted = false;
|
|
|
|
|
@ -324,7 +324,8 @@ class _RegisterNew extends State<RegisterNew> {
|
|
|
|
|
// Utils.showErrorToast(TranslationBase.of(context).pleaseEnterNationalId);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if (nationalIDorFile != null && !Utils.validateIqama(nationalIDorFile.text)) {
|
|
|
|
|
if ((!Utils.validateIqama(nationalIDorFile.text) && selectedCountry.countryCode == '966') ||
|
|
|
|
|
(!Utils.validateUaeNationalId(nationalIDorFile.text) && selectedCountry.countryCode == '971')) {
|
|
|
|
|
context.showBottomSheet(
|
|
|
|
|
child: ExceptionBottomSheet(
|
|
|
|
|
message: "Please enter correct national id",
|
|
|
|
|
@ -401,7 +402,18 @@ class _RegisterNew extends State<RegisterNew> {
|
|
|
|
|
if (mobileNo.isEmpty) {
|
|
|
|
|
context.showBottomSheet(
|
|
|
|
|
child: ExceptionBottomSheet(
|
|
|
|
|
message: "Please enter mobile number",
|
|
|
|
|
message: TranslationBase.of(context).pleaseEnterMobile,
|
|
|
|
|
showCancel: false,
|
|
|
|
|
onOkPressed: () {
|
|
|
|
|
Navigator.of(context).pop();
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
else if (!Utils.validateMobileNumber(mobileNo)) {
|
|
|
|
|
context.showBottomSheet(
|
|
|
|
|
child: ExceptionBottomSheet(
|
|
|
|
|
message: TranslationBase.of(context).pleaseEnterValidMobile,
|
|
|
|
|
showCancel: false,
|
|
|
|
|
onOkPressed: () {
|
|
|
|
|
Navigator.of(context).pop();
|
|
|
|
|
@ -409,19 +421,6 @@ class _RegisterNew extends State<RegisterNew> {
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
//
|
|
|
|
|
// 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);
|
|
|
|
|
}
|
|
|
|
|
@ -456,17 +455,17 @@ class _RegisterNew extends State<RegisterNew> {
|
|
|
|
|
if (mobileNo.isEmpty) {
|
|
|
|
|
context.showBottomSheet(
|
|
|
|
|
child: ExceptionBottomSheet(
|
|
|
|
|
message: "Please enter mobile number",
|
|
|
|
|
message: TranslationBase.of(context).pleaseEnterMobile,
|
|
|
|
|
showCancel: false,
|
|
|
|
|
onOkPressed: () {
|
|
|
|
|
Navigator.of(context).pop();
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
} else if (mobileNo.length < 9) {
|
|
|
|
|
} else if (!Utils.validateMobileNumber(mobileNo)) {
|
|
|
|
|
context.showBottomSheet(
|
|
|
|
|
child: ExceptionBottomSheet(
|
|
|
|
|
message: "Please enter correct mobile number",
|
|
|
|
|
message: TranslationBase.of(context).pleaseEnterValidMobile,
|
|
|
|
|
showCancel: false,
|
|
|
|
|
onOkPressed: () {
|
|
|
|
|
Navigator.of(context).pop();
|
|
|
|
|
@ -485,11 +484,14 @@ class _RegisterNew extends State<RegisterNew> {
|
|
|
|
|
icon: "assets/images/svg/whatsapp.svg",
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
], myFocusNode:myFocusNode,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
Future.delayed(Duration(milliseconds: 500), () {
|
|
|
|
|
myFocusNode.requestFocus();
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
fontFamily: context.fontFamily,
|
|
|
|
|
),
|
|
|
|
|
|