diff --git a/lib/core/service/feedback/feedback_service.dart b/lib/core/service/feedback/feedback_service.dart index 9e2245e6..37c0c7be 100644 --- a/lib/core/service/feedback/feedback_service.dart +++ b/lib/core/service/feedback/feedback_service.dart @@ -63,7 +63,7 @@ class FeedbackService extends BaseService { Map body = new Map(); body['IdentificationNo'] = user.patientIdentificationNo; body['MobileNo'] = "966" + Utils.getPhoneNumberWithoutZero(user.mobileNumber); - body['Searching_type'] = '1'; + body['Searching_type'] = 1; if (BASE_URL.contains('uat')) { body['ForDemo'] = true; diff --git a/lib/models/Appointments/DoctorListResponse.dart b/lib/models/Appointments/DoctorListResponse.dart index 651165e4..0da1a273 100644 --- a/lib/models/Appointments/DoctorListResponse.dart +++ b/lib/models/Appointments/DoctorListResponse.dart @@ -40,6 +40,7 @@ class DoctorList { String setupID; List speciality; dynamic workingHours; + dynamic decimalDoctorRate; DoctorList( {this.clinicID, @@ -82,7 +83,8 @@ class DoctorList { this.serviceID, this.setupID, this.speciality, - this.workingHours}); + this.workingHours, + this.decimalDoctorRate}); DoctorList.fromJson(Map json) { clinicID = json['ClinicID']; @@ -127,6 +129,7 @@ class DoctorList { if (json.containsKey('Speciality') && json['Speciality']!=null) speciality = json['Speciality'].cast(); workingHours = json['WorkingHours']; + decimalDoctorRate = json['DecimalDoctorRate']; } Map toJson() { @@ -172,6 +175,7 @@ class DoctorList { data['SetupID'] = this.setupID; data['Speciality'] = this.speciality; data['WorkingHours'] = this.workingHours; + data['DecimalDoctorRate'] = this.decimalDoctorRate; return data; } } diff --git a/lib/models/MyInvoices/GetDentalAppointmentsResponse.dart b/lib/models/MyInvoices/GetDentalAppointmentsResponse.dart index a5a43cef..f7294f3c 100644 --- a/lib/models/MyInvoices/GetDentalAppointmentsResponse.dart +++ b/lib/models/MyInvoices/GetDentalAppointmentsResponse.dart @@ -34,10 +34,13 @@ class ListDentalAppointments { int invoiceNo; int status; String arrivedOn; - String doctorName; - dynamic doctorNameN; + dynamic doctorName; + String doctorNameN; String clinicName; + dynamic decimalDoctorRate; String doctorImageURL; + dynamic doctorRate; + int patientNumber; String projectName; ListDentalAppointments( @@ -55,7 +58,10 @@ class ListDentalAppointments { this.doctorName, this.doctorNameN, this.clinicName, + this.decimalDoctorRate, this.doctorImageURL, + this.doctorRate, + this.patientNumber, this.projectName}); ListDentalAppointments.fromJson(Map json) { @@ -73,7 +79,10 @@ class ListDentalAppointments { doctorName = json['DoctorName']; doctorNameN = json['DoctorNameN']; clinicName = json['ClinicName']; + decimalDoctorRate = json['DecimalDoctorRate']; doctorImageURL = json['DoctorImageURL']; + doctorRate = json['DoctorRate']; + patientNumber = json['PatientNumber']; projectName = json['ProjectName']; } @@ -93,8 +102,12 @@ class ListDentalAppointments { data['DoctorName'] = this.doctorName; data['DoctorNameN'] = this.doctorNameN; data['ClinicName'] = this.clinicName; + data['DecimalDoctorRate'] = this.decimalDoctorRate; data['DoctorImageURL'] = this.doctorImageURL; + data['DoctorRate'] = this.doctorRate; + data['PatientNumber'] = this.patientNumber; data['ProjectName'] = this.projectName; return data; } } + diff --git a/lib/pages/AlHabibMedicalService/HomeHealthCare/orders_log_details_page.dart b/lib/pages/AlHabibMedicalService/HomeHealthCare/orders_log_details_page.dart index 12879ac9..f7b103d5 100644 --- a/lib/pages/AlHabibMedicalService/HomeHealthCare/orders_log_details_page.dart +++ b/lib/pages/AlHabibMedicalService/HomeHealthCare/orders_log_details_page.dart @@ -140,7 +140,7 @@ class OrdersLogDetailsPage extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.end, children: [ Text( - DateUtil.formatDateToDate(DateUtil.convertStringToDate(order.createdOn), projectViewModel.isArabic), + DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(order.createdOn)), style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.4, height: 16 / 10), ), SizedBox(height: 12), diff --git a/lib/pages/Blood/blood_donation.dart b/lib/pages/Blood/blood_donation.dart index 1c861462..e3888240 100644 --- a/lib/pages/Blood/blood_donation.dart +++ b/lib/pages/Blood/blood_donation.dart @@ -96,8 +96,7 @@ class _BloodDonationPageState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ Texts( - TranslationBase.of(context).bloodDEnterDesc, - textAlign: TextAlign.center, + TranslationBase.of(context).bloodDEnterDesc ), SizedBox( height: 12, @@ -240,7 +239,8 @@ class _BloodDonationPageState extends State { ), bottomSheet: Container( width: double.infinity, - padding: EdgeInsets.all(12), + color: Theme.of(context).scaffoldBackgroundColor, + padding: EdgeInsets.all(20), child: DefaultButton(TranslationBase.of(context).save, () async { if (_selectedHospital == null) { AppToast.showErrorToast(message: TranslationBase.of(context).selectCity); diff --git a/lib/pages/BookAppointment/BookConfirm.dart b/lib/pages/BookAppointment/BookConfirm.dart index 2b49043e..e069eca6 100644 --- a/lib/pages/BookAppointment/BookConfirm.dart +++ b/lib/pages/BookAppointment/BookConfirm.dart @@ -401,7 +401,7 @@ class _BookConfirmState extends State { widget.appoDateFormatted = DateUtil.getWeekDay(dateObj.weekday) + ", " + dateObj.day.toString() + " " + DateUtil.getMonth(dateObj.month) + " " + dateObj.year.toString(); }); - return widget.appoDateFormatted; + return DateUtil.getDayMonthYearDateFormatted(dateObj); } DateTime getDateTime() { diff --git a/lib/pages/BookAppointment/BookSuccess.dart b/lib/pages/BookAppointment/BookSuccess.dart index 84af56d6..15ccf128 100644 --- a/lib/pages/BookAppointment/BookSuccess.dart +++ b/lib/pages/BookAppointment/BookSuccess.dart @@ -214,55 +214,63 @@ class _BookSuccessState extends State { Widget _getConfirmAppoButtons() { return Container( - alignment: Alignment.bottomCenter, - margin: EdgeInsets.only(bottom: 5.0), - height: MediaQuery.of(context).size.height * 0.15, - child: Column( - mainAxisAlignment: MainAxisAlignment.end, - children: [ - ButtonTheme( - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(10.0), - ), - minWidth: MediaQuery.of(context).size.width * 0.7, - height: 45.0, - child: RaisedButton( - color: new Color(0xFF60686b), - textColor: Colors.white, - disabledTextColor: Colors.white, - disabledColor: new Color(0xFFbcc2c4), - onPressed: () { - AppoitmentAllHistoryResultList appo = new AppoitmentAllHistoryResultList(); - appo.clinicID = widget.docObject.clinicID; - appo.projectID = widget.docObject.projectID; - appo.appointmentNo = widget.patientShareResponse.appointmentNo; - appo.serviceID = widget.patientShareResponse.serviceID; - appo.isLiveCareAppointment = widget.patientShareResponse.isLiveCareAppointment; - appo.doctorID = widget.patientShareResponse.doctorID; - confirmAppointment(appo); - }, - child: Text(widget.patientShareResponse.isLiveCareAppointment ? TranslationBase.of(context).confirmLiveCare.toUpperCase() : TranslationBase.of(context).confirm.toUpperCase(), - style: TextStyle(fontSize: 18.0)), - ), - ), - ButtonTheme( - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(10.0), + color: CustomColors.appBackgroudGreyColor, + child: Container( + color: CustomColors.appBackgroudGreyColor, + margin: EdgeInsets.all(14), + height: 45.0, + child: Row( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + Expanded( + flex: 1, + child: ButtonTheme( + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(10.0), + ), + height: 45.0, + child: RaisedButton( + color: new Color(0xffc5272d), + textColor: Colors.white, + disabledTextColor: Colors.white, + disabledColor: new Color(0xFFbcc2c4), + onPressed: () { + navigateToHome(context); + }, + child: Text(TranslationBase.of(context).confirmLater, style: TextStyle(fontSize: 18.0)), + ), + ), ), - minWidth: MediaQuery.of(context).size.width * 0.7, - height: 45.0, - child: RaisedButton( - color: new Color(0xFFc5272d), - textColor: Colors.white, - disabledTextColor: Colors.white, - disabledColor: new Color(0xFFbcc2c4), - onPressed: () { - navigateToHome(context); - }, - child: Text(TranslationBase.of(context).confirmLater.toUpperCase(), style: TextStyle(fontSize: 18.0)), + mWidth(7), + Expanded( + flex: 1, + child: ButtonTheme( + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(10.0), + ), + height: 45.0, + child: RaisedButton( + color: CustomColors.green, + textColor: Colors.white, + disabledTextColor: Colors.white, + disabledColor: new Color(0xFFbcc2c4), + onPressed: () { + AppoitmentAllHistoryResultList appo = new AppoitmentAllHistoryResultList(); + appo.clinicID = widget.docObject.clinicID; + appo.projectID = widget.docObject.projectID; + appo.appointmentNo = widget.patientShareResponse.appointmentNo; + appo.serviceID = widget.patientShareResponse.serviceID; + appo.isLiveCareAppointment = widget.patientShareResponse.isLiveCareAppointment; + appo.doctorID = widget.patientShareResponse.doctorID; + confirmAppointment(appo); + }, + child: Text(widget.patientShareResponse.isLiveCareAppointment ? TranslationBase.of(context).confirmLiveCare : TranslationBase.of(context).confirm, + style: TextStyle(fontSize: 18.0)), + ), + ), ), - ), - ], + ], + ), ), ); } @@ -365,11 +373,7 @@ class _BookSuccessState extends State { ), ], ), - // Container( - // margin: EdgeInsets.fromLTRB(50.0, 20.0, 50.0, 20.0), - // child: Image.asset("assets/images/new-design/payment-method.png"), - // ), - Container(margin: EdgeInsets.fromLTRB(20.0, 5.0, 20.0, 5.0), child: getPaymentMethods()), + Container(margin: EdgeInsets.fromLTRB(20.0, 20.0, 20.0, 5.0), child: getPaymentMethods()), ], ); } @@ -479,11 +483,9 @@ class _BookSuccessState extends State { appo.clinicID = widget.patientShareResponse.clinicID; appo.appointmentNo = widget.patientShareResponse.appointmentNo; - Navigator.push(context, FadePage(page: PaymentMethod( - onSelectedMethod: (String metohd) { - setState(() {}); - } - ))).then((value) { + Navigator.push(context, FadePage(page: PaymentMethod(onSelectedMethod: (String metohd) { + setState(() {}); + }))).then((value) { if (value != null) { openPayment(value, authUser, double.parse(patientShareResponse.patientShareWithTax.toString()), patientShareResponse, appo); } diff --git a/lib/pages/BookAppointment/components/SearchByClinic.dart b/lib/pages/BookAppointment/components/SearchByClinic.dart index d1030636..ab36738e 100644 --- a/lib/pages/BookAppointment/components/SearchByClinic.dart +++ b/lib/pages/BookAppointment/components/SearchByClinic.dart @@ -13,6 +13,7 @@ import 'package:diplomaticquarterapp/pages/livecare/livecare_home.dart'; import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart'; import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart'; import 'package:diplomaticquarterapp/services/clinic_services/get_clinic_service.dart'; +import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; @@ -224,7 +225,7 @@ class _SearchByClinicState extends State { child: Row( children: [ Checkbox( - activeColor: new Color(0xFF40ACC9), + activeColor: CustomColors.accentColor, value: nearestAppo, onChanged: (bool value) { setState(() { diff --git a/lib/pages/Covid-DriveThru/covid-payment-alert.dart b/lib/pages/Covid-DriveThru/covid-payment-alert.dart index 9d2ac0a5..2d7d5363 100644 --- a/lib/pages/Covid-DriveThru/covid-payment-alert.dart +++ b/lib/pages/Covid-DriveThru/covid-payment-alert.dart @@ -2,7 +2,6 @@ import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/models/Appointments/PatientShareResposne.dart'; import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; import 'package:diplomaticquarterapp/pages/Covid-DriveThru/covid-payment-summary.dart'; -import 'package:diplomaticquarterapp/pages/ToDoList/payment_method_select.dart'; import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; @@ -11,7 +10,6 @@ import 'package:diplomaticquarterapp/uitl/utils_new.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/material.dart'; -import 'package:flutter_svg/flutter_svg.dart'; class CovidPaymentAlert extends StatefulWidget { PatientShareResponse patientShareResponse; @@ -126,7 +124,7 @@ class _CovidPaymentAlertState extends State { ), mWidth(6), _getNormalText( - widget.patientShareResponse.appointmentDate != null ? getDate(widget.patientShareResponse.appointmentDate).split(" ")[0] : "NULL", + DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(widget.patientShareResponse.appointmentDate)), isBold: true, ), ], @@ -139,7 +137,7 @@ class _CovidPaymentAlertState extends State { ), mWidth(6), _getNormalText( - widget.patientShareResponse.appointmentDate != null ? getDate(widget.patientShareResponse.appointmentDate).split(" ")[1] : "NULL", + DateUtil.formatDateToTimeLang(DateUtil.convertStringToDate(widget.patientShareResponse.appointmentDate), false), isBold: true, ), ], @@ -230,7 +228,6 @@ class _CovidPaymentAlertState extends State { }); } - Navigator.push( context, FadePage( diff --git a/lib/pages/DrawerPages/notifications/notification_details_page.dart b/lib/pages/DrawerPages/notifications/notification_details_page.dart index ee1398be..7633ab9c 100644 --- a/lib/pages/DrawerPages/notifications/notification_details_page.dart +++ b/lib/pages/DrawerPages/notifications/notification_details_page.dart @@ -51,12 +51,15 @@ class NotificationsDetailsPage extends StatelessWidget { ), Container( width: double.infinity, - color: Colors.grey[400], child: Padding( padding: const EdgeInsets.all(8.0), - child: Texts( + child: Text( DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(notification.createdOn)) + " " + DateUtil.formatDateToTimeLang(DateUtil.convertStringToDate(notification.createdOn), false), - fontSize: 16, + style: TextStyle( + fontSize: 18.0, + color: Colors.black, + fontWeight: FontWeight.w600 + ), ), ), ), @@ -88,7 +91,7 @@ class NotificationsDetailsPage extends StatelessWidget { children: [ Expanded( child: Center( - child: Texts(notification.message), + child: Text(notification.message), ), ), ], diff --git a/lib/pages/DrawerPages/notifications/notifications_page.dart b/lib/pages/DrawerPages/notifications/notifications_page.dart index aba2fb13..5a859fca 100644 --- a/lib/pages/DrawerPages/notifications/notifications_page.dart +++ b/lib/pages/DrawerPages/notifications/notifications_page.dart @@ -1,16 +1,17 @@ import 'package:diplomaticquarterapp/core/model/notifications/get_notifications_request_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/notifications_view_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/pages/DrawerPages/notifications/notification_details_page.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; -import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/material.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart'; +import 'package:provider/provider.dart'; // ignore: must_be_immutable class NotificationsPage extends StatelessWidget { @@ -18,9 +19,7 @@ class NotificationsPage extends StatelessWidget { DateTime d = DateUtil.convertStringToDate(date); String monthName = DateUtil.getMonth(d.month).toString(); TimeOfDay timeOfDay = TimeOfDay(hour: d.hour, minute: d.minute); - String minute = timeOfDay.minute < 10 - ? timeOfDay.minute.toString().padLeft(2, '0') - : timeOfDay.minute.toString(); + String minute = timeOfDay.minute < 10 ? timeOfDay.minute.toString().padLeft(2, '0') : timeOfDay.minute.toString(); String hour = '${timeOfDay.hourOfPeriod}:$minute'; if (timeOfDay.period == DayPeriod.am) { @@ -39,112 +38,184 @@ class NotificationsPage extends StatelessWidget { @override Widget build(BuildContext context) { - var prescriptionReport; + ProjectViewModel projectViewModel = Provider.of(context); return BaseView( onModelReady: (model) { - GetNotificationsRequestModel getNotificationsRequestModel = - new GetNotificationsRequestModel( - currentPage: currentIndex, - pagingSize: 14, - notificationStatusID: 2); + GetNotificationsRequestModel getNotificationsRequestModel = new GetNotificationsRequestModel(currentPage: currentIndex, pagingSize: 14, notificationStatusID: 2); model.getNotifications(getNotificationsRequestModel, context); }, builder: (_, model, widget) => AppScaffold( - isShowAppBar: true, - showNewAppBar: true, - showNewAppBarTitle: true, - appBarTitle: TranslationBase.of(context).notifications, - baseViewModel: model, - body: ListView( - children: model.notifications - .map( - (notification) => InkWell( - onTap: () async { - if (!notification.isRead) { - model.markAsRead(notification.id); - } - Navigator.push( - context, - FadePage( - page: NotificationsDetailsPage( - notification: notification, - ))); - }, - child: Container( - width: double.infinity, - margin: EdgeInsets.only( - top: 5, left: 10, right: 10, bottom: 5), - padding: EdgeInsets.all(8.0), - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.all( - Radius.circular(10.0), - ), - border: Border.all( - color: notification.isRead - ? Colors.grey[200] - : CustomColors.accentColor, - width: 0.5), - ), - child: Row( - children: [ - Expanded( - child: Padding( - padding: const EdgeInsets.all(8.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Texts(DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(notification.createdOn)) + " " + DateUtil.formatDateToTimeLang(DateUtil.convertStringToDate(notification.createdOn), false)), - SizedBox( - height: 5, - ), - Row( - children: [ - Expanded( - child: Texts(notification.message)), - if (notification.messageType == "image") - Icon(FontAwesomeIcons.images) - ], - ), - SizedBox( - height: 5, - ), - ], + isShowAppBar: true, + showNewAppBar: true, + showNewAppBarTitle: true, + appBarTitle: TranslationBase.of(context).notifications, + baseViewModel: model, + body: ListView.separated( + itemBuilder: (context, index) { + return InkWell( + onTap: () async { + if (!model.notifications[index].isRead) { + model.markAsRead(model.notifications[index].id); + } + Navigator.push( + context, + FadePage( + page: NotificationsDetailsPage( + notification: model.notifications[index], + ))); + }, + child: Container( + width: double.infinity, + padding: EdgeInsets.all(8.0), + decoration: BoxDecoration( + color: model.notifications[index].isRead ? Theme.of(context).scaffoldBackgroundColor : CustomColors.accentColor.withOpacity(0.05), + border: projectViewModel.isArabic + ? Border( + right: BorderSide( + color: model.notifications[index].isRead ? Theme.of(context).scaffoldBackgroundColor : CustomColors.accentColor, + width: 5.0, + ), + ) + : Border( + left: BorderSide( + color: model.notifications[index].isRead ? Theme.of(context).scaffoldBackgroundColor : CustomColors.accentColor, + width: 5.0, ), ), + ), + child: Row( + children: [ + Expanded( + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts(DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(model.notifications[index].createdOn)) + + " " + + DateUtil.formatDateToTimeLang(DateUtil.convertStringToDate(model.notifications[index].createdOn), false)), + SizedBox( + height: 5, + ), + Row( + children: [ + Expanded(child: Texts(model.notifications[index].message)), + if (model.notifications[index].messageType == "image") + Icon( + FontAwesomeIcons.images, + color: CustomColors.grey, + ) + ], + ), + SizedBox( + height: 5, + ), + ], + ), ), - SizedBox( - width: 15, - ), - ], - ), + ), + ], ), ), - ) - .toList() - ..add( - InkWell( - onTap: () async { - GifLoaderDialogUtils.showMyDialog(context); - currentIndex++; - GetNotificationsRequestModel - getNotificationsRequestModel = - new GetNotificationsRequestModel( - currentPage: currentIndex, - pagingSize: 14, - notificationStatusID: 2); - - await model.getNotifications( - getNotificationsRequestModel, context); - GifLoaderDialogUtils.hideDialog(context); - }, - child: Center( - child: Image.asset('assets/images/notf.png'), - ), + ); + }, + separatorBuilder: (context, index) { + return Column( + children: [ + Divider( + color: Colors.grey[300], + thickness: 2.0, ), - )), - ), + ], + ); + }, + itemCount: model.notifications.length)), + // ListView( + // children: model.notifications + // .map( + // (notification) => InkWell( + // onTap: () async { + // if (!notification.isRead) { + // model.markAsRead(notification.id); + // } + // Navigator.push( + // context, + // FadePage( + // page: NotificationsDetailsPage( + // notification: notification, + // ))); + // }, + // child: Container( + // width: double.infinity, + // padding: EdgeInsets.all(8.0), + // decoration: BoxDecoration( + // color: notification.isRead ? CustomColors.white : CustomColors.accentColor.withOpacity(0.05), + // border: Border( + // left: BorderSide( + // color: notification.isRead ? Colors.grey[200] : CustomColors.accentColor, + // width: 5.0, + // ), + // ), + // ), + // child: Row( + // children: [ + // Expanded( + // child: Padding( + // padding: const EdgeInsets.all(8.0), + // child: Column( + // crossAxisAlignment: CrossAxisAlignment.start, + // children: [ + // Texts(DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(notification.createdOn)) + " " + DateUtil.formatDateToTimeLang(DateUtil.convertStringToDate(notification.createdOn), false)), + // SizedBox( + // height: 5, + // ), + // Row( + // children: [ + // Expanded( + // child: Texts(notification.message)), + // if (notification.messageType == "image") + // Icon(FontAwesomeIcons.images, color: CustomColors.grey,) + // ], + // ), + // SizedBox( + // height: 5, + // ), + // Divider( + // height: 5.0, + // color: CustomColors.grey2, + // ), + // ], + // ), + // ), + // ), + // ], + // ), + // ), + // ), + // ) + // .toList() + // ..add( + // InkWell( + // onTap: () async { + // GifLoaderDialogUtils.showMyDialog(context); + // currentIndex++; + // GetNotificationsRequestModel + // getNotificationsRequestModel = + // new GetNotificationsRequestModel( + // currentPage: currentIndex, + // pagingSize: 14, + // notificationStatusID: 2); + // + // await model.getNotifications( + // getNotificationsRequestModel, context); + // GifLoaderDialogUtils.hideDialog(context); + // }, + // child: Center( + // child: Image.asset('assets/images/notf.png'), + // ), + // ), + // )), ); } } diff --git a/lib/pages/ToDoList/widgets/paymentDialog.dart b/lib/pages/ToDoList/widgets/paymentDialog.dart index c46535b3..7c1bf6ed 100644 --- a/lib/pages/ToDoList/widgets/paymentDialog.dart +++ b/lib/pages/ToDoList/widgets/paymentDialog.dart @@ -4,7 +4,9 @@ import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/utils_new.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_datetime_picker/flutter_datetime_picker.dart'; class PaymentDialog extends StatefulWidget { AppoitmentAllHistoryResultList appo; @@ -30,25 +32,18 @@ class _PaymentDialogState extends State { child: Column(crossAxisAlignment: CrossAxisAlignment.start, mainAxisSize: MainAxisSize.max, children: [ Container( margin: EdgeInsets.fromLTRB(20.0, 20.0, 20.0, 5.0), - child: Text(TranslationBase.of(context).invoiceDetails, style: TextStyle(fontSize: 25.0, fontWeight: FontWeight.bold)), - ), - Divider( - color: Colors.grey, + child: Text(TranslationBase.of(context).invoiceDetails, style: TextStyle(fontSize: 25.0, fontWeight: FontWeight.w600)), ), Container( - margin: EdgeInsets.fromLTRB(20.0, 5.0, 20.0, 5.0), - child: Text(TranslationBase.of(context).appoDetails, style: TextStyle(fontSize: 15.0, fontWeight: FontWeight.bold)), + margin: EdgeInsets.fromLTRB(20.0, 5.0, 20.0, 0.0), + child: Text(widget.appo.doctorTitle + " " + widget.appo.doctorNameObj, style: TextStyle(color: Colors.black, fontSize: 15.0, fontWeight: FontWeight.w600)), ), Container( - margin: EdgeInsets.fromLTRB(20.0, 5.0, 20.0, 5.0), - child: Text(widget.appo.doctorTitle + " " + widget.appo.doctorNameObj, style: TextStyle(color: Colors.grey[700], fontSize: 15.0, fontWeight: FontWeight.bold)), - ), - Container( - margin: EdgeInsets.fromLTRB(20.0, 5.0, 20.0, 5.0), + margin: EdgeInsets.fromLTRB(20.0, 5.0, 20.0, 0.0), child: Text(getDate(widget.appo.appointmentDate), style: getTextStyle()), ), Container( - margin: EdgeInsets.fromLTRB(20.0, 5.0, 20.0, 5.0), + margin: EdgeInsets.fromLTRB(20.0, 5.0, 20.0, 0.0), child: Text(widget.appo.projectName, style: getTextStyle()), ), Divider( @@ -58,7 +53,7 @@ class _PaymentDialogState extends State { margin: EdgeInsets.fromLTRB(20.0, 0.0, 20.0, 5.0), child: Table( children: [ - TableRow(children: [ + TableRow(decoration: BoxDecoration(), children: [ TableCell(child: _getNormalText(TranslationBase.of(context).patientShareToDo)), TableCell(child: _getNormalText(widget.patientShareResponse.patientShare.toString())), ]), @@ -77,46 +72,38 @@ class _PaymentDialogState extends State { color: Colors.grey, ), Container( - margin: EdgeInsets.fromLTRB(20.0, 10.0, 20.0, 5.0), - child: Text(TranslationBase.of(context).YouCanPayByTheFollowingOptions, style: TextStyle(fontSize: 14.0, fontWeight: FontWeight.bold)), + margin: EdgeInsets.fromLTRB(20.0, 20.0, 20.0, 5.0), + child: Text(TranslationBase.of(context).YouCanPayByTheFollowingOptions, style: TextStyle(fontSize: 14.0, fontWeight: FontWeight.w600)), ), Container(margin: EdgeInsets.fromLTRB(20.0, 5.0, 20.0, 5.0), child: getPaymentMethods()), Container( - margin: EdgeInsets.fromLTRB(20.0, 5.0, 20.0, 15.0), - child: Text(TranslationBase.of(context).appoPaymentConfirm, style: TextStyle(fontSize: 14.0, color: CustomColors.accentColor)), - ), - Divider( - color: Colors.grey, + margin: EdgeInsets.fromLTRB(20.0, 30.0, 20.0, 15.0), + child: Text(TranslationBase.of(context).appoPaymentConfirm, style: TextStyle(fontSize: 14.0, color: CustomColors.accentColor, fontWeight: FontWeight.w600)), ), Container( alignment: Alignment.center, height: 40.0, + margin: EdgeInsets.only(left: 20.0, right: 20.0, top: 20.0), child: Flex( direction: Axis.horizontal, children: [ Expanded( - child: InkWell( - onTap: () { + child: DefaultButton( + TranslationBase.of(context).cancel, + () { Navigator.pop(context, null); }, - child: Container( - child: Text(TranslationBase.of(context).cancel, textAlign: TextAlign.center, style: TextStyle(fontSize: 18.0, color: CustomColors.accentColor)), - ), + color: Color(0xffEAEAEA), + textColor: Colors.black, ), ), + mWidth(10.0), Expanded( - child: InkWell( - onTap: () { + child: DefaultButton( + TranslationBase.of(context).confirm, + () { Navigator.pop(context, widget.patientShareResponse); -// widget.onPaymentMethodSelected(); }, - child: Container( - child: Text(TranslationBase.of(context).ok, - textAlign: TextAlign.center, - style: TextStyle( - fontSize: 18.0, - )), - ), ), ), ], @@ -131,28 +118,17 @@ class _PaymentDialogState extends State { _getNormalText(text) { return Container( margin: EdgeInsets.only(top: 10.0, right: 10.0), - child: Text(text, style: TextStyle(fontSize: 13, letterSpacing: 0.5, color: Colors.grey[700])), + child: Text(text, style: TextStyle(fontSize: 13, letterSpacing: 0.5, color: Colors.black)), ); } TextStyle getTextStyle() { - return TextStyle(color: Colors.grey[700], fontSize: 13.0); + return TextStyle(color: Colors.grey[700], fontSize: 13.0, fontWeight: FontWeight.w600); } -// Future navigateToPaymentMethod(context) async { -// Navigator.push( -// context, MaterialPageRoute(builder: (context) => PaymentMethod())); -// } - String getDate(String date) { DateTime dateObj = DateUtil.convertStringToDate(date); - return DateUtil.getWeekDay(dateObj.weekday) + - ", " + - dateObj.day.toString() + - " " + - DateUtil.getMonth(dateObj.month) + - " " + - dateObj.year.toString() + + return DateUtil.getDayMonthYearDateFormatted(dateObj) + " " + dateObj.hour.toString() + ":" + diff --git a/lib/pages/feedback/status_feedback_page.dart b/lib/pages/feedback/status_feedback_page.dart index 269b336d..46a545a6 100644 --- a/lib/pages/feedback/status_feedback_page.dart +++ b/lib/pages/feedback/status_feedback_page.dart @@ -42,7 +42,7 @@ class _StatusFeedbackPageState extends State { children: [ Expanded( child: projectViewModel.isLogin - ? !model.cOCItemList.isNotEmpty + ? model.cOCItemList.isNotEmpty ? listData(model.cOCItemList, projectViewModel.isArabic, true) : Center( child: Column( diff --git a/lib/pages/insurance/insurance_approval_detail_screen.dart b/lib/pages/insurance/insurance_approval_detail_screen.dart index 2cc381d4..a1be5cf8 100644 --- a/lib/pages/insurance/insurance_approval_detail_screen.dart +++ b/lib/pages/insurance/insurance_approval_detail_screen.dart @@ -77,9 +77,9 @@ class InsuranceApprovalDetail extends StatelessWidget { myRichText(TranslationBase.of(context).companyName, insuranceApprovalModel?.companyName ?? "", projectViewModel.isArabic), SizedBox(height: 6), myRichText(TranslationBase.of(context).receiptOn, - DateUtil.formatDateToDate(DateUtil.convertStringToDateTime(insuranceApprovalModel.receiptOn), projectViewModel.isArabic) ?? "", projectViewModel.isArabic), + DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDateTime(insuranceApprovalModel.receiptOn)) ?? "", projectViewModel.isArabic), myRichText(TranslationBase.of(context).expiryOn, - DateUtil.formatDateToDate(DateUtil.convertStringToDateTime(insuranceApprovalModel.expiryDate), projectViewModel.isArabic) ?? "", projectViewModel.isArabic), + DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDateTime(insuranceApprovalModel.expiryDate)) ?? "", projectViewModel.isArabic), ], ), ), @@ -101,8 +101,8 @@ class InsuranceApprovalDetail extends StatelessWidget { TableRow( children: [ Utils.tableColumnValue(insuranceApprovalModel?.apporvalDetails?.procedureName ?? '', isLast: true, mProjectViewModel: projectViewModel), - Utils.tableColumnValue(insuranceApprovalModel?.approvalStatusDescption ?? '', isLast: true, mProjectViewModel: projectViewModel), - Utils.tableColumnValue(insuranceApprovalModel?.apporvalDetails?.isInvoicedDesc.toString() ?? '', isLast: true, mProjectViewModel: projectViewModel), + Utils.tableColumnValue(insuranceApprovalModel?.apporvalDetails?.status ?? '', isLast: true, mProjectViewModel: projectViewModel), + Utils.tableColumnValue(insuranceApprovalModel?.apporvalDetails?.isInvoicedDesc ?? '', isLast: true, mProjectViewModel: projectViewModel), ], ), ]) diff --git a/lib/pages/landing/landing_page.dart b/lib/pages/landing/landing_page.dart index 13cc2dce..cebcacdc 100644 --- a/lib/pages/landing/landing_page.dart +++ b/lib/pages/landing/landing_page.dart @@ -173,19 +173,22 @@ class _LandingPageState extends State with WidgetsBindingObserver { // pageController.jumpToPage(tab); } else { - if (currentTab > 0 && tab == 2) + if (currentTab > 0 && tab == 2) { pageController.jumpToPage(0); - else if (tab != 0) { + currentTab = tab; + } else if (tab != 0) { if (tab == 4 && projectViewModel.isLogin && model.count == 0) { AppToast.showErrorToast(message: TranslationBase.of(context).noBookedAppo); } else { pageController.jumpToPage(tab); + currentTab = tab; } } else { pageController.jumpToPage(tab); + currentTab = tab; } - currentTab = tab; + // currentTab = tab; } }); } diff --git a/lib/pages/livecare/widgets/LiveCareHistoryCard.dart b/lib/pages/livecare/widgets/LiveCareHistoryCard.dart index 785fcb71..d3029f86 100644 --- a/lib/pages/livecare/widgets/LiveCareHistoryCard.dart +++ b/lib/pages/livecare/widgets/LiveCareHistoryCard.dart @@ -6,6 +6,7 @@ import 'package:diplomaticquarterapp/pages/feedback/feedback_home_page.dart'; import 'package:diplomaticquarterapp/services/livecare_services/livecare_provider.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart'; @@ -60,7 +61,7 @@ class _LiveCareHistoryCardState extends State { child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Text(widget.erRequestHistoryList.sArrivalTime, style: TextStyle(fontSize: 14.0)), + Text(DateUtil.getDayMonthYearHourMinuteDateFormatted(DateUtil.convertStringToDate(widget.erRequestHistoryList.arrivalTime)), style: TextStyle(fontSize: 14.0)), Text(TranslationBase.of(context).callDuration + "\n" + getCallTime(widget.erRequestHistoryList.callDuration), textAlign: TextAlign.center, style: TextStyle(fontSize: 14.0, color: Colors.grey[600])), ], ), @@ -130,8 +131,8 @@ class _LiveCareHistoryCardState extends State { Icon(Icons.star, size: 24.0, color: Colors.yellow[700]), Container( width: MediaQuery.of(context).size.width * 0.2, - margin: EdgeInsets.only(left: 10.0), - child: Text(TranslationBase.of(context).rateDoctorAppo, overflow: TextOverflow.clip, textAlign: TextAlign.center, style: TextStyle(fontSize: 12.0)), + margin: EdgeInsets.only(left: 9.0), + child: Text(TranslationBase.of(context).rateDoctorAppo, overflow: TextOverflow.clip, textAlign: TextAlign.center, style: TextStyle(fontSize: 11.0)), ), ], ), diff --git a/lib/pages/medical/balance/dialogs/SelectHospitalDialog.dart b/lib/pages/medical/balance/dialogs/SelectHospitalDialog.dart index 7605a879..fd47ea1b 100644 --- a/lib/pages/medical/balance/dialogs/SelectHospitalDialog.dart +++ b/lib/pages/medical/balance/dialogs/SelectHospitalDialog.dart @@ -50,7 +50,7 @@ class _SelectHospitalDialogState extends State { }, child: ListTile( title: Text( - widget.hospitals[index].name + ' ${widget.hospitals[index].distanceInKilometers} KM', + widget.hospitals[index].name + ' ${widget.hospitals[index].distanceInKilometers} ' + TranslationBase.of(context).km, style: TextStyle( fontSize: 14, fontWeight: FontWeight.w600, diff --git a/lib/pages/medical/my_invoices/invoice_detail_page.dart b/lib/pages/medical/my_invoices/invoice_detail_page.dart index 0f35a96f..9a6a9b03 100644 --- a/lib/pages/medical/my_invoices/invoice_detail_page.dart +++ b/lib/pages/medical/my_invoices/invoice_detail_page.dart @@ -3,7 +3,6 @@ import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart import 'package:diplomaticquarterapp/models/MyInvoices/DentalInvoiceDetailResponse.dart'; import 'package:diplomaticquarterapp/models/MyInvoices/GetDentalAppointmentsResponse.dart'; import 'package:diplomaticquarterapp/models/header_model.dart'; -import 'package:diplomaticquarterapp/pages/BookAppointment/widgets/DoctorView.dart'; import 'package:diplomaticquarterapp/services/my_invoice_service/my_invoice_services.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; @@ -11,15 +10,11 @@ import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:diplomaticquarterapp/uitl/utils_new.dart'; -import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; import 'package:diplomaticquarterapp/widgets/data_display/medical/doctor_card.dart'; -import 'package:diplomaticquarterapp/widgets/dialogs/confirm_send_email_dialog.dart'; import 'package:diplomaticquarterapp/widgets/new_design/doctor_header.dart'; -import 'package:diplomaticquarterapp/widgets/others/app_expandable_notifier.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; -import 'package:diplomaticquarterapp/extensions/list_extension.dart'; class InvoiceDetail extends StatefulWidget { final DoctorList doctor; @@ -73,7 +68,8 @@ class _InvoiceDetailState extends State { widget.doctor.doctorRate, widget.doctor.actualDoctorRate, widget.doctor.noOfPatientsRate ?? 0, - projectViewModel.user.emailAddress), + projectViewModel.user.emailAddress, + decimalDoctorRate: widget.doctor.decimalDoctorRate.toString()), onTap: () { sendInvoiceEmail(); }, @@ -117,7 +113,12 @@ class _InvoiceDetailState extends State { margin: EdgeInsets.only(bottom: 10.0), child: Text(TranslationBase.of(context).cardDetail, style: TextStyle(color: Colors.black, letterSpacing: -0.64, fontSize: 18.0, fontWeight: FontWeight.bold)), ), - myRichText(TranslationBase.of(context).insuranceCompany + ": ", widget.dentalInvoiceDetailResponse.listEInvoiceForDental[0].companyName, projectViewModel.isArabic), + myRichText( + TranslationBase.of(context).insuranceCompany + ": ", + projectViewModel.isArabic + ? widget.dentalInvoiceDetailResponse.listEInvoiceForDental[0].groupNameN + : widget.dentalInvoiceDetailResponse.listEInvoiceForDental[0].companyName, + projectViewModel.isArabic), myRichText( TranslationBase.of(context).insuranceID + ": ", widget.dentalInvoiceDetailResponse.listEInvoiceForDental[0].insuranceID != null ? widget.dentalInvoiceDetailResponse.listEInvoiceForDental[0].insuranceID : "N/A", diff --git a/lib/pages/medical/my_invoices/my_invoice_page.dart b/lib/pages/medical/my_invoices/my_invoice_page.dart index d13a0599..820bf355 100644 --- a/lib/pages/medical/my_invoices/my_invoice_page.dart +++ b/lib/pages/medical/my_invoices/my_invoice_page.dart @@ -97,6 +97,10 @@ class _MyInvoicesState extends State { doctor.dayName = listDentalAppointments.invoiceNo; doctor.clinicName = listDentalAppointments.invoiceNo.toString(); doctor.date = listDentalAppointments.appointmentDate; + doctor.noOfPatientsRate = listDentalAppointments.patientNumber; + doctor.actualDoctorRate = listDentalAppointments.doctorRate; + doctor.decimalDoctorRate = listDentalAppointments.decimalDoctorRate; + doctor.doctorID = listDentalAppointments.doctorID; myInvoicesService.getDentalAppointmentInvoice(listDentalAppointments.projectID, listDentalAppointments.appointmentNo, context).then((res) { GifLoaderDialogUtils.hideDialog(context); diff --git a/lib/pages/medical/my_trackers/Weight/WeightMonthlyPage.dart b/lib/pages/medical/my_trackers/Weight/WeightMonthlyPage.dart index ff5a707d..3cc02dba 100644 --- a/lib/pages/medical/my_trackers/Weight/WeightMonthlyPage.dart +++ b/lib/pages/medical/my_trackers/Weight/WeightMonthlyPage.dart @@ -1,6 +1,5 @@ import "package:collection/collection.dart"; import 'package:diplomaticquarterapp/core/viewModels/medical/weight_pressure_view_model.dart'; -import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/pages/medical/my_trackers/widget/MonthLineChartCurved.dart'; import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; @@ -8,12 +7,10 @@ import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:diplomaticquarterapp/uitl/utils_new.dart'; import 'package:diplomaticquarterapp/widgets/charts/app_time_series_chart.dart'; -import 'package:diplomaticquarterapp/widgets/charts/show_chart.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -import 'package:provider/provider.dart'; class WeightMonthlyPage extends StatelessWidget { final WeightPressureViewModel model; @@ -26,7 +23,6 @@ class WeightMonthlyPage extends StatelessWidget { @override Widget build(BuildContext context) { - ProjectViewModel projectViewModel = Provider.of(context); groupData(); return AppScaffold( isShowDecPage: false, @@ -43,7 +39,6 @@ class WeightMonthlyPage extends StatelessWidget { timeSeries: model.weighMonthTimeSeriesData.isEmpty ? [TimeSeriesSales3(0, 0.0)] : model.weighMonthTimeSeriesData, indexes: model.weighMonthTimeSeriesData.length ~/ 5.5, ), - ), Card( shape: cardRadius(12), @@ -81,7 +76,7 @@ class WeightMonthlyPage extends StatelessWidget { 0: FlexColumnWidth(2.5), // 2: FlexColumnWidth(1.8), }, - children: fullData(context, projectViewModel, monthly[1]), + children: fullData(context, monthly[1]), ) ]) ]) @@ -97,7 +92,7 @@ class WeightMonthlyPage extends StatelessWidget { ); } - List fullData(BuildContext context, ProjectViewModel projectViewModel, model) { + List fullData(BuildContext context, model) { List tableRow = []; tableRow.add( TableRow( @@ -113,8 +108,7 @@ class WeightMonthlyPage extends StatelessWidget { tableRow.add( TableRow( children: [ - Utils.tableColumnValue('${projectViewModel.isArabic ? DateUtil.getMonthDayYearDateFormattedAr(diabtec.weightDate) : DateUtil.getMonthDayYearDateFormatted(diabtec.weightDate)} ', - isCapitable: false), + Utils.tableColumnValue('${DateUtil.getDayMonthYearDateFormatted(diabtec.weightDate)} ', isCapitable: false), Utils.tableColumnValue('${diabtec.weightDate.hour}:${diabtec.weightDate.minute}', isCapitable: false), Utils.tableColumnValue('${diabtec.weightMeasured}', isCapitable: false), ], diff --git a/lib/pages/medical/my_trackers/Weight/WeightWeeklyPage.dart b/lib/pages/medical/my_trackers/Weight/WeightWeeklyPage.dart index 54891563..6725874f 100644 --- a/lib/pages/medical/my_trackers/Weight/WeightWeeklyPage.dart +++ b/lib/pages/medical/my_trackers/Weight/WeightWeeklyPage.dart @@ -1,5 +1,4 @@ import 'package:diplomaticquarterapp/core/viewModels/medical/weight_pressure_view_model.dart'; -import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; @@ -12,7 +11,6 @@ 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'; import 'AddWeightPage.dart'; @@ -23,23 +21,11 @@ class WeightWeeklyPage extends StatelessWidget { @override Widget build(BuildContext context) { - ProjectViewModel projectViewModel = Provider.of(context); - return AppScaffold( isShowDecPage: false, backgroundColor: CustomColors.appBackgroudGrey2Color, body: ListView( children: [ - // Container( - // margin: EdgeInsets.only(top: 12, left: 8, right: 8), - // color: Colors.white, - // child: LineChartCurved( - // horizontalInterval: 1.0, - // title: TranslationBase.of(context).weight, - // timeSeries: model.weightWeekTimeSeriesData.isEmpty ? [TimeSeriesSales2(DateTime.now(), 0.0)] : model.weightWeekTimeSeriesData, - // indexes: model.weightWeekTimeSeriesData.length ~/ 5.5 ?? 0, - // ), - // ), Card( shape: cardRadius(12), elevation: 1, @@ -78,7 +64,7 @@ class WeightWeeklyPage extends StatelessWidget { columnWidths: { 0: FlexColumnWidth(2.5), }, - children: fullData(context, projectViewModel, model), + children: fullData(context, model), ), ], ), @@ -92,7 +78,7 @@ class WeightWeeklyPage extends StatelessWidget { ); } - List fullData(BuildContext context, ProjectViewModel projectViewModel, WeightPressureViewModel model) { + List fullData(BuildContext context, WeightPressureViewModel model) { List tableRow = []; tableRow.add( TableRow( @@ -109,8 +95,7 @@ class WeightWeeklyPage extends StatelessWidget { tableRow.add( TableRow( children: [ - Utils.tableColumnValue('${projectViewModel.isArabic ? DateUtil.getMonthDayYearDateFormattedAr(diabtec.weightDate) : DateUtil.getMonthDayYearDateFormatted(diabtec.weightDate)} ', - isCapitable: false), + Utils.tableColumnValue('${DateUtil.getDayMonthYearDateFormatted(diabtec.weightDate)} ', isCapitable: false), Utils.tableColumnValue('${diabtec.weightDate.hour}:${diabtec.weightDate.minute}', isCapitable: false), Utils.tableColumnValue('${diabtec.weightMeasured}', isCapitable: false), Column(crossAxisAlignment: CrossAxisAlignment.start, mainAxisSize: MainAxisSize.min, children: [ diff --git a/lib/pages/medical/my_trackers/Weight/WeightYeaPage.dart b/lib/pages/medical/my_trackers/Weight/WeightYeaPage.dart index efa3393d..c0c2142b 100644 --- a/lib/pages/medical/my_trackers/Weight/WeightYeaPage.dart +++ b/lib/pages/medical/my_trackers/Weight/WeightYeaPage.dart @@ -25,7 +25,6 @@ class WeightYearPage extends StatelessWidget { List monthlyGroup = []; @override Widget build(BuildContext context) { - ProjectViewModel projectViewModel = Provider.of(context); groupData(); return AppScaffold( isShowDecPage: false, @@ -76,7 +75,7 @@ class WeightYearPage extends StatelessWidget { columnWidths: { 0: FlexColumnWidth(2.5), }, - children: fullData(context, projectViewModel, monthly[1]), + children: fullData(context, monthly[1]), ) ]) ]), @@ -91,7 +90,7 @@ class WeightYearPage extends StatelessWidget { ); } - List fullData(BuildContext context, ProjectViewModel projectViewModel, model) { + List fullData(BuildContext context, model) { List tableRow = []; tableRow.add( TableRow( @@ -107,7 +106,7 @@ class WeightYearPage extends StatelessWidget { tableRow.add( TableRow( children: [ - Utils.tableColumnValue('${projectViewModel.isArabic ? DateUtil.getMonthDayYearDateFormattedAr(diabtec.weightDate) : DateUtil.getMonthDayYearDateFormatted(diabtec.weightDate)} ', + Utils.tableColumnValue('${DateUtil.getDayMonthYearDateFormatted(diabtec.weightDate)} ', isCapitable: false), Utils.tableColumnValue('${diabtec.weightDate.hour}:${diabtec.weightDate.minute}', isCapitable: false), Utils.tableColumnValue('${diabtec.weightMeasured}', isCapitable: false), diff --git a/lib/pages/medical/my_trackers/blood_pressure/BloodPressureMonthly.dart b/lib/pages/medical/my_trackers/blood_pressure/BloodPressureMonthly.dart index 8f79bb34..049636a9 100644 --- a/lib/pages/medical/my_trackers/blood_pressure/BloodPressureMonthly.dart +++ b/lib/pages/medical/my_trackers/blood_pressure/BloodPressureMonthly.dart @@ -1,6 +1,5 @@ import "package:collection/collection.dart"; import 'package:diplomaticquarterapp/core/viewModels/medical/blood_pressure_view_model.dart'; -import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/pages/medical/my_trackers/widget/MonthCurvedChartBloodPressure.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; @@ -10,16 +9,15 @@ import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -import 'package:provider/provider.dart'; class BloodPressureMonthlyPage extends StatelessWidget { final BloodPressureViewMode model; BloodPressureMonthlyPage({Key key, this.model}) : super(key: key); List monthlyGroup = []; + @override Widget build(BuildContext context) { - ProjectViewModel projectViewModel = Provider.of(context); groupData(); return AppScaffold( body: ListView( @@ -67,7 +65,7 @@ class BloodPressureMonthlyPage extends StatelessWidget { 0: FlexColumnWidth(1.8), 2: FlexColumnWidth(1.8), }, - children: fullData(context, projectViewModel, monthly[1]), + children: fullData(context, monthly[1]), ) ]) ]), @@ -80,7 +78,7 @@ class BloodPressureMonthlyPage extends StatelessWidget { ); } - List fullData(BuildContext context, ProjectViewModel projectViewModel, model) { + List fullData(BuildContext context, model) { List tableRow = []; tableRow.add( TableRow( @@ -97,9 +95,7 @@ class BloodPressureMonthlyPage extends StatelessWidget { tableRow.add( TableRow( children: [ - Utils.tableColumnValue( - '${projectViewModel.isArabic ? DateUtil.getMonthDayYearDateFormattedAr(diabtec.bloodPressureDate) : DateUtil.getMonthDayYearDateFormatted(diabtec.bloodPressureDate)}', - isCapitable: false), + Utils.tableColumnValue('${DateUtil.getDayMonthYearDateFormatted(diabtec.bloodPressureDate)}', isCapitable: false), Utils.tableColumnValue('${diabtec.bloodPressureDate.hour}:${diabtec.bloodPressureDate.minute}', isCapitable: false), Utils.tableColumnValue(diabtec.measuredArmDesc, isCapitable: false), Utils.tableColumnValue('${diabtec.systolicePressure}/${diabtec.diastolicPressure}', isCapitable: false), diff --git a/lib/pages/medical/my_trackers/blood_pressure/BloodPressureYeaPage.dart b/lib/pages/medical/my_trackers/blood_pressure/BloodPressureYeaPage.dart index c31b5f5c..1b1334e9 100644 --- a/lib/pages/medical/my_trackers/blood_pressure/BloodPressureYeaPage.dart +++ b/lib/pages/medical/my_trackers/blood_pressure/BloodPressureYeaPage.dart @@ -1,6 +1,5 @@ import "package:collection/collection.dart"; import 'package:diplomaticquarterapp/core/viewModels/medical/blood_pressure_view_model.dart'; -import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/pages/medical/my_trackers/widget/CurvedChartBloodPressure.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; @@ -10,16 +9,15 @@ import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -import 'package:provider/provider.dart'; class BloodPressureYearPage extends StatelessWidget { final BloodPressureViewMode model; BloodPressureYearPage({Key key, this.model}) : super(key: key); List monthlyGroup = []; + @override Widget build(BuildContext context) { - ProjectViewModel projectViewModel = Provider.of(context); groupData(); return AppScaffold( body: ListView( @@ -28,7 +26,8 @@ class BloodPressureYearPage extends StatelessWidget { margin: EdgeInsets.only(top: 12, left: 8, right: 8), color: Colors.white, child: CurvedChartBloodPressure( - horizontalInterval: 3.0, // model.weightWeekTimeSeriesDataLow.length==1 ?1 :20.0, + horizontalInterval: 3.0, + // model.weightWeekTimeSeriesDataLow.length==1 ?1 :20.0, title: TranslationBase.of(context).bloodPressure, timeSeries1: model.weightYearTimeSeriesDataTop.isEmpty ? [TimeSeriesSales2(DateTime.now(), 0.0)] : model.weightYearTimeSeriesDataTop, timeSeries2: model.weightYearTimeSeriesDataLow.isEmpty ? [TimeSeriesSales2(DateTime.now(), 0.0)] : model.weightYearTimeSeriesDataLow, @@ -38,10 +37,6 @@ class BloodPressureYearPage extends StatelessWidget { SizedBox( height: 12, ), - // Padding( - // padding: const EdgeInsets.all(8.0), - // child: Texts(TranslationBase.of(context).details), - // ), Container( padding: EdgeInsets.all(10), color: Colors.transparent, @@ -67,7 +62,7 @@ class BloodPressureYearPage extends StatelessWidget { 0: FlexColumnWidth(1.8), 2: FlexColumnWidth(1.8), }, - children: fullData(context, projectViewModel, monthly[1]), + children: fullData(context, monthly[1]), ) ]) ]), @@ -80,7 +75,7 @@ class BloodPressureYearPage extends StatelessWidget { ); } - List fullData(BuildContext context, ProjectViewModel projectViewModel, model) { + List fullData(BuildContext context, model) { List tableRow = []; tableRow.add( TableRow( @@ -97,9 +92,7 @@ class BloodPressureYearPage extends StatelessWidget { tableRow.add( TableRow( children: [ - Utils.tableColumnValue( - '${projectViewModel.isArabic ? DateUtil.getMonthDayYearDateFormattedAr(diabtec.bloodPressureDate) : DateUtil.getMonthDayYearDateFormatted(diabtec.bloodPressureDate)}', - isCapitable: false), + Utils.tableColumnValue('${DateUtil.getDayMonthYearDateFormatted(diabtec.bloodPressureDate)}', isCapitable: false), Utils.tableColumnValue('${diabtec.bloodPressureDate.hour}:${diabtec.bloodPressureDate.minute}', isCapitable: false), Utils.tableColumnValue(diabtec.measuredArmDesc, isCapitable: false), Utils.tableColumnValue('${diabtec.systolicePressure}/${diabtec.diastolicPressure}', isCapitable: false), diff --git a/lib/pages/medical/my_trackers/blood_pressure/bloodPressureWeeklyPage.dart b/lib/pages/medical/my_trackers/blood_pressure/bloodPressureWeeklyPage.dart index 1e7f3b8b..f3bdb057 100644 --- a/lib/pages/medical/my_trackers/blood_pressure/bloodPressureWeeklyPage.dart +++ b/lib/pages/medical/my_trackers/blood_pressure/bloodPressureWeeklyPage.dart @@ -1,16 +1,15 @@ import 'package:diplomaticquarterapp/core/viewModels/medical/blood_pressure_view_model.dart'; -import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; -import 'package:diplomaticquarterapp/pages/medical/my_trackers/widget/CurvedChartBloodPressure.dart'; +import 'package:diplomaticquarterapp/pages/medical/vital_sign/LineChartCurvedBloodPressure.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:diplomaticquarterapp/widgets/charts/app_time_series_chart.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; 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'; -import 'package:diplomaticquarterapp/uitl/utils.dart'; + import 'AddBloodPressurePage.dart'; class BloodPressureWeeklyPage extends StatelessWidget { @@ -20,7 +19,6 @@ class BloodPressureWeeklyPage extends StatelessWidget { @override Widget build(BuildContext context) { - ProjectViewModel projectViewModel = Provider.of(context); return AppScaffold( body: ListView( children: [ @@ -28,8 +26,7 @@ class BloodPressureWeeklyPage extends StatelessWidget { margin: EdgeInsets.only(top: 12, left: 8, right: 8, bottom: 12.0), padding: EdgeInsets.only(bottom: 12.0), color: Colors.white, - child: CurvedChartBloodPressure( - horizontalInterval: 3.0, + child: LineChartCurvedBloodPressure( title: TranslationBase.of(context).bloodPressure, timeSeries1: model.weightWeekTimeSeriesDataTop.isEmpty ? [TimeSeriesSales2(DateTime.now(), 0.0)] : model.weightWeekTimeSeriesDataTop, timeSeries2: model.weightWeekTimeSeriesDataLow.isEmpty ? [TimeSeriesSales2(DateTime.now(), 0.0)] : model.weightWeekTimeSeriesDataLow, @@ -60,7 +57,7 @@ class BloodPressureWeeklyPage extends StatelessWidget { 0: FlexColumnWidth(1.8), 2: FlexColumnWidth(1.8), }, - children: fullData(context, projectViewModel, model), + children: fullData(context, model), ), SizedBox(height: 80) ], @@ -71,7 +68,7 @@ class BloodPressureWeeklyPage extends StatelessWidget { ); } - List fullData(BuildContext context, ProjectViewModel projectViewModel, BloodPressureViewMode bloodSugarViewMode) { + List fullData(BuildContext context, BloodPressureViewMode bloodSugarViewMode) { List tableRow = []; tableRow.add( TableRow( @@ -89,7 +86,7 @@ class BloodPressureWeeklyPage extends StatelessWidget { tableRow.add( TableRow( children: [ - Utils.tableColumnValue('${DateUtil.getMonthDayYearDateFormatted(diabtec.bloodPressureDate)} ', isCapitable: false), + Utils.tableColumnValue('${DateUtil.getDayMonthYearDateFormatted(diabtec.bloodPressureDate)} ', isCapitable: false), Utils.tableColumnValue(diabtec.bloodPressureDate.hour.toString() + ':' + diabtec.bloodPressureDate.minute.toString(), isCapitable: false), Utils.tableColumnValue('${diabtec.measuredArmDesc}', isCapitable: false), Utils.tableColumnValue('${diabtec.systolicePressure}/${diabtec.diastolicPressure}', isCapitable: false), @@ -114,7 +111,7 @@ class BloodPressureWeeklyPage extends StatelessWidget { ), ).then((value) { model.getBloodPressure(); - if(model.weekDiabtecPatientResult.isEmpty) { + if (model.weekDiabtecPatientResult.isEmpty) { model.weightWeekTimeSeriesDataTop.clear(); model.weightWeekTimeSeriesDataLow.clear(); } diff --git a/lib/pages/medical/my_trackers/blood_suger/BloodMonthly.dart b/lib/pages/medical/my_trackers/blood_suger/BloodMonthly.dart index 5a3710e5..72e2e58b 100644 --- a/lib/pages/medical/my_trackers/blood_suger/BloodMonthly.dart +++ b/lib/pages/medical/my_trackers/blood_suger/BloodMonthly.dart @@ -1,7 +1,6 @@ import "package:collection/collection.dart"; import 'package:diplomaticquarterapp/core/model/my_trakers/blood_sugar/DiabtecPatientResult.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/blood_sugar_view_model.dart'; -import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/pages/medical/my_trackers/widget/MonthLineChartCurved.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; @@ -11,7 +10,6 @@ import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -import 'package:provider/provider.dart'; class BloodMonthlyPage extends StatelessWidget { final List diabtecPatientResult; @@ -24,10 +22,8 @@ class BloodMonthlyPage extends StatelessWidget { @override Widget build(BuildContext context) { - ProjectViewModel projectViewModel = Provider.of(context); groupData(); return AppScaffold( - // baseViewModel: bloodSugarViewMode, body: ListView( children: [ Container( @@ -69,7 +65,7 @@ class BloodMonthlyPage extends StatelessWidget { 0: FlexColumnWidth(1.8), 2: FlexColumnWidth(1.8), }, - children: fullData(context, projectViewModel, monthly[1]), + children: fullData(context, monthly[1]), ) ]) ]), @@ -79,7 +75,7 @@ class BloodMonthlyPage extends StatelessWidget { ); } - List fullData(BuildContext context, ProjectViewModel projectViewModel, e) { + List fullData(BuildContext context, e) { List tableRow = []; tableRow.add( TableRow( @@ -88,71 +84,6 @@ class BloodMonthlyPage extends StatelessWidget { Utils.tableColumnTitle(TranslationBase.of(context).time), Utils.tableColumnTitle(TranslationBase.of(context).measured), Utils.tableColumnTitle(TranslationBase.of(context).value), - // Container( - // child: Container( - // decoration: BoxDecoration( - // color: Theme.of(context).primaryColor, - // borderRadius: BorderRadius.only( - // topLeft: projectViewModel.isArabic ? Radius.circular(0.0) : Radius.circular(10.0), - // topRight: projectViewModel.isArabic ? Radius.circular(10.0) : Radius.circular(0.0), - // ), - // ), - // child: Center( - // child: Texts( - // TranslationBase.of(context).date, - // color: Colors.white, - // fontSize: 15, - // ), - // ), - // height: 40, - // ), - // ), - // Container( - // child: Container( - // decoration: BoxDecoration( - // color: Theme.of(context).primaryColor, - // ), - // child: Center( - // child: Texts( - // TranslationBase.of(context).time, - // color: Colors.white, - // fontSize: 15, - // ), - // ), - // height: 40), - // ), - // Container( - // child: Container( - // decoration: BoxDecoration( - // color: Theme.of(context).primaryColor, - // ), - // child: Center( - // child: Texts( - // TranslationBase.of(context).measured, - // color: Colors.white, - // fontSize: 15, - // ), - // ), - // height: 40), - // ), - // Container( - // child: Container( - // decoration: BoxDecoration( - // color: Theme.of(context).primaryColor, - // borderRadius: BorderRadius.only( - // topLeft: projectViewModel.isArabic ? Radius.circular(10.0) : Radius.circular(0.0), - // topRight: projectViewModel.isArabic ? Radius.circular(0.0) : Radius.circular(10.0), - // ), - // ), - // child: Center( - // child: Texts( - // TranslationBase.of(context).value, - // color: Colors.white, - // fontSize: 15, - // ), - // ), - // height: 40), - // ), ], ), ); @@ -161,67 +92,10 @@ class BloodMonthlyPage extends StatelessWidget { tableRow.add( TableRow( children: [ - Utils.tableColumnValue(projectViewModel.isArabic ? DateUtil.getMonthDayYearDateFormattedAr(diabtec.dateChart) : DateUtil.getMonthDayYearDateFormatted(diabtec.dateChart), - isCapitable: false), + Utils.tableColumnValue(DateUtil.getDayMonthYearDateFormatted(diabtec.dateChart), isCapitable: false), Utils.tableColumnValue(diabtec.dateChart.hour.toString() + ':' + diabtec.dateChart.minute.toString(), isCapitable: false), Utils.tableColumnValue(diabtec.measuredDesc, isCapitable: false), Utils.tableColumnValue(diabtec.resultValue.toString(), isCapitable: false), - // Container( - // child: Container( - // height: 70, - // padding: EdgeInsets.all(10), - // color: Colors.white, - // child: Center( - // child: Texts( - // '${projectViewModel.isArabic ? DateUtil.getMonthDayYearDateFormattedAr(diabtec.dateChart) : DateUtil.getMonthDayYearDateFormatted(diabtec.dateChart)} ', - // textAlign: TextAlign.center, - // fontSize: 12, - // ), - // ), - // ), - // ), - // Container( - // child: Container( - // height: 70, - // padding: EdgeInsets.all(10), - // color: Colors.white, - // child: Center( - // child: Texts( - // '${diabtec.dateChart.hour}:${diabtec.dateChart.minute}', - // textAlign: TextAlign.center, - // fontSize: 12, - // ), - // ), - // ), - // ), - // Container( - // child: Container( - // height: 70, - // padding: EdgeInsets.all(10), - // color: Colors.white, - // child: Center( - // child: Texts( - // '${diabtec.measuredDesc}', - // textAlign: TextAlign.center, - // fontSize: 12, - // ), - // ), - // ), - // ), - // Container( - // child: Container( - // height: 70, - // padding: EdgeInsets.all(10), - // color: Colors.white, - // child: Center( - // child: Texts( - // '${diabtec.resultValue}', - // textAlign: TextAlign.center, - // fontSize: 12, - // ), - // ), - // ), - // ), ], ), ); diff --git a/lib/pages/medical/my_trackers/blood_suger/BloodYeaPage.dart b/lib/pages/medical/my_trackers/blood_suger/BloodYeaPage.dart index d4e1698e..4b3b4152 100644 --- a/lib/pages/medical/my_trackers/blood_suger/BloodYeaPage.dart +++ b/lib/pages/medical/my_trackers/blood_suger/BloodYeaPage.dart @@ -1,17 +1,15 @@ import "package:collection/collection.dart"; import 'package:diplomaticquarterapp/core/model/my_trakers/blood_sugar/DiabtecPatientResult.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/blood_sugar_view_model.dart'; -import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; -import 'package:diplomaticquarterapp/pages/medical/my_trackers/widget/LineChartCurved.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:diplomaticquarterapp/widgets/charts/app_time_series_chart.dart'; +import 'package:diplomaticquarterapp/widgets/charts/show_chart.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -import 'package:provider/provider.dart'; class BloodYearPage extends StatelessWidget { final List diabtecPatientResult; @@ -20,23 +18,24 @@ class BloodYearPage extends StatelessWidget { BloodYearPage({Key key, this.diabtecPatientResult, this.timeSeriesData, this.bloodSugarViewMode}) : super(key: key); List yearlyGroup = []; + @override Widget build(BuildContext context) { groupData(); - ProjectViewModel projectViewModel = Provider.of(context); return AppScaffold( - // baseViewModel: bloodSugarViewMode, body: ListView( children: [ Container( - margin: EdgeInsets.only(top: 12, left: 8, right: 8), - width: double.maxFinite, - color: Colors.white, - child: LineChartCurved( - title: '${TranslationBase.of(context).bloodSugar}', - timeSeries: timeSeriesData.isEmpty ? [TimeSeriesSales2(DateTime.now(), 0.0)] : timeSeriesData, - indexes: timeSeriesData.length ~/ 5.5 ?? 0, - )), + margin: EdgeInsets.only(top: 12, left: 8, right: 8), + width: double.maxFinite, + color: Colors.white, + child: ShowChart( + title: TranslationBase.of(context).weight, + timeSeries: timeSeriesData.isEmpty ? [TimeSeriesSales2(DateTime.now(), 0.0)] : timeSeriesData, + indexes: timeSeriesData.length ~/ 5.5, + horizontalInterval: 2, + ), + ), SizedBox( height: 12, ), @@ -69,7 +68,7 @@ class BloodYearPage extends StatelessWidget { 0: FlexColumnWidth(1.8), 2: FlexColumnWidth(1.8), }, - children: fullData(context, projectViewModel, monthly[1]), + children: fullData(context, monthly[1]), ) ]) ]), @@ -82,7 +81,7 @@ class BloodYearPage extends StatelessWidget { ); } - List fullData(BuildContext context, ProjectViewModel projectViewModel, yearlyGroup) { + List fullData(BuildContext context, yearlyGroup) { List tableRow = []; tableRow.add( TableRow( @@ -99,8 +98,7 @@ class BloodYearPage extends StatelessWidget { tableRow.add( TableRow( children: [ - Utils.tableColumnValue(projectViewModel.isArabic ? DateUtil.getMonthDayYearDateFormattedAr(diabtec.dateChart) : DateUtil.getMonthDayYearDateFormatted(diabtec.dateChart), - isCapitable: false), + Utils.tableColumnValue(DateUtil.getDayMonthYearDateFormatted(diabtec.dateChart), isCapitable: false), Utils.tableColumnValue(diabtec.dateChart.hour.toString() + ':' + diabtec.dateChart.minute.toString(), isCapitable: false), Utils.tableColumnValue(diabtec.measuredDesc, isCapitable: false), Utils.tableColumnValue(diabtec.resultValue.toString(), isCapitable: false), diff --git a/lib/pages/medical/my_trackers/blood_suger/blood_sugar_weekly_page.dart b/lib/pages/medical/my_trackers/blood_suger/blood_sugar_weekly_page.dart index 7921d030..d1728610 100644 --- a/lib/pages/medical/my_trackers/blood_suger/blood_sugar_weekly_page.dart +++ b/lib/pages/medical/my_trackers/blood_suger/blood_sugar_weekly_page.dart @@ -1,18 +1,16 @@ import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/core/model/my_trakers/blood_sugar/DiabtecPatientResult.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/blood_sugar_view_model.dart'; -import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; -import 'package:diplomaticquarterapp/pages/medical/my_trackers/widget/LineChartCurved.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:diplomaticquarterapp/widgets/charts/app_time_series_chart.dart'; +import 'package:diplomaticquarterapp/widgets/charts/show_chart.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; 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'; import 'AddBloodSugarPage.dart'; @@ -25,18 +23,17 @@ class BloodSugarWeeklyPage extends StatelessWidget { @override Widget build(BuildContext context) { - ProjectViewModel projectViewModel = Provider.of(context); return AppScaffold( - // baseViewModel: bloodSugarViewMode, body: ListView( children: [ Container( margin: EdgeInsets.only(top: 12, left: 8, right: 8), color: Colors.white, - child: LineChartCurved( - title: '${TranslationBase.of(AppGlobal.context).bloodSugar}', + child: ShowChart( + title: TranslationBase.of(context).weight, timeSeries: timeSeriesData.isEmpty ? [TimeSeriesSales2(DateTime.now(), 0.0)] : timeSeriesData, indexes: timeSeriesData.length ~/ 5.5, + horizontalInterval: 2, ), ), SizedBox( @@ -63,7 +60,7 @@ class BloodSugarWeeklyPage extends StatelessWidget { 0: FlexColumnWidth(1.8), 2: FlexColumnWidth(1.8), }, - children: fullData(context, projectViewModel, bloodSugarViewMode), + children: fullData(context, bloodSugarViewMode), ), SizedBox( height: 80, @@ -76,7 +73,7 @@ class BloodSugarWeeklyPage extends StatelessWidget { ); } - List fullData(BuildContext context, ProjectViewModel projectViewModel, BloodSugarViewMode bloodSugarViewMode) { + List fullData(BuildContext context, BloodSugarViewMode bloodSugarViewMode) { List tableRow = []; tableRow.add( TableRow( @@ -94,8 +91,7 @@ class BloodSugarWeeklyPage extends StatelessWidget { tableRow.add( TableRow( children: [ - Utils.tableColumnValue(projectViewModel.isArabic ? DateUtil.getMonthDayYearDateFormattedAr(diabtec.dateChart) : DateUtil.getMonthDayYearDateFormatted(diabtec.dateChart), - isCapitable: false), + Utils.tableColumnValue(DateUtil.getDayMonthYearDateFormatted(diabtec.dateChart), isCapitable: false), Utils.tableColumnValue(diabtec.dateChart.hour.toString() + ':' + diabtec.dateChart.minute.toString(), isCapitable: false), Utils.tableColumnValue(diabtec.measuredDesc, isCapitable: false), Utils.tableColumnValue(diabtec.resultValue.toString(), isCapitable: false), @@ -119,7 +115,7 @@ class BloodSugarWeeklyPage extends StatelessWidget { ), ), ).then((value) { - if(bloodSugarViewMode.weekDiabtecPatientResult.isEmpty) { + if (bloodSugarViewMode.weekDiabtecPatientResult.isEmpty) { timeSeriesData.clear(); } }); diff --git a/lib/pages/medical/reports/reports_page.dart b/lib/pages/medical/reports/reports_page.dart index c7da70cf..3fa6ce39 100644 --- a/lib/pages/medical/reports/reports_page.dart +++ b/lib/pages/medical/reports/reports_page.dart @@ -74,7 +74,7 @@ class MedicalReports extends StatelessWidget { style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64, height: 25 / 16), ), Text( - DateUtil.formatDateToDate(_appointmenHistory.appointmentDate, projectViewModel.isArabic), + DateUtil.getDayMonthYearDateFormatted(_appointmenHistory.appointmentDate), style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48, height: 18 / 12), ), ], diff --git a/lib/uitl/date_uitl.dart b/lib/uitl/date_uitl.dart index 34585002..337d4af0 100644 --- a/lib/uitl/date_uitl.dart +++ b/lib/uitl/date_uitl.dart @@ -419,9 +419,7 @@ class DateUtil { "/" + dateTime.year.toString() + " " + - dateTime.hour.toString() + - ":" + - dateTime.minute.toString(); + DateFormat('HH:mm').format(dateTime); else return ""; } diff --git a/lib/widgets/drawer/app_drawer_widget.dart b/lib/widgets/drawer/app_drawer_widget.dart index 53969cd7..0b96d8fe 100644 --- a/lib/widgets/drawer/app_drawer_widget.dart +++ b/lib/widgets/drawer/app_drawer_widget.dart @@ -360,7 +360,7 @@ class _AppDrawerState extends State { onTap: () { //NotificationsPage // Navigator.of(context).pop(); - if (!projectProvider.user.isFamily) Navigator.push(context, FadePage(page: NotificationsPage())); + if (!projectProvider.isLoginChild) Navigator.push(AppGlobal.context, FadePage(page: NotificationsPage())); }, ), if (projectProvider.havePrivilege(3)) diff --git a/lib/widgets/in_app_browser/InAppBrowser.dart b/lib/widgets/in_app_browser/InAppBrowser.dart index d50420ab..e24fd6f0 100644 --- a/lib/widgets/in_app_browser/InAppBrowser.dart +++ b/lib/widgets/in_app_browser/InAppBrowser.dart @@ -174,7 +174,7 @@ class MyInAppBrowser extends InAppBrowser { applePayInsertRequest.longitude = this.long.toString(); applePayInsertRequest.amount = amount.toString(); applePayInsertRequest.isSchedule = "0"; - applePayInsertRequest.language = getLanguageID() == 'ar' ? 'AR' : 'EN'; + applePayInsertRequest.language = await getLanguageID() == 'ar' ? 'AR' : 'EN'; applePayInsertRequest.userName = authenticatedUser.patientID; applePayInsertRequest.responseContinueURL = "http://hmg.com/Documents/success.html"; applePayInsertRequest.backClickUrl = "http://hmg.com/Documents/success.html"; @@ -219,7 +219,7 @@ class MyInAppBrowser extends InAppBrowser { AuthenticatedUser authUser, bool isLiveCareAppo, var servID, var LiveServID, [var appoDate, var appoNo, var clinicID, var doctorID, var patientData]) async { getDeviceToken(); - String currentLanguageID = getLanguageID() == 'ar' ? 'AR' : 'EN'; + String currentLanguageID = await getLanguageID() == 'ar' ? 'AR' : 'EN'; String form = isLiveCareAppo ? getLiveCareForm() : getForm(); form = form.replaceFirst("EMAIL_VALUE", emailId); diff --git a/lib/widgets/new_design/doctor_header.dart b/lib/widgets/new_design/doctor_header.dart index ed93fe59..d2ff291e 100644 --- a/lib/widgets/new_design/doctor_header.dart +++ b/lib/widgets/new_design/doctor_header.dart @@ -197,6 +197,7 @@ class DoctorHeader extends StatelessWidget { res['DoctorRatingDetailsList'].forEach((v) { doctorDetailsList.add(new DoctorRateDetails.fromJson(v)); }); + this.headerModel.decimalDoctorRate = res['DecimalDoctorRate'].toString(); showRatingDialog(doctorDetailsList, context); } else { AppToast.showErrorToast(message: res['ErrorEndUserMessage']);