|
|
|
|
@ -248,7 +248,7 @@ class _OtherDetailsStepState extends State<OtherDetailsStep> {
|
|
|
|
|
child: Consumer<HabibWalletViewModel>(
|
|
|
|
|
builder: (context, habibWalletVM, child) {
|
|
|
|
|
final hospitals = habibWalletVM.advancePaymentHospitals;
|
|
|
|
|
if (hospitals == null || hospitals.isEmpty) {
|
|
|
|
|
if (hospitals.isEmpty) {
|
|
|
|
|
return const Center(
|
|
|
|
|
child: Padding(
|
|
|
|
|
padding: EdgeInsets.all(16.0),
|
|
|
|
|
@ -289,19 +289,15 @@ class _OtherDetailsStepState extends State<OtherDetailsStep> {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void _addMedicalReport(String image, File file, ReferralFormManager formManager) {
|
|
|
|
|
// Max 1 file
|
|
|
|
|
if (formManager.formData.medicalReportImages.isNotEmpty) {
|
|
|
|
|
formManager.setFieldError('medicalReport', LocaleKeys.maxOneFileAllowed.tr(context: context));
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
// Remove max 1 file check
|
|
|
|
|
// Max 1 MB
|
|
|
|
|
final fileSizeInBytes = file.lengthSync();
|
|
|
|
|
if (fileSizeInBytes > 1 * 1024 * 1024) {
|
|
|
|
|
formManager.setFieldError('medicalReport', LocaleKeys.fileSizeExceedsLimit.tr(context: context));
|
|
|
|
|
formManager.setFieldError('medicalReport', 'File size exceeds 1MB limit.');
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
final newAttachment = EReferralAttachment(
|
|
|
|
|
fileName: 'medical_report_${formManager.formData.medicalReportImages.length + 1}.png',
|
|
|
|
|
fileName: 'medical_report_formManager.formData.medicalReportImages.length + 1}.png',
|
|
|
|
|
base64String: image
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
@ -315,19 +311,15 @@ class _OtherDetailsStepState extends State<OtherDetailsStep> {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void _addInsuranceDocument(String image, File file, ReferralFormManager formManager) {
|
|
|
|
|
// Max 1 file
|
|
|
|
|
if (formManager.formData.insuredPatientImages.isNotEmpty) {
|
|
|
|
|
formManager.setFieldError('insuredDocument', LocaleKeys.maxOneFileAllowed.tr(context: context));
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
// Remove max 1 file check
|
|
|
|
|
// Max 1 MB
|
|
|
|
|
final fileSizeInBytes = file.lengthSync();
|
|
|
|
|
if (fileSizeInBytes > 1 * 1024 * 1024) {
|
|
|
|
|
formManager.setFieldError('insuredDocument', LocaleKeys.fileSizeExceedsLimit.tr(context: context));
|
|
|
|
|
formManager.setFieldError('insuredDocument', 'File size exceeds 1MB limit.');
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
final newAttachment = EReferralAttachment(
|
|
|
|
|
fileName: 'insurance_${formManager.formData.insuredPatientImages.length + 1}.png',
|
|
|
|
|
fileName: 'insurance_formManager.formData.insuredPatientImages.length + 1}.png',
|
|
|
|
|
base64String: image
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|