25-12-1/1
This commit is contained in:
@@ -356,9 +356,14 @@ class _PhoneNumberScreenState extends State<PhoneNumberScreen> {
|
||||
validator: (phone) {
|
||||
if (phone == null || phone.number.isEmpty) {
|
||||
return 'Please enter your phone number'.tr;
|
||||
} // Check if the number is a Syrian number
|
||||
if (phone.countryISOCode != 'SY') {
|
||||
return 'Only Syrian phone numbers are allowed'.tr;
|
||||
}
|
||||
// Check if the national number part starts with '0'
|
||||
if (phone.number.startsWith('0')) {
|
||||
if (phone.completeNumber.startsWith('96309') ||
|
||||
phone.completeNumber.startsWith('+9630') ||
|
||||
phone.completeNumber.startsWith('09')) {
|
||||
return 'Please enter the number without the leading 0'.tr;
|
||||
}
|
||||
if (phone.completeNumber.length < 10) {
|
||||
|
||||
@@ -121,6 +121,29 @@ class RegistrationView extends StatelessWidget {
|
||||
},
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
TextFormField(
|
||||
controller: c.bithdateController,
|
||||
decoration: InputDecoration(
|
||||
labelText: 'سنة الميلاد'.tr,
|
||||
hintText: '1999'.tr,
|
||||
border: const OutlineInputBorder(),
|
||||
),
|
||||
keyboardType: TextInputType.number,
|
||||
validator: (v) {
|
||||
if (v == null || v.isEmpty) {
|
||||
return 'Required field'.tr;
|
||||
}
|
||||
if (v.length != 4) {
|
||||
return 'Birth year must be 4 digits'.tr;
|
||||
}
|
||||
// Optional: check if it’s a valid number
|
||||
if (int.tryParse(v) == null) {
|
||||
return 'Enter a valid year'.tr;
|
||||
}
|
||||
return null;
|
||||
},
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
TextFormField(
|
||||
controller: c.driverLicenseExpiryController,
|
||||
decoration: InputDecoration(
|
||||
|
||||
Reference in New Issue
Block a user