feat(clinical-docs): expand writing canvas and optimize height for insurance auth and referral modals
This commit is contained in:
@@ -159,12 +159,15 @@ class _InsuranceAuthModalViewState extends State<InsuranceAuthModalView> {
|
|||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
final formattedDate = DateFormat('dd/MM/yyyy').format(DateTime.now());
|
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(
|
return Observer(
|
||||||
builder: (_) {
|
builder: (_) {
|
||||||
return MedicalModalDialog(
|
return MedicalModalDialog(
|
||||||
maxWidth: 820,
|
maxWidth: modalWidth,
|
||||||
maxHeight: 650,
|
maxHeight: modalHeight,
|
||||||
title: 'Autorización De Seguro (ARS)',
|
title: 'Autorización De Seguro (ARS)',
|
||||||
titleIcon: Container(
|
titleIcon: Container(
|
||||||
padding: const EdgeInsets.all(8),
|
padding: const EdgeInsets.all(8),
|
||||||
@@ -271,260 +274,285 @@ class _InsuranceAuthModalViewState extends State<InsuranceAuthModalView> {
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
child: SingleChildScrollView(
|
child: LayoutBuilder(
|
||||||
padding: const EdgeInsets.all(20),
|
builder: (context, constraints) {
|
||||||
child: Column(
|
final isCompact = constraints.maxHeight < 460;
|
||||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
|
||||||
children: [
|
final surgeryField = TextField(
|
||||||
// Membrete Informativo del Médico
|
controller: _surgeryController,
|
||||||
Container(
|
maxLines: isCompact ? 3 : null,
|
||||||
padding: const EdgeInsets.all(14),
|
minLines: isCompact ? 2 : null,
|
||||||
decoration: BoxDecoration(
|
expands: !isCompact,
|
||||||
color: const Color(0xFFF8FAFC),
|
textAlignVertical: TextAlignVertical.top,
|
||||||
borderRadius: BorderRadius.circular(12),
|
style: const TextStyle(fontSize: 13, height: 1.4),
|
||||||
border: Border.all(color: const Color(0xFFE2E8F0)),
|
decoration: InputDecoration(
|
||||||
|
labelText: 'La cirugía de: *',
|
||||||
|
hintText: 'Especifique el procedimiento quirúrgico o intervención (ej. Ureterolitotomía endoscópica láser, Biopsia de próstata...)',
|
||||||
|
floatingLabelBehavior: FloatingLabelBehavior.always,
|
||||||
|
filled: true,
|
||||||
|
fillColor: Colors.white,
|
||||||
|
contentPadding: const EdgeInsets.all(12),
|
||||||
|
border: OutlineInputBorder(borderRadius: BorderRadius.circular(8)),
|
||||||
|
enabledBorder: OutlineInputBorder(
|
||||||
|
borderRadius: BorderRadius.circular(8),
|
||||||
|
borderSide: const BorderSide(color: Color(0xFFE2E8F0)),
|
||||||
),
|
),
|
||||||
child: Column(
|
focusedBorder: OutlineInputBorder(
|
||||||
|
borderRadius: BorderRadius.circular(8),
|
||||||
|
borderSide: const BorderSide(color: AppColors.primary, width: 1.5),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
|
final diagnosisField = TextField(
|
||||||
|
controller: _diagnosisController,
|
||||||
|
maxLines: isCompact ? 3 : null,
|
||||||
|
minLines: isCompact ? 2 : null,
|
||||||
|
expands: !isCompact,
|
||||||
|
textAlignVertical: TextAlignVertical.top,
|
||||||
|
style: const TextStyle(fontSize: 13, height: 1.4),
|
||||||
|
decoration: InputDecoration(
|
||||||
|
labelText: 'Diagnóstico: *',
|
||||||
|
hintText: 'Diagnóstico principal, patología o hallazgo clínico que justifica la cirugía...',
|
||||||
|
floatingLabelBehavior: FloatingLabelBehavior.always,
|
||||||
|
filled: true,
|
||||||
|
fillColor: Colors.white,
|
||||||
|
contentPadding: const EdgeInsets.all(12),
|
||||||
|
border: OutlineInputBorder(borderRadius: BorderRadius.circular(8)),
|
||||||
|
enabledBorder: OutlineInputBorder(
|
||||||
|
borderRadius: BorderRadius.circular(8),
|
||||||
|
borderSide: const BorderSide(color: Color(0xFFE2E8F0)),
|
||||||
|
),
|
||||||
|
focusedBorder: OutlineInputBorder(
|
||||||
|
borderRadius: BorderRadius.circular(8),
|
||||||
|
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.nombreDoctor.isNotEmpty
|
||||||
|
? _configStore.nombreDoctor
|
||||||
|
: 'Dr. Luis A. Castro Sosa',
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
style: const TextStyle(
|
||||||
|
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,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const SizedBox(height: 10),
|
||||||
|
|
||||||
|
// Fila 1: Señores ARS y Paciente (Favor autorizar al Sr. a)
|
||||||
|
Row(
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Expanded(
|
||||||
_configStore.nombreDoctor.isNotEmpty
|
flex: 5,
|
||||||
? _configStore.nombreDoctor
|
child: Autocomplete<String>(
|
||||||
: 'Dr. Luis A. Castro Sosa',
|
initialValue: TextEditingValue(text: _arsController.text),
|
||||||
textAlign: TextAlign.center,
|
optionsBuilder: (textEditingValue) {
|
||||||
style: const TextStyle(
|
if (textEditingValue.text.isEmpty) {
|
||||||
fontSize: 18,
|
return arsList;
|
||||||
fontWeight: FontWeight.w700,
|
}
|
||||||
color: AppColors.textPrimary,
|
return arsList.where((ars) => ars
|
||||||
letterSpacing: -0.3,
|
.toLowerCase()
|
||||||
|
.contains(textEditingValue.text.toLowerCase()));
|
||||||
|
},
|
||||||
|
onSelected: (selection) => _arsController.text = selection,
|
||||||
|
fieldViewBuilder: (context, controller, focusNode, onEditingComplete) {
|
||||||
|
controller.addListener(() {
|
||||||
|
_arsController.text = controller.text;
|
||||||
|
});
|
||||||
|
return TextField(
|
||||||
|
controller: controller,
|
||||||
|
focusNode: focusNode,
|
||||||
|
onEditingComplete: onEditingComplete,
|
||||||
|
decoration: InputDecoration(
|
||||||
|
labelText: 'Señores ARS *',
|
||||||
|
hintText: 'Seleccione o escriba la ARS',
|
||||||
|
isDense: true,
|
||||||
|
floatingLabelBehavior: FloatingLabelBehavior.always,
|
||||||
|
filled: true,
|
||||||
|
fillColor: Colors.white,
|
||||||
|
prefixIcon: const Icon(Icons.security_rounded, size: 18, color: AppColors.primary),
|
||||||
|
contentPadding: const EdgeInsets.symmetric(horizontal: 12, vertical: 10),
|
||||||
|
border: OutlineInputBorder(borderRadius: BorderRadius.circular(8)),
|
||||||
|
enabledBorder: OutlineInputBorder(
|
||||||
|
borderRadius: BorderRadius.circular(8),
|
||||||
|
borderSide: const BorderSide(color: Color(0xFFE2E8F0)),
|
||||||
|
),
|
||||||
|
focusedBorder: OutlineInputBorder(
|
||||||
|
borderRadius: BorderRadius.circular(8),
|
||||||
|
borderSide: const BorderSide(color: AppColors.primary, width: 1.5),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
style: const TextStyle(fontSize: 12.5, fontWeight: FontWeight.w600),
|
||||||
|
);
|
||||||
|
},
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
if (_configStore.especialidad.isNotEmpty) ...[
|
const SizedBox(width: 12),
|
||||||
const SizedBox(height: 2),
|
Expanded(
|
||||||
Text(
|
flex: 5,
|
||||||
_configStore.especialidad.toUpperCase(),
|
child: TextField(
|
||||||
textAlign: TextAlign.center,
|
controller: _patientController,
|
||||||
style: const TextStyle(
|
decoration: InputDecoration(
|
||||||
fontSize: 11.5,
|
labelText: 'Favor autorizar al Sr. (a) *',
|
||||||
fontWeight: FontWeight.w600,
|
hintText: 'Nombre del paciente',
|
||||||
color: AppColors.primary,
|
isDense: true,
|
||||||
letterSpacing: 0.5,
|
floatingLabelBehavior: FloatingLabelBehavior.always,
|
||||||
|
filled: true,
|
||||||
|
fillColor: Colors.white,
|
||||||
|
prefixIcon: const Icon(Icons.person_outline_rounded, size: 18, color: AppColors.primary),
|
||||||
|
contentPadding: const EdgeInsets.symmetric(horizontal: 12, vertical: 10),
|
||||||
|
border: OutlineInputBorder(borderRadius: BorderRadius.circular(8)),
|
||||||
|
enabledBorder: OutlineInputBorder(
|
||||||
|
borderRadius: BorderRadius.circular(8),
|
||||||
|
borderSide: const BorderSide(color: Color(0xFFE2E8F0)),
|
||||||
|
),
|
||||||
|
focusedBorder: OutlineInputBorder(
|
||||||
|
borderRadius: BorderRadius.circular(8),
|
||||||
|
borderSide: const BorderSide(color: AppColors.primary, width: 1.5),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
style: const TextStyle(fontSize: 12.5, fontWeight: FontWeight.w600),
|
||||||
],
|
|
||||||
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: 10),
|
||||||
const SizedBox(height: 16),
|
|
||||||
|
|
||||||
// Fila 1: Señores ARS y Paciente (Favor autorizar al Sr. a)
|
// Campo: La cirugía de:
|
||||||
Row(
|
if (isCompact) surgeryField else Expanded(flex: 1, child: surgeryField),
|
||||||
children: [
|
const SizedBox(height: 10),
|
||||||
Expanded(
|
|
||||||
flex: 5,
|
// Campo: Diagnóstico:
|
||||||
child: Autocomplete<String>(
|
if (isCompact) diagnosisField else Expanded(flex: 1, child: diagnosisField),
|
||||||
initialValue: TextEditingValue(text: _arsController.text),
|
const SizedBox(height: 10),
|
||||||
optionsBuilder: (textEditingValue) {
|
|
||||||
if (textEditingValue.text.isEmpty) {
|
// Fila 3: Bajo Anestesia y Días de ingreso
|
||||||
return arsList;
|
Row(
|
||||||
}
|
children: [
|
||||||
return arsList.where((ars) => ars
|
Expanded(
|
||||||
.toLowerCase()
|
flex: 6,
|
||||||
.contains(textEditingValue.text.toLowerCase()));
|
child: TextField(
|
||||||
},
|
controller: _anesthesiaController,
|
||||||
onSelected: (selection) => _arsController.text = selection,
|
decoration: InputDecoration(
|
||||||
fieldViewBuilder: (context, controller, focusNode, onEditingComplete) {
|
labelText: 'Bajo Anestesia',
|
||||||
controller.addListener(() {
|
hintText: 'General, Raquídea, Sedación, Local...',
|
||||||
_arsController.text = controller.text;
|
isDense: true,
|
||||||
});
|
floatingLabelBehavior: FloatingLabelBehavior.always,
|
||||||
return TextField(
|
filled: true,
|
||||||
controller: controller,
|
fillColor: Colors.white,
|
||||||
focusNode: focusNode,
|
prefixIcon: const Icon(Icons.vaccines_outlined, size: 18, color: AppColors.primary),
|
||||||
onEditingComplete: onEditingComplete,
|
contentPadding: const EdgeInsets.symmetric(horizontal: 12, vertical: 10),
|
||||||
decoration: InputDecoration(
|
border: OutlineInputBorder(borderRadius: BorderRadius.circular(8)),
|
||||||
labelText: 'Señores ARS *',
|
enabledBorder: OutlineInputBorder(
|
||||||
hintText: 'Seleccione o escriba la ARS',
|
borderRadius: BorderRadius.circular(8),
|
||||||
isDense: true,
|
borderSide: const BorderSide(color: Color(0xFFE2E8F0)),
|
||||||
floatingLabelBehavior: FloatingLabelBehavior.always,
|
),
|
||||||
filled: true,
|
focusedBorder: OutlineInputBorder(
|
||||||
fillColor: Colors.white,
|
borderRadius: BorderRadius.circular(8),
|
||||||
prefixIcon: const Icon(Icons.security_rounded, size: 18, color: AppColors.primary),
|
borderSide: const BorderSide(color: AppColors.primary, width: 1.5),
|
||||||
contentPadding: const EdgeInsets.symmetric(horizontal: 12, vertical: 12),
|
|
||||||
border: OutlineInputBorder(borderRadius: BorderRadius.circular(8)),
|
|
||||||
enabledBorder: OutlineInputBorder(
|
|
||||||
borderRadius: BorderRadius.circular(8),
|
|
||||||
borderSide: const BorderSide(color: Color(0xFFE2E8F0)),
|
|
||||||
),
|
|
||||||
focusedBorder: OutlineInputBorder(
|
|
||||||
borderRadius: BorderRadius.circular(8),
|
|
||||||
borderSide: const BorderSide(color: AppColors.primary, width: 1.5),
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
style: const TextStyle(fontSize: 12.5, fontWeight: FontWeight.w600),
|
|
||||||
);
|
|
||||||
},
|
|
||||||
),
|
|
||||||
),
|
|
||||||
const SizedBox(width: 12),
|
|
||||||
Expanded(
|
|
||||||
flex: 5,
|
|
||||||
child: TextField(
|
|
||||||
controller: _patientController,
|
|
||||||
decoration: InputDecoration(
|
|
||||||
labelText: 'Favor autorizar al Sr. (a) *',
|
|
||||||
hintText: 'Nombre del paciente',
|
|
||||||
isDense: true,
|
|
||||||
floatingLabelBehavior: FloatingLabelBehavior.always,
|
|
||||||
filled: true,
|
|
||||||
fillColor: Colors.white,
|
|
||||||
prefixIcon: const Icon(Icons.person_outline_rounded, size: 18, color: AppColors.primary),
|
|
||||||
contentPadding: const EdgeInsets.symmetric(horizontal: 12, vertical: 12),
|
|
||||||
border: OutlineInputBorder(borderRadius: BorderRadius.circular(8)),
|
|
||||||
enabledBorder: OutlineInputBorder(
|
|
||||||
borderRadius: BorderRadius.circular(8),
|
|
||||||
borderSide: const BorderSide(color: Color(0xFFE2E8F0)),
|
|
||||||
),
|
|
||||||
focusedBorder: OutlineInputBorder(
|
|
||||||
borderRadius: BorderRadius.circular(8),
|
|
||||||
borderSide: const BorderSide(color: AppColors.primary, width: 1.5),
|
|
||||||
),
|
),
|
||||||
|
style: const TextStyle(fontSize: 12.5),
|
||||||
),
|
),
|
||||||
style: const TextStyle(fontSize: 12.5, fontWeight: FontWeight.w600),
|
|
||||||
),
|
),
|
||||||
),
|
const SizedBox(width: 12),
|
||||||
],
|
Expanded(
|
||||||
),
|
flex: 4,
|
||||||
const SizedBox(height: 14),
|
child: TextField(
|
||||||
|
controller: _daysController,
|
||||||
// Campo: La cirugía de:
|
decoration: InputDecoration(
|
||||||
TextField(
|
labelText: 'Días de ingreso',
|
||||||
controller: _surgeryController,
|
hintText: 'Ej. 1, 2, Ambulatorio',
|
||||||
maxLines: 3,
|
isDense: true,
|
||||||
style: const TextStyle(fontSize: 13, height: 1.4),
|
floatingLabelBehavior: FloatingLabelBehavior.always,
|
||||||
decoration: InputDecoration(
|
filled: true,
|
||||||
labelText: 'La cirugía de: *',
|
fillColor: Colors.white,
|
||||||
hintText: 'Especifique el procedimiento quirúrgico o intervención (ej. Ureterolitotomía endoscópica láser, Biopsia de próstata...)',
|
prefixIcon: const Icon(Icons.hotel_outlined, size: 18, color: AppColors.primary),
|
||||||
floatingLabelBehavior: FloatingLabelBehavior.always,
|
contentPadding: const EdgeInsets.symmetric(horizontal: 12, vertical: 10),
|
||||||
filled: true,
|
border: OutlineInputBorder(borderRadius: BorderRadius.circular(8)),
|
||||||
fillColor: Colors.white,
|
enabledBorder: OutlineInputBorder(
|
||||||
contentPadding: const EdgeInsets.all(12),
|
borderRadius: BorderRadius.circular(8),
|
||||||
border: OutlineInputBorder(borderRadius: BorderRadius.circular(8)),
|
borderSide: const BorderSide(color: Color(0xFFE2E8F0)),
|
||||||
enabledBorder: OutlineInputBorder(
|
),
|
||||||
borderRadius: BorderRadius.circular(8),
|
focusedBorder: OutlineInputBorder(
|
||||||
borderSide: const BorderSide(color: Color(0xFFE2E8F0)),
|
borderRadius: BorderRadius.circular(8),
|
||||||
),
|
borderSide: const BorderSide(color: AppColors.primary, width: 1.5),
|
||||||
focusedBorder: OutlineInputBorder(
|
),
|
||||||
borderRadius: BorderRadius.circular(8),
|
),
|
||||||
borderSide: const BorderSide(color: AppColors.primary, width: 1.5),
|
style: const TextStyle(fontSize: 12.5),
|
||||||
),
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
),
|
),
|
||||||
),
|
],
|
||||||
const SizedBox(height: 14),
|
);
|
||||||
|
|
||||||
// Campo: Diagnóstico:
|
if (isCompact) {
|
||||||
TextField(
|
return SingleChildScrollView(
|
||||||
controller: _diagnosisController,
|
padding: const EdgeInsets.all(16),
|
||||||
maxLines: 3,
|
child: bodyContent,
|
||||||
style: const TextStyle(fontSize: 13, height: 1.4),
|
);
|
||||||
decoration: InputDecoration(
|
}
|
||||||
labelText: 'Diagnóstico: *',
|
|
||||||
hintText: 'Diagnóstico principal, patología o hallazgo clínico que justifica la cirugía...',
|
|
||||||
floatingLabelBehavior: FloatingLabelBehavior.always,
|
|
||||||
filled: true,
|
|
||||||
fillColor: Colors.white,
|
|
||||||
contentPadding: const EdgeInsets.all(12),
|
|
||||||
border: OutlineInputBorder(borderRadius: BorderRadius.circular(8)),
|
|
||||||
enabledBorder: OutlineInputBorder(
|
|
||||||
borderRadius: BorderRadius.circular(8),
|
|
||||||
borderSide: const BorderSide(color: Color(0xFFE2E8F0)),
|
|
||||||
),
|
|
||||||
focusedBorder: OutlineInputBorder(
|
|
||||||
borderRadius: BorderRadius.circular(8),
|
|
||||||
borderSide: const BorderSide(color: AppColors.primary, width: 1.5),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
const SizedBox(height: 14),
|
|
||||||
|
|
||||||
// Fila 3: Bajo Anestesia y Días de ingreso
|
return Padding(
|
||||||
Row(
|
padding: const EdgeInsets.fromLTRB(20, 14, 20, 16),
|
||||||
children: [
|
child: bodyContent,
|
||||||
Expanded(
|
);
|
||||||
flex: 6,
|
},
|
||||||
child: TextField(
|
|
||||||
controller: _anesthesiaController,
|
|
||||||
decoration: InputDecoration(
|
|
||||||
labelText: 'Bajo Anestesia',
|
|
||||||
hintText: 'General, Raquídea, Sedación, Local...',
|
|
||||||
isDense: true,
|
|
||||||
floatingLabelBehavior: FloatingLabelBehavior.always,
|
|
||||||
filled: true,
|
|
||||||
fillColor: Colors.white,
|
|
||||||
prefixIcon: const Icon(Icons.vaccines_outlined, size: 18, color: AppColors.primary),
|
|
||||||
contentPadding: const EdgeInsets.symmetric(horizontal: 12, vertical: 12),
|
|
||||||
border: OutlineInputBorder(borderRadius: BorderRadius.circular(8)),
|
|
||||||
enabledBorder: OutlineInputBorder(
|
|
||||||
borderRadius: BorderRadius.circular(8),
|
|
||||||
borderSide: const BorderSide(color: Color(0xFFE2E8F0)),
|
|
||||||
),
|
|
||||||
focusedBorder: OutlineInputBorder(
|
|
||||||
borderRadius: BorderRadius.circular(8),
|
|
||||||
borderSide: const BorderSide(color: AppColors.primary, width: 1.5),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
style: const TextStyle(fontSize: 12.5),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
const SizedBox(width: 12),
|
|
||||||
Expanded(
|
|
||||||
flex: 4,
|
|
||||||
child: TextField(
|
|
||||||
controller: _daysController,
|
|
||||||
decoration: InputDecoration(
|
|
||||||
labelText: 'Días de ingreso',
|
|
||||||
hintText: 'Ej. 1, 2, Ambulatorio',
|
|
||||||
isDense: true,
|
|
||||||
floatingLabelBehavior: FloatingLabelBehavior.always,
|
|
||||||
filled: true,
|
|
||||||
fillColor: Colors.white,
|
|
||||||
prefixIcon: const Icon(Icons.hotel_outlined, size: 18, color: AppColors.primary),
|
|
||||||
contentPadding: const EdgeInsets.symmetric(horizontal: 12, vertical: 12),
|
|
||||||
border: OutlineInputBorder(borderRadius: BorderRadius.circular(8)),
|
|
||||||
enabledBorder: OutlineInputBorder(
|
|
||||||
borderRadius: BorderRadius.circular(8),
|
|
||||||
borderSide: const BorderSide(color: Color(0xFFE2E8F0)),
|
|
||||||
),
|
|
||||||
focusedBorder: OutlineInputBorder(
|
|
||||||
borderRadius: BorderRadius.circular(8),
|
|
||||||
borderSide: const BorderSide(color: AppColors.primary, width: 1.5),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
style: const TextStyle(fontSize: 12.5),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -103,12 +103,15 @@ class _DepartmentReferralModalViewState extends State<DepartmentReferralModalVie
|
|||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
final formattedDate = DateFormat('dd/MM/yyyy').format(DateTime.now());
|
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(
|
return Observer(
|
||||||
builder: (_) {
|
builder: (_) {
|
||||||
return MedicalModalDialog(
|
return MedicalModalDialog(
|
||||||
maxWidth: 820,
|
maxWidth: modalWidth,
|
||||||
maxHeight: 650,
|
maxHeight: modalHeight,
|
||||||
title: 'Referir a Departamento',
|
title: 'Referir a Departamento',
|
||||||
titleIcon: Container(
|
titleIcon: Container(
|
||||||
padding: const EdgeInsets.all(8),
|
padding: const EdgeInsets.all(8),
|
||||||
@@ -215,105 +218,124 @@ class _DepartmentReferralModalViewState extends State<DepartmentReferralModalVie
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
child: SingleChildScrollView(
|
child: LayoutBuilder(
|
||||||
padding: const EdgeInsets.all(20),
|
builder: (context, constraints) {
|
||||||
child: Column(
|
final isCompact = constraints.maxHeight < 420;
|
||||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
|
||||||
children: [
|
final textField = TextField(
|
||||||
// Membrete Informativo del Médico
|
controller: _referralController,
|
||||||
Container(
|
maxLines: isCompact ? 10 : null,
|
||||||
padding: const EdgeInsets.all(14),
|
minLines: isCompact ? 5 : null,
|
||||||
decoration: BoxDecoration(
|
expands: !isCompact,
|
||||||
color: const Color(0xFFF8FAFC),
|
textAlignVertical: TextAlignVertical.top,
|
||||||
borderRadius: BorderRadius.circular(12),
|
style: const TextStyle(fontSize: 13.5, height: 1.5, color: AppColors.textPrimary),
|
||||||
border: Border.all(color: const Color(0xFFE2E8F0)),
|
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(
|
focusedBorder: OutlineInputBorder(
|
||||||
children: [
|
borderRadius: BorderRadius.circular(10),
|
||||||
Text(
|
borderSide: const BorderSide(color: AppColors.primary, width: 1.5),
|
||||||
_configStore.nombreDoctor.isNotEmpty
|
),
|
||||||
? _configStore.nombreDoctor
|
),
|
||||||
: 'Dr. Luis A. Castro Sosa',
|
);
|
||||||
textAlign: TextAlign.center,
|
|
||||||
style: const TextStyle(
|
final bodyContent = Column(
|
||||||
fontSize: 18,
|
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||||
fontWeight: FontWeight.w700,
|
children: [
|
||||||
color: AppColors.textPrimary,
|
// Membrete Informativo del Médico
|
||||||
letterSpacing: -0.3,
|
Container(
|
||||||
),
|
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 10),
|
||||||
),
|
decoration: BoxDecoration(
|
||||||
if (_configStore.especialidad.isNotEmpty) ...[
|
color: const Color(0xFFF8FAFC),
|
||||||
const SizedBox(height: 2),
|
borderRadius: BorderRadius.circular(10),
|
||||||
|
border: Border.all(color: const Color(0xFFE2E8F0)),
|
||||||
|
),
|
||||||
|
child: Column(
|
||||||
|
children: [
|
||||||
Text(
|
Text(
|
||||||
_configStore.especialidad.toUpperCase(),
|
_configStore.nombreDoctor.isNotEmpty
|
||||||
|
? _configStore.nombreDoctor
|
||||||
|
: 'Dr. Luis A. Castro Sosa',
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
style: const TextStyle(
|
style: const TextStyle(
|
||||||
fontSize: 11.5,
|
fontSize: 17,
|
||||||
fontWeight: FontWeight.w600,
|
fontWeight: FontWeight.w700,
|
||||||
color: AppColors.primary,
|
color: AppColors.textPrimary,
|
||||||
letterSpacing: 0.5,
|
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,
|
||||||
|
);
|
||||||
|
},
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -102,12 +102,15 @@ class _DoctorReferralModalViewState extends State<DoctorReferralModalView> {
|
|||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
final formattedDate = DateFormat('dd/MM/yyyy').format(DateTime.now());
|
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(
|
return Observer(
|
||||||
builder: (_) {
|
builder: (_) {
|
||||||
return MedicalModalDialog(
|
return MedicalModalDialog(
|
||||||
maxWidth: 820,
|
maxWidth: modalWidth,
|
||||||
maxHeight: 650,
|
maxHeight: modalHeight,
|
||||||
title: 'Referir a Doctor (a)',
|
title: 'Referir a Doctor (a)',
|
||||||
titleIcon: Container(
|
titleIcon: Container(
|
||||||
padding: const EdgeInsets.all(8),
|
padding: const EdgeInsets.all(8),
|
||||||
@@ -214,105 +217,124 @@ class _DoctorReferralModalViewState extends State<DoctorReferralModalView> {
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
child: SingleChildScrollView(
|
child: LayoutBuilder(
|
||||||
padding: const EdgeInsets.all(20),
|
builder: (context, constraints) {
|
||||||
child: Column(
|
final isCompact = constraints.maxHeight < 420;
|
||||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
|
||||||
children: [
|
final textField = TextField(
|
||||||
// Membrete Informativo del Médico
|
controller: _referralController,
|
||||||
Container(
|
maxLines: isCompact ? 10 : null,
|
||||||
padding: const EdgeInsets.all(14),
|
minLines: isCompact ? 5 : null,
|
||||||
decoration: BoxDecoration(
|
expands: !isCompact,
|
||||||
color: const Color(0xFFF8FAFC),
|
textAlignVertical: TextAlignVertical.top,
|
||||||
borderRadius: BorderRadius.circular(12),
|
style: const TextStyle(fontSize: 13.5, height: 1.5, color: AppColors.textPrimary),
|
||||||
border: Border.all(color: const Color(0xFFE2E8F0)),
|
decoration: InputDecoration(
|
||||||
|
hintText: 'Redacte el referimiento médico...',
|
||||||
|
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(
|
focusedBorder: OutlineInputBorder(
|
||||||
children: [
|
borderRadius: BorderRadius.circular(10),
|
||||||
Text(
|
borderSide: const BorderSide(color: AppColors.primary, width: 1.5),
|
||||||
_configStore.nombreDoctor.isNotEmpty
|
),
|
||||||
? _configStore.nombreDoctor
|
),
|
||||||
: 'Dr. Luis A. Castro Sosa',
|
);
|
||||||
textAlign: TextAlign.center,
|
|
||||||
style: const TextStyle(
|
final bodyContent = Column(
|
||||||
fontSize: 18,
|
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||||
fontWeight: FontWeight.w700,
|
children: [
|
||||||
color: AppColors.textPrimary,
|
// Membrete Informativo del Médico
|
||||||
letterSpacing: -0.3,
|
Container(
|
||||||
),
|
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 10),
|
||||||
),
|
decoration: BoxDecoration(
|
||||||
if (_configStore.especialidad.isNotEmpty) ...[
|
color: const Color(0xFFF8FAFC),
|
||||||
const SizedBox(height: 2),
|
borderRadius: BorderRadius.circular(10),
|
||||||
|
border: Border.all(color: const Color(0xFFE2E8F0)),
|
||||||
|
),
|
||||||
|
child: Column(
|
||||||
|
children: [
|
||||||
Text(
|
Text(
|
||||||
_configStore.especialidad.toUpperCase(),
|
_configStore.nombreDoctor.isNotEmpty
|
||||||
|
? _configStore.nombreDoctor
|
||||||
|
: 'Dr. Luis A. Castro Sosa',
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
style: const TextStyle(
|
style: const TextStyle(
|
||||||
fontSize: 11.5,
|
fontSize: 17,
|
||||||
fontWeight: FontWeight.w600,
|
fontWeight: FontWeight.w700,
|
||||||
color: AppColors.primary,
|
color: AppColors.textPrimary,
|
||||||
letterSpacing: 0.5,
|
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 de la Interconsulta / Referimiento:',
|
|
||||||
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 médico...',
|
|
||||||
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 de la Interconsulta / Referimiento:',
|
||||||
|
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