|
|
|
@ -57,48 +57,48 @@ class _PatientSickleavesListPageState extends State<PatientSickleavesListPage> {
|
|
|
|
return Column(
|
|
|
|
return Column(
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
SizedBox(height: 16.h),
|
|
|
|
// SizedBox(height: 16.h),
|
|
|
|
// Clinic & Hospital Sort
|
|
|
|
// Clinic & Hospital Sort
|
|
|
|
Row(
|
|
|
|
// Row(
|
|
|
|
children: [
|
|
|
|
// children: [
|
|
|
|
CustomButton(
|
|
|
|
// CustomButton(
|
|
|
|
text: LocaleKeys.byClinic.tr(context: context),
|
|
|
|
// text: LocaleKeys.byClinic.tr(context: context),
|
|
|
|
onPressed: () {
|
|
|
|
// onPressed: () {
|
|
|
|
model.setIsSickLeavesSortByClinic(true);
|
|
|
|
// model.setIsSickLeavesSortByClinic(true);
|
|
|
|
},
|
|
|
|
// },
|
|
|
|
backgroundColor: model.isSickLeavesSortByClinic ? AppColors.bgRedLightColor : AppColors.whiteColor,
|
|
|
|
// backgroundColor: model.isSickLeavesSortByClinic ? AppColors.bgRedLightColor : AppColors.whiteColor,
|
|
|
|
borderColor: model.isSickLeavesSortByClinic ? AppColors.primaryRedColor : AppColors.textColor.withValues(alpha: 0.2),
|
|
|
|
// borderColor: model.isSickLeavesSortByClinic ? AppColors.primaryRedColor : AppColors.textColor.withValues(alpha: 0.2),
|
|
|
|
textColor: model.isSickLeavesSortByClinic ? AppColors.primaryRedColor : AppColors.blackColor,
|
|
|
|
// textColor: model.isSickLeavesSortByClinic ? AppColors.primaryRedColor : AppColors.blackColor,
|
|
|
|
fontSize: 12,
|
|
|
|
// fontSize: 12,
|
|
|
|
fontWeight: FontWeight.w500,
|
|
|
|
// fontWeight: FontWeight.w500,
|
|
|
|
borderRadius: 10,
|
|
|
|
// borderRadius: 10,
|
|
|
|
padding: EdgeInsets.fromLTRB(10, 0, 10, 0),
|
|
|
|
// padding: EdgeInsets.fromLTRB(10, 0, 10, 0),
|
|
|
|
height: 40.h,
|
|
|
|
// height: 40.h,
|
|
|
|
),
|
|
|
|
// ),
|
|
|
|
SizedBox(width: 8.h),
|
|
|
|
// SizedBox(width: 8.h),
|
|
|
|
CustomButton(
|
|
|
|
// CustomButton(
|
|
|
|
text: LocaleKeys.byHospital.tr(context: context),
|
|
|
|
// text: LocaleKeys.byHospital.tr(context: context),
|
|
|
|
onPressed: () {
|
|
|
|
// onPressed: () {
|
|
|
|
model.setIsSickLeavesSortByClinic(false);
|
|
|
|
// model.setIsSickLeavesSortByClinic(false);
|
|
|
|
},
|
|
|
|
// },
|
|
|
|
backgroundColor: model.isSickLeavesSortByClinic ? AppColors.whiteColor : AppColors.bgRedLightColor,
|
|
|
|
// backgroundColor: model.isSickLeavesSortByClinic ? AppColors.whiteColor : AppColors.bgRedLightColor,
|
|
|
|
borderColor: model.isSickLeavesSortByClinic ? AppColors.textColor.withValues(alpha: 0.2) : AppColors.primaryRedColor,
|
|
|
|
// borderColor: model.isSickLeavesSortByClinic ? AppColors.textColor.withValues(alpha: 0.2) : AppColors.primaryRedColor,
|
|
|
|
textColor: model.isSickLeavesSortByClinic ? AppColors.blackColor : AppColors.primaryRedColor,
|
|
|
|
// textColor: model.isSickLeavesSortByClinic ? AppColors.blackColor : AppColors.primaryRedColor,
|
|
|
|
fontSize: 12,
|
|
|
|
// fontSize: 12,
|
|
|
|
fontWeight: FontWeight.w500,
|
|
|
|
// fontWeight: FontWeight.w500,
|
|
|
|
borderRadius: 10,
|
|
|
|
// borderRadius: 10,
|
|
|
|
padding: EdgeInsets.fromLTRB(10, 0, 10, 0),
|
|
|
|
// padding: EdgeInsets.fromLTRB(10, 0, 10, 0),
|
|
|
|
height: 40.h,
|
|
|
|
// height: 40.h,
|
|
|
|
),
|
|
|
|
// ),
|
|
|
|
],
|
|
|
|
// ],
|
|
|
|
).paddingSymmetrical(24.h, 0.h),
|
|
|
|
// ).paddingSymmetrical(24.h, 0.h),
|
|
|
|
SizedBox(height: 20.h),
|
|
|
|
// SizedBox(height: 20.h),
|
|
|
|
// Expandable list
|
|
|
|
// Expandable list
|
|
|
|
ListView.builder(
|
|
|
|
ListView.builder(
|
|
|
|
itemCount: model.isPatientSickLeaveListLoading
|
|
|
|
itemCount: model.isPatientSickLeaveListLoading
|
|
|
|
? 4
|
|
|
|
? 4
|
|
|
|
: model.patientSickLeaveList.isNotEmpty
|
|
|
|
: model.patientSickLeaveList.isNotEmpty
|
|
|
|
? model.patientSickLeavesViewList.length
|
|
|
|
? model.patientSickLeaveList.length
|
|
|
|
: 1,
|
|
|
|
: 1,
|
|
|
|
physics: NeverScrollableScrollPhysics(),
|
|
|
|
physics: NeverScrollableScrollPhysics(),
|
|
|
|
shrinkWrap: true,
|
|
|
|
shrinkWrap: true,
|
|
|
|
@ -122,155 +122,322 @@ class _PatientSickleavesListPageState extends State<PatientSickleavesListPage> {
|
|
|
|
curve: Curves.easeInOut,
|
|
|
|
curve: Curves.easeInOut,
|
|
|
|
margin: EdgeInsets.symmetric(vertical: 8.h),
|
|
|
|
margin: EdgeInsets.symmetric(vertical: 8.h),
|
|
|
|
decoration: RoundedRectangleBorder().toSmoothCornerDecoration(color: AppColors.whiteColor, borderRadius: 20.h, hasShadow: true),
|
|
|
|
decoration: RoundedRectangleBorder().toSmoothCornerDecoration(color: AppColors.whiteColor, borderRadius: 20.h, hasShadow: true),
|
|
|
|
child: InkWell(
|
|
|
|
child: Container(
|
|
|
|
onTap: () {
|
|
|
|
padding: EdgeInsets.symmetric(horizontal: 16.h, vertical: 16.h),
|
|
|
|
setState(() {
|
|
|
|
child: Column(
|
|
|
|
expandedIndex = isExpanded ? null : index;
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
});
|
|
|
|
children: [
|
|
|
|
},
|
|
|
|
AppCustomChipWidget(
|
|
|
|
child: Column(
|
|
|
|
labelText:
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
"${getIt.get<AppState>().isArabic() ? model.patientSickLeaveList[index].isInOutPatientDescriptionN : model.patientSickLeaveList[index].isInOutPatientDescription}",
|
|
|
|
children: [
|
|
|
|
backgroundColor: AppColors.warningColorYellow.withOpacity(0.1),
|
|
|
|
Padding(
|
|
|
|
textColor: AppColors.warningColorYellow,
|
|
|
|
padding: EdgeInsets.all(16.h),
|
|
|
|
),
|
|
|
|
child: Column(
|
|
|
|
SizedBox(height: 16.h),
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
Row(
|
|
|
|
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
|
|
|
|
children: [
|
|
|
|
|
|
|
|
Image.network(
|
|
|
|
|
|
|
|
model.patientSickLeaveList[index].doctorImageURL!,
|
|
|
|
|
|
|
|
width: 24.h,
|
|
|
|
|
|
|
|
height: 24.h,
|
|
|
|
|
|
|
|
fit: BoxFit.fill,
|
|
|
|
|
|
|
|
).circle(100),
|
|
|
|
|
|
|
|
SizedBox(width: 8.h),
|
|
|
|
|
|
|
|
Expanded(child: model.patientSickLeaveList[index].doctorName!.toText14(weight: FontWeight.w500)),
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
SizedBox(height: 8.h),
|
|
|
|
|
|
|
|
Wrap(
|
|
|
|
|
|
|
|
direction: Axis.horizontal,
|
|
|
|
|
|
|
|
spacing: 6.h,
|
|
|
|
|
|
|
|
runSpacing: 6.h,
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
Row(
|
|
|
|
AppCustomChipWidget(
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
labelText: DateUtil.formatDateToDate(DateUtil.convertStringToDate(model.patientSickLeaveList[index].appointmentDate), false),
|
|
|
|
children: [
|
|
|
|
),
|
|
|
|
CustomButton(
|
|
|
|
AppCustomChipWidget(
|
|
|
|
text: "${model.patientSickLeavesViewList[index].sickLeavesList!.length} ${LocaleKeys.sickSubtitle.tr(context: context)} Available",
|
|
|
|
labelText: model.isSickLeavesSortByClinic ? model.patientSickLeaveList[index].projectName! : model.patientSickLeaveList[index].clinicName!,
|
|
|
|
onPressed: () {},
|
|
|
|
),
|
|
|
|
backgroundColor: AppColors.greyColor,
|
|
|
|
AppCustomChipWidget(
|
|
|
|
borderColor: AppColors.greyColor,
|
|
|
|
labelText: "${model.patientSickLeaveList[index].sickLeaveDays} Days",
|
|
|
|
textColor: AppColors.blackColor,
|
|
|
|
|
|
|
|
fontSize: 10,
|
|
|
|
|
|
|
|
fontWeight: FontWeight.w500,
|
|
|
|
|
|
|
|
borderRadius: 8,
|
|
|
|
|
|
|
|
padding: EdgeInsets.fromLTRB(10, 0, 10, 0),
|
|
|
|
|
|
|
|
height: 30.h,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
Icon(isExpanded ? Icons.expand_less : Icons.expand_more),
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
),
|
|
|
|
),
|
|
|
|
SizedBox(height: 8.h),
|
|
|
|
|
|
|
|
model.patientSickLeavesViewList[index].filterName!.toText16(isBold: true)
|
|
|
|
|
|
|
|
],
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
SizedBox(height: 12.h),
|
|
|
|
AnimatedSwitcher(
|
|
|
|
Row(
|
|
|
|
duration: Duration(milliseconds: 500),
|
|
|
|
children: [
|
|
|
|
switchInCurve: Curves.easeIn,
|
|
|
|
Expanded(
|
|
|
|
switchOutCurve: Curves.easeOut,
|
|
|
|
flex: 6,
|
|
|
|
transitionBuilder: (Widget child, Animation<double> animation) {
|
|
|
|
child: CustomButton(
|
|
|
|
return FadeTransition(
|
|
|
|
text: LocaleKeys.downloadReport.tr(context: context),
|
|
|
|
opacity: animation,
|
|
|
|
onPressed: () async {
|
|
|
|
child: SizeTransition(
|
|
|
|
LoaderBottomSheet.showLoader();
|
|
|
|
sizeFactor: animation,
|
|
|
|
await medicalFileViewModel.getPatientSickLeavePDF(model.patientSickLeaveList[index], appState.getAuthenticatedUser()!).then((val) async {
|
|
|
|
axisAlignment: 0.0,
|
|
|
|
LoaderBottomSheet.hideLoader();
|
|
|
|
child: child,
|
|
|
|
if (medicalFileViewModel.patientSickLeavePDFBase64.isNotEmpty) {
|
|
|
|
|
|
|
|
String path = await Utils.createFileFromString(medicalFileViewModel.patientSickLeavePDFBase64, "pdf");
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
OpenFilex.open(path);
|
|
|
|
|
|
|
|
} catch (ex) {
|
|
|
|
|
|
|
|
debugPrint("Error opening file: $ex");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
backgroundColor: AppColors.secondaryLightRedColor,
|
|
|
|
|
|
|
|
borderColor: AppColors.secondaryLightRedColor,
|
|
|
|
|
|
|
|
textColor: AppColors.primaryRedColor,
|
|
|
|
|
|
|
|
fontSize: 14,
|
|
|
|
|
|
|
|
fontWeight: FontWeight.w500,
|
|
|
|
|
|
|
|
borderRadius: 12,
|
|
|
|
|
|
|
|
padding: EdgeInsets.fromLTRB(10, 0, 10, 0),
|
|
|
|
|
|
|
|
height: 40.h,
|
|
|
|
|
|
|
|
icon: AppAssets.download,
|
|
|
|
|
|
|
|
iconColor: AppColors.primaryRedColor,
|
|
|
|
|
|
|
|
iconSize: 14.h,
|
|
|
|
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
],
|
|
|
|
},
|
|
|
|
),
|
|
|
|
child: isExpanded
|
|
|
|
// SizedBox(height: 12.h),
|
|
|
|
? Container(
|
|
|
|
// Divider(color: AppColors.borderOnlyColor.withValues(alpha: 0.05), height: 1.h),
|
|
|
|
key: ValueKey<int>(index),
|
|
|
|
// SizedBox(height: 12.h),
|
|
|
|
padding: EdgeInsets.symmetric(horizontal: 16.h, vertical: 8.h),
|
|
|
|
],
|
|
|
|
child: Column(
|
|
|
|
),
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
// Column(
|
|
|
|
children: [
|
|
|
|
// crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
...model.patientSickLeavesViewList[index].sickLeavesList!.map((sickLeave) {
|
|
|
|
// children: [
|
|
|
|
return Column(
|
|
|
|
// ...model.patientSickLeaveList[index].sickLeavesList!.map((sickLeave) {
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
// return Column(
|
|
|
|
children: [
|
|
|
|
// crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
Row(
|
|
|
|
// children: [
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
// Row(
|
|
|
|
children: [
|
|
|
|
// mainAxisSize: MainAxisSize.min,
|
|
|
|
Image.network(
|
|
|
|
// children: [
|
|
|
|
sickLeave.doctorImageURL!,
|
|
|
|
// Image.network(
|
|
|
|
width: 24.h,
|
|
|
|
// sickLeave.doctorImageURL!,
|
|
|
|
height: 24.h,
|
|
|
|
// width: 24.h,
|
|
|
|
fit: BoxFit.fill,
|
|
|
|
// height: 24.h,
|
|
|
|
).circle(100),
|
|
|
|
// fit: BoxFit.fill,
|
|
|
|
SizedBox(width: 8.h),
|
|
|
|
// ).circle(100),
|
|
|
|
Expanded(child: sickLeave.doctorName!.toText14(weight: FontWeight.w500)),
|
|
|
|
// SizedBox(width: 8.h),
|
|
|
|
],
|
|
|
|
// Expanded(child: sickLeave.doctorName!.toText14(weight: FontWeight.w500)),
|
|
|
|
),
|
|
|
|
// ],
|
|
|
|
SizedBox(height: 8.h),
|
|
|
|
// ),
|
|
|
|
Wrap(
|
|
|
|
// SizedBox(height: 8.h),
|
|
|
|
direction: Axis.horizontal,
|
|
|
|
// Wrap(
|
|
|
|
spacing: 6.h,
|
|
|
|
// direction: Axis.horizontal,
|
|
|
|
runSpacing: 6.h,
|
|
|
|
// spacing: 6.h,
|
|
|
|
children: [
|
|
|
|
// runSpacing: 6.h,
|
|
|
|
AppCustomChipWidget(
|
|
|
|
// children: [
|
|
|
|
labelText: DateUtil.formatDateToDate(DateUtil.convertStringToDate(sickLeave.appointmentDate), false),
|
|
|
|
// AppCustomChipWidget(
|
|
|
|
),
|
|
|
|
// labelText: DateUtil.formatDateToDate(DateUtil.convertStringToDate(sickLeave.appointmentDate), false),
|
|
|
|
AppCustomChipWidget(
|
|
|
|
// ),
|
|
|
|
labelText: model.isSickLeavesSortByClinic ? sickLeave.projectName! : sickLeave.clinicName!,
|
|
|
|
// AppCustomChipWidget(
|
|
|
|
),
|
|
|
|
// labelText: model.isSickLeavesSortByClinic ? sickLeave.projectName! : sickLeave.clinicName!,
|
|
|
|
AppCustomChipWidget(
|
|
|
|
// ),
|
|
|
|
labelText: "${sickLeave.sickLeaveDays} Days",
|
|
|
|
// AppCustomChipWidget(
|
|
|
|
),
|
|
|
|
// labelText: "${sickLeave.sickLeaveDays} Days",
|
|
|
|
],
|
|
|
|
// ),
|
|
|
|
),
|
|
|
|
// ],
|
|
|
|
SizedBox(height: 12.h),
|
|
|
|
// ),
|
|
|
|
Row(
|
|
|
|
// SizedBox(height: 12.h),
|
|
|
|
children: [
|
|
|
|
// Row(
|
|
|
|
Expanded(
|
|
|
|
// children: [
|
|
|
|
flex: 6,
|
|
|
|
// Expanded(
|
|
|
|
child: CustomButton(
|
|
|
|
// flex: 6,
|
|
|
|
text: LocaleKeys.downloadReport.tr(context: context),
|
|
|
|
// child: CustomButton(
|
|
|
|
onPressed: () async {
|
|
|
|
// text: LocaleKeys.downloadReport.tr(context: context),
|
|
|
|
LoaderBottomSheet.showLoader();
|
|
|
|
// onPressed: () async {
|
|
|
|
await medicalFileViewModel.getPatientSickLeavePDF(sickLeave, appState.getAuthenticatedUser()!).then((val) async {
|
|
|
|
// LoaderBottomSheet.showLoader();
|
|
|
|
LoaderBottomSheet.hideLoader();
|
|
|
|
// await medicalFileViewModel.getPatientSickLeavePDF(sickLeave, appState.getAuthenticatedUser()!).then((val) async {
|
|
|
|
if (medicalFileViewModel.patientSickLeavePDFBase64.isNotEmpty) {
|
|
|
|
// LoaderBottomSheet.hideLoader();
|
|
|
|
String path = await Utils.createFileFromString(medicalFileViewModel.patientSickLeavePDFBase64, "pdf");
|
|
|
|
// if (medicalFileViewModel.patientSickLeavePDFBase64.isNotEmpty) {
|
|
|
|
try {
|
|
|
|
// String path = await Utils.createFileFromString(medicalFileViewModel.patientSickLeavePDFBase64, "pdf");
|
|
|
|
OpenFilex.open(path);
|
|
|
|
// try {
|
|
|
|
} catch (ex) {
|
|
|
|
// OpenFilex.open(path);
|
|
|
|
debugPrint("Error opening file: $ex");
|
|
|
|
// } catch (ex) {
|
|
|
|
}
|
|
|
|
// debugPrint("Error opening file: $ex");
|
|
|
|
}
|
|
|
|
// }
|
|
|
|
});
|
|
|
|
// }
|
|
|
|
},
|
|
|
|
// });
|
|
|
|
backgroundColor: AppColors.secondaryLightRedColor,
|
|
|
|
// },
|
|
|
|
borderColor: AppColors.secondaryLightRedColor,
|
|
|
|
// backgroundColor: AppColors.secondaryLightRedColor,
|
|
|
|
textColor: AppColors.primaryRedColor,
|
|
|
|
// borderColor: AppColors.secondaryLightRedColor,
|
|
|
|
fontSize: 14,
|
|
|
|
// textColor: AppColors.primaryRedColor,
|
|
|
|
fontWeight: FontWeight.w500,
|
|
|
|
// fontSize: 14,
|
|
|
|
borderRadius: 12,
|
|
|
|
// fontWeight: FontWeight.w500,
|
|
|
|
padding: EdgeInsets.fromLTRB(10, 0, 10, 0),
|
|
|
|
// borderRadius: 12,
|
|
|
|
height: 40.h,
|
|
|
|
// padding: EdgeInsets.fromLTRB(10, 0, 10, 0),
|
|
|
|
icon: AppAssets.download,
|
|
|
|
// height: 40.h,
|
|
|
|
iconColor: AppColors.primaryRedColor,
|
|
|
|
// icon: AppAssets.download,
|
|
|
|
iconSize: 14.h,
|
|
|
|
// iconColor: AppColors.primaryRedColor,
|
|
|
|
),
|
|
|
|
// iconSize: 14.h,
|
|
|
|
),
|
|
|
|
// ),
|
|
|
|
],
|
|
|
|
// ),
|
|
|
|
),
|
|
|
|
// ],
|
|
|
|
SizedBox(height: 12.h),
|
|
|
|
// ),
|
|
|
|
Divider(color: AppColors.borderOnlyColor.withValues(alpha: 0.05), height: 1.h),
|
|
|
|
// SizedBox(height: 12.h),
|
|
|
|
SizedBox(height: 12.h),
|
|
|
|
// Divider(color: AppColors.borderOnlyColor.withValues(alpha: 0.05), height: 1.h),
|
|
|
|
],
|
|
|
|
// SizedBox(height: 12.h),
|
|
|
|
);
|
|
|
|
// ],
|
|
|
|
}),
|
|
|
|
// );
|
|
|
|
],
|
|
|
|
// }),
|
|
|
|
),
|
|
|
|
// ],
|
|
|
|
)
|
|
|
|
// ),
|
|
|
|
: SizedBox.shrink(),
|
|
|
|
)
|
|
|
|
),
|
|
|
|
// InkWell(
|
|
|
|
],
|
|
|
|
// onTap: () {
|
|
|
|
|
|
|
|
// setState(() {
|
|
|
|
|
|
|
|
// expandedIndex = isExpanded ? null : index;
|
|
|
|
|
|
|
|
// });
|
|
|
|
|
|
|
|
// },
|
|
|
|
|
|
|
|
// child:
|
|
|
|
|
|
|
|
// Column(
|
|
|
|
|
|
|
|
// crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
|
|
|
// children: [
|
|
|
|
|
|
|
|
// Padding(
|
|
|
|
|
|
|
|
// padding: EdgeInsets.all(16.h),
|
|
|
|
|
|
|
|
// child: Column(
|
|
|
|
|
|
|
|
// crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
|
|
|
// children: [
|
|
|
|
|
|
|
|
// Row(
|
|
|
|
|
|
|
|
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
|
|
|
// children: [
|
|
|
|
|
|
|
|
// CustomButton(
|
|
|
|
|
|
|
|
// text: "${model.patientSickLeavesViewList[index].sickLeavesList!.length} ${LocaleKeys.sickSubtitle.tr(context: context)} Available",
|
|
|
|
|
|
|
|
// onPressed: () {},
|
|
|
|
|
|
|
|
// backgroundColor: AppColors.greyColor,
|
|
|
|
|
|
|
|
// borderColor: AppColors.greyColor,
|
|
|
|
|
|
|
|
// textColor: AppColors.blackColor,
|
|
|
|
|
|
|
|
// fontSize: 10,
|
|
|
|
|
|
|
|
// fontWeight: FontWeight.w500,
|
|
|
|
|
|
|
|
// borderRadius: 8,
|
|
|
|
|
|
|
|
// padding: EdgeInsets.fromLTRB(10, 0, 10, 0),
|
|
|
|
|
|
|
|
// height: 30.h,
|
|
|
|
|
|
|
|
// ),
|
|
|
|
|
|
|
|
// Icon(isExpanded ? Icons.expand_less : Icons.expand_more),
|
|
|
|
|
|
|
|
// ],
|
|
|
|
|
|
|
|
// ),
|
|
|
|
|
|
|
|
// SizedBox(height: 8.h),
|
|
|
|
|
|
|
|
// model.patientSickLeavesViewList[index].filterName!.toText16(isBold: true)
|
|
|
|
|
|
|
|
// ],
|
|
|
|
|
|
|
|
// ),
|
|
|
|
|
|
|
|
// ),
|
|
|
|
|
|
|
|
// // AnimatedSwitcher(
|
|
|
|
|
|
|
|
// // duration: Duration(milliseconds: 500),
|
|
|
|
|
|
|
|
// // switchInCurve: Curves.easeIn,
|
|
|
|
|
|
|
|
// // switchOutCurve: Curves.easeOut,
|
|
|
|
|
|
|
|
// // transitionBuilder: (Widget child, Animation<double> animation) {
|
|
|
|
|
|
|
|
// // return FadeTransition(
|
|
|
|
|
|
|
|
// // opacity: animation,
|
|
|
|
|
|
|
|
// // child: SizeTransition(
|
|
|
|
|
|
|
|
// // sizeFactor: animation,
|
|
|
|
|
|
|
|
// // axisAlignment: 0.0,
|
|
|
|
|
|
|
|
// // child: child,
|
|
|
|
|
|
|
|
// // ),
|
|
|
|
|
|
|
|
// // );
|
|
|
|
|
|
|
|
// // },
|
|
|
|
|
|
|
|
// // child: isExpanded
|
|
|
|
|
|
|
|
// // ? Container(
|
|
|
|
|
|
|
|
// // key: ValueKey<int>(index),
|
|
|
|
|
|
|
|
// // padding: EdgeInsets.symmetric(horizontal: 16.h, vertical: 8.h),
|
|
|
|
|
|
|
|
// // child: Column(
|
|
|
|
|
|
|
|
// // crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
|
|
|
// // children: [
|
|
|
|
|
|
|
|
// // ...model.patientSickLeavesViewList[index].sickLeavesList!.map((sickLeave) {
|
|
|
|
|
|
|
|
// // return Column(
|
|
|
|
|
|
|
|
// // crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
|
|
|
// // children: [
|
|
|
|
|
|
|
|
// // Row(
|
|
|
|
|
|
|
|
// // mainAxisSize: MainAxisSize.min,
|
|
|
|
|
|
|
|
// // children: [
|
|
|
|
|
|
|
|
// // Image.network(
|
|
|
|
|
|
|
|
// // sickLeave.doctorImageURL!,
|
|
|
|
|
|
|
|
// // width: 24.h,
|
|
|
|
|
|
|
|
// // height: 24.h,
|
|
|
|
|
|
|
|
// // fit: BoxFit.fill,
|
|
|
|
|
|
|
|
// // ).circle(100),
|
|
|
|
|
|
|
|
// // SizedBox(width: 8.h),
|
|
|
|
|
|
|
|
// // Expanded(child: sickLeave.doctorName!.toText14(weight: FontWeight.w500)),
|
|
|
|
|
|
|
|
// // ],
|
|
|
|
|
|
|
|
// // ),
|
|
|
|
|
|
|
|
// // SizedBox(height: 8.h),
|
|
|
|
|
|
|
|
// // Wrap(
|
|
|
|
|
|
|
|
// // direction: Axis.horizontal,
|
|
|
|
|
|
|
|
// // spacing: 6.h,
|
|
|
|
|
|
|
|
// // runSpacing: 6.h,
|
|
|
|
|
|
|
|
// // children: [
|
|
|
|
|
|
|
|
// // AppCustomChipWidget(
|
|
|
|
|
|
|
|
// // labelText: DateUtil.formatDateToDate(DateUtil.convertStringToDate(sickLeave.appointmentDate), false),
|
|
|
|
|
|
|
|
// // ),
|
|
|
|
|
|
|
|
// // AppCustomChipWidget(
|
|
|
|
|
|
|
|
// // labelText: model.isSickLeavesSortByClinic ? sickLeave.projectName! : sickLeave.clinicName!,
|
|
|
|
|
|
|
|
// // ),
|
|
|
|
|
|
|
|
// // AppCustomChipWidget(
|
|
|
|
|
|
|
|
// // labelText: "${sickLeave.sickLeaveDays} Days",
|
|
|
|
|
|
|
|
// // ),
|
|
|
|
|
|
|
|
// // ],
|
|
|
|
|
|
|
|
// // ),
|
|
|
|
|
|
|
|
// // SizedBox(height: 12.h),
|
|
|
|
|
|
|
|
// // Row(
|
|
|
|
|
|
|
|
// // children: [
|
|
|
|
|
|
|
|
// // Expanded(
|
|
|
|
|
|
|
|
// // flex: 6,
|
|
|
|
|
|
|
|
// // child: CustomButton(
|
|
|
|
|
|
|
|
// // text: LocaleKeys.downloadReport.tr(context: context),
|
|
|
|
|
|
|
|
// // onPressed: () async {
|
|
|
|
|
|
|
|
// // LoaderBottomSheet.showLoader();
|
|
|
|
|
|
|
|
// // await medicalFileViewModel.getPatientSickLeavePDF(sickLeave, appState.getAuthenticatedUser()!).then((val) async {
|
|
|
|
|
|
|
|
// // LoaderBottomSheet.hideLoader();
|
|
|
|
|
|
|
|
// // if (medicalFileViewModel.patientSickLeavePDFBase64.isNotEmpty) {
|
|
|
|
|
|
|
|
// // String path = await Utils.createFileFromString(medicalFileViewModel.patientSickLeavePDFBase64, "pdf");
|
|
|
|
|
|
|
|
// // try {
|
|
|
|
|
|
|
|
// // OpenFilex.open(path);
|
|
|
|
|
|
|
|
// // } catch (ex) {
|
|
|
|
|
|
|
|
// // debugPrint("Error opening file: $ex");
|
|
|
|
|
|
|
|
// // }
|
|
|
|
|
|
|
|
// // }
|
|
|
|
|
|
|
|
// // });
|
|
|
|
|
|
|
|
// // },
|
|
|
|
|
|
|
|
// // backgroundColor: AppColors.secondaryLightRedColor,
|
|
|
|
|
|
|
|
// // borderColor: AppColors.secondaryLightRedColor,
|
|
|
|
|
|
|
|
// // textColor: AppColors.primaryRedColor,
|
|
|
|
|
|
|
|
// // fontSize: 14,
|
|
|
|
|
|
|
|
// // fontWeight: FontWeight.w500,
|
|
|
|
|
|
|
|
// // borderRadius: 12,
|
|
|
|
|
|
|
|
// // padding: EdgeInsets.fromLTRB(10, 0, 10, 0),
|
|
|
|
|
|
|
|
// // height: 40.h,
|
|
|
|
|
|
|
|
// // icon: AppAssets.download,
|
|
|
|
|
|
|
|
// // iconColor: AppColors.primaryRedColor,
|
|
|
|
|
|
|
|
// // iconSize: 14.h,
|
|
|
|
|
|
|
|
// // ),
|
|
|
|
|
|
|
|
// // ),
|
|
|
|
|
|
|
|
// // ],
|
|
|
|
|
|
|
|
// // ),
|
|
|
|
|
|
|
|
// // SizedBox(height: 12.h),
|
|
|
|
|
|
|
|
// // Divider(color: AppColors.borderOnlyColor.withValues(alpha: 0.05), height: 1.h),
|
|
|
|
|
|
|
|
// // SizedBox(height: 12.h),
|
|
|
|
|
|
|
|
// // ],
|
|
|
|
|
|
|
|
// // );
|
|
|
|
|
|
|
|
// // }),
|
|
|
|
|
|
|
|
// // ],
|
|
|
|
|
|
|
|
// // ),
|
|
|
|
|
|
|
|
// // )
|
|
|
|
|
|
|
|
// // : SizedBox.shrink(),
|
|
|
|
|
|
|
|
// // ),
|
|
|
|
|
|
|
|
// ],
|
|
|
|
|
|
|
|
// ),
|
|
|
|
|
|
|
|
// ),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
)
|
|
|
|
)
|
|
|
|
: Utils.getNoDataWidget(context, noDataText: LocaleKeys.youDontHaveAnySickLeavesYet.tr(context: context));
|
|
|
|
: Utils.getNoDataWidget(context, noDataText: LocaleKeys.youDontHaveAnySickLeavesYet.tr(context: context));
|
|
|
|
},
|
|
|
|
},
|
|
|
|
).paddingSymmetrical(24.h, 0.h),
|
|
|
|
).paddingSymmetrical(24.h, 0.h),
|
|
|
|
|
|
|
|
SizedBox(height: 24.h),
|
|
|
|
],
|
|
|
|
],
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}),
|
|
|
|
}),
|
|
|
|
|