|
|
|
|
@ -58,7 +58,7 @@ class _RegistrationScreenState extends State<RegistrationScreen> {
|
|
|
|
|
Utils.showLoading(context);
|
|
|
|
|
try {
|
|
|
|
|
await UserApiClient().registerUser(_firstName, _lastName, _email, _password, _countryCode, _phone);
|
|
|
|
|
Utils.showToast("Register successfully");
|
|
|
|
|
Utils.showToast("تسجيل بنجاح");
|
|
|
|
|
Utils.hideLoading(context);
|
|
|
|
|
Navigator.pop(context);
|
|
|
|
|
} catch (ex, tr) {
|
|
|
|
|
@ -169,46 +169,46 @@ class _RegistrationScreenState extends State<RegistrationScreen> {
|
|
|
|
|
child: TextButton(
|
|
|
|
|
onPressed: () {
|
|
|
|
|
if (_firstNameController.text.length < 1) {
|
|
|
|
|
Utils.showToast("Username is empty.");
|
|
|
|
|
Utils.showToast("اسم المستخدم فارغ");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if (_lastNameController.text.length < 1) {
|
|
|
|
|
Utils.showToast("Name is empty.");
|
|
|
|
|
Utils.showToast("الاسم فارغ");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if (_emailController.text.length < 1) {
|
|
|
|
|
Utils.showToast("Email is empty.");
|
|
|
|
|
Utils.showToast("البريد الإلكتروني فارغ");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if (_selectedCountry?.countryCode == null) {
|
|
|
|
|
Utils.showToast("you must select country.");
|
|
|
|
|
Utils.showToast("يجب عليك اختيار الدولة");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if (_mobileNumberController.text.length < 1) {
|
|
|
|
|
Utils.showToast("Phone number is empty.");
|
|
|
|
|
Utils.showToast("رقم الهاتف فارغ");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if (_passwordController.text.length < 1) {
|
|
|
|
|
Utils.showToast("Password is empty.");
|
|
|
|
|
Utils.showToast("كلمة المرور فارغة");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if (_confirmPasswordController.text.length < 1) {
|
|
|
|
|
Utils.showToast("Enter same password to confirm");
|
|
|
|
|
Utils.showToast("أدخل كلمة المرور نفسها للتأكيد");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!_emailController.text.isValidEmail()) {
|
|
|
|
|
Utils.showToast("Invalid email.");
|
|
|
|
|
Utils.showToast("بريد إلكتروني خاطئ");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (_passwordController.text != _confirmPasswordController.text) {
|
|
|
|
|
Utils.showToast("Your passwords are incorrect.");
|
|
|
|
|
Utils.showToast("كلمات السر الخاصة بك غير صحيحة");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!_isAccept) {
|
|
|
|
|
Utils.showToast("You must accept statement to proceed.");
|
|
|
|
|
Utils.showToast("يجب عليك قبول البيان للمتابعة");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
registerUser(
|
|
|
|
|
|