Initial commit for Intaleq Driver

This commit is contained in:
Hamza-Ayed
2025-09-01 19:04:50 +03:00
parent 889c67a691
commit 8c7f3e3a75
46 changed files with 4300 additions and 6192 deletions

View File

@@ -72,29 +72,53 @@ class RegistrationView extends StatelessWidget {
TextFormField(
controller: c.firstNameController,
decoration: InputDecoration(
labelText: 'First Name'.tr,
border: const OutlineInputBorder()),
validator: (v) =>
(v?.isEmpty ?? true) ? 'Required field'.tr : null,
labelText: 'First Name'.tr,
border: const OutlineInputBorder(),
),
validator: (v) {
if (v == null || v.isEmpty) {
return 'Required field'.tr;
}
if (v.length < 2) {
return 'Name must be at least 2 characters'.tr;
}
return null;
},
),
const SizedBox(height: 16),
TextFormField(
controller: c.lastNameController,
decoration: InputDecoration(
labelText: 'Last Name'.tr,
border: const OutlineInputBorder()),
validator: (v) =>
(v?.isEmpty ?? true) ? 'Required field'.tr : null,
labelText: 'Last Name'.tr,
border: const OutlineInputBorder(),
),
validator: (v) {
if (v == null || v.isEmpty) {
return 'Required field'.tr;
}
if (v.length < 2) {
return 'Name must be at least 2 characters'.tr;
}
return null;
},
),
const SizedBox(height: 16),
TextFormField(
controller: c.nationalIdController,
decoration: InputDecoration(
labelText: 'National ID Number'.tr,
border: const OutlineInputBorder()),
labelText: 'National ID Number'.tr,
border: const OutlineInputBorder(),
),
keyboardType: TextInputType.number,
validator: (v) =>
(v?.isEmpty ?? true) ? 'Required field'.tr : null,
validator: (v) {
if (v == null || v.isEmpty) {
return 'Required field'.tr;
}
if (v.length != 11) {
return 'National ID must be 11 digits'.tr;
}
return null;
},
),
const SizedBox(height: 16),
TextFormField(
@@ -296,6 +320,15 @@ class RegistrationView extends StatelessWidget {
);
}
Widget signedImageWithAuth(String fileUrl, String bearerToken) {
return Image.network(
fileUrl,
headers: {'Authorization': 'Bearer $bearerToken'},
fit: BoxFit.cover,
errorBuilder: (_, __, ___) => const Text('Image expired or unauthorized'),
);
}
Widget _buildImagePickerBox(String title, File? img, VoidCallback onTap) {
return Card(
margin: const EdgeInsets.only(bottom: 16),