|
|
|
|
@ -11,7 +11,7 @@ import 'package:hmg_patient_app_new/extensions/string_extensions.dart';
|
|
|
|
|
import 'package:hmg_patient_app_new/extensions/widget_extensions.dart';
|
|
|
|
|
import 'package:hmg_patient_app_new/generated/locale_keys.g.dart';
|
|
|
|
|
import 'package:hmg_patient_app_new/features/lab/lab_view_model.dart';
|
|
|
|
|
import 'package:hmg_patient_app_new/presentation/lab/collapsing_list_view.dart';
|
|
|
|
|
import 'package:hmg_patient_app_new/widgets/appbar/collapsing_list_view.dart';
|
|
|
|
|
import 'package:hmg_patient_app_new/presentation/radiology/radiology_result_page.dart';
|
|
|
|
|
import 'package:hmg_patient_app_new/theme/colors.dart';
|
|
|
|
|
import 'package:hmg_patient_app_new/widgets/buttons/custom_button.dart';
|
|
|
|
|
@ -61,130 +61,136 @@ class _RadiologyOrdersPageState extends State<RadiologyOrdersPage> {
|
|
|
|
|
ListView.builder(
|
|
|
|
|
shrinkWrap: true,
|
|
|
|
|
physics: NeverScrollableScrollPhysics(),
|
|
|
|
|
itemCount: model.isRadiologyOrdersLoading ? 5 : model.patientRadiologyOrders.length,
|
|
|
|
|
itemCount: model.isRadiologyOrdersLoading
|
|
|
|
|
? 5
|
|
|
|
|
: model.patientRadiologyOrders.isNotEmpty
|
|
|
|
|
? model.patientRadiologyOrders.length
|
|
|
|
|
: 1,
|
|
|
|
|
itemBuilder: (context, index) {
|
|
|
|
|
final isExpanded = expandedIndex == index;
|
|
|
|
|
return AnimationConfiguration.staggeredList(
|
|
|
|
|
position: index,
|
|
|
|
|
duration: const Duration(milliseconds: 500),
|
|
|
|
|
child: SlideAnimation(
|
|
|
|
|
verticalOffset: 100.0,
|
|
|
|
|
child: FadeInAnimation(
|
|
|
|
|
child: AnimatedContainer(
|
|
|
|
|
duration: 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;
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
Padding(
|
|
|
|
|
padding: EdgeInsets.all(16.h),
|
|
|
|
|
return model.patientRadiologyOrders.isNotEmpty
|
|
|
|
|
? AnimationConfiguration.staggeredList(
|
|
|
|
|
position: index,
|
|
|
|
|
duration: const Duration(milliseconds: 500),
|
|
|
|
|
child: SlideAnimation(
|
|
|
|
|
verticalOffset: 100.0,
|
|
|
|
|
child: FadeInAnimation(
|
|
|
|
|
child: AnimatedContainer(
|
|
|
|
|
duration: 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;
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
AppCustomChipWidget(
|
|
|
|
|
labelText: LocaleKeys.resultsAvailable.tr(context: context),
|
|
|
|
|
backgroundColor: AppColors.successColor.withOpacity(0.15),
|
|
|
|
|
textColor: AppColors.successColor,
|
|
|
|
|
).toShimmer2(isShow: model.isRadiologyOrdersLoading, width: 100),
|
|
|
|
|
SizedBox(height: 8.h),
|
|
|
|
|
Row(
|
|
|
|
|
children: [
|
|
|
|
|
Image.network(
|
|
|
|
|
model.isRadiologyOrdersLoading
|
|
|
|
|
? "https://hmgwebservices.com/Images/MobileImages/DUBAI/unkown_female.png"
|
|
|
|
|
: model.patientRadiologyOrders[index].doctorImageURL!,
|
|
|
|
|
width: 24.h,
|
|
|
|
|
height: 24.h,
|
|
|
|
|
fit: BoxFit.fill,
|
|
|
|
|
).circle(100).toShimmer2(isShow: model.isRadiologyOrdersLoading),
|
|
|
|
|
SizedBox(width: 4.h),
|
|
|
|
|
(model.isRadiologyOrdersLoading ? "Dr John Smith" : model.patientRadiologyOrders[index].doctorName!)
|
|
|
|
|
.toText16(isBold: true)
|
|
|
|
|
.toShimmer2(isShow: model.isRadiologyOrdersLoading)
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
SizedBox(height: 8.h),
|
|
|
|
|
Wrap(
|
|
|
|
|
direction: Axis.horizontal,
|
|
|
|
|
spacing: 3.h,
|
|
|
|
|
runSpacing: 4.h,
|
|
|
|
|
children: [
|
|
|
|
|
AppCustomChipWidget(
|
|
|
|
|
icon: AppAssets.doctor_calendar_icon,
|
|
|
|
|
labelText: model.isRadiologyOrdersLoading ? "01 Jan 2025" : DateUtil.formatDateToDate(model.patientRadiologyOrders[index].orderDate!, false),
|
|
|
|
|
).toShimmer2(isShow: model.isRadiologyOrdersLoading),
|
|
|
|
|
AppCustomChipWidget(
|
|
|
|
|
labelText: model.isRadiologyOrdersLoading ? "01 Jan 2025" : model.patientRadiologyOrders[index].clinicDescription!,
|
|
|
|
|
).toShimmer2(isShow: model.isRadiologyOrdersLoading),
|
|
|
|
|
Padding(
|
|
|
|
|
padding: EdgeInsets.all(16.h),
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
AppCustomChipWidget(
|
|
|
|
|
labelText: LocaleKeys.resultsAvailable.tr(context: context),
|
|
|
|
|
backgroundColor: AppColors.successColor.withOpacity(0.15),
|
|
|
|
|
textColor: AppColors.successColor,
|
|
|
|
|
).toShimmer2(isShow: model.isRadiologyOrdersLoading, width: 100),
|
|
|
|
|
SizedBox(height: 8.h),
|
|
|
|
|
Row(
|
|
|
|
|
children: [
|
|
|
|
|
Image.network(
|
|
|
|
|
model.isRadiologyOrdersLoading
|
|
|
|
|
? "https://hmgwebservices.com/Images/MobileImages/DUBAI/unkown_female.png"
|
|
|
|
|
: model.patientRadiologyOrders[index].doctorImageURL!,
|
|
|
|
|
width: 24.h,
|
|
|
|
|
height: 24.h,
|
|
|
|
|
fit: BoxFit.fill,
|
|
|
|
|
).circle(100).toShimmer2(isShow: model.isRadiologyOrdersLoading),
|
|
|
|
|
SizedBox(width: 4.h),
|
|
|
|
|
(model.isRadiologyOrdersLoading ? "Dr John Smith" : model.patientRadiologyOrders[index].doctorName!)
|
|
|
|
|
.toText16(isBold: true)
|
|
|
|
|
.toShimmer2(isShow: model.isRadiologyOrdersLoading)
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
SizedBox(height: 8.h),
|
|
|
|
|
Wrap(
|
|
|
|
|
direction: Axis.horizontal,
|
|
|
|
|
spacing: 3.h,
|
|
|
|
|
runSpacing: 4.h,
|
|
|
|
|
children: [
|
|
|
|
|
AppCustomChipWidget(
|
|
|
|
|
icon: AppAssets.doctor_calendar_icon,
|
|
|
|
|
labelText: model.isRadiologyOrdersLoading ? "01 Jan 2025" : DateUtil.formatDateToDate(model.patientRadiologyOrders[index].orderDate!, false),
|
|
|
|
|
).toShimmer2(isShow: model.isRadiologyOrdersLoading),
|
|
|
|
|
AppCustomChipWidget(
|
|
|
|
|
labelText: model.isRadiologyOrdersLoading ? "01 Jan 2025" : model.patientRadiologyOrders[index].clinicDescription!,
|
|
|
|
|
).toShimmer2(isShow: model.isRadiologyOrdersLoading),
|
|
|
|
|
|
|
|
|
|
// AppCustomChipWidget(labelText: "").toShimmer2(isShow: model.isRadiologyOrdersLoading, width: 16.h),
|
|
|
|
|
// AppCustomChipWidget(labelText: "").toShimmer2(isShow: model.isRadiologyOrdersLoading, width: 16.h),
|
|
|
|
|
],
|
|
|
|
|
// AppCustomChipWidget(labelText: "").toShimmer2(isShow: model.isRadiologyOrdersLoading, width: 16.h),
|
|
|
|
|
// AppCustomChipWidget(labelText: "").toShimmer2(isShow: model.isRadiologyOrdersLoading, width: 16.h),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
model.isRadiologyOrdersLoading
|
|
|
|
|
? SizedBox.shrink()
|
|
|
|
|
: AnimatedCrossFade(
|
|
|
|
|
firstChild: SizedBox.shrink(),
|
|
|
|
|
secondChild: Padding(
|
|
|
|
|
padding: EdgeInsets.symmetric(horizontal: 16.h, vertical: 8.h),
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
Padding(
|
|
|
|
|
padding: EdgeInsets.only(bottom: 8.h),
|
|
|
|
|
child: '● ${model.patientRadiologyOrders[index].description}'.toText14(weight: FontWeight.w500),
|
|
|
|
|
),
|
|
|
|
|
Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
children: [
|
|
|
|
|
SizedBox(),
|
|
|
|
|
CustomButton(
|
|
|
|
|
icon: AppAssets.view_report_icon,
|
|
|
|
|
iconColor: AppColors.primaryRedColor,
|
|
|
|
|
iconSize: 16.h,
|
|
|
|
|
text: LocaleKeys.viewReport.tr(context: context),
|
|
|
|
|
onPressed: () {
|
|
|
|
|
Navigator.of(context).push(
|
|
|
|
|
CustomPageRoute(
|
|
|
|
|
page: RadiologyResultPage(patientRadiologyResponseModel: model.patientRadiologyOrders[index]),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
backgroundColor: AppColors.secondaryLightRedColor,
|
|
|
|
|
borderColor: AppColors.secondaryLightRedColor,
|
|
|
|
|
textColor: AppColors.primaryRedColor,
|
|
|
|
|
fontSize: 14,
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
borderRadius: 12,
|
|
|
|
|
padding: EdgeInsets.fromLTRB(10, 0, 10, 0),
|
|
|
|
|
height: 40.h,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
crossFadeState: isExpanded ? CrossFadeState.showSecond : CrossFadeState.showFirst,
|
|
|
|
|
duration: Duration(milliseconds: 300),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
model.isRadiologyOrdersLoading
|
|
|
|
|
? SizedBox.shrink()
|
|
|
|
|
: AnimatedCrossFade(
|
|
|
|
|
firstChild: SizedBox.shrink(),
|
|
|
|
|
secondChild: Padding(
|
|
|
|
|
padding: EdgeInsets.symmetric(horizontal: 16.h, vertical: 8.h),
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
Padding(
|
|
|
|
|
padding: EdgeInsets.only(bottom: 8.h),
|
|
|
|
|
child: '● ${model.patientRadiologyOrders[index].description}'.toText14(weight: FontWeight.w500),
|
|
|
|
|
),
|
|
|
|
|
Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
children: [
|
|
|
|
|
SizedBox(),
|
|
|
|
|
CustomButton(
|
|
|
|
|
icon: AppAssets.view_report_icon,
|
|
|
|
|
iconColor: AppColors.primaryRedColor,
|
|
|
|
|
iconSize: 16.h,
|
|
|
|
|
text: LocaleKeys.viewReport.tr(context: context),
|
|
|
|
|
onPressed: () {
|
|
|
|
|
Navigator.of(context).push(
|
|
|
|
|
CustomPageRoute(
|
|
|
|
|
page: RadiologyResultPage(patientRadiologyResponseModel: model.patientRadiologyOrders[index]),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
backgroundColor: AppColors.secondaryLightRedColor,
|
|
|
|
|
borderColor: AppColors.secondaryLightRedColor,
|
|
|
|
|
textColor: AppColors.primaryRedColor,
|
|
|
|
|
fontSize: 14,
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
borderRadius: 12,
|
|
|
|
|
padding: EdgeInsets.fromLTRB(10, 0, 10, 0),
|
|
|
|
|
height: 40.h,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
crossFadeState: isExpanded ? CrossFadeState.showSecond : CrossFadeState.showFirst,
|
|
|
|
|
duration: Duration(milliseconds: 300),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
)
|
|
|
|
|
: Utils.getNoDataWidget(context, noDataText: "You don't have any radiology results yet.".needTranslation);
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
|