|
|
|
|
@ -6,11 +6,15 @@ import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
|
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
import 'package:quiver/time.dart';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class PreviousChiefComplaints extends StatelessWidget {
|
|
|
|
|
final List<EpisodeByChiefComplaintVidaPlus> complaints;
|
|
|
|
|
final Function(List<PatientPomrs>)? onSendClicked;
|
|
|
|
|
PreviousChiefComplaints(this.complaints,this.onSendClicked, {super.key,});
|
|
|
|
|
final List<EpisodeByChiefComplaintVidaPlus> complaints;
|
|
|
|
|
final Function(ChiefComplains , String)? onSendClicked;
|
|
|
|
|
|
|
|
|
|
PreviousChiefComplaints(
|
|
|
|
|
this.complaints,
|
|
|
|
|
this.onSendClicked, {
|
|
|
|
|
super.key,
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
@ -28,13 +32,13 @@ class PreviousChiefComplaints extends StatelessWidget {
|
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
AppText(
|
|
|
|
|
TranslationBase.of(context).previousChiefCompaints,
|
|
|
|
|
textAlign: TextAlign.start,
|
|
|
|
|
fontWeight: FontWeight.w600,
|
|
|
|
|
fontSize: 16,
|
|
|
|
|
color: Color(0xFF2E303A),
|
|
|
|
|
),
|
|
|
|
|
Text(TranslationBase.of(context).previousChiefCompaints,
|
|
|
|
|
textAlign: TextAlign.start,
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
fontWeight: FontWeight.w600,
|
|
|
|
|
fontSize: 16,
|
|
|
|
|
color: Color(0xFF2E303A),
|
|
|
|
|
)),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 16,
|
|
|
|
|
),
|
|
|
|
|
@ -49,43 +53,102 @@ class PreviousChiefComplaints extends StatelessWidget {
|
|
|
|
|
height: 10,
|
|
|
|
|
),
|
|
|
|
|
Flexible(
|
|
|
|
|
child: ListView.separated(
|
|
|
|
|
child: ListView.builder(
|
|
|
|
|
shrinkWrap: true,
|
|
|
|
|
separatorBuilder: (context, index2) => Divider(),
|
|
|
|
|
itemCount: complaints.length,
|
|
|
|
|
physics: NeverScrollableScrollPhysics(),
|
|
|
|
|
itemBuilder: (context, index) {
|
|
|
|
|
return complaints[index].patientPomrs!.isNotEmpty ? ListOfComplaintsItem(
|
|
|
|
|
name: getChildValue(complaints[index].patientPomrs!, 1),
|
|
|
|
|
createdBy: getChildValue(complaints[index].patientPomrs!,2),
|
|
|
|
|
createdAt: getChildValue(complaints[index].patientPomrs!, 3),
|
|
|
|
|
onSendClick: () {
|
|
|
|
|
onSendClicked!(complaints[index].patientPomrs!);
|
|
|
|
|
}) :SizedBox();
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
)
|
|
|
|
|
return ListView.builder(
|
|
|
|
|
shrinkWrap: true,
|
|
|
|
|
physics: NeverScrollableScrollPhysics(),
|
|
|
|
|
itemCount:
|
|
|
|
|
complaints[index].patientPomrs?.length ?? 0,
|
|
|
|
|
itemBuilder: (context, pomrID) {
|
|
|
|
|
return ListView.separated(
|
|
|
|
|
shrinkWrap: true,
|
|
|
|
|
physics: NeverScrollableScrollPhysics(),
|
|
|
|
|
itemCount: complaints[index]
|
|
|
|
|
.patientPomrs?[pomrID]
|
|
|
|
|
.chiefComplains
|
|
|
|
|
?.length ??
|
|
|
|
|
0,
|
|
|
|
|
separatorBuilder: (context, _) => Column(
|
|
|
|
|
children: [
|
|
|
|
|
SizedBox(height: 10,),
|
|
|
|
|
Divider(),
|
|
|
|
|
SizedBox(height: 10,),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
itemBuilder: (context, cheifComplainIndex) {
|
|
|
|
|
return ListOfComplaintsItem(
|
|
|
|
|
name: complaints[index]
|
|
|
|
|
.patientPomrs![pomrID]
|
|
|
|
|
.chiefComplains?[
|
|
|
|
|
cheifComplainIndex]
|
|
|
|
|
.chiefComplain ??
|
|
|
|
|
'',
|
|
|
|
|
// createdBy: getChildValue(complaints[index].patientPomrs!,2),
|
|
|
|
|
createdBy: complaints[index]
|
|
|
|
|
.patientPomrs![pomrID]
|
|
|
|
|
.chiefComplains?[
|
|
|
|
|
cheifComplainIndex]
|
|
|
|
|
.createdBy ??
|
|
|
|
|
'',
|
|
|
|
|
createdAt: complaints[index]
|
|
|
|
|
.patientPomrs![pomrID]
|
|
|
|
|
.chiefComplains?[
|
|
|
|
|
cheifComplainIndex]
|
|
|
|
|
.createdOn ??
|
|
|
|
|
'',
|
|
|
|
|
onSendClick: () {
|
|
|
|
|
onSendClicked!(
|
|
|
|
|
complaints[index]
|
|
|
|
|
.patientPomrs![pomrID]
|
|
|
|
|
.chiefComplains![
|
|
|
|
|
cheifComplainIndex]
|
|
|
|
|
,complaints[index]
|
|
|
|
|
.patientPomrs?[pomrID].chiefComplainTemplateId?.toString() ??'');
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
// return Column(
|
|
|
|
|
// children: complaints[index].patientPomrs![pomrID].chiefComplains?.map((element)=>ListOfComplaintsItem(
|
|
|
|
|
// name: element.chiefComplain ?? '',
|
|
|
|
|
// // createdBy: getChildValue(complaints[index].patientPomrs!,2),
|
|
|
|
|
// createdBy: element.createdBy ?? '',
|
|
|
|
|
// createdAt: element.createdOn ?? '',
|
|
|
|
|
// onSendClick: () {
|
|
|
|
|
// onSendClicked!(complaints[index].patientPomrs!);
|
|
|
|
|
// })).toList()??[],
|
|
|
|
|
// );
|
|
|
|
|
},
|
|
|
|
|
);
|
|
|
|
|
// return complaints[index].patientPomrs!.isNotEmpty ? ListOfComplaintsItem(
|
|
|
|
|
// name: getChildValue(complaints[index].patientPomrs!, 1),
|
|
|
|
|
// createdBy: getChildValue(complaints[index].patientPomrs!,2),
|
|
|
|
|
// createdAt: getChildValue(complaints[index].patientPomrs!, 3),
|
|
|
|
|
// onSendClick: () {
|
|
|
|
|
// onSendClicked!(complaints[index].patientPomrs!);
|
|
|
|
|
// }) :SizedBox();
|
|
|
|
|
}))
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
));
|
|
|
|
|
}
|
|
|
|
|
String getChildValue(List<PatientPomrs>? patientPomrs, int key) {
|
|
|
|
|
List<String> value = [];
|
|
|
|
|
patientPomrs!.forEach((element) {
|
|
|
|
|
if(key ==1) {
|
|
|
|
|
element.chiefComplains!.forEach((element2) {
|
|
|
|
|
value.add(element2.chiefComplain!);
|
|
|
|
|
});
|
|
|
|
|
}else if(key ==2) {
|
|
|
|
|
value.add(element.doctorName!);
|
|
|
|
|
}else {
|
|
|
|
|
value.add(element.createdOn!);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
return value.join(" ");
|
|
|
|
|
}
|
|
|
|
|
String getChildValue(List<PatientPomrs>? patientPomrs, int key) {
|
|
|
|
|
List<String> value = [];
|
|
|
|
|
patientPomrs!.forEach((element) {
|
|
|
|
|
if (key == 1) {
|
|
|
|
|
element.chiefComplains!.forEach((element2) {
|
|
|
|
|
value.add(element2.chiefComplain!);
|
|
|
|
|
});
|
|
|
|
|
} else if (key == 2) {
|
|
|
|
|
value.add(element.doctorName!);
|
|
|
|
|
} else {
|
|
|
|
|
value.add(element.createdOn!);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
return value.join(" ");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|