commit
1b5bae2041
@ -0,0 +1,4 @@
|
|||||||
|
<svg width="25" height="24" viewBox="0 0 25 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<path d="M12.5 1.25C8.04419 1.25 4.42789 4.84151 4.42786 9.27697C4.42776 10.3087 4.35838 11.0873 3.88271 11.7872C3.81656 11.8831 3.72879 12.0032 3.63289 12.1345C3.46634 12.3625 3.27527 12.624 3.13033 12.8505C2.87452 13.2503 2.62459 13.7324 2.53868 14.2942C2.25836 16.127 3.55056 17.3136 4.83746 17.8454C9.37016 19.7182 15.6298 19.7182 20.1625 17.8454C21.4494 17.3136 22.7416 16.127 22.4613 14.2942C22.3754 13.7324 22.1255 13.2503 21.8697 12.8505C21.7247 12.624 21.5337 12.3625 21.3671 12.1345C21.2712 12.0033 21.1835 11.8832 21.1173 11.7873C20.6416 11.0874 20.5722 10.3088 20.5721 9.27703C20.5721 4.84155 16.9558 1.25 12.5 1.25Z" fill="white"/>
|
||||||
|
<path d="M12.4985 22.7477C13.5187 22.7477 14.4742 22.4563 15.2776 21.9511C15.9906 21.5027 16.3472 21.2785 16.2224 20.9057C16.0976 20.533 15.6057 20.5747 14.6217 20.6582C13.2146 20.7776 11.7824 20.7776 10.3752 20.6582C9.39126 20.5747 8.8993 20.533 8.77454 20.9057C8.64977 21.2784 9.0063 21.5027 9.71934 21.9511C10.5227 22.4563 11.4782 22.7477 12.4985 22.7477Z" fill="white"/>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 1.1 KiB |
@ -0,0 +1,17 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
|
<plist version="1.0">
|
||||||
|
<dict>
|
||||||
|
<key>aps-environment</key>
|
||||||
|
<string>development</string>
|
||||||
|
<key>com.apple.developer.in-app-payments</key>
|
||||||
|
<array>
|
||||||
|
<string>merchant.com.hmgwebservices</string>
|
||||||
|
<string>merchant.com.hmgwebservices.uat</string>
|
||||||
|
</array>
|
||||||
|
<key>com.apple.developer.nfc.readersession.formats</key>
|
||||||
|
<array>
|
||||||
|
<string>TAG</string>
|
||||||
|
</array>
|
||||||
|
</dict>
|
||||||
|
</plist>
|
||||||
@ -0,0 +1,233 @@
|
|||||||
|
import 'package:easy_localization/easy_localization.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:hmg_patient_app_new/core/app_assets.dart';
|
||||||
|
import 'package:hmg_patient_app_new/core/app_export.dart';
|
||||||
|
import 'package:hmg_patient_app_new/core/utils/calendar_utils.dart';
|
||||||
|
import 'package:hmg_patient_app_new/core/utils/utils.dart';
|
||||||
|
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/features/prescriptions/prescriptions_view_model.dart';
|
||||||
|
import 'package:hmg_patient_app_new/generated/locale_keys.g.dart';
|
||||||
|
import 'package:hmg_patient_app_new/theme/colors.dart';
|
||||||
|
import 'package:hmg_patient_app_new/widgets/buttons/custom_button.dart';
|
||||||
|
|
||||||
|
class PrescriptionItemView extends StatelessWidget {
|
||||||
|
int index;
|
||||||
|
PrescriptionsViewModel prescriptionVM;
|
||||||
|
bool isLoading;
|
||||||
|
|
||||||
|
PrescriptionItemView({Key? key, required this.prescriptionVM, required this.index, this.isLoading = false}) : super(key: key);
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return 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: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
SizedBox(height: 16.h),
|
||||||
|
Row(
|
||||||
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
|
spacing: 8.h,
|
||||||
|
children: [
|
||||||
|
Image.network(
|
||||||
|
isLoading ? "" : prescriptionVM.prescriptionDetailsList[index].imageThumbUrl!,
|
||||||
|
width: 60.h,
|
||||||
|
height: 60.h,
|
||||||
|
errorBuilder: (cxt, child, tr) {
|
||||||
|
return SizedBox(height: 60, width: 60);
|
||||||
|
},
|
||||||
|
fit: BoxFit.fill,
|
||||||
|
).toShimmer2(isShow: isLoading).circle(100),
|
||||||
|
Expanded(
|
||||||
|
child: (isLoading ? "" : prescriptionVM.prescriptionDetailsList[index].itemDescription!).toText16(isBold: true, maxlines: 2).toShimmer2(isShow: isLoading),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
).paddingSymmetrical(16.h, 0.h),
|
||||||
|
SizedBox(height: 16.h),
|
||||||
|
Wrap(
|
||||||
|
direction: Axis.horizontal,
|
||||||
|
spacing: 6.h,
|
||||||
|
runSpacing: 6.h,
|
||||||
|
children: [
|
||||||
|
Row(
|
||||||
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
children: [
|
||||||
|
CustomButton(
|
||||||
|
text: "${LocaleKeys.route.tr(context: context)}: ${isLoading ? "" : prescriptionVM.prescriptionDetailsList[index].route}",
|
||||||
|
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,
|
||||||
|
).toShimmer2(isShow: isLoading),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
Row(
|
||||||
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
children: [
|
||||||
|
CustomButton(
|
||||||
|
text: "${LocaleKeys.frequency.tr(context: context)}: ${isLoading ? "" : prescriptionVM.prescriptionDetailsList[index].frequency}",
|
||||||
|
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,
|
||||||
|
).toShimmer2(isShow: isLoading),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
Row(
|
||||||
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
children: [
|
||||||
|
CustomButton(
|
||||||
|
text: "${LocaleKeys.dailyDoses.tr(context: context)}: ${isLoading ? "" : prescriptionVM.prescriptionDetailsList[index].doseDailyQuantity}",
|
||||||
|
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,
|
||||||
|
).toShimmer2(isShow: isLoading),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
Row(
|
||||||
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
children: [
|
||||||
|
CustomButton(
|
||||||
|
text: "${LocaleKeys.days.tr(context: context)}: ${isLoading ? "" : prescriptionVM.prescriptionDetailsList[index].days}",
|
||||||
|
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,
|
||||||
|
).toShimmer2(isShow: isLoading),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
],
|
||||||
|
).paddingSymmetrical(16.h, 0.h),
|
||||||
|
SizedBox(height: 8.h),
|
||||||
|
if (!isLoading)
|
||||||
|
Row(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Utils.buildSvgWithAssets(icon: AppAssets.prescription_remarks_icon, width: 18.h, height: 18.h),
|
||||||
|
SizedBox(width: 9.h),
|
||||||
|
Expanded(child: "${LocaleKeys.remarks.tr(context: context)}: ${isLoading ? "" : prescriptionVM.prescriptionDetailsList[index].remarks!}".toText10(isBold: true)),
|
||||||
|
],
|
||||||
|
).paddingSymmetrical(16.h, 0.h),
|
||||||
|
SizedBox(height: 14.h),
|
||||||
|
Divider(color: AppColors.borderOnlyColor.withValues(alpha: 0.05), height: 1.h),
|
||||||
|
SizedBox(height: 14.h),
|
||||||
|
Row(
|
||||||
|
mainAxisSize: MainAxisSize.max,
|
||||||
|
children: [
|
||||||
|
Utils.buildSvgWithAssets(icon: AppAssets.prescription_reminder_icon, width: 35.h, height: 35.h).toShimmer2(isShow: isLoading),
|
||||||
|
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),
|
||||||
|
],
|
||||||
|
).toShimmer2(isShow: isLoading).expanded,
|
||||||
|
Switch(
|
||||||
|
activeColor: AppColors.successColor,
|
||||||
|
activeTrackColor: AppColors.successColor.withValues(alpha: .15),
|
||||||
|
value: isLoading ? false : prescriptionVM.prescriptionDetailsList[index].hasReminder!,
|
||||||
|
onChanged: (newValue) async {
|
||||||
|
if (prescriptionVM.prescriptionDetailsList[index].hasReminder ?? false) {
|
||||||
|
await checkAndRemove(prescriptionVM.prescriptionDetailsList[index].hasReminder, delete: true);
|
||||||
|
prescriptionVM.notify();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
DateTime startDate = DateTime.now();
|
||||||
|
DateTime endDate = DateTime(startDate.year, startDate.month, startDate.day + prescriptionVM.prescriptionDetailsList[index].days!.toInt());
|
||||||
|
showReminderBottomSheet(
|
||||||
|
context,
|
||||||
|
endDate,
|
||||||
|
"",
|
||||||
|
prescriptionVM.prescriptionDetailsList[index].itemID.toString(),
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
title: "${prescriptionVM.prescriptionDetailsList[index].itemDescription} Prescription Reminder",
|
||||||
|
description:
|
||||||
|
"${prescriptionVM.prescriptionDetailsList[index].itemDescription} ${prescriptionVM.prescriptionDetailsList[index].frequency} ${prescriptionVM.prescriptionDetailsList[index].route} ",
|
||||||
|
onSuccess: () {
|
||||||
|
prescriptionVM.setPrescriptionItemReminder(newValue, prescriptionVM.prescriptionDetailsList[index]);
|
||||||
|
},
|
||||||
|
isMultiAllowed: true,
|
||||||
|
onMultiDateSuccess: (int selectedIndex) {
|
||||||
|
setCalender(context,
|
||||||
|
eventId: prescriptionVM.prescriptionDetailsList[index].itemID.toString(),
|
||||||
|
selectedMinutes: selectedIndex,
|
||||||
|
frequencyNumber: prescriptionVM.prescriptionDetailsList[index].frequencyNumber?.toInt(),
|
||||||
|
days: prescriptionVM.prescriptionDetailsList[index].days!.toInt(),
|
||||||
|
orderDate: prescriptionVM.prescriptionDetailsList[index].orderDate!,
|
||||||
|
itemDescriptionN: prescriptionVM.prescriptionDetailsList[index].itemDescription!,
|
||||||
|
route: prescriptionVM.prescriptionDetailsList[index].route!);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
},
|
||||||
|
).toShimmer2(isShow: isLoading),
|
||||||
|
],
|
||||||
|
).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,
|
||||||
|
).toShimmer2(isShow: isLoading),
|
||||||
|
),
|
||||||
|
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,
|
||||||
|
).toShimmer2(isShow: isLoading),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
).paddingSymmetrical(16.h, 16.h),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,116 @@
|
|||||||
|
import 'package:easy_localization/easy_localization.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:hmg_patient_app_new/core/app_assets.dart';
|
||||||
|
import 'package:hmg_patient_app_new/core/app_export.dart';
|
||||||
|
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/theme/colors.dart';
|
||||||
|
import 'package:hmg_patient_app_new/widgets/buttons/custom_button.dart';
|
||||||
|
|
||||||
|
class PrescriptionReminderView extends StatefulWidget {
|
||||||
|
Function(int) setReminder;
|
||||||
|
|
||||||
|
PrescriptionReminderView({Key? key, required this.setReminder}) : super(key: key);
|
||||||
|
|
||||||
|
@override
|
||||||
|
_PrescriptionReminderViewState createState() {
|
||||||
|
return _PrescriptionReminderViewState();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class _PrescriptionReminderViewState extends State<PrescriptionReminderView> {
|
||||||
|
final List<int> _options = [15, 30, 60, 90];
|
||||||
|
int _selectedOption = 0; // Nullable to represent no selection initially
|
||||||
|
|
||||||
|
@override
|
||||||
|
void initState() {
|
||||||
|
super.initState();
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
void dispose() {
|
||||||
|
super.dispose();
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Column(
|
||||||
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
spacing: 16.h,
|
||||||
|
children: [
|
||||||
|
Container(
|
||||||
|
width: double.infinity,
|
||||||
|
decoration: RoundedRectangleBorder().toSmoothCornerDecoration(color: AppColors.whiteColor, borderRadius: 24),
|
||||||
|
child: ListView.builder(
|
||||||
|
itemCount: _options.length,
|
||||||
|
physics: NeverScrollableScrollPhysics(),
|
||||||
|
padding: EdgeInsets.only(top: 8, bottom: 8),
|
||||||
|
shrinkWrap: true,
|
||||||
|
itemBuilder: (context, index) {
|
||||||
|
return Theme(
|
||||||
|
data: Theme.of(context).copyWith(
|
||||||
|
listTileTheme: ListTileThemeData(horizontalTitleGap: 4),
|
||||||
|
),
|
||||||
|
child: RadioListTile<int>(
|
||||||
|
title: Text(
|
||||||
|
"${_options[index]} minutes before".needTranslation,
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 16.h,
|
||||||
|
fontWeight: FontWeight.w500,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
value: index,
|
||||||
|
fillColor: WidgetStateProperty.resolveWith((states) {
|
||||||
|
if (states.contains(WidgetState.selected)) {
|
||||||
|
return AppColors.primaryRedColor;
|
||||||
|
}
|
||||||
|
return Color(0xffEEEEEE);
|
||||||
|
}),
|
||||||
|
contentPadding: EdgeInsets.only(left: 12.h, right: 12.h),
|
||||||
|
groupValue: _selectedOption,
|
||||||
|
onChanged: (int? newValue) {
|
||||||
|
setState(() {
|
||||||
|
_selectedOption = newValue!;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Row(
|
||||||
|
spacing: 16.h,
|
||||||
|
children: [
|
||||||
|
Expanded(
|
||||||
|
child: CustomButton(
|
||||||
|
text: LocaleKeys.cancel.tr(),
|
||||||
|
onPressed: () {
|
||||||
|
Navigator.of(context).pop();
|
||||||
|
},
|
||||||
|
backgroundColor: AppColors.secondaryLightRedColor,
|
||||||
|
borderColor: AppColors.secondaryLightRedColor,
|
||||||
|
textColor: AppColors.primaryRedColor,
|
||||||
|
icon: AppAssets.cancel,
|
||||||
|
iconColor: AppColors.primaryRedColor,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Expanded(
|
||||||
|
child: CustomButton(
|
||||||
|
text: LocaleKeys.setReminder.tr(),
|
||||||
|
onPressed: () {
|
||||||
|
Navigator.of(context).pop();
|
||||||
|
widget.setReminder(_selectedOption);
|
||||||
|
},
|
||||||
|
backgroundColor: AppColors.bgGreenColor,
|
||||||
|
borderColor: AppColors.bgGreenColor,
|
||||||
|
textColor: Colors.white,
|
||||||
|
icon: AppAssets.reminder_bell,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue