|
|
|
|
@ -3,6 +3,8 @@ import 'dart:async';
|
|
|
|
|
import 'package:easy_localization/easy_localization.dart';
|
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
import 'package:flutter_staggered_animations/flutter_staggered_animations.dart';
|
|
|
|
|
import 'package:hmg_patient_app_new/core/app_state.dart';
|
|
|
|
|
import 'package:hmg_patient_app_new/core/dependencies.dart';
|
|
|
|
|
import 'package:hmg_patient_app_new/core/utils/date_util.dart';
|
|
|
|
|
import 'package:hmg_patient_app_new/core/utils/size_utils.dart';
|
|
|
|
|
import 'package:hmg_patient_app_new/core/utils/utils.dart';
|
|
|
|
|
@ -96,40 +98,40 @@ class _RadiologyOrdersPageState extends State<RadiologyOrdersPage> {
|
|
|
|
|
children: [
|
|
|
|
|
// Clinic / Hospital toggle
|
|
|
|
|
SizedBox(height: 16.h),
|
|
|
|
|
Row(
|
|
|
|
|
children: [
|
|
|
|
|
CustomButton(
|
|
|
|
|
text: LocaleKeys.byClinic.tr(context: context),
|
|
|
|
|
onPressed: () {
|
|
|
|
|
model.setIsSortByClinic(true);
|
|
|
|
|
},
|
|
|
|
|
backgroundColor: model.isSortByClinic ? AppColors.bgRedLightColor : AppColors.whiteColor,
|
|
|
|
|
borderColor: model.isSortByClinic ? AppColors.primaryRedColor : AppColors.textColor.withValues(alpha: 0.2),
|
|
|
|
|
textColor: model.isSortByClinic ? AppColors.primaryRedColor : AppColors.blackColor,
|
|
|
|
|
fontSize: 12,
|
|
|
|
|
fontWeight: FontWeight.w500,
|
|
|
|
|
borderRadius: 10,
|
|
|
|
|
padding: EdgeInsets.fromLTRB(10, 0, 10, 0),
|
|
|
|
|
height: 40.h,
|
|
|
|
|
),
|
|
|
|
|
SizedBox(width: 8.h),
|
|
|
|
|
CustomButton(
|
|
|
|
|
text: LocaleKeys.byHospital.tr(context: context),
|
|
|
|
|
onPressed: () {
|
|
|
|
|
model.setIsSortByClinic(false);
|
|
|
|
|
},
|
|
|
|
|
backgroundColor: model.isSortByClinic ? AppColors.whiteColor : AppColors.bgRedLightColor,
|
|
|
|
|
borderColor: model.isSortByClinic ? AppColors.textColor.withValues(alpha: 0.2) : AppColors.primaryRedColor,
|
|
|
|
|
textColor: model.isSortByClinic ? AppColors.blackColor : AppColors.primaryRedColor,
|
|
|
|
|
fontSize: 12,
|
|
|
|
|
fontWeight: FontWeight.w500,
|
|
|
|
|
borderRadius: 10,
|
|
|
|
|
padding: EdgeInsets.fromLTRB(10, 0, 10, 0),
|
|
|
|
|
height: 40.h,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
SizedBox(height: 8.h),
|
|
|
|
|
// Row(
|
|
|
|
|
// children: [
|
|
|
|
|
// CustomButton(
|
|
|
|
|
// text: LocaleKeys.byClinic.tr(context: context),
|
|
|
|
|
// onPressed: () {
|
|
|
|
|
// model.setIsSortByClinic(true);
|
|
|
|
|
// },
|
|
|
|
|
// backgroundColor: model.isSortByClinic ? AppColors.bgRedLightColor : AppColors.whiteColor,
|
|
|
|
|
// borderColor: model.isSortByClinic ? AppColors.primaryRedColor : AppColors.textColor.withValues(alpha: 0.2),
|
|
|
|
|
// textColor: model.isSortByClinic ? AppColors.primaryRedColor : AppColors.blackColor,
|
|
|
|
|
// fontSize: 12,
|
|
|
|
|
// fontWeight: FontWeight.w500,
|
|
|
|
|
// borderRadius: 10,
|
|
|
|
|
// padding: EdgeInsets.fromLTRB(10, 0, 10, 0),
|
|
|
|
|
// height: 40.h,
|
|
|
|
|
// ),
|
|
|
|
|
// SizedBox(width: 8.h),
|
|
|
|
|
// CustomButton(
|
|
|
|
|
// text: LocaleKeys.byHospital.tr(context: context),
|
|
|
|
|
// onPressed: () {
|
|
|
|
|
// model.setIsSortByClinic(false);
|
|
|
|
|
// },
|
|
|
|
|
// backgroundColor: model.isSortByClinic ? AppColors.whiteColor : AppColors.bgRedLightColor,
|
|
|
|
|
// borderColor: model.isSortByClinic ? AppColors.textColor.withValues(alpha: 0.2) : AppColors.primaryRedColor,
|
|
|
|
|
// textColor: model.isSortByClinic ? AppColors.blackColor : AppColors.primaryRedColor,
|
|
|
|
|
// fontSize: 12,
|
|
|
|
|
// fontWeight: FontWeight.w500,
|
|
|
|
|
// borderRadius: 10,
|
|
|
|
|
// padding: EdgeInsets.fromLTRB(10, 0, 10, 0),
|
|
|
|
|
// height: 40.h,
|
|
|
|
|
// ),
|
|
|
|
|
// ],
|
|
|
|
|
// ),
|
|
|
|
|
// SizedBox(height: 8.h),
|
|
|
|
|
selectedFilterText.isNotEmpty
|
|
|
|
|
? AppCustomChipWidget(
|
|
|
|
|
padding: EdgeInsets.symmetric(horizontal: 5.h),
|
|
|
|
|
@ -171,198 +173,521 @@ class _RadiologyOrdersPageState extends State<RadiologyOrdersPage> {
|
|
|
|
|
return Utils.getNoDataWidget(ctx, noDataText: LocaleKeys.youDontHaveRadiologyOrders.tr(context: context));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return ListView.builder(
|
|
|
|
|
shrinkWrap: true,
|
|
|
|
|
physics: NeverScrollableScrollPhysics(),
|
|
|
|
|
padding: EdgeInsets.zero,
|
|
|
|
|
itemCount: model.patientRadiologyOrdersViewList.length,
|
|
|
|
|
itemBuilder: (context, index) {
|
|
|
|
|
final group = model.patientRadiologyOrdersViewList[index];
|
|
|
|
|
final displayName = model.isSortByClinic ? (group.first.clinicDescription ?? 'Unknown') : (group.first.projectName ?? 'Unknown');
|
|
|
|
|
final isExpanded = expandedIndex == index;
|
|
|
|
|
return AnimationConfiguration.staggeredList(
|
|
|
|
|
// return ListView.builder(
|
|
|
|
|
// shrinkWrap: true,
|
|
|
|
|
// physics: NeverScrollableScrollPhysics(),
|
|
|
|
|
// padding: EdgeInsets.zero,
|
|
|
|
|
// itemCount: model.patientRadiologyOrdersViewList.length,
|
|
|
|
|
// itemBuilder: (context, index) {
|
|
|
|
|
// final group = model.patientRadiologyOrdersViewList[index];
|
|
|
|
|
// final displayName = model.isSortByClinic ? (group.first.clinicDescription ?? 'Unknown') : (group.first.projectName ?? 'Unknown');
|
|
|
|
|
// final isExpanded = expandedIndex == index;
|
|
|
|
|
// return AnimationConfiguration.staggeredList(
|
|
|
|
|
// position: index,
|
|
|
|
|
// duration: const Duration(milliseconds: 400),
|
|
|
|
|
// child: SlideAnimation(
|
|
|
|
|
// verticalOffset: 50.0,
|
|
|
|
|
// child: FadeInAnimation(
|
|
|
|
|
// child: AnimatedContainer(
|
|
|
|
|
// duration: const Duration(milliseconds: 300),
|
|
|
|
|
// curve: Curves.easeInOut,
|
|
|
|
|
// margin: EdgeInsets.symmetric(vertical: 8.h),
|
|
|
|
|
// decoration: RoundedRectangleBorder().toSmoothCornerDecoration(
|
|
|
|
|
// color: AppColors.whiteColor,
|
|
|
|
|
// borderRadius: 20.h,
|
|
|
|
|
// hasShadow: true,
|
|
|
|
|
// ),
|
|
|
|
|
// child: InkWell(
|
|
|
|
|
// onTap: () {
|
|
|
|
|
// setState(() {
|
|
|
|
|
// expandedIndex = isExpanded ? null : index;
|
|
|
|
|
// });
|
|
|
|
|
// WidgetsBinding.instance.addPostFrameCallback((_) {
|
|
|
|
|
// final key = _groupKeys.putIfAbsent(index, () => GlobalKey());
|
|
|
|
|
// if (key.currentContext != null && expandedIndex == index) {
|
|
|
|
|
// Future.delayed(const Duration(milliseconds: 450), () {
|
|
|
|
|
// if (key.currentContext != null) {
|
|
|
|
|
// Scrollable.ensureVisible(
|
|
|
|
|
// key.currentContext!,
|
|
|
|
|
// duration: const Duration(milliseconds: 350),
|
|
|
|
|
// curve: Curves.easeInOut,
|
|
|
|
|
// alignment: 0.0,
|
|
|
|
|
// );
|
|
|
|
|
// }
|
|
|
|
|
// });
|
|
|
|
|
// }
|
|
|
|
|
// });
|
|
|
|
|
// },
|
|
|
|
|
// child: Column(
|
|
|
|
|
// crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
// children: [
|
|
|
|
|
// Padding(
|
|
|
|
|
// key: _groupKeys.putIfAbsent(index, () => GlobalKey()),
|
|
|
|
|
// padding: EdgeInsets.all(16.h),
|
|
|
|
|
// child: Column(
|
|
|
|
|
// crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
// children: [
|
|
|
|
|
// Row(
|
|
|
|
|
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
// children: [
|
|
|
|
|
// AppCustomChipWidget(labelText: "${group.length} ${LocaleKeys.results.tr(context: context)}"),
|
|
|
|
|
// Icon(isExpanded ? Icons.expand_less : Icons.expand_more),
|
|
|
|
|
// ],
|
|
|
|
|
// ),
|
|
|
|
|
// SizedBox(height: 8.h),
|
|
|
|
|
// Text(
|
|
|
|
|
// displayName,
|
|
|
|
|
// style: TextStyle(fontSize: 16.h, fontWeight: FontWeight.w600),
|
|
|
|
|
// overflow: TextOverflow.ellipsis,
|
|
|
|
|
// ),
|
|
|
|
|
// ],
|
|
|
|
|
// ),
|
|
|
|
|
// ),
|
|
|
|
|
// AnimatedSwitcher(
|
|
|
|
|
// duration: const 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.w),
|
|
|
|
|
// child: Column(
|
|
|
|
|
// crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
// children: [
|
|
|
|
|
// ...group.map<Widget>((order) {
|
|
|
|
|
// return Column(
|
|
|
|
|
// crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
// children: [
|
|
|
|
|
// Row(
|
|
|
|
|
// mainAxisSize: MainAxisSize.min,
|
|
|
|
|
// children: [
|
|
|
|
|
// Image.network(
|
|
|
|
|
// order.doctorImageURL ?? "https://hmgwebservices.com/Images/MobileImages/DUBAI/unkown_female.png",
|
|
|
|
|
// width: 24.w,
|
|
|
|
|
// height: 24.h,
|
|
|
|
|
// fit: BoxFit.cover,
|
|
|
|
|
// ).circle(100),
|
|
|
|
|
// SizedBox(width: 8.h),
|
|
|
|
|
// Expanded(
|
|
|
|
|
// child: (order.doctorName ?? '').toString().toText14(weight: FontWeight.w500),
|
|
|
|
|
// ),
|
|
|
|
|
// ],
|
|
|
|
|
// ),
|
|
|
|
|
// SizedBox(height: 8.h),
|
|
|
|
|
// Wrap(
|
|
|
|
|
// direction: Axis.horizontal,
|
|
|
|
|
// spacing: 4.h,
|
|
|
|
|
// runSpacing: 4.h,
|
|
|
|
|
// children: [
|
|
|
|
|
// if ((order.description ?? '').isNotEmpty)
|
|
|
|
|
// AppCustomChipWidget(
|
|
|
|
|
// labelText: (order.description ?? '').toString(),
|
|
|
|
|
// ),
|
|
|
|
|
// Directionality(
|
|
|
|
|
// textDirection: ui.TextDirection.ltr,
|
|
|
|
|
// child: AppCustomChipWidget(
|
|
|
|
|
// labelText: DateUtil.formatDateToDate(
|
|
|
|
|
// (order.orderDate ?? order.appointmentDate),
|
|
|
|
|
// false,
|
|
|
|
|
// ), isEnglishOnly: true,
|
|
|
|
|
// ),
|
|
|
|
|
// ),
|
|
|
|
|
// AppCustomChipWidget(
|
|
|
|
|
// labelText: model.isSortByClinic ? (order.projectName ?? '') : (order.clinicDescription ?? ''),
|
|
|
|
|
// ),
|
|
|
|
|
// ],
|
|
|
|
|
// ),
|
|
|
|
|
// SizedBox(height: 12.h),
|
|
|
|
|
// Row(
|
|
|
|
|
// children: [
|
|
|
|
|
// Expanded(flex: 2, child: const SizedBox()),
|
|
|
|
|
// Expanded(
|
|
|
|
|
// flex: 2,
|
|
|
|
|
// child: CustomButton(
|
|
|
|
|
// icon: AppAssets.view_report_icon,
|
|
|
|
|
// iconColor: AppColors.primaryRedColor,
|
|
|
|
|
// iconSize: 16.h,
|
|
|
|
|
// text: LocaleKeys.viewResults.tr(context: context),
|
|
|
|
|
// onPressed: () {
|
|
|
|
|
// model.navigationService.push(
|
|
|
|
|
// CustomPageRoute(
|
|
|
|
|
// page: RadiologyResultPage(patientRadiologyResponseModel: order),
|
|
|
|
|
// ),
|
|
|
|
|
// );
|
|
|
|
|
// },
|
|
|
|
|
// backgroundColor: AppColors.secondaryLightRedColor,
|
|
|
|
|
// borderColor: AppColors.secondaryLightRedColor,
|
|
|
|
|
// textColor: AppColors.primaryRedColor,
|
|
|
|
|
// fontSize: 14,
|
|
|
|
|
// fontWeight: FontWeight.w500,
|
|
|
|
|
// borderRadius: 12,
|
|
|
|
|
// padding: const EdgeInsets.fromLTRB(10, 0, 10, 0),
|
|
|
|
|
// height: 40.h,
|
|
|
|
|
// ),
|
|
|
|
|
// ),
|
|
|
|
|
// ],
|
|
|
|
|
// ),
|
|
|
|
|
// SizedBox(height: 12.h),
|
|
|
|
|
// Divider(color: AppColors.borderOnlyColor.withValues(alpha: 0.05), height: 1.h),
|
|
|
|
|
// SizedBox(height: 12.h),
|
|
|
|
|
// ],
|
|
|
|
|
// );
|
|
|
|
|
// }).toList(),
|
|
|
|
|
// ],
|
|
|
|
|
// ),
|
|
|
|
|
// )
|
|
|
|
|
// : const SizedBox.shrink(),
|
|
|
|
|
// ),
|
|
|
|
|
// ],
|
|
|
|
|
// ),
|
|
|
|
|
// ),
|
|
|
|
|
// ),
|
|
|
|
|
// ),
|
|
|
|
|
// ),
|
|
|
|
|
// );
|
|
|
|
|
// },
|
|
|
|
|
// );
|
|
|
|
|
|
|
|
|
|
return ListView.builder(
|
|
|
|
|
shrinkWrap: true,
|
|
|
|
|
physics: NeverScrollableScrollPhysics(),
|
|
|
|
|
padding: EdgeInsets.zero,
|
|
|
|
|
itemCount: model.patientRadiologyOrders.length,
|
|
|
|
|
itemBuilder: (context, index) {
|
|
|
|
|
final group = model.patientRadiologyOrders[index];
|
|
|
|
|
final isExpanded = expandedIndex == index;
|
|
|
|
|
return AnimationConfiguration.staggeredList(
|
|
|
|
|
position: index,
|
|
|
|
|
duration: const Duration(milliseconds: 400),
|
|
|
|
|
duration: const Duration(milliseconds: 500),
|
|
|
|
|
child: SlideAnimation(
|
|
|
|
|
verticalOffset: 50.0,
|
|
|
|
|
verticalOffset: 100.0,
|
|
|
|
|
child: FadeInAnimation(
|
|
|
|
|
child: AnimatedContainer(
|
|
|
|
|
duration: const Duration(milliseconds: 300),
|
|
|
|
|
duration: Duration(milliseconds: 300),
|
|
|
|
|
curve: Curves.easeInOut,
|
|
|
|
|
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(
|
|
|
|
|
onTap: () {
|
|
|
|
|
setState(() {
|
|
|
|
|
expandedIndex = isExpanded ? null : index;
|
|
|
|
|
});
|
|
|
|
|
WidgetsBinding.instance.addPostFrameCallback((_) {
|
|
|
|
|
final key = _groupKeys.putIfAbsent(index, () => GlobalKey());
|
|
|
|
|
if (key.currentContext != null && expandedIndex == index) {
|
|
|
|
|
Future.delayed(const Duration(milliseconds: 450), () {
|
|
|
|
|
if (key.currentContext != null) {
|
|
|
|
|
Scrollable.ensureVisible(
|
|
|
|
|
key.currentContext!,
|
|
|
|
|
duration: const Duration(milliseconds: 350),
|
|
|
|
|
curve: Curves.easeInOut,
|
|
|
|
|
alignment: 0.0,
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
Padding(
|
|
|
|
|
key: _groupKeys.putIfAbsent(index, () => GlobalKey()),
|
|
|
|
|
padding: EdgeInsets.all(16.h),
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
AppCustomChipWidget(
|
|
|
|
|
labelText: "${getIt.get<AppState>().isArabic() ? group.isInOutPatientDescriptionN : group.isInOutPatientDescription}",
|
|
|
|
|
backgroundColor: group.isInOutPatient! ? AppColors.primaryRedColor.withOpacity(0.1) : AppColors.warningColorYellow.withOpacity(0.1),
|
|
|
|
|
textColor: group.isInOutPatient! ? AppColors.primaryRedColor : AppColors.warningColorYellow,
|
|
|
|
|
),
|
|
|
|
|
SizedBox(height: 16.h),
|
|
|
|
|
Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
|
children: [
|
|
|
|
|
AppCustomChipWidget(labelText: "${group.length} ${LocaleKeys.results.tr(context: context)}"),
|
|
|
|
|
Icon(isExpanded ? Icons.expand_less : Icons.expand_more),
|
|
|
|
|
Image.network(
|
|
|
|
|
group.doctorImageURL ?? "https://hmgwebservices.com/Images/MobileImages/DUBAI/unkown_female.png",
|
|
|
|
|
width: 24.w,
|
|
|
|
|
height: 24.h,
|
|
|
|
|
fit: BoxFit.cover,
|
|
|
|
|
).circle(100),
|
|
|
|
|
SizedBox(width: 8.h),
|
|
|
|
|
Expanded(child: (group.doctorName ?? "").toString().toText14(weight: FontWeight.w500)),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
SizedBox(height: 8.h),
|
|
|
|
|
Text(
|
|
|
|
|
displayName,
|
|
|
|
|
style: TextStyle(fontSize: 16.h, fontWeight: FontWeight.w600),
|
|
|
|
|
overflow: TextOverflow.ellipsis,
|
|
|
|
|
Wrap(
|
|
|
|
|
direction: Axis.horizontal,
|
|
|
|
|
spacing: 4.h,
|
|
|
|
|
runSpacing: 4.h,
|
|
|
|
|
children: [
|
|
|
|
|
Directionality(
|
|
|
|
|
textDirection: ui.TextDirection.ltr,
|
|
|
|
|
child: AppCustomChipWidget(
|
|
|
|
|
labelText: DateUtil.formatDateToDate(group.orderDate!, false),
|
|
|
|
|
isEnglishOnly: true,
|
|
|
|
|
)),
|
|
|
|
|
AppCustomChipWidget(
|
|
|
|
|
labelText: (group.projectName ?? ""),
|
|
|
|
|
),
|
|
|
|
|
AppCustomChipWidget(
|
|
|
|
|
labelText: (group.clinicDescription ?? ""),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
SizedBox(height: 16.h),
|
|
|
|
|
Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
"• ${group.procedureName.toString().trim() ?? ""}".toText14(weight: FontWeight.w500),
|
|
|
|
|
// "Lorem ipsum text".toText12(fontWeight: FontWeight.w500, color: AppColors.textColorLight),
|
|
|
|
|
SizedBox(height: 16.h),
|
|
|
|
|
CustomButton(
|
|
|
|
|
text: LocaleKeys.viewReport.tr(),
|
|
|
|
|
onPressed: () {
|
|
|
|
|
model.navigationService.push(
|
|
|
|
|
CustomPageRoute(
|
|
|
|
|
page: RadiologyResultPage(patientRadiologyResponseModel: group),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
backgroundColor: AppColors.infoColor.withAlpha(20),
|
|
|
|
|
borderColor: AppColors.infoColor.withAlpha(0),
|
|
|
|
|
textColor: AppColors.infoColor,
|
|
|
|
|
fontSize: (isFoldable || isTablet) ? 12.f : 14.f,
|
|
|
|
|
fontWeight: FontWeight.w500,
|
|
|
|
|
borderRadius: 12.r,
|
|
|
|
|
padding: EdgeInsets.fromLTRB(10.w, 0, 10.w, 0),
|
|
|
|
|
height: 40.h,
|
|
|
|
|
iconSize: 14.h,
|
|
|
|
|
icon: AppAssets.view_report_icon,
|
|
|
|
|
iconColor: AppColors.infoColor,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
AnimatedSwitcher(
|
|
|
|
|
duration: const 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.w),
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
...group.map<Widget>((order) {
|
|
|
|
|
return Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
Row(
|
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
|
children: [
|
|
|
|
|
Image.network(
|
|
|
|
|
order.doctorImageURL ?? "https://hmgwebservices.com/Images/MobileImages/DUBAI/unkown_female.png",
|
|
|
|
|
width: 24.w,
|
|
|
|
|
height: 24.h,
|
|
|
|
|
fit: BoxFit.cover,
|
|
|
|
|
).circle(100),
|
|
|
|
|
SizedBox(width: 8.h),
|
|
|
|
|
Expanded(
|
|
|
|
|
child: (order.doctorName ?? '').toString().toText14(weight: FontWeight.w500),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
SizedBox(height: 8.h),
|
|
|
|
|
Wrap(
|
|
|
|
|
direction: Axis.horizontal,
|
|
|
|
|
spacing: 4.h,
|
|
|
|
|
runSpacing: 4.h,
|
|
|
|
|
children: [
|
|
|
|
|
if ((order.description ?? '').isNotEmpty)
|
|
|
|
|
AppCustomChipWidget(
|
|
|
|
|
labelText: (order.description ?? '').toString(),
|
|
|
|
|
),
|
|
|
|
|
Directionality(
|
|
|
|
|
textDirection: ui.TextDirection.ltr,
|
|
|
|
|
child: AppCustomChipWidget(
|
|
|
|
|
labelText: DateUtil.formatDateToDate(
|
|
|
|
|
(order.orderDate ?? order.appointmentDate),
|
|
|
|
|
false,
|
|
|
|
|
), isEnglishOnly: true,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
AppCustomChipWidget(
|
|
|
|
|
labelText: model.isSortByClinic ? (order.projectName ?? '') : (order.clinicDescription ?? ''),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
SizedBox(height: 12.h),
|
|
|
|
|
Row(
|
|
|
|
|
children: [
|
|
|
|
|
Expanded(flex: 2, child: const SizedBox()),
|
|
|
|
|
Expanded(
|
|
|
|
|
flex: 2,
|
|
|
|
|
child: CustomButton(
|
|
|
|
|
icon: AppAssets.view_report_icon,
|
|
|
|
|
iconColor: AppColors.primaryRedColor,
|
|
|
|
|
iconSize: 16.h,
|
|
|
|
|
text: LocaleKeys.viewResults.tr(context: context),
|
|
|
|
|
onPressed: () {
|
|
|
|
|
model.navigationService.push(
|
|
|
|
|
CustomPageRoute(
|
|
|
|
|
page: RadiologyResultPage(patientRadiologyResponseModel: order),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
backgroundColor: AppColors.secondaryLightRedColor,
|
|
|
|
|
borderColor: AppColors.secondaryLightRedColor,
|
|
|
|
|
textColor: AppColors.primaryRedColor,
|
|
|
|
|
fontSize: 14,
|
|
|
|
|
fontWeight: FontWeight.w500,
|
|
|
|
|
borderRadius: 12,
|
|
|
|
|
padding: const EdgeInsets.fromLTRB(10, 0, 10, 0),
|
|
|
|
|
height: 40.h,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
SizedBox(height: 12.h),
|
|
|
|
|
Divider(color: AppColors.borderOnlyColor.withValues(alpha: 0.05), height: 1.h),
|
|
|
|
|
SizedBox(height: 12.h),
|
|
|
|
|
],
|
|
|
|
|
);
|
|
|
|
|
}).toList(),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
)
|
|
|
|
|
: const SizedBox.shrink(),
|
|
|
|
|
),
|
|
|
|
|
// 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.w, vertical: 0.h),
|
|
|
|
|
// child: Column(
|
|
|
|
|
// children: [
|
|
|
|
|
// ListView.separated(
|
|
|
|
|
// shrinkWrap: true,
|
|
|
|
|
// physics: NeverScrollableScrollPhysics(),
|
|
|
|
|
// padding: EdgeInsets.zero,
|
|
|
|
|
// itemBuilder: (cxt, index) {
|
|
|
|
|
// PatientRadiologyResponseModel order = group;
|
|
|
|
|
// return Column(
|
|
|
|
|
// crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
// children: [
|
|
|
|
|
// "• ${order.procedureName ?? ""}".toText14(weight: FontWeight.w500),
|
|
|
|
|
// "Lorem ipsum text".toText12(fontWeight: FontWeight.w500, color: AppColors.textColorLight),
|
|
|
|
|
// // SizedBox(height: 4.h),
|
|
|
|
|
// // order.testDetails![index].testDescriptionEn!.toText12(fontWeight: FontWeight.w500, color: AppColors.textColorLight),
|
|
|
|
|
// // Row(
|
|
|
|
|
// // mainAxisSize: MainAxisSize.min,
|
|
|
|
|
// // children: [
|
|
|
|
|
// // Image.network(
|
|
|
|
|
// // order.doctorImageURL ?? "https://hmgwebservices.com/Images/MobileImages/DUBAI/unkown_female.png",
|
|
|
|
|
// // width: 24.w,
|
|
|
|
|
// // height: 24.h,
|
|
|
|
|
// // fit: BoxFit.cover,
|
|
|
|
|
// // ).circle(100),
|
|
|
|
|
// // SizedBox(width: 8.h),
|
|
|
|
|
// // Expanded(child: (order.doctorName ?? order.doctorNameEnglish ?? "").toString().toText14(weight: FontWeight.w500)),
|
|
|
|
|
// // ],
|
|
|
|
|
// // ),
|
|
|
|
|
// // SizedBox(height: 8.h),
|
|
|
|
|
// // Wrap(
|
|
|
|
|
// // direction: Axis.horizontal,
|
|
|
|
|
// // spacing: 4.h,
|
|
|
|
|
// // runSpacing: 4.h,
|
|
|
|
|
// // children: [
|
|
|
|
|
// // AppCustomChipWidget(
|
|
|
|
|
// // labelText: ("${LocaleKeys.orderNo.tr(context: context)}: ${order.orderNo!}"), isEnglishOnly: true,
|
|
|
|
|
// // ),
|
|
|
|
|
// // Directionality(
|
|
|
|
|
// // textDirection: ui.TextDirection.ltr,
|
|
|
|
|
// // child: AppCustomChipWidget(
|
|
|
|
|
// // labelText: DateUtil.formatDateToDate(DateUtil.convertStringToDate(order.orderDate ?? ""), false),
|
|
|
|
|
// // isEnglishOnly: true,
|
|
|
|
|
// // )),
|
|
|
|
|
// // AppCustomChipWidget(
|
|
|
|
|
// // labelText: labViewModel.isSortByClinic ? (order.projectName ?? "") : (order.clinicDescription ?? ""),
|
|
|
|
|
// // ),
|
|
|
|
|
// // ],
|
|
|
|
|
// // ),
|
|
|
|
|
// // // Row(
|
|
|
|
|
// // // children: [
|
|
|
|
|
// // // CustomButton(
|
|
|
|
|
// // // text: ("Order No: ".needTranslation + order.orderNo!),
|
|
|
|
|
// // // 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: 24.h,
|
|
|
|
|
// // // ),
|
|
|
|
|
// // // SizedBox(width: 8.h),
|
|
|
|
|
// // // CustomButton(
|
|
|
|
|
// // // text: DateUtil.formatDateToDate(DateUtil.convertStringToDate(order.orderDate ?? ""), false),
|
|
|
|
|
// // // 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: 24.h,
|
|
|
|
|
// // // ),
|
|
|
|
|
// // // ],
|
|
|
|
|
// // // ),
|
|
|
|
|
// // // SizedBox(height: 8.h),
|
|
|
|
|
// // // Row(
|
|
|
|
|
// // // children: [
|
|
|
|
|
// // // CustomButton(
|
|
|
|
|
// // // text: model.isSortByClinic ? (order.clinicDescription ?? "") : (order.projectName ?? ""),
|
|
|
|
|
// // // 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: 24.h,
|
|
|
|
|
// // // ),
|
|
|
|
|
// // // ],
|
|
|
|
|
// // // ),
|
|
|
|
|
// // SizedBox(height: 12.h),
|
|
|
|
|
// // Row(
|
|
|
|
|
// // children: [
|
|
|
|
|
// // Expanded(flex: 2, child: SizedBox()),
|
|
|
|
|
// // // Expanded(
|
|
|
|
|
// // // flex: 1,
|
|
|
|
|
// // // child: Container(
|
|
|
|
|
// // // height: 40.h,
|
|
|
|
|
// // // width: 40.w,
|
|
|
|
|
// // // decoration: RoundedRectangleBorder().toSmoothCornerDecoration(
|
|
|
|
|
// // // color: AppColors.textColor,
|
|
|
|
|
// // // borderRadius: 12,
|
|
|
|
|
// // // ),
|
|
|
|
|
// // // child: Padding(
|
|
|
|
|
// // // padding: EdgeInsets.all(12.h),
|
|
|
|
|
// // // child: Transform.flip(
|
|
|
|
|
// // // flipX: _appState.isArabic(),
|
|
|
|
|
// // // child: Utils.buildSvgWithAssets(
|
|
|
|
|
// // // icon: AppAssets.forward_arrow_icon_small,
|
|
|
|
|
// // // iconColor: AppColors.whiteColor,
|
|
|
|
|
// // // fit: BoxFit.contain,
|
|
|
|
|
// // // ),
|
|
|
|
|
// // // ),
|
|
|
|
|
// // // ),
|
|
|
|
|
// // // ).onPress(() {
|
|
|
|
|
// // // model.currentlySelectedPatientOrder = order;
|
|
|
|
|
// // // labProvider.getPatientLabResultByHospital(order);
|
|
|
|
|
// // // labProvider.getPatientSpecialResult(order);
|
|
|
|
|
// // // Navigator.of(context).push(
|
|
|
|
|
// // // CustomPageRoute(page: LabResultByClinic(labOrder: order)),
|
|
|
|
|
// // // );
|
|
|
|
|
// // // }),
|
|
|
|
|
// // // )
|
|
|
|
|
// //
|
|
|
|
|
// // Expanded(
|
|
|
|
|
// // flex: 2,
|
|
|
|
|
// // child: CustomButton(
|
|
|
|
|
// // icon: AppAssets.view_report_icon,
|
|
|
|
|
// // iconColor: AppColors.primaryRedColor,
|
|
|
|
|
// // iconSize: 16.h,
|
|
|
|
|
// // text: LocaleKeys.viewResults.tr(context: context),
|
|
|
|
|
// // onPressed: () {
|
|
|
|
|
// // labViewModel.currentlySelectedPatientOrder = order;
|
|
|
|
|
// // labProvider.getPatientLabResultByHospital(order);
|
|
|
|
|
// // labProvider.getPatientSpecialResult(order);
|
|
|
|
|
// // Navigator.of(context).push(
|
|
|
|
|
// // CustomPageRoute(page: LabResultByClinic(labOrder: order)),
|
|
|
|
|
// // );
|
|
|
|
|
// // },
|
|
|
|
|
// // 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,
|
|
|
|
|
// // ),
|
|
|
|
|
// // )
|
|
|
|
|
// // ],
|
|
|
|
|
// // ),
|
|
|
|
|
// // SizedBox(height: 12.h),
|
|
|
|
|
// // Divider(color: AppColors.borderOnlyColor.withValues(alpha: 0.05), height: 1.h),
|
|
|
|
|
// // SizedBox(height: 12.h),
|
|
|
|
|
// ],
|
|
|
|
|
// ).paddingOnly(top: 16, bottom: 16);
|
|
|
|
|
// },
|
|
|
|
|
// separatorBuilder: (cxt, index) => Divider(color: AppColors.borderOnlyColor.withValues(alpha: 0.05), height: 1.h),
|
|
|
|
|
// itemCount: 1),
|
|
|
|
|
// SizedBox(height: 16.h),
|
|
|
|
|
// CustomButton(
|
|
|
|
|
// text: LocaleKeys.viewReport.tr(),
|
|
|
|
|
// onPressed: () {
|
|
|
|
|
// model.navigationService.push(
|
|
|
|
|
// CustomPageRoute(
|
|
|
|
|
// page: RadiologyResultPage(patientRadiologyResponseModel: group),
|
|
|
|
|
// ),
|
|
|
|
|
// );
|
|
|
|
|
// },
|
|
|
|
|
// backgroundColor: AppColors.infoColor.withAlpha(20),
|
|
|
|
|
// borderColor: AppColors.infoColor.withAlpha(0),
|
|
|
|
|
// textColor: AppColors.infoColor,
|
|
|
|
|
// fontSize: (isFoldable || isTablet) ? 12.f : 14.f,
|
|
|
|
|
// fontWeight: FontWeight.w500,
|
|
|
|
|
// borderRadius: 12.r,
|
|
|
|
|
// padding: EdgeInsets.fromLTRB(10.w, 0, 10.w, 0),
|
|
|
|
|
// height: 40.h,
|
|
|
|
|
// iconSize: 14.h,
|
|
|
|
|
// icon: AppAssets.view_report_icon,
|
|
|
|
|
// iconColor: AppColors.infoColor,
|
|
|
|
|
// ),
|
|
|
|
|
// SizedBox(height: 16.h),
|
|
|
|
|
// ],
|
|
|
|
|
// ),
|
|
|
|
|
// )
|
|
|
|
|
// : SizedBox.shrink(),
|
|
|
|
|
// ),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
);
|
|
|
|
|
}),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
));
|
|
|
|
|
},
|
|
|
|
|
);
|
|
|
|
|
}),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|