From a6d3fce6fc72c010f5ceaa37b35bde6c1b9a20ba Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Sun, 13 Dec 2020 17:36:36 +0200 Subject: [PATCH 1/3] remove ErOptions --- .../all_habib_medical_service_page.dart | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart b/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart index 316a2437..1672828a 100644 --- a/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart +++ b/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart @@ -179,20 +179,20 @@ class _AllHabibMedicalServiceState extends State { 'assets/images/al-habib_online_payment_service_icon.png', title: TranslationBase.of(context).onlinePaymentService, ), - ServicesContainer( - onTap: () { - Navigator.push( - context, - FadePage( - page: ErOptions( - isAppbar: true, - ), - ), - ); - }, - imageLocation: 'assets/images/emergency_service_image.png', - title: TranslationBase.of(context).emergencyService, - ), + // ServicesContainer( + // onTap: () { + // Navigator.push( + // context, + // FadePage( + // page: ErOptions( + // isAppbar: true, + // ), + // ), + // ); + // }, + // imageLocation: 'assets/images/emergency_service_image.png', + // title: TranslationBase.of(context).emergencyService, + // ), ServicesContainer( onTap: () => Navigator.push( context, From 4e823c2be4cbb4eae66d5aa1ca86944ed99a8173 Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Mon, 14 Dec 2020 15:28:24 +0200 Subject: [PATCH 2/3] fix chart and duplicated data in Patient Lab Result --- lib/core/model/labs/lab_result.dart | 3 +- .../viewModels/medical/labs_view_model.dart | 16 +- lib/pages/landing/home_page.dart | 6 + lib/widgets/avatar/large_avatar.dart | 2 +- .../medical/LabResult/LineChartCurved.dart | 194 ++++++++++++++++++ .../lab_result_chart_and_detials.dart | 9 +- .../data_display/medical/doctor_card.dart | 2 +- pubspec.yaml | 3 + 8 files changed, 217 insertions(+), 18 deletions(-) create mode 100644 lib/widgets/data_display/medical/LabResult/LineChartCurved.dart diff --git a/lib/core/model/labs/lab_result.dart b/lib/core/model/labs/lab_result.dart index adc2e5ff..2deb13f3 100644 --- a/lib/core/model/labs/lab_result.dart +++ b/lib/core/model/labs/lab_result.dart @@ -92,8 +92,7 @@ class LabResultList { String filterName = ""; List patientLabResultList = List(); - LabResultList( - {this.filterName, LabResult lab}) { + LabResultList({this.filterName, LabResult lab}) { patientLabResultList.add(lab); } } diff --git a/lib/core/viewModels/medical/labs_view_model.dart b/lib/core/viewModels/medical/labs_view_model.dart index c54084d6..1f938fb0 100644 --- a/lib/core/viewModels/medical/labs_view_model.dart +++ b/lib/core/viewModels/medical/labs_view_model.dart @@ -115,18 +115,16 @@ class LabsViewModel extends BaseViewModel { setState(ViewState.Error); } else { _labsService.labResultList.forEach((element) { - List patientLabOrdersClinic = labResultLists - .where( - (elementClinic) => elementClinic.filterName == element.testCode) - .toList(); + List patientLabOrdersClinic = labResultLists.where((elementClinic) => elementClinic.filterName == element.testCode).toList(); if (patientLabOrdersClinic.length != 0) { - labResultLists[labResultLists.indexOf(patientLabOrdersClinic[0])] - .patientLabResultList - .add(element); + + var value= labResultLists[labResultLists.indexOf(patientLabOrdersClinic[0])].patientLabResultList + .where((e) => e.sampleCollectedOn== element.sampleCollectedOn && e.resultValue ==element.resultValue ).toList(); + if(value.isEmpty) + labResultLists[labResultLists.indexOf(patientLabOrdersClinic[0])].patientLabResultList.add(element); } else { - labResultLists - .add(LabResultList(filterName: element.testCode, lab: element)); + labResultLists.add(LabResultList(filterName: element.testCode, lab: element)); } }); setState(ViewState.Idle); diff --git a/lib/pages/landing/home_page.dart b/lib/pages/landing/home_page.dart index 1706ce8a..13d11a71 100644 --- a/lib/pages/landing/home_page.dart +++ b/lib/pages/landing/home_page.dart @@ -28,6 +28,7 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart'; +import '../../widgets/data_display/medical/LabResult/LineChartCurved.dart'; import '../../locator.dart'; class HomePage extends StatefulWidget { @@ -527,6 +528,11 @@ class _HomePageState extends State { ], ), ), + SizedBox(height: 8,), + // Padding( + // padding: const EdgeInsets.all(8.0), + // child: LineChartSample1(), + // ), SizedBox( height: 8, ), diff --git a/lib/widgets/avatar/large_avatar.dart b/lib/widgets/avatar/large_avatar.dart index ed904d03..fcfcaa94 100644 --- a/lib/widgets/avatar/large_avatar.dart +++ b/lib/widgets/avatar/large_avatar.dart @@ -37,7 +37,7 @@ class LargeAvatar extends StatelessWidget { borderRadius: BorderRadius.all(Radius.circular(radius)), child: Image.network( url.trim(), - fit: BoxFit.cover, + fit: BoxFit.fill, width: width, height: height, ), diff --git a/lib/widgets/data_display/medical/LabResult/LineChartCurved.dart b/lib/widgets/data_display/medical/LabResult/LineChartCurved.dart new file mode 100644 index 00000000..0056e23e --- /dev/null +++ b/lib/widgets/data_display/medical/LabResult/LineChartCurved.dart @@ -0,0 +1,194 @@ +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; +import 'package:fl_chart/fl_chart.dart'; +import 'package:flutter/material.dart'; + +import '../../../../core/model/labs/LabOrderResult.dart'; + +class LineChartCurved extends StatefulWidget { + final String title; + final List labResult; + + LineChartCurved({this.title, this.labResult}); + + @override + State createState() => LineChartCurvedState(); +} + +class LineChartCurvedState extends State { + bool isShowingMainData; + + @override + void initState() { + super.initState(); + isShowingMainData = true; + } + + @override + Widget build(BuildContext context) { + return AspectRatio( + aspectRatio: 1.23, + child: Container( + decoration: const BoxDecoration( + borderRadius: BorderRadius.all(Radius.circular(18)), + // color: Colors.white, + ), + child: Stack( + children: [ + Column( + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + const SizedBox( + height: 4, + ), + Text( + widget.title, + style: TextStyle( + color: Colors.black, + fontSize: 32, + fontWeight: FontWeight.bold, + letterSpacing: 2), + textAlign: TextAlign.center, + ), + + Expanded( + child: Padding( + padding: const EdgeInsets.only(right: 16.0, left: 6.0), + child: LineChart( + sampleData1(), + swapAnimationDuration: const Duration(milliseconds: 250), + ), + ), + ), + const SizedBox( + height: 10, + ), + ], + ), + ], + ), + ), + ); + } + + LineChartData sampleData1() { + return LineChartData( + lineTouchData: LineTouchData( + touchTooltipData: LineTouchTooltipData( + tooltipBgColor: Colors.white, + ), + touchCallback: (LineTouchResponse touchResponse) {}, + handleBuiltInTouches: true, + ), + gridData: FlGridData(show: true, drawVerticalLine: true,drawHorizontalLine: true), + titlesData: FlTitlesData( + bottomTitles: SideTitles( + showTitles: true, + getTextStyles: (value) => const TextStyle( + color: Colors.black, + fontSize: 12, + ), + margin: 10, + getTitles: (value) { + print(value); + if(widget.labResult.length>value.toInt()) + { DateTime date = DateUtil.convertStringToDate(widget.labResult[value.toInt()].verifiedOnDateTime); + return '${date.day}/ ${date.year}';} + return ''; + } + + , + ), + leftTitles: SideTitles( + showTitles: true, + getTextStyles: (value) => const TextStyle( + color: Colors.black, + fontWeight: FontWeight.bold, + fontSize: 14, + ), + getTitles: (value) { + return '${value.toInt()}'; + }, + margin: 8, + //reservedSize: 30, + ), + ), + borderData: FlBorderData( + show: true, + border: const Border( + bottom: BorderSide( + color: Colors.black, + width: 0.5, + ), + left: BorderSide( + color: Colors.black, + ), + right: BorderSide( + color: Colors.black, + ), + top: BorderSide( + color: Colors.transparent, + ), + ), + ), + minX: 0, + maxX: (widget.labResult.length-1).toDouble(), + maxY: getMaxY(), + minY: getMinY(), + lineBarsData: getData(), + ); + } + + double getMaxY(){ + double max =0; + widget.labResult.forEach((element) { + double resultValueDouble =double.parse(element.resultValue); + if(resultValueDouble>max) + max = resultValueDouble; + }); + + return max.roundToDouble(); + } + + double getMinY(){ + double min =double.parse(widget.labResult[0].resultValue); + + + widget.labResult.forEach((element) { + double resultValueDouble =double.parse(element.resultValue); + if(resultValueDouble getData() { + List spots = List(); + for (int index = 0; index < widget.labResult.length ; index++) { + var resultValueDouble = double.parse(widget.labResult[index].resultValue); + spots.add(FlSpot(index.toDouble(), resultValueDouble)); + } + + final LineChartBarData lineChartBarData1 = LineChartBarData( + spots: spots, + isCurved: true, + colors: [Theme.of(context).primaryColor], + barWidth: 5, + isStrokeCapRound: true, + dotData: FlDotData( + show: false, + ), + belowBarData: BarAreaData( + show: false, + + ), + ); + + return [ + lineChartBarData1, + ]; + } +} + + diff --git a/lib/widgets/data_display/medical/LabResult/lab_result_chart_and_detials.dart b/lib/widgets/data_display/medical/LabResult/lab_result_chart_and_detials.dart index dabad6af..bec6d63a 100644 --- a/lib/widgets/data_display/medical/LabResult/lab_result_chart_and_detials.dart +++ b/lib/widgets/data_display/medical/LabResult/lab_result_chart_and_detials.dart @@ -7,6 +7,7 @@ import 'package:flutter/material.dart'; import 'package:charts_flutter/flutter.dart' as charts; +import 'LineChartCurved.dart'; import 'Lab_Result_details_wideget.dart'; class LabResultChartAndDetails extends StatelessWidget { @@ -26,11 +27,9 @@ class LabResultChartAndDetails extends StatelessWidget { return Column( children: [ AppExpandableNotifier( - headerWidget: AppTimeSeriesChart( - seriesList: generateData(), - chartName: name, - startDate: DateUtil.convertStringToDate(labResult[0].verifiedOnDateTime), - endDate: DateUtil.convertStringToDate(labResult[labResult.length-1].verifiedOnDateTime), + headerWidget: Padding( + padding: const EdgeInsets.all(8.0), + child: LineChartCurved(title: name,labResult:labResult,), ), bodyWidget: LabResultDetailsWidget( labResult: labResult, diff --git a/lib/widgets/data_display/medical/doctor_card.dart b/lib/widgets/data_display/medical/doctor_card.dart index 2e70f2ab..5f6f7032 100644 --- a/lib/widgets/data_display/medical/doctor_card.dart +++ b/lib/widgets/data_display/medical/doctor_card.dart @@ -140,7 +140,7 @@ class DoctorCard extends StatelessWidget { onTap: onEmailTap, child: Icon( Icons.email, - color: Colors.red, + color: Theme.of(context).primaryColor, ), ) ], diff --git a/pubspec.yaml b/pubspec.yaml index 7941c492..d65a4f8e 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -28,6 +28,9 @@ dependencies: #Dependency Injection get_it: ^4.0.2 + #chart + fl_chart: ^0.12.1 + # Permissions permission_handler: ^5.0.0+hotfix.3 device_info: ^0.4.2+4 From 92e62751628f5ab8df307858661255f467fc7b8d Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Mon, 14 Dec 2020 16:59:23 +0200 Subject: [PATCH 3/3] Add Confirm send email dialog --- lib/config/localized_values.dart | 8 + .../confirm_send_email_dialog.dart | 111 +++++++ .../prescription_items_page.dart | 283 ++++++++++-------- lib/uitl/translations_delegate_base.dart | 2 + 4 files changed, 284 insertions(+), 120 deletions(-) create mode 100644 lib/pages/medical/prescriptions/confirm_send_email_dialog.dart diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index dfd13cca..e034b05e 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -1154,4 +1154,12 @@ const Map localizedValues = { "en": "This service allows you to chat with customer service directly without the need to call.", "ar": "المحادثة المباشرة: هذه الخدمة تمكنك التحدث كتابياً مع خدمة العملاء مباشرة دون الحاجة الى الاتصال هاتفياً." }, + "send-email": { + "en": "Send a copy of this report to the email", + "ar": "أرسل نسخة من هذا التقرير إلى البريد الإلكتروني" + }, + "update-email": { + "en": "Update Email", + "ar": "تحديث البريد الالكتروني" + } }; diff --git a/lib/pages/medical/prescriptions/confirm_send_email_dialog.dart b/lib/pages/medical/prescriptions/confirm_send_email_dialog.dart new file mode 100644 index 00000000..047b663d --- /dev/null +++ b/lib/pages/medical/prescriptions/confirm_send_email_dialog.dart @@ -0,0 +1,111 @@ +import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/H2O/insert_user_activity_request_model.dart'; +import 'package:diplomaticquarterapp/core/model/hospitals/hospitals_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/H2O_view_model.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +import '../../../routes.dart'; + +class ConfirmSendEmailDialog extends StatefulWidget { + final String email; + final GestureTapCallback onTapSendEmail; + + ConfirmSendEmailDialog({this.email, this.onTapSendEmail}); + + @override + _ConfirmSendEmailDialogState createState() => _ConfirmSendEmailDialogState(); +} + +class _ConfirmSendEmailDialogState extends State { + @override + void initState() { + super.initState(); + } + + @override + Widget build(BuildContext context) { + return SimpleDialog( + contentPadding: EdgeInsets.fromLTRB(28.0, 24.0, 28.0, 0.0), + title: Center( + child: Texts( + TranslationBase.of(context).confirm, + color: Colors.black, + ), + ), + children: [ + Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Center( + child: Texts( + TranslationBase.of(context).sendConfEmail, + color: Colors.grey, + ), + ), + Texts( + widget.email, + color: Colors.grey, + ), + SizedBox( + height: 5, + ), + Divider(), + SizedBox( + height: 5.0, + ), + InkWell( + onTap: () { + Navigator.pop(context); + }, + child: Container( + width: double.maxFinite, + child: Center( + child: Texts( + TranslationBase.of(context).cancel, + color: Colors.red, + ), + ), + ), + ), + SizedBox( + height: 15.0, + ), + InkWell( + onTap: () { + Navigator.pop(context); + widget.onTapSendEmail(); + }, + child: Container( + width: double.maxFinite, + child: Center( + child: Texts(TranslationBase.of(context).sendEmail), + ), + ), + ), + SizedBox( + height: 15.0, + ), + InkWell( + onTap: () { + Navigator.of(context).pushNamed( + SETTINGS, + ); + }, + child: Container( + width: double.maxFinite, + child: Center( + child: Texts(TranslationBase.of(context).updateEmail), + ), + ), + ), + SizedBox( + height: 20.0, + ), + ], + ) + ], + ); + } +} diff --git a/lib/pages/medical/prescriptions/prescription_items_page.dart b/lib/pages/medical/prescriptions/prescription_items_page.dart index d4a9e500..ce2738dd 100644 --- a/lib/pages/medical/prescriptions/prescription_items_page.dart +++ b/lib/pages/medical/prescriptions/prescription_items_page.dart @@ -12,6 +12,8 @@ import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import 'confirm_send_email_dialog.dart'; + class PrescriptionItemsPage extends StatelessWidget { final Prescriptions prescriptions; @@ -30,121 +32,148 @@ class PrescriptionItemsPage extends StatelessWidget { height: MediaQuery.of(context).size.height * 0.8, child: Column( children: [ - - if(!prescriptions.isInOutPatient) - ...List.generate(model.prescriptionReportList.length, (index) => InkWell( - onTap: () => Navigator.push( - context, - FadePage( - page: PrescriptionDetailsPage( - prescriptionReport: model.prescriptionReportList[index], - ), - ), - ), - child: Container( - width: double.infinity, - margin: EdgeInsets.only(top: 10, left: 10, right: 10), - padding: EdgeInsets.all(8.0), - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.all( - Radius.circular(10.0), - ), - border: Border.all(color: Colors.grey[200], width: 0.5), - ), - child: Row( - children: [ - ClipRRect( - borderRadius: BorderRadius.all(Radius.circular(5)), - child: Image.network( - model.prescriptionReportList[index].imageSRCUrl, - fit: BoxFit.cover, - width: 60, - height: 70, - ), - ), - SizedBox(width: 10,), - Expanded( - child: Padding( - padding: const EdgeInsets.all(8.0), - child: Center( - child: Texts(model.prescriptionReportList[index].itemDescription.isNotEmpty? - model.prescriptionReportList[index].itemDescription :model - .prescriptionReportList[index].itemDescriptionN)), - )), - Icon( - Icons.arrow_forward_ios, - size: 18, - color: Colors.grey[500], - ) - ], - ), - ), - )) - - else - ...List.generate( - model.prescriptionReportEnhList.length, + if (!prescriptions.isInOutPatient) + ...List.generate( + model.prescriptionReportList.length, (index) => InkWell( - onTap: (){ - PrescriptionReport prescriptionReport = PrescriptionReport( - imageSRCUrl: model.prescriptionReportEnhList[index].imageSRCUrl, - itemDescription: model.prescriptionReportEnhList[index].itemDescription, - itemDescriptionN: model.prescriptionReportEnhList[index].itemDescription, - routeN: model.prescriptionReportEnhList[index].route, - frequency: model.prescriptionReportEnhList[index].frequency, - frequencyN: model.prescriptionReportEnhList[index].frequency, - doseDailyQuantity: model.prescriptionReportEnhList[index].doseDailyQuantity, - days: model.prescriptionReportEnhList[index].days, - itemID: model.prescriptionReportEnhList[index].itemID, - remarks: model.prescriptionReportEnhList[index].remarks - ); - Navigator.push( - context, - FadePage( - page: PrescriptionDetailsPage( - prescriptionReport:prescriptionReport, + onTap: () => Navigator.push( + context, + FadePage( + page: PrescriptionDetailsPage( + prescriptionReport: + model.prescriptionReportList[index], + ), ), ), - ); - }, - child: Container( - margin: EdgeInsets.all(8.0), - color: Colors.white, - child: Row( - children: [ - ClipRRect( - borderRadius: BorderRadius.all(Radius.circular(5)), - child: Image.network( - model.prescriptionReportEnhList[index].imageSRCUrl, - fit: BoxFit.cover, - width: 60, - height: 70, - ), - ), - SizedBox(width: 10,), - Expanded( - child: Padding( - padding: const EdgeInsets.all(8.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, + child: Container( + width: double.infinity, + margin: + EdgeInsets.only(top: 10, left: 10, right: 10), + padding: EdgeInsets.all(8.0), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.all( + Radius.circular(10.0), + ), + border: Border.all( + color: Colors.grey[200], width: 0.5), + ), + child: Row( children: [ - Texts(model.prescriptionReportEnhList[index] - .itemDescription), + ClipRRect( + borderRadius: + BorderRadius.all(Radius.circular(5)), + child: Image.network( + model.prescriptionReportList[index] + .imageSRCUrl, + fit: BoxFit.cover, + width: 60, + height: 70, + ), + ), + SizedBox( + width: 10, + ), + Expanded( + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Center( + child: Texts(model + .prescriptionReportList[index] + .itemDescription + .isNotEmpty + ? model.prescriptionReportList[index] + .itemDescription + : model.prescriptionReportList[index] + .itemDescriptionN)), + )), + Icon( + Icons.arrow_forward_ios, + size: 18, + color: Colors.grey[500], + ) ], ), ), + )) + else + ...List.generate( + model.prescriptionReportEnhList.length, + (index) => InkWell( + onTap: () { + PrescriptionReport prescriptionReport = + PrescriptionReport( + imageSRCUrl: model + .prescriptionReportEnhList[index].imageSRCUrl, + itemDescription: model + .prescriptionReportEnhList[index] + .itemDescription, + itemDescriptionN: model + .prescriptionReportEnhList[index] + .itemDescription, + routeN: + model.prescriptionReportEnhList[index].route, + frequency: model + .prescriptionReportEnhList[index].frequency, + frequencyN: model + .prescriptionReportEnhList[index].frequency, + doseDailyQuantity: model + .prescriptionReportEnhList[index] + .doseDailyQuantity, + days: model.prescriptionReportEnhList[index].days, + itemID: + model.prescriptionReportEnhList[index].itemID, + remarks: model + .prescriptionReportEnhList[index].remarks); + Navigator.push( + context, + FadePage( + page: PrescriptionDetailsPage( + prescriptionReport: prescriptionReport, + ), ), - Icon( - Icons.arrow_forward_ios, - size: 18, - color: Colors.grey[500], - ) - ], - ), - ), + ); + }, + child: Container( + margin: EdgeInsets.all(8.0), + color: Colors.white, + child: Row( + children: [ + ClipRRect( + borderRadius: BorderRadius.all(Radius.circular(5)), + child: Image.network( + model + .prescriptionReportEnhList[index].imageSRCUrl, + fit: BoxFit.cover, + width: 60, + height: 70, + ), + ), + SizedBox( + width: 10, + ), + Expanded( + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts(model.prescriptionReportEnhList[index] + .itemDescription), + ], + ), + ), + ), + Icon( + Icons.arrow_forward_ios, + size: 18, + color: Colors.grey[500], + ) + ], + ), ), - ) + ), + ) ], ), ), @@ -159,27 +188,41 @@ class PrescriptionItemsPage extends StatelessWidget { width: MediaQuery.of(context).size.width * 0.8, child: Button( label: TranslationBase.of(context).sendCopy, - onTap: () => model.sendPrescriptionEmail( - appointmentDate: prescriptions.appointmentDate, - patientID: prescriptions.patientID, - clinicName: prescriptions.companyName, - doctorName: prescriptions.doctorName, - mes: TranslationBase.of(context).sendSuc, - projectID: prescriptions.projectID), + onTap: () { + showConfirmMessage(context,model); + }, loading: model.state == ViewState.BusyLocal, ), ), - if(false) - Container( - width: MediaQuery.of(context).size.width * 0.8, - child: Button( - label:TranslationBase.of(context).resendOrder, - backgroundColor: Colors.green[200], - )) + if (false) + Container( + width: MediaQuery.of(context).size.width * 0.8, + child: Button( + label: TranslationBase.of(context).resendOrder, + backgroundColor: Colors.green[200], + )) ], ), ), ), ); } + + void showConfirmMessage(BuildContext context, PrescriptionsViewModel model) { + showDialog( + context: context, + child: ConfirmSendEmailDialog( + email: model.user.emailAddress, + onTapSendEmail: () { + model.sendPrescriptionEmail( + appointmentDate: prescriptions.appointmentDate, + patientID: prescriptions.patientID, + clinicName: prescriptions.companyName, + doctorName: prescriptions.doctorName, + mes: TranslationBase.of(context).sendSuc, + projectID: prescriptions.projectID); + }, + ), + ); + } } diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index 80fb0cfe..bc28227d 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -1015,6 +1015,8 @@ class TranslationBase { String get lastVisit => localizedValues['last-visit'][locale.languageCode]; String get tapTitle => localizedValues['tap-title'][locale.languageCode]; String get later => localizedValues['later'][locale.languageCode]; + String get sendConfEmail => localizedValues['send-email'][locale.languageCode]; + String get updateEmail => localizedValues['update-email'][locale.languageCode]; } class TranslationBaseDelegate extends LocalizationsDelegate {