diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 6e2bc9ad..2987e621a 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -646,8 +646,8 @@ const Map localizedValues = { "Remarks": {"en": "Remarks", "ar": "ملاحضات"}, "ActiveMedications": {"en": "Active Medications", "ar": "ادويتي النشطة"}, "ExpDate": {"en": "Active Exp Date :", "VA": "تاريخ الإنتهاء"}, - "Route": {"en": "Route :", "ar": "الطريقة"}, - "Frequency": {"en": "Frequency :", "ar": "المعدل"}, + "Route": {"en": "Route", "ar": "الطريقة"}, + "Frequency": {"en": "Frequency", "ar": "المعدل"}, "DailyQuantity": {"en": "Daily Quantity :", "ar": "جرعات يومية"}, "AddReminder": {"en": "Add Reminder", "ar": "إضافة تذكير"}, "reminderDes": { @@ -1088,6 +1088,7 @@ const Map localizedValues = { "Average": {"en": "Average", "ar": "المعدل"}, "DailyDoses": {"en": "Daily Doses", "ar": "جرعات يومية"}, "Period": {"en": "Period", "ar": "الفترة"}, + "duration": {"en": "Duration", "ar": "المدة"}, "cm": {"en": "CM", "ar": "سم"}, "ft": {"en": "ft", "ar": "قدم"}, "kg": {"en": "kg", "ar": "كجم"}, diff --git a/lib/core/model/prescriptions/prescription_report.dart b/lib/core/model/prescriptions/prescription_report.dart index 51f5750f..8c18df62 100644 --- a/lib/core/model/prescriptions/prescription_report.dart +++ b/lib/core/model/prescriptions/prescription_report.dart @@ -1,127 +1,193 @@ import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; class PrescriptionReport { + String address; + int appointmentNo; + String clinic; + String companyName; + int days; + String doctorName; + var doseDailyQuantity; + String frequency; + int frequencyNumber; + String image; + String imageExtension; + String imageSRCUrl; + String imageString; + String imageThumbUrl; + String isCovered; + String itemDescription; + int itemID; + String orderDate; int patientID; String patientName; + String phoneOffice1; + String prescriptionQR; + int prescriptionTimes; + String productImage; + String productImageBase64; + String productImageString; + int projectID; + String projectName; + String remarks; + String route; + String sKU; + int scaleOffset; + String startDate; + String patientAge; String patientGender; - String address; String phoneOffice; - String itemDescription; int doseTimingID; int frequencyID; int routeID; - String clinic; - String doctorName; - String route; - String frequency; - String remarks; String name; - int days; - String startDate; - String orderDate; - int doseDailyQuantity; - int itemID; - Null productImage; - String sKU; String itemDescriptionN; String routeN; String frequencyN; - String imageSRCUrl; - String imageThumbUrl; - PrescriptionReport( - {this.patientID, - this.patientName, - this.patientAge, - this.patientGender, - this.address, - this.phoneOffice, - this.itemDescription, - this.doseTimingID, - this.frequencyID, - this.routeID, - this.clinic, - this.doctorName, - this.route, - this.frequency, - this.remarks, - this.name, - this.days, - this.startDate, - this.orderDate, - this.doseDailyQuantity, - this.itemID, - this.productImage, - this.sKU, - this.itemDescriptionN, - this.routeN, - this.frequencyN, - this.imageSRCUrl, - this.imageThumbUrl}); + PrescriptionReport({ + this.address, + this.appointmentNo, + this.clinic, + this.companyName, + this.days, + this.doctorName, + this.doseDailyQuantity, + this.frequency, + this.frequencyNumber, + this.image, + this.imageExtension, + this.imageSRCUrl, + this.imageString, + this.imageThumbUrl, + this.isCovered, + this.itemDescription, + this.itemID, + this.orderDate, + this.patientID, + this.patientName, + this.phoneOffice1, + this.prescriptionQR, + this.prescriptionTimes, + this.productImage, + this.productImageBase64, + this.productImageString, + this.projectID, + this.projectName, + this.remarks, + this.route, + this.sKU, + this.scaleOffset, + this.startDate, + this.patientAge, + this.patientGender, + this.phoneOffice, + this.doseTimingID, + this.frequencyID, + this.routeID, + this.name, + this.itemDescriptionN, + this.routeN, + this.frequencyN, + }); PrescriptionReport.fromJson(Map json) { - patientID = json['PatientID']; - patientName = json['PatientName']; - patientAge = json['PatientAge']; - patientGender = json['PatientGender']; address = json['Address']; - phoneOffice = json['PhoneOffice']; - itemDescription = json['ItemDescription']; - doseTimingID = json['DoseTimingID']; - frequencyID = json['FrequencyID']; - routeID = json['RouteID']; + appointmentNo = json['AppointmentNo']; clinic = json['Clinic']; - doctorName = json['DoctorName']; - route = json['Route']; - frequency = json['Frequency']; - remarks = json['Remarks']; - name = json['Name']; + companyName = json['CompanyName']; days = json['Days']; - startDate = json['StartDate']; - orderDate = json['OrderDate']; + doctorName = json['DoctorName']; doseDailyQuantity = json['DoseDailyQuantity']; + frequency = json['Frequency']; + frequencyNumber = json['FrequencyNumber']; + image = json['Image']; + imageExtension = json['ImageExtension']; + imageSRCUrl = json['ImageSRCUrl']; + imageString = json['ImageString']; + imageThumbUrl = json['ImageThumbUrl']; + isCovered = json['IsCovered']; + itemDescription = json['ItemDescription']; itemID = json['ItemID']; + orderDate = json['OrderDate']; + patientID = json['PatientID']; + patientName = json['PatientName']; + phoneOffice1 = json['PhoneOffice1']; + prescriptionQR = json['PrescriptionQR']; + prescriptionTimes = json['PrescriptionTimes']; productImage = json['ProductImage']; + productImageBase64 = json['ProductImageBase64']; + productImageString = json['ProductImageString']; + projectID = json['ProjectID']; + projectName = json['ProjectName']; + remarks = json['Remarks']; + route = json['Route']; sKU = json['SKU']; - itemDescriptionN = json['ItemDescriptionN']; - routeN = json['RouteN']; - frequencyN = json['FrequencyN']; - imageSRCUrl = json['ImageSRCUrl']; - imageThumbUrl = json['ImageThumbUrl']; + scaleOffset = json['ScaleOffset']; + startDate = json['StartDate']; + + patientAge = json['patientAge']; + patientGender = json['patientGender']; + phoneOffice = json['phoneOffice']; + doseTimingID = json['doseTimingID']; + frequencyID = json['frequencyID']; + routeID = json['routeID']; + name = json['name']; + itemDescriptionN = json['itemDescriptionN']; + routeN = json['routeN']; + frequencyN = json['frequencyN']; } Map toJson() { final Map data = new Map(); + + data['Address'] = this.address; + data['AppointmentNo'] = this.appointmentNo; + data['Clinic'] = this.clinic; + data['CompanyName'] = this.companyName; + data['Days'] = this.days; + data['DoctorName'] = this.doctorName; + data['DoseDailyQuantity'] = this.doseDailyQuantity; + data['Frequency'] = this.frequency; + data['FrequencyNumber'] = this.frequencyNumber; + data['Image'] = this.image; + data['ImageExtension'] = this.imageExtension; + data['ImageSRCUrl'] = this.imageSRCUrl; + data['ImageString'] = this.imageString; + data['ImageThumbUrl'] = this.imageThumbUrl; + data['IsCovered'] = this.isCovered; + data['ItemDescription'] = this.itemDescription; + data['ItemID'] = this.itemID; + data['OrderDate'] = this.orderDate; data['PatientID'] = this.patientID; data['PatientName'] = this.patientName; + data['PhoneOffice1'] = this.phoneOffice1; + data['PrescriptionQR'] = this.prescriptionQR; + data['PrescriptionTimes'] = this.prescriptionTimes; + data['ProductImage'] = this.productImage; + data['ProductImageBase64'] = this.productImageBase64; + data['ProductImageString'] = this.productImageString; + data['ProjectID'] = this.projectID; + data['ProjectName'] = this.projectName; + data['Remarks'] = this.remarks; + data['Route'] = this.route; + data['SKU'] = this.sKU; + data['ScaleOffset'] = this.scaleOffset; + data['StartDate'] = this.startDate; + data['PatientAge'] = this.patientAge; data['PatientGender'] = this.patientGender; - data['Address'] = this.address; data['PhoneOffice'] = this.phoneOffice; - data['ItemDescription'] = this.itemDescription; data['DoseTimingID'] = this.doseTimingID; data['FrequencyID'] = this.frequencyID; data['RouteID'] = this.routeID; - data['Clinic'] = this.clinic; - data['DoctorName'] = this.doctorName; - data['Route'] = this.route; - data['Frequency'] = this.frequency; - data['Remarks'] = this.remarks; data['Name'] = this.name; - data['Days'] = this.days; - data['StartDate'] = this.startDate; - data['OrderDate'] = this.orderDate; - data['DoseDailyQuantity'] = this.doseDailyQuantity; - data['ItemID'] = this.itemID; - data['ProductImage'] = this.productImage; - data['SKU'] = this.sKU; data['ItemDescriptionN'] = this.itemDescriptionN; data['RouteN'] = this.routeN; data['FrequencyN'] = this.frequencyN; - data['ImageSRCUrl'] = this.imageSRCUrl; - data['ImageThumbUrl'] = this.imageThumbUrl; data['hasPlan'] = false; + return data; } } diff --git a/lib/core/service/weather_service.dart b/lib/core/service/weather_service.dart index 10ab1adf..ea7d65bf 100644 --- a/lib/core/service/weather_service.dart +++ b/lib/core/service/weather_service.dart @@ -18,10 +18,9 @@ class WeatherService extends BaseService { var long = await sharedPref.getDouble(USER_LONG); body['Latitude'] = lat ?? 0; body['Longitude'] = long ?? 0; - + weatherIndicatorData = []; await baseAppClient.post(WEATHER_INDICATOR, onSuccess: (dynamic response, int statusCode) { - weatherIndicatorData = []; response['GetCityInfo_List'].forEach((data) { weatherIndicatorData.add(GetCityInfoList.fromJson(data)); }); diff --git a/lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrdersDetails.dart b/lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrdersDetails.dart index dc0d73d4..20d2966b 100644 --- a/lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrdersDetails.dart +++ b/lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrdersDetails.dart @@ -1,6 +1,7 @@ import 'package:diplomaticquarterapp/core/viewModels/ancillary_orders_view_model.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:flutter/material.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; @@ -42,7 +43,31 @@ class _AnicllaryOrdersState extends State getPatientInfo(model), getInvoiceDetails(model), getInsuranceDetails(model), - getAncillaryDetails(model) + getAncillaryDetails(model), + Row( + mainAxisAlignment: MainAxisAlignment.spaceAround, + children: [ + Texts( + TranslationBase.of(context).total, + fontSize: 20, + fontWeight: FontWeight.bold, + ), + Texts( + getTotalValue(model), + fontSize: 20, + fontWeight: FontWeight.bold, + ) + ], + ), + Row( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + Button( + label: TranslationBase.of(context).payNow, + onTap: () {}, + ) + ], + ) ]) : SizedBox()))); } @@ -208,7 +233,9 @@ class _AnicllaryOrdersState extends State ); list.add(Row( mainAxisAlignment: MainAxisAlignment.start, - children: [getLabDetails(value)], + children: [ + getLabDetails(value), + ], )); }); @@ -218,6 +245,13 @@ class _AnicllaryOrdersState extends State ); } + String getTotalValue(value) { + double total = 0.0; + value.ancillaryListsDetails[0].ancillaryOrderProcList + .forEach((result) => {total += result.companyShareWithTax}); + return total.toStringAsFixed(2); + } + getLabDetails(value) { return Column( crossAxisAlignment: CrossAxisAlignment.start, diff --git a/lib/pages/DrawerPages/family/my-family.dart b/lib/pages/DrawerPages/family/my-family.dart index 0a5c5091..07f99b16 100644 --- a/lib/pages/DrawerPages/family/my-family.dart +++ b/lib/pages/DrawerPages/family/my-family.dart @@ -660,14 +660,15 @@ class _MyFamily extends State with TickerProviderStateMixin { okText: TranslationBase.of(context).confirm, cancelText: TranslationBase.of(context).cancel_nocaps, okFunction: () => { - removeFamily(family, context), - ConfirmDialog.closeAlertDialog(context) + ConfirmDialog.closeAlertDialog(context), + removeFamily(family, context) }, cancelFunction: () => {}); dialog.showAlertDialog(context); } removeFamily(GetAllSharedRecordsByStatusList family, context) { + GifLoaderDialogUtils.showMyDialog(context); this.userID = family.iD; Map request = {}; request['ID'] = this.userID; @@ -679,7 +680,7 @@ class _MyFamily extends State with TickerProviderStateMixin { } refreshFamily(context) { - //sharedPref.remove(FAMILY_FILE); + GifLoaderDialogUtils.hideDialog(context); setState(() { sharedPref.remove(FAMILY_FILE); }); diff --git a/lib/pages/ErService/AmbulanceRequestIndexPages/AmbulanceRequestIndex.dart b/lib/pages/ErService/AmbulanceRequestIndexPages/AmbulanceRequestIndex.dart index 1fb47cec..f36eadc5 100644 --- a/lib/pages/ErService/AmbulanceRequestIndexPages/AmbulanceRequestIndex.dart +++ b/lib/pages/ErService/AmbulanceRequestIndexPages/AmbulanceRequestIndex.dart @@ -124,7 +124,7 @@ class _AmbulanceRequestIndexPageState extends State { : Column( children: [ SizedBox( - height: 80, + height: 20, ), Container( margin: EdgeInsets.only(left: 12, right: 12), diff --git a/lib/pages/ErService/AmbulanceRequestIndexPages/SelectTransportationMethod.dart b/lib/pages/ErService/AmbulanceRequestIndexPages/SelectTransportationMethod.dart index 0770448e..63d915d1 100644 --- a/lib/pages/ErService/AmbulanceRequestIndexPages/SelectTransportationMethod.dart +++ b/lib/pages/ErService/AmbulanceRequestIndexPages/SelectTransportationMethod.dart @@ -210,71 +210,77 @@ class _SelectTransportationMethodState SizedBox( height: 5, ), - Row( - children: [ - Expanded( - child: InkWell( - onTap: () { - setState(() { - _way = Way.OneWay; - }); - }, - child: Container( - decoration: BoxDecoration( - shape: BoxShape.rectangle, - borderRadius: BorderRadius.circular(8), - border: - Border.all(color: Colors.grey, width: 0.5), - color: Colors.white, - ), - child: ListTile( - title: - Texts(TranslationBase.of(context).oneDirec), - leading: Radio( - value: Way.OneWay, - groupValue: _way, - onChanged: (value) { - setState(() { - _way = value; - }); - }, + Container( + margin: EdgeInsets.only(bottom:65 ), + child: Row( + children: [ + Expanded( + child: InkWell( + onTap: () { + setState(() { + _way = Way.OneWay; + }); + }, + child: Container( + decoration: BoxDecoration( + shape: BoxShape.rectangle, + borderRadius: BorderRadius.circular(8), + border: + Border.all(color: Colors.grey, width: 0.5), + color: Colors.white, + ), + child: ListTile( + title: + Texts(TranslationBase.of(context).oneDirec), + leading: Radio( + value: Way.OneWay, + groupValue: _way, + onChanged: (value) { + setState(() { + _way = value; + }); + }, + ), ), ), ), ), - ), - Expanded( - child: InkWell( - onTap: () { - setState(() { - _way = Way.TwoWays; - }); - }, - child: Container( - decoration: BoxDecoration( - shape: BoxShape.rectangle, - borderRadius: BorderRadius.circular(8), - border: - Border.all(color: Colors.grey, width: 0.5), - color: Colors.white, - ), - child: ListTile( - title: - Texts(TranslationBase.of(context).twoDirec), - leading: Radio( - value: Way.TwoWays, - groupValue: _way, - onChanged: (value) { - setState(() { - _way = value; - }); - }, + Expanded( + child: InkWell( + onTap: () { + setState(() { + _way = Way.TwoWays; + }); + }, + child: Container( + decoration: BoxDecoration( + shape: BoxShape.rectangle, + borderRadius: BorderRadius.circular(8), + border: + Border.all(color: Colors.grey, width: 0.5), + color: Colors.white, + ), + child: ListTile( + title: + Texts(TranslationBase.of(context).twoDirec), + leading: Radio( + value: Way.TwoWays, + groupValue: _way, + onChanged: (value) { + setState(() { + _way = value; + }); + }, + ), ), ), ), ), - ), - ], + ], + ), + ), + SizedBox( + height: 30, ), ], ), diff --git a/lib/pages/ErService/AmbulanceRequestIndexPages/Summary.dart b/lib/pages/ErService/AmbulanceRequestIndexPages/Summary.dart index 6140dc62..f8bb9e8e 100644 --- a/lib/pages/ErService/AmbulanceRequestIndexPages/Summary.dart +++ b/lib/pages/ErService/AmbulanceRequestIndexPages/Summary.dart @@ -73,6 +73,7 @@ class _SummaryState extends State { Texts(TranslationBase.of(context).billAmount,textAlign: TextAlign.start,), SizedBox(height: 5,), Container( + height: 55, padding: EdgeInsets.all(10), decoration: BoxDecoration( @@ -87,8 +88,8 @@ class _SummaryState extends State { ], ), ), + SizedBox(height: 250), - SizedBox(height: 45,), ], ), diff --git a/lib/pages/MyAppointments/widgets/AppointmentActions.dart b/lib/pages/MyAppointments/widgets/AppointmentActions.dart index 51eefe1a..b335c740 100644 --- a/lib/pages/MyAppointments/widgets/AppointmentActions.dart +++ b/lib/pages/MyAppointments/widgets/AppointmentActions.dart @@ -509,8 +509,7 @@ class _AppointmentActionsState extends State { Navigator.push( context, FadePage( - page: - LaboratoryResultPage(patientLabOrders: patientLabOrders))) + page: LaboratoryResultPage(patientLabOrders: patientLabOrders))) .then((value) {}); } @@ -518,8 +517,7 @@ class _AppointmentActionsState extends State { Navigator.push( context, FadePage( - page: - RadiologyDetailsPage(finalRadiology: finalRadiology))) + page: RadiologyDetailsPage(finalRadiology: finalRadiology))) .then((value) {}); } @@ -542,7 +540,17 @@ class _AppointmentActionsState extends State { transform: Matrix4.translationValues(0.0, curvedValue * 200, 0.0), child: Opacity( opacity: a1.value, - child: ReminderDialog(appo: appo), + child: ReminderDialog( + eventId: appo.appointmentNo.toString(), + title: "Doctor Appointment", + description: "You have an appointment with " + + appo.doctorTitle + + " " + + appo.doctorNameObj, + startDate: appo.appointmentDate, + endDate: appo.appointmentDate, + location: appo.projectName, + ), ), ); }, @@ -668,7 +676,10 @@ class _AppointmentActionsState extends State { context, FadePage( page: VitalSignDetailsScreen( - appointmentNo: appoNo, projectID: projectID,isNotOneAppointment: false,))); + appointmentNo: appoNo, + projectID: projectID, + isNotOneAppointment: false, + ))); } navigateToInsertComplaint() { diff --git a/lib/pages/MyAppointments/widgets/reminder_dialog.dart b/lib/pages/MyAppointments/widgets/reminder_dialog.dart index b8803469..0db8cda4 100644 --- a/lib/pages/MyAppointments/widgets/reminder_dialog.dart +++ b/lib/pages/MyAppointments/widgets/reminder_dialog.dart @@ -9,9 +9,14 @@ import 'package:manage_calendar_events/manage_calendar_events.dart'; class ReminderDialog extends StatefulWidget { static var selectedDuration; - AppoitmentAllHistoryResultList appo; + final String eventId; + final String title; + final String description; + final String startDate; + final String endDate; + final String location; - ReminderDialog({@required this.appo}); + ReminderDialog({@required this.eventId, @required this.title, @required this.description, @required this.startDate, @required this.endDate, @required this.location}); @override _ReminderDialogState createState() => _ReminderDialogState(); @@ -98,17 +103,14 @@ class _ReminderDialogState extends State { }); CalendarEvent calendarEvent = new CalendarEvent( - eventId: widget.appo.appointmentNo.toString(), - title: "Doctor Appointment", - description: "You have an appointment with " + - widget.appo.doctorTitle + - " " + - widget.appo.doctorNameObj, - startDate: DateUtil.convertStringToDate(widget.appo.appointmentDate) + eventId: widget.eventId, + title: widget.title, + description: widget.description, + startDate: DateUtil.convertStringToDate(widget.startDate) .subtract( new Duration(microseconds: ReminderDialog.selectedDuration)), - endDate: DateUtil.convertStringToDate(widget.appo.appointmentDate), - location: widget.appo.projectName, + endDate: DateUtil.convertStringToDate(widget.endDate), + location: widget.location, duration: new Duration(minutes: 15).inMinutes, isAllDay: false, hasAlarm: true); @@ -118,7 +120,7 @@ class _ReminderDialogState extends State { .then((value) { print("Cal event"); print(value); - if (int.parse(value) == widget.appo.appointmentNo) { + if (int.parse(value) == int.parse(widget.eventId)) { AppToast.showSuccessToast(message: TranslationBase.of(context).reminderSuccess); } Navigator.of(context).pop(); diff --git a/lib/pages/login/welcome.dart b/lib/pages/login/welcome.dart index b2250f5c..6a007e0a 100644 --- a/lib/pages/login/welcome.dart +++ b/lib/pages/login/welcome.dart @@ -5,6 +5,7 @@ import 'package:diplomaticquarterapp/routes.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; @@ -41,20 +42,19 @@ class _WelcomeLogin extends State { children: [ Image.asset('assets/images/DQ/logo.png', height: 90, width: 90), - Text( + AppText( TranslationBase.of(context).welcome, - style: TextStyle( - fontSize: 30, fontWeight: FontWeight.bold), - textAlign: TextAlign.start, + fontSize: 30, + fontWeight: FontWeight.bold, ), - Text( + AppText( TranslationBase.of(context).welcomeText, - style: TextStyle(fontSize: 24), + fontSize: 24, textAlign: TextAlign.start, ), - Text( + AppText( TranslationBase.of(context).welcomeText2, - style: TextStyle(fontSize: 24), + fontSize: 24, textAlign: TextAlign.start, ), SizedBox( diff --git a/lib/pages/medical/prescriptions/pharmacy_for_prescriptions_page.dart b/lib/pages/medical/prescriptions/pharmacy_for_prescriptions_page.dart index 1b1eaf3f..96227fba 100644 --- a/lib/pages/medical/prescriptions/pharmacy_for_prescriptions_page.dart +++ b/lib/pages/medical/prescriptions/pharmacy_for_prescriptions_page.dart @@ -20,7 +20,7 @@ class PharmacyForPrescriptionsPage extends StatelessWidget { onModelReady: (model) => model.getListPharmacyForPrescriptions(itemId: prescriptionReport.itemID), builder: (_, model, widget) => AppScaffold( isShowAppBar: true, - appBarTitle: TranslationBase.of(context).ports, + appBarTitle: TranslationBase.of(context).availability, baseViewModel: model, body: ListView.builder( itemBuilder: (context, index) => Container( diff --git a/lib/pages/medical/prescriptions/prescription_details_page.dart b/lib/pages/medical/prescriptions/prescription_details_page.dart index d59bc06d..f40999c2 100644 --- a/lib/pages/medical/prescriptions/prescription_details_page.dart +++ b/lib/pages/medical/prescriptions/prescription_details_page.dart @@ -1,4 +1,6 @@ import 'package:diplomaticquarterapp/core/model/prescriptions/prescription_report.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; +import 'package:diplomaticquarterapp/pages/MyAppointments/widgets/reminder_dialog.dart'; import 'package:diplomaticquarterapp/pages/medical/prescriptions/pharmacy_for_prescriptions_page.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; @@ -6,6 +8,7 @@ import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; class PrescriptionDetailsPage extends StatelessWidget { final PrescriptionReport prescriptionReport; @@ -59,40 +62,49 @@ class PrescriptionDetailsPage extends StatelessWidget { ), Container( margin: EdgeInsets.all(8), - child: InkWell( - onTap: () => Navigator.push( - context, - FadePage( - page: PharmacyForPrescriptionsPage( - prescriptionReport: prescriptionReport), - ), - ), - child: Center( - child: Column( - children: [ - Container( - width: 50, - decoration: BoxDecoration( - color: Colors.white, shape: BoxShape.rectangle), + child: Row( + children: [ + Expanded( + child: InkWell( + onTap: () => Navigator.push( + context, + FadePage( + page: PharmacyForPrescriptionsPage( + prescriptionReport: prescriptionReport), + ), + ), + child: Center( child: Column( children: [ - Icon( - Icons.pin_drop, - color: Colors.red[800], - size: 55, + Container( + width: 50, + decoration: BoxDecoration( + color: Colors.white, + shape: BoxShape.rectangle), + child: Column( + children: [ + Icon( + Icons.pin_drop, + color: Colors.red[800], + size: 55, + ), + ], + ), + ), + SizedBox( + height: 5, ), + Texts(TranslationBase.of(context).availability) ], ), - ), - SizedBox( - height: 5, - ), - Texts(TranslationBase.of(context).ports) - ], - ), - )), + )), + ), + _addReminderButton(context) + ], + ), ), Container( + color: Colors.white, margin: EdgeInsets.only(top: 10, left: 10, right: 10), child: Table( border: TableBorder.symmetric( @@ -106,28 +118,28 @@ class PrescriptionDetailsPage extends StatelessWidget { height: 30, width: double.infinity, child: Center( - child: Texts(TranslationBase.of(context).way))), + child: Texts(TranslationBase.of(context).route, fontSize: 14,))), Container( color: Colors.white, height: 30, width: double.infinity, child: Center( child: - Texts(TranslationBase.of(context).average))), + Texts(TranslationBase.of(context).frequency, fontSize: 14,))), Container( color: Colors.white, - height: 30, width: double.infinity, + padding: EdgeInsets.symmetric(horizontal: 4), child: Center( child: Texts( - TranslationBase.of(context).dailyDoses))), + "${TranslationBase.of(context).dailyDoses}", fontSize: 14,))), Container( color: Colors.white, height: 30, width: double.infinity, child: Center( child: - Texts(TranslationBase.of(context).period))), + Texts(TranslationBase.of(context).duration, fontSize: 14,))), ], ), TableRow( @@ -192,4 +204,96 @@ class PrescriptionDetailsPage extends StatelessWidget { ), ); } + + Widget _addReminderButton(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); + + return GestureDetector( + onTap: () { + DateTime startDate = DateTime.now(); + DateTime endDate = DateTime(startDate.year, startDate.month, + startDate.day + prescriptionReport.days); + + print(prescriptionReport); + showGeneralDialog( + barrierColor: Colors.black.withOpacity(0.5), + transitionBuilder: (context, a1, a2, widget) { + final curvedValue = + Curves.easeInOutBack.transform(a1.value) - 1.0; + return Transform( + transform: + Matrix4.translationValues(0.0, curvedValue * 200, 0.0), + child: Opacity( + opacity: a1.value, + child: ReminderDialog( + eventId: prescriptionReport.itemID.toString(), + title: "Prescription Reminder", + description: + "${prescriptionReport.itemDescriptionN} ${prescriptionReport.frequencyN} ${prescriptionReport.routeN} ", + startDate: + "/Date(${startDate.millisecondsSinceEpoch}+0300)/", + endDate: "/Date(${endDate.millisecondsSinceEpoch}+0300)/", + location: prescriptionReport.remarks, + ), + ), + ); + }, + transitionDuration: Duration(milliseconds: 500), + barrierDismissible: true, + barrierLabel: '', + context: context, + pageBuilder: (context, animation1, animation2) {}); + }, + child: Column( + mainAxisSize: MainAxisSize.max, + children: [ + Container( + // height: 100.0, + margin: EdgeInsets.all(7.0), + padding: EdgeInsets.only(bottom: 4.0), + decoration: BoxDecoration(boxShadow: [ + BoxShadow( + color: Colors.grey[400], blurRadius: 2.0, spreadRadius: 0.0) + ], borderRadius: BorderRadius.circular(10), color: Colors.white), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.max, + children: [ + Container( + margin: EdgeInsets.fromLTRB(5.0, 5.0, 5.0, 0.0), + child: Text("add", + overflow: TextOverflow.clip, + style: TextStyle( + color: new Color(0xffB8382C), + letterSpacing: 1.0, + fontSize: 18.0)), + ), + Container( + margin: EdgeInsets.fromLTRB(5.0, 0.0, 5.0, 0.0), + child: Text("reminder", + overflow: TextOverflow.clip, + style: TextStyle( + color: Colors.black, + letterSpacing: 1.0, + fontSize: 15.0)), + ), + Container( + alignment: projectViewModel.isArabic + ? Alignment.bottomLeft + : Alignment.bottomRight, + margin: projectViewModel.isArabic + ? EdgeInsets.fromLTRB(10.0, 7.0, 0.0, 8.0) + : EdgeInsets.fromLTRB(0.0, 7.0, 10.0, 8.0), + child: Image.asset( + "assets/images/new-design/reminder_icon.png", + width: 45.0, + height: 45.0), + ), + ], + ), + ), + ], + ), + ); + } } diff --git a/lib/pages/pharmacy/pharmacyAddresses/PharmacyAddresses.dart b/lib/pages/pharmacy/pharmacyAddresses/PharmacyAddresses.dart index 340e2bd8..51256e11 100644 --- a/lib/pages/pharmacy/pharmacyAddresses/PharmacyAddresses.dart +++ b/lib/pages/pharmacy/pharmacyAddresses/PharmacyAddresses.dart @@ -104,7 +104,7 @@ class _PharmacyAddressesState extends State { fontWeight: FontWeight.bold, backgroundColor: Color(0xFF5AB145), fontSize: 14, - vPadding: 12, + vPadding: 8, handler: () { model.saveSelectedAddressLocally( model.addresses[model.selectedAddressIndex]); diff --git a/lib/services/authentication/auth_provider.dart b/lib/services/authentication/auth_provider.dart index 8f0ea470..bd2006f8 100644 --- a/lib/services/authentication/auth_provider.dart +++ b/lib/services/authentication/auth_provider.dart @@ -378,24 +378,24 @@ class AuthProvider with ChangeNotifier { Future sendPatientIDSMS(mobileNo, context) async { Map request; - var languageID = - await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + // var languageID = + // await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); Request req = appGlobal.getPublicRequest(); request = { - "LanguageID": languageID == 'ar' ? 1 : 2, - "IPAdress": "10.20.10.20", - "VersionID": req.VersionID, - "Channel": req.Channel, - "generalid": 'Cs2020@2016\$2958', - "PatientOutSA": 0, - "PatientID": 0, - "TokenID": "", + // "LanguageID": languageID == 'ar' ? 1 : 2, + // "IPAdress": "10.20.10.20", + // "VersionID": req.VersionID, + // "Channel": req.Channel, + // "generalid": 'Cs2020@2016\$2958', + // "PatientOutSA": 0, + // "PatientID": 0, + // "TokenID": "", "PatientMobileNumber": mobileNo, "SearchType": 2, - "ZipCode": "966", - "PatientIdentificationID": "", + // "ZipCode": "966", + // "PatientIdentificationID": "", "DeviceTypeID": req.DeviceTypeID, - "SessionID": null + // "SessionID": null }; dynamic localRes; diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index 9f411667..0e0058f9 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -988,6 +988,7 @@ class TranslationBase { String get average => localizedValues['Average'][locale.languageCode]; String get dailyDoses => localizedValues['DailyDoses'][locale.languageCode]; String get period => localizedValues['Period'][locale.languageCode]; + String get duration => localizedValues['duration'][locale.languageCode]; String get cm => localizedValues['cm'][locale.languageCode]; String get kg => localizedValues['kg'][locale.languageCode]; String get lb => localizedValues['lb'][locale.languageCode]; diff --git a/lib/widgets/data_display/medical/LabResult/FlowChartPage.dart b/lib/widgets/data_display/medical/LabResult/FlowChartPage.dart index fde78169..2cc9acd6 100644 --- a/lib/widgets/data_display/medical/LabResult/FlowChartPage.dart +++ b/lib/widgets/data_display/medical/LabResult/FlowChartPage.dart @@ -23,18 +23,21 @@ class FlowChartPage extends StatelessWidget { appBarTitle: filterName, baseViewModel: model, body: SingleChildScrollView( - child: model.labOrdersResultsList.isNotEmpty + child: model. labOrdersResultsList.isNotEmpty ? Container( child: LabResultChartAndDetails( name: filterName, labResult: model.labOrdersResultsList, ), ) - : Container( - child: Center( - child: Texts('no Data'), + : Center( + child: Container( + padding: EdgeInsets.only(top: MediaQuery.of(context).size.height *0.42), + child: Center( + child: Texts('No Data'), + ), ), - ), + ), ), ), ); diff --git a/lib/widgets/drawer/app_drawer_widget.dart b/lib/widgets/drawer/app_drawer_widget.dart index d5ddf3a9..c4a7d8d0 100644 --- a/lib/widgets/drawer/app_drawer_widget.dart +++ b/lib/widgets/drawer/app_drawer_widget.dart @@ -195,6 +195,7 @@ class _AppDrawerState extends State { sideArrow: true, ), onTap: () { + Navigator.of(context).pop(); Navigator.of(context).pushNamed( MY_FAMILIY, ); diff --git a/lib/widgets/others/app_scaffold_widget.dart b/lib/widgets/others/app_scaffold_widget.dart index 4b24af8a..ca72e267 100644 --- a/lib/widgets/others/app_scaffold_widget.dart +++ b/lib/widgets/others/app_scaffold_widget.dart @@ -87,7 +87,7 @@ class AppScaffold extends StatelessWidget { this.showHomeAppBarIcon = true, this.imagesInfo}); - AppScaffold setOnAppBarCartClick(VoidCallback onClick){ + AppScaffold setOnAppBarCartClick(VoidCallback onClick) { _onCartClick = onClick; return this; } @@ -112,21 +112,23 @@ class AppScaffold extends StatelessWidget { : null, bottomSheet: bottomSheet, body: SafeArea( - top: true, bottom: true, - child: (!Provider.of(context, listen: false).isLogin && - isShowDecPage) - ? NotAutPage( - title: title ?? appBarTitle, - description: description, - infoList: infoList, - imagesInfo: imagesInfo, - ) - : baseViewModel != null - ? NetworkBaseView( - child: buildBodyWidget(context), - baseViewModel: baseViewModel, - ) - : buildBodyWidget(context), + top: true, + bottom: true, + child: + (!Provider.of(context, listen: false).isLogin && + isShowDecPage) + ? NotAutPage( + title: title ?? appBarTitle, + description: description, + infoList: infoList, + imagesInfo: imagesInfo, + ) + : baseViewModel != null + ? NetworkBaseView( + child: buildBodyWidget(context), + baseViewModel: baseViewModel, + ) + : buildBodyWidget(context), ), ); } @@ -173,8 +175,7 @@ class AppBarWidget extends StatefulWidget with PreferredSizeWidget { Size get preferredSize => Size(double.maxFinite, 60); } -class AppBarWidgetState extends State{ - +class AppBarWidgetState extends State { String badgeText = "0"; @override Widget build(BuildContext context) { @@ -182,7 +183,7 @@ class AppBarWidgetState extends State{ return buildAppBar(context); } - badgeUpdateBlock(String value){ + badgeUpdateBlock(String value) { setState(() { badgeText = value; }); @@ -192,8 +193,9 @@ class AppBarWidgetState extends State{ ProjectViewModel projectViewModel = Provider.of(context); return AppBar( elevation: 0, - backgroundColor: - widget.isPharmacy ? Colors.green : Theme.of(context).appBarTheme.color, + backgroundColor: widget.isPharmacy + ? Colors.green + : Theme.of(context).appBarTheme.color, textTheme: TextTheme( headline6: TextStyle( color: Theme.of(context).textTheme.headline1.color, @@ -216,38 +218,32 @@ class AppBarWidgetState extends State{ actions: [ (widget.isPharmacy && widget.showPharmacyCart) ? IconButton( - icon: Badge( - badgeContent: Text( - badgeText - ), - child: Icon(Icons.shopping_cart) - ), - color: Colors.white, - onPressed: () { - Navigator.of(context).popUntil(ModalRoute.withName('/')); - }) + icon: Badge( + badgeContent: Text(badgeText), + child: Icon(Icons.shopping_cart)), + color: Colors.white, + onPressed: () { + Navigator.of(context).popUntil(ModalRoute.withName('/')); + }) : Container(), - (widget.isOfferPackages && widget.showOfferPackagesCart) ? IconButton( - icon: Badge( - - position: BadgePosition.topStart(top: -15,start: -10), - badgeContent: Text( - badgeText, - style: TextStyle(fontSize: 9,color: Colors.white, fontWeight: FontWeight.normal), - ), - child: Icon(Icons.shopping_cart) - ), - color: Colors.white, - onPressed: () { - // Cart Click Event - if(_onCartClick != null) - _onCartClick(); - - }) + icon: Badge( + position: BadgePosition.topStart(top: -15, start: -10), + badgeContent: Text( + badgeText, + style: TextStyle( + fontSize: 9, + color: Colors.white, + fontWeight: FontWeight.normal), + ), + child: Icon(Icons.shopping_cart)), + color: Colors.white, + onPressed: () { + // Cart Click Event + if (_onCartClick != null) _onCartClick(); + }) : Container(), - if (widget.showHomeAppBarIcon) IconButton( icon: Icon(FontAwesomeIcons.home), @@ -256,11 +252,10 @@ class AppBarWidgetState extends State{ Navigator.pushAndRemoveUntil( context, MaterialPageRoute(builder: (context) => LandingPage()), - (Route r) => false); + (Route r) => false); // Cart Click Event - if(_onCartClick != null) - _onCartClick(); + if (_onCartClick != null) _onCartClick(); }, ), if (widget.appBarIcons != null) ...widget.appBarIcons @@ -356,7 +351,7 @@ class _RobotIcon extends State { ], ), right: -30, - bottom: 50); + bottom: -15); } // setAnimation() async {