25-12-1/1

This commit is contained in:
Hamza-Ayed
2025-12-01 07:52:54 +03:00
parent b1b8efdd7d
commit 9b1008a0bf
40 changed files with 2471 additions and 2039 deletions

View File

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

View File

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