fix(pdf): maintain exact media-carta height and anchor footer for short clinical texts
This commit is contained in:
@@ -73,13 +73,11 @@ class InsuranceAuthPdfService {
|
|||||||
return pw.Column(
|
return pw.Column(
|
||||||
crossAxisAlignment: pw.CrossAxisAlignment.stretch,
|
crossAxisAlignment: pw.CrossAxisAlignment.stretch,
|
||||||
children: [
|
children: [
|
||||||
// Mitad superior de la hoja (máximo 5.5 pulgadas / 396 pt)
|
// Mitad superior de la hoja: altura fija de media carta (5.5 pulgadas / 396 pt)
|
||||||
pw.ConstrainedBox(
|
// para que el pie de página siempre quede anclado al final de la media hoja.
|
||||||
constraints: const pw.BoxConstraints(
|
pw.SizedBox(
|
||||||
maxHeight: 5.5 * PdfPageFormat.inch - 32,
|
height: 5.5 * PdfPageFormat.inch - 32,
|
||||||
),
|
|
||||||
child: pw.Column(
|
child: pw.Column(
|
||||||
mainAxisSize: pw.MainAxisSize.min,
|
|
||||||
crossAxisAlignment: pw.CrossAxisAlignment.stretch,
|
crossAxisAlignment: pw.CrossAxisAlignment.stretch,
|
||||||
children: [
|
children: [
|
||||||
// 1. Cabecera con Nombre del Doctor y Badge Sutil de Hidalyx Med
|
// 1. Cabecera con Nombre del Doctor y Badge Sutil de Hidalyx Med
|
||||||
@@ -209,11 +207,11 @@ class InsuranceAuthPdfService {
|
|||||||
),
|
),
|
||||||
pw.SizedBox(height: 8),
|
pw.SizedBox(height: 8),
|
||||||
|
|
||||||
// 3. Contenido Formal idéntico a AlfaMedical
|
// 3. Contenido Formal idéntico a AlfaMedical (ocupa el espacio central disponible)
|
||||||
pw.Column(
|
pw.Expanded(
|
||||||
crossAxisAlignment: pw.CrossAxisAlignment.stretch,
|
child: pw.Column(
|
||||||
mainAxisSize: pw.MainAxisSize.min,
|
crossAxisAlignment: pw.CrossAxisAlignment.stretch,
|
||||||
children: [
|
children: [
|
||||||
// Señores ARS
|
// Señores ARS
|
||||||
pw.RichText(
|
pw.RichText(
|
||||||
text: pw.TextSpan(
|
text: pw.TextSpan(
|
||||||
@@ -314,7 +312,8 @@ class InsuranceAuthPdfService {
|
|||||||
],
|
],
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
pw.SizedBox(height: 10),
|
),
|
||||||
|
pw.SizedBox(height: 6),
|
||||||
|
|
||||||
// Línea divisoria decorativa previa al pie
|
// Línea divisoria decorativa previa al pie
|
||||||
pw.Container(
|
pw.Container(
|
||||||
|
|||||||
@@ -70,13 +70,11 @@ class PrescriptionPdfService {
|
|||||||
return pw.Column(
|
return pw.Column(
|
||||||
crossAxisAlignment: pw.CrossAxisAlignment.stretch,
|
crossAxisAlignment: pw.CrossAxisAlignment.stretch,
|
||||||
children: [
|
children: [
|
||||||
// Mitad superior de la hoja (máximo 5.5 pulgadas / 396 pt)
|
// Mitad superior de la hoja: altura fija de media carta (5.5 pulgadas / 396 pt)
|
||||||
pw.ConstrainedBox(
|
// para que el pie de página siempre quede anclado al final de la media hoja.
|
||||||
constraints: const pw.BoxConstraints(
|
pw.SizedBox(
|
||||||
maxHeight: 5.5 * PdfPageFormat.inch - 32,
|
height: 5.5 * PdfPageFormat.inch - 32,
|
||||||
),
|
|
||||||
child: pw.Column(
|
child: pw.Column(
|
||||||
mainAxisSize: pw.MainAxisSize.min,
|
|
||||||
crossAxisAlignment: pw.CrossAxisAlignment.stretch,
|
crossAxisAlignment: pw.CrossAxisAlignment.stretch,
|
||||||
children: [
|
children: [
|
||||||
// 1. Cabecera con Nombre del Doctor y Badge Superior de Hidalyx Med
|
// 1. Cabecera con Nombre del Doctor y Badge Superior de Hidalyx Med
|
||||||
@@ -221,22 +219,25 @@ class PrescriptionPdfService {
|
|||||||
),
|
),
|
||||||
pw.SizedBox(height: 8),
|
pw.SizedBox(height: 8),
|
||||||
|
|
||||||
// 3. Contenido de la Receta / Prescripción Médica
|
// 3. Contenido de la Receta / Prescripción Médica (ocupa el espacio central disponible)
|
||||||
pw.Container(
|
pw.Expanded(
|
||||||
padding: const pw.EdgeInsets.symmetric(vertical: 6),
|
child: pw.Container(
|
||||||
child: pw.Text(
|
alignment: pw.Alignment.topLeft,
|
||||||
prescriptionText.trim().isNotEmpty
|
padding: const pw.EdgeInsets.symmetric(vertical: 4),
|
||||||
? prescriptionText.trim()
|
child: pw.Text(
|
||||||
: 'Sin prescripciones anotadas.',
|
prescriptionText.trim().isNotEmpty
|
||||||
style: pw.TextStyle(
|
? prescriptionText.trim()
|
||||||
font: regular,
|
: 'Sin prescripciones anotadas.',
|
||||||
fontSize: 10,
|
style: pw.TextStyle(
|
||||||
lineSpacing: 3,
|
font: regular,
|
||||||
color: PdfColor.fromHex('1E293B'),
|
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
|
// Línea sutil previa al pie de página
|
||||||
pw.Container(
|
pw.Container(
|
||||||
|
|||||||
@@ -68,13 +68,11 @@ class DepartmentReferralPdfService {
|
|||||||
return pw.Column(
|
return pw.Column(
|
||||||
crossAxisAlignment: pw.CrossAxisAlignment.stretch,
|
crossAxisAlignment: pw.CrossAxisAlignment.stretch,
|
||||||
children: [
|
children: [
|
||||||
// Mitad superior de la hoja (máximo 5.5 pulgadas / 396 pt)
|
// Mitad superior de la hoja: altura fija de media carta (5.5 pulgadas / 396 pt)
|
||||||
pw.ConstrainedBox(
|
// para que el pie de página siempre quede anclado al final de la media hoja.
|
||||||
constraints: const pw.BoxConstraints(
|
pw.SizedBox(
|
||||||
maxHeight: 5.5 * PdfPageFormat.inch - 32,
|
height: 5.5 * PdfPageFormat.inch - 32,
|
||||||
),
|
|
||||||
child: pw.Column(
|
child: pw.Column(
|
||||||
mainAxisSize: pw.MainAxisSize.min,
|
|
||||||
crossAxisAlignment: pw.CrossAxisAlignment.stretch,
|
crossAxisAlignment: pw.CrossAxisAlignment.stretch,
|
||||||
children: [
|
children: [
|
||||||
// 1. Cabecera con Nombre del Doctor y Badge Sutil de Hidalyx Med
|
// 1. Cabecera con Nombre del Doctor y Badge Sutil de Hidalyx Med
|
||||||
@@ -170,22 +168,25 @@ class DepartmentReferralPdfService {
|
|||||||
),
|
),
|
||||||
pw.SizedBox(height: 8),
|
pw.SizedBox(height: 8),
|
||||||
|
|
||||||
// 2. Contenido del Referimiento (Idéntico a AlfaMedical)
|
// 2. Contenido del Referimiento (ocupa el espacio central disponible)
|
||||||
pw.Container(
|
pw.Expanded(
|
||||||
padding: const pw.EdgeInsets.symmetric(vertical: 6),
|
child: pw.Container(
|
||||||
child: pw.Text(
|
alignment: pw.Alignment.topLeft,
|
||||||
referralText.trim().isNotEmpty
|
padding: const pw.EdgeInsets.symmetric(vertical: 4),
|
||||||
? referralText.trim()
|
child: pw.Text(
|
||||||
: 'Sin detalles de referimiento.',
|
referralText.trim().isNotEmpty
|
||||||
style: pw.TextStyle(
|
? referralText.trim()
|
||||||
font: regular,
|
: 'Sin detalles de referimiento.',
|
||||||
fontSize: 10.5,
|
style: pw.TextStyle(
|
||||||
lineSpacing: 3.5,
|
font: regular,
|
||||||
color: PdfColor.fromHex('1E293B'),
|
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
|
// Línea divisoria decorativa previa al pie
|
||||||
pw.Container(
|
pw.Container(
|
||||||
|
|||||||
@@ -68,13 +68,11 @@ class DoctorReferralPdfService {
|
|||||||
return pw.Column(
|
return pw.Column(
|
||||||
crossAxisAlignment: pw.CrossAxisAlignment.stretch,
|
crossAxisAlignment: pw.CrossAxisAlignment.stretch,
|
||||||
children: [
|
children: [
|
||||||
// Mitad superior de la hoja (máximo 5.5 pulgadas / 396 pt)
|
// Mitad superior de la hoja: altura fija de media carta (5.5 pulgadas / 396 pt)
|
||||||
pw.ConstrainedBox(
|
// para que el pie de página siempre quede anclado al final de la media hoja.
|
||||||
constraints: const pw.BoxConstraints(
|
pw.SizedBox(
|
||||||
maxHeight: 5.5 * PdfPageFormat.inch - 32,
|
height: 5.5 * PdfPageFormat.inch - 32,
|
||||||
),
|
|
||||||
child: pw.Column(
|
child: pw.Column(
|
||||||
mainAxisSize: pw.MainAxisSize.min,
|
|
||||||
crossAxisAlignment: pw.CrossAxisAlignment.stretch,
|
crossAxisAlignment: pw.CrossAxisAlignment.stretch,
|
||||||
children: [
|
children: [
|
||||||
// 1. Cabecera con Nombre del Doctor y Badge Sutil de Hidalyx Med
|
// 1. Cabecera con Nombre del Doctor y Badge Sutil de Hidalyx Med
|
||||||
@@ -170,22 +168,25 @@ class DoctorReferralPdfService {
|
|||||||
),
|
),
|
||||||
pw.SizedBox(height: 8),
|
pw.SizedBox(height: 8),
|
||||||
|
|
||||||
// 2. Contenido del Referimiento (Idéntico a AlfaMedical con fontSize 13-14)
|
// 2. Contenido del Referimiento (ocupa el espacio central disponible)
|
||||||
pw.Container(
|
pw.Expanded(
|
||||||
padding: const pw.EdgeInsets.symmetric(vertical: 6),
|
child: pw.Container(
|
||||||
child: pw.Text(
|
alignment: pw.Alignment.topLeft,
|
||||||
referralText.trim().isNotEmpty
|
padding: const pw.EdgeInsets.symmetric(vertical: 4),
|
||||||
? referralText.trim()
|
child: pw.Text(
|
||||||
: 'Sin detalles de referimiento.',
|
referralText.trim().isNotEmpty
|
||||||
style: pw.TextStyle(
|
? referralText.trim()
|
||||||
font: regular,
|
: 'Sin detalles de referimiento.',
|
||||||
fontSize: 10.5,
|
style: pw.TextStyle(
|
||||||
lineSpacing: 3.5,
|
font: regular,
|
||||||
color: PdfColor.fromHex('1E293B'),
|
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
|
// Línea divisoria decorativa previa al pie
|
||||||
pw.Container(
|
pw.Container(
|
||||||
|
|||||||
Reference in New Issue
Block a user