diff --git a/DQKey.jks b/DQKey.jks new file mode 100644 index 00000000..7c844584 Binary files /dev/null and b/DQKey.jks differ diff --git a/Keystore Pass.rtf b/Keystore Pass.rtf new file mode 100644 index 00000000..cd33f08e --- /dev/null +++ b/Keystore Pass.rtf @@ -0,0 +1,9 @@ +{\rtf1\ansi\ansicpg1252\cocoartf2513 +\cocoatextscaling0\cocoaplatform0{\fonttbl\f0\fswiss\fcharset0 Helvetica;} +{\colortbl;\red255\green255\blue255;} +{\*\expandedcolortbl;;} +\paperw11900\paperh16840\margl1440\margr1440\vieww10800\viewh8400\viewkind0 +\pard\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\pardirnatural\partightenfactor0 + +\f0\fs24 \cf0 keyPassword=HmGsa123\ +storePassword=HmGsa123} \ No newline at end of file diff --git a/key.properties b/key.properties new file mode 100644 index 00000000..01c8cbe8 --- /dev/null +++ b/key.properties @@ -0,0 +1,4 @@ +storePassword=HmGsa123 +keyPassword=HmGsa123 +keyAlias=DQKey +storeFile=DQKey.jks \ No newline at end of file diff --git a/lib/config/config.dart b/lib/config/config.dart index 2592d1b2..575abf23 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -105,6 +105,12 @@ const GET_CITIES_REQUEST = 'Services/Lists.svc/REST/GetAllCities'; const GET_BLOOD_REQUEST = 'services/PatientVarification.svc/REST/BloodDonation_GetBloodGroupDetails'; +const SAVE_BLOOD_REQUEST = + 'Services/PatientVarification.svc/REST/BloodDonation_RegisterBloodType'; + + +const GET_BLOOD_AGREEMENT = 'Services/PatientVarification.svc/REST/CheckUserAgreementForBloodDonation'; +const SAVE_BLOOD_AGREEMENT = 'Services/PatientVarification.svc/REST/AddUserAgreementForBloodDonation'; ///Reports const REPORTS = 'Services/Doctors.svc/REST/GetPatientMedicalReportStatusInfo'; const INSERT_REQUEST_FOR_MEDICAL_REPORT = diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 7843bff1..482d116d 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -1010,5 +1010,29 @@ const Map localizedValues = { "view-terms": { "en": "To view the terms and conditions", "ar": "عرض الشروط والأحكام" + }, + "InvoiceNo": {"en": " Invoice No", "ar": "رقم الفاتورة"}, + "SpecialResult": {"en": " Special Result", "ar": "نتيجة خاصة"}, + "GeneralResult": {"en": "General Result", "ar": "نتيجة عامة"}, + "show-more-btn": { + "en": "Flow Chart", + "ar": "النتائج التراكمية" + }, + + "value": { + "en": "Value", + "ar": "القيمة" + }, + "range": { + "en": "Range", + "ar": "المدى" + }, + "out-patient": { + "en": "Out Patient", + "ar": "عيادات خارجية" + }, + "in-patient": { + "en": "In Patient", + "ar": "تنويم" } }; diff --git a/lib/core/service/blood/blood_donation_service.dart b/lib/core/service/blood/blood_donation_service.dart index 326407a3..9fc11c04 100644 --- a/lib/core/service/blood/blood_donation_service.dart +++ b/lib/core/service/blood/blood_donation_service.dart @@ -1,4 +1,5 @@ import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/core/model/blooddonation/get_all_cities.dart'; import '../base_service.dart'; @@ -25,4 +26,52 @@ class BloodDonationService extends BaseService { super.error = error; }, body: body); } + Future bloodDonationSave(request) async { + var localRes; + try { + await baseAppClient.post(SAVE_BLOOD_REQUEST, + onSuccess: (dynamic response, int statusCode) { + localRes = response; + }, onFailure: (String error, int statusCode) { + localRes = error; + return Future.value(error); + }, body: request); + return Future.value(localRes); + } catch (error) { + throw error; + } + } + + Future getAgreement() async { + var localRes; + try { + await baseAppClient.post(GET_BLOOD_AGREEMENT, + onSuccess: (dynamic response, int statusCode) { + localRes = response; + }, onFailure: (String error, int statusCode) { + localRes = error; + return Future.value(error); + }, body: {}); + return Future.value(localRes); + } catch (error) { + throw error; + } + } + + + Future saveAgreement(request) async { + var localRes; + try { + await baseAppClient.post(SAVE_BLOOD_AGREEMENT, + onSuccess: (dynamic response, int statusCode) { + localRes = response; + }, onFailure: (String error, int statusCode) { + localRes = error; + return Future.value(error); + }, body: request); + return Future.value(localRes); + } catch (error) { + throw error; + } + } } diff --git a/lib/core/service/client/base_app_client.dart b/lib/core/service/client/base_app_client.dart index 11095fd3..ff7e7776 100644 --- a/lib/core/service/client/base_app_client.dart +++ b/lib/core/service/client/base_app_client.dart @@ -2,6 +2,7 @@ import 'dart:convert'; import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; +import 'package:diplomaticquarterapp/core/service/medical/vital_sign_service.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart'; @@ -23,6 +24,7 @@ AppSharedPreferences sharedPref = new AppSharedPreferences(); /// AuthenticatedUserObject authenticatedUserObject = locator(); +VitalSignService _vitalSignService = locator(); class BaseAppClient { post(String endPoint, @@ -165,6 +167,8 @@ class BaseAppClient { await sharedPref.remove(LOGIN_TOKEN_ID); await authenticatedUserObject.getUser(); Provider.of(AppGlobal.context, listen: false).isLogin = false; + _vitalSignService.weightKg =""; + _vitalSignService.heightCm=""; Navigator.of(AppGlobal.context).pushReplacementNamed(HOME); } diff --git a/lib/core/viewModels/medical/my_balance_view_model.dart b/lib/core/viewModels/medical/my_balance_view_model.dart index 62b7868b..f9e549a4 100644 --- a/lib/core/viewModels/medical/my_balance_view_model.dart +++ b/lib/core/viewModels/medical/my_balance_view_model.dart @@ -163,4 +163,5 @@ class MyBalanceViewModel extends BaseViewModel { setState(ViewState.Idle); } } + } diff --git a/lib/pages/Blood/blood_donation.dart b/lib/pages/Blood/blood_donation.dart index a2e46ff6..1eaa02da 100644 --- a/lib/pages/Blood/blood_donation.dart +++ b/lib/pages/Blood/blood_donation.dart @@ -7,8 +7,10 @@ import 'package:diplomaticquarterapp/core/model/blooddonation/get_all_cities.dar import 'package:diplomaticquarterapp/core/model/my_balance/AdvanceModel.dart'; import 'package:diplomaticquarterapp/core/model/my_balance/patient_info.dart'; import 'package:diplomaticquarterapp/core/service/blood/blood_details_servies.dart'; +import 'package:diplomaticquarterapp/core/service/blood/blood_donation_service.dart'; import 'package:diplomaticquarterapp/core/viewModels/blooddonation/blood_details_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/my_balance_view_model.dart'; +import 'package:diplomaticquarterapp/locator.dart'; import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; import 'package:diplomaticquarterapp/models/FamilyFiles/GetAllSharedRecordByStatusResponse.dart'; import 'package:diplomaticquarterapp/pages/Blood/user_agreement_page.dart'; @@ -18,10 +20,12 @@ import 'package:diplomaticquarterapp/pages/medical/balance/dialogs/SelectCiteisD import 'package:diplomaticquarterapp/pages/medical/balance/dialogs/SelectHospitalDialog.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.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'; import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; @@ -55,8 +59,7 @@ class _BloodDonationPageState extends State { Gender gender = Gender.Male;//Gender.NON; Blood blood = Blood.Aminus;//Blood.NON; //HospitalsModel _selectedHospital; - CitiesModel _selectedHospital; - + var _selectedHospital = new CitiesModel(); String amount = ""; String email; PatientInfo _selectedPatientInfo; @@ -65,12 +68,14 @@ class _BloodDonationPageState extends State { AdvanceModel advanceModel = AdvanceModel(); List_BloodGroupDetailsModel bloodDetails=List_BloodGroupDetailsModel(); AppSharedPreferences sharedPref = AppSharedPreferences(); + BloodDonationService _bloodDonationService = locator(); AuthenticatedUser authUser; var checkedValue = false; @override void initState() { super.initState(); getAuthUser(); + } @override Widget build(BuildContext context) { @@ -134,37 +139,7 @@ class _BloodDonationPageState extends State { ), ), ), - // if (beneficiaryType == BeneficiaryType.MyFamilyFiles) - // SizedBox( - // height: 12, - // ), - // if (beneficiaryType == BeneficiaryType.MyFamilyFiles) - // InkWell( - // onTap: () { - // model.getFamilyFiles().then((value) { - // confirmSelectFamilyDialog(model - // .getAllSharedRecordsByStatusResponse - // .getAllSharedRecordsByStatusList); - // }).showProgressBar( - // text: "Loading", - // backgroundColor: Colors.blue.withOpacity(0.6)); - // }, - // child: Container( - // padding: EdgeInsets.all(12), - // width: double.infinity, - // height: 65, - // decoration: BoxDecoration( - // borderRadius: BorderRadius.circular(12), - // color: Colors.white), - // child: Row( - // mainAxisAlignment: MainAxisAlignment.spaceBetween, - // children: [ - // Texts(getFamilyMembersName()), - // Icon(Icons.arrow_drop_down) - // ], - // ), - // ), - // ), + SizedBox( height: 12, ), @@ -233,7 +208,7 @@ class _BloodDonationPageState extends State { width: 10, ), Text( - 'I agree to the terms and conditions ', + TranslationBase.of(context).iAgreeToTheTermsAndConditions, style: Theme.of(context).textTheme.subtitle1.copyWith(color: checkedValue? Colors.red : Colors.black), ), ], @@ -267,7 +242,7 @@ class _BloodDonationPageState extends State { image: Image.asset( 'assets/images/BloodChrt_EN.png'), buttonCancelText: - Text('cancel'), + Text(TranslationBase.of(context).cancel), buttonCancelColor: Colors.grey, onlyCancelButton: true, @@ -298,10 +273,20 @@ class _BloodDonationPageState extends State { child: SecondaryButton( textColor: Colors.white, color: checkedValue== false ?Colors.white24:Color.fromRGBO(63, 72, 74, 1,), - label: "Save", + label: TranslationBase.of(context).save, // onTap: (){ + Map request = Map(); + request["BloodGroup"] = getBlood();//'O-'; + request['CellNumber'] =authUser.mobileNumber;//m'537503378'; + request['City'] = _selectedHospital.description; //'Riyadh'; + request['CityCode'] =_selectedHospital.iD ; + request['Gender']= gender.index ==0 ? 1 : 2; + request['NationalID'] = authUser.nationalityID; + request['ZipCode'] = authUser.outSA ==1 ? '971' :'966'; + + saveBloodDonation(request); bloodDetails.city=_selectedHospital.toString(); // bloodDetails. @@ -543,11 +528,15 @@ class _BloodDonationPageState extends State { } String getHospitalName() { - if (_selectedHospital != null) + if (_selectedHospital.description !=null) return _selectedHospital.description; else - return - "Riyadh"; + { + _selectedHospital.iD =1; + _selectedHospital.description='Riyadh'; + return _selectedHospital.description; + } + // "Riyadh"; // return List_BloodGroupDetailsModel.fromJson(0).city.toString();//"Select City";//TranslationBase.of(context).selectHospital; } @@ -562,6 +551,7 @@ class _BloodDonationPageState extends State { if (await this.sharedPref.getObject(USER_PROFILE) != null) { var data = AuthenticatedUser.fromJson( await this.sharedPref.getObject(USER_PROFILE)); + getBloodDonationAgreement(); setState(() { authUser = data; }); @@ -577,6 +567,28 @@ class _BloodDonationPageState extends State { //================ + saveBloodDonation(request){ + + GifLoaderDialogUtils.showMyDialog(context); + _bloodDonationService.bloodDonationSave(request).then((result)=> + { + GifLoaderDialogUtils.hideDialog(context), + AppToast.showSuccessToast(message: result['ErrorEndUserMessage']), + saveBloodDonationAgreement() + }); + } + getBloodDonationAgreement(){ + _bloodDonationService.getAgreement().then((result)=> { + checkedValue = result['IsAgreed'] + }); + } + saveBloodDonationAgreement(){ + Map request = Map(); + request['IsAgreed'] = checkedValue; + _bloodDonationService.saveAgreement(request).then((result)=> { + + }); + } } diff --git a/lib/pages/MyAppointments/AppointmentDetails.dart b/lib/pages/MyAppointments/AppointmentDetails.dart index db2b0643..109af9d1 100644 --- a/lib/pages/MyAppointments/AppointmentDetails.dart +++ b/lib/pages/MyAppointments/AppointmentDetails.dart @@ -203,6 +203,7 @@ class _AppointmentDetailsState extends State MaterialPageRoute( builder: (context) => BookConfirm( doctor: getDoctorObject(), + isLiveCareAppointment: widget.appo.isLiveCareAppointment, selectedDate: DocAvailableAppointments.selectedDate, selectedTime: DocAvailableAppointments.selectedTime))); } diff --git a/lib/pages/landing/home_page.dart b/lib/pages/landing/home_page.dart index b2c421fe..6716535b 100644 --- a/lib/pages/landing/home_page.dart +++ b/lib/pages/landing/home_page.dart @@ -42,13 +42,13 @@ class HomePage extends StatefulWidget { class _HomePageState extends State { ToDoCountProviderModel toDoProvider; - // @override - // void initState() { - // WidgetsBinding.instance.addPostFrameCallback((timeStamp) { - // getToDoCount(); - // }); - // super.initState(); - // } + @override + void initState() { + WidgetsBinding.instance.addPostFrameCallback((timeStamp) { + getToDoCount(); + }); + super.initState(); + } AuthenticatedUserObject authenticatedUserObject = locator(); @@ -57,7 +57,7 @@ class _HomePageState extends State { ProjectViewModel projectViewModel = Provider.of(context); toDoProvider = Provider.of(context); return BaseView( - onModelReady: (model) => {},//model.getPatientRadOrders(), + onModelReady: (model) => model.getPatientRadOrders(), builder: (_, model, wi) => AppScaffold( isShowDecPage: false, body: Container( diff --git a/lib/pages/landing/landing_page.dart b/lib/pages/landing/landing_page.dart index 8d522b1d..826c8b76 100644 --- a/lib/pages/landing/landing_page.dart +++ b/lib/pages/landing/landing_page.dart @@ -145,9 +145,9 @@ class _LandingPageState extends State with WidgetsBindingObserver { _firebaseMessaging.requestNotificationPermissions(); } - _firebaseMessaging.getToken().then((String token) { + _firebaseMessaging.getToken().then((String token) async { sharedPref.setString(PUSH_TOKEN, token); - if (token != null && DEVICE_TOKEN == "") { + if (token != null && await sharedPref.getObject(USER_PROFILE) ==null) { DEVICE_TOKEN = token; checkUserStatus(token); } @@ -410,9 +410,7 @@ class _LandingPageState extends State with WidgetsBindingObserver { SETTINGS, ); else - Navigator.of(context).pushNamed( - WELCOME_LOGIN, - ); + login(); }, //do something, ) ], @@ -553,4 +551,15 @@ class _LandingPageState extends State with WidgetsBindingObserver { _changeCurrentTab(2); } } + login() async { + var data = await sharedPref.getObject(IMEI_USER_DATA); + sharedPref.remove(REGISTER_DATA_FOR_LOGIIN); + if (data != null) { + Navigator.of(context).pushNamed(CONFIRM_LOGIN); + } else { + Navigator.of(context).pushNamed( + WELCOME_LOGIN, + ); + } + } } diff --git a/lib/pages/medical/labs/labs_home_page.dart b/lib/pages/medical/labs/labs_home_page.dart index 68dc180e..f459a057 100644 --- a/lib/pages/medical/labs/labs_home_page.dart +++ b/lib/pages/medical/labs/labs_home_page.dart @@ -40,7 +40,7 @@ class LabsHomePage extends StatelessWidget { leading: Radio( value: FilterType.Clinic, groupValue: model.filterType, - activeColor: Colors.red[800], + activeColor: Theme.of(context).primaryColor, onChanged: (FilterType value) { model.setFilterType(value); }, @@ -57,7 +57,7 @@ class LabsHomePage extends StatelessWidget { leading: Radio( value: FilterType.Hospital, groupValue: model.filterType, - activeColor: Colors.red[800], + activeColor: Theme.of(context).primaryColor, onChanged: (FilterType value) => model.setFilterType(value), ), diff --git a/lib/pages/medical/radiology/radiology_home_page.dart b/lib/pages/medical/radiology/radiology_home_page.dart index 995ac485..a7c4fcc5 100644 --- a/lib/pages/medical/radiology/radiology_home_page.dart +++ b/lib/pages/medical/radiology/radiology_home_page.dart @@ -85,6 +85,7 @@ class RadiologyHomePage extends StatelessWidget { ), ), child: DoctorCard( + isInOutPatient: radiology.isInOutPatient, name: radiology.doctorName, profileUrl: radiology.doctorImageURL, subName: '${radiology.projectName} \n${TranslationBase.of(context).billNo} ${radiology.invoiceNo}', diff --git a/lib/services/authentication/auth_provider.dart b/lib/services/authentication/auth_provider.dart index 4dedb37f..4518cc8b 100644 --- a/lib/services/authentication/auth_provider.dart +++ b/lib/services/authentication/auth_provider.dart @@ -464,7 +464,7 @@ class AuthProvider with ChangeNotifier { try { await new BaseAppClient().post(PROFILE_SETTING, onSuccess: (dynamic response, int statusCode) { - localRes = response; //CheckActivationCode.fromJson(); + localRes = response; }, onFailure: (String error, int statusCode) { localRes = error; return Future.value(error); diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index 9b216940..9d3d41fb 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -858,7 +858,14 @@ String get fileno => localizedValues['fileno'][locale.languageCode]; String get bloodDonation => localizedValues['blood-donation'][locale.languageCode]; String get bloodInstruction => localizedValues['blood-instruction'][locale.languageCode]; String get bloodTermsNcondition => localizedValues['view-terms'][locale.languageCode]; - + String get invoiceNo => localizedValues['InvoiceNo'][locale.languageCode]; + String get specialResult => localizedValues['SpecialResult'][locale.languageCode]; + String get generalResult => localizedValues['GeneralResult'][locale.languageCode]; + String get showMoreBtn => localizedValues['show-more-btn'][locale.languageCode]; + String get value => localizedValues['value'][locale.languageCode]; + String get range => localizedValues['range'][locale.languageCode]; + String get outpatient => localizedValues['out-patient'][locale.languageCode]; + String get inPatient => localizedValues['in-patient'][locale.languageCode]; } diff --git a/lib/widgets/data_display/medical/LabResultWidget.dart b/lib/widgets/data_display/medical/LabResultWidget.dart index 225b4076..6ad51c36 100644 --- a/lib/widgets/data_display/medical/LabResultWidget.dart +++ b/lib/widgets/data_display/medical/LabResultWidget.dart @@ -1,5 +1,6 @@ import 'package:diplomaticquarterapp/core/model/labs/lab_result.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; @@ -32,7 +33,7 @@ class LabResultWidget extends StatelessWidget { //TODO model.getPatientLabResult(patientLabOrder: widget.patientLabOrder); }, child: Texts( - 'Flow Chart', + TranslationBase.of(context).showMoreBtn, decoration: TextDecoration.underline, color: Colors.blue, ), @@ -44,13 +45,13 @@ class LabResultWidget extends StatelessWidget { inside: BorderSide( width: 2.0, color: Colors.grey[300]), ), - children: fullData(patientLabResultList), + children: fullData(patientLabResultList,context), ), ], ), ); } - List fullData(List labResultList) { + List fullData(List labResultList,context) { List tableRow = []; tableRow.add( TableRow( @@ -58,7 +59,7 @@ class LabResultWidget extends StatelessWidget { Container( child: Container( decoration: BoxDecoration( - color: Color(0xff515B5D), + color: Theme.of(context).primaryColor, borderRadius: BorderRadius.only( topLeft: projectViewModel.isArabic ? Radius.circular(0.0) @@ -70,7 +71,7 @@ class LabResultWidget extends StatelessWidget { ), child: Center( child: Texts( - 'Description', + TranslationBase.of(context).description, color: Colors.white, ), ), @@ -80,17 +81,17 @@ class LabResultWidget extends StatelessWidget { Container( child: Container( decoration: BoxDecoration( - color: Color(0xff515B5D), + color: Theme.of(context).primaryColor, ), child: Center( - child: Texts('Value', color: Colors.white), + child: Texts(TranslationBase.of(context).value, color: Colors.white), ), height: 60), ), Container( child: Container( decoration: BoxDecoration( - color: Color(0xff515B5D), + color: Theme.of(context).primaryColor, borderRadius: BorderRadius.only( topLeft: projectViewModel.isArabic ? Radius.circular(10.0) @@ -101,7 +102,7 @@ class LabResultWidget extends StatelessWidget { ), ), child: Center( - child: Texts('Range', color: Colors.white), + child: Texts(TranslationBase.of(context).range, color: Colors.white), ), height: 60), ), diff --git a/lib/widgets/data_display/medical/doctor_card.dart b/lib/widgets/data_display/medical/doctor_card.dart index 4fdaa1ab..732a8934 100644 --- a/lib/widgets/data_display/medical/doctor_card.dart +++ b/lib/widgets/data_display/medical/doctor_card.dart @@ -1,3 +1,5 @@ +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/avatar/large_avatar.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/others/StarRating.dart'; @@ -5,6 +7,7 @@ import 'package:diplomaticquarterapp/widgets/others/rounded_container_widget.dar import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart'; +import 'package:provider/provider.dart'; class DoctorCard extends StatelessWidget { final String name; @@ -26,22 +29,22 @@ class DoctorCard extends StatelessWidget { this.billNo, this.onTap, this.onEmailTap, - this.isInOutPatient}); + this.isInOutPatient}); @override Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); return Container( margin: EdgeInsets.all(10), decoration: BoxDecoration( - border: Border.all( - width: 0.5, - color: Theme.of(context).primaryColor, - ), - borderRadius: BorderRadius.all( - Radius.circular(8.0), - ), - color: Colors.white - ), + border: Border.all( + width: 0.5, + color: Theme.of(context).primaryColor, + ), + borderRadius: BorderRadius.all( + Radius.circular(8.0), + ), + color: Colors.white), child: InkWell( onTap: onTap, child: Column( @@ -50,18 +53,34 @@ class DoctorCard extends StatelessWidget { Row( children: [ Container( - width: 20, - height: date == null ? 100 : 130, + width:projectViewModel.isArabic? 27:20, + height: date == null ? projectViewModel.isArabic? 170 :100 : 150, decoration: BoxDecoration( - color: !isInOutPatient? Colors.red[900]: Theme.of(context).primaryColor, - borderRadius: BorderRadius.only( - topLeft: Radius.circular(8), - bottomLeft: Radius.circular(8))), + color: !isInOutPatient + ? Colors.red[900] + : Theme.of(context).primaryColor, + borderRadius: BorderRadius.only( + topLeft: projectViewModel.isArabic + ? Radius.circular(0) + : Radius.circular(8), + bottomLeft: projectViewModel.isArabic + ? Radius.circular(0) + : Radius.circular(8), + topRight: projectViewModel.isArabic? Radius.circular(8):Radius.circular(0), + bottomRight: projectViewModel.isArabic? Radius.circular(8):Radius.circular(0), + ), + ), child: RotatedBox( quarterTurns: 3, child: Center( child: Text( - !isInOutPatient? 'In Patient'.toUpperCase():'OutPatient'.toUpperCase(), + !isInOutPatient + ? TranslationBase.of(context) + .inPatient + .toUpperCase() + : TranslationBase.of(context) + .outpatient + .toUpperCase(), style: TextStyle(color: Colors.white), ), )), @@ -116,14 +135,14 @@ class DoctorCard extends StatelessWidget { ), ), ), - if(onEmailTap!=null) - InkWell( - onTap: onEmailTap, - child: Icon( - Icons.email, - color: Colors.red, - ), - ) + if (onEmailTap != null) + InkWell( + onTap: onEmailTap, + child: Icon( + Icons.email, + color: Colors.red, + ), + ) ], ), ), diff --git a/lib/widgets/data_display/medical/laboratory_result_widget.dart b/lib/widgets/data_display/medical/laboratory_result_widget.dart index f763def1..d16019b6 100644 --- a/lib/widgets/data_display/medical/laboratory_result_widget.dart +++ b/lib/widgets/data_display/medical/laboratory_result_widget.dart @@ -3,6 +3,8 @@ import 'package:diplomaticquarterapp/core/model/labs/patient_lab_orders.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/labs_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/network_base_view.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; @@ -41,139 +43,139 @@ class _LaboratoryResultWidgetState extends State { @override Widget build(BuildContext context) { projectViewModel = Provider.of(context); - return Container( - margin: EdgeInsets.all(15), - child: Column( - children: [ - Column( - crossAxisAlignment: CrossAxisAlignment.start, + return BaseView( + onModelReady: (model) => + model.getPatientLabResult(patientLabOrder: widget.patientLabOrder), + builder: (_, model, w) => NetworkBaseView( + baseViewModel: model, + child: Container( + margin: EdgeInsets.all(15), + child: Column( children: [ - Container( - margin: EdgeInsets.all(15), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Expanded( - child: Container( - decoration: BoxDecoration( - shape: BoxShape.rectangle, - color: Colors.white, - borderRadius: BorderRadius.all( - Radius.circular(5.0), - )), - padding: EdgeInsets.all(10.0), - margin: EdgeInsets.only(left: 5, right: 5), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Texts('Invoice No'), - Texts(widget.billNo), - ], - ), - ), - ), - InkWell( - onTap: widget.onTap, - child: Container( - margin: EdgeInsets.only(left: 5, right: 5), - decoration: BoxDecoration( - shape: BoxShape.rectangle, - color: Colors.red[800], - borderRadius: BorderRadius.all( - Radius.circular(5.0), - )), - child: Container( - padding: EdgeInsets.all(10.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Icon( - Icons.email, - color: Colors.white, - ), - Texts( - 'Send a copy', + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + margin: EdgeInsets.all(15), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Expanded( + child: Container( + decoration: BoxDecoration( + shape: BoxShape.rectangle, color: Colors.white, - ) - ], + borderRadius: BorderRadius.all( + Radius.circular(5.0), + )), + padding: EdgeInsets.all(10.0), + margin: EdgeInsets.only(left: 5, right: 5), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts(TranslationBase.of(context).invoiceNo), + Texts(widget.billNo), + ], + ), ), ), + InkWell( + onTap: widget.onTap, + child: Container( + margin: EdgeInsets.only(left: 5, right: 5), + decoration: BoxDecoration( + shape: BoxShape.rectangle, + color: Theme.of(context).primaryColor, + borderRadius: BorderRadius.all( + Radius.circular(5.0), + )), + child: Container( + padding: EdgeInsets.all(10.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Icon( + Icons.email, + color: Colors.white, + ), + Texts( + TranslationBase.of(context).sendCopy, + color: Colors.white, + ) + ], + ), + ), + ), + ) + ], + ), + ), + SizedBox( + height: 10, + ), + InkWell( + onTap: () { + setState(() { + _isShowMore = !_isShowMore; + }); + }, + child: Container( + padding: EdgeInsets.all(10.0), + margin: EdgeInsets.only(left: 5, right: 5), + decoration: BoxDecoration( + shape: BoxShape.rectangle, + color: Colors.white, + borderRadius: BorderRadius.all( + Radius.circular(5.0), + )), + child: Row( + children: [ + Expanded(child: Texts(TranslationBase.of(context).specialResult)), + Container( + width: 25, + height: 25, + decoration: BoxDecoration( + shape: BoxShape.circle, color: Theme.of(context).primaryColor), + child: Icon( + _isShowMore + ? Icons.keyboard_arrow_up + : Icons.keyboard_arrow_down, + color: Colors.white, + size: 22, + ), + ) + ], ), - ) - ], - ), - ), - SizedBox( - height: 10, - ), - InkWell( - onTap: () { - setState(() { - _isShowMore = !_isShowMore; - }); - }, - child: Container( - padding: EdgeInsets.all(10.0), - margin: EdgeInsets.only(left: 5, right: 5), - decoration: BoxDecoration( - shape: BoxShape.rectangle, - color: Colors.white, - borderRadius: BorderRadius.all( - Radius.circular(5.0), - )), - child: Row( - children: [ - Expanded(child: Texts('Special Result')), - Container( - width: 25, - height: 25, - decoration: BoxDecoration( - shape: BoxShape.circle, color: Colors.red[900]), - child: Icon( - _isShowMore - ? Icons.keyboard_arrow_up - : Icons.keyboard_arrow_down, + ), + ), + if (_isShowMore) + AnimatedContainer( + padding: EdgeInsets.all(10.0), + margin: EdgeInsets.only(left: 5, right: 5), + decoration: BoxDecoration( + shape: BoxShape.rectangle, color: Colors.white, - size: 22, - ), - ) - ], + borderRadius: BorderRadius.only( + bottomLeft: Radius.circular(5.0), + bottomRight: Radius.circular(5.0), + )), + duration: Duration(milliseconds: 7000), + child: Container( + width: double.infinity, + child: Html( + data: widget.details ?? 'No Data', + )), + ), + SizedBox( + height: 12, ), - ), - ), - if (_isShowMore) - AnimatedContainer( - padding: EdgeInsets.all(10.0), - margin: EdgeInsets.only(left: 5, right: 5), - decoration: BoxDecoration( - shape: BoxShape.rectangle, - color: Colors.white, - borderRadius: BorderRadius.only( - bottomLeft: Radius.circular(5.0), - bottomRight: Radius.circular(5.0), - )), - duration: Duration(milliseconds: 7000), - child: Container( - width: double.infinity, - child: Html( - data: widget.details ?? 'No Data', - )), - ), - SizedBox( - height: 12, - ), - BaseView( - onModelReady: (model) => model.getPatientLabResult( - patientLabOrder: widget.patientLabOrder), - builder: (_, model, w) => NetworkBaseView( - baseViewModel: model, - child: Container( + Container( child: Column( children: [ InkWell( onTap: () { setState( - () { + () { _isShowMoreGeneral = !_isShowMoreGeneral; }, ); @@ -189,13 +191,13 @@ class _LaboratoryResultWidgetState extends State { )), child: Row( children: [ - Expanded(child: Texts('General Result')), + Expanded(child: Texts(TranslationBase.of(context).generalResult)), Container( width: 25, height: 25, decoration: BoxDecoration( shape: BoxShape.circle, - color: Colors.red[900]), + color: Theme.of(context).primaryColor), child: Icon( _isShowMoreGeneral ? Icons.keyboard_arrow_up @@ -224,11 +226,12 @@ class _LaboratoryResultWidgetState extends State { child: Container( width: double.infinity, child: Column( - crossAxisAlignment: CrossAxisAlignment.start, + crossAxisAlignment: + CrossAxisAlignment.start, children: [ ...List.generate( model.labResultLists.length, - (index) => LabResultWidget( + (index) => LabResultWidget( filterName: model .labResultLists[index].filterName, patientLabResultList: model @@ -242,15 +245,13 @@ class _LaboratoryResultWidgetState extends State { ), ], ), - ), - ), - ) + ) + ], + ), ], ), - ], + ), ), ); } - - } diff --git a/lib/widgets/drawer/app_drawer_widget.dart b/lib/widgets/drawer/app_drawer_widget.dart index f29ea4c6..f9658c02 100644 --- a/lib/widgets/drawer/app_drawer_widget.dart +++ b/lib/widgets/drawer/app_drawer_widget.dart @@ -1,6 +1,7 @@ import 'dart:io'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/core/service/AuthenticatedUserObject.dart'; +import 'package:diplomaticquarterapp/core/service/medical/vital_sign_service.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; import 'package:diplomaticquarterapp/models/Authentication/check_activation_code_response.dart'; @@ -39,8 +40,9 @@ class _AppDrawerState extends State { var familyFileProvider = FamilyFilesProvider(); AuthenticatedUser user; AuthenticatedUser mainUser; - AuthenticatedUserObject authenticatedUserObject = - locator(); + AuthenticatedUserObject authenticatedUserObject = locator(); + VitalSignService _vitalSignService = locator(); + @override Widget build(BuildContext context) { @@ -408,6 +410,8 @@ class _AppDrawerState extends State { authenticatedUserObject.logout(); projectProvider.isLogin = false; await authenticatedUserObject.getUser(); + _vitalSignService.heightCm =""; + _vitalSignService.weightKg =""; await sharedPref.clear(); this.user = null; Navigator.of(context).pushNamed(HOME);