|
|
|
|
@ -29,6 +29,8 @@ class PrescriptionDetailPage extends StatefulWidget {
|
|
|
|
|
class _PrescriptionDetailPageState extends State<PrescriptionDetailPage> {
|
|
|
|
|
late PrescriptionsViewModel prescriptionsViewModel;
|
|
|
|
|
|
|
|
|
|
bool _isSwitched = false; // Initial state of the switch
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
void initState() {
|
|
|
|
|
scheduleMicrotask(() {
|
|
|
|
|
@ -46,7 +48,10 @@ class _PrescriptionDetailPageState extends State<PrescriptionDetailPage> {
|
|
|
|
|
title: LocaleKeys.prescriptions.tr(context: context).toText18(),
|
|
|
|
|
backgroundColor: AppColors.bgScaffoldColor,
|
|
|
|
|
),
|
|
|
|
|
body: SingleChildScrollView(
|
|
|
|
|
body: Column(
|
|
|
|
|
children: [
|
|
|
|
|
Expanded(
|
|
|
|
|
child: SingleChildScrollView(
|
|
|
|
|
child: Consumer<PrescriptionsViewModel>(builder: (context, prescriptionVM, child) {
|
|
|
|
|
return Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
@ -290,9 +295,68 @@ class _PrescriptionDetailPageState extends State<PrescriptionDetailPage> {
|
|
|
|
|
Expanded(child: "${LocaleKeys.remarks.tr(context: context)}: ${prescriptionVM.prescriptionDetailsList[index].remarks!}".toText10(isBold: true)),
|
|
|
|
|
],
|
|
|
|
|
).paddingSymmetrical(16.h, 0.h),
|
|
|
|
|
SizedBox(height: 16.h),
|
|
|
|
|
SizedBox(height: 14.h),
|
|
|
|
|
Divider(color: AppColors.borderOnlyColor.withValues(alpha: 0.05), height: 1.h),
|
|
|
|
|
SizedBox(height: 16.h),
|
|
|
|
|
SizedBox(height: 14.h),
|
|
|
|
|
Row(
|
|
|
|
|
mainAxisSize: MainAxisSize.max,
|
|
|
|
|
children: [
|
|
|
|
|
Utils.buildSvgWithAssets(icon: AppAssets.prescription_reminder_icon, width: 35.h, height: 35.h),
|
|
|
|
|
SizedBox(width: 8.h),
|
|
|
|
|
Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
LocaleKeys.setReminder.tr(context: context).toText13(isBold: true),
|
|
|
|
|
"Notify me before the consumption time".toText10(color: AppColors.textColorLight),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
SizedBox(width: 12.h),
|
|
|
|
|
Switch(
|
|
|
|
|
activeColor: AppColors.successColor,
|
|
|
|
|
value: prescriptionVM.prescriptionDetailsList[index].hasReminder!,
|
|
|
|
|
onChanged: (newValue) {
|
|
|
|
|
setState(() {
|
|
|
|
|
prescriptionVM.setPrescriptionItemReminder(newValue, prescriptionVM.prescriptionDetailsList[index]);
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
).paddingSymmetrical(16.h, 0.h),
|
|
|
|
|
SizedBox(height: 14.h),
|
|
|
|
|
Divider(color: AppColors.borderOnlyColor.withValues(alpha: 0.05), height: 1.h),
|
|
|
|
|
Row(
|
|
|
|
|
children: [
|
|
|
|
|
Expanded(
|
|
|
|
|
child: CustomButton(
|
|
|
|
|
text: LocaleKeys.checkAvailability.tr(context: context),
|
|
|
|
|
onPressed: () {},
|
|
|
|
|
backgroundColor: AppColors.primaryRedColor.withOpacity(0.1),
|
|
|
|
|
borderColor: AppColors.primaryRedColor.withOpacity(0.0),
|
|
|
|
|
textColor: AppColors.primaryRedColor,
|
|
|
|
|
fontSize: 13,
|
|
|
|
|
fontWeight: FontWeight.w500,
|
|
|
|
|
borderRadius: 12,
|
|
|
|
|
padding: EdgeInsets.fromLTRB(10, 0, 10, 0),
|
|
|
|
|
height: 40.h,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
SizedBox(width: 16.h),
|
|
|
|
|
Expanded(
|
|
|
|
|
child: CustomButton(
|
|
|
|
|
text: LocaleKeys.readInstructions.tr(context: context),
|
|
|
|
|
onPressed: () {},
|
|
|
|
|
backgroundColor: AppColors.primaryRedColor,
|
|
|
|
|
borderColor: AppColors.primaryRedColor,
|
|
|
|
|
textColor: AppColors.whiteColor,
|
|
|
|
|
fontSize: 13,
|
|
|
|
|
fontWeight: FontWeight.w500,
|
|
|
|
|
borderRadius: 12,
|
|
|
|
|
padding: EdgeInsets.fromLTRB(10, 0, 10, 0),
|
|
|
|
|
height: 40.h,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
).paddingSymmetrical(16.h, 16.h),
|
|
|
|
|
],
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
@ -307,6 +371,31 @@ class _PrescriptionDetailPageState extends State<PrescriptionDetailPage> {
|
|
|
|
|
);
|
|
|
|
|
}),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
decoration: RoundedRectangleBorder().toSmoothCornerDecoration(
|
|
|
|
|
color: AppColors.whiteColor,
|
|
|
|
|
borderRadius: 24.h,
|
|
|
|
|
hasShadow: true,
|
|
|
|
|
),
|
|
|
|
|
child: CustomButton(
|
|
|
|
|
text: widget.prescriptionsResponseModel.isHomeMedicineDeliverySupported! ? LocaleKeys.resendOrder.tr(context: context) : LocaleKeys.prescriptionDeliveryError.tr(context: context),
|
|
|
|
|
onPressed: () {},
|
|
|
|
|
backgroundColor: widget.prescriptionsResponseModel.isHomeMedicineDeliverySupported! ? AppColors.successColor : AppColors.greyF7Color,
|
|
|
|
|
borderColor: AppColors.successColor.withOpacity(0.01),
|
|
|
|
|
textColor: widget.prescriptionsResponseModel.isHomeMedicineDeliverySupported! ? AppColors.whiteColor : AppColors.textColor.withOpacity(0.35),
|
|
|
|
|
fontSize: 16,
|
|
|
|
|
fontWeight: FontWeight.w500,
|
|
|
|
|
borderRadius: 12,
|
|
|
|
|
padding: EdgeInsets.fromLTRB(10, 0, 10, 0),
|
|
|
|
|
height: 50.h,
|
|
|
|
|
icon: AppAssets.prescription_refill_icon,
|
|
|
|
|
iconColor: widget.prescriptionsResponseModel.isHomeMedicineDeliverySupported! ? AppColors.whiteColor : AppColors.textColor.withOpacity(0.35),
|
|
|
|
|
iconSize: 20.h,
|
|
|
|
|
).paddingSymmetrical(24.h, 24.h),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|