feat(clinical-docs): expand writing canvas and optimize height for insurance auth and referral modals
This commit is contained in:
@@ -103,12 +103,15 @@ class _DepartmentReferralModalViewState extends State<DepartmentReferralModalVie
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final formattedDate = DateFormat('dd/MM/yyyy').format(DateTime.now());
|
||||
final mediaQuery = MediaQuery.sizeOf(context);
|
||||
final modalHeight = (mediaQuery.height * 0.90).clamp(650.0, 780.0);
|
||||
final modalWidth = (mediaQuery.width * 0.90).clamp(840.0, 920.0);
|
||||
|
||||
return Observer(
|
||||
builder: (_) {
|
||||
return MedicalModalDialog(
|
||||
maxWidth: 820,
|
||||
maxHeight: 650,
|
||||
maxWidth: modalWidth,
|
||||
maxHeight: modalHeight,
|
||||
title: 'Referir a Departamento',
|
||||
titleIcon: Container(
|
||||
padding: const EdgeInsets.all(8),
|
||||
@@ -215,105 +218,124 @@ class _DepartmentReferralModalViewState extends State<DepartmentReferralModalVie
|
||||
],
|
||||
),
|
||||
),
|
||||
child: SingleChildScrollView(
|
||||
padding: const EdgeInsets.all(20),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: [
|
||||
// Membrete Informativo del Médico
|
||||
Container(
|
||||
padding: const EdgeInsets.all(14),
|
||||
decoration: BoxDecoration(
|
||||
color: const Color(0xFFF8FAFC),
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
border: Border.all(color: const Color(0xFFE2E8F0)),
|
||||
child: LayoutBuilder(
|
||||
builder: (context, constraints) {
|
||||
final isCompact = constraints.maxHeight < 420;
|
||||
|
||||
final textField = TextField(
|
||||
controller: _referralController,
|
||||
maxLines: isCompact ? 10 : null,
|
||||
minLines: isCompact ? 5 : null,
|
||||
expands: !isCompact,
|
||||
textAlignVertical: TextAlignVertical.top,
|
||||
style: const TextStyle(fontSize: 13.5, height: 1.5, color: AppColors.textPrimary),
|
||||
decoration: InputDecoration(
|
||||
hintText: 'Redacte el referimiento a departamento...',
|
||||
filled: true,
|
||||
fillColor: Colors.white,
|
||||
contentPadding: const EdgeInsets.all(16),
|
||||
border: OutlineInputBorder(borderRadius: BorderRadius.circular(10)),
|
||||
enabledBorder: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
borderSide: const BorderSide(color: Color(0xFFE2E8F0)),
|
||||
),
|
||||
child: Column(
|
||||
children: [
|
||||
Text(
|
||||
_configStore.nombreDoctor.isNotEmpty
|
||||
? _configStore.nombreDoctor
|
||||
: 'Dr. Luis A. Castro Sosa',
|
||||
textAlign: TextAlign.center,
|
||||
style: const TextStyle(
|
||||
fontSize: 18,
|
||||
fontWeight: FontWeight.w700,
|
||||
color: AppColors.textPrimary,
|
||||
letterSpacing: -0.3,
|
||||
),
|
||||
),
|
||||
if (_configStore.especialidad.isNotEmpty) ...[
|
||||
const SizedBox(height: 2),
|
||||
focusedBorder: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
borderSide: const BorderSide(color: AppColors.primary, width: 1.5),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
final bodyContent = Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: [
|
||||
// Membrete Informativo del Médico
|
||||
Container(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 10),
|
||||
decoration: BoxDecoration(
|
||||
color: const Color(0xFFF8FAFC),
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
border: Border.all(color: const Color(0xFFE2E8F0)),
|
||||
),
|
||||
child: Column(
|
||||
children: [
|
||||
Text(
|
||||
_configStore.especialidad.toUpperCase(),
|
||||
_configStore.nombreDoctor.isNotEmpty
|
||||
? _configStore.nombreDoctor
|
||||
: 'Dr. Luis A. Castro Sosa',
|
||||
textAlign: TextAlign.center,
|
||||
style: const TextStyle(
|
||||
fontSize: 11.5,
|
||||
fontWeight: FontWeight.w600,
|
||||
color: AppColors.primary,
|
||||
letterSpacing: 0.5,
|
||||
fontSize: 17,
|
||||
fontWeight: FontWeight.w700,
|
||||
color: AppColors.textPrimary,
|
||||
letterSpacing: -0.3,
|
||||
),
|
||||
),
|
||||
if (_configStore.especialidad.isNotEmpty) ...[
|
||||
const SizedBox(height: 2),
|
||||
Text(
|
||||
_configStore.especialidad.toUpperCase(),
|
||||
textAlign: TextAlign.center,
|
||||
style: const TextStyle(
|
||||
fontSize: 11,
|
||||
fontWeight: FontWeight.w600,
|
||||
color: AppColors.primary,
|
||||
letterSpacing: 0.5,
|
||||
),
|
||||
),
|
||||
],
|
||||
if (_configStore.descripEspecialidad.isNotEmpty) ...[
|
||||
const SizedBox(height: 1),
|
||||
Text(
|
||||
_configStore.descripEspecialidad.toUpperCase(),
|
||||
textAlign: TextAlign.center,
|
||||
style: const TextStyle(
|
||||
fontSize: 9.5,
|
||||
color: AppColors.textMuted,
|
||||
),
|
||||
),
|
||||
],
|
||||
const SizedBox(height: 3),
|
||||
Text(
|
||||
'Fecha: $formattedDate',
|
||||
style: const TextStyle(
|
||||
fontSize: 10.5,
|
||||
fontWeight: FontWeight.w500,
|
||||
color: AppColors.textSecondary,
|
||||
),
|
||||
),
|
||||
],
|
||||
if (_configStore.descripEspecialidad.isNotEmpty) ...[
|
||||
const SizedBox(height: 2),
|
||||
Text(
|
||||
_configStore.descripEspecialidad.toUpperCase(),
|
||||
textAlign: TextAlign.center,
|
||||
style: const TextStyle(
|
||||
fontSize: 10,
|
||||
color: AppColors.textMuted,
|
||||
),
|
||||
),
|
||||
],
|
||||
const SizedBox(height: 4),
|
||||
Text(
|
||||
'Fecha: $formattedDate',
|
||||
style: const TextStyle(
|
||||
fontSize: 11,
|
||||
fontWeight: FontWeight.w500,
|
||||
color: AppColors.textSecondary,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
|
||||
const Text(
|
||||
'Detalle del Referimiento a Departamento:',
|
||||
style: TextStyle(
|
||||
fontSize: 13,
|
||||
fontWeight: FontWeight.w700,
|
||||
color: AppColors.textPrimary,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
|
||||
// Área de texto multilínea idéntica a ScrolledText de AlfaMedical
|
||||
TextField(
|
||||
controller: _referralController,
|
||||
maxLines: 12,
|
||||
minLines: 9,
|
||||
style: const TextStyle(fontSize: 13.5, height: 1.5, color: AppColors.textPrimary),
|
||||
decoration: InputDecoration(
|
||||
hintText: 'Redacte el referimiento a departamento...',
|
||||
filled: true,
|
||||
fillColor: Colors.white,
|
||||
contentPadding: const EdgeInsets.all(16),
|
||||
border: OutlineInputBorder(borderRadius: BorderRadius.circular(10)),
|
||||
enabledBorder: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
borderSide: const BorderSide(color: Color(0xFFE2E8F0)),
|
||||
),
|
||||
focusedBorder: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
borderSide: const BorderSide(color: AppColors.primary, width: 1.5),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
|
||||
const Text(
|
||||
'Detalle del Referimiento a Departamento:',
|
||||
style: TextStyle(
|
||||
fontSize: 13,
|
||||
fontWeight: FontWeight.w700,
|
||||
color: AppColors.textPrimary,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
|
||||
// Área de texto multilínea que se expande para rellenar todo el espacio inferior
|
||||
if (isCompact) textField else Expanded(child: textField),
|
||||
],
|
||||
);
|
||||
|
||||
if (isCompact) {
|
||||
return SingleChildScrollView(
|
||||
padding: const EdgeInsets.all(16),
|
||||
child: bodyContent,
|
||||
);
|
||||
}
|
||||
|
||||
return Padding(
|
||||
padding: const EdgeInsets.fromLTRB(20, 14, 20, 16),
|
||||
child: bodyContent,
|
||||
);
|
||||
},
|
||||
),
|
||||
);
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user