diff --git a/lib/features/insurance_auth/services/insurance_auth_pdf_service.dart b/lib/features/insurance_auth/services/insurance_auth_pdf_service.dart index d28239f..5057ee8 100644 --- a/lib/features/insurance_auth/services/insurance_auth_pdf_service.dart +++ b/lib/features/insurance_auth/services/insurance_auth_pdf_service.dart @@ -73,13 +73,11 @@ class InsuranceAuthPdfService { return pw.Column( crossAxisAlignment: pw.CrossAxisAlignment.stretch, children: [ - // Mitad superior de la hoja (máximo 5.5 pulgadas / 396 pt) - pw.ConstrainedBox( - constraints: const pw.BoxConstraints( - maxHeight: 5.5 * PdfPageFormat.inch - 32, - ), + // Mitad superior de la hoja: altura fija de media carta (5.5 pulgadas / 396 pt) + // para que el pie de página siempre quede anclado al final de la media hoja. + pw.SizedBox( + height: 5.5 * PdfPageFormat.inch - 32, child: pw.Column( - mainAxisSize: pw.MainAxisSize.min, crossAxisAlignment: pw.CrossAxisAlignment.stretch, children: [ // 1. Cabecera con Nombre del Doctor y Badge Sutil de Hidalyx Med @@ -209,11 +207,11 @@ class InsuranceAuthPdfService { ), pw.SizedBox(height: 8), - // 3. Contenido Formal idéntico a AlfaMedical - pw.Column( - crossAxisAlignment: pw.CrossAxisAlignment.stretch, - mainAxisSize: pw.MainAxisSize.min, - children: [ + // 3. Contenido Formal idéntico a AlfaMedical (ocupa el espacio central disponible) + pw.Expanded( + child: pw.Column( + crossAxisAlignment: pw.CrossAxisAlignment.stretch, + children: [ // Señores ARS pw.RichText( text: pw.TextSpan( @@ -314,7 +312,8 @@ class InsuranceAuthPdfService { ], ], ), - pw.SizedBox(height: 10), + ), + pw.SizedBox(height: 6), // Línea divisoria decorativa previa al pie pw.Container( diff --git a/lib/features/prescription/services/prescription_pdf_service.dart b/lib/features/prescription/services/prescription_pdf_service.dart index 1d229b7..4434865 100644 --- a/lib/features/prescription/services/prescription_pdf_service.dart +++ b/lib/features/prescription/services/prescription_pdf_service.dart @@ -70,13 +70,11 @@ class PrescriptionPdfService { return pw.Column( crossAxisAlignment: pw.CrossAxisAlignment.stretch, children: [ - // Mitad superior de la hoja (máximo 5.5 pulgadas / 396 pt) - pw.ConstrainedBox( - constraints: const pw.BoxConstraints( - maxHeight: 5.5 * PdfPageFormat.inch - 32, - ), + // Mitad superior de la hoja: altura fija de media carta (5.5 pulgadas / 396 pt) + // para que el pie de página siempre quede anclado al final de la media hoja. + pw.SizedBox( + height: 5.5 * PdfPageFormat.inch - 32, child: pw.Column( - mainAxisSize: pw.MainAxisSize.min, crossAxisAlignment: pw.CrossAxisAlignment.stretch, children: [ // 1. Cabecera con Nombre del Doctor y Badge Superior de Hidalyx Med @@ -221,22 +219,25 @@ class PrescriptionPdfService { ), pw.SizedBox(height: 8), - // 3. Contenido de la Receta / Prescripción Médica - pw.Container( - padding: const pw.EdgeInsets.symmetric(vertical: 6), - child: pw.Text( - prescriptionText.trim().isNotEmpty - ? prescriptionText.trim() - : 'Sin prescripciones anotadas.', - style: pw.TextStyle( - font: regular, - fontSize: 10, - lineSpacing: 3, - color: PdfColor.fromHex('1E293B'), + // 3. Contenido de la Receta / Prescripción Médica (ocupa el espacio central disponible) + pw.Expanded( + child: pw.Container( + alignment: pw.Alignment.topLeft, + padding: const pw.EdgeInsets.symmetric(vertical: 4), + child: pw.Text( + prescriptionText.trim().isNotEmpty + ? prescriptionText.trim() + : 'Sin prescripciones anotadas.', + style: pw.TextStyle( + font: regular, + fontSize: 10, + lineSpacing: 3, + color: PdfColor.fromHex('1E293B'), + ), ), ), ), - pw.SizedBox(height: 10), + pw.SizedBox(height: 6), // Línea sutil previa al pie de página pw.Container( diff --git a/lib/features/referrals/services/department_referral_pdf_service.dart b/lib/features/referrals/services/department_referral_pdf_service.dart index 2dbb9de..2111eb4 100644 --- a/lib/features/referrals/services/department_referral_pdf_service.dart +++ b/lib/features/referrals/services/department_referral_pdf_service.dart @@ -68,13 +68,11 @@ class DepartmentReferralPdfService { return pw.Column( crossAxisAlignment: pw.CrossAxisAlignment.stretch, children: [ - // Mitad superior de la hoja (máximo 5.5 pulgadas / 396 pt) - pw.ConstrainedBox( - constraints: const pw.BoxConstraints( - maxHeight: 5.5 * PdfPageFormat.inch - 32, - ), + // Mitad superior de la hoja: altura fija de media carta (5.5 pulgadas / 396 pt) + // para que el pie de página siempre quede anclado al final de la media hoja. + pw.SizedBox( + height: 5.5 * PdfPageFormat.inch - 32, child: pw.Column( - mainAxisSize: pw.MainAxisSize.min, crossAxisAlignment: pw.CrossAxisAlignment.stretch, children: [ // 1. Cabecera con Nombre del Doctor y Badge Sutil de Hidalyx Med @@ -170,22 +168,25 @@ class DepartmentReferralPdfService { ), pw.SizedBox(height: 8), - // 2. Contenido del Referimiento (Idéntico a AlfaMedical) - pw.Container( - padding: const pw.EdgeInsets.symmetric(vertical: 6), - child: pw.Text( - referralText.trim().isNotEmpty - ? referralText.trim() - : 'Sin detalles de referimiento.', - style: pw.TextStyle( - font: regular, - fontSize: 10.5, - lineSpacing: 3.5, - color: PdfColor.fromHex('1E293B'), + // 2. Contenido del Referimiento (ocupa el espacio central disponible) + pw.Expanded( + child: pw.Container( + alignment: pw.Alignment.topLeft, + padding: const pw.EdgeInsets.symmetric(vertical: 4), + child: pw.Text( + referralText.trim().isNotEmpty + ? referralText.trim() + : 'Sin detalles de referimiento.', + style: pw.TextStyle( + font: regular, + fontSize: 10.5, + lineSpacing: 3.5, + color: PdfColor.fromHex('1E293B'), + ), ), ), ), - pw.SizedBox(height: 10), + pw.SizedBox(height: 6), // Línea divisoria decorativa previa al pie pw.Container( diff --git a/lib/features/referrals/services/doctor_referral_pdf_service.dart b/lib/features/referrals/services/doctor_referral_pdf_service.dart index 0630257..fa70b0c 100644 --- a/lib/features/referrals/services/doctor_referral_pdf_service.dart +++ b/lib/features/referrals/services/doctor_referral_pdf_service.dart @@ -68,13 +68,11 @@ class DoctorReferralPdfService { return pw.Column( crossAxisAlignment: pw.CrossAxisAlignment.stretch, children: [ - // Mitad superior de la hoja (máximo 5.5 pulgadas / 396 pt) - pw.ConstrainedBox( - constraints: const pw.BoxConstraints( - maxHeight: 5.5 * PdfPageFormat.inch - 32, - ), + // Mitad superior de la hoja: altura fija de media carta (5.5 pulgadas / 396 pt) + // para que el pie de página siempre quede anclado al final de la media hoja. + pw.SizedBox( + height: 5.5 * PdfPageFormat.inch - 32, child: pw.Column( - mainAxisSize: pw.MainAxisSize.min, crossAxisAlignment: pw.CrossAxisAlignment.stretch, children: [ // 1. Cabecera con Nombre del Doctor y Badge Sutil de Hidalyx Med @@ -170,22 +168,25 @@ class DoctorReferralPdfService { ), pw.SizedBox(height: 8), - // 2. Contenido del Referimiento (Idéntico a AlfaMedical con fontSize 13-14) - pw.Container( - padding: const pw.EdgeInsets.symmetric(vertical: 6), - child: pw.Text( - referralText.trim().isNotEmpty - ? referralText.trim() - : 'Sin detalles de referimiento.', - style: pw.TextStyle( - font: regular, - fontSize: 10.5, - lineSpacing: 3.5, - color: PdfColor.fromHex('1E293B'), + // 2. Contenido del Referimiento (ocupa el espacio central disponible) + pw.Expanded( + child: pw.Container( + alignment: pw.Alignment.topLeft, + padding: const pw.EdgeInsets.symmetric(vertical: 4), + child: pw.Text( + referralText.trim().isNotEmpty + ? referralText.trim() + : 'Sin detalles de referimiento.', + style: pw.TextStyle( + font: regular, + fontSize: 10.5, + lineSpacing: 3.5, + color: PdfColor.fromHex('1E293B'), + ), ), ), ), - pw.SizedBox(height: 10), + pw.SizedBox(height: 6), // Línea divisoria decorativa previa al pie pw.Container(