fix(pdf): maintain exact media-carta height and anchor footer for short clinical texts
This commit is contained in:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user