Initial push to my private server

This commit is contained in:
Hamza-Ayed
2025-09-21 15:02:12 +03:00
parent 7e904ae460
commit f08ee61a7e
32 changed files with 1622 additions and 373 deletions

View File

@@ -284,6 +284,9 @@ class RegistrationView extends StatelessWidget {
// STEP 3
Widget _buildDocumentUploadStep(BuildContext ctx, RegistrationController c) {
final String linkUpload =
'https://syria.intaleq.xyz/intaleq/auth/syria/uploadImage.php';
return GetBuilder<RegistrationController>(
builder: (ctrl) => SingleChildScrollView(
padding: const EdgeInsets.all(16),
@@ -296,23 +299,31 @@ class RegistrationView extends StatelessWidget {
const SizedBox(height: 20),
_buildImagePickerBox(
'Driver License (Front)'.tr,
ctrl.driverLicenseFrontImage,
() => ctrl.pickImage(ImageType.driverLicenseFront),
ctrl.docUrls['driver_license_front'],
// () => ctrl.pickImage(ImageType.driverLicenseFront),
() async =>
await ctrl.choosImage(linkUpload, 'driver_license_front'),
),
_buildImagePickerBox(
'Driver License (Back)'.tr,
ctrl.driverLicenseBackImage,
() => ctrl.pickImage(ImageType.driverLicenseBack),
ctrl.docUrls['driver_license_back'],
() async =>
await ctrl.choosImage(linkUpload, 'driver_license_back'),
// () => ctrl.pickImage(ImageType.driverLicenseBack),
),
_buildImagePickerBox(
'Car Registration (Front)'.tr,
ctrl.carLicenseFrontImage,
() => ctrl.pickImage(ImageType.carLicenseFront),
ctrl.docUrls['car_license_front'],
() async =>
await ctrl.choosImage(linkUpload, 'car_license_front'),
// () => ctrl.pickImage(ImageType.carLicenseFront),
),
_buildImagePickerBox(
'Car Registration (Back)'.tr,
ctrl.carLicenseBackImage,
() => ctrl.pickImage(ImageType.carLicenseBack),
ctrl.docUrls['car_license_back'],
() async => await ctrl.choosImage(linkUpload, 'car_license_back'),
// () => ctrl.pickImage(ImageType.carLicenseBack),
),
],
),
@@ -329,7 +340,7 @@ class RegistrationView extends StatelessWidget {
);
}
Widget _buildImagePickerBox(String title, File? img, VoidCallback onTap) {
Widget _buildImagePickerBox(String title, String? img, VoidCallback onTap) {
return Card(
margin: const EdgeInsets.only(bottom: 16),
child: InkWell(
@@ -337,8 +348,24 @@ class RegistrationView extends StatelessWidget {
child: SizedBox(
height: 150,
width: double.infinity,
child: img != null
? Image.file(img, fit: BoxFit.fill)
child: (img != null && img.isNotEmpty)
? Image.network(
img,
fit: BoxFit.cover,
errorBuilder: (context, error, stackTrace) {
return Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Icon(Icons.broken_image, size: 40, color: Colors.red),
const SizedBox(height: 8),
Text('Image not available',
style: TextStyle(color: Colors.red[700])),
],
),
);
},
)
: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [