From ba5f29ee9f651ad7c22c064d89b21c222081d906 Mon Sep 17 00:00:00 2001 From: Sultan khan <> Date: Wed, 4 Jan 2023 09:52:54 +0300 Subject: [PATCH 01/28] updated code for v.3.3 --- ios/Runner.xcodeproj/project.pbxproj | 125 ++- ios/Runner/Info.plist | 2 + lib/config/config.dart | 405 +++------ lib/core/service/AnalyticsService.dart | 13 +- .../viewModel/authentication_view_model.dart | 212 ++--- lib/core/viewModel/base_view_model.dart | 3 +- lib/screens/ER_singin/ER_singin_screen.dart | 204 +++-- lib/screens/live_care/video_call.dart | 112 +-- .../line_chart_for_diabetic.dart | 17 +- .../line_chart_curved_lab_history.dart | 14 +- .../notes/note/progress_note_screen.dart | 796 +++++++----------- .../profile/vital_sign/line_chart_curved.dart | 59 +- .../line_chart_curved_blood_pressure.dart | 45 +- .../reschedule_leaves/reschedule_leave.dart | 475 +++-------- lib/widgets/shared/app_texts_widget.dart | 68 +- .../shared/dialogs/dailog-list-select.dart | 19 +- .../shared/dialogs/master_key_dailog.dart | 34 +- .../dialogs/search-drugs-dailog-list.dart | 18 +- .../shared/text_fields/TextFields.dart | 100 +-- pubspec.lock | 375 +++++---- pubspec.yaml | 28 +- speech_to_text/example/lib/main.dart | 19 +- speech_to_text/example/pubspec.lock | 40 +- speech_to_text/pubspec.lock | 38 +- 24 files changed, 1240 insertions(+), 1981 deletions(-) diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index 3c58fe30..af797b24 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -14,8 +14,8 @@ 30F70E6C266F56FD005D8F8E /* MainAppViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 30F70E6B266F56FD005D8F8E /* MainAppViewController.swift */; }; 30F70E6F266F6509005D8F8E /* VideoCallRequestParameters.swift in Sources */ = {isa = PBXBuildFile; fileRef = 30F70E6E266F6509005D8F8E /* VideoCallRequestParameters.swift */; }; 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; - 3D7F2AC9B3EBF568D59B943B /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 104DCFE405BA413255D4BDD9 /* Pods_Runner.framework */; }; 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; + 7645621A848A5D0B29B97C46 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E4E9718EA62661304F55A32D /* Pods_Runner.framework */; }; 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; @@ -37,13 +37,10 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ - 0762701A9540BA69842BCA9C /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; }; - 104DCFE405BA413255D4BDD9 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; 29211CD725C165D600DD740D /* RunnerRelease.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = RunnerRelease.entitlements; sourceTree = ""; }; 29211E4125C172B700DD740D /* GoogleService-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "GoogleService-Info.plist"; sourceTree = ""; }; - 2ADF20AFB51DAEC9BED1884D /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; }; 300790F9266FB14B0052174C /* VCEmbeder.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VCEmbeder.swift; sourceTree = ""; }; 300790FB26710CAB0052174C /* Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Extensions.swift; sourceTree = ""; }; 30F70E6B266F56FD005D8F8E /* MainAppViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MainAppViewController.swift; sourceTree = ""; }; @@ -61,7 +58,10 @@ 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 9CE61EBC24AB366E008D68DD /* VideoCallViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VideoCallViewController.swift; sourceTree = ""; }; 9CE61ECC24ADBB4C008D68DD /* ICallProtocoll.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ICallProtocoll.swift; sourceTree = ""; }; - E5CA53445955DBB6BB6D164C /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; }; + C55D4AE245B71956447BA22F /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; }; + C8801C5E6B82B6CB497CA5C7 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; }; + E333B59AA5538E0304102FD2 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; }; + E4E9718EA62661304F55A32D /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -69,7 +69,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 3D7F2AC9B3EBF568D59B943B /* Pods_Runner.framework in Frameworks */, + 7645621A848A5D0B29B97C46 /* Pods_Runner.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -104,9 +104,9 @@ 7D66D387293CE5376A07EC5F /* Pods */ = { isa = PBXGroup; children = ( - 2ADF20AFB51DAEC9BED1884D /* Pods-Runner.debug.xcconfig */, - E5CA53445955DBB6BB6D164C /* Pods-Runner.release.xcconfig */, - 0762701A9540BA69842BCA9C /* Pods-Runner.profile.xcconfig */, + C55D4AE245B71956447BA22F /* Pods-Runner.debug.xcconfig */, + C8801C5E6B82B6CB497CA5C7 /* Pods-Runner.release.xcconfig */, + E333B59AA5538E0304102FD2 /* Pods-Runner.profile.xcconfig */, ); path = Pods; sourceTree = ""; @@ -129,7 +129,7 @@ 97C146F01CF9000F007C117D /* Runner */, 97C146EF1CF9000F007C117D /* Products */, 7D66D387293CE5376A07EC5F /* Pods */, - C1938275850F66EAA5D7AC0F /* Frameworks */, + A9562A4C43D78E443FA8BFD1 /* Frameworks */, ); sourceTree = ""; }; @@ -171,10 +171,10 @@ name = "Supporting Files"; sourceTree = ""; }; - C1938275850F66EAA5D7AC0F /* Frameworks */ = { + A9562A4C43D78E443FA8BFD1 /* Frameworks */ = { isa = PBXGroup; children = ( - 104DCFE405BA413255D4BDD9 /* Pods_Runner.framework */, + E4E9718EA62661304F55A32D /* Pods_Runner.framework */, ); name = Frameworks; sourceTree = ""; @@ -186,14 +186,14 @@ isa = PBXNativeTarget; buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; buildPhases = ( - C79BE4619064E868C0DFBD12 /* [CP] Check Pods Manifest.lock */, + 4CBD0CB2C106C3E696B88FDB /* [CP] Check Pods Manifest.lock */, 9740EEB61CF901F6004384FC /* Run Script */, 97C146EA1CF9000F007C117D /* Sources */, 97C146EB1CF9000F007C117D /* Frameworks */, 97C146EC1CF9000F007C117D /* Resources */, 9705A1C41CF9048500538489 /* Embed Frameworks */, 3B06AD1E1E4923F5004D2608 /* Thin Binary */, - 3DBDEDAE0EB70F8613EE7963 /* [CP] Embed Pods Frameworks */, + C21500C474806845DCE7C12A /* [CP] Embed Pods Frameworks */, ); buildRules = ( ); @@ -215,6 +215,7 @@ TargetAttributes = { 97C146ED1CF9000F007C117D = { CreatedOnToolsVersion = 7.3.1; + DevelopmentTeam = 3A359E86ZF; LastSwiftMigration = 1100; }; }; @@ -267,7 +268,43 @@ shellPath = /bin/sh; shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin"; }; - 3DBDEDAE0EB70F8613EE7963 /* [CP] Embed Pods Frameworks */ = { + 4CBD0CB2C106C3E696B88FDB /* [CP] Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", + ); + name = "[CP] Check Pods Manifest.lock"; + outputFileListPaths = ( + ); + outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; + showEnvVarsInLog = 0; + }; + 9740EEB61CF901F6004384FC /* Run Script */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Run Script"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; + }; + C21500C474806845DCE7C12A /* [CP] Embed Pods Frameworks */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( @@ -280,7 +317,7 @@ "${BUILT_PRODUCTS_DIR}/DKPhotoGallery/DKPhotoGallery.framework", "${BUILT_PRODUCTS_DIR}/FMDB/FMDB.framework", "${BUILT_PRODUCTS_DIR}/FirebaseCore/FirebaseCore.framework", - "${BUILT_PRODUCTS_DIR}/FirebaseCoreDiagnostics/FirebaseCoreDiagnostics.framework", + "${BUILT_PRODUCTS_DIR}/FirebaseCoreInternal/FirebaseCoreInternal.framework", "${BUILT_PRODUCTS_DIR}/FirebaseInstallations/FirebaseInstallations.framework", "${BUILT_PRODUCTS_DIR}/FirebaseMessaging/FirebaseMessaging.framework", "${BUILT_PRODUCTS_DIR}/GoogleDataTransport/GoogleDataTransport.framework", @@ -301,8 +338,7 @@ "${BUILT_PRODUCTS_DIR}/flutter_inappwebview/flutter_inappwebview.framework", "${BUILT_PRODUCTS_DIR}/flutter_keyboard_visibility/flutter_keyboard_visibility.framework", "${BUILT_PRODUCTS_DIR}/fluttertoast/fluttertoast.framework", - "${BUILT_PRODUCTS_DIR}/hexcolor/hexcolor.framework", - "${BUILT_PRODUCTS_DIR}/local_auth/local_auth.framework", + "${BUILT_PRODUCTS_DIR}/local_auth_ios/local_auth_ios.framework", "${BUILT_PRODUCTS_DIR}/maps_launcher/maps_launcher.framework", "${BUILT_PRODUCTS_DIR}/nanopb/nanopb.framework", "${BUILT_PRODUCTS_DIR}/path_provider_ios/path_provider_ios.framework", @@ -322,7 +358,7 @@ "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/DKPhotoGallery.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FMDB.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FirebaseCore.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FirebaseCoreDiagnostics.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FirebaseCoreInternal.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FirebaseInstallations.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FirebaseMessaging.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/GoogleDataTransport.framework", @@ -343,8 +379,7 @@ "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/flutter_inappwebview.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/flutter_keyboard_visibility.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/fluttertoast.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/hexcolor.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/local_auth.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/local_auth_ios.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/maps_launcher.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/nanopb.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/path_provider_ios.framework", @@ -361,42 +396,6 @@ shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; showEnvVarsInLog = 0; }; - 9740EEB61CF901F6004384FC /* Run Script */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "Run Script"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; - }; - C79BE4619064E868C0DFBD12 /* [CP] Check Pods Manifest.lock */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - ); - inputPaths = ( - "${PODS_PODFILE_DIR_PATH}/Podfile.lock", - "${PODS_ROOT}/Manifest.lock", - ); - name = "[CP] Check Pods Manifest.lock"; - outputFileListPaths = ( - ); - outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; - showEnvVarsInLog = 0; - }; /* End PBXShellScriptBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ @@ -489,12 +488,12 @@ }; 249021D4217E4FDB00AE95B9 /* Profile */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; + baseConfigurationReference = E333B59AA5538E0304102FD2 /* Pods-Runner.profile.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CURRENT_PROJECT_VERSION = 4; - DEVELOPMENT_TEAM = ""; + DEVELOPMENT_TEAM = 3A359E86ZF; ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", @@ -627,12 +626,12 @@ }; 97C147061CF9000F007C117D /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; + baseConfigurationReference = C55D4AE245B71956447BA22F /* Pods-Runner.debug.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CURRENT_PROJECT_VERSION = 4; - DEVELOPMENT_TEAM = ""; + DEVELOPMENT_TEAM = 3A359E86ZF; ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", @@ -660,13 +659,13 @@ }; 97C147071CF9000F007C117D /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; + baseConfigurationReference = C8801C5E6B82B6CB497CA5C7 /* Pods-Runner.release.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = Runner/RunnerRelease.entitlements; CURRENT_PROJECT_VERSION = 4; - DEVELOPMENT_TEAM = ""; + DEVELOPMENT_TEAM = 3A359E86ZF; ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", diff --git a/ios/Runner/Info.plist b/ios/Runner/Info.plist index 2314a2c8..31c95209 100644 --- a/ios/Runner/Info.plist +++ b/ios/Runner/Info.plist @@ -65,5 +65,7 @@ UIViewControllerBasedStatusBarAppearance + CADisableMinimumFrameDurationOnPhone + diff --git a/lib/config/config.dart b/lib/config/config.dart index 2195aff2..4a246275 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -5,119 +5,85 @@ const ONLY_NUMBERS = "[0-9]"; const ONLY_LETTERS = "[a-zA-Z &'\"]"; const ONLY_DATE = "[0-9/]"; const BASE_URL_LIVE_CARE = 'https://livecare.hmg.com/'; -// const BASE_URL = 'https://hmgwebservices.com/'; +//const BASE_URL = 'https://hmgwebservices.com/'; const BASE_URL = 'https://uat.hmgwebservices.com/'; const PHARMACY_ITEMS_URL = "Services/Lists.svc/REST/GetPharmcyItems_Region_enh"; const PHARMACY_LIST_URL = "Services/Patients.svc/REST/GetPharmcyList"; -const PATIENT_PROGRESS_NOTE_URL = - "Services/DoctorApplication.svc/REST/GetProgressNoteForInPatient"; -const PATIENT_INSURANCE_APPROVALS_URL = - "Services/DoctorApplication.svc/REST/GetApprovalStatusForInpatient"; -const PATIENT_REFER_TO_DOCTOR_URL = - "Services/DoctorApplication.svc/REST/ReferToDoctor"; -const PATIENT_GET_DOCTOR_BY_CLINIC_URL = - "Services/DoctorApplication.svc/REST/GetDoctorsByClinicID"; - -const PATIENT_GET_DOCTOR_BY_CLINIC_Hospital = - "Services/Doctors.svc/REST/SearchDoctorsByTime"; - -const GET_CLINICS_FOR_DOCTOR = - 'Services/DoctorApplication.svc/REST/GetClinicsForDoctor'; -const PATIENT_GET_LIST_REFERAL_URL = - "Services/Lists.svc/REST/GetList_STPReferralFrequency"; -const PATIENT_GET_CLINIC_BY_PROJECT_URL = - "Services/DoctorApplication.svc/REST/GetClinicsByProjectID"; +const PATIENT_PROGRESS_NOTE_URL = "Services/DoctorApplication.svc/REST/GetProgressNoteForInPatient"; +const PATIENT_INSURANCE_APPROVALS_URL = "Services/DoctorApplication.svc/REST/GetApprovalStatusForInpatient"; +const PATIENT_REFER_TO_DOCTOR_URL = "Services/DoctorApplication.svc/REST/ReferToDoctor"; +const PATIENT_GET_DOCTOR_BY_CLINIC_URL = "Services/DoctorApplication.svc/REST/GetDoctorsByClinicID"; + +const PATIENT_GET_DOCTOR_BY_CLINIC_Hospital = "Services/Doctors.svc/REST/SearchDoctorsByTime"; + +const GET_CLINICS_FOR_DOCTOR = 'Services/DoctorApplication.svc/REST/GetClinicsForDoctor'; +const PATIENT_GET_LIST_REFERAL_URL = "Services/Lists.svc/REST/GetList_STPReferralFrequency"; +const PATIENT_GET_CLINIC_BY_PROJECT_URL = "Services/DoctorApplication.svc/REST/GetClinicsByProjectID"; const PROJECT_GET_INFO = "Services/DoctorApplication.svc/REST/GetProjectInfo"; const GET_CLINICS = "Services/DoctorApplication.svc/REST/GetClinics"; -const GET_REFERRAL_FACILITIES = - 'Services/DoctorApplication.svc/REST/GetReferralFacilities'; +const GET_REFERRAL_FACILITIES = 'Services/DoctorApplication.svc/REST/GetReferralFacilities'; const GET_PROJECTS = 'Services/DoctorApplication.svc/REST/GetProjectInfo'; -const GET_PATIENT_VITAL_SIGN = - 'Services/Doctors.svc/REST/Doctor_GetPatientVitalSign'; -const GET_PATIENT_VITAL_SIGN_DATA = - 'Services/DoctorApplication.svc/REST/GetVitalSigns'; -const GET_PATIENT_LAB_OREDERS = - 'Services/DoctorApplication.svc/REST/GetPatientLabOreders'; +const GET_PATIENT_VITAL_SIGN = 'Services/Doctors.svc/REST/Doctor_GetPatientVitalSign'; +const GET_PATIENT_VITAL_SIGN_DATA = 'Services/DoctorApplication.svc/REST/GetVitalSigns'; +const GET_PATIENT_LAB_OREDERS = 'Services/DoctorApplication.svc/REST/GetPatientLabOreders'; const GET_PRESCRIPTION = 'Services/Patients.svc/REST/GetPrescriptionApptList'; -const GET_LIVECARE_PENDINGLIST = - 'Services/DoctorApplication.svc/REST/GetPendingPatientER'; +const GET_LIVECARE_PENDINGLIST = 'Services/DoctorApplication.svc/REST/GetPendingPatientER'; const START_LIVE_CARE_CALL = 'LiveCareApi/DoctorApp/CallPatient'; -const LIVE_CARE_STATISTICS_FOR_CERTAIN_DOCTOR_URL = - "Lists.svc/REST/DashBoard_GetLiveCareDoctorsStatsticsForCertainDoctor"; +const LIVE_CARE_STATISTICS_FOR_CERTAIN_DOCTOR_URL = "Lists.svc/REST/DashBoard_GetLiveCareDoctorsStatsticsForCertainDoctor"; -const GET_PRESCRIPTION_REPORT = - 'Services/Patients.svc/REST/GetPrescriptionReport'; +const GET_PRESCRIPTION_REPORT = 'Services/Patients.svc/REST/GetPrescriptionReport'; -const GT_MY_PATIENT_QUESTION = - 'Services/DoctorApplication.svc/REST/GtMyPatientsQuestions'; +const GT_MY_PATIENT_QUESTION = 'Services/DoctorApplication.svc/REST/GtMyPatientsQuestions'; -const PRM_SEARCH_PATIENT = - 'Services/Patients.svc/REST/GetPatientInformation_PRM'; +const PRM_SEARCH_PATIENT = 'Services/Patients.svc/REST/GetPatientInformation_PRM'; const GET_PATIENT = 'Services/DoctorApplication.svc/REST/'; -const GET_PRESCRIPTION_REPORT_FOR_IN_PATIENT = - 'Services/DoctorApplication.svc/REST/GetPrescriptionReportForInPatient'; +const GET_PRESCRIPTION_REPORT_FOR_IN_PATIENT = 'Services/DoctorApplication.svc/REST/GetPrescriptionReportForInPatient'; -const GET_MY_REFERRAL_PATIENT = - 'Services/DoctorApplication.svc/REST/GtMyReferralPatient'; +const GET_MY_REFERRAL_PATIENT = 'Services/DoctorApplication.svc/REST/GtMyReferralPatient'; const REFER_TO_DOCTOR = 'Services/DoctorApplication.svc/REST/ReferToDoctor'; -const ADD_REFERRED_DOCTOR_REMARKS = - 'Services/DoctorApplication.svc/REST/AddReferredDoctorRemarks'; +const ADD_REFERRED_DOCTOR_REMARKS = 'Services/DoctorApplication.svc/REST/AddReferredDoctorRemarks'; -const GET_MY_REFERRED_PATIENT = - 'Services/DoctorApplication.svc/REST/GtMyReferredPatient'; +const GET_MY_REFERRED_PATIENT = 'Services/DoctorApplication.svc/REST/GtMyReferredPatient'; -const GET_MY_REFERRED_OUT_PATIENT = - 'Services/DoctorApplication.svc/REST/GtMyReferredOutPatient'; +const GET_MY_REFERRED_OUT_PATIENT = 'Services/DoctorApplication.svc/REST/GtMyReferredOutPatient'; -const GET_PENDING_REFERRAL_PATIENT = - 'Services/DoctorApplication.svc/REST/PendingReferrals'; +const GET_PENDING_REFERRAL_PATIENT = 'Services/DoctorApplication.svc/REST/PendingReferrals'; -const CREATE_REFERRAL_PATIENT = - 'Services/DoctorApplication.svc/REST/CreateReferral'; +const CREATE_REFERRAL_PATIENT = 'Services/DoctorApplication.svc/REST/CreateReferral'; -const RESPONSE_PENDING_REFERRAL_PATIENT = - 'Services/DoctorApplication.svc/REST/RespondReferral'; +const RESPONSE_PENDING_REFERRAL_PATIENT = 'Services/DoctorApplication.svc/REST/RespondReferral'; const GET_PATIENT_REFERRAL = 'Services/DoctorApplication.svc/REST/GetRefferal'; const POST_UCAF = 'Services/DoctorApplication.svc/REST/PostUCAF'; -const GET_DOCTOR_WORKING_HOURS_TABLE = - 'Services/Doctors.svc/REST/GetDoctorWorkingHoursTable'; +const GET_DOCTOR_WORKING_HOURS_TABLE = 'Services/Doctors.svc/REST/GetDoctorWorkingHoursTable'; -const GET_PATIENT_LAB_RESULTS = - 'Services/DoctorApplication.svc/REST/GetPatientLabResults'; +const GET_PATIENT_LAB_RESULTS = 'Services/DoctorApplication.svc/REST/GetPatientLabResults'; const LOGIN_URL = 'Services/Sentry.svc/REST/MemberLogIN_New'; -const INSERT_DEVICE_IMEI = - 'Services/DoctorApplication.svc/REST/DoctorApp_InsertOrUpdateDeviceDetails'; +const INSERT_DEVICE_IMEI = 'Services/DoctorApplication.svc/REST/DoctorApp_InsertOrUpdateDeviceDetails'; // 'Services/Sentry.svc/REST/DoctorApplication_INSERTDeviceIMEI'; // const SELECT_DEVICE_IMEI = // 'Services/Sentry.svc/REST/DoctorApplication_SELECTDeviceIMEIbyIMEI'; -const SELECT_DEVICE_IMEI = - 'Services/DoctorApplication.svc/REST/DoctorApp_GetDeviceDetailsByIMEI'; +const SELECT_DEVICE_IMEI = 'Services/DoctorApplication.svc/REST/DoctorApp_GetDeviceDetailsByIMEI'; -const SEND_ACTIVATION_CODE_BY_OTP_NOTIFICATION_TYPE = - 'Services/Sentry.svc/REST/DoctorApplication_SendActivationCodebyOTPNotificationType'; +const SEND_ACTIVATION_CODE_BY_OTP_NOTIFICATION_TYPE = 'Services/Sentry.svc/REST/DoctorApplication_SendActivationCodebyOTPNotificationType'; -const SEND_ACTIVATION_CODE_FOR_DOCTOR_APP = - 'Services/DoctorApplication.svc/REST/SendActivationCodeForDoctorApp'; +const SEND_ACTIVATION_CODE_FOR_DOCTOR_APP = 'Services/DoctorApplication.svc/REST/SendActivationCodeForDoctorApp'; -const SEND_ACTIVATION_CODE_FOR_VERIFICATION_SCREEN = - 'Services/DoctorApplication.svc/REST/SendVerificationCode'; -const MEMBER_CHECK_ACTIVATION_CODE_NEW = - 'Services/Sentry.svc/REST/MemberCheckActivationCode_New'; +const SEND_ACTIVATION_CODE_FOR_VERIFICATION_SCREEN = 'Services/DoctorApplication.svc/REST/SendVerificationCode'; +const MEMBER_CHECK_ACTIVATION_CODE_NEW = 'Services/Sentry.svc/REST/MemberCheckActivationCode_New'; -const CHECK_ACTIVATION_CODE_FOR_DOCTOR_APP = - 'Services/DoctorApplication.svc/REST/CheckActivationCodeForDoctorApp'; +const CHECK_ACTIVATION_CODE_FOR_DOCTOR_APP = 'Services/DoctorApplication.svc/REST/CheckActivationCodeForDoctorApp'; const GET_DOC_PROFILES = 'Services/Doctors.svc/REST/GetDocProfiles'; const TRANSFERT_TO_ADMIN = 'LiveCareApi/DoctorApp/TransferToAdmin'; @@ -125,268 +91,179 @@ const SEND_SMS_INSTRUCTIONS = 'LiveCareApi/DoctorApp/SendSMSInstruction'; const GET_ALTERNATIVE_SERVICE = 'LiveCareApi/DoctorApp/GetAlternativeServices'; const END_CALL = 'LiveCareApi/DoctorApp/EndCall'; const END_CALL_WITH_CHARGE = 'LiveCareApi/DoctorApp/CompleteCallWithCharge'; -const GET_DASHBOARD = - 'Services/DoctorApplication.svc/REST/GetDoctorDashboardKPI'; -const GET_SICKLEAVE_STATISTIC = - 'Services/DoctorApplication.svc/REST/PreSickLeaveStatistics'; -const ARRIVED_PATIENT_URL = - 'Services/DoctorApplication.svc/REST/PatientArrivalList'; +const GET_DASHBOARD = 'Services/DoctorApplication.svc/REST/GetDoctorDashboardKPI'; +const GET_SICKLEAVE_STATISTIC = 'Services/DoctorApplication.svc/REST/PreSickLeaveStatistics'; +const ARRIVED_PATIENT_URL = 'Services/DoctorApplication.svc/REST/PatientArrivalList'; const ADD_SICK_LEAVE = 'Services/DoctorApplication.svc/REST/PostSickLeave'; const GET_SICK_LEAVE = 'Services/Patients.svc/REST/GetPatientSickLeave'; const EXTEND_SICK_LEAVE = 'Services/DoctorApplication.svc/REST/ExtendSickLeave'; const GET_MASTER_LOOKUP_LIST = 'Services/DoctorApplication.svc/REST/GetMasterLookUpList'; -const GET_COVERING_DOCTORS = - 'Services/DoctorApplication.svc/REST/GetCoveringDoctor'; +const GET_COVERING_DOCTORS = 'Services/DoctorApplication.svc/REST/GetCoveringDoctor'; const ADD_RESCHDEULE = 'Services/DoctorApplication.svc/REST/PostRequisition'; -const UPDATE_RESCHDEULE = - 'Services/DoctorApplication.svc/REST/PatchRequisition'; -const GET_RESCHEDULE_LEAVE = - 'Services/DoctorApplication.svc/REST/GetRequisition'; -const GET_PRESCRIPTION_LIST = - 'Services/DoctorApplication.svc/REST/GetPrescription'; - -const POST_PRESCRIPTION_LIST = - 'Services/DoctorApplication.svc/REST/PostPrescription'; -const GET_PROCEDURE_LIST = - 'Services/DoctorApplication.svc/REST/GetOrderedProcedure'; -const POST_PROCEDURE_LIST = 'Services/DoctorApplication.svc/REST/PostProcedure'; +const UPDATE_RESCHDEULE = 'Services/DoctorApplication.svc/REST/PatchRequisition'; +const GET_RESCHEDULE_LEAVE = 'Services/DoctorApplication.svc/REST/GetRequisition'; +const GET_PRESCRIPTION_LIST = 'Services/DoctorApplication.svc/REST/GetPrescription'; +const POST_PRESCRIPTION_LIST = 'Services/DoctorApplication.svc/REST/PostPrescription'; +const GET_PROCEDURE_LIST = 'Services/DoctorApplication.svc/REST/GetOrderedProcedure'; +const POST_PROCEDURE_LIST = 'Services/DoctorApplication.svc/REST/PostProcedure'; -const GET_PATIENT_IN_PATIENT_LIST = - 'Services/DoctorApplication.svc/REST/GetMyInPatient'; +const GET_PATIENT_IN_PATIENT_LIST = 'Services/DoctorApplication.svc/REST/GetMyInPatient'; -const Verify_Referral_Doctor_Remarks = - 'Services/DoctorApplication.svc/REST/VerifyReferralDoctorRemarks'; +const Verify_Referral_Doctor_Remarks = 'Services/DoctorApplication.svc/REST/VerifyReferralDoctorRemarks'; ///Lab Order const GET_Patient_LAB_ORDERS = 'Services/Patients.svc/REST/GetPatientLabOrders'; -const GET_Patient_LAB_SPECIAL_RESULT = - 'Services/Patients.svc/REST/GetPatientLabSpecialResults'; -const SEND_LAB_RESULT_EMAIL = - 'Services/Notifications.svc/REST/SendLabReportEmail'; -const GET_Patient_LAB_RESULT = - 'Services/Patients.svc/REST/GetPatientLabResults'; -const GET_Patient_LAB_ORDERS_RESULT = - 'Services/Patients.svc/REST/GetPatientLabOrdersResults'; -const GET_PATIENT_LAB_ORDERS_RESULT_HISTORY_BY_DESCRIPTION = - 'Services/Patients.svc/REST/GetPatientLabOrdersResultsHistoryByDescription'; +const GET_Patient_LAB_SPECIAL_RESULT = 'Services/Patients.svc/REST/GetPatientLabSpecialResults'; +const SEND_LAB_RESULT_EMAIL = 'Services/Notifications.svc/REST/SendLabReportEmail'; +const GET_Patient_LAB_RESULT = 'Services/Patients.svc/REST/GetPatientLabResults'; +const GET_Patient_LAB_ORDERS_RESULT = 'Services/Patients.svc/REST/GetPatientLabOrdersResults'; +const GET_PATIENT_LAB_ORDERS_RESULT_HISTORY_BY_DESCRIPTION = 'Services/Patients.svc/REST/GetPatientLabOrdersResultsHistoryByDescription'; // SOAP const GET_ALLERGIES = 'Services/DoctorApplication.svc/REST/GetAllergies'; const POST_EPISODE = 'Services/DoctorApplication.svc/REST/PostEpisode'; -const POST_EPISODE_FOR_IN_PATIENT = - 'Services/DoctorApplication.svc/REST/PostEpisodeForInpatient'; +const POST_EPISODE_FOR_IN_PATIENT = 'Services/DoctorApplication.svc/REST/PostEpisodeForInpatient'; const POST_ALLERGY = 'Services/DoctorApplication.svc/REST/PostAllergies'; const POST_HISTORY = 'Services/DoctorApplication.svc/REST/PostHistory'; -const POST_CHIEF_COMPLAINT = - 'Services/DoctorApplication.svc/REST/PostChiefcomplaint'; -const POST_PHYSICAL_EXAM = - 'Services/DoctorApplication.svc/REST/PostPhysicalExam'; -const POST_PROGRESS_NOTE = - '/Services/DoctorApplication.svc/REST/PostProgressNote'; +const POST_CHIEF_COMPLAINT = 'Services/DoctorApplication.svc/REST/PostChiefcomplaint'; +const POST_PHYSICAL_EXAM = 'Services/DoctorApplication.svc/REST/PostPhysicalExam'; +const POST_PROGRESS_NOTE = '/Services/DoctorApplication.svc/REST/PostProgressNote'; const POST_ASSESSMENT = 'Services/DoctorApplication.svc/REST/PostAssessment'; const PATCH_ALLERGY = 'Services/DoctorApplication.svc/REST/PatchAllergies'; const PATCH_HISTORY = 'Services/DoctorApplication.svc/REST/PatchHistory'; -const PATCH_CHIEF_COMPLAINT = - 'Services/DoctorApplication.svc/REST/PatchChiefcomplaint'; +const PATCH_CHIEF_COMPLAINT = 'Services/DoctorApplication.svc/REST/PatchChiefcomplaint'; -const PATCH_PHYSICAL_EXAM = - 'Services/DoctorApplication.svc/REST/PatchPhysicalExam'; -const PATCH_PROGRESS_NOTE = - 'Services/DoctorApplication.svc/REST/PatchProgressNote'; +const PATCH_PHYSICAL_EXAM = 'Services/DoctorApplication.svc/REST/PatchPhysicalExam'; +const PATCH_PROGRESS_NOTE = 'Services/DoctorApplication.svc/REST/PatchProgressNote'; const PATCH_ASSESSMENT = 'Services/DoctorApplication.svc/REST/PatchAssessment'; const GET_HISTORY = 'Services/DoctorApplication.svc/REST/GetHistory'; -const GET_CHIEF_COMPLAINT = - 'Services/DoctorApplication.svc/REST/GetChiefcomplaint'; +const GET_CHIEF_COMPLAINT = 'Services/DoctorApplication.svc/REST/GetChiefcomplaint'; const GET_PHYSICAL_EXAM = 'Services/DoctorApplication.svc/REST/GetPhysicalExam'; const GET_PROGRESS_NOTE = 'Services/DoctorApplication.svc/REST/GetProgressNote'; const GET_ASSESSMENT = 'Services/DoctorApplication.svc/REST/GetAssessment'; +const GET_LIST_CATEGORISE = 'Services/DoctorApplication.svc/REST/GetProcedureCategories'; -const GET_LIST_CATEGORISE = - 'Services/DoctorApplication.svc/REST/GetProcedureCategories'; - -const GET_CATEGORISE_PROCEDURE = - 'Services/DoctorApplication.svc/REST/GetProcedure'; +const GET_CATEGORISE_PROCEDURE = 'Services/DoctorApplication.svc/REST/GetProcedure'; const UPDATE_PROCEDURE = 'Services/DoctorApplication.svc/REST/PatchProcedure'; -const UPDATE_PRESCRIPTION = - 'Services/DoctorApplication.svc/REST/PatchPrescription'; +const UPDATE_PRESCRIPTION = 'Services/DoctorApplication.svc/REST/PatchPrescription'; const SEARCH_DRUG = 'Services/DoctorApplication.svc/REST/GetMedicationList'; -const DRUG_TO_DRUG = - 'Services/DoctorApplication.svc/REST/DrugToDrugInteraction'; +const DRUG_TO_DRUG = 'Services/DoctorApplication.svc/REST/DrugToDrugInteraction'; const GET_MEDICAL_FILE = 'Services/DoctorApplication.svc/REST/GetMedicalFile'; const GET_FLOORS = 'Services/DoctorApplication.svc/REST/GetFloors'; const GET_WARDS = 'Services/DoctorApplication.svc/REST/GetWards'; -const GET_ROOM_CATEGORIES = - 'Services/DoctorApplication.svc/REST/GetRoomCategories'; -const GET_DIAGNOSIS_TYPES = - 'Services/DoctorApplication.svc/REST/DiagnosisTypes'; +const GET_ROOM_CATEGORIES = 'Services/DoctorApplication.svc/REST/GetRoomCategories'; +const GET_DIAGNOSIS_TYPES = 'Services/DoctorApplication.svc/REST/DiagnosisTypes'; const GET_DIET_TYPES = 'Services/DoctorApplication.svc/REST/DietTypes'; const GET_ICD_CODES = 'Services/DoctorApplication.svc/REST/GetICDCodes'; -const POST_ADMISSION_REQUEST = - 'Services/DoctorApplication.svc/REST/PostAdmissionRequest'; -const GET_ITEM_BY_MEDICINE = - 'Services/DoctorApplication.svc/REST/GetItemByMedicineCode'; +const POST_ADMISSION_REQUEST = 'Services/DoctorApplication.svc/REST/PostAdmissionRequest'; +const GET_ITEM_BY_MEDICINE = 'Services/DoctorApplication.svc/REST/GetItemByMedicineCode'; -const GET_PROCEDURE_VALIDATION = - 'Services/DoctorApplication.svc/REST/ValidateProcedures'; -const GET_BOX_QUANTITY = - 'Services/DoctorApplication.svc/REST/CalculateBoxQuantity'; +const GET_PROCEDURE_VALIDATION = 'Services/DoctorApplication.svc/REST/ValidateProcedures'; +const GET_BOX_QUANTITY = 'Services/DoctorApplication.svc/REST/CalculateBoxQuantity'; ///GET ECG const GET_ECG = "Services/Patients.svc/REST/HIS_GetPatientMuseResults"; -const GET_MY_REFERRAL_INPATIENT = - "Services/DoctorApplication.svc/REST/GtMyReferralPatient"; +const GET_MY_REFERRAL_INPATIENT = "Services/DoctorApplication.svc/REST/GtMyReferralPatient"; -const GET_MY_REFERRAL_OUT_PATIENT = - "Services/DoctorApplication.svc/REST/GtMyReferralForOutPatient"; +const GET_MY_REFERRAL_OUT_PATIENT = "Services/DoctorApplication.svc/REST/GtMyReferralForOutPatient"; -const GET_MY_DISCHARGE_PATIENT = - "Services/DoctorApplication.svc/REST/GtMyDischargeReferralPatient"; -const GET_DISCHARGE_PATIENT = - "Services/DoctorApplication.svc/REST/GtMyDischargePatient"; +const GET_MY_DISCHARGE_PATIENT = "Services/DoctorApplication.svc/REST/GtMyDischargeReferralPatient"; +const GET_DISCHARGE_PATIENT = "Services/DoctorApplication.svc/REST/GtMyDischargePatient"; -const GET_PAtIENTS_INSURANCE_APPROVALS = - "Services/Patients.svc/REST/GetApprovalStatus"; +const GET_PAtIENTS_INSURANCE_APPROVALS = "Services/Patients.svc/REST/GetApprovalStatus"; const GET_RAD_IMAGE_URL = 'Services/Patients.svc/Rest/GetRadImageURL'; const GET_PATIENT_ORDERS = 'Services/Patients.svc/REST/GetPatientRadOrders'; -const GET_IN_PATIENT_ORDERS = - 'Services/DoctorApplication.svc/REST/GetPatientRadResult'; +const GET_IN_PATIENT_ORDERS = 'Services/DoctorApplication.svc/REST/GetPatientRadResult'; ///Prescriptions -const GET_PRESCRIPTIONS_ALL_ORDERS = - 'Services/Patients.svc/REST/PatientER_GetPatientAllPresOrders'; -const GET_PRESCRIPTION_REPORT_NEW = - 'Services/Patients.svc/REST/INP_GetPrescriptionReport'; -const SEND_PRESCRIPTION_EMAIL = - 'Services/Notifications.svc/REST/SendPrescriptionEmail'; -const GET_PRESCRIPTION_REPORT_ENH = - 'Services/Patients.svc/REST/GetPrescriptionReport_enh'; -const UPDATE_PROGRESS_NOTE_FOR_INPATIENT = - "Services/DoctorApplication.svc/REST/UpdateProgressNoteForInPatient"; -const CREATE_PROGRESS_NOTE_FOR_INPATIENT = - "Services/DoctorApplication.svc/REST/CreateProgressNoteForInPatient"; +const GET_PRESCRIPTIONS_ALL_ORDERS = 'Services/Patients.svc/REST/PatientER_GetPatientAllPresOrders'; +const GET_PRESCRIPTION_REPORT_NEW = 'Services/Patients.svc/REST/INP_GetPrescriptionReport'; +const SEND_PRESCRIPTION_EMAIL = 'Services/Notifications.svc/REST/SendPrescriptionEmail'; +const GET_PRESCRIPTION_REPORT_ENH = 'Services/Patients.svc/REST/GetPrescriptionReport_enh'; +const UPDATE_PROGRESS_NOTE_FOR_INPATIENT = "Services/DoctorApplication.svc/REST/UpdateProgressNoteForInPatient"; +const CREATE_PROGRESS_NOTE_FOR_INPATIENT = "Services/DoctorApplication.svc/REST/CreateProgressNoteForInPatient"; const GET_SICK_LEAVE_PATIENT = "Services/Patients.svc/REST/GetPatientSickLeave"; -const GET_MY_OUT_PATIENT = - "Services/DoctorApplication.svc/REST/GetMyOutPatient"; +const GET_MY_OUT_PATIENT = "Services/DoctorApplication.svc/REST/GetMyOutPatient"; -const PATIENT_MEDICAL_REPORT_GET_LIST = - "Services/Patients.svc/REST/DAPP_ListMedicalReport"; -const PATIENT_MEDICAL_REPORT_GET_TEMPLATE = - "Services/Patients.svc/REST/DAPP_GetTemplateByID"; -const PATIENT_MEDICAL_REPORT_INSERT = - "Services/Patients.svc/REST/DAPP_InsertMedicalReport"; -const PATIENT_MEDICAL_REPORT_VERIFIED = - "Services/Patients.svc/REST/DAPP_VerifiedMedicalReport"; +const PATIENT_MEDICAL_REPORT_GET_LIST = "Services/Patients.svc/REST/DAPP_ListMedicalReport"; +const PATIENT_MEDICAL_REPORT_GET_TEMPLATE = "Services/Patients.svc/REST/DAPP_GetTemplateByID"; +const PATIENT_MEDICAL_REPORT_INSERT = "Services/Patients.svc/REST/DAPP_InsertMedicalReport"; +const PATIENT_MEDICAL_REPORT_VERIFIED = "Services/Patients.svc/REST/DAPP_VerifiedMedicalReport"; -const GET_PROCEDURE_TEMPLETE = - 'Services/Doctors.svc/REST/DAPP_ProcedureTemplateGet'; +const GET_PROCEDURE_TEMPLETE = 'Services/Doctors.svc/REST/DAPP_ProcedureTemplateGet'; const GET_TEMPLETE_LIST = 'Services/Doctors.svc/REST/DAPP_TemplateGet'; -const GET_PROCEDURE_TEMPLETE_DETAILS = - "Services/Doctors.svc/REST/DAPP_ProcedureTemplateDetailsGet"; -const GET_PENDING_PATIENT_ER_FOR_DOCTOR_APP = - 'Services/DoctorApplication.svc/REST/GetPendingPatientERForDoctorApp'; +const GET_PROCEDURE_TEMPLETE_DETAILS = "Services/Doctors.svc/REST/DAPP_ProcedureTemplateDetailsGet"; +const GET_PENDING_PATIENT_ER_FOR_DOCTOR_APP = 'Services/DoctorApplication.svc/REST/GetPendingPatientERForDoctorApp'; -const DOCTOR_CHECK_HAS_LIVE_CARE = - "Services/DoctorApplication.svc/REST/CheckDoctorHasLiveCare"; +const DOCTOR_CHECK_HAS_LIVE_CARE = "Services/DoctorApplication.svc/REST/CheckDoctorHasLiveCare"; const LIVE_CARE_IS_LOGIN = "LiveCareApi/DoctorApp/UseIsLogin"; -const ADD_REFERRED_REMARKS_NEW = - "Services/DoctorApplication.svc/REST/AddReferredDoctorRemarks_New"; -const GET_SPECIAL_CLINICAL_CARE_LIST = - "Services/DoctorApplication.svc/REST/GetSpecialClinicalCareList"; -const GET_SPECIAL_CLINICAL_CARE_MAPPING_LIST = - "Services/DoctorApplication.svc/REST/GetSpecialClinicalCareMappingList"; - -const INSERT_MEDICAL_REPORT = - "Services/Patients.svc/REST/DAPP_InsertMedicalReport_New"; - -const UPDATE_MEDICAL_REPORT = - "Services/Patients.svc/REST/DAPP_UpdateMedicalReport"; -const GET_SICK_LEAVE_DOCTOR_APP = - "Services/DoctorApplication.svc/REST/GetAllSickLeaves"; +const ADD_REFERRED_REMARKS_NEW = "Services/DoctorApplication.svc/REST/AddReferredDoctorRemarks_New"; +const GET_SPECIAL_CLINICAL_CARE_LIST = "Services/DoctorApplication.svc/REST/GetSpecialClinicalCareList"; +const GET_SPECIAL_CLINICAL_CARE_MAPPING_LIST = "Services/DoctorApplication.svc/REST/GetSpecialClinicalCareMappingList"; + +const INSERT_MEDICAL_REPORT = "Services/Patients.svc/REST/DAPP_InsertMedicalReport_New"; + +const UPDATE_MEDICAL_REPORT = "Services/Patients.svc/REST/DAPP_UpdateMedicalReport"; +const GET_SICK_LEAVE_DOCTOR_APP = "Services/DoctorApplication.svc/REST/GetAllSickLeaves"; const ADD_PATIENT_TO_DOCTOR = "LiveCareApi/DoctorApp/AssignPatientToDoctor"; const REMOVE_PATIENT_FROM_DOCTOR = "LiveCareApi/DoctorApp/BackPatientToQueue"; -const CREATE_DOCTOR_RESPONSE = - "Services/DoctorApplication.svc/REST/CreateDoctorResponse"; -const GET_DOCTOR_NOT_REPLIED_COUNTS = - "Services/DoctorApplication.svc/REST/DoctorApp_GetDoctorNotRepliedCounts"; -const ALL_SPECIAL_LAB_RESULT = - "services/Patients.svc/REST/GetPatientLabSpecialResultsALL"; -const GET_MEDICATION_FOR_IN_PATIENT = - "Services/DoctorApplication.svc/REST/Doctor_GetMedicationForInpatient"; -const GET_EPISODE_FOR_INPATIENT = - "/Services/DoctorApplication.svc/REST/DoctorApp_GetEpisodeForInpatient"; +const CREATE_DOCTOR_RESPONSE = "Services/DoctorApplication.svc/REST/CreateDoctorResponse"; +const GET_DOCTOR_NOT_REPLIED_COUNTS = "Services/DoctorApplication.svc/REST/DoctorApp_GetDoctorNotRepliedCounts"; +const ALL_SPECIAL_LAB_RESULT = "services/Patients.svc/REST/GetPatientLabSpecialResultsALL"; +const GET_MEDICATION_FOR_IN_PATIENT = "Services/DoctorApplication.svc/REST/Doctor_GetMedicationForInpatient"; +const GET_EPISODE_FOR_INPATIENT = "/Services/DoctorApplication.svc/REST/DoctorApp_GetEpisodeForInpatient"; ///Operation Details Services -const GET_RESERVATIONS = - "Services/DoctorApplication.svc/REST/DoctorApp_GetReservationDetails"; -const GET_OPERATION_DETAILS = - "Services/DoctorApplication.svc/REST/DoctorApp_GetOperationDetails"; -const UPDATE_OPERATION_REPORT = - "Services/DoctorApplication.svc/REST/DoctorApp_CreateUpdateOperationReport"; +const GET_RESERVATIONS = "Services/DoctorApplication.svc/REST/DoctorApp_GetReservationDetails"; +const GET_OPERATION_DETAILS = "Services/DoctorApplication.svc/REST/DoctorApp_GetOperationDetails"; +const UPDATE_OPERATION_REPORT = "Services/DoctorApplication.svc/REST/DoctorApp_CreateUpdateOperationReport"; -const NURSING_PROGRESS_NOTE = - "Services/DoctorApplication.svc/REST/DoctorApp_GetNursingProgressNote"; -const GET_DIAGNOSIS_FOR_IN_PATIENT = - "Services/DoctorApplication.svc/REST/DoctorApp_GetDiagnosisForInPatient"; +const NURSING_PROGRESS_NOTE = "Services/DoctorApplication.svc/REST/DoctorApp_GetNursingProgressNote"; +const GET_DIAGNOSIS_FOR_IN_PATIENT = "Services/DoctorApplication.svc/REST/DoctorApp_GetDiagnosisForInPatient"; -const GET_DIABETIC_CHART_VALUES = - "Services/DoctorApplication.svc/REST/DoctorApp_GetDiabeticChartValues"; +const GET_DIABETIC_CHART_VALUES = "Services/DoctorApplication.svc/REST/DoctorApp_GetDiabeticChartValues"; -const GET_PENDING_ORDERS = - "Services/DoctorApplication.svc/REST/DoctorApp_GetPendingOrdersForInPatient"; +const GET_PENDING_ORDERS = "Services/DoctorApplication.svc/REST/DoctorApp_GetPendingOrdersForInPatient"; -const GET_ADMISSION_ORDERS = - "/Services/DoctorApplication.svc/REST/DoctorApp_GetAdmissionOrders"; +const GET_ADMISSION_ORDERS = "/Services/DoctorApplication.svc/REST/DoctorApp_GetAdmissionOrders"; ///Patient Registration Services -const CHECK_PATIENT_FOR_REGISTRATION = - "Services/Authentication.svc/REST/CheckPatientForRegisteration"; -const SEND_ACTIVATION_CODE_BY_OTP_NOT_TYPE_FOR_REGISTRATION = - "Services/Authentication.svc/REST/SendActivationCodebyOTPNotificationTypeForRegistration"; -const CHECK_ACTIVATION_CODE_FOR_PATIENT = - "Services/Authentication.svc/REST/CheckActivationCode"; -const PATIENT_REGISTRATION = - "Services/Authentication.svc/REST/PatientRegistration"; +const CHECK_PATIENT_FOR_REGISTRATION = "Services/Authentication.svc/REST/CheckPatientForRegisteration"; +const SEND_ACTIVATION_CODE_BY_OTP_NOT_TYPE_FOR_REGISTRATION = "Services/Authentication.svc/REST/SendActivationCodebyOTPNotificationTypeForRegistration"; +const CHECK_ACTIVATION_CODE_FOR_PATIENT = "Services/Authentication.svc/REST/CheckActivationCode"; +const PATIENT_REGISTRATION = "Services/Authentication.svc/REST/PatientRegistration"; const GET_PATIENT_INFO = "Services/NHIC.svc/REST/GetPatientInfo"; /// Discharge Summary -const GET_PENDING_DISCHARGE_SUMMARY = - "Services/DoctorApplication.svc/REST/DoctorApp_GetPendingDischargeSummary"; -const GET_ALL_DISCHARGE_SUMMARY = - "Services/DoctorApplication.svc/REST/DoctorApp_GetDischargeSummary"; - -const VTE_ASSESSMENT = - "Services/Patients.svc/REST/INP_GetVTEHistoryByTransactionNo"; +const GET_PENDING_DISCHARGE_SUMMARY = "Services/DoctorApplication.svc/REST/DoctorApp_GetPendingDischargeSummary"; +const GET_ALL_DISCHARGE_SUMMARY = "Services/DoctorApplication.svc/REST/DoctorApp_GetDischargeSummary"; -const GET_INTERVENTION_MEDICATION = - "Services/DoctorApplication.svc/REST/DoctorApp_GetInterventionMedications"; +const VTE_ASSESSMENT = "Services/Patients.svc/REST/INP_GetVTEHistoryByTransactionNo"; -const GET_INTERVENTION_MEDICATION_HISTORY = - "Services/DoctorApplication.svc/REST/DoctorApp_GetInterventionHistory"; +const GET_INTERVENTION_MEDICATION = "Services/DoctorApplication.svc/REST/DoctorApp_GetInterventionMedications"; -const SET_ACCEPTED_OR_REJECTED = - "Services/DoctorApplication.svc/REST/DoctorApp_AcceptOrRejectIntervention"; +const GET_INTERVENTION_MEDICATION_HISTORY = "Services/DoctorApplication.svc/REST/DoctorApp_GetInterventionHistory"; -const GET_STP_MASTER_LIST = - "Services/DoctorApplication.svc/REST/DoctorApp_GetSTPMasterList"; +const SET_ACCEPTED_OR_REJECTED = "Services/DoctorApplication.svc/REST/DoctorApp_AcceptOrRejectIntervention"; +const GET_STP_MASTER_LIST = "Services/DoctorApplication.svc/REST/DoctorApp_GetSTPMasterList"; -const DOCTOR_ER_SIGN_ASSESSMENT = - "Services/DoctorApplication.svc/REST/DoctorApp_DoctorERSignAssessment"; +const DOCTOR_ER_SIGN_ASSESSMENT = "Services/DoctorApplication.svc/REST/DoctorApp_DoctorERSignAssessment"; var selectedPatientType = 1; @@ -411,26 +288,8 @@ var SERVICES_PATIANT2 = [ "List_MyReferralPatient", "patientArrivalList" ]; -var SERVICES_PATIANT_HEADER = [ - "My OutPatient", - "My InPatient", - "Discharge", - "Referred", - "Referral Discharge", - "Tomorrow", - "Referral", - "Arrival Patient" -]; -var SERVICES_PATIANT_HEADER_AR = [ - "المريض الخارجي", - "المريض المنوم", - "المريض المعافى", - "المريض المحول الي", - "المريض المحال المعافى", - "مريض الغد", - "المريض المحول مني", - "المريض الواصل" -]; +var SERVICES_PATIANT_HEADER = ["My OutPatient", "My InPatient", "Discharge", "Referred", "Referral Discharge", "Tomorrow", "Referral", "Arrival Patient"]; +var SERVICES_PATIANT_HEADER_AR = ["المريض الخارجي", "المريض المنوم", "المريض المعافى", "المريض المحول الي", "المريض المحال المعافى", "مريض الغد", "المريض المحول مني", "المريض الواصل"]; const PRIMARY_COLOR = 0xff515B5D; @@ -438,7 +297,7 @@ const TRANSACTION_NO = 0; const LANGUAGE_ID = 2; const STAMP = '2020-04-27T12:17:17.721Z'; const IP_ADDRESS = '9.9.9.9'; -const VERSION_ID = 8.3; +const VERSION_ID = 8.9; const CHANNEL = 9; const SESSION_ID = 'BlUSkYymTt'; const IS_LOGIN_FOR_DOCTOR_APP = true; @@ -450,7 +309,6 @@ const GENERAL_ID = 'Cs2020@2016\$2958'; const PATIENT_TYPE = 1; const PATIENT_TYPE_ID = 1; - /// Timer Info const TIMER_MIN = 10; @@ -459,7 +317,6 @@ class AppGlobal { static Color appRedColor = Color(0xFFD02127); static Color appGreenColor = Color(0xFF359846); static Color appTextColor = Color(0xFF2B353E); - static Color scheduleTextColor = Color(0xFF2E303A); - static Color inProgressColor = Color(0xFFCC9B14); - + static Color scheduleTextColor = Color(0xFF2E303A); + static Color inProgressColor = Color(0xFFCC9B14); } diff --git a/lib/core/service/AnalyticsService.dart b/lib/core/service/AnalyticsService.dart index e194ed9a..b2290299 100644 --- a/lib/core/service/AnalyticsService.dart +++ b/lib/core/service/AnalyticsService.dart @@ -3,14 +3,13 @@ import 'package:firebase_analytics/observer.dart'; import 'package:flutter/cupertino.dart'; class AnalyticsService { - final FirebaseAnalytics _analytics = FirebaseAnalytics(); + // final FirebaseAnalytics _analytics = FirebaseAnalytics(); + static FirebaseAnalyticsObserver observer = FirebaseAnalyticsObserver(analytics: analytics); + static FirebaseAnalytics analytics = FirebaseAnalytics.instance; + FirebaseAnalyticsObserver getAnalyticsObserver() => FirebaseAnalyticsObserver(analytics: analytics); - FirebaseAnalyticsObserver getAnalyticsObserver() => - FirebaseAnalyticsObserver(analytics: _analytics); - - Future logEvent( - {@required String eventCategory, @required String eventAction}) async { - await _analytics.logEvent(name: 'event', parameters: { + Future logEvent({@required String eventCategory, @required String eventAction}) async { + await analytics.logEvent(name: 'event', parameters: { "eventCategory": eventCategory, "eventAction": eventAction, }); diff --git a/lib/core/viewModel/authentication_view_model.dart b/lib/core/viewModel/authentication_view_model.dart index 9f0b28e5..0a20fb47 100644 --- a/lib/core/viewModel/authentication_view_model.dart +++ b/lib/core/viewModel/authentication_view_model.dart @@ -26,7 +26,7 @@ import 'package:doctor_app_flutter/utils/utils.dart'; import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; import 'package:firebase_messaging/firebase_messaging.dart'; import 'package:flutter/services.dart'; -import 'package:local_auth/auth_strings.dart'; +// import 'package:local_auth/auth_strings.dart'; import 'package:local_auth/local_auth.dart'; enum APP_STATUS { LOADING, UNAUTHENTICATED, AUTHENTICATED, UNVERIFIED } @@ -41,20 +41,13 @@ class AuthenticationViewModel extends BaseViewModel { NewLoginInformationModel get loginInfo => _authService.loginInfo; - List get doctorProfilesList => - _authService.doctorProfilesList; + List get doctorProfilesList => _authService.doctorProfilesList; - SendActivationCodeForDoctorAppResponseModel - get activationCodeVerificationScreenRes => - _authService.activationCodeVerificationScreenRes; + SendActivationCodeForDoctorAppResponseModel get activationCodeVerificationScreenRes => _authService.activationCodeVerificationScreenRes; - SendActivationCodeForDoctorAppResponseModel - get activationCodeForDoctorAppRes => - _authService.activationCodeForDoctorAppRes; + SendActivationCodeForDoctorAppResponseModel get activationCodeForDoctorAppRes => _authService.activationCodeForDoctorAppRes; - CheckActivationCodeForDoctorAppResponseModel - get checkActivationCodeForDoctorAppRes => - _authService.checkActivationCodeForDoctorAppRes; + CheckActivationCodeForDoctorAppResponseModel get checkActivationCodeForDoctorAppRes => _authService.checkActivationCodeForDoctorAppRes; NewLoginInformationModel loggedUser; GetIMEIDetailsModel user; @@ -88,32 +81,20 @@ class AuthenticationViewModel extends BaseViewModel { profileInfo['IMEI'] = token; profileInfo['LogInTypeID'] = await sharedPref.getInt(OTP_TYPE); profileInfo['BioMetricEnabled'] = true; - profileInfo['MobileNo'] = - loggedIn != null ? loggedIn['MobileNumber'] : user.mobile; - InsertIMEIDetailsModel insertIMEIDetailsModel = - InsertIMEIDetailsModel.fromJson(profileInfo); - insertIMEIDetailsModel.genderDescription = - profileInfo['Gender_Description']; - insertIMEIDetailsModel.genderDescriptionN = - profileInfo['Gender_DescriptionN']; - insertIMEIDetailsModel.genderDescriptionN = - profileInfo['Gender_DescriptionN']; + profileInfo['MobileNo'] = loggedIn != null ? loggedIn['MobileNumber'] : user.mobile; + InsertIMEIDetailsModel insertIMEIDetailsModel = InsertIMEIDetailsModel.fromJson(profileInfo); + insertIMEIDetailsModel.genderDescription = profileInfo['Gender_Description']; + insertIMEIDetailsModel.genderDescriptionN = profileInfo['Gender_DescriptionN']; + insertIMEIDetailsModel.genderDescriptionN = profileInfo['Gender_DescriptionN']; insertIMEIDetailsModel.titleDescription = profileInfo['Title_Description']; - insertIMEIDetailsModel.titleDescriptionN = - profileInfo['Title_DescriptionN']; + insertIMEIDetailsModel.titleDescriptionN = profileInfo['Title_DescriptionN']; insertIMEIDetailsModel.projectID = await sharedPref.getInt(PROJECT_ID); - insertIMEIDetailsModel.doctorID = loggedIn != null - ? loggedIn['List_MemberInformation'][0]['MemberID'] - : user.doctorID; - insertIMEIDetailsModel.outSA = - loggedIn != null ? loggedIn['PatientOutSA'] : user.outSA; - insertIMEIDetailsModel.vidaAuthTokenID = - await sharedPref.getString(VIDA_AUTH_TOKEN_ID); - insertIMEIDetailsModel.vidaRefreshTokenID = - await sharedPref.getString(VIDA_REFRESH_TOKEN_ID); + insertIMEIDetailsModel.doctorID = loggedIn != null ? loggedIn['List_MemberInformation'][0]['MemberID'] : user.doctorID; + insertIMEIDetailsModel.outSA = loggedIn != null ? loggedIn['PatientOutSA'] : user.outSA; + insertIMEIDetailsModel.vidaAuthTokenID = await sharedPref.getString(VIDA_AUTH_TOKEN_ID); + insertIMEIDetailsModel.vidaRefreshTokenID = await sharedPref.getString(VIDA_REFRESH_TOKEN_ID); insertIMEIDetailsModel.password = userInfo.password; - insertIMEIDetailsModel.loginDoctorID = loggedUser != null ? loggedUser.listMemberInformation[0].employeeID - : int.parse(user.editedBy.toString()); + insertIMEIDetailsModel.loginDoctorID = loggedUser != null ? loggedUser.listMemberInformation[0].employeeID : int.parse(user.editedBy.toString()); await _authService.insertDeviceImei(insertIMEIDetailsModel); if (_authService.hasError) { @@ -141,25 +122,22 @@ class AuthenticationViewModel extends BaseViewModel { } /// send activation code for for msg methods - Future sendActivationCodeVerificationScreen( - AuthMethodTypes authMethodType) async { + Future sendActivationCodeVerificationScreen(AuthMethodTypes authMethodType) async { setState(ViewState.BusyLocal); - ActivationCodeForVerificationScreenModel activationCodeModel = - ActivationCodeForVerificationScreenModel( - iMEI: user.iMEI, - facilityId: user.projectID, - memberID: user.doctorID, - loginDoctorID: int.parse(user.editedBy.toString()), - zipCode: user.outSA == true ? '971' : '966', - mobileNumber: user.mobile, - oTPSendType: authMethodType.getTypeIdService(), - isMobileFingerPrint: 1, - vidaAuthTokenID: user.vidaAuthTokenID, - vidaRefreshTokenID: user.vidaRefreshTokenID); + ActivationCodeForVerificationScreenModel activationCodeModel = ActivationCodeForVerificationScreenModel( + iMEI: user.iMEI, + facilityId: user.projectID, + memberID: user.doctorID, + loginDoctorID: int.parse(user.editedBy.toString()), + zipCode: user.outSA == true ? '971' : '966', + mobileNumber: user.mobile, + oTPSendType: authMethodType.getTypeIdService(), + isMobileFingerPrint: 1, + vidaAuthTokenID: user.vidaAuthTokenID, + vidaRefreshTokenID: user.vidaRefreshTokenID); await sharedPref.setString(DOCTOR_ID, user.editedBy.toString()); - await _authService - .sendActivationCodeVerificationScreen(activationCodeModel); + await _authService.sendActivationCodeVerificationScreen(activationCodeModel); if (_authService.hasError) { error = _authService.error; setState(ViewState.ErrorLocal); @@ -168,8 +146,7 @@ class AuthenticationViewModel extends BaseViewModel { } /// send activation code for silent login - Future sendActivationCodeForDoctorApp( - {AuthMethodTypes authMethodType, String password}) async { + Future sendActivationCodeForDoctorApp({AuthMethodTypes authMethodType, String password}) async { setState(ViewState.BusyLocal); int projectID = await sharedPref.getInt(PROJECT_ID); ActivationCodeModel activationCodeModel = ActivationCodeModel( @@ -184,57 +161,45 @@ class AuthenticationViewModel extends BaseViewModel { error = _authService.error; setState(ViewState.ErrorLocal); } else { - await sharedPref.setString( - TOKEN, _authService.activationCodeForDoctorAppRes.logInTokenID); + await sharedPref.setString(TOKEN, _authService.activationCodeForDoctorAppRes.logInTokenID); setState(ViewState.Idle); } } /// check activation code for sms and whats app - Future checkActivationCodeForDoctorApp( - {String activationCode, bool isSilentLogin = false}) async { + Future checkActivationCodeForDoctorApp({String activationCode, bool isSilentLogin = false}) async { setState(ViewState.BusyLocal); - CheckActivationCodeRequestModel checkActivationCodeForDoctorApp = - new CheckActivationCodeRequestModel( - zipCode: loggedUser != null ? loggedUser.zipCode : user.zipCode, - mobileNumber: - loggedUser != null ? loggedUser.mobileNumber : user.mobile, - projectID: await sharedPref.getInt(PROJECT_ID) != null - ? await sharedPref.getInt(PROJECT_ID) - : user.projectID, - logInTokenID: await sharedPref.getString(TOKEN), - activationCode: activationCode ?? '0000', - memberID: userInfo.userID != null - ? int.parse(userInfo.userID) - : user.doctorID, - password: userInfo.password, - facilityId: userInfo.projectID != null - ? userInfo.projectID.toString() - : user.projectID.toString(), - oTPSendType: await sharedPref.getInt(OTP_TYPE), - iMEI: localToken, - loginDoctorID: loggedUser != null ? loggedUser.listMemberInformation[0].employeeID - : int.parse(user.editedBy.toString()),///loggedUser.listMemberInformation[0].employeeID, - // loggedUser.listMemberInformation[0].employeeID, - isForSilentLogin: isSilentLogin, - generalid: "Cs2020@2016\$2958"); - await _authService - .checkActivationCodeForDoctorApp(checkActivationCodeForDoctorApp); + CheckActivationCodeRequestModel checkActivationCodeForDoctorApp = new CheckActivationCodeRequestModel( + zipCode: loggedUser != null ? loggedUser.zipCode : user.zipCode, + mobileNumber: loggedUser != null ? loggedUser.mobileNumber : user.mobile, + projectID: await sharedPref.getInt(PROJECT_ID) != null ? await sharedPref.getInt(PROJECT_ID) : user.projectID, + logInTokenID: await sharedPref.getString(TOKEN), + activationCode: activationCode ?? '0000', + memberID: userInfo.userID != null ? int.parse(userInfo.userID) : user.doctorID, + password: userInfo.password, + facilityId: userInfo.projectID != null ? userInfo.projectID.toString() : user.projectID.toString(), + oTPSendType: await sharedPref.getInt(OTP_TYPE), + iMEI: localToken, + loginDoctorID: loggedUser != null ? loggedUser.listMemberInformation[0].employeeID : int.parse(user.editedBy.toString()), + + ///loggedUser.listMemberInformation[0].employeeID, + // loggedUser.listMemberInformation[0].employeeID, + isForSilentLogin: isSilentLogin, + generalid: "Cs2020@2016\$2958"); + await _authService.checkActivationCodeForDoctorApp(checkActivationCodeForDoctorApp); if (_authService.hasError) { error = _authService.error; setState(ViewState.ErrorLocal); } else { - await setDataAfterSendActivationSuccess( - checkActivationCodeForDoctorAppRes); + await setDataAfterSendActivationSuccess(checkActivationCodeForDoctorAppRes); setState(ViewState.Idle); } } /// get list of Hospitals Future getHospitalsList(memberID) async { - GetHospitalsRequestModel getHospitalsRequestModel = - GetHospitalsRequestModel(); + GetHospitalsRequestModel getHospitalsRequestModel = GetHospitalsRequestModel(); getHospitalsRequestModel.memberID = memberID; await _hospitalsService.getHospitals(getHospitalsRequestModel); if (_hospitalsService.hasError) { @@ -266,16 +231,11 @@ class AuthenticationViewModel extends BaseViewModel { } /// add  token to shared preferences in case of send activation code is success - setDataAfterSendActivationSuccess( - CheckActivationCodeForDoctorAppResponseModel - sendActivationCodeForDoctorAppResponseModel) async { + setDataAfterSendActivationSuccess(CheckActivationCodeForDoctorAppResponseModel sendActivationCodeForDoctorAppResponseModel) async { // print("VerificationCode : " + sendActivationCodeForDoctorAppResponseModel.verificationCode); - await sharedPref.setString(VIDA_AUTH_TOKEN_ID, - sendActivationCodeForDoctorAppResponseModel.vidaAuthTokenID); - await sharedPref.setString(VIDA_REFRESH_TOKEN_ID, - sendActivationCodeForDoctorAppResponseModel.vidaRefreshTokenID); - await sharedPref.setString(TOKEN, - sendActivationCodeForDoctorAppResponseModel.authenticationTokenID); + await sharedPref.setString(VIDA_AUTH_TOKEN_ID, sendActivationCodeForDoctorAppResponseModel.vidaAuthTokenID); + await sharedPref.setString(VIDA_REFRESH_TOKEN_ID, sendActivationCodeForDoctorAppResponseModel.vidaRefreshTokenID); + await sharedPref.setString(TOKEN, sendActivationCodeForDoctorAppResponseModel.authenticationTokenID); } saveObjToString(String key, value) async { @@ -284,21 +244,23 @@ class AuthenticationViewModel extends BaseViewModel { /// ask user to add his biometric showIOSAuthMessages() async { - const iosStrings = const IOSAuthMessages( - cancelButton: 'cancel', - goToSettingsButton: 'settings', - goToSettingsDescription: 'Please set up your Touch ID.', - lockOut: 'Please Enable Your Touch ID'); - - try { - await auth.authenticateWithBiometrics( - localizedReason: 'Scan your fingerprint to authenticate', - useErrorDialogs: true, - stickyAuth: true, - iOSAuthStrings: iosStrings); - } on PlatformException catch (e) { - DrAppToastMsg.showErrorToast(e.toString()); - } + //TODO FOR UPGRADE NEED TO BE TESTED FIRST + + // const iosStrings = const IOSAuthMessages( + // cancelButton: 'cancel', + // goToSettingsButton: 'settings', + // goToSettingsDescription: 'Please set up your Touch ID.', + // lockOut: 'Please Enable Your Touch ID'); + + // try { + // await auth.authenticateWithBiometrics( + // localizedReason: 'Scan your fingerprint to authenticate', + // useErrorDialogs: true, + // stickyAuth: true, + // // iOSAuthStrings: iosStrings); + // } on PlatformException catch (e) { + // DrAppToastMsg.showErrorToast(e.toString()); + // } } /// add profile to base view model super class @@ -308,12 +270,7 @@ class AuthenticationViewModel extends BaseViewModel { /// get doctor profile based on clinic model Future getDoctorProfileBasedOnClinic(ClinicModel clinicInfo) async { - ProfileReqModel docInfo = new ProfileReqModel( - doctorID: clinicInfo.doctorID, - clinicID: clinicInfo.clinicID, - license: true, - projectID: clinicInfo.projectID, - languageID: 2); + ProfileReqModel docInfo = new ProfileReqModel(doctorID: clinicInfo.doctorID, clinicID: clinicInfo.clinicID, license: true, projectID: clinicInfo.projectID, languageID: 2); ///TODO change the lan await _authService.getDoctorProfileBasedOnClinic(docInfo); @@ -328,17 +285,12 @@ class AuthenticationViewModel extends BaseViewModel { /// add some logic in case of check activation code is success onCheckActivationCodeSuccess({bool isSilentLogin = false}) async { - sharedPref.setString( - TOKEN, checkActivationCodeForDoctorAppRes.authenticationTokenID); - if (checkActivationCodeForDoctorAppRes.listDoctorProfile != null && - checkActivationCodeForDoctorAppRes.listDoctorProfile.isNotEmpty) { - localSetDoctorProfile( - checkActivationCodeForDoctorAppRes.listDoctorProfile[0]); + sharedPref.setString(TOKEN, checkActivationCodeForDoctorAppRes.authenticationTokenID); + if (checkActivationCodeForDoctorAppRes.listDoctorProfile != null && checkActivationCodeForDoctorAppRes.listDoctorProfile.isNotEmpty) { + localSetDoctorProfile(checkActivationCodeForDoctorAppRes.listDoctorProfile[0]); } else { - sharedPref.setObj( - CLINIC_NAME, checkActivationCodeForDoctorAppRes.listDoctorsClinic); - ClinicModel clinic = ClinicModel.fromJson( - checkActivationCodeForDoctorAppRes.listDoctorsClinic[0].toJson()); + sharedPref.setObj(CLINIC_NAME, checkActivationCodeForDoctorAppRes.listDoctorsClinic); + ClinicModel clinic = ClinicModel.fromJson(checkActivationCodeForDoctorAppRes.listDoctorsClinic[0].toJson()); await getDoctorProfileBasedOnClinic(clinic); } } @@ -382,10 +334,8 @@ class AuthenticationViewModel extends BaseViewModel { } else { if (_authService.dashboardItemsList.length > 0) { user = _authService.dashboardItemsList[0]; - sharedPref.setObj( - LAST_LOGIN_USER, _authService.dashboardItemsList[0]); - await sharedPref.setString( - VIDA_REFRESH_TOKEN_ID, user.vidaRefreshTokenID); + sharedPref.setObj(LAST_LOGIN_USER, _authService.dashboardItemsList[0]); + await sharedPref.setString(VIDA_REFRESH_TOKEN_ID, user.vidaRefreshTokenID); await sharedPref.setString(VIDA_AUTH_TOKEN_ID, user.vidaAuthTokenID); this.unverified = true; } diff --git a/lib/core/viewModel/base_view_model.dart b/lib/core/viewModel/base_view_model.dart index 2cbc593b..0785f4d8 100644 --- a/lib/core/viewModel/base_view_model.dart +++ b/lib/core/viewModel/base_view_model.dart @@ -23,8 +23,7 @@ class BaseViewModel extends ChangeNotifier { notifyListeners(); } - Future getDoctorProfile( - {bool isGetProfile = false}) async { + Future getDoctorProfile({bool isGetProfile = false}) async { if (isGetProfile) { Map profile = await sharedPref.getObj(DOCTOR_PROFILE); if (profile != null) { diff --git a/lib/screens/ER_singin/ER_singin_screen.dart b/lib/screens/ER_singin/ER_singin_screen.dart index 0d9dbc5e..767d4e54 100644 --- a/lib/screens/ER_singin/ER_singin_screen.dart +++ b/lib/screens/ER_singin/ER_singin_screen.dart @@ -34,14 +34,15 @@ class _ErSignInScreenState extends State { ProjectViewModel projectViewModel; @override Widget build(BuildContext context) { - projectViewModel = Provider.of(context); + projectViewModel = Provider.of(context); return BaseView( builder: (_, model, w) => AppScaffold( baseViewModel: model, isShowAppBar: true, - appBar: PatientSearchHeader(title: "ER Sign In",) - , + appBar: PatientSearchHeader( + title: "ER Sign In", + ), body: Center( child: Container( margin: EdgeInsets.only(top: SizeConfig.realScreenHeight / 7), @@ -58,10 +59,7 @@ class _ErSignInScreenState extends State { SizedBox( height: 7, ), - AppText(TranslationBase.of(context).scanERQrCode, - fontSize: 14, - fontWeight: FontWeight.w400, - textAlign: TextAlign.center), + AppText(TranslationBase.of(context).scanERQrCode, fontSize: 14, fontWeight: FontWeight.w400, textAlign: TextAlign.center), SizedBox( height: 15, ), @@ -95,29 +93,28 @@ class _ErSignInScreenState extends State { _scanQrAndGetPatient(BuildContext context, ERSignInViewModel model) async { var result = (await BarcodeScanner.scan()).rawContent; if (result != "") { - try{ + try { List listOfParams = result.split(','); int patientID = 0; - if (listOfParams[0].length != 0) - patientID = int.parse(listOfParams[0]); - showMyDialog(context:context, firstAction: (){ - signInERPatient(context: context, model: model, patientId: patientID, signInType: 1); - } , secondAction: (){ - signInERPatient(context: context, model: model, patientId: patientID, signInType: 2); - - } ); - }catch(e){ + if (listOfParams[0].length != 0) patientID = int.parse(listOfParams[0]); + showMyDialog( + context: context, + firstAction: () { + signInERPatient(context: context, model: model, patientId: patientID, signInType: 1); + }, + secondAction: () { + signInERPatient(context: context, model: model, patientId: patientID, signInType: 2); + }); + } catch (e) { Utils.showErrorToast("Please Enter Valid Code"); } - } } - - signInERPatient ({BuildContext context, ERSignInViewModel model, patientId, signInType}) async { + signInERPatient({BuildContext context, ERSignInViewModel model, patientId, signInType}) async { GifLoaderDialogUtils.showMyDialog(context); - await model.signInERPatient(patientId:patientId, signInType: signInType ); - if(model.state == ViewState.ErrorLocal) { + await model.signInERPatient(patientId: patientId, signInType: signInType); + if (model.state == ViewState.ErrorLocal) { Utils.showErrorToast(model.error); } else { /// TODO Elham* Create this in Utils @@ -125,103 +122,100 @@ class _ErSignInScreenState extends State { } GifLoaderDialogUtils.hideDialog(context); Navigator.of(context).pop(); - } /// TODO Elham* Make this as custom Dialog - showMyDialog({BuildContext context, Function firstAction,Function secondAction, }) { + showMyDialog({ + BuildContext context, + Function firstAction, + Function secondAction, + }) { showDialog( context: context, builder: (ctx) => Center( - child: Container( - width: MediaQuery.of(context).size.width * 0.8, - height: 250, - child: AppScaffold( - isShowAppBar: false, - body: Container( - color: Colors.white, - child: Center( - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - // SizedBox(height: 20,), - SizedBox( - height: 10, - ), - Row( + child: Container( + width: MediaQuery.of(context).size.width * 0.8, + height: 250, + child: AppScaffold( + isShowAppBar: false, + body: Container( + color: Colors.white, + child: Center( + child: Column( mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, children: [ - AppText( - "Select option", - fontWeight: FontWeight.w600, - color: Colors.black, - fontSize: 16, + // SizedBox(height: 20,), + SizedBox( + height: 10, + ), + Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + AppText( + "Select option", + fontWeight: FontWeight.w600, + color: Colors.black, + fontSize: 16, + ), + ], + ), + SizedBox( + height: 10, + ), + DividerWithSpacesAround(), + SizedBox( + height: 12, ), - ], - ), - SizedBox( - height: 10, - ), - DividerWithSpacesAround(), - SizedBox( - height: 12, - ), - Container( - padding: EdgeInsets.all(20), - color: Colors.white, - child: AppText( - projectViewModel.isArabic - ? "الرجاء اختيار الإجراء الذي تريد القيام به" - : 'Please choose the action you want to do ', - fontSize: 15, - textAlign: TextAlign.center, - ), - ), + Container( + padding: EdgeInsets.all(20), + color: Colors.white, + child: AppText( + projectViewModel.isArabic ? "الرجاء اختيار الإجراء الذي تريد القيام به" : 'Please choose the action you want to do ', + fontSize: 15, + textAlign: TextAlign.center, + ), + ), - SizedBox( - height: 8, + SizedBox( + height: 8, + ), + DividerWithSpacesAround(), + FractionallySizedBox( + widthFactor: 0.75, + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + ElevatedButton( + child: AppText( + "Sing In", + fontWeight: FontWeight.w600, + color: Colors.black, + fontSize: 16, + ), //Text("Cancel"), + onPressed: () async { + await firstAction(); + }), + ElevatedButton( + child: AppText( + "Sing Out", + fontWeight: FontWeight.w600, + color: Colors.black, + fontSize: 16, + ), //Text("Confirm", ), + onPressed: () async { + await secondAction(); + }) + ], + ), + ) + ], ), - DividerWithSpacesAround(), - FractionallySizedBox( - widthFactor: 0.75, - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - FlatButton( - child: AppText( - "Sing In", - fontWeight: FontWeight.w600, - color: Colors.black, - fontSize: 16, - ), //Text("Cancel"), - onPressed: () async { - await firstAction(); - - - }), - FlatButton( - child: AppText( - "Sing Out", - fontWeight: FontWeight.w600, - color: Colors.black, - fontSize: 16, - ), //Text("Confirm", ), - onPressed: () async { - await secondAction(); - }) - ], - ), - ) - ], + ), ), ), ), - ), - ), - )); + )); } - - } diff --git a/lib/screens/live_care/video_call.dart b/lib/screens/live_care/video_call.dart index d3851be0..146519c6 100644 --- a/lib/screens/live_care/video_call.dart +++ b/lib/screens/live_care/video_call.dart @@ -70,10 +70,7 @@ class _VideoCallPageState extends State { kApiKey: '46209962', vcId: widget.patientData.vcId, isRecording: tokenData != null ? tokenData.isRecording : false, - patientName: widget.patientData.fullName ?? - widget.patientData.firstName != null - ? "${widget.patientData.firstName} ${widget.patientData.lastName}" - : "-", + patientName: widget.patientData.fullName ?? widget.patientData.firstName != null ? "${widget.patientData.firstName} ${widget.patientData.lastName}" : "-", tokenID: token, //"hfkjshdf347r8743", generalId: "Cs2020@2016\$2958", @@ -105,8 +102,7 @@ class _VideoCallPageState extends State { }); connectOpenTok(result); - }).catchError((error) => - {Utils.showErrorToast(error), Navigator.of(context).pop()}); + }).catchError((error) => {Utils.showErrorToast(error), Navigator.of(context).pop()}); } @override @@ -134,20 +130,14 @@ class _VideoCallPageState extends State { ), Text( _start == 0 ? 'Dailing' : 'Connected', - style: TextStyle( - color: Colors.deepPurpleAccent, - fontWeight: FontWeight.w300, - fontSize: 15), + style: TextStyle(color: Colors.deepPurpleAccent, fontWeight: FontWeight.w300, fontSize: 15), ), SizedBox( height: MediaQuery.of(context).size.height * 0.02, ), Text( widget.patientData.fullName, - style: TextStyle( - color: Colors.deepPurpleAccent, - fontWeight: FontWeight.w900, - fontSize: 20), + style: TextStyle(color: Colors.deepPurpleAccent, fontWeight: FontWeight.w900, fontSize: 20), ), SizedBox( height: MediaQuery.of(context).size.height * 0.02, @@ -155,10 +145,7 @@ class _VideoCallPageState extends State { Container( child: Text( _start == 0 ? 'Connecting...' : _timmer.toString(), - style: TextStyle( - color: Colors.deepPurpleAccent, - fontWeight: FontWeight.w300, - fontSize: 15), + style: TextStyle(color: Colors.deepPurpleAccent, fontWeight: FontWeight.w300, fontSize: 15), )), SizedBox( height: MediaQuery.of(context).size.height * 0.02, @@ -205,22 +192,21 @@ class _VideoCallPageState extends State { _showAlert(BuildContext context) async { await showDialog( context: context, - builder: (dialogContex) => AlertDialog(content: StatefulBuilder( - builder: (BuildContext context, StateSetter setState) { + builder: (dialogContex) => AlertDialog(content: StatefulBuilder(builder: (BuildContext context, StateSetter setState) { return Container( height: MediaQuery.of(context).size.height * 0.7, width: MediaQuery.of(context).size.width * .9, child: Stack( fit: StackFit.loose, - overflow: Overflow.visible, + // overflow: Overflow.visible, + children: [ Positioned( right: -40.0, top: -40.0, child: InkResponse( onTap: () { - Navigator.of(context, rootNavigator: true) - .pop('dialog'); + Navigator.of(context, rootNavigator: true).pop('dialog'); Navigator.of(context).pop(); }, child: CircleAvatar( @@ -236,41 +222,41 @@ class _VideoCallPageState extends State { children: [ Padding( padding: EdgeInsets.all(8.0), - child: RaisedButton( - onPressed: () => {endCall()}, - child: - Text(TranslationBase.of(context).endcall), - color: Colors.red, - textColor: Colors.white, - )), + child: ElevatedButton( + onPressed: () => {endCall()}, + child: Text(TranslationBase.of(context).endcall), + style: ElevatedButton.styleFrom(backgroundColor: Colors.red, textStyle: TextStyle(color: Colors.white)) + + //color: Colors.red, + //textColor: Colors.white, + )), Padding( padding: EdgeInsets.all(8.0), - child: RaisedButton( - onPressed: () => {resumeCall()}, - child: - Text(TranslationBase.of(context).resumecall), - color: AppGlobal.appGreenColor, - textColor: Colors.white, - ), + child: ElevatedButton( + onPressed: () => {resumeCall()}, + child: Text(TranslationBase.of(context).resumecall), + style: ElevatedButton.styleFrom(backgroundColor: AppGlobal.appGreenColor, textStyle: TextStyle(color: Colors.white)) + + // color: AppGlobal.appGreenColor, + // textColor: Colors.white, + ), ), Padding( padding: EdgeInsets.all(8.0), - child: RaisedButton( - onPressed: () => {endCallWithCharge()}, - child: Text(TranslationBase.of(context) - .endcallwithcharge), - textColor: Colors.white, - ), + child: ElevatedButton( + onPressed: () => {endCallWithCharge()}, + child: Text(TranslationBase.of(context).endcallwithcharge), + style: ElevatedButton.styleFrom(textStyle: TextStyle(color: Colors.white))), ), Padding( padding: EdgeInsets.all(8.0), - child: RaisedButton( + child: ElevatedButton( onPressed: () => { setState(() => {isTransfer = true}) }, - child: Text( - TranslationBase.of(context).transfertoadmin), - color: Colors.yellow[900], + child: Text(TranslationBase.of(context).transfertoadmin), + style: ElevatedButton.styleFrom(textStyle: TextStyle(color: Colors.yellow[900])), + // color: Colors.yellow[900], ), ), isTransfer == true @@ -283,16 +269,13 @@ class _VideoCallPageState extends State { child: TextField( maxLines: 3, controller: notes, - decoration: InputDecoration.collapsed( - hintText: - "Enter your notes here"), + decoration: InputDecoration.collapsed(hintText: "Enter your notes here"), )), Center( - child: RaisedButton( - onPressed: () => - {this.transferToAdmin(notes)}, + child: ElevatedButton( + onPressed: () => {this.transferToAdmin(notes)}, child: Text('Transfer'), - color: Colors.yellow[900], + style: ElevatedButton.styleFrom(textStyle: TextStyle(color: Colors.yellow[900])), )) ], ) @@ -312,33 +295,24 @@ class _VideoCallPageState extends State { transferToAdmin(notes) { closeRoute(); - _liveCareProvider - .transfterToAdmin(widget.patientData, notes) - .then((result) { + _liveCareProvider.transfterToAdmin(widget.patientData, notes).then((result) { connectOpenTok(result); - }).catchError((error) => - {Utils.showErrorToast(error), Navigator.of(context).pop()}); + }).catchError((error) => {Utils.showErrorToast(error), Navigator.of(context).pop()}); } endCall() { closeRoute(); - _liveCareProvider - .endCall(widget.patientData, false, doctorprofile['DoctorID']) - .then((result) { + _liveCareProvider.endCall(widget.patientData, false, doctorprofile['DoctorID']).then((result) { print(result); - }).catchError((error) => - {Utils.showErrorToast(error), Navigator.of(context).pop()}); + }).catchError((error) => {Utils.showErrorToast(error), Navigator.of(context).pop()}); } endCallWithCharge() { - _liveCareProvider - .endCallWithCharge(widget.patientData.vcId, doctorprofile['DoctorID']) - .then((result) { + _liveCareProvider.endCallWithCharge(widget.patientData.vcId, doctorprofile['DoctorID']).then((result) { closeRoute(); print('end callwith charge'); print(result); - }).catchError((error) => - {Utils.showErrorToast(error), Navigator.of(context).pop()}); + }).catchError((error) => {Utils.showErrorToast(error), Navigator.of(context).pop()}); } closeRoute() { diff --git a/lib/screens/patients/profile/diabetic_chart/line_chart_for_diabetic.dart b/lib/screens/patients/profile/diabetic_chart/line_chart_for_diabetic.dart index 093a5f69..7f1755b1 100644 --- a/lib/screens/patients/profile/diabetic_chart/line_chart_for_diabetic.dart +++ b/lib/screens/patients/profile/diabetic_chart/line_chart_for_diabetic.dart @@ -10,8 +10,7 @@ class LineChartForDiabetic extends StatelessWidget { final int indexes; final bool isOX; - LineChartForDiabetic( - {this.title, this.timeSeries1, this.indexes, this.isOX = false}); + LineChartForDiabetic({this.title, this.timeSeries1, this.indexes, this.isOX = false}); List xAxixs = List(); List yAxixs = List(); @@ -52,8 +51,7 @@ class LineChartForDiabetic extends StatelessWidget { ), Expanded( child: Padding( - padding: - const EdgeInsets.only(right: 18.0, left: 16.0, top: 15), + padding: const EdgeInsets.only(right: 18.0, left: 16.0, top: 15), child: LineChart( sampleData1(context), swapAnimationDuration: const Duration(milliseconds: 250), @@ -84,11 +82,10 @@ class LineChartForDiabetic extends StatelessWidget { touchTooltipData: LineTouchTooltipData( tooltipBgColor: Colors.white, ), - touchCallback: (LineTouchResponse touchResponse) {}, + //touchCallback: (LineTouchResponse touchResponse) {}, handleBuiltInTouches: true, ), - gridData: FlGridData( - show: true, drawVerticalLine: true, drawHorizontalLine: true), + gridData: FlGridData(show: true, drawVerticalLine: true, drawHorizontalLine: true), titlesData: FlTitlesData( bottomTitles: SideTitles( showTitles: true, @@ -109,10 +106,8 @@ class LineChartForDiabetic extends StatelessWidget { } else return ''; } else { - if (value.toInt() == 0) - return '${timeSeries1[value.toInt()].time.month}/ ${timeSeries1[value.toInt()].time.year}'; - if (value.toInt() == timeSeries1.length - 1) - return '${timeSeries1[value.toInt()].time.month}/ ${timeSeries1[value.toInt()].time.year}'; + if (value.toInt() == 0) return '${timeSeries1[value.toInt()].time.month}/ ${timeSeries1[value.toInt()].time.year}'; + if (value.toInt() == timeSeries1.length - 1) return '${timeSeries1[value.toInt()].time.month}/ ${timeSeries1[value.toInt()].time.year}'; if (xAxixs.contains(value.toInt())) { return '${timeSeries1[value.toInt()].time.month}/ ${timeSeries1[value.toInt()].time.year}'; } diff --git a/lib/screens/patients/profile/lab_result/history/line_chart_curved_lab_history.dart b/lib/screens/patients/profile/lab_result/history/line_chart_curved_lab_history.dart index e07990b9..f23f973a 100644 --- a/lib/screens/patients/profile/lab_result/history/line_chart_curved_lab_history.dart +++ b/lib/screens/patients/profile/lab_result/history/line_chart_curved_lab_history.dart @@ -90,11 +90,10 @@ class LineChartCurvedLabHistoryState extends State { touchTooltipData: LineTouchTooltipData( tooltipBgColor: Colors.white, ), - touchCallback: (LineTouchResponse touchResponse) {}, + // touchCallback: (LineTouchResponse touchResponse) {}, handleBuiltInTouches: true, ), - gridData: FlGridData( - show: true, drawVerticalLine: true, drawHorizontalLine: true), + gridData: FlGridData(show: true, drawVerticalLine: true, drawHorizontalLine: true), titlesData: FlTitlesData( bottomTitles: SideTitles( showTitles: true, @@ -108,8 +107,7 @@ class LineChartCurvedLabHistoryState extends State { rotateAngle: -65, getTitles: (value) { print(value); - DateTime date = AppDateUtils.convertStringToDate( - widget.labResultHistory[value.toInt()].verifiedOnDateTime); + DateTime date = AppDateUtils.convertStringToDate(widget.labResultHistory[value.toInt()].verifiedOnDateTime); if (widget.labResultHistory.length < 8) { if (widget.labResultHistory.length > value.toInt()) { return '${date.day}/ ${date.year}'; @@ -117,8 +115,7 @@ class LineChartCurvedLabHistoryState extends State { return ''; } else { if (value.toInt() == 0) return '${date.day}/ ${date.year}'; - if (value.toInt() == widget.labResultHistory.length - 1) - return '${date.day}/ ${date.year}'; + if (value.toInt() == widget.labResultHistory.length - 1) return '${date.day}/ ${date.year}'; if (xAxixs.contains(value.toInt())) { return '${date.day}/ ${date.year}'; } @@ -203,8 +200,7 @@ class LineChartCurvedLabHistoryState extends State { List spots = List(); for (int index = 0; index < widget.labResultHistory.length; index++) { try { - var resultValueDouble = - double.parse(widget.labResultHistory[index].resultValue); + var resultValueDouble = double.parse(widget.labResultHistory[index].resultValue); spots.add(FlSpot(index.toDouble(), resultValueDouble)); } catch (e) { print(e); diff --git a/lib/screens/patients/profile/notes/note/progress_note_screen.dart b/lib/screens/patients/profile/notes/note/progress_note_screen.dart index 19882b9c..a32a8791 100644 --- a/lib/screens/patients/profile/notes/note/progress_note_screen.dart +++ b/lib/screens/patients/profile/notes/note/progress_note_screen.dart @@ -45,8 +45,7 @@ class _ProgressNoteState extends State { AuthenticationViewModel authenticationViewModel; ProjectViewModel projectViewModel; - getProgressNoteList(BuildContext context, PatientViewModel model, - {bool isLocalBusy = false}) async { + getProgressNoteList(BuildContext context, PatientViewModel model, {bool isLocalBusy = false}) async { final routeArgs = ModalRoute.of(context).settings.arguments as Map; PatiantInformtion patient = routeArgs['patient']; String token = await sharedPref.getString(TOKEN); @@ -61,10 +60,7 @@ class _ProgressNoteState extends State { tokenID: token, patientTypeID: patient.patientType, languageID: 2); - model - .getPatientProgressNote(progressNoteRequest.toJson(), - isLocalBusy: isLocalBusy) - .then((c) { + model.getPatientProgressNote(progressNoteRequest.toJson(), isLocalBusy: isLocalBusy).then((c) { notesList = model.patientProgressNoteList; }); } @@ -76,8 +72,7 @@ class _ProgressNoteState extends State { final routeArgs = ModalRoute.of(context).settings.arguments as Map; PatiantInformtion patient = routeArgs['patient']; String arrivalType = routeArgs['arrivalType']; - if (routeArgs.containsKey('isDischargedPatient')) - isDischargedPatient = routeArgs['isDischargedPatient']; + if (routeArgs.containsKey('isDischargedPatient')) isDischargedPatient = routeArgs['isDischargedPatient']; return BaseView( onModelReady: (model) => getProgressNoteList(context, model), builder: (_, model, w) => AppScaffold( @@ -88,511 +83,338 @@ class _ProgressNoteState extends State { patient, isInpatient: true, ), - body: Container( - color: Colors.grey[200], - child: Column( - children: [ - if (!isDischargedPatient) - AddNewOrder( - onTap: () async { - await locator().logEvent( - eventCategory: "Progress Note Screen", - eventAction: "Update Progress Note", - ); - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => UpdateNoteOrder( - patientModel: model, - patient: patient, - visitType: widget.visitType, - isUpdate: false, - ), - settings: RouteSettings(name: 'UpdateNoteOrder'), - ), - ); - }, - label: widget.visitType == 3 - ? TranslationBase.of(context).addNewOrderSheet - : TranslationBase.of(context).addProgressNote, + body: Container( + color: Colors.grey[200], + child: Column( + children: [ + if (!isDischargedPatient) + AddNewOrder( + onTap: () async { + await locator().logEvent( + eventCategory: "Progress Note Screen", + eventAction: "Update Progress Note", + ); + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => UpdateNoteOrder( + patientModel: model, + patient: patient, + visitType: widget.visitType, + isUpdate: false, + ), + settings: RouteSettings(name: 'UpdateNoteOrder'), ), - Expanded( - child: Container( - child: ListView.builder( - itemCount: model.patientProgressNoteList.length, - itemBuilder: (BuildContext ctxt, int index) { - return FractionallySizedBox( - widthFactor: 0.95, - child: CardWithBgWidget( - hasBorder: false, - bgColor: model.patientProgressNoteList[index] - .status == - 1 && - authenticationViewModel - .doctorProfile.doctorID != - model - .patientProgressNoteList[ - index] - .createdBy - ? Color(0xFFCC9B14) - : model.patientProgressNoteList[index] - .status == - 4 - ? Colors.red.shade700 - : model.patientProgressNoteList[index] - .status == - 2 - ? AppGlobal.appGreenColor - : Color(0xFFCC9B14), - widget: Column( - children: [ - Column( - crossAxisAlignment: - CrossAxisAlignment.start, + ); + }, + label: widget.visitType == 3 ? TranslationBase.of(context).addNewOrderSheet : TranslationBase.of(context).addProgressNote, + ), + Expanded( + child: Container( + child: ListView.builder( + itemCount: model.patientProgressNoteList.length, + itemBuilder: (BuildContext ctxt, int index) { + return FractionallySizedBox( + widthFactor: 0.95, + child: CardWithBgWidget( + hasBorder: false, + bgColor: model.patientProgressNoteList[index].status == 1 && authenticationViewModel.doctorProfile.doctorID != model.patientProgressNoteList[index].createdBy + ? Color(0xFFCC9B14) + : model.patientProgressNoteList[index].status == 4 + ? Colors.red.shade700 + : model.patientProgressNoteList[index].status == 2 + ? AppGlobal.appGreenColor + : Color(0xFFCC9B14), + widget: Column( + children: [ + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + if (model.patientProgressNoteList[index].status == 1 && authenticationViewModel.doctorProfile.doctorID != model.patientProgressNoteList[index].createdBy) + AppText( + TranslationBase.of(context).notePending, + fontWeight: FontWeight.bold, + color: Color(0xFFCC9B14), + fontSize: 12, + ), + if (model.patientProgressNoteList[index].status == 4) + AppText( + TranslationBase.of(context).noteCanceled, + fontWeight: FontWeight.bold, + color: Colors.red.shade700, + fontSize: 12, + ), + if (model.patientProgressNoteList[index].status == 2) + AppText( + TranslationBase.of(context).noteVerified, + fontWeight: FontWeight.bold, + color: AppGlobal.appGreenColor, + fontSize: 12, + ), + if (model.patientProgressNoteList[index].status != 2 && + model.patientProgressNoteList[index].status != 4 && + authenticationViewModel.doctorProfile.doctorID == model.patientProgressNoteList[index].createdBy) + Row( + crossAxisAlignment: CrossAxisAlignment.start, children: [ - if (model - .patientProgressNoteList[ - index] - .status == - 1 && - authenticationViewModel - .doctorProfile.doctorID != - model - .patientProgressNoteList[ - index] - .createdBy) - AppText( - TranslationBase.of(context) - .notePending, - fontWeight: FontWeight.bold, - color: Color(0xFFCC9B14), - fontSize: 12, - ), - if (model - .patientProgressNoteList[ - index] - .status == - 4) - AppText( - TranslationBase.of(context) - .noteCanceled, - fontWeight: FontWeight.bold, - color: Colors.red.shade700, - fontSize: 12, - ), - if (model - .patientProgressNoteList[ - index] - .status == - 2) - AppText( - TranslationBase.of(context) - .noteVerified, - fontWeight: FontWeight.bold, - color: AppGlobal.appGreenColor, - fontSize: 12, - ), - if (model.patientProgressNoteList[index].status != 2 && - model - .patientProgressNoteList[ - index] - .status != - 4 && - authenticationViewModel - .doctorProfile.doctorID == - model - .patientProgressNoteList[ - index] - .createdBy) - Row( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - InkWell( - onTap: () { - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => - UpdateNoteOrder( - note: model - .patientProgressNoteList[ - index], - patientModel: - model, - patient: - patient, - visitType: widget - .visitType, - isUpdate: true, - )), - ); - }, - child: Container( - decoration: BoxDecoration( - color: Colors.grey[600], - borderRadius: - BorderRadius.circular( - 10), - ), - // color:Colors.red[600], + InkWell( + onTap: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => UpdateNoteOrder( + note: model.patientProgressNoteList[index], + patientModel: model, + patient: patient, + visitType: widget.visitType, + isUpdate: true, + )), + ); + }, + child: Container( + decoration: BoxDecoration( + color: Colors.grey[600], + borderRadius: BorderRadius.circular(10), + ), + // color:Colors.red[600], - child: Row( - children: [ - Icon( - DoctorApp.edit_1, - size: 12, - color: Colors.white, - ), - SizedBox( - width: 2, - ), - AppText( - TranslationBase.of( - context) - .update, - fontSize: 10, - color: Colors.white, - ), - ], - ), - padding: EdgeInsets.all(6), + child: Row( + children: [ + Icon( + DoctorApp.edit_1, + size: 12, + color: Colors.white, ), - ), - SizedBox( - width: 10, - ), - InkWell( - onTap: () async { - showMyDialog( - context: context, - actionName: "verify", - confirmFun: () async { - GifLoaderDialogUtils - .showMyDialog( - context); - UpdateNoteReqModel - reqModel = - UpdateNoteReqModel( - admissionNo: int - .parse(patient - .admissionNo), - cancelledNote: - false, - lineItemNo: model - .patientProgressNoteList[ - index] - .lineItemNo, - conditionId: model - .patientProgressNoteList[ - index].condition, - createdBy: model - .patientProgressNoteList[ - index] - .createdBy, - notes: model - .patientProgressNoteList[ - index] - .notes, - verifiedNote: true, - patientTypeID: - patient - .patientType, - patientOutSA: false, - ); - await model - .updatePatientProgressNote( - reqModel); - await getProgressNoteList( - context, model, - isLocalBusy: - true); - GifLoaderDialogUtils - .hideDialog( - context); - }); - }, - child: Container( - decoration: BoxDecoration( - color: AppGlobal - .appGreenColor, - borderRadius: - BorderRadius.circular( - 10), - ), - // color:Colors.red[600], - - child: Row( - children: [ - Icon( - FontAwesomeIcons - .check, - size: 12, - color: Colors.white, - ), - SizedBox( - width: 2, - ), - AppText( - TranslationBase.of( - context) - .noteVerify, - fontSize: 10, - color: Colors.white, - ), - ], - ), - padding: EdgeInsets.all(6), + SizedBox( + width: 2, ), - ), - SizedBox( - width: 10, - ), - InkWell( - onTap: () async { - showMyDialog( - context: context, - actionName: - TranslationBase.of( - context) - .cancel, - confirmFun: () async { - GifLoaderDialogUtils - .showMyDialog( - context, - ); - UpdateNoteReqModel - reqModel = - UpdateNoteReqModel( - admissionNo: int - .parse(patient - .admissionNo), - conditionId: model - .patientProgressNoteList[ - index].condition, - cancelledNote: true, - lineItemNo: model - .patientProgressNoteList[ - index] - .lineItemNo, - createdBy: model - .patientProgressNoteList[ - index] - .createdBy, - notes: model - .patientProgressNoteList[ - index] - .notes, - verifiedNote: false, - patientTypeID: - patient - .patientType, - patientOutSA: false, - ); - await model - .updatePatientProgressNote( - reqModel); - await getProgressNoteList( - context, model, - isLocalBusy: - true); - GifLoaderDialogUtils - .hideDialog( - context); - }); - }, - child: Container( - decoration: BoxDecoration( - color: Colors.red[600], - borderRadius: - BorderRadius.circular( - 10), - ), - // color:Colors.red[600], - - child: Row( - children: [ - Icon( - FontAwesomeIcons - .trash, - size: 12, - color: Colors.white, - ), - SizedBox( - width: 2, - ), - AppText( - 'Cancel', - fontSize: 10, - color: Colors.white, - ), - ], - ), - padding: EdgeInsets.all(6), + AppText( + TranslationBase.of(context).update, + fontSize: 10, + color: Colors.white, ), - ), - SizedBox( - width: 10, - ) - ], + ], + ), + padding: EdgeInsets.all(6), ), + ), SizedBox( - height: 10, + width: 10, ), - Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Container( - width: MediaQuery.of(context) - .size - .width * - 0.60, - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Row( - crossAxisAlignment: - CrossAxisAlignment - .start, - children: [ - AppText( - TranslationBase.of( - context) - .createdBy + ' ', - fontSize: 10, - ), - Expanded( - child: AppText( - model - .patientProgressNoteList[ - index] - .doctorName ?? - '', - fontWeight: - FontWeight.w600, - fontSize: 12, - isCopyable: true, - ), - ), - ], - ), - Row( - crossAxisAlignment: - CrossAxisAlignment - .start, - children: [ - AppText( - TranslationBase.of(context).conditionDescription + ' : ', - fontSize: 10, - ), - Expanded( - child: AppText( - model.patientProgressNoteList[index].conditionDescription ?? '', - fontWeight: - FontWeight.w600, - fontSize: 12, - isCopyable: true, - ), - ), - ], - ), - ], - ), + InkWell( + onTap: () async { + showMyDialog( + context: context, + actionName: "verify", + confirmFun: () async { + GifLoaderDialogUtils.showMyDialog(context); + UpdateNoteReqModel reqModel = UpdateNoteReqModel( + admissionNo: int.parse(patient.admissionNo), + cancelledNote: false, + lineItemNo: model.patientProgressNoteList[index].lineItemNo, + conditionId: model.patientProgressNoteList[index].condition, + createdBy: model.patientProgressNoteList[index].createdBy, + notes: model.patientProgressNoteList[index].notes, + verifiedNote: true, + patientTypeID: patient.patientType, + patientOutSA: false, + ); + await model.updatePatientProgressNote(reqModel); + await getProgressNoteList(context, model, isLocalBusy: true); + GifLoaderDialogUtils.hideDialog(context); + }); + }, + child: Container( + decoration: BoxDecoration( + color: AppGlobal.appGreenColor, + borderRadius: BorderRadius.circular(10), ), - Column( + // color:Colors.red[600], + + child: Row( children: [ - AppText( - model - .patientProgressNoteList[ - index] - .createdOn != - null - ? AppDateUtils.getDayMonthYearDateFormatted( - AppDateUtils - .getDateTimeFromServerFormat(model - .patientProgressNoteList[ - index] - .createdOn), - isArabic: - projectViewModel - .isArabic, - isMonthShort: true) - : AppDateUtils - .getDayMonthYearDateFormatted( - DateTime.now(), - isArabic: - projectViewModel - .isArabic), - fontWeight: FontWeight.w600, - fontSize: 14, - isCopyable: true, + Icon( + FontAwesomeIcons.check, + size: 12, + color: Colors.white, + ), + SizedBox( + width: 2, ), AppText( - model - .patientProgressNoteList[ - index] - .createdOn != - null - ? AppDateUtils.getHour( - AppDateUtils - .getDateTimeFromServerFormat(model - .patientProgressNoteList[ - index] - .createdOn)) - : AppDateUtils.getHour( - DateTime.now()), - fontWeight: FontWeight.w600, - fontSize: 14, - isCopyable: true, + TranslationBase.of(context).noteVerify, + fontSize: 10, + color: Colors.white, ), ], - crossAxisAlignment: - CrossAxisAlignment.end, - ) - ], + ), + padding: EdgeInsets.all(6), + ), ), SizedBox( - height: 8, + width: 10, ), - Row( - mainAxisAlignment: - MainAxisAlignment.start, - children: [ - Expanded( - child: AppText( - model - .patientProgressNoteList[ - index] - .notes, + InkWell( + onTap: () async { + showMyDialog( + context: context, + actionName: TranslationBase.of(context).cancel, + confirmFun: () async { + GifLoaderDialogUtils.showMyDialog( + context, + ); + UpdateNoteReqModel reqModel = UpdateNoteReqModel( + admissionNo: int.parse(patient.admissionNo), + conditionId: model.patientProgressNoteList[index].condition, + cancelledNote: true, + lineItemNo: model.patientProgressNoteList[index].lineItemNo, + createdBy: model.patientProgressNoteList[index].createdBy, + notes: model.patientProgressNoteList[index].notes, + verifiedNote: false, + patientTypeID: patient.patientType, + patientOutSA: false, + ); + await model.updatePatientProgressNote(reqModel); + await getProgressNoteList(context, model, isLocalBusy: true); + GifLoaderDialogUtils.hideDialog(context); + }); + }, + child: Container( + decoration: BoxDecoration( + color: Colors.red[600], + borderRadius: BorderRadius.circular(10), + ), + // color:Colors.red[600], + + child: Row( + children: [ + Icon( + FontAwesomeIcons.trash, + size: 12, + color: Colors.white, + ), + SizedBox( + width: 2, + ), + AppText( + 'Cancel', fontSize: 10, - isCopyable: true, + color: Colors.white, ), - ), - ]) + ], + ), + padding: EdgeInsets.all(6), + ), + ), + SizedBox( + width: 10, + ) ], ), - SizedBox( - height: 20, + SizedBox( + height: 10, + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + width: MediaQuery.of(context).size.width * 0.60, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context).createdBy + ' ', + fontSize: 10, + ), + Expanded( + child: AppText( + model.patientProgressNoteList[index].doctorName ?? '', + fontWeight: FontWeight.w600, + fontSize: 12, + isCopyable: true, + ), + ), + ], + ), + Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context).conditionDescription + ' : ', + fontSize: 10, + ), + Expanded( + child: AppText( + model.patientProgressNoteList[index].conditionDescription ?? '', + fontWeight: FontWeight.w600, + fontSize: 12, + isCopyable: true, + ), + ), + ], + ), + ], + ), + ), + Column( + children: [ + AppText( + model.patientProgressNoteList[index].createdOn != null + ? AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat(model.patientProgressNoteList[index].createdOn), + isArabic: projectViewModel.isArabic, isMonthShort: true) + : AppDateUtils.getDayMonthYearDateFormatted(DateTime.now(), isArabic: projectViewModel.isArabic), + fontWeight: FontWeight.w600, + fontSize: 14, + isCopyable: true, + ), + AppText( + model.patientProgressNoteList[index].createdOn != null + ? AppDateUtils.getHour(AppDateUtils.getDateTimeFromServerFormat(model.patientProgressNoteList[index].createdOn)) + : AppDateUtils.getHour(DateTime.now()), + fontWeight: FontWeight.w600, + fontSize: 14, + isCopyable: true, + ), + ], + crossAxisAlignment: CrossAxisAlignment.end, + ) + ], + ), + SizedBox( + height: 8, + ), + Row(mainAxisAlignment: MainAxisAlignment.start, children: [ + Expanded( + child: AppText( + model.patientProgressNoteList[index].notes, + fontSize: 10, + isCopyable: true, + ), ), - ], - ), + ]) + ], ), - ); - }), - ), - ), - ], + SizedBox( + height: 20, + ), + ], + ), + ), + ); + }), ), ), + ], + ), + ), ), ); } - /// TODO Elham* Make this as custom Dialog showMyDialog({BuildContext context, Function confirmFun, String actionName}) { showDialog( @@ -637,9 +459,7 @@ class _ProgressNoteState extends State { padding: EdgeInsets.all(20), color: Colors.white, child: AppText( - projectViewModel.isArabic - ? "هل أنت متأكد أنك تريد تنفيذ $actionName هذا الأمر؟" - : 'Are you sure you want $actionName this order?', + projectViewModel.isArabic ? "هل أنت متأكد أنك تريد تنفيذ $actionName هذا الأمر؟" : 'Are you sure you want $actionName this order?', fontSize: 15, textAlign: TextAlign.center, ), @@ -654,7 +474,7 @@ class _ProgressNoteState extends State { child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - FlatButton( + ElevatedButton( child: AppText( TranslationBase.of(context).cancel, fontWeight: FontWeight.w600, @@ -664,7 +484,7 @@ class _ProgressNoteState extends State { onPressed: () { Navigator.of(context).pop(); }), - FlatButton( + ElevatedButton( child: AppText( TranslationBase.of(context).noteConfirm, fontWeight: FontWeight.w600, diff --git a/lib/screens/patients/profile/vital_sign/line_chart_curved.dart b/lib/screens/patients/profile/vital_sign/line_chart_curved.dart index ae102b88..c97c6041 100644 --- a/lib/screens/patients/profile/vital_sign/line_chart_curved.dart +++ b/lib/screens/patients/profile/vital_sign/line_chart_curved.dart @@ -96,18 +96,16 @@ class LineChartCurved extends StatelessWidget { } } - LineChartData sampleData1(context) { return LineChartData( lineTouchData: LineTouchData( touchTooltipData: LineTouchTooltipData( tooltipBgColor: Colors.white, ), - touchCallback: (LineTouchResponse touchResponse) {}, + //touchCallback: (LineTouchResponse touchResponse) {}, handleBuiltInTouches: true, ), - gridData: FlGridData( - show: true, drawVerticalLine: true, drawHorizontalLine: true), + gridData: FlGridData(show: true, drawVerticalLine: true, drawHorizontalLine: true), titlesData: FlTitlesData( bottomTitles: SideTitles( showTitles: true, @@ -133,9 +131,7 @@ class LineChartCurved extends StatelessWidget { return ''; } } else { - if (value.toInt() == 0 || - value.toInt() == timeSeries.length - 1 || - xAxixs.contains(value.toInt())) { + if (value.toInt() == 0 || value.toInt() == timeSeries.length - 1 || xAxixs.contains(value.toInt())) { DateTime dateTime = timeSeries[value.toInt()].time; if (isDatesSameYear) { return monthFormat.format(dateTime); @@ -163,25 +159,25 @@ class LineChartCurved extends StatelessWidget { return ''; }, ), - leftTitles: SideTitles( - showTitles: true, - getTextStyles: (cxt, value) => const TextStyle( - color: Colors.black, - fontWeight: FontWeight.bold, - fontSize: 10, - ), - interval:getInterval(), - - // getTitles: (value) { - // if (value.toInt() == 0) - // return '${value.toInt()}'; - // else if (value.toInt() % horizontalInterval == 0) - // return '${value.toInt()}'; - // else - // return ''; - // }, - margin: 12, + leftTitles: SideTitles( + showTitles: true, + getTextStyles: (cxt, value) => const TextStyle( + color: Colors.black, + fontWeight: FontWeight.bold, + fontSize: 10, ), + interval: getInterval(), + + // getTitles: (value) { + // if (value.toInt() == 0) + // return '${value.toInt()}'; + // else if (value.toInt() % horizontalInterval == 0) + // return '${value.toInt()}'; + // else + // return ''; + // }, + margin: 12, + ), ), borderData: FlBorderData( show: true, @@ -230,15 +226,12 @@ class LineChartCurved extends StatelessWidget { // return value.toDouble(); // } - - double getInterval(){ - + double getInterval() { return getMaxY() - getMinY() <= 100 ? 20 : getMaxY() - getMinY() <= 1000 - ? 100 - : 200; - + ? 100 + : 200; } double getMaxY() { @@ -268,9 +261,7 @@ class LineChartCurved extends StatelessWidget { int previousDateYear = 0; for (int index = 0; index < timeSeries.length; index++) { spots.add(FlSpot(index.toDouble(), timeSeries[index].sales)); - if (isDatesSameYear == false || - (previousDateYear != 0 && - previousDateYear != timeSeries[index].time.year)) { + if (isDatesSameYear == false || (previousDateYear != 0 && previousDateYear != timeSeries[index].time.year)) { isDatesSameYear = false; } previousDateYear = timeSeries[index].time.year; diff --git a/lib/screens/patients/profile/vital_sign/line_chart_curved_blood_pressure.dart b/lib/screens/patients/profile/vital_sign/line_chart_curved_blood_pressure.dart index f4def5ee..ba983005 100644 --- a/lib/screens/patients/profile/vital_sign/line_chart_curved_blood_pressure.dart +++ b/lib/screens/patients/profile/vital_sign/line_chart_curved_blood_pressure.dart @@ -12,12 +12,7 @@ class LineChartCurvedBloodPressure extends StatelessWidget { final int indexes; final bool isOX; - LineChartCurvedBloodPressure( - {this.title, - this.timeSeries1, - this.indexes, - this.timeSeries2, - this.isOX = false}); + LineChartCurvedBloodPressure({this.title, this.timeSeries1, this.indexes, this.timeSeries2, this.isOX = false}); List xAxixs = List(); List yAxixs = List(); @@ -58,8 +53,7 @@ class LineChartCurvedBloodPressure extends StatelessWidget { ), Expanded( child: Padding( - padding: - const EdgeInsets.only(right: 18.0, left: 16.0, top: 15), + padding: const EdgeInsets.only(right: 18.0, left: 16.0, top: 15), child: LineChart( sampleData1(context), swapAnimationDuration: const Duration(milliseconds: 250), @@ -78,15 +72,12 @@ class LineChartCurvedBloodPressure extends StatelessWidget { Container( width: 20, height: 20, - decoration: BoxDecoration( - shape: BoxShape.rectangle, - color: Theme.of(context).primaryColor), + decoration: BoxDecoration(shape: BoxShape.rectangle, color: Theme.of(context).primaryColor), ), SizedBox( width: 5, ), - AppText( - isOX ? "SAO2" : TranslationBase.of(context).systolicLng) + AppText(isOX ? "SAO2" : TranslationBase.of(context).systolicLng) ], ), SizedBox( @@ -97,8 +88,7 @@ class LineChartCurvedBloodPressure extends StatelessWidget { Container( width: 20, height: 20, - decoration: BoxDecoration( - shape: BoxShape.rectangle, color: Colors.red), + decoration: BoxDecoration(shape: BoxShape.rectangle, color: Colors.red), ), SizedBox( width: 5, @@ -131,11 +121,10 @@ class LineChartCurvedBloodPressure extends StatelessWidget { touchTooltipData: LineTouchTooltipData( tooltipBgColor: Colors.white, ), - touchCallback: (LineTouchResponse touchResponse) {}, + // touchCallback: (LineTouchResponse touchResponse) {}, handleBuiltInTouches: true, ), - gridData: FlGridData( - show: true, drawVerticalLine: true, drawHorizontalLine: true), + gridData: FlGridData(show: true, drawVerticalLine: true, drawHorizontalLine: true), titlesData: FlTitlesData( bottomTitles: SideTitles( showTitles: true, @@ -155,10 +144,8 @@ class LineChartCurvedBloodPressure extends StatelessWidget { } else return ''; } else { - if (value.toInt() == 0) - return '${timeSeries1[value.toInt()].time.month}/ ${timeSeries1[value.toInt()].time.year}'; - if (value.toInt() == timeSeries1.length - 1) - return '${timeSeries1[value.toInt()].time.month}/ ${timeSeries1[value.toInt()].time.year}'; + if (value.toInt() == 0) return '${timeSeries1[value.toInt()].time.month}/ ${timeSeries1[value.toInt()].time.year}'; + if (value.toInt() == timeSeries1.length - 1) return '${timeSeries1[value.toInt()].time.month}/ ${timeSeries1[value.toInt()].time.year}'; if (xAxixs.contains(value.toInt())) { return '${timeSeries1[value.toInt()].time.month}/ ${timeSeries1[value.toInt()].time.year}'; } @@ -173,7 +160,7 @@ class LineChartCurvedBloodPressure extends StatelessWidget { fontWeight: FontWeight.bold, fontSize: 10, ), - interval:getInterval(), + interval: getInterval(), getTitles: (value) { return '${value.toInt()}'; }, @@ -200,24 +187,20 @@ class LineChartCurvedBloodPressure extends StatelessWidget { ), minX: 0, maxX: 0, - maxY: getMaxY() + getInterval(), + maxY: getMaxY() + getInterval(), minY: 0, lineBarsData: getData(context), ); } - double getInterval(){ - + double getInterval() { return getMaxY() - getMinY() <= 100 ? 20 : getMaxY() - getMinY() <= 1000 - ? 100 - : 200; - + ? 100 + : 200; } - - double getMaxY() { double max = 0; timeSeries1.forEach((element) { diff --git a/lib/screens/reschedule_leaves/reschedule_leave.dart b/lib/screens/reschedule_leaves/reschedule_leave.dart index 3ebf5b97..35de7fe7 100644 --- a/lib/screens/reschedule_leaves/reschedule_leave.dart +++ b/lib/screens/reschedule_leaves/reschedule_leave.dart @@ -56,12 +56,8 @@ class _RescheduleLeaveScreen extends State { void _presentDatePicker(id) { var date = new DateTime.now(); - var initialDate = id == 'fromDate' - ? new DateTime(date.year, date.month, date.day + 15) - : new DateTime(fromDate.year, fromDate.month, fromDate.day); - var firstDate = id == 'fromDate' - ? new DateTime(date.year, date.month, date.day + 15) - : new DateTime(fromDate.year, fromDate.month, fromDate.day); + var initialDate = id == 'fromDate' ? new DateTime(date.year, date.month, date.day + 15) : new DateTime(fromDate.year, fromDate.month, fromDate.day); + var firstDate = id == 'fromDate' ? new DateTime(date.year, date.month, date.day + 15) : new DateTime(fromDate.year, fromDate.month, fromDate.day); showDatePicker( context: context, initialDate: initialDate, @@ -94,9 +90,7 @@ class _RescheduleLeaveScreen extends State { @override Widget build(BuildContext context) { projectsProvider = Provider.of(context); - offTime = widget.updateData != null - ? widget.updateData.requisitionType.toString() - : offTime; + offTime = widget.updateData != null ? widget.updateData.requisitionType.toString() : offTime; return BaseView( onModelReady: (model) => model.getClinicsList(), builder: (_, model, w) => BaseView( @@ -126,23 +120,13 @@ class _RescheduleLeaveScreen extends State { children: [ Container( margin: EdgeInsets.all(8), - decoration: BoxDecoration( - borderRadius: BorderRadius.all( - Radius.circular(6.0)), - border: Border.all( - width: 1.0, - color: HexColor("#CCCCCC"))), + decoration: BoxDecoration(borderRadius: BorderRadius.all(Radius.circular(6.0)), border: Border.all(width: 1.0, color: HexColor("#CCCCCC"))), width: double.infinity, child: Padding( padding: EdgeInsets.only( - top: SizeConfig.widthMultiplier * 0.9, - bottom: - SizeConfig.widthMultiplier * 0.9, - right: SizeConfig.widthMultiplier * 3, - left: SizeConfig.widthMultiplier * 3), + top: SizeConfig.widthMultiplier * 0.9, bottom: SizeConfig.widthMultiplier * 0.9, right: SizeConfig.widthMultiplier * 3, left: SizeConfig.widthMultiplier * 3), child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, children: [ Row( mainAxisSize: MainAxisSize.max, @@ -150,35 +134,22 @@ class _RescheduleLeaveScreen extends State { model2.allOffTime.length > 0 ? Expanded( // add Expanded to have your dropdown button fill remaining space - child: - DropdownButtonHideUnderline( - child: - DropdownButton( + child: DropdownButtonHideUnderline( + child: DropdownButton( // focusColor: Colors.grey, isExpanded: true, - value: offTime == null - ? model2.allOffTime[0] - ['code'] - : offTime, + value: offTime == null ? model2.allOffTime[0]['code'] : offTime, iconSize: 40, elevation: 16, - selectedItemBuilder: - (BuildContext - context) { - return model2.allOffTime - .map((item) { + selectedItemBuilder: (BuildContext context) { + return model2.allOffTime.map((item) { return Row( - mainAxisSize: - MainAxisSize - .max, + mainAxisSize: MainAxisSize.max, children: [ AppText( - item[ - 'description'], + item['description'], - fontSize: SizeConfig - .textMultiplier * - 2.1, + fontSize: SizeConfig.textMultiplier * 2.1, // color: // Colors.grey, ), @@ -192,29 +163,21 @@ class _RescheduleLeaveScreen extends State { }); if (offTime == '1') { model2.getReasons(18); - } else if (offTime == - '2') { + } else if (offTime == '2') { model2.getReasons(19); - } else if (offTime == - '3' || - offTime == '5') { - model2 - .getReasons(102); + } else if (offTime == '3' || offTime == '5') { + model2.getReasons(102); setState(() { offTime = newValue; }); } }, - items: model2.allOffTime - .map((item) { - return DropdownMenuItem< - String>( - value: item['code'] - .toString(), + items: model2.allOffTime.map((item) { + return DropdownMenuItem( + value: item['code'].toString(), child: Text( item['description'], - textAlign: - TextAlign.end, + textAlign: TextAlign.end, ), ); }).toList(), @@ -231,38 +194,23 @@ class _RescheduleLeaveScreen extends State { children: [ Container( margin: EdgeInsets.all(8), - decoration: BoxDecoration( - borderRadius: BorderRadius.all( - Radius.circular(6.0)), - border: Border.all( - width: 1.0, - color: - HexColor("#CCCCCC"))), + decoration: BoxDecoration(borderRadius: BorderRadius.all(Radius.circular(6.0)), border: Border.all(width: 1.0, color: HexColor("#CCCCCC"))), padding: EdgeInsets.all(5), child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, children: [ AppTextFormField( - hintText: TranslationBase.of( - context) - .fromDate, + hintText: TranslationBase.of(context).fromDate, borderColor: Colors.white, - prefix: IconButton( - icon: Icon(Icons - .calendar_today)), - textInputType: - TextInputType.number, + prefix: IconButton(icon: Icon(Icons.calendar_today)), + textInputType: TextInputType.number, controller: _toDateController, onTap: () { - _presentDatePicker( - 'fromDate'); + _presentDatePicker('fromDate'); }, inputFormatter: ONLY_DATE, - onChanged: (val) => - fromDate = val, - onSaved: (val) => - fromDate = val, + onChanged: (val) => fromDate = val, + onSaved: (val) => fromDate = val, ) ], )), @@ -271,38 +219,23 @@ class _RescheduleLeaveScreen extends State { Expanded( child: Container( margin: EdgeInsets.all(8), - decoration: BoxDecoration( - borderRadius: - BorderRadius.all( - Radius.circular( - 6.0)), - border: Border.all( - width: 1.0, - color: HexColor( - "#CCCCCC"))), + decoration: BoxDecoration(borderRadius: BorderRadius.all(Radius.circular(6.0)), border: Border.all(width: 1.0, color: HexColor("#CCCCCC"))), padding: EdgeInsets.all(5), child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, children: [ DateTimePicker( - timeHintText: - TranslationBase.of( - context) - .fromTime, - type: DateTimePickerType - .time, + timeHintText: TranslationBase.of(context).fromTime, + type: DateTimePickerType.time, controller: _controller4, - onChanged: (val) => - fromTime = val, + onChanged: (val) => fromTime = val, validator: (val) { print(val); // setState( // () => _valueToValidate4 = val); return null; }, - onSaved: (val) => - fromTime = val, + onSaved: (val) => fromTime = val, ) ], ), @@ -311,38 +244,23 @@ class _RescheduleLeaveScreen extends State { Expanded( child: Container( margin: EdgeInsets.all(8), - decoration: BoxDecoration( - borderRadius: - BorderRadius.all( - Radius.circular( - 6.0)), - border: Border.all( - width: 1.0, - color: HexColor( - "#CCCCCC"))), + decoration: BoxDecoration(borderRadius: BorderRadius.all(Radius.circular(6.0)), border: Border.all(width: 1.0, color: HexColor("#CCCCCC"))), padding: EdgeInsets.all(5), child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, children: [ DateTimePicker( - timeHintText: - TranslationBase.of( - context) - .toTime, - type: DateTimePickerType - .time, + timeHintText: TranslationBase.of(context).toTime, + type: DateTimePickerType.time, controller: _controller5, - onChanged: (val) => - toTime = val, + onChanged: (val) => toTime = val, validator: (val) { print(val); // setState( // () => _valueToValidate4 = val); return null; }, - onSaved: (val) => - toTime = val, + onSaved: (val) => toTime = val, ) ], ), @@ -356,35 +274,20 @@ class _RescheduleLeaveScreen extends State { children: [ Container( margin: EdgeInsets.all(8), - decoration: BoxDecoration( - borderRadius: BorderRadius.all( - Radius.circular(6.0)), - border: Border.all( - width: 1.0, - color: - HexColor("#CCCCCC"))), + decoration: BoxDecoration(borderRadius: BorderRadius.all(Radius.circular(6.0)), border: Border.all(width: 1.0, color: HexColor("#CCCCCC"))), padding: EdgeInsets.all(5), child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, children: [ AppTextFormField( - hintText: - TranslationBase.of( - context) - .fromDate, + hintText: TranslationBase.of(context).fromDate, borderColor: Colors.white, - prefix: IconButton( - icon: Icon(Icons - .calendar_today)), - textInputType: - TextInputType.number, + prefix: IconButton(icon: Icon(Icons.calendar_today)), + textInputType: TextInputType.number, readOnly: true, - controller: - _toDateController, + controller: _toDateController, onTap: () { - _presentDatePicker( - 'fromDate'); + _presentDatePicker('fromDate'); }, inputFormatter: ONLY_DATE, onChanged: (value) { @@ -396,35 +299,20 @@ class _RescheduleLeaveScreen extends State { )), Container( margin: EdgeInsets.all(8), - decoration: BoxDecoration( - borderRadius: BorderRadius.all( - Radius.circular(6.0)), - border: Border.all( - width: 1.0, - color: - HexColor("#CCCCCC"))), + decoration: BoxDecoration(borderRadius: BorderRadius.all(Radius.circular(6.0)), border: Border.all(width: 1.0, color: HexColor("#CCCCCC"))), padding: EdgeInsets.all(5), child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, children: [ AppTextFormField( - hintText: - TranslationBase - .of(context) - .toDate, + hintText: TranslationBase.of(context).toDate, readOnly: true, borderColor: Colors.white, - prefix: IconButton( - icon: Icon(Icons - .calendar_today)), - textInputType: - TextInputType.number, - controller: - _toDateController2, + prefix: IconButton(icon: Icon(Icons.calendar_today)), + textInputType: TextInputType.number, + controller: _toDateController2, onTap: () { - _presentDatePicker( - 'toDate'); + _presentDatePicker('toDate'); }, inputFormatter: ONLY_DATE, onChanged: (value) { @@ -438,23 +326,13 @@ class _RescheduleLeaveScreen extends State { ), Container( margin: EdgeInsets.all(8), - decoration: BoxDecoration( - borderRadius: BorderRadius.all( - Radius.circular(6.0)), - border: Border.all( - width: 1.0, - color: HexColor("#CCCCCC"))), + decoration: BoxDecoration(borderRadius: BorderRadius.all(Radius.circular(6.0)), border: Border.all(width: 1.0, color: HexColor("#CCCCCC"))), width: double.infinity, child: Padding( padding: EdgeInsets.only( - top: SizeConfig.widthMultiplier * 0.9, - bottom: - SizeConfig.widthMultiplier * 0.9, - right: SizeConfig.widthMultiplier * 3, - left: SizeConfig.widthMultiplier * 3), + top: SizeConfig.widthMultiplier * 0.9, bottom: SizeConfig.widthMultiplier * 0.9, right: SizeConfig.widthMultiplier * 3, left: SizeConfig.widthMultiplier * 3), child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, children: [ Row( mainAxisSize: MainAxisSize.max, @@ -462,39 +340,21 @@ class _RescheduleLeaveScreen extends State { model2.allReasons.length > 0 ? Expanded( // add Expanded to have your dropdown button fill remaining space - child: - DropdownButtonHideUnderline( - child: - DropdownButton( + child: DropdownButtonHideUnderline( + child: DropdownButton( focusColor: Colors.grey, isExpanded: true, - value: model2 - .allReasons[0] - ['id'] - .toString() ?? - "", + value: model2.allReasons[0]['id'].toString() ?? "", iconSize: 40, elevation: 16, - selectedItemBuilder: - (BuildContext - context) { - return model2.allReasons - .map((item) { + selectedItemBuilder: (BuildContext context) { + return model2.allReasons.map((item) { return Row( - mainAxisSize: - MainAxisSize - .max, + mainAxisSize: MainAxisSize.max, children: [ AppText( - projectsProvider - .isArabic - ? item[ - 'nameAr'] - : item[ - 'nameEn'], - fontSize: SizeConfig - .textMultiplier * - 2.1, + projectsProvider.isArabic ? item['nameAr'] : item['nameEn'], + fontSize: SizeConfig.textMultiplier * 2.1, // color: // Colors.grey, ), @@ -507,20 +367,12 @@ class _RescheduleLeaveScreen extends State { reason = newValue; }) }, - items: model2.allReasons - .map((item) { - return DropdownMenuItem< - String>( - value: item['id'] - .toString(), + items: model2.allReasons.map((item) { + return DropdownMenuItem( + value: item['id'].toString(), child: Text( - projectsProvider - .isArabic - ? item['nameAr'] - : item[ - 'nameEn'], - textAlign: - TextAlign.end, + projectsProvider.isArabic ? item['nameAr'] : item['nameEn'], + textAlign: TextAlign.end, ), ); }).toList(), @@ -535,23 +387,13 @@ class _RescheduleLeaveScreen extends State { Container( margin: EdgeInsets.all(8), - decoration: BoxDecoration( - borderRadius: BorderRadius.all( - Radius.circular(6.0)), - border: Border.all( - width: 1.0, - color: HexColor("#CCCCCC"))), + decoration: BoxDecoration(borderRadius: BorderRadius.all(Radius.circular(6.0)), border: Border.all(width: 1.0, color: HexColor("#CCCCCC"))), width: double.infinity, child: Padding( padding: EdgeInsets.only( - top: SizeConfig.widthMultiplier * 0.9, - bottom: - SizeConfig.widthMultiplier * 0.9, - right: SizeConfig.widthMultiplier * 3, - left: SizeConfig.widthMultiplier * 3), + top: SizeConfig.widthMultiplier * 0.9, bottom: SizeConfig.widthMultiplier * 0.9, right: SizeConfig.widthMultiplier * 3, left: SizeConfig.widthMultiplier * 3), child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, children: [ Row( mainAxisSize: MainAxisSize.max, @@ -562,56 +404,24 @@ class _RescheduleLeaveScreen extends State { child: DropdownSearch( mode: Mode.BOTTOM_SHEET, - dropdownSearchDecoration: - InputDecoration( - contentPadding: - EdgeInsets - .all(0), - border: - InputBorder - .none), + dropdownSearchDecoration: InputDecoration(contentPadding: EdgeInsets.all(0), border: InputBorder.none), //maxHeight: 300, - items: model2 - .coveringDoctors - .map((item) { - return projectsProvider - .isArabic - ? item[ - 'doctorNameN'] - : item[ - 'doctorName']; + items: model2.coveringDoctors.map((item) { + return projectsProvider.isArabic ? item['doctorNameN'] : item['doctorName']; }).toList(), // label: "Doctor List", onChanged: (item) { - model2.coveringDoctors - .forEach( - (newVal) => { - if (newVal[ - 'doctorName'] == - item) - doctorID = - newVal['DoctorID'] - }); + model2.coveringDoctors.forEach((newVal) => {if (newVal['doctorName'] == item) doctorID = newVal['DoctorID']}); }, - selectedItem: - getSelectedDoctor( - model2), + selectedItem: getSelectedDoctor(model2), showSearchBox: true, popupTitle: Container( height: 50, - decoration: - BoxDecoration( - color: Theme.of( - context) - .primaryColorDark, - borderRadius: - BorderRadius.only( - topLeft: - Radius.circular( - 20), - topRight: - Radius.circular( - 20), + decoration: BoxDecoration( + color: Theme.of(context).primaryColorDark, + borderRadius: BorderRadius.only( + topLeft: Radius.circular(20), + topRight: Radius.circular(20), ), ), child: Center( @@ -619,25 +429,16 @@ class _RescheduleLeaveScreen extends State { '', style: TextStyle( fontSize: 24, - fontWeight: - FontWeight - .bold, - color: - Colors.white, + fontWeight: FontWeight.bold, + color: Colors.white, ), ), ), ), - popupShape: - RoundedRectangleBorder( - borderRadius: - BorderRadius.only( - topLeft: - Radius.circular( - 24), - topRight: - Radius.circular( - 24), + popupShape: RoundedRectangleBorder( + borderRadius: BorderRadius.only( + topLeft: Radius.circular(24), + topRight: Radius.circular(24), ), ), ), @@ -650,17 +451,12 @@ class _RescheduleLeaveScreen extends State { )), SizedBox(height: SizeConfig.screenHeight * .3), Container( - margin: EdgeInsets.all( - SizeConfig.widthMultiplier * 5), + margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5), child: Wrap( alignment: WrapAlignment.center, children: [ AppButton( - title: widget.isUpdate == true - ? TranslationBase.of(context) - .updateReschedule - : TranslationBase.of(context) - .addReschedule, + title: widget.isUpdate == true ? TranslationBase.of(context).updateReschedule : TranslationBase.of(context).addReschedule, color: HexColor('#359846'), onPressed: () { if (offTime == '1' || offTime == '2') { @@ -670,9 +466,7 @@ class _RescheduleLeaveScreen extends State { addRecheduleLeave(model2); } } else { - DrAppToastMsg.showErrorToast( - TranslationBase.of(context) - .onlyOfftimeHoliday); + DrAppToastMsg.showErrorToast(TranslationBase.of(context).onlyOfftimeHoliday); } }, ), @@ -705,16 +499,13 @@ class _RescheduleLeaveScreen extends State { final df = new DateFormat('HH:mm:ss'); final dateFormat = new DateFormat('yyyy-MM-dd'); this.offTime = widget.updateData.requisitionType.toString(); - _toDateController.text = - dateFormat.format(DateTime.parse(widget.updateData.dateTimeFrom)); + _toDateController.text = dateFormat.format(DateTime.parse(widget.updateData.dateTimeFrom)); //df.format(DateTime.parse(widget.updateData.dateTimeFrom)); - this.fromTime = - df.format(DateTime.parse(widget.updateData.dateTimeFrom)); + this.fromTime = df.format(DateTime.parse(widget.updateData.dateTimeFrom)); this.fromTime = this.fromTime.substring(0, this.fromTime.length - 3); this.toTime = df.format(DateTime.parse(widget.updateData.dateTimeTo)); this.toTime = this.toTime.substring(0, this.toTime.length - 3); - _toDateController2.text = - dateFormat.format(DateTime.parse(widget.updateData.dateTimeTo)); + _toDateController2.text = dateFormat.format(DateTime.parse(widget.updateData.dateTimeTo)); _controller5.text = toTime; _controller4.text = fromTime; toDate = _toDateController2.text; @@ -727,8 +518,7 @@ class _RescheduleLeaveScreen extends State { getClinicName(model) { var clinicID = this.profile['ClinicID'] ?? 1; - var clinicInfo = - model.clinicsList.where((i) => i['ClinicID'] == clinicID).toList(); + var clinicInfo = model.clinicsList.where((i) => i['ClinicID'] == clinicID).toList(); return clinicInfo.length > 0 ? clinicInfo[0]['ClinicDescription'] : ""; } @@ -738,16 +528,8 @@ class _RescheduleLeaveScreen extends State { var fromDates = fromDate; var toDates = toDate; if (offTime == '1') { - fromDate = df.format(DateTime.parse(dateFormat.format(fromDates) + - 'T' + - fromTime + - ':' + - DateTime.now().second.toString())); - toDate = df.format(DateTime.parse(dateFormat.format(fromDates) + - 'T' + - toTime + - ':' + - DateTime.now().second.toString())); + fromDate = df.format(DateTime.parse(dateFormat.format(fromDates) + 'T' + fromTime + ':' + DateTime.now().second.toString())); + toDate = df.format(DateTime.parse(dateFormat.format(fromDates) + 'T' + toTime + ':' + DateTime.now().second.toString())); } else { fromDate = df.format(fromDates); toDate = df.format(toDates); @@ -762,19 +544,10 @@ class _RescheduleLeaveScreen extends State { "dateTimeTo": toDate, "date": offTime == '1' ? fromDate : df.format(DateTime.now()), "reasonId": reason == null ? model.allOffTime[0]['code'] : reason, - "coveringDoctorId": - doctorID == null ? model.coveringDoctors[0]['doctorID'] : doctorID, + "coveringDoctorId": doctorID == null ? model.coveringDoctors[0]['doctorID'] : doctorID, "status": 2, "schedule": [ - { - "weekDayId": 1, - "shiftId": 1, - "isOpen": true, - "timeFrom": fromTime, - "timeTo": toTime, - "timeFromstr": "", - "timeTostr": "" - } + {"weekDayId": 1, "shiftId": 1, "isOpen": true, "timeFrom": fromTime, "timeTo": toTime, "timeFromstr": "", "timeTostr": ""} ] } }; @@ -785,9 +558,7 @@ class _RescheduleLeaveScreen extends State { Navigator.pushNamedAndRemoveUntil(context, HOME, (r) => false); Navigator.push( context, - MaterialPageRoute( - builder: (context) => AddRescheduleLeaveScreen(), - settings: RouteSettings(name: 'AddRescheduleLeaveScreen') + MaterialPageRoute(builder: (context) => AddRescheduleLeaveScreen(), settings: RouteSettings(name: 'AddRescheduleLeaveScreen') // MyReferredPatient(), ), ); @@ -802,21 +573,11 @@ class _RescheduleLeaveScreen extends State { dynamic fromDates = fromDate; dynamic toDates = toDate; if (offTime == '1') { - fromDate = df.format(DateTime.parse(_toDateController.text)) + - 'T' + - fromTime + - ':' + - DateTime.now().second.toString(); - toDate = df.format(DateTime.parse(_toDateController2.text)) + - 'T' + - toTime + - ':' + - DateTime.now().second.toString(); + fromDate = df.format(DateTime.parse(_toDateController.text)) + 'T' + fromTime + ':' + DateTime.now().second.toString(); + toDate = df.format(DateTime.parse(_toDateController2.text)) + 'T' + toTime + ':' + DateTime.now().second.toString(); } else { - fromDate = df.format( - fromDates is DateTime ? fromDates : DateTime.parse(fromDates)); - toDate = - df.format(toDates is DateTime ? toDates : DateTime.parse(toDates)); + fromDate = df.format(fromDates is DateTime ? fromDates : DateTime.parse(fromDates)); + toDate = df.format(toDates is DateTime ? toDates : DateTime.parse(toDates)); } Map request = { @@ -829,19 +590,10 @@ class _RescheduleLeaveScreen extends State { "dateTimeTo": toDate, "date": offTime == '1' ? fromDate : df.format(DateTime.now()), "reasonId": reason == null ? model.allOffTime[0]['code'] : reason, - "coveringDoctorId": - doctorID == null ? model.coveringDoctors[0]['doctorID'] : doctorID, + "coveringDoctorId": doctorID == null ? model.coveringDoctors[0]['doctorID'] : doctorID, "status": 2, "schedule": [ - { - "weekDayId": 1, - "shiftId": 1, - "isOpen": true, - "timeFrom": "", - "timeTo": "", - "timeFromstr": fromTime, - "timeTostr": toTime - } + {"weekDayId": 1, "shiftId": 1, "isOpen": true, "timeFrom": "", "timeTo": "", "timeFromstr": fromTime, "timeTostr": toTime} ] } }; @@ -852,9 +604,7 @@ class _RescheduleLeaveScreen extends State { Navigator.pushNamedAndRemoveUntil(context, HOME, (r) => false); Navigator.push( context, - MaterialPageRoute( - builder: (context) => AddRescheduleLeaveScreen(), - settings: RouteSettings(name: 'AddRescheduleLeaveScreen')), + MaterialPageRoute(builder: (context) => AddRescheduleLeaveScreen(), settings: RouteSettings(name: 'AddRescheduleLeaveScreen')), ); } }); @@ -863,13 +613,10 @@ class _RescheduleLeaveScreen extends State { getSelectedDoctor(model2) { var doctorName; if (doctorID == null) - return projectsProvider.isArabic - ? model2.coveringDoctors[0]['doctorNameN'] - : model2.coveringDoctors[0]['doctorName']; + return projectsProvider.isArabic ? model2.coveringDoctors[0]['doctorNameN'] : model2.coveringDoctors[0]['doctorName']; else { model2.coveringDoctors.forEach((newVal) => { - if (newVal['doctorID'].toString() == doctorID) - {doctorName = newVal['doctorName']} + if (newVal['doctorID'].toString() == doctorID) {doctorName = newVal['doctorName']} }); return doctorName; } diff --git a/lib/widgets/shared/app_texts_widget.dart b/lib/widgets/shared/app_texts_widget.dart index 006c1499..2ea3aa8f 100644 --- a/lib/widgets/shared/app_texts_widget.dart +++ b/lib/widgets/shared/app_texts_widget.dart @@ -97,13 +97,7 @@ class _AppTextState extends State { Widget build(BuildContext context) { return GestureDetector( child: Container( - margin: widget.margin != null - ? EdgeInsets.all(widget.margin) - : EdgeInsets.only( - top: widget.marginTop, - right: widget.marginRight, - bottom: widget.marginBottom, - left: widget.marginLeft), + margin: widget.margin != null ? EdgeInsets.all(widget.margin) : EdgeInsets.only(top: widget.marginTop, right: widget.marginRight, bottom: widget.marginBottom, left: widget.marginLeft), child: Column( mainAxisAlignment: MainAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.start, @@ -118,21 +112,16 @@ class _AppTextState extends State { right: 0, child: Container( decoration: BoxDecoration( - gradient: LinearGradient( - colors: [ - Theme.of(context).backgroundColor, - Theme.of(context).backgroundColor.withOpacity(0), - ], - begin: Alignment.bottomCenter, - end: Alignment.topCenter)), + gradient: LinearGradient(colors: [ + Theme.of(context).backgroundColor, + Theme.of(context).backgroundColor.withOpacity(0), + ], begin: Alignment.bottomCenter, end: Alignment.topCenter)), height: 30, ), ) ], ), - if (widget.allowExpand && - widget.readMore && - text.length > widget.maxLength) + if (widget.allowExpand && widget.readMore && text.length > widget.maxLength) Padding( padding: EdgeInsets.only(top: 8.0, right: 8.0, bottom: 8.0), child: InkWell( @@ -165,17 +154,11 @@ class _AppTextState extends State { if (widget.isCopyable) { return Theme( data: ThemeData( - textSelectionColor: Colors.lightBlueAccent, + highlightColor: Colors.lightBlueAccent, ), child: Container( child: SelectableText( - !hidden - ? text - : (text.substring( - 0, - text.length > widget.maxLength - ? widget.maxLength - : text.length)), + !hidden ? text : (text.substring(0, text.length > widget.maxLength ? widget.maxLength : text.length)), textAlign: widget.textAlign, // overflow: widget.maxLines != null // ? ((widget.maxLines > 1) @@ -184,18 +167,12 @@ class _AppTextState extends State { // : null, maxLines: widget.maxLines ?? null, style: widget.style != null - ? _getFontStyle().copyWith( - fontStyle: widget.italic ? FontStyle.italic : null, - color: widget.color, - fontWeight: widget.fontWeight ?? _getFontWeight(), - height: widget.fontHeight) + ? _getFontStyle().copyWith(fontStyle: widget.italic ? FontStyle.italic : null, color: widget.color, fontWeight: widget.fontWeight ?? _getFontWeight(), height: widget.fontHeight) : TextStyle( fontStyle: widget.italic ? FontStyle.italic : null, - color: - widget.color != null ? widget.color : Color(0xff2E303A), + color: widget.color != null ? widget.color : Color(0xff2E303A), fontSize: widget.fontSize ?? _getFontSize(), - letterSpacing: widget.letterSpacing ?? - (widget.variant == "overline" ? 1.5 : null), + letterSpacing: widget.letterSpacing ?? (widget.variant == "overline" ? 1.5 : null), fontWeight: widget.fontWeight ?? _getFontWeight(), fontFamily: widget.fontFamily ?? 'Poppins', decoration: widget.textDecoration, @@ -205,32 +182,17 @@ class _AppTextState extends State { ); } else { return Text( - !hidden - ? text - : (text.substring( - 0, - text.length > widget.maxLength - ? widget.maxLength - : text.length)), + !hidden ? text : (text.substring(0, text.length > widget.maxLength ? widget.maxLength : text.length)), textAlign: widget.textAlign, - overflow: widget.maxLines != null - ? ((widget.maxLines > 1) - ? TextOverflow.fade - : TextOverflow.ellipsis) - : null, + overflow: widget.maxLines != null ? ((widget.maxLines > 1) ? TextOverflow.fade : TextOverflow.ellipsis) : null, maxLines: widget.maxLines ?? null, style: widget.style != null - ? _getFontStyle().copyWith( - fontStyle: widget.italic ? FontStyle.italic : null, - color: widget.color, - fontWeight: widget.fontWeight ?? _getFontWeight(), - height: widget.fontHeight) + ? _getFontStyle().copyWith(fontStyle: widget.italic ? FontStyle.italic : null, color: widget.color, fontWeight: widget.fontWeight ?? _getFontWeight(), height: widget.fontHeight) : TextStyle( fontStyle: widget.italic ? FontStyle.italic : null, color: widget.color != null ? widget.color : Colors.black, fontSize: widget.fontSize ?? _getFontSize(), - letterSpacing: widget.letterSpacing ?? - (widget.variant == "overline" ? 1.5 : null), + letterSpacing: widget.letterSpacing ?? (widget.variant == "overline" ? 1.5 : null), fontWeight: widget.fontWeight ?? _getFontWeight(), fontFamily: widget.fontFamily ?? 'Poppins', decoration: widget.textDecoration, diff --git a/lib/widgets/shared/dialogs/dailog-list-select.dart b/lib/widgets/shared/dialogs/dailog-list-select.dart index 36eeb62b..ed06506c 100644 --- a/lib/widgets/shared/dialogs/dailog-list-select.dart +++ b/lib/widgets/shared/dialogs/dailog-list-select.dart @@ -46,12 +46,12 @@ class _ListSelectDialogState extends State { } showAlertDialog(BuildContext context) { - Widget cancelButton = FlatButton( + Widget cancelButton = ElevatedButton( child: Text(TranslationBase.of(context).cancel), onPressed: () { Navigator.of(context).pop(); }); - Widget continueButton = FlatButton( + Widget continueButton = ElevatedButton( child: Text(this.widget.okText), onPressed: () { Navigator.of(context).pop(); @@ -77,11 +77,7 @@ class _ListSelectDialogState extends State { Container( height: MediaQuery.of(context).size.height * 0.070, child: TextField( - decoration: Utils.textFieldSelectorDecoration( - widget.hintSearchText ?? - TranslationBase.of(context).search, - null, - false, + decoration: Utils.textFieldSelectorDecoration(widget.hintSearchText ?? TranslationBase.of(context).search, null, false, suffixIcon: Icon( Icons.search, )), @@ -101,10 +97,7 @@ class _ListSelectDialogState extends State { groupValue: Utils.convertToTitleCase(widget.selectedValue[widget.attributeValueId].toString()), value: item[widget.attributeValueId].toString(), activeColor: AppGlobal.appRedColor, - selected: item[widget.attributeValueId] - .toString() == - widget.selectedValue[widget.attributeValueId] - .toString(), + selected: item[widget.attributeValueId].toString() == widget.selectedValue[widget.attributeValueId].toString(), onChanged: (val) { setState(() { widget.selectedValue = item; @@ -131,9 +124,7 @@ class _ListSelectDialogState extends State { if (query.isNotEmpty) { List dummyListData = List(); dummySearchList.forEach((item) { - if ("${item[widget.attributeName].toString()}" - .toLowerCase() - .contains(query.toLowerCase())) { + if ("${item[widget.attributeName].toString()}".toLowerCase().contains(query.toLowerCase())) { dummyListData.add(item); } }); diff --git a/lib/widgets/shared/dialogs/master_key_dailog.dart b/lib/widgets/shared/dialogs/master_key_dailog.dart index 4c4eb8f0..382a4b63 100644 --- a/lib/widgets/shared/dialogs/master_key_dailog.dart +++ b/lib/widgets/shared/dialogs/master_key_dailog.dart @@ -15,12 +15,7 @@ class MasterKeyDailog extends StatefulWidget { MasterKeyModel selectedValue; final bool isICD; - MasterKeyDailog( - {@required this.list, - @required this.okText, - @required this.okFunction, - this.selectedValue, - this.isICD = false}); + MasterKeyDailog({@required this.list, @required this.okText, @required this.okFunction, this.selectedValue, this.isICD = false}); @override _MasterKeyDailogState createState() => _MasterKeyDailogState(); @@ -41,22 +36,20 @@ class _MasterKeyDailogState extends State { showAlertDialog(BuildContext context, ProjectViewModel projectViewModel) { // set up the buttons - Widget cancelButton = FlatButton( + Widget cancelButton = ElevatedButton( child: AppText( TranslationBase.of(context).cancel, color: Colors.grey, - fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * - (SizeConfig.isWidthLarge ? 3.5 : 5), + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * (SizeConfig.isWidthLarge ? 3.5 : 5), ), onPressed: () { Navigator.of(context).pop(); }); - Widget continueButton = FlatButton( + Widget continueButton = ElevatedButton( child: AppText( this.widget.okText, color: Colors.grey, - fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * - (SizeConfig.isWidthLarge ? 3.5 : 5), + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * (SizeConfig.isWidthLarge ? 3.5 : 5), ), onPressed: () { this.widget.okFunction(widget.selectedValue); @@ -83,21 +76,12 @@ class _MasterKeyDailogState extends State { ...widget.list .map((item) => RadioListTile( title: AppText( - '${projectViewModel.isArabic ? item.nameAr : item.nameEn}' + - (widget.isICD ? '/${item.code}' : ''), + '${projectViewModel.isArabic ? item.nameAr : item.nameEn}' + (widget.isICD ? '/${item.code}' : ''), ), - groupValue: widget.isICD - ? widget.selectedValue.code.toString() - : widget.selectedValue.id.toString(), - value: widget.isICD - ? widget.selectedValue.code.toString() - : item.id.toString(), + groupValue: widget.isICD ? widget.selectedValue.code.toString() : widget.selectedValue.id.toString(), + value: widget.isICD ? widget.selectedValue.code.toString() : item.id.toString(), activeColor: Colors.blue.shade700, - selected: widget.isICD - ? item.code.toString() == - widget.selectedValue.code.toString() - : item.id.toString() == - widget.selectedValue.id.toString(), + selected: widget.isICD ? item.code.toString() == widget.selectedValue.code.toString() : item.id.toString() == widget.selectedValue.id.toString(), onChanged: (val) { setState(() { widget.selectedValue = item; diff --git a/lib/widgets/shared/dialogs/search-drugs-dailog-list.dart b/lib/widgets/shared/dialogs/search-drugs-dailog-list.dart index e528f2b5..0bfa2a42 100644 --- a/lib/widgets/shared/dialogs/search-drugs-dailog-list.dart +++ b/lib/widgets/shared/dialogs/search-drugs-dailog-list.dart @@ -9,12 +9,7 @@ class ListSelectDialog extends StatefulWidget { final Function(dynamic) okFunction; dynamic selectedValue; - ListSelectDialog( - {@required this.list, - @required this.attributeName, - @required this.attributeValueId, - @required this.okText, - @required this.okFunction}); + ListSelectDialog({@required this.list, @required this.attributeName, @required this.attributeValueId, @required this.okText, @required this.okFunction}); @override _ListSelectDialogState createState() => _ListSelectDialogState(); @@ -34,12 +29,12 @@ class _ListSelectDialogState extends State { showAlertDialog(BuildContext context) { // set up the buttons - Widget cancelButton = FlatButton( + Widget cancelButton = ElevatedButton( child: Text(TranslationBase.of(context).cancel), onPressed: () { Navigator.of(context).pop(); }); - Widget continueButton = FlatButton( + Widget continueButton = ElevatedButton( child: Text(this.widget.okText), onPressed: () { this.widget.okFunction(widget.selectedValue); @@ -66,13 +61,10 @@ class _ListSelectDialogState extends State { ...widget.list .map((item) => RadioListTile( title: Text("${item[widget.attributeName].toString()}"), - groupValue: widget.selectedValue[widget.attributeValueId] - .toString(), + groupValue: widget.selectedValue[widget.attributeValueId].toString(), value: item[widget.attributeValueId].toString(), activeColor: Colors.blue.shade700, - selected: item[widget.attributeValueId].toString() == - widget.selectedValue[widget.attributeValueId] - .toString(), + selected: item[widget.attributeValueId].toString() == widget.selectedValue[widget.attributeValueId].toString(), onChanged: (val) { setState(() { widget.selectedValue = item; diff --git a/lib/widgets/shared/text_fields/TextFields.dart b/lib/widgets/shared/text_fields/TextFields.dart index bc4600b4..005d4c0e 100644 --- a/lib/widgets/shared/text_fields/TextFields.dart +++ b/lib/widgets/shared/text_fields/TextFields.dart @@ -4,8 +4,7 @@ import 'package:flutter/services.dart'; class NumberTextInputFormatter extends TextInputFormatter { @override - TextEditingValue formatEditUpdate( - TextEditingValue oldValue, TextEditingValue newValue) { + TextEditingValue formatEditUpdate(TextEditingValue oldValue, TextEditingValue newValue) { final int newTextLength = newValue.text.length; int selectionIndex = newValue.selection.end; int usedSubstringIndex = 0; @@ -27,8 +26,7 @@ class NumberTextInputFormatter extends TextInputFormatter { if (newValue.selection.end >= 10) selectionIndex++; } // Dump the rest. - if (newTextLength >= usedSubstringIndex) - newText.write(newValue.text.substring(usedSubstringIndex)); + if (newTextLength >= usedSubstringIndex) newText.write(newValue.text.substring(usedSubstringIndex)); return TextEditingValue( text: newText.toString(), selection: TextSelection.collapsed(offset: selectionIndex), @@ -168,28 +166,20 @@ class _TextFieldsState extends State { view = false; }); }, - child: Icon(EvaIcons.eye, - size: 24.0, color: Color.fromRGBO(78, 62, 253, 1.0))) + child: Icon(EvaIcons.eye, size: 24.0, color: Color.fromRGBO(78, 62, 253, 1.0))) : InkWell( onTap: () { this.setState(() { view = true; }); }, - child: Icon(EvaIcons.eyeOff, - size: 24.0, color: Colors.grey[500]))); + child: Icon(EvaIcons.eyeOff, size: 24.0, color: Colors.grey[500]))); } break; default: if (widget.suffixIcon != null) - return InkWell( - onTap: widget.onSuffixTap, - child: Icon(widget.suffixIcon, - size: 22.0, - color: widget.suffixIconColor != null - ? widget.suffixIconColor - : Colors.grey[500])); + return InkWell(onTap: widget.onSuffixTap, child: Icon(widget.suffixIcon, size: 22.0, color: widget.suffixIconColor != null ? widget.suffixIconColor : Colors.grey[500])); else return null; } @@ -216,10 +206,7 @@ class _TextFieldsState extends State { // color: Color.fromRGBO(70, 68, 167, focus ? 0.20 : 0), // offset: Offset(0.0, 13.0), // blurRadius: focus ? 34.0 : 12.0) - BoxShadow( - color: Color.fromRGBO(110, 68, 80, focus ? 0.20 : 0), - offset: Offset(0.0, 13.0), - blurRadius: focus ? 34.0 : 12.0) + BoxShadow(color: Color.fromRGBO(110, 68, 80, focus ? 0.20 : 0), offset: Offset(0.0, 13.0), blurRadius: focus ? 34.0 : 12.0) ]), child: Column( children: [ @@ -239,7 +226,7 @@ class _TextFieldsState extends State { textInputAction: widget.inputAction, minLines: widget.minLines ?? 1, maxLines: widget.maxLines ?? 1, - maxLengthEnforced: widget.maxLengthEnforced, + //maxLengthEnforced: widget.maxLengthEnforced, initialValue: widget.initialValue, onChanged: (value) { if (widget.showLabelText) { @@ -264,8 +251,7 @@ class _TextFieldsState extends State { autofocus: widget.autoFocus ?? false, validator: widget.validator, onSaved: widget.onSaved, - style: Theme.of(context).textTheme.bodyText1.copyWith( - fontSize: widget.fontSize, fontWeight: widget.fontWeight), + style: Theme.of(context).textTheme.bodyText1.copyWith(fontSize: widget.fontSize, fontWeight: widget.fontWeight), inputFormatters: widget.keyboardType == TextInputType.phone ? [ // WhitelistingTextInputFormatter.digitsOnly, @@ -286,73 +272,29 @@ class _TextFieldsState extends State { fontWeight: widget.fontWeight, color: widget.hintColor ?? Theme.of(context).hintColor, ), - contentPadding: widget.padding != null - ? widget.padding - : EdgeInsets.symmetric( - vertical: - (widget.bare && !widget.keepPadding) ? 0.0 : 10.0, - horizontal: 16.0), + contentPadding: widget.padding != null ? widget.padding : EdgeInsets.symmetric(vertical: (widget.bare && !widget.keepPadding) ? 0.0 : 10.0, horizontal: 16.0), filled: true, - fillColor: widget.bare - ? Colors.transparent - : Theme.of(context).backgroundColor, + fillColor: widget.bare ? Colors.transparent : Theme.of(context).backgroundColor, suffixIcon: _buildSuffixIcon(), prefixIcon: widget.prefixIcon, - errorStyle: TextStyle( - fontSize: 12.0, - fontWeight: widget.fontWeight, - height: widget.borderOnlyError ? 0.0 : null), + errorStyle: TextStyle(fontSize: 12.0, fontWeight: widget.fontWeight, height: widget.borderOnlyError ? 0.0 : null), errorBorder: OutlineInputBorder( - borderSide: widget.hasBorder - ? BorderSide( - color: Theme.of(context) - .errorColor - .withOpacity(widget.bare ? 0.0 : 0.5), - width: 1.0) - : BorderSide(color: Colors.transparent, width: 0), - borderRadius: widget.hasBorder - ? BorderRadius.circular( - widget.bare ? 0.0 : widget.borderRadius) - : BorderRadius.circular(0.0), + borderSide: widget.hasBorder ? BorderSide(color: Theme.of(context).errorColor.withOpacity(widget.bare ? 0.0 : 0.5), width: 1.0) : BorderSide(color: Colors.transparent, width: 0), + borderRadius: widget.hasBorder ? BorderRadius.circular(widget.bare ? 0.0 : widget.borderRadius) : BorderRadius.circular(0.0), ), focusedErrorBorder: OutlineInputBorder( - borderSide: widget.hasBorder - ? BorderSide( - color: Theme.of(context) - .errorColor - .withOpacity(widget.bare ? 0.0 : 0.5), - width: 1.0) - : BorderSide(color: Colors.transparent, width: 0), - borderRadius: BorderRadius.circular( - widget.bare ? 0.0 : widget.borderRadius)), + borderSide: widget.hasBorder ? BorderSide(color: Theme.of(context).errorColor.withOpacity(widget.bare ? 0.0 : 0.5), width: 1.0) : BorderSide(color: Colors.transparent, width: 0), + borderRadius: BorderRadius.circular(widget.bare ? 0.0 : widget.borderRadius)), focusedBorder: OutlineInputBorder( - borderSide: widget.hasBorder - ? BorderSide( - color: widget.borderColor, width: widget.borderWidth) - : BorderSide(color: Colors.transparent, width: 0), - borderRadius: widget.hasBorder - ? BorderRadius.circular( - widget.bare ? 0.0 : widget.borderRadius) - : BorderRadius.circular(0.0), + borderSide: widget.hasBorder ? BorderSide(color: widget.borderColor, width: widget.borderWidth) : BorderSide(color: Colors.transparent, width: 0), + borderRadius: widget.hasBorder ? BorderRadius.circular(widget.bare ? 0.0 : widget.borderRadius) : BorderRadius.circular(0.0), ), disabledBorder: OutlineInputBorder( - borderSide: widget.hasBorder - ? BorderSide( - color: widget.borderColor, width: widget.borderWidth) - : BorderSide(color: Colors.transparent, width: 0), - borderRadius: widget.hasBorder - ? BorderRadius.circular( - widget.bare ? 0.0 : widget.borderRadius) - : BorderRadius.circular(0.0)), + borderSide: widget.hasBorder ? BorderSide(color: widget.borderColor, width: widget.borderWidth) : BorderSide(color: Colors.transparent, width: 0), + borderRadius: widget.hasBorder ? BorderRadius.circular(widget.bare ? 0.0 : widget.borderRadius) : BorderRadius.circular(0.0)), enabledBorder: OutlineInputBorder( - borderSide: widget.hasBorder - ? BorderSide( - color: widget.borderColor, width: widget.borderWidth) - : BorderSide(color: Colors.transparent, width: 0), - borderRadius: widget.hasBorder - ? BorderRadius.circular( - widget.bare ? 0.0 : widget.borderRadius) - : BorderRadius.circular(0.0), + borderSide: widget.hasBorder ? BorderSide(color: widget.borderColor, width: widget.borderWidth) : BorderSide(color: Colors.transparent, width: 0), + borderRadius: widget.hasBorder ? BorderRadius.circular(widget.bare ? 0.0 : widget.borderRadius) : BorderRadius.circular(0.0), ), ), ), diff --git a/pubspec.lock b/pubspec.lock index 424d9a09..5cda33f5 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -8,6 +8,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "22.0.0" + _flutterfire_internals: + dependency: transitive + description: + name: _flutterfire_internals + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.12" analyzer: dependency: transitive description: @@ -21,49 +28,49 @@ packages: name: archive url: "https://pub.dartlang.org" source: hosted - version: "3.2.0" + version: "3.3.5" args: dependency: transitive description: name: args url: "https://pub.dartlang.org" source: hosted - version: "2.3.0" + version: "2.3.1" async: dependency: transitive description: name: async url: "https://pub.dartlang.org" source: hosted - version: "2.8.2" + version: "2.9.0" autocomplete_textfield: dependency: "direct main" description: name: autocomplete_textfield url: "https://pub.dartlang.org" source: hosted - version: "1.7.3" + version: "2.0.1" badges: dependency: "direct main" description: name: badges url: "https://pub.dartlang.org" source: hosted - version: "2.0.2" + version: "2.0.3" barcode_scan2: dependency: "direct main" description: name: barcode_scan2 url: "https://pub.dartlang.org" source: hosted - version: "4.2.0" + version: "4.2.2" bazel_worker: dependency: transitive description: name: bazel_worker url: "https://pub.dartlang.org" source: hosted - version: "1.0.1" + version: "1.0.2" boolean_selector: dependency: transitive description: @@ -140,42 +147,35 @@ packages: name: built_value url: "https://pub.dartlang.org" source: hosted - version: "8.1.4" + version: "8.4.2" cached_network_image: dependency: "direct main" description: name: cached_network_image url: "https://pub.dartlang.org" source: hosted - version: "3.2.0" + version: "3.2.3" cached_network_image_platform_interface: dependency: transitive description: name: cached_network_image_platform_interface url: "https://pub.dartlang.org" source: hosted - version: "1.0.0" + version: "2.0.0" cached_network_image_web: dependency: transitive description: name: cached_network_image_web url: "https://pub.dartlang.org" source: hosted - version: "1.0.1" + version: "1.0.2" characters: dependency: transitive description: name: characters url: "https://pub.dartlang.org" source: hosted - version: "1.2.0" - charcode: - dependency: transitive - description: - name: charcode - url: "https://pub.dartlang.org" - source: hosted - version: "1.3.1" + version: "1.2.1" charts_common: dependency: transitive description: @@ -203,7 +203,7 @@ packages: name: chewie url: "https://pub.dartlang.org" source: hosted - version: "1.1.0" + version: "1.3.6" chewie_audio: dependency: transitive description: @@ -224,7 +224,7 @@ packages: name: clock url: "https://pub.dartlang.org" source: hosted - version: "1.1.0" + version: "1.1.1" code_builder: dependency: transitive description: @@ -238,7 +238,7 @@ packages: name: collection url: "https://pub.dartlang.org" source: hosted - version: "1.15.0" + version: "1.16.0" connectivity: dependency: "direct main" description: @@ -273,28 +273,28 @@ packages: name: convert url: "https://pub.dartlang.org" source: hosted - version: "3.0.1" + version: "3.1.1" crypto: dependency: transitive description: name: crypto url: "https://pub.dartlang.org" source: hosted - version: "3.0.1" + version: "3.0.2" csslib: dependency: transitive description: name: csslib url: "https://pub.dartlang.org" source: hosted - version: "0.17.1" + version: "0.17.2" cupertino_icons: dependency: "direct main" description: name: cupertino_icons url: "https://pub.dartlang.org" source: hosted - version: "1.0.4" + version: "1.0.5" dart_style: dependency: transitive description: @@ -329,21 +329,21 @@ packages: name: dropdown_search url: "https://pub.dartlang.org" source: hosted - version: "2.0.1" + version: "3.0.1" equatable: dependency: transitive description: name: equatable url: "https://pub.dartlang.org" source: hosted - version: "2.0.3" + version: "2.0.5" eva_icons_flutter: dependency: "direct main" description: name: eva_icons_flutter url: "https://pub.dartlang.org" source: hosted - version: "3.0.2" + version: "3.1.0" expandable: dependency: "direct main" description: @@ -357,112 +357,119 @@ packages: name: fake_async url: "https://pub.dartlang.org" source: hosted - version: "1.2.0" + version: "1.3.1" ffi: dependency: transitive description: name: ffi url: "https://pub.dartlang.org" source: hosted - version: "1.1.2" + version: "1.2.1" file: dependency: transitive description: name: file url: "https://pub.dartlang.org" source: hosted - version: "6.1.2" + version: "6.1.4" file_picker: dependency: "direct main" description: name: file_picker url: "https://pub.dartlang.org" source: hosted - version: "3.0.4" - firebase: - dependency: transitive - description: - name: firebase - url: "https://pub.dartlang.org" - source: hosted - version: "9.0.2" + version: "4.6.1" firebase_analytics: dependency: "direct main" description: name: firebase_analytics url: "https://pub.dartlang.org" source: hosted - version: "8.3.4" + version: "10.1.0" firebase_analytics_platform_interface: dependency: transitive description: name: firebase_analytics_platform_interface url: "https://pub.dartlang.org" source: hosted - version: "2.0.1" + version: "3.3.17" firebase_analytics_web: dependency: transitive description: name: firebase_analytics_web url: "https://pub.dartlang.org" source: hosted - version: "0.3.0+1" + version: "0.5.1+8" firebase_core: dependency: transitive description: name: firebase_core url: "https://pub.dartlang.org" source: hosted - version: "1.12.0" + version: "2.4.1" firebase_core_platform_interface: dependency: transitive description: name: firebase_core_platform_interface url: "https://pub.dartlang.org" source: hosted - version: "4.2.4" + version: "4.5.2" firebase_core_web: dependency: transitive description: name: firebase_core_web url: "https://pub.dartlang.org" source: hosted - version: "1.5.4" + version: "2.1.0" firebase_messaging: dependency: "direct main" description: name: firebase_messaging url: "https://pub.dartlang.org" source: hosted - version: "10.0.9" + version: "14.2.1" firebase_messaging_platform_interface: dependency: transitive description: name: firebase_messaging_platform_interface url: "https://pub.dartlang.org" source: hosted - version: "3.1.6" + version: "4.2.10" firebase_messaging_web: dependency: transitive description: name: firebase_messaging_web url: "https://pub.dartlang.org" source: hosted - version: "2.2.7" + version: "3.2.11" fixnum: dependency: transitive description: name: fixnum url: "https://pub.dartlang.org" source: hosted - version: "1.0.0" + version: "1.0.1" fl_chart: dependency: "direct main" description: name: fl_chart url: "https://pub.dartlang.org" source: hosted - version: "0.36.4" + version: "0.40.6" + flex_color_picker: + dependency: transitive + description: + name: flex_color_picker + url: "https://pub.dartlang.org" + source: hosted + version: "2.6.1" + flex_seed_scheme: + dependency: transitive + description: + name: flex_seed_scheme + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.0" flutter: dependency: "direct main" description: flutter @@ -474,7 +481,7 @@ packages: name: flutter_blurhash url: "https://pub.dartlang.org" source: hosted - version: "0.6.0" + version: "0.7.0" flutter_cache_manager: dependency: transitive description: @@ -488,7 +495,7 @@ packages: name: flutter_colorpicker url: "https://pub.dartlang.org" source: hosted - version: "0.5.0" + version: "1.0.3" flutter_datetime_picker: dependency: "direct main" description: @@ -523,14 +530,28 @@ packages: name: flutter_inappwebview url: "https://pub.dartlang.org" source: hosted - version: "5.3.2" + version: "5.7.2+3" flutter_keyboard_visibility: dependency: transitive description: name: flutter_keyboard_visibility url: "https://pub.dartlang.org" source: hosted - version: "5.1.1" + version: "5.4.0" + flutter_keyboard_visibility_linux: + dependency: transitive + description: + name: flutter_keyboard_visibility_linux + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.0" + flutter_keyboard_visibility_macos: + dependency: transitive + description: + name: flutter_keyboard_visibility_macos + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.0" flutter_keyboard_visibility_platform_interface: dependency: transitive description: @@ -545,13 +566,20 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "2.0.0" + flutter_keyboard_visibility_windows: + dependency: transitive + description: + name: flutter_keyboard_visibility_windows + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.0" flutter_layout_grid: dependency: transitive description: name: flutter_layout_grid url: "https://pub.dartlang.org" source: hosted - version: "1.0.3" + version: "1.0.6" flutter_localizations: dependency: "direct main" description: flutter @@ -577,7 +605,7 @@ packages: name: flutter_plugin_android_lifecycle url: "https://pub.dartlang.org" source: hosted - version: "2.0.5" + version: "2.0.7" flutter_staggered_grid_view: dependency: "direct main" description: @@ -615,14 +643,14 @@ packages: name: fluttertoast url: "https://pub.dartlang.org" source: hosted - version: "8.0.8" + version: "8.1.2" font_awesome_flutter: dependency: "direct main" description: name: font_awesome_flutter url: "https://pub.dartlang.org" source: hosted - version: "9.2.0" + version: "10.3.0" get_it: dependency: "direct main" description: @@ -636,7 +664,7 @@ packages: name: glob url: "https://pub.dartlang.org" source: hosted - version: "2.0.2" + version: "2.1.1" graphs: dependency: transitive description: @@ -650,7 +678,7 @@ packages: name: hexcolor url: "https://pub.dartlang.org" source: hosted - version: "2.0.6" + version: "3.0.1" hijri: dependency: transitive description: @@ -671,28 +699,28 @@ packages: name: html url: "https://pub.dartlang.org" source: hosted - version: "0.15.0" + version: "0.15.1" html_editor_enhanced: dependency: "direct main" description: name: html_editor_enhanced url: "https://pub.dartlang.org" source: hosted - version: "2.2.0+1-dev.1" + version: "2.5.0" http: dependency: "direct main" description: name: http url: "https://pub.dartlang.org" source: hosted - version: "0.13.4" + version: "0.13.5" http_interceptor: dependency: "direct main" description: name: http_interceptor url: "https://pub.dartlang.org" source: hosted - version: "0.4.1" + version: "1.0.2" http_multi_server: dependency: transitive description: @@ -706,7 +734,7 @@ packages: name: http_parser url: "https://pub.dartlang.org" source: hosted - version: "4.0.0" + version: "4.0.2" infinite_listview: dependency: transitive description: @@ -734,7 +762,7 @@ packages: name: js url: "https://pub.dartlang.org" source: hosted - version: "0.6.3" + version: "0.6.4" json_annotation: dependency: transitive description: @@ -748,14 +776,42 @@ packages: name: local_auth url: "https://pub.dartlang.org" source: hosted - version: "1.1.10" + version: "2.1.3" + local_auth_android: + dependency: transitive + description: + name: local_auth_android + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.17" + local_auth_ios: + dependency: transitive + description: + name: local_auth_ios + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.12" + local_auth_platform_interface: + dependency: transitive + description: + name: local_auth_platform_interface + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.6" + local_auth_windows: + dependency: transitive + description: + name: local_auth_windows + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.4" logging: dependency: transitive description: name: logging url: "https://pub.dartlang.org" source: hosted - version: "1.0.2" + version: "1.1.0" maps_launcher: dependency: "direct main" description: @@ -769,21 +825,28 @@ packages: name: matcher url: "https://pub.dartlang.org" source: hosted - version: "0.12.11" + version: "0.12.12" + material_color_utilities: + dependency: transitive + description: + name: material_color_utilities + url: "https://pub.dartlang.org" + source: hosted + version: "0.1.5" meta: dependency: transitive description: name: meta url: "https://pub.dartlang.org" source: hosted - version: "1.7.0" + version: "1.8.0" mime: dependency: transitive description: name: mime url: "https://pub.dartlang.org" source: hosted - version: "1.0.1" + version: "1.0.3" nested: dependency: transitive description: @@ -811,21 +874,21 @@ packages: name: octo_image url: "https://pub.dartlang.org" source: hosted - version: "1.0.1" + version: "1.0.2" package_config: dependency: transitive description: name: package_config url: "https://pub.dartlang.org" source: hosted - version: "2.0.2" + version: "2.1.0" path: dependency: transitive description: name: path url: "https://pub.dartlang.org" source: hosted - version: "1.8.0" + version: "1.8.2" path_drawing: dependency: transitive description: @@ -846,49 +909,49 @@ packages: name: path_provider url: "https://pub.dartlang.org" source: hosted - version: "2.0.9" + version: "2.0.11" path_provider_android: dependency: transitive description: name: path_provider_android url: "https://pub.dartlang.org" source: hosted - version: "2.0.11" + version: "2.0.22" path_provider_ios: dependency: transitive description: name: path_provider_ios url: "https://pub.dartlang.org" source: hosted - version: "2.0.7" + version: "2.0.11" path_provider_linux: dependency: transitive description: name: path_provider_linux url: "https://pub.dartlang.org" source: hosted - version: "2.1.5" + version: "2.1.7" path_provider_macos: dependency: transitive description: name: path_provider_macos url: "https://pub.dartlang.org" source: hosted - version: "2.0.5" + version: "2.0.6" path_provider_platform_interface: dependency: transitive description: name: path_provider_platform_interface url: "https://pub.dartlang.org" source: hosted - version: "2.0.3" + version: "2.0.5" path_provider_windows: dependency: transitive description: name: path_provider_windows url: "https://pub.dartlang.org" source: hosted - version: "2.0.5" + version: "2.0.7" pedantic: dependency: transitive description: @@ -902,28 +965,49 @@ packages: name: percent_indicator url: "https://pub.dartlang.org" source: hosted - version: "3.4.0" + version: "4.2.2" permission_handler: dependency: "direct main" description: name: permission_handler url: "https://pub.dartlang.org" source: hosted - version: "8.3.0" + version: "10.2.0" + permission_handler_android: + dependency: transitive + description: + name: permission_handler_android + url: "https://pub.dartlang.org" + source: hosted + version: "10.2.0" + permission_handler_apple: + dependency: transitive + description: + name: permission_handler_apple + url: "https://pub.dartlang.org" + source: hosted + version: "9.0.7" permission_handler_platform_interface: dependency: transitive description: name: permission_handler_platform_interface url: "https://pub.dartlang.org" source: hosted - version: "3.7.0" + version: "3.9.0" + permission_handler_windows: + dependency: transitive + description: + name: permission_handler_windows + url: "https://pub.dartlang.org" + source: hosted + version: "0.1.2" petitparser: dependency: transitive description: name: petitparser url: "https://pub.dartlang.org" source: hosted - version: "4.4.0" + version: "5.1.0" platform: dependency: transitive description: @@ -937,21 +1021,28 @@ packages: name: plugin_platform_interface url: "https://pub.dartlang.org" source: hosted - version: "2.1.2" + version: "2.1.3" pointer_interceptor: dependency: transitive description: name: pointer_interceptor url: "https://pub.dartlang.org" source: hosted - version: "0.9.1" + version: "0.9.3+3" + pointycastle: + dependency: transitive + description: + name: pointycastle + url: "https://pub.dartlang.org" + source: hosted + version: "3.6.2" pool: dependency: transitive description: name: pool url: "https://pub.dartlang.org" source: hosted - version: "1.5.0" + version: "1.5.1" process: dependency: transitive description: @@ -965,21 +1056,21 @@ packages: name: protobuf url: "https://pub.dartlang.org" source: hosted - version: "2.0.1" + version: "2.1.0" provider: dependency: "direct main" description: name: provider url: "https://pub.dartlang.org" source: hosted - version: "6.0.2" + version: "6.0.5" pub_semver: dependency: transitive description: name: pub_semver url: "https://pub.dartlang.org" source: hosted - version: "2.1.0" + version: "2.1.3" pubspec_parse: dependency: transitive description: @@ -993,14 +1084,14 @@ packages: name: quiver url: "https://pub.dartlang.org" source: hosted - version: "3.0.1+1" + version: "3.2.1" rxdart: dependency: transitive description: name: rxdart url: "https://pub.dartlang.org" source: hosted - version: "0.27.3" + version: "0.27.7" scratch_space: dependency: transitive description: @@ -1014,63 +1105,63 @@ packages: name: shared_preferences url: "https://pub.dartlang.org" source: hosted - version: "2.0.13" + version: "2.0.15" shared_preferences_android: dependency: transitive description: name: shared_preferences_android url: "https://pub.dartlang.org" source: hosted - version: "2.0.11" + version: "2.0.14" shared_preferences_ios: dependency: transitive description: name: shared_preferences_ios url: "https://pub.dartlang.org" source: hosted - version: "2.0.10" + version: "2.1.1" shared_preferences_linux: dependency: transitive description: name: shared_preferences_linux url: "https://pub.dartlang.org" source: hosted - version: "2.1.0" + version: "2.1.2" shared_preferences_macos: dependency: transitive description: name: shared_preferences_macos url: "https://pub.dartlang.org" source: hosted - version: "2.0.3" + version: "2.0.4" shared_preferences_platform_interface: dependency: transitive description: name: shared_preferences_platform_interface url: "https://pub.dartlang.org" source: hosted - version: "2.0.0" + version: "2.1.0" shared_preferences_web: dependency: transitive description: name: shared_preferences_web url: "https://pub.dartlang.org" source: hosted - version: "2.0.3" + version: "2.0.4" shared_preferences_windows: dependency: transitive description: name: shared_preferences_windows url: "https://pub.dartlang.org" source: hosted - version: "2.1.0" + version: "2.1.2" shelf: dependency: transitive description: name: shelf url: "https://pub.dartlang.org" source: hosted - version: "1.2.0" + version: "1.4.0" shelf_web_socket: dependency: transitive description: @@ -1089,14 +1180,14 @@ packages: name: source_maps url: "https://pub.dartlang.org" source: hosted - version: "0.10.10" + version: "0.10.11" source_span: dependency: transitive description: name: source_span url: "https://pub.dartlang.org" source: hosted - version: "1.8.1" + version: "1.9.0" speech_to_text: dependency: "direct main" description: @@ -1110,14 +1201,14 @@ packages: name: sqflite url: "https://pub.dartlang.org" source: hosted - version: "2.0.2" + version: "2.2.2" sqflite_common: dependency: transitive description: name: sqflite_common url: "https://pub.dartlang.org" source: hosted - version: "2.2.0" + version: "2.4.0+2" stack_trace: dependency: transitive description: @@ -1131,7 +1222,7 @@ packages: name: sticky_headers url: "https://pub.dartlang.org" source: hosted - version: "0.2.0" + version: "0.3.0+2" stream_channel: dependency: transitive description: @@ -1145,35 +1236,35 @@ packages: name: stream_transform url: "https://pub.dartlang.org" source: hosted - version: "2.0.0" + version: "2.1.0" string_scanner: dependency: transitive description: name: string_scanner url: "https://pub.dartlang.org" source: hosted - version: "1.1.0" + version: "1.1.1" synchronized: dependency: transitive description: name: synchronized url: "https://pub.dartlang.org" source: hosted - version: "3.0.0" + version: "3.0.0+3" term_glyph: dependency: transitive description: name: term_glyph url: "https://pub.dartlang.org" source: hosted - version: "1.2.0" + version: "1.2.1" test_api: dependency: transitive description: name: test_api url: "https://pub.dartlang.org" source: hosted - version: "0.4.3" + version: "0.4.12" timing: dependency: transitive description: @@ -1194,133 +1285,133 @@ packages: name: tuple url: "https://pub.dartlang.org" source: hosted - version: "2.0.0" + version: "2.0.1" typed_data: dependency: transitive description: name: typed_data url: "https://pub.dartlang.org" source: hosted - version: "1.3.0" + version: "1.3.1" url_launcher: dependency: "direct main" description: name: url_launcher url: "https://pub.dartlang.org" source: hosted - version: "6.0.20" + version: "6.1.7" url_launcher_android: dependency: transitive description: name: url_launcher_android url: "https://pub.dartlang.org" source: hosted - version: "6.0.15" + version: "6.0.22" url_launcher_ios: dependency: transitive description: name: url_launcher_ios url: "https://pub.dartlang.org" source: hosted - version: "6.0.15" + version: "6.0.17" url_launcher_linux: dependency: transitive description: name: url_launcher_linux url: "https://pub.dartlang.org" source: hosted - version: "3.0.0" + version: "3.0.1" url_launcher_macos: dependency: transitive description: name: url_launcher_macos url: "https://pub.dartlang.org" source: hosted - version: "3.0.0" + version: "3.0.1" url_launcher_platform_interface: dependency: transitive description: name: url_launcher_platform_interface url: "https://pub.dartlang.org" source: hosted - version: "2.0.5" + version: "2.1.1" url_launcher_web: dependency: transitive description: name: url_launcher_web url: "https://pub.dartlang.org" source: hosted - version: "2.0.6" + version: "2.0.13" url_launcher_windows: dependency: transitive description: name: url_launcher_windows url: "https://pub.dartlang.org" source: hosted - version: "3.0.0" + version: "3.0.1" uuid: dependency: transitive description: name: uuid url: "https://pub.dartlang.org" source: hosted - version: "3.0.5" + version: "3.0.7" vector_math: dependency: transitive description: name: vector_math url: "https://pub.dartlang.org" source: hosted - version: "2.1.1" + version: "2.1.2" video_player: dependency: transitive description: name: video_player url: "https://pub.dartlang.org" source: hosted - version: "2.2.18" + version: "2.4.10" video_player_android: dependency: transitive description: name: video_player_android url: "https://pub.dartlang.org" source: hosted - version: "2.2.17" + version: "2.3.10" video_player_avfoundation: dependency: transitive description: name: video_player_avfoundation url: "https://pub.dartlang.org" source: hosted - version: "2.2.18" + version: "2.3.8" video_player_platform_interface: dependency: transitive description: name: video_player_platform_interface url: "https://pub.dartlang.org" source: hosted - version: "5.0.2" + version: "6.0.1" video_player_web: dependency: transitive description: name: video_player_web url: "https://pub.dartlang.org" source: hosted - version: "2.0.7" + version: "2.0.13" visibility_detector: dependency: transitive description: name: visibility_detector url: "https://pub.dartlang.org" source: hosted - version: "0.2.2" + version: "0.3.3" wakelock: dependency: transitive description: name: wakelock url: "https://pub.dartlang.org" source: hosted - version: "0.5.6" + version: "0.6.2" wakelock_macos: dependency: transitive description: @@ -1355,7 +1446,7 @@ packages: name: watcher url: "https://pub.dartlang.org" source: hosted - version: "1.0.1" + version: "1.0.2" web_socket_channel: dependency: transitive description: @@ -1376,49 +1467,49 @@ packages: name: webview_flutter_android url: "https://pub.dartlang.org" source: hosted - version: "2.8.2" + version: "2.10.4" webview_flutter_platform_interface: dependency: transitive description: name: webview_flutter_platform_interface url: "https://pub.dartlang.org" source: hosted - version: "1.8.1" + version: "1.9.5" webview_flutter_wkwebview: dependency: transitive description: name: webview_flutter_wkwebview url: "https://pub.dartlang.org" source: hosted - version: "2.7.1" + version: "2.9.5" win32: dependency: transitive description: name: win32 url: "https://pub.dartlang.org" source: hosted - version: "2.3.11" + version: "2.6.1" xdg_directories: dependency: transitive description: name: xdg_directories url: "https://pub.dartlang.org" source: hosted - version: "0.2.0+1" + version: "0.2.0+2" xml: dependency: transitive description: name: xml url: "https://pub.dartlang.org" source: hosted - version: "5.3.1" + version: "5.4.1" yaml: dependency: transitive description: name: yaml url: "https://pub.dartlang.org" source: hosted - version: "3.1.0" + version: "3.1.1" sdks: - dart: ">=2.15.0 <3.0.0" - flutter: ">=2.8.0" + dart: ">=2.18.1 <3.0.0" + flutter: ">=3.3.0" diff --git a/pubspec.yaml b/pubspec.yaml index dfc76868..d29099e0 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -27,7 +27,7 @@ environment: dependencies: flutter: sdk: flutter - hexcolor: ^2.0.4 + hexcolor: ^3.0.1 flutter_localizations: sdk: flutter flutter_device_type: ^0.4.0 @@ -38,8 +38,8 @@ dependencies: # imei_plugin: ^1.2.0 # flutter_flexible_toast: ^0.1.4 fluttertoast: ^8.0.8 - local_auth: ^1.1.6 - http_interceptor: ^0.4.1 + local_auth: ^2.1.3 + http_interceptor: ^1.0.2 connectivity: ^3.0.6 maps_launcher: ^2.0.0 @@ -48,8 +48,8 @@ dependencies: flutter_swiper: ^1.1.6 #Icons eva_icons_flutter: ^3.0.0 - font_awesome_flutter: ^9.0.0 - dropdown_search: ^2.0.1 + font_awesome_flutter: ^10.3.0 + dropdown_search: ^3.0.1 flutter_staggered_grid_view: ^0.4.0 expandable: ^5.0.1 @@ -57,7 +57,7 @@ dependencies: # Qr code Scanner barcode_scan2: ^4.1.4 # permissions - permission_handler: ^8.0.1 + permission_handler: ^10.2.0 device_info: ^2.0.2 # The following adds the Cupertino Icons font to your application. @@ -65,23 +65,23 @@ dependencies: cupertino_icons: ^1.0.3 # SVG #flutter_svg: ^1.0.0 - percent_indicator: ^3.0.1 + percent_indicator: ^4.2.2 #Dependency Injection get_it: ^7.1.3 #chart - fl_chart: ^0.36.1 + fl_chart: ^0.40.2 # Firebase - firebase_messaging: ^10.0.1 - firebase_analytics : ^8.3.4 + firebase_messaging: ^14.2.1 + firebase_analytics : ^10.1.0 #GIF image flutter_gifimage: ^1.0.1 #Autocomplete TextField - autocomplete_textfield: ^1.7.3 + autocomplete_textfield: ^2.0.1 date_time_picker: ^2.0.0 # Html @@ -89,15 +89,15 @@ dependencies: # Flutter Html View flutter_html: ^2.1.0 - sticky_headers: ^0.2.0 - file_picker: ^3.0.2+2 + sticky_headers: ^0.3.0+2 + file_picker: ^4.6.1 #speech to text speech_to_text: path: speech_to_text quiver: ^3.0.0 - flutter_colorpicker: ^0.5.0 + flutter_colorpicker: ^1.0.3 # Html Editor Enhanced html_editor_enhanced: ^2.1.1 diff --git a/speech_to_text/example/lib/main.dart b/speech_to_text/example/lib/main.dart index 0115b828..f9e672fa 100644 --- a/speech_to_text/example/lib/main.dart +++ b/speech_to_text/example/lib/main.dart @@ -33,8 +33,7 @@ class _MyAppState extends State { } Future initSpeechState() async { - bool hasSpeech = await speech.initialize( - onError: errorListener, onStatus: statusListener); + bool hasSpeech = await speech.initialize(onError: errorListener, onStatus: statusListener); if (hasSpeech) { _localeNames = await speech.locales(); @@ -49,7 +48,7 @@ class _MyAppState extends State { }); } - void requestPermissions() async{ + void requestPermissions() async { Map statuses = await [ Permission.microphone, ].request(); @@ -86,9 +85,7 @@ class _MyAppState extends State { children: [ FlatButton( child: Text('Start'), - onPressed: !_hasSpeech || speech.isListening - ? null - : startListening, + onPressed: !_hasSpeech || speech.isListening ? null : startListening, ), FlatButton( child: Text('Stop'), @@ -151,15 +148,9 @@ class _MyAppState extends State { height: 40, alignment: Alignment.center, decoration: BoxDecoration( - boxShadow: [ - BoxShadow( - blurRadius: .26, - spreadRadius: level * 1.5, - color: Colors.black.withOpacity(.05)) - ], + boxShadow: [BoxShadow(blurRadius: .26, spreadRadius: level * 1.5, color: Colors.black.withOpacity(.05))], color: Colors.white, - borderRadius: - BorderRadius.all(Radius.circular(50)), + borderRadius: BorderRadius.all(Radius.circular(50)), ), child: IconButton(icon: Icon(Icons.mic)), ), diff --git a/speech_to_text/example/pubspec.lock b/speech_to_text/example/pubspec.lock index 6809f75f..f7f8a8a5 100644 --- a/speech_to_text/example/pubspec.lock +++ b/speech_to_text/example/pubspec.lock @@ -7,42 +7,42 @@ packages: name: async url: "https://pub.dartlang.org" source: hosted - version: "2.5.0-nullsafety.1" + version: "2.8.2" boolean_selector: dependency: transitive description: name: boolean_selector url: "https://pub.dartlang.org" source: hosted - version: "2.1.0-nullsafety.1" + version: "2.1.0" characters: dependency: transitive description: name: characters url: "https://pub.dartlang.org" source: hosted - version: "1.1.0-nullsafety.3" + version: "1.2.0" charcode: dependency: transitive description: name: charcode url: "https://pub.dartlang.org" source: hosted - version: "1.2.0-nullsafety.1" + version: "1.3.1" clock: dependency: transitive description: name: clock url: "https://pub.dartlang.org" source: hosted - version: "1.1.0-nullsafety.1" + version: "1.1.0" collection: dependency: transitive description: name: collection url: "https://pub.dartlang.org" source: hosted - version: "1.15.0-nullsafety.3" + version: "1.15.0" cupertino_icons: dependency: "direct main" description: @@ -56,7 +56,7 @@ packages: name: fake_async url: "https://pub.dartlang.org" source: hosted - version: "1.2.0-nullsafety.1" + version: "1.2.0" flutter: dependency: "direct main" description: flutter @@ -80,14 +80,14 @@ packages: name: matcher url: "https://pub.dartlang.org" source: hosted - version: "0.12.10-nullsafety.1" + version: "0.12.11" meta: dependency: transitive description: name: meta url: "https://pub.dartlang.org" source: hosted - version: "1.3.0-nullsafety.3" + version: "1.7.0" nested: dependency: transitive description: @@ -101,7 +101,7 @@ packages: name: path url: "https://pub.dartlang.org" source: hosted - version: "1.8.0-nullsafety.1" + version: "1.8.0" permission_handler: dependency: "direct main" description: @@ -141,7 +141,7 @@ packages: name: source_span url: "https://pub.dartlang.org" source: hosted - version: "1.8.0-nullsafety.2" + version: "1.8.1" speech_to_text: dependency: "direct dev" description: @@ -155,49 +155,49 @@ packages: name: stack_trace url: "https://pub.dartlang.org" source: hosted - version: "1.10.0-nullsafety.1" + version: "1.10.0" stream_channel: dependency: transitive description: name: stream_channel url: "https://pub.dartlang.org" source: hosted - version: "2.1.0-nullsafety.1" + version: "2.1.0" string_scanner: dependency: transitive description: name: string_scanner url: "https://pub.dartlang.org" source: hosted - version: "1.1.0-nullsafety.1" + version: "1.1.0" term_glyph: dependency: transitive description: name: term_glyph url: "https://pub.dartlang.org" source: hosted - version: "1.2.0-nullsafety.1" + version: "1.2.0" test_api: dependency: transitive description: name: test_api url: "https://pub.dartlang.org" source: hosted - version: "0.2.19-nullsafety.2" + version: "0.4.3" typed_data: dependency: transitive description: name: typed_data url: "https://pub.dartlang.org" source: hosted - version: "1.3.0-nullsafety.3" + version: "1.3.0" vector_math: dependency: transitive description: name: vector_math url: "https://pub.dartlang.org" source: hosted - version: "2.1.0-nullsafety.3" + version: "2.1.1" sdks: - dart: ">=2.10.0-110 <2.11.0" - flutter: ">=1.16.0 <2.0.0" + dart: ">=2.14.0 <3.0.0" + flutter: ">=1.16.0" diff --git a/speech_to_text/pubspec.lock b/speech_to_text/pubspec.lock index efc63cc7..a892c39c 100644 --- a/speech_to_text/pubspec.lock +++ b/speech_to_text/pubspec.lock @@ -28,14 +28,14 @@ packages: name: async url: "https://pub.dartlang.org" source: hosted - version: "2.5.0-nullsafety.1" + version: "2.8.2" boolean_selector: dependency: transitive description: name: boolean_selector url: "https://pub.dartlang.org" source: hosted - version: "2.1.0-nullsafety.1" + version: "2.1.0" build: dependency: transitive description: @@ -98,14 +98,14 @@ packages: name: characters url: "https://pub.dartlang.org" source: hosted - version: "1.1.0-nullsafety.3" + version: "1.2.0" charcode: dependency: transitive description: name: charcode url: "https://pub.dartlang.org" source: hosted - version: "1.2.0-nullsafety.1" + version: "1.3.1" checked_yaml: dependency: transitive description: @@ -119,7 +119,7 @@ packages: name: clock url: "https://pub.dartlang.org" source: hosted - version: "1.1.0-nullsafety.1" + version: "1.1.0" code_builder: dependency: transitive description: @@ -133,7 +133,7 @@ packages: name: collection url: "https://pub.dartlang.org" source: hosted - version: "1.15.0-nullsafety.3" + version: "1.15.0" convert: dependency: transitive description: @@ -168,7 +168,7 @@ packages: name: fake_async url: "https://pub.dartlang.org" source: hosted - version: "1.2.0-nullsafety.1" + version: "1.2.0" fixnum: dependency: transitive description: @@ -262,14 +262,14 @@ packages: name: matcher url: "https://pub.dartlang.org" source: hosted - version: "0.12.10-nullsafety.1" + version: "0.12.11" meta: dependency: transitive description: name: meta url: "https://pub.dartlang.org" source: hosted - version: "1.3.0-nullsafety.3" + version: "1.7.0" mime: dependency: transitive description: @@ -304,7 +304,7 @@ packages: name: path url: "https://pub.dartlang.org" source: hosted - version: "1.8.0-nullsafety.1" + version: "1.8.0" pedantic: dependency: transitive description: @@ -372,21 +372,21 @@ packages: name: source_span url: "https://pub.dartlang.org" source: hosted - version: "1.8.0-nullsafety.2" + version: "1.8.1" stack_trace: dependency: transitive description: name: stack_trace url: "https://pub.dartlang.org" source: hosted - version: "1.10.0-nullsafety.1" + version: "1.10.0" stream_channel: dependency: transitive description: name: stream_channel url: "https://pub.dartlang.org" source: hosted - version: "2.1.0-nullsafety.1" + version: "2.1.0" stream_transform: dependency: transitive description: @@ -400,21 +400,21 @@ packages: name: string_scanner url: "https://pub.dartlang.org" source: hosted - version: "1.1.0-nullsafety.1" + version: "1.1.0" term_glyph: dependency: transitive description: name: term_glyph url: "https://pub.dartlang.org" source: hosted - version: "1.2.0-nullsafety.1" + version: "1.2.0" test_api: dependency: transitive description: name: test_api url: "https://pub.dartlang.org" source: hosted - version: "0.2.19-nullsafety.2" + version: "0.4.3" timing: dependency: transitive description: @@ -428,14 +428,14 @@ packages: name: typed_data url: "https://pub.dartlang.org" source: hosted - version: "1.3.0-nullsafety.3" + version: "1.3.0" vector_math: dependency: transitive description: name: vector_math url: "https://pub.dartlang.org" source: hosted - version: "2.1.0-nullsafety.3" + version: "2.1.1" watcher: dependency: transitive description: @@ -458,5 +458,5 @@ packages: source: hosted version: "2.2.1" sdks: - dart: ">=2.10.0-110 <2.11.0" + dart: ">=2.14.0 <3.0.0" flutter: ">=1.10.0" From 705c9f6fb86b3f297ff70fd0bdafaa49aebe953e Mon Sep 17 00:00:00 2001 From: "mirza.shafique" Date: Mon, 9 Jan 2023 09:44:19 +0300 Subject: [PATCH 02/28] android fixes --- android/app/build.gradle | 4 +- android/app/src/main/AndroidManifest.xml | 1 + .../hmgDr/Service/BaseMovingFloatingWidget.kt | 8 +- .../hmgDr/ui/fragment/VideoCallFragment.kt | 38 +- android/build.gradle | 2 +- pubspec.lock | 24 +- pubspec.yaml | 5 +- speech_to_text/.github/workflows/master.yml | 19 - speech_to_text/.gitignore | 11 - speech_to_text/.metadata | 10 - speech_to_text/CHANGELOG.md | 166 ----- speech_to_text/LICENSE | 29 - speech_to_text/README.md | 150 ----- speech_to_text/android/.classpath | 6 - speech_to_text/android/.gitignore | 8 - speech_to_text/android/.project | 23 - .../org.eclipse.buildship.core.prefs | 13 - speech_to_text/android/build.gradle | 44 -- .../android/gradle/gradle.properties | 3 - .../android/gradle/local.properties | 2 - speech_to_text/android/gradle/settings.gradle | 1 - .../gradle/wrapper/gradle-wrapper.properties | 5 - .../android/src/main/AndroidManifest.xml | 3 - .../speech_to_text/SpeechToTextPlugin.kt | 595 ------------------ speech_to_text/example/.gitignore | 73 --- speech_to_text/example/.metadata | 10 - speech_to_text/example/README.md | 155 ----- speech_to_text/example/android/.project | 17 - .../org.eclipse.buildship.core.prefs | 2 - .../example/android/app/build.gradle | 67 -- .../android/app/src/debug/AndroidManifest.xml | 7 - .../android/app/src/main/AndroidManifest.xml | 32 - .../speech_to_text_example/MainActivity.kt | 12 - .../main/res/drawable/launch_background.xml | 12 - .../src/main/res/mipmap-hdpi/ic_launcher.png | Bin 544 -> 0 bytes .../src/main/res/mipmap-mdpi/ic_launcher.png | Bin 442 -> 0 bytes .../src/main/res/mipmap-xhdpi/ic_launcher.png | Bin 721 -> 0 bytes .../main/res/mipmap-xxhdpi/ic_launcher.png | Bin 1031 -> 0 bytes .../main/res/mipmap-xxxhdpi/ic_launcher.png | Bin 1443 -> 0 bytes .../app/src/main/res/values/styles.xml | 8 - .../app/src/profile/AndroidManifest.xml | 7 - speech_to_text/example/android/build.gradle | 31 - .../example/android/gradle.properties | 4 - .../gradle/wrapper/gradle-wrapper.properties | 6 - .../example/android/settings.gradle | 15 - .../assets/sounds/speech_to_text_cancel.m4r | Bin 14006 -> 0 bytes .../sounds/speech_to_text_listening.m4r | Bin 16416 -> 0 bytes .../assets/sounds/speech_to_text_stop.m4r | Bin 17128 -> 0 bytes .../ios/Flutter/AppFrameworkInfo.plist | 26 - .../example/ios/Flutter/Debug.xcconfig | 2 - .../example/ios/Flutter/Flutter.podspec | 18 - .../example/ios/Flutter/Release.xcconfig | 2 - speech_to_text/example/ios/Podfile | 90 --- speech_to_text/example/ios/Podfile.lock | 29 - .../ios/Runner.xcodeproj/project.pbxproj | 578 ----------------- .../contents.xcworkspacedata | 7 - .../xcshareddata/xcschemes/Runner.xcscheme | 91 --- .../contents.xcworkspacedata | 10 - .../xcshareddata/IDEWorkspaceChecks.plist | 8 - .../example/ios/Runner/AppDelegate.swift | 13 - .../AppIcon.appiconset/Contents.json | 122 ---- .../Icon-App-1024x1024@1x.png | Bin 10932 -> 0 bytes .../AppIcon.appiconset/Icon-App-20x20@1x.png | Bin 564 -> 0 bytes .../AppIcon.appiconset/Icon-App-20x20@2x.png | Bin 1283 -> 0 bytes .../AppIcon.appiconset/Icon-App-20x20@3x.png | Bin 1588 -> 0 bytes .../AppIcon.appiconset/Icon-App-29x29@1x.png | Bin 1025 -> 0 bytes .../AppIcon.appiconset/Icon-App-29x29@2x.png | Bin 1716 -> 0 bytes .../AppIcon.appiconset/Icon-App-29x29@3x.png | Bin 1920 -> 0 bytes .../AppIcon.appiconset/Icon-App-40x40@1x.png | Bin 1283 -> 0 bytes .../AppIcon.appiconset/Icon-App-40x40@2x.png | Bin 1895 -> 0 bytes .../AppIcon.appiconset/Icon-App-40x40@3x.png | Bin 2665 -> 0 bytes .../AppIcon.appiconset/Icon-App-60x60@2x.png | Bin 2665 -> 0 bytes .../AppIcon.appiconset/Icon-App-60x60@3x.png | Bin 3831 -> 0 bytes .../AppIcon.appiconset/Icon-App-76x76@1x.png | Bin 1888 -> 0 bytes .../AppIcon.appiconset/Icon-App-76x76@2x.png | Bin 3294 -> 0 bytes .../Icon-App-83.5x83.5@2x.png | Bin 3612 -> 0 bytes .../LaunchImage.imageset/Contents.json | 23 - .../LaunchImage.imageset/LaunchImage.png | Bin 68 -> 0 bytes .../LaunchImage.imageset/LaunchImage@2x.png | Bin 68 -> 0 bytes .../LaunchImage.imageset/LaunchImage@3x.png | Bin 68 -> 0 bytes .../LaunchImage.imageset/README.md | 5 - .../Runner/Base.lproj/LaunchScreen.storyboard | 37 -- .../ios/Runner/Base.lproj/Main.storyboard | 26 - speech_to_text/example/ios/Runner/Info.plist | 49 -- .../ios/Runner/Runner-Bridging-Header.h | 1 - speech_to_text/example/lib/main.dart | 266 -------- speech_to_text/example/pubspec.lock | 203 ------ speech_to_text/example/pubspec.yaml | 33 - speech_to_text/example/test/widget_test.dart | 27 - speech_to_text/ios/.gitignore | 37 -- speech_to_text/ios/Assets/.gitkeep | 0 .../ios/Classes/SpeechToTextPlugin.h | 4 - .../ios/Classes/SpeechToTextPlugin.m | 8 - .../ios/Classes/SwiftSpeechToTextPlugin.swift | 580 ----------------- speech_to_text/ios/speech_to_text.podspec | 22 - .../lib/speech_recognition_error.dart | 44 -- .../lib/speech_recognition_error.g.dart | 22 - .../lib/speech_recognition_event.dart | 30 - .../lib/speech_recognition_result.dart | 140 ----- .../lib/speech_recognition_result.g.dart | 41 -- speech_to_text/lib/speech_to_text.dart | 511 --------------- .../lib/speech_to_text_provider.dart | 201 ------ speech_to_text/pubspec.lock | 462 -------------- speech_to_text/pubspec.yaml | 31 - .../test/speech_recognition_error_test.dart | 65 -- .../test/speech_recognition_event_test.dart | 42 -- .../test/speech_recognition_result_test.dart | 134 ---- .../test/speech_recognitions_words_test.dart | 86 --- .../test/speech_to_text_provider_test.dart | 196 ------ speech_to_text/test/speech_to_text_test.dart | 425 ------------- .../test/test_speech_channel_handler.dart | 134 ---- speech_to_text/test/test_speech_listener.dart | 36 -- 112 files changed, 49 insertions(+), 6496 deletions(-) delete mode 100644 speech_to_text/.github/workflows/master.yml delete mode 100644 speech_to_text/.gitignore delete mode 100644 speech_to_text/.metadata delete mode 100644 speech_to_text/CHANGELOG.md delete mode 100644 speech_to_text/LICENSE delete mode 100644 speech_to_text/README.md delete mode 100644 speech_to_text/android/.classpath delete mode 100644 speech_to_text/android/.gitignore delete mode 100644 speech_to_text/android/.project delete mode 100644 speech_to_text/android/.settings/org.eclipse.buildship.core.prefs delete mode 100644 speech_to_text/android/build.gradle delete mode 100644 speech_to_text/android/gradle/gradle.properties delete mode 100644 speech_to_text/android/gradle/local.properties delete mode 100644 speech_to_text/android/gradle/settings.gradle delete mode 100644 speech_to_text/android/gradle/wrapper/gradle-wrapper.properties delete mode 100644 speech_to_text/android/src/main/AndroidManifest.xml delete mode 100644 speech_to_text/android/src/main/kotlin/com/csdcorp/speech_to_text/SpeechToTextPlugin.kt delete mode 100644 speech_to_text/example/.gitignore delete mode 100644 speech_to_text/example/.metadata delete mode 100644 speech_to_text/example/README.md delete mode 100644 speech_to_text/example/android/.project delete mode 100644 speech_to_text/example/android/.settings/org.eclipse.buildship.core.prefs delete mode 100644 speech_to_text/example/android/app/build.gradle delete mode 100644 speech_to_text/example/android/app/src/debug/AndroidManifest.xml delete mode 100644 speech_to_text/example/android/app/src/main/AndroidManifest.xml delete mode 100644 speech_to_text/example/android/app/src/main/kotlin/com/csdcorp/speech_to_text_example/MainActivity.kt delete mode 100644 speech_to_text/example/android/app/src/main/res/drawable/launch_background.xml delete mode 100644 speech_to_text/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png delete mode 100644 speech_to_text/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png delete mode 100644 speech_to_text/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png delete mode 100644 speech_to_text/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png delete mode 100644 speech_to_text/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png delete mode 100644 speech_to_text/example/android/app/src/main/res/values/styles.xml delete mode 100644 speech_to_text/example/android/app/src/profile/AndroidManifest.xml delete mode 100644 speech_to_text/example/android/build.gradle delete mode 100644 speech_to_text/example/android/gradle.properties delete mode 100644 speech_to_text/example/android/gradle/wrapper/gradle-wrapper.properties delete mode 100644 speech_to_text/example/android/settings.gradle delete mode 100644 speech_to_text/example/assets/sounds/speech_to_text_cancel.m4r delete mode 100644 speech_to_text/example/assets/sounds/speech_to_text_listening.m4r delete mode 100644 speech_to_text/example/assets/sounds/speech_to_text_stop.m4r delete mode 100644 speech_to_text/example/ios/Flutter/AppFrameworkInfo.plist delete mode 100644 speech_to_text/example/ios/Flutter/Debug.xcconfig delete mode 100644 speech_to_text/example/ios/Flutter/Flutter.podspec delete mode 100644 speech_to_text/example/ios/Flutter/Release.xcconfig delete mode 100644 speech_to_text/example/ios/Podfile delete mode 100644 speech_to_text/example/ios/Podfile.lock delete mode 100644 speech_to_text/example/ios/Runner.xcodeproj/project.pbxproj delete mode 100644 speech_to_text/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata delete mode 100644 speech_to_text/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme delete mode 100644 speech_to_text/example/ios/Runner.xcworkspace/contents.xcworkspacedata delete mode 100644 speech_to_text/example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist delete mode 100644 speech_to_text/example/ios/Runner/AppDelegate.swift delete mode 100644 speech_to_text/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json delete mode 100644 speech_to_text/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png delete mode 100644 speech_to_text/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png delete mode 100644 speech_to_text/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png delete mode 100644 speech_to_text/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png delete mode 100644 speech_to_text/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png delete mode 100644 speech_to_text/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png delete mode 100644 speech_to_text/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png delete mode 100644 speech_to_text/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png delete mode 100644 speech_to_text/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png delete mode 100644 speech_to_text/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png delete mode 100644 speech_to_text/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png delete mode 100644 speech_to_text/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png delete mode 100644 speech_to_text/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png delete mode 100644 speech_to_text/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png delete mode 100644 speech_to_text/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png delete mode 100644 speech_to_text/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json delete mode 100644 speech_to_text/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png delete mode 100644 speech_to_text/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png delete mode 100644 speech_to_text/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png delete mode 100644 speech_to_text/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md delete mode 100644 speech_to_text/example/ios/Runner/Base.lproj/LaunchScreen.storyboard delete mode 100644 speech_to_text/example/ios/Runner/Base.lproj/Main.storyboard delete mode 100644 speech_to_text/example/ios/Runner/Info.plist delete mode 100644 speech_to_text/example/ios/Runner/Runner-Bridging-Header.h delete mode 100644 speech_to_text/example/lib/main.dart delete mode 100644 speech_to_text/example/pubspec.lock delete mode 100644 speech_to_text/example/pubspec.yaml delete mode 100644 speech_to_text/example/test/widget_test.dart delete mode 100644 speech_to_text/ios/.gitignore delete mode 100644 speech_to_text/ios/Assets/.gitkeep delete mode 100644 speech_to_text/ios/Classes/SpeechToTextPlugin.h delete mode 100644 speech_to_text/ios/Classes/SpeechToTextPlugin.m delete mode 100644 speech_to_text/ios/Classes/SwiftSpeechToTextPlugin.swift delete mode 100644 speech_to_text/ios/speech_to_text.podspec delete mode 100644 speech_to_text/lib/speech_recognition_error.dart delete mode 100644 speech_to_text/lib/speech_recognition_error.g.dart delete mode 100644 speech_to_text/lib/speech_recognition_event.dart delete mode 100644 speech_to_text/lib/speech_recognition_result.dart delete mode 100644 speech_to_text/lib/speech_recognition_result.g.dart delete mode 100644 speech_to_text/lib/speech_to_text.dart delete mode 100644 speech_to_text/lib/speech_to_text_provider.dart delete mode 100644 speech_to_text/pubspec.lock delete mode 100644 speech_to_text/pubspec.yaml delete mode 100644 speech_to_text/test/speech_recognition_error_test.dart delete mode 100644 speech_to_text/test/speech_recognition_event_test.dart delete mode 100644 speech_to_text/test/speech_recognition_result_test.dart delete mode 100644 speech_to_text/test/speech_recognitions_words_test.dart delete mode 100644 speech_to_text/test/speech_to_text_provider_test.dart delete mode 100644 speech_to_text/test/speech_to_text_test.dart delete mode 100644 speech_to_text/test/test_speech_channel_handler.dart delete mode 100644 speech_to_text/test/test_speech_listener.dart diff --git a/android/app/build.gradle b/android/app/build.gradle index 59f0f344..eeb6a370 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -26,7 +26,7 @@ apply plugin: 'kotlin-android' apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" android { - compileSdkVersion 30 + compileSdkVersion 33 signingConfigs { release { @@ -49,7 +49,7 @@ android { // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). applicationId "com.hmg.hmgDr" minSdkVersion 21 - targetSdkVersion 30 + targetSdkVersion 33 versionCode flutterVersionCode.toInteger() versionName flutterVersionName testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index 9cd98ee3..d7b04504 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -41,6 +41,7 @@ android:hardwareAccelerated="true" android:launchMode="singleTop" android:theme="@style/LaunchTheme" + android:exported="true" android:windowSoftInputMode="adjustResize"> diff --git a/android/app/src/main/kotlin/com/hmg/hmgDr/Service/BaseMovingFloatingWidget.kt b/android/app/src/main/kotlin/com/hmg/hmgDr/Service/BaseMovingFloatingWidget.kt index 220d2fc4..8e36e71d 100644 --- a/android/app/src/main/kotlin/com/hmg/hmgDr/Service/BaseMovingFloatingWidget.kt +++ b/android/app/src/main/kotlin/com/hmg/hmgDr/Service/BaseMovingFloatingWidget.kt @@ -133,10 +133,10 @@ abstract class BaseMovingFloatingWidget : Service() { return true } - override fun onDoubleTap(e: MotionEvent?): Boolean { - miniCircleDoubleTap() - return super.onDoubleTap(e) - } +// override fun onDoubleTap(e: MotionEvent?): Boolean { +// miniCircleDoubleTap() +// return super.onDoubleTap(e) +// } } diff --git a/android/app/src/main/kotlin/com/hmg/hmgDr/ui/fragment/VideoCallFragment.kt b/android/app/src/main/kotlin/com/hmg/hmgDr/ui/fragment/VideoCallFragment.kt index bcd842e6..a5ff26e9 100644 --- a/android/app/src/main/kotlin/com/hmg/hmgDr/ui/fragment/VideoCallFragment.kt +++ b/android/app/src/main/kotlin/com/hmg/hmgDr/ui/fragment/VideoCallFragment.kt @@ -144,7 +144,7 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session } override fun onCreateDialog(@Nullable savedInstanceState: Bundle?): Dialog {// FullScreenVideoTheme - val layoutInflater = activity!!.layoutInflater + val layoutInflater = requireActivity().layoutInflater this.parentView = onCreateView(layoutInflater, null) val alertDialogBuilder: AlertDialog.Builder = @@ -230,7 +230,7 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session handleDragDialog() mDetector = GestureDetectorCompat( - context, + requireContext(), MyGestureListener({ showControlPanelTemporarily() }, { miniCircleDoubleTap() }) ) @@ -772,16 +772,16 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session val mCallBtnLayoutParam: ConstraintLayout.LayoutParams = mCallBtn.layoutParams as ConstraintLayout.LayoutParams - val iconSize: Int = context!!.resources.getDimension(R.dimen.video_icon_size).toInt() + val iconSize: Int = requireContext().resources.getDimension(R.dimen.video_icon_size).toInt() val iconSizeSmall: Int = - context!!.resources.getDimension(R.dimen.video_icon_size_small).toInt() + requireContext().resources.getDimension(R.dimen.video_icon_size_small).toInt() val localPreviewMargin: Int = - context!!.resources.getDimension(R.dimen.local_preview_margin_top).toInt() + requireContext().resources.getDimension(R.dimen.local_preview_margin_top).toInt() val localPreviewWidth: Int = - context!!.resources.getDimension(R.dimen.local_preview_width).toInt() + requireContext().resources.getDimension(R.dimen.local_preview_width).toInt() val localPreviewHeight: Int = - context!!.resources.getDimension(R.dimen.local_preview_height).toInt() + requireContext().resources.getDimension(R.dimen.local_preview_height).toInt() // val localPreviewIconSize: Int = context!!.resources.getDimension(R.dimen.local_back_icon_size).toInt() // val localPreviewMarginSmall : Int = context!!.resources.getDimension(R.dimen.local_preview_margin_small).toInt() // val localPreviewWidthSmall : Int = context!!.resources.getDimension(R.dimen.local_preview_width_small).toInt() @@ -792,9 +792,9 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session mPublisherViewContainer.layoutParams as RelativeLayout.LayoutParams val remotePreviewIconSize: Int = - context!!.resources.getDimension(R.dimen.remote_back_icon_size).toInt() + requireContext().resources.getDimension(R.dimen.remote_back_icon_size).toInt() val remotePreviewIconSizeSmall: Int = - context!!.resources.getDimension(R.dimen.remote_back_icon_size_small).toInt() + requireContext().resources.getDimension(R.dimen.remote_back_icon_size_small).toInt() val remotePreviewLayoutParam: FrameLayout.LayoutParams = mSubscriberViewIcon.layoutParams as FrameLayout.LayoutParams @@ -884,17 +884,17 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session controlPanel.layoutParams as ConstraintLayout.LayoutParams val layoutNameHeight: Int = - context!!.resources.getDimension(R.dimen.layout_name_height).toInt() + requireContext().resources.getDimension(R.dimen.layout_name_height).toInt() val layoutMiniHeight: Int = - context!!.resources.getDimension(R.dimen.layout_mini_height).toInt() - val panelHeight: Int = context!!.resources.getDimension(R.dimen.layout_panel_height).toInt() + requireContext().resources.getDimension(R.dimen.layout_mini_height).toInt() + val panelHeight: Int = requireContext().resources.getDimension(R.dimen.layout_panel_height).toInt() val panelHeightSmall: Int = - context!!.resources.getDimension(R.dimen.layout_panel_height_small).toInt() + requireContext().resources.getDimension(R.dimen.layout_panel_height_small).toInt() val panelPadding: Int = - context!!.resources.getDimension(R.dimen.padding_space_big).toInt() + requireContext().resources.getDimension(R.dimen.padding_space_big).toInt() val panelPaddingMedium: Int = - context!!.resources.getDimension(R.dimen.padding_space_medium).toInt() + requireContext().resources.getDimension(R.dimen.padding_space_medium).toInt() val temp = getStatusBarHeight() / 2 @@ -1152,10 +1152,10 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session return true } - override fun onDoubleTap(e: MotionEvent?): Boolean { - miniCircleDoubleTap() - return super.onDoubleTap(e) - } +// override fun onDoubleTap(e: MotionEvent?): Boolean { +// miniCircleDoubleTap() +// return super.onDoubleTap(e) +// } } diff --git a/android/build.gradle b/android/build.gradle index ae74fcf6..b40a5b6e 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -1,5 +1,5 @@ buildscript { - ext.kotlin_version = '1.3.50' + ext.kotlin_version = '1.6.10' repositories { google() jcenter() diff --git a/pubspec.lock b/pubspec.lock index 5cda33f5..b12aacbb 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -769,7 +769,7 @@ packages: name: json_annotation url: "https://pub.dartlang.org" source: hosted - version: "3.1.1" + version: "4.7.0" local_auth: dependency: "direct main" description: @@ -1191,10 +1191,24 @@ packages: speech_to_text: dependency: "direct main" description: - path: speech_to_text - relative: true - source: path - version: "0.0.0" + name: speech_to_text + url: "https://pub.dartlang.org" + source: hosted + version: "6.1.1" + speech_to_text_macos: + dependency: transitive + description: + name: speech_to_text_macos + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.2" + speech_to_text_platform_interface: + dependency: transitive + description: + name: speech_to_text_platform_interface + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.1" sqflite: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index d29099e0..9e8abe78 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -93,8 +93,9 @@ dependencies: file_picker: ^4.6.1 #speech to text - speech_to_text: - path: speech_to_text +# speech_to_text: +# path: speech_to_text + speech_to_text: ^6.1.1 quiver: ^3.0.0 flutter_colorpicker: ^1.0.3 diff --git a/speech_to_text/.github/workflows/master.yml b/speech_to_text/.github/workflows/master.yml deleted file mode 100644 index 4d4cff1c..00000000 --- a/speech_to_text/.github/workflows/master.yml +++ /dev/null @@ -1,19 +0,0 @@ -name: build - -on: - push: - branches: - - master - -jobs: - test: - name: Test on Ubuntu - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v1 - - uses: subosito/flutter-action@v1.3.2 - with: - flutter-version: '1.17.1' - channel: 'stable' - - run: flutter pub get - - run: flutter test diff --git a/speech_to_text/.gitignore b/speech_to_text/.gitignore deleted file mode 100644 index 8969cbcd..00000000 --- a/speech_to_text/.gitignore +++ /dev/null @@ -1,11 +0,0 @@ -.DS_Store -.dart_tool/ - -.packages -.pub/ - -build/ -coverage/ -example/.flutter-plugins-dependencies -**/ios/Flutter/flutter_export_environment.sh -android/.idea/ diff --git a/speech_to_text/.metadata b/speech_to_text/.metadata deleted file mode 100644 index 1940d996..00000000 --- a/speech_to_text/.metadata +++ /dev/null @@ -1,10 +0,0 @@ -# This file tracks properties of this Flutter project. -# Used by Flutter tool to assess capabilities and perform upgrades etc. -# -# This file should be version controlled and should not be manually edited. - -version: - revision: 2d2a1ffec95cc70a3218872a2cd3f8de4933c42f - channel: stable - -project_type: plugin diff --git a/speech_to_text/CHANGELOG.md b/speech_to_text/CHANGELOG.md deleted file mode 100644 index 477e110c..00000000 --- a/speech_to_text/CHANGELOG.md +++ /dev/null @@ -1,166 +0,0 @@ -# Changelog - -## 2.3.0 - -### New - * new parameter `onDevice` on the `listen` method enforces on device recognition for sensitive content - * onSoundLevelChange now supported on iOS - * added compile troubleshooting help to README.md - * `SpeechToTextProvider` is an alternate and simpler way to interact with the `SpeechToText` plugin. - * new `provider_example.dart` example for usage of `SpeechToTextProvider`. -### Fix - * on iOS handles some conflicts with other applications better to keep speech working after calls for example - - -## 2.2.0 - -### New - * improved error handling and logging in the iOS implementation - * added general guides for iOS to the README - * moved stress testing out of the main example - * iOS now defaults to using the speaker rather than the receiver for start /stop sounds when no headphones -### Fix - * iOS now properly deactivates the audio session when no longer listening - * start and stop sounds on iOS should be more reliable when available - -## 2.1.0 -### Breaking - * `listenFor` now calls `stop` rather than `cancel` as this seems like more useful behaviour - -### Fix - * Android no longer stops or cancels the speech recognizer if it has already been shutdown by a - timeout or other platform behaviour. - * Android no longer tries to restart the listener when it is already active - * Now properly notifies errors that happen after listening stops due to platform callback rather than - client request. See https://github.com/csdcorp/speech_to_text/issues/51 - -## 2.0.1 -### Fix - * Resolves an issue with the Android implementation not handling permission requests properly on apps - that didn't use the 1.12.x plugin APIs for registration. The permission dialog would not appear and - permission was denied. - - -## 2.0.0 - -### Breaking - - * Upgraded to New Swift 1.12 plugin structure, may work with older Flutter version but not guaranteed - -### New - - * the plugin now requests both speech and microphone permission on initialize on iOS - * added `debugLogging` parameter to the `initialize` method to control native logging - -### Fix - - * The Android implementation now blocks duplicate results notifications. It appears that at least on some - Android versions the final results notification onResults is notified twice when Android automatically - terminates the session due to a pause time. The de-duplication looks for successive notifications - with < 100 ms between them and blocks the second. If you miss any onResult notifications please post - an issue. - -## 1.1.0 - -### New - - * error_timeout has been separated into error_network_timeout and error_speech_timeout - -## 1.0.0 - -### New - * hasPermission to check for the current permission without bringing up the system dialog - * `listen` has a new optional `cancelOnError` parameter to support automatically canceling - a listening session on a permanent error. - * `listen` has a new optional `partialResults` parameter that controls whether the callback - receives partial or only final results. - -## 0.8.0 - -### New - - * speech recognizer now exposes multiple possible transcriptions for each recognized speech - * alternates list on SpeechRecognitionResult exposes alternate transcriptions of voice - * confidence on SpeechRecognitionResult gives an estimate of confidence in the transcription - * isConfident on SpeechRecognitionResult supports testing confidence - * hasConfidenceRating on SpeechRecognitionResult indicates if confidence was provided from the device - * new SpeechRecognitionWords class gives details on per transcription words and confidence - -### Fix - - * speechRecognizer availabilityDidChange was crashing if invoked due to an invalid parameter type - * Added iOS platform 10 to example Podfile to resolve compilation warnings - -## 0.7.2 - -### Breaking - - * Upgrade Swift to version 5 to match Flutter. Projects using this plugin must now switch to 5. - -## 0.7.1 - -### Fix - - * Upgrade Kotlin to 1.3.5 to match the Flutter 1.12 version - * Upgrade Gradle build to 3.5.0 to match the Flutter 1.12 version - * Android version of the plugin was repeating the system default locale in the `locales` list - -## 0.7.0 - -### New - - * locales method returns the list of available languages for speech - * new optional localeId parameter on listen method supports choosing the comprehension language separately from the current system locale. - -### Breaking - - * `cancel` and `stop` are now async - -## 0.6.3 - -### Fix - - * request permission fix on Android to ensure it doesn't conflict with other requests - -## 0.6.2 - -### Fix - - * channel invoke wasn't being done on the main thread in iOS - -## 0.6.1 - -### Fix - - * listening sound was failing due to timing, now uses play and record mode on iOS. - - ## 0.6.0 -### Breaking - - * The filenames for the optional sounds for iOS have changed. - -### New - - * Added an optional listenFor parameter to set a max duration to listen for speech and then automatically cancel. - -### Fix - - * Was failing to play sounds because of record mode. Now plays sounds before going into record mode and after coming out. - * Status listener was being ignored, now properly notifies on status changes. - -## 0.5.1 - * Fixes a problem where the recognizer left the AVAudioSession in record mode which meant that subsequent sounds couldn't be played. - -## 0.5.0 -Initial draft with limited functionality, supports: - * initializing speech recognition - * asking the user for permission if required - * listening for recognized speech - * canceling the current recognition session - * stopping the current recognition session -* Android and iOS 10+ support - -Missing: - * some error handling - * testing across multiple OS versions - * and more, to be discovered... diff --git a/speech_to_text/LICENSE b/speech_to_text/LICENSE deleted file mode 100644 index 7c3991c8..00000000 --- a/speech_to_text/LICENSE +++ /dev/null @@ -1,29 +0,0 @@ -BSD 3-Clause License - -Copyright (c) 2019, Corner Software Development Corp. -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -3. Neither the name of the copyright holder nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file diff --git a/speech_to_text/README.md b/speech_to_text/README.md deleted file mode 100644 index af726f0e..00000000 --- a/speech_to_text/README.md +++ /dev/null @@ -1,150 +0,0 @@ -# speech_to_text - -[![pub package](https://img.shields.io/badge/pub-v2.3.0-blue)](https://pub.dartlang.org/packages/speech_to_text) [![build status](https://github.com/csdcorp/speech_to_text/workflows/build/badge.svg)](https://github.com/csdcorp/speech_to_text/actions?query=workflow%3Abuild) - -A library that exposes device specific speech recognition capability. - -This plugin contains a set of classes that make it easy to use the speech recognition -capabilities of the mobile device in Flutter. It supports both Android and iOS. The -target use cases for this library are commands and short phrases, not continuous spoken -conversion or always on listening. - -## Recent Updates - -The 2.3.0 version adds `SpeechToTextProvider` as a simpler way to interact with the plugin. Checkout -the new `provider_example.dart` for intended usage. - -The 2.2.0 version improves audio session handling and start / stop sound playback on iOS. - -*Note*: Feedback from any test devices is welcome. - -## Using - -To recognize text from the microphone import the package and call the plugin, like so: - -```dart -import 'package:speech_to_text/speech_to_text.dart' as stt; - - stt.SpeechToText speech = stt.SpeechToText(); - bool available = await speech.initialize( onStatus: statusListener, onError: errorListener ); - if ( available ) { - speech.listen( onResult: resultListener ); - } - else { - print("The user has denied the use of speech recognition."); - } - // some time later... - speech.stop() -``` - -### Initialize once -The `initialize` method only needs to be called once per application session. After that `listen`, -`start`, `stop`, and `cancel` can be used to interact with the plugin. Subsequent calls to `initialize` -are ignored which is safe but does mean that the `onStatus` and `onError` callbacks cannot be reset after -the first call to `initialize`. For that reason there should be only one instance of the plugin per -application. The `SpeechToTextProvider` is one way to create a single instance and easily reuse it in -multiple widgets. - -## Permissions - -Applications using this plugin require user permissions. -### iOS - -Add the following keys to your _Info.plist_ file, located in `/ios/Runner/Info.plist`: - -* `NSSpeechRecognitionUsageDescription` - describe why your app uses speech recognition. This is called _Privacy - Speech Recognition Usage Description_ in the visual editor. -* `NSMicrophoneUsageDescription` - describe why your app needs access to the microphone. This is called _Privacy - Microphone Usage Description_ in the visual editor. - -### Android - -Add the record audio permission to your _AndroidManifest.xml_ file, located in `/android/app/src/main/AndroidManifest.xml`. - -* `android.permission.RECORD_AUDIO` - this permission is required for microphone access. -* `android.permission.INTERNET` - this permission is required because speech recognition may use remote services. - -## Adding Sounds for iOS (optional) - -Android automatically plays system sounds when speech listening starts or stops but iOS does not. This plugin supports playing sounds to indicate listening status on iOS if sound files are available as assets in the application. To enable sounds in an application using this plugin add the sound files to the project and reference them in the assets section of the application `pubspec.yaml`. The location and filenames of the sound files must exactly match what -is shown below or they will not be found. The example application for the plugin shows the usage. *Note* These files should be very short as they delay -the start / end of the speech recognizer until the sound playback is complete. -```yaml - assets: - - assets/sounds/speech_to_text_listening.m4r - - assets/sounds/speech_to_text_cancel.m4r - - assets/sounds/speech_to_text_stop.m4r -``` -* `speech_to_text_listening.m4r` - played when the listen method is called. -* `speech_to_text_cancel.m4r` - played when the cancel method is called. -* `speech_to_text_stop.m4r` - played when the stop method is called. - -## Troubleshooting - -### SDK version error trying to compile for Android -``` -Manifest merger failed : uses-sdk:minSdkVersion 16 cannot be smaller than version 21 declared in library [:speech_to_text] -``` -The speech_to_text plugin requires at least Android SDK 21 because some of the speech functions in Android -were only introduced in that version. To fix this error you need to change the `build.gradle` entry to reflect -this version. Here's what the relevant part of that file looked like as of this writing: -``` - defaultConfig { - applicationId "com.example.app" - minSdkVersion 21 - targetSdkVersion 28 - versionCode flutterVersionCode.toInteger() - versionName flutterVersionName - testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" - } -``` - -### Incorrect Swift version trying to compile for iOS -``` -/Users/markvandergon/flutter/.pub-cache/hosted/pub.dartlang.org/speech_to_text-1.1.0/ios/Classes/SwiftSpeechToTextPlugin.swift:224:44: error: value of type 'SwiftSpeechToTextPlugin' has no member 'AVAudioSession' - rememberedAudioCategory = self.AVAudioSession.Category - ~~~~ ^~~~~~~~~~~~~~ - /Users/markvandergon/flutter/.pub-cache/hosted/pub.dartlang.org/speech_to_text-1.1.0/ios/Classes/SwiftSpeechToTextPlugin.swift:227:63: error: type 'Int' has no member 'notifyOthersOnDeactivation' - try self.audioSession.setActive(true, withFlags: .notifyOthersOnDeactivation) -``` -This happens when the Swift language version is not set correctly. See this thread for help https://github.com/csdcorp/speech_to_text/issues/45. - -### Swift not supported trying to compile for iOS -``` -`speech_to_text` does not specify a Swift version and none of the targets (`Runner`) integrating it have the `SWIFT_VERSION` attribute set. -``` -This usually happens for older projects that only support Objective-C. See this thread for help https://github.com/csdcorp/speech_to_text/issues/88. - -### Not working on a particular Android device -The symptom for this issue is that the `initialize` method will always fail. If you turn on debug logging -using the `debugLogging: true` flag on the `initialize` method you'll see `'Speech recognition unavailable'` -in the Android log. There's a lengthy issue discussion here https://github.com/csdcorp/speech_to_text/issues/36 -about this. The issue seems to be that the recognizer is not always automatically enabled on the device. Two -key things helped resolve the issue in this case at least. - -#### First -1. Go to Google Play -2. Search for 'Google' -3. You should find this app: https://play.google.com/store/apps/details?id=com.google.android.googlequicksearchbox -If 'Disabled' enable it - -This is the SO post that helped: https://stackoverflow.com/questions/28769320/how-to-check-wether-speech-recognition-is-available-or-not - -#### Second -Ensure the app has the required permissions. The symptom for this that you get a permanent error notification - 'error_audio_error` when starting a listen session. Here's a Stack Overflow post that addresses that - https://stackoverflow.com/questions/46376193/android-speechrecognizer-audio-recording-error - Here's the important excerpt: - >You should go to system setting, Apps, Google app, then enable its permission of microphone. - -### iOS recognition guidelines -Apple has quite a good guide on the user experience for using speech, the original is here -https://developer.apple.com/documentation/speech/sfspeechrecognizer This is the section that I think is particularly relevant: - ->#### Create a Great User Experience for Speech Recognition ->Here are some tips to consider when adding speech recognition support to your app. - ->**Be prepared to handle failures caused by speech recognition limits.** Because speech recognition is a network-based service, limits are enforced so that the service can remain freely available to all apps. Individual devices may be limited in the number of recognitions that can be performed per day, and each app may be throttled globally based on the number of requests it makes per day. If a recognition request fails quickly (within a second or two of starting), check to see if the recognition service became unavailable. If it is, you may want to ask users to try again later. - ->**Plan for a one-minute limit on audio duration.** Speech recognition places a relatively high burden on battery life and network usage. To minimize this burden, the framework stops speech recognition tasks that last longer than one minute. This limit is similar to the one for keyboard-related dictation. -Remind the user when your app is recording. For example, display a visual indicator and play sounds at the beginning and end of speech recognition to help users understand that they're being actively recorded. You can also display speech as it is being recognized so that users understand what your app is doing and see any mistakes made during the recognition process. - ->**Do not perform speech recognition on private or sensitive information.** Some speech is not appropriate for recognition. Don't send passwords, health or financial data, and other sensitive speech for recognition. diff --git a/speech_to_text/android/.classpath b/speech_to_text/android/.classpath deleted file mode 100644 index eb19361b..00000000 --- a/speech_to_text/android/.classpath +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/speech_to_text/android/.gitignore b/speech_to_text/android/.gitignore deleted file mode 100644 index c6cbe562..00000000 --- a/speech_to_text/android/.gitignore +++ /dev/null @@ -1,8 +0,0 @@ -*.iml -.gradle -/local.properties -/.idea/workspace.xml -/.idea/libraries -.DS_Store -/build -/captures diff --git a/speech_to_text/android/.project b/speech_to_text/android/.project deleted file mode 100644 index 3050653c..00000000 --- a/speech_to_text/android/.project +++ /dev/null @@ -1,23 +0,0 @@ - - - speech_to_text - Project android_____ created by Buildship. - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.buildship.core.gradleprojectbuilder - - - - - - org.eclipse.jdt.core.javanature - org.eclipse.buildship.core.gradleprojectnature - - diff --git a/speech_to_text/android/.settings/org.eclipse.buildship.core.prefs b/speech_to_text/android/.settings/org.eclipse.buildship.core.prefs deleted file mode 100644 index 7a23d112..00000000 --- a/speech_to_text/android/.settings/org.eclipse.buildship.core.prefs +++ /dev/null @@ -1,13 +0,0 @@ -arguments= -auto.sync=false -build.scans.enabled=false -connection.gradle.distribution=GRADLE_DISTRIBUTION(VERSION(5.6.1)) -connection.project.dir= -eclipse.preferences.version=1 -gradle.user.home= -java.home= -jvm.arguments= -offline.mode=false -override.workspace.settings=true -show.console.view=true -show.executions.view=true diff --git a/speech_to_text/android/build.gradle b/speech_to_text/android/build.gradle deleted file mode 100644 index cc06ea57..00000000 --- a/speech_to_text/android/build.gradle +++ /dev/null @@ -1,44 +0,0 @@ -group 'com.csdcorp.speech_to_text' -version '1.0-SNAPSHOT' - -buildscript { - ext.kotlin_version = '1.3.50' - repositories { - google() - jcenter() - } - - dependencies { - classpath 'com.android.tools.build:gradle:3.5.0' - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" - } -} - -rootProject.allprojects { - repositories { - google() - jcenter() - } -} - -apply plugin: 'com.android.library' -apply plugin: 'kotlin-android' - -android { - compileSdkVersion 28 - - sourceSets { - main.java.srcDirs += 'src/main/kotlin' - } - defaultConfig { - minSdkVersion 18 - testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" - } - lintOptions { - disable 'InvalidPackage' - } -} - -dependencies { - implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" -} diff --git a/speech_to_text/android/gradle/gradle.properties b/speech_to_text/android/gradle/gradle.properties deleted file mode 100644 index 94adc3a3..00000000 --- a/speech_to_text/android/gradle/gradle.properties +++ /dev/null @@ -1,3 +0,0 @@ -org.gradle.jvmargs=-Xmx1536M -android.useAndroidX=true -android.enableJetifier=true diff --git a/speech_to_text/android/gradle/local.properties b/speech_to_text/android/gradle/local.properties deleted file mode 100644 index b85628e7..00000000 --- a/speech_to_text/android/gradle/local.properties +++ /dev/null @@ -1,2 +0,0 @@ -sdk.dir=/Users/stephen.owens/Library/Android/sdk -flutter.sdk=/Users/stephen.owens/Documents/dev/flutter/sdk/flutter \ No newline at end of file diff --git a/speech_to_text/android/gradle/settings.gradle b/speech_to_text/android/gradle/settings.gradle deleted file mode 100644 index cdfc1c4b..00000000 --- a/speech_to_text/android/gradle/settings.gradle +++ /dev/null @@ -1 +0,0 @@ -rootProject.name = 'speech_to_text' diff --git a/speech_to_text/android/gradle/wrapper/gradle-wrapper.properties b/speech_to_text/android/gradle/wrapper/gradle-wrapper.properties deleted file mode 100644 index 674bdda0..00000000 --- a/speech_to_text/android/gradle/wrapper/gradle-wrapper.properties +++ /dev/null @@ -1,5 +0,0 @@ -distributionBase=GRADLE_USER_HOME -distributionPath=wrapper/dists -zipStoreBase=GRADLE_USER_HOME -zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip diff --git a/speech_to_text/android/src/main/AndroidManifest.xml b/speech_to_text/android/src/main/AndroidManifest.xml deleted file mode 100644 index 61a73f32..00000000 --- a/speech_to_text/android/src/main/AndroidManifest.xml +++ /dev/null @@ -1,3 +0,0 @@ - - diff --git a/speech_to_text/android/src/main/kotlin/com/csdcorp/speech_to_text/SpeechToTextPlugin.kt b/speech_to_text/android/src/main/kotlin/com/csdcorp/speech_to_text/SpeechToTextPlugin.kt deleted file mode 100644 index 7954add3..00000000 --- a/speech_to_text/android/src/main/kotlin/com/csdcorp/speech_to_text/SpeechToTextPlugin.kt +++ /dev/null @@ -1,595 +0,0 @@ -package com.csdcorp.speech_to_text - -import androidx.annotation.NonNull; -import io.flutter.embedding.engine.plugins.FlutterPlugin -import android.Manifest -import android.annotation.TargetApi -import android.app.Activity -import android.content.Intent -import android.content.pm.PackageManager -import android.os.Build -import android.os.Bundle -import android.speech.RecognitionListener -import android.speech.SpeechRecognizer.createSpeechRecognizer -import android.speech.RecognizerIntent -import android.speech.SpeechRecognizer -import androidx.core.app.ActivityCompat -import androidx.core.content.ContextCompat -import io.flutter.plugin.common.MethodCall -import io.flutter.plugin.common.MethodChannel -import io.flutter.plugin.common.MethodChannel.MethodCallHandler -import io.flutter.plugin.common.MethodChannel.Result -import io.flutter.plugin.common.PluginRegistry -import io.flutter.plugin.common.PluginRegistry.Registrar -import org.json.JSONObject -import android.content.Context -import android.content.BroadcastReceiver -import android.os.Handler -import android.os.Looper -import android.util.Log -import io.flutter.embedding.engine.plugins.activity.ActivityAware -import io.flutter.embedding.engine.plugins.activity.ActivityPluginBinding -import io.flutter.plugin.common.BinaryMessenger -import org.json.JSONArray -import java.util.* - - -enum class SpeechToTextErrors { - multipleRequests, - unimplemented, - noLanguageIntent, - recognizerNotAvailable, - missingOrInvalidArg, - unknown -} - -enum class SpeechToTextCallbackMethods { - textRecognition, - notifyStatus, - notifyError, - soundLevelChange, -} - -enum class SpeechToTextStatus { - listening, - notListening, - unavailable, - available, -} - -enum class ListenMode { - deviceDefault, - dictation, - search, - confirmation, -} - -const val pluginChannelName = "plugin.csdcorp.com/speech_to_text" - -@TargetApi(8) -/** SpeechToTextPlugin */ -public class SpeechToTextPlugin : - MethodCallHandler, RecognitionListener, - PluginRegistry.RequestPermissionsResultListener, FlutterPlugin, - ActivityAware { - private var pluginContext: Context? = null - private var channel: MethodChannel? = null - private val minSdkForSpeechSupport = 21 - private val speechToTextPermissionCode = 28521 - private val missingConfidence: Double = -1.0 - private val logTag = "SpeechToTextPlugin" - private var currentActivity: Activity? = null - private var activeResult: Result? = null - private var initializedSuccessfully: Boolean = false - private var permissionToRecordAudio: Boolean = false - private var listening = false - private var debugLogging: Boolean = false - private var speechRecognizer: SpeechRecognizer? = null - private var recognizerIntent: Intent? = null - private var previousRecognizerLang: String? = null - private var previousPartialResults: Boolean = true - private var previousListenMode: ListenMode = ListenMode.deviceDefault - private var lastFinalTime: Long = 0 - private val handler: Handler = Handler(Looper.getMainLooper()) - private val defaultLanguageTag: String = Locale.getDefault().toLanguageTag() - - override fun onAttachedToEngine(@NonNull flutterPluginBinding: FlutterPlugin.FlutterPluginBinding) { - - onAttachedToEngine(flutterPluginBinding.getApplicationContext(), flutterPluginBinding.getBinaryMessenger()); - } - - // This static function is optional and equivalent to onAttachedToEngine. It supports the old - // pre-Flutter-1.12 Android projects. You are encouraged to continue supporting - // plugin registration via this function while apps migrate to use the new Android APIs - // post-flutter-1.12 via https://flutter.dev/go/android-project-migration. - // - // It is encouraged to share logic between onAttachedToEngine and registerWith to keep - // them functionally equivalent. Only one of onAttachedToEngine or registerWith will be called - // depending on the user's project. onAttachedToEngine or registerWith must both be defined - // in the same class. - companion object { - @JvmStatic - fun registerWith(registrar: Registrar) { - val speechPlugin = SpeechToTextPlugin() - speechPlugin.currentActivity = registrar.activity() - registrar.addRequestPermissionsResultListener(speechPlugin) - speechPlugin.onAttachedToEngine(registrar.context(), registrar.messenger()) - } - } - - private fun onAttachedToEngine(applicationContext: Context, messenger: BinaryMessenger) { - this.pluginContext = applicationContext; - channel = MethodChannel(messenger, pluginChannelName) - channel?.setMethodCallHandler(this) - } - - override fun onDetachedFromEngine(@NonNull binding: FlutterPlugin.FlutterPluginBinding) { - this.pluginContext = null; - channel?.setMethodCallHandler(null) - channel = null - } - - override fun onDetachedFromActivity() { - currentActivity = null - } - - override fun onReattachedToActivityForConfigChanges(binding: ActivityPluginBinding) { - currentActivity = binding.activity - binding.addRequestPermissionsResultListener(this) - } - - override fun onAttachedToActivity(binding: ActivityPluginBinding) { - currentActivity = binding.activity - binding.addRequestPermissionsResultListener(this) - } - - override fun onDetachedFromActivityForConfigChanges() { - currentActivity = null - } - - override fun onMethodCall(@NonNull call: MethodCall, @NonNull rawrResult: Result) { - val result = ChannelResultWrapper(rawrResult) - try { - when (call.method) { - "has_permission" -> hasPermission(result) - "initialize" -> { - var dlog = call.argument("debugLogging") - if (null != dlog) { - debugLogging = dlog - } - initialize(result) - } - "listen" -> { - var localeId = call.argument("localeId") - if (null == localeId) { - localeId = defaultLanguageTag - } - var partialResults = call.argument("partialResults") - if (null == partialResults) { - partialResults = true - } - val listenModeIndex = call.argument("listenMode") - if ( null == listenModeIndex ) { - result.error(SpeechToTextErrors.missingOrInvalidArg.name, - "listenMode is required", null) - return - } - startListening(result, localeId, partialResults, listenModeIndex ) - } - "stop" -> stopListening(result) - "cancel" -> cancelListening(result) - "locales" -> locales(result) - else -> result.notImplemented() - } - } catch (exc: Exception) { - Log.e(logTag, "Unexpected exception", exc) - result.error(SpeechToTextErrors.unknown.name, - "Unexpected exception", exc.localizedMessage) - } - } - - private fun hasPermission(result: Result) { - if (sdkVersionTooLow(result)) { - return - } - debugLog("Start has_permission") - val localContext = pluginContext - if (localContext != null) { - val hasPerm = ContextCompat.checkSelfPermission(localContext, - Manifest.permission.RECORD_AUDIO) == PackageManager.PERMISSION_GRANTED - result.success(hasPerm) - } - } - - private fun initialize(result: Result) { - if (sdkVersionTooLow(result)) { - return - } - debugLog("Start initialize") - if (null != activeResult) { - result.error(SpeechToTextErrors.multipleRequests.name, - "Only one initialize at a time", null) - return - } - activeResult = result - val localContext = pluginContext - initializeIfPermitted(pluginContext) - } - - private fun sdkVersionTooLow(result: Result): Boolean { - if (Build.VERSION.SDK_INT < minSdkForSpeechSupport) { - result.success(false) - return true; - } - return false; - } - - private fun isNotInitialized(result: Result): Boolean { - if (!initializedSuccessfully || null == pluginContext) { - result.success(false) - } - return !initializedSuccessfully - } - - private fun isListening(): Boolean { - return listening - } - - private fun isNotListening(): Boolean { - return !listening - } - - private fun startListening(result: Result, languageTag: String, partialResults: Boolean, - listenModeIndex: Int) { - if (sdkVersionTooLow(result) || isNotInitialized(result) || isListening()) { - return - } - debugLog("Start listening") - var listenMode = ListenMode.deviceDefault - if ( listenModeIndex == ListenMode.dictation.ordinal) { - listenMode = ListenMode.dictation - } - setupRecognizerIntent(languageTag, partialResults, listenMode) - handler.post { - run { - speechRecognizer?.startListening(recognizerIntent) - } - } - notifyListening(isRecording = true) - result.success(true) - debugLog("Start listening done") - } - - private fun stopListening(result: Result) { - if (sdkVersionTooLow(result) || isNotInitialized(result) || isNotListening()) { - return - } - debugLog("Stop listening") - handler.post { - run { - speechRecognizer?.stopListening() - } - } - notifyListening(isRecording = false) - result.success(true) - debugLog("Stop listening done") - } - - private fun cancelListening(result: Result) { - if (sdkVersionTooLow(result) || isNotInitialized(result) || isNotListening()) { - return - } - debugLog("Cancel listening") - handler.post { - run { - speechRecognizer?.cancel() - } - } - notifyListening(isRecording = false) - result.success(true) - debugLog("Cancel listening done") - } - - private fun locales(result: Result) { - if (sdkVersionTooLow(result) || isNotInitialized(result)) { - return - } - var detailsIntent = RecognizerIntent.getVoiceDetailsIntent(pluginContext) - if (null == detailsIntent) { - detailsIntent = Intent(RecognizerIntent.ACTION_GET_LANGUAGE_DETAILS) - } - if (null == detailsIntent) { - result.error(SpeechToTextErrors.noLanguageIntent.name, - "Could not get voice details", null) - return - } - pluginContext?.sendOrderedBroadcast( - detailsIntent, null, LanguageDetailsChecker(result), - null, Activity.RESULT_OK, null, null) - } - - private fun notifyListening(isRecording: Boolean) { - debugLog("Notify listening") - listening = isRecording - val status = when (isRecording) { - true -> SpeechToTextStatus.listening.name - false -> SpeechToTextStatus.notListening.name - } - channel?.invokeMethod(SpeechToTextCallbackMethods.notifyStatus.name, status) - debugLog("Notify listening done") - } - - private fun updateResults(speechBundle: Bundle?, isFinal: Boolean) { - if (isDuplicateFinal( isFinal )) { - debugLog("Discarding duplicate final") - return - } - val userSaid = speechBundle?.getStringArrayList(SpeechRecognizer.RESULTS_RECOGNITION) - if (null != userSaid && userSaid.isNotEmpty()) { - val speechResult = JSONObject() - speechResult.put("finalResult", isFinal) - val confidence = speechBundle?.getFloatArray(SpeechRecognizer.CONFIDENCE_SCORES) - val alternates = JSONArray() - for (resultIndex in 0..userSaid.size - 1) { - val speechWords = JSONObject() - speechWords.put("recognizedWords", userSaid[resultIndex]) - if (null != confidence && confidence.size >= userSaid.size) { - speechWords.put("confidence", confidence[resultIndex]) - } else { - speechWords.put("confidence", missingConfidence) - } - alternates.put(speechWords) - } - speechResult.put("alternates", alternates) - val jsonResult = speechResult.toString() - debugLog("Calling results callback") - channel?.invokeMethod(SpeechToTextCallbackMethods.textRecognition.name, - jsonResult) - } - } - - private fun isDuplicateFinal( isFinal: Boolean ) : Boolean { - if ( !isFinal ) { - return false - } - val delta = System.currentTimeMillis() - lastFinalTime - lastFinalTime = System.currentTimeMillis() - return delta >= 0 && delta < 100 - } - - private fun initializeIfPermitted(context: Context?) { - val localContext = context - if (null == localContext) { - completeInitialize() - return - } - permissionToRecordAudio = ContextCompat.checkSelfPermission(localContext, - Manifest.permission.RECORD_AUDIO) == PackageManager.PERMISSION_GRANTED - debugLog("Checked permission") - if (!permissionToRecordAudio) { - val localActivity = currentActivity - if (null != localActivity) { - debugLog("Requesting permission") - ActivityCompat.requestPermissions(localActivity, - arrayOf(Manifest.permission.RECORD_AUDIO), speechToTextPermissionCode) - } else { - debugLog("no permission, no activity, completing") - completeInitialize() - } - } else { - debugLog("has permission, completing") - completeInitialize() - } - debugLog("leaving initializeIfPermitted") - } - - private fun completeInitialize() { - - debugLog("completeInitialize") - if (permissionToRecordAudio) { - debugLog("Testing recognition availability") - if (!SpeechRecognizer.isRecognitionAvailable(pluginContext)) { - Log.e(logTag, "Speech recognition not available on this device") - activeResult?.error(SpeechToTextErrors.recognizerNotAvailable.name, - "Speech recognition not available on this device", "") - activeResult = null - return - } - - debugLog("Creating recognizer") - speechRecognizer = createSpeechRecognizer(pluginContext).apply { - debugLog("Setting listener") - setRecognitionListener(this@SpeechToTextPlugin) - } - if (null == speechRecognizer) { - Log.e(logTag, "Speech recognizer null") - activeResult?.error( - SpeechToTextErrors.recognizerNotAvailable.name, - "Speech recognizer null", "") - activeResult = null - } - - debugLog("before setup intent") - setupRecognizerIntent(defaultLanguageTag, true, ListenMode.deviceDefault) - debugLog("after setup intent") - } - - initializedSuccessfully = permissionToRecordAudio - debugLog("sending result") - activeResult?.success(permissionToRecordAudio) - debugLog("leaving complete") - activeResult = null - } - - private fun setupRecognizerIntent(languageTag: String, partialResults: Boolean, listenMode: ListenMode) { - debugLog("setupRecognizerIntent") - if (previousRecognizerLang == null || - previousRecognizerLang != languageTag || - partialResults != previousPartialResults || previousListenMode != listenMode ) { - previousRecognizerLang = languageTag; - previousPartialResults = partialResults - previousListenMode = listenMode - handler.post { - run { - recognizerIntent = Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH).apply { - debugLog("In RecognizerIntent apply") - putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, RecognizerIntent.LANGUAGE_MODEL_FREE_FORM) - debugLog("put model") - val localContext = pluginContext - if (null != localContext) { - putExtra(RecognizerIntent.EXTRA_CALLING_PACKAGE, - localContext.applicationInfo.packageName) - } - debugLog("put package") - putExtra(RecognizerIntent.EXTRA_PARTIAL_RESULTS, partialResults) - debugLog("put partial") - if (languageTag != Locale.getDefault().toLanguageTag()) { - putExtra(RecognizerIntent.EXTRA_LANGUAGE, languageTag); - debugLog("put languageTag") - } - } - } - } - } - } - - override fun onRequestPermissionsResult(requestCode: Int, permissions: Array?, - grantResults: IntArray?): Boolean { - when (requestCode) { - speechToTextPermissionCode -> { - if (null != grantResults) { - permissionToRecordAudio = grantResults.isNotEmpty() && - grantResults.get(0) == PackageManager.PERMISSION_GRANTED - } - completeInitialize() - return true - } - } - return false - } - - - override fun onPartialResults(results: Bundle?) = updateResults(results, false) - override fun onResults(results: Bundle?) = updateResults(results, true) - override fun onEndOfSpeech() = notifyListening(isRecording = false) - - override fun onError(errorCode: Int) { - val errorMsg = when (errorCode) { - SpeechRecognizer.ERROR_AUDIO -> "error_audio_error" - SpeechRecognizer.ERROR_CLIENT -> "error_client" - SpeechRecognizer.ERROR_INSUFFICIENT_PERMISSIONS -> "error_permission" - SpeechRecognizer.ERROR_NETWORK -> "error_network" - SpeechRecognizer.ERROR_NETWORK_TIMEOUT -> "error_network_timeout" - SpeechRecognizer.ERROR_NO_MATCH -> "error_no_match" - SpeechRecognizer.ERROR_RECOGNIZER_BUSY -> "error_busy" - SpeechRecognizer.ERROR_SERVER -> "error_server" - SpeechRecognizer.ERROR_SPEECH_TIMEOUT -> "error_speech_timeout" - else -> "error_unknown" - } - sendError(errorMsg) - } - - private fun debugLog( msg: String ) { - if ( debugLogging ) { - Log.d( logTag, msg ) - } - } - - private fun sendError(errorMsg: String) { - val speechError = JSONObject() - speechError.put("errorMsg", errorMsg) - speechError.put("permanent", true) - handler.post { - run { - channel?.invokeMethod(SpeechToTextCallbackMethods.notifyError.name, speechError.toString()) - } - } - } - - override fun onRmsChanged(rmsdB: Float) { - handler.post { - run { - channel?.invokeMethod(SpeechToTextCallbackMethods.soundLevelChange.name, rmsdB) - } - } - } - - override fun onReadyForSpeech(p0: Bundle?) {} - override fun onBufferReceived(p0: ByteArray?) {} - override fun onEvent(p0: Int, p1: Bundle?) {} - override fun onBeginningOfSpeech() {} -} - -// See https://stackoverflow.com/questions/10538791/how-to-set-the-language-in-speech-recognition-on-android/10548680#10548680 -class LanguageDetailsChecker(flutterResult: Result) : BroadcastReceiver() { - private val result: Result = flutterResult - private var supportedLanguages: List? = null - - private var languagePreference: String? = null - - override fun onReceive(context: Context, intent: Intent) { - val results = getResultExtras(true) - if (results.containsKey(RecognizerIntent.EXTRA_LANGUAGE_PREFERENCE)) { - languagePreference = results.getString(RecognizerIntent.EXTRA_LANGUAGE_PREFERENCE) - } - if (results.containsKey(RecognizerIntent.EXTRA_SUPPORTED_LANGUAGES)) { - supportedLanguages = results.getStringArrayList( - RecognizerIntent.EXTRA_SUPPORTED_LANGUAGES) - createResponse(supportedLanguages) - } - } - - private fun createResponse(supportedLanguages: List?) { - val currentLocale = Locale.getDefault() - val localeNames = ArrayList() - localeNames.add(buildIdNameForLocale(currentLocale)) - if (null != supportedLanguages) { - for (lang in supportedLanguages) { - if (currentLocale.toLanguageTag() == lang) { - continue - } - val locale = Locale.forLanguageTag(lang) - localeNames.add(buildIdNameForLocale(locale)) - } - } - result.success(localeNames) - - } - - private fun buildIdNameForLocale(locale: Locale): String { - val name = locale.displayName.replace(':', ' ') - return "${locale.language}_${locale.country}:$name" - } -} - -private class ChannelResultWrapper(result: Result) : Result { - // Caller handler - val handler: Handler = Handler(Looper.getMainLooper()) - val result: Result = result - - // make sure to respond in the caller thread - override fun success(results: Any?) { - - handler.post { - run { - result.success(results); - } - } - } - - override fun error(errorCode: String?, errorMessage: String?, data: Any?) { - handler.post { - run { - result.error(errorCode, errorMessage, data); - } - } - } - - override fun notImplemented() { - handler.post { - run { - result.notImplemented(); - } - } - } -} diff --git a/speech_to_text/example/.gitignore b/speech_to_text/example/.gitignore deleted file mode 100644 index 2ddde2a5..00000000 --- a/speech_to_text/example/.gitignore +++ /dev/null @@ -1,73 +0,0 @@ -# Miscellaneous -*.class -*.log -*.pyc -*.swp -.DS_Store -.atom/ -.buildlog/ -.history -.svn/ - -# IntelliJ related -*.iml -*.ipr -*.iws -.idea/ - -# The .vscode folder contains launch configuration and tasks you configure in -# VS Code which you may wish to be included in version control, so this line -# is commented out by default. -#.vscode/ - -# Flutter/Dart/Pub related -**/doc/api/ -.dart_tool/ -.flutter-plugins -.packages -.pub-cache/ -.pub/ -/build/ - -# Android related -**/android/**/gradle-wrapper.jar -**/android/.gradle -**/android/captures/ -**/android/gradlew -**/android/gradlew.bat -**/android/local.properties -**/android/**/GeneratedPluginRegistrant.java - -# iOS/XCode related -**/ios/**/*.mode1v3 -**/ios/**/*.mode2v3 -**/ios/**/*.moved-aside -**/ios/**/*.pbxuser -**/ios/**/*.perspectivev3 -**/ios/**/*sync/ -**/ios/**/.sconsign.dblite -**/ios/**/.tags* -**/ios/**/.vagrant/ -**/ios/**/DerivedData/ -**/ios/**/Icon? -**/ios/**/Pods/ -**/ios/**/.symlinks/ -**/ios/**/profile -**/ios/**/xcuserdata -**/ios/.generated/ -**/ios/Flutter/App.framework -**/ios/Flutter/Flutter.framework -**/ios/Flutter/Generated.xcconfig -**/ios/Flutter/app.flx -**/ios/Flutter/app.zip -**/ios/Flutter/flutter_assets/ -**/ios/Flutter/flutter_export_environment.sh -**/ios/ServiceDefinitions.json -**/ios/Runner/GeneratedPluginRegistrant.* - -# Exceptions to above rules. -!**/ios/**/default.mode1v3 -!**/ios/**/default.mode2v3 -!**/ios/**/default.pbxuser -!**/ios/**/default.perspectivev3 -!/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages diff --git a/speech_to_text/example/.metadata b/speech_to_text/example/.metadata deleted file mode 100644 index aeb01ee2..00000000 --- a/speech_to_text/example/.metadata +++ /dev/null @@ -1,10 +0,0 @@ -# This file tracks properties of this Flutter project. -# Used by Flutter tool to assess capabilities and perform upgrades etc. -# -# This file should be version controlled and should not be manually edited. - -version: - revision: 2d2a1ffec95cc70a3218872a2cd3f8de4933c42f - channel: stable - -project_type: app diff --git a/speech_to_text/example/README.md b/speech_to_text/example/README.md deleted file mode 100644 index 92252821..00000000 --- a/speech_to_text/example/README.md +++ /dev/null @@ -1,155 +0,0 @@ -# speech_to_text_example - -Demonstrates how to use the speech_to_text plugin. This example requires -that the plugin has been installed. It initializes speech recognition, -listens for words and prints them. - - -## Source - -```dart -import 'package:flutter/material.dart'; -import 'dart:async'; - -import 'package:speech_to_text/speech_to_text.dart'; -import 'package:speech_to_text/speech_recognition_result.dart'; -import 'package:speech_to_text/speech_recognition_error.dart'; - -void main() => runApp(MyApp()); - -class MyApp extends StatefulWidget { - @override - _MyAppState createState() => _MyAppState(); -} - -class _MyAppState extends State { - bool _hasSpeech = false; - String lastWords = ""; - String lastError = ""; - String lastStatus = ""; - final SpeechToText speech = SpeechToText(); - - @override - void initState() { - super.initState(); - initSpeechState(); - } - - Future initSpeechState() async { - bool hasSpeech = await speech.initialize(onError: errorListener, onStatus: statusListener ); - - if (!mounted) return; - setState(() { - _hasSpeech = hasSpeech; - }); - } - - @override - Widget build(BuildContext context) { - return MaterialApp( - home: Scaffold( - appBar: AppBar( - title: const Text('Speech to Text Example'), - ), - body: _hasSpeech - ? Column(children: [ - Expanded( - child: Center( - child: Text('Speech recognition available'), - ), - ), - Expanded( - child: Row( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - FlatButton( - child: Text('Start'), - onPressed: startListening, - ), - FlatButton( - child: Text('Stop'), - onPressed: stopListening, - ), - FlatButton( - child: Text('Cancel'), - onPressed:cancelListening, - ), - ], - ), - ), - Expanded( - child: Column( - children: [ - Center( - child: Text('Recognized Words'), - ), - Center( - child: Text(lastWords), - ), - ], - ), - ), - Expanded( - child: Column( - children: [ - Center( - child: Text('Error'), - ), - Center( - child: Text(lastError), - ), - ], - ), - ), - Expanded( - child: Center( - child: speech.isListening ? Text("I'm listening...") : Text( 'Not listening' ), - ), - ), - ]) - : Center( child: Text('Speech recognition unavailable', style: TextStyle(fontSize: 20.0, fontWeight: FontWeight.bold))), - ), - ); - } - - void startListening() { - lastWords = ""; - lastError = ""; - speech.listen(onResult: resultListener ); - setState(() { - - }); - } - - void stopListening() { - speech.stop( ); - setState(() { - - }); - } - - void cancelListening() { - speech.cancel( ); - setState(() { - - }); - } - - void resultListener(SpeechRecognitionResult result) { - setState(() { - lastWords = "${result.recognizedWords} - ${result.finalResult}"; - }); - } - - void errorListener(SpeechRecognitionError error ) { - setState(() { - lastError = "${error.errorMsg} - ${error.permanent}"; - }); - } - void statusListener(String status ) { - setState(() { - lastStatus = "$status"; - }); - } -} -``` \ No newline at end of file diff --git a/speech_to_text/example/android/.project b/speech_to_text/example/android/.project deleted file mode 100644 index d7d48141..00000000 --- a/speech_to_text/example/android/.project +++ /dev/null @@ -1,17 +0,0 @@ - - - android___ - Project android___ created by Buildship. - - - - - org.eclipse.buildship.core.gradleprojectbuilder - - - - - - org.eclipse.buildship.core.gradleprojectnature - - diff --git a/speech_to_text/example/android/.settings/org.eclipse.buildship.core.prefs b/speech_to_text/example/android/.settings/org.eclipse.buildship.core.prefs deleted file mode 100644 index e8895216..00000000 --- a/speech_to_text/example/android/.settings/org.eclipse.buildship.core.prefs +++ /dev/null @@ -1,2 +0,0 @@ -connection.project.dir= -eclipse.preferences.version=1 diff --git a/speech_to_text/example/android/app/build.gradle b/speech_to_text/example/android/app/build.gradle deleted file mode 100644 index 104069d3..00000000 --- a/speech_to_text/example/android/app/build.gradle +++ /dev/null @@ -1,67 +0,0 @@ -def localProperties = new Properties() -def localPropertiesFile = rootProject.file('local.properties') -if (localPropertiesFile.exists()) { - localPropertiesFile.withReader('UTF-8') { reader -> - localProperties.load(reader) - } -} - -def flutterRoot = localProperties.getProperty('flutter.sdk') -if (flutterRoot == null) { - throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") -} - -def flutterVersionCode = localProperties.getProperty('flutter.versionCode') -if (flutterVersionCode == null) { - flutterVersionCode = '1' -} - -def flutterVersionName = localProperties.getProperty('flutter.versionName') -if (flutterVersionName == null) { - flutterVersionName = '1.0' -} - -apply plugin: 'com.android.application' -apply plugin: 'kotlin-android' -apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" - -android { - compileSdkVersion 28 - - sourceSets { - main.java.srcDirs += 'src/main/kotlin' - } - - lintOptions { - disable 'InvalidPackage' - } - - defaultConfig { - // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). - applicationId "com.csdcorp.speech_to_text_example" - minSdkVersion 18 - targetSdkVersion 28 - versionCode flutterVersionCode.toInteger() - versionName flutterVersionName - testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" - } - - buildTypes { - release { - // TODO: Add your own signing config for the release build. - // Signing with the debug keys for now, so `flutter run --release` works. - signingConfig signingConfigs.debug - } - } -} - -flutter { - source '../..' -} - -dependencies { - implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" - testImplementation 'junit:junit:4.12' - androidTestImplementation 'androidx.test:runner:1.1.1' - androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1' -} diff --git a/speech_to_text/example/android/app/src/debug/AndroidManifest.xml b/speech_to_text/example/android/app/src/debug/AndroidManifest.xml deleted file mode 100644 index 36edf838..00000000 --- a/speech_to_text/example/android/app/src/debug/AndroidManifest.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - diff --git a/speech_to_text/example/android/app/src/main/AndroidManifest.xml b/speech_to_text/example/android/app/src/main/AndroidManifest.xml deleted file mode 100644 index b0912061..00000000 --- a/speech_to_text/example/android/app/src/main/AndroidManifest.xml +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - - - - - - - - - diff --git a/speech_to_text/example/android/app/src/main/kotlin/com/csdcorp/speech_to_text_example/MainActivity.kt b/speech_to_text/example/android/app/src/main/kotlin/com/csdcorp/speech_to_text_example/MainActivity.kt deleted file mode 100644 index f44e470e..00000000 --- a/speech_to_text/example/android/app/src/main/kotlin/com/csdcorp/speech_to_text_example/MainActivity.kt +++ /dev/null @@ -1,12 +0,0 @@ -package com.csdcorp.speech_to_text_example - -import androidx.annotation.NonNull; -import io.flutter.embedding.android.FlutterActivity -import io.flutter.embedding.engine.FlutterEngine -import io.flutter.plugins.GeneratedPluginRegistrant - -class MainActivity: FlutterActivity() { - override fun configureFlutterEngine(@NonNull flutterEngine: FlutterEngine) { - GeneratedPluginRegistrant.registerWith(flutterEngine); - } -} diff --git a/speech_to_text/example/android/app/src/main/res/drawable/launch_background.xml b/speech_to_text/example/android/app/src/main/res/drawable/launch_background.xml deleted file mode 100644 index 304732f8..00000000 --- a/speech_to_text/example/android/app/src/main/res/drawable/launch_background.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - diff --git a/speech_to_text/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png b/speech_to_text/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png deleted file mode 100644 index db77bb4b7b0906d62b1847e87f15cdcacf6a4f29..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 544 zcmeAS@N?(olHy`uVBq!ia0vp^9w5xY3?!3`olAj~WQl7;NpOBzNqJ&XDuZK6ep0G} zXKrG8YEWuoN@d~6R2!h8bpbvhu0Wd6uZuB!w&u2PAxD2eNXD>P5D~Wn-+_Wa#27Xc zC?Zj|6r#X(-D3u$NCt}(Ms06KgJ4FxJVv{GM)!I~&n8Bnc94O7-Hd)cjDZswgC;Qs zO=b+9!WcT8F?0rF7!Uys2bs@gozCP?z~o%U|N3vA*22NaGQG zlg@K`O_XuxvZ&Ks^m&R!`&1=spLvfx7oGDKDwpwW`#iqdw@AL`7MR}m`rwr|mZgU`8P7SBkL78fFf!WnuYWm$5Z0 zNXhDbCv&49sM544K|?c)WrFfiZvCi9h0O)B3Pgg&ebxsLQ05GG~ AQ2+n{ diff --git a/speech_to_text/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png b/speech_to_text/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png deleted file mode 100644 index 17987b79bb8a35cc66c3c1fd44f5a5526c1b78be..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 442 zcmeAS@N?(olHy`uVBq!ia0vp^1|ZDA3?vioaBc-sk|nMYCBgY=CFO}lsSJ)O`AMk? zp1FzXsX?iUDV2pMQ*D5Xx&nMcT!A!W`0S9QKQy;}1Cl^CgaH=;G9cpY;r$Q>i*pfB zP2drbID<_#qf;rPZx^FqH)F_D#*k@@q03KywUtLX8Ua?`H+NMzkczFPK3lFz@i_kW%1NOn0|D2I9n9wzH8m|-tHjsw|9>@K=iMBhxvkv6m8Y-l zytQ?X=U+MF$@3 zt`~i=@j|6y)RWMK--}M|=T`o&^Ni>IoWKHEbBXz7?A@mgWoL>!*SXo`SZH-*HSdS+ yn*9;$7;m`l>wYBC5bq;=U}IMqLzqbYCidGC!)_gkIk_C@Uy!y&wkt5C($~2D>~)O*cj@FGjOCM)M>_ixfudOh)?xMu#Fs z#}Y=@YDTwOM)x{K_j*Q;dPdJ?Mz0n|pLRx{4n|)f>SXlmV)XB04CrSJn#dS5nK2lM zrZ9#~WelCp7&e13Y$jvaEXHskn$2V!!DN-nWS__6T*l;H&Fopn?A6HZ-6WRLFP=R` zqG+CE#d4|IbyAI+rJJ`&x9*T`+a=p|0O(+s{UBcyZdkhj=yS1>AirP+0R;mf2uMgM zC}@~JfByORAh4SyRgi&!(cja>F(l*O+nd+@4m$|6K6KDn_&uvCpV23&>G9HJp{xgg zoq1^2_p9@|WEo z*X_Uko@K)qYYv~>43eQGMdbiGbo>E~Q& zrYBH{QP^@Sti!`2)uG{irBBq@y*$B zi#&(U-*=fp74j)RyIw49+0MRPMRU)+a2r*PJ$L5roHt2$UjExCTZSbq%V!HeS7J$N zdG@vOZB4v_lF7Plrx+hxo7(fCV&}fHq)$ diff --git a/speech_to_text/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/speech_to_text/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png deleted file mode 100644 index d5f1c8d34e7a88e3f88bea192c3a370d44689c3c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1031 zcmeAS@N?(olHy`uVBq!ia0vp^6F``Q8Ax83A=Cw=BuiW)N`mv#O3D+9QW+dm@{>{( zJaZG%Q-e|yQz{EjrrIztFa`(sgt!6~Yi|1%a`XoT0ojZ}lNrNjb9xjc(B0U1_% zz5^97Xt*%oq$rQy4?0GKNfJ44uvxI)gC`h-NZ|&0-7(qS@?b!5r36oQ}zyZrNO3 zMO=Or+<~>+A&uN&E!^Sl+>xE!QC-|oJv`ApDhqC^EWD|@=#J`=d#Xzxs4ah}w&Jnc z$|q_opQ^2TrnVZ0o~wh<3t%W&flvYGe#$xqda2bR_R zvPYgMcHgjZ5nSA^lJr%;<&0do;O^tDDh~=pIxA#coaCY>&N%M2^tq^U%3DB@ynvKo}b?yu-bFc-u0JHzced$sg7S3zqI(2 z#Km{dPr7I=pQ5>FuK#)QwK?Y`E`B?nP+}U)I#c1+FM*1kNvWG|a(TpksZQ3B@sD~b zpQ2)*V*TdwjFOtHvV|;OsiDqHi=6%)o4b!)x$)%9pGTsE z-JL={-Ffv+T87W(Xpooq<`r*VzWQcgBN$$`u}f>-ZQI1BB8ykN*=e4rIsJx9>z}*o zo~|9I;xof diff --git a/speech_to_text/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/speech_to_text/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png deleted file mode 100644 index 4d6372eebdb28e45604e46eeda8dd24651419bc0..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1443 zcmb`G{WsKk6vsdJTdFg%tJav9_E4vzrOaqkWF|A724Nly!y+?N9`YV6wZ}5(X(D_N(?!*n3`|_r0Hc?=PQw&*vnU?QTFY zB_MsH|!j$PP;I}?dppoE_gA(4uc!jV&0!l7_;&p2^pxNo>PEcNJv za5_RT$o2Mf!<+r?&EbHH6nMoTsDOa;mN(wv8RNsHpG)`^ymG-S5By8=l9iVXzN_eG%Xg2@Xeq76tTZ*dGh~Lo9vl;Zfs+W#BydUw zCkZ$o1LqWQO$FC9aKlLl*7x9^0q%0}$OMlp@Kk_jHXOjofdePND+j!A{q!8~Jn+s3 z?~~w@4?egS02}8NuulUA=L~QQfm;MzCGd)XhiftT;+zFO&JVyp2mBww?;QByS_1w! zrQlx%{^cMj0|Bo1FjwY@Q8?Hx0cIPF*@-ZRFpPc#bBw{5@tD(5%sClzIfl8WU~V#u zm5Q;_F!wa$BSpqhN>W@2De?TKWR*!ujY;Yylk_X5#~V!L*Gw~;$%4Q8~Mad z@`-kG?yb$a9cHIApZDVZ^U6Xkp<*4rU82O7%}0jjHlK{id@?-wpN*fCHXyXh(bLt* zPc}H-x0e4E&nQ>y%B-(EL=9}RyC%MyX=upHuFhAk&MLbsF0LP-q`XnH78@fT+pKPW zu72MW`|?8ht^tz$iC}ZwLp4tB;Q49K!QCF3@!iB1qOI=?w z7In!}F~ij(18UYUjnbmC!qKhPo%24?8U1x{7o(+?^Zu0Hx81|FuS?bJ0jgBhEMzf< zCgUq7r2OCB(`XkKcN-TL>u5y#dD6D!)5W?`O5)V^>jb)P)GBdy%t$uUMpf$SNV31$ zb||OojAbvMP?T@$h_ZiFLFVHDmbyMhJF|-_)HX3%m=CDI+ID$0^C>kzxprBW)hw(v zr!Gmda);ICoQyhV_oP5+C%?jcG8v+D@9f?Dk*!BxY}dazmrT@64UrP3hlslANK)bq z$67n83eh}OeW&SV@HG95P|bjfqJ7gw$e+`Hxo!4cx`jdK1bJ>YDSpGKLPZ^1cv$ek zIB?0S<#tX?SJCLWdMd{-ME?$hc7A$zBOdIJ)4!KcAwb=VMov)nK;9z>x~rfT1>dS+ zZ6#`2v@`jgbqq)P22H)Tx2CpmM^o1$B+xT6`(v%5xJ(?j#>Q$+rx_R|7TzDZe{J6q zG1*EcU%tE?!kO%^M;3aM6JN*LAKUVb^xz8-Pxo#jR5(-KBeLJvA@-gxNHx0M-ZJLl z;#JwQoh~9V?`UVo#}{6ka@II>++D@%KqGpMdlQ}?9E*wFcf5(#XQnP$Dk5~%iX^>f z%$y;?M0BLp{O3a(-4A?ewryHrrD%cx#Q^%KY1H zNre$ve+vceSLZcNY4U(RBX&)oZn*Py()h)XkE?PL$!bNb{N5FVI2Y%LKEm%yvpyTP z(1P?z~7YxD~Rf<(a@_y` diff --git a/speech_to_text/example/android/app/src/main/res/values/styles.xml b/speech_to_text/example/android/app/src/main/res/values/styles.xml deleted file mode 100644 index 00fa4417..00000000 --- a/speech_to_text/example/android/app/src/main/res/values/styles.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - diff --git a/speech_to_text/example/android/app/src/profile/AndroidManifest.xml b/speech_to_text/example/android/app/src/profile/AndroidManifest.xml deleted file mode 100644 index 36edf838..00000000 --- a/speech_to_text/example/android/app/src/profile/AndroidManifest.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - diff --git a/speech_to_text/example/android/build.gradle b/speech_to_text/example/android/build.gradle deleted file mode 100644 index 13546311..00000000 --- a/speech_to_text/example/android/build.gradle +++ /dev/null @@ -1,31 +0,0 @@ -buildscript { - ext.kotlin_version = '1.3.50' - repositories { - google() - jcenter() - } - - dependencies { - classpath 'com.android.tools.build:gradle:3.6.1' - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" - } -} - -allprojects { - repositories { - google() - jcenter() - } -} - -rootProject.buildDir = '../build' -subprojects { - project.buildDir = "${rootProject.buildDir}/${project.name}" -} -subprojects { - project.evaluationDependsOn(':app') -} - -task clean(type: Delete) { - delete rootProject.buildDir -} diff --git a/speech_to_text/example/android/gradle.properties b/speech_to_text/example/android/gradle.properties deleted file mode 100644 index a6738207..00000000 --- a/speech_to_text/example/android/gradle.properties +++ /dev/null @@ -1,4 +0,0 @@ -org.gradle.jvmargs=-Xmx1536M -android.useAndroidX=true -android.enableJetifier=true -android.enableR8=true diff --git a/speech_to_text/example/android/gradle/wrapper/gradle-wrapper.properties b/speech_to_text/example/android/gradle/wrapper/gradle-wrapper.properties deleted file mode 100644 index 052e7951..00000000 --- a/speech_to_text/example/android/gradle/wrapper/gradle-wrapper.properties +++ /dev/null @@ -1,6 +0,0 @@ -#Mon Mar 16 08:57:32 EDT 2020 -distributionBase=GRADLE_USER_HOME -distributionPath=wrapper/dists -zipStoreBase=GRADLE_USER_HOME -zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip diff --git a/speech_to_text/example/android/settings.gradle b/speech_to_text/example/android/settings.gradle deleted file mode 100644 index 5a2f14fb..00000000 --- a/speech_to_text/example/android/settings.gradle +++ /dev/null @@ -1,15 +0,0 @@ -include ':app' - -def flutterProjectRoot = rootProject.projectDir.parentFile.toPath() - -def plugins = new Properties() -def pluginsFile = new File(flutterProjectRoot.toFile(), '.flutter-plugins') -if (pluginsFile.exists()) { - pluginsFile.withReader('UTF-8') { reader -> plugins.load(reader) } -} - -plugins.each { name, path -> - def pluginDirectory = flutterProjectRoot.resolve(path).resolve('android').toFile() - include ":$name" - project(":$name").projectDir = pluginDirectory -} diff --git a/speech_to_text/example/assets/sounds/speech_to_text_cancel.m4r b/speech_to_text/example/assets/sounds/speech_to_text_cancel.m4r deleted file mode 100644 index ccb3afe392f563a0c8205265f8953c5cb801794a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 14006 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 F{x65=vylJ* diff --git a/speech_to_text/example/ios/Flutter/AppFrameworkInfo.plist b/speech_to_text/example/ios/Flutter/AppFrameworkInfo.plist deleted file mode 100644 index 6b4c0f78..00000000 --- a/speech_to_text/example/ios/Flutter/AppFrameworkInfo.plist +++ /dev/null @@ -1,26 +0,0 @@ - - - - - CFBundleDevelopmentRegion - $(DEVELOPMENT_LANGUAGE) - CFBundleExecutable - App - CFBundleIdentifier - io.flutter.flutter.app - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - App - CFBundlePackageType - FMWK - CFBundleShortVersionString - 1.0 - CFBundleSignature - ???? - CFBundleVersion - 1.0 - MinimumOSVersion - 8.0 - - diff --git a/speech_to_text/example/ios/Flutter/Debug.xcconfig b/speech_to_text/example/ios/Flutter/Debug.xcconfig deleted file mode 100644 index e8efba11..00000000 --- a/speech_to_text/example/ios/Flutter/Debug.xcconfig +++ /dev/null @@ -1,2 +0,0 @@ -#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" -#include "Generated.xcconfig" diff --git a/speech_to_text/example/ios/Flutter/Flutter.podspec b/speech_to_text/example/ios/Flutter/Flutter.podspec deleted file mode 100644 index 5ca30416..00000000 --- a/speech_to_text/example/ios/Flutter/Flutter.podspec +++ /dev/null @@ -1,18 +0,0 @@ -# -# NOTE: This podspec is NOT to be published. It is only used as a local source! -# - -Pod::Spec.new do |s| - s.name = 'Flutter' - s.version = '1.0.0' - s.summary = 'High-performance, high-fidelity mobile apps.' - s.description = <<-DESC -Flutter provides an easy and productive way to build and deploy high-performance mobile apps for Android and iOS. - DESC - s.homepage = 'https://flutter.io' - s.license = { :type => 'MIT' } - s.author = { 'Flutter Dev Team' => 'flutter-dev@googlegroups.com' } - s.source = { :git => 'https://github.com/flutter/engine', :tag => s.version.to_s } - s.ios.deployment_target = '8.0' - s.vendored_frameworks = 'Flutter.framework' -end diff --git a/speech_to_text/example/ios/Flutter/Release.xcconfig b/speech_to_text/example/ios/Flutter/Release.xcconfig deleted file mode 100644 index 399e9340..00000000 --- a/speech_to_text/example/ios/Flutter/Release.xcconfig +++ /dev/null @@ -1,2 +0,0 @@ -#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" -#include "Generated.xcconfig" diff --git a/speech_to_text/example/ios/Podfile b/speech_to_text/example/ios/Podfile deleted file mode 100644 index ab7d5b46..00000000 --- a/speech_to_text/example/ios/Podfile +++ /dev/null @@ -1,90 +0,0 @@ -# Uncomment this line to define a global platform for your project -platform :ios, '10.0' - -# CocoaPods analytics sends network stats synchronously affecting flutter build latency. -ENV['COCOAPODS_DISABLE_STATS'] = 'true' - -project 'Runner', { - 'Debug' => :debug, - 'Profile' => :release, - 'Release' => :release, -} - -def parse_KV_file(file, separator='=') - file_abs_path = File.expand_path(file) - if !File.exists? file_abs_path - return []; - end - generated_key_values = {} - skip_line_start_symbols = ["#", "/"] - File.foreach(file_abs_path) do |line| - next if skip_line_start_symbols.any? { |symbol| line =~ /^\s*#{symbol}/ } - plugin = line.split(pattern=separator) - if plugin.length == 2 - podname = plugin[0].strip() - path = plugin[1].strip() - podpath = File.expand_path("#{path}", file_abs_path) - generated_key_values[podname] = podpath - else - puts "Invalid plugin specification: #{line}" - end - end - generated_key_values -end - -target 'Runner' do - use_frameworks! - use_modular_headers! - - # Flutter Pod - - copied_flutter_dir = File.join(__dir__, 'Flutter') - copied_framework_path = File.join(copied_flutter_dir, 'Flutter.framework') - copied_podspec_path = File.join(copied_flutter_dir, 'Flutter.podspec') - unless File.exist?(copied_framework_path) && File.exist?(copied_podspec_path) - # Copy Flutter.framework and Flutter.podspec to Flutter/ to have something to link against if the xcode backend script has not run yet. - # That script will copy the correct debug/profile/release version of the framework based on the currently selected Xcode configuration. - # CocoaPods will not embed the framework on pod install (before any build phases can generate) if the dylib does not exist. - - generated_xcode_build_settings_path = File.join(copied_flutter_dir, 'Generated.xcconfig') - unless File.exist?(generated_xcode_build_settings_path) - raise "Generated.xcconfig must exist. If you're running pod install manually, make sure flutter pub get is executed first" - end - generated_xcode_build_settings = parse_KV_file(generated_xcode_build_settings_path) - cached_framework_dir = generated_xcode_build_settings['FLUTTER_FRAMEWORK_DIR']; - - unless File.exist?(copied_framework_path) - FileUtils.cp_r(File.join(cached_framework_dir, 'Flutter.framework'), copied_flutter_dir) - end - unless File.exist?(copied_podspec_path) - FileUtils.cp(File.join(cached_framework_dir, 'Flutter.podspec'), copied_flutter_dir) - end - end - - # Keep pod path relative so it can be checked into Podfile.lock. - pod 'Flutter', :path => 'Flutter' - - # Plugin Pods - - # Prepare symlinks folder. We use symlinks to avoid having Podfile.lock - # referring to absolute paths on developers' machines. - system('rm -rf .symlinks') - system('mkdir -p .symlinks/plugins') - plugin_pods = parse_KV_file('../.flutter-plugins') - plugin_pods.each do |name, path| - symlink = File.join('.symlinks', 'plugins', name) - File.symlink(path, symlink) - pod name, :path => File.join(symlink, 'ios') - end -end - -# Prevent Cocoapods from embedding a second Flutter framework and causing an error with the new Xcode build system. -install! 'cocoapods', :disable_input_output_paths => true - -post_install do |installer| - installer.pods_project.targets.each do |target| - target.build_configurations.each do |config| - config.build_settings['ENABLE_BITCODE'] = 'NO' - end - end -end diff --git a/speech_to_text/example/ios/Podfile.lock b/speech_to_text/example/ios/Podfile.lock deleted file mode 100644 index 60c8b57d..00000000 --- a/speech_to_text/example/ios/Podfile.lock +++ /dev/null @@ -1,29 +0,0 @@ -PODS: - - Flutter (1.0.0) - - speech_to_text (0.0.1): - - Flutter - - Try - - Try (2.1.1) - -DEPENDENCIES: - - Flutter (from `Flutter`) - - speech_to_text (from `.symlinks/plugins/speech_to_text/ios`) - -SPEC REPOS: - trunk: - - Try - -EXTERNAL SOURCES: - Flutter: - :path: Flutter - speech_to_text: - :path: ".symlinks/plugins/speech_to_text/ios" - -SPEC CHECKSUMS: - Flutter: 0e3d915762c693b495b44d77113d4970485de6ec - speech_to_text: b43a7d99aef037bd758ed8e45d79bbac035d2dfe - Try: 5ef669ae832617b3cee58cb2c6f99fb767a4ff96 - -PODFILE CHECKSUM: 0ba44ad07df4ab62269dc769727cf0f12b1e453d - -COCOAPODS: 1.9.3 diff --git a/speech_to_text/example/ios/Runner.xcodeproj/project.pbxproj b/speech_to_text/example/ios/Runner.xcodeproj/project.pbxproj deleted file mode 100644 index c40af650..00000000 --- a/speech_to_text/example/ios/Runner.xcodeproj/project.pbxproj +++ /dev/null @@ -1,578 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 46; - objects = { - -/* Begin PBXBuildFile section */ - 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; - 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; - 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; - 9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 9740EEB21CF90195004384FC /* Debug.xcconfig */; }; - 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; - 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; - 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; - C446300A034BF27D9F1ACEF9 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E76E9615C6B4FABD88067D55 /* Pods_Runner.framework */; }; -/* End PBXBuildFile section */ - -/* Begin PBXCopyFilesBuildPhase section */ - 9705A1C41CF9048500538489 /* Embed Frameworks */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 2147483647; - dstPath = ""; - dstSubfolderSpec = 10; - files = ( - ); - name = "Embed Frameworks"; - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXCopyFilesBuildPhase section */ - -/* Begin PBXFileReference section */ - 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; - 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; - 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; - 59AFE6BB0B596A0E0811BDFF /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; }; - 6280E2A777726D2043BF80B7 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; }; - 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; }; - 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; - 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; - 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; - 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; - 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; - 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; - 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; - 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; - 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - C3909A4B7EC98A20255210E3 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; }; - E76E9615C6B4FABD88067D55 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - 97C146EB1CF9000F007C117D /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - C446300A034BF27D9F1ACEF9 /* Pods_Runner.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 7937AF765430D66F28F7FEEF /* Frameworks */ = { - isa = PBXGroup; - children = ( - E76E9615C6B4FABD88067D55 /* Pods_Runner.framework */, - ); - name = Frameworks; - sourceTree = ""; - }; - 9740EEB11CF90186004384FC /* Flutter */ = { - isa = PBXGroup; - children = ( - 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, - 9740EEB21CF90195004384FC /* Debug.xcconfig */, - 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, - 9740EEB31CF90195004384FC /* Generated.xcconfig */, - ); - name = Flutter; - sourceTree = ""; - }; - 97C146E51CF9000F007C117D = { - isa = PBXGroup; - children = ( - 9740EEB11CF90186004384FC /* Flutter */, - 97C146F01CF9000F007C117D /* Runner */, - 97C146EF1CF9000F007C117D /* Products */, - A68CCF1640763A551D35BD31 /* Pods */, - 7937AF765430D66F28F7FEEF /* Frameworks */, - ); - sourceTree = ""; - }; - 97C146EF1CF9000F007C117D /* Products */ = { - isa = PBXGroup; - children = ( - 97C146EE1CF9000F007C117D /* Runner.app */, - ); - name = Products; - sourceTree = ""; - }; - 97C146F01CF9000F007C117D /* Runner */ = { - isa = PBXGroup; - children = ( - 97C146FA1CF9000F007C117D /* Main.storyboard */, - 97C146FD1CF9000F007C117D /* Assets.xcassets */, - 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, - 97C147021CF9000F007C117D /* Info.plist */, - 97C146F11CF9000F007C117D /* Supporting Files */, - 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, - 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, - 74858FAE1ED2DC5600515810 /* AppDelegate.swift */, - 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */, - ); - path = Runner; - sourceTree = ""; - }; - 97C146F11CF9000F007C117D /* Supporting Files */ = { - isa = PBXGroup; - children = ( - ); - name = "Supporting Files"; - sourceTree = ""; - }; - A68CCF1640763A551D35BD31 /* Pods */ = { - isa = PBXGroup; - children = ( - 59AFE6BB0B596A0E0811BDFF /* Pods-Runner.debug.xcconfig */, - 6280E2A777726D2043BF80B7 /* Pods-Runner.release.xcconfig */, - C3909A4B7EC98A20255210E3 /* Pods-Runner.profile.xcconfig */, - ); - path = Pods; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - 97C146ED1CF9000F007C117D /* Runner */ = { - isa = PBXNativeTarget; - buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; - buildPhases = ( - 949FCB95217187F2C022D6A9 /* [CP] Check Pods Manifest.lock */, - 9740EEB61CF901F6004384FC /* Run Script */, - 97C146EA1CF9000F007C117D /* Sources */, - 97C146EB1CF9000F007C117D /* Frameworks */, - 97C146EC1CF9000F007C117D /* Resources */, - 9705A1C41CF9048500538489 /* Embed Frameworks */, - 3B06AD1E1E4923F5004D2608 /* Thin Binary */, - 8B0988F04B6AE44AA0304FEF /* [CP] Embed Pods Frameworks */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = Runner; - productName = Runner; - productReference = 97C146EE1CF9000F007C117D /* Runner.app */; - productType = "com.apple.product-type.application"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - 97C146E61CF9000F007C117D /* Project object */ = { - isa = PBXProject; - attributes = { - LastUpgradeCheck = 1020; - ORGANIZATIONNAME = "The Chromium Authors"; - TargetAttributes = { - 97C146ED1CF9000F007C117D = { - CreatedOnToolsVersion = 7.3.1; - DevelopmentTeam = 3X949YE9K2; - LastSwiftMigration = 0910; - }; - }; - }; - buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */; - compatibilityVersion = "Xcode 3.2"; - developmentRegion = en; - hasScannedForEncodings = 0; - knownRegions = ( - en, - Base, - ); - mainGroup = 97C146E51CF9000F007C117D; - productRefGroup = 97C146EF1CF9000F007C117D /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - 97C146ED1CF9000F007C117D /* Runner */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXResourcesBuildPhase section */ - 97C146EC1CF9000F007C117D /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, - 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, - 9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */, - 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, - 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXShellScriptBuildPhase section */ - 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "Thin Binary"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin"; - }; - 8B0988F04B6AE44AA0304FEF /* [CP] Embed Pods Frameworks */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "[CP] Embed Pods Frameworks"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; - showEnvVarsInLog = 0; - }; - 949FCB95217187F2C022D6A9 /* [CP] Check Pods Manifest.lock */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - ); - inputPaths = ( - "${PODS_PODFILE_DIR_PATH}/Podfile.lock", - "${PODS_ROOT}/Manifest.lock", - ); - name = "[CP] Check Pods Manifest.lock"; - outputFileListPaths = ( - ); - outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; - showEnvVarsInLog = 0; - }; - 9740EEB61CF901F6004384FC /* Run Script */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "Run Script"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; - }; -/* End PBXShellScriptBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - 97C146EA1CF9000F007C117D /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */, - 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin PBXVariantGroup section */ - 97C146FA1CF9000F007C117D /* Main.storyboard */ = { - isa = PBXVariantGroup; - children = ( - 97C146FB1CF9000F007C117D /* Base */, - ); - name = Main.storyboard; - sourceTree = ""; - }; - 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = { - isa = PBXVariantGroup; - children = ( - 97C147001CF9000F007C117D /* Base */, - ); - name = LaunchScreen.storyboard; - sourceTree = ""; - }; -/* End PBXVariantGroup section */ - -/* Begin XCBuildConfiguration section */ - 249021D3217E4FDB00AE95B9 /* Profile */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_NS_ASSERTIONS = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_NO_COMMON_BLOCKS = YES; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - MTL_ENABLE_DEBUG_INFO = NO; - SDKROOT = iphoneos; - TARGETED_DEVICE_FAMILY = "1,2"; - VALIDATE_PRODUCT = YES; - }; - name = Profile; - }; - 249021D4217E4FDB00AE95B9 /* Profile */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CLANG_ENABLE_MODULES = YES; - CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; - DEVELOPMENT_TEAM = 3X949YE9K2; - ENABLE_BITCODE = NO; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/Flutter", - ); - INFOPLIST_FILE = Runner/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 10.0; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - LIBRARY_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/Flutter", - ); - PRODUCT_BUNDLE_IDENTIFIER = com.csdcorp.speechToTextExample; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; - SWIFT_VERSION = 5.0; - VERSIONING_SYSTEM = "apple-generic"; - }; - name = Profile; - }; - 97C147031CF9000F007C117D /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = dwarf; - ENABLE_STRICT_OBJC_MSGSEND = YES; - ENABLE_TESTABILITY = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_DYNAMIC_NO_PIC = NO; - GCC_NO_COMMON_BLOCKS = YES; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - MTL_ENABLE_DEBUG_INFO = YES; - ONLY_ACTIVE_ARCH = YES; - SDKROOT = iphoneos; - TARGETED_DEVICE_FAMILY = "1,2"; - }; - name = Debug; - }; - 97C147041CF9000F007C117D /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_NS_ASSERTIONS = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_NO_COMMON_BLOCKS = YES; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - MTL_ENABLE_DEBUG_INFO = NO; - SDKROOT = iphoneos; - SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; - TARGETED_DEVICE_FAMILY = "1,2"; - VALIDATE_PRODUCT = YES; - }; - name = Release; - }; - 97C147061CF9000F007C117D /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CLANG_ENABLE_MODULES = YES; - CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; - DEVELOPMENT_TEAM = 3X949YE9K2; - ENABLE_BITCODE = NO; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/Flutter", - ); - INFOPLIST_FILE = Runner/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 10.0; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - LIBRARY_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/Flutter", - ); - PRODUCT_BUNDLE_IDENTIFIER = com.csdcorp.speechToTextExample; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 5.0; - VERSIONING_SYSTEM = "apple-generic"; - }; - name = Debug; - }; - 97C147071CF9000F007C117D /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CLANG_ENABLE_MODULES = YES; - CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; - DEVELOPMENT_TEAM = 3X949YE9K2; - ENABLE_BITCODE = NO; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/Flutter", - ); - INFOPLIST_FILE = Runner/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 10.0; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - LIBRARY_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/Flutter", - ); - PRODUCT_BUNDLE_IDENTIFIER = com.csdcorp.speechToTextExample; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; - SWIFT_VERSION = 5.0; - VERSIONING_SYSTEM = "apple-generic"; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 97C147031CF9000F007C117D /* Debug */, - 97C147041CF9000F007C117D /* Release */, - 249021D3217E4FDB00AE95B9 /* Profile */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 97C147061CF9000F007C117D /* Debug */, - 97C147071CF9000F007C117D /* Release */, - 249021D4217E4FDB00AE95B9 /* Profile */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 97C146E61CF9000F007C117D /* Project object */; -} diff --git a/speech_to_text/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/speech_to_text/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index 1d526a16..00000000 --- a/speech_to_text/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/speech_to_text/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/speech_to_text/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme deleted file mode 100644 index a28140cf..00000000 --- a/speech_to_text/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ /dev/null @@ -1,91 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/speech_to_text/example/ios/Runner.xcworkspace/contents.xcworkspacedata b/speech_to_text/example/ios/Runner.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index 21a3cc14..00000000 --- a/speech_to_text/example/ios/Runner.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - diff --git a/speech_to_text/example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/speech_to_text/example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist deleted file mode 100644 index 18d98100..00000000 --- a/speech_to_text/example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +++ /dev/null @@ -1,8 +0,0 @@ - - - - - IDEDidComputeMac32BitWarning - - - diff --git a/speech_to_text/example/ios/Runner/AppDelegate.swift b/speech_to_text/example/ios/Runner/AppDelegate.swift deleted file mode 100644 index 70693e4a..00000000 --- a/speech_to_text/example/ios/Runner/AppDelegate.swift +++ /dev/null @@ -1,13 +0,0 @@ -import UIKit -import Flutter - -@UIApplicationMain -@objc class AppDelegate: FlutterAppDelegate { - override func application( - _ application: UIApplication, - didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? - ) -> Bool { - GeneratedPluginRegistrant.register(with: self) - return super.application(application, didFinishLaunchingWithOptions: launchOptions) - } -} diff --git a/speech_to_text/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json b/speech_to_text/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json deleted file mode 100644 index d36b1fab..00000000 --- a/speech_to_text/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json +++ /dev/null @@ -1,122 +0,0 @@ -{ - "images" : [ - { - "size" : "20x20", - "idiom" : "iphone", - "filename" : "Icon-App-20x20@2x.png", - "scale" : "2x" - }, - { - "size" : "20x20", - "idiom" : "iphone", - "filename" : "Icon-App-20x20@3x.png", - "scale" : "3x" - }, - { - "size" : "29x29", - "idiom" : "iphone", - "filename" : "Icon-App-29x29@1x.png", - "scale" : "1x" - }, - { - "size" : "29x29", - "idiom" : "iphone", - "filename" : "Icon-App-29x29@2x.png", - "scale" : "2x" - }, - { - "size" : "29x29", - "idiom" : "iphone", - "filename" : "Icon-App-29x29@3x.png", - "scale" : "3x" - }, - { - "size" : "40x40", - "idiom" : "iphone", - "filename" : "Icon-App-40x40@2x.png", - "scale" : "2x" - }, - { - "size" : "40x40", - "idiom" : "iphone", - "filename" : "Icon-App-40x40@3x.png", - "scale" : "3x" - }, - { - "size" : "60x60", - "idiom" : "iphone", - "filename" : "Icon-App-60x60@2x.png", - "scale" : "2x" - }, - { - "size" : "60x60", - "idiom" : "iphone", - "filename" : "Icon-App-60x60@3x.png", - "scale" : "3x" - }, - { - "size" : "20x20", - "idiom" : "ipad", - "filename" : "Icon-App-20x20@1x.png", - "scale" : "1x" - }, - { - "size" : "20x20", - "idiom" : "ipad", - "filename" : "Icon-App-20x20@2x.png", - "scale" : "2x" - }, - { - "size" : "29x29", - "idiom" : "ipad", - "filename" : "Icon-App-29x29@1x.png", - "scale" : "1x" - }, - { - "size" : "29x29", - "idiom" : "ipad", - "filename" : "Icon-App-29x29@2x.png", - "scale" : "2x" - }, - { - "size" : "40x40", - "idiom" : "ipad", - "filename" : "Icon-App-40x40@1x.png", - "scale" : "1x" - }, - { - "size" : "40x40", - "idiom" : "ipad", - "filename" : "Icon-App-40x40@2x.png", - "scale" : "2x" - }, - { - "size" : "76x76", - "idiom" : "ipad", - "filename" : "Icon-App-76x76@1x.png", - "scale" : "1x" - }, - { - "size" : "76x76", - "idiom" : "ipad", - "filename" : "Icon-App-76x76@2x.png", - "scale" : "2x" - }, - { - "size" : "83.5x83.5", - "idiom" : "ipad", - "filename" : "Icon-App-83.5x83.5@2x.png", - "scale" : "2x" - }, - { - "size" : "1024x1024", - "idiom" : "ios-marketing", - "filename" : "Icon-App-1024x1024@1x.png", - "scale" : "1x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} diff --git a/speech_to_text/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png b/speech_to_text/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png deleted file mode 100644 index dc9ada4725e9b0ddb1deab583e5b5102493aa332..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 10932 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 diff --git a/speech_to_text/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png b/speech_to_text/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png deleted file mode 100644 index f091b6b0bca859a3f474b03065bef75ba58a9e4c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1588 zcmV-42Fv-0P)C1SqPt}wig>|5Crh^=oyX$BK<}M8eLU3e2hGT;=G|!_SP)7zNI6fqUMB=)y zRAZ>eDe#*r`yDAVgB_R*LB*MAc)8(b{g{9McCXW!lq7r(btRoB9!8B-#AI6JMb~YFBEvdsV)`mEQO^&#eRKx@b&x- z5lZm*!WfD8oCLzfHGz#u7sT0^VLMI1MqGxF^v+`4YYnVYgk*=kU?HsSz{v({E3lb9 z>+xILjBN)t6`=g~IBOelGQ(O990@BfXf(DRI5I$qN$0Gkz-FSc$3a+2fX$AedL4u{ z4V+5Ong(9LiGcIKW?_352sR;LtDPmPJXI{YtT=O8=76o9;*n%_m|xo!i>7$IrZ-{l z-x3`7M}qzHsPV@$v#>H-TpjDh2UE$9g6sysUREDy_R(a)>=eHw-WAyfIN z*qb!_hW>G)Tu8nSw9yn#3wFMiLcfc4pY0ek1}8(NqkBR@t4{~oC>ryc-h_ByH(Cg5 z>ao-}771+xE3um9lWAY1FeQFxowa1(!J(;Jg*wrg!=6FdRX+t_<%z&d&?|Bn){>zm zZQj(aA_HeBY&OC^jj*)N`8fa^ePOU72VpInJoI1?`ty#lvlNzs(&MZX+R%2xS~5Kh zX*|AU4QE#~SgPzOXe9>tRj>hjU@c1k5Y_mW*Jp3fI;)1&g3j|zDgC+}2Q_v%YfDax z!?umcN^n}KYQ|a$Lr+51Nf9dkkYFSjZZjkma$0KOj+;aQ&721~t7QUKx61J3(P4P1 zstI~7-wOACnWP4=8oGOwz%vNDqD8w&Q`qcNGGrbbf&0s9L0De{4{mRS?o0MU+nR_! zrvshUau0G^DeMhM_v{5BuLjb#Hh@r23lDAk8oF(C+P0rsBpv85EP>4CVMx#04MOfG z;P%vktHcXwTj~+IE(~px)3*MY77e}p#|c>TD?sMatC0Tu4iKKJ0(X8jxQY*gYtxsC z(zYC$g|@+I+kY;dg_dE>scBf&bP1Nc@Hz<3R)V`=AGkc;8CXqdi=B4l2k|g;2%#m& z*jfX^%b!A8#bI!j9-0Fi0bOXl(-c^AB9|nQaE`*)Hw+o&jS9@7&Gov#HbD~#d{twV zXd^Tr^mWLfFh$@Dr$e;PBEz4(-2q1FF0}c;~B5sA}+Q>TOoP+t>wf)V9Iy=5ruQa;z)y zI9C9*oUga6=hxw6QasLPnee@3^Rr*M{CdaL5=R41nLs(AHk_=Y+A9$2&H(B7!_pURs&8aNw7?`&Z&xY_Ye z)~D5Bog^td-^QbUtkTirdyK^mTHAOuptDflut!#^lnKqU md>ggs(5nOWAqO?umG&QVYK#ibz}*4>0000U6E9hRK9^#O7(mu>ETqrXGsduA8$)?`v2seloOCza43C{NQ$$gAOH**MCn0Q?+L7dl7qnbRdqZ8LSVp1ItDxhxD?t@5_yHg6A8yI zC*%Wgg22K|8E#!~cTNYR~@Y9KepMPrrB8cABapAFa=`H+UGhkXUZV1GnwR1*lPyZ;*K(i~2gp|@bzp8}og7e*#% zEnr|^CWdVV!-4*Y_7rFvlww2Ze+>j*!Z!pQ?2l->4q#nqRu9`ELo6RMS5=br47g_X zRw}P9a7RRYQ%2Vsd0Me{_(EggTnuN6j=-?uFS6j^u69elMypu?t>op*wBx<=Wx8?( ztpe^(fwM6jJX7M-l*k3kEpWOl_Vk3@(_w4oc}4YF4|Rt=2V^XU?#Yz`8(e?aZ@#li0n*=g^qOcVpd-Wbok=@b#Yw zqn8u9a)z>l(1kEaPYZ6hwubN6i<8QHgsu0oE) ziJ(p;Wxm>sf!K+cw>R-(^Y2_bahB+&KI9y^);#0qt}t-$C|Bo71lHi{_+lg#f%RFy z0um=e3$K3i6K{U_4K!EX?F&rExl^W|G8Z8;`5z-k}OGNZ0#WVb$WCpQu-_YsiqKP?BB# vzVHS-CTUF4Ozn5G+mq_~Qqto~ahA+K`|lyv3(-e}00000NkvXXu0mjfd`9t{ diff --git a/speech_to_text/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png b/speech_to_text/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png deleted file mode 100644 index d0ef06e7edb86cdfe0d15b4b0d98334a86163658..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1716 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 diff --git a/speech_to_text/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png b/speech_to_text/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png deleted file mode 100644 index c8f9ed8f5cee1c98386d13b17e89f719e83555b2..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1895 zcmV-t2blPYP)FQtfgmafE#=YDCq`qUBt#QpG%*H6QHY765~R=q zZ6iudfM}q!Pz#~9JgOi8QJ|DSu?1-*(kSi1K4#~5?#|rh?sS)(-JQqX*}ciXJ56_H zdw=^s_srbAdqxlvGyrgGet#6T7_|j;95sL%MtM;q86vOxKM$f#puR)Bjv9Zvz9-di zXOTSsZkM83)E9PYBXC<$6(|>lNLVBb&&6y{NByFCp%6+^ALR@NCTse_wqvNmSWI-m z!$%KlHFH2omF!>#%1l3LTZg(s7eof$7*xB)ZQ0h?ejh?Ta9fDv59+u#MokW+1t8Zb zgHv%K(u9G^Lv`lh#f3<6!JVTL3(dCpxHbnbA;kKqQyd1~^Xe0VIaYBSWm6nsr;dFj z4;G-RyL?cYgsN1{L4ZFFNa;8)Rv0fM0C(~Tkit94 zz#~A)59?QjD&pAPSEQ)p8gP|DS{ng)j=2ux)_EzzJ773GmQ_Cic%3JJhC0t2cx>|v zJcVusIB!%F90{+}8hG3QU4KNeKmK%T>mN57NnCZ^56=0?&3@!j>a>B43pi{!u z7JyDj7`6d)qVp^R=%j>UIY6f+3`+qzIc!Y_=+uN^3BYV|o+$vGo-j-Wm<10%A=(Yk^beI{t%ld@yhKjq0iNjqN4XMGgQtbKubPM$JWBz}YA65k%dm*awtC^+f;a-x4+ddbH^7iDWGg&N0n#MW{kA|=8iMUiFYvMoDY@sPC#t$55gn6ykUTPAr`a@!(;np824>2xJthS z*ZdmT`g5-`BuJs`0LVhz+D9NNa3<=6m;cQLaF?tCv8)zcRSh66*Z|vXhG@$I%U~2l z?`Q zykI#*+rQ=z6Jm=Bui-SfpDYLA=|vzGE(dYm=OC8XM&MDo7ux4UF1~0J1+i%aCUpRe zt3L_uNyQ*cE(38Uy03H%I*)*Bh=Lb^Xj3?I^Hnbeq72(EOK^Y93CNp*uAA{5Lc=ky zx=~RKa4{iTm{_>_vSCm?$Ej=i6@=m%@VvAITnigVg{&@!7CDgs908761meDK5azA} z4?=NOH|PdvabgJ&fW2{Mo$Q0CcD8Qc84%{JPYt5EiG{MdLIAeX%T=D7NIP4%Hw}p9 zg)==!2Lbp#j{u_}hMiao9=!VSyx0gHbeCS`;q&vzeq|fs`y&^X-lso(Ls@-706qmA z7u*T5PMo_w3{se1t2`zWeO^hOvTsohG_;>J0wVqVe+n)AbQCx)yh9;w+J6?NF5Lmo zecS@ieAKL8%bVd@+-KT{yI|S}O>pYckUFs;ry9Ow$CD@ztz5K-*D$^{i(_1llhSh^ zEkL$}tsQt5>QA^;QgjgIfBDmcOgi5YDyu?t6vSnbp=1+@6D& z5MJ}B8q;bRlVoxasyhcUF1+)o`&3r0colr}QJ3hcSdLu;9;td>kf@Tcn<@9sIx&=m z;AD;SCh95=&p;$r{Xz3iWCO^MX83AGJ(yH&eTXgv|0=34#-&WAmw{)U7OU9!Wz^!7 zZ%jZFi@JR;>Mhi7S>V7wQ176|FdW2m?&`qa(ScO^CFPR80HucLHOTy%5s*HR0^8)i h0WYBP*#0Ks^FNSabJA*5${_#%002ovPDHLkV1oKhTl@e3 diff --git a/speech_to_text/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png b/speech_to_text/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png deleted file mode 100644 index a6d6b8609df07bf62e5100a53a01510388bd2b22..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2665 zcmV-v3YPVWP)oFh3q0MFesq&64WThn3$;G69TfjsAv=f2G9}p zgSx99+!YV6qME!>9MD13x)k(+XE7W?_O4LoLb5ND8 zaV{9+P@>42xDfRiYBMSgD$0!vssptcb;&?u9u(LLBKmkZ>RMD=kvD3h`sk6!QYtBa ztlZI#nu$8lJ^q2Z79UTgZe>BU73(Aospiq+?SdMt8lDZ;*?@tyWVZVS_Q7S&*tJaiRlJ z+aSMOmbg3@h5}v;A*c8SbqM3icg-`Cnwl;7Ts%A1RkNIp+Txl-Ckkvg4oxrqGA5ewEgYqwtECD<_3Egu)xGllKt&J8g&+=ac@Jq4-?w6M3b*>w5 z69N3O%=I^6&UL5gZ!}trC7bUj*12xLdkNs~Bz4QdJJ*UDZox2UGR}SNg@lmOvhCc~ z*f_UeXv(=#I#*7>VZx2ObEN~UoGUTl=-@)E;YtCRZ>SVp$p9yG5hEFZ!`wI!spd)n zSk+vK0Vin7FL{7f&6OB%f;SH22dtbcF<|9fi2Fp%q4kxL!b1#l^)8dUwJ zwEf{(wJj@8iYDVnKB`eSU+;ml-t2`@%_)0jDM`+a46xhDbBj2+&Ih>1A>6aky#(-SYyE{R3f#y57wfLs z6w1p~$bp;6!9DX$M+J~S@D6vJAaElETnsX4h9a5tvPhC3L@qB~bOzkL@^z0k_hS{T4PF*TDrgdXp+dzsE? z>V|VR035Pl9n5&-RePFdS{7KAr2vPOqR9=M$vXA1Yy5>w;EsF`;OK{2pkn-kpp9Pw z)r;5JfJKKaT$4qCb{TaXHjb$QA{y0EYy*+b1XI;6Ah- zw13P)xT`>~eFoJC!>{2XL(a_#upp3gaR1#5+L(Jmzp4TBnx{~WHedpJ1ch8JFk~Sw z>F+gN+i+VD?gMXwcIhn8rz`>e>J^TI3E-MW>f}6R-pL}>WMOa0k#jN+`RyUVUC;#D zg|~oS^$6%wpF{^Qr+}X>0PKcr3Fc&>Z>uv@C);pwDs@2bZWhYP!rvGx?_|q{d`t<*XEb#=aOb=N+L@CVBGqImZf&+a zCQEa3$~@#kC);pasdG=f6tuIi0PO-y&tvX%>Mv=oY3U$nD zJ#gMegnQ46pq+3r=;zmgcG+zRc9D~c>z+jo9&D+`E6$LmyFqlmCYw;-Zooma{sR@~ z)_^|YL1&&@|GXo*pivH7k!msl+$Sew3%XJnxajt0K%3M6Bd&YFNy9}tWG^aovK2eX z1aL1%7;KRDrA@eG-Wr6w+;*H_VD~qLiVI`{_;>o)k`{8xa3EJT1O_>#iy_?va0eR? zDV=N%;Zjb%Z2s$@O>w@iqt!I}tLjGk!=p`D23I}N4Be@$(|iSA zf3Ih7b<{zqpDB4WF_5X1(peKe+rASze%u8eKLn#KKXt;UZ+Adf$_TO+vTqshLLJ5c z52HucO=lrNVae5XWOLm!V@n-ObU11!b+DN<$RuU+YsrBq*lYT;?AwJpmNKniF0Q1< zJCo>Q$=v$@&y=sj6{r!Y&y&`0$-I}S!H_~pI&2H8Z1C|BX4VgZ^-! zje3-;x0PBD!M`v*J_)rL^+$<1VJhH*2Fi~aA7s&@_rUHYJ9zD=M%4AFQ`}k8OC$9s XsPq=LnkwKG00000NkvXXu0mjfhAk5^ diff --git a/speech_to_text/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png b/speech_to_text/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png deleted file mode 100644 index a6d6b8609df07bf62e5100a53a01510388bd2b22..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2665 zcmV-v3YPVWP)oFh3q0MFesq&64WThn3$;G69TfjsAv=f2G9}p zgSx99+!YV6qME!>9MD13x)k(+XE7W?_O4LoLb5ND8 zaV{9+P@>42xDfRiYBMSgD$0!vssptcb;&?u9u(LLBKmkZ>RMD=kvD3h`sk6!QYtBa ztlZI#nu$8lJ^q2Z79UTgZe>BU73(Aospiq+?SdMt8lDZ;*?@tyWVZVS_Q7S&*tJaiRlJ z+aSMOmbg3@h5}v;A*c8SbqM3icg-`Cnwl;7Ts%A1RkNIp+Txl-Ckkvg4oxrqGA5ewEgYqwtECD<_3Egu)xGllKt&J8g&+=ac@Jq4-?w6M3b*>w5 z69N3O%=I^6&UL5gZ!}trC7bUj*12xLdkNs~Bz4QdJJ*UDZox2UGR}SNg@lmOvhCc~ z*f_UeXv(=#I#*7>VZx2ObEN~UoGUTl=-@)E;YtCRZ>SVp$p9yG5hEFZ!`wI!spd)n zSk+vK0Vin7FL{7f&6OB%f;SH22dtbcF<|9fi2Fp%q4kxL!b1#l^)8dUwJ zwEf{(wJj@8iYDVnKB`eSU+;ml-t2`@%_)0jDM`+a46xhDbBj2+&Ih>1A>6aky#(-SYyE{R3f#y57wfLs z6w1p~$bp;6!9DX$M+J~S@D6vJAaElETnsX4h9a5tvPhC3L@qB~bOzkL@^z0k_hS{T4PF*TDrgdXp+dzsE? z>V|VR035Pl9n5&-RePFdS{7KAr2vPOqR9=M$vXA1Yy5>w;EsF`;OK{2pkn-kpp9Pw z)r;5JfJKKaT$4qCb{TaXHjb$QA{y0EYy*+b1XI;6Ah- zw13P)xT`>~eFoJC!>{2XL(a_#upp3gaR1#5+L(Jmzp4TBnx{~WHedpJ1ch8JFk~Sw z>F+gN+i+VD?gMXwcIhn8rz`>e>J^TI3E-MW>f}6R-pL}>WMOa0k#jN+`RyUVUC;#D zg|~oS^$6%wpF{^Qr+}X>0PKcr3Fc&>Z>uv@C);pwDs@2bZWhYP!rvGx?_|q{d`t<*XEb#=aOb=N+L@CVBGqImZf&+a zCQEa3$~@#kC);pasdG=f6tuIi0PO-y&tvX%>Mv=oY3U$nD zJ#gMegnQ46pq+3r=;zmgcG+zRc9D~c>z+jo9&D+`E6$LmyFqlmCYw;-Zooma{sR@~ z)_^|YL1&&@|GXo*pivH7k!msl+$Sew3%XJnxajt0K%3M6Bd&YFNy9}tWG^aovK2eX z1aL1%7;KRDrA@eG-Wr6w+;*H_VD~qLiVI`{_;>o)k`{8xa3EJT1O_>#iy_?va0eR? zDV=N%;Zjb%Z2s$@O>w@iqt!I}tLjGk!=p`D23I}N4Be@$(|iSA zf3Ih7b<{zqpDB4WF_5X1(peKe+rASze%u8eKLn#KKXt;UZ+Adf$_TO+vTqshLLJ5c z52HucO=lrNVae5XWOLm!V@n-ObU11!b+DN<$RuU+YsrBq*lYT;?AwJpmNKniF0Q1< zJCo>Q$=v$@&y=sj6{r!Y&y&`0$-I}S!H_~pI&2H8Z1C|BX4VgZ^-! zje3-;x0PBD!M`v*J_)rL^+$<1VJhH*2Fi~aA7s&@_rUHYJ9zD=M%4AFQ`}k8OC$9s XsPq=LnkwKG00000NkvXXu0mjfhAk5^ diff --git a/speech_to_text/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png b/speech_to_text/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png deleted file mode 100644 index 75b2d164a5a98e212cca15ea7bf2ab5de5108680..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3831 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 diff --git a/speech_to_text/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png b/speech_to_text/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png deleted file mode 100644 index c4df70d39da7941ef3f6dcb7f06a192d8dcb308d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1888 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 iW8Zci7-kcv6Uzs@r-FtIZ-&5|)J Q1PU{Fy85}Sb4q9e0B4a5jsO4v diff --git a/speech_to_text/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png b/speech_to_text/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png deleted file mode 100644 index 9da19eacad3b03bb08bbddbbf4ac48dd78b3d838..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 68 zcmeAS@N?(olHy`uVBq!ia0vp^j3CUx0wlM}@Gt=>Zci7-kcv6Uzs@r-FtIZ-&5|)J Q1PU{Fy85}Sb4q9e0B4a5jsO4v diff --git a/speech_to_text/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png b/speech_to_text/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png deleted file mode 100644 index 9da19eacad3b03bb08bbddbbf4ac48dd78b3d838..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 68 zcmeAS@N?(olHy`uVBq!ia0vp^j3CUx0wlM}@Gt=>Zci7-kcv6Uzs@r-FtIZ-&5|)J Q1PU{Fy85}Sb4q9e0B4a5jsO4v diff --git a/speech_to_text/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md b/speech_to_text/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md deleted file mode 100644 index 89c2725b..00000000 --- a/speech_to_text/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md +++ /dev/null @@ -1,5 +0,0 @@ -# Launch Screen Assets - -You can customize the launch screen with your own desired assets by replacing the image files in this directory. - -You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images. \ No newline at end of file diff --git a/speech_to_text/example/ios/Runner/Base.lproj/LaunchScreen.storyboard b/speech_to_text/example/ios/Runner/Base.lproj/LaunchScreen.storyboard deleted file mode 100644 index f2e259c7..00000000 --- a/speech_to_text/example/ios/Runner/Base.lproj/LaunchScreen.storyboard +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/speech_to_text/example/ios/Runner/Base.lproj/Main.storyboard b/speech_to_text/example/ios/Runner/Base.lproj/Main.storyboard deleted file mode 100644 index f3c28516..00000000 --- a/speech_to_text/example/ios/Runner/Base.lproj/Main.storyboard +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/speech_to_text/example/ios/Runner/Info.plist b/speech_to_text/example/ios/Runner/Info.plist deleted file mode 100644 index a69c0fce..00000000 --- a/speech_to_text/example/ios/Runner/Info.plist +++ /dev/null @@ -1,49 +0,0 @@ - - - - - NSMicrophoneUsageDescription - This example listens for speech on the device microphone on your request. - NSSpeechRecognitionUsageDescription - This example recognizes words as you speak them and displays them. - CFBundleDevelopmentRegion - $(DEVELOPMENT_LANGUAGE) - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - speech_to_text_example - CFBundlePackageType - APPL - CFBundleShortVersionString - $(FLUTTER_BUILD_NAME) - CFBundleSignature - ???? - CFBundleVersion - $(FLUTTER_BUILD_NUMBER) - LSRequiresIPhoneOS - - UILaunchStoryboardName - LaunchScreen - UIMainStoryboardFile - Main - UISupportedInterfaceOrientations - - UIInterfaceOrientationPortrait - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - UISupportedInterfaceOrientations~ipad - - UIInterfaceOrientationPortrait - UIInterfaceOrientationPortraitUpsideDown - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - UIViewControllerBasedStatusBarAppearance - - - diff --git a/speech_to_text/example/ios/Runner/Runner-Bridging-Header.h b/speech_to_text/example/ios/Runner/Runner-Bridging-Header.h deleted file mode 100644 index 7335fdf9..00000000 --- a/speech_to_text/example/ios/Runner/Runner-Bridging-Header.h +++ /dev/null @@ -1 +0,0 @@ -#import "GeneratedPluginRegistrant.h" \ No newline at end of file diff --git a/speech_to_text/example/lib/main.dart b/speech_to_text/example/lib/main.dart deleted file mode 100644 index f9e672fa..00000000 --- a/speech_to_text/example/lib/main.dart +++ /dev/null @@ -1,266 +0,0 @@ -import 'dart:async'; -import 'dart:math'; - -import 'package:flutter/material.dart'; -import 'package:permission_handler/permission_handler.dart'; -import 'package:speech_to_text/speech_recognition_error.dart'; -import 'package:speech_to_text/speech_recognition_result.dart'; -import 'package:speech_to_text/speech_to_text.dart'; - -void main() => runApp(MyApp()); - -class MyApp extends StatefulWidget { - @override - _MyAppState createState() => _MyAppState(); -} - -class _MyAppState extends State { - bool _hasSpeech = false; - double level = 0.0; - double minSoundLevel = 50000; - double maxSoundLevel = -50000; - String lastWords = ""; - String lastError = ""; - String lastStatus = ""; - String _currentLocaleId = ""; - List _localeNames = []; - final SpeechToText speech = SpeechToText(); - - @override - void initState() { - requestPermissions(); - super.initState(); - } - - Future initSpeechState() async { - bool hasSpeech = await speech.initialize(onError: errorListener, onStatus: statusListener); - if (hasSpeech) { - _localeNames = await speech.locales(); - - var systemLocale = await speech.systemLocale(); - _currentLocaleId = systemLocale.localeId; - } - - if (!mounted) return; - - setState(() { - _hasSpeech = hasSpeech; - }); - } - - void requestPermissions() async { - Map statuses = await [ - Permission.microphone, - ].request(); - } - - @override - Widget build(BuildContext context) { - return MaterialApp( - home: Scaffold( - appBar: AppBar( - title: const Text('Speech to Text CloudSolution'), - ), - body: Column(children: [ - Center( - child: Text( - 'Speech recognition available', - style: TextStyle(fontSize: 22.0), - ), - ), - Container( - child: Column( - children: [ - Row( - mainAxisAlignment: MainAxisAlignment.spaceAround, - children: [ - FlatButton( - child: Text('Initialize'), - onPressed: _hasSpeech ? null : initSpeechState, - ), - ], - ), - Row( - mainAxisAlignment: MainAxisAlignment.spaceAround, - children: [ - FlatButton( - child: Text('Start'), - onPressed: !_hasSpeech || speech.isListening ? null : startListening, - ), - FlatButton( - child: Text('Stop'), - onPressed: speech.isListening ? stopListening : null, - ), - FlatButton( - child: Text('Cancel'), - onPressed: speech.isListening ? cancelListening : null, - ), - ], - ), - Row( - mainAxisAlignment: MainAxisAlignment.spaceAround, - children: [ - DropdownButton( - onChanged: (selectedVal) => _switchLang(selectedVal), - value: _currentLocaleId, - items: _localeNames - .map( - (localeName) => DropdownMenuItem( - value: localeName.localeId, - child: Text(localeName.name), - ), - ) - .toList(), - ), - ], - ) - ], - ), - ), - Expanded( - flex: 4, - child: Column( - children: [ - Center( - child: Text( - 'Recognized Words', - style: TextStyle(fontSize: 22.0), - ), - ), - Expanded( - child: Stack( - children: [ - Container( - color: Theme.of(context).selectedRowColor, - child: Center( - child: Text( - lastWords, - textAlign: TextAlign.center, - ), - ), - ), - Positioned.fill( - bottom: 10, - child: Align( - alignment: Alignment.bottomCenter, - child: Container( - width: 40, - height: 40, - alignment: Alignment.center, - decoration: BoxDecoration( - boxShadow: [BoxShadow(blurRadius: .26, spreadRadius: level * 1.5, color: Colors.black.withOpacity(.05))], - color: Colors.white, - borderRadius: BorderRadius.all(Radius.circular(50)), - ), - child: IconButton(icon: Icon(Icons.mic)), - ), - ), - ), - ], - ), - ), - ], - ), - ), - Expanded( - flex: 1, - child: Column( - children: [ - Center( - child: Text( - 'Error Status', - style: TextStyle(fontSize: 22.0), - ), - ), - Center( - child: Text(lastError), - ), - ], - ), - ), - Container( - padding: EdgeInsets.symmetric(vertical: 20), - color: Theme.of(context).backgroundColor, - child: Center( - child: speech.isListening - ? Text( - "I'm listening...", - style: TextStyle(fontWeight: FontWeight.bold), - ) - : Text( - 'Not listening', - style: TextStyle(fontWeight: FontWeight.bold), - ), - ), - ), - ]), - ), - ); - } - - void startListening() { - lastWords = ""; - lastError = ""; - speech.listen( - onResult: resultListener, - listenFor: Duration(seconds: 10), - localeId: _currentLocaleId, - onSoundLevelChange: soundLevelListener, - cancelOnError: true, - partialResults: true, - onDevice: true, - listenMode: ListenMode.confirmation); - setState(() {}); - } - - void stopListening() { - speech.stop(); - setState(() { - level = 0.0; - }); - } - - void cancelListening() { - speech.cancel(); - setState(() { - level = 0.0; - }); - } - - void resultListener(SpeechRecognitionResult result) { - setState(() { - lastWords = "${result.recognizedWords} - ${result.finalResult}"; - }); - } - - void soundLevelListener(double level) { - minSoundLevel = min(minSoundLevel, level); - maxSoundLevel = max(maxSoundLevel, level); - // print("sound level $level: $minSoundLevel - $maxSoundLevel "); - setState(() { - this.level = level; - }); - } - - void errorListener(SpeechRecognitionError error) { - // print("Received error status: $error, listening: ${speech.isListening}"); - setState(() { - lastError = "${error.errorMsg} - ${error.permanent}"; - }); - } - - void statusListener(String status) { - // print( - // "Received listener status: $status, listening: ${speech.isListening}"); - setState(() { - lastStatus = "$status"; - }); - } - - _switchLang(selectedVal) { - setState(() { - _currentLocaleId = selectedVal; - }); - print(selectedVal); - } -} diff --git a/speech_to_text/example/pubspec.lock b/speech_to_text/example/pubspec.lock deleted file mode 100644 index f7f8a8a5..00000000 --- a/speech_to_text/example/pubspec.lock +++ /dev/null @@ -1,203 +0,0 @@ -# Generated by pub -# See https://dart.dev/tools/pub/glossary#lockfile -packages: - async: - dependency: transitive - description: - name: async - url: "https://pub.dartlang.org" - source: hosted - version: "2.8.2" - boolean_selector: - dependency: transitive - description: - name: boolean_selector - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.0" - characters: - dependency: transitive - description: - name: characters - url: "https://pub.dartlang.org" - source: hosted - version: "1.2.0" - charcode: - dependency: transitive - description: - name: charcode - url: "https://pub.dartlang.org" - source: hosted - version: "1.3.1" - clock: - dependency: transitive - description: - name: clock - url: "https://pub.dartlang.org" - source: hosted - version: "1.1.0" - collection: - dependency: transitive - description: - name: collection - url: "https://pub.dartlang.org" - source: hosted - version: "1.15.0" - cupertino_icons: - dependency: "direct main" - description: - name: cupertino_icons - url: "https://pub.dartlang.org" - source: hosted - version: "0.1.3" - fake_async: - dependency: transitive - description: - name: fake_async - url: "https://pub.dartlang.org" - source: hosted - version: "1.2.0" - flutter: - dependency: "direct main" - description: flutter - source: sdk - version: "0.0.0" - flutter_test: - dependency: "direct dev" - description: flutter - source: sdk - version: "0.0.0" - json_annotation: - dependency: transitive - description: - name: json_annotation - url: "https://pub.dartlang.org" - source: hosted - version: "3.0.1" - matcher: - dependency: transitive - description: - name: matcher - url: "https://pub.dartlang.org" - source: hosted - version: "0.12.11" - meta: - dependency: transitive - description: - name: meta - url: "https://pub.dartlang.org" - source: hosted - version: "1.7.0" - nested: - dependency: transitive - description: - name: nested - url: "https://pub.dartlang.org" - source: hosted - version: "0.0.4" - path: - dependency: transitive - description: - name: path - url: "https://pub.dartlang.org" - source: hosted - version: "1.8.0" - permission_handler: - dependency: "direct main" - description: - name: permission_handler - url: "https://pub.dartlang.org" - source: hosted - version: "5.0.1+1" - permission_handler_platform_interface: - dependency: transitive - description: - name: permission_handler_platform_interface - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.1" - plugin_platform_interface: - dependency: transitive - description: - name: plugin_platform_interface - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.2" - provider: - dependency: "direct main" - description: - name: provider - url: "https://pub.dartlang.org" - source: hosted - version: "4.3.1" - sky_engine: - dependency: transitive - description: flutter - source: sdk - version: "0.0.99" - source_span: - dependency: transitive - description: - name: source_span - url: "https://pub.dartlang.org" - source: hosted - version: "1.8.1" - speech_to_text: - dependency: "direct dev" - description: - path: ".." - relative: true - source: path - version: "0.0.0" - stack_trace: - dependency: transitive - description: - name: stack_trace - url: "https://pub.dartlang.org" - source: hosted - version: "1.10.0" - stream_channel: - dependency: transitive - description: - name: stream_channel - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.0" - string_scanner: - dependency: transitive - description: - name: string_scanner - url: "https://pub.dartlang.org" - source: hosted - version: "1.1.0" - term_glyph: - dependency: transitive - description: - name: term_glyph - url: "https://pub.dartlang.org" - source: hosted - version: "1.2.0" - test_api: - dependency: transitive - description: - name: test_api - url: "https://pub.dartlang.org" - source: hosted - version: "0.4.3" - typed_data: - dependency: transitive - description: - name: typed_data - url: "https://pub.dartlang.org" - source: hosted - version: "1.3.0" - vector_math: - dependency: transitive - description: - name: vector_math - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.1" -sdks: - dart: ">=2.14.0 <3.0.0" - flutter: ">=1.16.0" diff --git a/speech_to_text/example/pubspec.yaml b/speech_to_text/example/pubspec.yaml deleted file mode 100644 index d2bfcff7..00000000 --- a/speech_to_text/example/pubspec.yaml +++ /dev/null @@ -1,33 +0,0 @@ -name: speech_to_text_example -description: Demonstrates how to use the speech_to_text plugin. -version: 1.1.0 -publish_to: 'none' - -environment: - sdk: ">=2.1.0 <3.0.0" - -dependencies: - flutter: - sdk: flutter - - cupertino_icons: ^0.1.2 - permission_handler: ^5.0.1+1 - - provider: - -dev_dependencies: - flutter_test: - sdk: flutter - - speech_to_text: - path: ../ - -# The following section is specific to Flutter. -flutter: - - uses-material-design: true - - assets: - - assets/sounds/speech_to_text_listening.m4r - - assets/sounds/speech_to_text_cancel.m4r - - assets/sounds/speech_to_text_stop.m4r diff --git a/speech_to_text/example/test/widget_test.dart b/speech_to_text/example/test/widget_test.dart deleted file mode 100644 index 639a52fb..00000000 --- a/speech_to_text/example/test/widget_test.dart +++ /dev/null @@ -1,27 +0,0 @@ -// This is a basic Flutter widget test. -// -// To perform an interaction with a widget in your test, use the WidgetTester -// utility that Flutter provides. For example, you can send tap and scroll -// gestures. You can also use WidgetTester to find child widgets in the widget -// tree, read text, and verify that the values of widget properties are correct. - -import 'package:flutter/material.dart'; -import 'package:flutter_test/flutter_test.dart'; - -import '../lib/main.dart'; - -void main() { - testWidgets('Verify Platform version', (WidgetTester tester) async { - // Build our app and trigger a frame. - await tester.pumpWidget(MyApp()); - - // Verify that platform version is retrieved. - expect( - find.byWidgetPredicate( - (Widget widget) => - widget is Text && widget.data.startsWith('Running on:'), - ), - findsOneWidget, - ); - }); -} diff --git a/speech_to_text/ios/.gitignore b/speech_to_text/ios/.gitignore deleted file mode 100644 index aa479fd3..00000000 --- a/speech_to_text/ios/.gitignore +++ /dev/null @@ -1,37 +0,0 @@ -.idea/ -.vagrant/ -.sconsign.dblite -.svn/ - -.DS_Store -*.swp -profile - -DerivedData/ -build/ -GeneratedPluginRegistrant.h -GeneratedPluginRegistrant.m - -.generated/ - -*.pbxuser -*.mode1v3 -*.mode2v3 -*.perspectivev3 - -!default.pbxuser -!default.mode1v3 -!default.mode2v3 -!default.perspectivev3 - -xcuserdata - -*.moved-aside - -*.pyc -*sync/ -Icon? -.tags* - -/Flutter/Generated.xcconfig -/Flutter/flutter_export_environment.sh \ No newline at end of file diff --git a/speech_to_text/ios/Assets/.gitkeep b/speech_to_text/ios/Assets/.gitkeep deleted file mode 100644 index e69de29b..00000000 diff --git a/speech_to_text/ios/Classes/SpeechToTextPlugin.h b/speech_to_text/ios/Classes/SpeechToTextPlugin.h deleted file mode 100644 index 1785eb8f..00000000 --- a/speech_to_text/ios/Classes/SpeechToTextPlugin.h +++ /dev/null @@ -1,4 +0,0 @@ -#import - -@interface SpeechToTextPlugin : NSObject -@end diff --git a/speech_to_text/ios/Classes/SpeechToTextPlugin.m b/speech_to_text/ios/Classes/SpeechToTextPlugin.m deleted file mode 100644 index 20d0327d..00000000 --- a/speech_to_text/ios/Classes/SpeechToTextPlugin.m +++ /dev/null @@ -1,8 +0,0 @@ -#import "SpeechToTextPlugin.h" -#import - -@implementation SpeechToTextPlugin -+ (void)registerWithRegistrar:(NSObject*)registrar { - [SwiftSpeechToTextPlugin registerWithRegistrar:registrar]; -} -@end diff --git a/speech_to_text/ios/Classes/SwiftSpeechToTextPlugin.swift b/speech_to_text/ios/Classes/SwiftSpeechToTextPlugin.swift deleted file mode 100644 index 68687967..00000000 --- a/speech_to_text/ios/Classes/SwiftSpeechToTextPlugin.swift +++ /dev/null @@ -1,580 +0,0 @@ -import Flutter -import UIKit -import Speech -import os.log -import Try - -public enum SwiftSpeechToTextMethods: String { - case has_permission - case initialize - case listen - case stop - case cancel - case locales - case unknown // just for testing -} - -public enum SwiftSpeechToTextCallbackMethods: String { - case textRecognition - case notifyStatus - case notifyError - case soundLevelChange -} - -public enum SpeechToTextStatus: String { - case listening - case notListening - case unavailable - case available -} - -public enum SpeechToTextErrors: String { - case onDeviceError - case noRecognizerError - case listenFailedError - case missingOrInvalidArg -} - -public enum ListenMode: Int { - case deviceDefault = 0 - case dictation = 1 - case search = 2 - case confirmation = 3 -} - -struct SpeechRecognitionWords : Codable { - let recognizedWords: String - let confidence: Decimal -} - -struct SpeechRecognitionResult : Codable { - let alternates: [SpeechRecognitionWords] - let finalResult: Bool -} - -struct SpeechRecognitionError : Codable { - let errorMsg: String - let permanent: Bool -} - -enum SpeechToTextError: Error { - case runtimeError(String) -} - - -@available(iOS 10.0, *) -public class SwiftSpeechToTextPlugin: NSObject, FlutterPlugin { - private var channel: FlutterMethodChannel - private var registrar: FlutterPluginRegistrar - private var recognizer: SFSpeechRecognizer? - private var currentRequest: SFSpeechAudioBufferRecognitionRequest? - private var currentTask: SFSpeechRecognitionTask? - private var listeningSound: AVAudioPlayer? - private var successSound: AVAudioPlayer? - private var cancelSound: AVAudioPlayer? - private var rememberedAudioCategory: AVAudioSession.Category? - private var previousLocale: Locale? - private var onPlayEnd: (() -> Void)? - private var returnPartialResults: Bool = true - private var failedListen: Bool = false - private var listening = false - private let audioSession = AVAudioSession.sharedInstance() - private let audioEngine = AVAudioEngine() - private let jsonEncoder = JSONEncoder() - private let busForNodeTap = 0 - private let speechBufferSize: AVAudioFrameCount = 1024 - private static var subsystem = Bundle.main.bundleIdentifier! - private let pluginLog = OSLog(subsystem: "com.csdcorp.speechToText", category: "plugin") - - public static func register(with registrar: FlutterPluginRegistrar) { - let channel = FlutterMethodChannel(name: "plugin.csdcorp.com/speech_to_text", binaryMessenger: registrar.messenger()) - let instance = SwiftSpeechToTextPlugin( channel, registrar: registrar ) - registrar.addMethodCallDelegate(instance, channel: channel ) - } - - init( _ channel: FlutterMethodChannel, registrar: FlutterPluginRegistrar ) { - self.channel = channel - self.registrar = registrar - } - - public func handle(_ call: FlutterMethodCall, result: @escaping FlutterResult) { - switch call.method { - case SwiftSpeechToTextMethods.has_permission.rawValue: - hasPermission( result ) - case SwiftSpeechToTextMethods.initialize.rawValue: - initialize( result ) - case SwiftSpeechToTextMethods.listen.rawValue: - guard let argsArr = call.arguments as? Dictionary, - let partialResults = argsArr["partialResults"] as? Bool, let onDevice = argsArr["onDevice"] as? Bool, let listenModeIndex = argsArr["listenMode"] as? Int - else { - DispatchQueue.main.async { - result(FlutterError( code: SpeechToTextErrors.missingOrInvalidArg.rawValue, - message:"Missing arg partialResults, onDevice, and listenMode are required", - details: nil )) - } - return - } - var localeStr: String? = nil - if let localeParam = argsArr["localeId"] as? String { - localeStr = localeParam - } - guard let listenMode = ListenMode(rawValue: listenModeIndex) else { - DispatchQueue.main.async { - result(FlutterError( code: SpeechToTextErrors.missingOrInvalidArg.rawValue, - message:"invalid value for listenMode, must be 0-2, was \(listenModeIndex)", - details: nil )) - } - return - } - - listenForSpeech( result, localeStr: localeStr, partialResults: partialResults, onDevice: onDevice, listenMode: listenMode ) - case SwiftSpeechToTextMethods.stop.rawValue: - stopSpeech( result ) - case SwiftSpeechToTextMethods.cancel.rawValue: - cancelSpeech( result ) - case SwiftSpeechToTextMethods.locales.rawValue: - locales( result ) - default: - os_log("Unrecognized method: %{PUBLIC}@", log: pluginLog, type: .error, call.method) - DispatchQueue.main.async { - result( FlutterMethodNotImplemented) - } - } - } - - private func hasPermission( _ result: @escaping FlutterResult) { - let has = SFSpeechRecognizer.authorizationStatus() == SFSpeechRecognizerAuthorizationStatus.authorized && - AVAudioSession.sharedInstance().recordPermission == AVAudioSession.RecordPermission.granted - DispatchQueue.main.async { - result( has ) - } - } - - private func initialize( _ result: @escaping FlutterResult) { - var success = false - let status = SFSpeechRecognizer.authorizationStatus() - switch status { - case SFSpeechRecognizerAuthorizationStatus.notDetermined: - SFSpeechRecognizer.requestAuthorization({(status)->Void in - success = status == SFSpeechRecognizerAuthorizationStatus.authorized - if ( success ) { - AVAudioSession.sharedInstance().requestRecordPermission({(granted: Bool)-> Void in - if granted { - self.setupSpeechRecognition(result) - } else{ - self.sendBoolResult( false, result ); - os_log("User denied permission", log: self.pluginLog, type: .info) - } - }) - } - else { - self.sendBoolResult( false, result ); - } - }); - case SFSpeechRecognizerAuthorizationStatus.denied: - os_log("Permission permanently denied", log: self.pluginLog, type: .info) - sendBoolResult( false, result ); - case SFSpeechRecognizerAuthorizationStatus.restricted: - os_log("Device restriction prevented initialize", log: self.pluginLog, type: .info) - sendBoolResult( false, result ); - default: - os_log("Has permissions continuing with setup", log: self.pluginLog, type: .debug) - setupSpeechRecognition(result) - } - } - - fileprivate func sendBoolResult( _ value: Bool, _ result: @escaping FlutterResult) { - DispatchQueue.main.async { - result( value ) - } - } - - fileprivate func setupListeningSound() { - listeningSound = loadSound("assets/sounds/speech_to_text_listening.m4r") - successSound = loadSound("assets/sounds/speech_to_text_stop.m4r") - cancelSound = loadSound("assets/sounds/speech_to_text_cancel.m4r") - } - - fileprivate func loadSound( _ assetPath: String ) -> AVAudioPlayer? { - var player: AVAudioPlayer? = nil - let soundKey = registrar.lookupKey(forAsset: assetPath ) - guard !soundKey.isEmpty else { - return player - } - if let soundPath = Bundle.main.path(forResource: soundKey, ofType:nil) { - let soundUrl = URL(fileURLWithPath: soundPath ) - do { - player = try AVAudioPlayer(contentsOf: soundUrl ) - player?.delegate = self - } catch { - // no audio - } - } - return player - } - - private func setupSpeechRecognition( _ result: @escaping FlutterResult) { - setupRecognizerForLocale( locale: Locale.current ) - guard recognizer != nil else { - sendBoolResult( false, result ); - return - } - recognizer?.delegate = self - setupListeningSound() - - sendBoolResult( true, result ); - } - - private func setupRecognizerForLocale( locale: Locale ) { - if ( previousLocale == locale ) { - return - } - previousLocale = locale - recognizer = SFSpeechRecognizer( locale: locale ) - } - - private func getLocale( _ localeStr: String? ) -> Locale { - guard let aLocaleStr = localeStr else { - return Locale.current - } - let locale = Locale(identifier: aLocaleStr) - return locale - } - - private func stopSpeech( _ result: @escaping FlutterResult) { - if ( !listening ) { - sendBoolResult( false, result ); - return - } - stopAllPlayers() - if let sound = successSound { - onPlayEnd = {() -> Void in - self.currentTask?.finish() - self.stopCurrentListen( ) - self.sendBoolResult( true, result ) - return - } - sound.play() - } - else { - stopCurrentListen( ) - sendBoolResult( true, result ); - } - } - - private func cancelSpeech( _ result: @escaping FlutterResult) { - if ( !listening ) { - sendBoolResult( false, result ); - return - } - stopAllPlayers() - if let sound = cancelSound { - onPlayEnd = {() -> Void in - self.currentTask?.cancel() - self.stopCurrentListen( ) - self.sendBoolResult( true, result ) - return - } - sound.play() - } - else { - self.currentTask?.cancel() - stopCurrentListen( ) - sendBoolResult( true, result ); - } - } - - private func stopAllPlayers() { - cancelSound?.stop() - successSound?.stop() - listeningSound?.stop() - } - - private func stopCurrentListen( ) { - stopAllPlayers() - currentRequest?.endAudio() - - do { - try trap { - self.audioEngine.stop() - } - } - catch { - os_log("Error stopping engine: %{PUBLIC}@", log: pluginLog, type: .error, error.localizedDescription) - } - do { - try trap { - let inputNode = self.audioEngine.inputNode - inputNode.removeTap(onBus: self.busForNodeTap); - } - } - catch { - os_log("Error removing trap: %{PUBLIC}@", log: pluginLog, type: .error, error.localizedDescription) - } - do { - if let rememberedAudioCategory = rememberedAudioCategory { - try self.audioSession.setCategory(rememberedAudioCategory) - } - } - catch { - os_log("Error stopping listen: %{PUBLIC}@", log: pluginLog, type: .error, error.localizedDescription) - } - do { - try self.audioSession.setActive(false, options: .notifyOthersOnDeactivation) - } - catch { - os_log("Error deactivation: %{PUBLIC}@", log: pluginLog, type: .info, error.localizedDescription) - } - currentRequest = nil - currentTask = nil - onPlayEnd = nil - listening = false - } - - private func listenForSpeech( _ result: @escaping FlutterResult, localeStr: String?, partialResults: Bool, onDevice: Bool, listenMode: ListenMode ) { - if ( nil != currentTask || listening ) { - sendBoolResult( false, result ); - return - } - do { - // let inErrorTest = true - failedListen = false - returnPartialResults = partialResults - setupRecognizerForLocale(locale: getLocale(localeStr)) - guard let localRecognizer = recognizer else { - result(FlutterError( code: SpeechToTextErrors.noRecognizerError.rawValue, - message:"Failed to create speech recognizer", - details: nil )) - return - } - if ( onDevice ) { - if #available(iOS 13.0, *), !localRecognizer.supportsOnDeviceRecognition { - result(FlutterError( code: SpeechToTextErrors.onDeviceError.rawValue, - message:"on device recognition is not supported on this device", - details: nil )) - } - } - rememberedAudioCategory = self.audioSession.category - try self.audioSession.setCategory(AVAudioSession.Category.playAndRecord, options: .defaultToSpeaker) - // try self.audioSession.setMode(AVAudioSession.Mode.measurement) - try self.audioSession.setMode(AVAudioSession.Mode.default) - try self.audioSession.setActive(true, options: .notifyOthersOnDeactivation) - if let sound = listeningSound { - self.onPlayEnd = {()->Void in - if ( !self.failedListen ) { - self.listening = true - self.invokeFlutter( SwiftSpeechToTextCallbackMethods.notifyStatus, arguments: SpeechToTextStatus.listening.rawValue ) - - } - } - sound.play() - } - self.audioEngine.reset(); - let inputNode = self.audioEngine.inputNode - if(inputNode.inputFormat(forBus: 0).channelCount == 0){ - throw SpeechToTextError.runtimeError("Not enough available inputs.") - } - self.currentRequest = SFSpeechAudioBufferRecognitionRequest() - guard let currentRequest = self.currentRequest else { - sendBoolResult( false, result ); - return - } - currentRequest.shouldReportPartialResults = true - if #available(iOS 13.0, *), onDevice { - currentRequest.requiresOnDeviceRecognition = true - } - switch listenMode { - case ListenMode.dictation: - currentRequest.taskHint = SFSpeechRecognitionTaskHint.dictation - break - case ListenMode.search: - currentRequest.taskHint = SFSpeechRecognitionTaskHint.search - break - case ListenMode.confirmation: - currentRequest.taskHint = SFSpeechRecognitionTaskHint.confirmation - break - default: - break - } - self.currentTask = self.recognizer?.recognitionTask(with: currentRequest, delegate: self ) - let recordingFormat = inputNode.outputFormat(forBus: self.busForNodeTap) - try trap { - inputNode.installTap(onBus: self.busForNodeTap, bufferSize: self.speechBufferSize, format: recordingFormat) { (buffer: AVAudioPCMBuffer, when: AVAudioTime) in - currentRequest.append(buffer) - self.updateSoundLevel( buffer: buffer ) - } - } - // if ( inErrorTest ){ - // throw SpeechToTextError.runtimeError("for testing only") - // } - self.audioEngine.prepare() - try self.audioEngine.start() - if nil == listeningSound { - listening = true - self.invokeFlutter( SwiftSpeechToTextCallbackMethods.notifyStatus, arguments: SpeechToTextStatus.listening.rawValue ) - } - sendBoolResult( true, result ); - } - catch { - failedListen = true - os_log("Error starting listen: %{PUBLIC}@", log: pluginLog, type: .error, error.localizedDescription) - stopCurrentListen() - sendBoolResult( false, result ); - invokeFlutter( SwiftSpeechToTextCallbackMethods.notifyStatus, arguments: SpeechToTextStatus.notListening.rawValue ) - let speechError = SpeechRecognitionError(errorMsg: "error_listen_failed", permanent: true ) - do { - let errorResult = try jsonEncoder.encode(speechError) - invokeFlutter( SwiftSpeechToTextCallbackMethods.notifyError, arguments: String( data:errorResult, encoding: .utf8) ) - } catch { - os_log("Could not encode JSON", log: pluginLog, type: .error) - } - } - } - - private func updateSoundLevel( buffer: AVAudioPCMBuffer) { - guard - let channelData = buffer.floatChannelData - else { - return - } - - let channelDataValue = channelData.pointee - let channelDataValueArray = stride(from: 0, - to: Int(buffer.frameLength), - by: buffer.stride).map{ channelDataValue[$0] } - let frameLength = Float(buffer.frameLength) - let rms = sqrt(channelDataValueArray.map{ $0 * $0 }.reduce(0, +) / frameLength ) - let avgPower = 20 * log10(rms) - self.invokeFlutter( SwiftSpeechToTextCallbackMethods.soundLevelChange, arguments: avgPower ) - } - - /// Build a list of localId:name with the current locale first - private func locales( _ result: @escaping FlutterResult ) { - var localeNames = [String](); - let locales = SFSpeechRecognizer.supportedLocales(); - let currentLocale = Locale.current - if let idName = buildIdNameForLocale(forIdentifier: currentLocale.identifier ) { - localeNames.append(idName) - } - for locale in locales { - if ( locale.identifier == currentLocale.identifier) { - continue - } - if let idName = buildIdNameForLocale(forIdentifier: locale.identifier ) { - localeNames.append(idName) - } - } - DispatchQueue.main.async { - result(localeNames) - } - } - - private func buildIdNameForLocale( forIdentifier: String ) -> String? { - var idName: String? - if let name = Locale.current.localizedString(forIdentifier: forIdentifier ) { - let sanitizedName = name.replacingOccurrences(of: ":", with: " ") - idName = "\(forIdentifier):\(sanitizedName)" - } - return idName - } - - private func handleResult( _ transcriptions: [SFTranscription], isFinal: Bool ) { - if ( !isFinal && !returnPartialResults ) { - return - } - var speechWords: [SpeechRecognitionWords] = [] - for transcription in transcriptions { - let words: SpeechRecognitionWords = SpeechRecognitionWords(recognizedWords: transcription.formattedString, confidence: confidenceIn( transcription)) - speechWords.append( words ) - } - let speechInfo = SpeechRecognitionResult(alternates: speechWords, finalResult: isFinal ) - do { - let speechMsg = try jsonEncoder.encode(speechInfo) - if let speechStr = String( data:speechMsg, encoding: .utf8) { - os_log("Encoded JSON result: %{PUBLIC}@", log: pluginLog, type: .debug, speechStr ) - invokeFlutter( SwiftSpeechToTextCallbackMethods.textRecognition, arguments: speechStr ) - } - } catch { - os_log("Could not encode JSON", log: pluginLog, type: .error) - } - } - - private func confidenceIn( _ transcription: SFTranscription ) -> Decimal { - guard ( transcription.segments.count > 0 ) else { - return 0; - } - var totalConfidence: Float = 0.0; - for segment in transcription.segments { - totalConfidence += segment.confidence - } - let avgConfidence: Float = totalConfidence / Float(transcription.segments.count ) - let confidence: Float = (avgConfidence * 1000).rounded() / 1000 - return Decimal( string: String( describing: confidence ) )! - } - - private func invokeFlutter( _ method: SwiftSpeechToTextCallbackMethods, arguments: Any? ) { - DispatchQueue.main.async { - self.channel.invokeMethod( method.rawValue, arguments: arguments ) - } - } - -} - -@available(iOS 10.0, *) -extension SwiftSpeechToTextPlugin : SFSpeechRecognizerDelegate { - public func speechRecognizer(_ speechRecognizer: SFSpeechRecognizer, availabilityDidChange available: Bool) { - let availability = available ? SpeechToTextStatus.available.rawValue : SpeechToTextStatus.unavailable.rawValue - os_log("Availability changed: %{PUBLIC}@", log: pluginLog, type: .debug, availability) - invokeFlutter( SwiftSpeechToTextCallbackMethods.notifyStatus, arguments: availability ) - } -} - -@available(iOS 10.0, *) -extension SwiftSpeechToTextPlugin : SFSpeechRecognitionTaskDelegate { - public func speechRecognitionDidDetectSpeech(_ task: SFSpeechRecognitionTask) { - // Do nothing for now - } - - public func speechRecognitionTaskFinishedReadingAudio(_ task: SFSpeechRecognitionTask) { - reportError(source: "FinishedReadingAudio", error: task.error) - invokeFlutter( SwiftSpeechToTextCallbackMethods.notifyStatus, arguments: SpeechToTextStatus.notListening.rawValue ) - } - - public func speechRecognitionTaskWasCancelled(_ task: SFSpeechRecognitionTask) { - reportError(source: "TaskWasCancelled", error: task.error) - invokeFlutter( SwiftSpeechToTextCallbackMethods.notifyStatus, arguments: SpeechToTextStatus.notListening.rawValue ) - } - - public func speechRecognitionTask(_ task: SFSpeechRecognitionTask, didFinishSuccessfully successfully: Bool) { - reportError(source: "FinishSuccessfully", error: task.error) - stopCurrentListen( ) - } - - public func speechRecognitionTask(_ task: SFSpeechRecognitionTask, didHypothesizeTranscription transcription: SFTranscription) { - reportError(source: "HypothesizeTranscription", error: task.error) - handleResult( [transcription], isFinal: false ) - } - - public func speechRecognitionTask(_ task: SFSpeechRecognitionTask, didFinishRecognition recognitionResult: SFSpeechRecognitionResult) { - reportError(source: "FinishRecognition", error: task.error) - let isFinal = recognitionResult.isFinal - handleResult( recognitionResult.transcriptions, isFinal: isFinal ) - } - - private func reportError( source: String, error: Error?) { - if ( nil != error) { - os_log("%{PUBLIC}@ with error: %{PUBLIC}@", log: pluginLog, type: .debug, source, error.debugDescription) - } - } -} - -@available(iOS 10.0, *) -extension SwiftSpeechToTextPlugin : AVAudioPlayerDelegate { - - public func audioPlayerDidFinishPlaying(_ player: AVAudioPlayer, - successfully flag: Bool) { - if let playEnd = self.onPlayEnd { - playEnd() - } - } -} diff --git a/speech_to_text/ios/speech_to_text.podspec b/speech_to_text/ios/speech_to_text.podspec deleted file mode 100644 index 1db79aa0..00000000 --- a/speech_to_text/ios/speech_to_text.podspec +++ /dev/null @@ -1,22 +0,0 @@ -# -# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html -# -Pod::Spec.new do |s| - s.name = 'speech_to_text' - s.version = '0.0.1' - s.summary = 'A new flutter plugin project.' - s.description = <<-DESC -A new flutter plugin project. - DESC - s.homepage = 'http://example.com' - s.license = { :file => '../LICENSE' } - s.author = { 'Your Company' => 'email@example.com' } - s.source = { :path => '.' } - s.source_files = 'Classes/**/*' - s.public_header_files = 'Classes/**/*.h' - s.dependency 'Flutter' - s.dependency 'Try' - - s.ios.deployment_target = '8.0' -end - diff --git a/speech_to_text/lib/speech_recognition_error.dart b/speech_to_text/lib/speech_recognition_error.dart deleted file mode 100644 index 2ab6cd4d..00000000 --- a/speech_to_text/lib/speech_recognition_error.dart +++ /dev/null @@ -1,44 +0,0 @@ -import 'package:json_annotation/json_annotation.dart'; - -part 'speech_recognition_error.g.dart'; - -/// A single error returned from the underlying speech services. -/// -/// Errors are either transient or permanent. Permanent errors -/// block speech recognition from continuing and must be -/// addressed before recogntion will work. Transient errors -/// cause individual recognition sessions to fail but subsequent -/// attempts may well succeed. -@JsonSerializable() -class SpeechRecognitionError { - /// Use this to differentiate the various error conditions. - /// - /// Not meant for display to the user. - final String errorMsg; - - /// True means that recognition cannot continue until - /// the error is resolved. - final bool permanent; - - SpeechRecognitionError(this.errorMsg, this.permanent); - - factory SpeechRecognitionError.fromJson(Map json) => - _$SpeechRecognitionErrorFromJson(json); - Map toJson() => _$SpeechRecognitionErrorToJson(this); - - @override - String toString() { - return "SpeechRecognitionError msg: $errorMsg, permanent: $permanent"; - } - - @override - bool operator ==(Object other) { - return identical(this, other) || - other is SpeechRecognitionError && - errorMsg == other.errorMsg && - permanent == other.permanent; - } - - @override - int get hashCode => errorMsg.hashCode; -} diff --git a/speech_to_text/lib/speech_recognition_error.g.dart b/speech_to_text/lib/speech_recognition_error.g.dart deleted file mode 100644 index 65299f6d..00000000 --- a/speech_to_text/lib/speech_recognition_error.g.dart +++ /dev/null @@ -1,22 +0,0 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND - -part of 'speech_recognition_error.dart'; - -// ************************************************************************** -// JsonSerializableGenerator -// ************************************************************************** - -SpeechRecognitionError _$SpeechRecognitionErrorFromJson( - Map json) { - return SpeechRecognitionError( - json['errorMsg'] as String, - json['permanent'] as bool, - ); -} - -Map _$SpeechRecognitionErrorToJson( - SpeechRecognitionError instance) => - { - 'errorMsg': instance.errorMsg, - 'permanent': instance.permanent, - }; diff --git a/speech_to_text/lib/speech_recognition_event.dart b/speech_to_text/lib/speech_recognition_event.dart deleted file mode 100644 index 71729365..00000000 --- a/speech_to_text/lib/speech_recognition_event.dart +++ /dev/null @@ -1,30 +0,0 @@ -import 'package:speech_to_text/speech_recognition_error.dart'; -import 'package:speech_to_text/speech_recognition_result.dart'; - -enum SpeechRecognitionEventType { - finalRecognitionEvent, - partialRecognitionEvent, - errorEvent, - statusChangeEvent, - soundLevelChangeEvent, -} - -/// A single event in a stream of speech recognition events. -/// -/// Use [eventType] to determine what type of event it is and depending on that -/// use the other properties to get information about it. -class SpeechRecognitionEvent { - final SpeechRecognitionEventType eventType; - final SpeechRecognitionError _error; - final SpeechRecognitionResult _result; - final bool _listening; - final double _level; - - SpeechRecognitionEvent( - this.eventType, this._result, this._error, this._listening, this._level); - - bool get isListening => _listening; - double get level => _level; - SpeechRecognitionResult get recognitionResult => _result; - SpeechRecognitionError get error => _error; -} diff --git a/speech_to_text/lib/speech_recognition_result.dart b/speech_to_text/lib/speech_recognition_result.dart deleted file mode 100644 index 38509f65..00000000 --- a/speech_to_text/lib/speech_recognition_result.dart +++ /dev/null @@ -1,140 +0,0 @@ -import 'dart:collection'; - -import 'package:json_annotation/json_annotation.dart'; - -part 'speech_recognition_result.g.dart'; - -/// A sequence of recognized words from the speech recognition -/// service. -/// -/// Depending on the platform behaviour the words may come in all -/// at once at the end or as partial results as each word is -/// recognized. Use the [finalResult] flag to determine if the -/// result is considered final by the platform. -@JsonSerializable(explicitToJson: true) -class SpeechRecognitionResult { - List _alternates; - - /// Returns a list of possible transcriptions of the speech. - /// - /// The first value is always the same as the [recognizedWords] - /// value. Use the confidence for each alternate transcription - /// to determine how likely it is. Note that not all platforms - /// do a good job with confidence, there are convenience methods - /// on [SpeechRecogntionWords] to work with possibly missing - /// confidence values. - List get alternates => - UnmodifiableListView(_alternates); - - /// The sequence of words that is the best transcription of - /// what was said. - /// - /// This is the same as the first value of [alternates]. - String get recognizedWords => - _alternates.isNotEmpty ? _alternates.first.recognizedWords : ""; - - /// False means the words are an interim result, true means - /// they are the final recognition. - final bool finalResult; - - /// The confidence that the [recognizedWords] are correct. - /// - /// Confidence is expressed as a value between 0 and 1. -1 - /// means that the confidence value was not available. - double get confidence => - _alternates.isNotEmpty ? _alternates.first.confidence : 0; - - /// true if there is confidence in this recognition, false otherwise. - /// - /// There are two separate ways for there to be confidence, the first - /// is if the confidence is missing, which is indicated by a value of - /// -1. The second is if the confidence is greater than or equal - /// [threshold]. If [threshold] is not provided it defaults to 0.8. - bool isConfident( - {double threshold = SpeechRecognitionWords.confidenceThreshold}) => - _alternates.isNotEmpty - ? _alternates.first.isConfident(threshold: threshold) - : false; - - /// true if [confidence] is not the [missingConfidence] value, false - /// otherwise. - bool get hasConfidenceRating => - _alternates.isNotEmpty ? _alternates.first.hasConfidenceRating : false; - - SpeechRecognitionResult(this._alternates, this.finalResult); - - @override - String toString() { - return "SpeechRecognitionResult words: $_alternates, final: $finalResult"; - } - - @override - bool operator ==(Object other) { - return identical(this, other) || - other is SpeechRecognitionResult && - recognizedWords == other.recognizedWords && - finalResult == other.finalResult; - } - - @override - int get hashCode => recognizedWords.hashCode; - - factory SpeechRecognitionResult.fromJson(Map json) => - _$SpeechRecognitionResultFromJson(json); - Map toJson() => _$SpeechRecognitionResultToJson(this); -} - -/// A set of words recognized in a [SpeechRecognitionResult]. -/// -/// Each result will have one or more [SpeechRecognitionWords] -/// with a varying degree of confidence about each set of words. -@JsonSerializable() -class SpeechRecognitionWords { - /// The sequence of words recognized - final String recognizedWords; - - /// The confidence that the [recognizedWords] are correct. - /// - /// Confidence is expressed as a value between 0 and 1. 0 - /// means that the confidence value was not available. Use - /// [isConfident] which will ignore 0 values automatically. - final double confidence; - - static const double confidenceThreshold = 0.8; - static const double missingConfidence = -1; - - const SpeechRecognitionWords(this.recognizedWords, this.confidence); - - /// true if there is confidence in this recognition, false otherwise. - /// - /// There are two separate ways for there to be confidence, the first - /// is if the confidence is missing, which is indicated by a value of - /// -1. The second is if the confidence is greater than or equal - /// [threshold]. If [threshold] is not provided it defaults to 0.8. - bool isConfident({double threshold = confidenceThreshold}) => - confidence == missingConfidence || confidence >= threshold; - - /// true if [confidence] is not the [missingConfidence] value, false - /// otherwise. - bool get hasConfidenceRating => confidence != missingConfidence; - - @override - String toString() { - return "SpeechRecognitionWords words: $recognizedWords, confidence: $confidence"; - } - - @override - bool operator ==(Object other) { - return identical(this, other) || - other is SpeechRecognitionWords && - recognizedWords == other.recognizedWords && - confidence == other.confidence; - } - - @override - int get hashCode => recognizedWords.hashCode; - - factory SpeechRecognitionWords.fromJson(Map json) => - _$SpeechRecognitionWordsFromJson(json); - Map toJson() => _$SpeechRecognitionWordsToJson(this); -} diff --git a/speech_to_text/lib/speech_recognition_result.g.dart b/speech_to_text/lib/speech_recognition_result.g.dart deleted file mode 100644 index 023e5485..00000000 --- a/speech_to_text/lib/speech_recognition_result.g.dart +++ /dev/null @@ -1,41 +0,0 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND - -part of 'speech_recognition_result.dart'; - -// ************************************************************************** -// JsonSerializableGenerator -// ************************************************************************** - -SpeechRecognitionResult _$SpeechRecognitionResultFromJson( - Map json) { - return SpeechRecognitionResult( - (json['alternates'] as List) - ?.map((e) => e == null - ? null - : SpeechRecognitionWords.fromJson(e as Map)) - ?.toList(), - json['finalResult'] as bool, - ); -} - -Map _$SpeechRecognitionResultToJson( - SpeechRecognitionResult instance) => - { - 'alternates': instance.alternates?.map((e) => e?.toJson())?.toList(), - 'finalResult': instance.finalResult, - }; - -SpeechRecognitionWords _$SpeechRecognitionWordsFromJson( - Map json) { - return SpeechRecognitionWords( - json['recognizedWords'] as String, - (json['confidence'] as num)?.toDouble(), - ); -} - -Map _$SpeechRecognitionWordsToJson( - SpeechRecognitionWords instance) => - { - 'recognizedWords': instance.recognizedWords, - 'confidence': instance.confidence, - }; diff --git a/speech_to_text/lib/speech_to_text.dart b/speech_to_text/lib/speech_to_text.dart deleted file mode 100644 index 343706e6..00000000 --- a/speech_to_text/lib/speech_to_text.dart +++ /dev/null @@ -1,511 +0,0 @@ -import 'dart:async'; -import 'dart:convert'; -import 'dart:math'; - -import 'package:clock/clock.dart'; -import 'package:flutter/foundation.dart'; -import 'package:flutter/services.dart'; -import 'package:speech_to_text/speech_recognition_error.dart'; -import 'package:speech_to_text/speech_recognition_result.dart'; - -enum ListenMode { - deviceDefault, - dictation, - search, - confirmation, -} - -/// Notified as words are recognized with the current set of recognized words. -/// -/// See the [onResult] argument on the [listen] method for use. -typedef SpeechResultListener = void Function(SpeechRecognitionResult result); - -/// Notified if errors occur during recognition or intialization. -/// -/// Possible errors per the Android docs are described here: -/// https://developer.android.com/reference/android/speech/SpeechRecognizer -/// "error_audio_error" -/// "error_client" -/// "error_permission" -/// "error_network" -/// "error_network_timeout" -/// "error_no_match" -/// "error_busy" -/// "error_server" -/// "error_speech_timeout" -/// See the [onError] argument on the [initialize] method for use. -typedef SpeechErrorListener = void Function( - SpeechRecognitionError errorNotification); - -/// Notified when recognition status changes. -/// -/// See the [onStatus] argument on the [initialize] method for use. -typedef SpeechStatusListener = void Function(String status); - -/// Notified when the sound level changes during a listen method. -/// -/// [level] is a measure of the decibels of the current sound on -/// the recognition input. See the [onSoundLevelChange] argument on -/// the [listen] method for use. -typedef SpeechSoundLevelChange = Function(double level); - -/// An interface to device specific speech recognition services. -/// -/// The general flow of a speech recognition session is as follows: -/// ```Dart -/// SpeechToText speech = SpeechToText(); -/// bool isReady = await speech.initialize(); -/// if ( isReady ) { -/// await speech.listen( resultListener: resultListener ); -/// } -/// ... -/// // At some point later -/// speech.stop(); -/// ``` -class SpeechToText { - static const String listenMethod = 'listen'; - static const String textRecognitionMethod = 'textRecognition'; - static const String notifyErrorMethod = 'notifyError'; - static const String notifyStatusMethod = 'notifyStatus'; - static const String soundLevelChangeMethod = "soundLevelChange"; - static const String notListeningStatus = "notListening"; - static const String listeningStatus = "listening"; - - static const MethodChannel speechChannel = - const MethodChannel('plugin.csdcorp.com/speech_to_text'); - static final SpeechToText _instance = - SpeechToText.withMethodChannel(speechChannel); - bool _initWorked = false; - bool _recognized = false; - bool _listening = false; - bool _cancelOnError = false; - bool _partialResults = false; - int _listenStartedAt = 0; - int _lastSpeechEventAt = 0; - Duration _pauseFor; - Duration _listenFor; - - /// True if not listening or the user called cancel / stop, false - /// if cancel/stop were invoked by timeout or error condition. - bool _userEnded = false; - String _lastRecognized = ""; - String _lastStatus = ""; - double _lastSoundLevel = 0; - Timer _listenTimer; - LocaleName _systemLocale; - SpeechRecognitionError _lastError; - SpeechResultListener _resultListener; - SpeechErrorListener errorListener; - SpeechStatusListener statusListener; - SpeechSoundLevelChange _soundLevelChange; - - final MethodChannel channel; - factory SpeechToText() => _instance; - - @visibleForTesting - SpeechToText.withMethodChannel(this.channel); - - /// True if words have been recognized during the current [listen] call. - /// - /// Goes false as soon as [cancel] is called. - bool get hasRecognized => _recognized; - - /// The last set of recognized words received. - /// - /// This is maintained across [cancel] calls but cleared on the next - /// [listen]. - String get lastRecognizedWords => _lastRecognized; - - /// The last status update received, see [initialize] to register - /// an optional listener to be notified when this changes. - String get lastStatus => _lastStatus; - - /// The last sound level received during a listen event. - /// - /// The sound level is a measure of how loud the current - /// input is during listening. Use the [onSoundLevelChange] - /// argument in the [listen] method to get notified of - /// changes. - double get lastSoundLevel => _lastSoundLevel; - - /// True if [initialize] succeeded - bool get isAvailable => _initWorked; - - /// True if [listen] succeeded and [stop] or [cancel] has not been called. - /// - /// Also goes false when listening times out if listenFor was set. - bool get isListening => _listening; - bool get isNotListening => !isListening; - - /// The last error received or null if none, see [initialize] to - /// register an optional listener to be notified of errors. - SpeechRecognitionError get lastError => _lastError; - - /// True if an error has been received, see [lastError] for details - bool get hasError => null != lastError; - - /// Returns true if the user has already granted permission to access the - /// microphone, does not prompt the user. - /// - /// This method can be called before [initialize] to check if permission - /// has already been granted. If this returns false then the [initialize] - /// call will prompt the user for permission if it is allowed to do so. - /// Note that applications cannot ask for permission again if the user has - /// denied them permission in the past. - Future get hasPermission async { - bool hasPermission = await channel.invokeMethod('has_permission'); - return hasPermission; - } - - /// Initialize speech recognition services, returns true if - /// successful, false if failed. - /// - /// This method must be called before any other speech functions. - /// If this method returns false no further [SpeechToText] methods - /// should be used. Should only be called once if successful but does protect - /// itself if called repeatedly. False usually means that the user has denied - /// permission to use speech. The usual option in that case is to give them - /// instructions on how to open system settings and grant permission. - /// - /// [onError] is an optional listener for errors like - /// timeout, or failure of the device speech recognition. - /// [onStatus] is an optional listener for status changes from - /// listening to not listening. - /// [debugLogging] controls whether there is detailed logging from the underlying - /// plugins. It is off by default, usually only useful for troubleshooting issues - /// with a paritcular OS version or device, fairly verbose - Future initialize( - {SpeechErrorListener onError, - SpeechStatusListener onStatus, - debugLogging = false}) async { - if (_initWorked) { - return Future.value(_initWorked); - } - errorListener = onError; - statusListener = onStatus; - channel.setMethodCallHandler(_handleCallbacks); - _initWorked = await channel - .invokeMethod('initialize', {"debugLogging": debugLogging}); - return _initWorked; - } - - /// Stops the current listen for speech if active, does nothing if not. - /// - /// Stopping a listen session will cause a final result to be sent. Each - /// listen session should be ended with either [stop] or [cancel], for - /// example in the dispose method of a Widget. [cancel] is automatically - /// invoked by a permanent error if [cancelOnError] is set to true in the - /// [listen] call. - /// - /// *Note:* Cannot be used until a successful [initialize] call. Should - /// only be used after a successful [listen] call. - Future stop() async { - _userEnded = true; - return _stop(); - } - - Future _stop() async { - if (!_initWorked) { - return; - } - _shutdownListener(); - await channel.invokeMethod('stop'); - } - - /// Cancels the current listen for speech if active, does nothing if not. - /// - /// Canceling means that there will be no final result returned from the - /// recognizer. Each listen session should be ended with either [stop] or - /// [cancel], for example in the dispose method of a Widget. [cancel] is - /// automatically invoked by a permanent error if [cancelOnError] is set - /// to true in the [listen] call. - /// - /// *Note* Cannot be used until a successful [initialize] call. Should only - /// be used after a successful [listen] call. - Future cancel() async { - _userEnded = true; - return _cancel(); - } - - Future _cancel() async { - if (!_initWorked) { - return; - } - _shutdownListener(); - await channel.invokeMethod('cancel'); - } - - /// Starts a listening session for speech and converts it to text, - /// invoking the provided [onResult] method as words are recognized. - /// - /// Cannot be used until a successful [initialize] call. There is a - /// time limit on listening imposed by both Android and iOS. The time - /// depends on the device, network, etc. Android is usually quite short, - /// especially if there is no active speech event detected, on the order - /// of ten seconds or so. - /// - /// When listening is done always invoke either [cancel] or [stop] to - /// end the session, even if it times out. [cancelOnError] provides an - /// automatic way to ensure this happens. - /// - /// [onResult] is an optional listener that is notified when words - /// are recognized. - /// - /// [listenFor] sets the maximum duration that it will listen for, after - /// that it automatically stops the listen for you. - /// - /// [pauseFor] sets the maximum duration of a pause in speech with no words - /// detected, after that it automatically stops the listen for you. - /// - /// [localeId] is an optional locale that can be used to listen in a language - /// other than the current system default. See [locales] to find the list of - /// supported languages for listening. - /// - /// [onSoundLevelChange] is an optional listener that is notified when the - /// sound level of the input changes. Use this to update the UI in response to - /// more or less input. The values currently differ between Ancroid and iOS, - /// haven't yet been able to determine from the Android documentation what the - /// value means. On iOS the value returned is in decibels. - /// - /// [cancelOnError] if true then listening is automatically canceled on a - /// permanent error. This defaults to false. When false cancel should be - /// called from the error handler. - /// - /// [partialResults] if true the listen reports results as they are recognized, - /// when false only final results are reported. Defaults to true. - /// - /// [onDevice] if true the listen attempts to recognize locally with speech never - /// leaving the device. If it cannot do this the listen attempt will fail. This is - /// usually only needed for sensitive content where privacy or security is a concern. - Future listen( - {SpeechResultListener onResult, - Duration listenFor, - Duration pauseFor, - String localeId, - SpeechSoundLevelChange onSoundLevelChange, - cancelOnError = false, - partialResults = true, - onDevice = false, - ListenMode listenMode = ListenMode.confirmation}) async { - if (!_initWorked) { - throw SpeechToTextNotInitializedException(); - } - _userEnded = false; - _cancelOnError = cancelOnError; - _recognized = false; - _resultListener = onResult; - _soundLevelChange = onSoundLevelChange; - _partialResults = partialResults; - Map listenParams = { - "partialResults": partialResults || null != pauseFor, - "onDevice": onDevice, - "listenMode": listenMode.index, - }; - if (null != localeId) { - listenParams["localeId"] = localeId; - } - try { - bool started = await channel.invokeMethod(listenMethod, listenParams); - if (started) { - _listenStartedAt = clock.now().millisecondsSinceEpoch; - _setupListenAndPause(pauseFor, listenFor); - } - } on PlatformException catch (e) { - throw ListenFailedException(e.details); - } - } - - void _setupListenAndPause(Duration pauseFor, Duration listenFor) { - _pauseFor = null; - _listenFor = null; - if (null == pauseFor && null == listenFor) { - return; - } - var minDuration; - if (null == pauseFor) { - _listenFor = Duration(milliseconds: listenFor.inMilliseconds); - minDuration = listenFor; - } else if (null == listenFor) { - _pauseFor = Duration(milliseconds: pauseFor.inMilliseconds); - minDuration = pauseFor; - } else { - _listenFor = Duration(milliseconds: listenFor.inMilliseconds); - _pauseFor = Duration(milliseconds: pauseFor.inMilliseconds); - var minMillis = min(listenFor.inMilliseconds - _elapsedListenMillis, - pauseFor.inMilliseconds); - minDuration = Duration(milliseconds: minMillis); - } - _listenTimer = Timer(minDuration, _stopOnPauseOrListen); - } - - int get _elapsedListenMillis => - clock.now().millisecondsSinceEpoch - _listenStartedAt; - int get _elapsedSinceSpeechEvent => - clock.now().millisecondsSinceEpoch - _lastSpeechEventAt; - - void _stopOnPauseOrListen() { - if (null != _listenFor && - _elapsedListenMillis >= _listenFor.inMilliseconds) { - _stop(); - } else if (null != _pauseFor && - _elapsedSinceSpeechEvent >= _pauseFor.inMilliseconds) { - _stop(); - } else { - _setupListenAndPause(_pauseFor, _listenFor); - } - } - - /// returns the list of speech locales available on the device. - /// - /// This method is useful to find the identifier to use - /// for the [listen] method, it is the [localeId] member of the - /// [LocaleName]. - /// - /// Each [LocaleName] in the returned list has the - /// identifier for the locale as well as a name for - /// display. The name is localized for the system locale on - /// the device. - Future> locales() async { - if (!_initWorked) { - throw SpeechToTextNotInitializedException(); - } - final List locales = await channel.invokeMethod('locales'); - List filteredLocales = locales - .map((locale) { - var components = locale.split(":"); - if (components.length != 2) { - return null; - } - return LocaleName(components[0], components[1]); - }) - .where((item) => item != null) - .toList(); - if (filteredLocales.isNotEmpty) { - _systemLocale = filteredLocales.first; - } else { - _systemLocale = null; - } - filteredLocales.sort((ln1, ln2) => ln1.name.compareTo(ln2.name)); - return filteredLocales; - } - - /// returns the locale that will be used if no localeId is passed - /// to the [listen] method. - Future systemLocale() async { - if (null == _systemLocale) { - await locales(); - } - return Future.value(_systemLocale); - } - - Future _handleCallbacks(MethodCall call) async { - // print("SpeechToText call: ${call.method} ${call.arguments}"); - switch (call.method) { - case textRecognitionMethod: - if (call.arguments is String) { - _onTextRecognition(call.arguments); - } - break; - case notifyErrorMethod: - if (call.arguments is String) { - await _onNotifyError(call.arguments); - } - break; - case notifyStatusMethod: - if (call.arguments is String) { - _onNotifyStatus(call.arguments); - } - break; - case soundLevelChangeMethod: - if (call.arguments is double) { - _onSoundLevelChange(call.arguments); - } - break; - default: - } - } - - void _onTextRecognition(String resultJson) { - _lastSpeechEventAt = clock.now().millisecondsSinceEpoch; - Map resultMap = jsonDecode(resultJson); - SpeechRecognitionResult speechResult = - SpeechRecognitionResult.fromJson(resultMap); - if (!_partialResults && !speechResult.finalResult) { - return; - } - _recognized = true; - // print("Recognized text $resultJson"); - - _lastRecognized = speechResult.recognizedWords; - if (null != _resultListener) { - _resultListener(speechResult); - } - } - - Future _onNotifyError(String errorJson) async { - if (isNotListening && _userEnded) { - return; - } - Map errorMap = jsonDecode(errorJson); - SpeechRecognitionError speechError = - SpeechRecognitionError.fromJson(errorMap); - _lastError = speechError; - if (null != errorListener) { - errorListener(speechError); - } - if (_cancelOnError && speechError.permanent) { - await _cancel(); - } - } - - void _onNotifyStatus(String status) { - _lastStatus = status; - _listening = status == listeningStatus; - // print(status); - if (null != statusListener) { - statusListener(status); - } - } - - void _onSoundLevelChange(double level) { - if (isNotListening) { - return; - } - _lastSoundLevel = level; - if (null != _soundLevelChange) { - _soundLevelChange(level); - } - } - - _shutdownListener() { - _listening = false; - _recognized = false; - _listenTimer?.cancel(); - _listenTimer = null; - } - - @visibleForTesting - Future processMethodCall(MethodCall call) async { - return await _handleCallbacks(call); - } -} - -/// A single locale with a [name], localized to the current system locale, -/// and a [localeId] which can be used in the [listen] method to choose a -/// locale for speech recognition. -class LocaleName { - final String localeId; - final String name; - LocaleName(this.localeId, this.name); -} - -/// Thrown when a method is called that requires successful -/// initialization first. -class SpeechToTextNotInitializedException implements Exception {} - -/// Thrown when listen fails to properly start a speech listening session -/// on the device -class ListenFailedException implements Exception { - final String details; - ListenFailedException(this.details); -} diff --git a/speech_to_text/lib/speech_to_text_provider.dart b/speech_to_text/lib/speech_to_text_provider.dart deleted file mode 100644 index 91adf3b4..00000000 --- a/speech_to_text/lib/speech_to_text_provider.dart +++ /dev/null @@ -1,201 +0,0 @@ -import 'dart:async'; - -import 'package:flutter/material.dart'; -import 'package:speech_to_text/speech_recognition_error.dart'; -import 'package:speech_to_text/speech_recognition_event.dart'; -import 'package:speech_to_text/speech_recognition_result.dart'; -import 'package:speech_to_text/speech_to_text.dart'; - -/// Simplifies interaction with [SpeechToText] by handling all the callbacks and notifying -/// listeners as events happen. -/// -/// Here's an example of using the [SpeechToTextProvider] -/// ``` -/// var speechProvider = SpeechToTextProvider( SpeechToText()); -/// var available = await speechProvider.initialize(); -/// StreamSubscription _subscription; -/// _subscription = speechProvider.recognitionController.stream.listen((recognitionEvent) { -/// if (recognitionEvent.eventType == SpeechRecognitionEventType.finalRecognitionEvent ) { -/// print("I heard: ${recognitionEvent.recognitionResult.recognizedWords}"); -/// } -/// }); -/// speechProvider.addListener(() { -/// var words = speechProvider.lastWords; -/// }); -class SpeechToTextProvider extends ChangeNotifier { - final StreamController _recognitionController = - StreamController.broadcast(); - final SpeechToText _speechToText; - SpeechRecognitionResult _lastResult; - double _lastLevel = 0; - List _locales = []; - LocaleName _systemLocale; - - /// Only construct one instance in an application. - /// - /// Do not call `initialize` on the [SpeechToText] that is passed as a parameter, instead - /// call the [initialize] method on this class. - SpeechToTextProvider(this._speechToText); - - Stream get stream => _recognitionController.stream; - - /// Returns the last result received, may be null. - SpeechRecognitionResult get lastResult => _lastResult; - - /// Returns the last error received, may be null. - SpeechRecognitionError get lastError => _speechToText.lastError; - - /// Returns the last sound level received. - /// - /// Note this is only available when the `soundLevel` is set to true on - /// a call to [listen], will be 0 at all other times. - double get lastLevel => _lastLevel; - - /// Initializes the provider and the contained [SpeechToText] instance. - /// - /// Returns true if [SpeechToText] was initialized successful and can now - /// be used, false otherwse. - Future initialize() async { - if (isAvailable) { - return isAvailable; - } - bool availableBefore = _speechToText.isAvailable; - bool available = - await _speechToText.initialize(onStatus: _onStatus, onError: _onError); - if (available) { - _locales = []; - _locales.addAll(await _speechToText.locales()); - _systemLocale = await _speechToText.systemLocale(); - } - if (availableBefore != available) { - notifyListeners(); - } - return available; - } - - /// Returns true if the provider has been initialized and can be used to recognize speech. - bool get isAvailable => _speechToText.isAvailable; - - /// Returns true if the provider cannot be used to recognize speech, either because it has not - /// yet been initialized or because initialization failed. - bool get isNotAvailable => !_speechToText.isAvailable; - - /// Returns true if [SpeechToText] is listening for new speech. - bool get isListening => _speechToText.isListening; - - /// Returns true if [SpeechToText] is not listening for new speech. - bool get isNotListening => _speechToText.isNotListening; - - /// Returns true if [SpeechToText] has a previous error. - bool get hasError => _speechToText.hasError; - - /// Returns true if [lastResult] has a last result. - bool get hasResults => null != _lastResult; - - /// Returns the list of locales that are available on the device for speech recognition. - List get locales => _locales; - - /// Returns the locale that is currently set as active on the device. - LocaleName get systemLocale => _systemLocale; - - /// Start listening for new events, set [partialResults] to true to receive interim - /// recognition results. - /// - /// [soundLevel] set to true to be notified on changes to the input sound level - /// on the microphone. - /// - /// [listenFor] sets the maximum duration that it will listen for, after - /// that it automatically stops the listen for you. - /// - /// [pauseFor] sets the maximum duration of a pause in speech with no words - /// detected, after that it automatically stops the listen for you. - /// - /// Call this only after a successful [initialize] call - void listen( - {bool partialResults = false, - bool soundLevel = false, - Duration listenFor, - Duration pauseFor}) { - _lastLevel = 0; - _lastResult = null; - if (soundLevel) { - _speechToText.listen( - partialResults: partialResults, - listenFor: listenFor, - pauseFor: pauseFor, - cancelOnError: true, - onResult: _onListenResult, - // onSoundLevelChange: _onSoundLevelChange); - ); - } else { - _speechToText.listen( - partialResults: partialResults, - listenFor: listenFor, - pauseFor: pauseFor, - cancelOnError: true, - onResult: _onListenResult); - } - } - - /// Stops a current active listening session. - /// - /// Call this after calling [listen] to stop the recognizer from listening further - /// and return the current result as final. - void stop() { - _speechToText.stop(); - notifyListeners(); - } - - /// Cancel a current active listening session. - /// - /// Call this after calling [listen] to stop the recognizer from listening further - /// and ignore any results recognized so far. - void cancel() { - _speechToText.cancel(); - notifyListeners(); - } - - void _onError(SpeechRecognitionError errorNotification) { - _recognitionController.add(SpeechRecognitionEvent( - SpeechRecognitionEventType.errorEvent, - null, - errorNotification, - isListening, - null)); - notifyListeners(); - } - - void _onStatus(String status) { - _recognitionController.add(SpeechRecognitionEvent( - SpeechRecognitionEventType.statusChangeEvent, - null, - null, - isListening, - null)); - notifyListeners(); - } - - void _onListenResult(SpeechRecognitionResult result) { - _lastResult = result; - _recognitionController.add(SpeechRecognitionEvent( - result.finalResult - ? SpeechRecognitionEventType.finalRecognitionEvent - : SpeechRecognitionEventType.partialRecognitionEvent, - result, - null, - isListening, - null)); - notifyListeners(); - } - - // void _onSoundLevelChange(double level) { - // _lastLevel = level; - // _recognitionController.add(SpeechRecognitionEvent( - // SpeechRecognitionEventType.soundLevelChangeEvent, - // null, - // null, - // null, - // level)); - // notifyListeners(); - // } -} diff --git a/speech_to_text/pubspec.lock b/speech_to_text/pubspec.lock deleted file mode 100644 index a892c39c..00000000 --- a/speech_to_text/pubspec.lock +++ /dev/null @@ -1,462 +0,0 @@ -# Generated by pub -# See https://dart.dev/tools/pub/glossary#lockfile -packages: - _fe_analyzer_shared: - dependency: transitive - description: - name: _fe_analyzer_shared - url: "https://pub.dartlang.org" - source: hosted - version: "5.0.0" - analyzer: - dependency: transitive - description: - name: analyzer - url: "https://pub.dartlang.org" - source: hosted - version: "0.39.13" - args: - dependency: transitive - description: - name: args - url: "https://pub.dartlang.org" - source: hosted - version: "1.6.0" - async: - dependency: transitive - description: - name: async - url: "https://pub.dartlang.org" - source: hosted - version: "2.8.2" - boolean_selector: - dependency: transitive - description: - name: boolean_selector - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.0" - build: - dependency: transitive - description: - name: build - url: "https://pub.dartlang.org" - source: hosted - version: "1.3.0" - build_config: - dependency: transitive - description: - name: build_config - url: "https://pub.dartlang.org" - source: hosted - version: "0.4.2" - build_daemon: - dependency: transitive - description: - name: build_daemon - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.4" - build_resolvers: - dependency: transitive - description: - name: build_resolvers - url: "https://pub.dartlang.org" - source: hosted - version: "1.3.10" - build_runner: - dependency: "direct dev" - description: - name: build_runner - url: "https://pub.dartlang.org" - source: hosted - version: "1.10.0" - build_runner_core: - dependency: transitive - description: - name: build_runner_core - url: "https://pub.dartlang.org" - source: hosted - version: "5.2.0" - built_collection: - dependency: transitive - description: - name: built_collection - url: "https://pub.dartlang.org" - source: hosted - version: "4.3.2" - built_value: - dependency: transitive - description: - name: built_value - url: "https://pub.dartlang.org" - source: hosted - version: "7.1.0" - characters: - dependency: transitive - description: - name: characters - url: "https://pub.dartlang.org" - source: hosted - version: "1.2.0" - charcode: - dependency: transitive - description: - name: charcode - url: "https://pub.dartlang.org" - source: hosted - version: "1.3.1" - checked_yaml: - dependency: transitive - description: - name: checked_yaml - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.2" - clock: - dependency: "direct main" - description: - name: clock - url: "https://pub.dartlang.org" - source: hosted - version: "1.1.0" - code_builder: - dependency: transitive - description: - name: code_builder - url: "https://pub.dartlang.org" - source: hosted - version: "3.4.0" - collection: - dependency: transitive - description: - name: collection - url: "https://pub.dartlang.org" - source: hosted - version: "1.15.0" - convert: - dependency: transitive - description: - name: convert - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.1" - crypto: - dependency: transitive - description: - name: crypto - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.4" - csslib: - dependency: transitive - description: - name: csslib - url: "https://pub.dartlang.org" - source: hosted - version: "0.16.1" - dart_style: - dependency: transitive - description: - name: dart_style - url: "https://pub.dartlang.org" - source: hosted - version: "1.3.6" - fake_async: - dependency: "direct dev" - description: - name: fake_async - url: "https://pub.dartlang.org" - source: hosted - version: "1.2.0" - fixnum: - dependency: transitive - description: - name: fixnum - url: "https://pub.dartlang.org" - source: hosted - version: "0.10.11" - flutter: - dependency: "direct main" - description: flutter - source: sdk - version: "0.0.0" - flutter_test: - dependency: "direct dev" - description: flutter - source: sdk - version: "0.0.0" - glob: - dependency: transitive - description: - name: glob - url: "https://pub.dartlang.org" - source: hosted - version: "1.2.0" - graphs: - dependency: transitive - description: - name: graphs - url: "https://pub.dartlang.org" - source: hosted - version: "0.2.0" - html: - dependency: transitive - description: - name: html - url: "https://pub.dartlang.org" - source: hosted - version: "0.14.0+3" - http_multi_server: - dependency: transitive - description: - name: http_multi_server - url: "https://pub.dartlang.org" - source: hosted - version: "2.2.0" - http_parser: - dependency: transitive - description: - name: http_parser - url: "https://pub.dartlang.org" - source: hosted - version: "3.1.4" - io: - dependency: transitive - description: - name: io - url: "https://pub.dartlang.org" - source: hosted - version: "0.3.4" - js: - dependency: transitive - description: - name: js - url: "https://pub.dartlang.org" - source: hosted - version: "0.6.2" - json_annotation: - dependency: "direct main" - description: - name: json_annotation - url: "https://pub.dartlang.org" - source: hosted - version: "3.0.1" - json_serializable: - dependency: "direct dev" - description: - name: json_serializable - url: "https://pub.dartlang.org" - source: hosted - version: "3.3.0" - logging: - dependency: transitive - description: - name: logging - url: "https://pub.dartlang.org" - source: hosted - version: "0.11.4" - matcher: - dependency: transitive - description: - name: matcher - url: "https://pub.dartlang.org" - source: hosted - version: "0.12.11" - meta: - dependency: transitive - description: - name: meta - url: "https://pub.dartlang.org" - source: hosted - version: "1.7.0" - mime: - dependency: transitive - description: - name: mime - url: "https://pub.dartlang.org" - source: hosted - version: "0.9.6+3" - node_interop: - dependency: transitive - description: - name: node_interop - url: "https://pub.dartlang.org" - source: hosted - version: "1.1.1" - node_io: - dependency: transitive - description: - name: node_io - url: "https://pub.dartlang.org" - source: hosted - version: "1.1.1" - package_config: - dependency: transitive - description: - name: package_config - url: "https://pub.dartlang.org" - source: hosted - version: "1.9.3" - path: - dependency: transitive - description: - name: path - url: "https://pub.dartlang.org" - source: hosted - version: "1.8.0" - pedantic: - dependency: transitive - description: - name: pedantic - url: "https://pub.dartlang.org" - source: hosted - version: "1.9.0" - pool: - dependency: transitive - description: - name: pool - url: "https://pub.dartlang.org" - source: hosted - version: "1.4.0" - pub_semver: - dependency: transitive - description: - name: pub_semver - url: "https://pub.dartlang.org" - source: hosted - version: "1.4.4" - pubspec_parse: - dependency: transitive - description: - name: pubspec_parse - url: "https://pub.dartlang.org" - source: hosted - version: "0.1.5" - quiver: - dependency: transitive - description: - name: quiver - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.3" - shelf: - dependency: transitive - description: - name: shelf - url: "https://pub.dartlang.org" - source: hosted - version: "0.7.7" - shelf_web_socket: - dependency: transitive - description: - name: shelf_web_socket - url: "https://pub.dartlang.org" - source: hosted - version: "0.2.3" - sky_engine: - dependency: transitive - description: flutter - source: sdk - version: "0.0.99" - source_gen: - dependency: transitive - description: - name: source_gen - url: "https://pub.dartlang.org" - source: hosted - version: "0.9.6" - source_span: - dependency: transitive - description: - name: source_span - url: "https://pub.dartlang.org" - source: hosted - version: "1.8.1" - stack_trace: - dependency: transitive - description: - name: stack_trace - url: "https://pub.dartlang.org" - source: hosted - version: "1.10.0" - stream_channel: - dependency: transitive - description: - name: stream_channel - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.0" - stream_transform: - dependency: transitive - description: - name: stream_transform - url: "https://pub.dartlang.org" - source: hosted - version: "1.2.0" - string_scanner: - dependency: transitive - description: - name: string_scanner - url: "https://pub.dartlang.org" - source: hosted - version: "1.1.0" - term_glyph: - dependency: transitive - description: - name: term_glyph - url: "https://pub.dartlang.org" - source: hosted - version: "1.2.0" - test_api: - dependency: transitive - description: - name: test_api - url: "https://pub.dartlang.org" - source: hosted - version: "0.4.3" - timing: - dependency: transitive - description: - name: timing - url: "https://pub.dartlang.org" - source: hosted - version: "0.1.1+2" - typed_data: - dependency: transitive - description: - name: typed_data - url: "https://pub.dartlang.org" - source: hosted - version: "1.3.0" - vector_math: - dependency: transitive - description: - name: vector_math - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.1" - watcher: - dependency: transitive - description: - name: watcher - url: "https://pub.dartlang.org" - source: hosted - version: "0.9.7+15" - web_socket_channel: - dependency: transitive - description: - name: web_socket_channel - url: "https://pub.dartlang.org" - source: hosted - version: "1.1.0" - yaml: - dependency: transitive - description: - name: yaml - url: "https://pub.dartlang.org" - source: hosted - version: "2.2.1" -sdks: - dart: ">=2.14.0 <3.0.0" - flutter: ">=1.10.0" diff --git a/speech_to_text/pubspec.yaml b/speech_to_text/pubspec.yaml deleted file mode 100644 index 34b3da29..00000000 --- a/speech_to_text/pubspec.yaml +++ /dev/null @@ -1,31 +0,0 @@ -name: speech_to_text -description: A Flutter plugin that exposes device specific speech to text recognition capability. - - - -environment: - sdk: ">=2.1.0 <3.0.0" - flutter: ">=1.10.0" - -dependencies: - flutter: - sdk: flutter - json_annotation: ^3.0.0 - clock: ^1.0.1 - -dev_dependencies: - flutter_test: - sdk: flutter - build_runner: ^1.0.0 - json_serializable: ^3.0.0 - fake_async: ^1.0.1 - -flutter: - plugin: - platforms: - android: - package: com.csdcorp.speech_to_text - pluginClass: SpeechToTextPlugin - ios: - pluginClass: SpeechToTextPlugin - diff --git a/speech_to_text/test/speech_recognition_error_test.dart b/speech_to_text/test/speech_recognition_error_test.dart deleted file mode 100644 index 202ae4cd..00000000 --- a/speech_to_text/test/speech_recognition_error_test.dart +++ /dev/null @@ -1,65 +0,0 @@ -import 'dart:convert'; - -import 'package:flutter_test/flutter_test.dart'; -import 'package:speech_to_text/speech_recognition_error.dart'; - -void main() { - const String msg1 = "msg1"; - - setUp(() {}); - - group('properties', () { - test('equals true for same object', () { - SpeechRecognitionError error = SpeechRecognitionError(msg1, false); - expect(error, error); - }); - test('equals true for different object same values', () { - SpeechRecognitionError error1 = SpeechRecognitionError(msg1, false); - SpeechRecognitionError error2 = SpeechRecognitionError(msg1, false); - expect(error1, error2); - }); - test('equals false for different object', () { - SpeechRecognitionError error1 = SpeechRecognitionError(msg1, false); - SpeechRecognitionError error2 = SpeechRecognitionError("msg2", false); - expect(error1, isNot(error2)); - }); - test('hash same for same object', () { - SpeechRecognitionError error = SpeechRecognitionError(msg1, false); - expect(error.hashCode, error.hashCode); - }); - test('hash same for different object same values', () { - SpeechRecognitionError error1 = SpeechRecognitionError(msg1, false); - SpeechRecognitionError error2 = SpeechRecognitionError(msg1, false); - expect(error1.hashCode, error2.hashCode); - }); - test('hash different for different object', () { - SpeechRecognitionError error1 = SpeechRecognitionError(msg1, false); - SpeechRecognitionError error2 = SpeechRecognitionError("msg2", false); - expect(error1.hashCode, isNot(error2.hashCode)); - }); - test('toString as expected', () { - SpeechRecognitionError error1 = SpeechRecognitionError(msg1, false); - expect(error1.toString(), - "SpeechRecognitionError msg: $msg1, permanent: false"); - }); - }); - group('json', () { - test('loads properly', () { - var json = jsonDecode('{"errorMsg":"$msg1","permanent":true}'); - SpeechRecognitionError error = SpeechRecognitionError.fromJson(json); - expect(error.errorMsg, msg1); - expect(error.permanent, isTrue); - json = jsonDecode('{"errorMsg":"$msg1","permanent":false}'); - error = SpeechRecognitionError.fromJson(json); - expect(error.permanent, isFalse); - }); - test('roundtrips properly', () { - var json = jsonDecode('{"errorMsg":"$msg1","permanent":true}'); - SpeechRecognitionError error = SpeechRecognitionError.fromJson(json); - var roundtripJson = error.toJson(); - SpeechRecognitionError roundtripError = - SpeechRecognitionError.fromJson(roundtripJson); - expect(error, roundtripError); - }); - }); -} diff --git a/speech_to_text/test/speech_recognition_event_test.dart b/speech_to_text/test/speech_recognition_event_test.dart deleted file mode 100644 index ceaaab8a..00000000 --- a/speech_to_text/test/speech_recognition_event_test.dart +++ /dev/null @@ -1,42 +0,0 @@ -import 'package:flutter_test/flutter_test.dart'; -import 'package:speech_to_text/speech_recognition_event.dart'; - -import 'test_speech_channel_handler.dart'; - -void main() { - group('properties', () { - test('status listening matches', () { - var event = SpeechRecognitionEvent( - SpeechRecognitionEventType.statusChangeEvent, null, null, true, null); - expect(event.eventType, SpeechRecognitionEventType.statusChangeEvent); - expect(event.isListening, isTrue); - }); - test('result matches', () { - var event = SpeechRecognitionEvent( - SpeechRecognitionEventType.finalRecognitionEvent, - TestSpeechChannelHandler.firstRecognizedResult, - null, - null, - null); - expect(event.eventType, SpeechRecognitionEventType.finalRecognitionEvent); - expect(event.recognitionResult, - TestSpeechChannelHandler.firstRecognizedResult); - }); - test('error matches', () { - var event = SpeechRecognitionEvent(SpeechRecognitionEventType.errorEvent, - null, TestSpeechChannelHandler.firstError, null, null); - expect(event.eventType, SpeechRecognitionEventType.errorEvent); - expect(event.error, TestSpeechChannelHandler.firstError); - }); - test('sound level matches', () { - var event = SpeechRecognitionEvent( - SpeechRecognitionEventType.soundLevelChangeEvent, - null, - null, - null, - TestSpeechChannelHandler.level1); - expect(event.eventType, SpeechRecognitionEventType.soundLevelChangeEvent); - expect(event.level, TestSpeechChannelHandler.level1); - }); - }); -} diff --git a/speech_to_text/test/speech_recognition_result_test.dart b/speech_to_text/test/speech_recognition_result_test.dart deleted file mode 100644 index 1516779a..00000000 --- a/speech_to_text/test/speech_recognition_result_test.dart +++ /dev/null @@ -1,134 +0,0 @@ -import 'dart:convert'; - -import 'package:flutter_test/flutter_test.dart'; -import 'package:speech_to_text/speech_recognition_result.dart'; - -void main() { - final String firstRecognizedWords = 'hello'; - final String secondRecognizedWords = 'hello there'; - final double firstConfidence = 0.85; - final double secondConfidence = 0.62; - final String firstRecognizedJson = - '{"alternates":[{"recognizedWords":"$firstRecognizedWords","confidence":$firstConfidence}],"finalResult":false}'; - final String secondRecognizedJson = - '{"alternates":[{"recognizedWords":"$secondRecognizedWords","confidence":$secondConfidence}],"finalResult":false}'; - final SpeechRecognitionWords firstWords = - SpeechRecognitionWords(firstRecognizedWords, firstConfidence); - final SpeechRecognitionWords secondWords = - SpeechRecognitionWords(secondRecognizedWords, secondConfidence); - - setUp(() {}); - - group('recognizedWords', () { - test('empty if no alternates', () { - SpeechRecognitionResult result = SpeechRecognitionResult([], true); - expect(result.recognizedWords, isEmpty); - }); - test('matches first alternate', () { - SpeechRecognitionResult result = - SpeechRecognitionResult([firstWords, secondWords], true); - expect(result.recognizedWords, firstRecognizedWords); - }); - }); - group('alternates', () { - test('empty if no alternates', () { - SpeechRecognitionResult result = SpeechRecognitionResult([], true); - expect(result.alternates, isEmpty); - }); - test('expected contents', () { - SpeechRecognitionResult result = - SpeechRecognitionResult([firstWords, secondWords], true); - expect(result.alternates, contains(firstWords)); - expect(result.alternates, contains(secondWords)); - }); - test('in order', () { - SpeechRecognitionResult result = - SpeechRecognitionResult([firstWords, secondWords], true); - expect(result.alternates.first, firstWords); - }); - }); - group('confidence', () { - test('0 if no alternates', () { - SpeechRecognitionResult result = SpeechRecognitionResult([], true); - expect(result.confidence, 0); - }); - test('isConfident false if no alternates', () { - SpeechRecognitionResult result = SpeechRecognitionResult([], true); - expect(result.isConfident(), isFalse); - }); - test('isConfident matches first alternate', () { - SpeechRecognitionResult result = - SpeechRecognitionResult([firstWords, secondWords], true); - expect(result.isConfident(), firstWords.isConfident()); - }); - test('hasConfidenceRating false if no alternates', () { - SpeechRecognitionResult result = SpeechRecognitionResult([], true); - expect(result.hasConfidenceRating, isFalse); - }); - test('hasConfidenceRating matches first alternate', () { - SpeechRecognitionResult result = - SpeechRecognitionResult([firstWords, secondWords], true); - expect(result.hasConfidenceRating, firstWords.hasConfidenceRating); - }); - }); - group('json', () { - test('loads correctly', () { - var json = jsonDecode(firstRecognizedJson); - SpeechRecognitionResult result = SpeechRecognitionResult.fromJson(json); - expect(result.recognizedWords, firstRecognizedWords); - expect(result.confidence, firstConfidence); - }); - test('roundtrips correctly', () { - var json = jsonDecode(firstRecognizedJson); - SpeechRecognitionResult result = SpeechRecognitionResult.fromJson(json); - var roundTripJson = result.toJson(); - SpeechRecognitionResult roundtripResult = - SpeechRecognitionResult.fromJson(roundTripJson); - expect(result, roundtripResult); - }); - }); - group('overrides', () { - test('toString works with no alternates', () { - SpeechRecognitionResult result = SpeechRecognitionResult([], true); - expect( - result.toString(), "SpeechRecognitionResult words: [], final: true"); - }); - test('toString works with alternates', () { - SpeechRecognitionResult result = - SpeechRecognitionResult([firstWords], true); - expect(result.toString(), - "SpeechRecognitionResult words: [SpeechRecognitionWords words: hello, confidence: 0.85], final: true"); - }); - test('hash same for same object', () { - SpeechRecognitionResult result = - SpeechRecognitionResult([firstWords], true); - expect(result.hashCode, result.hashCode); - }); - test('hash differs for different objects', () { - SpeechRecognitionResult result1 = - SpeechRecognitionResult([firstWords], true); - SpeechRecognitionResult result2 = - SpeechRecognitionResult([secondWords], true); - expect(result1.hashCode, isNot(result2.hashCode)); - }); - test('equals same for same object', () { - SpeechRecognitionResult result = - SpeechRecognitionResult([firstWords], true); - expect(result, result); - }); - test('equals same for different object same values', () { - SpeechRecognitionResult result1 = - SpeechRecognitionResult([firstWords], true); - SpeechRecognitionResult result1a = - SpeechRecognitionResult([firstWords], true); - expect(result1, result1a); - }); - test('equals differs for different objects', () { - SpeechRecognitionResult result1 = - SpeechRecognitionResult([firstWords], true); - SpeechRecognitionResult result2 = - SpeechRecognitionResult([secondWords], true); - expect(result1, isNot(result2)); - }); - }); -} diff --git a/speech_to_text/test/speech_recognitions_words_test.dart b/speech_to_text/test/speech_recognitions_words_test.dart deleted file mode 100644 index 36a9ef0e..00000000 --- a/speech_to_text/test/speech_recognitions_words_test.dart +++ /dev/null @@ -1,86 +0,0 @@ -import 'dart:convert'; - -import 'package:flutter_test/flutter_test.dart'; -import 'package:speech_to_text/speech_recognition_result.dart'; - -void main() { - final String firstRecognizedWords = 'hello'; - final String secondRecognizedWords = 'hello there'; - final double firstConfidence = 0.85; - final double secondConfidence = 0.62; - final String firstRecognizedJson = - '{"recognizedWords":"$firstRecognizedWords","confidence":$firstConfidence}'; - final SpeechRecognitionWords firstWords = - SpeechRecognitionWords(firstRecognizedWords, firstConfidence); - final SpeechRecognitionWords secondWords = - SpeechRecognitionWords(secondRecognizedWords, secondConfidence); - - setUp(() {}); - - group('properties', () { - test('words', () { - expect(firstWords.recognizedWords, firstRecognizedWords); - expect(secondWords.recognizedWords, secondRecognizedWords); - }); - test('confidence', () { - expect(firstWords.confidence, firstConfidence); - expect(secondWords.confidence, secondConfidence); - expect(firstWords.hasConfidenceRating, isTrue); - }); - test('equals true for same object', () { - expect(firstWords, firstWords); - }); - test('equals true for different object with same values', () { - SpeechRecognitionWords firstWordsA = - SpeechRecognitionWords(firstRecognizedWords, firstConfidence); - expect(firstWords, firstWordsA); - }); - test('equals false for different results', () { - expect(firstWords, isNot(secondWords)); - }); - test('hash same for same object', () { - expect(firstWords.hashCode, firstWords.hashCode); - }); - test('hash same for different object with same values', () { - SpeechRecognitionWords firstWordsA = - SpeechRecognitionWords(firstRecognizedWords, firstConfidence); - expect(firstWords.hashCode, firstWordsA.hashCode); - }); - test('hash different for different results', () { - expect(firstWords.hashCode, isNot(secondWords.hashCode)); - }); - }); - group('isConfident', () { - test('true when >= 0.8', () { - expect(firstWords.isConfident(), isTrue); - }); - test('false when < 0.8', () { - expect(secondWords.isConfident(), isFalse); - }); - test('respects threshold', () { - expect(secondWords.isConfident(threshold: 0.5), isTrue); - }); - test('true when missing', () { - SpeechRecognitionWords words = SpeechRecognitionWords( - firstRecognizedWords, SpeechRecognitionWords.missingConfidence); - expect(words.isConfident(), isTrue); - expect(words.hasConfidenceRating, isFalse); - }); - }); - group('json', () { - test('loads correctly', () { - var json = jsonDecode(firstRecognizedJson); - SpeechRecognitionWords words = SpeechRecognitionWords.fromJson(json); - expect(words.recognizedWords, firstRecognizedWords); - expect(words.confidence, firstConfidence); - }); - test('roundtrips correctly', () { - var json = jsonDecode(firstRecognizedJson); - SpeechRecognitionWords words = SpeechRecognitionWords.fromJson(json); - var roundTripJson = words.toJson(); - SpeechRecognitionWords roundtripWords = - SpeechRecognitionWords.fromJson(roundTripJson); - expect(words, roundtripWords); - }); - }); -} diff --git a/speech_to_text/test/speech_to_text_provider_test.dart b/speech_to_text/test/speech_to_text_provider_test.dart deleted file mode 100644 index 25366b6f..00000000 --- a/speech_to_text/test/speech_to_text_provider_test.dart +++ /dev/null @@ -1,196 +0,0 @@ -import 'package:fake_async/fake_async.dart'; -import 'package:flutter_test/flutter_test.dart'; -import 'package:speech_to_text/speech_to_text.dart'; -import 'package:speech_to_text/speech_to_text_provider.dart'; - -import 'test_speech_channel_handler.dart'; -import 'test_speech_listener.dart'; - -void main() { - SpeechToTextProvider provider; - SpeechToText speechToText; - TestSpeechChannelHandler speechHandler; - TestSpeechListener speechListener; - - TestWidgetsFlutterBinding.ensureInitialized(); - - setUp(() { - speechToText = SpeechToText.withMethodChannel(SpeechToText.speechChannel); - speechHandler = TestSpeechChannelHandler(speechToText); - speechToText.channel - .setMockMethodCallHandler(speechHandler.methodCallHandler); - provider = SpeechToTextProvider(speechToText); - speechListener = TestSpeechListener(provider); - provider.addListener(speechListener.onNotify); - }); - - tearDown(() { - speechToText.channel.setMockMethodCallHandler(null); - }); - - group('delegates', () { - test('isListening matches delegate defaults', () { - expect(provider.isListening, speechToText.isListening); - expect(provider.isNotListening, speechToText.isNotListening); - }); - test('isAvailable matches delegate defaults', () { - expect(provider.isAvailable, speechToText.isAvailable); - expect(provider.isNotAvailable, !speechToText.isAvailable); - }); - test('isAvailable matches delegate after init', () async { - expect(await provider.initialize(), isTrue); - expect(provider.isAvailable, speechToText.isAvailable); - expect(provider.isNotAvailable, !speechToText.isAvailable); - }); - test('hasError matches delegate after error', () async { - expect(await provider.initialize(), isTrue); - expect(provider.hasError, speechToText.hasError); - }); - }); - group('listening', () { - test('notifies on initialize', () async { - fakeAsync((fa) { - provider.initialize(); - fa.flushMicrotasks(); - expect(speechListener.notified, isTrue); - expect(speechListener.isAvailable, isTrue); - }); - }); - test('notifies on listening', () async { - fakeAsync((fa) { - setupForListen(provider, fa, speechListener); - expect(speechListener.notified, isTrue); - expect(speechListener.isListening, isTrue); - expect(provider.hasResults, isFalse); - }); - }); - test('notifies on final words', () async { - fakeAsync((fa) { - setupForListen(provider, fa, speechListener); - speechListener.reset(); - speechHandler.notifyFinalWords(); - fa.flushMicrotasks(); - expect(speechListener.notified, isTrue); - expect(provider.hasResults, isTrue); - var result = speechListener.recognitionResult; - expect(result.recognizedWords, - TestSpeechChannelHandler.secondRecognizedWords); - expect(result.finalResult, isTrue); - }); - }); - test('hasResult false after listening before new results', () async { - fakeAsync((fa) { - setupForListen(provider, fa, speechListener); - speechHandler.notifyFinalWords(); - provider.stop(); - setupForListen(provider, fa, speechListener); - fa.flushMicrotasks(); - expect(provider.hasResults, isFalse); - }); - }); - test('notifies on partial words', () async { - fakeAsync((fa) { - setupForListen(provider, fa, speechListener, partialResults: true); - speechListener.reset(); - speechHandler.notifyPartialWords(); - fa.flushMicrotasks(); - expect(speechListener.notified, isTrue); - expect(provider.hasResults, isTrue); - var result = speechListener.recognitionResult; - expect(result.recognizedWords, - TestSpeechChannelHandler.firstRecognizedWords); - expect(result.finalResult, isFalse); - }); - }); - }); - group('soundLevel', () { - test('notifies when requested', () async { - fakeAsync((fa) { - setupForListen(provider, fa, speechListener, - partialResults: true, soundLevel: true); - speechListener.reset(); - speechHandler.notifySoundLevel(); - fa.flushMicrotasks(); - expect(speechListener.notified, isTrue); - expect(speechListener.soundLevel, TestSpeechChannelHandler.level2); - }); - }); - test('no notification by default', () async { - fakeAsync((fa) { - setupForListen(provider, fa, speechListener, - partialResults: true, soundLevel: false); - speechListener.reset(); - speechHandler.notifySoundLevel(); - fa.flushMicrotasks(); - expect(speechListener.notified, isFalse); - expect(speechListener.soundLevel, 0); - }); - }); - }); - group('stop/cancel', () { - test('notifies on stop', () async { - fakeAsync((fa) { - provider.initialize(); - setupForListen(provider, fa, speechListener); - speechListener.reset(); - provider.stop(); - fa.flushMicrotasks(); - expect(speechListener.notified, isTrue); - expect(speechListener.isListening, isFalse); - }); - }); - test('notifies on cancel', () async { - fakeAsync((fa) { - provider.initialize(); - setupForListen(provider, fa, speechListener); - speechListener.reset(); - provider.cancel(); - fa.flushMicrotasks(); - expect(speechListener.notified, isTrue); - expect(speechListener.isListening, isFalse); - }); - }); - }); - group('error handling', () { - test('hasError matches delegate default', () async { - expect(await provider.initialize(), isTrue); - expect(provider.hasError, speechToText.hasError); - }); - test('notifies on error', () async { - fakeAsync((fa) { - provider.initialize(); - setupForListen(provider, fa, speechListener); - speechListener.reset(); - speechHandler.notifyPermanentError(); - expect(speechListener.notified, isTrue); - expect(speechListener.hasError, isTrue); - }); - }); - }); - group('locale', () { - test('locales empty before init', () async { - expect(provider.systemLocale, isNull); - expect(provider.locales, isEmpty); - }); - test('set from SpeechToText after init', () async { - fakeAsync((fa) { - speechHandler.setupLocales(); - provider.initialize(); - fa.flushMicrotasks(); - expect( - provider.systemLocale.localeId, TestSpeechChannelHandler.localeId1); - expect(provider.locales, hasLength(speechHandler.locales.length)); - }); - }); - }); -} - -void setupForListen(SpeechToTextProvider provider, FakeAsync fa, - TestSpeechListener speechListener, - {bool partialResults = false, bool soundLevel = false}) { - provider.initialize(); - fa.flushMicrotasks(); - speechListener.reset(); - provider.listen(partialResults: partialResults, soundLevel: soundLevel); - fa.flushMicrotasks(); -} diff --git a/speech_to_text/test/speech_to_text_test.dart b/speech_to_text/test/speech_to_text_test.dart deleted file mode 100644 index 7b4701ff..00000000 --- a/speech_to_text/test/speech_to_text_test.dart +++ /dev/null @@ -1,425 +0,0 @@ -import 'package:fake_async/fake_async.dart'; -import 'package:flutter/services.dart'; -import 'package:flutter_test/flutter_test.dart'; -import 'package:speech_to_text/speech_recognition_error.dart'; -import 'package:speech_to_text/speech_recognition_result.dart'; -import 'package:speech_to_text/speech_to_text.dart'; - -import 'test_speech_channel_handler.dart'; - -void main() { - TestWidgetsFlutterBinding.ensureInitialized(); - - TestSpeechListener listener; - TestSpeechChannelHandler speechHandler; - SpeechToText speech; - - setUp(() { - listener = TestSpeechListener(); - speech = SpeechToText.withMethodChannel(SpeechToText.speechChannel); - speechHandler = TestSpeechChannelHandler(speech); - speech.channel.setMockMethodCallHandler(speechHandler.methodCallHandler); - }); - - tearDown(() { - speech.channel.setMockMethodCallHandler(null); - }); - - group('hasPermission', () { - test('true if platform reports true', () async { - expect(await speech.hasPermission, true); - }); - test('false if platform reports false', () async { - speechHandler.hasPermissionResult = false; - expect(await speech.hasPermission, false); - }); - }); - group('init', () { - test('succeeds on platform success', () async { - expect(await speech.initialize(), true); - expect(speechHandler.initInvoked, true); - expect(speech.isAvailable, true); - }); - test('only invokes once', () async { - expect(await speech.initialize(), true); - speechHandler.initInvoked = false; - expect(await speech.initialize(), true); - expect(speechHandler.initInvoked, false); - }); - test('fails on platform failure', () async { - speechHandler.initResult = false; - expect(await speech.initialize(), false); - expect(speech.isAvailable, false); - }); - }); - - group('listen', () { - test('fails with exception if not initialized', () async { - try { - await speech.listen(); - fail("Expected an exception."); - } on SpeechToTextNotInitializedException { - // This is a good result - } - }); - test('fails with exception if init fails', () async { - try { - speechHandler.initResult = false; - await speech.initialize(); - await speech.listen(); - fail("Expected an exception."); - } on SpeechToTextNotInitializedException { - // This is a good result - } - }); - test('invokes listen after successful init', () async { - await speech.initialize(); - await speech.listen(); - expect(speechHandler.listenLocale, isNull); - expect(speechHandler.listenInvoked, true); - }); - test('converts platformException to listenFailed', () async { - await speech.initialize(); - speechHandler.listenException = true; - try { - await speech.listen(); - fail("Should have thrown"); - } on ListenFailedException catch (e) { - expect(e.details, TestSpeechChannelHandler.listenExceptionDetails); - } catch (wrongE) { - fail("Should have been ListenFailedException"); - } - }); - test('stops listen after listenFor duration', () async { - fakeAsync((fa) { - speech.initialize(); - fa.flushMicrotasks(); - speech.listen(listenFor: Duration(seconds: 2)); - fa.flushMicrotasks(); - expect(speech.isListening, isTrue); - fa.elapse(Duration(seconds: 2)); - expect(speech.isListening, isFalse); - }); - }); - test('stops listen after listenFor duration even with speech event', - () async { - fakeAsync((fa) { - speech.initialize(); - fa.flushMicrotasks(); - speech.listen(listenFor: Duration(seconds: 1)); - speech.processMethodCall(MethodCall(SpeechToText.textRecognitionMethod, - TestSpeechChannelHandler.firstRecognizedJson)); - fa.flushMicrotasks(); - expect(speech.isListening, isTrue); - fa.elapse(Duration(seconds: 1)); - expect(speech.isListening, isFalse); - }); - }); - test('stops listen after pauseFor duration with no speech', () async { - fakeAsync((fa) { - speech.initialize(); - fa.flushMicrotasks(); - speech.listen(pauseFor: Duration(seconds: 2)); - fa.flushMicrotasks(); - expect(speech.isListening, isTrue); - fa.elapse(Duration(seconds: 2)); - expect(speech.isListening, isFalse); - }); - }); - test('stops listen after pauseFor with longer listenFor duration', - () async { - fakeAsync((fa) { - speech.initialize(); - fa.flushMicrotasks(); - speech.listen( - pauseFor: Duration(seconds: 1), listenFor: Duration(seconds: 5)); - fa.flushMicrotasks(); - expect(speech.isListening, isTrue); - fa.elapse(Duration(seconds: 1)); - expect(speech.isListening, isFalse); - }); - }); - test('stops listen after listenFor with longer pauseFor duration', - () async { - fakeAsync((fa) { - speech.initialize(); - fa.flushMicrotasks(); - speech.listen( - listenFor: Duration(seconds: 1), pauseFor: Duration(seconds: 5)); - fa.flushMicrotasks(); - expect(speech.isListening, isTrue); - fa.elapse(Duration(seconds: 1)); - expect(speech.isListening, isFalse); - }); - }); - test('keeps listening after pauseFor with speech event', () async { - fakeAsync((fa) { - speech.initialize(); - fa.flushMicrotasks(); - speech.listen(pauseFor: Duration(seconds: 2)); - fa.flushMicrotasks(); - fa.elapse(Duration(seconds: 1)); - speech.processMethodCall(MethodCall(SpeechToText.textRecognitionMethod, - TestSpeechChannelHandler.firstRecognizedJson)); - fa.flushMicrotasks(); - fa.elapse(Duration(seconds: 1)); - expect(speech.isListening, isTrue); - }); - }); - test('uses localeId if provided', () async { - await speech.initialize(); - await speech.listen(localeId: TestSpeechChannelHandler.localeId1); - expect(speechHandler.listenInvoked, true); - expect(speechHandler.listenLocale, TestSpeechChannelHandler.localeId1); - }); - test('calls speech listener', () async { - await speech.initialize(); - await speech.listen(onResult: listener.onSpeechResult); - await speech.processMethodCall(MethodCall( - SpeechToText.textRecognitionMethod, - TestSpeechChannelHandler.firstRecognizedJson)); - expect(listener.speechResults, 1); - expect( - listener.results, [TestSpeechChannelHandler.firstRecognizedResult]); - expect(speech.lastRecognizedWords, - TestSpeechChannelHandler.firstRecognizedWords); - }); - test('calls speech listener with multiple', () async { - await speech.initialize(); - await speech.listen(onResult: listener.onSpeechResult); - await speech.processMethodCall(MethodCall( - SpeechToText.textRecognitionMethod, - TestSpeechChannelHandler.firstRecognizedJson)); - await speech.processMethodCall(MethodCall( - SpeechToText.textRecognitionMethod, - TestSpeechChannelHandler.secondRecognizedJson)); - expect(listener.speechResults, 2); - expect(listener.results, [ - TestSpeechChannelHandler.firstRecognizedResult, - TestSpeechChannelHandler.secondRecognizedResult - ]); - expect(speech.lastRecognizedWords, - TestSpeechChannelHandler.secondRecognizedWords); - }); - }); - - group('status callback', () { - test('invoked on listen', () async { - await speech.initialize( - onError: listener.onSpeechError, onStatus: listener.onSpeechStatus); - await speech.processMethodCall(MethodCall( - SpeechToText.notifyStatusMethod, SpeechToText.listeningStatus)); - expect(listener.speechStatus, 1); - expect(listener.statuses.contains(SpeechToText.listeningStatus), true); - }); - }); - - group('soundLevel callback', () { - test('invoked on listen', () async { - await speech.initialize(); - await speech.listen(onSoundLevelChange: listener.onSoundLevel); - await speech.processMethodCall(MethodCall( - SpeechToText.soundLevelChangeMethod, - TestSpeechChannelHandler.level1)); - expect(listener.soundLevel, 1); - expect(listener.soundLevels, contains(TestSpeechChannelHandler.level1)); - }); - test('sets lastLevel', () async { - await speech.initialize(); - await speech.listen(onSoundLevelChange: listener.onSoundLevel); - await speech.processMethodCall(MethodCall( - SpeechToText.soundLevelChangeMethod, - TestSpeechChannelHandler.level1)); - expect(speech.lastSoundLevel, TestSpeechChannelHandler.level1); - }); - }); - - group('cancel', () { - test('does nothing if not initialized', () async { - speech.cancel(); - expect(speechHandler.cancelInvoked, false); - }); - test('cancels an active listen', () async { - await speech.initialize(); - await speech.listen(); - await speech.cancel(); - expect(speechHandler.cancelInvoked, true); - expect(speech.isListening, isFalse); - }); - }); - group('stop', () { - test('does nothing if not initialized', () async { - speech.stop(); - expect(speechHandler.cancelInvoked, false); - }); - test('stops an active listen', () async { - await speech.initialize(); - speech.listen(); - speech.stop(); - expect(speechHandler.stopInvoked, true); - }); - }); - group('error', () { - test('notifies handler with transient', () async { - await speech.initialize(onError: listener.onSpeechError); - await speech.listen(); - await speech.processMethodCall(MethodCall(SpeechToText.notifyErrorMethod, - TestSpeechChannelHandler.transientErrorJson)); - expect(listener.speechErrors, 1); - expect(listener.errors.first.permanent, isFalse); - }); - test('notifies handler with permanent', () async { - await speech.initialize(onError: listener.onSpeechError); - await speech.listen(); - await speech.processMethodCall(MethodCall(SpeechToText.notifyErrorMethod, - TestSpeechChannelHandler.permanentErrorJson)); - expect(listener.speechErrors, 1); - expect(listener.errors.first.permanent, isTrue); - }); - test('continues listening on transient', () async { - await speech.initialize(onError: listener.onSpeechError); - await speech.listen(); - await speech.processMethodCall(MethodCall(SpeechToText.notifyErrorMethod, - TestSpeechChannelHandler.transientErrorJson)); - expect(speech.isListening, isTrue); - }); - test('continues listening on permanent if cancel not explicitly requested', - () async { - await speech.initialize(onError: listener.onSpeechError); - await speech.listen(); - await speech.processMethodCall(MethodCall(SpeechToText.notifyErrorMethod, - TestSpeechChannelHandler.permanentErrorJson)); - expect(speech.isListening, isTrue); - }); - test('stops listening on permanent if cancel explicitly requested', - () async { - await speech.initialize(onError: listener.onSpeechError); - await speech.listen(cancelOnError: true); - await speech.processMethodCall(MethodCall(SpeechToText.notifyErrorMethod, - TestSpeechChannelHandler.permanentErrorJson)); - expect(speech.isListening, isFalse); - }); - test('Error not sent after cancel', () async { - await speech.initialize(onError: listener.onSpeechError); - await speech.listen(); - await speech.cancel(); - await speech.processMethodCall(MethodCall(SpeechToText.notifyErrorMethod, - TestSpeechChannelHandler.permanentErrorJson)); - expect(speech.isListening, isFalse); - expect(listener.speechErrors, 0); - }); - test('Error still sent after implicit cancel', () async { - await speech.initialize(onError: listener.onSpeechError); - await speech.listen(cancelOnError: true); - await speech.processMethodCall(MethodCall(SpeechToText.notifyErrorMethod, - TestSpeechChannelHandler.permanentErrorJson)); - await speech.processMethodCall(MethodCall(SpeechToText.notifyErrorMethod, - TestSpeechChannelHandler.permanentErrorJson)); - expect(speech.isListening, isFalse); - expect(listener.speechErrors, 2); - }); - }); - group('locales', () { - test('fails with exception if not initialized', () async { - try { - await speech.locales(); - fail("Expected an exception."); - } on SpeechToTextNotInitializedException { - // This is a good result - } - }); - test('system locale null if not initialized', () async { - LocaleName current; - try { - current = await speech.systemLocale(); - fail("Expected an exception."); - } on SpeechToTextNotInitializedException { - expect(current, isNull); - } - }); - test('handles an empty list', () async { - await speech.initialize(onError: listener.onSpeechError); - List localeNames = await speech.locales(); - expect(speechHandler.localesInvoked, isTrue); - expect(localeNames, isEmpty); - }); - test('returns expected locales', () async { - await speech.initialize(onError: listener.onSpeechError); - speechHandler.locales.add(TestSpeechChannelHandler.locale1); - speechHandler.locales.add(TestSpeechChannelHandler.locale2); - List localeNames = await speech.locales(); - expect(localeNames, hasLength(speechHandler.locales.length)); - expect(localeNames[0].localeId, TestSpeechChannelHandler.localeId1); - expect(localeNames[0].name, TestSpeechChannelHandler.name1); - expect(localeNames[1].localeId, TestSpeechChannelHandler.localeId2); - expect(localeNames[1].name, TestSpeechChannelHandler.name2); - }); - test('skips incorrect locales', () async { - await speech.initialize(onError: listener.onSpeechError); - speechHandler.locales.add("InvalidJunk"); - speechHandler.locales.add(TestSpeechChannelHandler.locale1); - List localeNames = await speech.locales(); - expect(localeNames, hasLength(1)); - expect(localeNames[0].localeId, TestSpeechChannelHandler.localeId1); - expect(localeNames[0].name, TestSpeechChannelHandler.name1); - }); - test('system locale matches first returned locale', () async { - await speech.initialize(onError: listener.onSpeechError); - speechHandler.locales.add(TestSpeechChannelHandler.locale1); - speechHandler.locales.add(TestSpeechChannelHandler.locale2); - LocaleName current = await speech.systemLocale(); - expect(current.localeId, TestSpeechChannelHandler.localeId1); - }); - }); - group('status', () { - test('recognized false at start', () async { - expect(speech.hasRecognized, isFalse); - }); - test('listening false at start', () async { - expect(speech.isListening, isFalse); - }); - }); - test('available false at start', () async { - expect(speech.isAvailable, isFalse); - }); - test('hasError false at start', () async { - expect(speech.hasError, isFalse); - }); - test('lastError null at start', () async { - expect(speech.lastError, isNull); - }); - test('status empty at start', () async { - expect(speech.lastStatus, isEmpty); - }); -} - -class TestSpeechListener { - int speechResults = 0; - List results = []; - int speechErrors = 0; - List errors = []; - int speechStatus = 0; - List statuses = []; - int soundLevel = 0; - List soundLevels = []; - - void onSpeechResult(SpeechRecognitionResult result) { - ++speechResults; - results.add(result); - } - - void onSpeechError(SpeechRecognitionError errorResult) { - ++speechErrors; - errors.add(errorResult); - } - - void onSpeechStatus(String status) { - ++speechStatus; - statuses.add(status); - } - - void onSoundLevel(double level) { - ++soundLevel; - soundLevels.add(level); - } -} diff --git a/speech_to_text/test/test_speech_channel_handler.dart b/speech_to_text/test/test_speech_channel_handler.dart deleted file mode 100644 index a55f0670..00000000 --- a/speech_to_text/test/test_speech_channel_handler.dart +++ /dev/null @@ -1,134 +0,0 @@ -import 'package:flutter/services.dart'; -import 'package:speech_to_text/speech_recognition_error.dart'; -import 'package:speech_to_text/speech_recognition_result.dart'; -import 'package:speech_to_text/speech_to_text.dart'; - -/// Holds a set of responses and acts as a mock for the platform specific -/// implementations allowing test cases to determine what the result of -/// a call should be. -class TestSpeechChannelHandler { - final SpeechToText _speech; - - bool listenException = false; - - static const String listenExceptionCode = "listenFailedError"; - static const String listenExceptionMessage = "Failed"; - static const String listenExceptionDetails = "Device Listen Failure"; - - TestSpeechChannelHandler(this._speech); - - bool initResult = true; - bool initInvoked = false; - bool listenInvoked = false; - bool cancelInvoked = false; - bool stopInvoked = false; - bool localesInvoked = false; - bool hasPermissionResult = true; - String listeningStatusResponse = SpeechToText.listeningStatus; - String listenLocale; - List locales = []; - static const String localeId1 = "en_US"; - static const String localeId2 = "fr_CA"; - static const String name1 = "English US"; - static const String name2 = "French Canada"; - static const String locale1 = "$localeId1:$name1"; - static const String locale2 = "$localeId2:$name2"; - static const String firstRecognizedWords = 'hello'; - static const String secondRecognizedWords = 'hello there'; - static const double firstConfidence = 0.85; - static const double secondConfidence = 0.62; - static const String firstRecognizedJson = - '{"alternates":[{"recognizedWords":"$firstRecognizedWords","confidence":$firstConfidence}],"finalResult":false}'; - static const String secondRecognizedJson = - '{"alternates":[{"recognizedWords":"$secondRecognizedWords","confidence":$secondConfidence}],"finalResult":false}'; - static const String finalRecognizedJson = - '{"alternates":[{"recognizedWords":"$secondRecognizedWords","confidence":$secondConfidence}],"finalResult":true}'; - static const SpeechRecognitionWords firstWords = - SpeechRecognitionWords(firstRecognizedWords, firstConfidence); - static const SpeechRecognitionWords secondWords = - SpeechRecognitionWords(secondRecognizedWords, secondConfidence); - static final SpeechRecognitionResult firstRecognizedResult = - SpeechRecognitionResult([firstWords], false); - static final SpeechRecognitionResult secondRecognizedResult = - SpeechRecognitionResult([secondWords], false); - static final SpeechRecognitionResult finalRecognizedResult = - SpeechRecognitionResult([secondWords], true); - static const String transientErrorJson = - '{"errorMsg":"network","permanent":false}'; - static const String permanentErrorJson = - '{"errorMsg":"network","permanent":true}'; - static final SpeechRecognitionError firstError = - SpeechRecognitionError("network", true); - static const double level1 = 0.5; - static const double level2 = 10; - - Future methodCallHandler(MethodCall methodCall) async { - switch (methodCall.method) { - case "has_permission": - return hasPermissionResult; - break; - case "initialize": - initInvoked = true; - return initResult; - break; - case "cancel": - cancelInvoked = true; - return true; - break; - case "stop": - stopInvoked = true; - return true; - break; - case SpeechToText.listenMethod: - listenInvoked = true; - if (listenException) { - throw PlatformException( - code: listenExceptionCode, - message: listenExceptionMessage, - details: listenExceptionDetails); - } - listenLocale = methodCall.arguments["localeId"]; - await _speech.processMethodCall(MethodCall( - SpeechToText.notifyStatusMethod, listeningStatusResponse)); - return initResult; - break; - case "locales": - localesInvoked = true; - return locales; - break; - default: - } - return initResult; - } - - void notifyFinalWords() { - _speech.processMethodCall( - MethodCall(SpeechToText.textRecognitionMethod, finalRecognizedJson)); - } - - void notifyPartialWords() { - _speech.processMethodCall( - MethodCall(SpeechToText.textRecognitionMethod, firstRecognizedJson)); - } - - void notifyPermanentError() { - _speech.processMethodCall( - MethodCall(SpeechToText.notifyErrorMethod, permanentErrorJson)); - } - - void notifyTransientError() { - _speech.processMethodCall( - MethodCall(SpeechToText.notifyErrorMethod, transientErrorJson)); - } - - void notifySoundLevel() { - _speech.processMethodCall( - MethodCall(SpeechToText.soundLevelChangeMethod, level2)); - } - - void setupLocales() { - locales.clear(); - locales.add(locale1); - locales.add(locale2); - } -} diff --git a/speech_to_text/test/test_speech_listener.dart b/speech_to_text/test/test_speech_listener.dart deleted file mode 100644 index 1efcd81c..00000000 --- a/speech_to_text/test/test_speech_listener.dart +++ /dev/null @@ -1,36 +0,0 @@ -import 'package:speech_to_text/speech_recognition_error.dart'; -import 'package:speech_to_text/speech_recognition_result.dart'; -import 'package:speech_to_text/speech_to_text_provider.dart'; - -/// Holds the results of notification by the [SpeechToTextProvider] -class TestSpeechListener { - final SpeechToTextProvider _speechProvider; - - bool isListening = false; - bool isFinal = false; - bool isAvailable = false; - bool notified = false; - bool hasError = false; - SpeechRecognitionResult recognitionResult; - SpeechRecognitionError lastError; - double soundLevel; - - TestSpeechListener(this._speechProvider); - - void reset() { - isListening = false; - isFinal = false; - isAvailable = false; - notified = false; - } - - void onNotify() { - notified = true; - isAvailable = _speechProvider.isAvailable; - isListening = _speechProvider.isListening; - recognitionResult = _speechProvider.lastResult; - hasError = _speechProvider.hasError; - lastError = _speechProvider.lastError; - soundLevel = _speechProvider.lastLevel; - } -} From b2773aa320461c74f221aadea61ff07987ab2618 Mon Sep 17 00:00:00 2001 From: Sultan khan <> Date: Mon, 9 Jan 2023 11:34:27 +0300 Subject: [PATCH 03/28] ios fixed for speech to text --- ios/Runner.xcodeproj/project.pbxproj | 20 ++++++------------- .../profile/notes/note/update_note.dart | 13 +++++++----- lib/widgets/shared/speech-text-popup.dart | 4 ++-- .../shared/text_fields/html_rich_editor.dart | 5 +++-- 4 files changed, 19 insertions(+), 23 deletions(-) diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index af797b24..2475931a 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -501,10 +501,7 @@ ); INFOPLIST_FILE = Runner/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 11.0; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - ); + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; LIBRARY_SEARCH_PATHS = ( "$(inherited)", "$(PROJECT_DIR)/Flutter", @@ -520,6 +517,7 @@ }; 97C147031CF9000F007C117D /* Debug */ = { isa = XCBuildConfiguration; + baseConfigurationReference = 9740EEB31CF90195004384FC /* Generated.xcconfig */; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_ANALYZER_NONNULL = YES; @@ -639,10 +637,7 @@ ); INFOPLIST_FILE = Runner/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 11.0; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - ); + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; LIBRARY_SEARCH_PATHS = ( "$(inherited)", "$(PROJECT_DIR)/Flutter", @@ -673,10 +668,7 @@ ); INFOPLIST_FILE = Runner/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 11.0; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - ); + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; LIBRARY_SEARCH_PATHS = ( "$(inherited)", "$(PROJECT_DIR)/Flutter", @@ -701,7 +693,7 @@ 249021D3217E4FDB00AE95B9 /* Profile */, ); defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; + defaultConfigurationName = Debug; }; 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = { isa = XCConfigurationList; @@ -711,7 +703,7 @@ 249021D4217E4FDB00AE95B9 /* Profile */, ); defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; + defaultConfigurationName = Debug; }; /* End XCConfigurationList section */ }; diff --git a/lib/screens/patients/profile/notes/note/update_note.dart b/lib/screens/patients/profile/notes/note/update_note.dart index 71e86a4a..4369506f 100644 --- a/lib/screens/patients/profile/notes/note/update_note.dart +++ b/lib/screens/patients/profile/notes/note/update_note.dart @@ -14,6 +14,7 @@ import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.dart'; import 'package:doctor_app_flutter/utils/dr_app_toast_msg.dart'; +import 'package:doctor_app_flutter/utils/extenstions_utils.dart'; import 'package:doctor_app_flutter/utils/utils.dart'; import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; @@ -377,12 +378,14 @@ class _UpdateNoteOrderState extends State { void resultListener(result) { recognizedWord = result.recognizedWords; event.setValue({"searchText": recognizedWord}); - - if (result.finalResult == true) { + if (result.finalResult ==true) { setState(() { - SpeechToText.closeAlertDialog(context); - speech.stop(); - progressNoteController.text += recognizedWord + '\n'; + if (mounted) { + // speech.stop(); + progressNoteController.text += recognizedWord + '\n'; + SpeechToText.closeAlertDialog(context); + + } }); } else { print(result.finalResult); diff --git a/lib/widgets/shared/speech-text-popup.dart b/lib/widgets/shared/speech-text-popup.dart index ecb001b5..d911b86c 100644 --- a/lib/widgets/shared/speech-text-popup.dart +++ b/lib/widgets/shared/speech-text-popup.dart @@ -66,10 +66,10 @@ class _MyStatefulBuilderState extends State { if ((p['searchText'] != 'null' && p['searchText'] != null && p['searchText'] != "" && - isClosed == false) && - mounted) { + isClosed == false)) { setState(() { searchText = p['searchText']; + SpeechToText.closeAlertDialog(context); }); } else if (p['searchText'] == 'null') { setState(() { diff --git a/lib/widgets/shared/text_fields/html_rich_editor.dart b/lib/widgets/shared/text_fields/html_rich_editor.dart index 041bd8a8..6b5cd080 100644 --- a/lib/widgets/shared/text_fields/html_rich_editor.dart +++ b/lib/widgets/shared/text_fields/html_rich_editor.dart @@ -149,9 +149,10 @@ class _HtmlRichEditorState extends State { String txt = await widget.controller.getText(); if (result.finalResult == true) { setState(() { - SpeechToText.closeAlertDialog(context); - speech.stop(); widget.controller.setText(txt + recognizedWord); + SpeechToText.closeAlertDialog(context); + // speech.stop(); + }); } else { print(result.finalResult); From 51a8a93de1bdfcedbcd74323dbe68709f574ceef Mon Sep 17 00:00:00 2001 From: Sultan khan <> Date: Tue, 14 Mar 2023 11:47:41 +0300 Subject: [PATCH 04/28] pharmacy intervention null issue --- .../intervention_medication_history_res_model.dart | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/core/model/pharmacy-intervention-model/intervention_medication_history_res_model.dart b/lib/core/model/pharmacy-intervention-model/intervention_medication_history_res_model.dart index 451cccb8..e753ad62 100644 --- a/lib/core/model/pharmacy-intervention-model/intervention_medication_history_res_model.dart +++ b/lib/core/model/pharmacy-intervention-model/intervention_medication_history_res_model.dart @@ -7,7 +7,7 @@ class InterventionMedicationHistoryResModel { int orderNo; int id; int interventionId; - Null intervention; + dynamic intervention; String remark; int commentedBy; bool isDoctor; @@ -16,10 +16,10 @@ class InterventionMedicationHistoryResModel { String createdByName; String createdByNameN; String createdOn; - Null editedBy; - Null editedByName; - Null editedByNameN; - Null editedOn; + dynamic editedBy; + dynamic editedByName; + dynamic editedByNameN; + dynamic editedOn; InterventionMedicationHistoryResModel( {this.setupId, From 5d4aeff350af83a21f25532c49c0cbaa9a328d2d Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Thu, 18 May 2023 12:43:03 +0300 Subject: [PATCH 05/28] Updates & fixes --- android/app/build.gradle | 2 +- .../main/kotlin/com/hmg/hmgDr/MainActivity.kt | 4 +- .../hmg/hmgDr/Service/SessionStatusAPI.java | 6 +- .../VideoStreamFloatingWidgetService.kt | 3 + .../model/ChangeCallStatusRequestModel.java | 2 +- .../hmgDr/model/GetSessionStatusModel.java | 2 +- .../hmg/hmgDr/model/SessionStatusModel.java | 2 +- .../com/hmg/hmgDr/ui/VideoCallContract.java | 6 +- .../hmg/hmgDr/ui/VideoCallPresenterImpl.java | 6 +- .../hmgDr/ui/fragment/VideoCallFragment.kt | 7 +- ios/Podfile | 1 + lib/config/config.dart | 413 +++++++++++------ lib/config/localized_values.dart | 2 +- .../get_hospitals_request_model.dart | 7 +- lib/core/service/VideoCallService.dart | 12 +- lib/core/service/authentication_service.dart | 82 ++-- .../viewModel/authentication_view_model.dart | 231 ++++++---- .../auth/verification_methods_screen.dart | 436 ++++++------------ .../soap_update/plan/update_plan_page.dart | 2 +- .../LineChartCurvedBloodPressure.dart | 296 ++++++++++++ .../vital_sign/vital_sign_details_screen.dart | 341 ++++---------- .../vital_sign_item_details_screen.dart | 49 ++ .../vital_sing_chart_blood_pressure.dart | 3 +- lib/utils/utils.dart | 1 + ...ent-profile-header-new-design-app-bar.dart | 128 ++--- pubspec.yaml | 10 +- 26 files changed, 1130 insertions(+), 924 deletions(-) create mode 100644 lib/screens/patients/profile/vital_sign/LineChartCurvedBloodPressure.dart diff --git a/android/app/build.gradle b/android/app/build.gradle index eeb6a370..a518ebf8 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -30,7 +30,7 @@ android { signingConfigs { release { - storeFile file('/Users/nextwo/Desktop/Elham/keys/doctor app key') + storeFile file('/Users/mohamedmekawy/Documents/Work/DoctorApp/android/doctor app key') storePassword 'Hmgdoctor1234' keyAlias 'hmgdoctor' keyPassword 'Hmgdoctor1234' diff --git a/android/app/src/main/kotlin/com/hmg/hmgDr/MainActivity.kt b/android/app/src/main/kotlin/com/hmg/hmgDr/MainActivity.kt index f1c2c602..bfeaa3bf 100644 --- a/android/app/src/main/kotlin/com/hmg/hmgDr/MainActivity.kt +++ b/android/app/src/main/kotlin/com/hmg/hmgDr/MainActivity.kt @@ -17,8 +17,8 @@ import android.widget.Toast import androidx.annotation.NonNull import com.google.gson.GsonBuilder import com.hmg.hmgDr.Service.VideoStreamFloatingWidgetService -import com.hmg.hmgDr.model.GetSessionStatusModel -import com.hmg.hmgDr.model.SessionStatusModel +import com.hmg.hmgDr.Model.GetSessionStatusModel +import com.hmg.hmgDr.Model.SessionStatusModel import com.hmg.hmgDr.ui.VideoCallResponseListener import io.flutter.embedding.android.FlutterFragmentActivity import io.flutter.embedding.engine.FlutterEngine diff --git a/android/app/src/main/kotlin/com/hmg/hmgDr/Service/SessionStatusAPI.java b/android/app/src/main/kotlin/com/hmg/hmgDr/Service/SessionStatusAPI.java index 7c458b25..e507650e 100644 --- a/android/app/src/main/kotlin/com/hmg/hmgDr/Service/SessionStatusAPI.java +++ b/android/app/src/main/kotlin/com/hmg/hmgDr/Service/SessionStatusAPI.java @@ -1,8 +1,8 @@ package com.hmg.hmgDr.Service; -import com.hmg.hmgDr.model.ChangeCallStatusRequestModel; -import com.hmg.hmgDr.model.GetSessionStatusModel; -import com.hmg.hmgDr.model.SessionStatusModel; +import com.hmg.hmgDr.Model.ChangeCallStatusRequestModel; +import com.hmg.hmgDr.Model.GetSessionStatusModel; +import com.hmg.hmgDr.Model.SessionStatusModel; import retrofit2.Call; diff --git a/android/app/src/main/kotlin/com/hmg/hmgDr/Service/VideoStreamFloatingWidgetService.kt b/android/app/src/main/kotlin/com/hmg/hmgDr/Service/VideoStreamFloatingWidgetService.kt index fb152322..f82eae3d 100644 --- a/android/app/src/main/kotlin/com/hmg/hmgDr/Service/VideoStreamFloatingWidgetService.kt +++ b/android/app/src/main/kotlin/com/hmg/hmgDr/Service/VideoStreamFloatingWidgetService.kt @@ -17,6 +17,9 @@ import androidx.core.app.NotificationCompat import androidx.core.app.NotificationManagerCompat import androidx.core.content.ContextCompat import androidx.core.view.GestureDetectorCompat +import com.hmg.hmgDr.Model.ChangeCallStatusRequestModel +import com.hmg.hmgDr.Model.GetSessionStatusModel +import com.hmg.hmgDr.Model.SessionStatusModel import com.hmg.hmgDr.R import com.hmg.hmgDr.model.* import com.hmg.hmgDr.ui.VideoCallContract diff --git a/android/app/src/main/kotlin/com/hmg/hmgDr/model/ChangeCallStatusRequestModel.java b/android/app/src/main/kotlin/com/hmg/hmgDr/model/ChangeCallStatusRequestModel.java index c7993d5f..5fcdb611 100644 --- a/android/app/src/main/kotlin/com/hmg/hmgDr/model/ChangeCallStatusRequestModel.java +++ b/android/app/src/main/kotlin/com/hmg/hmgDr/model/ChangeCallStatusRequestModel.java @@ -1,4 +1,4 @@ -package com.hmg.hmgDr.model; +package com.hmg.hmgDr.Model; import android.os.Parcel; diff --git a/android/app/src/main/kotlin/com/hmg/hmgDr/model/GetSessionStatusModel.java b/android/app/src/main/kotlin/com/hmg/hmgDr/model/GetSessionStatusModel.java index 32b3a96c..9e2e1cf4 100644 --- a/android/app/src/main/kotlin/com/hmg/hmgDr/model/GetSessionStatusModel.java +++ b/android/app/src/main/kotlin/com/hmg/hmgDr/model/GetSessionStatusModel.java @@ -1,4 +1,4 @@ -package com.hmg.hmgDr.model; +package com.hmg.hmgDr.Model; import android.os.Parcel; import android.os.Parcelable; diff --git a/android/app/src/main/kotlin/com/hmg/hmgDr/model/SessionStatusModel.java b/android/app/src/main/kotlin/com/hmg/hmgDr/model/SessionStatusModel.java index fe309922..51b0b1ee 100644 --- a/android/app/src/main/kotlin/com/hmg/hmgDr/model/SessionStatusModel.java +++ b/android/app/src/main/kotlin/com/hmg/hmgDr/model/SessionStatusModel.java @@ -1,4 +1,4 @@ -package com.hmg.hmgDr.model; +package com.hmg.hmgDr.Model; import android.os.Parcel; import android.os.Parcelable; diff --git a/android/app/src/main/kotlin/com/hmg/hmgDr/ui/VideoCallContract.java b/android/app/src/main/kotlin/com/hmg/hmgDr/ui/VideoCallContract.java index cf87e54e..c26f8df4 100644 --- a/android/app/src/main/kotlin/com/hmg/hmgDr/ui/VideoCallContract.java +++ b/android/app/src/main/kotlin/com/hmg/hmgDr/ui/VideoCallContract.java @@ -1,8 +1,8 @@ package com.hmg.hmgDr.ui; -import com.hmg.hmgDr.model.ChangeCallStatusRequestModel; -import com.hmg.hmgDr.model.GetSessionStatusModel; -import com.hmg.hmgDr.model.SessionStatusModel; +import com.hmg.hmgDr.Model.ChangeCallStatusRequestModel; +import com.hmg.hmgDr.Model.GetSessionStatusModel; +import com.hmg.hmgDr.Model.SessionStatusModel; public interface VideoCallContract { diff --git a/android/app/src/main/kotlin/com/hmg/hmgDr/ui/VideoCallPresenterImpl.java b/android/app/src/main/kotlin/com/hmg/hmgDr/ui/VideoCallPresenterImpl.java index eed191fb..4613c231 100644 --- a/android/app/src/main/kotlin/com/hmg/hmgDr/ui/VideoCallPresenterImpl.java +++ b/android/app/src/main/kotlin/com/hmg/hmgDr/ui/VideoCallPresenterImpl.java @@ -1,8 +1,8 @@ package com.hmg.hmgDr.ui; -import com.hmg.hmgDr.model.ChangeCallStatusRequestModel; -import com.hmg.hmgDr.model.GetSessionStatusModel; -import com.hmg.hmgDr.model.SessionStatusModel; +import com.hmg.hmgDr.Model.ChangeCallStatusRequestModel; +import com.hmg.hmgDr.Model.GetSessionStatusModel; +import com.hmg.hmgDr.Model.SessionStatusModel; import com.hmg.hmgDr.Service.AppRetrofit; import com.hmg.hmgDr.Service.SessionStatusAPI; diff --git a/android/app/src/main/kotlin/com/hmg/hmgDr/ui/fragment/VideoCallFragment.kt b/android/app/src/main/kotlin/com/hmg/hmgDr/ui/fragment/VideoCallFragment.kt index a5ff26e9..e11e6b20 100644 --- a/android/app/src/main/kotlin/com/hmg/hmgDr/ui/fragment/VideoCallFragment.kt +++ b/android/app/src/main/kotlin/com/hmg/hmgDr/ui/fragment/VideoCallFragment.kt @@ -20,9 +20,9 @@ import androidx.constraintlayout.widget.ConstraintLayout import androidx.core.content.ContextCompat import androidx.core.view.GestureDetectorCompat import androidx.fragment.app.DialogFragment -import com.hmg.hmgDr.model.ChangeCallStatusRequestModel -import com.hmg.hmgDr.model.GetSessionStatusModel -import com.hmg.hmgDr.model.SessionStatusModel +import com.hmg.hmgDr.Model.ChangeCallStatusRequestModel +import com.hmg.hmgDr.Model.GetSessionStatusModel +import com.hmg.hmgDr.Model.SessionStatusModel import com.hmg.hmgDr.R import com.hmg.hmgDr.ui.VideoCallContract.VideoCallPresenter import com.hmg.hmgDr.ui.VideoCallContract.VideoCallView @@ -143,6 +143,7 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session return R.style.dialogTheme } + @SuppressLint("UseRequireInsteadOfGet") override fun onCreateDialog(@Nullable savedInstanceState: Bundle?): Dialog {// FullScreenVideoTheme val layoutInflater = requireActivity().layoutInflater this.parentView = onCreateView(layoutInflater, null) diff --git a/ios/Podfile b/ios/Podfile index 1d3f65fc..e02bcf99 100644 --- a/ios/Podfile +++ b/ios/Podfile @@ -38,6 +38,7 @@ target 'Runner' do # Plugin Pods flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__)) + pod 'DKImagePickerController/PhotoGallery', :git => 'https://github.com/miguelpruivo/DKImagePickerController.git' end post_install do |installer| diff --git a/lib/config/config.dart b/lib/config/config.dart index 4a246275..c8d7ceaf 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -5,85 +5,125 @@ const ONLY_NUMBERS = "[0-9]"; const ONLY_LETTERS = "[a-zA-Z &'\"]"; const ONLY_DATE = "[0-9/]"; const BASE_URL_LIVE_CARE = 'https://livecare.hmg.com/'; -//const BASE_URL = 'https://hmgwebservices.com/'; -const BASE_URL = 'https://uat.hmgwebservices.com/'; -const PHARMACY_ITEMS_URL = "Services/Lists.svc/REST/GetPharmcyItems_Region_enh"; -const PHARMACY_LIST_URL = "Services/Patients.svc/REST/GetPharmcyList"; -const PATIENT_PROGRESS_NOTE_URL = "Services/DoctorApplication.svc/REST/GetProgressNoteForInPatient"; -const PATIENT_INSURANCE_APPROVALS_URL = "Services/DoctorApplication.svc/REST/GetApprovalStatusForInpatient"; -const PATIENT_REFER_TO_DOCTOR_URL = "Services/DoctorApplication.svc/REST/ReferToDoctor"; -const PATIENT_GET_DOCTOR_BY_CLINIC_URL = "Services/DoctorApplication.svc/REST/GetDoctorsByClinicID"; -const PATIENT_GET_DOCTOR_BY_CLINIC_Hospital = "Services/Doctors.svc/REST/SearchDoctorsByTime"; +const BASE_URL = 'https://hmgwebservices.com/'; + +// const BASE_URL = 'https://uat.hmgwebservices.com/'; + +// const BASE_URL = 'https://vidauat.cloudsolutions.com.sa/'; //Vida Plus URL + -const GET_CLINICS_FOR_DOCTOR = 'Services/DoctorApplication.svc/REST/GetClinicsForDoctor'; -const PATIENT_GET_LIST_REFERAL_URL = "Services/Lists.svc/REST/GetList_STPReferralFrequency"; -const PATIENT_GET_CLINIC_BY_PROJECT_URL = "Services/DoctorApplication.svc/REST/GetClinicsByProjectID"; +const PHARMACY_ITEMS_URL = "Services/Lists.svc/REST/GetPharmcyItems_Region_enh"; +const PHARMACY_LIST_URL = "Services/Patients.svc/REST/GetPharmcyList"; +const PATIENT_PROGRESS_NOTE_URL = + "Services/DoctorApplication.svc/REST/GetProgressNoteForInPatient"; +const PATIENT_INSURANCE_APPROVALS_URL = + "Services/DoctorApplication.svc/REST/GetApprovalStatusForInpatient"; +const PATIENT_REFER_TO_DOCTOR_URL = + "Services/DoctorApplication.svc/REST/ReferToDoctor"; +const PATIENT_GET_DOCTOR_BY_CLINIC_URL = + "Services/DoctorApplication.svc/REST/GetDoctorsByClinicID"; + +const PATIENT_GET_DOCTOR_BY_CLINIC_Hospital = + "Services/Doctors.svc/REST/SearchDoctorsByTime"; + +const GET_CLINICS_FOR_DOCTOR = + 'Services/DoctorApplication.svc/REST/GetClinicsForDoctor'; +const PATIENT_GET_LIST_REFERAL_URL = + "Services/Lists.svc/REST/GetList_STPReferralFrequency"; +const PATIENT_GET_CLINIC_BY_PROJECT_URL = + "Services/DoctorApplication.svc/REST/GetClinicsByProjectID"; const PROJECT_GET_INFO = "Services/DoctorApplication.svc/REST/GetProjectInfo"; const GET_CLINICS = "Services/DoctorApplication.svc/REST/GetClinics"; -const GET_REFERRAL_FACILITIES = 'Services/DoctorApplication.svc/REST/GetReferralFacilities'; +const GET_REFERRAL_FACILITIES = + 'Services/DoctorApplication.svc/REST/GetReferralFacilities'; const GET_PROJECTS = 'Services/DoctorApplication.svc/REST/GetProjectInfo'; -const GET_PATIENT_VITAL_SIGN = 'Services/Doctors.svc/REST/Doctor_GetPatientVitalSign'; -const GET_PATIENT_VITAL_SIGN_DATA = 'Services/DoctorApplication.svc/REST/GetVitalSigns'; -const GET_PATIENT_LAB_OREDERS = 'Services/DoctorApplication.svc/REST/GetPatientLabOreders'; +const GET_PATIENT_VITAL_SIGN = + 'Services/Doctors.svc/REST/Doctor_GetPatientVitalSign'; +const GET_PATIENT_VITAL_SIGN_DATA = + 'Services/DoctorApplication.svc/REST/GetVitalSigns'; +const GET_PATIENT_LAB_OREDERS = + 'Services/DoctorApplication.svc/REST/GetPatientLabOreders'; const GET_PRESCRIPTION = 'Services/Patients.svc/REST/GetPrescriptionApptList'; -const GET_LIVECARE_PENDINGLIST = 'Services/DoctorApplication.svc/REST/GetPendingPatientER'; +const GET_LIVECARE_PENDINGLIST = + 'Services/DoctorApplication.svc/REST/GetPendingPatientER'; const START_LIVE_CARE_CALL = 'LiveCareApi/DoctorApp/CallPatient'; -const LIVE_CARE_STATISTICS_FOR_CERTAIN_DOCTOR_URL = "Lists.svc/REST/DashBoard_GetLiveCareDoctorsStatsticsForCertainDoctor"; +const LIVE_CARE_STATISTICS_FOR_CERTAIN_DOCTOR_URL = + "Lists.svc/REST/DashBoard_GetLiveCareDoctorsStatsticsForCertainDoctor"; -const GET_PRESCRIPTION_REPORT = 'Services/Patients.svc/REST/GetPrescriptionReport'; +const GET_PRESCRIPTION_REPORT = + 'Services/Patients.svc/REST/GetPrescriptionReport'; -const GT_MY_PATIENT_QUESTION = 'Services/DoctorApplication.svc/REST/GtMyPatientsQuestions'; +const GT_MY_PATIENT_QUESTION = + 'Services/DoctorApplication.svc/REST/GtMyPatientsQuestions'; -const PRM_SEARCH_PATIENT = 'Services/Patients.svc/REST/GetPatientInformation_PRM'; +const PRM_SEARCH_PATIENT = + 'Services/Patients.svc/REST/GetPatientInformation_PRM'; const GET_PATIENT = 'Services/DoctorApplication.svc/REST/'; -const GET_PRESCRIPTION_REPORT_FOR_IN_PATIENT = 'Services/DoctorApplication.svc/REST/GetPrescriptionReportForInPatient'; +const GET_PRESCRIPTION_REPORT_FOR_IN_PATIENT = + 'Services/DoctorApplication.svc/REST/GetPrescriptionReportForInPatient'; -const GET_MY_REFERRAL_PATIENT = 'Services/DoctorApplication.svc/REST/GtMyReferralPatient'; +const GET_MY_REFERRAL_PATIENT = + 'Services/DoctorApplication.svc/REST/GtMyReferralPatient'; const REFER_TO_DOCTOR = 'Services/DoctorApplication.svc/REST/ReferToDoctor'; -const ADD_REFERRED_DOCTOR_REMARKS = 'Services/DoctorApplication.svc/REST/AddReferredDoctorRemarks'; +const ADD_REFERRED_DOCTOR_REMARKS = + 'Services/DoctorApplication.svc/REST/AddReferredDoctorRemarks'; -const GET_MY_REFERRED_PATIENT = 'Services/DoctorApplication.svc/REST/GtMyReferredPatient'; +const GET_MY_REFERRED_PATIENT = + 'Services/DoctorApplication.svc/REST/GtMyReferredPatient'; -const GET_MY_REFERRED_OUT_PATIENT = 'Services/DoctorApplication.svc/REST/GtMyReferredOutPatient'; +const GET_MY_REFERRED_OUT_PATIENT = + 'Services/DoctorApplication.svc/REST/GtMyReferredOutPatient'; -const GET_PENDING_REFERRAL_PATIENT = 'Services/DoctorApplication.svc/REST/PendingReferrals'; +const GET_PENDING_REFERRAL_PATIENT = + 'Services/DoctorApplication.svc/REST/PendingReferrals'; -const CREATE_REFERRAL_PATIENT = 'Services/DoctorApplication.svc/REST/CreateReferral'; +const CREATE_REFERRAL_PATIENT = + 'Services/DoctorApplication.svc/REST/CreateReferral'; -const RESPONSE_PENDING_REFERRAL_PATIENT = 'Services/DoctorApplication.svc/REST/RespondReferral'; +const RESPONSE_PENDING_REFERRAL_PATIENT = + 'Services/DoctorApplication.svc/REST/RespondReferral'; const GET_PATIENT_REFERRAL = 'Services/DoctorApplication.svc/REST/GetRefferal'; const POST_UCAF = 'Services/DoctorApplication.svc/REST/PostUCAF'; -const GET_DOCTOR_WORKING_HOURS_TABLE = 'Services/Doctors.svc/REST/GetDoctorWorkingHoursTable'; +const GET_DOCTOR_WORKING_HOURS_TABLE = + 'Services/Doctors.svc/REST/GetDoctorWorkingHoursTable'; -const GET_PATIENT_LAB_RESULTS = 'Services/DoctorApplication.svc/REST/GetPatientLabResults'; +const GET_PATIENT_LAB_RESULTS = + 'Services/DoctorApplication.svc/REST/GetPatientLabResults'; const LOGIN_URL = 'Services/Sentry.svc/REST/MemberLogIN_New'; -const INSERT_DEVICE_IMEI = 'Services/DoctorApplication.svc/REST/DoctorApp_InsertOrUpdateDeviceDetails'; +const INSERT_DEVICE_IMEI = + 'Services/DoctorApplication.svc/REST/DoctorApp_InsertOrUpdateDeviceDetails'; // 'Services/Sentry.svc/REST/DoctorApplication_INSERTDeviceIMEI'; // const SELECT_DEVICE_IMEI = // 'Services/Sentry.svc/REST/DoctorApplication_SELECTDeviceIMEIbyIMEI'; -const SELECT_DEVICE_IMEI = 'Services/DoctorApplication.svc/REST/DoctorApp_GetDeviceDetailsByIMEI'; +const SELECT_DEVICE_IMEI = + 'Services/DoctorApplication.svc/REST/DoctorApp_GetDeviceDetailsByIMEI'; -const SEND_ACTIVATION_CODE_BY_OTP_NOTIFICATION_TYPE = 'Services/Sentry.svc/REST/DoctorApplication_SendActivationCodebyOTPNotificationType'; +const SEND_ACTIVATION_CODE_BY_OTP_NOTIFICATION_TYPE = + 'Services/Sentry.svc/REST/DoctorApplication_SendActivationCodebyOTPNotificationType'; -const SEND_ACTIVATION_CODE_FOR_DOCTOR_APP = 'Services/DoctorApplication.svc/REST/SendActivationCodeForDoctorApp'; +const SEND_ACTIVATION_CODE_FOR_DOCTOR_APP = + 'Services/DoctorApplication.svc/REST/SendActivationCodeForDoctorApp'; -const SEND_ACTIVATION_CODE_FOR_VERIFICATION_SCREEN = 'Services/DoctorApplication.svc/REST/SendVerificationCode'; -const MEMBER_CHECK_ACTIVATION_CODE_NEW = 'Services/Sentry.svc/REST/MemberCheckActivationCode_New'; +const SEND_ACTIVATION_CODE_FOR_VERIFICATION_SCREEN = + 'Services/DoctorApplication.svc/REST/SendVerificationCode'; +const MEMBER_CHECK_ACTIVATION_CODE_NEW = + 'Services/Sentry.svc/REST/MemberCheckActivationCode_New'; -const CHECK_ACTIVATION_CODE_FOR_DOCTOR_APP = 'Services/DoctorApplication.svc/REST/CheckActivationCodeForDoctorApp'; +const CHECK_ACTIVATION_CODE_FOR_DOCTOR_APP = + 'Services/DoctorApplication.svc/REST/CheckActivationCodeForDoctorApp'; const GET_DOC_PROFILES = 'Services/Doctors.svc/REST/GetDocProfiles'; const TRANSFERT_TO_ADMIN = 'LiveCareApi/DoctorApp/TransferToAdmin'; @@ -91,179 +131,268 @@ const SEND_SMS_INSTRUCTIONS = 'LiveCareApi/DoctorApp/SendSMSInstruction'; const GET_ALTERNATIVE_SERVICE = 'LiveCareApi/DoctorApp/GetAlternativeServices'; const END_CALL = 'LiveCareApi/DoctorApp/EndCall'; const END_CALL_WITH_CHARGE = 'LiveCareApi/DoctorApp/CompleteCallWithCharge'; -const GET_DASHBOARD = 'Services/DoctorApplication.svc/REST/GetDoctorDashboardKPI'; -const GET_SICKLEAVE_STATISTIC = 'Services/DoctorApplication.svc/REST/PreSickLeaveStatistics'; -const ARRIVED_PATIENT_URL = 'Services/DoctorApplication.svc/REST/PatientArrivalList'; +const GET_DASHBOARD = + 'Services/DoctorApplication.svc/REST/GetDoctorDashboardKPI'; +const GET_SICKLEAVE_STATISTIC = + 'Services/DoctorApplication.svc/REST/PreSickLeaveStatistics'; +const ARRIVED_PATIENT_URL = + 'Services/DoctorApplication.svc/REST/PatientArrivalList'; const ADD_SICK_LEAVE = 'Services/DoctorApplication.svc/REST/PostSickLeave'; const GET_SICK_LEAVE = 'Services/Patients.svc/REST/GetPatientSickLeave'; const EXTEND_SICK_LEAVE = 'Services/DoctorApplication.svc/REST/ExtendSickLeave'; const GET_MASTER_LOOKUP_LIST = 'Services/DoctorApplication.svc/REST/GetMasterLookUpList'; -const GET_COVERING_DOCTORS = 'Services/DoctorApplication.svc/REST/GetCoveringDoctor'; +const GET_COVERING_DOCTORS = + 'Services/DoctorApplication.svc/REST/GetCoveringDoctor'; const ADD_RESCHDEULE = 'Services/DoctorApplication.svc/REST/PostRequisition'; -const UPDATE_RESCHDEULE = 'Services/DoctorApplication.svc/REST/PatchRequisition'; -const GET_RESCHEDULE_LEAVE = 'Services/DoctorApplication.svc/REST/GetRequisition'; -const GET_PRESCRIPTION_LIST = 'Services/DoctorApplication.svc/REST/GetPrescription'; - -const POST_PRESCRIPTION_LIST = 'Services/DoctorApplication.svc/REST/PostPrescription'; -const GET_PROCEDURE_LIST = 'Services/DoctorApplication.svc/REST/GetOrderedProcedure'; +const UPDATE_RESCHDEULE = + 'Services/DoctorApplication.svc/REST/PatchRequisition'; +const GET_RESCHEDULE_LEAVE = + 'Services/DoctorApplication.svc/REST/GetRequisition'; +const GET_PRESCRIPTION_LIST = + 'Services/DoctorApplication.svc/REST/GetPrescription'; + +const POST_PRESCRIPTION_LIST = + 'Services/DoctorApplication.svc/REST/PostPrescription'; +const GET_PROCEDURE_LIST = + 'Services/DoctorApplication.svc/REST/GetOrderedProcedure'; const POST_PROCEDURE_LIST = 'Services/DoctorApplication.svc/REST/PostProcedure'; -const GET_PATIENT_IN_PATIENT_LIST = 'Services/DoctorApplication.svc/REST/GetMyInPatient'; -const Verify_Referral_Doctor_Remarks = 'Services/DoctorApplication.svc/REST/VerifyReferralDoctorRemarks'; +const GET_PATIENT_IN_PATIENT_LIST = + 'Services/DoctorApplication.svc/REST/GetMyInPatient'; + +const Verify_Referral_Doctor_Remarks = + 'Services/DoctorApplication.svc/REST/VerifyReferralDoctorRemarks'; ///Lab Order const GET_Patient_LAB_ORDERS = 'Services/Patients.svc/REST/GetPatientLabOrders'; -const GET_Patient_LAB_SPECIAL_RESULT = 'Services/Patients.svc/REST/GetPatientLabSpecialResults'; -const SEND_LAB_RESULT_EMAIL = 'Services/Notifications.svc/REST/SendLabReportEmail'; -const GET_Patient_LAB_RESULT = 'Services/Patients.svc/REST/GetPatientLabResults'; -const GET_Patient_LAB_ORDERS_RESULT = 'Services/Patients.svc/REST/GetPatientLabOrdersResults'; -const GET_PATIENT_LAB_ORDERS_RESULT_HISTORY_BY_DESCRIPTION = 'Services/Patients.svc/REST/GetPatientLabOrdersResultsHistoryByDescription'; +const GET_Patient_LAB_SPECIAL_RESULT = + 'Services/Patients.svc/REST/GetPatientLabSpecialResults'; +const SEND_LAB_RESULT_EMAIL = + 'Services/Notifications.svc/REST/SendLabReportEmail'; +const GET_Patient_LAB_RESULT = + 'Services/Patients.svc/REST/GetPatientLabResults'; +const GET_Patient_LAB_ORDERS_RESULT = + 'Services/Patients.svc/REST/GetPatientLabOrdersResults'; +const GET_PATIENT_LAB_ORDERS_RESULT_HISTORY_BY_DESCRIPTION = + 'Services/Patients.svc/REST/GetPatientLabOrdersResultsHistoryByDescription'; // SOAP const GET_ALLERGIES = 'Services/DoctorApplication.svc/REST/GetAllergies'; const POST_EPISODE = 'Services/DoctorApplication.svc/REST/PostEpisode'; -const POST_EPISODE_FOR_IN_PATIENT = 'Services/DoctorApplication.svc/REST/PostEpisodeForInpatient'; +const POST_EPISODE_FOR_IN_PATIENT = + 'Services/DoctorApplication.svc/REST/PostEpisodeForInpatient'; const POST_ALLERGY = 'Services/DoctorApplication.svc/REST/PostAllergies'; const POST_HISTORY = 'Services/DoctorApplication.svc/REST/PostHistory'; -const POST_CHIEF_COMPLAINT = 'Services/DoctorApplication.svc/REST/PostChiefcomplaint'; -const POST_PHYSICAL_EXAM = 'Services/DoctorApplication.svc/REST/PostPhysicalExam'; -const POST_PROGRESS_NOTE = '/Services/DoctorApplication.svc/REST/PostProgressNote'; +const POST_CHIEF_COMPLAINT = + 'Services/DoctorApplication.svc/REST/PostChiefcomplaint'; +const POST_PHYSICAL_EXAM = + 'Services/DoctorApplication.svc/REST/PostPhysicalExam'; +const POST_PROGRESS_NOTE = + '/Services/DoctorApplication.svc/REST/PostProgressNote'; const POST_ASSESSMENT = 'Services/DoctorApplication.svc/REST/PostAssessment'; const PATCH_ALLERGY = 'Services/DoctorApplication.svc/REST/PatchAllergies'; const PATCH_HISTORY = 'Services/DoctorApplication.svc/REST/PatchHistory'; -const PATCH_CHIEF_COMPLAINT = 'Services/DoctorApplication.svc/REST/PatchChiefcomplaint'; +const PATCH_CHIEF_COMPLAINT = + 'Services/DoctorApplication.svc/REST/PatchChiefcomplaint'; -const PATCH_PHYSICAL_EXAM = 'Services/DoctorApplication.svc/REST/PatchPhysicalExam'; -const PATCH_PROGRESS_NOTE = 'Services/DoctorApplication.svc/REST/PatchProgressNote'; +const PATCH_PHYSICAL_EXAM = + 'Services/DoctorApplication.svc/REST/PatchPhysicalExam'; +const PATCH_PROGRESS_NOTE = + 'Services/DoctorApplication.svc/REST/PatchProgressNote'; const PATCH_ASSESSMENT = 'Services/DoctorApplication.svc/REST/PatchAssessment'; const GET_HISTORY = 'Services/DoctorApplication.svc/REST/GetHistory'; -const GET_CHIEF_COMPLAINT = 'Services/DoctorApplication.svc/REST/GetChiefcomplaint'; +const GET_CHIEF_COMPLAINT = + 'Services/DoctorApplication.svc/REST/GetChiefcomplaint'; const GET_PHYSICAL_EXAM = 'Services/DoctorApplication.svc/REST/GetPhysicalExam'; const GET_PROGRESS_NOTE = 'Services/DoctorApplication.svc/REST/GetProgressNote'; const GET_ASSESSMENT = 'Services/DoctorApplication.svc/REST/GetAssessment'; -const GET_LIST_CATEGORISE = 'Services/DoctorApplication.svc/REST/GetProcedureCategories'; -const GET_CATEGORISE_PROCEDURE = 'Services/DoctorApplication.svc/REST/GetProcedure'; +const GET_LIST_CATEGORISE = + 'Services/DoctorApplication.svc/REST/GetProcedureCategories'; + +const GET_CATEGORISE_PROCEDURE = + 'Services/DoctorApplication.svc/REST/GetProcedure'; const UPDATE_PROCEDURE = 'Services/DoctorApplication.svc/REST/PatchProcedure'; -const UPDATE_PRESCRIPTION = 'Services/DoctorApplication.svc/REST/PatchPrescription'; +const UPDATE_PRESCRIPTION = + 'Services/DoctorApplication.svc/REST/PatchPrescription'; const SEARCH_DRUG = 'Services/DoctorApplication.svc/REST/GetMedicationList'; -const DRUG_TO_DRUG = 'Services/DoctorApplication.svc/REST/DrugToDrugInteraction'; +const DRUG_TO_DRUG = + 'Services/DoctorApplication.svc/REST/DrugToDrugInteraction'; const GET_MEDICAL_FILE = 'Services/DoctorApplication.svc/REST/GetMedicalFile'; const GET_FLOORS = 'Services/DoctorApplication.svc/REST/GetFloors'; const GET_WARDS = 'Services/DoctorApplication.svc/REST/GetWards'; -const GET_ROOM_CATEGORIES = 'Services/DoctorApplication.svc/REST/GetRoomCategories'; -const GET_DIAGNOSIS_TYPES = 'Services/DoctorApplication.svc/REST/DiagnosisTypes'; +const GET_ROOM_CATEGORIES = + 'Services/DoctorApplication.svc/REST/GetRoomCategories'; +const GET_DIAGNOSIS_TYPES = + 'Services/DoctorApplication.svc/REST/DiagnosisTypes'; const GET_DIET_TYPES = 'Services/DoctorApplication.svc/REST/DietTypes'; const GET_ICD_CODES = 'Services/DoctorApplication.svc/REST/GetICDCodes'; -const POST_ADMISSION_REQUEST = 'Services/DoctorApplication.svc/REST/PostAdmissionRequest'; -const GET_ITEM_BY_MEDICINE = 'Services/DoctorApplication.svc/REST/GetItemByMedicineCode'; +const POST_ADMISSION_REQUEST = + 'Services/DoctorApplication.svc/REST/PostAdmissionRequest'; +const GET_ITEM_BY_MEDICINE = + 'Services/DoctorApplication.svc/REST/GetItemByMedicineCode'; -const GET_PROCEDURE_VALIDATION = 'Services/DoctorApplication.svc/REST/ValidateProcedures'; -const GET_BOX_QUANTITY = 'Services/DoctorApplication.svc/REST/CalculateBoxQuantity'; +const GET_PROCEDURE_VALIDATION = + 'Services/DoctorApplication.svc/REST/ValidateProcedures'; +const GET_BOX_QUANTITY = + 'Services/DoctorApplication.svc/REST/CalculateBoxQuantity'; ///GET ECG const GET_ECG = "Services/Patients.svc/REST/HIS_GetPatientMuseResults"; -const GET_MY_REFERRAL_INPATIENT = "Services/DoctorApplication.svc/REST/GtMyReferralPatient"; +const GET_MY_REFERRAL_INPATIENT = + "Services/DoctorApplication.svc/REST/GtMyReferralPatient"; -const GET_MY_REFERRAL_OUT_PATIENT = "Services/DoctorApplication.svc/REST/GtMyReferralForOutPatient"; +const GET_MY_REFERRAL_OUT_PATIENT = + "Services/DoctorApplication.svc/REST/GtMyReferralForOutPatient"; -const GET_MY_DISCHARGE_PATIENT = "Services/DoctorApplication.svc/REST/GtMyDischargeReferralPatient"; -const GET_DISCHARGE_PATIENT = "Services/DoctorApplication.svc/REST/GtMyDischargePatient"; +const GET_MY_DISCHARGE_PATIENT = + "Services/DoctorApplication.svc/REST/GtMyDischargeReferralPatient"; +const GET_DISCHARGE_PATIENT = + "Services/DoctorApplication.svc/REST/GtMyDischargePatient"; -const GET_PAtIENTS_INSURANCE_APPROVALS = "Services/Patients.svc/REST/GetApprovalStatus"; +const GET_PAtIENTS_INSURANCE_APPROVALS = + "Services/Patients.svc/REST/GetApprovalStatus"; const GET_RAD_IMAGE_URL = 'Services/Patients.svc/Rest/GetRadImageURL'; const GET_PATIENT_ORDERS = 'Services/Patients.svc/REST/GetPatientRadOrders'; -const GET_IN_PATIENT_ORDERS = 'Services/DoctorApplication.svc/REST/GetPatientRadResult'; +const GET_IN_PATIENT_ORDERS = + 'Services/DoctorApplication.svc/REST/GetPatientRadResult'; ///Prescriptions -const GET_PRESCRIPTIONS_ALL_ORDERS = 'Services/Patients.svc/REST/PatientER_GetPatientAllPresOrders'; -const GET_PRESCRIPTION_REPORT_NEW = 'Services/Patients.svc/REST/INP_GetPrescriptionReport'; -const SEND_PRESCRIPTION_EMAIL = 'Services/Notifications.svc/REST/SendPrescriptionEmail'; -const GET_PRESCRIPTION_REPORT_ENH = 'Services/Patients.svc/REST/GetPrescriptionReport_enh'; -const UPDATE_PROGRESS_NOTE_FOR_INPATIENT = "Services/DoctorApplication.svc/REST/UpdateProgressNoteForInPatient"; -const CREATE_PROGRESS_NOTE_FOR_INPATIENT = "Services/DoctorApplication.svc/REST/CreateProgressNoteForInPatient"; +const GET_PRESCRIPTIONS_ALL_ORDERS = + 'Services/Patients.svc/REST/PatientER_GetPatientAllPresOrders'; +const GET_PRESCRIPTION_REPORT_NEW = + 'Services/Patients.svc/REST/INP_GetPrescriptionReport'; +const SEND_PRESCRIPTION_EMAIL = + 'Services/Notifications.svc/REST/SendPrescriptionEmail'; +const GET_PRESCRIPTION_REPORT_ENH = + 'Services/Patients.svc/REST/GetPrescriptionReport_enh'; +const UPDATE_PROGRESS_NOTE_FOR_INPATIENT = + "Services/DoctorApplication.svc/REST/UpdateProgressNoteForInPatient"; +const CREATE_PROGRESS_NOTE_FOR_INPATIENT = + "Services/DoctorApplication.svc/REST/CreateProgressNoteForInPatient"; const GET_SICK_LEAVE_PATIENT = "Services/Patients.svc/REST/GetPatientSickLeave"; -const GET_MY_OUT_PATIENT = "Services/DoctorApplication.svc/REST/GetMyOutPatient"; +const GET_MY_OUT_PATIENT = + "Services/DoctorApplication.svc/REST/GetMyOutPatient"; -const PATIENT_MEDICAL_REPORT_GET_LIST = "Services/Patients.svc/REST/DAPP_ListMedicalReport"; -const PATIENT_MEDICAL_REPORT_GET_TEMPLATE = "Services/Patients.svc/REST/DAPP_GetTemplateByID"; -const PATIENT_MEDICAL_REPORT_INSERT = "Services/Patients.svc/REST/DAPP_InsertMedicalReport"; -const PATIENT_MEDICAL_REPORT_VERIFIED = "Services/Patients.svc/REST/DAPP_VerifiedMedicalReport"; +const PATIENT_MEDICAL_REPORT_GET_LIST = + "Services/Patients.svc/REST/DAPP_ListMedicalReport"; +const PATIENT_MEDICAL_REPORT_GET_TEMPLATE = + "Services/Patients.svc/REST/DAPP_GetTemplateByID"; +const PATIENT_MEDICAL_REPORT_INSERT = + "Services/Patients.svc/REST/DAPP_InsertMedicalReport"; +const PATIENT_MEDICAL_REPORT_VERIFIED = + "Services/Patients.svc/REST/DAPP_VerifiedMedicalReport"; -const GET_PROCEDURE_TEMPLETE = 'Services/Doctors.svc/REST/DAPP_ProcedureTemplateGet'; +const GET_PROCEDURE_TEMPLETE = + 'Services/Doctors.svc/REST/DAPP_ProcedureTemplateGet'; const GET_TEMPLETE_LIST = 'Services/Doctors.svc/REST/DAPP_TemplateGet'; -const GET_PROCEDURE_TEMPLETE_DETAILS = "Services/Doctors.svc/REST/DAPP_ProcedureTemplateDetailsGet"; -const GET_PENDING_PATIENT_ER_FOR_DOCTOR_APP = 'Services/DoctorApplication.svc/REST/GetPendingPatientERForDoctorApp'; +const GET_PROCEDURE_TEMPLETE_DETAILS = + "Services/Doctors.svc/REST/DAPP_ProcedureTemplateDetailsGet"; +const GET_PENDING_PATIENT_ER_FOR_DOCTOR_APP = + 'Services/DoctorApplication.svc/REST/GetPendingPatientERForDoctorApp'; -const DOCTOR_CHECK_HAS_LIVE_CARE = "Services/DoctorApplication.svc/REST/CheckDoctorHasLiveCare"; +const DOCTOR_CHECK_HAS_LIVE_CARE = + "Services/DoctorApplication.svc/REST/CheckDoctorHasLiveCare"; const LIVE_CARE_IS_LOGIN = "LiveCareApi/DoctorApp/UseIsLogin"; -const ADD_REFERRED_REMARKS_NEW = "Services/DoctorApplication.svc/REST/AddReferredDoctorRemarks_New"; -const GET_SPECIAL_CLINICAL_CARE_LIST = "Services/DoctorApplication.svc/REST/GetSpecialClinicalCareList"; -const GET_SPECIAL_CLINICAL_CARE_MAPPING_LIST = "Services/DoctorApplication.svc/REST/GetSpecialClinicalCareMappingList"; - -const INSERT_MEDICAL_REPORT = "Services/Patients.svc/REST/DAPP_InsertMedicalReport_New"; - -const UPDATE_MEDICAL_REPORT = "Services/Patients.svc/REST/DAPP_UpdateMedicalReport"; -const GET_SICK_LEAVE_DOCTOR_APP = "Services/DoctorApplication.svc/REST/GetAllSickLeaves"; +const ADD_REFERRED_REMARKS_NEW = + "Services/DoctorApplication.svc/REST/AddReferredDoctorRemarks_New"; +const GET_SPECIAL_CLINICAL_CARE_LIST = + "Services/DoctorApplication.svc/REST/GetSpecialClinicalCareList"; +const GET_SPECIAL_CLINICAL_CARE_MAPPING_LIST = + "Services/DoctorApplication.svc/REST/GetSpecialClinicalCareMappingList"; + +const INSERT_MEDICAL_REPORT = + "Services/Patients.svc/REST/DAPP_InsertMedicalReport_New"; + +const UPDATE_MEDICAL_REPORT = + "Services/Patients.svc/REST/DAPP_UpdateMedicalReport"; +const GET_SICK_LEAVE_DOCTOR_APP = + "Services/DoctorApplication.svc/REST/GetAllSickLeaves"; const ADD_PATIENT_TO_DOCTOR = "LiveCareApi/DoctorApp/AssignPatientToDoctor"; const REMOVE_PATIENT_FROM_DOCTOR = "LiveCareApi/DoctorApp/BackPatientToQueue"; -const CREATE_DOCTOR_RESPONSE = "Services/DoctorApplication.svc/REST/CreateDoctorResponse"; -const GET_DOCTOR_NOT_REPLIED_COUNTS = "Services/DoctorApplication.svc/REST/DoctorApp_GetDoctorNotRepliedCounts"; -const ALL_SPECIAL_LAB_RESULT = "services/Patients.svc/REST/GetPatientLabSpecialResultsALL"; -const GET_MEDICATION_FOR_IN_PATIENT = "Services/DoctorApplication.svc/REST/Doctor_GetMedicationForInpatient"; -const GET_EPISODE_FOR_INPATIENT = "/Services/DoctorApplication.svc/REST/DoctorApp_GetEpisodeForInpatient"; +const CREATE_DOCTOR_RESPONSE = + "Services/DoctorApplication.svc/REST/CreateDoctorResponse"; +const GET_DOCTOR_NOT_REPLIED_COUNTS = + "Services/DoctorApplication.svc/REST/DoctorApp_GetDoctorNotRepliedCounts"; +const ALL_SPECIAL_LAB_RESULT = + "services/Patients.svc/REST/GetPatientLabSpecialResultsALL"; +const GET_MEDICATION_FOR_IN_PATIENT = + "Services/DoctorApplication.svc/REST/Doctor_GetMedicationForInpatient"; +const GET_EPISODE_FOR_INPATIENT = + "/Services/DoctorApplication.svc/REST/DoctorApp_GetEpisodeForInpatient"; ///Operation Details Services -const GET_RESERVATIONS = "Services/DoctorApplication.svc/REST/DoctorApp_GetReservationDetails"; -const GET_OPERATION_DETAILS = "Services/DoctorApplication.svc/REST/DoctorApp_GetOperationDetails"; -const UPDATE_OPERATION_REPORT = "Services/DoctorApplication.svc/REST/DoctorApp_CreateUpdateOperationReport"; +const GET_RESERVATIONS = + "Services/DoctorApplication.svc/REST/DoctorApp_GetReservationDetails"; +const GET_OPERATION_DETAILS = + "Services/DoctorApplication.svc/REST/DoctorApp_GetOperationDetails"; +const UPDATE_OPERATION_REPORT = + "Services/DoctorApplication.svc/REST/DoctorApp_CreateUpdateOperationReport"; -const NURSING_PROGRESS_NOTE = "Services/DoctorApplication.svc/REST/DoctorApp_GetNursingProgressNote"; -const GET_DIAGNOSIS_FOR_IN_PATIENT = "Services/DoctorApplication.svc/REST/DoctorApp_GetDiagnosisForInPatient"; +const NURSING_PROGRESS_NOTE = + "Services/DoctorApplication.svc/REST/DoctorApp_GetNursingProgressNote"; +const GET_DIAGNOSIS_FOR_IN_PATIENT = + "Services/DoctorApplication.svc/REST/DoctorApp_GetDiagnosisForInPatient"; -const GET_DIABETIC_CHART_VALUES = "Services/DoctorApplication.svc/REST/DoctorApp_GetDiabeticChartValues"; +const GET_DIABETIC_CHART_VALUES = + "Services/DoctorApplication.svc/REST/DoctorApp_GetDiabeticChartValues"; -const GET_PENDING_ORDERS = "Services/DoctorApplication.svc/REST/DoctorApp_GetPendingOrdersForInPatient"; +const GET_PENDING_ORDERS = + "Services/DoctorApplication.svc/REST/DoctorApp_GetPendingOrdersForInPatient"; -const GET_ADMISSION_ORDERS = "/Services/DoctorApplication.svc/REST/DoctorApp_GetAdmissionOrders"; +const GET_ADMISSION_ORDERS = + "/Services/DoctorApplication.svc/REST/DoctorApp_GetAdmissionOrders"; ///Patient Registration Services -const CHECK_PATIENT_FOR_REGISTRATION = "Services/Authentication.svc/REST/CheckPatientForRegisteration"; -const SEND_ACTIVATION_CODE_BY_OTP_NOT_TYPE_FOR_REGISTRATION = "Services/Authentication.svc/REST/SendActivationCodebyOTPNotificationTypeForRegistration"; -const CHECK_ACTIVATION_CODE_FOR_PATIENT = "Services/Authentication.svc/REST/CheckActivationCode"; -const PATIENT_REGISTRATION = "Services/Authentication.svc/REST/PatientRegistration"; +const CHECK_PATIENT_FOR_REGISTRATION = + "Services/Authentication.svc/REST/CheckPatientForRegisteration"; +const SEND_ACTIVATION_CODE_BY_OTP_NOT_TYPE_FOR_REGISTRATION = + "Services/Authentication.svc/REST/SendActivationCodebyOTPNotificationTypeForRegistration"; +const CHECK_ACTIVATION_CODE_FOR_PATIENT = + "Services/Authentication.svc/REST/CheckActivationCode"; +const PATIENT_REGISTRATION = + "Services/Authentication.svc/REST/PatientRegistration"; const GET_PATIENT_INFO = "Services/NHIC.svc/REST/GetPatientInfo"; /// Discharge Summary -const GET_PENDING_DISCHARGE_SUMMARY = "Services/DoctorApplication.svc/REST/DoctorApp_GetPendingDischargeSummary"; -const GET_ALL_DISCHARGE_SUMMARY = "Services/DoctorApplication.svc/REST/DoctorApp_GetDischargeSummary"; +const GET_PENDING_DISCHARGE_SUMMARY = + "Services/DoctorApplication.svc/REST/DoctorApp_GetPendingDischargeSummary"; +const GET_ALL_DISCHARGE_SUMMARY = + "Services/DoctorApplication.svc/REST/DoctorApp_GetDischargeSummary"; + +const VTE_ASSESSMENT = + "Services/Patients.svc/REST/INP_GetVTEHistoryByTransactionNo"; -const VTE_ASSESSMENT = "Services/Patients.svc/REST/INP_GetVTEHistoryByTransactionNo"; +const GET_INTERVENTION_MEDICATION = + "Services/DoctorApplication.svc/REST/DoctorApp_GetInterventionMedications"; -const GET_INTERVENTION_MEDICATION = "Services/DoctorApplication.svc/REST/DoctorApp_GetInterventionMedications"; +const GET_INTERVENTION_MEDICATION_HISTORY = + "Services/DoctorApplication.svc/REST/DoctorApp_GetInterventionHistory"; -const GET_INTERVENTION_MEDICATION_HISTORY = "Services/DoctorApplication.svc/REST/DoctorApp_GetInterventionHistory"; +const SET_ACCEPTED_OR_REJECTED = + "Services/DoctorApplication.svc/REST/DoctorApp_AcceptOrRejectIntervention"; -const SET_ACCEPTED_OR_REJECTED = "Services/DoctorApplication.svc/REST/DoctorApp_AcceptOrRejectIntervention"; +const GET_STP_MASTER_LIST = + "Services/DoctorApplication.svc/REST/DoctorApp_GetSTPMasterList"; -const GET_STP_MASTER_LIST = "Services/DoctorApplication.svc/REST/DoctorApp_GetSTPMasterList"; -const DOCTOR_ER_SIGN_ASSESSMENT = "Services/DoctorApplication.svc/REST/DoctorApp_DoctorERSignAssessment"; +const DOCTOR_ER_SIGN_ASSESSMENT = + "Services/DoctorApplication.svc/REST/DoctorApp_DoctorERSignAssessment"; var selectedPatientType = 1; @@ -288,8 +417,26 @@ var SERVICES_PATIANT2 = [ "List_MyReferralPatient", "patientArrivalList" ]; -var SERVICES_PATIANT_HEADER = ["My OutPatient", "My InPatient", "Discharge", "Referred", "Referral Discharge", "Tomorrow", "Referral", "Arrival Patient"]; -var SERVICES_PATIANT_HEADER_AR = ["المريض الخارجي", "المريض المنوم", "المريض المعافى", "المريض المحول الي", "المريض المحال المعافى", "مريض الغد", "المريض المحول مني", "المريض الواصل"]; +var SERVICES_PATIANT_HEADER = [ + "My OutPatient", + "My InPatient", + "Discharge", + "Referred", + "Referral Discharge", + "Tomorrow", + "Referral", + "Arrival Patient" +]; +var SERVICES_PATIANT_HEADER_AR = [ + "المريض الخارجي", + "المريض المنوم", + "المريض المعافى", + "المريض المحول الي", + "المريض المحال المعافى", + "مريض الغد", + "المريض المحول مني", + "المريض الواصل" +]; const PRIMARY_COLOR = 0xff515B5D; @@ -297,7 +444,7 @@ const TRANSACTION_NO = 0; const LANGUAGE_ID = 2; const STAMP = '2020-04-27T12:17:17.721Z'; const IP_ADDRESS = '9.9.9.9'; -const VERSION_ID = 8.9; +const VERSION_ID = 8.6; const CHANNEL = 9; const SESSION_ID = 'BlUSkYymTt'; const IS_LOGIN_FOR_DOCTOR_APP = true; @@ -309,6 +456,7 @@ const GENERAL_ID = 'Cs2020@2016\$2958'; const PATIENT_TYPE = 1; const PATIENT_TYPE_ID = 1; + /// Timer Info const TIMER_MIN = 10; @@ -317,6 +465,7 @@ class AppGlobal { static Color appRedColor = Color(0xFFD02127); static Color appGreenColor = Color(0xFF359846); static Color appTextColor = Color(0xFF2B353E); - static Color scheduleTextColor = Color(0xFF2E303A); - static Color inProgressColor = Color(0xFFCC9B14); + static Color scheduleTextColor = Color(0xFF2E303A); + static Color inProgressColor = Color(0xFFCC9B14); + } diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index c9b9a9a6..1dac83f3 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -800,7 +800,7 @@ const Map> localizedValues = { "open-rad": {"en": "Open Radiology Image", "ar": "فتح صور الاشعة"}, "fileNumber": {"en": "File Number: ", "ar": "رقم الملف : "}, "searchPatient-name": { - "en": "Search Name, Medical File, Phone Number", + "en": "Search Medical File, Phone Number", "ar": "اسم البحث ، الملف الطبي ، رقم الهاتف" }, "reschedule": {"en": "Reschedule", "ar": "إعادة جدولة"}, diff --git a/lib/core/model/hospitals/get_hospitals_request_model.dart b/lib/core/model/hospitals/get_hospitals_request_model.dart index b858bba4..03485aa2 100644 --- a/lib/core/model/hospitals/get_hospitals_request_model.dart +++ b/lib/core/model/hospitals/get_hospitals_request_model.dart @@ -8,6 +8,7 @@ class GetHospitalsRequestModel { String sessionID; bool isLoginForDoctorApp; String memberID; + String doctorID; GetHospitalsRequestModel( {this.languageID, @@ -18,7 +19,9 @@ class GetHospitalsRequestModel { this.tokenID, this.sessionID, this.isLoginForDoctorApp, - this.memberID}); + this.memberID, + this.doctorID, + }); GetHospitalsRequestModel.fromJson(Map json) { languageID = json['LanguageID']; @@ -30,6 +33,7 @@ class GetHospitalsRequestModel { sessionID = json['SessionID']; isLoginForDoctorApp = json['IsLoginForDoctorApp']; memberID = json['MemberID']; + doctorID = json['DoctorID']; } Map toJson() { @@ -43,6 +47,7 @@ class GetHospitalsRequestModel { data['SessionID'] = this.sessionID; data['IsLoginForDoctorApp'] = this.isLoginForDoctorApp; data['MemberID'] = this.memberID; + data['DoctorID'] = this.doctorID; return data; } } diff --git a/lib/core/service/VideoCallService.dart b/lib/core/service/VideoCallService.dart index ef42e1cc..94307ce6 100644 --- a/lib/core/service/VideoCallService.dart +++ b/lib/core/service/VideoCallService.dart @@ -34,12 +34,14 @@ class VideoCallService extends BaseService { await getDoctorProfile(isGetProfile: true); await VideoChannel.openVideoCallScreen( // TODO MOSA TEST - kToken: startCallRes.openTokenID, - kSessionId: startCallRes.openSessionID, kApiKey: '46209962', - // kToken: "T1==cGFydG5lcl9pZD00NzI0Nzk1NCZzaWc9NGUyZjgxMjFlYTFkNzU5NjcxNDY2ZTM2ZjM3YTVhNTI2NGY0NTI2NzpzZXNzaW9uX2lkPTJfTVg0ME56STBOemsxTkg1LU1UWXlOVGN5TmpnMk5qZzNOMzQ1YUhCcGRtcDFXbVpDTDFkNE1qbDRkWFY2TTA4cmIySi1mZyZjcmVhdGVfdGltZT0xNjI1NzI2ODg5Jm5vbmNlPTAuNjc2Nzc4OTQxNjA1MTMxNSZyb2xlPXB1Ymxpc2hlciZleHBpcmVfdGltZT0xNjI4MzE4ODg4JmluaXRpYWxfbGF5b3V0X2NsYXNzX2xpc3Q9", - // kSessionId: "2_MX40NzI0Nzk1NH5-MTYyNTcyNjg2Njg3N345aHBpdmp1WmZCL1d4Mjl4dXV6M08rb2J-fg", - // kApiKey:'47247954', + + // kToken: startCallRes.openTokenID, + // kSessionId: startCallRes.openSessionID, + + kToken: "T1==cGFydG5lcl9pZD00NjIwOTk2MiZzaWc9NjM4ZjgxNmFjZjI0ODU2YTk0YTMwMGIxMjFkNmZlY2E5OGJlYWNlZDpzZXNzaW9uX2lkPTJfTVg0ME5qSXdPVGsyTW41LU1UWTNNek0xTURFMk1qSTNPWDVZT0RGMWFVdElaRWRWVldGTlVGYzNObFYxVERWNFRFbC1mbjQmY3JlYXRlX3RpbWU9MTY3MzM1MDE2MiZub25jZT0wLjE5OTUyMjMwNzIyMDAyODczJnJvbGU9bW9kZXJhdG9yJmV4cGlyZV90aW1lPTE2NzM0MzY1NjImaW5pdGlhbF9sYXlvdXRfY2xhc3NfbGlzdD0=", + kSessionId: "2_MX40NjIwOTk2Mn5-MTY3MzM1MDE2MjI3OX5YODF1aUtIZEdVVWFNUFc3NlV1TDV4TEl-fn4", + vcId: patient.vcId, isRecording: isRecording, patientName: patient.fullName ?? diff --git a/lib/core/service/authentication_service.dart b/lib/core/service/authentication_service.dart index 6b5510a9..b25dbcc6 100644 --- a/lib/core/service/authentication_service.dart +++ b/lib/core/service/authentication_service.dart @@ -7,10 +7,10 @@ import 'package:doctor_app_flutter/core/model/auth/imei_details.dart'; import 'package:doctor_app_flutter/core/model/auth/insert_imei_model.dart'; import 'package:doctor_app_flutter/core/model/auth/new_login_information_response_model.dart'; import 'package:doctor_app_flutter/core/model/auth/send_activation_code_for_doctor_app_response_model.dart'; -import 'package:doctor_app_flutter/core/service/base/base_service.dart'; import 'package:doctor_app_flutter/core/model/doctor/doctor_profile_model.dart'; import 'package:doctor_app_flutter/core/model/doctor/profile_req_Model.dart'; import 'package:doctor_app_flutter/core/model/doctor/user_model.dart'; +import 'package:doctor_app_flutter/core/service/base/base_service.dart'; class AuthenticationService extends BaseService { List _imeiDetails = []; @@ -19,26 +19,16 @@ class AuthenticationService extends BaseService { NewLoginInformationModel _loginInfo = NewLoginInformationModel(); NewLoginInformationModel get loginInfo => _loginInfo; - SendActivationCodeForDoctorAppResponseModel - _activationCodeVerificationScreenRes = - SendActivationCodeForDoctorAppResponseModel(); - - SendActivationCodeForDoctorAppResponseModel - get activationCodeVerificationScreenRes => - _activationCodeVerificationScreenRes; - - SendActivationCodeForDoctorAppResponseModel _activationCodeForDoctorAppRes = - SendActivationCodeForDoctorAppResponseModel(); - - SendActivationCodeForDoctorAppResponseModel - get activationCodeForDoctorAppRes => _activationCodeForDoctorAppRes; - CheckActivationCodeForDoctorAppResponseModel - _checkActivationCodeForDoctorAppRes = - CheckActivationCodeForDoctorAppResponseModel(); - - CheckActivationCodeForDoctorAppResponseModel - get checkActivationCodeForDoctorAppRes => - _checkActivationCodeForDoctorAppRes; + SendActivationCodeForDoctorAppResponseModel _activationCodeVerificationScreenRes = SendActivationCodeForDoctorAppResponseModel(); + + SendActivationCodeForDoctorAppResponseModel get activationCodeVerificationScreenRes => _activationCodeVerificationScreenRes; + + SendActivationCodeForDoctorAppResponseModel _activationCodeForDoctorAppRes = SendActivationCodeForDoctorAppResponseModel(); + + SendActivationCodeForDoctorAppResponseModel get activationCodeForDoctorAppRes => _activationCodeForDoctorAppRes; + CheckActivationCodeForDoctorAppResponseModel _checkActivationCodeForDoctorAppRes = CheckActivationCodeForDoctorAppResponseModel(); + + CheckActivationCodeForDoctorAppResponseModel get checkActivationCodeForDoctorAppRes => _checkActivationCodeForDoctorAppRes; Map _insertDeviceImeiRes = {}; List _doctorProfilesList = []; @@ -47,8 +37,7 @@ class AuthenticationService extends BaseService { Future selectDeviceImei(imei) async { try { - await baseAppClient.post(SELECT_DEVICE_IMEI, - onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(SELECT_DEVICE_IMEI, onSuccess: (dynamic response, int statusCode) { _imeiDetails = []; response['List_DoctorDeviceDetails'].forEach((v) { _imeiDetails.add(GetIMEIDetailsModel.fromJson(v)); @@ -56,7 +45,7 @@ class AuthenticationService extends BaseService { }, onFailure: (String error, int statusCode) { hasError = true; super.error = error; - }, body: {"IMEI": imei, "TokenID": "@dm!n"}); + }, body: {"IMEI": imei}); } catch (error) { hasError = true; super.error = error; @@ -67,8 +56,7 @@ class AuthenticationService extends BaseService { hasError = false; _loginInfo = NewLoginInformationModel(); try { - await baseAppClient.post(LOGIN_URL, - onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(LOGIN_URL, onSuccess: (dynamic response, int statusCode) { _loginInfo = NewLoginInformationModel.fromJson(response); }, onFailure: (String error, int statusCode) { hasError = true; @@ -80,16 +68,12 @@ class AuthenticationService extends BaseService { } } - Future sendActivationCodeVerificationScreen( - ActivationCodeForVerificationScreenModel activationCodeModel) async { + Future sendActivationCodeVerificationScreen(ActivationCodeForVerificationScreenModel activationCodeModel) async { hasError = false; - _activationCodeVerificationScreenRes = - SendActivationCodeForDoctorAppResponseModel(); + _activationCodeVerificationScreenRes = SendActivationCodeForDoctorAppResponseModel(); try { - await baseAppClient.post(SEND_ACTIVATION_CODE_FOR_VERIFICATION_SCREEN, - onSuccess: (dynamic response, int statusCode) { - _activationCodeVerificationScreenRes = - SendActivationCodeForDoctorAppResponseModel.fromJson(response); + await baseAppClient.post(SEND_ACTIVATION_CODE_FOR_VERIFICATION_SCREEN, onSuccess: (dynamic response, int statusCode) { + _activationCodeVerificationScreenRes = SendActivationCodeForDoctorAppResponseModel.fromJson(response); }, onFailure: (String error, int statusCode) { hasError = true; super.error = error; @@ -100,16 +84,12 @@ class AuthenticationService extends BaseService { } } - Future sendActivationCodeForDoctorApp( - ActivationCodeModel activationCodeModel) async { + Future sendActivationCodeForDoctorApp(ActivationCodeModel activationCodeModel) async { hasError = false; - _activationCodeForDoctorAppRes = - SendActivationCodeForDoctorAppResponseModel(); + _activationCodeForDoctorAppRes = SendActivationCodeForDoctorAppResponseModel(); try { - await baseAppClient.post(SEND_ACTIVATION_CODE_FOR_DOCTOR_APP, - onSuccess: (dynamic response, int statusCode) { - _activationCodeForDoctorAppRes = - SendActivationCodeForDoctorAppResponseModel.fromJson(response); + await baseAppClient.post(SEND_ACTIVATION_CODE_FOR_DOCTOR_APP, onSuccess: (dynamic response, int statusCode) { + _activationCodeForDoctorAppRes = SendActivationCodeForDoctorAppResponseModel.fromJson(response); }, onFailure: (String error, int statusCode) { hasError = true; super.error = error; @@ -120,16 +100,12 @@ class AuthenticationService extends BaseService { } } - Future checkActivationCodeForDoctorApp( - CheckActivationCodeRequestModel checkActivationCodeRequestModel) async { + Future checkActivationCodeForDoctorApp(CheckActivationCodeRequestModel checkActivationCodeRequestModel) async { hasError = false; - _checkActivationCodeForDoctorAppRes = - CheckActivationCodeForDoctorAppResponseModel(); + _checkActivationCodeForDoctorAppRes = CheckActivationCodeForDoctorAppResponseModel(); try { - await baseAppClient.post(CHECK_ACTIVATION_CODE_FOR_DOCTOR_APP, - onSuccess: (dynamic response, int statusCode) { - _checkActivationCodeForDoctorAppRes = - CheckActivationCodeForDoctorAppResponseModel.fromJson(response); + await baseAppClient.post(CHECK_ACTIVATION_CODE_FOR_DOCTOR_APP, onSuccess: (dynamic response, int statusCode) { + _checkActivationCodeForDoctorAppRes = CheckActivationCodeForDoctorAppResponseModel.fromJson(response); }, onFailure: (String error, int statusCode) { hasError = true; super.error = error; @@ -144,8 +120,7 @@ class AuthenticationService extends BaseService { hasError = false; _insertDeviceImeiRes = {}; try { - await baseAppClient.post(INSERT_DEVICE_IMEI, - onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(INSERT_DEVICE_IMEI, onSuccess: (dynamic response, int statusCode) { _insertDeviceImeiRes = response; }, onFailure: (String error, int statusCode) { hasError = true; @@ -160,8 +135,7 @@ class AuthenticationService extends BaseService { Future getDoctorProfileBasedOnClinic(ProfileReqModel profileReqModel) async { hasError = false; try { - await baseAppClient.post(GET_DOC_PROFILES, - onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(GET_DOC_PROFILES, onSuccess: (dynamic response, int statusCode) { _doctorProfilesList.clear(); response['DoctorProfileList'].forEach((v) { _doctorProfilesList.add(DoctorProfileModel.fromJson(v)); diff --git a/lib/core/viewModel/authentication_view_model.dart b/lib/core/viewModel/authentication_view_model.dart index 0a20fb47..d17cb661 100644 --- a/lib/core/viewModel/authentication_view_model.dart +++ b/lib/core/viewModel/authentication_view_model.dart @@ -26,6 +26,8 @@ import 'package:doctor_app_flutter/utils/utils.dart'; import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; import 'package:firebase_messaging/firebase_messaging.dart'; import 'package:flutter/services.dart'; +import 'package:local_auth/auth_strings.dart'; +// import 'package:huawei_hmsavailability/huawei_hmsavailability.dart'; // import 'package:local_auth/auth_strings.dart'; import 'package:local_auth/local_auth.dart'; @@ -41,13 +43,20 @@ class AuthenticationViewModel extends BaseViewModel { NewLoginInformationModel get loginInfo => _authService.loginInfo; - List get doctorProfilesList => _authService.doctorProfilesList; + List get doctorProfilesList => + _authService.doctorProfilesList; - SendActivationCodeForDoctorAppResponseModel get activationCodeVerificationScreenRes => _authService.activationCodeVerificationScreenRes; + SendActivationCodeForDoctorAppResponseModel + get activationCodeVerificationScreenRes => + _authService.activationCodeVerificationScreenRes; - SendActivationCodeForDoctorAppResponseModel get activationCodeForDoctorAppRes => _authService.activationCodeForDoctorAppRes; + SendActivationCodeForDoctorAppResponseModel + get activationCodeForDoctorAppRes => + _authService.activationCodeForDoctorAppRes; - CheckActivationCodeForDoctorAppResponseModel get checkActivationCodeForDoctorAppRes => _authService.checkActivationCodeForDoctorAppRes; + CheckActivationCodeForDoctorAppResponseModel + get checkActivationCodeForDoctorAppRes => + _authService.checkActivationCodeForDoctorAppRes; NewLoginInformationModel loggedUser; GetIMEIDetailsModel user; @@ -62,6 +71,7 @@ class AuthenticationViewModel extends BaseViewModel { bool isFromLogin = false; APP_STATUS appStatus = APP_STATUS.LOADING; String localToken = ""; + bool isHuawei = false; AuthenticationViewModel({bool checkDeviceInfo = false}) { getDeviceInfoFromFirebase(); @@ -81,20 +91,32 @@ class AuthenticationViewModel extends BaseViewModel { profileInfo['IMEI'] = token; profileInfo['LogInTypeID'] = await sharedPref.getInt(OTP_TYPE); profileInfo['BioMetricEnabled'] = true; - profileInfo['MobileNo'] = loggedIn != null ? loggedIn['MobileNumber'] : user.mobile; - InsertIMEIDetailsModel insertIMEIDetailsModel = InsertIMEIDetailsModel.fromJson(profileInfo); - insertIMEIDetailsModel.genderDescription = profileInfo['Gender_Description']; - insertIMEIDetailsModel.genderDescriptionN = profileInfo['Gender_DescriptionN']; - insertIMEIDetailsModel.genderDescriptionN = profileInfo['Gender_DescriptionN']; + profileInfo['MobileNo'] = + loggedIn != null ? loggedIn['MobileNumber'] : user.mobile; + InsertIMEIDetailsModel insertIMEIDetailsModel = + InsertIMEIDetailsModel.fromJson(profileInfo); + insertIMEIDetailsModel.genderDescription = + profileInfo['Gender_Description']; + insertIMEIDetailsModel.genderDescriptionN = + profileInfo['Gender_DescriptionN']; + insertIMEIDetailsModel.genderDescriptionN = + profileInfo['Gender_DescriptionN']; insertIMEIDetailsModel.titleDescription = profileInfo['Title_Description']; - insertIMEIDetailsModel.titleDescriptionN = profileInfo['Title_DescriptionN']; + insertIMEIDetailsModel.titleDescriptionN = + profileInfo['Title_DescriptionN']; insertIMEIDetailsModel.projectID = await sharedPref.getInt(PROJECT_ID); - insertIMEIDetailsModel.doctorID = loggedIn != null ? loggedIn['List_MemberInformation'][0]['MemberID'] : user.doctorID; - insertIMEIDetailsModel.outSA = loggedIn != null ? loggedIn['PatientOutSA'] : user.outSA; - insertIMEIDetailsModel.vidaAuthTokenID = await sharedPref.getString(VIDA_AUTH_TOKEN_ID); - insertIMEIDetailsModel.vidaRefreshTokenID = await sharedPref.getString(VIDA_REFRESH_TOKEN_ID); + insertIMEIDetailsModel.doctorID = loggedIn != null + ? loggedIn['List_MemberInformation'][0]['MemberID'] + : user.doctorID; + insertIMEIDetailsModel.outSA = + loggedIn != null ? loggedIn['PatientOutSA'] : user.outSA; + insertIMEIDetailsModel.vidaAuthTokenID = + await sharedPref.getString(VIDA_AUTH_TOKEN_ID); + insertIMEIDetailsModel.vidaRefreshTokenID = + await sharedPref.getString(VIDA_REFRESH_TOKEN_ID); insertIMEIDetailsModel.password = userInfo.password; - insertIMEIDetailsModel.loginDoctorID = loggedUser != null ? loggedUser.listMemberInformation[0].employeeID : int.parse(user.editedBy.toString()); + insertIMEIDetailsModel.loginDoctorID = loggedUser != null ? loggedUser.listMemberInformation[0].employeeID + : int.parse(user.editedBy.toString()); await _authService.insertDeviceImei(insertIMEIDetailsModel); if (_authService.hasError) { @@ -122,22 +144,25 @@ class AuthenticationViewModel extends BaseViewModel { } /// send activation code for for msg methods - Future sendActivationCodeVerificationScreen(AuthMethodTypes authMethodType) async { + Future sendActivationCodeVerificationScreen( + AuthMethodTypes authMethodType) async { setState(ViewState.BusyLocal); - ActivationCodeForVerificationScreenModel activationCodeModel = ActivationCodeForVerificationScreenModel( - iMEI: user.iMEI, - facilityId: user.projectID, - memberID: user.doctorID, - loginDoctorID: int.parse(user.editedBy.toString()), - zipCode: user.outSA == true ? '971' : '966', - mobileNumber: user.mobile, - oTPSendType: authMethodType.getTypeIdService(), - isMobileFingerPrint: 1, - vidaAuthTokenID: user.vidaAuthTokenID, - vidaRefreshTokenID: user.vidaRefreshTokenID); + ActivationCodeForVerificationScreenModel activationCodeModel = + ActivationCodeForVerificationScreenModel( + iMEI: user.iMEI, + facilityId: user.projectID, + memberID: user.doctorID, + loginDoctorID: int.parse(user.editedBy.toString()), + zipCode: user.outSA == true ? '971' : '966', + mobileNumber: user.mobile, + oTPSendType: authMethodType.getTypeIdService(), + isMobileFingerPrint: 1, + vidaAuthTokenID: user.vidaAuthTokenID, + vidaRefreshTokenID: user.vidaRefreshTokenID); await sharedPref.setString(DOCTOR_ID, user.editedBy.toString()); - await _authService.sendActivationCodeVerificationScreen(activationCodeModel); + await _authService + .sendActivationCodeVerificationScreen(activationCodeModel); if (_authService.hasError) { error = _authService.error; setState(ViewState.ErrorLocal); @@ -146,7 +171,8 @@ class AuthenticationViewModel extends BaseViewModel { } /// send activation code for silent login - Future sendActivationCodeForDoctorApp({AuthMethodTypes authMethodType, String password}) async { + Future sendActivationCodeForDoctorApp( + {AuthMethodTypes authMethodType, String password}) async { setState(ViewState.BusyLocal); int projectID = await sharedPref.getInt(PROJECT_ID); ActivationCodeModel activationCodeModel = ActivationCodeModel( @@ -161,46 +187,59 @@ class AuthenticationViewModel extends BaseViewModel { error = _authService.error; setState(ViewState.ErrorLocal); } else { - await sharedPref.setString(TOKEN, _authService.activationCodeForDoctorAppRes.logInTokenID); + await sharedPref.setString( + TOKEN, _authService.activationCodeForDoctorAppRes.logInTokenID); setState(ViewState.Idle); } } /// check activation code for sms and whats app - Future checkActivationCodeForDoctorApp({String activationCode, bool isSilentLogin = false}) async { + Future checkActivationCodeForDoctorApp( + {String activationCode, bool isSilentLogin = false}) async { setState(ViewState.BusyLocal); - CheckActivationCodeRequestModel checkActivationCodeForDoctorApp = new CheckActivationCodeRequestModel( - zipCode: loggedUser != null ? loggedUser.zipCode : user.zipCode, - mobileNumber: loggedUser != null ? loggedUser.mobileNumber : user.mobile, - projectID: await sharedPref.getInt(PROJECT_ID) != null ? await sharedPref.getInt(PROJECT_ID) : user.projectID, - logInTokenID: await sharedPref.getString(TOKEN), - activationCode: activationCode ?? '0000', - memberID: userInfo.userID != null ? int.parse(userInfo.userID) : user.doctorID, - password: userInfo.password, - facilityId: userInfo.projectID != null ? userInfo.projectID.toString() : user.projectID.toString(), - oTPSendType: await sharedPref.getInt(OTP_TYPE), - iMEI: localToken, - loginDoctorID: loggedUser != null ? loggedUser.listMemberInformation[0].employeeID : int.parse(user.editedBy.toString()), - - ///loggedUser.listMemberInformation[0].employeeID, - // loggedUser.listMemberInformation[0].employeeID, - isForSilentLogin: isSilentLogin, - generalid: "Cs2020@2016\$2958"); - await _authService.checkActivationCodeForDoctorApp(checkActivationCodeForDoctorApp); + CheckActivationCodeRequestModel checkActivationCodeForDoctorApp = + new CheckActivationCodeRequestModel( + zipCode: loggedUser != null ? loggedUser.zipCode : user.zipCode, + mobileNumber: + loggedUser != null ? loggedUser.mobileNumber : user.mobile, + projectID: await sharedPref.getInt(PROJECT_ID) != null + ? await sharedPref.getInt(PROJECT_ID) + : user.projectID, + logInTokenID: await sharedPref.getString(TOKEN), + activationCode: activationCode ?? '0000', + memberID: userInfo.userID != null + ? int.parse(userInfo.userID) + : user.doctorID, + password: userInfo.password, + facilityId: userInfo.projectID != null + ? userInfo.projectID.toString() + : user.projectID.toString(), + oTPSendType: await sharedPref.getInt(OTP_TYPE), + iMEI: localToken, + loginDoctorID: loggedUser != null ? loggedUser.listMemberInformation[0].employeeID + : int.parse(user.editedBy.toString()),///loggedUser.listMemberInformation[0].employeeID, + // loggedUser.listMemberInformation[0].employeeID, + isForSilentLogin: isSilentLogin, + generalid: "Cs2020@2016\$2958"); + await _authService + .checkActivationCodeForDoctorApp(checkActivationCodeForDoctorApp); if (_authService.hasError) { error = _authService.error; setState(ViewState.ErrorLocal); } else { - await setDataAfterSendActivationSuccess(checkActivationCodeForDoctorAppRes); + await setDataAfterSendActivationSuccess( + checkActivationCodeForDoctorAppRes); setState(ViewState.Idle); } } /// get list of Hospitals Future getHospitalsList(memberID) async { - GetHospitalsRequestModel getHospitalsRequestModel = GetHospitalsRequestModel(); + GetHospitalsRequestModel getHospitalsRequestModel = + GetHospitalsRequestModel(); getHospitalsRequestModel.memberID = memberID; + getHospitalsRequestModel.doctorID = memberID; await _hospitalsService.getHospitals(getHospitalsRequestModel); if (_hospitalsService.hasError) { error = _hospitalsService.error; @@ -231,11 +270,16 @@ class AuthenticationViewModel extends BaseViewModel { } /// add  token to shared preferences in case of send activation code is success - setDataAfterSendActivationSuccess(CheckActivationCodeForDoctorAppResponseModel sendActivationCodeForDoctorAppResponseModel) async { + setDataAfterSendActivationSuccess( + CheckActivationCodeForDoctorAppResponseModel + sendActivationCodeForDoctorAppResponseModel) async { // print("VerificationCode : " + sendActivationCodeForDoctorAppResponseModel.verificationCode); - await sharedPref.setString(VIDA_AUTH_TOKEN_ID, sendActivationCodeForDoctorAppResponseModel.vidaAuthTokenID); - await sharedPref.setString(VIDA_REFRESH_TOKEN_ID, sendActivationCodeForDoctorAppResponseModel.vidaRefreshTokenID); - await sharedPref.setString(TOKEN, sendActivationCodeForDoctorAppResponseModel.authenticationTokenID); + await sharedPref.setString(VIDA_AUTH_TOKEN_ID, + sendActivationCodeForDoctorAppResponseModel.vidaAuthTokenID); + await sharedPref.setString(VIDA_REFRESH_TOKEN_ID, + sendActivationCodeForDoctorAppResponseModel.vidaRefreshTokenID); + await sharedPref.setString(TOKEN, + sendActivationCodeForDoctorAppResponseModel.authenticationTokenID); } saveObjToString(String key, value) async { @@ -244,23 +288,21 @@ class AuthenticationViewModel extends BaseViewModel { /// ask user to add his biometric showIOSAuthMessages() async { - //TODO FOR UPGRADE NEED TO BE TESTED FIRST - - // const iosStrings = const IOSAuthMessages( - // cancelButton: 'cancel', - // goToSettingsButton: 'settings', - // goToSettingsDescription: 'Please set up your Touch ID.', - // lockOut: 'Please Enable Your Touch ID'); - - // try { - // await auth.authenticateWithBiometrics( - // localizedReason: 'Scan your fingerprint to authenticate', - // useErrorDialogs: true, - // stickyAuth: true, - // // iOSAuthStrings: iosStrings); - // } on PlatformException catch (e) { - // DrAppToastMsg.showErrorToast(e.toString()); - // } + const iosStrings = const IOSAuthMessages( + cancelButton: 'cancel', + goToSettingsButton: 'settings', + goToSettingsDescription: 'Please set up your Touch ID.', + lockOut: 'Please Enable Your Touch ID'); + + try { + await auth.authenticateWithBiometrics( + localizedReason: 'Scan your fingerprint to authenticate', + useErrorDialogs: true, + stickyAuth: true, + iOSAuthStrings: iosStrings); + } on PlatformException catch (e) { + DrAppToastMsg.showErrorToast(e.toString()); + } } /// add profile to base view model super class @@ -270,7 +312,12 @@ class AuthenticationViewModel extends BaseViewModel { /// get doctor profile based on clinic model Future getDoctorProfileBasedOnClinic(ClinicModel clinicInfo) async { - ProfileReqModel docInfo = new ProfileReqModel(doctorID: clinicInfo.doctorID, clinicID: clinicInfo.clinicID, license: true, projectID: clinicInfo.projectID, languageID: 2); + ProfileReqModel docInfo = new ProfileReqModel( + doctorID: clinicInfo.doctorID, + clinicID: clinicInfo.clinicID, + license: true, + projectID: clinicInfo.projectID, + languageID: 2); ///TODO change the lan await _authService.getDoctorProfileBasedOnClinic(docInfo); @@ -285,12 +332,17 @@ class AuthenticationViewModel extends BaseViewModel { /// add some logic in case of check activation code is success onCheckActivationCodeSuccess({bool isSilentLogin = false}) async { - sharedPref.setString(TOKEN, checkActivationCodeForDoctorAppRes.authenticationTokenID); - if (checkActivationCodeForDoctorAppRes.listDoctorProfile != null && checkActivationCodeForDoctorAppRes.listDoctorProfile.isNotEmpty) { - localSetDoctorProfile(checkActivationCodeForDoctorAppRes.listDoctorProfile[0]); + sharedPref.setString( + TOKEN, checkActivationCodeForDoctorAppRes.authenticationTokenID); + if (checkActivationCodeForDoctorAppRes.listDoctorProfile != null && + checkActivationCodeForDoctorAppRes.listDoctorProfile.isNotEmpty) { + localSetDoctorProfile( + checkActivationCodeForDoctorAppRes.listDoctorProfile[0]); } else { - sharedPref.setObj(CLINIC_NAME, checkActivationCodeForDoctorAppRes.listDoctorsClinic); - ClinicModel clinic = ClinicModel.fromJson(checkActivationCodeForDoctorAppRes.listDoctorsClinic[0].toJson()); + sharedPref.setObj( + CLINIC_NAME, checkActivationCodeForDoctorAppRes.listDoctorsClinic); + ClinicModel clinic = ClinicModel.fromJson( + checkActivationCodeForDoctorAppRes.listDoctorsClinic[0].toJson()); await getDoctorProfileBasedOnClinic(clinic); } } @@ -316,14 +368,29 @@ class AuthenticationViewModel extends BaseViewModel { } } + // checkIsHuawei() async { + // HmsApiAvailability hmsApiAvailability = HmsApiAvailability(); + // await hmsApiAvailability.isHMSAvailable().then((value) { + // isHuawei = value == 0 ? true : false; + // }); + // print(isHuawei); + // } + /// call firebase service to check if the user already login in before or not getDeviceInfoFromFirebase() async { + // await checkIsHuawei(); + var token; _firebaseMessaging.setAutoInitEnabled(true); if (Platform.isIOS) { _firebaseMessaging.requestPermission(); } setState(ViewState.Busy); - var token = await _firebaseMessaging.getToken(); + try { + token = await _firebaseMessaging.getToken(); + } catch(ex) { + print(ex); + } + if (localToken == "") { localToken = token; @@ -334,8 +401,10 @@ class AuthenticationViewModel extends BaseViewModel { } else { if (_authService.dashboardItemsList.length > 0) { user = _authService.dashboardItemsList[0]; - sharedPref.setObj(LAST_LOGIN_USER, _authService.dashboardItemsList[0]); - await sharedPref.setString(VIDA_REFRESH_TOKEN_ID, user.vidaRefreshTokenID); + sharedPref.setObj( + LAST_LOGIN_USER, _authService.dashboardItemsList[0]); + await sharedPref.setString( + VIDA_REFRESH_TOKEN_ID, user.vidaRefreshTokenID); await sharedPref.setString(VIDA_AUTH_TOKEN_ID, user.vidaAuthTokenID); this.unverified = true; } diff --git a/lib/screens/auth/verification_methods_screen.dart b/lib/screens/auth/verification_methods_screen.dart index 03669eb7..06b5d2ec 100644 --- a/lib/screens/auth/verification_methods_screen.dart +++ b/lib/screens/auth/verification_methods_screen.dart @@ -35,8 +35,7 @@ class VerificationMethodsScreen extends StatefulWidget { }); @override - _VerificationMethodsScreenState createState() => - _VerificationMethodsScreenState(); + _VerificationMethodsScreenState createState() => _VerificationMethodsScreenState(); } class _VerificationMethodsScreenState extends State { @@ -64,16 +63,13 @@ class _VerificationMethodsScreenState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ SizedBox( - height: SizeConfig.heightMultiplier * - (SizeConfig.isHeightVeryShort ? 6 : 4), + height: SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort ? 6 : 4), ), if (authenticationViewModel.isFromLogin) InkWell( onTap: () { - authenticationViewModel.setUnverified(false, - isFromLogin: false); - authenticationViewModel - .setAppStatus(APP_STATUS.UNAUTHENTICATED); + authenticationViewModel.setUnverified(false, isFromLogin: false); + authenticationViewModel.setAppStatus(APP_STATUS.UNAUTHENTICATED); }, child: Icon( Icons.arrow_back_ios, @@ -82,30 +78,23 @@ class _VerificationMethodsScreenState extends State { Column( children: [ SizedBox( - height: SizeConfig.heightMultiplier * - (SizeConfig.isHeightVeryShort ? 3 : 4), + height: SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort ? 3 : 4), ), - authenticationViewModel.user != null && - isMoreOption == false + authenticationViewModel.user != null && isMoreOption == false ? Column( mainAxisAlignment: MainAxisAlignment.spaceEvenly, crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( TranslationBase.of(context).welcomeBack, - fontSize: SizeConfig - .getTextMultiplierBasedOnWidth() * - 3.5, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.5, fontWeight: FontWeight.w600, color: AppGlobal.appTextColor, letterSpacing: -0.72, ), AppText( - Utils.convertToTitleCase( - authenticationViewModel.user.doctorName), - fontSize: SizeConfig - .getTextMultiplierBasedOnWidth() * - 6, + Utils.convertToTitleCase(authenticationViewModel.user.doctorName), + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 6, color: AppGlobal.appTextColor, fontWeight: FontWeight.bold, letterSpacing: -1.44, @@ -115,15 +104,12 @@ class _VerificationMethodsScreenState extends State { ), AppText( TranslationBase.of(context).accountInfo, - fontSize: SizeConfig - .getTextMultiplierBasedOnWidth() * - 4.5, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 4.5, color: Color(0xFF2E303A), fontWeight: FontWeight.w600, letterSpacing: -0.64, ), - SizedBox( - height: SizeConfig.heightMultiplier * 4), + SizedBox(height: SizeConfig.heightMultiplier * 4), Container( padding: EdgeInsets.all(15), decoration: BoxDecoration( @@ -131,149 +117,85 @@ class _VerificationMethodsScreenState extends State { borderRadius: BorderRadius.all( Radius.circular(10), ), - border: Border.all( - color: HexColor('#707070'), width: 0.1), + border: Border.all(color: HexColor('#707070'), width: 0.1), ), child: Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - crossAxisAlignment: - CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.start, children: [ Container( width: SizeConfig.realScreenWidth * .5, padding: EdgeInsets.all(0), child: Column( - mainAxisAlignment: - MainAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.start, children: [ Text( - TranslationBase.of(context) - .lastLoginAt, + TranslationBase.of(context).lastLoginAt, overflow: TextOverflow.ellipsis, style: TextStyle( fontFamily: 'Poppins', - fontSize: SizeConfig - .getTextMultiplierBasedOnWidth() * - 4.5, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 4.5, color: Color(0xFF2E303A), fontWeight: FontWeight.w600, letterSpacing: -0.4), ), Container( - width: MediaQuery.of(context) - .size - .width * - 0.55, + width: MediaQuery.of(context).size.width * 0.55, child: RichText( text: TextSpan( - text: TranslationBase.of( - context) - .verifyWith + - ':', + text: TranslationBase.of(context).verifyWith + ':', style: TextStyle( - color: - Color(0xFF575757), - fontSize: SizeConfig - .getTextMultiplierBasedOnWidth() * - 3.5, + color: Color(0xFF575757), + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.5, fontFamily: 'Poppins', - fontWeight: - FontWeight.w600, + fontWeight: FontWeight.w600, letterSpacing: -0.4), children: [ TextSpan( - text: authenticationViewModel - .getType( - authenticationViewModel - .user - .logInTypeID, - context), + text: authenticationViewModel.getType(authenticationViewModel.user.logInTypeID, context), style: TextStyle( - color: AppGlobal - .appTextColor, - fontSize: SizeConfig - .getTextMultiplierBasedOnWidth() * - 3.5, - fontFamily: - 'Poppins', - fontWeight: - FontWeight.w600, - letterSpacing: - -0.48), + color: AppGlobal.appTextColor, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.5, + fontFamily: 'Poppins', + fontWeight: FontWeight.w600, + letterSpacing: -0.48), ) ]), ), ), ], - crossAxisAlignment: - CrossAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, ), ), Column( - mainAxisAlignment: - MainAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.start, children: [ AppText( - authenticationViewModel - .user.editedOn != - null - ? AppDateUtils - .getDayMonthYearDateFormatted( - AppDateUtils - .convertStringToDate( - authenticationViewModel - .user - .editedOn), - isMonthShort: true) - : authenticationViewModel - .user.createdOn != - null - ? AppDateUtils.getDayMonthYearDateFormatted( - AppDateUtils - .convertStringToDate( - authenticationViewModel - .user - .createdOn), - isMonthShort: true) + authenticationViewModel.user.editedOn != null + ? AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.convertStringToDate(authenticationViewModel.user.editedOn), isMonthShort: true) + : authenticationViewModel.user.createdOn != null + ? AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.convertStringToDate(authenticationViewModel.user.createdOn), isMonthShort: true) : '--', textAlign: TextAlign.right, - fontSize: SizeConfig - .getTextMultiplierBasedOnWidth() * - 4.5, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 4.5, color: Color(0xFF2E303A), fontWeight: FontWeight.w700, letterSpacing: -0.48, ), AppText( - authenticationViewModel - .user.editedOn != - null - ? AppDateUtils.getHour(AppDateUtils - .convertStringToDate( - authenticationViewModel - .user.editedOn)) - : authenticationViewModel - .user.createdOn != - null - ? AppDateUtils.getHour( - AppDateUtils - .convertStringToDate( - authenticationViewModel - .user - .createdOn)) + authenticationViewModel.user.editedOn != null + ? AppDateUtils.getHour(AppDateUtils.convertStringToDate(authenticationViewModel.user.editedOn)) + : authenticationViewModel.user.createdOn != null + ? AppDateUtils.getHour(AppDateUtils.convertStringToDate(authenticationViewModel.user.createdOn)) : '--', textAlign: TextAlign.right, - fontSize: SizeConfig - .getTextMultiplierBasedOnWidth() * - 3.5, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.5, fontWeight: FontWeight.w600, letterSpacing: -0.48, color: Color(0xFF575757), ) ], - crossAxisAlignment: - CrossAxisAlignment.end, + crossAxisAlignment: CrossAxisAlignment.end, ) ], ), @@ -286,9 +208,7 @@ class _VerificationMethodsScreenState extends State { //todo add translation AppText( "Please Verify", - fontSize: SizeConfig - .getTextMultiplierBasedOnWidth() * - 4.5, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 4.5, color: AppGlobal.appTextColor, fontWeight: FontWeight.w600, letterSpacing: -.64, @@ -300,150 +220,90 @@ class _VerificationMethodsScreenState extends State { ), ], ) - : Column( - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - this.onlySMSBox == false - ? Container( - margin: EdgeInsets.only( - bottom: 20, top: 30), - child: AppText( - TranslationBase.of(context) - .verifyLoginWith, - fontSize: SizeConfig - .getTextMultiplierBasedOnWidth() * - 4, - color: Color(0xFF2E303A), - fontWeight: FontWeight.bold, - textAlign: TextAlign.left, - ), - ) - : AppText( - TranslationBase.of(context) - .verifyFingerprint2, - fontSize: SizeConfig - .getTextMultiplierBasedOnWidth() * - 4, - textAlign: TextAlign.start, - ), - ]), - authenticationViewModel.user != null && - isMoreOption == false - ? Column( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - mainAxisAlignment: - MainAxisAlignment.center, + : Column(mainAxisAlignment: MainAxisAlignment.spaceEvenly, crossAxisAlignment: CrossAxisAlignment.start, children: [ + this.onlySMSBox == false + ? Container( + margin: EdgeInsets.only(bottom: 20, top: 30), + child: AppText( + TranslationBase.of(context).verifyLoginWith, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 4, + color: Color(0xFF2E303A), + fontWeight: FontWeight.bold, + textAlign: TextAlign.left, + ), + ) + : AppText( + TranslationBase.of(context).verifyFingerprint2, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 4, + textAlign: TextAlign.start, + ), + ]), + authenticationViewModel.user != null && isMoreOption == false + ? Column(mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start, children: [ + Row(mainAxisAlignment: MainAxisAlignment.center, children: [ + Expanded( + child: InkWell( + onTap: () => { + print("Fingerprint"), + // TODO check this logic it seem it will create bug to us + authenticateUser(AuthMethodTypes.Fingerprint, true) + }, + child: VerificationMethodsList( + authenticationViewModel: authenticationViewModel, + authMethodType: SelectedAuthMethodTypesService.getMethodsTypeService(authenticationViewModel.user.logInTypeID), + authenticateUser: (AuthMethodTypes authMethodType, isActive) => authenticateUser(authMethodType, isActive), + )), + ), + Expanded( + child: VerificationMethodsList( + authenticationViewModel: authenticationViewModel, + authMethodType: AuthMethodTypes.MoreOptions, + onShowMore: () { + setState(() { + isMoreOption = true; + }); + }, + )) + ]), + ]) + : Column(mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start, children: [ + onlySMSBox == false + ? Row( + mainAxisAlignment: MainAxisAlignment.center, children: [ Expanded( - child: InkWell( - onTap: () => { - // TODO check this logic it seem it will create bug to us - authenticateUser( - AuthMethodTypes - .Fingerprint, - true) - }, - child: VerificationMethodsList( - authenticationViewModel: - authenticationViewModel, - authMethodType: - SelectedAuthMethodTypesService - .getMethodsTypeService( - authenticationViewModel - .user - .logInTypeID), - authenticateUser: - (AuthMethodTypes - authMethodType, - isActive) => - authenticateUser( - authMethodType, - isActive), - )), - ), + child: VerificationMethodsList( + authenticationViewModel: authenticationViewModel, + authMethodType: AuthMethodTypes.Fingerprint, + authenticateUser: (AuthMethodTypes authMethodType, isActive) => authenticateUser(authMethodType, isActive), + )), Expanded( child: VerificationMethodsList( - authenticationViewModel: - authenticationViewModel, - authMethodType: - AuthMethodTypes.MoreOptions, - onShowMore: () { - setState(() { - isMoreOption = true; - }); - }, + authenticationViewModel: authenticationViewModel, + authMethodType: AuthMethodTypes.FaceID, + authenticateUser: (AuthMethodTypes authMethodType, isActive) => authenticateUser(authMethodType, isActive), )) - ]), - ]) - : Column( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - onlySMSBox == false - ? Row( - mainAxisAlignment: - MainAxisAlignment.center, - children: [ - Expanded( - child: VerificationMethodsList( - authenticationViewModel: - authenticationViewModel, - authMethodType: - AuthMethodTypes.Fingerprint, - authenticateUser: (AuthMethodTypes - authMethodType, - isActive) => - authenticateUser( - authMethodType, isActive), - )), - Expanded( - child: VerificationMethodsList( - authenticationViewModel: - authenticationViewModel, - authMethodType: - AuthMethodTypes.FaceID, - authenticateUser: (AuthMethodTypes - authMethodType, - isActive) => - authenticateUser( - authMethodType, isActive), - )) - ], - ) - : SizedBox(), - Row( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Expanded( - child: VerificationMethodsList( - authenticationViewModel: - authenticationViewModel, - authMethodType: AuthMethodTypes.SMS, - authenticateUser: - (AuthMethodTypes authMethodType, - isActive) => - authenticateUser( - authMethodType, isActive), - )), - Expanded( - child: VerificationMethodsList( - authenticationViewModel: - authenticationViewModel, - authMethodType: - AuthMethodTypes.WhatsApp, - authenticateUser: - (AuthMethodTypes authMethodType, - isActive) => - authenticateUser( - authMethodType, isActive), - )) - ], - ), - ]), + ], + ) + : SizedBox(), + Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Expanded( + child: VerificationMethodsList( + authenticationViewModel: authenticationViewModel, + authMethodType: AuthMethodTypes.SMS, + authenticateUser: (AuthMethodTypes authMethodType, isActive) => authenticateUser(authMethodType, isActive), + )), + Expanded( + child: VerificationMethodsList( + authenticationViewModel: authenticationViewModel, + authMethodType: AuthMethodTypes.WhatsApp, + authenticateUser: (AuthMethodTypes authMethodType, isActive) => authenticateUser(authMethodType, isActive), + )) + ], + ), + ]), // ) ], @@ -468,14 +328,12 @@ class _VerificationMethodsScreenState extends State { mainAxisAlignment: MainAxisAlignment.end, children: [ AppButton( - title: - TranslationBase.of(context).useAnotherAccount ?? '', + title: TranslationBase.of(context).useAnotherAccount ?? '', color: Color(0xFFD02127), //fontWeight: FontWeight.w700, onPressed: () { authenticationViewModel.deleteUser(); - authenticationViewModel - .setAppStatus(APP_STATUS.UNAUTHENTICATED); + authenticationViewModel.setAppStatus(APP_STATUS.UNAUTHENTICATED); }, ), SizedBox( @@ -489,15 +347,11 @@ class _VerificationMethodsScreenState extends State { ); } - sendActivationCodeByOtpNotificationType( - AuthMethodTypes authMethodType) async { - if (authMethodType == AuthMethodTypes.SMS || - authMethodType == AuthMethodTypes.WhatsApp) { + sendActivationCodeByOtpNotificationType(AuthMethodTypes authMethodType) async { + if (authMethodType == AuthMethodTypes.SMS || authMethodType == AuthMethodTypes.WhatsApp) { GifLoaderDialogUtils.showMyDialog(context); - await authenticationViewModel.sendActivationCodeForDoctorApp( - authMethodType: authMethodType, - password: authenticationViewModel.userInfo.password); + await authenticationViewModel.sendActivationCodeForDoctorApp(authMethodType: authMethodType, password: authenticationViewModel.userInfo.password); if (authenticationViewModel.state == ViewState.ErrorLocal) { Utils.showErrorToast(authenticationViewModel.error); GifLoaderDialogUtils.hideDialog(context); @@ -515,19 +369,14 @@ class _VerificationMethodsScreenState extends State { sendActivationCodeVerificationScreen(AuthMethodTypes authMethodType) async { GifLoaderDialogUtils.showMyDialog(context); - await authenticationViewModel - .sendActivationCodeVerificationScreen(authMethodType); + await authenticationViewModel.sendActivationCodeVerificationScreen(authMethodType); if (authenticationViewModel.state == ViewState.ErrorLocal) { GifLoaderDialogUtils.hideDialog(context); Utils.showErrorToast(authenticationViewModel.error); } else { - await sharedPref.setString( - TOKEN, - authenticationViewModel - .activationCodeVerificationScreenRes.logInTokenID); - if (authMethodType == AuthMethodTypes.SMS || - authMethodType == AuthMethodTypes.WhatsApp) { + await sharedPref.setString(TOKEN, authenticationViewModel.activationCodeVerificationScreenRes.logInTokenID); + if (authMethodType == AuthMethodTypes.SMS || authMethodType == AuthMethodTypes.WhatsApp) { GifLoaderDialogUtils.hideDialog(context); this.startSMSService(authMethodType, isSilentLogin: true); } else { @@ -537,12 +386,10 @@ class _VerificationMethodsScreenState extends State { } authenticateUser(AuthMethodTypes authMethodType, isActive) { - if (authMethodType == AuthMethodTypes.Fingerprint || - authMethodType == AuthMethodTypes.FaceID) { + if (authMethodType == AuthMethodTypes.Fingerprint || authMethodType == AuthMethodTypes.FaceID) { fingerPrintBefore = authMethodType; } - this.selectedOption = - fingerPrintBefore != null ? fingerPrintBefore : authMethodType; + this.selectedOption = fingerPrintBefore != null ? fingerPrintBefore : authMethodType; switch (authMethodType) { case AuthMethodTypes.SMS: @@ -552,8 +399,7 @@ class _VerificationMethodsScreenState extends State { sendActivationCode(authMethodType); break; case AuthMethodTypes.Fingerprint: - this.loginWithFingerPrintOrFaceID( - AuthMethodTypes.Fingerprint, isActive); + this.loginWithFingerPrintOrFaceID(AuthMethodTypes.Fingerprint, isActive); break; case AuthMethodTypes.FaceID: this.loginWithFingerPrintOrFaceID(AuthMethodTypes.FaceID, isActive); @@ -576,9 +422,7 @@ class _VerificationMethodsScreenState extends State { new SMSOTP( context, type, - authenticationViewModel.loggedUser != null - ? authenticationViewModel.loggedUser.mobileNumber - : authenticationViewModel.user.mobile, + authenticationViewModel.loggedUser != null ? authenticationViewModel.loggedUser.mobileNumber : authenticationViewModel.user.mobile, (value) { showDialog( context: context, @@ -594,18 +438,13 @@ class _VerificationMethodsScreenState extends State { ).displayDialog(context); } - loginWithFingerPrintOrFaceID( - AuthMethodTypes authMethodTypes, isActive) async { + loginWithFingerPrintOrFaceID(AuthMethodTypes authMethodTypes, isActive) async { if (isActive) { await authenticationViewModel.showIOSAuthMessages(); if (!mounted) return; if (authenticationViewModel.user != null && - (SelectedAuthMethodTypesService.getMethodsTypeService( - authenticationViewModel.user.logInTypeID) == - AuthMethodTypes.Fingerprint || - SelectedAuthMethodTypesService.getMethodsTypeService( - authenticationViewModel.user.logInTypeID) == - AuthMethodTypes.FaceID)) { + (SelectedAuthMethodTypesService.getMethodsTypeService(authenticationViewModel.user.logInTypeID) == AuthMethodTypes.Fingerprint || + SelectedAuthMethodTypesService.getMethodsTypeService(authenticationViewModel.user.logInTypeID) == AuthMethodTypes.FaceID)) { this.sendActivationCode(authMethodTypes); } else { setState(() { @@ -616,8 +455,7 @@ class _VerificationMethodsScreenState extends State { } checkActivationCode({String value, bool isSilentLogin = false}) async { - await authenticationViewModel.checkActivationCodeForDoctorApp( - activationCode: value, isSilentLogin: isSilentLogin); + await authenticationViewModel.checkActivationCodeForDoctorApp(activationCode: value, isSilentLogin: isSilentLogin); if (authenticationViewModel.state == ViewState.ErrorLocal) { Navigator.pop(context); Utils.showErrorToast(authenticationViewModel.error); diff --git a/lib/screens/patients/profile/soap_update/plan/update_plan_page.dart b/lib/screens/patients/profile/soap_update/plan/update_plan_page.dart index d1d647f5..6336f8ed 100644 --- a/lib/screens/patients/profile/soap_update/plan/update_plan_page.dart +++ b/lib/screens/patients/profile/soap_update/plan/update_plan_page.dart @@ -361,7 +361,7 @@ class _UpdatePlanPageState extends State episodeId: widget.patientInfo.episodeNo, appointmentNo: widget.patientInfo.appointmentNo, planNote: patientProgressNote.planNote, - doctorID: '', + doctorID: widget.patientInfo.doctorId, editedBy: ''); if (widget.sOAPViewModel.patientProgressNoteList.isEmpty) { diff --git a/lib/screens/patients/profile/vital_sign/LineChartCurvedBloodPressure.dart b/lib/screens/patients/profile/vital_sign/LineChartCurvedBloodPressure.dart new file mode 100644 index 00000000..c493135e --- /dev/null +++ b/lib/screens/patients/profile/vital_sign/LineChartCurvedBloodPressure.dart @@ -0,0 +1,296 @@ +import 'package:doctor_app_flutter/core/model/charts/app_time_series_chart.dart'; +import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; +import 'package:fl_chart/fl_chart.dart'; +import 'package:flutter/material.dart'; + +class LineChartCurvedBloodPressureNew extends StatelessWidget { + final String title; + final List timeSeries1; + final List timeSeries2; + final int indexes; + final bool isOX; + + LineChartCurvedBloodPressureNew({this.title, this.timeSeries1, this.indexes, this.timeSeries2, this.isOX = false}); + + List xAxixs = List(); + List yAxixs = List(); + + @override + Widget build(BuildContext context) { + getXaxix(); + return AspectRatio( + aspectRatio: 1.1, + child: Container( + decoration: const BoxDecoration( + borderRadius: BorderRadius.all(Radius.circular(18)), + // color: Colors.white, + ), + child: Stack( + children: [ + Column( + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + const SizedBox( + height: 12, + ), + Padding( + padding: const EdgeInsets.only( + left: 20, + right: 20, + ), + child: Text( + title, + style: TextStyle( + color: Colors.black, + fontSize: 16, + letterSpacing: -0.64, + fontWeight: FontWeight.w600, + ), + textAlign: TextAlign.start, + ), + ), + SizedBox( + height: 10, + ), + Expanded( + child: Padding( + padding: const EdgeInsets.only(right: 18.0, left: 16.0, top: 15), + child: LineChart( + sampleData1(context), + swapAnimationDuration: const Duration(milliseconds: 250), + ), + ), + ), + SizedBox( + height: 10, + ), + Row( + crossAxisAlignment: CrossAxisAlignment.center, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Row( + children: [ + Container( + width: 16, + height: 16, + decoration: containerRadius(Theme.of(context).primaryColor, 100), + ), + SizedBox( + width: 5, + ), + Text( + TranslationBase.of(context).systolicLng, + style: TextStyle( + color: Colors.black, + fontSize: 12, + letterSpacing: -0.64, + fontWeight: FontWeight.w600, + ), + ), + ], + ), + SizedBox( + width: 15, + ), + Row( + children: [ + Container( + width: 16, + height: 16, + decoration: containerRadius(Color(0xFFD02127), 100), + ), + SizedBox( + width: 5, + ), + Text( + TranslationBase.of(context).diastolicLng, + style: TextStyle( + color: Colors.black, + fontSize: 12, + letterSpacing: -0.64, + fontWeight: FontWeight.w600, + ), + ), + ], + ), + ], + ), + const SizedBox( + height: 12, + ), + ], + ), + ], + ), + ), + ); + } + + getXaxix() { + for (int index = 0; index < timeSeries1.length; index++) { + int mIndex = indexes * index; + if (mIndex < timeSeries1.length) { + xAxixs.add(mIndex); + } + } + } + + LineChartData sampleData1(context) { + return LineChartData( + lineTouchData: LineTouchData( + touchTooltipData: LineTouchTooltipData( + tooltipBgColor: Colors.white, + ), + touchCallback: (touchEvent, LineTouchResponse touchResponse) {}, + handleBuiltInTouches: true, + ), + gridData: FlGridData(show: true, drawVerticalLine: true, drawHorizontalLine: true, horizontalInterval: 14, verticalInterval: 14), + titlesData: FlTitlesData( + bottomTitles: SideTitles( + showTitles: true, + getTextStyles: (cxt, value) => const TextStyle( + color: Colors.black, + fontSize: 10, + ), + rotateAngle: -65, + margin: 22, + getTitles: (value) { + if (timeSeries1.length < 15) { + if (timeSeries1.length > value.toInt()) { + return '${timeSeries1[value.toInt()].time.month}/ ${timeSeries1[value.toInt()].time.year}'; + } else + return ''; + } else { + if (value.toInt() == 0) return '${timeSeries1[value.toInt()].time.month}/ ${timeSeries1[value.toInt()].time.year}'; + if (value.toInt() == timeSeries1.length - 1) return '${timeSeries1[value.toInt()].time.month}/ ${timeSeries1[value.toInt()].time.year}'; + if (xAxixs.contains(value.toInt())) { + return '${timeSeries1[value.toInt()].time.month}/ ${timeSeries1[value.toInt()].time.year}'; + } + } + return ''; + }, + ), + leftTitles: SideTitles( + showTitles: true, + getTextStyles: (cxt, value) => const TextStyle( + color: Colors.black, + fontWeight: FontWeight.bold, + fontSize: 10, + ), + interval: getMaxY() - getMinY() <= 500 + ? 50 + : getMaxY() - getMinY() <= 1000 + ? 100 + : 200, + margin: 12, + ), + ), + borderData: FlBorderData( + show: true, + border: const Border( + bottom: BorderSide( + color: Colors.black, + width: 0.5, + ), + left: BorderSide( + color: Colors.black, + ), + right: BorderSide( + color: Colors.black, + ), + top: BorderSide( + color: Colors.transparent, + ), + ), + ), + minX: 0, + maxX: (timeSeries1.length - 1).toDouble(), + maxY: getMaxY() + 15, + minY: getMinY() - 15, + lineBarsData: getData(context), + ); + } + + double getMaxY() { + double max = 0; + timeSeries1.forEach((element) { + double resultValueDouble = element.sales; + if (resultValueDouble > max) max = resultValueDouble; + }); + timeSeries2.forEach((element) { + double resultValueDouble = element.sales; + if (resultValueDouble > max) max = resultValueDouble; + }); + + return max.roundToDouble(); + } + + double getMinY() { + double min = timeSeries1[0].sales; + timeSeries1.forEach((element) { + double resultValueDouble = element.sales; + if (resultValueDouble < min) min = resultValueDouble; + }); + timeSeries2.forEach((element) { + double resultValueDouble = element.sales; + if (resultValueDouble < min) min = resultValueDouble; + }); + + int value = min.toInt(); + + return value.toDouble(); + } + + List getData(context) { + List spots = List(); + for (int index = 0; index < timeSeries1.length; index++) { + spots.add(FlSpot(index.toDouble(), timeSeries1[index].sales)); + } + + List spots2 = List(); + for (int index = 0; index < timeSeries2.length; index++) { + spots2.add(FlSpot(index.toDouble(), timeSeries2[index].sales)); + } + + final LineChartBarData lineChartBarData1 = LineChartBarData( + spots: spots, + isCurved: true, + colors: [Colors.red], + barWidth: 1.5, + isStrokeCapRound: true, + dotData: FlDotData( + show: false, + ), + belowBarData: BarAreaData( + show: false, + ), + ); + final LineChartBarData lineChartBarData2 = LineChartBarData( + spots: spots2, + isCurved: true, + colors: [Theme.of(context).primaryColor], + barWidth: 1.5, + isStrokeCapRound: true, + dotData: FlDotData( + show: false, + ), + belowBarData: BarAreaData( + show: false, + ), + ); + + return [lineChartBarData1, lineChartBarData2]; + } + + Decoration containerRadius(Color background, double radius) { + return BoxDecoration( + color: background, + border: Border.all( + width: 1, // + color: background // <--- border width here + ), + borderRadius: BorderRadius.circular(radius), + ); + } + +} diff --git a/lib/screens/patients/profile/vital_sign/vital_sign_details_screen.dart b/lib/screens/patients/profile/vital_sign/vital_sign_details_screen.dart index d2375196..85a29937 100644 --- a/lib/screens/patients/profile/vital_sign/vital_sign_details_screen.dart +++ b/lib/screens/patients/profile/vital_sign/vital_sign_details_screen.dart @@ -1,9 +1,9 @@ import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/core/service/AnalyticsService.dart'; import 'package:doctor_app_flutter/core/viewModel/patient-vital-sign-viewmodel.dart'; import 'package:doctor_app_flutter/locator.dart'; import 'package:doctor_app_flutter/lookups/patient_lookup.dart'; -import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/patients/profile/vital_sign/vital_sign_item.dart'; import 'package:doctor_app_flutter/screens/patients/profile/vital_sign/vital_sign_item_details_screen.dart'; @@ -20,8 +20,7 @@ class VitalSignDetailsScreen extends StatelessWidget { int projectID; bool isNotOneAppointment; - VitalSignDetailsScreen( - {this.appointmentNo, this.projectID, this.isNotOneAppointment = true}); + VitalSignDetailsScreen({this.appointmentNo, this.projectID, this.isNotOneAppointment = true}); @override Widget build(BuildContext context) { @@ -36,8 +35,7 @@ class VitalSignDetailsScreen extends StatelessWidget { String assetBasePath = "${imageBasePath}patient/vital_signs/"; return BaseView( - onModelReady: (model) => - model.getPatientVitalSignHistory(patient, from, to, isInpatient), + onModelReady: (model) => model.getPatientVitalSignHistory(patient, from, to, isInpatient), builder: (_, mode, widget) => AppScaffold( baseViewModel: mode, isShowAppBar: true, @@ -76,8 +74,7 @@ class VitalSignDetailsScreen extends StatelessWidget { height: MediaQuery.of(context).size.height * 0.23, width: double.infinity, padding: EdgeInsets.all(12.0), - margin: EdgeInsets.symmetric( - horizontal: 16.0, vertical: 8.0), + margin: EdgeInsets.symmetric(horizontal: 16.0, vertical: 8.0), decoration: BoxDecoration( shape: BoxShape.rectangle, color: Colors.white, @@ -101,17 +98,11 @@ class VitalSignDetailsScreen extends StatelessWidget { children: [ Expanded( child: Column( - crossAxisAlignment: - CrossAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, children: [ Image.asset( - mode.getBMIStatus() != 1 - ? '${assetBasePath}underweight_BMI.png' - : '${assetBasePath}underweight_BMI-r.png', - height: MediaQuery.of(context) - .size - .height * - 0.10, + mode.getBMIStatus() != 1 ? '${assetBasePath}underweight_BMI.png' : '${assetBasePath}underweight_BMI-r.png', + height: MediaQuery.of(context).size.height * 0.10, ), const SizedBox( height: 4, @@ -119,38 +110,26 @@ class VitalSignDetailsScreen extends StatelessWidget { AppText( "${TranslationBase.of(context).bmiUnderWeight}", fontFamily: 'Poppins', - fontSize: - SizeConfig.textMultiplier * 1.15, - color: mode.getBMIStatus() == 1 - ? Color(0XFFD02127) - : null, + fontSize: SizeConfig.textMultiplier * 1.15, + color: mode.getBMIStatus() == 1 ? Color(0XFFD02127) : null, fontWeight: FontWeight.w700, ), AppText( "(<18.5)", fontFamily: 'Poppins', - fontSize: - SizeConfig.textMultiplier * 1.15, - color: mode.getBMIStatus() == 1 - ? Color(0XFFD02127) - : null, + fontSize: SizeConfig.textMultiplier * 1.15, + color: mode.getBMIStatus() == 1 ? Color(0XFFD02127) : null, fontWeight: FontWeight.w700, ), ], )), Expanded( child: Column( - crossAxisAlignment: - CrossAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, children: [ Image.asset( - mode.getBMIStatus() != 2 - ? '${assetBasePath}health_BMI.png' - : '${assetBasePath}health_BMI-r.png', - height: MediaQuery.of(context) - .size - .height * - 0.10, + mode.getBMIStatus() != 2 ? '${assetBasePath}health_BMI.png' : '${assetBasePath}health_BMI-r.png', + height: MediaQuery.of(context).size.height * 0.10, ), const SizedBox( height: 4, @@ -159,40 +138,27 @@ class VitalSignDetailsScreen extends StatelessWidget { child: AppText( "${TranslationBase.of(context).normal}", fontFamily: 'Poppins', - fontSize: - SizeConfig.textMultiplier * - 1.15, + fontSize: SizeConfig.textMultiplier * 1.15, fontWeight: FontWeight.w700, - color: mode.getBMIStatus() == 2 - ? Color(0XFFD02127) - : null, + color: mode.getBMIStatus() == 2 ? Color(0XFFD02127) : null, ), ), AppText( "(18.5-24.9)", fontFamily: 'Poppins', - fontSize: - SizeConfig.textMultiplier * 1.15, + fontSize: SizeConfig.textMultiplier * 1.15, fontWeight: FontWeight.w700, - color: mode.getBMIStatus() == 2 - ? Color(0XFFD02127) - : null, + color: mode.getBMIStatus() == 2 ? Color(0XFFD02127) : null, ), ], )), Expanded( child: Column( - crossAxisAlignment: - CrossAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, children: [ Image.asset( - mode.getBMIStatus() != 3 - ? '${assetBasePath}ovrweight_BMI.png' - : '${assetBasePath}ovrweight_BMI-r.png', - height: MediaQuery.of(context) - .size - .height * - 0.10, + mode.getBMIStatus() != 3 ? '${assetBasePath}ovrweight_BMI.png' : '${assetBasePath}ovrweight_BMI-r.png', + height: MediaQuery.of(context).size.height * 0.10, ), const SizedBox( height: 4, @@ -200,38 +166,26 @@ class VitalSignDetailsScreen extends StatelessWidget { AppText( "${TranslationBase.of(context).bmiOverWeight}", fontFamily: 'Poppins', - fontSize: - SizeConfig.textMultiplier * 1.155, + fontSize: SizeConfig.textMultiplier * 1.155, fontWeight: FontWeight.w700, - color: mode.getBMIStatus() == 3 - ? Color(0XFFD02127) - : null, + color: mode.getBMIStatus() == 3 ? Color(0XFFD02127) : null, ), AppText( "(25-29.9)", fontFamily: 'Poppins', - fontSize: - SizeConfig.textMultiplier * 1.155, + fontSize: SizeConfig.textMultiplier * 1.155, fontWeight: FontWeight.w700, - color: mode.getBMIStatus() == 3 - ? Color(0XFFD02127) - : null, + color: mode.getBMIStatus() == 3 ? Color(0XFFD02127) : null, ), ], )), Expanded( child: Column( - crossAxisAlignment: - CrossAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, children: [ Image.asset( - mode.getBMIStatus() != 4 - ? '${assetBasePath}Obese_BMI.png' - : '${assetBasePath}Obese_BMI-r.png', - height: MediaQuery.of(context) - .size - .height * - 0.10, + mode.getBMIStatus() != 4 ? '${assetBasePath}Obese_BMI.png' : '${assetBasePath}Obese_BMI-r.png', + height: MediaQuery.of(context).size.height * 0.10, ), const SizedBox( height: 4, @@ -239,38 +193,26 @@ class VitalSignDetailsScreen extends StatelessWidget { AppText( "${TranslationBase.of(context).bmiObese}", fontFamily: 'Poppins', - fontSize: - SizeConfig.textMultiplier * 1.15, + fontSize: SizeConfig.textMultiplier * 1.15, fontWeight: FontWeight.w700, - color: mode.getBMIStatus() == 4 - ? Color(0XFFD02127) - : null, + color: mode.getBMIStatus() == 4 ? Color(0XFFD02127) : null, ), AppText( "(30-34.9)", fontFamily: 'Poppins', - fontSize: - SizeConfig.textMultiplier * 1.15, + fontSize: SizeConfig.textMultiplier * 1.15, fontWeight: FontWeight.w700, - color: mode.getBMIStatus() == 4 - ? Color(0XFFD02127) - : null, + color: mode.getBMIStatus() == 4 ? Color(0XFFD02127) : null, ), ], )), Expanded( child: Column( - crossAxisAlignment: - CrossAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, children: [ Image.asset( - mode.getBMIStatus() != 5 - ? '${assetBasePath}Obese_BMI.png' - : '${assetBasePath}Obese_BMI-r.png', - height: MediaQuery.of(context) - .size - .height * - 0.10, + mode.getBMIStatus() != 5 ? '${assetBasePath}Obese_BMI.png' : '${assetBasePath}Obese_BMI-r.png', + height: MediaQuery.of(context).size.height * 0.10, ), const SizedBox( height: 4, @@ -280,24 +222,17 @@ class VitalSignDetailsScreen extends StatelessWidget { child: AppText( "${TranslationBase.of(context).bmiObeseExtreme}", fontFamily: 'Poppins', - fontSize: - SizeConfig.textMultiplier * - 1.15, + fontSize: SizeConfig.textMultiplier * 1.15, fontWeight: FontWeight.w700, - color: mode.getBMIStatus() == 5 - ? Color(0XFFD02127) - : null, + color: mode.getBMIStatus() == 5 ? Color(0XFFD02127) : null, ), ), AppText( "(35<)", fontFamily: 'Poppins', - fontSize: - SizeConfig.textMultiplier * 1.15, + fontSize: SizeConfig.textMultiplier * 1.15, fontWeight: FontWeight.w700, - color: mode.getBMIStatus() == 5 - ? Color(0XFFD02127) - : null, + color: mode.getBMIStatus() == 5 ? Color(0XFFD02127) : null, ), ], )), @@ -309,8 +244,7 @@ class VitalSignDetailsScreen extends StatelessWidget { Expanded( child: SingleChildScrollView( child: Container( - margin: EdgeInsets.symmetric( - horizontal: 16.0, vertical: 16), + margin: EdgeInsets.symmetric(horizontal: 16.0, vertical: 16), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -326,16 +260,10 @@ class VitalSignDetailsScreen extends StatelessWidget { ? Navigator.push( context, FadePage( - page: - VitalSignItemDetailsScreen( - pageKey: vitalSignDetails - .Height, - pageTitle: - TranslationBase.of( - context) - .height, - vitalList: mode - .patientVitalSignsHistory, + page: VitalSignItemDetailsScreen( + pageKey: vitalSignDetails.Height, + pageTitle: TranslationBase.of(context).height, + vitalList: mode.patientVitalSignsHistory, patient: patient, patientType: patientType, arrivalType: arrivalType, @@ -345,40 +273,28 @@ class VitalSignDetailsScreen extends StatelessWidget { : null, child: Container( child: VitalSignItem( - des: TranslationBase.of(context) - .height, - imagePath: - "${assetBasePath}height.png", + des: TranslationBase.of(context).height, + imagePath: "${assetBasePath}height.png", lastVal: mode.heightCm, - unit: TranslationBase.of(context) - .cm, + unit: TranslationBase.of(context).cm, ), ), ), if (isNotOneAppointment) InkWell( onTap: () async { - await locator() - .logEvent( - eventCategory: - "Vital Sign Details Screen", - eventAction: - "Vital Sign Details", + await locator().logEvent( + eventCategory: "Vital Sign Details Screen", + eventAction: "Vital Sign Details", ); Navigator.push( context, FadePage( - page: - VitalSignItemDetailsScreen( - pageKey: - vitalSignDetails.Weight, - pageTitle: - TranslationBase.of( - context) - .weight, - vitalList: mode - .patientVitalSignsHistory, + page: VitalSignItemDetailsScreen( + pageKey: vitalSignDetails.Weight, + pageTitle: TranslationBase.of(context).weight, + vitalList: mode.patientVitalSignsHistory, patient: patient, patientType: patientType, arrivalType: arrivalType, @@ -387,12 +303,9 @@ class VitalSignDetailsScreen extends StatelessWidget { ); }, child: VitalSignItem( - des: TranslationBase.of(context) - .weight, - imagePath: - "${assetBasePath}weight.png", - unit: TranslationBase.of(context) - .kg, + des: TranslationBase.of(context).weight, + imagePath: "${assetBasePath}weight.png", + unit: TranslationBase.of(context).kg, lastVal: mode.weightKg, ), ), @@ -401,16 +314,10 @@ class VitalSignDetailsScreen extends StatelessWidget { ? Navigator.push( context, FadePage( - page: - VitalSignItemDetailsScreen( - pageKey: vitalSignDetails - .Temperature, - pageTitle: - TranslationBase.of( - context) - .temperature, - vitalList: mode - .patientVitalSignsHistory, + page: VitalSignItemDetailsScreen( + pageKey: vitalSignDetails.Temperature, + pageTitle: TranslationBase.of(context).temperature, + vitalList: mode.patientVitalSignsHistory, patient: patient, patientType: patientType, arrivalType: arrivalType, @@ -420,13 +327,10 @@ class VitalSignDetailsScreen extends StatelessWidget { : null, child: Container( child: VitalSignItem( - des: TranslationBase.of(context) - .temperature, - imagePath: - "${assetBasePath}temperature.png", + des: TranslationBase.of(context).temperature, + imagePath: "${assetBasePath}temperature.png", lastVal: mode.temperatureCelcius, - unit: TranslationBase.of(context) - .tempC, + unit: TranslationBase.of(context).tempC, ), ), ), @@ -435,16 +339,10 @@ class VitalSignDetailsScreen extends StatelessWidget { ? Navigator.push( context, FadePage( - page: - VitalSignItemDetailsScreen( - pageKey: vitalSignDetails - .heart, - pageTitle: - TranslationBase.of( - context) - .heart, - vitalList: mode - .patientVitalSignsHistory, + page: VitalSignItemDetailsScreen( + pageKey: vitalSignDetails.heart, + pageTitle: TranslationBase.of(context).heart, + vitalList: mode.patientVitalSignsHistory, patient: patient, patientType: patientType, arrivalType: arrivalType, @@ -453,13 +351,10 @@ class VitalSignDetailsScreen extends StatelessWidget { ) : null, child: VitalSignItem( - des: TranslationBase.of(context) - .heart, - imagePath: - "${assetBasePath}heart_rate.png", + des: TranslationBase.of(context).heart, + imagePath: "${assetBasePath}heart_rate.png", lastVal: mode.hartRat, - unit: - TranslationBase.of(context).bpm, + unit: TranslationBase.of(context).bpm, ), ), InkWell( @@ -467,16 +362,10 @@ class VitalSignDetailsScreen extends StatelessWidget { ? Navigator.push( context, FadePage( - page: - VitalSignItemDetailsScreen( - pageKey: vitalSignDetails - .Respiration, - pageTitle: - TranslationBase.of( - context) - .respirationRate, - vitalList: mode - .patientVitalSignsHistory, + page: VitalSignItemDetailsScreen( + pageKey: vitalSignDetails.Respiration, + pageTitle: TranslationBase.of(context).respirationRate, + vitalList: mode.patientVitalSignsHistory, patient: patient, patientType: patientType, arrivalType: arrivalType, @@ -485,14 +374,10 @@ class VitalSignDetailsScreen extends StatelessWidget { ) : null, child: VitalSignItem( - des: TranslationBase.of(context) - .respirationRate, - imagePath: - "${assetBasePath}respiration_rate.png", - lastVal: - mode.respirationBeatPerMinute, - unit: TranslationBase.of(context) - .respirationSigns, + des: TranslationBase.of(context).respirationRate, + imagePath: "${assetBasePath}respiration_rate.png", + lastVal: mode.respirationBeatPerMinute, + unit: TranslationBase.of(context).respirationSigns, ), ), InkWell( @@ -500,31 +385,24 @@ class VitalSignDetailsScreen extends StatelessWidget { ? Navigator.push( context, FadePage( - page: - VitalSignItemDetailsScreen( - pageKey: vitalSignDetails - .BloodPressure, - pageTitle: - TranslationBase.of( - context) - .bloodPressure, - vitalList: mode - .patientVitalSignsHistory, + page: VitalSignItemDetailsScreen( + pageKey: vitalSignDetails.BloodPressure, + pageTitle: TranslationBase.of(context).bloodPressure, + vitalList: mode.patientVitalSignsHistory, patient: patient, patientType: patientType, arrivalType: arrivalType, + viewKey1: 'BloodPressureHigher', + viewKey2: 'BloodPressureLower', ), ), ) : null, child: VitalSignItem( - des: TranslationBase.of(context) - .bloodPressure, - imagePath: - "${assetBasePath}blood_pressure.png", + des: TranslationBase.of(context).bloodPressure, + imagePath: "${assetBasePath}blood_pressure.png", lastVal: mode.bloodPressure, - unit: TranslationBase.of(context) - .sysDias, + unit: TranslationBase.of(context).sysDias, ), ), InkWell( @@ -532,16 +410,10 @@ class VitalSignDetailsScreen extends StatelessWidget { ? Navigator.push( context, FadePage( - page: - VitalSignItemDetailsScreen( - pageKey: vitalSignDetails - .Oxygenation, - pageTitle: - TranslationBase.of( - context) - .oxygenation, - vitalList: mode - .patientVitalSignsHistory, + page: VitalSignItemDetailsScreen( + pageKey: vitalSignDetails.Oxygenation, + pageTitle: TranslationBase.of(context).oxygenation, + vitalList: mode.patientVitalSignsHistory, patient: patient, patientType: patientType, arrivalType: arrivalType, @@ -550,10 +422,8 @@ class VitalSignDetailsScreen extends StatelessWidget { ) : null, child: VitalSignItem( - des: TranslationBase.of(context) - .oxygenation, - imagePath: - "${assetBasePath}oxg.png", + des: TranslationBase.of(context).oxygenation, + imagePath: "${assetBasePath}oxg.png", lastVal: "${mode.oxygenation}%", unit: "", ), @@ -563,16 +433,10 @@ class VitalSignDetailsScreen extends StatelessWidget { ? Navigator.push( context, FadePage( - page: - VitalSignItemDetailsScreen( - pageKey: vitalSignDetails - .PainScale, - pageTitle: - TranslationBase.of( - context) - .painScale, - vitalList: mode - .patientVitalSignsHistory, + page: VitalSignItemDetailsScreen( + pageKey: vitalSignDetails.PainScale, + pageTitle: TranslationBase.of(context).painScale, + vitalList: mode.patientVitalSignsHistory, patient: patient, patientType: patientType, arrivalType: arrivalType, @@ -581,13 +445,10 @@ class VitalSignDetailsScreen extends StatelessWidget { ) : null, child: VitalSignItem( - des: TranslationBase.of(context) - .painScale, - imagePath: - "${assetBasePath}painScale.png", + des: TranslationBase.of(context).painScale, + imagePath: "${assetBasePath}painScale.png", lastVal: mode.painScore, - unit: TranslationBase.of(context) - .severe, + unit: TranslationBase.of(context).severe, ), ), ], diff --git a/lib/screens/patients/profile/vital_sign/vital_sign_item_details_screen.dart b/lib/screens/patients/profile/vital_sign/vital_sign_item_details_screen.dart index 95147ba0..1decdd4e 100644 --- a/lib/screens/patients/profile/vital_sign/vital_sign_item_details_screen.dart +++ b/lib/screens/patients/profile/vital_sign/vital_sign_item_details_screen.dart @@ -1,11 +1,15 @@ import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/core/model/charts/app_time_series_chart.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/lookups/patient_lookup.dart'; import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/core/model/patient/vital_sign/patient-vital-sign-history.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/vital_sign/LineChartCurvedBloodPressure.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/vital_sign/line_chart_curved_blood_pressure.dart'; import 'package:doctor_app_flutter/screens/patients/profile/vital_sign/vital_sign_detail_pain_scale.dart'; import 'package:doctor_app_flutter/screens/patients/profile/vital_sign/vital_sing_chart_and_detials.dart'; import 'package:doctor_app_flutter/screens/patients/profile/vital_sign/vital_sing_chart_blood_pressure.dart'; +import 'package:doctor_app_flutter/utils/date-utils.dart'; import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-profile-app-bar.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; @@ -21,9 +25,17 @@ class VitalSignItemDetailsScreen extends StatelessWidget { String patientType; String arrivalType; + List timeSeriesData1 = []; + List timeSeriesData2 = []; + + final String viewKey1; + final String viewKey2; + VitalSignItemDetailsScreen( {this.vitalList, this.pageKey, + @required this.viewKey1, + @required this.viewKey2, this.pageTitle, this.patient, this.patientType, @@ -34,6 +46,7 @@ class VitalSignItemDetailsScreen extends StatelessWidget { @override Widget build(BuildContext context) { ProjectViewModel projectViewModel = Provider.of(context); + generateData(); switch (pageKey) { case vitalSignDetails.BodyMeasurements: VSchart = [ @@ -233,6 +246,15 @@ class VitalSignItemDetailsScreen extends StatelessWidget { if (vitalListTemp.length != 0 && chartInfo['viewKey'] == 'BloodPressure' || chartInfo['viewKey'] == 'O2') { + // return LineChartCurvedBloodPressureNew( + // title: projectViewModel.isArabic + // ? chartInfo['nameAr'] + // : chartInfo['name'], + // timeSeries1: timeSeriesData1, + // timeSeries2: timeSeriesData2, + // indexes: timeSeriesData1.length ~/ 5.5, + // ); + return VitalSingChartBloodPressure( vitalList: vitalList, name: projectViewModel.isArabic @@ -252,6 +274,7 @@ class VitalSignItemDetailsScreen extends StatelessWidget { ? 'BloodPressureLower' : 'FIO2', ); + } return vitalListTemp.length != 0 @@ -274,4 +297,30 @@ class VitalSignItemDetailsScreen extends StatelessWidget { ), ); } + + generateData() { + if (vitalList.length > 0) { + vitalList.reversed.toList().forEach( + (element) { + if (element.toJson()[viewKey1]?.toInt() != 0) + timeSeriesData1.add( + TimeSeriesSales2( + AppDateUtils.convertStringToDate(element.createdOn), + // new DateTime(element.vitalSignDate.year, element.vitalSignDate.month, element.vitalSignDate.day), + element.toJson()[viewKey1].toDouble(), + ), + ); + if (element.toJson()[viewKey2]?.toInt() != 0) + timeSeriesData2.add( + TimeSeriesSales2( + AppDateUtils.convertStringToDate(element.createdOn), + // new DateTime(element.vitalSignDate.year, element.vitalSignDate.month, element.vitalSignDate.day), + element.toJson()[viewKey2].toDouble(), + ), + ); + }, + ); + } + } + } diff --git a/lib/screens/patients/profile/vital_sign/vital_sing_chart_blood_pressure.dart b/lib/screens/patients/profile/vital_sign/vital_sing_chart_blood_pressure.dart index 874bb4f8..2219f44a 100644 --- a/lib/screens/patients/profile/vital_sign/vital_sing_chart_blood_pressure.dart +++ b/lib/screens/patients/profile/vital_sign/vital_sing_chart_blood_pressure.dart @@ -1,6 +1,7 @@ import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/model/charts/app_time_series_chart.dart'; import 'package:doctor_app_flutter/core/model/patient/vital_sign/patient-vital-sign-history.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/vital_sign/LineChartCurvedBloodPressure.dart'; import 'package:doctor_app_flutter/screens/patients/profile/vital_sign/vital_sign_details_blood_pressurewideget.dart'; import 'package:doctor_app_flutter/utils/date-utils.dart'; import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; @@ -45,7 +46,7 @@ class VitalSingChartBloodPressure extends StatelessWidget { decoration: BoxDecoration( color: Colors.white, borderRadius: BorderRadius.circular(12)), - child: LineChartCurvedBloodPressure( + child: LineChartCurvedBloodPressureNew( title: name, isOX: title2 == "SAO2", timeSeries1: timeSeriesData1, diff --git a/lib/utils/utils.dart b/lib/utils/utils.dart index 20222ac6..48213619 100644 --- a/lib/utils/utils.dart +++ b/lib/utils/utils.dart @@ -112,6 +112,7 @@ class Utils { }); } + static TextStyle textStyle(context) => TextStyle(color: Theme.of(context).primaryColor); diff --git a/lib/widgets/patients/profile/app_bar/patient-profile-header-new-design-app-bar.dart b/lib/widgets/patients/profile/app_bar/patient-profile-header-new-design-app-bar.dart index 996effed..7f19b5e4 100644 --- a/lib/widgets/patients/profile/app_bar/patient-profile-header-new-design-app-bar.dart +++ b/lib/widgets/patients/profile/app_bar/patient-profile-header-new-design-app-bar.dart @@ -1,12 +1,12 @@ import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/core/service/AnalyticsService.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; import 'package:doctor_app_flutter/locator.dart'; -import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/utils/date-utils.dart'; -import 'package:doctor_app_flutter/utils/utils.dart'; import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; +import 'package:doctor_app_flutter/utils/utils.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; @@ -15,8 +15,7 @@ import 'package:url_launcher/url_launcher.dart'; import 'header_row.dart'; -class PatientProfileHeaderNewDesignAppBar extends StatelessWidget - with PreferredSizeWidget { +class PatientProfileHeaderNewDesignAppBar extends StatelessWidget with PreferredSizeWidget { final PatiantInformtion patient; final String patientType; final String arrivalType; @@ -27,13 +26,8 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget final Stream videoCallDurationStream; - PatientProfileHeaderNewDesignAppBar( - this.patient, this.patientType, this.arrivalType, - {this.height = 0.0, - this.isInpatient = false, - this.isDischargedPatient = false, - this.isFromLiveCare = false, - this.videoCallDurationStream}); + PatientProfileHeaderNewDesignAppBar(this.patient, this.patientType, this.arrivalType, + {this.height = 0.0, this.isInpatient = false, this.isDischargedPatient = false, this.isFromLiveCare = false, this.videoCallDurationStream}); @override Widget build(BuildContext context) { @@ -73,11 +67,8 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget Expanded( child: AppText( patient.firstName != null - ? (Utils.capitalize(patient.firstName) + - " " + - Utils.capitalize(patient.lastName)) - : Utils.capitalize(patient.fullName ?? - patient.patientDetails.fullName), + ? (Utils.capitalize(patient.firstName) + " " + Utils.capitalize(patient.lastName)) + : Utils.capitalize(patient.fullName ?? patient.patientDetails.fullName), fontSize: SizeConfig.textMultiplier * 1.8, fontWeight: FontWeight.bold, fontFamily: 'Poppins', @@ -110,17 +101,13 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget ), StreamBuilder( stream: videoCallDurationStream, - builder: - (BuildContext context, AsyncSnapshot snapshot) { + builder: (BuildContext context, AsyncSnapshot snapshot) { if (snapshot.hasData && snapshot.data != null) return InkWell( onTap: () {}, child: Container( - decoration: BoxDecoration( - color: Colors.red, - borderRadius: BorderRadius.circular(20)), - padding: - EdgeInsets.symmetric(vertical: 2, horizontal: 10), + decoration: BoxDecoration(color: Colors.red, borderRadius: BorderRadius.circular(20)), + padding: EdgeInsets.symmetric(vertical: 2, horizontal: 10), child: Text( snapshot.data, style: TextStyle(color: Colors.white), @@ -140,9 +127,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget width: 60, height: 60, child: Image.asset( - gender == 1 - ? 'assets/images/male_avatar.png' - : 'assets/images/female_avatar.png', + gender == 1 ? 'assets/images/male_avatar.png' : 'assets/images/female_avatar.png', fit: BoxFit.cover, ), ), @@ -154,58 +139,48 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - SERVICES_PATIANT2[int.parse(patientType)] == - "patientArrivalList" + SERVICES_PATIANT2[int.parse(patientType)] == "patientArrivalList" ? Container( child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - patient.patientStatusType == 43 - ? AppText( - TranslationBase.of(context).arrivedP, - color: AppGlobal.appGreenColor, - fontWeight: FontWeight.bold, - fontFamily: 'Poppins', - fontSize: 12, - ) - : AppText( - TranslationBase.of(context).notArrived, - color: Colors.red[800], - fontWeight: FontWeight.bold, - fontFamily: 'Poppins', - fontSize: 12, - ), + if (patient.patientStatusType != null) + patient.patientStatusType == 43 + ? AppText( + TranslationBase.of(context).arrivedP, + color: AppGlobal.appGreenColor, + fontWeight: FontWeight.bold, + fontFamily: 'Poppins', + fontSize: 12, + ) + : AppText( + TranslationBase.of(context).notArrived, + color: Colors.red[800], + fontWeight: FontWeight.bold, + fontFamily: 'Poppins', + fontSize: 12, + ), arrivalType == '1' || patient.arrivedOn == null ? AppText( - patient.startTime != null - ? patient.startTime - : '', + patient.startTime != null ? patient.startTime : '', fontFamily: 'Poppins', fontWeight: FontWeight.w600, ) : AppText( - patient.arrivedOn != null - ? AppDateUtils - .convertStringToDateFormat( - patient.arrivedOn, - 'MM-dd-yyyy HH:mm') - : '', + patient.arrivedOn != null ? AppDateUtils.convertStringToDateFormat(patient.arrivedOn, 'MM-dd-yyyy HH:mm') : '', fontFamily: 'Poppins', fontWeight: FontWeight.w600, ) ], )) : SizedBox(), - if (SERVICES_PATIANT2[int.parse(patientType)] == - "List_MyOutPatient" && - !isFromLiveCare) + if (SERVICES_PATIANT2[int.parse(patientType)] == "List_MyOutPatient" && !isFromLiveCare) Container( child: Row( mainAxisAlignment: MainAxisAlignment.start, children: [ AppText( - TranslationBase.of(context).appointmentDate + - " : ", + TranslationBase.of(context).appointmentDate + " : ", fontSize: 14, ), patient.startTime != null @@ -230,8 +205,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget ), Container( child: AppText( - convertDateFormat2( - patient.appointmentDate ?? ''), + convertDateFormat2(patient.appointmentDate ?? ''), fontSize: 1.5 * SizeConfig.textMultiplier, fontWeight: FontWeight.bold, ), @@ -261,10 +235,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget child: Container( alignment: Alignment.centerRight, child: AppText( - patient.nationalityName ?? - patient.nationality ?? - patient.nationalityId ?? - '', + patient.nationalityName ?? patient.nationality ?? patient.nationalityId ?? '', fontWeight: FontWeight.bold, fontSize: 12, ), @@ -277,9 +248,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget patient.nationalityFlagURL, height: 25, width: 30, - errorBuilder: (BuildContext context, - Object exception, - StackTrace stackTrace) { + errorBuilder: (BuildContext context, Object exception, StackTrace stackTrace) { return Text(''); }, )) @@ -299,19 +268,12 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget crossAxisAlignment: CrossAxisAlignment.start, children: [ HeaderRow( - label: patient.admissionDate == null - ? "" - : TranslationBase.of(context).admissionDate + - " : ", - value: patient.admissionDate == null - ? "" - : "${AppDateUtils.convertDateFromServerFormat(patient.admissionDate.toString(), 'yyyy-MM-dd')}"), + label: patient.admissionDate == null ? "" : TranslationBase.of(context).admissionDate + " : ", + value: patient.admissionDate == null ? "" : "${AppDateUtils.convertDateFromServerFormat(patient.admissionDate.toString(), 'yyyy-MM-dd')}"), if (patient.admissionDate != null) HeaderRow( - label: - "${TranslationBase.of(context).numOfDays}: ", - value: isDischargedPatient && - patient.dischargeDate != null + label: "${TranslationBase.of(context).numOfDays}: ", + value: isDischargedPatient && patient.dischargeDate != null ? "${AppDateUtils.getDateTimeFromServerFormat(patient.dischargeDate).difference(AppDateUtils.getDateTimeFromServerFormat(patient.admissionDate)).inDays + 1}" : "${DateTime.now().difference(AppDateUtils.getDateTimeFromServerFormat(patient.admissionDate)).inDays + 1}", ) @@ -336,13 +298,8 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget final startIndex = str.indexOf(start); final endIndex = str.indexOf(end, startIndex + start.length); - var date = new DateTime.fromMillisecondsSinceEpoch( - int.parse(str.substring(startIndex + start.length, endIndex))); - newDate = date.year.toString() + - "/" + - date.month.toString().padLeft(2, '0') + - "/" + - date.day.toString().padLeft(2, '0'); + var date = new DateTime.fromMillisecondsSinceEpoch(int.parse(str.substring(startIndex + start.length, endIndex))); + newDate = date.year.toString() + "/" + date.month.toString().padLeft(2, '0') + "/" + date.day.toString().padLeft(2, '0'); } return newDate ?? ''; @@ -350,8 +307,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget isToday(date) { DateTime tempDate = new DateFormat("yyyy-MM-dd").parse(date); - return DateFormat("yyyy-MM-dd").format(tempDate) == - DateFormat("yyyy-MM-dd").format(DateTime.now()); + return DateFormat("yyyy-MM-dd").format(tempDate) == DateFormat("yyyy-MM-dd").format(DateTime.now()); } myBoxDecoration() { diff --git a/pubspec.yaml b/pubspec.yaml index 9e8abe78..27cb655f 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -38,7 +38,7 @@ dependencies: # imei_plugin: ^1.2.0 # flutter_flexible_toast: ^0.1.4 fluttertoast: ^8.0.8 - local_auth: ^2.1.3 + local_auth: 1.1.8 http_interceptor: ^1.0.2 connectivity: ^3.0.6 @@ -71,7 +71,7 @@ dependencies: get_it: ^7.1.3 #chart - fl_chart: ^0.40.2 + fl_chart: ^0.45.0 # Firebase firebase_messaging: ^14.2.1 @@ -93,8 +93,8 @@ dependencies: file_picker: ^4.6.1 #speech to text -# speech_to_text: -# path: speech_to_text + # speech_to_text: + # path: speech_to_text speech_to_text: ^6.1.1 quiver: ^3.0.0 @@ -187,4 +187,4 @@ flutter: - asset: assets/fonts/DoctorApp.ttf # # For details regarding fonts from package dependencies, - # see https://flutter.dev/custom-fonts/#from-packages + # see https://flutter.dev/custom-fonts/#from-packages \ No newline at end of file From 73ce9d02b8712ebd4b481fdbc5ae17686c535407 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Thu, 18 May 2023 12:45:22 +0300 Subject: [PATCH 06/28] chart fixes --- .../vital_sign_item_details_screen.dart | 85 +++---------------- 1 file changed, 11 insertions(+), 74 deletions(-) diff --git a/lib/screens/patients/profile/vital_sign/vital_sign_item_details_screen.dart b/lib/screens/patients/profile/vital_sign/vital_sign_item_details_screen.dart index 1decdd4e..57a14675 100644 --- a/lib/screens/patients/profile/vital_sign/vital_sign_item_details_screen.dart +++ b/lib/screens/patients/profile/vital_sign/vital_sign_item_details_screen.dart @@ -1,11 +1,9 @@ import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/model/charts/app_time_series_chart.dart'; -import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; -import 'package:doctor_app_flutter/lookups/patient_lookup.dart'; import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/core/model/patient/vital_sign/patient-vital-sign-history.dart'; -import 'package:doctor_app_flutter/screens/patients/profile/vital_sign/LineChartCurvedBloodPressure.dart'; -import 'package:doctor_app_flutter/screens/patients/profile/vital_sign/line_chart_curved_blood_pressure.dart'; +import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; +import 'package:doctor_app_flutter/lookups/patient_lookup.dart'; import 'package:doctor_app_flutter/screens/patients/profile/vital_sign/vital_sign_detail_pain_scale.dart'; import 'package:doctor_app_flutter/screens/patients/profile/vital_sign/vital_sing_chart_and_detials.dart'; import 'package:doctor_app_flutter/screens/patients/profile/vital_sign/vital_sing_chart_blood_pressure.dart'; @@ -31,22 +29,13 @@ class VitalSignItemDetailsScreen extends StatelessWidget { final String viewKey1; final String viewKey2; - VitalSignItemDetailsScreen( - {this.vitalList, - this.pageKey, - @required this.viewKey1, - @required this.viewKey2, - this.pageTitle, - this.patient, - this.patientType, - this.arrivalType}); + VitalSignItemDetailsScreen({this.vitalList, this.pageKey, @required this.viewKey1, @required this.viewKey2, this.pageTitle, this.patient, this.patientType, this.arrivalType}); final List vitalList; @override Widget build(BuildContext context) { ProjectViewModel projectViewModel = Provider.of(context); - generateData(); switch (pageKey) { case vitalSignDetails.BodyMeasurements: VSchart = [ @@ -243,50 +232,24 @@ class VitalSignItemDetailsScreen extends StatelessWidget { return VitalSignDetailPainScale(vitalList); } - if (vitalListTemp.length != 0 && - chartInfo['viewKey'] == 'BloodPressure' || - chartInfo['viewKey'] == 'O2') { - // return LineChartCurvedBloodPressureNew( - // title: projectViewModel.isArabic - // ? chartInfo['nameAr'] - // : chartInfo['name'], - // timeSeries1: timeSeriesData1, - // timeSeries2: timeSeriesData2, - // indexes: timeSeriesData1.length ~/ 5.5, - // ); - + if (vitalListTemp.length != 0 && chartInfo['viewKey'] == 'BloodPressure' || chartInfo['viewKey'] == 'O2') { return VitalSingChartBloodPressure( vitalList: vitalList, - name: projectViewModel.isArabic - ? chartInfo['nameAr'] - : chartInfo['name'], + name: projectViewModel.isArabic ? chartInfo['nameAr'] : chartInfo['name'], title1: chartInfo['title1'], - title2: projectViewModel.isArabic - ? chartInfo['title2Ar'] - : chartInfo['title2'], - title3: projectViewModel.isArabic - ? chartInfo['title3Ar'] - : chartInfo['title3'], - viewKey1: chartInfo['viewKey'] == 'BloodPressure' - ? 'BloodPressureHigher' - : 'SAO2', - viewKey2: chartInfo['viewKey'] == 'BloodPressure' - ? 'BloodPressureLower' - : 'FIO2', + title2: projectViewModel.isArabic ? chartInfo['title2Ar'] : chartInfo['title2'], + title3: projectViewModel.isArabic ? chartInfo['title3Ar'] : chartInfo['title3'], + viewKey1: chartInfo['viewKey'] == 'BloodPressure' ? 'BloodPressureHigher' : 'SAO2', + viewKey2: chartInfo['viewKey'] == 'BloodPressure' ? 'BloodPressureLower' : 'FIO2', ); - } return vitalListTemp.length != 0 ? VitalSingChartAndDetials( vitalList: vitalList, - name: projectViewModel.isArabic - ? chartInfo['nameAr'] - : chartInfo['name'], + name: projectViewModel.isArabic ? chartInfo['nameAr'] : chartInfo['name'], title1: chartInfo['title1'], - title2: projectViewModel.isArabic - ? chartInfo['title2Ar'] - : chartInfo['title2'], + title2: projectViewModel.isArabic ? chartInfo['title2Ar'] : chartInfo['title2'], viewKey: chartInfo['viewKey']) : Container(); }).toList(), @@ -297,30 +260,4 @@ class VitalSignItemDetailsScreen extends StatelessWidget { ), ); } - - generateData() { - if (vitalList.length > 0) { - vitalList.reversed.toList().forEach( - (element) { - if (element.toJson()[viewKey1]?.toInt() != 0) - timeSeriesData1.add( - TimeSeriesSales2( - AppDateUtils.convertStringToDate(element.createdOn), - // new DateTime(element.vitalSignDate.year, element.vitalSignDate.month, element.vitalSignDate.day), - element.toJson()[viewKey1].toDouble(), - ), - ); - if (element.toJson()[viewKey2]?.toInt() != 0) - timeSeriesData2.add( - TimeSeriesSales2( - AppDateUtils.convertStringToDate(element.createdOn), - // new DateTime(element.vitalSignDate.year, element.vitalSignDate.month, element.vitalSignDate.day), - element.toJson()[viewKey2].toDouble(), - ), - ); - }, - ); - } - } - } From 3b3e911af392aa10942c1cfab7812f4cb4c3eeea Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Sun, 21 May 2023 11:58:01 +0300 Subject: [PATCH 07/28] Search medicine bug fixed --- .../prescription/medicine_service.dart | 2 +- lib/screens/medicine/medicine_search_screen.dart | 11 +++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/lib/core/service/patient_medical_file/prescription/medicine_service.dart b/lib/core/service/patient_medical_file/prescription/medicine_service.dart index cd61e783..567fd556 100644 --- a/lib/core/service/patient_medical_file/prescription/medicine_service.dart +++ b/lib/core/service/patient_medical_file/prescription/medicine_service.dart @@ -19,12 +19,12 @@ class MedicineService extends BaseService { PharmaciesListRequestModel _listRequestModel = PharmaciesListRequestModel(); Future getMedicineItem(String itemName) async { + _pharmacyItemsList.clear(); _itemsRequestModel.pHRItemName = itemName; searchText = itemName; await baseAppClient.post( PHARMACY_ITEMS_URL, onSuccess: (dynamic response, int statusCode) { - _pharmacyItemsList.clear(); _pharmacyItemsList = response['ListPharmcy_Region_enh']; }, onFailure: (String error, int statusCode) { diff --git a/lib/screens/medicine/medicine_search_screen.dart b/lib/screens/medicine/medicine_search_screen.dart index 67b8d6ca..b7e49ca5 100644 --- a/lib/screens/medicine/medicine_search_screen.dart +++ b/lib/screens/medicine/medicine_search_screen.dart @@ -70,11 +70,18 @@ class _MedicineSearchState extends State { }); } + + @override + void dispose() { + super.dispose(); + + } + @override Widget build(BuildContext context) { return BaseView(onModelReady: (model) async { }, builder: (_, model, w) { - myController.text = model.searchText; + // myController.text = model.searchText; return AppScaffold( // baseViewModel: model, isShowAppBar: true, @@ -86,7 +93,7 @@ class _MedicineSearchState extends State { mainAxisAlignment: MainAxisAlignment.start, children: [ SizedBox( - height: 20, + height: 10, ), AppTextFieldCustomSearch( hintText: From 92c665197d35f586524be83dbf02410a1c3af94d Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Wed, 24 May 2023 10:04:40 +0300 Subject: [PATCH 08/28] SetupID made dynamic --- lib/client/base_app_client.dart | 103 +++------ lib/config/shared_pref_kay.dart | 1 + ...on_code_for_doctor_app_response_model.dart | 2 +- lib/core/model/doctor/clinic_model.dart | 2 +- .../viewModel/authentication_view_model.dart | 206 +++++++----------- .../patient_sick_leave_screen.dart | 152 ++++--------- .../out_patient/out_patient_screen.dart | 77 +++---- 7 files changed, 175 insertions(+), 368 deletions(-) diff --git a/lib/client/base_app_client.dart b/lib/client/base_app_client.dart index 0218507f..d7619066 100644 --- a/lib/client/base_app_client.dart +++ b/lib/client/base_app_client.dart @@ -5,10 +5,10 @@ import 'dart:io' show Platform; import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; -import 'package:doctor_app_flutter/core/service/NavigationService.dart'; -import 'package:doctor_app_flutter/core/viewModel/authentication_view_model.dart'; import 'package:doctor_app_flutter/core/model/doctor/doctor_profile_model.dart'; import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/service/NavigationService.dart'; +import 'package:doctor_app_flutter/core/viewModel/authentication_view_model.dart'; import 'package:doctor_app_flutter/utils/dr_app_shared_pref.dart'; import 'package:doctor_app_flutter/utils/utils.dart'; import 'package:flutter/cupertino.dart'; @@ -47,14 +47,12 @@ class BaseAppClient { body['DoctorID'] = doctorProfile?.doctorID; } if (body['DoctorID'] == "") body['DoctorID'] = null; - if (body['EditedBy'] == null) - body['EditedBy'] = doctorProfile?.doctorID; + if (body['EditedBy'] == null) body['EditedBy'] = doctorProfile?.doctorID; if (body['ProjectID'] == null) { body['ProjectID'] = doctorProfile?.projectID; } - if (body['ClinicID'] == null) - body['ClinicID'] = doctorProfile?.clinicID; + if (body['ClinicID'] == null) body['ClinicID'] = doctorProfile?.clinicID; } else { String doctorID = await sharedPref.getString(DOCTOR_ID); if (body['DoctorID'] == '') { @@ -88,21 +86,16 @@ class BaseAppClient { body['IsLoginForDoctorApp'] = IS_LOGIN_FOR_DOCTOR_APP; body['PatientOutSA'] = body['PatientOutSA'] ?? 0; // PATIENT_OUT_SA; if (body['VidaAuthTokenID'] == null) { - body['VidaAuthTokenID'] = - await sharedPref.getString(VIDA_AUTH_TOKEN_ID); + body['VidaAuthTokenID'] = await sharedPref.getString(VIDA_AUTH_TOKEN_ID); } if (body['VidaRefreshTokenID'] == null) { - body['VidaRefreshTokenID'] = - await sharedPref.getString(VIDA_REFRESH_TOKEN_ID); + body['VidaRefreshTokenID'] = await sharedPref.getString(VIDA_REFRESH_TOKEN_ID); } int projectID = await sharedPref.getInt(PROJECT_ID); if (projectID == 2 || projectID == 3) body['PatientOutSA'] = true; - else if ((body.containsKey('facilityId') && body['facilityId'] == 2 || - body['facilityId'] == 3) || - body['ProjectID'] == 2 || - body['ProjectID'] == 3) + else if ((body.containsKey('facilityId') && body['facilityId'] == 2 || body['facilityId'] == 3) || body['ProjectID'] == 2 || body['ProjectID'] == 3) body['PatientOutSA'] = true; else body['PatientOutSA'] = false; @@ -113,29 +106,21 @@ class BaseAppClient { var asd = json.encode(body); var asd2; if (await Utils.checkConnection()) { - final response = await http.post(Uri.parse(url), - body: json.encode(body), - headers: { - 'Content-Type': 'application/json', - 'Accept': 'application/json' - }); + final response = await http.post(Uri.parse(url), body: json.encode(body), headers: {'Content-Type': 'application/json', 'Accept': 'application/json'}); final int statusCode = response.statusCode; if (statusCode < 200 || statusCode >= 400) { onFailure(Utils.generateContactAdminMsg(), statusCode); } else { var parsed = json.decode(response.body.toString()); if (parsed['ErrorType'] == 4) { - helpers.navigateToUpdatePage(parsed['ErrorEndUserMessage'], - parsed['AndroidLink'], parsed['IOSLink']); + helpers.navigateToUpdatePage(parsed['ErrorEndUserMessage'], parsed['AndroidLink'], parsed['IOSLink']); } if (parsed['IsAuthenticated'] != null && !parsed['IsAuthenticated']) { if (body['OTP_SendType'] != null) { onFailure(getError(parsed), statusCode); } else if (!isAllowAny) { - await Provider.of(AppGlobal.CONTEX, - listen: false) - .logout(); + await Provider.of(AppGlobal.CONTEX, listen: false).logout(); Utils.showErrorToast('Your session expired Please login again'); locator().pushNamedAndRemoveUntil(ROOT); @@ -170,10 +155,7 @@ class BaseAppClient { String url = BASE_URL + endPoint; try { - Map headers = { - 'Content-Type': 'application/json', - 'Accept': 'application/json' - }; + Map headers = {'Content-Type': 'application/json', 'Accept': 'application/json'}; String token = await sharedPref.getString(TOKEN); Map profile = await sharedPref.getObj(DOCTOR_PROFILE); @@ -184,13 +166,12 @@ class BaseAppClient { body['DoctorID'] = doctorProfile?.doctorID; } } - var languageID = - await sharedPref.getStringWithDefaultValue(APP_Language, 'en'); + var languageID = await sharedPref.getStringWithDefaultValue(APP_Language, 'en'); body['SetupID'] = body.containsKey('SetupID') ? body['SetupID'] != null ? body['SetupID'] - : SETUP_ID - : SETUP_ID; + : await sharedPref.getString(DOCTOR_SETUP_ID) + : await sharedPref.getString(DOCTOR_SETUP_ID); body['VersionID'] = VERSION_ID; body['Channel'] = CHANNEL; @@ -205,12 +186,11 @@ class BaseAppClient { : PATIENT_OUT_SA_PATIENT_REQ; if (body.containsKey('isDentalAllowedBackend')) { - body['isDentalAllowedBackend'] = - body.containsKey('isDentalAllowedBackend') - ? body['isDentalAllowedBackend'] != null - ? body['isDentalAllowedBackend'] - : IS_DENTAL_ALLOWED_BACKEND - : IS_DENTAL_ALLOWED_BACKEND; + body['isDentalAllowedBackend'] = body.containsKey('isDentalAllowedBackend') + ? body['isDentalAllowedBackend'] != null + ? body['isDentalAllowedBackend'] + : IS_DENTAL_ALLOWED_BACKEND + : IS_DENTAL_ALLOWED_BACKEND; } body['DeviceTypeID'] = Platform.isAndroid ? 1 : 2; @@ -231,10 +211,8 @@ class BaseAppClient { : PATIENT_TYPE_ID : PATIENT_TYPE_ID; - body['TokenID'] = body.containsKey('TokenID') ? body['TokenID']??token : token; - body['PatientID'] = body['PatientID'] != null - ? body['PatientID'] - : patient.patientId ?? patient.patientMRN; + body['TokenID'] = body.containsKey('TokenID') ? body['TokenID'] ?? token : token; + body['PatientID'] = body['PatientID'] != null ? body['PatientID'] : patient.patientId ?? patient.patientMRN; body['PatientOutSA'] = 0; //user['OutSA']; //TODO change it body['SessionID'] = SESSION_ID; //getSe @@ -250,8 +228,7 @@ class BaseAppClient { var asd = json.encode(body); var asd2; if (await Utils.checkConnection()) { - final response = await http.post(Uri.parse(url.trim()), - body: json.encode(body), headers: headers); + final response = await http.post(Uri.parse(url.trim()), body: json.encode(body), headers: headers); final int statusCode = response.statusCode; print("statusCode :$statusCode"); if (statusCode < 200 || statusCode >= 400 || json == null) { @@ -263,8 +240,7 @@ class BaseAppClient { onSuccess(parsed, statusCode); } else { if (parsed['ErrorType'] == 4) { - helpers.navigateToUpdatePage(parsed['ErrorEndUserMessage'], - parsed['AndroidLink'], parsed['IOSLink']); + helpers.navigateToUpdatePage(parsed['ErrorEndUserMessage'], parsed['AndroidLink'], parsed['IOSLink']); } if (parsed['IsAuthenticated'] == null) { if (parsed['isSMSSent'] == true) { @@ -280,28 +256,20 @@ class BaseAppClient { onFailure(getError(parsed), statusCode); } } - } else if (parsed['MessageStatus'] == 1 || - parsed['SMSLoginRequired'] == true) { + } else if (parsed['MessageStatus'] == 1 || parsed['SMSLoginRequired'] == true) { onSuccess(parsed, statusCode); - } else if (parsed['MessageStatus'] == 2 && - parsed['IsAuthenticated']) { + } else if (parsed['MessageStatus'] == 2 && parsed['IsAuthenticated']) { if (parsed['SameClinicApptList'] != null) { onSuccess(parsed, statusCode); } else { - if (parsed['message'] == null && - parsed['ErrorEndUserMessage'] == null) { + if (parsed['message'] == null && parsed['ErrorEndUserMessage'] == null) { if (parsed['ErrorSearchMsg'] == null) { - onFailure("Server Error found with no available message", - statusCode); + onFailure("Server Error found with no available message", statusCode); } else { onFailure(parsed['ErrorSearchMsg'], statusCode); } } else { - onFailure( - parsed['message'] ?? - parsed['ErrorEndUserMessage'] ?? - parsed['ErrorMessage'], - statusCode); + onFailure(parsed['message'] ?? parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], statusCode); } } } else { @@ -311,9 +279,7 @@ class BaseAppClient { if (parsed['message'] != null) { onFailure(parsed['message'] ?? parsed['message'], statusCode); } else { - onFailure( - parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], - statusCode); + onFailure(parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], statusCode); } } } @@ -334,14 +300,9 @@ class BaseAppClient { if (parsed["ValidationErrors"] != null) { error = parsed["ValidationErrors"]["StatusMessage"].toString() + "\n"; - if (parsed["ValidationErrors"]["ValidationErrors"] != null && - parsed["ValidationErrors"]["ValidationErrors"].length != 0) { - for (var i = 0; - i < parsed["ValidationErrors"]["ValidationErrors"].length; - i++) { - error = error + - parsed["ValidationErrors"]["ValidationErrors"][i]["Messages"][0] + - "\n"; + if (parsed["ValidationErrors"]["ValidationErrors"] != null && parsed["ValidationErrors"]["ValidationErrors"].length != 0) { + for (var i = 0; i < parsed["ValidationErrors"]["ValidationErrors"].length; i++) { + error = error + parsed["ValidationErrors"]["ValidationErrors"][i]["Messages"][0] + "\n"; } } } diff --git a/lib/config/shared_pref_kay.dart b/lib/config/shared_pref_kay.dart index 628f5a0e..a3656328 100644 --- a/lib/config/shared_pref_kay.dart +++ b/lib/config/shared_pref_kay.dart @@ -14,3 +14,4 @@ const DASHBOARD_DATA = 'dashboard-data'; const OTP_TYPE = 'otp-type'; const LAST_LOGIN_USER = 'last-login-user'; const CLINIC_NAME = 'clinic-name'; +const DOCTOR_SETUP_ID = 'doctor-setup-id'; diff --git a/lib/core/model/auth/check_activation_code_for_doctor_app_response_model.dart b/lib/core/model/auth/check_activation_code_for_doctor_app_response_model.dart index 6fb7eb70..1bb10d1f 100644 --- a/lib/core/model/auth/check_activation_code_for_doctor_app_response_model.dart +++ b/lib/core/model/auth/check_activation_code_for_doctor_app_response_model.dart @@ -60,7 +60,7 @@ class CheckActivationCodeForDoctorAppResponseModel { } class ListDoctorsClinic { - Null setupID; + String setupID; int projectID; int doctorID; int clinicID; diff --git a/lib/core/model/doctor/clinic_model.dart b/lib/core/model/doctor/clinic_model.dart index e5eb8eee..4ea7636c 100644 --- a/lib/core/model/doctor/clinic_model.dart +++ b/lib/core/model/doctor/clinic_model.dart @@ -6,7 +6,7 @@ *@desc: Clinic Model */ class ClinicModel { - Null setupID; + String setupID; int projectID; int doctorID; int clinicID; diff --git a/lib/core/viewModel/authentication_view_model.dart b/lib/core/viewModel/authentication_view_model.dart index d17cb661..9c900eac 100644 --- a/lib/core/viewModel/authentication_view_model.dart +++ b/lib/core/viewModel/authentication_view_model.dart @@ -11,22 +11,23 @@ import 'package:doctor_app_flutter/core/model/auth/imei_details.dart'; import 'package:doctor_app_flutter/core/model/auth/insert_imei_model.dart'; import 'package:doctor_app_flutter/core/model/auth/new_login_information_response_model.dart'; import 'package:doctor_app_flutter/core/model/auth/send_activation_code_for_doctor_app_response_model.dart'; +import 'package:doctor_app_flutter/core/model/doctor/clinic_model.dart'; +import 'package:doctor_app_flutter/core/model/doctor/doctor_profile_model.dart'; +import 'package:doctor_app_flutter/core/model/doctor/profile_req_Model.dart'; +import 'package:doctor_app_flutter/core/model/doctor/user_model.dart'; import 'package:doctor_app_flutter/core/model/hospitals/get_hospitals_request_model.dart'; import 'package:doctor_app_flutter/core/model/hospitals/get_hospitals_response_model.dart'; import 'package:doctor_app_flutter/core/service/authentication_service.dart'; import 'package:doctor_app_flutter/core/service/hospitals/hospitals_service.dart'; import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart'; import 'package:doctor_app_flutter/locator.dart'; -import 'package:doctor_app_flutter/core/model/doctor/clinic_model.dart'; -import 'package:doctor_app_flutter/core/model/doctor/doctor_profile_model.dart'; -import 'package:doctor_app_flutter/core/model/doctor/profile_req_Model.dart'; -import 'package:doctor_app_flutter/core/model/doctor/user_model.dart'; import 'package:doctor_app_flutter/utils/dr_app_toast_msg.dart'; -import 'package:doctor_app_flutter/utils/utils.dart'; import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; +import 'package:doctor_app_flutter/utils/utils.dart'; import 'package:firebase_messaging/firebase_messaging.dart'; import 'package:flutter/services.dart'; import 'package:local_auth/auth_strings.dart'; + // import 'package:huawei_hmsavailability/huawei_hmsavailability.dart'; // import 'package:local_auth/auth_strings.dart'; import 'package:local_auth/local_auth.dart'; @@ -43,20 +44,13 @@ class AuthenticationViewModel extends BaseViewModel { NewLoginInformationModel get loginInfo => _authService.loginInfo; - List get doctorProfilesList => - _authService.doctorProfilesList; + List get doctorProfilesList => _authService.doctorProfilesList; - SendActivationCodeForDoctorAppResponseModel - get activationCodeVerificationScreenRes => - _authService.activationCodeVerificationScreenRes; + SendActivationCodeForDoctorAppResponseModel get activationCodeVerificationScreenRes => _authService.activationCodeVerificationScreenRes; - SendActivationCodeForDoctorAppResponseModel - get activationCodeForDoctorAppRes => - _authService.activationCodeForDoctorAppRes; + SendActivationCodeForDoctorAppResponseModel get activationCodeForDoctorAppRes => _authService.activationCodeForDoctorAppRes; - CheckActivationCodeForDoctorAppResponseModel - get checkActivationCodeForDoctorAppRes => - _authService.checkActivationCodeForDoctorAppRes; + CheckActivationCodeForDoctorAppResponseModel get checkActivationCodeForDoctorAppRes => _authService.checkActivationCodeForDoctorAppRes; NewLoginInformationModel loggedUser; GetIMEIDetailsModel user; @@ -91,32 +85,20 @@ class AuthenticationViewModel extends BaseViewModel { profileInfo['IMEI'] = token; profileInfo['LogInTypeID'] = await sharedPref.getInt(OTP_TYPE); profileInfo['BioMetricEnabled'] = true; - profileInfo['MobileNo'] = - loggedIn != null ? loggedIn['MobileNumber'] : user.mobile; - InsertIMEIDetailsModel insertIMEIDetailsModel = - InsertIMEIDetailsModel.fromJson(profileInfo); - insertIMEIDetailsModel.genderDescription = - profileInfo['Gender_Description']; - insertIMEIDetailsModel.genderDescriptionN = - profileInfo['Gender_DescriptionN']; - insertIMEIDetailsModel.genderDescriptionN = - profileInfo['Gender_DescriptionN']; + profileInfo['MobileNo'] = loggedIn != null ? loggedIn['MobileNumber'] : user.mobile; + InsertIMEIDetailsModel insertIMEIDetailsModel = InsertIMEIDetailsModel.fromJson(profileInfo); + insertIMEIDetailsModel.genderDescription = profileInfo['Gender_Description']; + insertIMEIDetailsModel.genderDescriptionN = profileInfo['Gender_DescriptionN']; + insertIMEIDetailsModel.genderDescriptionN = profileInfo['Gender_DescriptionN']; insertIMEIDetailsModel.titleDescription = profileInfo['Title_Description']; - insertIMEIDetailsModel.titleDescriptionN = - profileInfo['Title_DescriptionN']; + insertIMEIDetailsModel.titleDescriptionN = profileInfo['Title_DescriptionN']; insertIMEIDetailsModel.projectID = await sharedPref.getInt(PROJECT_ID); - insertIMEIDetailsModel.doctorID = loggedIn != null - ? loggedIn['List_MemberInformation'][0]['MemberID'] - : user.doctorID; - insertIMEIDetailsModel.outSA = - loggedIn != null ? loggedIn['PatientOutSA'] : user.outSA; - insertIMEIDetailsModel.vidaAuthTokenID = - await sharedPref.getString(VIDA_AUTH_TOKEN_ID); - insertIMEIDetailsModel.vidaRefreshTokenID = - await sharedPref.getString(VIDA_REFRESH_TOKEN_ID); + insertIMEIDetailsModel.doctorID = loggedIn != null ? loggedIn['List_MemberInformation'][0]['MemberID'] : user.doctorID; + insertIMEIDetailsModel.outSA = loggedIn != null ? loggedIn['PatientOutSA'] : user.outSA; + insertIMEIDetailsModel.vidaAuthTokenID = await sharedPref.getString(VIDA_AUTH_TOKEN_ID); + insertIMEIDetailsModel.vidaRefreshTokenID = await sharedPref.getString(VIDA_REFRESH_TOKEN_ID); insertIMEIDetailsModel.password = userInfo.password; - insertIMEIDetailsModel.loginDoctorID = loggedUser != null ? loggedUser.listMemberInformation[0].employeeID - : int.parse(user.editedBy.toString()); + insertIMEIDetailsModel.loginDoctorID = loggedUser != null ? loggedUser.listMemberInformation[0].employeeID : int.parse(user.editedBy.toString()); await _authService.insertDeviceImei(insertIMEIDetailsModel); if (_authService.hasError) { @@ -144,25 +126,22 @@ class AuthenticationViewModel extends BaseViewModel { } /// send activation code for for msg methods - Future sendActivationCodeVerificationScreen( - AuthMethodTypes authMethodType) async { + Future sendActivationCodeVerificationScreen(AuthMethodTypes authMethodType) async { setState(ViewState.BusyLocal); - ActivationCodeForVerificationScreenModel activationCodeModel = - ActivationCodeForVerificationScreenModel( - iMEI: user.iMEI, - facilityId: user.projectID, - memberID: user.doctorID, - loginDoctorID: int.parse(user.editedBy.toString()), - zipCode: user.outSA == true ? '971' : '966', - mobileNumber: user.mobile, - oTPSendType: authMethodType.getTypeIdService(), - isMobileFingerPrint: 1, - vidaAuthTokenID: user.vidaAuthTokenID, - vidaRefreshTokenID: user.vidaRefreshTokenID); + ActivationCodeForVerificationScreenModel activationCodeModel = ActivationCodeForVerificationScreenModel( + iMEI: user.iMEI, + facilityId: user.projectID, + memberID: user.doctorID, + loginDoctorID: int.parse(user.editedBy.toString()), + zipCode: user.outSA == true ? '971' : '966', + mobileNumber: user.mobile, + oTPSendType: authMethodType.getTypeIdService(), + isMobileFingerPrint: 1, + vidaAuthTokenID: user.vidaAuthTokenID, + vidaRefreshTokenID: user.vidaRefreshTokenID); await sharedPref.setString(DOCTOR_ID, user.editedBy.toString()); - await _authService - .sendActivationCodeVerificationScreen(activationCodeModel); + await _authService.sendActivationCodeVerificationScreen(activationCodeModel); if (_authService.hasError) { error = _authService.error; setState(ViewState.ErrorLocal); @@ -171,8 +150,7 @@ class AuthenticationViewModel extends BaseViewModel { } /// send activation code for silent login - Future sendActivationCodeForDoctorApp( - {AuthMethodTypes authMethodType, String password}) async { + Future sendActivationCodeForDoctorApp({AuthMethodTypes authMethodType, String password}) async { setState(ViewState.BusyLocal); int projectID = await sharedPref.getInt(PROJECT_ID); ActivationCodeModel activationCodeModel = ActivationCodeModel( @@ -187,57 +165,45 @@ class AuthenticationViewModel extends BaseViewModel { error = _authService.error; setState(ViewState.ErrorLocal); } else { - await sharedPref.setString( - TOKEN, _authService.activationCodeForDoctorAppRes.logInTokenID); + await sharedPref.setString(TOKEN, _authService.activationCodeForDoctorAppRes.logInTokenID); setState(ViewState.Idle); } } /// check activation code for sms and whats app - Future checkActivationCodeForDoctorApp( - {String activationCode, bool isSilentLogin = false}) async { + Future checkActivationCodeForDoctorApp({String activationCode, bool isSilentLogin = false}) async { setState(ViewState.BusyLocal); - CheckActivationCodeRequestModel checkActivationCodeForDoctorApp = - new CheckActivationCodeRequestModel( - zipCode: loggedUser != null ? loggedUser.zipCode : user.zipCode, - mobileNumber: - loggedUser != null ? loggedUser.mobileNumber : user.mobile, - projectID: await sharedPref.getInt(PROJECT_ID) != null - ? await sharedPref.getInt(PROJECT_ID) - : user.projectID, - logInTokenID: await sharedPref.getString(TOKEN), - activationCode: activationCode ?? '0000', - memberID: userInfo.userID != null - ? int.parse(userInfo.userID) - : user.doctorID, - password: userInfo.password, - facilityId: userInfo.projectID != null - ? userInfo.projectID.toString() - : user.projectID.toString(), - oTPSendType: await sharedPref.getInt(OTP_TYPE), - iMEI: localToken, - loginDoctorID: loggedUser != null ? loggedUser.listMemberInformation[0].employeeID - : int.parse(user.editedBy.toString()),///loggedUser.listMemberInformation[0].employeeID, - // loggedUser.listMemberInformation[0].employeeID, - isForSilentLogin: isSilentLogin, - generalid: "Cs2020@2016\$2958"); - await _authService - .checkActivationCodeForDoctorApp(checkActivationCodeForDoctorApp); + CheckActivationCodeRequestModel checkActivationCodeForDoctorApp = new CheckActivationCodeRequestModel( + zipCode: loggedUser != null ? loggedUser.zipCode : user.zipCode, + mobileNumber: loggedUser != null ? loggedUser.mobileNumber : user.mobile, + projectID: await sharedPref.getInt(PROJECT_ID) != null ? await sharedPref.getInt(PROJECT_ID) : user.projectID, + logInTokenID: await sharedPref.getString(TOKEN), + activationCode: activationCode ?? '0000', + memberID: userInfo.userID != null ? int.parse(userInfo.userID) : user.doctorID, + password: userInfo.password, + facilityId: userInfo.projectID != null ? userInfo.projectID.toString() : user.projectID.toString(), + oTPSendType: await sharedPref.getInt(OTP_TYPE), + iMEI: localToken, + loginDoctorID: loggedUser != null ? loggedUser.listMemberInformation[0].employeeID : int.parse(user.editedBy.toString()), + + ///loggedUser.listMemberInformation[0].employeeID, + // loggedUser.listMemberInformation[0].employeeID, + isForSilentLogin: isSilentLogin, + generalid: "Cs2020@2016\$2958"); + await _authService.checkActivationCodeForDoctorApp(checkActivationCodeForDoctorApp); if (_authService.hasError) { error = _authService.error; setState(ViewState.ErrorLocal); } else { - await setDataAfterSendActivationSuccess( - checkActivationCodeForDoctorAppRes); + await setDataAfterSendActivationSuccess(checkActivationCodeForDoctorAppRes); setState(ViewState.Idle); } } /// get list of Hospitals Future getHospitalsList(memberID) async { - GetHospitalsRequestModel getHospitalsRequestModel = - GetHospitalsRequestModel(); + GetHospitalsRequestModel getHospitalsRequestModel = GetHospitalsRequestModel(); getHospitalsRequestModel.memberID = memberID; getHospitalsRequestModel.doctorID = memberID; await _hospitalsService.getHospitals(getHospitalsRequestModel); @@ -269,17 +235,13 @@ class AuthenticationViewModel extends BaseViewModel { } } - /// add  token to shared preferences in case of send activation code is success - setDataAfterSendActivationSuccess( - CheckActivationCodeForDoctorAppResponseModel - sendActivationCodeForDoctorAppResponseModel) async { + /// add token to shared preferences in case of send activation code is success + setDataAfterSendActivationSuccess(CheckActivationCodeForDoctorAppResponseModel sendActivationCodeForDoctorAppResponseModel) async { // print("VerificationCode : " + sendActivationCodeForDoctorAppResponseModel.verificationCode); - await sharedPref.setString(VIDA_AUTH_TOKEN_ID, - sendActivationCodeForDoctorAppResponseModel.vidaAuthTokenID); - await sharedPref.setString(VIDA_REFRESH_TOKEN_ID, - sendActivationCodeForDoctorAppResponseModel.vidaRefreshTokenID); - await sharedPref.setString(TOKEN, - sendActivationCodeForDoctorAppResponseModel.authenticationTokenID); + await sharedPref.setString(DOCTOR_SETUP_ID, sendActivationCodeForDoctorAppResponseModel.listDoctorsClinic[0].setupID); + await sharedPref.setString(VIDA_AUTH_TOKEN_ID, sendActivationCodeForDoctorAppResponseModel.vidaAuthTokenID); + await sharedPref.setString(VIDA_REFRESH_TOKEN_ID, sendActivationCodeForDoctorAppResponseModel.vidaRefreshTokenID); + await sharedPref.setString(TOKEN, sendActivationCodeForDoctorAppResponseModel.authenticationTokenID); } saveObjToString(String key, value) async { @@ -288,18 +250,10 @@ class AuthenticationViewModel extends BaseViewModel { /// ask user to add his biometric showIOSAuthMessages() async { - const iosStrings = const IOSAuthMessages( - cancelButton: 'cancel', - goToSettingsButton: 'settings', - goToSettingsDescription: 'Please set up your Touch ID.', - lockOut: 'Please Enable Your Touch ID'); + const iosStrings = const IOSAuthMessages(cancelButton: 'cancel', goToSettingsButton: 'settings', goToSettingsDescription: 'Please set up your Touch ID.', lockOut: 'Please Enable Your Touch ID'); try { - await auth.authenticateWithBiometrics( - localizedReason: 'Scan your fingerprint to authenticate', - useErrorDialogs: true, - stickyAuth: true, - iOSAuthStrings: iosStrings); + await auth.authenticateWithBiometrics(localizedReason: 'Scan your fingerprint to authenticate', useErrorDialogs: true, stickyAuth: true, iOSAuthStrings: iosStrings); } on PlatformException catch (e) { DrAppToastMsg.showErrorToast(e.toString()); } @@ -312,12 +266,7 @@ class AuthenticationViewModel extends BaseViewModel { /// get doctor profile based on clinic model Future getDoctorProfileBasedOnClinic(ClinicModel clinicInfo) async { - ProfileReqModel docInfo = new ProfileReqModel( - doctorID: clinicInfo.doctorID, - clinicID: clinicInfo.clinicID, - license: true, - projectID: clinicInfo.projectID, - languageID: 2); + ProfileReqModel docInfo = new ProfileReqModel(doctorID: clinicInfo.doctorID, clinicID: clinicInfo.clinicID, license: true, projectID: clinicInfo.projectID, languageID: 2); ///TODO change the lan await _authService.getDoctorProfileBasedOnClinic(docInfo); @@ -332,17 +281,12 @@ class AuthenticationViewModel extends BaseViewModel { /// add some logic in case of check activation code is success onCheckActivationCodeSuccess({bool isSilentLogin = false}) async { - sharedPref.setString( - TOKEN, checkActivationCodeForDoctorAppRes.authenticationTokenID); - if (checkActivationCodeForDoctorAppRes.listDoctorProfile != null && - checkActivationCodeForDoctorAppRes.listDoctorProfile.isNotEmpty) { - localSetDoctorProfile( - checkActivationCodeForDoctorAppRes.listDoctorProfile[0]); + sharedPref.setString(TOKEN, checkActivationCodeForDoctorAppRes.authenticationTokenID); + if (checkActivationCodeForDoctorAppRes.listDoctorProfile != null && checkActivationCodeForDoctorAppRes.listDoctorProfile.isNotEmpty) { + localSetDoctorProfile(checkActivationCodeForDoctorAppRes.listDoctorProfile[0]); } else { - sharedPref.setObj( - CLINIC_NAME, checkActivationCodeForDoctorAppRes.listDoctorsClinic); - ClinicModel clinic = ClinicModel.fromJson( - checkActivationCodeForDoctorAppRes.listDoctorsClinic[0].toJson()); + sharedPref.setObj(CLINIC_NAME, checkActivationCodeForDoctorAppRes.listDoctorsClinic); + ClinicModel clinic = ClinicModel.fromJson(checkActivationCodeForDoctorAppRes.listDoctorsClinic[0].toJson()); await getDoctorProfileBasedOnClinic(clinic); } } @@ -387,7 +331,7 @@ class AuthenticationViewModel extends BaseViewModel { setState(ViewState.Busy); try { token = await _firebaseMessaging.getToken(); - } catch(ex) { + } catch (ex) { print(ex); } @@ -401,10 +345,8 @@ class AuthenticationViewModel extends BaseViewModel { } else { if (_authService.dashboardItemsList.length > 0) { user = _authService.dashboardItemsList[0]; - sharedPref.setObj( - LAST_LOGIN_USER, _authService.dashboardItemsList[0]); - await sharedPref.setString( - VIDA_REFRESH_TOKEN_ID, user.vidaRefreshTokenID); + sharedPref.setObj(LAST_LOGIN_USER, _authService.dashboardItemsList[0]); + await sharedPref.setString(VIDA_REFRESH_TOKEN_ID, user.vidaRefreshTokenID); await sharedPref.setString(VIDA_AUTH_TOKEN_ID, user.vidaAuthTokenID); this.unverified = true; } diff --git a/lib/screens/patient-sick-leave/patient_sick_leave_screen.dart b/lib/screens/patient-sick-leave/patient_sick_leave_screen.dart index 2c0a406c..0e5873df 100644 --- a/lib/screens/patient-sick-leave/patient_sick_leave_screen.dart +++ b/lib/screens/patient-sick-leave/patient_sick_leave_screen.dart @@ -1,16 +1,16 @@ import 'package:cached_network_image/cached_network_image.dart'; import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/core/model/sick_leave/sick_leave_patient_model.dart'; import 'package:doctor_app_flutter/core/service/AnalyticsService.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/sick_leave_view_model.dart'; import 'package:doctor_app_flutter/locator.dart'; -import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/patient-sick-leave/add_patient_sick_leave_screen.dart'; import 'package:doctor_app_flutter/utils/date-utils.dart'; -import 'package:doctor_app_flutter/utils/utils.dart'; import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; +import 'package:doctor_app_flutter/utils/utils.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/add-order/addNewOrder.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-profile-app-bar.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; @@ -64,18 +64,14 @@ class PatientSickLeaveScreen extends StatelessWidget { if (!projectsProvider.isArabic) AppText( TranslationBase.of(context).patient, - fontSize: - SizeConfig.getTextMultiplierBasedOnWidth() * - (SizeConfig.isWidthLarge ? 3 : 4), + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * (SizeConfig.isWidthLarge ? 3 : 4), fontWeight: FontWeight.w700, letterSpacing: -0.72, color: Color(0xFF2E303A), ), AppText( TranslationBase.of(context).sickLeave, - fontSize: - SizeConfig.getTextMultiplierBasedOnWidth() * - (SizeConfig.isWidthLarge ? 6 : 6), + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * (SizeConfig.isWidthLarge ? 6 : 6), fontWeight: FontWeight.bold, letterSpacing: -1.44, color: Color(0xFF2E303A), @@ -105,8 +101,7 @@ class PatientSickLeaveScreen extends StatelessWidget { shrinkWrap: true, itemCount: model.getAllSIckLeavePatient.length, itemBuilder: (BuildContext ctxt, int index) { - SickLeavePatientModel item = - model.getAllSIckLeavePatient[index]; + SickLeavePatientModel item = model.getAllSIckLeavePatient[index]; return Column( children: [ CardWithBgWidget( @@ -122,42 +117,31 @@ class PatientSickLeaveScreen extends StatelessWidget { child: Column( children: [ if (item.doctorName != null) - Row( - crossAxisAlignment: - CrossAxisAlignment.start, - mainAxisAlignment: - MainAxisAlignment.start, - children: [ - Expanded( - // width: MediaQuery.of(context).size.width*0.51, - child: AppText( - Utils.capitalize( - item.doctorName ?? ""), - fontSize: 18, - color: Color(0xff2e303a), - fontWeight: FontWeight.w700, - fontFamily: 'Poppins', - textOverflow: - TextOverflow.ellipsis, - ), - ), - ]), + Row(crossAxisAlignment: CrossAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start, children: [ + Expanded( + // width: MediaQuery.of(context).size.width*0.51, + child: AppText( + Utils.capitalize(item.doctorName ?? ""), + fontSize: 18, + color: Color(0xff2e303a), + fontWeight: FontWeight.w700, + fontFamily: 'Poppins', + textOverflow: TextOverflow.ellipsis, + ), + ), + ]), SizedBox( height: 10, ), Row( children: [ ClipRRect( - borderRadius: - BorderRadius.circular(50.0), + borderRadius: BorderRadius.circular(50.0), child: CachedNetworkImage( - imageUrl: item.doctorImageURL ?? - "https://hmgwebservices.com/Images/MobileImages/DUBAI/unkown.png", + imageUrl: item.doctorImageURL ?? "https://hmgwebservices.com/Images/MobileImages/DUBAI/unkown.png", height: 30, width: 30, - errorWidget: - (context, url, error) => - AppText( + errorWidget: (context, url, error) => AppText( 'No Image', fontSize: 10, ), @@ -170,90 +154,36 @@ class PatientSickLeaveScreen extends StatelessWidget { child: Column( children: [ CustomRow( - label: TranslationBase.of( - context) - .daysSickleave, - labelSize: SizeConfig - .getTextMultiplierBasedOnWidth() * - 3.3, - valueSize: SizeConfig - .getTextMultiplierBasedOnWidth() * - 4, - value: (item.sickLeaveDays - .toString() != - null && - item.sickLeaveDays - .toString() != - "null") - ? item.sickLeaveDays - .toString() - : item.noOfDays - .toString(), + label: TranslationBase.of(context).daysSickleave, + labelSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.3, + valueSize: SizeConfig.getTextMultiplierBasedOnWidth() * 4, + value: + (item.sickLeaveDays.toString() != null && item.sickLeaveDays.toString() != "null") ? item.sickLeaveDays.toString() : item.noOfDays.toString(), ), CustomRow( - label: TranslationBase.of( - context) - .startDate + - ' ' ?? - "", - labelSize: SizeConfig - .getTextMultiplierBasedOnWidth() * - 3.3, - valueSize: SizeConfig - .getTextMultiplierBasedOnWidth() * - 4, - value: AppDateUtils - .getDayMonthYearDateFormatted( - item.startDate.contains( - "/Date(") - ? AppDateUtils - .convertStringToDate( - item - .startDate) - : DateTime.parse( - item.startDate), + label: TranslationBase.of(context).startDate + ' ' ?? "", + labelSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.3, + valueSize: SizeConfig.getTextMultiplierBasedOnWidth() * 4, + value: AppDateUtils.getDayMonthYearDateFormatted( + item.startDate.contains("/Date(") ? AppDateUtils.convertStringToDate(item.startDate) : DateTime.parse(item.startDate), ), ), CustomRow( - label: TranslationBase.of( - context) - .endDate + - ' ' ?? - "", - labelSize: SizeConfig - .getTextMultiplierBasedOnWidth() * - 3.3, - valueSize: SizeConfig - .getTextMultiplierBasedOnWidth() * - 4, - value: AppDateUtils - .getDayMonthYearDateFormatted( - item.startDate.contains( - "/Date(") - ? AppDateUtils - .convertStringToDate( - item.endDate ?? - "") - .add( - Duration( - days: item - .noOfDays ?? - item.sickLeaveDays), + label: TranslationBase.of(context).endDate + ' ' ?? "", + labelSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.3, + valueSize: SizeConfig.getTextMultiplierBasedOnWidth() * 4, + value: AppDateUtils.getDayMonthYearDateFormatted( + item.startDate.contains("/Date(") + ? AppDateUtils.convertStringToDate(item.endDate ?? "").add( + Duration(days: item.noOfDays ?? item.sickLeaveDays), ) - : DateTime.parse( - item.startDate ?? - "") - .add( - Duration( - days: - item.noOfDays ?? - ""), + : DateTime.parse(item.startDate ?? "").add( + Duration(days: item.noOfDays ?? ""), ), ), ), ], - crossAxisAlignment: - CrossAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, ), ), ], diff --git a/lib/screens/patients/out_patient/out_patient_screen.dart b/lib/screens/patients/out_patient/out_patient_screen.dart index 733ba1a1..59d6298b 100644 --- a/lib/screens/patients/out_patient/out_patient_screen.dart +++ b/lib/screens/patients/out_patient/out_patient_screen.dart @@ -1,12 +1,12 @@ import 'package:doctor_app_flutter/core/enum/filter_type.dart'; import 'package:doctor_app_flutter/core/enum/patient_type.dart'; import 'package:doctor_app_flutter/core/enum/view_state.dart'; +import 'package:doctor_app_flutter/core/model/patient/patient_model.dart'; import 'package:doctor_app_flutter/core/model/patient_muse/PatientSearchRequestModel.dart'; import 'package:doctor_app_flutter/core/viewModel/PatientSearchViewModel.dart'; import 'package:doctor_app_flutter/core/viewModel/authentication_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; -import 'package:doctor_app_flutter/core/model/patient/patient_model.dart'; import 'package:doctor_app_flutter/routes.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/patients/patient_search/patient_search_header.dart'; @@ -20,6 +20,7 @@ import 'package:doctor_app_flutter/widgets/shared/text_fields/app_text_field_cus import 'package:flutter/material.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart'; import 'package:provider/provider.dart'; + import 'filter_date_page.dart'; // ignore: must_be_immutable @@ -107,8 +108,7 @@ class _OutPatientsScreenState extends State { mainAxisSize: MainAxisSize.max, crossAxisAlignment: CrossAxisAlignment.center, children: _times.map((item) { - bool _isActive = - _times[_activeLocation] == item ? true : false; + bool _isActive = _times[_activeLocation] == item ? true : false; return Expanded( child: InkWell( @@ -128,8 +128,7 @@ class _OutPatientsScreenState extends State { await model.getPatientBasedOnDate( item: item, selectedPatientType: widget.selectedPatientType, - patientSearchRequestModel: - widget.patientSearchRequestModel, + patientSearchRequestModel: widget.patientSearchRequestModel, isSearchWithKeyInfo: widget.isSearchWithKeyInfo, outPatientFilterType: outPatientFilterType); GifLoaderDialogUtils.hideDialog(context); @@ -140,24 +139,15 @@ class _OutPatientsScreenState extends State { decoration: TabUtils.getBoxTabsBoxDecoration( isActive: _isActive, isFirst: _times.indexOf(item) == 0, - isLast: - _times.indexOf(item) == _times.length - 1, - isMiddle: _times.indexOf(item) != 0 && - _times.indexOf(item) != _times.length - 1, + isLast: _times.indexOf(item) == _times.length - 1, + isMiddle: _times.indexOf(item) != 0 && _times.indexOf(item) != _times.length - 1, projectViewModel: projectsProvider), child: Center( child: Row( mainAxisAlignment: MainAxisAlignment.center, children: [ - TabUtils.getTabText( - title: item, isActive: _isActive), - _isActive && - _activeLocation != 0 && - model.state == ViewState.Idle - ? TabUtils.getTabCounter( - isActive: _isActive, - counter: model.filterData.length) - : Container(), + TabUtils.getTabText(title: item, isActive: _isActive), + _isActive && _activeLocation != 0 && model.state == ViewState.Idle ? TabUtils.getTabCounter(isActive: _isActive, counter: model.filterData.length) : Container(), ], ), ), @@ -177,9 +167,7 @@ class _OutPatientsScreenState extends State { marginTop: 5, suffixIcon: IconButton( icon: Icon( - _activeLocation != 0 - ? DoctorApp.filter_1 - : FontAwesomeIcons.slidersH, + _activeLocation != 0 ? DoctorApp.filter_1 : FontAwesomeIcons.slidersH, color: Colors.black, ), iconSize: 20, @@ -189,21 +177,17 @@ class _OutPatientsScreenState extends State { Navigator.push( context, MaterialPageRoute( - builder: (BuildContext context) => - FilterDatePage( + builder: (BuildContext context) => FilterDatePage( outPatientFilterType: outPatientFilterType, patientSearchViewModel: model, ), - settings: RouteSettings( - name: 'FilterOutPatentDateScreen'), + settings: RouteSettings(name: 'FilterOutPatentDateScreen'), )); }, ), positionedChild: IconButton( icon: Icon( - isSortDes - ? FontAwesomeIcons.sortAmountDown - : FontAwesomeIcons.sortAmountUp, + isSortDes ? FontAwesomeIcons.sortAmountDown : FontAwesomeIcons.sortAmountUp, color: Colors.black, ), iconSize: 20, @@ -218,8 +202,7 @@ class _OutPatientsScreenState extends State { child: model.filterData.isEmpty ? Center( child: ErrorMessage( - error: TranslationBase.of(context) - .youDontHaveAnyPatient, + error: TranslationBase.of(context).youDontHaveAnyPatient, ), ) : ListView.builder( @@ -227,15 +210,9 @@ class _OutPatientsScreenState extends State { shrinkWrap: true, itemCount: model.filterData.length, itemBuilder: (BuildContext ctxt, int index) { - if (_activeLocation != 0 || - (model.filterData[index].patientStatusType != - null && - model.filterData[index] - .patientStatusType == - 43)) + if (_activeLocation != 0 || (model.filterData[index].patientStatusType != null && model.filterData[index].patientStatusType == 43)) return Padding( - padding: EdgeInsets.symmetric( - horizontal: 8, vertical: 0), + padding: EdgeInsets.symmetric(horizontal: 8, vertical: 0), child: PatientCard( patientInfo: model.filterData[index], patientType: patientType, @@ -244,20 +221,16 @@ class _OutPatientsScreenState extends State { isInpatient: widget.isInpatient, onTap: () { // TODO change the parameter to daynamic - Navigator.of(context).pushNamed( - PATIENTS_PROFILE, - arguments: { - "patient": model.filterData[index], - "patientType": "1", - "from": widget - .patientSearchRequestModel.from, - "to": widget - .patientSearchRequestModel.from, - "isSearch": false, - "isInpatient": false, - "arrivalType": "7", - "isSearchAndOut": false, - }); + Navigator.of(context).pushNamed(PATIENTS_PROFILE, arguments: { + "patient": model.filterData[index], + "patientType": "1", + "from": widget.patientSearchRequestModel.from, + "to": widget.patientSearchRequestModel.from, + "isSearch": false, + "isInpatient": false, + "arrivalType": "7", + "isSearchAndOut": false, + }); }, // isFromSearch: widget.isSearch, ), From ac74e1e62de229030fa1baf84e16050ed0917d51 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Thu, 8 Jun 2023 10:07:25 +0300 Subject: [PATCH 09/28] updates --- lib/client/base_app_client.dart | 21 + lib/config/config.dart | 4 +- lib/core/model/radiology/final_radiology.dart | 9 +- .../radiology/radiology_service.dart | 40 +- .../sick_leave/sickleave_service.dart | 1 + .../viewModel/authentication_view_model.dart | 2 +- lib/core/viewModel/procedure_View_model.dart | 5 + .../medical-file/medical_file_details.dart | 576 +++--------------- .../patient_profile_screen.dart | 162 ++--- .../radiology/radiology_details_page.dart | 21 +- .../radiology/radiology_home_page.dart | 81 +-- .../referred_patient_detail_in-paint.dart | 223 ++----- .../prescription/old_prescriptions_page.dart | 241 +++----- 13 files changed, 403 insertions(+), 983 deletions(-) diff --git a/lib/client/base_app_client.dart b/lib/client/base_app_client.dart index d7619066..3901554f 100644 --- a/lib/client/base_app_client.dart +++ b/lib/client/base_app_client.dart @@ -100,7 +100,17 @@ class BaseAppClient { else body['PatientOutSA'] = false; + // if (!body.containsKey('ProjectID')) { + // if (projectID != null) { + // body['ProjectID'] = projectID; + // } else { + // body['ProjectID'] = 0; + // } + // } + body['DeviceTypeID'] = Platform.isAndroid ? 1 : 2; + // print("ProjectID :"); + // print(body['ProjectID']); print("URL : $url"); print("Body : ${json.encode(body)}"); var asd = json.encode(body); @@ -223,6 +233,17 @@ class BaseAppClient { else body['PatientOutSA'] = false; + // if(!body.containsKey('ProjectID')) { + // if (projectID != null) { + // body['ProjectID'] = 313; + // } else { + // body['ProjectID'] = 0; + // } + // } + + // body['DoctorID'] = 24; //3844083 + // body['TokenID'] = "@dm!n"; + print("URL : $url"); print("Body : ${json.encode(body)}"); var asd = json.encode(body); diff --git a/lib/config/config.dart b/lib/config/config.dart index c8d7ceaf..439bcc4b 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -6,12 +6,14 @@ const ONLY_LETTERS = "[a-zA-Z &'\"]"; const ONLY_DATE = "[0-9/]"; const BASE_URL_LIVE_CARE = 'https://livecare.hmg.com/'; -const BASE_URL = 'https://hmgwebservices.com/'; +// const BASE_URL = 'https://hmgwebservices.com/'; // const BASE_URL = 'https://uat.hmgwebservices.com/'; // const BASE_URL = 'https://vidauat.cloudsolutions.com.sa/'; //Vida Plus URL +const BASE_URL = 'https://vidamergeuat.cloudsolutions.com.sa/'; //Vida Plus URL + const PHARMACY_ITEMS_URL = "Services/Lists.svc/REST/GetPharmcyItems_Region_enh"; const PHARMACY_LIST_URL = "Services/Patients.svc/REST/GetPharmcyList"; diff --git a/lib/core/model/radiology/final_radiology.dart b/lib/core/model/radiology/final_radiology.dart index 07c4f984..90eb7d18 100644 --- a/lib/core/model/radiology/final_radiology.dart +++ b/lib/core/model/radiology/final_radiology.dart @@ -6,6 +6,7 @@ class FinalRadiology { dynamic patientID; dynamic invoiceLineItemNo; dynamic invoiceNo; + dynamic invoiceNo_VP; dynamic doctorID; dynamic clinicID; DateTime orderDate; @@ -43,6 +44,7 @@ class FinalRadiology { bool isCVI; bool isRadMedicalReport; bool isLiveCareAppodynamicment; + bool isRecordFromVidaPlus; FinalRadiology( {this.setupID, @@ -50,6 +52,7 @@ class FinalRadiology { this.patientID, this.invoiceLineItemNo, this.invoiceNo, + this.invoiceNo_VP, this.doctorID, this.clinicID, this.orderDate, @@ -86,7 +89,7 @@ class FinalRadiology { this.speciality, this.isCVI, this.isRadMedicalReport, - this.isLiveCareAppodynamicment}); + this.isLiveCareAppodynamicment, this.isRecordFromVidaPlus}); FinalRadiology.fromJson(Map json) { try { @@ -95,6 +98,7 @@ class FinalRadiology { patientID = json['PatientID']; invoiceLineItemNo = json['InvoiceLineItemNo']; invoiceNo = json['InvoiceNo']; + invoiceNo_VP = json['InvoiceNo_VP']; doctorID = json['DoctorID']; clinicID = json['ClinicID']; orderDate = AppDateUtils.convertStringToDate(json['OrderDate']); @@ -132,6 +136,7 @@ class FinalRadiology { // speciality = json['Speciality'].cast(); isCVI = json['isCVI']; isRadMedicalReport = json['isRadMedicalReport']; + isRecordFromVidaPlus = json['IsRecordFromVidaPlus']; } catch (e) { print(e); } @@ -144,6 +149,7 @@ class FinalRadiology { data['PatientID'] = this.patientID; data['InvoiceLineItemNo'] = this.invoiceLineItemNo; data['InvoiceNo'] = this.invoiceNo; + data['InvoiceNo_VP'] = this.invoiceNo_VP; data['DoctorID'] = this.doctorID; data['ClinicID'] = this.clinicID; data['OrderDate'] = this.orderDate; @@ -179,6 +185,7 @@ class FinalRadiology { data['Speciality'] = this.speciality; data['isCVI'] = this.isCVI; data['isRadMedicalReport'] = this.isRadMedicalReport; + data['IsRecordFromVidaPlus'] = this.isRecordFromVidaPlus; return data; } } diff --git a/lib/core/service/patient_medical_file/radiology/radiology_service.dart b/lib/core/service/patient_medical_file/radiology/radiology_service.dart index 965fa03b..10eb9a49 100644 --- a/lib/core/service/patient_medical_file/radiology/radiology_service.dart +++ b/lib/core/service/patient_medical_file/radiology/radiology_service.dart @@ -1,6 +1,6 @@ import 'package:doctor_app_flutter/config/config.dart'; -import 'package:doctor_app_flutter/core/model/radiology/final_radiology.dart'; import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/radiology/final_radiology.dart'; import 'package:flutter/cupertino.dart'; import '../../base/base_service.dart'; @@ -8,20 +8,17 @@ import '../../base/base_service.dart'; class RadiologyService extends BaseService { List finalRadiologyList = List(); String url = ''; + bool isRadiologyVIDAPlus = false; - Future getRadImageURL( - {int invoiceNo, - int lineItem, - int projectId, - @required PatiantInformtion patient}) async { + Future getRadImageURL({int invoiceNo, int lineItem, int projectId, @required PatiantInformtion patient}) async { hasError = false; final Map body = new Map(); body['InvoiceNo'] = invoiceNo; + body['InvoiceNo_VP'] = invoiceNo; body['LineItemNo'] = lineItem; body['ProjectID'] = projectId; - await baseAppClient.postPatient(GET_RAD_IMAGE_URL, patient: patient, - onSuccess: (dynamic response, int statusCode) { + await baseAppClient.postPatient(GET_RAD_IMAGE_URL, patient: patient, onSuccess: (dynamic response, int statusCode) { url = response['Data']; }, onFailure: (String error, int statusCode) { hasError = true; @@ -29,8 +26,7 @@ class RadiologyService extends BaseService { }, body: body); } - Future getPatientRadOrders(PatiantInformtion patient, - {isInPatient = false}) async { + Future getPatientRadOrders(PatiantInformtion patient, {isInPatient = false}) async { String url = GET_PATIENT_ORDERS; final Map body = new Map(); if (isInPatient) { @@ -39,19 +35,29 @@ class RadiologyService extends BaseService { } finalRadiologyList.clear(); hasError = false; - await baseAppClient.postPatient(url, patient: patient, - onSuccess: (dynamic response, int statusCode) { + await baseAppClient.postPatient(url, patient: patient, onSuccess: (dynamic response, int statusCode) { finalRadiologyList = []; String label = "ListRAD"; if (isInPatient) { label = "List_GetRadOreders"; } - if (response[label] == null || response[label].length == 0) { - label = "FinalRadiologyList"; + if (response['FinalRadiologyList'] != null && response['FinalRadiologyList'].length != 0) { + isRadiologyVIDAPlus = false; + response['FinalRadiologyList'].forEach((radiology) { + finalRadiologyList.add(FinalRadiology.fromJson(radiology)); + }); + } else { + isRadiologyVIDAPlus = true; + response['FinalRadiologyListAPI'].forEach((radiology) { + finalRadiologyList.add(FinalRadiology.fromJson(radiology)); + }); } - response[label].forEach((radiology) { - finalRadiologyList.add(FinalRadiology.fromJson(radiology)); - }); + // if (response[label] == null || response[label].length == 0) { + // label = "FinalRadiologyList"; + // } + // response[label].forEach((radiology) { + // finalRadiologyList.add(FinalRadiology.fromJson(radiology)); + // }); }, onFailure: (String error, int statusCode) { hasError = true; super.error = error; diff --git a/lib/core/service/patient_medical_file/sick_leave/sickleave_service.dart b/lib/core/service/patient_medical_file/sick_leave/sickleave_service.dart index 333ffeea..b7a52d9f 100644 --- a/lib/core/service/patient_medical_file/sick_leave/sickleave_service.dart +++ b/lib/core/service/patient_medical_file/sick_leave/sickleave_service.dart @@ -100,6 +100,7 @@ class SickLeaveService extends BaseService { onSuccess: (dynamic response, int statusCode) { // Future.value(response); getAllSickLeavePatient = []; + getAllSickLeavePatient.clear(); response['List_SickLeave'].forEach((v) { getAllSickLeavePatient.add(SickLeavePatientModel.fromJson(v)); }); diff --git a/lib/core/viewModel/authentication_view_model.dart b/lib/core/viewModel/authentication_view_model.dart index 9c900eac..52cdb1f7 100644 --- a/lib/core/viewModel/authentication_view_model.dart +++ b/lib/core/viewModel/authentication_view_model.dart @@ -238,7 +238,7 @@ class AuthenticationViewModel extends BaseViewModel { /// add token to shared preferences in case of send activation code is success setDataAfterSendActivationSuccess(CheckActivationCodeForDoctorAppResponseModel sendActivationCodeForDoctorAppResponseModel) async { // print("VerificationCode : " + sendActivationCodeForDoctorAppResponseModel.verificationCode); - await sharedPref.setString(DOCTOR_SETUP_ID, sendActivationCodeForDoctorAppResponseModel.listDoctorsClinic[0].setupID); + await sharedPref.setString(DOCTOR_SETUP_ID, sendActivationCodeForDoctorAppResponseModel.listDoctorsClinic[0].setupID != null ? sendActivationCodeForDoctorAppResponseModel.listDoctorsClinic[0].setupID : ""); await sharedPref.setString(VIDA_AUTH_TOKEN_ID, sendActivationCodeForDoctorAppResponseModel.vidaAuthTokenID); await sharedPref.setString(VIDA_REFRESH_TOKEN_ID, sendActivationCodeForDoctorAppResponseModel.vidaRefreshTokenID); await sharedPref.setString(TOKEN, sendActivationCodeForDoctorAppResponseModel.authenticationTokenID); diff --git a/lib/core/viewModel/procedure_View_model.dart b/lib/core/viewModel/procedure_View_model.dart index 76571092..eba91698 100644 --- a/lib/core/viewModel/procedure_View_model.dart +++ b/lib/core/viewModel/procedure_View_model.dart @@ -72,6 +72,10 @@ class ProcedureViewModel extends BaseViewModel { List get procedureTemplateDetails => _procedureService.templateDetailsList; + bool _isRadiologyVIDAPlus = false; + + bool get isRadiologyVIDAPlus => _isRadiologyVIDAPlus; + Future getProcedure( {int mrn, String patientType, @@ -240,6 +244,7 @@ class ProcedureViewModel extends BaseViewModel { setState(ViewState.Busy); await _radiologyService.getPatientRadOrders(patient, isInPatient: isInPatient); + _isRadiologyVIDAPlus = _radiologyService.isRadiologyVIDAPlus; if (_radiologyService.hasError) { error = _radiologyService.error; if (patientType == "7") diff --git a/lib/screens/medical-file/medical_file_details.dart b/lib/screens/medical-file/medical_file_details.dart index ae2fb0f0..1f2666ff 100644 --- a/lib/screens/medical-file/medical_file_details.dart +++ b/lib/screens/medical-file/medical_file_details.dart @@ -1,6 +1,6 @@ +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/core/viewModel/medical_file_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; -import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/utils/date-utils.dart'; import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; @@ -30,18 +30,7 @@ class MedicalFileDetails extends StatefulWidget { String doctorImage; MedicalFileDetails( - {this.age, - this.firstName, - this.lastName, - this.gender, - this.encounterNumber, - this.pp, - this.patient, - this.doctorName, - this.vistDate, - this.clinicName, - this.episode, - this.doctorImage}); + {this.age, this.firstName, this.lastName, this.gender, this.encounterNumber, this.pp, this.patient, this.doctorName, this.vistDate, this.clinicName, this.episode, this.doctorImage}); @override _MedicalFileDetailsState createState() => _MedicalFileDetailsState( @@ -75,18 +64,7 @@ class _MedicalFileDetailsState extends State { String doctorImage; _MedicalFileDetailsState( - {this.age, - this.firstName, - this.lastName, - this.gender, - this.encounterNumber, - this.pp, - this.patient, - this.doctorName, - this.vistDate, - this.clinicName, - this.episode, - this.doctorImage}); + {this.age, this.firstName, this.lastName, this.gender, this.encounterNumber, this.pp, this.patient, this.doctorName, this.vistDate, this.clinicName, this.episode, this.doctorImage}); bool isPhysicalExam = true; bool isProcedureExpand = true; @@ -102,9 +80,7 @@ class _MedicalFileDetailsState extends State { model.getMedicalFile(mrn: pp); } }, - builder: - (BuildContext context, MedicalFileViewModel model, Widget child) => - AppScaffold( + builder: (BuildContext context, MedicalFileViewModel model, Widget child) => AppScaffold( appBar: PatientProfileAppBar( patient, doctorName: doctorName, @@ -113,10 +89,9 @@ class _MedicalFileDetailsState extends State { isPrescriptions: true, isMedicalFile: true, episode: episode, - visitDate: - '${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat( - vistDate, - ), isArabic: projectViewModel.isArabic)}', + visitDate: '${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat( + vistDate, + ), isArabic: projectViewModel.isArabic)}', isAppointmentHeader: true, ), isShowAppBar: true, @@ -128,125 +103,67 @@ class _MedicalFileDetailsState extends State { child: Container( child: Column( children: [ - model.medicalFileList.length != 0 && - model - .medicalFileList[0] - .entityList[0] - .timelines[encounterNumber] - .timeLineEvents[0] - .consulations - .length != - 0 + model.medicalFileList.length != 0 && model.medicalFileList[0].entityList[0].timelines[encounterNumber].timeLineEvents[0].consulations.length != 0 ? Padding( padding: EdgeInsets.all(10.0), child: Container( child: Column( children: [ SizedBox(height: 25.0), - if (model.medicalFileList.length != 0 && - model - .medicalFileList[0] - .entityList[0] - .timelines[encounterNumber] - .timeLineEvents[0] - .consulations - .length != - 0) + if (model.medicalFileList.length != 0 && model.medicalFileList[0].entityList[0].timelines[encounterNumber].timeLineEvents[0].consulations.length != 0) Container( width: double.infinity, - margin: EdgeInsets.only( - top: 10, left: 10, right: 10), + margin: EdgeInsets.only(top: 10, left: 10, right: 10), padding: EdgeInsets.all(8.0), decoration: BoxDecoration( color: Colors.white, borderRadius: BorderRadius.all( Radius.circular(10.0), ), - border: Border.all( - color: Colors.grey[200], - width: 0.5), + border: Border.all(color: Colors.grey[200], width: 0.5), ), child: Padding( padding: const EdgeInsets.all(15.0), child: HeaderBodyExpandableNotifier( headerWidget: Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, + mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Row( children: [ - AppText( - TranslationBase.of( - context) - .historyOfPresentIllness - .toUpperCase(), - variant: isHistoryExpand - ? "bodyText" - : '', - bold: isHistoryExpand - ? true - : true, - color: Colors.black), + AppText(TranslationBase.of(context).historyOfPresentIllness.toUpperCase(), + variant: isHistoryExpand ? "bodyText" : '', bold: isHistoryExpand ? true : true, color: Colors.black), ], ), InkWell( onTap: () { setState(() { - isHistoryExpand = - !isHistoryExpand; + isHistoryExpand = !isHistoryExpand; }); }, - child: Icon(isHistoryExpand - ? EvaIcons.arrowUp - : EvaIcons.arrowDown)) + child: Icon(isHistoryExpand ? EvaIcons.arrowUp : EvaIcons.arrowDown)) ], ), bodyWidget: ListView.builder( - physics: - NeverScrollableScrollPhysics(), + physics: NeverScrollableScrollPhysics(), scrollDirection: Axis.vertical, shrinkWrap: true, - itemCount: model - .medicalFileList[0] - .entityList[0] - .timelines[encounterNumber] - .timeLineEvents[0] - .consulations[0] - .lstCheifComplaint - .length, - itemBuilder: (BuildContext ctxt, - int index) { + itemCount: model.medicalFileList[0].entityList[0].timelines[encounterNumber].timeLineEvents[0].consulations[0].lstCheifComplaint.length, + itemBuilder: (BuildContext ctxt, int index) { return Padding( padding: EdgeInsets.all(8.0), child: Container( child: Column( - mainAxisAlignment: - MainAxisAlignment - .center, + mainAxisAlignment: MainAxisAlignment.center, children: [ Row( children: [ Expanded( child: AppText( - model - .medicalFileList[ - 0] - .entityList[ - 0] - .timelines[ - encounterNumber] - .timeLineEvents[ - 0] - .consulations[ - 0] - .lstCheifComplaint[ - index] - .hOPI + model.medicalFileList[0].entityList[0].timelines[encounterNumber].timeLineEvents[0].consulations[0].lstCheifComplaint[index].hOPI .trim(), ), ), - SizedBox( - width: 35.0), + SizedBox(width: 35.0), ], ), ], @@ -265,87 +182,50 @@ class _MedicalFileDetailsState extends State { SizedBox( height: 30, ), - if (model.medicalFileList.length != 0 && - model - .medicalFileList[0] - .entityList[0] - .timelines[encounterNumber] - .timeLineEvents[0] - .consulations - .length != - 0) + if (model.medicalFileList.length != 0 && model.medicalFileList[0].entityList[0].timelines[encounterNumber].timeLineEvents[0].consulations.length != 0) Container( width: double.infinity, - margin: EdgeInsets.only( - top: 10, left: 10, right: 10), + margin: EdgeInsets.only(top: 10, left: 10, right: 10), padding: EdgeInsets.all(8.0), decoration: BoxDecoration( color: Colors.white, borderRadius: BorderRadius.all( Radius.circular(10.0), ), - border: Border.all( - color: Colors.grey[200], - width: 0.5), + border: Border.all(color: Colors.grey[200], width: 0.5), ), child: Padding( padding: const EdgeInsets.all(15.0), child: HeaderBodyExpandableNotifier( headerWidget: Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, + mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Row( children: [ - AppText( - TranslationBase.of( - context) - .assessment - .toUpperCase(), - variant: - isAssessmentExpand - ? "bodyText" - : '', - bold: isAssessmentExpand - ? true - : true, - color: Colors.black), + AppText(TranslationBase.of(context).assessment.toUpperCase(), + variant: isAssessmentExpand ? "bodyText" : '', bold: isAssessmentExpand ? true : true, color: Colors.black), ], ), InkWell( onTap: () { setState(() { - isAssessmentExpand = - !isAssessmentExpand; + isAssessmentExpand = !isAssessmentExpand; }); }, - child: Icon(isAssessmentExpand - ? EvaIcons.arrowUp - : EvaIcons.arrowDown)) + child: Icon(isAssessmentExpand ? EvaIcons.arrowUp : EvaIcons.arrowDown)) ], ), bodyWidget: ListView.builder( - physics: - NeverScrollableScrollPhysics(), + physics: NeverScrollableScrollPhysics(), scrollDirection: Axis.vertical, shrinkWrap: true, - itemCount: model - .medicalFileList[0] - .entityList[0] - .timelines[encounterNumber] - .timeLineEvents[0] - .consulations[0] - .lstAssessments - .length, - itemBuilder: (BuildContext ctxt, - int index) { + itemCount: model.medicalFileList[0].entityList[0].timelines[encounterNumber].timeLineEvents[0].consulations[0].lstAssessments.length, + itemBuilder: (BuildContext ctxt, int index) { return Padding( padding: EdgeInsets.all(8.0), child: Container( child: Column( - mainAxisAlignment: - MainAxisAlignment - .center, + mainAxisAlignment: MainAxisAlignment.center, children: [ Row( children: [ @@ -354,59 +234,25 @@ class _MedicalFileDetailsState extends State { fontSize: 13.0, ), AppText( - model - .medicalFileList[ - 0] - .entityList[0] - .timelines[ - encounterNumber] - .timeLineEvents[ - 0] - .consulations[ - 0] - .lstAssessments[ - index] - .iCD10 - .trim(), + model.medicalFileList[0].entityList[0].timelines[encounterNumber].timeLineEvents[0].consulations[0].lstAssessments[index].iCD10.trim(), fontSize: 13.5, - fontWeight: - FontWeight - .w700, + fontWeight: FontWeight.w700, ), - SizedBox( - width: 15.0), + SizedBox(width: 15.0), ], ), Row( children: [ AppText( - TranslationBase.of( - context) - .condition + - ": ", + TranslationBase.of(context).condition + ": ", fontSize: 12.5, ), Expanded( child: AppText( - model - .medicalFileList[ - 0] - .entityList[ - 0] - .timelines[ - encounterNumber] - .timeLineEvents[ - 0] - .consulations[ - 0] - .lstAssessments[ - index] - .condition + model.medicalFileList[0].entityList[0].timelines[encounterNumber].timeLineEvents[0].consulations[0].lstAssessments[index].condition .trim(), fontSize: 13.0, - fontWeight: - FontWeight - .w700, + fontWeight: FontWeight.w700, ), ), ], @@ -415,23 +261,8 @@ class _MedicalFileDetailsState extends State { children: [ Expanded( child: AppText( - model - .medicalFileList[ - 0] - .entityList[ - 0] - .timelines[ - encounterNumber] - .timeLineEvents[ - 0] - .consulations[ - 0] - .lstAssessments[ - index] - .description, - fontWeight: - FontWeight - .w700, + model.medicalFileList[0].entityList[0].timelines[encounterNumber].timeLineEvents[0].consulations[0].lstAssessments[index].description, + fontWeight: FontWeight.w700, fontSize: 15.0, ), ) @@ -440,32 +271,14 @@ class _MedicalFileDetailsState extends State { Row( children: [ AppText( - TranslationBase.of( - context) - .type + - ": ", + TranslationBase.of(context).type + ": ", fontSize: 15.5, ), Expanded( child: AppText( - model - .medicalFileList[ - 0] - .entityList[ - 0] - .timelines[ - encounterNumber] - .timeLineEvents[ - 0] - .consulations[ - 0] - .lstAssessments[ - index] - .type, + model.medicalFileList[0].entityList[0].timelines[encounterNumber].timeLineEvents[0].consulations[0].lstAssessments[index].type, fontSize: 16.0, - fontWeight: - FontWeight - .w700, + fontWeight: FontWeight.w700, ), ), ], @@ -474,18 +287,7 @@ class _MedicalFileDetailsState extends State { height: 15.0, ), AppText( - model - .medicalFileList[ - 0] - .entityList[0] - .timelines[ - encounterNumber] - .timeLineEvents[0] - .consulations[0] - .lstAssessments[ - index] - .remarks - .trim(), + model.medicalFileList[0].entityList[0].timelines[encounterNumber].timeLineEvents[0].consulations[0].lstAssessments[index].remarks.trim(), ), Divider( height: 1, @@ -508,86 +310,50 @@ class _MedicalFileDetailsState extends State { SizedBox( height: 30, ), - if (model.medicalFileList.length != 0 && - model - .medicalFileList[0] - .entityList[0] - .timelines[encounterNumber] - .timeLineEvents[0] - .consulations - .length != - 0) + if (model.medicalFileList.length != 0 && model.medicalFileList[0].entityList[0].timelines[encounterNumber].timeLineEvents[0].consulations.length != 0) Container( width: double.infinity, - margin: EdgeInsets.only( - top: 10, left: 10, right: 10), + margin: EdgeInsets.only(top: 10, left: 10, right: 10), padding: EdgeInsets.all(8.0), decoration: BoxDecoration( color: Colors.white, borderRadius: BorderRadius.all( Radius.circular(10.0), ), - border: Border.all( - color: Colors.grey[200], - width: 0.5), + border: Border.all(color: Colors.grey[200], width: 0.5), ), child: Padding( padding: const EdgeInsets.all(15.0), child: HeaderBodyExpandableNotifier( headerWidget: Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, + mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Row( children: [ - AppText( - TranslationBase.of( - context) - .test - .toUpperCase(), - variant: isProcedureExpand - ? "bodyText" - : '', - bold: isProcedureExpand - ? true - : true, - color: Colors.black), + AppText(TranslationBase.of(context).test.toUpperCase(), + variant: isProcedureExpand ? "bodyText" : '', bold: isProcedureExpand ? true : true, color: Colors.black), ], ), InkWell( onTap: () { setState(() { - isProcedureExpand = - !isProcedureExpand; + isProcedureExpand = !isProcedureExpand; }); }, - child: Icon(isProcedureExpand - ? EvaIcons.arrowUp - : EvaIcons.arrowDown)) + child: Icon(isProcedureExpand ? EvaIcons.arrowUp : EvaIcons.arrowDown)) ], ), bodyWidget: ListView.builder( - physics: - NeverScrollableScrollPhysics(), + physics: NeverScrollableScrollPhysics(), scrollDirection: Axis.vertical, shrinkWrap: true, - itemCount: model - .medicalFileList[0] - .entityList[0] - .timelines[encounterNumber] - .timeLineEvents[0] - .consulations[0] - .lstProcedure - .length, - itemBuilder: (BuildContext ctxt, - int index) { + itemCount: model.medicalFileList[0].entityList[0].timelines[encounterNumber].timeLineEvents[0].consulations[0].lstProcedure.length, + itemBuilder: (BuildContext ctxt, int index) { return Padding( padding: EdgeInsets.all(8.0), child: Container( child: Column( - mainAxisAlignment: - MainAxisAlignment - .center, + mainAxisAlignment: MainAxisAlignment.center, children: [ Row( children: [ @@ -597,65 +363,26 @@ class _MedicalFileDetailsState extends State { 'Procedure ID: ', ), AppText( - model - .medicalFileList[ - 0] - .entityList[ - 0] - .timelines[ - encounterNumber] - .timeLineEvents[ - 0] - .consulations[ - 0] - .lstProcedure[ - index] - .procedureId + model.medicalFileList[0].entityList[0].timelines[encounterNumber].timeLineEvents[0].consulations[0].lstProcedure[index].procedureId .trim(), - fontSize: - 13.5, - fontWeight: - FontWeight - .w700, + fontSize: 13.5, + fontWeight: FontWeight.w700, ), ], ), - SizedBox( - width: 35.0), + SizedBox(width: 35.0), Column( children: [ AppText( - TranslationBase.of( - context) - .orderDate + - ": ", + TranslationBase.of(context).orderDate + ": ", ), AppText( - AppDateUtils - .getDateFormatted( - DateTime - .parse( - model - .medicalFileList[ - 0] - .entityList[ - 0] - .timelines[ - encounterNumber] - .timeLineEvents[ - 0] - .consulations[ - 0] - .lstProcedure[ - index] - .orderDate + AppDateUtils.getDateFormatted(DateTime.parse( + model.medicalFileList[0].entityList[0].timelines[encounterNumber].timeLineEvents[0].consulations[0].lstProcedure[index].orderDate .trim(), )), - fontSize: - 13.5, - fontWeight: - FontWeight - .w700, + fontSize: 13.5, + fontWeight: FontWeight.w700, ), ], ), @@ -668,23 +395,8 @@ class _MedicalFileDetailsState extends State { children: [ Expanded( child: AppText( - model - .medicalFileList[ - 0] - .entityList[ - 0] - .timelines[ - encounterNumber] - .timeLineEvents[ - 0] - .consulations[ - 0] - .lstProcedure[ - index] - .procName, - fontWeight: - FontWeight - .w700, + model.medicalFileList[0].entityList[0].timelines[encounterNumber].timeLineEvents[0].consulations[0].lstProcedure[index].procName, + fontWeight: FontWeight.w700, ), ) ], @@ -695,23 +407,9 @@ class _MedicalFileDetailsState extends State { 'CPT Code : ', ), AppText( - model - .medicalFileList[ - 0] - .entityList[0] - .timelines[ - encounterNumber] - .timeLineEvents[ - 0] - .consulations[ - 0] - .lstProcedure[ - index] - .patientID + model.medicalFileList[0].entityList[0].timelines[encounterNumber].timeLineEvents[0].consulations[0].lstProcedure[index].patientID .toString(), - fontWeight: - FontWeight - .w700, + fontWeight: FontWeight.w700, ), ], ), @@ -739,79 +437,45 @@ class _MedicalFileDetailsState extends State { SizedBox( height: 30, ), - if (model.medicalFileList.length != 0 && - model - .medicalFileList[0] - .entityList[0] - .timelines[encounterNumber] - .timeLineEvents[0] - .consulations - .length != - 0) + if (model.medicalFileList.length != 0 && model.medicalFileList[0].entityList[0].timelines[encounterNumber].timeLineEvents[0].consulations.length != 0) Container( width: double.infinity, - margin: EdgeInsets.only( - top: 10, left: 10, right: 10), + margin: EdgeInsets.only(top: 10, left: 10, right: 10), padding: EdgeInsets.all(8.0), decoration: BoxDecoration( color: Colors.white, borderRadius: BorderRadius.all( Radius.circular(10.0), ), - border: Border.all( - color: Colors.grey[200], - width: 0.5), + border: Border.all(color: Colors.grey[200], width: 0.5), ), child: Padding( padding: const EdgeInsets.all(15.0), child: HeaderBodyExpandableNotifier( headerWidget: Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, + mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Row( children: [ - AppText( - TranslationBase.of( - context) - .physicalSystemExamination - .toUpperCase(), - variant: isPhysicalExam - ? "bodyText" - : '', - bold: isPhysicalExam - ? true - : true, - color: Colors.black), + AppText(TranslationBase.of(context).physicalSystemExamination.toUpperCase(), + variant: isPhysicalExam ? "bodyText" : '', bold: isPhysicalExam ? true : true, color: Colors.black), ], ), InkWell( onTap: () { setState(() { - isPhysicalExam = - !isPhysicalExam; + isPhysicalExam = !isPhysicalExam; }); }, - child: Icon(isPhysicalExam - ? EvaIcons.arrowUp - : EvaIcons.arrowDown)) + child: Icon(isPhysicalExam ? EvaIcons.arrowUp : EvaIcons.arrowDown)) ], ), bodyWidget: ListView.builder( - physics: - NeverScrollableScrollPhysics(), + physics: NeverScrollableScrollPhysics(), scrollDirection: Axis.vertical, shrinkWrap: true, - itemCount: model - .medicalFileList[0] - .entityList[0] - .timelines[encounterNumber] - .timeLineEvents[0] - .consulations[0] - .lstPhysicalExam - .length, - itemBuilder: (BuildContext ctxt, - int index) { + itemCount: model.medicalFileList[0].entityList[0].timelines[encounterNumber].timeLineEvents[0].consulations[0].lstPhysicalExam.length, + itemBuilder: (BuildContext ctxt, int index) { return Padding( padding: EdgeInsets.all(8.0), child: Container( @@ -819,75 +483,27 @@ class _MedicalFileDetailsState extends State { children: [ Row( children: [ - AppText(TranslationBase.of( - context) - .examType + - ": "), + AppText(TranslationBase.of(context).examType + ": "), AppText( - model - .medicalFileList[ - 0] - .entityList[0] - .timelines[ - encounterNumber] - .timeLineEvents[ - 0] - .consulations[ - 0] - .lstPhysicalExam[ - index] - .examDesc, - fontWeight: - FontWeight - .w700, + model.medicalFileList[0].entityList[0].timelines[encounterNumber].timeLineEvents[0].consulations[0].lstPhysicalExam[index].examDesc, + fontWeight: FontWeight.w700, ), ], ), Row( children: [ AppText( - model - .medicalFileList[ - 0] - .entityList[0] - .timelines[ - encounterNumber] - .timeLineEvents[ - 0] - .consulations[ - 0] - .lstPhysicalExam[ - index] - .examDesc, - fontWeight: - FontWeight - .w700, + model.medicalFileList[0].entityList[0].timelines[encounterNumber].timeLineEvents[0].consulations[0].lstPhysicalExam[index].examDesc, + fontWeight: FontWeight.w700, ) ], ), Row( children: [ - AppText(TranslationBase.of( - context) - .abnormal + - ": "), + AppText(TranslationBase.of(context).abnormal + ": "), AppText( - model - .medicalFileList[ - 0] - .entityList[0] - .timelines[ - encounterNumber] - .timeLineEvents[ - 0] - .consulations[ - 0] - .lstPhysicalExam[ - index] - .abnormal, - fontWeight: - FontWeight - .w700, + model.medicalFileList[0].entityList[0].timelines[encounterNumber].timeLineEvents[0].consulations[0].lstPhysicalExam[index].abnormal, + fontWeight: FontWeight.w700, ), ], ), @@ -895,17 +511,7 @@ class _MedicalFileDetailsState extends State { height: 15.0, ), AppText( - model - .medicalFileList[ - 0] - .entityList[0] - .timelines[ - encounterNumber] - .timeLineEvents[0] - .consulations[0] - .lstPhysicalExam[ - index] - .remarks, + model.medicalFileList[0].entityList[0].timelines[encounterNumber].timeLineEvents[0].consulations[0].lstPhysicalExam[index].remarks, ), Divider( height: 1, diff --git a/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart b/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart index d12ec115..64f28ba9 100644 --- a/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart +++ b/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart @@ -1,22 +1,23 @@ import 'dart:async'; + import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/enum/view_state.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/in_patient/post_episode_for_Inpatient_request_model.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/post_episode_req_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/core/service/AnalyticsService.dart'; import 'package:doctor_app_flutter/core/service/VideoCallService.dart'; import 'package:doctor_app_flutter/core/viewModel/LiveCarePatientViewModel.dart'; import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; -import 'package:doctor_app_flutter/core/model/SOAP/post_episode_req_model.dart'; -import 'package:doctor_app_flutter/core/model/SOAP/in_patient/post_episode_for_Inpatient_request_model.dart'; -import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/live_care/end_call_screen.dart'; import 'package:doctor_app_flutter/screens/patients/profile/profile_screen/profile_gird_for_InPatient.dart'; import 'package:doctor_app_flutter/screens/patients/profile/profile_screen/profile_gird_for_other.dart'; import 'package:doctor_app_flutter/screens/patients/profile/profile_screen/profile_gird_for_search.dart'; import 'package:doctor_app_flutter/utils/notification_permission_utils.dart'; -import 'package:doctor_app_flutter/utils/utils.dart'; import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; +import 'package:doctor_app_flutter/utils/utils.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-profile-header-new-design-app-bar.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; @@ -34,8 +35,7 @@ class PatientProfileScreen extends StatefulWidget { _PatientProfileScreenState createState() => _PatientProfileScreenState(); } -class _PatientProfileScreenState extends State - with SingleTickerProviderStateMixin { +class _PatientProfileScreenState extends State with SingleTickerProviderStateMixin { PatiantInformtion patient; LiveCarePatientViewModel _liveCareViewModel = LiveCarePatientViewModel(); @@ -115,15 +115,14 @@ class _PatientProfileScreenState extends State StreamSubscription callTimer; callConnected() { - callTimer = - CountdownTimer(Duration(minutes: 90), Duration(seconds: 1)).listen(null) - ..onDone(() { - callTimer.cancel(); - }) - ..onData((data) { - var t = Utils.timeFrom(duration: data.elapsed); - videoCallDurationStreamController.sink.add(t); - }); + callTimer = CountdownTimer(Duration(minutes: 90), Duration(seconds: 1)).listen(null) + ..onDone(() { + callTimer.cancel(); + }) + ..onData((data) { + var t = Utils.timeFrom(duration: data.elapsed); + videoCallDurationStreamController.sink.add(t); + }); } callDisconnected() { @@ -140,8 +139,7 @@ class _PatientProfileScreenState extends State final screenSize = MediaQuery.of(context).size; return BaseView( onModelReady: (model) async { - if (isFromLiveCare && patient.patientStatus == 1) - await model.addPatientToDoctorList(patient.vcId); + if (isFromLiveCare && patient.patientStatus == 1) await model.addPatientToDoctorList(patient.vcId); }, builder: (_, model, w) => AppScaffold( baseViewModel: model, @@ -154,13 +152,11 @@ class _PatientProfileScreenState extends State children: [ Column( children: [ - PatientProfileHeaderNewDesignAppBar( - patient, arrivalType ?? '0', patientType, + PatientProfileHeaderNewDesignAppBar(patient, arrivalType ?? '0', patientType, videoCallDurationStream: videoCallDurationStream, isInpatient: isInpatient, isFromLiveCare: isFromLiveCare, - height: (patient.patientStatusType != null && - patient.patientStatusType == 43) + height: (patient.patientStatusType != null && patient.patientStatusType == 43) ? 210 : isDischargedPatient ? 240 @@ -192,8 +188,7 @@ class _PatientProfileScreenState extends State isInpatient: isInpatient, from: from, to: to, - isDischargedPatient: - isDischargedPatient, + isDischargedPatient: isDischargedPatient, isFromSearch: isFromSearch, ) : ProfileGridForOther( @@ -218,8 +213,7 @@ class _PatientProfileScreenState extends State ? true : isFromLiveCare ? patient.episodeNo != null - : patient.patientStatusType != null && - patient.patientStatusType == 43) + : patient.patientStatusType != null && patient.patientStatusType == 43) BaseView( onModelReady: (model) async { model.getDoctorProfile(); @@ -237,10 +231,8 @@ class _PatientProfileScreenState extends State if (patient.episodeNo == 0) AppButton( loading: model.state == ViewState.BusyLocal, - disabled: - model.state == ViewState.BusyLocal, - title: - "${TranslationBase.of(context).createNew}\n${TranslationBase.of(context).episode}", + disabled: model.state == ViewState.BusyLocal, + title: "${TranslationBase.of(context).createNew}\n${TranslationBase.of(context).episode}", color: isFromLiveCare || isInpatient ? AppGlobal.appRedColor : patient.patientStatusType == 43 @@ -248,8 +240,7 @@ class _PatientProfileScreenState extends State : AppGlobal.appRedColor, fontColor: Colors.white, // vPadding: 8, - height: SizeConfig.heightMultiplier * - (SizeConfig.isHeightVeryShort ? 9 : 6), + height: SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort ? 9 : 6), radius: 30, hPadding: 25, fontWeight: FontWeight.normal, @@ -260,34 +251,24 @@ class _PatientProfileScreenState extends State height: 30, ), onPressed: () async { - if ((isFromLiveCare && - patient.appointmentNo != null) || - patient.patientStatusType == 43 || - isInpatient) { - createEpisode( - patient: patient, model: model); + if ((isFromLiveCare && patient.appointmentNo != null) || patient.patientStatusType == 43 || isInpatient) { + createEpisode(patient: patient, model: model); } }, ), if (patient.episodeNo != 0) AppButton( - loading: - model.state == ViewState.BusyLocal, - disabled: - model.state == ViewState.BusyLocal, - title: - "${TranslationBase.of(context).update}\n${TranslationBase.of(context).episode}", - color: ((isInpatient) || - isFromLiveCare) && - model.state != ViewState.BusyLocal + loading: model.state == ViewState.BusyLocal, + disabled: model.state == ViewState.BusyLocal, + title: "${TranslationBase.of(context).update}\n${TranslationBase.of(context).episode}", + color: ((isInpatient) || isFromLiveCare) && model.state != ViewState.BusyLocal ? AppGlobal.appRedColor : patient.patientStatusType == 43 - ?AppGlobal.appRedColor + ? AppGlobal.appRedColor : AppGlobal.appRedColor, fontColor: Colors.white, // vPadding: 8, - height: SizeConfig.heightMultiplier * - (SizeConfig.isHeightVeryShort ? 9 : 6), + height: SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort ? 9 : 6), radius: 30, hPadding: 25, fontWeight: FontWeight.normal, @@ -298,19 +279,12 @@ class _PatientProfileScreenState extends State height: 30, ), onPressed: () async { - await locator() - .logEvent( + await locator().logEvent( eventCategory: "Patient Profile ", eventAction: "Update Episode", ); - if ((isFromLiveCare && - patient.appointmentNo != null && - patient.appointmentNo != 0) || - patient.patientStatusType == 43 || - isInpatient) { - Navigator.of(context).pushNamed( - UPDATE_EPISODE, - arguments: {'patient': patient}); + if ((isFromLiveCare && patient.appointmentNo != null && patient.appointmentNo != 0) || patient.patientStatusType == 43 || isInpatient) { + Navigator.of(context).pushNamed(UPDATE_EPISODE, arguments: {'patient': patient}); } }), ], @@ -342,14 +316,9 @@ class _PatientProfileScreenState extends State child: Center( child: AppButton( fontWeight: FontWeight.w700, - color: isCallFinished - ? Colors.red[600] - : AppGlobal.appGreenColor, - title: isCallFinished - ? TranslationBase.of(context).endCall - : TranslationBase.of(context).initiateCall, - disabled: isCallStarted || - model.state == ViewState.BusyLocal, + color: isCallFinished ? Colors.red[600] : AppGlobal.appGreenColor, + title: isCallFinished ? TranslationBase.of(context).endCall : TranslationBase.of(context).initiateCall, + disabled: isCallStarted || model.state == ViewState.BusyLocal, onPressed: () async { // TODO MOSA TEST // AppPermissionsUtils @@ -367,50 +336,32 @@ class _PatientProfileScreenState extends State Navigator.push( context, MaterialPageRoute( - builder: (BuildContext context) => - EndCallScreen(patient: patient), - settings: - RouteSettings(name: 'EndCallScreen'), + builder: (BuildContext context) => EndCallScreen(patient: patient), + settings: RouteSettings(name: 'EndCallScreen'), ), ); } else { GifLoaderDialogUtils.showMyDialog(context); - await model.startCall( - isReCall: false, vCID: patient.vcId); + await model.startCall(isReCall: false, vCID: patient.vcId); if (model.state == ViewState.ErrorLocal) { GifLoaderDialogUtils.hideDialog(context); Utils.showErrorToast(model.error); } else { await model.getDoctorProfile(); - patient.appointmentNo = int.parse(model - .startCallRes.appointmentNo - .toString()); + patient.appointmentNo = int.parse(model.startCallRes.appointmentNo.toString()); patient.episodeNo = 0; - model.updateInCallPatient( - patient: patient, - appointmentNo: int.parse(model - .startCallRes.appointmentNo - .toString())); + model.updateInCallPatient(patient: patient, appointmentNo: int.parse(model.startCallRes.appointmentNo.toString())); setState(() { isCallStarted = true; }); GifLoaderDialogUtils.hideDialog(context); - AppPermissionsUtils - .requestVideoCallPermission( - context: context, - onTapGrant: () { - locator() - .openVideo( - model.startCallRes, - patient, - model.startCallRes != null - ? model.startCallRes - .isRecording - : true, - callConnected, - callDisconnected); - }); + AppPermissionsUtils.requestVideoCallPermission( + context: context, + onTapGrant: () { + locator() + .openVideo(model.startCallRes, patient, model.startCallRes != null ? model.startCallRes.isRecording : true, callConnected, callDisconnected); + }); } } }, @@ -436,15 +387,10 @@ class _PatientProfileScreenState extends State ); GifLoaderDialogUtils.showMyDialog(context); if (patient.admissionNo != null && patient.admissionNo.isNotEmpty) { - PostEpisodeForInpatientRequestModel postEpisodeReqModel = - PostEpisodeForInpatientRequestModel( - admissionNo: int.parse(patient.admissionNo), - patientID: patient.patientId); + PostEpisodeForInpatientRequestModel postEpisodeReqModel = PostEpisodeForInpatientRequestModel(admissionNo: int.parse(patient.admissionNo), patientID: patient.patientId); await model.postEpisodeForInPatient(postEpisodeReqModel); } else { - PostEpisodeReqModel postEpisodeReqModel = PostEpisodeReqModel( - appointmentNo: int.parse(patient.appointmentNo.toString()), - patientMRN: patient.patientMRN); + PostEpisodeReqModel postEpisodeReqModel = PostEpisodeReqModel(appointmentNo: int.parse(patient.appointmentNo.toString()), patientMRN: patient.patientMRN); await model.postEpisode(postEpisodeReqModel); } @@ -454,8 +400,7 @@ class _PatientProfileScreenState extends State Utils.showErrorToast(model.error); } else { patient.episodeNo = model.episodeID; - Navigator.of(context) - .pushNamed(CREATE_EPISODE, arguments: {'patient': patient}); + Navigator.of(context).pushNamed(CREATE_EPISODE, arguments: {'patient': patient}); } } } @@ -469,12 +414,7 @@ class AvatarWidget extends StatelessWidget { Widget build(BuildContext context) { return Container( decoration: BoxDecoration( - boxShadow: [ - BoxShadow( - color: Color.fromRGBO(0, 0, 0, 0.08), - offset: Offset(0.0, 5.0), - blurRadius: 16.0) - ], + boxShadow: [BoxShadow(color: Color.fromRGBO(0, 0, 0, 0.08), offset: Offset(0.0, 5.0), blurRadius: 16.0)], borderRadius: BorderRadius.all(Radius.circular(35.0)), color: Color(0xffCCCCCC), ), diff --git a/lib/screens/patients/profile/radiology/radiology_details_page.dart b/lib/screens/patients/profile/radiology/radiology_details_page.dart index 27d6e077..ccd2fc11 100644 --- a/lib/screens/patients/profile/radiology/radiology_details_page.dart +++ b/lib/screens/patients/profile/radiology/radiology_details_page.dart @@ -1,7 +1,7 @@ +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/core/model/radiology/final_radiology.dart'; import 'package:doctor_app_flutter/core/service/AnalyticsService.dart'; import 'package:doctor_app_flutter/core/viewModel/radiology_view_model.dart'; -import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-profile-app-bar.dart'; @@ -20,23 +20,15 @@ class RadiologyDetailsPage extends StatelessWidget { final String patientType; final String arrivalType; final bool isInpatient; + final bool isVidaPlus; - RadiologyDetailsPage( - {Key key, - this.finalRadiology, - this.patient, - this.patientType, - this.arrivalType, - this.isInpatient = false}); + RadiologyDetailsPage({Key key, this.finalRadiology, this.patient, this.patientType, this.arrivalType, this.isInpatient = false, this.isVidaPlus = false}); @override Widget build(BuildContext context) { return BaseView( onModelReady: (model) => model.getRadImageURL( - patient: patient, - projectId: finalRadiology.projectID, - lineItem: finalRadiology.invoiceLineItemNo, - invoiceNo: finalRadiology.invoiceNo), + patient: patient, projectId: finalRadiology.projectID, lineItem: finalRadiology.invoiceLineItemNo, invoiceNo: isVidaPlus ? finalRadiology.invoiceNo_VP : finalRadiology.invoiceNo), builder: (_, model, widget) => AppScaffold( appBar: PatientProfileAppBar( patient, @@ -50,7 +42,7 @@ class RadiologyDetailsPage extends StatelessWidget { ), isShowAppBar: true, baseViewModel: model, - body: SingleChildScrollView( + body: SingleChildScrollView( child: Column( mainAxisSize: MainAxisSize.max, crossAxisAlignment: CrossAxisAlignment.center, @@ -99,8 +91,7 @@ class RadiologyDetailsPage extends StatelessWidget { height: 80, width: double.maxFinite, child: Container( - margin: - EdgeInsets.only(left: 35, right: 35, top: 12, bottom: 12), + margin: EdgeInsets.only(left: 35, right: 35, top: 12, bottom: 12), child: AppButton( color: Color(0xffD02127), disabled: finalRadiology.dIAPACSURL == "", diff --git a/lib/screens/patients/profile/radiology/radiology_home_page.dart b/lib/screens/patients/profile/radiology/radiology_home_page.dart index 12b54a3c..0f64185c 100644 --- a/lib/screens/patients/profile/radiology/radiology_home_page.dart +++ b/lib/screens/patients/profile/radiology/radiology_home_page.dart @@ -1,6 +1,6 @@ +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/core/viewModel/procedure_View_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; -import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/patients/profile/radiology/radiology_details_page.dart'; import 'package:doctor_app_flutter/screens/procedures/base_add_procedure_tab_page.dart'; @@ -17,6 +17,7 @@ import 'package:doctor_app_flutter/widgets/transitions/slide_up_page.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; + import '../../../../widgets/shared/errors/error_message.dart'; class RadiologyHomePage extends StatefulWidget { @@ -47,8 +48,7 @@ class _RadiologyHomePageState extends State { Widget build(BuildContext context) { ProjectViewModel projectViewModel = Provider.of(context); return BaseView( - onModelReady: (model) => model.getPatientRadOrders(patient, - patientType: patientType, isInPatient: false), + onModelReady: (model) => model.getPatientRadOrders(patient, patientType: patientType, isInPatient: false), builder: (_, model, widget) => AppScaffold( isShowAppBar: true, backgroundColor: Colors.grey[100], @@ -66,21 +66,17 @@ class _RadiologyHomePageState extends State { SizedBox( height: 12, ), - if (model.radiologyList.isNotEmpty && - patient.patientStatusType != 43) + if (model.radiologyList.isNotEmpty && patient.patientStatusType != 43) ServiceTitle( title: TranslationBase.of(context).radiology, subTitle: TranslationBase.of(context).result, ), - if (patient.patientStatusType != null && - patient.patientStatusType == 43) + if (patient.patientStatusType != null && patient.patientStatusType == 43) ServiceTitle( title: TranslationBase.of(context).radiology, subTitle: TranslationBase.of(context).result, ), - if ((patient.patientStatusType != null && - patient.patientStatusType == 43) || - (isFromLiveCare && patient.appointmentNo != null)) + if ((patient.patientStatusType != null && patient.patientStatusType == 43) || (isFromLiveCare && patient.appointmentNo != null)) AddNewOrder( onTap: () { Navigator.push( @@ -96,6 +92,7 @@ class _RadiologyHomePageState extends State { }, label: TranslationBase.of(context).applyForRadiologyOrder, ), + ///TODO Elham * fix this to be list view builder ...List.generate( model.radiologyList.length, @@ -117,43 +114,26 @@ class _RadiologyHomePageState extends State { height: 160, decoration: BoxDecoration( //Colors.red[900] Color(0xff404545) - color: model.radiologyList[index] - .isLiveCareAppodynamicment + color: model.radiologyList[index].isLiveCareAppodynamicment ? Colors.red[900] : !model.radiologyList[index].isInOutPatient ? Colors.black : Color(0xffa9a089), 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)), + 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( - model.radiologyList[index] - .isLiveCareAppodynamicment - ? TranslationBase.of(context) - .liveCare - .toUpperCase() - : !model.radiologyList[index] - .isInOutPatient - ? TranslationBase.of(context) - .inPatientLabel - .toUpperCase() - : TranslationBase.of(context) - .outpatient - .toUpperCase(), + model.radiologyList[index].isLiveCareAppodynamicment + ? TranslationBase.of(context).liveCare.toUpperCase() + : !model.radiologyList[index].isInOutPatient + ? TranslationBase.of(context).inPatientLabel.toUpperCase() + : TranslationBase.of(context).outpatient.toUpperCase(), style: TextStyle(color: Colors.white), ), )), @@ -161,28 +141,18 @@ class _RadiologyHomePageState extends State { Expanded( child: DoctorCard( isNoMargin: true, - doctorName: - Utils.convertToTitleCase(model.radiologyList[index].doctorName), - profileUrl: - model.radiologyList[index].doctorImageURL, - invoiceNO: - '${model.radiologyList[index].invoiceNo}', - branch: - '${model.radiologyList[index].projectName}', - clinic: - Utils.convertToTitleCase(model.radiologyList[index].clinicDescription), - appointmentDate: - model.radiologyList[index].orderDate ?? - model.radiologyList[index].reportDate, + doctorName: Utils.convertToTitleCase(model.radiologyList[index].doctorName), + profileUrl: model.radiologyList[index].doctorImageURL, + invoiceNO: model.isRadiologyVIDAPlus ? '${model.radiologyList[index].invoiceNo}' : '${model.radiologyList[index].invoiceNo}', + branch: '${model.radiologyList[index].projectName}', + clinic: Utils.convertToTitleCase(model.radiologyList[index].clinicDescription), + appointmentDate: model.radiologyList[index].orderDate ?? model.radiologyList[index].reportDate, onTap: () { Navigator.push( context, FadePage( page: RadiologyDetailsPage( - finalRadiology: - model.radiologyList[index], - patient: patient, - isInpatient: isInpatient), + finalRadiology: model.radiologyList[index], patient: patient, isInpatient: isInpatient, isVidaPlus: model.radiologyList[index].isRecordFromVidaPlus), ), ); }, @@ -191,8 +161,7 @@ class _RadiologyHomePageState extends State { ], ), )), - if (model.radiologyList.isEmpty && - patient.patientStatusType != 43) + if (model.radiologyList.isEmpty && patient.patientStatusType != 43) Center( child: ErrorMessage( error: TranslationBase.of(context).noDataAvailable, diff --git a/lib/screens/patients/profile/referral/refer_details/referred_patient_detail_in-paint.dart b/lib/screens/patients/profile/referral/refer_details/referred_patient_detail_in-paint.dart index 77a6efbb..f33ec6bc 100644 --- a/lib/screens/patients/profile/referral/refer_details/referred_patient_detail_in-paint.dart +++ b/lib/screens/patients/profile/referral/refer_details/referred_patient_detail_in-paint.dart @@ -2,19 +2,20 @@ import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/enum/PatientType.dart'; import 'package:doctor_app_flutter/core/enum/view_state.dart'; -import 'package:doctor_app_flutter/core/viewModel/patient-referral-viewmodel.dart'; -import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; import 'package:doctor_app_flutter/core/model/patient/my_referral/my_referred_patient_model.dart'; import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/viewModel/patient-referral-viewmodel.dart'; +import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/utils/date-utils.dart'; import 'package:doctor_app_flutter/utils/dr_app_toast_msg.dart'; -import 'package:doctor_app_flutter/utils/utils.dart'; import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; +import 'package:doctor_app_flutter/utils/utils.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; import 'package:flutter/material.dart'; + import '../../../../../routes.dart'; class ReferredPatientDetailScreen extends StatelessWidget { @@ -52,8 +53,7 @@ class ReferredPatientDetailScreen extends StatelessWidget { ), Expanded( child: AppText( - (Utils.capitalize( - "${referredPatient.firstName} ${referredPatient.lastName}")), + (Utils.capitalize("${referredPatient.firstName} ${referredPatient.lastName}")), fontSize: SizeConfig.textMultiplier * 2.5, fontWeight: FontWeight.bold, fontFamily: 'Poppins', @@ -70,19 +70,14 @@ class ReferredPatientDetailScreen extends StatelessWidget { ), InkWell( onTap: () { - PatiantInformtion patient = - model.getPatientFromReferral(referredPatient); - Navigator.of(context) - .pushNamed(PATIENTS_PROFILE, arguments: { + PatiantInformtion patient = model.getPatientFromReferral(referredPatient); + Navigator.of(context).pushNamed(PATIENTS_PROFILE, arguments: { "patient": patient, "patientType": "1", - "isInpatient": - patientType == PatientType.IN_PATIENT, + "isInpatient": patientType == PatientType.IN_PATIENT, "arrivalType": "1", - "from": AppDateUtils.convertDateToFormat( - DateTime.now(), 'yyyy-MM-dd'), - "to": AppDateUtils.convertDateToFormat( - DateTime.now(), 'yyyy-MM-dd'), + "from": AppDateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'), + "to": AppDateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'), }); }, child: Icon( @@ -97,19 +92,14 @@ class ReferredPatientDetailScreen extends StatelessWidget { children: [ InkWell( onTap: () { - PatiantInformtion patient = - model.getPatientFromReferral(referredPatient); - Navigator.of(context) - .pushNamed(PATIENTS_PROFILE, arguments: { + PatiantInformtion patient = model.getPatientFromReferral(referredPatient); + Navigator.of(context).pushNamed(PATIENTS_PROFILE, arguments: { "patient": patient, "patientType": "1", - "isInpatient": - patientType == PatientType.IN_PATIENT, + "isInpatient": patientType == PatientType.IN_PATIENT, "arrivalType": "1", - "from": AppDateUtils.convertDateToFormat( - DateTime.now(), 'yyyy-MM-dd'), - "to": AppDateUtils.convertDateToFormat( - DateTime.now(), 'yyyy-MM-dd'), + "from": AppDateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'), + "to": AppDateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'), }); }, child: Column( @@ -120,9 +110,7 @@ class ReferredPatientDetailScreen extends StatelessWidget { width: 60, height: 60, child: Image.asset( - referredPatient.gender == 1 - ? 'assets/images/male_avatar.png' - : 'assets/images/female_avatar.png', + referredPatient.gender == 1 ? 'assets/images/male_avatar.png' : 'assets/images/female_avatar.png', fit: BoxFit.cover, ), ), @@ -146,8 +134,7 @@ class ReferredPatientDetailScreen extends StatelessWidget { child: Column( children: [ Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, + mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ AppText( referredPatient.referralStatusDesc, @@ -161,9 +148,7 @@ class ReferredPatientDetailScreen extends StatelessWidget { : Colors.red[700], ), AppText( - AppDateUtils.convertDateFromServerFormat( - referredPatient.referralDate, - "dd MMM,yyyy"), + AppDateUtils.convertDateFromServerFormat(referredPatient.referralDate, "dd MMM,yyyy"), fontFamily: 'Poppins', fontWeight: FontWeight.w600, fontSize: 2.0 * SizeConfig.textMultiplier, @@ -172,20 +157,16 @@ class ReferredPatientDetailScreen extends StatelessWidget { ], ), Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, + mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Row( - mainAxisAlignment: - MainAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.start, children: [ AppText( - TranslationBase.of(context) - .fileNumber, + TranslationBase.of(context).fileNumber, fontFamily: 'Poppins', fontWeight: FontWeight.w600, - fontSize: - 1.7 * SizeConfig.textMultiplier, + fontSize: 1.7 * SizeConfig.textMultiplier, color: Color(0XFF575757), ), AppText( @@ -198,9 +179,7 @@ class ReferredPatientDetailScreen extends StatelessWidget { ], ), AppText( - AppDateUtils.convertDateFromServerFormat( - referredPatient.referralDate, - "hh:mm a"), + AppDateUtils.convertDateFromServerFormat(referredPatient.referralDate, "hh:mm a"), fontFamily: 'Poppins', fontWeight: FontWeight.w600, fontSize: 1.8 * SizeConfig.textMultiplier, @@ -209,29 +188,25 @@ class ReferredPatientDetailScreen extends StatelessWidget { ], ), Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, + mainAxisAlignment: MainAxisAlignment.spaceBetween, crossAxisAlignment: CrossAxisAlignment.center, children: [ Expanded( child: Column( children: [ Row( - mainAxisAlignment: - MainAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.start, children: [ AppText( "${TranslationBase.of(context).refClinic}: ", fontFamily: 'Poppins', fontWeight: FontWeight.w600, - fontSize: 1.7 * - SizeConfig.textMultiplier, + fontSize: 1.7 * SizeConfig.textMultiplier, color: Color(0XFF575757), ), Expanded( child: AppText( - referredPatient - .referralClinicDescription, + referredPatient.referralClinicDescription, fontFamily: 'Poppins', fontWeight: FontWeight.w700, fontSize: 13, @@ -240,29 +215,21 @@ class ReferredPatientDetailScreen extends StatelessWidget { ), ], ), - if (referredPatient - .frequencyDescription != - null) + if (referredPatient.frequencyDescription != null) Row( - mainAxisAlignment: - MainAxisAlignment.start, - crossAxisAlignment: - CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - TranslationBase.of(context) - .frequency + - ": ", + TranslationBase.of(context).frequency + ": ", fontFamily: 'Poppins', fontWeight: FontWeight.w600, - fontSize: 1.7 * - SizeConfig.textMultiplier, + fontSize: 1.7 * SizeConfig.textMultiplier, color: Color(0XFF575757), ), Expanded( child: AppText( - referredPatient - .frequencyDescription, + referredPatient.frequencyDescription, fontFamily: 'Poppins', fontWeight: FontWeight.w700, fontSize: 14, @@ -277,29 +244,19 @@ class ReferredPatientDetailScreen extends StatelessWidget { Row( children: [ AppText( - referredPatient.nationalityName != - null - ? referredPatient.nationalityName - : "", + referredPatient.nationalityName != null ? referredPatient.nationalityName : "", fontWeight: FontWeight.bold, color: Color(0xFF2E303A), - fontSize: - 1.4 * SizeConfig.textMultiplier, + fontSize: 1.4 * SizeConfig.textMultiplier, ), - referredPatient.nationalityFlagURL != - null + referredPatient.nationalityFlagURL != null ? ClipRRect( - borderRadius: - BorderRadius.circular(20.0), + borderRadius: BorderRadius.circular(20.0), child: Image.network( - referredPatient - .nationalityFlagURL, + referredPatient.nationalityFlagURL, height: 25, width: 30, - errorBuilder: (BuildContext - context, - Object exception, - StackTrace stackTrace) { + errorBuilder: (BuildContext context, Object exception, StackTrace stackTrace) { return Text('No Image'); }, )) @@ -311,16 +268,13 @@ class ReferredPatientDetailScreen extends StatelessWidget { if (referredPatient.priorityDescription != null) Row( mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: - CrossAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - TranslationBase.of(context).priority + - ": ", + TranslationBase.of(context).priority + ": ", fontFamily: 'Poppins', fontWeight: FontWeight.w600, - fontSize: - 1.7 * SizeConfig.textMultiplier, + fontSize: 1.7 * SizeConfig.textMultiplier, color: Color(0XFF575757), ), AppText( @@ -335,33 +289,21 @@ class ReferredPatientDetailScreen extends StatelessWidget { if (referredPatient.mAXResponseTime != null) Row( mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: - CrossAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - TranslationBase.of(context) - .maxResponseTime + - ": ", + TranslationBase.of(context).maxResponseTime + ": ", fontFamily: 'Poppins', fontWeight: FontWeight.w600, - fontSize: - 1.7 * SizeConfig.textMultiplier, + fontSize: 1.7 * SizeConfig.textMultiplier, color: Color(0XFF575757), ), Expanded( child: AppText( - referredPatient.mAXResponseTime != - null - ? AppDateUtils - .convertDateFromServerFormat( - referredPatient - .mAXResponseTime, - "dd MMM,yyyy") - : '', + referredPatient.mAXResponseTime != null ? AppDateUtils.convertDateFromServerFormat(referredPatient.mAXResponseTime, "dd MMM,yyyy") : '', fontFamily: 'Poppins', fontWeight: FontWeight.w700, - fontSize: - 1.8 * SizeConfig.textMultiplier, + fontSize: 1.8 * SizeConfig.textMultiplier, color: Color(0XFF2E303A), ), ), @@ -371,8 +313,7 @@ class ReferredPatientDetailScreen extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ Container( - margin: - EdgeInsets.only(left: 10, right: 0), + margin: EdgeInsets.only(left: 10, right: 0), child: Image.asset( 'assets/images/patient/ic_ref_arrow_left.png', height: 50, @@ -380,34 +321,22 @@ class ReferredPatientDetailScreen extends StatelessWidget { ), ), Container( - margin: EdgeInsets.only( - left: 0, - top: 25, - right: 0, - bottom: 0), - padding: EdgeInsets.only( - left: 4.0, right: 4.0), - child: referredPatient.doctorImageURL != - null + margin: EdgeInsets.only(left: 0, top: 25, right: 0, bottom: 0), + padding: EdgeInsets.only(left: 4.0, right: 4.0), + child: referredPatient.doctorImageURL != null ? ClipRRect( - borderRadius: - BorderRadius.circular(20.0), + borderRadius: BorderRadius.circular(20.0), child: Image.network( referredPatient.doctorImageURL, height: 25, width: 30, - errorBuilder: - (BuildContext context, - Object exception, - StackTrace stackTrace) { + errorBuilder: (BuildContext context, Object exception, StackTrace stackTrace) { return Text('No Image'); }, )) : Container( child: Image.asset( - referredPatient.gender == 1 - ? 'assets/images/male_avatar.png' - : 'assets/images/female_avatar.png', + referredPatient.gender == 1 ? 'assets/images/male_avatar.png' : 'assets/images/female_avatar.png', fit: BoxFit.cover, ), ), @@ -415,30 +344,22 @@ class ReferredPatientDetailScreen extends StatelessWidget { Expanded( flex: 4, child: Container( - margin: EdgeInsets.only( - left: 10, - top: 30, - right: 10, - bottom: 0), + margin: EdgeInsets.only(left: 10, top: 30, right: 10, bottom: 0), child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( "${TranslationBase.of(context).dr} ${referredPatient.referralDoctorName}", fontFamily: 'Poppins', fontWeight: FontWeight.w800, - fontSize: 1.5 * - SizeConfig.textMultiplier, + fontSize: 1.5 * SizeConfig.textMultiplier, color: Colors.black, ), AppText( - referredPatient - .referralClinicDescription, + referredPatient.referralClinicDescription, fontFamily: 'Poppins', fontWeight: FontWeight.w700, - fontSize: 1.3 * - SizeConfig.textMultiplier, + fontSize: 1.3 * SizeConfig.textMultiplier, color: Color(0XFF2E303A), ), ], @@ -495,8 +416,7 @@ class ReferredPatientDetailScreen extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ Container( - margin: EdgeInsets.only( - left: 0, top: 0, right: 4, bottom: 0), + margin: EdgeInsets.only(left: 0, top: 0, right: 4, bottom: 0), padding: EdgeInsets.only(left: 4.0, right: 4.0), child: referredPatient.doctorImageURL != null ? ClipRRect( @@ -505,17 +425,13 @@ class ReferredPatientDetailScreen extends StatelessWidget { referredPatient.doctorImageURL, height: 25, width: 30, - errorBuilder: (BuildContext context, - Object exception, - StackTrace stackTrace) { + errorBuilder: (BuildContext context, Object exception, StackTrace stackTrace) { return Text('No Image'); }, )) : Container( child: Image.asset( - referredPatient.gender == 1 - ? 'assets/images/male_avatar.png' - : 'assets/images/female_avatar.png', + referredPatient.gender == 1 ? 'assets/images/male_avatar.png' : 'assets/images/female_avatar.png', fit: BoxFit.cover, ), ), @@ -532,15 +448,11 @@ class ReferredPatientDetailScreen extends StatelessWidget { color: Color(0XFF2E303A), ), AppText( - referredPatient.referredDoctorRemarks == - null + referredPatient.referredDoctorRemarks == null ? '' - : referredPatient.referredDoctorRemarks - .isNotEmpty - ? referredPatient - .referredDoctorRemarks - : TranslationBase.of(context) - .notRepliedYet, + : referredPatient.referredDoctorRemarks.isNotEmpty + ? referredPatient.referredDoctorRemarks + : TranslationBase.of(context).notRepliedYet, fontFamily: 'Poppins', fontWeight: FontWeight.w600, fontSize: 1.6 * SizeConfig.textMultiplier, @@ -576,8 +488,7 @@ class ReferredPatientDetailScreen extends StatelessWidget { if (model.state == ViewState.ErrorLocal) { DrAppToastMsg.showErrorToast(model.error); } else { - DrAppToastMsg.showSuccesToast( - "Referral is acknowledged"); + DrAppToastMsg.showSuccesToast("Referral is acknowledged"); Navigator.pop(context); } }, diff --git a/lib/screens/prescription/old_prescriptions_page.dart b/lib/screens/prescription/old_prescriptions_page.dart index f937c8b1..1b9ab395 100644 --- a/lib/screens/prescription/old_prescriptions_page.dart +++ b/lib/screens/prescription/old_prescriptions_page.dart @@ -1,6 +1,6 @@ import 'package:doctor_app_flutter/config/size_config.dart'; -import 'package:doctor_app_flutter/core/viewModel/prescription/prescription_view_model.dart'; import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/viewModel/prescription/prescription_view_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/prescription/prescriptions_items/prescription_items_in_patient.dart'; import 'package:doctor_app_flutter/screens/prescription/prescriptions_items/prescription_items_out_patient.dart'; @@ -15,6 +15,7 @@ import 'package:doctor_app_flutter/widgets/shared/user-guid/CusomRow.dart'; import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; + import '../../utils/utils.dart'; import '../../widgets/shared/errors/error_message.dart'; @@ -29,10 +30,7 @@ class OldPrescriptionsPage extends StatelessWidget { bool isFromLiveCare = routeArgs['isFromLiveCare']; return BaseView( onModelReady: (model) async { - patient.admissionNo == null - ? model.getPrescriptions(patient, - patientType: patientType, isLocalBusy: false) - : model.getMedicationForInPatient(patient); + patient.admissionNo == null ? model.getPrescriptions(patient, patientType: patientType, isLocalBusy: false) : model.getMedicationForInPatient(patient); }, builder: (_, model, w) => AppScaffold( baseViewModel: model, @@ -52,20 +50,18 @@ class OldPrescriptionsPage extends StatelessWidget { SizedBox( height: 12, ), - Padding( - padding: const EdgeInsets.all(8.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - ServiceTitle( - title: TranslationBase.of(context).orders, - subTitle: TranslationBase.of(context) - .prescriptions + "(${TranslationBase.of(context) - .old }) ", - ), - ], - ), + Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + ServiceTitle( + title: TranslationBase.of(context).orders, + subTitle: TranslationBase.of(context).prescriptions + "(${TranslationBase.of(context).old}) ", + ), + ], ), + ), ListView.builder( physics: BouncingScrollPhysics(), itemCount: model.prescriptionsList.length, @@ -76,8 +72,7 @@ class OldPrescriptionsPage extends StatelessWidget { context, FadePage( page: PrescriptionItemsPage( - prescriptions: model - .prescriptionsList[index], + prescriptions: model.prescriptionsList[index], patient: patient, arrivalType: arrivalType, ), @@ -86,143 +81,109 @@ class OldPrescriptionsPage extends StatelessWidget { child: Column( children: [ DoctorCard( - doctorName: - Utils.convertToTitleCase(model - .prescriptionsList[index] - .doctorName), - profileUrl: model - .prescriptionsList[index] - .doctorImageURL, - branch: model - .prescriptionsList[index].name, - clinic: model.prescriptionsList[index] - .clinicDescription, + doctorName: Utils.convertToTitleCase(model.prescriptionsList[index].doctorName), + profileUrl: model.prescriptionsList[index].doctorImageURL, + branch: model.prescriptionsList[index].name, + clinic: model.prescriptionsList[index].clinicDescription, isPrescriptions: true, - appointmentDate: AppDateUtils - .getDateTimeFromServerFormat( - model.prescriptionsList[index] - .appointmentDate, + appointmentDate: AppDateUtils.getDateTimeFromServerFormat( + model.prescriptionsList[index].appointmentDate, ), ), ], )); }), - if (model.prescriptionsList.isEmpty && - patient.patientStatusType != 43) + if (model.prescriptionsList.isEmpty && patient.patientStatusType != 43) Center( child: ErrorMessage( - error: TranslationBase.of(context) - .noPrescriptionsFound, + error: TranslationBase.of(context).noPrescriptionsFound, )) ], ), ), ) : Center( - child: FractionallySizedBox( - widthFactor: 0.9, - child: SingleChildScrollView( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - SizedBox( - height: 12, - ), - ServiceTitle( - title: TranslationBase.of(context).orders, - subTitle: TranslationBase.of(context) - .prescriptions + "(${TranslationBase.of(context) - .old }) ", - ), - model.medicationForInPatient.length == 0? - Center( - child: ErrorMessage( - error: TranslationBase.of(context) - .noPrescriptionsFound, - )): ListView.builder( - scrollDirection: Axis.vertical, - physics: NeverScrollableScrollPhysics(), - shrinkWrap: true, - itemCount: model.medicationForInPatient.length, - itemBuilder: (context, index) { - //model.medicationForInPatient.length, - return InkWell( - child: CardWithBgWidget( - bgColor: Colors.transparent, - widget: Column( - children: [ - CustomRow( - label: "", - value: Utils.convertToTitleCase(model - .medicationForInPatient[index] - .pHRItemDescription), - valueSize: SizeConfig - .getTextMultiplierBasedOnWidth() * - 3.5, - ), - SizedBox( - height: 10, - ), - CustomRow( - label: "Doctor Name :", - value: Utils.convertToTitleCase(model - .medicationForInPatient[index] - .doctorName - .toString()), - ), - CustomRow( - label: "Status :", - value: Utils.convertToTitleCase(model - .medicationForInPatient[index] - .statusDescription - .toString()), - ), - CustomRow( - label: "dose :", - value: Utils.convertToTitleCase(model - .medicationForInPatient[index] - .dose - .toString()), - ), CustomRow( - label: "comments :", - value: Utils.convertToTitleCase(model - .medicationForInPatient[index] - .comments - .toString()), - ), - - ], - ), - ), - onTap: () => Navigator.push( - context, - FadePage( - page: PrescriptionItemsInPatientPage( - prescriptionIndex: index, - prescriptions: - model.medicationForInPatient[index], - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - startOn: AppDateUtils - .getDateTimeFromServerFormat( - model.medicationForInPatient[index] - .startDatetime, + child: FractionallySizedBox( + widthFactor: 0.9, + child: SingleChildScrollView( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 12, + ), + ServiceTitle( + title: TranslationBase.of(context).orders, + subTitle: TranslationBase.of(context).prescriptions + "(${TranslationBase.of(context).old}) ", + ), + model.medicationForInPatient.length == 0 + ? Center( + child: ErrorMessage( + error: TranslationBase.of(context).noPrescriptionsFound, + )) + : ListView.builder( + scrollDirection: Axis.vertical, + physics: NeverScrollableScrollPhysics(), + shrinkWrap: true, + itemCount: model.medicationForInPatient.length, + itemBuilder: (context, index) { + //model.medicationForInPatient.length, + return InkWell( + child: CardWithBgWidget( + bgColor: Colors.transparent, + widget: Column( + children: [ + CustomRow( + label: "", + value: Utils.convertToTitleCase(model.medicationForInPatient[index].pHRItemDescription), + valueSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.5, + ), + SizedBox( + height: 10, + ), + CustomRow( + label: "Doctor Name :", + value: Utils.convertToTitleCase(model.medicationForInPatient[index].doctorName.toString()), + ), + CustomRow( + label: "Status :", + value: Utils.convertToTitleCase(model.medicationForInPatient[index].statusDescription.toString()), + ), + CustomRow( + label: "dose :", + value: Utils.convertToTitleCase(model.medicationForInPatient[index].dose.toString()), + ), + CustomRow( + label: "comments :", + value: Utils.convertToTitleCase(model.medicationForInPatient[index].comments.toString()), + ), + ], + ), ), - stopOn: AppDateUtils - .getDateTimeFromServerFormat( - model.medicationForInPatient[index] - .stopDatetime, + onTap: () => Navigator.push( + context, + FadePage( + page: PrescriptionItemsInPatientPage( + prescriptionIndex: index, + prescriptions: model.medicationForInPatient[index], + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + startOn: AppDateUtils.getDateTimeFromServerFormat( + model.medicationForInPatient[index].startDatetime, + ), + stopOn: AppDateUtils.getDateTimeFromServerFormat( + model.medicationForInPatient[index].stopDatetime, + ), + ), + ), ), - ), - ), - ), - ); - }), - ], + ); + }), + ], + ), ), ), - ), - ))); + ))); } } From 90382a1b278a7c09025b1e68fd4012f69dad0712 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Thu, 8 Jun 2023 11:46:19 +0300 Subject: [PATCH 10/28] Create Episode fixes --- .../soap_update/plan/update_plan_page.dart | 242 ++++++------------ 1 file changed, 82 insertions(+), 160 deletions(-) diff --git a/lib/screens/patients/profile/soap_update/plan/update_plan_page.dart b/lib/screens/patients/profile/soap_update/plan/update_plan_page.dart index 6336f8ed..b41cb4fe 100644 --- a/lib/screens/patients/profile/soap_update/plan/update_plan_page.dart +++ b/lib/screens/patients/profile/soap_update/plan/update_plan_page.dart @@ -4,15 +4,15 @@ import 'package:doctor_app_flutter/core/enum/view_state.dart'; import 'package:doctor_app_flutter/core/model/SOAP/progress_note/GetGetProgressNoteResModel.dart'; import 'package:doctor_app_flutter/core/model/SOAP/progress_note/get_progress_note_req_model.dart'; import 'package:doctor_app_flutter/core/model/SOAP/progress_note/post_progress_note_request_model.dart'; -import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; -import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; import 'package:doctor_app_flutter/core/model/doctor/doctor_profile_model.dart'; import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; +import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/plan/plan_call_back.dart'; import 'package:doctor_app_flutter/utils/date-utils.dart'; -import 'package:doctor_app_flutter/utils/utils.dart'; import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; +import 'package:doctor_app_flutter/utils/utils.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart'; @@ -30,31 +30,20 @@ class UpdatePlanPage extends StatefulWidget { final int currentIndex; - UpdatePlanPage( - {Key key, - this.changePageViewIndex, - this.patientInfo, - this.changeLoadingState, - this.currentIndex, - this.sOAPViewModel, - this.changeStateFun}); + UpdatePlanPage({Key key, this.changePageViewIndex, this.patientInfo, this.changeLoadingState, this.currentIndex, this.sOAPViewModel, this.changeStateFun}); @override _UpdatePlanPageState createState() => _UpdatePlanPageState(); } -class _UpdatePlanPageState extends State - implements PlanCallBack { +class _UpdatePlanPageState extends State implements PlanCallBack { bool isAddProgress = true; bool isProgressExpanded = true; - GetPatientProgressNoteResModel patientProgressNote = - GetPatientProgressNoteResModel(); + GetPatientProgressNoteResModel patientProgressNote = GetPatientProgressNoteResModel(); - TextEditingController progressNoteController = - TextEditingController(text: null); + TextEditingController progressNoteController = TextEditingController(text: null); - BoxDecoration containerBorderDecoration( - Color containerColor, Color borderColor) { + BoxDecoration containerBorderDecoration(Color containerColor, Color borderColor) { return BoxDecoration( color: containerColor, shape: BoxShape.rectangle, @@ -76,35 +65,25 @@ class _UpdatePlanPageState extends State } } - getPatientProgressNote(SOAPViewModel model, - {bool isAddProgress = false}) async { - GetProgressNoteReqModel getGetProgressNoteReqModel = - GetProgressNoteReqModel( - appointmentNo: - int.parse(widget.patientInfo.appointmentNo.toString()), - patientMRN: widget.patientInfo.patientMRN, - episodeID: widget.patientInfo.episodeNo.toString(), - editedBy: '', - doctorID: ''); - await widget.sOAPViewModel - .getPatientProgressNote(getGetProgressNoteReqModel); + getPatientProgressNote(SOAPViewModel model, {bool isAddProgress = false}) async { + GetProgressNoteReqModel getGetProgressNoteReqModel = GetProgressNoteReqModel( + appointmentNo: int.parse(widget.patientInfo.appointmentNo.toString()), + patientMRN: widget.patientInfo.patientMRN, + episodeID: widget.patientInfo.episodeNo.toString(), + editedBy: '', + doctorID: ''); + await widget.sOAPViewModel.getPatientProgressNote(getGetProgressNoteReqModel); ///TODO set progressNote in model; if (widget.sOAPViewModel.patientProgressNoteList.isNotEmpty) { - progressNoteController.text = Utils.parseHtmlString( - widget.sOAPViewModel.patientProgressNoteList[0].planNote); + progressNoteController.text = Utils.parseHtmlString(widget.sOAPViewModel.patientProgressNoteList[0].planNote); patientProgressNote.planNote = progressNoteController.text; - patientProgressNote.createdByName = - widget.sOAPViewModel.patientProgressNoteList[0].createdByName; - patientProgressNote.createdOn = - widget.sOAPViewModel.patientProgressNoteList[0].createdOn; - patientProgressNote.editedOn = - widget.sOAPViewModel.patientProgressNoteList[0].editedOn; - patientProgressNote.editedByName = - widget.sOAPViewModel.patientProgressNoteList[0].editedByName; - patientProgressNote.appointmentNo = - widget.sOAPViewModel.patientProgressNoteList[0].appointmentNo; + patientProgressNote.createdByName = widget.sOAPViewModel.patientProgressNoteList[0].createdByName; + patientProgressNote.createdOn = widget.sOAPViewModel.patientProgressNoteList[0].createdOn; + patientProgressNote.editedOn = widget.sOAPViewModel.patientProgressNoteList[0].editedOn; + patientProgressNote.editedByName = widget.sOAPViewModel.patientProgressNoteList[0].editedByName; + patientProgressNote.appointmentNo = widget.sOAPViewModel.patientProgressNoteList[0].appointmentNo; setState(() { isAddProgress = isAddProgress; widget.sOAPViewModel.isAddProgress = isAddProgress; @@ -118,31 +97,22 @@ class _UpdatePlanPageState extends State return BaseView( onModelReady: (model) async { widget.sOAPViewModel.setPlanCallBack(this); - GetProgressNoteReqModel getGetProgressNoteReqModel = - GetProgressNoteReqModel( - appointmentNo: - int.parse(widget.patientInfo.appointmentNo.toString()), - patientMRN: widget.patientInfo.patientMRN, - episodeID: widget.patientInfo.episodeNo.toString(), - editedBy: '', - doctorID: ''); - await widget.sOAPViewModel - .getPatientProgressNote(getGetProgressNoteReqModel); + GetProgressNoteReqModel getGetProgressNoteReqModel = GetProgressNoteReqModel( + appointmentNo: int.parse(widget.patientInfo.appointmentNo.toString()), + patientMRN: widget.patientInfo.patientMRN, + episodeID: widget.patientInfo.episodeNo.toString(), + editedBy: '', + doctorID: ''); + await widget.sOAPViewModel.getPatientProgressNote(getGetProgressNoteReqModel); if (widget.sOAPViewModel.patientProgressNoteList.isNotEmpty) { - progressNoteController.text = Utils.parseHtmlString( - widget.sOAPViewModel.patientProgressNoteList[0].planNote); + progressNoteController.text = Utils.parseHtmlString(widget.sOAPViewModel.patientProgressNoteList[0].planNote); patientProgressNote.planNote = progressNoteController.text; - patientProgressNote.createdByName = - widget.sOAPViewModel.patientProgressNoteList[0].createdByName; - patientProgressNote.createdOn = - widget.sOAPViewModel.patientProgressNoteList[0].createdOn; - patientProgressNote.editedOn = - widget.sOAPViewModel.patientProgressNoteList[0].editedOn; - patientProgressNote.editedByName = - widget.sOAPViewModel.patientProgressNoteList[0].editedByName; - patientProgressNote.appointmentNo = - widget.sOAPViewModel.patientProgressNoteList[0].appointmentNo; + patientProgressNote.createdByName = widget.sOAPViewModel.patientProgressNoteList[0].createdByName; + patientProgressNote.createdOn = widget.sOAPViewModel.patientProgressNoteList[0].createdOn; + patientProgressNote.editedOn = widget.sOAPViewModel.patientProgressNoteList[0].editedOn; + patientProgressNote.editedByName = widget.sOAPViewModel.patientProgressNoteList[0].editedByName; + patientProgressNote.appointmentNo = widget.sOAPViewModel.patientProgressNoteList[0].appointmentNo; widget.sOAPViewModel.progressNoteText = progressNoteController.text; setState(() { @@ -185,19 +155,16 @@ class _UpdatePlanPageState extends State children: [ if (isAddProgress) Container( - margin: EdgeInsets.only( - left: 10, right: 10, top: 15), + margin: EdgeInsets.only(left: 10, right: 10, top: 15), child: AppTextFieldCustom( - hintText: TranslationBase.of(context) - .progressNote, + hintText: TranslationBase.of(context).progressNote, controller: progressNoteController, minLines: 2, maxLines: 4, inputType: TextInputType.multiline, onChanged: (value) { setState(() { - patientProgressNote.planNote = - value; + patientProgressNote.planNote = value; model.progressNoteText = value; widget.changeStateFun(); }); @@ -207,73 +174,48 @@ class _UpdatePlanPageState extends State SizedBox( height: 9, ), - if (patientProgressNote.planNote != null && - !isAddProgress) + if (patientProgressNote.planNote != null && !isAddProgress) Container( margin: EdgeInsets.only( left: 5, right: 5, ), child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, children: [ Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - crossAxisAlignment: - CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.start, children: [ Row( children: [ AppText( 'Appointment No: ', - fontSize: SizeConfig - .getTextMultiplierBasedOnWidth() * - 3, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3, letterSpacing: -0.4, color: Color(0xFF575757), ), AppText( - patientProgressNote - .appointmentNo != - null - ? patientProgressNote - .appointmentNo - .toString() - : '', + patientProgressNote.appointmentNo != null ? patientProgressNote.appointmentNo.toString() : '', fontWeight: FontWeight.w600, letterSpacing: -0.48, color: Color(0xFF2B353E), - fontSize: SizeConfig - .getTextMultiplierBasedOnWidth() * - 3.6, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.6, ), ], ), AppText( - patientProgressNote.createdOn != - null - ? AppDateUtils - .getDayMonthYearDateFormatted( - DateTime.parse( - patientProgressNote - .createdOn)) - : AppDateUtils - .getDayMonthYearDateFormatted( - DateTime.now()), + patientProgressNote.createdOn != null + ? AppDateUtils.getDayMonthYearDateFormatted(DateTime.parse(patientProgressNote.createdOn)) + : AppDateUtils.getDayMonthYearDateFormatted(DateTime.now()), fontWeight: FontWeight.w600, - fontSize: SizeConfig - .getTextMultiplierBasedOnWidth() * - 3.6, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.6, ) ], ), Row( - mainAxisAlignment: - MainAxisAlignment.end, - crossAxisAlignment: - CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.end, + crossAxisAlignment: CrossAxisAlignment.start, children: [ // Row( // children: [ @@ -288,19 +230,10 @@ class _UpdatePlanPageState extends State // ], // ), AppText( - patientProgressNote.createdOn != - null - ? AppDateUtils.getHour( - DateTime.parse( - patientProgressNote - .createdOn)) - : AppDateUtils.getHour( - DateTime.now()), + patientProgressNote.createdOn != null ? AppDateUtils.getHour(DateTime.parse(patientProgressNote.createdOn)) : AppDateUtils.getHour(DateTime.now()), fontWeight: FontWeight.w600, color: Color(0xFF575757), - fontSize: SizeConfig - .getTextMultiplierBasedOnWidth() * - 3.6, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.6, ) ], ), @@ -308,8 +241,7 @@ class _UpdatePlanPageState extends State height: 8, ), Row( - mainAxisAlignment: - MainAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.start, children: [ Expanded( child: AppText( @@ -321,8 +253,7 @@ class _UpdatePlanPageState extends State onTap: () { setState(() { isAddProgress = true; - widget.sOAPViewModel - .isAddProgress = true; + widget.sOAPViewModel.isAddProgress = true; }); }, child: Icon( @@ -341,8 +272,7 @@ class _UpdatePlanPageState extends State isExpanded: isProgressExpanded, ), SizedBox( - height: SizeConfig.heightMultiplier * - (SizeConfig.isHeightVeryShort ? 20 : 10), + height: SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort ? 20 : 10), ), ], ), @@ -355,59 +285,51 @@ class _UpdatePlanPageState extends State submitPlan(SOAPViewModel model) async { if (progressNoteController.text.isNotEmpty) { widget.changeLoadingState(true); - PostProgressNoteRequestModel postProgressNoteRequestModel = - new PostProgressNoteRequestModel( - patientMRN: widget.patientInfo.patientMRN, - episodeId: widget.patientInfo.episodeNo, - appointmentNo: widget.patientInfo.appointmentNo, - planNote: patientProgressNote.planNote, - doctorID: widget.patientInfo.doctorId, - editedBy: ''); + PostProgressNoteRequestModel postProgressNoteRequestModel = new PostProgressNoteRequestModel( + patientMRN: widget.patientInfo.patientMRN, + episodeId: widget.patientInfo.episodeNo, + appointmentNo: widget.patientInfo.appointmentNo, + planNote: patientProgressNote.planNote, + doctorID: widget.patientInfo.doctorId, + editedBy: ''); if (widget.sOAPViewModel.patientProgressNoteList.isEmpty) { - await widget.sOAPViewModel - .postProgressNote(postProgressNoteRequestModel); + await widget.sOAPViewModel.postProgressNote(postProgressNoteRequestModel); } else { Map profile = await sharedPref.getObj(DOCTOR_PROFILE); DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile); postProgressNoteRequestModel.editedBy = doctorProfile.doctorID; - await widget.sOAPViewModel - .patchProgressNote(postProgressNoteRequestModel); + await widget.sOAPViewModel.patchProgressNote(postProgressNoteRequestModel); } if (widget.sOAPViewModel.state == ViewState.ErrorLocal) { Utils.showErrorToast(widget.sOAPViewModel.error); } else { - GetProgressNoteReqModel getGetProgressNoteReqModel = - GetProgressNoteReqModel( - appointmentNo: - int.parse(widget.patientInfo.appointmentNo.toString()), - patientMRN: widget.patientInfo.patientMRN, - episodeID: widget.patientInfo.episodeNo.toString(), - editedBy: '', - doctorID: ''); - await widget.sOAPViewModel - .getPatientProgressNote(getGetProgressNoteReqModel); + GetProgressNoteReqModel getGetProgressNoteReqModel = GetProgressNoteReqModel( + appointmentNo: int.parse(widget.patientInfo.appointmentNo.toString()), + patientMRN: widget.patientInfo.patientMRN, + episodeID: widget.patientInfo.episodeNo.toString(), + editedBy: '', + doctorID: ''); + await widget.sOAPViewModel.getPatientProgressNote(getGetProgressNoteReqModel); if (widget.sOAPViewModel.patientProgressNoteList.isNotEmpty) { - progressNoteController.text = Utils.parseHtmlString( - widget.sOAPViewModel.patientProgressNoteList[0].planNote); + progressNoteController.text = Utils.parseHtmlString(widget.sOAPViewModel.patientProgressNoteList[0].planNote); patientProgressNote.planNote = progressNoteController.text; - patientProgressNote.createdByName = - widget.sOAPViewModel.patientProgressNoteList[0].createdByName; - patientProgressNote.createdOn = - widget.sOAPViewModel.patientProgressNoteList[0].createdOn; - patientProgressNote.editedOn = - widget.sOAPViewModel.patientProgressNoteList[0].editedOn; - patientProgressNote.editedByName = - widget.sOAPViewModel.patientProgressNoteList[0].editedByName; - patientProgressNote.appointmentNo = - widget.sOAPViewModel.patientProgressNoteList[0].appointmentNo; + patientProgressNote.createdByName = widget.sOAPViewModel.patientProgressNoteList[0].createdByName; + patientProgressNote.createdOn = widget.sOAPViewModel.patientProgressNoteList[0].createdOn; + patientProgressNote.editedOn = widget.sOAPViewModel.patientProgressNoteList[0].editedOn; + patientProgressNote.editedByName = widget.sOAPViewModel.patientProgressNoteList[0].editedByName; + patientProgressNote.appointmentNo = widget.sOAPViewModel.patientProgressNoteList[0].appointmentNo; setState(() { isAddProgress = false; widget.sOAPViewModel.isAddProgress = false; }); } + + Navigator.of(context).pop(); + Utils.showErrorToast("Episode Created Successfully"); + } widget.changeLoadingState(false); } else { From 0861a0c79fa8dda088103ac2858c2f02114b1288 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Wed, 14 Jun 2023 15:28:14 +0300 Subject: [PATCH 11/28] updates --- lib/client/base_app_client.dart | 4 ++++ lib/config/config.dart | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/client/base_app_client.dart b/lib/client/base_app_client.dart index 3901554f..5b2a6c12 100644 --- a/lib/client/base_app_client.dart +++ b/lib/client/base_app_client.dart @@ -109,6 +109,10 @@ class BaseAppClient { // } body['DeviceTypeID'] = Platform.isAndroid ? 1 : 2; + + // body['DoctorID'] = 1002; //3844083 + // body['TokenID'] = "@dm!n"; + // print("ProjectID :"); // print(body['ProjectID']); print("URL : $url"); diff --git a/lib/config/config.dart b/lib/config/config.dart index 439bcc4b..bb448ee7 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -8,11 +8,11 @@ const BASE_URL_LIVE_CARE = 'https://livecare.hmg.com/'; // const BASE_URL = 'https://hmgwebservices.com/'; -// const BASE_URL = 'https://uat.hmgwebservices.com/'; +const BASE_URL = 'https://uat.hmgwebservices.com/'; // const BASE_URL = 'https://vidauat.cloudsolutions.com.sa/'; //Vida Plus URL -const BASE_URL = 'https://vidamergeuat.cloudsolutions.com.sa/'; //Vida Plus URL +// const BASE_URL = 'https://vidamergeuat.cloudsolutions.com.sa/'; //Vida Plus URL const PHARMACY_ITEMS_URL = "Services/Lists.svc/REST/GetPharmcyItems_Region_enh"; From 2b13d437575128317b9a378be5b93e89936d1fd9 Mon Sep 17 00:00:00 2001 From: Sultan khan <> Date: Thu, 17 Aug 2023 16:36:39 +0300 Subject: [PATCH 12/28] bug fixes --- lib/config/config.dart | 2 +- .../discharge_summary/GetDischargeSummaryReqModel.dart | 2 +- .../model/vte_assessment/vte_assessment_req_model.dart | 2 +- lib/core/service/VideoCallService.dart | 10 +++++----- lib/core/service/pending_order_service.dart | 4 ++-- .../viewModel/ER_sign_in/ER_sign_in_view_model.dart | 2 +- lib/core/viewModel/doctor_replay_view_model.dart | 2 +- lib/core/viewModel/patient_view_model.dart | 2 +- .../viewModel/profile/operation_report_view_model.dart | 2 +- .../patients/profile/diagnosis/diagnosis_screen.dart | 2 +- .../notes/nursing_note/nursing_note_screen.dart | 2 +- .../operation_report/update_operation_report.dart | 2 +- 12 files changed, 17 insertions(+), 17 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index bb448ee7..3bc3dda8 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -5,7 +5,7 @@ const ONLY_NUMBERS = "[0-9]"; const ONLY_LETTERS = "[a-zA-Z &'\"]"; const ONLY_DATE = "[0-9/]"; const BASE_URL_LIVE_CARE = 'https://livecare.hmg.com/'; - +// const BASE_URL_LIVE_CARE = 'https://livecareuat.hmg.com/'; // const BASE_URL = 'https://hmgwebservices.com/'; const BASE_URL = 'https://uat.hmgwebservices.com/'; diff --git a/lib/core/model/discharge_summary/GetDischargeSummaryReqModel.dart b/lib/core/model/discharge_summary/GetDischargeSummaryReqModel.dart index 3bc5f931..ccc686aa 100644 --- a/lib/core/model/discharge_summary/GetDischargeSummaryReqModel.dart +++ b/lib/core/model/discharge_summary/GetDischargeSummaryReqModel.dart @@ -23,7 +23,7 @@ class GetDischargeSummaryReqModel { data['AdmissionNo'] = this.admissionNo; data['PatientType'] = this.patientType; data['PatientTypeID'] = this.patientTypeID; - data['SetupID'] = "010266"; + data['isDentalAllowedBackend'] = false; return data; } diff --git a/lib/core/model/vte_assessment/vte_assessment_req_model.dart b/lib/core/model/vte_assessment/vte_assessment_req_model.dart index 1f0bd1fa..e17ae4ba 100644 --- a/lib/core/model/vte_assessment/vte_assessment_req_model.dart +++ b/lib/core/model/vte_assessment/vte_assessment_req_model.dart @@ -4,7 +4,7 @@ class VteAssessmentRequestModel { int transactionNo; VteAssessmentRequestModel( - {this.setupID = "010266", this.parameterGroup = 7, this.transactionNo}); + {this.setupID, this.parameterGroup = 7, this.transactionNo}); VteAssessmentRequestModel.fromJson(Map json) { setupID = json['SetupID']; diff --git a/lib/core/service/VideoCallService.dart b/lib/core/service/VideoCallService.dart index 94307ce6..0aa770ca 100644 --- a/lib/core/service/VideoCallService.dart +++ b/lib/core/service/VideoCallService.dart @@ -36,11 +36,11 @@ class VideoCallService extends BaseService { // TODO MOSA TEST kApiKey: '46209962', - // kToken: startCallRes.openTokenID, - // kSessionId: startCallRes.openSessionID, - - kToken: "T1==cGFydG5lcl9pZD00NjIwOTk2MiZzaWc9NjM4ZjgxNmFjZjI0ODU2YTk0YTMwMGIxMjFkNmZlY2E5OGJlYWNlZDpzZXNzaW9uX2lkPTJfTVg0ME5qSXdPVGsyTW41LU1UWTNNek0xTURFMk1qSTNPWDVZT0RGMWFVdElaRWRWVldGTlVGYzNObFYxVERWNFRFbC1mbjQmY3JlYXRlX3RpbWU9MTY3MzM1MDE2MiZub25jZT0wLjE5OTUyMjMwNzIyMDAyODczJnJvbGU9bW9kZXJhdG9yJmV4cGlyZV90aW1lPTE2NzM0MzY1NjImaW5pdGlhbF9sYXlvdXRfY2xhc3NfbGlzdD0=", - kSessionId: "2_MX40NjIwOTk2Mn5-MTY3MzM1MDE2MjI3OX5YODF1aUtIZEdVVWFNUFc3NlV1TDV4TEl-fn4", + kToken: startCallRes.openTokenID, + kSessionId: startCallRes.openSessionID, + // + // kToken: "T1==cGFydG5lcl9pZD00NjIwOTk2MiZzaWc9NzE0MGE4YzM0ZTU2YjQ5NmQzOTgwOTNkYmU1NzEzMmQxYTdkMDliZTpzZXNzaW9uX2lkPTFfTVg0ME5qSXdPVGsyTW41LU1UWTVNakkxTkRjMU1EUTRObjVCVFZsM2MwODFNV1ZhTjFsUlEyZGxiRFZxZVZjNWNHMS1mbjQmY3JlYXRlX3RpbWU9MTY5MjI1NDc1MCZub25jZT0wLjY5OTQyNzkzMTg1NDg4NSZyb2xlPW1vZGVyYXRvciZleHBpcmVfdGltZT0xNjkyMjU2NTUwJmluaXRpYWxfbGF5b3V0X2NsYXNzX2xpc3Q9", + // kSessionId: "1_MX40NjIwOTk2Mn5-MTY5MjI1NDc1MDQ4Nn5BTVl3c081MWVaN1lRQ2dlbDVqeVc5cG1-fn4", vcId: patient.vcId, isRecording: isRecording, diff --git a/lib/core/service/pending_order_service.dart b/lib/core/service/pending_order_service.dart index 17f6ea12..8f148f21 100644 --- a/lib/core/service/pending_order_service.dart +++ b/lib/core/service/pending_order_service.dart @@ -23,7 +23,7 @@ class PendingOrderService extends BaseService { admissionNo: admissionNo, patientTypeID: 1, patientType: 1, - setupID: "010266"); + ); hasError = false; await baseAppClient.post(GET_PENDING_ORDERS, @@ -50,7 +50,7 @@ class PendingOrderService extends BaseService { admissionNo: admissionNo, patientTypeID: 1, patientType: 1, - setupID: "010266"); + ); hasError = false; await baseAppClient.post(GET_ADMISSION_ORDERS, diff --git a/lib/core/viewModel/ER_sign_in/ER_sign_in_view_model.dart b/lib/core/viewModel/ER_sign_in/ER_sign_in_view_model.dart index 0bf10e76..02ddd1e8 100644 --- a/lib/core/viewModel/ER_sign_in/ER_sign_in_view_model.dart +++ b/lib/core/viewModel/ER_sign_in/ER_sign_in_view_model.dart @@ -27,7 +27,7 @@ class ERSignInViewModel extends BaseViewModel { Future signInERPatient({int patientId, int signInType}) async { hasError = false; await getDoctorProfile(); - DoctorErSignAssessmentReqModel doctorErSignAssessmentReqModel = new DoctorErSignAssessmentReqModel(setupID:"010266", signInType:signInType, loginDoctorID:doctorProfile.doctorID, patientID: patientId ); + DoctorErSignAssessmentReqModel doctorErSignAssessmentReqModel = new DoctorErSignAssessmentReqModel(signInType:signInType, loginDoctorID:doctorProfile.doctorID, patientID: patientId ); setState(ViewState.BusyLocal); await _ERSignInService.signInERPatient(doctorErSignAssessmentReqModel: doctorErSignAssessmentReqModel); if (_ERSignInService.hasError) { diff --git a/lib/core/viewModel/doctor_replay_view_model.dart b/lib/core/viewModel/doctor_replay_view_model.dart index 4cc51635..86c04528 100644 --- a/lib/core/viewModel/doctor_replay_view_model.dart +++ b/lib/core/viewModel/doctor_replay_view_model.dart @@ -55,7 +55,7 @@ class DoctorReplayViewModel extends BaseViewModel { infoStatus: 6, createdBy: this.doctorProfile.doctorID, infoEnteredBy: this.doctorProfile.doctorID, - setupID: "010266"); + ); setState(ViewState.BusyLocal); await _doctorReplyService.createDoctorResponse(createDoctorResponseModel); if (_doctorReplyService.hasError) { diff --git a/lib/core/viewModel/patient_view_model.dart b/lib/core/viewModel/patient_view_model.dart index daf25bac..e21be54a 100644 --- a/lib/core/viewModel/patient_view_model.dart +++ b/lib/core/viewModel/patient_view_model.dart @@ -354,7 +354,7 @@ class PatientViewModel extends BaseViewModel { patientTypeID: 1, patientType: 1, resultType: resultType, - setupID: "010266"); + ); await _patientService.getDiabeticChartValues(requestModel); if (_patientService.hasError) { error = _patientService.error; diff --git a/lib/core/viewModel/profile/operation_report_view_model.dart b/lib/core/viewModel/profile/operation_report_view_model.dart index 944995b2..dab6b5fd 100644 --- a/lib/core/viewModel/profile/operation_report_view_model.dart +++ b/lib/core/viewModel/profile/operation_report_view_model.dart @@ -38,7 +38,7 @@ class OperationReportViewModel extends BaseViewModel { GetOperationDetailsRequestModel( reservationNo: reservation.oTReservationID, patientID: reservation.patientID, - setupID: "010266"); + ); await _operationReportService.getOperationReportDetails( getOperationReportRequestModel: getOperationReportRequestModel); if (_operationReportService.hasError) { diff --git a/lib/screens/patients/profile/diagnosis/diagnosis_screen.dart b/lib/screens/patients/profile/diagnosis/diagnosis_screen.dart index d7fbc46f..07fe70d1 100644 --- a/lib/screens/patients/profile/diagnosis/diagnosis_screen.dart +++ b/lib/screens/patients/profile/diagnosis/diagnosis_screen.dart @@ -42,7 +42,7 @@ class _ProgressNoteState extends State { admissionNo: int.parse(patient.admissionNo), patientTypeID: patient.patientType, patientID: patient.patientId, - setupID: "010266"); + ); model.getDiagnosisForInPatient(getDiagnosisForInPatientRequestModel); } diff --git a/lib/screens/patients/profile/notes/nursing_note/nursing_note_screen.dart b/lib/screens/patients/profile/notes/nursing_note/nursing_note_screen.dart index 37cdd870..df5b5b47 100644 --- a/lib/screens/patients/profile/notes/nursing_note/nursing_note_screen.dart +++ b/lib/screens/patients/profile/notes/nursing_note/nursing_note_screen.dart @@ -45,7 +45,7 @@ class _ProgressNoteState extends State { admissionNo: int.parse(patient.admissionNo), patientTypeID: patient.patientType, patientID: patient.patientId, - setupID: "010266"); + ); model.getNursingProgressNote(getNursingProgressNoteRequestModel); } diff --git a/lib/screens/patients/profile/operation_report/update_operation_report.dart b/lib/screens/patients/profile/operation_report/update_operation_report.dart index 62536bb3..c15a3f88 100644 --- a/lib/screens/patients/profile/operation_report/update_operation_report.dart +++ b/lib/screens/patients/profile/operation_report/update_operation_report.dart @@ -591,7 +591,7 @@ class _UpdateOperationReportState extends State { widget.patient.admissionNo), createdBy: model.doctorProfile.doctorID, - setupID: "010266"); + ); await model.updateOperationReport( createUpdateOperationReportRequestModel); From c50100613a86ec025c8ca53297c709cf75461d9a Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Sun, 20 Aug 2023 09:15:33 +0300 Subject: [PATCH 13/28] updates --- lib/client/base_app_client.dart | 1 + .../admissionRequest/admission-request.dart | 19 +- .../patients/DischargedPatientPage.dart | 270 ++------ .../admission_request_first_screen.dart | 199 ++---- .../subjective/medication/add_medication.dart | 586 +++++++----------- .../shared/dialogs/master_key_dailog.dart | 4 +- 6 files changed, 370 insertions(+), 709 deletions(-) diff --git a/lib/client/base_app_client.dart b/lib/client/base_app_client.dart index 5b2a6c12..ed5a202e 100644 --- a/lib/client/base_app_client.dart +++ b/lib/client/base_app_client.dart @@ -126,6 +126,7 @@ class BaseAppClient { onFailure(Utils.generateContactAdminMsg(), statusCode); } else { var parsed = json.decode(response.body.toString()); + print("Response : $parsed"); if (parsed['ErrorType'] == 4) { helpers.navigateToUpdatePage(parsed['ErrorEndUserMessage'], parsed['AndroidLink'], parsed['IOSLink']); } diff --git a/lib/core/model/admissionRequest/admission-request.dart b/lib/core/model/admissionRequest/admission-request.dart index 1ab5a990..dc78f7af 100644 --- a/lib/core/model/admissionRequest/admission-request.dart +++ b/lib/core/model/admissionRequest/admission-request.dart @@ -23,6 +23,7 @@ class AdmissionRequest { bool isDietType; int dietType; String dietRemarks; + String diagnosis; bool isPhysicalActivityModification; String physicalActivityModificationComments; int orStatus; @@ -66,6 +67,7 @@ class AdmissionRequest { this.isDietType, this.dietType, this.dietRemarks, + this.diagnosis, this.isPhysicalActivityModification = false, this.physicalActivityModificationComments = "", this.orStatus = 1, @@ -109,9 +111,9 @@ class AdmissionRequest { isDietType = json['isDietType']; dietType = json['dietType']; dietRemarks = json['dietRemarks']; + diagnosis = json['diagnosis']; isPhysicalActivityModification = json['isPhysicalActivityModification']; - physicalActivityModificationComments = - json['physicalActivityModificationComments']; + physicalActivityModificationComments = json['physicalActivityModificationComments']; orStatus = json['orStatus']; mainLineOfTreatment = json['mainLineOfTreatment']; estimatedCost = json['estimatedCost']; @@ -164,16 +166,14 @@ class AdmissionRequest { data['transportComments'] = this.transportComments; data['isPhysioAppointmentNeeded'] = this.isPhysioAppointmentNeeded; data['physioAppointmentComments'] = this.physioAppointmentComments; - data['isOPDFollowupAppointmentNeeded'] = - this.isOPDFollowupAppointmentNeeded; + data['isOPDFollowupAppointmentNeeded'] = this.isOPDFollowupAppointmentNeeded; data['opdFollowUpComments'] = this.opdFollowUpComments; data['isDietType'] = this.isDietType; data['dietType'] = this.dietType; data['dietRemarks'] = this.dietRemarks; - data['isPhysicalActivityModification'] = - this.isPhysicalActivityModification; - data['physicalActivityModificationComments'] = - this.physicalActivityModificationComments; + data['diagnosis'] = this.diagnosis; + data['isPhysicalActivityModification'] = this.isPhysicalActivityModification; + data['physicalActivityModificationComments'] = this.physicalActivityModificationComments; data['orStatus'] = this.orStatus; data['mainLineOfTreatment'] = this.mainLineOfTreatment; data['estimatedCost'] = this.estimatedCost; @@ -189,8 +189,7 @@ class AdmissionRequest { // this.admissionRequestDiagnoses.map((v) => v.toJson()).toList(); } if (this.admissionRequestProcedures != null) { - data['admissionRequestProcedures'] = - this.admissionRequestProcedures.map((v) => v.toJson()).toList(); + data['admissionRequestProcedures'] = this.admissionRequestProcedures.map((v) => v.toJson()).toList(); } data['appointmentNo'] = this.appointmentNo; data['episodeID'] = this.episodeID; diff --git a/lib/screens/patients/DischargedPatientPage.dart b/lib/screens/patients/DischargedPatientPage.dart index 778bd1bf..546a331b 100644 --- a/lib/screens/patients/DischargedPatientPage.dart +++ b/lib/screens/patients/DischargedPatientPage.dart @@ -72,136 +72,70 @@ class _DischargedPatientState extends State { model.filterData.length, (index) => InkWell( onTap: () { - Navigator.of(context).pushNamed( - PATIENTS_PROFILE, - arguments: { - "patient": - model.filterData[index], - "patientType": "1", - "isSearch": false, - "isInpatient": true, - "isDischargedPatient": true - }); + Navigator.of(context).pushNamed(PATIENTS_PROFILE, + arguments: {"patient": model.filterData[index], "patientType": "1", "isSearch": false, "isInpatient": true, "isDischargedPatient": true}); }, child: Container( width: double.maxFinite, margin: EdgeInsets.all(8), - padding: EdgeInsets.only( - left: 0, - right: 5, - bottom: 5, - top: 5), + padding: EdgeInsets.only(left: 0, right: 5, bottom: 5, top: 5), decoration: BoxDecoration( - borderRadius: - BorderRadius.circular(15), + borderRadius: BorderRadius.circular(15), color: Colors.white, ), child: Column( children: [ Padding( - padding: EdgeInsets.only( - left: 12.0), + padding: EdgeInsets.only(left: 12.0), child: Row( - mainAxisAlignment: - MainAxisAlignment - .spaceBetween, + mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Row(children: [ Container( width: 170, child: AppText( - (Utils.capitalize(model - .filterData[ - index] - .firstName) + - " " + - Utils.capitalize(model - .filterData[ - index] - .lastName)), + (Utils.capitalize(model.filterData[index].firstName) + " " + Utils.capitalize(model.filterData[index].lastName)), fontSize: 16, - fontWeight: - FontWeight - .bold, - fontFamily: - 'Poppins', - textOverflow: - TextOverflow - .ellipsis, + fontWeight: FontWeight.bold, + fontFamily: 'Poppins', + textOverflow: TextOverflow.ellipsis, ), ), - model.filterData[index] - .gender == - 1 + model.filterData[index].gender == 1 ? Icon( - DoctorApp - .male_2, - color: Colors - .blue, + DoctorApp.male_2, + color: Colors.blue, ) : Icon( - DoctorApp - .female_1, - color: Colors - .pink, + DoctorApp.female_1, + color: Colors.pink, ), ]), Row( children: [ AppText( - model.filterData[index].nationalityName != - null - ? model - .filterData[ - index] - .nationalityName - .trim() - : model.filterData[index].nationality != - null - ? model - .filterData[ - index] - .nationality - .trim() - : model.filterData[index].nationalityId != - null + model.filterData[index].nationalityName != null + ? model.filterData[index].nationalityName.trim() + : model.filterData[index].nationality != null + ? model.filterData[index].nationality.trim() + : model.filterData[index].nationalityId != null ? model.filterData[index].nationalityId : "", - fontWeight: - FontWeight - .bold, + fontWeight: FontWeight.bold, fontSize: 14, - textOverflow: - TextOverflow - .ellipsis, + textOverflow: TextOverflow.ellipsis, ), - model.filterData[index].nationality != - null || - model.filterData[index].nationalityId != - null + model.filterData[index].nationality != null || model.filterData[index].nationalityId != null ? ClipRRect( - borderRadius: - BorderRadius.circular( - 20.0), - child: Image - .network( - model.filterData[index].nationalityFlagURL != - null - ? model.filterData[index].nationalityFlagURL - : '', - height: - 25, - width: - 30, - errorBuilder: (BuildContext context, - Object - exception, - StackTrace - stackTrace) { + borderRadius: BorderRadius.circular(20.0), + child: Image.network( + model.filterData[index].nationalityFlagURL != null ? model.filterData[index].nationalityFlagURL : '', + height: 25, + width: 30, + errorBuilder: (BuildContext context, Object exception, StackTrace stackTrace) { return AppText( '', - fontSize: - 10, + fontSize: 10, ); }, )) @@ -213,26 +147,16 @@ class _DischargedPatientState extends State { Row( children: [ Column( - mainAxisAlignment: - MainAxisAlignment - .start, + mainAxisAlignment: MainAxisAlignment.start, children: [ Padding( - padding: - EdgeInsets.only( - left: 12.0), + padding: EdgeInsets.only(left: 12.0), child: Container( width: 60, height: 60, - child: - Image.asset( - model.filterData[index] - .gender == - 1 - ? 'assets/images/male_avatar.png' - : 'assets/images/female_avatar.png', - fit: BoxFit - .cover, + child: Image.asset( + model.filterData[index].gender == 1 ? 'assets/images/male_avatar.png' : 'assets/images/female_avatar.png', + fit: BoxFit.cover, ), ), ), @@ -243,118 +167,57 @@ class _DischargedPatientState extends State { ), Expanded( child: Column( - crossAxisAlignment: - CrossAxisAlignment - .start, + crossAxisAlignment: CrossAxisAlignment.start, children: [ Container( child: RichText( - text: + text: new TextSpan( + style: new TextStyle(fontSize: 2.0 * SizeConfig.textMultiplier, color: Colors.black), + children: [ + new TextSpan(text: TranslationBase.of(context).fileNumber, style: TextStyle(fontSize: 14, fontFamily: 'Poppins')), new TextSpan( - style: new TextStyle( - fontSize: 2.0 * - SizeConfig - .textMultiplier, - color: Colors - .black), - children: < - TextSpan>[ - new TextSpan( - text: TranslationBase.of(context) - .fileNumber, - style: TextStyle( - fontSize: - 14, - fontFamily: - 'Poppins')), - new TextSpan( - text: model - .filterData[ - index] - .patientId - .toString(), - style: TextStyle( - fontWeight: FontWeight - .w700, - fontFamily: - 'Poppins', - fontSize: - 15)), + text: model.filterData[index].patientId.toString(), + style: TextStyle(fontWeight: FontWeight.w700, fontFamily: 'Poppins', fontSize: 15)), ], ), ), ), Container( child: RichText( - text: - new TextSpan( - style: - new TextStyle( - fontSize: 2.0 * - SizeConfig - .textMultiplier, - color: Colors - .black, - fontFamily: - 'Poppins', + text: new TextSpan( + style: new TextStyle( + fontSize: 2.0 * SizeConfig.textMultiplier, + color: Colors.black, + fontFamily: 'Poppins', ), - children: < - TextSpan>[ + children: [ new TextSpan( - text: model.filterData[index].admissionDate == - null - ? "" - : TranslationBase.of(context).admissionDate + - " : ", - style: TextStyle( - fontSize: - 14)), + text: model.filterData[index].admissionDate == null ? "" : TranslationBase.of(context).admissionDate + " : ", + style: TextStyle(fontSize: 14)), new TextSpan( - text: model.filterData[index].admissionDate == - null + text: model.filterData[index].admissionDate == null ? "" : "${AppDateUtils.convertDateFromServerFormat(model.filterData[index].admissionDate.toString(), 'yyyy-MM-dd')}", - style: TextStyle( - fontWeight: - FontWeight.w700, - fontSize: 15)), + style: TextStyle(fontWeight: FontWeight.w700, fontSize: 15)), ], ), ), ), Container( child: RichText( - text: - new TextSpan( - style: - new TextStyle( - fontSize: 2.0 * - SizeConfig - .textMultiplier, - color: Colors - .black, - fontFamily: - 'Poppins', + text: new TextSpan( + style: new TextStyle( + fontSize: 2.0 * SizeConfig.textMultiplier, + color: Colors.black, + fontFamily: 'Poppins', ), - children: < - TextSpan>[ - new TextSpan( - text: model.filterData[index].dischargeDate == - null - ? "" - : "Discharge Date : ", - style: TextStyle( - fontSize: - 14)), + children: [ + new TextSpan(text: model.filterData[index].dischargeDate == null ? "" : "Discharge Date : ", style: TextStyle(fontSize: 14)), new TextSpan( - text: model.filterData[index].dischargeDate == - null + text: model.filterData[index].dischargeDate == null ? "" : "${AppDateUtils.convertDateFromServerFormat(model.filterData[index].dischargeDate.toString(), 'yyyy-MM-dd')}", - style: TextStyle( - fontWeight: - FontWeight.w700, - fontSize: 15)), + style: TextStyle(fontWeight: FontWeight.w700, fontSize: 15)), ], ), ), @@ -364,17 +227,12 @@ class _DischargedPatientState extends State { AppText( "${TranslationBase.of(context).numOfDays}: ", fontSize: 14, - fontWeight: - FontWeight - .w300, + fontWeight: FontWeight.w300, ), AppText( "${AppDateUtils.convertStringToDate(model.filterData[index].dischargeDate).difference(AppDateUtils.getDateTimeFromServerFormat(model.filterData[index].admissionDate)).inDays + 1}", - fontSize: - 15, - fontWeight: - FontWeight - .w700), + fontSize: 15, + fontWeight: FontWeight.w700), ], ), ], diff --git a/lib/screens/patients/profile/admission_request/admission_request_first_screen.dart b/lib/screens/patients/profile/admission_request/admission_request_first_screen.dart index 4f7c61e9..4668222a 100644 --- a/lib/screens/patients/profile/admission_request/admission_request_first_screen.dart +++ b/lib/screens/patients/profile/admission_request/admission_request_first_screen.dart @@ -26,12 +26,10 @@ import '../../../../routes.dart'; class AdmissionRequestFirstScreen extends StatefulWidget { @override - _AdmissionRequestThirdScreenState createState() => - _AdmissionRequestThirdScreenState(); + _AdmissionRequestThirdScreenState createState() => _AdmissionRequestThirdScreenState(); } -class _AdmissionRequestThirdScreenState - extends State { +class _AdmissionRequestThirdScreenState extends State { final _dietTypeRemarksController = TextEditingController(); final _sickLeaveCommentsController = TextEditingController(); final _postMedicalHistoryController = TextEditingController(); @@ -92,8 +90,7 @@ class _AdmissionRequestThirdScreenState height: 15, ), Container( - margin: - EdgeInsets.symmetric(vertical: 0, horizontal: 16), + margin: EdgeInsets.symmetric(vertical: 0, horizontal: 16), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -120,45 +117,27 @@ class _AdmissionRequestThirdScreenState : _selectedClinic['clinicNameEnglish'] : null, enabled: false, - onClick: model.clinicList != null && - model.clinicList.length > 0 + onClick: model.clinicList != null && model.clinicList.length > 0 ? () { - openListDialogField( - projectViewModel.isArabic - ? 'clinicNameArabic' - : 'clinicNameEnglish', - 'clinicID', - model.clinicList, (selectedValue) { + openListDialogField(projectViewModel.isArabic ? 'clinicNameArabic' : 'clinicNameEnglish', 'clinicID', model.clinicList, (selectedValue) { setState(() { _selectedClinic = selectedValue; }); }); } : () async { - GifLoaderDialogUtils.showMyDialog( - context); - await model.getClinics().then((_) => - GifLoaderDialogUtils.hideDialog( - context)); - if (model.state == ViewState.Idle && - model.clinicList.length > 0) { - openListDialogField( - projectViewModel.isArabic - ? 'clinicNameArabic' - : 'clinicNameEnglish', - 'clinicID', - model.clinicList, (selectedValue) { + GifLoaderDialogUtils.showMyDialog(context); + await model.getClinics().then((_) => GifLoaderDialogUtils.hideDialog(context)); + if (model.state == ViewState.Idle && model.clinicList.length > 0) { + openListDialogField(projectViewModel.isArabic ? 'clinicNameArabic' : 'clinicNameEnglish', 'clinicID', model.clinicList, (selectedValue) { setState(() { _selectedClinic = selectedValue; }); }); - } else if (model.state == - ViewState.ErrorLocal) { - DrAppToastMsg.showErrorToast( - model.error); + } else if (model.state == ViewState.ErrorLocal) { + DrAppToastMsg.showErrorToast(model.error); } else { - DrAppToastMsg.showErrorToast( - "Empty List"); + DrAppToastMsg.showErrorToast("Empty List"); } }, ), @@ -169,47 +148,31 @@ class _AdmissionRequestThirdScreenState height: screenSize.height * 0.075, hintText: TranslationBase.of(context).doctor, isTextFieldHasSuffix: true, - dropDownText: _selectedDoctor != null - ? _selectedDoctor['DoctorName'] - : null, + dropDownText: _selectedDoctor != null ? _selectedDoctor['DoctorName'] : null, enabled: false, validationError: doctorError, onClick: _selectedClinic != null - ? model.doctorsList != null && - model.doctorsList.length > 0 + ? model.doctorsList != null && model.doctorsList.length > 0 ? () { - openListDialogField('DoctorName', - 'DoctorID', model.doctorsList, - (selectedValue) { + openListDialogField('DoctorName', 'DoctorID', model.doctorsList, (selectedValue) { setState(() { _selectedDoctor = selectedValue; }); }); } : () async { - GifLoaderDialogUtils.showMyDialog( - context); - await model - .getClinicDoctors( - _selectedClinic['clinicID']) - .then((_) => GifLoaderDialogUtils - .hideDialog(context)); - if (model.state == ViewState.Idle && - model.doctorsList.length > 0) { - openListDialogField('DoctorName', - 'DoctorID', model.doctorsList, - (selectedValue) { + GifLoaderDialogUtils.showMyDialog(context); + await model.getClinicDoctors(_selectedClinic['clinicID']).then((_) => GifLoaderDialogUtils.hideDialog(context)); + if (model.state == ViewState.Idle && model.doctorsList.length > 0) { + openListDialogField('DoctorName', 'DoctorID', model.doctorsList, (selectedValue) { setState(() { _selectedDoctor = selectedValue; }); }); - } else if (model.state == - ViewState.ErrorLocal) { - DrAppToastMsg.showErrorToast( - model.error); + } else if (model.state == ViewState.ErrorLocal) { + DrAppToastMsg.showErrorToast(model.error); } else { - DrAppToastMsg.showErrorToast( - "Empty List"); + DrAppToastMsg.showErrorToast("Empty List"); } } : null, @@ -241,8 +204,7 @@ class _AdmissionRequestThirdScreenState _patientPregnant = newValue; }); }, - controlAffinity: - ListTileControlAffinity.leading, + controlAffinity: ListTileControlAffinity.leading, contentPadding: EdgeInsets.all(0), ), CheckboxListTile( @@ -266,8 +228,7 @@ class _AdmissionRequestThirdScreenState height: 8, ), AppTextFieldCustom( - hintText: - TranslationBase.of(context).sickLeaveComments, + hintText: TranslationBase.of(context).sickLeaveComments, controller: _sickLeaveCommentsController, minLines: 2, maxLines: 4, @@ -282,45 +243,29 @@ class _AdmissionRequestThirdScreenState hintText: TranslationBase.of(context).dietType, isTextFieldHasSuffix: true, validationError: dietTypeError, - dropDownText: _selectedDietType != null - ? _selectedDietType['nameEn'] - : null, + dropDownText: _selectedDietType != null ? _selectedDietType['nameEn'] : null, enabled: false, - onClick: model.dietTypesList != null && - model.dietTypesList.length > 0 + onClick: model.dietTypesList != null && model.dietTypesList.length > 0 ? () { - openListDialogField( - 'nameEn', 'id', model.dietTypesList, - (selectedValue) { + openListDialogField('nameEn', 'id', model.dietTypesList, (selectedValue) { setState(() { _selectedDietType = selectedValue; }); }); } : () async { - GifLoaderDialogUtils.showMyDialog( - context); - await model - .getDietTypes(patient.patientId) - .then((_) => - GifLoaderDialogUtils.hideDialog( - context)); - if (model.state == ViewState.Idle && - model.dietTypesList.length > 0) { - openListDialogField( - 'nameEn', 'id', model.dietTypesList, - (selectedValue) { + GifLoaderDialogUtils.showMyDialog(context); + await model.getDietTypes(patient.patientId).then((_) => GifLoaderDialogUtils.hideDialog(context)); + if (model.state == ViewState.Idle && model.dietTypesList.length > 0) { + openListDialogField('nameEn', 'id', model.dietTypesList, (selectedValue) { setState(() { _selectedDietType = selectedValue; }); }); - } else if (model.state == - ViewState.ErrorLocal) { - DrAppToastMsg.showErrorToast( - model.error); + } else if (model.state == ViewState.ErrorLocal) { + DrAppToastMsg.showErrorToast(model.error); } else { - DrAppToastMsg.showErrorToast( - "Empty List"); + DrAppToastMsg.showErrorToast("Empty List"); } }, ), @@ -328,8 +273,7 @@ class _AdmissionRequestThirdScreenState height: 10, ), AppTextFieldCustom( - hintText: - TranslationBase.of(context).dietTypeRemarks, + hintText: TranslationBase.of(context).dietTypeRemarks, controller: _dietTypeRemarksController, minLines: 4, maxLines: 6, @@ -339,8 +283,7 @@ class _AdmissionRequestThirdScreenState height: 10, ), AppTextFieldCustom( - hintText: TranslationBase.of(context) - .pastMedicalHistory, + hintText: TranslationBase.of(context).pastMedicalHistory, controller: _postMedicalHistoryController, minLines: 4, maxLines: 6, @@ -351,8 +294,7 @@ class _AdmissionRequestThirdScreenState height: 10, ), AppTextFieldCustom( - hintText: TranslationBase.of(context) - .pastSurgicalHistory, + hintText: TranslationBase.of(context).pastSurgicalHistory, controller: _postSurgicalHistoryController, minLines: 2, maxLines: 4, @@ -385,80 +327,56 @@ class _AdmissionRequestThirdScreenState _sickLeaveCommentsController.text != "" && _postMedicalHistoryController.text != "" && _postSurgicalHistoryController.text != "") { - model.admissionRequestData.patientMRN = - patient.patientMRN; - model.admissionRequestData.appointmentNo = - patient.appointmentNo; + model.admissionRequestData.patientMRN = patient.patientMRN; + model.admissionRequestData.appointmentNo = patient.appointmentNo; model.admissionRequestData.episodeID = patient.episodeNo; model.admissionRequestData.admissionRequestNo = 0; - model.admissionRequestData.admitToClinic = - _selectedClinic['clinicID']; - model.admissionRequestData.mrpDoctorID = - _selectedDoctor['DoctorID']; + model.admissionRequestData.admitToClinic = _selectedClinic['clinicID']; + model.admissionRequestData.mrpDoctorID = _selectedDoctor['DoctorID']; model.admissionRequestData.isPregnant = _patientPregnant; - model.admissionRequestData.isSickLeaveRequired = - _isSickLeaveRequired; - model.admissionRequestData.sickLeaveComments = - _sickLeaveCommentsController.text; - model.admissionRequestData.isDietType = - _selectedDietType != null ? true : false; - model.admissionRequestData.dietType = - _selectedDietType != null - ? _selectedDietType['id'] - : 0; - model.admissionRequestData.dietRemarks = - _dietTypeRemarksController.text; - model.admissionRequestData.pastMedicalHistory = - _postMedicalHistoryController.text; - model.admissionRequestData.pastSurgicalHistory = - _postSurgicalHistoryController.text; + model.admissionRequestData.isSickLeaveRequired = _isSickLeaveRequired; + model.admissionRequestData.sickLeaveComments = _sickLeaveCommentsController.text; + model.admissionRequestData.isDietType = _selectedDietType != null ? true : false; + model.admissionRequestData.dietType = _selectedDietType != null ? _selectedDietType['id'] : 0; + model.admissionRequestData.dietRemarks = _dietTypeRemarksController.text; + model.admissionRequestData.diagnosis = "0"; + model.admissionRequestData.pastMedicalHistory = _postMedicalHistoryController.text; + model.admissionRequestData.pastSurgicalHistory = _postSurgicalHistoryController.text; Navigator.of(context) - .pushNamed(PATIENT_ADMISSION_REQUEST_2, arguments: { - 'patient': patient, - 'patientType': patientType, - 'arrivalType': arrivalType, - 'admission-data': model.admissionRequestData - }); + .pushNamed(PATIENT_ADMISSION_REQUEST_2, arguments: {'patient': patient, 'patientType': patientType, 'arrivalType': arrivalType, 'admission-data': model.admissionRequestData}); } else { - DrAppToastMsg.showErrorToast( - TranslationBase.of(context).pleaseFill); + DrAppToastMsg.showErrorToast(TranslationBase.of(context).pleaseFill); setState(() { if (_selectedClinic == null) { - clinicError = - TranslationBase.of(context).fieldRequired; + clinicError = TranslationBase.of(context).fieldRequired; } else { clinicError = null; } if (_selectedDoctor == null) { - doctorError = - TranslationBase.of(context).fieldRequired; + doctorError = TranslationBase.of(context).fieldRequired; } else { doctorError = null; } if (_sickLeaveCommentsController.text == "") { - sickLeaveCommentError = - TranslationBase.of(context).fieldRequired; + sickLeaveCommentError = TranslationBase.of(context).fieldRequired; } else { sickLeaveCommentError = null; } if (_selectedDietType == null) { - dietTypeError = - TranslationBase.of(context).fieldRequired; + dietTypeError = TranslationBase.of(context).fieldRequired; } else { dietTypeError = null; } if (_postMedicalHistoryController.text == "") { - medicalHistoryError = - TranslationBase.of(context).fieldRequired; + medicalHistoryError = TranslationBase.of(context).fieldRequired; } else { medicalHistoryError = null; } if (_postSurgicalHistoryController.text == "") { - surgicalHistoryError = - TranslationBase.of(context).fieldRequired; + surgicalHistoryError = TranslationBase.of(context).fieldRequired; } else { surgicalHistoryError = null; } @@ -470,8 +388,7 @@ class _AdmissionRequestThirdScreenState ); } - void openListDialogField(String attributeName, String attributeValueId, - List list, Function(dynamic selectedValue) okFunction) { + void openListDialogField(String attributeName, String attributeValueId, List list, Function(dynamic selectedValue) okFunction) { ListSelectDialog dialog = ListSelectDialog( list: list, attributeName: attributeName, diff --git a/lib/screens/patients/profile/soap_update/subjective/medication/add_medication.dart b/lib/screens/patients/profile/soap_update/subjective/medication/add_medication.dart index 7a89fe05..2a9f14c4 100644 --- a/lib/screens/patients/profile/soap_update/subjective/medication/add_medication.dart +++ b/lib/screens/patients/profile/soap_update/subjective/medication/add_medication.dart @@ -26,8 +26,7 @@ class AddMedication extends StatefulWidget { final Function addMedicationFun; TextEditingController medicationController; - AddMedication({Key key, this.addMedicationFun, this.medicationController}) - : super(key: key); + AddMedication({Key key, this.addMedicationFun, this.medicationController}) : super(key: key); @override _AddMedicationState createState() => _AddMedicationState(); @@ -45,8 +44,7 @@ class _AddMedicationState extends State { TextEditingController frequencyController = TextEditingController(); GetMedicationResponseModel _selectedMedication; - GlobalKey key = - new GlobalKey>(); + GlobalKey key = new GlobalKey>(); bool isFormSubmitted = false; @override @@ -65,359 +63,248 @@ class _AddMedicationState extends State { ), body: Center( child: Container( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - SizedBox( - height: 10, - ), - Expanded( - child: FractionallySizedBox( - widthFactor: 0.9, - child: SingleChildScrollView( - child: Column( - children: [ - SizedBox( - height: SizeConfig.heightMultiplier * - (SizeConfig.isHeightVeryShort + child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ + SizedBox( + height: 10, + ), + Expanded( + child: FractionallySizedBox( + widthFactor: 0.9, + child: SingleChildScrollView( + child: Column( + children: [ + SizedBox( + height: SizeConfig.heightMultiplier * + (SizeConfig.isHeightVeryShort + ? 2 + : SizeConfig.isHeightShort ? 2 - : SizeConfig.isHeightShort - ? 2 - : 2), - ), - Container( - // height: screenSize.height * 0.070, - child: InkWell( - onTap: model.allMedicationList != null - ? () { - setState(() { - _selectedMedication = null; - }); - } - : null, - child: _selectedMedication == null - ? CustomAutoCompleteTextField( - isShowError: isFormSubmitted && - _selectedMedication == null, - child: AutoCompleteTextField< - GetMedicationResponseModel>( - decoration: TextFieldsUtils - .textFieldSelectorDecoration( - TranslationBase.of( - context) - .searchMedicineNameHere, - null, - true, - suffixIcon: - Icons.search), - itemSubmitted: (item) => - setState(() => - _selectedMedication = - item), - key: key, - suggestions: - model.allMedicationList, - itemBuilder: (context, - suggestion) => - new Padding( - child: AppText(suggestion - .description + - '/' + - suggestion - .genericName), - padding: EdgeInsets.all( - 8.0)), - itemSorter: (a, b) => 1, - itemFilter: (suggestion, - input) => - suggestion.genericName.toLowerCase().startsWith( - input.toLowerCase()) || - suggestion.description - .toLowerCase() - .startsWith(input - .toLowerCase()) || - suggestion.keywords - .toLowerCase() - .startsWith(input - .toLowerCase()), - ), - ) - : AppTextFieldCustom( - height: - Utils.getTextFieldHeight(), - hintText: _selectedMedication != - null - ? _selectedMedication - .description + - (' (${_selectedMedication.genericName} )') - : TranslationBase.of(context) - .searchMedicineNameHere, - minLines: 1, - maxLines: 1, - isTextFieldHasSuffix: true, - suffixIcon: IconButton( - icon: Icon( - Icons.search, - color: Colors.grey.shade600, - )), - enabled: false, - ), - ), - ), - if (_selectedMedication != null) - Column( - children: [ - SizedBox( - height: 3, - ), - Container( - width: MediaQuery.of(context) - .size - .width * - 0.7, - child: AppText( - _selectedMedication.description + - (' (${_selectedMedication.genericName} )'), - color: Color(0xFF575757), - fontSize: 10, - fontWeight: FontWeight.w700, - letterSpacing: -0.4, + : 2), + ), + Container( + // height: screenSize.height * 0.070, + child: InkWell( + onTap: model.allMedicationList != null + ? () { + setState(() { + _selectedMedication = null; + }); + } + : null, + child: _selectedMedication == null + ? CustomAutoCompleteTextField( + isShowError: isFormSubmitted && _selectedMedication == null, + child: AutoCompleteTextField( + decoration: TextFieldsUtils.textFieldSelectorDecoration(TranslationBase.of(context).searchMedicineNameHere, null, true, suffixIcon: Icons.search), + itemSubmitted: (item) => setState(() => _selectedMedication = item), + key: key, + suggestions: model.allMedicationList, + itemBuilder: (context, suggestion) => new Padding(child: AppText(suggestion.description + '/' + suggestion.genericName), padding: EdgeInsets.all(8.0)), + itemSorter: (a, b) => 1, + itemFilter: (suggestion, input) => + suggestion.genericName.toLowerCase().startsWith(input.toLowerCase()) || + suggestion.description.toLowerCase().startsWith(input.toLowerCase()) || + suggestion.keywords.toLowerCase().startsWith(input.toLowerCase()), ), + ) + : AppTextFieldCustom( + height: Utils.getTextFieldHeight(), + hintText: _selectedMedication != null + ? _selectedMedication.description + (' (${_selectedMedication.genericName} )') + : TranslationBase.of(context).searchMedicineNameHere, + minLines: 1, + maxLines: 1, + isTextFieldHasSuffix: true, + suffixIcon: IconButton( + icon: Icon( + Icons.search, + color: Colors.grey.shade600, + )), + enabled: false, ), - ], + ), + ), + if (_selectedMedication != null) + Column( + children: [ + SizedBox( + height: 3, ), - SizedBox( - height: 5, - ), - AppTextFieldCustom( - height: Utils.getTextFieldHeight(), - enabled: false, - onClick: model.medicationDoseTimeList != - null - ? () { - MasterKeyDailog dialog = - MasterKeyDailog( - list: - model.medicationDoseTimeList, - okText: - TranslationBase.of(context) - .ok, - selectedValue: - _selectedMedicationDose, - okFunction: (selectedValue) { - setState(() { - _selectedMedicationDose = - selectedValue; + Container( + width: MediaQuery.of(context).size.width * 0.7, + child: AppText( + _selectedMedication.description + (' (${_selectedMedication.genericName} )'), + color: Color(0xFF575757), + fontSize: 10, + fontWeight: FontWeight.w700, + letterSpacing: -0.4, + ), + ), + ], + ), + SizedBox( + height: 5, + ), + AppTextFieldCustom( + height: Utils.getTextFieldHeight(), + enabled: false, + onClick: model.medicationDoseTimeList != null + ? () { + MasterKeyDailog dialog = MasterKeyDailog( + list: model.medicationDoseTimeList, + okText: TranslationBase.of(context).ok, + selectedValue: _selectedMedicationDose, + okFunction: (selectedValue) { + setState(() { + _selectedMedicationDose = selectedValue; - doseController - .text = projectViewModel - .isArabic - ? _selectedMedicationDose - .nameAr - : _selectedMedicationDose - .nameEn; - }); - }, - ); - showDialog( - barrierDismissible: false, - context: context, - builder: (BuildContext context) { - return dialog; - }, - ); - } - : null, - hintText: - TranslationBase.of(context).doseTime, - maxLines: 1, - minLines: 1, - isTextFieldHasSuffix: true, - controller: doseController, - validationError: isFormSubmitted && - _selectedMedicationDose == null - ? TranslationBase.of(context) - .emptyMessage - : null, - ), - SizedBox( - height: 5, - ), - AppTextFieldCustom( - height: Utils.getTextFieldHeight(), - enabled: false, - isTextFieldHasSuffix: true, - onClick: model.medicationStrengthList != - null - ? () { - MasterKeyDailog dialog = - MasterKeyDailog( - list: - model.medicationStrengthList, - okText: - TranslationBase.of(context) - .ok, - selectedValue: - _selectedMedicationStrength, - okFunction: (selectedValue) { - setState(() { - _selectedMedicationStrength = - selectedValue; + doseController.text = projectViewModel.isArabic ? _selectedMedicationDose.nameAr : _selectedMedicationDose.nameEn; + }); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: (BuildContext context) { + return dialog; + }, + ); + } + : null, + hintText: TranslationBase.of(context).doseTime, + maxLines: 1, + minLines: 1, + isTextFieldHasSuffix: true, + controller: doseController, + validationError: isFormSubmitted && _selectedMedicationDose == null ? TranslationBase.of(context).emptyMessage : null, + ), + SizedBox( + height: 5, + ), + AppTextFieldCustom( + height: Utils.getTextFieldHeight(), + enabled: false, + isTextFieldHasSuffix: true, + onClick: model.medicationStrengthList != null + ? () { + MasterKeyDailog dialog = MasterKeyDailog( + list: model.medicationStrengthList, + okText: TranslationBase.of(context).ok, + selectedValue: _selectedMedicationStrength, + okFunction: (selectedValue) { + setState(() { + _selectedMedicationStrength = selectedValue; - strengthController - .text = projectViewModel - .isArabic - ? _selectedMedicationStrength - .nameAr - : _selectedMedicationStrength - .nameEn; - }); - }, - ); - showDialog( - barrierDismissible: false, - context: context, - builder: (BuildContext context) { - return dialog; - }, - ); - } - : null, - hintText: - TranslationBase.of(context).strength, - maxLines: 1, - minLines: 1, - controller: strengthController, - validationError: isFormSubmitted && - _selectedMedicationStrength == null - ? TranslationBase.of(context) - .emptyMessage - : null, - ), - SizedBox( - height: 5, - ), - SizedBox( - height: 5, - ), - AppTextFieldCustom( - height: Utils.getTextFieldHeight(), - enabled: false, - isTextFieldHasSuffix: true, - onClick: model.medicationRouteList != null - ? () { - MasterKeyDailog dialog = - MasterKeyDailog( - list: model.medicationRouteList, - selectedValue: - _selectedMedicationRoute, - okText: - TranslationBase.of(context) - .ok, - okFunction: (selectedValue) { - setState(() { - _selectedMedicationRoute = - selectedValue; + strengthController.text = projectViewModel.isArabic ? _selectedMedicationStrength.nameAr : _selectedMedicationStrength.nameEn; + }); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: (BuildContext context) { + return dialog; + }, + ); + } + : null, + hintText: TranslationBase.of(context).strength, + maxLines: 1, + minLines: 1, + controller: strengthController, + validationError: isFormSubmitted && _selectedMedicationStrength == null ? TranslationBase.of(context).emptyMessage : null, + ), + SizedBox( + height: 5, + ), + SizedBox( + height: 5, + ), + AppTextFieldCustom( + height: Utils.getTextFieldHeight(), + enabled: false, + isTextFieldHasSuffix: true, + onClick: model.medicationRouteList != null + ? () { + MasterKeyDailog dialog = MasterKeyDailog( + list: model.medicationRouteList, + selectedValue: _selectedMedicationRoute, + okText: TranslationBase.of(context).ok, + okFunction: (selectedValue) { + setState(() { + _selectedMedicationRoute = selectedValue; - routeController - .text = projectViewModel - .isArabic - ? _selectedMedicationRoute - .nameAr - : _selectedMedicationRoute - .nameEn; - }); - }, - ); - showDialog( - barrierDismissible: false, - context: context, - builder: (BuildContext context) { - return dialog; - }, - ); - } - : null, - hintText: TranslationBase.of(context).route, - maxLines: 1, - minLines: 1, - controller: routeController, - validationError: isFormSubmitted && - _selectedMedicationRoute == null - ? TranslationBase.of(context) - .emptyMessage - : null, - ), - SizedBox( - height: 5, - ), - SizedBox( - height: 5, - ), - AppTextFieldCustom( - height: Utils.getTextFieldHeight(), - onClick: model.medicationFrequencyList != - null - ? () { - MasterKeyDailog dialog = - MasterKeyDailog( - list: - model.medicationFrequencyList, - okText: - TranslationBase.of(context) - .ok, - selectedValue: - _selectedMedicationFrequency, - okFunction: (selectedValue) { - setState(() { - _selectedMedicationFrequency = - selectedValue; + routeController.text = projectViewModel.isArabic ? _selectedMedicationRoute.nameAr : _selectedMedicationRoute.nameEn; + }); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: (BuildContext context) { + return dialog; + }, + ); + } + : null, + hintText: TranslationBase.of(context).route, + maxLines: 1, + minLines: 1, + controller: routeController, + validationError: isFormSubmitted && _selectedMedicationRoute == null ? TranslationBase.of(context).emptyMessage : null, + ), + SizedBox( + height: 5, + ), + SizedBox( + height: 5, + ), + AppTextFieldCustom( + height: Utils.getTextFieldHeight(), + onClick: model.medicationFrequencyList != null + ? () { + MasterKeyDailog dialog = MasterKeyDailog( + list: model.medicationFrequencyList, + okText: TranslationBase.of(context).ok, + selectedValue: _selectedMedicationFrequency, + okFunction: (selectedValue) { + setState(() { + _selectedMedicationFrequency = selectedValue; - frequencyController - .text = projectViewModel - .isArabic - ? _selectedMedicationFrequency - .nameAr - : _selectedMedicationFrequency - .nameEn; - }); - }, - ); - showDialog( - barrierDismissible: false, - context: context, - builder: (BuildContext context) { - return dialog; - }, - ); - } - : null, - hintText: - TranslationBase.of(context).frequency, - enabled: false, - maxLines: 1, - minLines: 1, - isTextFieldHasSuffix: true, - controller: frequencyController, - validationError: isFormSubmitted && - _selectedMedicationFrequency == null - ? TranslationBase.of(context) - .emptyMessage - : null, - ), - SizedBox( - height: SizeConfig.heightMultiplier * - (SizeConfig.isHeightVeryShort - ? 20 - : SizeConfig.isHeightShort - ? 15 - : 10), - ), - ], + frequencyController.text = projectViewModel.isArabic ? _selectedMedicationFrequency.nameAr : _selectedMedicationFrequency.nameEn; + }); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: (BuildContext context) { + return dialog; + }, + ); + } + : null, + hintText: TranslationBase.of(context).frequency, + enabled: false, + maxLines: 1, + minLines: 1, + isTextFieldHasSuffix: true, + controller: frequencyController, + validationError: isFormSubmitted && _selectedMedicationFrequency == null ? TranslationBase.of(context).emptyMessage : null, + ), + SizedBox( + height: SizeConfig.heightMultiplier * + (SizeConfig.isHeightVeryShort + ? 20 + : SizeConfig.isHeightShort + ? 15 + : 10), ), - )), - ), - ]), + ], + ), + )), + ), + ]), ), ), bottomSheet: model.state != ViewState.Idle @@ -435,8 +322,7 @@ class _AddMedicationState extends State { _selectedMedicationStrength != null && _selectedMedicationRoute != null && _selectedMedicationFrequency != null) { - widget.medicationController.text = widget - .medicationController.text + + widget.medicationController.text = widget.medicationController.text + '${_selectedMedication.description} (${TranslationBase.of(context).doseTime} ) ${doseController.text} (${TranslationBase.of(context).strength}) ${strengthController.text} (${TranslationBase.of(context).route}) ${routeController.text} (${TranslationBase.of(context).frequency}) ${frequencyController.text} \n \n'; Navigator.of(context).pop(); } diff --git a/lib/widgets/shared/dialogs/master_key_dailog.dart b/lib/widgets/shared/dialogs/master_key_dailog.dart index 382a4b63..3ea6fa43 100644 --- a/lib/widgets/shared/dialogs/master_key_dailog.dart +++ b/lib/widgets/shared/dialogs/master_key_dailog.dart @@ -39,7 +39,7 @@ class _MasterKeyDailogState extends State { Widget cancelButton = ElevatedButton( child: AppText( TranslationBase.of(context).cancel, - color: Colors.grey, + color: Colors.white, fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * (SizeConfig.isWidthLarge ? 3.5 : 5), ), onPressed: () { @@ -48,7 +48,7 @@ class _MasterKeyDailogState extends State { Widget continueButton = ElevatedButton( child: AppText( this.widget.okText, - color: Colors.grey, + color: Colors.white, fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * (SizeConfig.isWidthLarge ? 3.5 : 5), ), onPressed: () { From 4741a7b66deaf5836134a7e7f0dba0c600ab338f Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Sun, 20 Aug 2023 09:18:23 +0300 Subject: [PATCH 14/28] podfile --- ios/Podfile | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/ios/Podfile b/ios/Podfile index e02bcf99..e0cd5115 100644 --- a/ios/Podfile +++ b/ios/Podfile @@ -1,5 +1,5 @@ # Uncomment this line to define a global platform for your project - platform :ios, '11.0' + platform :ios, '13.0' # CocoaPods analytics sends network stats synchronously affecting flutter build latency. ENV['COCOAPODS_DISABLE_STATS'] = 'true' @@ -44,5 +44,18 @@ end post_install do |installer| installer.pods_project.targets.each do |target| flutter_additional_ios_build_settings(target) + target.build_configurations.each do |build_configuration| + build_configuration.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= [ + '$(inherited)', + ## dart: [PermissionGroup.location, PermissionGroup.locationAlways, PermissionGroup.locationWhenInUse] + 'PERMISSION_CAMERA=1', + 'PERMISSION_MICROPHONE=1', + ] + build_configuration.build_settings['EXCLUDED_ARCHS[sdk=iphonesimulator*]'] = 'arm64 i386' + build_configuration.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '13.0' + if build_configuration.build_settings['WRAPPER_EXTENSION'] == 'bundle' + build_configuration.build_settings['DEVELOPMENT_TEAM'] = '3A359E86ZF' + end + end end end From fc219618072f931d6d1424d4b87357d3bb24256b Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Sun, 27 Aug 2023 12:08:46 +0300 Subject: [PATCH 15/28] updates & fixes --- doctor_app_key | Bin 0 -> 2234 bytes key.properties | 4 + lib/client/base_app_client.dart | 4 +- lib/config/config.dart | 2 +- .../viewModel/patient-ucaf-viewmodel.dart | 41 +-- lib/core/viewModel/procedure_View_model.dart | 247 +++++------------- .../objective/update_objective_page.dart | 117 ++------- .../profile/soap_update/soap_utils.dart | 53 +--- pubspec.yaml | 2 +- 9 files changed, 121 insertions(+), 349 deletions(-) create mode 100644 doctor_app_key create mode 100644 key.properties diff --git a/doctor_app_key b/doctor_app_key new file mode 100644 index 0000000000000000000000000000000000000000..ae5bdbbc2f834986ff64efc6e11330fa19e2f272 GIT binary patch literal 2234 zcmchYYc!ON7RTqA8RU||U}$25N@MU0a*1dp#w{e*985!raY@9?D={vS+#1Y?A-P6K zh3+Z$Ta-(3E0jXa49SS&J_MH0;j|0N%L~B1<#@qw7_&V zQqURPlU9{FG4ZXn!zV5LaN8-Oj6b28F_9jZB^>Ox26h^WwWOWHtjL%Cwy$Xr`(eqm zay`Ny3o(%NGe+2O%X&2R$g8Rfi;KxMlS$rw4)gbEA(Z?wUPbxlX zt6`)oQV$B9XUtr2zot>J6iK~P%h?tD;CRR%TPT{)gfG}F`$Bf$Ll3oKpsVxD@{_m6 zhbxI$74g{90>9_~T-|KHSl76DY__!H$+ASg)F+7qv+(MfW<7+h=a-g_LI#3eZXR#c zg?o1Iif;wne3x6#>7hDK>92!KpJ?0gzmH|yCIrQaKoSw9vufDtE_ z;f&qzV_9%uZ^Q3P`?dEX3CK$F4>o4j;={|&2TLM!>^EhaPlfgSdguU8#e`n_H^jE~ z`aT;gTQk?XvQ?oPUddT!-4Cha^_ZFHR3v7m=*I8CrJqtsqr4jc`^pR2xTxix-lLC% zY!u)s4p-}5Bub)bCdQLDX?KdmS`JszY_&HkZAB`BY`q;h~>$6uVA;mzsMFitw!F~Ky&O1i4 zqB>(=7ZV+uC+zH{-0V_X8tS=gXkQugi@j);xy=ZXWT!YP$;0PmNI&T8;!CQ$dlSm0 zZr_t`6d%sr&y{wHn>OF?F9wKnyXCrZ@F1La;gU7B`ePOdfA021$S$&SYiRXrM4 zNxzmZe=AP$z^~?~1}=KjA{V7GytwD?lpIi=Ao$JHA~d6>&2{T(Ls#vw#OG*ILf*8;BlI>sMy7S8yK;$Az%XXv6{Tta+Z+##53*vGtyH%pe-YH{!s!uKZ`YLW zMvL_=JUg>6>bm9;h0Bj($opxhk4dHAf~Os#jHk3&6$b z7+hakQjK~=1IpH$HE=MMJSBm?i}5NNgInNB-7c>*>{}Q7^4ya!JD>bDrqPBzW}rV9 zRi^x~azfotECCt~bURX}z9Qg+jzMC3?w5Yt=XSfJ*pLv+3 zQv`){A&3;LM48+f30>*|7r+B*LU|8ITJ0p-6V*m)2zI)H$HbU*}32LQ-TBOPDOtvNDw zh3UP;>%DtRDSCS$j>R~U4C-suyFO$K$L1(T`rR)=e;$lvac`>Gy1<1iEqGh`sHw-e zaq~DUt2S4wK#cRxfo|Hi4RYRarWY3EJSh)xH*W8zK(#r}62o&;k4jOsPV2f>n>Xr{ z`R)qZWwmnMt%KPv^PI6kth-T}iU2O%HRr%b(}~8nM}--@4JCa2$Ap+Qqk*!QW63YY zhY22!^l?eUek!SUqS@c?oSxH9r>jruf@=4JrZ@|43sa7nG%PzZdt!?h-bDwQ=@e)M zgk51{SpLHL;=^PYZ~qMiEgz{5AKwO&VWW*PzD*_*XFKh$DnMZX1Sr`DVnBtRNh^rM zW#Q7^y&+aMlIs?%p9MMo%g)t`6IM=thq$vxI}icL89RG5iw9-~{CMi{a)h}fau}3% zROGy~4fww8Zv5_?VVnU$0<1uuJGD`T?KvbZ+jaQP-73_~uS<=`I6lFz>QGuE-~LSO zk?T1^c$f)uN!AK#p1qiTlW|D#Yk9(~2dhP{I|)sVtXO1HmhzGUikRIVN2Lwd9M;r~ zdy!5;5JTyv{EnM1j$XrlB6Omq3MEElCpi)Nh;FWfNO-> zTJMtV>|>riw;M1& literal 0 HcmV?d00001 diff --git a/key.properties b/key.properties new file mode 100644 index 00000000..92d5c684 --- /dev/null +++ b/key.properties @@ -0,0 +1,4 @@ +storePassword=HmGsa123 +keyPassword=HmGsa123 +keyAlias=hmgdoctor +storeFile=doctor_app_key \ No newline at end of file diff --git a/lib/client/base_app_client.dart b/lib/client/base_app_client.dart index ed5a202e..df7874da 100644 --- a/lib/client/base_app_client.dart +++ b/lib/client/base_app_client.dart @@ -115,8 +115,8 @@ class BaseAppClient { // print("ProjectID :"); // print(body['ProjectID']); - print("URL : $url"); - print("Body : ${json.encode(body)}"); + debugPrint("URL : $url"); + debugPrint("Body : ${json.encode(body)}"); var asd = json.encode(body); var asd2; if (await Utils.checkConnection()) { diff --git a/lib/config/config.dart b/lib/config/config.dart index 3bc3dda8..7be1e61f 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -446,7 +446,7 @@ const TRANSACTION_NO = 0; const LANGUAGE_ID = 2; const STAMP = '2020-04-27T12:17:17.721Z'; const IP_ADDRESS = '9.9.9.9'; -const VERSION_ID = 8.6; +const VERSION_ID = 8.7; const CHANNEL = 9; const SESSION_ID = 'BlUSkYymTt'; const IS_LOGIN_FOR_DOCTOR_APP = true; diff --git a/lib/core/viewModel/patient-ucaf-viewmodel.dart b/lib/core/viewModel/patient-ucaf-viewmodel.dart index a060f69f..ace5e866 100644 --- a/lib/core/viewModel/patient-ucaf-viewmodel.dart +++ b/lib/core/viewModel/patient-ucaf-viewmodel.dart @@ -18,19 +18,15 @@ import '../../locator.dart'; class UcafViewModel extends BaseViewModel { UcafService _ucafService = locator(); - List get patientChiefComplaintList => - _ucafService.patientChiefComplaintList; + List get patientChiefComplaintList => _ucafService.patientChiefComplaintList; - List get patientVitalSignsHistory => - _ucafService.patientVitalSignsHistory; + List get patientVitalSignsHistory => _ucafService.patientVitalSignsHistory; - List get patientAssessmentList => - _ucafService.patientAssessmentList; + List get patientAssessmentList => _ucafService.patientAssessmentList; List get diagnosisTypes => _ucafService.listOfDiagnosisType; - List get diagnosisConditions => - _ucafService.listOfDiagnosisCondition; + List get diagnosisConditions => _ucafService.listOfDiagnosisCondition; PrescriptionModel get prescriptionList => _ucafService.prescriptionList; @@ -75,7 +71,7 @@ class UcafViewModel extends BaseViewModel { // await _ucafService.getPatientVitalSignsHistory(patient, from, to); await _ucafService.getInPatientVitalSignHistory(patient, false); - await _ucafService.getPatientChiefComplaint(patient); + // await _ucafService.getPatientChiefComplaint(patient); if (_ucafService.hasError) { error = _ucafService.error; @@ -91,23 +87,16 @@ class UcafViewModel extends BaseViewModel { if (bodyMax == "0" || bodyMax == null || bodyMax == 'null') { bodyMax = element.bodyMassIndex.toString(); } - if (temperatureCelcius == "0" || - temperatureCelcius == null || - temperatureCelcius == 'null') { + if (temperatureCelcius == "0" || temperatureCelcius == null || temperatureCelcius == 'null') { temperatureCelcius = element.temperatureCelcius.toString(); } if (hartRat == "0" || hartRat == null || hartRat == 'null') { hartRat = element.pulseBeatPerMinute.toString(); } - if (respirationBeatPerMinute == "0" || - respirationBeatPerMinute == null || - respirationBeatPerMinute == 'null') { - respirationBeatPerMinute = - element.respirationBeatPerMinute.toString(); + if (respirationBeatPerMinute == "0" || respirationBeatPerMinute == null || respirationBeatPerMinute == 'null') { + respirationBeatPerMinute = element.respirationBeatPerMinute.toString(); } - if (bloodPressure == "0 / 0" || - bloodPressure == null || - bloodPressure == 'null') { + if (bloodPressure == "0/0" || bloodPressure == null || bloodPressure == 'null') { bloodPressure = element.bloodPressure.toString(); } }); @@ -126,8 +115,7 @@ class UcafViewModel extends BaseViewModel { } else { if (patientAssessmentList.isNotEmpty) { if (diagnosisConditions.length == 0) { - await _ucafService - .getMasterLookup(MasterKeysService.DiagnosisCondition); + await _ucafService.getMasterLookup(MasterKeysService.DiagnosisCondition); } if (diagnosisTypes.length == 0) { await _ucafService.getMasterLookup(MasterKeysService.DiagnosisType); @@ -169,13 +157,11 @@ class UcafViewModel extends BaseViewModel { } } - MasterKeyModel findMasterDataById( - {@required MasterKeysService masterKeys, dynamic id}) { + MasterKeyModel findMasterDataById({@required MasterKeysService masterKeys, dynamic id}) { switch (masterKeys) { case MasterKeysService.DiagnosisCondition: List result = diagnosisConditions.where((element) { - return element.id == id && - element.typeId == masterKeys.getMasterKeyService(); + return element.id == id && element.typeId == masterKeys.getMasterKeyService(); }).toList(); if (result.isNotEmpty) { return result.first; @@ -183,8 +169,7 @@ class UcafViewModel extends BaseViewModel { return null; case MasterKeysService.DiagnosisType: List result = diagnosisTypes.where((element) { - return element.id == id && - element.typeId == masterKeys.getMasterKeyService(); + return element.id == id && element.typeId == masterKeys.getMasterKeyService(); }).toList(); if (result.isNotEmpty) { return result.first; diff --git a/lib/core/viewModel/procedure_View_model.dart b/lib/core/viewModel/procedure_View_model.dart index eba91698..005d095d 100644 --- a/lib/core/viewModel/procedure_View_model.dart +++ b/lib/core/viewModel/procedure_View_model.dart @@ -7,8 +7,7 @@ import 'package:doctor_app_flutter/core/model/labs/patient_lab_orders.dart'; import 'package:doctor_app_flutter/core/model/labs/patient_lab_special_result.dart'; import 'package:doctor_app_flutter/core/model/procedure/ControlsModel.dart'; import 'package:doctor_app_flutter/core/model/procedure/categories_procedure.dart'; -import 'package:doctor_app_flutter/core/model/procedure/categories_procedure.dart' - as cpe; +import 'package:doctor_app_flutter/core/model/procedure/categories_procedure.dart' as cpe; import 'package:doctor_app_flutter/core/model/procedure/get_ordered_procedure_model.dart'; import 'package:doctor_app_flutter/core/model/procedure/post_procedure_req_model.dart'; import 'package:doctor_app_flutter/core/model/procedure/procedure_templateModel.dart'; @@ -36,14 +35,11 @@ class ProcedureViewModel extends BaseViewModel { bool hasError = false; ProcedureService _procedureService = locator(); - List get procedureList => - _procedureService.procedureList; + List get procedureList => _procedureService.procedureList; - List get valadteProcedureList => - _procedureService.valadteProcedureList; + List get valadteProcedureList => _procedureService.valadteProcedureList; - List get categoriesList => - _procedureService.categoriesList; + List get categoriesList => _procedureService.categoriesList; List get categoryList => _procedureService.categoryList; RadiologyService _radiologyService = locator(); @@ -51,44 +47,31 @@ class ProcedureViewModel extends BaseViewModel { List _finalRadiologyListClinic = List(); List _finalRadiologyListHospital = List(); - List get finalRadiologyList => - filterType == FilterType.Clinic - ? _finalRadiologyListClinic - : _finalRadiologyListHospital; + List get finalRadiologyList => filterType == FilterType.Clinic ? _finalRadiologyListClinic : _finalRadiologyListHospital; - List get radiologyList => - _radiologyService.finalRadiologyList; + List get radiologyList => _radiologyService.finalRadiologyList; - List get patientLabOrdersList => - _labsService.patientLabOrdersList; + List get patientLabOrdersList => _labsService.patientLabOrdersList; - List get labOrdersResultsList => - _labsService.labOrdersResultsList; + List get labOrdersResultsList => _labsService.labOrdersResultsList; - List get procedureTemplate => - _procedureService.templateList; + List get procedureTemplate => _procedureService.templateList; List templateList = List(); - List get procedureTemplateDetails => - _procedureService.templateDetailsList; + List get procedureTemplateDetails => _procedureService.templateDetailsList; bool _isRadiologyVIDAPlus = false; bool get isRadiologyVIDAPlus => _isRadiologyVIDAPlus; - Future getProcedure( - {int mrn, - String patientType, - int appointmentNo, - bool isLocalBusy = false}) async { + Future getProcedure({int mrn, String patientType, int appointmentNo, bool isLocalBusy = false}) async { hasError = false; await getDoctorProfile(); if (isLocalBusy) setState(ViewState.BusyLocal); else setState(ViewState.Busy); - await _procedureService.getProcedure( - mrn: mrn, appointmentNo: appointmentNo); + await _procedureService.getProcedure(mrn: mrn, appointmentNo: appointmentNo); if (_procedureService.hasError) { error = _procedureService.error; if (patientType == "7") @@ -99,21 +82,14 @@ class ProcedureViewModel extends BaseViewModel { setState(ViewState.Idle); } - Future getProcedureCategory( - {String categoryName, - String categoryID, - patientId, - bool isLocalBusy = false}) async { + Future getProcedureCategory({String categoryName, String categoryID, patientId, bool isLocalBusy = false}) async { if (categoryName == null) return; hasError = false; if (isLocalBusy) setState(ViewState.BusyLocal); else setState(ViewState.Busy); - await _procedureService.getProcedureCategory( - categoryName: categoryName, - categoryID: categoryID, - patientId: patientId); + await _procedureService.getProcedureCategory(categoryName: categoryName, categoryID: categoryID, patientId: patientId); if (_procedureService.hasError) { error = _procedureService.error; setState(ViewState.ErrorLocal); @@ -133,17 +109,13 @@ class ProcedureViewModel extends BaseViewModel { setState(ViewState.Idle); } - Future getProcedureTemplate( - {String categoryID, - bool isLocalBusy = false, - BuildContext context}) async { + Future getProcedureTemplate({String categoryID, bool isLocalBusy = false, BuildContext context}) async { if (isLocalBusy) { setState(ViewState.BusyLocal); } else { setState(ViewState.Busy); } - await _procedureService.getProcedureTemplate( - categoryID: categoryID, isLocalBusy: false); + await _procedureService.getProcedureTemplate(categoryID: categoryID, isLocalBusy: false); if (_procedureService.hasError) { error = _procedureService.error; setState(ViewState.ErrorLocal); @@ -154,20 +126,12 @@ class ProcedureViewModel extends BaseViewModel { setTemplateListDependOnId() { procedureTemplate.forEach((element) { - List templateListData = templateList - .where((elementTemplate) => - elementTemplate.templateId == element.templateID) - .toList(); + List templateListData = templateList.where((elementTemplate) => elementTemplate.templateId == element.templateID).toList(); if (templateListData.length != 0) { - templateList[templateList.indexOf(templateListData[0])] - .procedureTemplate - .add(element); + templateList[templateList.indexOf(templateListData[0])].procedureTemplate.add(element); } else { - var template = ProcedureTempleteDetailsModelList( - templateName: element.templateName, - templateId: element.templateID, - template: element); + var template = ProcedureTempleteDetailsModelList(templateName: element.templateName, templateId: element.templateID, template: element); if (!templateList.contains(template)) templateList.add(template); } }); @@ -189,8 +153,7 @@ class ProcedureViewModel extends BaseViewModel { setState(ViewState.Idle); } - Future postProcedure(PostProcedureReqModel postProcedureReqModel, int mrn, - {bool isLocalBusy = false}) async { + Future postProcedure(PostProcedureReqModel postProcedureReqModel, int mrn, {bool isLocalBusy = false}) async { hasError = false; if (isLocalBusy) setState(ViewState.BusyLocal); @@ -201,14 +164,12 @@ class ProcedureViewModel extends BaseViewModel { error = _procedureService.error; setState(ViewState.ErrorLocal); } else { - await getProcedure(mrn: mrn, isLocalBusy:isLocalBusy); + await getProcedure(mrn: mrn, isLocalBusy: isLocalBusy); setState(ViewState.Idle); } } - Future validationProcedure( - ProcedureValidationRequestModel procedureValidateRequestModel, - {bool isLocalBusy = false}) async { + Future validationProcedure(ProcedureValidationRequestModel procedureValidateRequestModel, {bool isLocalBusy = false}) async { hasError = false; if (isLocalBusy) { setState(ViewState.BusyLocal); @@ -224,12 +185,12 @@ class ProcedureViewModel extends BaseViewModel { } } - Future updateProcedure( - {UpdateProcedureRequestModel updateProcedureRequestModel, - int mrn, bool isLocalBusy = false}) async { + Future updateProcedure({UpdateProcedureRequestModel updateProcedureRequestModel, int mrn, bool isLocalBusy = false}) async { hasError = false; - if(isLocalBusy)setState(ViewState.BusyLocal); else - setState(ViewState.Busy); + if (isLocalBusy) + setState(ViewState.BusyLocal); + else + setState(ViewState.Busy); await _procedureService.updateProcedure(updateProcedureRequestModel); if (_procedureService.hasError) { error = _procedureService.error; @@ -239,11 +200,9 @@ class ProcedureViewModel extends BaseViewModel { //await getProcedure(mrn: mrn); } - void getPatientRadOrders(PatiantInformtion patient, - {String patientType, bool isInPatient = false}) async { + void getPatientRadOrders(PatiantInformtion patient, {String patientType, bool isInPatient = false}) async { setState(ViewState.Busy); - await _radiologyService.getPatientRadOrders(patient, - isInPatient: isInPatient); + await _radiologyService.getPatientRadOrders(patient, isInPatient: isInPatient); _isRadiologyVIDAPlus = _radiologyService.isRadiologyVIDAPlus; if (_radiologyService.hasError) { error = _radiologyService.error; @@ -253,39 +212,25 @@ class ProcedureViewModel extends BaseViewModel { setState(ViewState.ErrorLocal); } else { _radiologyService.finalRadiologyList.forEach((element) { - List finalRadiologyListClinic = - _finalRadiologyListClinic - .where((elementClinic) => - elementClinic.filterName == element.clinicDescription) - .toList(); + List finalRadiologyListClinic = _finalRadiologyListClinic.where((elementClinic) => elementClinic.filterName == element.clinicDescription).toList(); if (finalRadiologyListClinic.length != 0) { - _finalRadiologyListClinic[ - finalRadiologyListClinic.indexOf(finalRadiologyListClinic[0])] - .finalRadiologyList - .add(element); + _finalRadiologyListClinic[finalRadiologyListClinic.indexOf(finalRadiologyListClinic[0])].finalRadiologyList.add(element); } else { - _finalRadiologyListClinic.add(FinalRadiologyList( - filterName: element.clinicDescription, finalRadiology: element)); + _finalRadiologyListClinic.add(FinalRadiologyList(filterName: element.clinicDescription, finalRadiology: element)); } // FinalRadiologyList list sort via project - List finalRadiologyListHospital = - _finalRadiologyListHospital - .where( - (elementClinic) => - elementClinic.filterName == element.projectName, - ) - .toList(); + List finalRadiologyListHospital = _finalRadiologyListHospital + .where( + (elementClinic) => elementClinic.filterName == element.projectName, + ) + .toList(); if (finalRadiologyListHospital.length != 0) { - _finalRadiologyListHospital[finalRadiologyListHospital - .indexOf(finalRadiologyListHospital[0])] - .finalRadiologyList - .add(element); + _finalRadiologyListHospital[finalRadiologyListHospital.indexOf(finalRadiologyListHospital[0])].finalRadiologyList.add(element); } else { - _finalRadiologyListHospital.add(FinalRadiologyList( - filterName: element.projectName, finalRadiology: element)); + _finalRadiologyListHospital.add(FinalRadiologyList(filterName: element.projectName, finalRadiology: element)); } }); @@ -295,17 +240,9 @@ class ProcedureViewModel extends BaseViewModel { String get radImageURL => _radiologyService.url; - getRadImageURL( - {int invoiceNo, - int lineItem, - int projectId, - @required PatiantInformtion patient}) async { + getRadImageURL({int invoiceNo, int lineItem, int projectId, @required PatiantInformtion patient}) async { setState(ViewState.Busy); - await _radiologyService.getRadImageURL( - invoiceNo: invoiceNo, - lineItem: lineItem, - projectId: projectId, - patient: patient); + await _radiologyService.getRadImageURL(invoiceNo: invoiceNo, lineItem: lineItem, projectId: projectId, patient: patient); if (_radiologyService.hasError) { error = _radiologyService.error; setState(ViewState.Error); @@ -318,8 +255,7 @@ class ProcedureViewModel extends BaseViewModel { notifyListeners(); } - List get patientLabSpecialResult => - _labsService.patientLabSpecialResult; + List get patientLabSpecialResult => _labsService.patientLabSpecialResult; List get labResultList => _labsService.labResultList; @@ -340,19 +276,9 @@ class ProcedureViewModel extends BaseViewModel { } } - getLaboratoryResult( - {String projectID, - int clinicID, - String invoiceNo, - String orderNo, - PatiantInformtion patient}) async { + getLaboratoryResult({String projectID, int clinicID, String invoiceNo, String orderNo, PatiantInformtion patient}) async { setState(ViewState.Busy); - await _labsService.getLaboratoryResult( - invoiceNo: invoiceNo, - orderNo: orderNo, - projectID: projectID, - clinicID: clinicID, - patient: patient); + await _labsService.getLaboratoryResult(invoiceNo: invoiceNo, orderNo: orderNo, projectID: projectID, clinicID: clinicID, patient: patient); if (_labsService.hasError) { error = _labsService.error; setState(ViewState.Error); @@ -361,15 +287,9 @@ class ProcedureViewModel extends BaseViewModel { } } - getPatientLabOrdersResults( - {PatientLabOrders patientLabOrder, - String procedure, - PatiantInformtion patient}) async { + getPatientLabOrdersResults({PatientLabOrders patientLabOrder, String procedure, PatiantInformtion patient}) async { setState(ViewState.Busy); - await _labsService.getPatientLabOrdersResults( - patientLabOrder: patientLabOrder, - procedure: procedure, - patient: patient); + await _labsService.getPatientLabOrdersResults(patientLabOrder: patientLabOrder, procedure: procedure, patient: patient); if (_labsService.hasError) { error = _labsService.error; setState(ViewState.Error); @@ -377,9 +297,7 @@ class ProcedureViewModel extends BaseViewModel { bool isShouldClear = false; if (_labsService.labOrdersResultsList.length == 1) { labOrdersResultsList.forEach((element) { - if (element.resultValue.contains('/') || - element.resultValue.contains('*') || - element.resultValue.isEmpty) isShouldClear = true; + if (element.resultValue.contains('/') || element.resultValue.contains('*') || element.resultValue.isEmpty) isShouldClear = true; }); } if (isShouldClear) _labsService.labOrdersResultsList.clear(); @@ -410,8 +328,7 @@ class ProcedureViewModel extends BaseViewModel { setState(ViewState.Busy); } PostProcedureReqModel postProcedureReqModel = new PostProcedureReqModel(); - ProcedureValidationRequestModel procedureValadteRequestModel = - new ProcedureValidationRequestModel(); + ProcedureValidationRequestModel procedureValadteRequestModel = new ProcedureValidationRequestModel(); procedureValadteRequestModel.patientMRN = patient.patientMRN; procedureValadteRequestModel.episodeID = patient.episodeNo; procedureValadteRequestModel.appointmentNo = patient.appointmentNo; @@ -426,48 +343,34 @@ class ProcedureViewModel extends BaseViewModel { procedureValadteRequestModel.procedure = [element.procedureId]; List controls = List(); controls.add( - Controls( - code: "remarks", - controlValue: element.remarks != null ? element.remarks : ""), + Controls(code: "remarks", controlValue: element.remarks != null ? element.remarks : ""), ); controls.add( - Controls( - code: "ordertype", - controlValue: procedureType == ProcedureType.PROCEDURE - ? element.type ?? "1" - : "0"), + Controls(code: "ordertype", controlValue: procedureType == ProcedureType.PROCEDURE ? element.type ?? "1" : "0"), ); - controlsProcedure.add(Procedures( - category: element.categoryID, - procedure: element.procedureId, - controls: controls)); + controlsProcedure.add(Procedures(category: element.categoryID, procedure: element.procedureId, controls: controls)); }); postProcedureReqModel.procedures = controlsProcedure; - await validationProcedure(procedureValadteRequestModel, - isLocalBusy: isLocalBusy); + await validationProcedure(procedureValadteRequestModel, isLocalBusy: isLocalBusy); if (state == ViewState.Idle) { if (valadteProcedureList[0].entityList.length == 0) { - await postProcedure(postProcedureReqModel, patient.patientMRN, - isLocalBusy: isLocalBusy); + await postProcedure(postProcedureReqModel, patient.patientMRN, isLocalBusy: isLocalBusy); if (state == ViewState.ErrorLocal) { Utils.showErrorToast(error); getProcedure(mrn: patient.patientMRN, isLocalBusy: isLocalBusy); } else if (state == ViewState.Idle) { DrAppToastMsg.showSuccesToast('procedure has been added'); - if (Navigator.canPop(AppGlobal.CONTEX)) - Navigator.pop(AppGlobal.CONTEX); - if (Navigator.canPop(AppGlobal.CONTEX)) - Navigator.pop(AppGlobal.CONTEX); + if (Navigator.canPop(AppGlobal.CONTEX)) Navigator.pop(AppGlobal.CONTEX); + if (Navigator.canPop(AppGlobal.CONTEX)) Navigator.pop(AppGlobal.CONTEX); } } else { if (state == ViewState.ErrorLocal) { Utils.showErrorToast(error); getProcedure(mrn: patient.patientMRN); } else if (state == ViewState.Idle) { - Utils.showErrorToast( - valadteProcedureList[0].entityList[0].warringMessages); + Utils.showErrorToast(valadteProcedureList[0].entityList[0].warringMessages); } } } else { @@ -475,34 +378,23 @@ class ProcedureViewModel extends BaseViewModel { } } - bool isEntityListSelected( - cpe.EntityList masterKey, List entityList) { - Iterable history = entityList - .where((element) => masterKey.procedureId == element.procedureId); + bool isEntityListSelected(cpe.EntityList masterKey, List entityList) { + Iterable history = entityList.where((element) => masterKey.procedureId == element.procedureId); if (history.length > 0) { return true; } return false; } - bool isProcedureEntityListSelected(ProcedureTempleteDetailsModel masterKey, - List entityList) { - Iterable history = entityList.where( - (element) => - masterKey.templateID == element.templateID && - masterKey.procedureName == element.procedureName); + bool isProcedureEntityListSelected(ProcedureTempleteDetailsModel masterKey, List entityList) { + Iterable history = entityList.where((element) => masterKey.templateID == element.templateID && masterKey.procedureName == element.procedureName); if (history.length > 0) { return true; } return false; } - Future addProcedures( - ProcedureViewModel model, - List items, - PatiantInformtion patient, - TextEditingController remarksController, - {bool isLocalBusy = false}) async { + Future addProcedures(ProcedureViewModel model, List items, PatiantInformtion patient, TextEditingController remarksController, {bool isLocalBusy = false}) async { if (isLocalBusy) { setState(ViewState.BusyLocal); } else { @@ -523,15 +415,10 @@ class ProcedureViewModel extends BaseViewModel { eventCategory: "Procedure Checkout Screen", eventAction: "Add New Procedure", ); - await model.preparePostProcedure( - entityList: entityList, - patient: patient, - remarks: remarksController.text, - isLocalBusy: isLocalBusy); + await model.preparePostProcedure(entityList: entityList, patient: patient, remarks: remarksController.text, isLocalBusy: isLocalBusy); } - Future filterSearchResults(String query, List masterList, - List items) async { + Future filterSearchResults(String query, List masterList, List items) async { List dummySearchList = List(); dummySearchList.addAll(masterList); if (query.isNotEmpty) { @@ -549,13 +436,9 @@ class ProcedureViewModel extends BaseViewModel { } } - void filterProcedureSearchResults( - String query, - List masterList, - List items) { + void filterProcedureSearchResults(String query, List masterList, List items) { List dummySearchList = List(); - if(masterList!= null) - dummySearchList.addAll(masterList); + if (masterList != null) dummySearchList.addAll(masterList); if (query.isNotEmpty) { List dummyListData = List(); dummySearchList.forEach((item) { diff --git a/lib/screens/patients/profile/soap_update/objective/update_objective_page.dart b/lib/screens/patients/profile/soap_update/objective/update_objective_page.dart index 1d51c4c3..451fd5d8 100644 --- a/lib/screens/patients/profile/soap_update/objective/update_objective_page.dart +++ b/lib/screens/patients/profile/soap_update/objective/update_objective_page.dart @@ -31,24 +31,17 @@ class UpdateObjectivePage extends StatefulWidget { final int currentIndex; final PatiantInformtion patientInfo; - UpdateObjectivePage( - {Key key, - this.changePageViewIndex, - this.patientInfo, - this.changeLoadingState, - this.currentIndex}); + UpdateObjectivePage({Key key, this.changePageViewIndex, this.patientInfo, this.changeLoadingState, this.currentIndex}); @override _UpdateObjectivePageState createState() => _UpdateObjectivePageState(); } -class _UpdateObjectivePageState extends State - implements ObjectiveCallBack { +class _UpdateObjectivePageState extends State implements ObjectiveCallBack { bool isSysExaminationExpand = false; List mySelectedExamination = List(); - BoxDecoration containerBorderDecoration( - Color containerColor, Color borderColor) { + BoxDecoration containerBorderDecoration(Color containerColor, Color borderColor) { return BoxDecoration( color: containerColor, shape: BoxShape.rectangle, @@ -77,8 +70,7 @@ class _UpdateObjectivePageState extends State masterKeys: MasterKeysService.PhysicalExamination, id: element.examId, ); - MySelectedExamination tempEam = - SoapUtils.generateMySelectedExamination( + MySelectedExamination tempEam = SoapUtils.generateMySelectedExamination( examination: examMaster, remark: element.remarks, isNormal: element.isNormal, @@ -113,8 +105,7 @@ class _UpdateObjectivePageState extends State patientInfo: widget.patientInfo, ), ExpandableSOAPWidget( - headerTitle: - TranslationBase.of(context).physicalSystemExamination, + headerTitle: TranslationBase.of(context).physicalSystemExamination, onTap: () { setState(() { isSysExaminationExpand = !isSysExaminationExpand; @@ -123,14 +114,12 @@ class _UpdateObjectivePageState extends State child: Column( children: [ SOAPOpenItems( - label: - "${TranslationBase.of(context).addExamination}", + label: "${TranslationBase.of(context).addExamination}", onTap: () { openExaminationList(context); }, ), - if (mySelectedExamination.isNotEmpty && - mySelectedExamination.first.isLocal) + if (mySelectedExamination.isNotEmpty && mySelectedExamination.first.isLocal) Row( children: [ AppText( @@ -143,25 +132,14 @@ class _UpdateObjectivePageState extends State ), Column( children: mySelectedExamination - .sublist( - 0, - model.getFirstIndexForOldExamination( - mySelectedExamination) == - -1 - ? 0 - : model.getFirstIndexForOldExamination( - mySelectedExamination)) + .sublist(0, model.getFirstIndexForOldExamination(mySelectedExamination) == -1 ? 0 : model.getFirstIndexForOldExamination(mySelectedExamination)) .map((examination) { return ExaminationItemCard(examination, () { - removeExamination( - examination.selectedExamination); + removeExamination(examination.selectedExamination); }); }).toList(), ), - if (mySelectedExamination.isNotEmpty && - model.getFirstIndexForOldExamination( - mySelectedExamination) > - -1) + if (mySelectedExamination.isNotEmpty && model.getFirstIndexForOldExamination(mySelectedExamination) > -1) Row( children: [ AppText( @@ -174,16 +152,10 @@ class _UpdateObjectivePageState extends State ), Column( children: mySelectedExamination - .sublist(model.getFirstIndexForOldExamination( - mySelectedExamination) == - -1 - ? 0 - : model.getFirstIndexForOldExamination( - mySelectedExamination)) + .sublist(model.getFirstIndexForOldExamination(mySelectedExamination) == -1 ? 0 : model.getFirstIndexForOldExamination(mySelectedExamination)) .map((examination) { return ExaminationItemCard(examination, () { - removeExamination( - examination.selectedExamination); + removeExamination(examination.selectedExamination); }); }).toList(), ) @@ -192,8 +164,7 @@ class _UpdateObjectivePageState extends State isExpanded: isSysExaminationExpand, ), SizedBox( - height: SizeConfig.heightMultiplier * - (SizeConfig.isHeightVeryShort ? 14 : 12), + height: SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort ? 14 : 12), ) ], ), @@ -206,33 +177,20 @@ class _UpdateObjectivePageState extends State submitUpdateObjectivePage(SOAPViewModel model) async { if (mySelectedExamination.isNotEmpty) { - if (!model.isAddExamInProgress && - widget.patientInfo.admissionNo != null && - widget.patientInfo.admissionNo.isNotEmpty) { + if (!model.isAddExamInProgress && widget.patientInfo.admissionNo != null && widget.patientInfo.admissionNo.isNotEmpty) { Navigator.of(context).pop(); } else { widget.changeLoadingState(true); Map profile = await sharedPref.getObj(DOCTOR_PROFILE); DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile); - PostPhysicalExamRequestModel postPhysicalExamRequestModel = - new PostPhysicalExamRequestModel(); + PostPhysicalExamRequestModel postPhysicalExamRequestModel = new PostPhysicalExamRequestModel(); mySelectedExamination.forEach((exam) { - if (postPhysicalExamRequestModel - .listHisProgNotePhysicalExaminationVM == - null) - postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM = - []; - ListHisProgNotePhysicalExaminationVM - listHisProgNotePhysicalExaminationVM = - ListHisProgNotePhysicalExaminationVM( + if (postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM == null) postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM = []; + ListHisProgNotePhysicalExaminationVM listHisProgNotePhysicalExaminationVM = ListHisProgNotePhysicalExaminationVM( patientMRN: widget.patientInfo.patientMRN, - episodeId: widget.patientInfo.episodeNo == null - ? 0 - : widget.patientInfo.episodeNo, - appointmentNo: widget.patientInfo.appointmentNo == null - ? 0 - : widget.patientInfo.appointmentNo, + episodeId: widget.patientInfo.episodeNo == null ? 0 : widget.patientInfo.episodeNo, + appointmentNo: widget.patientInfo.appointmentNo == null ? 0 : widget.patientInfo.appointmentNo, remarks: exam.remark ?? '', createdBy: exam.createdBy ?? doctorProfile.doctorID, createdOn: exam.createdOn ?? DateTime.now().toIso8601String(), @@ -255,15 +213,12 @@ class _UpdateObjectivePageState extends State : "Not Examined", isNew: exam.isNew, ); - if (widget.patientInfo.admissionNo != null && - widget.patientInfo.admissionNo.isNotEmpty) { - listHisProgNotePhysicalExaminationVM.admissionNo = - int.parse(widget.patientInfo.admissionNo); + if (widget.patientInfo.admissionNo != null && widget.patientInfo.admissionNo.isNotEmpty) { + listHisProgNotePhysicalExaminationVM.admissionNo = int.parse(widget.patientInfo.admissionNo); } else { listHisProgNotePhysicalExaminationVM.admissionNo = 0; } - postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM - .add(listHisProgNotePhysicalExaminationVM); + postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM.add(listHisProgNotePhysicalExaminationVM); }); if (model.patientPhysicalExamList.isEmpty) { @@ -275,14 +230,12 @@ class _UpdateObjectivePageState extends State if (model.state == ViewState.ErrorLocal) { widget.changeLoadingState(false); Utils.showErrorToast(model.error); - if (widget.patientInfo.admissionNo != null && - widget.patientInfo.admissionNo.isNotEmpty) { + if (widget.patientInfo.admissionNo != null && widget.patientInfo.admissionNo.isNotEmpty) { // Navigator.of(context).pop(); model.isAddExamInProgress = false; } } else { - if (widget.patientInfo.admissionNo != null && - widget.patientInfo.admissionNo.isNotEmpty) { + if (widget.patientInfo.admissionNo != null && widget.patientInfo.admissionNo.isNotEmpty) { // Navigator.of(context).pop(); widget.changeLoadingState(false); model.isAddExamInProgress = false; @@ -298,10 +251,7 @@ class _UpdateObjectivePageState extends State } removeExamination(MasterKeyModel masterKey) { - Iterable history = mySelectedExamination.where( - (element) => - masterKey.id == element.selectedExamination.id && - masterKey.typeId == element.selectedExamination.typeId); + Iterable history = mySelectedExamination.where((element) => masterKey.id == element.selectedExamination.id && masterKey.typeId == element.selectedExamination.typeId); if (history.length > 0) { setState(() { @@ -322,17 +272,11 @@ class _UpdateObjectivePageState extends State FadePage( page: AddExaminationPage( mySelectedExamination: mySelectedExamination, - addSelectedExamination: - (List mySelectedExaminationLocal) { + addSelectedExamination: (List mySelectedExaminationLocal) { setState(() { { mySelectedExaminationLocal.forEach((element) { - if ((mySelectedExamination.singleWhere( - (it) => - it.selectedExamination.id == - element.selectedExamination.id, - orElse: () => null)) == - null) { + if ((mySelectedExamination.singleWhere((it) => it.selectedExamination.id == element.selectedExamination.id, orElse: () => null)) == null) { mySelectedExamination.insert(0, element); } }); @@ -340,12 +284,7 @@ class _UpdateObjectivePageState extends State /// remove items. List removedList = []; mySelectedExamination.forEach((element) { - if ((mySelectedExaminationLocal.singleWhere( - (it) => - it.selectedExamination.id == - element.selectedExamination.id, - orElse: () => null)) == - null) { + if ((mySelectedExaminationLocal.singleWhere((it) => it.selectedExamination.id == element.selectedExamination.id, orElse: () => null)) == null) { removedList.add(element); } }); diff --git a/lib/screens/patients/profile/soap_update/soap_utils.dart b/lib/screens/patients/profile/soap_update/soap_utils.dart index 29ed59d7..5100c613 100644 --- a/lib/screens/patients/profile/soap_update/soap_utils.dart +++ b/lib/screens/patients/profile/soap_update/soap_utils.dart @@ -4,48 +4,19 @@ import 'package:doctor_app_flutter/core/model/SOAP/selected_items/my_selected_ex import 'package:doctor_app_flutter/core/model/SOAP/selected_items/my_selected_history.dart'; class SoapUtils { - static MySelectedHistory generateMySelectedHistory( - {history, isChecked = false, remark, isLocal = true}) { - MySelectedHistory mySelectedHistory = MySelectedHistory( - selectedHistory: history, - isChecked: isChecked, - remark: remark, - isLocal: isLocal); + static MySelectedHistory generateMySelectedHistory({history, isChecked = false, remark, isLocal = true}) { + MySelectedHistory mySelectedHistory = MySelectedHistory(selectedHistory: history, isChecked: isChecked, remark: remark, isLocal: isLocal); return mySelectedHistory; } - static MySelectedAllergy generateMySelectedAllergy( - {allergy, - allergySeverity, - isChecked = false, - remark, - isLocal = true, - int createdBy, - bool isExpanded = false}) { - MySelectedAllergy mySelectedAllergy = MySelectedAllergy( - selectedAllergy: allergy, - selectedAllergySeverity: allergySeverity, - isChecked: isChecked, - remark: remark, - isLocal: isLocal, - createdBy: createdBy, - isExpanded: isExpanded); + static MySelectedAllergy generateMySelectedAllergy({allergy, allergySeverity, isChecked = false, remark, isLocal = true, int createdBy, bool isExpanded = false}) { + MySelectedAllergy mySelectedAllergy = + MySelectedAllergy(selectedAllergy: allergy, selectedAllergySeverity: allergySeverity, isChecked: isChecked, remark: remark, isLocal: isLocal, createdBy: createdBy, isExpanded: isExpanded); return mySelectedAllergy; } static MySelectedExamination generateMySelectedExamination( - {examination, - allergySeverity, - isChecked = false, - remark, - isLocal = true, - isNormal, - createdBy, - createdOn, - editedOn, - notExamined, - isNew, - isAbnormal}) { + {examination, allergySeverity, isChecked = false, remark, isLocal = true, isNormal, createdBy, createdOn, editedOn, notExamined, isNew, isAbnormal}) { MySelectedExamination mySelectedExamination = MySelectedExamination( selectedExamination: examination, remark: remark, @@ -61,17 +32,7 @@ class SoapUtils { return mySelectedExamination; } - static MySelectedAssessment generateMySelectedAssessment( - {appointmentNo, - remark, - diagnosisType, - diagnosisCondition, - selectedICD, - doctorID, - doctorName, - createdBy, - createdOn, - icdCode10ID}) { + static MySelectedAssessment generateMySelectedAssessment({appointmentNo, remark, diagnosisType, diagnosisCondition, selectedICD, doctorID, doctorName, createdBy, createdOn, icdCode10ID}) { MySelectedAssessment mySelectedAssessment = MySelectedAssessment( appointmentId: appointmentNo, remark: remark, diff --git a/pubspec.yaml b/pubspec.yaml index 27cb655f..0e4ff414 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -11,7 +11,7 @@ description: A new Flutter project. # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. # Read more about iOS versioning at # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html -version: 4.3.5+1 +version: 1.3.97+1 environment: From 1a67129a851d7776d38ed653d4e47ffc195be857 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Mon, 28 Aug 2023 09:42:17 +0300 Subject: [PATCH 16/28] radiology fixes --- android/build.gradle | 2 +- .../gradle/wrapper/gradle-wrapper.properties | 2 +- .../viewModel/patient-ucaf-viewmodel.dart | 2 +- lib/core/viewModel/radiology_view_model.dart | 57 +++++-------------- .../radiology/radiology_details_page.dart | 1 - 5 files changed, 18 insertions(+), 46 deletions(-) diff --git a/android/build.gradle b/android/build.gradle index b40a5b6e..dc4d22a0 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -1,5 +1,5 @@ buildscript { - ext.kotlin_version = '1.6.10' + ext.kotlin_version = '1.7.20' repositories { google() jcenter() diff --git a/android/gradle/wrapper/gradle-wrapper.properties b/android/gradle/wrapper/gradle-wrapper.properties index ed1a787b..02e5f581 100644 --- a/android/gradle/wrapper/gradle-wrapper.properties +++ b/android/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-all.zip diff --git a/lib/core/viewModel/patient-ucaf-viewmodel.dart b/lib/core/viewModel/patient-ucaf-viewmodel.dart index ace5e866..741344b2 100644 --- a/lib/core/viewModel/patient-ucaf-viewmodel.dart +++ b/lib/core/viewModel/patient-ucaf-viewmodel.dart @@ -71,7 +71,7 @@ class UcafViewModel extends BaseViewModel { // await _ucafService.getPatientVitalSignsHistory(patient, from, to); await _ucafService.getInPatientVitalSignHistory(patient, false); - // await _ucafService.getPatientChiefComplaint(patient); + await _ucafService.getPatientChiefComplaint(patient); if (_ucafService.hasError) { error = _ucafService.error; diff --git a/lib/core/viewModel/radiology_view_model.dart b/lib/core/viewModel/radiology_view_model.dart index 35b39cb7..57cccce5 100644 --- a/lib/core/viewModel/radiology_view_model.dart +++ b/lib/core/viewModel/radiology_view_model.dart @@ -15,54 +15,35 @@ class RadiologyViewModel extends BaseViewModel { List _finalRadiologyListClinic = List(); List _finalRadiologyListHospital = List(); - List get finalRadiologyList => - filterType == FilterType.Clinic - ? _finalRadiologyListClinic - : _finalRadiologyListHospital; + List get finalRadiologyList => filterType == FilterType.Clinic ? _finalRadiologyListClinic : _finalRadiologyListHospital; - void getPatientRadOrders(PatiantInformtion patient, - {isInPatient = false}) async { + void getPatientRadOrders(PatiantInformtion patient, {isInPatient = false}) async { setState(ViewState.Busy); - await _radiologyService.getPatientRadOrders(patient, - isInPatient: isInPatient); + await _radiologyService.getPatientRadOrders(patient, isInPatient: isInPatient); if (_radiologyService.hasError) { error = _radiologyService.error; setState(ViewState.Error); } else { _radiologyService.finalRadiologyList.forEach((element) { - List finalRadiologyListClinic = - _finalRadiologyListClinic - .where((elementClinic) => - elementClinic.filterName == element.clinicDescription) - .toList(); + List finalRadiologyListClinic = _finalRadiologyListClinic.where((elementClinic) => elementClinic.filterName == element.clinicDescription).toList(); if (finalRadiologyListClinic.length != 0) { - _finalRadiologyListClinic[ - finalRadiologyListClinic.indexOf(finalRadiologyListClinic[0])] - .finalRadiologyList - .add(element); + _finalRadiologyListClinic[finalRadiologyListClinic.indexOf(finalRadiologyListClinic[0])].finalRadiologyList.add(element); } else { - _finalRadiologyListClinic.add(FinalRadiologyList( - filterName: element.clinicDescription, finalRadiology: element)); + _finalRadiologyListClinic.add(FinalRadiologyList(filterName: element.clinicDescription, finalRadiology: element)); } // FinalRadiologyList list sort via project - List finalRadiologyListHospital = - _finalRadiologyListHospital - .where( - (elementClinic) => - elementClinic.filterName == element.projectName, - ) - .toList(); + List finalRadiologyListHospital = _finalRadiologyListHospital + .where( + (elementClinic) => elementClinic.filterName == element.projectName, + ) + .toList(); if (finalRadiologyListHospital.length != 0) { - _finalRadiologyListHospital[finalRadiologyListHospital - .indexOf(finalRadiologyListHospital[0])] - .finalRadiologyList - .add(element); + _finalRadiologyListHospital[finalRadiologyListHospital.indexOf(finalRadiologyListHospital[0])].finalRadiologyList.add(element); } else { - _finalRadiologyListHospital.add(FinalRadiologyList( - filterName: element.projectName, finalRadiology: element)); + _finalRadiologyListHospital.add(FinalRadiologyList(filterName: element.projectName, finalRadiology: element)); } }); @@ -72,17 +53,9 @@ class RadiologyViewModel extends BaseViewModel { String get radImageURL => _radiologyService.url; - getRadImageURL( - {int invoiceNo, - int lineItem, - int projectId, - @required PatiantInformtion patient}) async { + getRadImageURL({int invoiceNo, int lineItem, int projectId, @required PatiantInformtion patient}) async { setState(ViewState.Busy); - await _radiologyService.getRadImageURL( - invoiceNo: invoiceNo, - lineItem: lineItem, - projectId: projectId, - patient: patient); + await _radiologyService.getRadImageURL(invoiceNo: invoiceNo, lineItem: lineItem, projectId: projectId, patient: patient); if (_radiologyService.hasError) { error = _radiologyService.error; setState(ViewState.Error); diff --git a/lib/screens/patients/profile/radiology/radiology_details_page.dart b/lib/screens/patients/profile/radiology/radiology_details_page.dart index ccd2fc11..ae5abefc 100644 --- a/lib/screens/patients/profile/radiology/radiology_details_page.dart +++ b/lib/screens/patients/profile/radiology/radiology_details_page.dart @@ -94,7 +94,6 @@ class RadiologyDetailsPage extends StatelessWidget { margin: EdgeInsets.only(left: 35, right: 35, top: 12, bottom: 12), child: AppButton( color: Color(0xffD02127), - disabled: finalRadiology.dIAPACSURL == "", onPressed: () async { await locator().logEvent( eventCategory: "RadiologyDetailsPage", From e530646c28bf22881f84257e0afb7ec226f17b15 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Tue, 29 Aug 2023 14:25:31 +0300 Subject: [PATCH 17/28] VidaPlus changes for radiology --- lib/config/config.dart | 4 +- .../hospitals/VidaPlusProjectListModel.dart | 15 ++ .../service/hospitals/hospitals_service.dart | 8 + .../radiology/radiology_service.dart | 6 +- .../viewModel/authentication_view_model.dart | 6 +- lib/core/viewModel/project_view_model.dart | 27 ++- lib/core/viewModel/radiology_view_model.dart | 4 +- lib/screens/auth/login_screen.dart | 225 ++++++++---------- .../patient_profile_screen.dart | 4 + .../profile_gird_for_other.dart | 118 ++------- .../radiology/radiology_details_page.dart | 11 +- .../radiology/radiology_home_page.dart | 13 +- lib/utils/utils.dart | 55 ++--- .../app_bar/patient-profile-app-bar.dart | 206 ++++++---------- 14 files changed, 293 insertions(+), 409 deletions(-) create mode 100644 lib/core/model/hospitals/VidaPlusProjectListModel.dart diff --git a/lib/config/config.dart b/lib/config/config.dart index 7be1e61f..b589e661 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -8,11 +8,11 @@ const BASE_URL_LIVE_CARE = 'https://livecare.hmg.com/'; // const BASE_URL_LIVE_CARE = 'https://livecareuat.hmg.com/'; // const BASE_URL = 'https://hmgwebservices.com/'; -const BASE_URL = 'https://uat.hmgwebservices.com/'; +// const BASE_URL = 'https://uat.hmgwebservices.com/'; // const BASE_URL = 'https://vidauat.cloudsolutions.com.sa/'; //Vida Plus URL -// const BASE_URL = 'https://vidamergeuat.cloudsolutions.com.sa/'; //Vida Plus URL +const BASE_URL = 'https://vidamergeuat.cloudsolutions.com.sa/'; //Vida Plus URL const PHARMACY_ITEMS_URL = "Services/Lists.svc/REST/GetPharmcyItems_Region_enh"; diff --git a/lib/core/model/hospitals/VidaPlusProjectListModel.dart b/lib/core/model/hospitals/VidaPlusProjectListModel.dart new file mode 100644 index 00000000..e56b82db --- /dev/null +++ b/lib/core/model/hospitals/VidaPlusProjectListModel.dart @@ -0,0 +1,15 @@ +class VidaPlusProjectListModel { + int projectID; + + VidaPlusProjectListModel({this.projectID}); + + VidaPlusProjectListModel.fromJson(Map json) { + projectID = json['ProjectID']; + } + + Map toJson() { + final Map data = new Map(); + data['ProjectID'] = this.projectID; + return data; + } +} diff --git a/lib/core/service/hospitals/hospitals_service.dart b/lib/core/service/hospitals/hospitals_service.dart index 96267d01..09e5a365 100644 --- a/lib/core/service/hospitals/hospitals_service.dart +++ b/lib/core/service/hospitals/hospitals_service.dart @@ -1,10 +1,12 @@ import 'package:doctor_app_flutter/config/config.dart'; +import 'package:doctor_app_flutter/core/model/hospitals/VidaPlusProjectListModel.dart'; import 'package:doctor_app_flutter/core/model/hospitals/get_hospitals_request_model.dart'; import 'package:doctor_app_flutter/core/model/hospitals/get_hospitals_response_model.dart'; import 'package:doctor_app_flutter/core/service/base/base_service.dart'; class HospitalsService extends BaseService { List hospitals = List(); + List vidaPlusProjectListModel = List(); Future getHospitals(GetHospitalsRequestModel getHospitalsRequestModel) async { hasError = false; @@ -15,6 +17,12 @@ class HospitalsService extends BaseService { response['ProjectInfo'].forEach((hospital) { hospitals.add(GetHospitalsResponseModel.fromJson(hospital)); }); + vidaPlusProjectListModel.clear(); + if (response['ProjectListVidaPlus'].length != 0) { + response['ProjectListVidaPlus'].forEach((item) { + vidaPlusProjectListModel.add(VidaPlusProjectListModel.fromJson(item)); + }); + } }, onFailure: (String error, int statusCode) { hasError = true; diff --git a/lib/core/service/patient_medical_file/radiology/radiology_service.dart b/lib/core/service/patient_medical_file/radiology/radiology_service.dart index 10eb9a49..22765c6d 100644 --- a/lib/core/service/patient_medical_file/radiology/radiology_service.dart +++ b/lib/core/service/patient_medical_file/radiology/radiology_service.dart @@ -10,11 +10,11 @@ class RadiologyService extends BaseService { String url = ''; bool isRadiologyVIDAPlus = false; - Future getRadImageURL({int invoiceNo, int lineItem, int projectId, @required PatiantInformtion patient}) async { + Future getRadImageURL({int invoiceNo, int lineItem, int projectId, bool isVidaPlus, @required PatiantInformtion patient}) async { hasError = false; final Map body = new Map(); - body['InvoiceNo'] = invoiceNo; - body['InvoiceNo_VP'] = invoiceNo; + body['InvoiceNo'] = isVidaPlus ? "0" : invoiceNo; + body['InvoiceNo_VP'] = isVidaPlus ? invoiceNo : "0"; body['LineItemNo'] = lineItem; body['ProjectID'] = projectId; diff --git a/lib/core/viewModel/authentication_view_model.dart b/lib/core/viewModel/authentication_view_model.dart index 52cdb1f7..aec315c8 100644 --- a/lib/core/viewModel/authentication_view_model.dart +++ b/lib/core/viewModel/authentication_view_model.dart @@ -15,6 +15,7 @@ import 'package:doctor_app_flutter/core/model/doctor/clinic_model.dart'; import 'package:doctor_app_flutter/core/model/doctor/doctor_profile_model.dart'; import 'package:doctor_app_flutter/core/model/doctor/profile_req_Model.dart'; import 'package:doctor_app_flutter/core/model/doctor/user_model.dart'; +import 'package:doctor_app_flutter/core/model/hospitals/VidaPlusProjectListModel.dart'; import 'package:doctor_app_flutter/core/model/hospitals/get_hospitals_request_model.dart'; import 'package:doctor_app_flutter/core/model/hospitals/get_hospitals_response_model.dart'; import 'package:doctor_app_flutter/core/service/authentication_service.dart'; @@ -52,6 +53,8 @@ class AuthenticationViewModel extends BaseViewModel { CheckActivationCodeForDoctorAppResponseModel get checkActivationCodeForDoctorAppRes => _authService.checkActivationCodeForDoctorAppRes; + List get vidaPlusProjectList => _hospitalsService.vidaPlusProjectListModel; + NewLoginInformationModel loggedUser; GetIMEIDetailsModel user; @@ -238,7 +241,8 @@ class AuthenticationViewModel extends BaseViewModel { /// add token to shared preferences in case of send activation code is success setDataAfterSendActivationSuccess(CheckActivationCodeForDoctorAppResponseModel sendActivationCodeForDoctorAppResponseModel) async { // print("VerificationCode : " + sendActivationCodeForDoctorAppResponseModel.verificationCode); - await sharedPref.setString(DOCTOR_SETUP_ID, sendActivationCodeForDoctorAppResponseModel.listDoctorsClinic[0].setupID != null ? sendActivationCodeForDoctorAppResponseModel.listDoctorsClinic[0].setupID : ""); + await sharedPref.setString( + DOCTOR_SETUP_ID, sendActivationCodeForDoctorAppResponseModel.listDoctorsClinic[0].setupID != null ? sendActivationCodeForDoctorAppResponseModel.listDoctorsClinic[0].setupID : ""); await sharedPref.setString(VIDA_AUTH_TOKEN_ID, sendActivationCodeForDoctorAppResponseModel.vidaAuthTokenID); await sharedPref.setString(VIDA_REFRESH_TOKEN_ID, sendActivationCodeForDoctorAppResponseModel.vidaRefreshTokenID); await sharedPref.setString(TOKEN, sendActivationCodeForDoctorAppResponseModel.authenticationTokenID); diff --git a/lib/core/viewModel/project_view_model.dart b/lib/core/viewModel/project_view_model.dart index 7e0c2468..9be8774a 100644 --- a/lib/core/viewModel/project_view_model.dart +++ b/lib/core/viewModel/project_view_model.dart @@ -6,6 +6,7 @@ import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; import 'package:doctor_app_flutter/core/model/doctor/clinic_model.dart'; import 'package:doctor_app_flutter/core/model/doctor/doctor_profile_model.dart'; +import 'package:doctor_app_flutter/core/model/hospitals/VidaPlusProjectListModel.dart'; import 'package:doctor_app_flutter/utils/dr_app_shared_pref.dart'; import 'package:doctor_app_flutter/utils/utils.dart'; import 'package:flutter/cupertino.dart'; @@ -32,12 +33,14 @@ class ProjectViewModel with ChangeNotifier { bool get isArabic => _isArabic; StreamSubscription subscription; + List _vidaPlusProjectListModel = List(); + + List get vidaPlusProjectList => _vidaPlusProjectListModel; + ProjectViewModel() { loadSharedPrefLanguage(); - subscription = Connectivity() - .onConnectivityChanged - .listen((ConnectivityResult result) { + subscription = Connectivity().onConnectivityChanged.listen((ConnectivityResult result) { switch (result) { case ConnectivityResult.wifi: isInternetConnection = true; @@ -53,6 +56,11 @@ class ProjectViewModel with ChangeNotifier { }); } + setVidaPlusProjectList(List vidaPlusProjectListModelInput) { + _vidaPlusProjectListModel = vidaPlusProjectListModelInput; + notifyListeners(); + } + void loadSharedPrefLanguage() async { currentLanguage = await sharedPref.getString(APP_Language); _appLocale = Locale(currentLanguage ?? 'en'); @@ -95,12 +103,18 @@ class ProjectViewModel with ChangeNotifier { try { dynamic localRes; - await baseAppClient.post(GET_CLINICS_FOR_DOCTOR, - onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(GET_CLINICS_FOR_DOCTOR, onSuccess: (dynamic response, int statusCode) { doctorClinicsList = []; response['List_DoctorsClinic'].forEach((v) { doctorClinicsList.add(new ClinicModel.fromJson(v)); }); + _vidaPlusProjectListModel.clear(); + if (response['ProjectListVidaPlus'].length != 0) { + response['ProjectListVidaPlus'].forEach((item) { + _vidaPlusProjectListModel.add(VidaPlusProjectListModel.fromJson(item)); + }); + setVidaPlusProjectList(_vidaPlusProjectListModel); + } localRes = response; }, onFailure: (String error, int statusCode) { throw error; @@ -122,7 +136,6 @@ class ProjectViewModel with ChangeNotifier { projectID: doctorProfile.projectID, ); - await Provider.of(AppGlobal.CONTEX, listen: false) - .getDoctorProfileBasedOnClinic(clinicModel); + await Provider.of(AppGlobal.CONTEX, listen: false).getDoctorProfileBasedOnClinic(clinicModel); } } diff --git a/lib/core/viewModel/radiology_view_model.dart b/lib/core/viewModel/radiology_view_model.dart index 57cccce5..e49af610 100644 --- a/lib/core/viewModel/radiology_view_model.dart +++ b/lib/core/viewModel/radiology_view_model.dart @@ -53,9 +53,9 @@ class RadiologyViewModel extends BaseViewModel { String get radImageURL => _radiologyService.url; - getRadImageURL({int invoiceNo, int lineItem, int projectId, @required PatiantInformtion patient}) async { + getRadImageURL({int invoiceNo, int lineItem, int projectId, bool isVidaPlus, @required PatiantInformtion patient}) async { setState(ViewState.Busy); - await _radiologyService.getRadImageURL(invoiceNo: invoiceNo, lineItem: lineItem, projectId: projectId, patient: patient); + await _radiologyService.getRadImageURL(invoiceNo: invoiceNo, lineItem: lineItem, projectId: projectId, isVidaPlus: isVidaPlus, patient: patient); if (_radiologyService.hasError) { error = _radiologyService.error; setState(ViewState.Error); diff --git a/lib/screens/auth/login_screen.dart b/lib/screens/auth/login_screen.dart index 0527742a..c1ce9c3c 100644 --- a/lib/screens/auth/login_screen.dart +++ b/lib/screens/auth/login_screen.dart @@ -3,6 +3,7 @@ import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/enum/view_state.dart'; import 'package:doctor_app_flutter/core/model/hospitals/get_hospitals_response_model.dart'; import 'package:doctor_app_flutter/core/viewModel/authentication_view_model.dart'; +import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/utils/utils.dart'; import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; @@ -32,10 +33,12 @@ class _LoginScreenState extends State { FocusNode focusPass = FocusNode(); FocusNode focusProject = FocusNode(); AuthenticationViewModel authenticationViewModel; + ProjectViewModel projectViewModel; @override Widget build(BuildContext context) { authenticationViewModel = Provider.of(context); + projectViewModel = Provider.of(context); return AppScaffold( isShowAppBar: false, backgroundColor: HexColor('#F8F8F8'), @@ -44,142 +47,106 @@ class _LoginScreenState extends State { Container( margin: EdgeInsetsDirectional.fromSTEB(30, 0, 30, 30), alignment: Alignment.topLeft, - child: Column( + child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ + Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Column( + //TODO Use App Text rather than text + Container( + child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - //TODO Use App Text rather than text - Container( - child: Column( + Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - SizedBox( - height: 30, - ), - ], + SizedBox( + height: 30, ), - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - SizedBox( - height: 10, - ), - Text( - TranslationBase.of(context).welcomeTo, - style: TextStyle( - fontSize: 16, - fontWeight: FontWeight.w600, - fontFamily: 'Poppins'), - ), - Text( - TranslationBase.of(context) - .drSulaimanAlHabib, - style: TextStyle( - color: Color(0xFF2B353E), - fontWeight: FontWeight.bold, - fontSize: SizeConfig.isMobile - ? 24 - : SizeConfig.realScreenWidth * - 0.029, - fontFamily: 'Poppins'), - ), - Text( - "Doctor App", - style: TextStyle( - fontSize: SizeConfig.isMobile - ? 16 - : SizeConfig.realScreenWidth * - 0.030, - fontWeight: FontWeight.w600, - color: Color(0xFFD02127)), - ), - ]), ], - )), - SizedBox( - height: 40, ), - Form( - key: loginFormKey, - child: Column( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Container( - width: SizeConfig.realScreenWidth * 0.90, - height: SizeConfig.realScreenHeight * 0.65, - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - buildSizedBox(), - AppTextFieldCustom( - hintText: - TranslationBase.of(context).enterId, - hasBorder: true, - controller: userIdController, - onChanged: (value) { - if (value != null) - setState(() { - authenticationViewModel.userInfo - .userID = value.trim(); - }); - }, - ), - buildSizedBox(), - AppTextFieldCustom( - hintText: TranslationBase.of(context) - .enterPassword, - hasBorder: true, - isSecure: true, - controller: passwordController, - onChanged: (value) { - if (value != null) - setState(() { - authenticationViewModel.userInfo - .password = value.trim(); - }); - // if(allowCallApi) { - this.getProjects( - authenticationViewModel - .userInfo.userID); - // setState(() { - // allowCallApi = false; - // }); - // } - }, - onClick: () {}, - ), - buildSizedBox(), - AppTextFieldCustom( - hintText: TranslationBase.of(context) - .selectYourProject, - hasBorder: true, - controller: projectIdController, - isTextFieldHasSuffix: true, - enabled: false, - onClick: () { - Utils.showCupertinoPicker( - context, - projectsList, - 'facilityName', - onSelectProject, - authenticationViewModel); - }, - ), - buildSizedBox() - ]), - ), - ], + Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ + SizedBox( + height: 10, + ), + Text( + TranslationBase.of(context).welcomeTo, + style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, fontFamily: 'Poppins'), + ), + Text( + TranslationBase.of(context).drSulaimanAlHabib, + style: TextStyle(color: Color(0xFF2B353E), fontWeight: FontWeight.bold, fontSize: SizeConfig.isMobile ? 24 : SizeConfig.realScreenWidth * 0.029, fontFamily: 'Poppins'), ), - ) + Text( + "Doctor App", + style: TextStyle(fontSize: SizeConfig.isMobile ? 16 : SizeConfig.realScreenWidth * 0.030, fontWeight: FontWeight.w600, color: Color(0xFFD02127)), + ), + ]), ], + )), + SizedBox( + height: 40, + ), + Form( + key: loginFormKey, + child: Column( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Container( + width: SizeConfig.realScreenWidth * 0.90, + height: SizeConfig.realScreenHeight * 0.65, + child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ + buildSizedBox(), + AppTextFieldCustom( + hintText: TranslationBase.of(context).enterId, + hasBorder: true, + controller: userIdController, + onChanged: (value) { + if (value != null) + setState(() { + authenticationViewModel.userInfo.userID = value.trim(); + }); + }, + ), + buildSizedBox(), + AppTextFieldCustom( + hintText: TranslationBase.of(context).enterPassword, + hasBorder: true, + isSecure: true, + controller: passwordController, + onChanged: (value) { + if (value != null) + setState(() { + authenticationViewModel.userInfo.password = value.trim(); + }); + // if(allowCallApi) { + this.getProjects(authenticationViewModel.userInfo.userID); + // setState(() { + // allowCallApi = false; + // }); + // } + }, + onClick: () {}, + ), + buildSizedBox(), + AppTextFieldCustom( + hintText: TranslationBase.of(context).selectYourProject, + hasBorder: true, + controller: projectIdController, + isTextFieldHasSuffix: true, + enabled: false, + onClick: () { + Utils.showCupertinoPicker(context, projectsList, 'facilityName', onSelectProject, authenticationViewModel); + }, + ), + buildSizedBox() + ]), + ), + ], + ), ) - ])) + ], + ) + ])) ]), ), bottomSheet: Container( @@ -195,8 +162,7 @@ class _LoginScreenState extends State { title: TranslationBase.of(context).login, color: AppGlobal.appRedColor, fontWeight: FontWeight.w600, - disabled: authenticationViewModel.userInfo.userID == null || - authenticationViewModel.userInfo.password == null, + disabled: authenticationViewModel.userInfo.userID == null || authenticationViewModel.userInfo.password == null, onPressed: () { login(context); }, @@ -246,8 +212,7 @@ class _LoginScreenState extends State { onSelectProject(index) { setState(() { - authenticationViewModel.userInfo.projectID = - projectsList[index].facilityId; + authenticationViewModel.userInfo.projectID = projectsList[index].facilityId; projectIdController.text = projectsList[index].facilityName; }); @@ -264,8 +229,8 @@ class _LoginScreenState extends State { if (authenticationViewModel.state == ViewState.Idle) { projectsList = authenticationViewModel.hospitals; setState(() { - authenticationViewModel.userInfo.projectID = - projectsList[0].facilityId; + projectViewModel.setVidaPlusProjectList(authenticationViewModel.vidaPlusProjectList); + authenticationViewModel.userInfo.projectID = projectsList[0].facilityId; projectIdController.text = projectsList[0].facilityName; }); } diff --git a/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart b/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart index 64f28ba9..bde71637 100644 --- a/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart +++ b/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart @@ -10,6 +10,7 @@ import 'package:doctor_app_flutter/core/service/AnalyticsService.dart'; import 'package:doctor_app_flutter/core/service/VideoCallService.dart'; import 'package:doctor_app_flutter/core/viewModel/LiveCarePatientViewModel.dart'; import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; +import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/live_care/end_call_screen.dart'; import 'package:doctor_app_flutter/screens/patients/profile/profile_screen/profile_gird_for_InPatient.dart'; @@ -25,6 +26,7 @@ import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils import 'package:flutter/material.dart'; import 'package:flutter_svg/svg.dart'; import 'package:hexcolor/hexcolor.dart'; +import 'package:provider/provider.dart'; import 'package:quiver/async.dart'; import '../../../../locator.dart'; @@ -137,6 +139,7 @@ class _PatientProfileScreenState extends State with Single @override Widget build(BuildContext context) { final screenSize = MediaQuery.of(context).size; + ProjectViewModel projectViewModel = Provider.of(context); return BaseView( onModelReady: (model) async { if (isFromLiveCare && patient.patientStatus == 1) await model.addPatientToDoctorList(patient.vcId); @@ -199,6 +202,7 @@ class _PatientProfileScreenState extends State with Single isFromLiveCare: isFromLiveCare, from: from, to: to, + projectViewModel: projectViewModel, ), ), SizedBox( diff --git a/lib/screens/patients/profile/profile_screen/profile_gird_for_other.dart b/lib/screens/patients/profile/profile_screen/profile_gird_for_other.dart index 1084f7f2..f9ea94a0 100644 --- a/lib/screens/patients/profile/profile_screen/profile_gird_for_other.dart +++ b/lib/screens/patients/profile/profile_screen/profile_gird_for_other.dart @@ -1,6 +1,8 @@ import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/screens/patients/profile/profile_screen/patient_profile_card_model.dart'; import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; +import 'package:doctor_app_flutter/utils/utils.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/PatientProfileButton.dart'; import 'package:flutter/material.dart'; @@ -16,122 +18,50 @@ class ProfileGridForOther extends StatelessWidget { final bool isFromLiveCare; String from; String to; + ProjectViewModel projectViewModel; - ProfileGridForOther( - {Key key, - this.patient, - this.patientType, - this.arrivalType, - this.height, - this.isInpatient, - this.from, - this.to, - this.isFromLiveCare}) - : super(key: key); + ProfileGridForOther({Key key, this.patient, this.patientType, this.arrivalType, this.height, this.isInpatient, this.from, this.to, this.isFromLiveCare, this.projectViewModel}) : super(key: key); @override Widget build(BuildContext context) { final List cardsList = [ - PatientProfileCardModel( - TranslationBase.of(context).vital, - TranslationBase.of(context).signs, - VITAL_SIGN_DETAILS, - 'assets/images/svgs/profile_screen/vital signs.svg', + PatientProfileCardModel(TranslationBase.of(context).vital, TranslationBase.of(context).signs, VITAL_SIGN_DETAILS, 'assets/images/svgs/profile_screen/vital signs.svg', isInPatient: isInpatient), + PatientProfileCardModel(TranslationBase.of(context).lab, TranslationBase.of(context).result, LAB_RESULT, 'assets/images/svgs/profile_screen/lab results.svg', isInPatient: isInpatient), + PatientProfileCardModel(TranslationBase.of(context).lab, TranslationBase.of(context).special, ALL_SPECIAL_LAB_RESULT, 'assets/images/svgs/profile_screen/lab results.svg', isInPatient: isInpatient), - PatientProfileCardModel( - TranslationBase.of(context).lab, - TranslationBase.of(context).result, - LAB_RESULT, - 'assets/images/svgs/profile_screen/lab results.svg', + PatientProfileCardModel(TranslationBase.of(context).radiology, TranslationBase.of(context).service, RADIOLOGY_PATIENT, 'assets/images/svgs/profile_screen/health summary.svg', isInPatient: isInpatient), - PatientProfileCardModel( - TranslationBase.of(context).lab, - TranslationBase.of(context).special, - ALL_SPECIAL_LAB_RESULT, - 'assets/images/svgs/profile_screen/lab results.svg', - isInPatient: isInpatient), - PatientProfileCardModel( - TranslationBase.of(context).radiology, - TranslationBase.of(context).service, - RADIOLOGY_PATIENT, - 'assets/images/svgs/profile_screen/health summary.svg', - isInPatient: isInpatient), - PatientProfileCardModel( - TranslationBase.of(context).orders, - TranslationBase.of(context).prescription + ' (${TranslationBase.of(context).old})', - ORDER_PRESCRIPTION_OLD, - 'assets/images/svgs/profile_screen/order prescription.svg', - isInPatient: isInpatient), - PatientProfileCardModel( - TranslationBase.of(context).patient, - TranslationBase.of(context).prescription, - ORDER_PRESCRIPTION_NEW, + PatientProfileCardModel(TranslationBase.of(context).orders, TranslationBase.of(context).prescription + ' (${TranslationBase.of(context).old})', ORDER_PRESCRIPTION_OLD, 'assets/images/svgs/profile_screen/order prescription.svg', isInPatient: isInpatient), - PatientProfileCardModel( - TranslationBase.of(context).health, - TranslationBase.of(context).summary, - HEALTH_SUMMARY, - 'assets/images/svgs/profile_screen/health summary.svg', + PatientProfileCardModel(TranslationBase.of(context).patient, TranslationBase.of(context).prescription, ORDER_PRESCRIPTION_NEW, 'assets/images/svgs/profile_screen/order prescription.svg', isInPatient: isInpatient), - PatientProfileCardModel(TranslationBase.of(context).patient, "ECG", - PATIENT_ECG, 'assets/images/svgs/profile_screen/ECG.svg', + PatientProfileCardModel(TranslationBase.of(context).health, TranslationBase.of(context).summary, HEALTH_SUMMARY, 'assets/images/svgs/profile_screen/health summary.svg', isInPatient: isInpatient), - PatientProfileCardModel( - TranslationBase.of(context).orders, - TranslationBase.of(context).procedures, - ORDER_PROCEDURE, - 'assets/images/svgs/profile_screen/Order Procedures.svg', + PatientProfileCardModel(TranslationBase.of(context).patient, "ECG", PATIENT_ECG, 'assets/images/svgs/profile_screen/ECG.svg', isInPatient: isInpatient), + PatientProfileCardModel(TranslationBase.of(context).orders, TranslationBase.of(context).procedures, ORDER_PROCEDURE, 'assets/images/svgs/profile_screen/Order Procedures.svg', isInPatient: isInpatient), - PatientProfileCardModel( - TranslationBase.of(context).insurance, - TranslationBase.of(context).service, - PATIENT_INSURANCE_APPROVALS_NEW, - 'assets/images/svgs/profile_screen/insurance approval.svg', + PatientProfileCardModel(TranslationBase.of(context).insurance, TranslationBase.of(context).service, PATIENT_INSURANCE_APPROVALS_NEW, 'assets/images/svgs/profile_screen/insurance approval.svg', isInPatient: isInpatient), - PatientProfileCardModel( - TranslationBase.of(context).patientSick, - TranslationBase.of(context).leave, - ADD_SICKLEAVE, - 'assets/images/svgs/profile_screen/patient sick leave.svg', + PatientProfileCardModel(TranslationBase.of(context).patientSick, TranslationBase.of(context).leave, ADD_SICKLEAVE, 'assets/images/svgs/profile_screen/patient sick leave.svg', isInPatient: isInpatient), - if (isFromLiveCare || - (patient.appointmentNo != null && patient.appointmentNo != 0)) - PatientProfileCardModel( - TranslationBase.of(context).patient, - TranslationBase.of(context).ucaf, - PATIENT_UCAF_REQUEST, - 'assets/images/svgs/profile_screen/UCAF.svg', - isInPatient: isInpatient, - isDisable: isFromLiveCare - ? patient.appointmentNo == null - : patient.patientStatusType != 43 || - patient.appointmentNo == null), - if (isFromLiveCare || - (patient.appointmentNo != null && patient.appointmentNo != 0)) + if (isFromLiveCare || (patient.appointmentNo != null && patient.appointmentNo != 0)) + PatientProfileCardModel(TranslationBase.of(context).patient, TranslationBase.of(context).ucaf, PATIENT_UCAF_REQUEST, 'assets/images/svgs/profile_screen/UCAF.svg', + isInPatient: isInpatient, isDisable: isFromLiveCare ? patient.appointmentNo == null : patient.patientStatusType != 43 || patient.appointmentNo == null), + if (isFromLiveCare || (patient.appointmentNo != null && patient.appointmentNo != 0)) PatientProfileCardModel( TranslationBase.of(context).referral, TranslationBase.of(context).patient, REFER_PATIENT_TO_DOCTOR, 'assets/images/svgs/profile_screen/refer patient.svg', isInPatient: isInpatient, - isDisable: isFromLiveCare - ? patient.appointmentNo == null - : patient.patientStatusType != 43 || - patient.appointmentNo == null, + isDisable: isFromLiveCare ? patient.appointmentNo == null : patient.patientStatusType != 43 || patient.appointmentNo == null, ), - if (isFromLiveCare || - (patient.appointmentNo != null && patient.appointmentNo != 0)) - PatientProfileCardModel( - TranslationBase.of(context).admission, - TranslationBase.of(context).request, - PATIENT_ADMISSION_REQUEST, - 'assets/images/svgs/profile_screen/admission req.svg', + if (isFromLiveCare || (patient.appointmentNo != null && patient.appointmentNo != 0)) + PatientProfileCardModel(TranslationBase.of(context).admission, TranslationBase.of(context).request, PATIENT_ADMISSION_REQUEST, 'assets/images/svgs/profile_screen/admission req.svg', isInPatient: isInpatient, - isDisable: isFromLiveCare - ? patient.appointmentNo == null - : patient.patientStatusType != 43 || - patient.appointmentNo == null), + isDisable: + Utils.isVidaPlusProject(projectViewModel, patient.projectId) || (isFromLiveCare ? patient.appointmentNo == null : patient.patientStatusType != 43) || patient.appointmentNo == null), ]; return Padding( padding: const EdgeInsets.symmetric(vertical: 15.0, horizontal: 15), diff --git a/lib/screens/patients/profile/radiology/radiology_details_page.dart b/lib/screens/patients/profile/radiology/radiology_details_page.dart index ae5abefc..a71bc59d 100644 --- a/lib/screens/patients/profile/radiology/radiology_details_page.dart +++ b/lib/screens/patients/profile/radiology/radiology_details_page.dart @@ -1,15 +1,18 @@ import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/core/model/radiology/final_radiology.dart'; import 'package:doctor_app_flutter/core/service/AnalyticsService.dart'; +import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/radiology_view_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; +import 'package:doctor_app_flutter/utils/utils.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-profile-app-bar.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; import 'package:url_launcher/url_launcher.dart'; import '../../../../locator.dart'; @@ -26,9 +29,15 @@ class RadiologyDetailsPage extends StatelessWidget { @override Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); return BaseView( onModelReady: (model) => model.getRadImageURL( - patient: patient, projectId: finalRadiology.projectID, lineItem: finalRadiology.invoiceLineItemNo, invoiceNo: isVidaPlus ? finalRadiology.invoiceNo_VP : finalRadiology.invoiceNo), + patient: patient, + projectId: finalRadiology.projectID, + lineItem: finalRadiology.invoiceLineItemNo, + invoiceNo: Utils.isVidaPlusProject(projectViewModel, finalRadiology.projectID) ? finalRadiology.invoiceNo_VP : finalRadiology.invoiceNo, + isVidaPlus: Utils.isVidaPlusProject(projectViewModel, finalRadiology.projectID), + ), builder: (_, model, widget) => AppScaffold( appBar: PatientProfileAppBar( patient, diff --git a/lib/screens/patients/profile/radiology/radiology_home_page.dart b/lib/screens/patients/profile/radiology/radiology_home_page.dart index 0f64185c..cc419e06 100644 --- a/lib/screens/patients/profile/radiology/radiology_home_page.dart +++ b/lib/screens/patients/profile/radiology/radiology_home_page.dart @@ -143,7 +143,10 @@ class _RadiologyHomePageState extends State { isNoMargin: true, doctorName: Utils.convertToTitleCase(model.radiologyList[index].doctorName), profileUrl: model.radiologyList[index].doctorImageURL, - invoiceNO: model.isRadiologyVIDAPlus ? '${model.radiologyList[index].invoiceNo}' : '${model.radiologyList[index].invoiceNo}', + invoiceNO: Utils.isVidaPlusProject(projectViewModel, model.radiologyList[index].projectID) + ? '${model.radiologyList[index].invoiceNo_VP}' + : '${model.radiologyList[index].invoiceNo}', + // model.isRadiologyVIDAPlus ? '${model.radiologyList[index].invoiceNo}' : '${model.radiologyList[index].invoiceNo}', branch: '${model.radiologyList[index].projectName}', clinic: Utils.convertToTitleCase(model.radiologyList[index].clinicDescription), appointmentDate: model.radiologyList[index].orderDate ?? model.radiologyList[index].reportDate, @@ -152,7 +155,13 @@ class _RadiologyHomePageState extends State { context, FadePage( page: RadiologyDetailsPage( - finalRadiology: model.radiologyList[index], patient: patient, isInpatient: isInpatient, isVidaPlus: model.radiologyList[index].isRecordFromVidaPlus), + finalRadiology: model.radiologyList[index], + patient: patient, + isInpatient: isInpatient, + isVidaPlus: Utils.isVidaPlusProject(projectViewModel, model.radiologyList[index].projectID) + // false + // model.radiologyList[index].isRecordFromVidaPlus + ), ), ); }, diff --git a/lib/utils/utils.dart b/lib/utils/utils.dart index 48213619..9907a032 100644 --- a/lib/utils/utils.dart +++ b/lib/utils/utils.dart @@ -4,6 +4,7 @@ import 'package:doctor_app_flutter/core/model/hospitals/get_hospitals_response_m import 'package:doctor_app_flutter/core/service/NavigationService.dart'; import 'package:doctor_app_flutter/core/viewModel/authentication_view_model.dart'; import 'package:doctor_app_flutter/core/model/doctor/list_doctor_working_hours_table_model.dart'; +import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/utils/dr_app_shared_pref.dart'; import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; @@ -25,8 +26,7 @@ class Utils { get currentLanguage => null; - static showConfirmationDialog( - BuildContext context, String message, Function okFunction) { + static showConfirmationDialog(BuildContext context, String message, Function okFunction) { return showDialog( context: context, barrierDismissible: false, // user must tap button! @@ -63,8 +63,7 @@ class Utils { }); } - static showCupertinoPicker(context, List items, - decKey, onSelectFun, AuthenticationViewModel model) { + static showCupertinoPicker(context, List items, decKey, onSelectFun, AuthenticationViewModel model) { showModalBottomSheet( isDismissible: false, context: context, @@ -82,8 +81,7 @@ class Utils { mainAxisAlignment: MainAxisAlignment.end, children: [ CupertinoButton( - child: Text(TranslationBase.of(context).cancel, - style: textStyle(context)), + child: Text(TranslationBase.of(context).cancel, style: textStyle(context)), onPressed: () { Navigator.pop(context); }, @@ -101,27 +99,19 @@ class Utils { ], ), ), - Container( - height: SizeConfig.realScreenHeight * 0.3, - color: Color(0xfff7f7f7), - child: buildPickerItems( - context, items, decKey, onSelectFun, model)) + Container(height: SizeConfig.realScreenHeight * 0.3, color: Color(0xfff7f7f7), child: buildPickerItems(context, items, decKey, onSelectFun, model)) ], ), ); }); } + static TextStyle textStyle(context) => TextStyle(color: Theme.of(context).primaryColor); - static TextStyle textStyle(context) => - TextStyle(color: Theme.of(context).primaryColor); - - static buildPickerItems(context, List items, - decKey, onSelectFun, model) { + static buildPickerItems(context, List items, decKey, onSelectFun, model) { return CupertinoPicker( magnification: 1.5, - scrollController: - FixedExtentScrollController(initialItem: cupertinoPickerIndex), + scrollController: FixedExtentScrollController(initialItem: cupertinoPickerIndex), children: items.map((item) { return Text( '${item.facilityName}', @@ -147,10 +137,8 @@ class Utils { } static Future checkConnection() async { - ConnectivityResult connectivityResult = - await (Connectivity().checkConnectivity()); - if ((connectivityResult == ConnectivityResult.mobile) || - (connectivityResult == ConnectivityResult.wifi)) { + ConnectivityResult connectivityResult = await (Connectivity().checkConnectivity()); + if ((connectivityResult == ConnectivityResult.mobile) || (connectivityResult == ConnectivityResult.wifi)) { return true; } else { return false; @@ -163,8 +151,7 @@ class Utils { listOfHours.forEach((element) { WorkingHours workingHours = WorkingHours(); - var from = element.substring( - element.indexOf('m ') + 2, element.indexOf('To') - 1); + var from = element.substring(element.indexOf('m ') + 2, element.indexOf('To') - 1); workingHours.from = from.trim(); var to = element.substring(element.indexOf('To') + 2); workingHours.to = to.trim(); @@ -232,9 +219,7 @@ class Utils { return parsedString; } - static InputDecoration textFieldSelectorDecoration( - String hintText, String selectedText, bool isDropDown, - {Icon suffixIcon, Color dropDownColor}) { + static InputDecoration textFieldSelectorDecoration(String hintText, String selectedText, bool isDropDown, {Icon suffixIcon, Color dropDownColor}) { return InputDecoration( focusedBorder: OutlineInputBorder( borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), @@ -264,9 +249,7 @@ class Utils { ); } - static BoxDecoration containerBorderDecoration( - Color containerColor, Color borderColor, - {double borderWidth = -1}) { + static BoxDecoration containerBorderDecoration(Color containerColor, Color borderColor, {double borderWidth = -1}) { return BoxDecoration( color: containerColor, shape: BoxShape.rectangle, @@ -326,8 +309,6 @@ class Utils { return kpi; } - - static String convertToTitleCase(String text) { if (text == null) { return null; @@ -354,4 +335,14 @@ class Utils { // Join/Merge all words back to one String return capitalizedWords.join(' '); } + + static bool isVidaPlusProject(ProjectViewModel projectViewModel, int projectID) { + bool isVidaPlus = false; + projectViewModel.vidaPlusProjectList.forEach((element) { + if (element.projectID == projectID) { + isVidaPlus = true; + } + }); + return isVidaPlus; + } } diff --git a/lib/widgets/patients/profile/app_bar/patient-profile-app-bar.dart b/lib/widgets/patients/profile/app_bar/patient-profile-app-bar.dart index c27c9dd7..19578c2b 100644 --- a/lib/widgets/patients/profile/app_bar/patient-profile-app-bar.dart +++ b/lib/widgets/patients/profile/app_bar/patient-profile-app-bar.dart @@ -73,17 +73,14 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget { right: 5, bottom: 5, ), - decoration: BoxDecoration( - color: Colors.white, - border: Border(bottom: BorderSide(color: Color(0xFFEFEFEF)))), + decoration: BoxDecoration(color: Colors.white, border: Border(bottom: BorderSide(color: Color(0xFFEFEFEF)))), child: Container( - padding: EdgeInsets.only(left: 10, right: 10, bottom: 10), + padding: EdgeInsets.only(left: 10, right: 10, bottom: 0), margin: EdgeInsets.only(top: SizeConfig.isHeightVeryShort ? 30 : 50), child: Column( children: [ Container( - padding: EdgeInsets.only( - left: SizeConfig.isHeightVeryShort ? 0 : 12.0), + padding: EdgeInsets.only(left: SizeConfig.isHeightVeryShort ? 0 : 12.0), child: Row(children: [ IconButton( icon: Icon(Icons.arrow_back_ios), @@ -96,11 +93,8 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget { Expanded( child: AppText( patient.firstName != null - ? (Utils.capitalize(patient.firstName) + - " " + - Utils.capitalize(patient.lastName)) - : Utils.capitalize(patient.fullName ?? - patient.patientDetails.fullName), + ? (Utils.capitalize(patient.firstName) + " " + Utils.capitalize(patient.lastName)) + : Utils.capitalize(patient.fullName ?? patient.patientDetails.fullName), fontSize: SizeConfig.textMultiplier * 1.8, fontWeight: FontWeight.bold, fontFamily: 'Poppins', @@ -133,15 +127,12 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget { ), Row(children: [ Padding( - padding: EdgeInsets.only( - left: SizeConfig.isHeightVeryShort ? 0 : 12.0), + padding: EdgeInsets.only(left: SizeConfig.isHeightVeryShort ? 0 : 12.0), child: Container( width: SizeConfig.getTextMultiplierBasedOnWidth() * 20, height: SizeConfig.getTextMultiplierBasedOnWidth() * 20, child: Image.asset( - gender == 1 - ? 'assets/images/male_avatar.png' - : 'assets/images/female_avatar.png', + gender == 1 ? 'assets/images/male_avatar.png' : 'assets/images/female_avatar.png', fit: BoxFit.cover, ), ), @@ -164,29 +155,18 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget { color: AppGlobal.appGreenColor, fontWeight: FontWeight.bold, fontFamily: 'Poppins', - fontSize: SizeConfig - .getTextMultiplierBasedOnWidth() * - 3.5, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.5, ) : AppText( TranslationBase.of(context).notArrived, color: Colors.red[800], fontWeight: FontWeight.bold, fontFamily: 'Poppins', - fontSize: SizeConfig - .getTextMultiplierBasedOnWidth() * - 3.5, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.5, ), patient.startTime != null - ? AppText( - patient.startTime != null - ? patient.startTime - : '', - fontWeight: FontWeight.w700, - fontSize: SizeConfig - .getTextMultiplierBasedOnWidth() * - 3.5, - color: Color(0xFF2E303A)) + ? AppText(patient.startTime != null ? patient.startTime : '', + fontWeight: FontWeight.w700, fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.5, color: Color(0xFF2E303A)) : SizedBox() ], )) @@ -199,9 +179,7 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget { children: [ AppText( TranslationBase.of(context).fileNumber, - fontSize: - SizeConfig.getTextMultiplierBasedOnWidth() * - 3, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3, color: Color(0xFF575757), fontWeight: FontWeight.w600, ), @@ -210,9 +188,7 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget { ), AppText( patient.patientId.toString(), - fontSize: - SizeConfig.getTextMultiplierBasedOnWidth() * - 3.5, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.5, color: Color(0xFF2E303A), fontWeight: FontWeight.w700, isCopyable: true, @@ -222,14 +198,9 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget { Row( children: [ AppText( - patient.nationalityName ?? - patient.nationality ?? - patient.nationalityId ?? - '', + patient.nationalityName ?? patient.nationality ?? patient.nationalityId ?? '', fontWeight: FontWeight.bold, - fontSize: - SizeConfig.getTextMultiplierBasedOnWidth() * - 3.5, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.5, ), patient.nationalityFlagURL != null ? ClipRRect( @@ -238,9 +209,7 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget { patient.nationalityFlagURL, height: 25, width: 30, - errorBuilder: (BuildContext context, - Object exception, - StackTrace stackTrace) { + errorBuilder: (BuildContext context, Object exception, StackTrace stackTrace) { return Text('No Image'); }, )) @@ -256,42 +225,29 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget { "${AppDateUtils.getAgeByBirthday(patient.patientDetails != null ? patient.patientDetails.dateofBirth ?? "" : patient.dateofBirth ?? "", context, isServerFormat: !isFromLiveCare)}", ), - if (patient.appointmentDate != null && - patient.appointmentDate.isNotEmpty && - !isFromLabResult) + if (patient.appointmentDate != null && patient.appointmentDate.isNotEmpty && !isFromLabResult) HeaderRow( - label: - TranslationBase.of(context).appointmentDate + " : ", - value: AppDateUtils.getDayMonthYearDateFormatted( - AppDateUtils.convertStringToDate( - patient.appointmentDate)), + label: TranslationBase.of(context).appointmentDate + " : ", + value: AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.convertStringToDate(patient.appointmentDate)), ), if (isFromLabResult) HeaderRow( label: "Result Date: ", - value: - '${AppDateUtils.getDayMonthYearDateFormatted(appointmentDate, isArabic: projectViewModel.isArabic)}', + value: '${AppDateUtils.getDayMonthYearDateFormatted(appointmentDate, isArabic: projectViewModel.isArabic)}', ), // if(isInpatient) Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - if (patient.admissionDate != null && - patient.admissionDate.isNotEmpty) + if (patient.admissionDate != null && patient.admissionDate.isNotEmpty) HeaderRow( - label: patient.admissionDate == null - ? "" - : TranslationBase.of(context).admissionDate + - " : ", - value: patient.admissionDate == null - ? "" - : "${AppDateUtils.getDayMonthYearDateFormatted((AppDateUtils.getDateTimeFromServerFormat(patient.admissionDate.toString())))}", + label: patient.admissionDate == null ? "" : TranslationBase.of(context).admissionDate + " : ", + value: patient.admissionDate == null ? "" : "${AppDateUtils.getDayMonthYearDateFormatted((AppDateUtils.getDateTimeFromServerFormat(patient.admissionDate.toString())))}", ), if (patient.admissionDate != null) HeaderRow( label: "${TranslationBase.of(context).numOfDays}: ", - value: isDischargedPatient && - patient.dischargeDate != null + value: isDischargedPatient && patient.dischargeDate != null ? "${AppDateUtils.getDateTimeFromServerFormat(patient.dischargeDate).difference(AppDateUtils.getDateTimeFromServerFormat(patient.admissionDate)).inDays + 1}" : "${DateTime.now().difference(AppDateUtils.getDateTimeFromServerFormat(patient.admissionDate)).inDays + 1}", ) @@ -308,15 +264,11 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget { Container( width: 30, height: 30, - margin: EdgeInsets.only( - left: projectViewModel.isArabic ? 10 : 85, - right: projectViewModel.isArabic ? 85 : 10, - top: 5), + margin: EdgeInsets.only(left: projectViewModel.isArabic ? 10 : 85, right: projectViewModel.isArabic ? 85 : 10, top: 5), decoration: BoxDecoration( shape: BoxShape.rectangle, border: Border( - bottom: - BorderSide(color: Colors.grey[400], width: 2.5), + bottom: BorderSide(color: Colors.grey[400], width: 2.5), left: BorderSide(color: Colors.grey[400], width: 2.5), )), ), @@ -339,65 +291,50 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget { flex: 5, child: Container( margin: EdgeInsets.all(10), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( - Utils.convertToTitleCase( - '${TranslationBase.of(context).dr}$doctorName'), - color: Color(0xFF2E303A), - fontWeight: FontWeight.w700, - fontSize: SizeConfig - .getTextMultiplierBasedOnWidth() * - 3.5, - isCopyable: true, - ), - if (orderNo != null && !isPrescriptions) - HeaderRow( - label: 'Order No: ', - value: orderNo ?? '', - ), - if (invoiceNO != null && !isPrescriptions) - HeaderRow( - label: 'Invoice: ', - value: invoiceNO ?? "", - ), - if (branch != null) - HeaderRow( - label: 'Branch: ', - value: branch ?? '', - ), - if (clinic != null) - Container( - width: - MediaQuery.of(context).size.width * - 0.51, - child: HeaderRow( - label: 'Clinic: ', - value: Utils.convertToTitleCase( - clinic) ?? - '', - isExpanded: true), - ), - if (isMedicalFile && episode != null) - HeaderRow( - label: 'Episode: ', - value: episode ?? '', - ), - if (isMedicalFile && visitDate != null) - HeaderRow( - label: 'Visit Date: ', - value: visitDate ?? '', - ), - if (!isMedicalFile) - HeaderRow( - label: !isPrescriptions - ? 'Result Date:' - : 'Prescriptions Date ', - value: - '${AppDateUtils.getDayMonthYearDateFormatted(appointmentDate, isArabic: projectViewModel.isArabic)}', - ), - ]), + child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ + AppText( + Utils.convertToTitleCase('${TranslationBase.of(context).dr}$doctorName'), + color: Color(0xFF2E303A), + fontWeight: FontWeight.w700, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.5, + isCopyable: true, + ), + if (orderNo != null && !isPrescriptions) + HeaderRow( + label: 'Order No: ', + value: orderNo ?? '', + ), + if (invoiceNO != null && !isPrescriptions) + HeaderRow( + label: 'Invoice: ', + value: invoiceNO ?? "", + ), + if (branch != null) + HeaderRow( + label: 'Branch: ', + value: branch ?? '', + ), + if (clinic != null) + Container( + width: MediaQuery.of(context).size.width * 0.51, + child: HeaderRow(label: 'Clinic: ', value: Utils.convertToTitleCase(clinic) ?? '', isExpanded: true), + ), + if (isMedicalFile && episode != null) + HeaderRow( + label: 'Episode: ', + value: episode ?? '', + ), + if (isMedicalFile && visitDate != null) + HeaderRow( + label: 'Visit Date: ', + value: visitDate ?? '', + ), + if (!isMedicalFile) + HeaderRow( + label: !isPrescriptions ? 'Result Date:' : 'Prescriptions Date ', + value: '${AppDateUtils.getDayMonthYearDateFormatted(appointmentDate, isArabic: projectViewModel.isArabic)}', + ), + ]), ), ), ], @@ -424,7 +361,6 @@ class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget { ? 137 : SizeConfig.isHeightShort ? 190 - : SizeConfig.heightMultiplier * - (SizeConfig.isWidthLarge ? 25 : 20) + : SizeConfig.heightMultiplier * (SizeConfig.isWidthLarge ? 25 : 20) : height); } From d2a16f53579a60a9de4db0f2a90b7e561abe6f60 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Thu, 31 Aug 2023 17:31:42 +0300 Subject: [PATCH 18/28] updates & fixes --- lib/client/base_app_client.dart | 3 + .../get_doctor_by_clinic_id_request.dart | 4 + .../model/patient/patiant_info_model.dart | 2 +- lib/core/service/base/lookup-service.dart | 5 +- .../service/patient/out_patient_service.dart | 6 +- .../patient-doctor-referral-service.dart | 1 + lib/core/viewModel/SOAP_view_model.dart | 4 +- lib/screens/ER_singin/ER_singin_screen.dart | 4 +- lib/screens/patients/ECGPage.dart | 53 ++---- .../out_patient/out_patient_screen.dart | 1 + .../patient_profile_screen.dart | 5 +- .../subjective/allergies/add_allergies.dart | 172 ++++++++---------- ..._key_checkbox_search_allergies_widget.dart | 117 ++++++------ .../subjective/update_subjective_page.dart | 129 ++++--------- pubspec.yaml | 2 +- 15 files changed, 211 insertions(+), 297 deletions(-) diff --git a/lib/client/base_app_client.dart b/lib/client/base_app_client.dart index df7874da..3f434334 100644 --- a/lib/client/base_app_client.dart +++ b/lib/client/base_app_client.dart @@ -181,6 +181,9 @@ class BaseAppClient { body['DoctorID'] = doctorProfile?.doctorID; } } + if (body['DoctorID'] == 0) { + body['DoctorID'] = null; + } var languageID = await sharedPref.getStringWithDefaultValue(APP_Language, 'en'); body['SetupID'] = body.containsKey('SetupID') ? body['SetupID'] != null diff --git a/lib/core/model/patient/get_doctor_by_clinic_id_request.dart b/lib/core/model/patient/get_doctor_by_clinic_id_request.dart index 0ac6ee62..2dff34a5 100644 --- a/lib/core/model/patient/get_doctor_by_clinic_id_request.dart +++ b/lib/core/model/patient/get_doctor_by_clinic_id_request.dart @@ -4,6 +4,7 @@ class DoctorsByClinicIdRequest { bool continueDentalPlan; bool isSearchAppointmnetByClinicID; int patientID; + int doctorID; int gender; bool isGetNearAppointment; bool isVoiceCommand; @@ -18,6 +19,7 @@ class DoctorsByClinicIdRequest { this.continueDentalPlan = false, this.isSearchAppointmnetByClinicID = true, this.patientID, + this.doctorID, this.gender, this.isGetNearAppointment = false, this.isVoiceCommand = true, @@ -30,6 +32,7 @@ class DoctorsByClinicIdRequest { DoctorsByClinicIdRequest.fromJson(Map json) { clinicID = json['ClinicID']; projectID = json['ProjectID']; + doctorID = json['DoctorID']; continueDentalPlan = json['ContinueDentalPlan']; isSearchAppointmnetByClinicID = json['IsSearchAppointmnetByClinicID']; patientID = json['PatientID']; @@ -49,6 +52,7 @@ class DoctorsByClinicIdRequest { data['ContinueDentalPlan'] = this.continueDentalPlan; data['IsSearchAppointmnetByClinicID'] = this.isSearchAppointmnetByClinicID; data['PatientID'] = this.patientID; + data['DoctorID'] = this.doctorID; data['gender'] = this.gender; data['IsGetNearAppointment'] = this.isGetNearAppointment; data['IsVoiceCommand'] = this.isVoiceCommand; diff --git a/lib/core/model/patient/patiant_info_model.dart b/lib/core/model/patient/patiant_info_model.dart index bc8e3a07..19864b7c 100644 --- a/lib/core/model/patient/patiant_info_model.dart +++ b/lib/core/model/patient/patiant_info_model.dart @@ -227,7 +227,7 @@ class PatiantInformtion { endTime = json['endTime']; episodeNo = json['episodeNo'] ?? json['EpisodeID'] ?? json['EpisodeNo']; fallRiskScore = json['fallRiskScore']; - isSigned = json['isSigned']; + isSigned = json['IsSigned']; medicationOrders = json['medicationOrders']; nationality = json['nationality'] ?? json['NationalityNameN']; patientMRN = json['patientMRN'] ?? diff --git a/lib/core/service/base/lookup-service.dart b/lib/core/service/base/lookup-service.dart index d630f07a..f1e086a1 100644 --- a/lib/core/service/base/lookup-service.dart +++ b/lib/core/service/base/lookup-service.dart @@ -55,10 +55,11 @@ class LookupService extends BaseService { List listOfAdmissionType = []; List listOfDiagnosisSelectionTypes = []; - Future getMasterLookup(MasterKeysService masterKeys) async { + Future getMasterLookup(MasterKeysService masterKeys, {String searchKey = ""}) async { hasError = false; Map body = { - "MasterInput": masterKeys.getMasterKeyService() + "MasterInput": masterKeys.getMasterKeyService(), + "SearchKey": searchKey }; await baseAppClient.post(GET_MASTER_LOOKUP_LIST, onSuccess: (dynamic response, int statusCode) { diff --git a/lib/core/service/patient/out_patient_service.dart b/lib/core/service/patient/out_patient_service.dart index 74db4453..81a939e7 100644 --- a/lib/core/service/patient/out_patient_service.dart +++ b/lib/core/service/patient/out_patient_service.dart @@ -8,8 +8,7 @@ class OutPatientService extends BaseService { List get patientList => _patientList; - Future getOutPatient( - PatientSearchRequestModel patientSearchRequestModel) async { + Future getOutPatient(PatientSearchRequestModel patientSearchRequestModel) async { hasError = false; await baseAppClient.post( GET_MY_OUT_PATIENT, @@ -27,8 +26,7 @@ class OutPatientService extends BaseService { ); } - Future getPatientFileInformation( - PatientSearchRequestModel patientSearchRequestModel) async { + Future getPatientFileInformation(PatientSearchRequestModel patientSearchRequestModel) async { hasError = false; await baseAppClient.post( PRM_SEARCH_PATIENT, diff --git a/lib/core/service/patient/patient-doctor-referral-service.dart b/lib/core/service/patient/patient-doctor-referral-service.dart index b61e18b9..810fb7ff 100644 --- a/lib/core/service/patient/patient-doctor-referral-service.dart +++ b/lib/core/service/patient/patient-doctor-referral-service.dart @@ -114,6 +114,7 @@ class PatientReferralService extends LookupService { _doctorsByClinicIdRequest.clinicID = clinicId; _doctorsByClinicIdRequest.patientID = patient.patientId; _doctorsByClinicIdRequest.gender = patient.gender; + _doctorsByClinicIdRequest.doctorID = 0; await baseAppClient.postPatient(PATIENT_GET_DOCTOR_BY_CLINIC_Hospital, onSuccess: (dynamic response, int statusCode) { diff --git a/lib/core/viewModel/SOAP_view_model.dart b/lib/core/viewModel/SOAP_view_model.dart index a145fa89..a6904678 100644 --- a/lib/core/viewModel/SOAP_view_model.dart +++ b/lib/core/viewModel/SOAP_view_model.dart @@ -152,12 +152,12 @@ class SOAPViewModel extends BaseViewModel { planCallBack.nextFunction(model); } Future getMasterLookup(MasterKeysService masterKeys, - {bool isBusyLocal = false}) async { + {bool isBusyLocal = false, String searchKey = ""}) async { if (isBusyLocal) { setState(ViewState.Busy); } else setState(ViewState.Busy); - await _SOAPService.getMasterLookup(masterKeys); + await _SOAPService.getMasterLookup(masterKeys, searchKey: searchKey); if (_SOAPService.hasError) { error = _SOAPService.error; setState(ViewState.Error); diff --git a/lib/screens/ER_singin/ER_singin_screen.dart b/lib/screens/ER_singin/ER_singin_screen.dart index 767d4e54..b4f6a363 100644 --- a/lib/screens/ER_singin/ER_singin_screen.dart +++ b/lib/screens/ER_singin/ER_singin_screen.dart @@ -189,7 +189,7 @@ class _ErSignInScreenState extends State { children: [ ElevatedButton( child: AppText( - "Sing In", + "Sign In", fontWeight: FontWeight.w600, color: Colors.black, fontSize: 16, @@ -199,7 +199,7 @@ class _ErSignInScreenState extends State { }), ElevatedButton( child: AppText( - "Sing Out", + "Sign Out", fontWeight: FontWeight.w600, color: Colors.black, fontSize: 16, diff --git a/lib/screens/patients/ECGPage.dart b/lib/screens/patients/ECGPage.dart index d35b4ee3..e65b0c1d 100644 --- a/lib/screens/patients/ECGPage.dart +++ b/lib/screens/patients/ECGPage.dart @@ -5,6 +5,7 @@ import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/utils/date-utils.dart'; +import 'package:doctor_app_flutter/utils/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-profile-app-bar.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; @@ -23,10 +24,7 @@ class ECGPage extends StatelessWidget { String arrivalType = routeArgs['arrival-type']; ProjectViewModel projectViewModel = Provider.of(context); return BaseView( - onModelReady: (model) => model.getECGPatient( - patientType: patient.patientType, - patientOutSA: 0, - patientID: patient.patientId), + onModelReady: (model) => model.getECGPatient(patientType: patient.patientType, patientOutSA: 0, patientID: patient.patientId), builder: (_, model, w) => AppScaffold( baseViewModel: model, isShowAppBar: true, @@ -59,19 +57,24 @@ class ECGPage extends StatelessWidget { model.patientMuseResultsModelList.length, (index) => InkWell( onTap: () async { - await launch(model - .patientMuseResultsModelList[index].imageURL); + Uri ecgImageURL = Uri.parse(model.patientMuseResultsModelList[index].imageURL); + await canLaunchUrl(ecgImageURL).then((value) async { + await launchUrl(ecgImageURL); + }).catchError((err) { + DrAppToastMsg.showErrorToast(err.toString()); + }); + // if (await canLaunchUrl(ecgImageURL)) { + // await launchUrl(ecgImageURL); + // } else { + // DrAppToastMsg.showErrorToast("Unable to open ECG Image"); + // } }, child: Container( width: double.infinity, height: 120, margin: EdgeInsets.only(top: 5, bottom: 5), padding: EdgeInsets.all(10), - decoration: BoxDecoration( - border: - Border.all(color: Colors.white, width: 2), - color: Colors.white, - borderRadius: BorderRadius.circular(8)), + decoration: BoxDecoration(border: Border.all(color: Colors.white, width: 2), color: Colors.white, borderRadius: BorderRadius.circular(8)), child: Column( children: [ Row( @@ -79,8 +82,7 @@ class ECGPage extends StatelessWidget { children: [ Expanded( child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( 'ECG Report', @@ -90,26 +92,12 @@ class ECGPage extends StatelessWidget { SizedBox(height: 3), RichText( text: TextSpan( - style: TextStyle( - fontSize: 1.6 * - SizeConfig.textMultiplier, - color: Colors.black), + style: TextStyle(fontSize: 1.6 * SizeConfig.textMultiplier, color: Colors.black), children: [ + new TextSpan(text: TranslationBase.of(context).orderNo, style: TextStyle(fontSize: 12, fontFamily: 'Poppins')), new TextSpan( - text: TranslationBase.of( - context) - .orderNo, - style: TextStyle( - fontSize: 12, - fontFamily: 'Poppins')), - new TextSpan( - text: - '${/*model.patientMuseResultsModelList[index].orderNo?? */ '3455'}', - style: TextStyle( - fontWeight: - FontWeight.w600, - fontFamily: 'Poppins', - fontSize: 14)), + text: '${/*model.patientMuseResultsModelList[index].orderNo?? */ '3455'}', + style: TextStyle(fontWeight: FontWeight.w600, fontFamily: 'Poppins', fontSize: 14)), ], ), ) @@ -118,8 +106,7 @@ class ECGPage extends StatelessWidget { ), Expanded( child: Column( - crossAxisAlignment: - CrossAxisAlignment.end, + crossAxisAlignment: CrossAxisAlignment.end, children: [ AppText( '${AppDateUtils.getDayMonthYearDateFormatted(model.patientMuseResultsModelList[index].createdOnDateTime, isArabic: projectViewModel.isArabic)}', diff --git a/lib/screens/patients/out_patient/out_patient_screen.dart b/lib/screens/patients/out_patient/out_patient_screen.dart index 59d6298b..237a1b3b 100644 --- a/lib/screens/patients/out_patient/out_patient_screen.dart +++ b/lib/screens/patients/out_patient/out_patient_screen.dart @@ -230,6 +230,7 @@ class _OutPatientsScreenState extends State { "isInpatient": false, "arrivalType": "7", "isSearchAndOut": false, + "isSigned": model.filterData[index].isSigned != null ? model.filterData[index].isSigned : false, }); }, // isFromSearch: widget.isSearch, diff --git a/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart b/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart index bde71637..c4a2ad61 100644 --- a/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart +++ b/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart @@ -44,6 +44,8 @@ class _PatientProfileScreenState extends State with Single bool isFromSearch = false; bool isFromLiveCare = false; + bool isSigned = false; + bool isInpatient = false; bool isMyPatient = false; bool isCallFinished = false; @@ -87,6 +89,7 @@ class _PatientProfileScreenState extends State with Single arrivalType = routeArgs['arrivalType']; from = routeArgs['from']; to = routeArgs['to']; + isSigned = routeArgs['isSigned']; if (routeArgs.containsKey("isSearch")) { isFromSearch = routeArgs['isSearch']; } @@ -263,7 +266,7 @@ class _PatientProfileScreenState extends State with Single if (patient.episodeNo != 0) AppButton( loading: model.state == ViewState.BusyLocal, - disabled: model.state == ViewState.BusyLocal, + disabled: model.state == ViewState.BusyLocal || isSigned, title: "${TranslationBase.of(context).update}\n${TranslationBase.of(context).episode}", color: ((isInpatient) || isFromLiveCare) && model.state != ViewState.BusyLocal ? AppGlobal.appRedColor diff --git a/lib/screens/patients/profile/soap_update/subjective/allergies/add_allergies.dart b/lib/screens/patients/profile/soap_update/subjective/allergies/add_allergies.dart index abcc72ad..06d451aa 100644 --- a/lib/screens/patients/profile/soap_update/subjective/allergies/add_allergies.dart +++ b/lib/screens/patients/profile/soap_update/subjective/allergies/add_allergies.dart @@ -19,8 +19,7 @@ class AddAllergies extends StatefulWidget { final Function addAllergiesFun; final List myAllergiesList; - const AddAllergies({Key key, this.addAllergiesFun, this.myAllergiesList}) - : super(key: key); + const AddAllergies({Key key, this.addAllergiesFun, this.myAllergiesList}) : super(key: key); @override _AddAllergiesState createState() => _AddAllergiesState(); @@ -42,98 +41,80 @@ class _AddAllergiesState extends State { @override Widget build(BuildContext context) { - return FractionallySizedBox( - heightFactor: 1, - child: BaseView( - onModelReady: (model) async { - if (model.allergiesList.length == 0) { - await model.getMasterLookup(MasterKeysService.Allergies); - } - if (model.allergySeverityList.length == 0) { - await model.getMasterLookup(MasterKeysService.AllergySeverity); - } - }, - builder: (_, model, w) => AppScaffold( - baseViewModel: model, - isShowAppBar: true, - appBar: BottomSheetTitle( - title: TranslationBase.of(context).addAllergies, - ), - body: Center( - child: Container( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - SizedBox( - height: 10, - ), - SizedBox( - height: 16, - ), - Expanded( - child: Center( - child: FractionallySizedBox( - widthFactor: 0.9, - child: Center( - child: NetworkBaseView( - baseViewModel: model, - child: MasterKeyCheckboxSearchAllergiesWidget( - model: model, - masterList: model.allergiesList, - removeAllergy: (master) { - setState(() { - removeAllergyFromLocalList(master); - }); - }, - addAllergy: - (MySelectedAllergy mySelectedAllergy) { - addAllergyLocally(mySelectedAllergy); - }, - addSelectedAllergy: () { - setState(() { - widget - .addAllergiesFun(myAllergiesListLocal); - }); - }, - isServiceSelected: (master) => - isServiceSelected(master), - getServiceSelectedAllergy: (master) => - getSelectedAllergy(master), - ), - ), - ), - ), - ), - ), - SizedBox( - height: MediaQuery.of(context).size.height * 0.11, - ), - ]), + return AppScaffold( + // baseViewModel: model, + isShowAppBar: true, + appBar: BottomSheetTitle( + title: TranslationBase.of(context).addAllergies, + ), + body: Center( + child: Container( + child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ + SizedBox( + height: 10, ), - ), - bottomSheet: model.state != ViewState.Idle - ? Container( - height: 0, - ) - : CustomBottomSheetContainer( - label: TranslationBase.of(context).addAllergies, - onTap: () { - setState(() { - widget.addAllergiesFun(myAllergiesListLocal); - }); - }, + SizedBox( + height: 16, + ), + Expanded( + child: Center( + child: FractionallySizedBox( + widthFactor: 0.9, + child: Center( + child: BaseView( + onModelReady: (model) async {}, + builder: (_, model, w) { + return MasterKeyCheckboxSearchAllergiesWidget( + model: model, + masterList: model.allergiesList, + removeAllergy: (master) { + setState(() { + removeAllergyFromLocalList(master); + }); + }, + addAllergy: (MySelectedAllergy mySelectedAllergy) { + addAllergyLocally(mySelectedAllergy); + }, + addSelectedAllergy: () { + setState(() { + widget.addAllergiesFun(myAllergiesListLocal); + }); + }, + isServiceSelected: (master) => isServiceSelected(master), + getServiceSelectedAllergy: (master) => getSelectedAllergy(master), + ); + }), + ), ), + ), + ), + SizedBox( + height: MediaQuery.of(context).size.height * 0.11, + ), + ]), ), ), + bottomSheet: + // model.state != ViewState.Idle + // ? + // Container( + // height: 0, + // ) + // : + CustomBottomSheetContainer( + label: TranslationBase.of(context).addAllergies, + onTap: () { + setState(() { + widget.addAllergiesFun(myAllergiesListLocal); + }); + }, + ), ); } isServiceSelected(MasterKeyModel masterKey) { - Iterable allergy = myAllergiesListLocal.where( - (element) => - masterKey.id == element.selectedAllergy.id && - masterKey.typeId == element.selectedAllergy.typeId && - element.isChecked); + Iterable allergy = + myAllergiesListLocal.where((element) => masterKey.id == element.selectedAllergy.id && masterKey.typeId == element.selectedAllergy.typeId && element.isChecked); if (allergy.length > 0) { return true; } @@ -141,16 +122,12 @@ class _AddAllergiesState extends State { } removeAllergyFromLocalList(MasterKeyModel masterKey) { - myAllergiesListLocal - .removeWhere((element) => element.selectedAllergy.id == masterKey.id); + myAllergiesListLocal.removeWhere((element) => element.selectedAllergy.id == masterKey.id); } MySelectedAllergy getSelectedAllergy(MasterKeyModel masterKey) { - Iterable allergy = myAllergiesListLocal.where( - (element) => - masterKey.id == element.selectedAllergy.id && - masterKey.typeId == element.selectedAllergy.typeId && - element.isChecked); + Iterable allergy = + myAllergiesListLocal.where((element) => masterKey.id == element.selectedAllergy.id && masterKey.typeId == element.selectedAllergy.typeId && element.isChecked); if (allergy.length > 0) { return allergy.first; } @@ -164,18 +141,13 @@ class _AddAllergiesState extends State { setState(() { List allergy = // ignore: missing_return - myAllergiesListLocal - .where((element) => - mySelectedAllergy.selectedAllergy.id == - element.selectedAllergy.id) - .toList(); + myAllergiesListLocal.where((element) => mySelectedAllergy.selectedAllergy.id == element.selectedAllergy.id).toList(); if (allergy.isEmpty) { myAllergiesListLocal.add(mySelectedAllergy); } else { allergy.first.selectedAllergy = mySelectedAllergy.selectedAllergy; - allergy.first.selectedAllergySeverity = - mySelectedAllergy.selectedAllergySeverity; + allergy.first.selectedAllergySeverity = mySelectedAllergy.selectedAllergySeverity; allergy.first.remark = mySelectedAllergy.remark; allergy.first.isChecked = mySelectedAllergy.isChecked; } diff --git a/lib/screens/patients/profile/soap_update/subjective/allergies/master_key_checkbox_search_allergies_widget.dart b/lib/screens/patients/profile/soap_update/subjective/allergies/master_key_checkbox_search_allergies_widget.dart index 9fc5425c..fb8043cb 100644 --- a/lib/screens/patients/profile/soap_update/subjective/allergies/master_key_checkbox_search_allergies_widget.dart +++ b/lib/screens/patients/profile/soap_update/subjective/allergies/master_key_checkbox_search_allergies_widget.dart @@ -1,3 +1,5 @@ +import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; +import 'package:doctor_app_flutter/core/enum/view_state.dart'; import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; import 'package:doctor_app_flutter/core/model/SOAP/master_key_model.dart'; import 'package:doctor_app_flutter/core/model/SOAP/selected_items/my_selected_allergy.dart'; @@ -36,12 +38,10 @@ class MasterKeyCheckboxSearchAllergiesWidget extends StatefulWidget { : super(key: key); @override - _MasterKeyCheckboxSearchAllergiesWidgetState createState() => - _MasterKeyCheckboxSearchAllergiesWidgetState(); + _MasterKeyCheckboxSearchAllergiesWidgetState createState() => _MasterKeyCheckboxSearchAllergiesWidgetState(); } -class _MasterKeyCheckboxSearchAllergiesWidgetState - extends State { +class _MasterKeyCheckboxSearchAllergiesWidgetState extends State { List items = List(); TextEditingController filteredSearchController = TextEditingController(); @@ -60,56 +60,66 @@ class _MasterKeyCheckboxSearchAllergiesWidgetState child: Container( height: Utils.getTextFieldHeight(), child: Center( - child: Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(12), - color: Colors.white), - child: Column( - children: [ - AppTextFieldCustom( - hintText: TranslationBase.of(context).selectAllergy, - isTextFieldHasSuffix: true, - hasBorder: false, - controller: filteredSearchController, - onChanged: (value) { - filterSearchResults(value); - }, - suffixIcon: IconButton( - icon: Icon( - Icons.search, - color: Colors.black, - )), + child: Container( + decoration: BoxDecoration(borderRadius: BorderRadius.circular(12), color: Colors.white), + child: Column( + children: [ + AppTextFieldCustom( + hintText: TranslationBase.of(context).selectAllergy, + isTextFieldHasSuffix: true, + hasBorder: false, + controller: filteredSearchController, + onChanged: (value) { + // filterSearchResults(value); + }, + onFieldSubmitted: (value) { + widget.model.getMasterLookup(MasterKeysService.Allergies, searchKey: filteredSearchController.text); + widget.model.getMasterLookup(MasterKeysService.AllergySeverity, searchKey: ""); + }, + suffixIcon: IconButton( + icon: Icon( + Icons.search, + color: Colors.black, ), - DividerWithSpacesAround(), - SizedBox( - height: 10, + onPressed: () { + widget.model.getMasterLookup(MasterKeysService.Allergies, searchKey: filteredSearchController.text); + widget.model.getMasterLookup(MasterKeysService.AllergySeverity, searchKey: ""); + }, + ), + ), + DividerWithSpacesAround(), + SizedBox( + height: 10, + ), + Expanded( + child: FractionallySizedBox( + widthFactor: 0.9, + child: Container( + height: MediaQuery.of(context).size.height * 0.60, + child: widget.model.state == ViewState.Idle + ? ListView.builder( + itemCount: widget.model.allergiesList.length, + itemBuilder: (context, index) { + return AddAllergiesItem( + item: widget.model.allergiesList[index], + model: widget.model, + removeAllergy: widget.removeAllergy, + addAllergy: widget.addAllergy, + isServiceSelected: widget.isServiceSelected, + getServiceSelectedAllergy: widget.getServiceSelectedAllergy, + ); + }, + ) + : widget.model.state == ViewState.Busy + ? Center(child: CircularProgressIndicator()) + : Container(), ), - Expanded( - child: FractionallySizedBox( - widthFactor: 0.9, - child: Container( - height: - MediaQuery.of(context).size.height * 0.60, - child: ListView.builder( - itemCount: items.length, - itemBuilder: (context, index) { - return AddAllergiesItem( - item: items[index], - model: widget.model, - removeAllergy: widget.removeAllergy, - addAllergy: widget.addAllergy, - isServiceSelected: - widget.isServiceSelected, - getServiceSelectedAllergy: - widget.getServiceSelectedAllergy, - ); - }, - ), - ), - ), - ), - ], - ))), + ), + ), + ], + ), + ), + ), ), ), SizedBox( @@ -126,8 +136,7 @@ class _MasterKeyCheckboxSearchAllergiesWidgetState if (query.isNotEmpty) { List dummyListData = List(); dummySearchList.forEach((items) { - if (items.nameAr.toLowerCase().contains(query.toLowerCase()) || - items.nameEn.toLowerCase().contains(query.toLowerCase())) { + if (items.nameAr.toLowerCase().contains(query.toLowerCase()) || items.nameEn.toLowerCase().contains(query.toLowerCase())) { dummyListData.add(items); } }); diff --git a/lib/screens/patients/profile/soap_update/subjective/update_subjective_page.dart b/lib/screens/patients/profile/soap_update/subjective/update_subjective_page.dart index 53195a47..6d7c7f51 100644 --- a/lib/screens/patients/profile/soap_update/subjective/update_subjective_page.dart +++ b/lib/screens/patients/profile/soap_update/subjective/update_subjective_page.dart @@ -25,19 +25,13 @@ class UpdateSubjectivePage extends StatefulWidget { final PatiantInformtion patientInfo; final int currentIndex; - UpdateSubjectivePage( - {Key key, - this.changePageViewIndex, - this.patientInfo, - this.changeLoadingState, - this.currentIndex}); + UpdateSubjectivePage({Key key, this.changePageViewIndex, this.patientInfo, this.changeLoadingState, this.currentIndex}); @override _UpdateSubjectivePageState createState() => _UpdateSubjectivePageState(); } -class _UpdateSubjectivePageState extends State - implements SubjectiveCallBack { +class _UpdateSubjectivePageState extends State implements SubjectiveCallBack { bool isChiefExpand = false; bool isHistoryExpand = false; bool isAllergiesExpand = false; @@ -53,67 +47,43 @@ class _UpdateSubjectivePageState extends State widget.changeLoadingState(true); if (model.patientHistoryList.isNotEmpty) { model.patientHistoryList.forEach((element) { - if (element.historyType == - MasterKeysService.HistoryFamily.getMasterKeyService()) { + if (element.historyType == MasterKeysService.HistoryFamily.getMasterKeyService()) { MasterKeyModel history = model.getOneMasterKey( masterKeys: MasterKeysService.HistoryFamily, id: element.historyId, ); if (history != null) { - MySelectedHistory mySelectedHistory = - SoapUtils.generateMySelectedHistory( - history: history, - isChecked: element.isChecked, - remark: element.remarks, - isLocal: false); + MySelectedHistory mySelectedHistory = SoapUtils.generateMySelectedHistory(history: history, isChecked: element.isChecked, remark: element.remarks, isLocal: false); myHistoryList.add(mySelectedHistory); } } - if (element.historyType == - MasterKeysService.HistoryMedical.getMasterKeyService()) { + if (element.historyType == MasterKeysService.HistoryMedical.getMasterKeyService()) { MasterKeyModel history = model.getOneMasterKey( masterKeys: MasterKeysService.HistoryMedical, id: element.historyId, ); if (history != null) { - MySelectedHistory mySelectedHistory = - SoapUtils.generateMySelectedHistory( - history: history, - isChecked: element.isChecked, - remark: element.remarks, - isLocal: false); + MySelectedHistory mySelectedHistory = SoapUtils.generateMySelectedHistory(history: history, isChecked: element.isChecked, remark: element.remarks, isLocal: false); myHistoryList.add(mySelectedHistory); } } - if (element.historyType == - MasterKeysService.HistorySports.getMasterKeyService()) { + if (element.historyType == MasterKeysService.HistorySports.getMasterKeyService()) { MasterKeyModel history = model.getOneMasterKey( masterKeys: MasterKeysService.HistorySports, id: element.historyId, ); if (history != null) { - MySelectedHistory mySelectedHistory = - SoapUtils.generateMySelectedHistory( - history: history, - isChecked: element.isChecked, - remark: element.remarks, - isLocal: false); + MySelectedHistory mySelectedHistory = SoapUtils.generateMySelectedHistory(history: history, isChecked: element.isChecked, remark: element.remarks, isLocal: false); myHistoryList.add(mySelectedHistory); } } - if (element.historyType == - MasterKeysService.HistorySurgical.getMasterKeyService()) { + if (element.historyType == MasterKeysService.HistorySurgical.getMasterKeyService()) { MasterKeyModel history = model.getOneMasterKey( masterKeys: MasterKeysService.HistorySurgical, id: element.historyId, ); if (history != null) { - MySelectedHistory mySelectedHistory = - SoapUtils.generateMySelectedHistory( - history: history, - isChecked: element.isChecked, - remark: element.remarks, - isLocal: false); + MySelectedHistory mySelectedHistory = SoapUtils.generateMySelectedHistory(history: history, isChecked: element.isChecked, remark: element.remarks, isLocal: false); myHistoryList.add(mySelectedHistory); } } @@ -124,17 +94,10 @@ class _UpdateSubjectivePageState extends State getAllergies(SOAPViewModel model) async { if (model.patientAllergiesList.isNotEmpty) { model.patientAllergiesList.forEach((element) { - MasterKeyModel selectedAllergy = model.getOneMasterKey( - masterKeys: MasterKeysService.Allergies, - id: element.allergyDiseaseId, - typeId: element.allergyDiseaseType); + MasterKeyModel selectedAllergy = model.getOneMasterKey(masterKeys: MasterKeysService.Allergies, id: element.allergyDiseaseId, typeId: element.allergyDiseaseType); MasterKeyModel selectedAllergySeverity; if (element.severity == 0) { - selectedAllergySeverity = MasterKeyModel( - id: 0, - typeId: MasterKeysService.AllergySeverity.getMasterKeyService(), - nameAr: '', - nameEn: ''); + selectedAllergySeverity = MasterKeyModel(id: 0, typeId: MasterKeysService.AllergySeverity.getMasterKeyService(), nameAr: '', nameEn: ''); } else { selectedAllergySeverity = model.getOneMasterKey( masterKeys: MasterKeysService.AllergySeverity, @@ -142,17 +105,10 @@ class _UpdateSubjectivePageState extends State ); } - MySelectedAllergy mySelectedAllergy = - SoapUtils.generateMySelectedAllergy( - allergy: selectedAllergy, - isChecked: element.isChecked, - createdBy: element.createdBy, - remark: element.remarks, - isLocal: false, - allergySeverity: selectedAllergySeverity); + MySelectedAllergy mySelectedAllergy = SoapUtils.generateMySelectedAllergy( + allergy: selectedAllergy, isChecked: element.isChecked, createdBy: element.createdBy, remark: element.remarks, isLocal: false, allergySeverity: selectedAllergySeverity); - if (selectedAllergy != null && selectedAllergySeverity != null) - myAllergiesList.add(mySelectedAllergy); + if (selectedAllergy != null && selectedAllergySeverity != null) myAllergiesList.add(mySelectedAllergy); }); } } @@ -168,14 +124,11 @@ class _UpdateSubjectivePageState extends State if (model.patientChiefComplaintList.isNotEmpty) { isChiefExpand = true; - complaintsController.text = Utils.parseHtmlString( - model.patientChiefComplaintList[0].chiefComplaint); + complaintsController.text = Utils.parseHtmlString(model.patientChiefComplaintList[0].chiefComplaint); illnessController.text = model.patientChiefComplaintList[0].hopi; - medicationController.text = - !(model.patientChiefComplaintList[0].currentMedication).isNotEmpty - ? model.patientChiefComplaintList[0].currentMedication + - '\n \n' - : model.patientChiefComplaintList[0].currentMedication; + medicationController.text = model.patientChiefComplaintList[0].currentMedication != null ? !(model.patientChiefComplaintList[0].currentMedication).isNotEmpty + ? model.patientChiefComplaintList[0].currentMedication + '\n \n' + : model.patientChiefComplaintList[0].currentMedication : ""; } if (widget.patientInfo.admissionNo == null) { await getHistory(model); @@ -214,17 +167,14 @@ class _UpdateSubjectivePageState extends State complaintsController: complaintsController, illnessController: illnessController, medicationController: medicationController, - complaintsControllerError: - model.complaintsControllerError, + complaintsControllerError: model.complaintsControllerError, illnessControllerError: model.illnessControllerError, - medicationControllerError: - model.medicationControllerError, + medicationControllerError: model.medicationControllerError, ), isExpanded: isChiefExpand, ), SizedBox( - height: SizeConfig.heightMultiplier * - (SizeConfig.isHeightVeryShort ? 4 : 2), + height: SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort ? 4 : 2), ), if (widget.patientInfo.admissionNo == null) ExpandableSOAPWidget( @@ -236,15 +186,12 @@ class _UpdateSubjectivePageState extends State }); }, child: Column( - children: [ - UpdateHistoryWidget(myHistoryList: myHistoryList) - ], + children: [UpdateHistoryWidget(myHistoryList: myHistoryList)], ), isExpanded: isHistoryExpand, ), SizedBox( - height: SizeConfig.heightMultiplier * - (SizeConfig.isHeightVeryShort ? 4 : 2), + height: SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort ? 4 : 2), ), if (widget.patientInfo.admissionNo == null) ExpandableSOAPWidget( @@ -268,8 +215,7 @@ class _UpdateSubjectivePageState extends State isExpanded: isAllergiesExpand, ), SizedBox( - height: SizeConfig.heightMultiplier * - (SizeConfig.isHeightVeryShort ? 20 : 10), + height: SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort ? 20 : 10), ), ], ), @@ -280,10 +226,7 @@ class _UpdateSubjectivePageState extends State ); } - addSubjectiveInfo( - {SOAPViewModel model, - List myAllergiesList, - List myHistoryList}) async { + addSubjectiveInfo({SOAPViewModel model, List myAllergiesList, List myHistoryList}) async { if (FocusScope.of(context).hasFocus) FocusScope.of(context).unfocus(); widget.changeLoadingState(true); formKey.currentState.save(); @@ -292,8 +235,7 @@ class _UpdateSubjectivePageState extends State model.complaintsControllerError = ''; model.medicationControllerError = ''; model.illnessControllerError = ''; - if (complaintsController.text.isNotEmpty && - illnessController.text.isNotEmpty) { + if (complaintsController.text.isNotEmpty && illnessController.text.isNotEmpty) { await model.postSubjectServices( patientInfo: widget.patientInfo, complaintsText: complaintsController.text, @@ -309,32 +251,25 @@ class _UpdateSubjectivePageState extends State } else { setState(() { if (complaintsController.text.isEmpty) { - model.complaintsControllerError = - TranslationBase.of(context).emptyMessage; + model.complaintsControllerError = TranslationBase.of(context).emptyMessage; } if (illnessController.text.isEmpty) { - model.illnessControllerError = - TranslationBase.of(context).emptyMessage; + model.illnessControllerError = TranslationBase.of(context).emptyMessage; } if (medicationController.text.isEmpty) { - model.medicationControllerError = - TranslationBase.of(context).emptyMessage; + model.medicationControllerError = TranslationBase.of(context).emptyMessage; } }); widget.changeLoadingState(false); - Utils.showErrorToast( - TranslationBase.of(context).chiefComplaintErrorMsg); + Utils.showErrorToast(TranslationBase.of(context).chiefComplaintErrorMsg); } } @override Function nextFunction(model) { - addSubjectiveInfo( - model: model, - myAllergiesList: myAllergiesList, - myHistoryList: myHistoryList); + addSubjectiveInfo(model: model, myAllergiesList: myAllergiesList, myHistoryList: myHistoryList); } } diff --git a/pubspec.yaml b/pubspec.yaml index 0e4ff414..e73526f3 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -11,7 +11,7 @@ description: A new Flutter project. # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. # Read more about iOS versioning at # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html -version: 1.3.97+1 +version: 1.3.9+19 environment: From 0d65197b2f7801b069d894f5de61737a8db94a55 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Tue, 5 Sep 2023 10:17:17 +0300 Subject: [PATCH 19/28] updates & fixes --- lib/client/base_app_client.dart | 6 + lib/config/config.dart | 402 ++++++------------ .../doctor_ER_sign_assessment_req_model.dart | 12 +- .../ER_signin/ER_signin_service.dart | 3 - .../ER_sign_in/ER_sign_in_view_model.dart | 4 +- 5 files changed, 144 insertions(+), 283 deletions(-) diff --git a/lib/client/base_app_client.dart b/lib/client/base_app_client.dart index 3f434334..8e7a227f 100644 --- a/lib/client/base_app_client.dart +++ b/lib/client/base_app_client.dart @@ -60,6 +60,12 @@ class BaseAppClient { } else if (doctorID != null) body['DoctorID'] = int.parse(doctorID); } + body['SetupID'] = body.containsKey('SetupID') + ? body['SetupID'] != null + ? body['SetupID'] + : await sharedPref.getString(DOCTOR_SETUP_ID) + : await sharedPref.getString(DOCTOR_SETUP_ID); + if (body['EditedBy'] == '') { body.remove("EditedBy"); } diff --git a/lib/config/config.dart b/lib/config/config.dart index b589e661..d8dfab93 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -14,118 +14,83 @@ const BASE_URL_LIVE_CARE = 'https://livecare.hmg.com/'; const BASE_URL = 'https://vidamergeuat.cloudsolutions.com.sa/'; //Vida Plus URL - const PHARMACY_ITEMS_URL = "Services/Lists.svc/REST/GetPharmcyItems_Region_enh"; const PHARMACY_LIST_URL = "Services/Patients.svc/REST/GetPharmcyList"; -const PATIENT_PROGRESS_NOTE_URL = - "Services/DoctorApplication.svc/REST/GetProgressNoteForInPatient"; -const PATIENT_INSURANCE_APPROVALS_URL = - "Services/DoctorApplication.svc/REST/GetApprovalStatusForInpatient"; -const PATIENT_REFER_TO_DOCTOR_URL = - "Services/DoctorApplication.svc/REST/ReferToDoctor"; -const PATIENT_GET_DOCTOR_BY_CLINIC_URL = - "Services/DoctorApplication.svc/REST/GetDoctorsByClinicID"; - -const PATIENT_GET_DOCTOR_BY_CLINIC_Hospital = - "Services/Doctors.svc/REST/SearchDoctorsByTime"; - -const GET_CLINICS_FOR_DOCTOR = - 'Services/DoctorApplication.svc/REST/GetClinicsForDoctor'; -const PATIENT_GET_LIST_REFERAL_URL = - "Services/Lists.svc/REST/GetList_STPReferralFrequency"; -const PATIENT_GET_CLINIC_BY_PROJECT_URL = - "Services/DoctorApplication.svc/REST/GetClinicsByProjectID"; +const PATIENT_PROGRESS_NOTE_URL = "Services/DoctorApplication.svc/REST/GetProgressNoteForInPatient"; +const PATIENT_INSURANCE_APPROVALS_URL = "Services/DoctorApplication.svc/REST/GetApprovalStatusForInpatient"; +const PATIENT_REFER_TO_DOCTOR_URL = "Services/DoctorApplication.svc/REST/ReferToDoctor"; +const PATIENT_GET_DOCTOR_BY_CLINIC_URL = "Services/DoctorApplication.svc/REST/GetDoctorsByClinicID"; + +const PATIENT_GET_DOCTOR_BY_CLINIC_Hospital = "Services/Doctors.svc/REST/SearchDoctorsByTime"; + +const GET_CLINICS_FOR_DOCTOR = 'Services/DoctorApplication.svc/REST/GetClinicsForDoctor'; +const PATIENT_GET_LIST_REFERAL_URL = "Services/Lists.svc/REST/GetList_STPReferralFrequency"; +const PATIENT_GET_CLINIC_BY_PROJECT_URL = "Services/DoctorApplication.svc/REST/GetClinicsByProjectID"; const PROJECT_GET_INFO = "Services/DoctorApplication.svc/REST/GetProjectInfo"; const GET_CLINICS = "Services/DoctorApplication.svc/REST/GetClinics"; -const GET_REFERRAL_FACILITIES = - 'Services/DoctorApplication.svc/REST/GetReferralFacilities'; +const GET_REFERRAL_FACILITIES = 'Services/DoctorApplication.svc/REST/GetReferralFacilities'; const GET_PROJECTS = 'Services/DoctorApplication.svc/REST/GetProjectInfo'; -const GET_PATIENT_VITAL_SIGN = - 'Services/Doctors.svc/REST/Doctor_GetPatientVitalSign'; -const GET_PATIENT_VITAL_SIGN_DATA = - 'Services/DoctorApplication.svc/REST/GetVitalSigns'; -const GET_PATIENT_LAB_OREDERS = - 'Services/DoctorApplication.svc/REST/GetPatientLabOreders'; +const GET_PATIENT_VITAL_SIGN = 'Services/Doctors.svc/REST/Doctor_GetPatientVitalSign'; +const GET_PATIENT_VITAL_SIGN_DATA = 'Services/DoctorApplication.svc/REST/GetVitalSigns'; +const GET_PATIENT_LAB_OREDERS = 'Services/DoctorApplication.svc/REST/GetPatientLabOreders'; const GET_PRESCRIPTION = 'Services/Patients.svc/REST/GetPrescriptionApptList'; -const GET_LIVECARE_PENDINGLIST = - 'Services/DoctorApplication.svc/REST/GetPendingPatientER'; +const GET_LIVECARE_PENDINGLIST = 'Services/DoctorApplication.svc/REST/GetPendingPatientER'; const START_LIVE_CARE_CALL = 'LiveCareApi/DoctorApp/CallPatient'; -const LIVE_CARE_STATISTICS_FOR_CERTAIN_DOCTOR_URL = - "Lists.svc/REST/DashBoard_GetLiveCareDoctorsStatsticsForCertainDoctor"; +const LIVE_CARE_STATISTICS_FOR_CERTAIN_DOCTOR_URL = "Lists.svc/REST/DashBoard_GetLiveCareDoctorsStatsticsForCertainDoctor"; -const GET_PRESCRIPTION_REPORT = - 'Services/Patients.svc/REST/GetPrescriptionReport'; +const GET_PRESCRIPTION_REPORT = 'Services/Patients.svc/REST/GetPrescriptionReport'; -const GT_MY_PATIENT_QUESTION = - 'Services/DoctorApplication.svc/REST/GtMyPatientsQuestions'; +const GT_MY_PATIENT_QUESTION = 'Services/DoctorApplication.svc/REST/GtMyPatientsQuestions'; -const PRM_SEARCH_PATIENT = - 'Services/Patients.svc/REST/GetPatientInformation_PRM'; +const PRM_SEARCH_PATIENT = 'Services/Patients.svc/REST/GetPatientInformation_PRM'; const GET_PATIENT = 'Services/DoctorApplication.svc/REST/'; -const GET_PRESCRIPTION_REPORT_FOR_IN_PATIENT = - 'Services/DoctorApplication.svc/REST/GetPrescriptionReportForInPatient'; +const GET_PRESCRIPTION_REPORT_FOR_IN_PATIENT = 'Services/DoctorApplication.svc/REST/GetPrescriptionReportForInPatient'; -const GET_MY_REFERRAL_PATIENT = - 'Services/DoctorApplication.svc/REST/GtMyReferralPatient'; +const GET_MY_REFERRAL_PATIENT = 'Services/DoctorApplication.svc/REST/GtMyReferralPatient'; const REFER_TO_DOCTOR = 'Services/DoctorApplication.svc/REST/ReferToDoctor'; -const ADD_REFERRED_DOCTOR_REMARKS = - 'Services/DoctorApplication.svc/REST/AddReferredDoctorRemarks'; +const ADD_REFERRED_DOCTOR_REMARKS = 'Services/DoctorApplication.svc/REST/AddReferredDoctorRemarks'; -const GET_MY_REFERRED_PATIENT = - 'Services/DoctorApplication.svc/REST/GtMyReferredPatient'; +const GET_MY_REFERRED_PATIENT = 'Services/DoctorApplication.svc/REST/GtMyReferredPatient'; -const GET_MY_REFERRED_OUT_PATIENT = - 'Services/DoctorApplication.svc/REST/GtMyReferredOutPatient'; +const GET_MY_REFERRED_OUT_PATIENT = 'Services/DoctorApplication.svc/REST/GtMyReferredOutPatient'; -const GET_PENDING_REFERRAL_PATIENT = - 'Services/DoctorApplication.svc/REST/PendingReferrals'; +const GET_PENDING_REFERRAL_PATIENT = 'Services/DoctorApplication.svc/REST/PendingReferrals'; -const CREATE_REFERRAL_PATIENT = - 'Services/DoctorApplication.svc/REST/CreateReferral'; +const CREATE_REFERRAL_PATIENT = 'Services/DoctorApplication.svc/REST/CreateReferral'; -const RESPONSE_PENDING_REFERRAL_PATIENT = - 'Services/DoctorApplication.svc/REST/RespondReferral'; +const RESPONSE_PENDING_REFERRAL_PATIENT = 'Services/DoctorApplication.svc/REST/RespondReferral'; const GET_PATIENT_REFERRAL = 'Services/DoctorApplication.svc/REST/GetRefferal'; const POST_UCAF = 'Services/DoctorApplication.svc/REST/PostUCAF'; -const GET_DOCTOR_WORKING_HOURS_TABLE = - 'Services/Doctors.svc/REST/GetDoctorWorkingHoursTable'; +const GET_DOCTOR_WORKING_HOURS_TABLE = 'Services/Doctors.svc/REST/GetDoctorWorkingHoursTable'; -const GET_PATIENT_LAB_RESULTS = - 'Services/DoctorApplication.svc/REST/GetPatientLabResults'; +const GET_PATIENT_LAB_RESULTS = 'Services/DoctorApplication.svc/REST/GetPatientLabResults'; const LOGIN_URL = 'Services/Sentry.svc/REST/MemberLogIN_New'; -const INSERT_DEVICE_IMEI = - 'Services/DoctorApplication.svc/REST/DoctorApp_InsertOrUpdateDeviceDetails'; +const INSERT_DEVICE_IMEI = 'Services/DoctorApplication.svc/REST/DoctorApp_InsertOrUpdateDeviceDetails'; // 'Services/Sentry.svc/REST/DoctorApplication_INSERTDeviceIMEI'; // const SELECT_DEVICE_IMEI = // 'Services/Sentry.svc/REST/DoctorApplication_SELECTDeviceIMEIbyIMEI'; -const SELECT_DEVICE_IMEI = - 'Services/DoctorApplication.svc/REST/DoctorApp_GetDeviceDetailsByIMEI'; +const SELECT_DEVICE_IMEI = 'Services/DoctorApplication.svc/REST/DoctorApp_GetDeviceDetailsByIMEI'; -const SEND_ACTIVATION_CODE_BY_OTP_NOTIFICATION_TYPE = - 'Services/Sentry.svc/REST/DoctorApplication_SendActivationCodebyOTPNotificationType'; +const SEND_ACTIVATION_CODE_BY_OTP_NOTIFICATION_TYPE = 'Services/Sentry.svc/REST/DoctorApplication_SendActivationCodebyOTPNotificationType'; -const SEND_ACTIVATION_CODE_FOR_DOCTOR_APP = - 'Services/DoctorApplication.svc/REST/SendActivationCodeForDoctorApp'; +const SEND_ACTIVATION_CODE_FOR_DOCTOR_APP = 'Services/DoctorApplication.svc/REST/SendActivationCodeForDoctorApp'; -const SEND_ACTIVATION_CODE_FOR_VERIFICATION_SCREEN = - 'Services/DoctorApplication.svc/REST/SendVerificationCode'; -const MEMBER_CHECK_ACTIVATION_CODE_NEW = - 'Services/Sentry.svc/REST/MemberCheckActivationCode_New'; +const SEND_ACTIVATION_CODE_FOR_VERIFICATION_SCREEN = 'Services/DoctorApplication.svc/REST/SendVerificationCode'; +const MEMBER_CHECK_ACTIVATION_CODE_NEW = 'Services/Sentry.svc/REST/MemberCheckActivationCode_New'; -const CHECK_ACTIVATION_CODE_FOR_DOCTOR_APP = - 'Services/DoctorApplication.svc/REST/CheckActivationCodeForDoctorApp'; +const CHECK_ACTIVATION_CODE_FOR_DOCTOR_APP = 'Services/DoctorApplication.svc/REST/CheckActivationCodeForDoctorApp'; const GET_DOC_PROFILES = 'Services/Doctors.svc/REST/GetDocProfiles'; const TRANSFERT_TO_ADMIN = 'LiveCareApi/DoctorApp/TransferToAdmin'; @@ -133,268 +98,179 @@ const SEND_SMS_INSTRUCTIONS = 'LiveCareApi/DoctorApp/SendSMSInstruction'; const GET_ALTERNATIVE_SERVICE = 'LiveCareApi/DoctorApp/GetAlternativeServices'; const END_CALL = 'LiveCareApi/DoctorApp/EndCall'; const END_CALL_WITH_CHARGE = 'LiveCareApi/DoctorApp/CompleteCallWithCharge'; -const GET_DASHBOARD = - 'Services/DoctorApplication.svc/REST/GetDoctorDashboardKPI'; -const GET_SICKLEAVE_STATISTIC = - 'Services/DoctorApplication.svc/REST/PreSickLeaveStatistics'; -const ARRIVED_PATIENT_URL = - 'Services/DoctorApplication.svc/REST/PatientArrivalList'; +const GET_DASHBOARD = 'Services/DoctorApplication.svc/REST/GetDoctorDashboardKPI'; +const GET_SICKLEAVE_STATISTIC = 'Services/DoctorApplication.svc/REST/PreSickLeaveStatistics'; +const ARRIVED_PATIENT_URL = 'Services/DoctorApplication.svc/REST/PatientArrivalList'; const ADD_SICK_LEAVE = 'Services/DoctorApplication.svc/REST/PostSickLeave'; const GET_SICK_LEAVE = 'Services/Patients.svc/REST/GetPatientSickLeave'; const EXTEND_SICK_LEAVE = 'Services/DoctorApplication.svc/REST/ExtendSickLeave'; const GET_MASTER_LOOKUP_LIST = 'Services/DoctorApplication.svc/REST/GetMasterLookUpList'; -const GET_COVERING_DOCTORS = - 'Services/DoctorApplication.svc/REST/GetCoveringDoctor'; +const GET_COVERING_DOCTORS = 'Services/DoctorApplication.svc/REST/GetCoveringDoctor'; const ADD_RESCHDEULE = 'Services/DoctorApplication.svc/REST/PostRequisition'; -const UPDATE_RESCHDEULE = - 'Services/DoctorApplication.svc/REST/PatchRequisition'; -const GET_RESCHEDULE_LEAVE = - 'Services/DoctorApplication.svc/REST/GetRequisition'; -const GET_PRESCRIPTION_LIST = - 'Services/DoctorApplication.svc/REST/GetPrescription'; - -const POST_PRESCRIPTION_LIST = - 'Services/DoctorApplication.svc/REST/PostPrescription'; -const GET_PROCEDURE_LIST = - 'Services/DoctorApplication.svc/REST/GetOrderedProcedure'; -const POST_PROCEDURE_LIST = 'Services/DoctorApplication.svc/REST/PostProcedure'; +const UPDATE_RESCHDEULE = 'Services/DoctorApplication.svc/REST/PatchRequisition'; +const GET_RESCHEDULE_LEAVE = 'Services/DoctorApplication.svc/REST/GetRequisition'; +const GET_PRESCRIPTION_LIST = 'Services/DoctorApplication.svc/REST/GetPrescription'; +const POST_PRESCRIPTION_LIST = 'Services/DoctorApplication.svc/REST/PostPrescription'; +const GET_PROCEDURE_LIST = 'Services/DoctorApplication.svc/REST/GetOrderedProcedure'; +const POST_PROCEDURE_LIST = 'Services/DoctorApplication.svc/REST/PostProcedure'; -const GET_PATIENT_IN_PATIENT_LIST = - 'Services/DoctorApplication.svc/REST/GetMyInPatient'; +const GET_PATIENT_IN_PATIENT_LIST = 'Services/DoctorApplication.svc/REST/GetMyInPatient'; -const Verify_Referral_Doctor_Remarks = - 'Services/DoctorApplication.svc/REST/VerifyReferralDoctorRemarks'; +const Verify_Referral_Doctor_Remarks = 'Services/DoctorApplication.svc/REST/VerifyReferralDoctorRemarks'; ///Lab Order const GET_Patient_LAB_ORDERS = 'Services/Patients.svc/REST/GetPatientLabOrders'; -const GET_Patient_LAB_SPECIAL_RESULT = - 'Services/Patients.svc/REST/GetPatientLabSpecialResults'; -const SEND_LAB_RESULT_EMAIL = - 'Services/Notifications.svc/REST/SendLabReportEmail'; -const GET_Patient_LAB_RESULT = - 'Services/Patients.svc/REST/GetPatientLabResults'; -const GET_Patient_LAB_ORDERS_RESULT = - 'Services/Patients.svc/REST/GetPatientLabOrdersResults'; -const GET_PATIENT_LAB_ORDERS_RESULT_HISTORY_BY_DESCRIPTION = - 'Services/Patients.svc/REST/GetPatientLabOrdersResultsHistoryByDescription'; +const GET_Patient_LAB_SPECIAL_RESULT = 'Services/Patients.svc/REST/GetPatientLabSpecialResults'; +const SEND_LAB_RESULT_EMAIL = 'Services/Notifications.svc/REST/SendLabReportEmail'; +const GET_Patient_LAB_RESULT = 'Services/Patients.svc/REST/GetPatientLabResults'; +const GET_Patient_LAB_ORDERS_RESULT = 'Services/Patients.svc/REST/GetPatientLabOrdersResults'; +const GET_PATIENT_LAB_ORDERS_RESULT_HISTORY_BY_DESCRIPTION = 'Services/Patients.svc/REST/GetPatientLabOrdersResultsHistoryByDescription'; // SOAP const GET_ALLERGIES = 'Services/DoctorApplication.svc/REST/GetAllergies'; const POST_EPISODE = 'Services/DoctorApplication.svc/REST/PostEpisode'; -const POST_EPISODE_FOR_IN_PATIENT = - 'Services/DoctorApplication.svc/REST/PostEpisodeForInpatient'; +const POST_EPISODE_FOR_IN_PATIENT = 'Services/DoctorApplication.svc/REST/PostEpisodeForInpatient'; const POST_ALLERGY = 'Services/DoctorApplication.svc/REST/PostAllergies'; const POST_HISTORY = 'Services/DoctorApplication.svc/REST/PostHistory'; -const POST_CHIEF_COMPLAINT = - 'Services/DoctorApplication.svc/REST/PostChiefcomplaint'; -const POST_PHYSICAL_EXAM = - 'Services/DoctorApplication.svc/REST/PostPhysicalExam'; -const POST_PROGRESS_NOTE = - '/Services/DoctorApplication.svc/REST/PostProgressNote'; +const POST_CHIEF_COMPLAINT = 'Services/DoctorApplication.svc/REST/PostChiefcomplaint'; +const POST_PHYSICAL_EXAM = 'Services/DoctorApplication.svc/REST/PostPhysicalExam'; +const POST_PROGRESS_NOTE = '/Services/DoctorApplication.svc/REST/PostProgressNote'; const POST_ASSESSMENT = 'Services/DoctorApplication.svc/REST/PostAssessment'; const PATCH_ALLERGY = 'Services/DoctorApplication.svc/REST/PatchAllergies'; const PATCH_HISTORY = 'Services/DoctorApplication.svc/REST/PatchHistory'; -const PATCH_CHIEF_COMPLAINT = - 'Services/DoctorApplication.svc/REST/PatchChiefcomplaint'; +const PATCH_CHIEF_COMPLAINT = 'Services/DoctorApplication.svc/REST/PatchChiefcomplaint'; -const PATCH_PHYSICAL_EXAM = - 'Services/DoctorApplication.svc/REST/PatchPhysicalExam'; -const PATCH_PROGRESS_NOTE = - 'Services/DoctorApplication.svc/REST/PatchProgressNote'; +const PATCH_PHYSICAL_EXAM = 'Services/DoctorApplication.svc/REST/PatchPhysicalExam'; +const PATCH_PROGRESS_NOTE = 'Services/DoctorApplication.svc/REST/PatchProgressNote'; const PATCH_ASSESSMENT = 'Services/DoctorApplication.svc/REST/PatchAssessment'; const GET_HISTORY = 'Services/DoctorApplication.svc/REST/GetHistory'; -const GET_CHIEF_COMPLAINT = - 'Services/DoctorApplication.svc/REST/GetChiefcomplaint'; +const GET_CHIEF_COMPLAINT = 'Services/DoctorApplication.svc/REST/GetChiefcomplaint'; const GET_PHYSICAL_EXAM = 'Services/DoctorApplication.svc/REST/GetPhysicalExam'; const GET_PROGRESS_NOTE = 'Services/DoctorApplication.svc/REST/GetProgressNote'; const GET_ASSESSMENT = 'Services/DoctorApplication.svc/REST/GetAssessment'; +const GET_LIST_CATEGORISE = 'Services/DoctorApplication.svc/REST/GetProcedureCategories'; -const GET_LIST_CATEGORISE = - 'Services/DoctorApplication.svc/REST/GetProcedureCategories'; - -const GET_CATEGORISE_PROCEDURE = - 'Services/DoctorApplication.svc/REST/GetProcedure'; +const GET_CATEGORISE_PROCEDURE = 'Services/DoctorApplication.svc/REST/GetProcedure'; const UPDATE_PROCEDURE = 'Services/DoctorApplication.svc/REST/PatchProcedure'; -const UPDATE_PRESCRIPTION = - 'Services/DoctorApplication.svc/REST/PatchPrescription'; +const UPDATE_PRESCRIPTION = 'Services/DoctorApplication.svc/REST/PatchPrescription'; const SEARCH_DRUG = 'Services/DoctorApplication.svc/REST/GetMedicationList'; -const DRUG_TO_DRUG = - 'Services/DoctorApplication.svc/REST/DrugToDrugInteraction'; +const DRUG_TO_DRUG = 'Services/DoctorApplication.svc/REST/DrugToDrugInteraction'; const GET_MEDICAL_FILE = 'Services/DoctorApplication.svc/REST/GetMedicalFile'; const GET_FLOORS = 'Services/DoctorApplication.svc/REST/GetFloors'; const GET_WARDS = 'Services/DoctorApplication.svc/REST/GetWards'; -const GET_ROOM_CATEGORIES = - 'Services/DoctorApplication.svc/REST/GetRoomCategories'; -const GET_DIAGNOSIS_TYPES = - 'Services/DoctorApplication.svc/REST/DiagnosisTypes'; +const GET_ROOM_CATEGORIES = 'Services/DoctorApplication.svc/REST/GetRoomCategories'; +const GET_DIAGNOSIS_TYPES = 'Services/DoctorApplication.svc/REST/DiagnosisTypes'; const GET_DIET_TYPES = 'Services/DoctorApplication.svc/REST/DietTypes'; const GET_ICD_CODES = 'Services/DoctorApplication.svc/REST/GetICDCodes'; -const POST_ADMISSION_REQUEST = - 'Services/DoctorApplication.svc/REST/PostAdmissionRequest'; -const GET_ITEM_BY_MEDICINE = - 'Services/DoctorApplication.svc/REST/GetItemByMedicineCode'; +const POST_ADMISSION_REQUEST = 'Services/DoctorApplication.svc/REST/PostAdmissionRequest'; +const GET_ITEM_BY_MEDICINE = 'Services/DoctorApplication.svc/REST/GetItemByMedicineCode'; -const GET_PROCEDURE_VALIDATION = - 'Services/DoctorApplication.svc/REST/ValidateProcedures'; -const GET_BOX_QUANTITY = - 'Services/DoctorApplication.svc/REST/CalculateBoxQuantity'; +const GET_PROCEDURE_VALIDATION = 'Services/DoctorApplication.svc/REST/ValidateProcedures'; +const GET_BOX_QUANTITY = 'Services/DoctorApplication.svc/REST/CalculateBoxQuantity'; ///GET ECG const GET_ECG = "Services/Patients.svc/REST/HIS_GetPatientMuseResults"; -const GET_MY_REFERRAL_INPATIENT = - "Services/DoctorApplication.svc/REST/GtMyReferralPatient"; +const GET_MY_REFERRAL_INPATIENT = "Services/DoctorApplication.svc/REST/GtMyReferralPatient"; -const GET_MY_REFERRAL_OUT_PATIENT = - "Services/DoctorApplication.svc/REST/GtMyReferralForOutPatient"; +const GET_MY_REFERRAL_OUT_PATIENT = "Services/DoctorApplication.svc/REST/GtMyReferralForOutPatient"; -const GET_MY_DISCHARGE_PATIENT = - "Services/DoctorApplication.svc/REST/GtMyDischargeReferralPatient"; -const GET_DISCHARGE_PATIENT = - "Services/DoctorApplication.svc/REST/GtMyDischargePatient"; +const GET_MY_DISCHARGE_PATIENT = "Services/DoctorApplication.svc/REST/GtMyDischargeReferralPatient"; +const GET_DISCHARGE_PATIENT = "Services/DoctorApplication.svc/REST/GtMyDischargePatient"; -const GET_PAtIENTS_INSURANCE_APPROVALS = - "Services/Patients.svc/REST/GetApprovalStatus"; +const GET_PAtIENTS_INSURANCE_APPROVALS = "Services/Patients.svc/REST/GetApprovalStatus"; const GET_RAD_IMAGE_URL = 'Services/Patients.svc/Rest/GetRadImageURL'; const GET_PATIENT_ORDERS = 'Services/Patients.svc/REST/GetPatientRadOrders'; -const GET_IN_PATIENT_ORDERS = - 'Services/DoctorApplication.svc/REST/GetPatientRadResult'; +const GET_IN_PATIENT_ORDERS = 'Services/DoctorApplication.svc/REST/GetPatientRadResult'; ///Prescriptions -const GET_PRESCRIPTIONS_ALL_ORDERS = - 'Services/Patients.svc/REST/PatientER_GetPatientAllPresOrders'; -const GET_PRESCRIPTION_REPORT_NEW = - 'Services/Patients.svc/REST/INP_GetPrescriptionReport'; -const SEND_PRESCRIPTION_EMAIL = - 'Services/Notifications.svc/REST/SendPrescriptionEmail'; -const GET_PRESCRIPTION_REPORT_ENH = - 'Services/Patients.svc/REST/GetPrescriptionReport_enh'; -const UPDATE_PROGRESS_NOTE_FOR_INPATIENT = - "Services/DoctorApplication.svc/REST/UpdateProgressNoteForInPatient"; -const CREATE_PROGRESS_NOTE_FOR_INPATIENT = - "Services/DoctorApplication.svc/REST/CreateProgressNoteForInPatient"; +const GET_PRESCRIPTIONS_ALL_ORDERS = 'Services/Patients.svc/REST/PatientER_GetPatientAllPresOrders'; +const GET_PRESCRIPTION_REPORT_NEW = 'Services/Patients.svc/REST/INP_GetPrescriptionReport'; +const SEND_PRESCRIPTION_EMAIL = 'Services/Notifications.svc/REST/SendPrescriptionEmail'; +const GET_PRESCRIPTION_REPORT_ENH = 'Services/Patients.svc/REST/GetPrescriptionReport_enh'; +const UPDATE_PROGRESS_NOTE_FOR_INPATIENT = "Services/DoctorApplication.svc/REST/UpdateProgressNoteForInPatient"; +const CREATE_PROGRESS_NOTE_FOR_INPATIENT = "Services/DoctorApplication.svc/REST/CreateProgressNoteForInPatient"; const GET_SICK_LEAVE_PATIENT = "Services/Patients.svc/REST/GetPatientSickLeave"; -const GET_MY_OUT_PATIENT = - "Services/DoctorApplication.svc/REST/GetMyOutPatient"; +const GET_MY_OUT_PATIENT = "Services/DoctorApplication.svc/REST/GetMyOutPatient"; -const PATIENT_MEDICAL_REPORT_GET_LIST = - "Services/Patients.svc/REST/DAPP_ListMedicalReport"; -const PATIENT_MEDICAL_REPORT_GET_TEMPLATE = - "Services/Patients.svc/REST/DAPP_GetTemplateByID"; -const PATIENT_MEDICAL_REPORT_INSERT = - "Services/Patients.svc/REST/DAPP_InsertMedicalReport"; -const PATIENT_MEDICAL_REPORT_VERIFIED = - "Services/Patients.svc/REST/DAPP_VerifiedMedicalReport"; +const PATIENT_MEDICAL_REPORT_GET_LIST = "Services/Patients.svc/REST/DAPP_ListMedicalReport"; +const PATIENT_MEDICAL_REPORT_GET_TEMPLATE = "Services/Patients.svc/REST/DAPP_GetTemplateByID"; +const PATIENT_MEDICAL_REPORT_INSERT = "Services/Patients.svc/REST/DAPP_InsertMedicalReport"; +const PATIENT_MEDICAL_REPORT_VERIFIED = "Services/Patients.svc/REST/DAPP_VerifiedMedicalReport"; -const GET_PROCEDURE_TEMPLETE = - 'Services/Doctors.svc/REST/DAPP_ProcedureTemplateGet'; +const GET_PROCEDURE_TEMPLETE = 'Services/Doctors.svc/REST/DAPP_ProcedureTemplateGet'; const GET_TEMPLETE_LIST = 'Services/Doctors.svc/REST/DAPP_TemplateGet'; -const GET_PROCEDURE_TEMPLETE_DETAILS = - "Services/Doctors.svc/REST/DAPP_ProcedureTemplateDetailsGet"; -const GET_PENDING_PATIENT_ER_FOR_DOCTOR_APP = - 'Services/DoctorApplication.svc/REST/GetPendingPatientERForDoctorApp'; +const GET_PROCEDURE_TEMPLETE_DETAILS = "Services/Doctors.svc/REST/DAPP_ProcedureTemplateDetailsGet"; +const GET_PENDING_PATIENT_ER_FOR_DOCTOR_APP = 'Services/DoctorApplication.svc/REST/GetPendingPatientERForDoctorApp'; -const DOCTOR_CHECK_HAS_LIVE_CARE = - "Services/DoctorApplication.svc/REST/CheckDoctorHasLiveCare"; +const DOCTOR_CHECK_HAS_LIVE_CARE = "Services/DoctorApplication.svc/REST/CheckDoctorHasLiveCare"; const LIVE_CARE_IS_LOGIN = "LiveCareApi/DoctorApp/UseIsLogin"; -const ADD_REFERRED_REMARKS_NEW = - "Services/DoctorApplication.svc/REST/AddReferredDoctorRemarks_New"; -const GET_SPECIAL_CLINICAL_CARE_LIST = - "Services/DoctorApplication.svc/REST/GetSpecialClinicalCareList"; -const GET_SPECIAL_CLINICAL_CARE_MAPPING_LIST = - "Services/DoctorApplication.svc/REST/GetSpecialClinicalCareMappingList"; - -const INSERT_MEDICAL_REPORT = - "Services/Patients.svc/REST/DAPP_InsertMedicalReport_New"; - -const UPDATE_MEDICAL_REPORT = - "Services/Patients.svc/REST/DAPP_UpdateMedicalReport"; -const GET_SICK_LEAVE_DOCTOR_APP = - "Services/DoctorApplication.svc/REST/GetAllSickLeaves"; +const ADD_REFERRED_REMARKS_NEW = "Services/DoctorApplication.svc/REST/AddReferredDoctorRemarks_New"; +const GET_SPECIAL_CLINICAL_CARE_LIST = "Services/DoctorApplication.svc/REST/GetSpecialClinicalCareList"; +const GET_SPECIAL_CLINICAL_CARE_MAPPING_LIST = "Services/DoctorApplication.svc/REST/GetSpecialClinicalCareMappingList"; + +const INSERT_MEDICAL_REPORT = "Services/Patients.svc/REST/DAPP_InsertMedicalReport_New"; + +const UPDATE_MEDICAL_REPORT = "Services/Patients.svc/REST/DAPP_UpdateMedicalReport"; +const GET_SICK_LEAVE_DOCTOR_APP = "Services/DoctorApplication.svc/REST/GetAllSickLeaves"; const ADD_PATIENT_TO_DOCTOR = "LiveCareApi/DoctorApp/AssignPatientToDoctor"; const REMOVE_PATIENT_FROM_DOCTOR = "LiveCareApi/DoctorApp/BackPatientToQueue"; -const CREATE_DOCTOR_RESPONSE = - "Services/DoctorApplication.svc/REST/CreateDoctorResponse"; -const GET_DOCTOR_NOT_REPLIED_COUNTS = - "Services/DoctorApplication.svc/REST/DoctorApp_GetDoctorNotRepliedCounts"; -const ALL_SPECIAL_LAB_RESULT = - "services/Patients.svc/REST/GetPatientLabSpecialResultsALL"; -const GET_MEDICATION_FOR_IN_PATIENT = - "Services/DoctorApplication.svc/REST/Doctor_GetMedicationForInpatient"; -const GET_EPISODE_FOR_INPATIENT = - "/Services/DoctorApplication.svc/REST/DoctorApp_GetEpisodeForInpatient"; +const CREATE_DOCTOR_RESPONSE = "Services/DoctorApplication.svc/REST/CreateDoctorResponse"; +const GET_DOCTOR_NOT_REPLIED_COUNTS = "Services/DoctorApplication.svc/REST/DoctorApp_GetDoctorNotRepliedCounts"; +const ALL_SPECIAL_LAB_RESULT = "services/Patients.svc/REST/GetPatientLabSpecialResultsALL"; +const GET_MEDICATION_FOR_IN_PATIENT = "Services/DoctorApplication.svc/REST/Doctor_GetMedicationForInpatient"; +const GET_EPISODE_FOR_INPATIENT = "/Services/DoctorApplication.svc/REST/DoctorApp_GetEpisodeForInpatient"; ///Operation Details Services -const GET_RESERVATIONS = - "Services/DoctorApplication.svc/REST/DoctorApp_GetReservationDetails"; -const GET_OPERATION_DETAILS = - "Services/DoctorApplication.svc/REST/DoctorApp_GetOperationDetails"; -const UPDATE_OPERATION_REPORT = - "Services/DoctorApplication.svc/REST/DoctorApp_CreateUpdateOperationReport"; +const GET_RESERVATIONS = "Services/DoctorApplication.svc/REST/DoctorApp_GetReservationDetails"; +const GET_OPERATION_DETAILS = "Services/DoctorApplication.svc/REST/DoctorApp_GetOperationDetails"; +const UPDATE_OPERATION_REPORT = "Services/DoctorApplication.svc/REST/DoctorApp_CreateUpdateOperationReport"; -const NURSING_PROGRESS_NOTE = - "Services/DoctorApplication.svc/REST/DoctorApp_GetNursingProgressNote"; -const GET_DIAGNOSIS_FOR_IN_PATIENT = - "Services/DoctorApplication.svc/REST/DoctorApp_GetDiagnosisForInPatient"; +const NURSING_PROGRESS_NOTE = "Services/DoctorApplication.svc/REST/DoctorApp_GetNursingProgressNote"; +const GET_DIAGNOSIS_FOR_IN_PATIENT = "Services/DoctorApplication.svc/REST/DoctorApp_GetDiagnosisForInPatient"; -const GET_DIABETIC_CHART_VALUES = - "Services/DoctorApplication.svc/REST/DoctorApp_GetDiabeticChartValues"; +const GET_DIABETIC_CHART_VALUES = "Services/DoctorApplication.svc/REST/DoctorApp_GetDiabeticChartValues"; -const GET_PENDING_ORDERS = - "Services/DoctorApplication.svc/REST/DoctorApp_GetPendingOrdersForInPatient"; +const GET_PENDING_ORDERS = "Services/DoctorApplication.svc/REST/DoctorApp_GetPendingOrdersForInPatient"; -const GET_ADMISSION_ORDERS = - "/Services/DoctorApplication.svc/REST/DoctorApp_GetAdmissionOrders"; +const GET_ADMISSION_ORDERS = "/Services/DoctorApplication.svc/REST/DoctorApp_GetAdmissionOrders"; ///Patient Registration Services -const CHECK_PATIENT_FOR_REGISTRATION = - "Services/Authentication.svc/REST/CheckPatientForRegisteration"; -const SEND_ACTIVATION_CODE_BY_OTP_NOT_TYPE_FOR_REGISTRATION = - "Services/Authentication.svc/REST/SendActivationCodebyOTPNotificationTypeForRegistration"; -const CHECK_ACTIVATION_CODE_FOR_PATIENT = - "Services/Authentication.svc/REST/CheckActivationCode"; -const PATIENT_REGISTRATION = - "Services/Authentication.svc/REST/PatientRegistration"; +const CHECK_PATIENT_FOR_REGISTRATION = "Services/Authentication.svc/REST/CheckPatientForRegisteration"; +const SEND_ACTIVATION_CODE_BY_OTP_NOT_TYPE_FOR_REGISTRATION = "Services/Authentication.svc/REST/SendActivationCodebyOTPNotificationTypeForRegistration"; +const CHECK_ACTIVATION_CODE_FOR_PATIENT = "Services/Authentication.svc/REST/CheckActivationCode"; +const PATIENT_REGISTRATION = "Services/Authentication.svc/REST/PatientRegistration"; const GET_PATIENT_INFO = "Services/NHIC.svc/REST/GetPatientInfo"; /// Discharge Summary -const GET_PENDING_DISCHARGE_SUMMARY = - "Services/DoctorApplication.svc/REST/DoctorApp_GetPendingDischargeSummary"; -const GET_ALL_DISCHARGE_SUMMARY = - "Services/DoctorApplication.svc/REST/DoctorApp_GetDischargeSummary"; - -const VTE_ASSESSMENT = - "Services/Patients.svc/REST/INP_GetVTEHistoryByTransactionNo"; +const GET_PENDING_DISCHARGE_SUMMARY = "Services/DoctorApplication.svc/REST/DoctorApp_GetPendingDischargeSummary"; +const GET_ALL_DISCHARGE_SUMMARY = "Services/DoctorApplication.svc/REST/DoctorApp_GetDischargeSummary"; -const GET_INTERVENTION_MEDICATION = - "Services/DoctorApplication.svc/REST/DoctorApp_GetInterventionMedications"; +const VTE_ASSESSMENT = "Services/Patients.svc/REST/INP_GetVTEHistoryByTransactionNo"; -const GET_INTERVENTION_MEDICATION_HISTORY = - "Services/DoctorApplication.svc/REST/DoctorApp_GetInterventionHistory"; +const GET_INTERVENTION_MEDICATION = "Services/DoctorApplication.svc/REST/DoctorApp_GetInterventionMedications"; -const SET_ACCEPTED_OR_REJECTED = - "Services/DoctorApplication.svc/REST/DoctorApp_AcceptOrRejectIntervention"; +const GET_INTERVENTION_MEDICATION_HISTORY = "Services/DoctorApplication.svc/REST/DoctorApp_GetInterventionHistory"; -const GET_STP_MASTER_LIST = - "Services/DoctorApplication.svc/REST/DoctorApp_GetSTPMasterList"; +const SET_ACCEPTED_OR_REJECTED = "Services/DoctorApplication.svc/REST/DoctorApp_AcceptOrRejectIntervention"; +const GET_STP_MASTER_LIST = "Services/DoctorApplication.svc/REST/DoctorApp_GetSTPMasterList"; -const DOCTOR_ER_SIGN_ASSESSMENT = - "Services/DoctorApplication.svc/REST/DoctorApp_DoctorERSignAssessment"; +const DOCTOR_ER_SIGN_ASSESSMENT = "Services/DoctorApplication.svc/REST/DoctorApp_DoctorERSignAssessment"; var selectedPatientType = 1; @@ -419,26 +295,8 @@ var SERVICES_PATIANT2 = [ "List_MyReferralPatient", "patientArrivalList" ]; -var SERVICES_PATIANT_HEADER = [ - "My OutPatient", - "My InPatient", - "Discharge", - "Referred", - "Referral Discharge", - "Tomorrow", - "Referral", - "Arrival Patient" -]; -var SERVICES_PATIANT_HEADER_AR = [ - "المريض الخارجي", - "المريض المنوم", - "المريض المعافى", - "المريض المحول الي", - "المريض المحال المعافى", - "مريض الغد", - "المريض المحول مني", - "المريض الواصل" -]; +var SERVICES_PATIANT_HEADER = ["My OutPatient", "My InPatient", "Discharge", "Referred", "Referral Discharge", "Tomorrow", "Referral", "Arrival Patient"]; +var SERVICES_PATIANT_HEADER_AR = ["المريض الخارجي", "المريض المنوم", "المريض المعافى", "المريض المحول الي", "المريض المحال المعافى", "مريض الغد", "المريض المحول مني", "المريض الواصل"]; const PRIMARY_COLOR = 0xff515B5D; @@ -458,7 +316,6 @@ const GENERAL_ID = 'Cs2020@2016\$2958'; const PATIENT_TYPE = 1; const PATIENT_TYPE_ID = 1; - /// Timer Info const TIMER_MIN = 10; @@ -467,7 +324,6 @@ class AppGlobal { static Color appRedColor = Color(0xFFD02127); static Color appGreenColor = Color(0xFF359846); static Color appTextColor = Color(0xFF2B353E); - static Color scheduleTextColor = Color(0xFF2E303A); - static Color inProgressColor = Color(0xFFCC9B14); - + static Color scheduleTextColor = Color(0xFF2E303A); + static Color inProgressColor = Color(0xFFCC9B14); } diff --git a/lib/core/model/ER_sign_in/doctor_ER_sign_assessment_req_model.dart b/lib/core/model/ER_sign_in/doctor_ER_sign_assessment_req_model.dart index 19996bd4..b0d56669 100644 --- a/lib/core/model/ER_sign_in/doctor_ER_sign_assessment_req_model.dart +++ b/lib/core/model/ER_sign_in/doctor_ER_sign_assessment_req_model.dart @@ -1,14 +1,18 @@ class DoctorErSignAssessmentReqModel { - String setupID; + // String setupID; int signInType; int loginDoctorID; int patientID; DoctorErSignAssessmentReqModel( - {this.setupID, this.signInType, this.loginDoctorID, this.patientID}); + { + // this.setupID, + this.signInType, + this.loginDoctorID, + this.patientID}); DoctorErSignAssessmentReqModel.fromJson(Map json) { - setupID = json['SetupID']; + // setupID = json['SetupID']; signInType = json['SignInType']; loginDoctorID = json['LoginDoctorID']; patientID = json['PatientID']; @@ -16,7 +20,7 @@ class DoctorErSignAssessmentReqModel { Map toJson() { final Map data = new Map(); - data['SetupID'] = this.setupID; + // data['SetupID'] = this.setupID; data['SignInType'] = this.signInType; data['LoginDoctorID'] = this.loginDoctorID; data['PatientID'] = this.patientID; diff --git a/lib/core/service/patient_medical_file/ER_signin/ER_signin_service.dart b/lib/core/service/patient_medical_file/ER_signin/ER_signin_service.dart index 9e1de604..4d953350 100644 --- a/lib/core/service/patient_medical_file/ER_signin/ER_signin_service.dart +++ b/lib/core/service/patient_medical_file/ER_signin/ER_signin_service.dart @@ -33,10 +33,7 @@ class ERSignInService extends LookupService { Future signInERPatient({DoctorErSignAssessmentReqModel doctorErSignAssessmentReqModel}) async { - - hasError = false; - await baseAppClient.post(DOCTOR_ER_SIGN_ASSESSMENT, onSuccess: (dynamic response, int statusCode) { diff --git a/lib/core/viewModel/ER_sign_in/ER_sign_in_view_model.dart b/lib/core/viewModel/ER_sign_in/ER_sign_in_view_model.dart index 02ddd1e8..f1e9104f 100644 --- a/lib/core/viewModel/ER_sign_in/ER_sign_in_view_model.dart +++ b/lib/core/viewModel/ER_sign_in/ER_sign_in_view_model.dart @@ -27,7 +27,7 @@ class ERSignInViewModel extends BaseViewModel { Future signInERPatient({int patientId, int signInType}) async { hasError = false; await getDoctorProfile(); - DoctorErSignAssessmentReqModel doctorErSignAssessmentReqModel = new DoctorErSignAssessmentReqModel(signInType:signInType, loginDoctorID:doctorProfile.doctorID, patientID: patientId ); + DoctorErSignAssessmentReqModel doctorErSignAssessmentReqModel = new DoctorErSignAssessmentReqModel(signInType: signInType, loginDoctorID: doctorProfile.doctorID, patientID: patientId); setState(ViewState.BusyLocal); await _ERSignInService.signInERPatient(doctorErSignAssessmentReqModel: doctorErSignAssessmentReqModel); if (_ERSignInService.hasError) { @@ -36,6 +36,4 @@ class ERSignInViewModel extends BaseViewModel { } else setState(ViewState.Idle); } - - } From 5e63db7ea65d19ea294437e0acc726d70b267297 Mon Sep 17 00:00:00 2001 From: Sultan khan <> Date: Wed, 6 Sep 2023 10:02:25 +0300 Subject: [PATCH 20/28] bug fixes and updates --- .../model/procedure/categories_procedure.dart | 2 +- .../sick_leave/sick_leave_patient_model.dart | 3 +- lib/core/viewModel/sick_leave_view_model.dart | 16 +- .../patient_sick_leave_screen.dart | 385 +++++++++++------- .../procedures/add_procedure_page.dart | 4 +- .../entity_list_checkbox_search_widget.dart | 12 +- 6 files changed, 253 insertions(+), 169 deletions(-) diff --git a/lib/core/model/procedure/categories_procedure.dart b/lib/core/model/procedure/categories_procedure.dart index 9e6f847f..a679aa3d 100644 --- a/lib/core/model/procedure/categories_procedure.dart +++ b/lib/core/model/procedure/categories_procedure.dart @@ -58,7 +58,7 @@ class EntityList { this.subGroup, this.template, this.remarks, - this.type}); + this.type ='1'}); EntityList.fromJson(Map json) { allowedClinic = json['allowedClinic']; diff --git a/lib/core/model/sick_leave/sick_leave_patient_model.dart b/lib/core/model/sick_leave/sick_leave_patient_model.dart index d4c15368..c1620b6f 100644 --- a/lib/core/model/sick_leave/sick_leave_patient_model.dart +++ b/lib/core/model/sick_leave/sick_leave_patient_model.dart @@ -9,6 +9,7 @@ class SickLeavePatientModel { dynamic requestDate; dynamic sickLeaveDays; dynamic appointmentNo; + dynamic appointmentNO; dynamic admissionNo; dynamic actualDoctorRate; dynamic appointmentDate; @@ -98,7 +99,7 @@ class SickLeavePatientModel { requestNo = json['RequestNo']; requestDate = json['RequestDate']; sickLeaveDays = json['SickLeaveDays']; - appointmentNo = json['AppointmentNo']; + appointmentNo = (json['AppointmentNo'] ==null ? json['appointmentNo'] : json['AppointmentNo']); admissionNo = json['AdmissionNo']; actualDoctorRate = json['ActualDoctorRate']; appointmentDate = json['AppointmentDate']; diff --git a/lib/core/viewModel/sick_leave_view_model.dart b/lib/core/viewModel/sick_leave_view_model.dart index 4a9a5875..768a36d6 100644 --- a/lib/core/viewModel/sick_leave_view_model.dart +++ b/lib/core/viewModel/sick_leave_view_model.dart @@ -1,4 +1,5 @@ import 'package:doctor_app_flutter/core/enum/view_state.dart'; +import 'package:doctor_app_flutter/core/model/sick_leave/sick_leave_patient_model.dart'; import 'package:doctor_app_flutter/core/service/patient/patient_service.dart'; import 'package:doctor_app_flutter/core/service/patient_medical_file/sick_leave/sickleave_service.dart'; import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; @@ -30,10 +31,10 @@ class SickLeaveViewModel extends BaseViewModel { get postSechedule => _sickLeaveService.postReschedule; - get getAllSIckLeavePatient => [ + get getAllSIckLeavePatient => removeDuplicates([ ..._sickLeaveService.getAllSickLeavePatient, ..._sickLeaveService.getAllSickLeaveDoctor - ]; + ]); Future addSickLeave(AddSickLeaveRequest addSickLeaveRequest) async { setState(ViewState.BusyLocal); @@ -183,4 +184,15 @@ class SickLeaveViewModel extends BaseViewModel { } else setState(ViewState.Idle); } + List removeDuplicates(List items) { + ListuniqueItems = []; + var uniqueIDs = items + .map((e) => e.appointmentNo) + .toSet(); + uniqueIDs.forEach((e) { + uniqueItems.add(items.firstWhere((i) => i.appointmentNo == e)); + }); + return uniqueItems; + } } + diff --git a/lib/screens/patient-sick-leave/patient_sick_leave_screen.dart b/lib/screens/patient-sick-leave/patient_sick_leave_screen.dart index 0e5873df..4433bfa8 100644 --- a/lib/screens/patient-sick-leave/patient_sick_leave_screen.dart +++ b/lib/screens/patient-sick-leave/patient_sick_leave_screen.dart @@ -29,185 +29,255 @@ class PatientSickLeaveScreen extends StatelessWidget { Widget build(BuildContext context) { ProjectViewModel projectsProvider = Provider.of(context); - final routeArgs = ModalRoute.of(context).settings.arguments as Map; + final routeArgs = ModalRoute + .of(context) + .settings + .arguments as Map; patient = routeArgs['patient']; bool isInpatient = routeArgs['isInpatient']; return BaseView( onModelReady: (model) async { await model.getSickLeaveForPatient(patient); }, - builder: (_, model, w) => AppScaffold( - baseViewModel: model, - isShowAppBar: true, - backgroundColor: Colors.grey[100], - appBar: PatientProfileAppBar( - patient, - isInpatient: isInpatient, - ), - body: Column(children: [ - patient.patientStatusType == 43 - ? Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Padding( - padding: EdgeInsets.all(10), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - SizedBox( - height: SizeConfig.isHeightVeryShort - ? 30 - : SizeConfig.isHeightShort - ? 35 - : 10, - ), - if (!projectsProvider.isArabic) - AppText( - TranslationBase.of(context).patient, - fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * (SizeConfig.isWidthLarge ? 3 : 4), - fontWeight: FontWeight.w700, - letterSpacing: -0.72, - color: Color(0xFF2E303A), - ), + builder: (_, model, w) => + AppScaffold( + baseViewModel: model, + isShowAppBar: true, + backgroundColor: Colors.grey[100], + appBar: PatientProfileAppBar( + patient, + isInpatient: isInpatient, + ), + body: Column(children: [ + patient.patientStatusType == 43 + ? Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Padding( + padding: EdgeInsets.all(10), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: SizeConfig.isHeightVeryShort + ? 30 + : SizeConfig.isHeightShort + ? 35 + : 10, + ), + if (!projectsProvider.isArabic) AppText( - TranslationBase.of(context).sickLeave, - fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * (SizeConfig.isWidthLarge ? 6 : 6), - fontWeight: FontWeight.bold, - letterSpacing: -1.44, + TranslationBase + .of(context) + .patient, + fontSize: SizeConfig + .getTextMultiplierBasedOnWidth() * (SizeConfig + .isWidthLarge ? 3 : 4), + fontWeight: FontWeight.w700, + letterSpacing: -0.72, color: Color(0xFF2E303A), ), - ], - ), + AppText( + TranslationBase + .of(context) + .sickLeave, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * + (SizeConfig.isWidthLarge ? 6 : 6), + fontWeight: FontWeight.bold, + letterSpacing: -1.44, + color: Color(0xFF2E303A), + ), + ], ), - AddNewOrder( - label: TranslationBase.of(context).noSickLeaveApplied, - onTap: () async { - await locator().logEvent( - eventCategory: "Add Sick Leave Screen" - "Leave Screen", - eventAction: "apply For Sick Leave", - ); - openSickLeave(context, model); - }), - ], - ) - : SizedBox(), - model.getAllSIckLeavePatient.length > 0 - ? Expanded( - child: FractionallySizedBox( - widthFactor: 0.95, - child: ListView.builder( - scrollDirection: Axis.vertical, - shrinkWrap: true, - itemCount: model.getAllSIckLeavePatient.length, - itemBuilder: (BuildContext ctxt, int index) { - SickLeavePatientModel item = model.getAllSIckLeavePatient[index]; - return Column( - children: [ - CardWithBgWidget( - padding: 0, - marginLeft: 10, - marginSymmetric: 10, - hasBorder: false, - bgColor: Colors.black, - widget: Container( - color: Colors.white, - padding: EdgeInsets.all(20), - child: InkWell( - child: Column( - children: [ - if (item.doctorName != null) - Row(crossAxisAlignment: CrossAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start, children: [ - Expanded( - // width: MediaQuery.of(context).size.width*0.51, - child: AppText( - Utils.capitalize(item.doctorName ?? ""), - fontSize: 18, - color: Color(0xff2e303a), - fontWeight: FontWeight.w700, - fontFamily: 'Poppins', - textOverflow: TextOverflow.ellipsis, - ), - ), - ]), - SizedBox( - height: 10, - ), - Row( - children: [ - ClipRRect( - borderRadius: BorderRadius.circular(50.0), - child: CachedNetworkImage( - imageUrl: item.doctorImageURL ?? "https://hmgwebservices.com/Images/MobileImages/DUBAI/unkown.png", - height: 30, - width: 30, - errorWidget: (context, url, error) => AppText( - 'No Image', - fontSize: 10, + ), + AddNewOrder( + label: TranslationBase + .of(context) + .noSickLeaveApplied, + onTap: () async { + await locator().logEvent( + eventCategory: "Add Sick Leave Screen" + "Leave Screen", + eventAction: "apply For Sick Leave", + ); + openSickLeave(context, model); + }), + ], + ) + : SizedBox(), + model.getAllSIckLeavePatient.length > 0 + ? Expanded( + child: FractionallySizedBox( + widthFactor: 0.95, + child: ListView.builder( + scrollDirection: Axis.vertical, + shrinkWrap: true, + itemCount: model.getAllSIckLeavePatient.length, + itemBuilder: (BuildContext ctxt, int index) { + SickLeavePatientModel item = model + .getAllSIckLeavePatient[index]; + return Column( + children: [ + CardWithBgWidget( + padding: 0, + marginLeft: 10, + marginSymmetric: 10, + hasBorder: false, + bgColor: Colors.black, + widget: Container( + color: Colors.white, + padding: EdgeInsets.all(20), + child: InkWell( + child: Column( + children: [ + if (item.doctorName != null) + Row(crossAxisAlignment: CrossAxisAlignment + .start, + mainAxisAlignment: MainAxisAlignment + .start, + children: [ + Expanded( + // width: MediaQuery.of(context).size.width*0.51, + child: AppText( + Utils.capitalize( + item.doctorName ?? ""), + fontSize: 18, + color: Color(0xff2e303a), + fontWeight: FontWeight.w700, + fontFamily: 'Poppins', + textOverflow: TextOverflow + .ellipsis, ), ), - ), - SizedBox( - width: 10, - ), - Expanded( - child: Column( - children: [ - CustomRow( - label: TranslationBase.of(context).daysSickleave, - labelSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.3, - valueSize: SizeConfig.getTextMultiplierBasedOnWidth() * 4, - value: - (item.sickLeaveDays.toString() != null && item.sickLeaveDays.toString() != "null") ? item.sickLeaveDays.toString() : item.noOfDays.toString(), + ]), + SizedBox( + height: 10, + ), + Row( + children: [ + ClipRRect( + borderRadius: BorderRadius.circular( + 50.0), + child: CachedNetworkImage( + imageUrl: item.doctorImageURL ?? + "https://hmgwebservices.com/Images/MobileImages/DUBAI/unkown.png", + height: 30, + width: 30, + errorWidget: (context, url, + error) => + AppText( + 'No Image', + fontSize: 10, ), - CustomRow( - label: TranslationBase.of(context).startDate + ' ' ?? "", - labelSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.3, - valueSize: SizeConfig.getTextMultiplierBasedOnWidth() * 4, - value: AppDateUtils.getDayMonthYearDateFormatted( - item.startDate.contains("/Date(") ? AppDateUtils.convertStringToDate(item.startDate) : DateTime.parse(item.startDate), - ), + ), + ), + SizedBox( + width: 10, + ), + Expanded( + child: Column( + children: [ + CustomRow( + label: TranslationBase + .of(context) + .daysSickleave, + labelSize: SizeConfig + .getTextMultiplierBasedOnWidth() * + 3.3, + valueSize: SizeConfig + .getTextMultiplierBasedOnWidth() * + 4, + value: + (item.sickLeaveDays + .toString() != null && + item.sickLeaveDays + .toString() != "null") + ? item.sickLeaveDays + .toString() + : item.noOfDays + .toString(), + ), + CustomRow( + label: TranslationBase + .of(context) + .startDate + ' ' ?? "", + labelSize: SizeConfig + .getTextMultiplierBasedOnWidth() * + 3.3, + valueSize: SizeConfig + .getTextMultiplierBasedOnWidth() * + 4, + value: AppDateUtils + .getDayMonthYearDateFormatted( + item.startDate.contains( + "/Date(") + ? AppDateUtils + .convertStringToDate( + item.startDate) + : DateTime.parse( + item.startDate), ), - CustomRow( - label: TranslationBase.of(context).endDate + ' ' ?? "", - labelSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.3, - valueSize: SizeConfig.getTextMultiplierBasedOnWidth() * 4, - value: AppDateUtils.getDayMonthYearDateFormatted( - item.startDate.contains("/Date(") - ? AppDateUtils.convertStringToDate(item.endDate ?? "").add( - Duration(days: item.noOfDays ?? item.sickLeaveDays), - ) - : DateTime.parse(item.startDate ?? "").add( - Duration(days: item.noOfDays ?? ""), - ), + ), + CustomRow( + label: TranslationBase + .of(context) + .endDate + ' ' ?? "", + labelSize: SizeConfig + .getTextMultiplierBasedOnWidth() * + 3.3, + valueSize: SizeConfig + .getTextMultiplierBasedOnWidth() * + 4, + value: AppDateUtils + .getDayMonthYearDateFormatted( + item.startDate.contains( + "/Date(") + ? AppDateUtils + .convertStringToDate( + item.endDate ?? "").add( + Duration( + days: item.noOfDays ?? + item + .sickLeaveDays), + ) + : DateTime.parse( + item.startDate ?? "") + .add( + Duration( + days: item.noOfDays ?? + ""), ), ), - ], - crossAxisAlignment: CrossAxisAlignment.start, - ), + ), + ], + crossAxisAlignment: CrossAxisAlignment + .start, ), - ], - ), - ], - ), + ), + ], + ), + ], ), ), ), - ], - ); - }), - ), - ) - : patient.patientStatusType != 43 + ), + ], + ); + }), + ), + ) + : patient.patientStatusType != 43 ? ErrorMessage( - error: TranslationBase.of(context).noSickLeave, - ) + error: TranslationBase + .of(context) + .noSickLeave, + ) : SizedBox(), - SizedBox( - height: 100, - ) - ]), - ), + SizedBox( + height: 100, + ) + ]), + ), ); } @@ -226,3 +296,4 @@ class PatientSickLeaveScreen extends StatelessWidget { ); } } + diff --git a/lib/screens/procedures/add_procedure_page.dart b/lib/screens/procedures/add_procedure_page.dart index bedfea99..efb1185f 100644 --- a/lib/screens/procedures/add_procedure_page.dart +++ b/lib/screens/procedures/add_procedure_page.dart @@ -31,7 +31,7 @@ class AddProcedurePage extends StatefulWidget { } class _AddProcedurePageState extends State { - int selectedType; + String selectedType; ProcedureViewModel model; PatiantInformtion patient; ProcedureType procedureType; @@ -46,7 +46,7 @@ class _AddProcedurePageState extends State { dynamic selectedCategory; - setSelectedType(int val) { + setSelectedType(String val) { setState(() { selectedType = val; }); diff --git a/lib/screens/procedures/entity_list_checkbox_search_widget.dart b/lib/screens/procedures/entity_list_checkbox_search_widget.dart index 3a3f6b09..6e55c77e 100644 --- a/lib/screens/procedures/entity_list_checkbox_search_widget.dart +++ b/lib/screens/procedures/entity_list_checkbox_search_widget.dart @@ -37,11 +37,11 @@ class EntityListCheckboxSearchWidget extends StatefulWidget { class _EntityListCheckboxSearchWidgetState extends State { - int selectedType = 0; + String selectedType = '0'; int typeUrgent; int typeRegular; - setSelectedType(int val) { + setSelectedType(String val) { setState(() { selectedType = val; }); @@ -158,8 +158,8 @@ class _EntityListCheckboxSearchWidgetState Radio( activeColor: Color(0xFFD02127), - value: 0, - groupValue: selectedType, + value: '0', + groupValue: historyInfo.type, onChanged: (value) { historyInfo.type = setSelectedType(value) @@ -177,8 +177,8 @@ class _EntityListCheckboxSearchWidgetState Radio( activeColor: Color(0xFFD02127), - groupValue: selectedType, - value: 1, + groupValue: historyInfo.type, + value: '1', onChanged: (value) { historyInfo.type = setSelectedType(value) From 793f9ff90565ab1be677695ff954ff91c90be63e Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Wed, 6 Sep 2023 17:05:48 +0300 Subject: [PATCH 21/28] add assessment updated --- lib/core/viewModel/SOAP_view_model.dart | 356 ++++------- .../patient_profile_screen.dart | 2 +- .../assessment/add_assessment_details.dart | 563 ++++++++---------- 3 files changed, 353 insertions(+), 568 deletions(-) diff --git a/lib/core/viewModel/SOAP_view_model.dart b/lib/core/viewModel/SOAP_view_model.dart index a6904678..866321fe 100644 --- a/lib/core/viewModel/SOAP_view_model.dart +++ b/lib/core/viewModel/SOAP_view_model.dart @@ -45,52 +45,39 @@ class SOAPViewModel extends BaseViewModel { List get allergiesList => _SOAPService.allergiesList; - List get allergySeverityList => - _SOAPService.allergySeverityList; + List get allergySeverityList => _SOAPService.allergySeverityList; List get historyFamilyList => _SOAPService.historyFamilyList; - List get historyMedicalList => - _SOAPService.historyMedicalList; + List get historyMedicalList => _SOAPService.historyMedicalList; List get historySportList => _SOAPService.historySportList; List get historySocialList => _SOAPService.historySocialList; - List get historySurgicalList => - _SOAPService.historySurgicalList; + List get historySurgicalList => _SOAPService.historySurgicalList; - List get mergeHistorySurgicalWithHistorySportList => - [...historySurgicalList, ...historySportList]; + List get mergeHistorySurgicalWithHistorySportList => [...historySurgicalList, ...historySportList]; - List get physicalExaminationList => - _SOAPService.physicalExaminationList; + List get physicalExaminationList => _SOAPService.physicalExaminationList; - List get listOfDiagnosisType => - _SOAPService.listOfDiagnosisType; + List get listOfDiagnosisType => _SOAPService.listOfDiagnosisType; - List get listOfDiagnosisCondition => - _SOAPService.listOfDiagnosisCondition; + List get listOfDiagnosisCondition => _SOAPService.listOfDiagnosisCondition; List get listOfICD10 => _SOAPService.listOfICD10; - List get patientChiefComplaintList => - _SOAPService.patientChiefComplaintList; + List get patientChiefComplaintList => _SOAPService.patientChiefComplaintList; - List get patientAllergiesList => - _SOAPService.patientAllergiesList; + List get patientAllergiesList => _SOAPService.patientAllergiesList; - List get patientHistoryList => - _SOAPService.patientHistoryList; + List get patientHistoryList => _SOAPService.patientHistoryList; - List get patientPhysicalExamList => - _SOAPService.patientPhysicalExamList; + List get patientPhysicalExamList => _SOAPService.patientPhysicalExamList; - List get patientProgressNoteList => - _SOAPService.patientProgressNoteList; + List get patientProgressNoteList => _SOAPService.patientProgressNoteList; - List get patientAssessmentList => - _SOAPService.patientAssessmentList; + List get patientAssessmentList => _SOAPService.patientAssessmentList; int get episodeID => _SOAPService.episodeID; @@ -109,8 +96,7 @@ class SOAPViewModel extends BaseViewModel { get medicationFrequencyList => _SOAPService.medicationFrequencyListWithModel; - List get allMedicationList => - _prescriptionService.allMedicationList; + List get allMedicationList => _prescriptionService.allMedicationList; SubjectiveCallBack subjectiveCallBack; @@ -151,8 +137,8 @@ class SOAPViewModel extends BaseViewModel { nextOnPlanPage(model) { planCallBack.nextFunction(model); } - Future getMasterLookup(MasterKeysService masterKeys, - {bool isBusyLocal = false, String searchKey = ""}) async { + + Future getMasterLookup(MasterKeysService masterKeys, {bool isBusyLocal = false, String searchKey = ""}) async { if (isBusyLocal) { setState(ViewState.Busy); } else @@ -175,12 +161,9 @@ class SOAPViewModel extends BaseViewModel { setState(ViewState.Idle); } - Future postEpisodeForInPatient( - PostEpisodeForInpatientRequestModel - postEpisodeForInpatientRequestModel) async { + Future postEpisodeForInPatient(PostEpisodeForInpatientRequestModel postEpisodeForInpatientRequestModel) async { setState(ViewState.BusyLocal); - await _SOAPService.postEpisodeForInPatient( - postEpisodeForInpatientRequestModel); + await _SOAPService.postEpisodeForInPatient(postEpisodeForInpatientRequestModel); if (_SOAPService.hasError) { error = _SOAPService.error; setState(ViewState.ErrorLocal); @@ -188,8 +171,7 @@ class SOAPViewModel extends BaseViewModel { setState(ViewState.Idle); } - Future postPhysicalExam( - PostPhysicalExamRequestModel postPhysicalExamRequestModel) async { + Future postPhysicalExam(PostPhysicalExamRequestModel postPhysicalExamRequestModel) async { setState(ViewState.BusyLocal); await _SOAPService.postPhysicalExam(postPhysicalExamRequestModel); if (_SOAPService.hasError) { @@ -199,8 +181,7 @@ class SOAPViewModel extends BaseViewModel { setState(ViewState.Idle); } - Future postProgressNote( - PostProgressNoteRequestModel postProgressNoteRequestModel) async { + Future postProgressNote(PostProgressNoteRequestModel postProgressNoteRequestModel) async { setState(ViewState.BusyLocal); await _SOAPService.postProgressNote(postProgressNoteRequestModel); if (_SOAPService.hasError) { @@ -210,8 +191,7 @@ class SOAPViewModel extends BaseViewModel { setState(ViewState.Idle); } - Future postAssessment( - PostAssessmentRequestModel postAssessmentRequestModel) async { + Future postAssessment(PostAssessmentRequestModel postAssessmentRequestModel) async { setState(ViewState.BusyLocal); await _SOAPService.postAssessment(postAssessmentRequestModel); if (_SOAPService.hasError) { @@ -221,8 +201,7 @@ class SOAPViewModel extends BaseViewModel { setState(ViewState.Idle); } - Future patchPhysicalExam( - PostPhysicalExamRequestModel patchPhysicalExamRequestModel) async { + Future patchPhysicalExam(PostPhysicalExamRequestModel patchPhysicalExamRequestModel) async { setState(ViewState.BusyLocal); await _SOAPService.patchPhysicalExam(patchPhysicalExamRequestModel); if (_SOAPService.hasError) { @@ -232,8 +211,7 @@ class SOAPViewModel extends BaseViewModel { setState(ViewState.Idle); } - Future patchProgressNote( - PostProgressNoteRequestModel patchProgressNoteRequestModel) async { + Future patchProgressNote(PostProgressNoteRequestModel patchProgressNoteRequestModel) async { setState(ViewState.BusyLocal); await _SOAPService.patchProgressNote(patchProgressNoteRequestModel); if (_SOAPService.hasError) { @@ -243,8 +221,7 @@ class SOAPViewModel extends BaseViewModel { setState(ViewState.Idle); } - Future patchAssessment( - PatchAssessmentReqModel patchAssessmentRequestModel) async { + Future patchAssessment(PatchAssessmentReqModel patchAssessmentRequestModel) async { setState(ViewState.BusyLocal); await _SOAPService.patchAssessment(patchAssessmentRequestModel); if (_SOAPService.hasError) { @@ -254,8 +231,7 @@ class SOAPViewModel extends BaseViewModel { setState(ViewState.Idle); } - Future getPatientAllergy(GeneralGetReqForSOAP generalGetReqForSOAP, - {isLocalBusy = false}) async { + Future getPatientAllergy(GeneralGetReqForSOAP generalGetReqForSOAP, {isLocalBusy = false}) async { if (isLocalBusy) { setState(ViewState.BusyLocal); } else @@ -274,14 +250,8 @@ class SOAPViewModel extends BaseViewModel { String getAllergicNames(isArabic) { String allergiesString = ''; patientAllergiesList.forEach((element) { - MasterKeyModel selectedAllergy = getOneMasterKey( - masterKeys: MasterKeysService.Allergies, - id: element.allergyDiseaseId, - typeId: element.allergyDiseaseType); - if (selectedAllergy != null && element.isChecked) - allergiesString += - (isArabic ? selectedAllergy.nameAr : selectedAllergy.nameEn) + - ' , '; + MasterKeyModel selectedAllergy = getOneMasterKey(masterKeys: MasterKeysService.Allergies, id: element.allergyDiseaseId, typeId: element.allergyDiseaseType); + if (selectedAllergy != null && element.isChecked) allergiesString += (isArabic ? selectedAllergy.nameAr : selectedAllergy.nameEn) + ' , '; }); return allergiesString; } @@ -291,9 +261,7 @@ class SOAPViewModel extends BaseViewModel { ) async { GetPhysicalExamReqModel getPhysicalExamReqModel = GetPhysicalExamReqModel( patientMRN: patientInfo.patientMRN, - episodeID: patientInfo.episodeNo == null - ? "0" - : patientInfo.episodeNo.toString(), + episodeID: patientInfo.episodeNo == null ? "0" : patientInfo.episodeNo.toString(), appointmentNo: patientInfo.appointmentNo == null ? 0 : int.parse( @@ -313,8 +281,7 @@ class SOAPViewModel extends BaseViewModel { setState(ViewState.Idle); } - Future getPatientProgressNote( - GetProgressNoteReqModel getGetProgressNoteReqModel) async { + Future getPatientProgressNote(GetProgressNoteReqModel getGetProgressNoteReqModel) async { setState(ViewState.Busy); await _SOAPService.getPatientProgressNote(getGetProgressNoteReqModel); if (_SOAPService.hasError) { @@ -324,7 +291,6 @@ class SOAPViewModel extends BaseViewModel { setState(ViewState.Idle); } - Future getMedicationList() async { setState(ViewState.Busy); await _prescriptionService.getMedicationList(); @@ -337,11 +303,7 @@ class SOAPViewModel extends BaseViewModel { Future getEpisodeForInpatient(PatiantInformtion patient) async { setState(ViewState.BusyLocal); - GetEpisodeForInpatientReqModel getEpisodeForInpatientReqModel = - GetEpisodeForInpatientReqModel( - patientID: patient.patientId, - admissionNo: int.parse(patient.admissionNo), - patientTypeID: 1); + GetEpisodeForInpatientReqModel getEpisodeForInpatientReqModel = GetEpisodeForInpatientReqModel(patientID: patient.patientId, admissionNo: int.parse(patient.admissionNo), patientTypeID: 1); await _SOAPService.getEpisodeForInpatient(getEpisodeForInpatientReqModel); if (_SOAPService.hasError) { error = _SOAPService.error; @@ -353,13 +315,11 @@ class SOAPViewModel extends BaseViewModel { } // ignore: missing_return - MasterKeyModel getOneMasterKey( - {@required MasterKeysService masterKeys, dynamic id, int typeId}) { + MasterKeyModel getOneMasterKey({@required MasterKeysService masterKeys, dynamic id, int typeId}) { switch (masterKeys) { case MasterKeysService.Allergies: List result = allergiesList.where((element) { - return element.id == id && - element.typeId == masterKeys.getMasterKeyService(); + return element.id == id && element.typeId == masterKeys.getMasterKeyService(); }).toList(); if (result.isNotEmpty) { return result.first; @@ -368,8 +328,7 @@ class SOAPViewModel extends BaseViewModel { case MasterKeysService.HistoryFamily: List result = historyFamilyList.where((element) { - return element.id == id && - element.typeId == masterKeys.getMasterKeyService(); + return element.id == id && element.typeId == masterKeys.getMasterKeyService(); }).toList(); if (result.isNotEmpty) { return result.first; @@ -377,8 +336,7 @@ class SOAPViewModel extends BaseViewModel { break; case MasterKeysService.HistoryMedical: List result = historyMedicalList.where((element) { - return element.id == id && - element.typeId == masterKeys.getMasterKeyService(); + return element.id == id && element.typeId == masterKeys.getMasterKeyService(); }).toList(); if (result.isNotEmpty) { return result.first; @@ -386,8 +344,7 @@ class SOAPViewModel extends BaseViewModel { break; case MasterKeysService.HistorySocial: List result = historySocialList.where((element) { - return element.id == id && - element.typeId == masterKeys.getMasterKeyService(); + return element.id == id && element.typeId == masterKeys.getMasterKeyService(); }).toList(); if (result.isNotEmpty) { return result.first; @@ -395,8 +352,7 @@ class SOAPViewModel extends BaseViewModel { break; case MasterKeysService.HistorySports: List result = historySocialList.where((element) { - return element.id == id && - element.typeId == masterKeys.getMasterKeyService(); + return element.id == id && element.typeId == masterKeys.getMasterKeyService(); }).toList(); if (result.isNotEmpty) { return result.first; @@ -412,8 +368,7 @@ class SOAPViewModel extends BaseViewModel { break; case MasterKeysService.PhysicalExamination: List result = physicalExaminationList.where((element) { - return element.id == id && - element.typeId == masterKeys.getMasterKeyService(); + return element.id == id && element.typeId == masterKeys.getMasterKeyService(); }).toList(); if (result.isNotEmpty) { return result.first; @@ -421,8 +376,7 @@ class SOAPViewModel extends BaseViewModel { break; case MasterKeysService.AllergySeverity: List result = allergySeverityList.where((element) { - return element.id == id && - element.typeId == masterKeys.getMasterKeyService(); + return element.id == id && element.typeId == masterKeys.getMasterKeyService(); }).toList(); if (result.isNotEmpty) { return result.first; @@ -430,8 +384,7 @@ class SOAPViewModel extends BaseViewModel { break; case MasterKeysService.DiagnosisType: List result = listOfDiagnosisType.where((element) { - return element.id == id && - element.typeId == masterKeys.getMasterKeyService(); + return element.id == id && element.typeId == masterKeys.getMasterKeyService(); }).toList(); if (result.isNotEmpty) { return result.first; @@ -439,8 +392,7 @@ class SOAPViewModel extends BaseViewModel { break; case MasterKeysService.DiagnosisCondition: List result = listOfDiagnosisCondition.where((element) { - return element.id == id && - element.typeId == masterKeys.getMasterKeyService(); + return element.id == id && element.typeId == masterKeys.getMasterKeyService(); }).toList(); if (result.isNotEmpty) { return result.first; @@ -458,10 +410,8 @@ class SOAPViewModel extends BaseViewModel { } } - int getFirstIndexForOldExamination( - List mySelectedExamination) { - Iterable examList = - mySelectedExamination.where((element) => !element.isLocal); + int getFirstIndexForOldExamination(List mySelectedExamination) { + Iterable examList = mySelectedExamination.where((element) => !element.isLocal); if (examList.length > 0) { return mySelectedExamination.indexOf(examList.first); @@ -470,44 +420,25 @@ class SOAPViewModel extends BaseViewModel { } onUpdateSubjectStepStart(PatiantInformtion patientInfo) async { - GetChiefComplaintReqModel getChiefComplaintReqModel = - GetChiefComplaintReqModel( - admissionNo: - patientInfo - .admissionNo != - null - ? int.parse(patientInfo.admissionNo) - : null, - patientMRN: patientInfo.patientMRN, - appointmentNo: patientInfo.appointmentNo != null - ? int.parse(patientInfo.appointmentNo.toString()) - : null, - episodeId: patientInfo.episodeNo, - episodeID: patientInfo.episodeNo, - doctorID: ''); - var services = [ - _SOAPService.getPatientChiefComplaint(getChiefComplaintReqModel) - ]; + GetChiefComplaintReqModel getChiefComplaintReqModel = GetChiefComplaintReqModel( + admissionNo: patientInfo.admissionNo != null ? int.parse(patientInfo.admissionNo) : null, + patientMRN: patientInfo.patientMRN, + appointmentNo: patientInfo.appointmentNo != null ? int.parse(patientInfo.appointmentNo.toString()) : null, + episodeId: patientInfo.episodeNo, + episodeID: patientInfo.episodeNo, + doctorID: ''); + var services = [_SOAPService.getPatientChiefComplaint(getChiefComplaintReqModel)]; if (patientInfo.admissionNo == null) { complaintsControllerError = ''; medicationControllerError = ''; illnessControllerError = ''; GetHistoryReqModel getHistoryReqModel = GetHistoryReqModel( - patientMRN: patientInfo.patientMRN, - episodeID: patientInfo.episodeNo.toString(), - appointmentNo: int.parse(patientInfo.appointmentNo.toString()), - doctorID: '', - editedBy: ''); - services.add( - _SOAPService.getPatientHistories(getHistoryReqModel, isFirst: true)); - - GeneralGetReqForSOAP generalGetReqForSOAP = GeneralGetReqForSOAP( - patientMRN: patientInfo.patientMRN, - episodeId: patientInfo.episodeNo, - appointmentNo: int.parse(patientInfo.appointmentNo.toString()), - doctorID: '', - editedBy: ''); + patientMRN: patientInfo.patientMRN, episodeID: patientInfo.episodeNo.toString(), appointmentNo: int.parse(patientInfo.appointmentNo.toString()), doctorID: '', editedBy: ''); + services.add(_SOAPService.getPatientHistories(getHistoryReqModel, isFirst: true)); + + GeneralGetReqForSOAP generalGetReqForSOAP = + GeneralGetReqForSOAP(patientMRN: patientInfo.patientMRN, episodeId: patientInfo.episodeNo, appointmentNo: int.parse(patientInfo.appointmentNo.toString()), doctorID: '', editedBy: ''); services.add(_SOAPService.getPatientAllergy(generalGetReqForSOAP)); } @@ -521,40 +452,28 @@ class SOAPViewModel extends BaseViewModel { if (patientHistoryList.isNotEmpty) { if (historyFamilyList.isEmpty) { if (services == null) { - services = [ - _SOAPService.getMasterLookup(MasterKeysService.HistoryFamily) - ]; + services = [_SOAPService.getMasterLookup(MasterKeysService.HistoryFamily)]; } else { - services.add( - _SOAPService.getMasterLookup(MasterKeysService.HistoryFamily)); + services.add(_SOAPService.getMasterLookup(MasterKeysService.HistoryFamily)); } } if (historyMedicalList.isEmpty) { if (services == null) { - services = [ - _SOAPService.getMasterLookup(MasterKeysService.HistoryMedical) - ]; + services = [_SOAPService.getMasterLookup(MasterKeysService.HistoryMedical)]; } else - services.add( - _SOAPService.getMasterLookup(MasterKeysService.HistoryMedical)); + services.add(_SOAPService.getMasterLookup(MasterKeysService.HistoryMedical)); } if (historySurgicalList.length == 0) { if (services == null) { - services = [ - _SOAPService.getMasterLookup(MasterKeysService.HistorySurgical) - ]; + services = [_SOAPService.getMasterLookup(MasterKeysService.HistorySurgical)]; } else - services.add( - _SOAPService.getMasterLookup(MasterKeysService.HistorySurgical)); + services.add(_SOAPService.getMasterLookup(MasterKeysService.HistorySurgical)); } if (historySportList.length == 0) { if (services == null) { - services = [ - _SOAPService.getMasterLookup(MasterKeysService.HistorySports) - ]; + services = [_SOAPService.getMasterLookup(MasterKeysService.HistorySports)]; } else - services.add( - _SOAPService.getMasterLookup(MasterKeysService.HistorySports)); + services.add(_SOAPService.getMasterLookup(MasterKeysService.HistorySports)); } } @@ -565,12 +484,9 @@ class SOAPViewModel extends BaseViewModel { services.add(_SOAPService.getMasterLookup(MasterKeysService.Allergies)); if (allergySeverityList.isEmpty) { if (services == null) { - services = [ - _SOAPService.getMasterLookup(MasterKeysService.AllergySeverity) - ]; + services = [_SOAPService.getMasterLookup(MasterKeysService.AllergySeverity)]; } else - services.add( - _SOAPService.getMasterLookup(MasterKeysService.AllergySeverity)); + services.add(_SOAPService.getMasterLookup(MasterKeysService.AllergySeverity)); } } @@ -588,42 +504,30 @@ class SOAPViewModel extends BaseViewModel { var services; if (medicationStrengthList.length == 0) { if (services == null) { - services = [ - _SOAPService.getMasterLookup(MasterKeysService.MedicationStrength) - ]; + services = [_SOAPService.getMasterLookup(MasterKeysService.MedicationStrength)]; } else { - services.add( - _SOAPService.getMasterLookup(MasterKeysService.MedicationStrength)); + services.add(_SOAPService.getMasterLookup(MasterKeysService.MedicationStrength)); } } if (medicationFrequencyList.length == 0) { if (services == null) { - services = [ - _SOAPService.getMasterLookup(MasterKeysService.MedicationFrequency) - ]; + services = [_SOAPService.getMasterLookup(MasterKeysService.MedicationFrequency)]; } else { - services.add(_SOAPService.getMasterLookup( - MasterKeysService.MedicationFrequency)); + services.add(_SOAPService.getMasterLookup(MasterKeysService.MedicationFrequency)); } } if (medicationDoseTimeList.length == 0) { if (services == null) { - services = [ - _SOAPService.getMasterLookup(MasterKeysService.MedicationDoseTime) - ]; + services = [_SOAPService.getMasterLookup(MasterKeysService.MedicationDoseTime)]; } else { - services.add( - _SOAPService.getMasterLookup(MasterKeysService.MedicationDoseTime)); + services.add(_SOAPService.getMasterLookup(MasterKeysService.MedicationDoseTime)); } } if (medicationRouteList.length == 0) { if (services == null) { - services = [ - _SOAPService.getMasterLookup(MasterKeysService.MedicationRoute) - ]; + services = [_SOAPService.getMasterLookup(MasterKeysService.MedicationRoute)]; } else { - services.add( - _SOAPService.getMasterLookup(MasterKeysService.MedicationRoute)); + services.add(_SOAPService.getMasterLookup(MasterKeysService.MedicationRoute)); } } if (allMedicationList.length == 0) { @@ -643,34 +547,28 @@ class SOAPViewModel extends BaseViewModel { setState(ViewState.Idle); } - callAddAssessmentLookupsServices({bool allowSetState = true}) async { + callAddAssessmentLookupsServices({String searchKey = "", bool allowSetState = true}) async { if (allowSetState) setState(ViewState.Busy); var services; if (listOfDiagnosisCondition.length == 0) { if (services == null) { - services = [ - _SOAPService.getMasterLookup(MasterKeysService.DiagnosisCondition) - ]; + services = [_SOAPService.getMasterLookup(MasterKeysService.DiagnosisCondition)]; } else { - services.add( - _SOAPService.getMasterLookup(MasterKeysService.DiagnosisCondition)); + services.add(_SOAPService.getMasterLookup(MasterKeysService.DiagnosisCondition)); } } if (listOfDiagnosisType.length == 0) { if (services == null) { - services = [ - _SOAPService.getMasterLookup(MasterKeysService.DiagnosisType) - ]; + services = [_SOAPService.getMasterLookup(MasterKeysService.DiagnosisType)]; } else { - services - .add(_SOAPService.getMasterLookup(MasterKeysService.DiagnosisType)); + services.add(_SOAPService.getMasterLookup(MasterKeysService.DiagnosisType)); } } if (listOfICD10.length == 0) { if (services == null) { - services = [_SOAPService.getMasterLookup(MasterKeysService.ICD10)]; + services = [_SOAPService.getMasterLookup(MasterKeysService.ICD10, searchKey: searchKey)]; } else { - services.add(_SOAPService.getMasterLookup(MasterKeysService.ICD10)); + services.add(_SOAPService.getMasterLookup(MasterKeysService.ICD10, searchKey: searchKey)); } } @@ -686,11 +584,7 @@ class SOAPViewModel extends BaseViewModel { onUpdateAssessmentStepStart(PatiantInformtion patientInfo) async { GetAssessmentReqModel getAssessmentReqModel = GetAssessmentReqModel( - patientMRN: patientInfo.patientMRN, - episodeID: patientInfo.episodeNo.toString(), - editedBy: '', - doctorID: '', - appointmentNo: int.parse(patientInfo.appointmentNo.toString())); + patientMRN: patientInfo.patientMRN, episodeID: patientInfo.episodeNo.toString(), editedBy: '', doctorID: '', appointmentNo: int.parse(patientInfo.appointmentNo.toString())); var services = [_SOAPService.getPatientAssessment(getAssessmentReqModel)]; @@ -707,37 +601,21 @@ class SOAPViewModel extends BaseViewModel { setState(ViewState.Idle); } - postSubjectServices( - {patientInfo, - String complaintsText, - String medicationText, - String illnessText, - List myHistoryList, - List myAllergiesList}) async { + postSubjectServices({patientInfo, String complaintsText, String medicationText, String illnessText, List myHistoryList, List myAllergiesList}) async { var services; PostChiefComplaintRequestModel postChiefComplaintRequestModel = - createPostChiefComplaintRequestModel( - patientInfo: patientInfo, - illnessText: illnessText, - medicationText: medicationText, - complaintsText: complaintsText); + createPostChiefComplaintRequestModel(patientInfo: patientInfo, illnessText: illnessText, medicationText: medicationText, complaintsText: complaintsText); if (patientChiefComplaintList.isEmpty) { postChiefComplaintRequestModel.editedBy = ''; - services = [ - _SOAPService.postChiefComplaint(postChiefComplaintRequestModel) - ]; + services = [_SOAPService.postChiefComplaint(postChiefComplaintRequestModel)]; } else { postChiefComplaintRequestModel.editedBy = ''; - services = [ - _SOAPService.patchChiefComplaint(postChiefComplaintRequestModel) - ]; + services = [_SOAPService.patchChiefComplaint(postChiefComplaintRequestModel)]; } if (myHistoryList.length != 0) { - PostHistoriesRequestModel postHistoriesRequestModel = - createPostHistoriesRequestModel( - patientInfo: patientInfo, myHistoryList: myHistoryList); + PostHistoriesRequestModel postHistoriesRequestModel = createPostHistoriesRequestModel(patientInfo: patientInfo, myHistoryList: myHistoryList); if (patientHistoryList.isEmpty) { services.add(_SOAPService.postHistories(postHistoriesRequestModel)); @@ -747,9 +625,7 @@ class SOAPViewModel extends BaseViewModel { } if (myAllergiesList.length != 0) { - PostAllergyRequestModel postAllergyRequestModel = - createPostAllergyRequestModel( - myAllergiesList: myAllergiesList, patientInfo: patientInfo); + PostAllergyRequestModel postAllergyRequestModel = createPostAllergyRequestModel(myAllergiesList: myAllergiesList, patientInfo: patientInfo); if (patientAllergiesList.isEmpty) { services.add(_SOAPService.postAllergy(postAllergyRequestModel)); } else { @@ -766,15 +642,9 @@ class SOAPViewModel extends BaseViewModel { setState(ViewState.Idle); } - PostChiefComplaintRequestModel createPostChiefComplaintRequestModel( - {patientInfo, - String complaintsText, - String medicationText, - String illnessText}) { + PostChiefComplaintRequestModel createPostChiefComplaintRequestModel({patientInfo, String complaintsText, String medicationText, String illnessText}) { return new PostChiefComplaintRequestModel( - admissionNo: patientInfo.admissionNo != null - ? int.parse(patientInfo.admissionNo) - : null, + admissionNo: patientInfo.admissionNo != null ? int.parse(patientInfo.admissionNo) : null, patientMRN: patientInfo.patientMRN, episodeID: patientInfo.episodeNo ?? 0, appointmentNo: patientInfo.appointmentNo ?? 0, @@ -787,13 +657,10 @@ class SOAPViewModel extends BaseViewModel { numberOfWeeks: 0); } - PostHistoriesRequestModel createPostHistoriesRequestModel( - {patientInfo, List myHistoryList}) { - PostHistoriesRequestModel postHistoriesRequestModel = - new PostHistoriesRequestModel(doctorID: ''); + PostHistoriesRequestModel createPostHistoriesRequestModel({patientInfo, List myHistoryList}) { + PostHistoriesRequestModel postHistoriesRequestModel = new PostHistoriesRequestModel(doctorID: ''); myHistoryList.forEach((history) { - if (postHistoriesRequestModel.listMedicalHistoryVM == null) - postHistoriesRequestModel.listMedicalHistoryVM = []; + if (postHistoriesRequestModel.listMedicalHistoryVM == null) postHistoriesRequestModel.listMedicalHistoryVM = []; postHistoriesRequestModel.listMedicalHistoryVM.add(ListMedicalHistoryVM( patientMRN: patientInfo.patientMRN, episodeId: patientInfo.episodeNo, @@ -808,29 +675,24 @@ class SOAPViewModel extends BaseViewModel { return postHistoriesRequestModel; } - PostAllergyRequestModel createPostAllergyRequestModel( - {myAllergiesList, patientInfo}) { - PostAllergyRequestModel postAllergyRequestModel = - new PostAllergyRequestModel(); + PostAllergyRequestModel createPostAllergyRequestModel({myAllergiesList, patientInfo}) { + PostAllergyRequestModel postAllergyRequestModel = new PostAllergyRequestModel(); myAllergiesList.forEach((allergy) { - if (postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM == - null) - postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM = []; - postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM.add( - ListHisProgNotePatientAllergyDiseaseVM( - allergyDiseaseId: allergy.selectedAllergy.id, - allergyDiseaseType: allergy.selectedAllergy.typeId, - patientMRN: patientInfo.patientMRN, - episodeId: patientInfo.episodeNo, - appointmentNo: patientInfo.appointmentNo, - severity: allergy.selectedAllergySeverity.id, - remarks: allergy.remark, - createdBy: allergy.createdBy ?? doctorProfile.doctorID, - createdOn: DateTime.now().toIso8601String(), - editedBy: doctorProfile.doctorID, - editedOn: DateTime.now().toIso8601String(), - isChecked: allergy.isChecked, - isUpdatedByNurse: false)); + if (postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM == null) postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM = []; + postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM.add(ListHisProgNotePatientAllergyDiseaseVM( + allergyDiseaseId: allergy.selectedAllergy.id, + allergyDiseaseType: allergy.selectedAllergy.typeId, + patientMRN: patientInfo.patientMRN, + episodeId: patientInfo.episodeNo, + appointmentNo: patientInfo.appointmentNo, + severity: allergy.selectedAllergySeverity.id, + remarks: allergy.remark, + createdBy: allergy.createdBy ?? doctorProfile.doctorID, + createdOn: DateTime.now().toIso8601String(), + editedBy: doctorProfile.doctorID, + editedOn: DateTime.now().toIso8601String(), + isChecked: allergy.isChecked, + isUpdatedByNurse: false)); }); return postAllergyRequestModel; diff --git a/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart b/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart index c4a2ad61..a18a93a2 100644 --- a/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart +++ b/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart @@ -266,7 +266,7 @@ class _PatientProfileScreenState extends State with Single if (patient.episodeNo != 0) AppButton( loading: model.state == ViewState.BusyLocal, - disabled: model.state == ViewState.BusyLocal || isSigned, + // disabled: model.state == ViewState.BusyLocal || isSigned, title: "${TranslationBase.of(context).update}\n${TranslationBase.of(context).episode}", color: ((isInpatient) || isFromLiveCare) && model.state != ViewState.BusyLocal ? AppGlobal.appRedColor diff --git a/lib/screens/patients/profile/soap_update/assessment/add_assessment_details.dart b/lib/screens/patients/profile/soap_update/assessment/add_assessment_details.dart index 6f564f03..c4d3c778 100644 --- a/lib/screens/patients/profile/soap_update/assessment/add_assessment_details.dart +++ b/lib/screens/patients/profile/soap_update/assessment/add_assessment_details.dart @@ -12,6 +12,7 @@ import 'package:doctor_app_flutter/core/model/doctor/doctor_profile_model.dart'; import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.dart'; +import 'package:doctor_app_flutter/utils/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/utils/utils.dart'; import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; import 'package:doctor_app_flutter/widgets/bottom_sheet/custom_bottom_sheet_container.dart'; @@ -28,18 +29,11 @@ import 'package:provider/provider.dart'; class AddAssessmentDetails extends StatefulWidget { final MySelectedAssessment mySelectedAssessment; final List mySelectedAssessmentList; - final Function(MySelectedAssessment mySelectedAssessment, bool isUpdate) - addSelectedAssessment; + final Function(MySelectedAssessment mySelectedAssessment, bool isUpdate) addSelectedAssessment; final PatiantInformtion patientInfo; final bool isUpdate; - AddAssessmentDetails( - {Key key, - this.mySelectedAssessment, - this.addSelectedAssessment, - this.patientInfo, - this.isUpdate = false, - this.mySelectedAssessmentList}); + AddAssessmentDetails({Key key, this.mySelectedAssessment, this.addSelectedAssessment, this.patientInfo, this.isUpdate = false, this.mySelectedAssessmentList}); @override _AddAssessmentDetailsState createState() => _AddAssessmentDetailsState(); @@ -60,48 +54,28 @@ class _AddAssessmentDetailsState extends State { ProjectViewModel projectViewModel = Provider.of(context); remarkController.text = widget.mySelectedAssessment.remark ?? ""; - appointmentIdController.text = - widget.mySelectedAssessment.appointmentId.toString(); + appointmentIdController.text = widget.mySelectedAssessment.appointmentId.toString(); if (widget.isUpdate) { if (widget.mySelectedAssessment.selectedDiagnosisCondition != null) - conditionController.text = projectViewModel.isArabic - ? widget.mySelectedAssessment.selectedDiagnosisCondition.nameAr - : widget.mySelectedAssessment.selectedDiagnosisCondition.nameEn; + conditionController.text = projectViewModel.isArabic ? widget.mySelectedAssessment.selectedDiagnosisCondition.nameAr : widget.mySelectedAssessment.selectedDiagnosisCondition.nameEn; if (widget.mySelectedAssessment.selectedDiagnosisType != null) - typeController.text = projectViewModel.isArabic - ? widget.mySelectedAssessment.selectedDiagnosisType.nameAr - : widget.mySelectedAssessment.selectedDiagnosisType.nameEn; - if (widget.mySelectedAssessment.selectedICD != null) - icdNameController.text = widget.mySelectedAssessment.selectedICD.code; + typeController.text = projectViewModel.isArabic ? widget.mySelectedAssessment.selectedDiagnosisType.nameAr : widget.mySelectedAssessment.selectedDiagnosisType.nameEn; + if (widget.mySelectedAssessment.selectedICD != null) icdNameController.text = widget.mySelectedAssessment.selectedICD.code; } - InputDecoration textFieldSelectorDecoration( - String hintText, String selectedText, bool isDropDown, - {IconData icon, String validationError}) { + InputDecoration textFieldSelectorDecoration(String hintText, String selectedText, bool isDropDown, {IconData icon, String validationError}) { return new InputDecoration( fillColor: Colors.white, contentPadding: EdgeInsets.symmetric(vertical: 15, horizontal: 10), focusedBorder: OutlineInputBorder( - borderSide: BorderSide( - color: (validationError != null - ? Colors.red.shade700 - : Color(0xFFEFEFEF)), - width: 2.5), + borderSide: BorderSide(color: (validationError != null ? Colors.red.shade700 : Color(0xFFEFEFEF)), width: 2.5), borderRadius: BorderRadius.circular(8), ), enabledBorder: OutlineInputBorder( - borderSide: BorderSide( - color: (validationError != null - ? Colors.red.shade700 - : Color(0xFFEFEFEF)), - width: 2.5), + borderSide: BorderSide(color: (validationError != null ? Colors.red.shade700 : Color(0xFFEFEFEF)), width: 2.5), borderRadius: BorderRadius.circular(8), ), disabledBorder: OutlineInputBorder( - borderSide: BorderSide( - color: (validationError != null - ? Colors.red.shade700 - : Color(0xFFEFEFEF)), - width: 2.5), + borderSide: BorderSide(color: (validationError != null ? Colors.red.shade700 : Color(0xFFEFEFEF)), width: 2.5), borderRadius: BorderRadius.circular(8), ), hintText: selectedText != null ? selectedText : hintText, @@ -118,13 +92,12 @@ class _AddAssessmentDetailsState extends State { heightFactor: 1, child: BaseView( onModelReady: (model) async { - model.callAddAssessmentLookupsServices(); + // model.callAddAssessmentLookupsServices(); }, builder: (_, model, w) => AppScaffold( baseViewModel: model, isShowAppBar: true, - appBar: BottomSheetTitle( - title: TranslationBase.of(context).addAssessmentDetails), + appBar: BottomSheetTitle(title: TranslationBase.of(context).addAssessmentDetails), backgroundColor: Theme.of(context).scaffoldBackgroundColor, body: SingleChildScrollView( child: Center( @@ -133,263 +106,229 @@ class _AddAssessmentDetailsState extends State { FractionallySizedBox( widthFactor: 0.9, child: Container( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - SizedBox( - height: 16, - ), - Container( - margin: EdgeInsets.only(left: 0, right: 0, top: 15), - child: AppTextFieldCustom( - // height: 55.0, - height: Utils.getTextFieldHeight(), - - hintText: - TranslationBase.of(context).appointmentNumber, - isTextFieldHasSuffix: false, - enabled: false, - controller: appointmentIdController, - ), - ), - SizedBox( - height: 10, - ), - Container( - child: InkWell( - onTap: model.listOfICD10 != null - ? () { - setState(() { - widget.mySelectedAssessment - .selectedICD = null; - icdNameController.text = null; - }); - } - : null, - child: widget - .mySelectedAssessment.selectedICD == - null - ? CustomAutoCompleteTextField( - isShowError: isFormSubmitted && - widget.mySelectedAssessment - .selectedICD == - null, - child: AutoCompleteTextField< - MasterKeyModel>( - decoration: TextFieldsUtils - .textFieldSelectorDecoration( - TranslationBase.of(context) - .nameOrICD, - null, - true, - suffixIcon: Icons.search), - itemSubmitted: (item) => setState(() { - widget.mySelectedAssessment - .selectedICD = item; - icdNameController.text = - '${item.code.trim()}/${item.description}'; - }), - key: key, - suggestions: model.listOfICD10, - itemBuilder: (context, suggestion) => - new Padding( - child: AppText( - suggestion.description + - " / " + - suggestion.code - .toString()), - padding: EdgeInsets.all(8.0)), - itemSorter: (a, b) => 1, - itemFilter: (suggestion, input) => - suggestion.description - .toLowerCase() - .startsWith( - input.toLowerCase()) || - suggestion.description - .toLowerCase() - .startsWith( - input.toLowerCase()) || - suggestion.code - .toLowerCase() - .startsWith( - input.toLowerCase()), + child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ + SizedBox( + height: 16, + ), + Container( + margin: EdgeInsets.only(left: 0, right: 0, top: 15), + child: AppTextFieldCustom( + // height: 55.0, + height: Utils.getTextFieldHeight(), + hintText: TranslationBase.of(context).appointmentNumber, + isTextFieldHasSuffix: false, + enabled: false, + controller: appointmentIdController, + ), + ), + SizedBox( + height: 10, + ), + Container( + child: InkWell( + onTap: model.listOfICD10 != null + ? () { + setState(() { + widget.mySelectedAssessment.selectedICD = null; + icdNameController.text = null; + }); + } + : null, + child: widget.mySelectedAssessment.selectedICD == null + ? CustomAutoCompleteTextField( + isShowError: isFormSubmitted && widget.mySelectedAssessment.selectedICD == null, + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + mainAxisSize: MainAxisSize.min, + children: [ + Expanded( + flex: 4, + child: AutoCompleteTextField( + decoration: TextFieldsUtils.textFieldSelectorDecoration(TranslationBase.of(context).nameOrICD, null, true, suffixIcon: null), + controller: icdNameController, + itemSubmitted: (item) => setState(() { + widget.mySelectedAssessment.selectedICD = item; + icdNameController.text = '${item.code.trim()}/${item.description}'; + }), + key: key, + suggestions: model.listOfICD10, + itemBuilder: (context, suggestion) => + new Padding(child: AppText(suggestion.description + " / " + suggestion.code.toString()), padding: EdgeInsets.all(8.0)), + itemSorter: (a, b) => 1, + itemFilter: (suggestion, input) => + // suggestion.description.toLowerCase().startsWith(input.toLowerCase()) || + // suggestion.description.toLowerCase().startsWith(input.toLowerCase()) || + // suggestion.code.toLowerCase().startsWith(input.toLowerCase()), + suggestion.description.toLowerCase().contains(input.toLowerCase()) || + // suggestion.description.toLowerCase().startsWith(input.toLowerCase()) || + suggestion.code.toLowerCase().contains(input.toLowerCase()), + ), ), - ) - : AppTextFieldCustom( - height: Utils.getTextFieldHeight(), - onClick: model.listOfICD10 != null - ? () { - setState(() { - widget.mySelectedAssessment - .selectedICD = null; - icdNameController.text = null; - }); + Expanded( + child: IconButton( + onPressed: () { + print(icdNameController.text); + if (icdNameController.text.length <= 3) { + DrAppToastMsg.showErrorToast("Please enter 4 or more characters"); + } else { + model.listOfICD10.clear(); + model.callAddAssessmentLookupsServices(searchKey: icdNameController.text); } - : null, - hintText: TranslationBase.of(context) - .nameOrICD, - maxLines: 1, - minLines: 1, - controller: icdNameController, - enabled: true, - isTextFieldHasSuffix: true, - suffixIcon: IconButton( - icon: Icon( + }, + icon: Icon(Icons.search), + ), + ), + ], + ), + ) + : AppTextFieldCustom( + height: Utils.getTextFieldHeight(), + onClick: model.listOfICD10 != null + ? () { + setState(() { + widget.mySelectedAssessment.selectedICD = null; + icdNameController.text = null; + }); + } + : null, + hintText: TranslationBase.of(context).nameOrICD, + maxLines: 1, + minLines: 1, + controller: icdNameController, + enabled: true, + isTextFieldHasSuffix: true, + suffixIcon: IconButton( + onPressed: () { + print(icdNameController.text); + if (icdNameController.text.length <= 3) { + DrAppToastMsg.showErrorToast("Please enter 4 or more characters"); + } else { + model.listOfICD10.clear(); + model.callAddAssessmentLookupsServices(searchKey: icdNameController.text); + } + }, + icon: Icon( Icons.search, color: Colors.grey.shade600, )), - )), - ), - if (widget.mySelectedAssessment.selectedICD != null) - Column( - children: [ - SizedBox( - height: 3, - ), - Container( - width: - MediaQuery.of(context).size.width * 0.7, - child: AppText( - widget.mySelectedAssessment.selectedICD - .description + - (' (${widget.mySelectedAssessment.selectedICD.code} )'), - color: Color(0xFF575757), - fontSize: 10, - fontWeight: FontWeight.w700, - letterSpacing: -0.4, - ), - ), - ], + )), + ), + if (widget.mySelectedAssessment.selectedICD != null) + Column( + children: [ + SizedBox( + height: 3, ), - SizedBox( - height: 7, - ), - AppTextFieldCustom( - height: Utils.getTextFieldHeight(), - onClick: model.listOfDiagnosisCondition != null - ? () { - MasterKeyDailog dialog = MasterKeyDailog( - list: model.listOfDiagnosisCondition, - okText: TranslationBase.of(context).ok, - selectedValue: widget.mySelectedAssessment - .selectedDiagnosisCondition, - okFunction: - (MasterKeyModel selectedValue) { - setState(() { - widget.mySelectedAssessment - .selectedDiagnosisCondition = - selectedValue; - conditionController - .text = projectViewModel - .isArabic - ? widget - .mySelectedAssessment - .selectedDiagnosisCondition - .nameAr - : widget - .mySelectedAssessment - .selectedDiagnosisCondition - .nameEn; - }); - }, - ); - showDialog( - barrierDismissible: false, - context: context, - builder: (BuildContext context) { - return dialog; - }, - ); - } - : null, - hintText: TranslationBase.of(context).condition, - maxLines: 1, - minLines: 1, - controller: conditionController, - isTextFieldHasSuffix: true, - enabled: false, - hasBorder: true, - validationError: isFormSubmitted && - widget.mySelectedAssessment - .selectedDiagnosisCondition == - null - ? TranslationBase.of(context).emptyMessage - : null, - ), - SizedBox( - height: 10, - ), - AppTextFieldCustom( - height: Utils.getTextFieldHeight(), - onClick: model.listOfDiagnosisType != null - ? () { - MasterKeyDailog dialog = MasterKeyDailog( - list: model.listOfDiagnosisType, - okText: TranslationBase.of(context).ok, - selectedValue: widget.mySelectedAssessment - .selectedDiagnosisType, - okFunction: - (MasterKeyModel selectedValue) { - setState(() { - widget.mySelectedAssessment - .selectedDiagnosisType = - selectedValue; - typeController.text = - projectViewModel.isArabic - ? selectedValue.nameAr - : selectedValue.nameEn; - }); - }, - ); - showDialog( - barrierDismissible: false, - context: context, - builder: (BuildContext context) { - return dialog; - }, - ); - } - : null, - hintText: TranslationBase.of(context).dType, - maxLines: 1, - minLines: 1, - enabled: false, - isTextFieldHasSuffix: true, - controller: typeController, - hasBorder: true, - validationError: isFormSubmitted && - widget.mySelectedAssessment - .selectedDiagnosisType == - null - ? TranslationBase.of(context).emptyMessage - : null, - ), - SizedBox( - height: 10, - ), - Container( - margin: EdgeInsets.only(left: 0, right: 0, top: 15), - child: AppTextFieldCustom( - hintText: TranslationBase.of(context).remarks, - maxLines: 18, - minLines: 5, - inputType: TextInputType.multiline, - controller: remarkController, - onChanged: (value) { - widget.mySelectedAssessment.remark = - remarkController.text; - }, + Container( + width: MediaQuery.of(context).size.width * 0.7, + child: AppText( + widget.mySelectedAssessment.selectedICD.description + (' (${widget.mySelectedAssessment.selectedICD.code} )'), + color: Color(0xFF575757), + fontSize: 10, + fontWeight: FontWeight.w700, + letterSpacing: -0.4, + ), ), - ), - SizedBox( - height: SizeConfig.heightMultiplier * - (SizeConfig.isHeightVeryShort - ? 20 - : SizeConfig.isHeightShort - ? 15 - : 10), - ), - ])), + ], + ), + SizedBox( + height: 7, + ), + AppTextFieldCustom( + height: Utils.getTextFieldHeight(), + onClick: model.listOfDiagnosisCondition != null + ? () { + MasterKeyDailog dialog = MasterKeyDailog( + list: model.listOfDiagnosisCondition, + okText: TranslationBase.of(context).ok, + selectedValue: widget.mySelectedAssessment.selectedDiagnosisCondition, + okFunction: (MasterKeyModel selectedValue) { + setState(() { + widget.mySelectedAssessment.selectedDiagnosisCondition = selectedValue; + conditionController.text = + projectViewModel.isArabic ? widget.mySelectedAssessment.selectedDiagnosisCondition.nameAr : widget.mySelectedAssessment.selectedDiagnosisCondition.nameEn; + }); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: (BuildContext context) { + return dialog; + }, + ); + } + : null, + hintText: TranslationBase.of(context).condition, + maxLines: 1, + minLines: 1, + controller: conditionController, + isTextFieldHasSuffix: true, + enabled: false, + hasBorder: true, + validationError: isFormSubmitted && widget.mySelectedAssessment.selectedDiagnosisCondition == null ? TranslationBase.of(context).emptyMessage : null, + ), + SizedBox( + height: 10, + ), + AppTextFieldCustom( + height: Utils.getTextFieldHeight(), + onClick: model.listOfDiagnosisType != null + ? () { + MasterKeyDailog dialog = MasterKeyDailog( + list: model.listOfDiagnosisType, + okText: TranslationBase.of(context).ok, + selectedValue: widget.mySelectedAssessment.selectedDiagnosisType, + okFunction: (MasterKeyModel selectedValue) { + setState(() { + widget.mySelectedAssessment.selectedDiagnosisType = selectedValue; + typeController.text = projectViewModel.isArabic ? selectedValue.nameAr : selectedValue.nameEn; + }); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: (BuildContext context) { + return dialog; + }, + ); + } + : null, + hintText: TranslationBase.of(context).dType, + maxLines: 1, + minLines: 1, + enabled: false, + isTextFieldHasSuffix: true, + controller: typeController, + hasBorder: true, + validationError: isFormSubmitted && widget.mySelectedAssessment.selectedDiagnosisType == null ? TranslationBase.of(context).emptyMessage : null, + ), + SizedBox( + height: 10, + ), + Container( + margin: EdgeInsets.only(left: 0, right: 0, top: 15), + child: AppTextFieldCustom( + hintText: TranslationBase.of(context).remarks, + maxLines: 18, + minLines: 5, + inputType: TextInputType.multiline, + controller: remarkController, + onChanged: (value) { + widget.mySelectedAssessment.remark = remarkController.text; + }, + ), + ), + SizedBox( + height: SizeConfig.heightMultiplier * + (SizeConfig.isHeightVeryShort + ? 20 + : SizeConfig.isHeightShort + ? 15 + : 10), + ), + ])), ), ], ), @@ -400,26 +339,17 @@ class _AddAssessmentDetailsState extends State { height: 0, ) : CustomBottomSheetContainer( - label: (widget.isUpdate - ? 'Update Assessment Details' - : 'Add Assessment Details'), + label: (widget.isUpdate ? 'Update Assessment Details' : 'Add Assessment Details'), onTap: () async { setState(() { isFormSubmitted = true; }); widget.mySelectedAssessment.remark = remarkController.text; - widget.mySelectedAssessment.appointmentId = - int.parse(appointmentIdController.text); - if (widget.mySelectedAssessment - .selectedDiagnosisCondition != - null && - widget.mySelectedAssessment.selectedDiagnosisType != - null && + widget.mySelectedAssessment.appointmentId = int.parse(appointmentIdController.text); + if (widget.mySelectedAssessment.selectedDiagnosisCondition != null && + widget.mySelectedAssessment.selectedDiagnosisType != null && widget.mySelectedAssessment.selectedICD != null) { - await submitAssessment( - isUpdate: widget.isUpdate, - model: model, - mySelectedAssessment: widget.mySelectedAssessment); + await submitAssessment(isUpdate: widget.isUpdate, model: model, mySelectedAssessment: widget.mySelectedAssessment); } }, ), @@ -428,10 +358,7 @@ class _AddAssessmentDetailsState extends State { ); } - submitAssessment( - {SOAPViewModel model, - MySelectedAssessment mySelectedAssessment, - bool isUpdate = false}) async { + submitAssessment({SOAPViewModel model, MySelectedAssessment mySelectedAssessment, bool isUpdate = false}) async { GifLoaderDialogUtils.showMyDialog(context); if (isUpdate) { PatchAssessmentReqModel patchAssessmentReqModel = PatchAssessmentReqModel( @@ -448,18 +375,14 @@ class _AddAssessmentDetailsState extends State { await model.patchAssessment(patchAssessmentReqModel); } else { PostAssessmentRequestModel postAssessmentRequestModel = - new PostAssessmentRequestModel( - patientMRN: widget.patientInfo.patientMRN, - episodeId: widget.patientInfo.episodeNo, - appointmentNo: widget.patientInfo.appointmentNo, - icdCodeDetails: [ - new IcdCodeDetails( - remarks: mySelectedAssessment.remark, - complexDiagnosis: true, - conditionId: mySelectedAssessment.selectedDiagnosisCondition.id, - diagnosisTypeId: mySelectedAssessment.selectedDiagnosisType.id, - icdcode10Id: mySelectedAssessment.selectedICD.code) - ]); + new PostAssessmentRequestModel(patientMRN: widget.patientInfo.patientMRN, episodeId: widget.patientInfo.episodeNo, appointmentNo: widget.patientInfo.appointmentNo, icdCodeDetails: [ + new IcdCodeDetails( + remarks: mySelectedAssessment.remark, + complexDiagnosis: true, + conditionId: mySelectedAssessment.selectedDiagnosisCondition.id, + diagnosisTypeId: mySelectedAssessment.selectedDiagnosisType.id, + icdcode10Id: mySelectedAssessment.selectedICD.code) + ]); await model.postAssessment(postAssessmentRequestModel); } From f0204fcbb04b1d18b48443348f02c1c2f7a5d39c Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Wed, 20 Sep 2023 17:11:53 +0300 Subject: [PATCH 22/28] updates & fixes --- .../vital_sign/patient-vital-sign-data.dart | 2 +- lib/core/viewModel/sick_leave_view_model.dart | 24 +- .../patient_sick_leave_screen.dart | 385 +++++++----------- .../assessment/add_assessment_details.dart | 6 +- .../assessment/update_assessment_page.dart | 304 ++++---------- .../add_drug/drug_to_drug.dart | 78 ++-- .../prescription_form_widget.dart | 84 +--- .../prescription_checkout_screen.dart | 342 ++++------------ 8 files changed, 382 insertions(+), 843 deletions(-) diff --git a/lib/core/model/patient/vital_sign/patient-vital-sign-data.dart b/lib/core/model/patient/vital_sign/patient-vital-sign-data.dart index 7c0448b9..25104d07 100644 --- a/lib/core/model/patient/vital_sign/patient-vital-sign-data.dart +++ b/lib/core/model/patient/vital_sign/patient-vital-sign-data.dart @@ -22,7 +22,7 @@ class VitalSignData { int patientType; int pulseBeatPerMinute; int pulseRhythm; - int respirationBeatPerMinute; + num respirationBeatPerMinute; int respirationPattern; int sao2; int status; diff --git a/lib/core/viewModel/sick_leave_view_model.dart b/lib/core/viewModel/sick_leave_view_model.dart index 768a36d6..c06ff542 100644 --- a/lib/core/viewModel/sick_leave_view_model.dart +++ b/lib/core/viewModel/sick_leave_view_model.dart @@ -14,8 +14,7 @@ class SickLeaveViewModel extends BaseViewModel { SickLeaveService _sickLeaveService = locator(); PatientService _patientService = locator(); - SickLeaveStatisticsModel get sickLeaveStatistics => - _sickLeaveService.sickLeavestatisitics; + SickLeaveStatisticsModel get sickLeaveStatistics => _sickLeaveService.sickLeavestatisitics; get getAllSIckLeave => _sickLeaveService.getAllSickLeave; @@ -31,10 +30,7 @@ class SickLeaveViewModel extends BaseViewModel { get postSechedule => _sickLeaveService.postReschedule; - get getAllSIckLeavePatient => removeDuplicates([ - ..._sickLeaveService.getAllSickLeavePatient, - ..._sickLeaveService.getAllSickLeaveDoctor - ]); + get getAllSIckLeavePatient => removeDuplicates([..._sickLeaveService.getAllSickLeaveDoctor, ..._sickLeaveService.getAllSickLeavePatient]); Future addSickLeave(AddSickLeaveRequest addSickLeaveRequest) async { setState(ViewState.BusyLocal); @@ -89,17 +85,13 @@ class SickLeaveViewModel extends BaseViewModel { setState(ViewState.Idle); } - Future getSickLeaveForPatient(PatiantInformtion patient, - {bool isLocalBusy = false}) async { + Future getSickLeaveForPatient(PatiantInformtion patient, {bool isLocalBusy = false}) async { if (isLocalBusy) setState(ViewState.BusyLocal); else setState(ViewState.Busy); var patientMRN = patient.patientMRN ?? patient.patientId; - var services = [ - _sickLeaveService.getSickLeavePatient(patientMRN), - _sickLeaveService.getSickLeaveDoctor(patientMRN) - ]; + var services = [_sickLeaveService.getSickLeavePatient(patientMRN), _sickLeaveService.getSickLeaveDoctor(patientMRN)]; final results = await Future.wait(services); if (_sickLeaveService.hasError) { @@ -184,15 +176,13 @@ class SickLeaveViewModel extends BaseViewModel { } else setState(ViewState.Idle); } + List removeDuplicates(List items) { - ListuniqueItems = []; - var uniqueIDs = items - .map((e) => e.appointmentNo) - .toSet(); + List uniqueItems = []; + var uniqueIDs = items.map((e) => e.appointmentNo).toSet(); uniqueIDs.forEach((e) { uniqueItems.add(items.firstWhere((i) => i.appointmentNo == e)); }); return uniqueItems; } } - diff --git a/lib/screens/patient-sick-leave/patient_sick_leave_screen.dart b/lib/screens/patient-sick-leave/patient_sick_leave_screen.dart index 4433bfa8..0e5873df 100644 --- a/lib/screens/patient-sick-leave/patient_sick_leave_screen.dart +++ b/lib/screens/patient-sick-leave/patient_sick_leave_screen.dart @@ -29,255 +29,185 @@ class PatientSickLeaveScreen extends StatelessWidget { Widget build(BuildContext context) { ProjectViewModel projectsProvider = Provider.of(context); - final routeArgs = ModalRoute - .of(context) - .settings - .arguments as Map; + final routeArgs = ModalRoute.of(context).settings.arguments as Map; patient = routeArgs['patient']; bool isInpatient = routeArgs['isInpatient']; return BaseView( onModelReady: (model) async { await model.getSickLeaveForPatient(patient); }, - builder: (_, model, w) => - AppScaffold( - baseViewModel: model, - isShowAppBar: true, - backgroundColor: Colors.grey[100], - appBar: PatientProfileAppBar( - patient, - isInpatient: isInpatient, - ), - body: Column(children: [ - patient.patientStatusType == 43 - ? Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Padding( - padding: EdgeInsets.all(10), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - SizedBox( - height: SizeConfig.isHeightVeryShort - ? 30 - : SizeConfig.isHeightShort - ? 35 - : 10, - ), - if (!projectsProvider.isArabic) + builder: (_, model, w) => AppScaffold( + baseViewModel: model, + isShowAppBar: true, + backgroundColor: Colors.grey[100], + appBar: PatientProfileAppBar( + patient, + isInpatient: isInpatient, + ), + body: Column(children: [ + patient.patientStatusType == 43 + ? Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Padding( + padding: EdgeInsets.all(10), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: SizeConfig.isHeightVeryShort + ? 30 + : SizeConfig.isHeightShort + ? 35 + : 10, + ), + if (!projectsProvider.isArabic) + AppText( + TranslationBase.of(context).patient, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * (SizeConfig.isWidthLarge ? 3 : 4), + fontWeight: FontWeight.w700, + letterSpacing: -0.72, + color: Color(0xFF2E303A), + ), AppText( - TranslationBase - .of(context) - .patient, - fontSize: SizeConfig - .getTextMultiplierBasedOnWidth() * (SizeConfig - .isWidthLarge ? 3 : 4), - fontWeight: FontWeight.w700, - letterSpacing: -0.72, + TranslationBase.of(context).sickLeave, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * (SizeConfig.isWidthLarge ? 6 : 6), + fontWeight: FontWeight.bold, + letterSpacing: -1.44, color: Color(0xFF2E303A), ), - AppText( - TranslationBase - .of(context) - .sickLeave, - fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * - (SizeConfig.isWidthLarge ? 6 : 6), - fontWeight: FontWeight.bold, - letterSpacing: -1.44, - color: Color(0xFF2E303A), - ), - ], + ], + ), ), - ), - AddNewOrder( - label: TranslationBase - .of(context) - .noSickLeaveApplied, - onTap: () async { - await locator().logEvent( - eventCategory: "Add Sick Leave Screen" - "Leave Screen", - eventAction: "apply For Sick Leave", - ); - openSickLeave(context, model); - }), - ], - ) - : SizedBox(), - model.getAllSIckLeavePatient.length > 0 - ? Expanded( - child: FractionallySizedBox( - widthFactor: 0.95, - child: ListView.builder( - scrollDirection: Axis.vertical, - shrinkWrap: true, - itemCount: model.getAllSIckLeavePatient.length, - itemBuilder: (BuildContext ctxt, int index) { - SickLeavePatientModel item = model - .getAllSIckLeavePatient[index]; - return Column( - children: [ - CardWithBgWidget( - padding: 0, - marginLeft: 10, - marginSymmetric: 10, - hasBorder: false, - bgColor: Colors.black, - widget: Container( - color: Colors.white, - padding: EdgeInsets.all(20), - child: InkWell( - child: Column( - children: [ - if (item.doctorName != null) - Row(crossAxisAlignment: CrossAxisAlignment - .start, - mainAxisAlignment: MainAxisAlignment - .start, - children: [ - Expanded( - // width: MediaQuery.of(context).size.width*0.51, - child: AppText( - Utils.capitalize( - item.doctorName ?? ""), - fontSize: 18, - color: Color(0xff2e303a), - fontWeight: FontWeight.w700, - fontFamily: 'Poppins', - textOverflow: TextOverflow - .ellipsis, - ), + AddNewOrder( + label: TranslationBase.of(context).noSickLeaveApplied, + onTap: () async { + await locator().logEvent( + eventCategory: "Add Sick Leave Screen" + "Leave Screen", + eventAction: "apply For Sick Leave", + ); + openSickLeave(context, model); + }), + ], + ) + : SizedBox(), + model.getAllSIckLeavePatient.length > 0 + ? Expanded( + child: FractionallySizedBox( + widthFactor: 0.95, + child: ListView.builder( + scrollDirection: Axis.vertical, + shrinkWrap: true, + itemCount: model.getAllSIckLeavePatient.length, + itemBuilder: (BuildContext ctxt, int index) { + SickLeavePatientModel item = model.getAllSIckLeavePatient[index]; + return Column( + children: [ + CardWithBgWidget( + padding: 0, + marginLeft: 10, + marginSymmetric: 10, + hasBorder: false, + bgColor: Colors.black, + widget: Container( + color: Colors.white, + padding: EdgeInsets.all(20), + child: InkWell( + child: Column( + children: [ + if (item.doctorName != null) + Row(crossAxisAlignment: CrossAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start, children: [ + Expanded( + // width: MediaQuery.of(context).size.width*0.51, + child: AppText( + Utils.capitalize(item.doctorName ?? ""), + fontSize: 18, + color: Color(0xff2e303a), + fontWeight: FontWeight.w700, + fontFamily: 'Poppins', + textOverflow: TextOverflow.ellipsis, ), - ]), - SizedBox( - height: 10, - ), - Row( - children: [ - ClipRRect( - borderRadius: BorderRadius.circular( - 50.0), - child: CachedNetworkImage( - imageUrl: item.doctorImageURL ?? - "https://hmgwebservices.com/Images/MobileImages/DUBAI/unkown.png", - height: 30, - width: 30, - errorWidget: (context, url, - error) => - AppText( - 'No Image', - fontSize: 10, - ), ), - ), - SizedBox( - width: 10, - ), - Expanded( - child: Column( - children: [ - CustomRow( - label: TranslationBase - .of(context) - .daysSickleave, - labelSize: SizeConfig - .getTextMultiplierBasedOnWidth() * - 3.3, - valueSize: SizeConfig - .getTextMultiplierBasedOnWidth() * - 4, - value: - (item.sickLeaveDays - .toString() != null && - item.sickLeaveDays - .toString() != "null") - ? item.sickLeaveDays - .toString() - : item.noOfDays - .toString(), + ]), + SizedBox( + height: 10, + ), + Row( + children: [ + ClipRRect( + borderRadius: BorderRadius.circular(50.0), + child: CachedNetworkImage( + imageUrl: item.doctorImageURL ?? "https://hmgwebservices.com/Images/MobileImages/DUBAI/unkown.png", + height: 30, + width: 30, + errorWidget: (context, url, error) => AppText( + 'No Image', + fontSize: 10, ), - CustomRow( - label: TranslationBase - .of(context) - .startDate + ' ' ?? "", - labelSize: SizeConfig - .getTextMultiplierBasedOnWidth() * - 3.3, - valueSize: SizeConfig - .getTextMultiplierBasedOnWidth() * - 4, - value: AppDateUtils - .getDayMonthYearDateFormatted( - item.startDate.contains( - "/Date(") - ? AppDateUtils - .convertStringToDate( - item.startDate) - : DateTime.parse( - item.startDate), + ), + ), + SizedBox( + width: 10, + ), + Expanded( + child: Column( + children: [ + CustomRow( + label: TranslationBase.of(context).daysSickleave, + labelSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.3, + valueSize: SizeConfig.getTextMultiplierBasedOnWidth() * 4, + value: + (item.sickLeaveDays.toString() != null && item.sickLeaveDays.toString() != "null") ? item.sickLeaveDays.toString() : item.noOfDays.toString(), ), - ), - CustomRow( - label: TranslationBase - .of(context) - .endDate + ' ' ?? "", - labelSize: SizeConfig - .getTextMultiplierBasedOnWidth() * - 3.3, - valueSize: SizeConfig - .getTextMultiplierBasedOnWidth() * - 4, - value: AppDateUtils - .getDayMonthYearDateFormatted( - item.startDate.contains( - "/Date(") - ? AppDateUtils - .convertStringToDate( - item.endDate ?? "").add( - Duration( - days: item.noOfDays ?? - item - .sickLeaveDays), - ) - : DateTime.parse( - item.startDate ?? "") - .add( - Duration( - days: item.noOfDays ?? - ""), + CustomRow( + label: TranslationBase.of(context).startDate + ' ' ?? "", + labelSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.3, + valueSize: SizeConfig.getTextMultiplierBasedOnWidth() * 4, + value: AppDateUtils.getDayMonthYearDateFormatted( + item.startDate.contains("/Date(") ? AppDateUtils.convertStringToDate(item.startDate) : DateTime.parse(item.startDate), ), ), - ), - ], - crossAxisAlignment: CrossAxisAlignment - .start, + CustomRow( + label: TranslationBase.of(context).endDate + ' ' ?? "", + labelSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.3, + valueSize: SizeConfig.getTextMultiplierBasedOnWidth() * 4, + value: AppDateUtils.getDayMonthYearDateFormatted( + item.startDate.contains("/Date(") + ? AppDateUtils.convertStringToDate(item.endDate ?? "").add( + Duration(days: item.noOfDays ?? item.sickLeaveDays), + ) + : DateTime.parse(item.startDate ?? "").add( + Duration(days: item.noOfDays ?? ""), + ), + ), + ), + ], + crossAxisAlignment: CrossAxisAlignment.start, + ), ), - ), - ], - ), - ], + ], + ), + ], + ), ), ), ), - ), - ], - ); - }), - ), - ) - : patient.patientStatusType != 43 + ], + ); + }), + ), + ) + : patient.patientStatusType != 43 ? ErrorMessage( - error: TranslationBase - .of(context) - .noSickLeave, - ) + error: TranslationBase.of(context).noSickLeave, + ) : SizedBox(), - SizedBox( - height: 100, - ) - ]), - ), + SizedBox( + height: 100, + ) + ]), + ), ); } @@ -296,4 +226,3 @@ class PatientSickLeaveScreen extends StatelessWidget { ); } } - diff --git a/lib/screens/patients/profile/soap_update/assessment/add_assessment_details.dart b/lib/screens/patients/profile/soap_update/assessment/add_assessment_details.dart index c4d3c778..c1c08132 100644 --- a/lib/screens/patients/profile/soap_update/assessment/add_assessment_details.dart +++ b/lib/screens/patients/profile/soap_update/assessment/add_assessment_details.dart @@ -148,12 +148,14 @@ class _AddAssessmentDetailsState extends State { controller: icdNameController, itemSubmitted: (item) => setState(() { widget.mySelectedAssessment.selectedICD = item; - icdNameController.text = '${item.code.trim()}/${item.description}'; + // icdNameController.text = '${item.code.trim()}/${item.description}'; + icdNameController.text = '${item.description}'; }), key: key, suggestions: model.listOfICD10, + suggestionsAmount: 10, itemBuilder: (context, suggestion) => - new Padding(child: AppText(suggestion.description + " / " + suggestion.code.toString()), padding: EdgeInsets.all(8.0)), + new Padding(child: AppText(suggestion.description + " / " + suggestion.code.toString(), fontSize: 12.0), padding: EdgeInsets.all(8.0)), itemSorter: (a, b) => 1, itemFilter: (suggestion, input) => // suggestion.description.toLowerCase().startsWith(input.toLowerCase()) || diff --git a/lib/screens/patients/profile/soap_update/assessment/update_assessment_page.dart b/lib/screens/patients/profile/soap_update/assessment/update_assessment_page.dart index c898ec77..74b9a1f4 100644 --- a/lib/screens/patients/profile/soap_update/assessment/update_assessment_page.dart +++ b/lib/screens/patients/profile/soap_update/assessment/update_assessment_page.dart @@ -30,19 +30,13 @@ class UpdateAssessmentPage extends StatefulWidget { final Function changeLoadingState; final int currentIndex; - UpdateAssessmentPage( - {Key key, - this.changePageViewIndex, - this.patientInfo, - this.changeLoadingState, - this.currentIndex}); + UpdateAssessmentPage({Key key, this.changePageViewIndex, this.patientInfo, this.changeLoadingState, this.currentIndex}); @override _UpdateAssessmentPageState createState() => _UpdateAssessmentPageState(); } -class _UpdateAssessmentPageState extends State - implements AssessmentCallBack { +class _UpdateAssessmentPageState extends State implements AssessmentCallBack { bool isAssessmentExpand = false; List mySelectedAssessmentList = List(); @@ -71,21 +65,18 @@ class _UpdateAssessmentPageState extends State masterKeys: MasterKeysService.DiagnosisCondition, id: element.conditionID, ); - if (diagnosisCondition != null && - diagnosisType != null && - diagnosisCondition != null) { - MySelectedAssessment temMySelectedAssessment = - SoapUtils.generateMySelectedAssessment( - appointmentNo: element.appointmentNo, - remark: element.remarks, - diagnosisType: diagnosisType, - diagnosisCondition: diagnosisCondition, - selectedICD: selectedICD, - doctorID: element.doctorID, - doctorName: element.doctorName, - createdBy: element.createdBy, - createdOn: element.createdOn, - icdCode10ID: element.icdCode10ID); + if (diagnosisCondition != null && diagnosisType != null && diagnosisCondition != null) { + MySelectedAssessment temMySelectedAssessment = SoapUtils.generateMySelectedAssessment( + appointmentNo: element.appointmentNo, + remark: element.remarks, + diagnosisType: diagnosisType, + diagnosisCondition: diagnosisCondition, + selectedICD: selectedICD, + doctorID: element.doctorID, + doctorName: element.doctorName, + createdBy: element.createdBy, + createdOn: element.createdOn, + icdCode10ID: element.icdCode10ID); mySelectedAssessmentList.add(temMySelectedAssessment); } @@ -126,111 +117,73 @@ class _UpdateAssessmentPageState extends State Column( children: [ SOAPOpenItems( - label: - "${TranslationBase.of(context).addAssessment}", + label: "${TranslationBase.of(context).addAssessment}", onTap: () { - openAssessmentDialog(context, - isUpdate: false, model: model); + openAssessmentDialog(context, isUpdate: false, model: model); }, ), SizedBox( height: 20, ), Column( - children: - mySelectedAssessmentList.map((assessment) { + children: mySelectedAssessmentList.map((assessment) { return Container( - margin: EdgeInsets.only( - left: 5, right: 5, top: 15, bottom: 15), + margin: EdgeInsets.only(left: 5, right: 5, top: 15, bottom: 15), child: Column( children: [ Row( - children: [ - RichText( - text: new TextSpan( - style: new TextStyle( - fontSize: SizeConfig - .getTextMultiplierBasedOnWidth() * - 3.6, - color: Color(0xFF2E303A), - fontFamily: 'Poppins', + RichText( + text: new TextSpan( + style: new TextStyle( + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.6, + color: Color(0xFF2E303A), + fontFamily: 'Poppins', + fontWeight: FontWeight.w600, + letterSpacing: -0.4), + children: [ + new TextSpan( + text: "ICD : ".toUpperCase(), + ), + new TextSpan(text: (assessment != null && assessment.selectedICD != null) ? assessment.selectedICD.code.trim().toUpperCase() ?? "" : ""), + ], + ), + ), + Column( + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + AppText( + assessment.createdOn != null + ? AppDateUtils.getDayMonthYearDateFormatted(DateTime.parse(assessment.createdOn), isMonthShort: true) + : AppDateUtils.getDayMonthYearDateFormatted(DateTime.now()), fontWeight: FontWeight.w600, - letterSpacing: -0.4), - children: [ - new TextSpan( - text: "ICD : ".toUpperCase(), + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.6, + ), + AppText( + assessment.createdOn != null ? AppDateUtils.getHour(DateTime.parse(assessment.createdOn)) : AppDateUtils.getHour(DateTime.now()), + fontWeight: FontWeight.w600, + color: Color(0xFF575757), + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.6, ), - new TextSpan( - text: assessment - .selectedICD.code - .trim() - .toUpperCase() ?? - ""), ], ), - ), - Column( - crossAxisAlignment: - CrossAxisAlignment.end, - children: [ - AppText( - assessment.createdOn != null - ? AppDateUtils - .getDayMonthYearDateFormatted( - DateTime.parse( - assessment - .createdOn), isMonthShort: true) - : AppDateUtils - .getDayMonthYearDateFormatted( - DateTime.now()), - fontWeight: FontWeight.w600, - fontSize: SizeConfig - .getTextMultiplierBasedOnWidth() * - 3.6, - ), - AppText( - assessment.createdOn != null - ? AppDateUtils.getHour( - DateTime.parse( - assessment - .createdOn)) - : AppDateUtils.getHour( - DateTime.now()), - fontWeight: FontWeight.w600, - color: Color(0xFF575757), - fontSize: SizeConfig - .getTextMultiplierBasedOnWidth() * - 3.6, - ), - ], - ), - ], + ], mainAxisAlignment: MainAxisAlignment.spaceBetween, crossAxisAlignment: CrossAxisAlignment.start, ), Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - crossAxisAlignment: - CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.start, children: [ Column( - crossAxisAlignment: - CrossAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, children: [ - Container( - width: MediaQuery.of(context) - .size - .width * - 0.50, + width: MediaQuery.of(context).size.width * 0.50, child: RichText( text: new TextSpan( style: new TextStyle( - fontSize: SizeConfig - .getTextMultiplierBasedOnWidth() * - 4.3, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 4.3, color: Color(0xFF2E303A), fontFamily: 'Poppins', fontWeight: FontWeight.w600, @@ -238,9 +191,8 @@ class _UpdateAssessmentPageState extends State ), children: [ new TextSpan( - text: assessment - .selectedICD.description - .toString(), + text: (assessment != null && assessment.selectedICD != null) ? assessment.selectedICD.description.toString() : "", + // text: assessment.selectedICD.description.toString(), ), ], ), @@ -249,34 +201,24 @@ class _UpdateAssessmentPageState extends State RichText( text: new TextSpan( style: new TextStyle( - fontSize: SizeConfig - .getTextMultiplierBasedOnWidth() * - 3.5, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.5, color: Color(0xFF2E303A), fontFamily: 'Poppins', fontWeight: FontWeight.w600, ), children: [ new TextSpan( - text: TranslationBase.of( - context) - .appointmentNo, + text: TranslationBase.of(context).appointmentNo, style: new TextStyle( - fontSize: SizeConfig - .getTextMultiplierBasedOnWidth() * - 3, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3, letterSpacing: -0.4, color: Color(0xFF575757), ), ), new TextSpan( - text: assessment.appointmentId - .toString() ?? - "", + text: assessment.appointmentId.toString() ?? "", style: new TextStyle( - fontSize: SizeConfig - .getTextMultiplierBasedOnWidth() * - 3.6, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.6, letterSpacing: -0.48, color: Color(0xFF2B353E), ), @@ -287,36 +229,19 @@ class _UpdateAssessmentPageState extends State RichText( text: new TextSpan( style: new TextStyle( - fontSize: SizeConfig - .getTextMultiplierBasedOnWidth() * - 3, - color: Color(0xFF2E303A), - fontFamily: 'Poppins', - fontWeight: FontWeight.w600), + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3, color: Color(0xFF2E303A), fontFamily: 'Poppins', fontWeight: FontWeight.w600), children: [ new TextSpan( - text: TranslationBase.of( - context) - .condition + - " : ", + text: TranslationBase.of(context).condition + " : ", style: new TextStyle( letterSpacing: -0.4, color: Color(0xFF575757), ), ), new TextSpan( - text: projectViewModel - .isArabic - ? assessment - .selectedDiagnosisCondition - .nameAr - : assessment - .selectedDiagnosisCondition - .nameEn, + text: projectViewModel.isArabic ? assessment.selectedDiagnosisCondition.nameAr : assessment.selectedDiagnosisCondition.nameEn, style: new TextStyle( - fontSize: SizeConfig - .getTextMultiplierBasedOnWidth() * - 3.6, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.6, letterSpacing: -0.48, color: Color(0xFF2B353E), ), @@ -327,36 +252,19 @@ class _UpdateAssessmentPageState extends State RichText( text: new TextSpan( style: new TextStyle( - fontSize: SizeConfig - .getTextMultiplierBasedOnWidth() * - 3, - color: Color(0xFF2E303A), - fontFamily: 'Poppins', - fontWeight: FontWeight.w600), + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3, color: Color(0xFF2E303A), fontFamily: 'Poppins', fontWeight: FontWeight.w600), children: [ new TextSpan( - text: TranslationBase.of( - context) - .dType + - ' : ', + text: TranslationBase.of(context).dType + ' : ', style: new TextStyle( letterSpacing: -0.4, color: Color(0xFF575757), ), ), new TextSpan( - text: projectViewModel - .isArabic - ? assessment - .selectedDiagnosisType - .nameAr - : assessment - .selectedDiagnosisType - .nameEn, + text: projectViewModel.isArabic ? assessment.selectedDiagnosisType.nameAr : assessment.selectedDiagnosisType.nameEn, style: new TextStyle( - fontSize: SizeConfig - .getTextMultiplierBasedOnWidth() * - 3.6, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.6, letterSpacing: -0.48, color: Color(0xFF2B353E), ), @@ -368,35 +276,20 @@ class _UpdateAssessmentPageState extends State RichText( text: new TextSpan( style: new TextStyle( - fontSize: SizeConfig - .getTextMultiplierBasedOnWidth() * - 3.6, - color: Color(0xFF2E303A), - fontFamily: 'Poppins', - fontWeight: - FontWeight.w600), + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.6, color: Color(0xFF2E303A), fontFamily: 'Poppins', fontWeight: FontWeight.w600), children: [ new TextSpan( - text: TranslationBase.of( - context) - .doctor + - ' : ', + text: TranslationBase.of(context).doctor + ' : ', style: new TextStyle( - fontSize: SizeConfig - .getTextMultiplierBasedOnWidth() * - 3, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3, letterSpacing: -0.4, color: Color(0xFF575757), ), ), new TextSpan( - text: - assessment.doctorName ?? - '', + text: assessment.doctorName ?? '', style: new TextStyle( - fontSize: SizeConfig - .getTextMultiplierBasedOnWidth() * - 3.6, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.6, letterSpacing: -0.48, color: Color(0xFF2B353E), ), @@ -408,29 +301,14 @@ class _UpdateAssessmentPageState extends State height: 6, ), Row( - mainAxisAlignment: - MainAxisAlignment.start, - crossAxisAlignment: - CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, children: [ SizedBox( height: 6, ), - AppText( - (assessment.remark != null && - assessment.remark != - '') - ? TranslationBase.of( - context) - .remarks + - " : " - : '', - fontSize: SizeConfig - .getTextMultiplierBasedOnWidth() * - 3, - color: Color(0xFF2E303A), - fontFamily: 'Poppins', - fontWeight: FontWeight.w600), + AppText((assessment.remark != null && assessment.remark != '') ? TranslationBase.of(context).remarks + " : " : '', + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3, color: Color(0xFF2E303A), fontFamily: 'Poppins', fontWeight: FontWeight.w600), RemarkText( remark: assessment.remark ?? "", ), @@ -439,22 +317,14 @@ class _UpdateAssessmentPageState extends State ], ), Column( - crossAxisAlignment: - CrossAxisAlignment.end, + crossAxisAlignment: CrossAxisAlignment.end, children: [ - SizedBox( - height: MediaQuery.of(context) - .size - .height * - 0.05, + height: MediaQuery.of(context).size.height * 0.05, ), InkWell( onTap: () { - openAssessmentDialog(context, - isUpdate: true, - assessment: assessment, - model: model); + openAssessmentDialog(context, isUpdate: true, assessment: assessment, model: model); }, child: Icon( DoctorApp.edit, @@ -488,11 +358,9 @@ class _UpdateAssessmentPageState extends State ); } - openAssessmentDialog(BuildContext context, - {MySelectedAssessment assessment, bool isUpdate, SOAPViewModel model}) { + openAssessmentDialog(BuildContext context, {MySelectedAssessment assessment, bool isUpdate, SOAPViewModel model}) { if (assessment == null) { - assessment = SoapUtils.generateMySelectedAssessment( - remark: '', appointmentNo: widget.patientInfo.appointmentNo); + assessment = SoapUtils.generateMySelectedAssessment(remark: '', appointmentNo: widget.patientInfo.appointmentNo); } showModalBottomSheet( backgroundColor: Colors.white, @@ -504,11 +372,9 @@ class _UpdateAssessmentPageState extends State patientInfo: widget.patientInfo, isUpdate: isUpdate, mySelectedAssessmentList: mySelectedAssessmentList, - addSelectedAssessment: (MySelectedAssessment mySelectedAssessment, - bool isUpdate) async { + addSelectedAssessment: (MySelectedAssessment mySelectedAssessment, bool isUpdate) async { setState(() { - if (!isUpdate) - mySelectedAssessmentList.add(mySelectedAssessment); + if (!isUpdate) mySelectedAssessmentList.add(mySelectedAssessment); }); }); }); diff --git a/lib/screens/prescription/add_prescription/add_drug/drug_to_drug.dart b/lib/screens/prescription/add_prescription/add_drug/drug_to_drug.dart index 18125bd2..869e45a5 100644 --- a/lib/screens/prescription/add_prescription/add_drug/drug_to_drug.dart +++ b/lib/screens/prescription/add_prescription/add_drug/drug_to_drug.dart @@ -29,6 +29,7 @@ class DrugToDrug extends StatefulWidget { class _DrugToDrug extends State { int typeID = 1; bool isLoaded = false; + /// TODO Elham* fix this List> expandableList = [ {'name': 'CRITICAL', 'level': 'LEVEL_4'}, @@ -38,7 +39,6 @@ class _DrugToDrug extends State { {'name': 'INFO', 'level': 'INFO'}, ]; - VitalSignsViewModel vitalSignsViewModel = new VitalSignsViewModel(); SOAPViewModel soapViewModel = new SOAPViewModel(); @@ -53,49 +53,31 @@ class _DrugToDrug extends State { Widget build(BuildContext context) { return isLoaded == true ? BaseView( - onModelReady: (prescriptionViewModel) => prescriptionViewModel.getDrugToDrug( - vitalSignsViewModel.patientVitalSigns, - widget.listAssessment, - soapViewModel.patientAllergiesList, - widget.patient, - widget.prescription), - builder: (BuildContext context, PrescriptionViewModel prescriptionViewModel, - Widget child) => - NetworkBaseView( - baseViewModel: prescriptionViewModel, - child: Container( - height: SizeConfig.realScreenHeight * .9, - child: new ListView.builder( - itemCount: expandableList.length, - itemBuilder: (context, i) { - return new ExpansionTile( - title: new AppText( - expandableList[i]['name'] + - ' ' + - '(' + - getDrugInfo(expandableList[i]['level'], - prescriptionViewModel) - .length - .toString() + - ')', - fontSize: 20, - fontWeight: FontWeight.bold, - ), - children: getDrugInfo( - expandableList[i]['level'], prescriptionViewModel) - .map((item) { - return Container( - padding: EdgeInsets.all(10), - child: AppText( - item['comment'], - color: Colors.red[900], - )); - }).toList()); - })))) - : Container( - height: SizeConfig.realScreenHeight * .45, - child: GifLoaderContainer() - ); + onModelReady: (prescriptionViewModel) => + prescriptionViewModel.getDrugToDrug(vitalSignsViewModel.patientVitalSigns, widget.listAssessment, soapViewModel.patientAllergiesList, widget.patient, widget.prescription), + builder: (BuildContext context, PrescriptionViewModel prescriptionViewModel, Widget child) => NetworkBaseView( + baseViewModel: prescriptionViewModel, + child: Container( + height: SizeConfig.realScreenHeight * .9, + child: new ListView.builder( + itemCount: expandableList.length, + itemBuilder: (context, i) { + return new ExpansionTile( + title: new AppText( + expandableList[i]['name'] + ' ' + '(' + getDrugInfo(expandableList[i]['level'], prescriptionViewModel).length.toString() + ')', + fontSize: 20, + fontWeight: FontWeight.bold, + ), + children: getDrugInfo(expandableList[i]['level'], prescriptionViewModel).map((item) { + return Container( + padding: EdgeInsets.all(10), + child: AppText( + item['comment'], + color: Colors.red[900], + )); + }).toList()); + })))) + : Container(height: SizeConfig.realScreenHeight * .45, child: GifLoaderContainer()); } getTypeID() async { @@ -106,14 +88,12 @@ class _DrugToDrug extends State { } getRequestedData() async { - - GeneralGetReqForSOAP generalGetReqForSOAP = GeneralGetReqForSOAP( - /// TODO Elham* fix this today + + /// TODO Elham* fix this today patientMRN: widget.patient.patientMRN, episodeId: widget.patient.episodeNo, - appointmentNo: - widget.patient.appointmentNo, + appointmentNo: widget.patient.appointmentNo, doctorID: '', editedBy: ''); diff --git a/lib/screens/prescription/add_prescription/prescription_form_widget.dart b/lib/screens/prescription/add_prescription/prescription_form_widget.dart index 803e8d7d..cb4ebf06 100644 --- a/lib/screens/prescription/add_prescription/prescription_form_widget.dart +++ b/lib/screens/prescription/add_prescription/prescription_form_widget.dart @@ -35,13 +35,7 @@ class PrescriptionFormWidget extends StatefulWidget { final MedicineViewModel medicineViewModel; final GetMedicationResponseModel selectedMedication; - const PrescriptionFormWidget( - {Key key, - this.patient, - this.prescriptionList, - this.prescriptionViewModel, - this.medicineViewModel, - this.selectedMedication}); + const PrescriptionFormWidget({Key key, this.patient, this.prescriptionList, this.prescriptionViewModel, this.medicineViewModel, this.selectedMedication}); @override _PrescriptionFormWidgetState createState() => _PrescriptionFormWidgetState(); @@ -67,8 +61,7 @@ class _PrescriptionFormWidgetState extends State { DateTime selectedDate = DateTime.now(); int strengthChar; - GlobalKey key = - new GlobalKey>(); + GlobalKey key = new GlobalKey>(); TextEditingController drugIdController = TextEditingController(); TextEditingController doseController = TextEditingController(); @@ -97,8 +90,7 @@ class _PrescriptionFormWidgetState extends State { onVoiceText() async { new SpeechToText(context: context).showAlertDialog(context); var lang = TranslationBase.of(AppGlobal.CONTEX).locale.languageCode; - bool available = await speech.initialize( - onStatus: statusListener, onError: errorListener); + bool available = await speech.initialize(onStatus: statusListener, onError: errorListener); if (available) { speech.listen( onResult: resultListener, @@ -135,8 +127,7 @@ class _PrescriptionFormWidgetState extends State { } Future initSpeechState() async { - bool hasSpeech = await speech.initialize( - onError: errorListener, onStatus: statusListener); + bool hasSpeech = await speech.initialize(onError: errorListener, onStatus: statusListener); print(hasSpeech); if (!mounted) return; } @@ -185,7 +176,7 @@ class _PrescriptionFormWidgetState extends State { children: [ Container( width: MediaQuery.of(context).size.width * 0.35, - child: AppTextFieldCustom( + child: AppTextFieldCustom( validationError: strengthError, hintText: TranslationBase.of(context).strength, isTextFieldHasSuffix: false, @@ -197,8 +188,7 @@ class _PrescriptionFormWidgetState extends State { }); if (strengthChar >= 5) { DrAppToastMsg.showErrorToast( - TranslationBase.of(context) - .only5DigitsAllowedForStrength, + TranslationBase.of(context).only5DigitsAllowedForStrength, ); } }, @@ -212,10 +202,7 @@ class _PrescriptionFormWidgetState extends State { ), PrescriptionTextFiled( width: MediaQuery.of(context).size.width * 0.510, - element: - widget.medicineViewModel.itemMedicineListUnit.length == 1 - ? widget.medicineViewModel.itemMedicineListUnit[0] - : units, + element: widget.medicineViewModel.itemMedicineListUnit.length == 1 ? widget.medicineViewModel.itemMedicineListUnit[0] : units, elementError: unitError, keyName: 'description', keyId: 'parameterCode', @@ -233,9 +220,7 @@ class _PrescriptionFormWidgetState extends State { SizedBox(height: spaceBetweenTextFields), PrescriptionTextFiled( elementList: widget.medicineViewModel.itemMedicineListRoute, - element: widget.medicineViewModel.itemMedicineListRoute.length == 1 - ? route = widget.medicineViewModel.itemMedicineListRoute[0] - : route, + element: widget.medicineViewModel.itemMedicineListRoute.length == 1 ? route = widget.medicineViewModel.itemMedicineListRoute[0] : route, elementError: routeError, keyId: 'parameterCode', keyName: 'description', @@ -252,9 +237,7 @@ class _PrescriptionFormWidgetState extends State { hintText: TranslationBase.of(context).frequency, elementError: frequencyError, // element: frequency, - element: widget.medicineViewModel.itemMedicineListRoute.length == 1 - ? frequency = widget.medicineViewModel.itemMedicineListRoute[0] - : frequency, + element: widget.medicineViewModel.itemMedicineListRoute.length == 1 ? frequency = widget.medicineViewModel.itemMedicineListRoute[0] : frequency, elementList: widget.medicineViewModel.itemMedicineList, keyId: 'parameterCode', keyName: 'description', @@ -262,15 +245,9 @@ class _PrescriptionFormWidgetState extends State { setState(() { frequency = selectedValue; frequency['isDefault'] = true; - if (widget.selectedMedication != null && - duration != null && - frequency != null && - strengthController.text != null) { - widget.medicineViewModel.getBoxQuantity( - freq: frequency['parameterCode'], - duration: duration['id'], - itemCode: widget.selectedMedication.itemId, - strength: double.parse(strengthController.text)); + if (widget.selectedMedication != null && duration != null && frequency != null && strengthController.text != null) { + widget.medicineViewModel + .getBoxQuantity(freq: frequency['parameterCode'], duration: duration['id'], itemCode: widget.selectedMedication.itemId, strength: double.parse(strengthController.text)); return; } @@ -300,9 +277,7 @@ class _PrescriptionFormWidgetState extends State { Container( width: MediaQuery.of(context).size.width * 0.29, child: AppTextFieldCustom( - hintText: widget - .medicineViewModel.patientAssessmentList[0].icdCode10ID - .toString(), + hintText: widget.medicineViewModel.patientAssessmentList[0].icdCode10ID.toString(), enabled: true, ), ), @@ -311,16 +286,15 @@ class _PrescriptionFormWidgetState extends State { color: Colors.white, child: AppTextFieldCustom( maxLines: 5, - hintText: widget - .medicineViewModel.patientAssessmentList[0].asciiDesc - .toString(), + hintText: widget.medicineViewModel.patientAssessmentList[0].asciiDesc.toString(), enabled: true, ), ), ], ), ), - SizedBox(height: spaceBetweenTextFields), Container( + SizedBox(height: spaceBetweenTextFields), + Container( color: Colors.transparent, child: InkWell( onTap: () => selectDate(context, widget.prescriptionViewModel), @@ -334,9 +308,7 @@ class _PrescriptionFormWidgetState extends State { color: Colors.black, ), ), - dropDownText: selectedDate != null - ? "${AppDateUtils.convertStringToDateFormat(selectedDate.toString(), "yyyy-MM-dd")}" - : null, + dropDownText: selectedDate != null ? "${AppDateUtils.convertStringToDateFormat(selectedDate.toString(), "yyyy-MM-dd")}" : null, enabled: false, ), ), @@ -352,10 +324,7 @@ class _PrescriptionFormWidgetState extends State { okFunction: (selectedValue) { setState(() { duration = selectedValue; - if (widget.selectedMedication != null && - duration != null && - frequency != null && - strengthController.text != null) { + if (widget.selectedMedication != null && duration != null && frequency != null && strengthController.text != null) { box = widget.medicineViewModel.boxQuintity; return; } @@ -378,17 +347,13 @@ class _PrescriptionFormWidgetState extends State { child: AppTextFieldCustom( hintText: TranslationBase.of(context).boxQuantity, isTextFieldHasSuffix: false, - dropDownText: box != null - ? widget.medicineViewModel.boxQuintity.toString() - : null, + dropDownText: box != null ? widget.medicineViewModel.boxQuintity.toString() : null, enabled: false, ), ), SizedBox(height: spaceBetweenTextFields), Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.all(Radius.circular(6.0)), - border: Border.all(width: 1.0, color: HexColor("#CCCCCC"))), + decoration: BoxDecoration(borderRadius: BorderRadius.all(Radius.circular(6.0)), border: Border.all(width: 1.0, color: HexColor("#CCCCCC"))), child: Stack( children: [ TextFields( @@ -459,14 +424,9 @@ class _PrescriptionFormWidgetState extends State { eventCategory: "Add Prescription Form", eventAction: "Add Prescription", ); - if (duration != null && - doseTime != null && - frequency != null && - selectedDate != null && - strengthController.text != "") { + if (duration != null && doseTime != null && frequency != null && selectedDate != null && strengthController.text != "") { if (widget.selectedMedication.isNarcotic == true) { - DrAppToastMsg.showErrorToast(TranslationBase.of(context) - .narcoticMedicineCanOnlyBePrescribedFromVida); + DrAppToastMsg.showErrorToast(TranslationBase.of(context).narcoticMedicineCanOnlyBePrescribedFromVida); Navigator.pop(context); return; } diff --git a/lib/screens/prescription/prescription_checkout_screen.dart b/lib/screens/prescription/prescription_checkout_screen.dart index e9bcbbcb..b336bde3 100644 --- a/lib/screens/prescription/prescription_checkout_screen.dart +++ b/lib/screens/prescription/prescription_checkout_screen.dart @@ -37,21 +37,13 @@ class PrescriptionCheckOutScreen extends StatefulWidget { final List prescriptionList; final ProcedureTempleteDetailsModel groupProcedures; - const PrescriptionCheckOutScreen( - {Key key, - this.model, - this.patient, - this.prescriptionList, - this.groupProcedures}) - : super(key: key); + const PrescriptionCheckOutScreen({Key key, this.model, this.patient, this.prescriptionList, this.groupProcedures}) : super(key: key); @override - _PrescriptionCheckOutScreenState createState() => - _PrescriptionCheckOutScreenState(); + _PrescriptionCheckOutScreenState createState() => _PrescriptionCheckOutScreenState(); } -class _PrescriptionCheckOutScreenState - extends State { +class _PrescriptionCheckOutScreenState extends State { postPrescription( {String duration, String doseTimeIn, @@ -68,8 +60,7 @@ class _PrescriptionCheckOutScreenState String icdCode, PatiantInformtion patient, String patientType}) async { - PostPrescriptionReqModel postProcedureReqModel = - new PostPrescriptionReqModel(); + PostPrescriptionReqModel postProcedureReqModel = new PostPrescriptionReqModel(); List prescriptionList = List(); postProcedureReqModel.appointmentNo = patient.appointmentNo; @@ -121,8 +112,7 @@ class _PrescriptionCheckOutScreenState DateTime selectedDate; int strengthChar; GetMedicationResponseModel _selectedMedication; - GlobalKey key = - new GlobalKey>(); + GlobalKey key = new GlobalKey>(); TextEditingController drugIdController = TextEditingController(); TextEditingController doseController = TextEditingController(); @@ -160,8 +150,7 @@ class _PrescriptionCheckOutScreenState onVoiceText() async { new SpeechToText(context: context).showAlertDialog(context); var lang = TranslationBase.of(AppGlobal.CONTEX).locale.languageCode; - bool available = await speech.initialize( - onStatus: statusListener, onError: errorListener); + bool available = await speech.initialize(onStatus: statusListener, onError: errorListener); if (available) { speech.listen( onResult: resultListener, @@ -204,8 +193,7 @@ class _PrescriptionCheckOutScreenState } Future initSpeechState() async { - bool hasSpeech = await speech.initialize( - onError: errorListener, onStatus: statusListener); + bool hasSpeech = await speech.initialize(onError: errorListener, onStatus: statusListener); print(hasSpeech); if (!mounted) return; } @@ -222,19 +210,13 @@ class _PrescriptionCheckOutScreenState return BaseView( onModelReady: (model) async { // TODO Elham* move this logic to the model - model.getItem( - itemID: int.parse( - widget.groupProcedures.aliasN.replaceAll("item code ;", ""))); + model.getItem(itemID: int.parse(widget.groupProcedures.aliasN.replaceAll("item code ;", ""))); x = model.patientAssessmentList.map((element) { return element.icdCode10ID; }); - GetAssessmentReqModel getAssessmentReqModel = GetAssessmentReqModel( - patientMRN: widget.patient.patientMRN, - episodeID: widget.patient.episodeNo.toString(), - editedBy: '', - doctorID: '', - appointmentNo: widget.patient.appointmentNo); + GetAssessmentReqModel getAssessmentReqModel = + GetAssessmentReqModel(patientMRN: widget.patient.patientMRN, episodeID: widget.patient.episodeNo.toString(), editedBy: '', doctorID: '', appointmentNo: widget.patient.appointmentNo); if (model.medicationStrengthList.length == 0) { await model.getMedicationStrength(); } @@ -265,8 +247,7 @@ class _PrescriptionCheckOutScreenState height: MediaQuery.of(context).size.height * 1.35, color: Color(0xffF8F8F8), child: Padding( - padding: - EdgeInsets.symmetric(horizontal: 12.0, vertical: 10.0), + padding: EdgeInsets.symmetric(horizontal: 12.0, vertical: 10.0), child: Column( children: [ Column( @@ -290,8 +271,7 @@ class _PrescriptionCheckOutScreenState width: 7.0, ), AppText( - TranslationBase.of(context) - .newPrescriptionOrder, + TranslationBase.of(context).newPrescriptionOrder, fontWeight: FontWeight.w700, fontSize: 20, ), @@ -325,16 +305,14 @@ class _PrescriptionCheckOutScreenState child: Column( children: [ AppText( - widget.groupProcedures.procedureName ?? - "", + widget.groupProcedures.procedureName ?? "", bold: true, ), Container( child: Row( children: [ AppText( - TranslationBase.of(context) - .orderType, + TranslationBase.of(context).orderType, fontWeight: FontWeight.w600, ), Radio( @@ -345,8 +323,7 @@ class _PrescriptionCheckOutScreenState setSelectedType(value); }, ), - Text(TranslationBase.of(context) - .regular), + Text(TranslationBase.of(context).regular), ], ), ), @@ -356,10 +333,7 @@ class _PrescriptionCheckOutScreenState child: Row( children: [ Container( - width: MediaQuery.of(context) - .size - .width * - 0.35, + width: MediaQuery.of(context).size.width * 0.35, child: AppTextFieldCustom( height: 40, validationError: strengthError, @@ -372,16 +346,12 @@ class _PrescriptionCheckOutScreenState strengthChar = value.length; }); if (strengthChar >= 5) { - DrAppToastMsg - .showErrorToast( - TranslationBase.of( - context) - .only5DigitsAllowedForStrength, + DrAppToastMsg.showErrorToast( + TranslationBase.of(context).only5DigitsAllowedForStrength, ); } }, - inputType: TextInputType - .numberWithOptions( + inputType: TextInputType.numberWithOptions( decimal: true, ), ), @@ -390,17 +360,13 @@ class _PrescriptionCheckOutScreenState width: 5.0, ), PrescriptionTextFiled( - width: MediaQuery.of(context) - .size - .width * - 0.560, + width: MediaQuery.of(context).size.width * 0.560, element: units, elementError: unitError, keyName: 'description', keyId: 'parameterCode', hintText: 'Select', - elementList: - model.itemMedicineListUnit, + elementList: model.itemMedicineListUnit, okFunction: (selectedValue) { setState(() { units = selectedValue; @@ -413,8 +379,7 @@ class _PrescriptionCheckOutScreenState ), SizedBox(height: spaceBetweenTextFields), PrescriptionTextFiled( - elementList: - model.itemMedicineListRoute, + elementList: model.itemMedicineListRoute, element: route, elementError: routeError, keyId: 'parameterCode', @@ -425,13 +390,11 @@ class _PrescriptionCheckOutScreenState route['isDefault'] = true; }); }, - hintText: - TranslationBase.of(context).route, + hintText: TranslationBase.of(context).route, ), SizedBox(height: spaceBetweenTextFields), PrescriptionTextFiled( - hintText: TranslationBase.of(context) - .frequency, + hintText: TranslationBase.of(context).frequency, elementError: frequencyError, element: frequency, elementList: model.itemMedicineList, @@ -441,21 +404,9 @@ class _PrescriptionCheckOutScreenState setState(() { frequency = selectedValue; frequency['isDefault'] = true; - if (_selectedMedication != null && - duration != null && - frequency != null && - strengthController.text != - null) { + if (_selectedMedication != null && duration != null && frequency != null && strengthController.text != null) { model.getBoxQuantity( - freq: frequency[ - 'parameterCode'], - duration: duration['id'], - itemCode: - _selectedMedication - .itemId, - strength: double.parse( - strengthController - .text)); + freq: frequency['parameterCode'], duration: duration['id'], itemCode: _selectedMedication.itemId, strength: double.parse(strengthController.text)); return; } @@ -463,12 +414,10 @@ class _PrescriptionCheckOutScreenState }), SizedBox(height: spaceBetweenTextFields), PrescriptionTextFiled( - hintText: TranslationBase.of(context) - .doseTime, + hintText: TranslationBase.of(context).doseTime, elementError: doseTimeError, element: doseTime, - elementList: - model.medicationDoseTimeList, + elementList: model.medicationDoseTimeList, keyId: 'id', keyName: 'nameEn', okFunction: (selectedValue) { @@ -477,8 +426,7 @@ class _PrescriptionCheckOutScreenState }); }), SizedBox(height: spaceBetweenTextFields), - if (model - .patientAssessmentList.isNotEmpty) + if (model.patientAssessmentList.isNotEmpty) Container( height: screenSize.height * 0.070, width: double.infinity, @@ -486,47 +434,19 @@ class _PrescriptionCheckOutScreenState child: Row( children: [ Container( - width: MediaQuery.of(context) - .size - .width * - 0.29, + width: MediaQuery.of(context).size.width * 0.29, child: TextField( - decoration: - textFieldSelectorDecoration( - model - .patientAssessmentList[ - 0] - .icdCode10ID - .toString(), - indication != null - ? indication[ - 'name'] - : null, - false), + decoration: textFieldSelectorDecoration(model.patientAssessmentList[0].icdCode10ID.toString(), indication != null ? indication['name'] : null, false), enabled: true, readOnly: true, ), ), Container( - width: MediaQuery.of(context) - .size - .width * - 0.65, + width: MediaQuery.of(context).size.width * 0.65, color: Colors.white, child: TextField( maxLines: 5, - decoration: - textFieldSelectorDecoration( - model - .patientAssessmentList[ - 0] - .asciiDesc - .toString(), - indication != null - ? indication[ - 'name'] - : null, - false), + decoration: textFieldSelectorDecoration(model.patientAssessmentList[0].asciiDesc.toString(), indication != null ? indication['name'] : null, false), enabled: true, readOnly: true, ), @@ -539,16 +459,10 @@ class _PrescriptionCheckOutScreenState height: screenSize.height * 0.070, color: Colors.white, child: InkWell( - onTap: () => - selectDate(context, widget.model), + onTap: () => selectDate(context, widget.model), child: TextField( - decoration: textFieldSelectorDecoration( - TranslationBase.of(context) - .date, - selectedDate != null - ? "${AppDateUtils.convertStringToDateFormat(selectedDate.toString(), "yyyy-MM-dd")}" - : null, - true, + decoration: textFieldSelectorDecoration(TranslationBase.of(context).date, + selectedDate != null ? "${AppDateUtils.convertStringToDateFormat(selectedDate.toString(), "yyyy-MM-dd")}" : null, true, suffixIcon: Icon( Icons.calendar_today, color: Colors.black, @@ -561,28 +475,19 @@ class _PrescriptionCheckOutScreenState PrescriptionTextFiled( element: duration, elementError: durationError, - hintText: TranslationBase.of(context) - .duration, - elementList: - model.medicationDurationList, + hintText: TranslationBase.of(context).duration, + elementList: model.medicationDurationList, keyName: 'nameEn', keyId: 'id', okFunction: (selectedValue) { setState(() { duration = selectedValue; - if (_selectedMedication != null && - duration != null && - frequency != null && - strengthController.text != - null) { + if (_selectedMedication != null && duration != null && frequency != null && strengthController.text != null) { model.getBoxQuantity( - freq: - frequency['parameterCode'], + freq: frequency['parameterCode'], duration: duration['id'], - itemCode: - _selectedMedication.itemId, - strength: double.parse( - strengthController.text), + itemCode: _selectedMedication.itemId, + strength: double.parse(strengthController.text), ); box = model.boxQuintity; @@ -595,20 +500,13 @@ class _PrescriptionCheckOutScreenState SizedBox(height: spaceBetweenTextFields), SizedBox(height: spaceBetweenTextFields), Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.all( - Radius.circular(6.0)), - border: Border.all( - width: 1.0, - color: HexColor("#CCCCCC"))), + decoration: BoxDecoration(borderRadius: BorderRadius.all(Radius.circular(6.0)), border: Border.all(width: 1.0, color: HexColor("#CCCCCC"))), child: Stack( children: [ TextFields( maxLines: 6, minLines: 4, - hintText: - TranslationBase.of(context) - .instruction, + hintText: TranslationBase.of(context).instruction, controller: instructionController, //keyboardType: TextInputType.number, ), @@ -622,9 +520,7 @@ class _PrescriptionCheckOutScreenState size: 35, ), onPressed: () { - initSpeechState().then( - (value) => - {onVoiceText()}); + initSpeechState().then((value) => {onVoiceText()}); }, ), ), @@ -633,15 +529,13 @@ class _PrescriptionCheckOutScreenState ), SizedBox(height: spaceBetweenTextFields), Container( - margin: EdgeInsets.all( - SizeConfig.widthMultiplier * 5), + margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5), child: Wrap( alignment: WrapAlignment.center, children: [ AppButton( color: AppGlobal.appGreenColor, - title: TranslationBase.of(context) - .addMedication, + title: TranslationBase.of(context).addMedication, fontWeight: FontWeight.w600, onPressed: () async { if (route != null && @@ -650,101 +544,41 @@ class _PrescriptionCheckOutScreenState frequency != null && units != null && selectedDate != null && - strengthController.text != - "") { - if (double.parse( - strengthController - .text) > - 1000.0) { + strengthController.text != "") { + if (double.parse(strengthController.text) > 1000.0) { DrAppToastMsg.showErrorToast( - TranslationBase.of(context).thousandIsTheMAXForTheStrength,); + TranslationBase.of(context).thousandIsTheMAXForTheStrength, + ); return; } - if (double.parse( - strengthController - .text) < - 0.0) { + if (double.parse(strengthController.text) < 0.0) { DrAppToastMsg.showErrorToast( - TranslationBase.of(context).strengthCanNotBeZero,); + TranslationBase.of(context).strengthCanNotBeZero, + ); return; } - if (formKey.currentState - .validate()) { + if (formKey.currentState.validate()) { Navigator.pop(context); { postPrescription( - icdCode: model - .patientAssessmentList - .isNotEmpty - ? model - .patientAssessmentList[ - 0] - .icdCode10ID - .isEmpty + icdCode: model.patientAssessmentList.isNotEmpty + ? model.patientAssessmentList[0].icdCode10ID.isEmpty ? "test" - : model - .patientAssessmentList[ - 0] - .icdCode10ID - .toString() + : model.patientAssessmentList[0].icdCode10ID.toString() : "test", - dose: strengthController - .text, - doseUnit: model - .itemMedicineListUnit - .length == - 1 - ? model - .itemMedicineListUnit[ - 0][ - 'parameterCode'] - .toString() - : units['parameterCode'] - .toString(), + dose: strengthController.text, + doseUnit: + model.itemMedicineListUnit.length == 1 ? model.itemMedicineListUnit[0]['parameterCode'].toString() : units['parameterCode'].toString(), patient: widget.patient, - doseTimeIn: - doseTime['id'] - .toString(), + doseTimeIn: doseTime['id'].toString(), model: widget.model, - duration: duration['id'] - .toString(), - frequency: model - .itemMedicineList - .length == - 1 - ? model - .itemMedicineList[ - 0][ - 'parameterCode'] - .toString() - : frequency[ - 'parameterCode'] - .toString(), - route: model.itemMedicineListRoute - .length == - 1 - ? model - .itemMedicineListRoute[ - 0][ - 'parameterCode'] - .toString() - : route['parameterCode'] - .toString(), - drugId: (widget - .groupProcedures - .aliasN - .replaceAll( - "item code ;", - "")), - strength: - strengthController - .text, - indication: - indicationController - .text, - instruction: - instructionController - .text, + duration: duration['id'].toString(), + frequency: model.itemMedicineList.length == 1 ? model.itemMedicineList[0]['parameterCode'].toString() : frequency['parameterCode'].toString(), + route: model.itemMedicineListRoute.length == 1 ? model.itemMedicineListRoute[0]['parameterCode'].toString() : route['parameterCode'].toString(), + drugId: (widget.groupProcedures.aliasN.replaceAll("item code ;", "")), + strength: strengthController.text, + indication: indicationController.text, + instruction: instructionController.text, doseTime: selectedDate, ); } @@ -752,52 +586,32 @@ class _PrescriptionCheckOutScreenState } else { setState(() { if (duration == null) { - durationError = - TranslationBase.of( - context) - .fieldRequired; + durationError = TranslationBase.of(context).fieldRequired; } else { durationError = null; } if (doseTime == null) { - doseTimeError = - TranslationBase.of( - context) - .fieldRequired; + doseTimeError = TranslationBase.of(context).fieldRequired; } else { doseTimeError = null; } if (route == null) { - routeError = - TranslationBase.of( - context) - .fieldRequired; + routeError = TranslationBase.of(context).fieldRequired; } else { routeError = null; } if (frequency == null) { - frequencyError = - TranslationBase.of( - context) - .fieldRequired; + frequencyError = TranslationBase.of(context).fieldRequired; } else { frequencyError = null; } if (units == null) { - unitError = - TranslationBase.of( - context) - .fieldRequired; + unitError = TranslationBase.of(context).fieldRequired; } else { unitError = null; } - if (strengthController - .text == - "") { - strengthError = - TranslationBase.of( - context) - .fieldRequired; + if (strengthController.text == "") { + strengthError = TranslationBase.of(context).fieldRequired; } else { strengthError = null; } @@ -849,9 +663,7 @@ class _PrescriptionCheckOutScreenState /// TODO Elham* Use it from the textfeild utils - InputDecoration textFieldSelectorDecoration( - String hintText, String selectedText, bool isDropDown, - {Icon suffixIcon}) { + InputDecoration textFieldSelectorDecoration(String hintText, String selectedText, bool isDropDown, {Icon suffixIcon}) { return InputDecoration( focusedBorder: OutlineInputBorder( borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), From 324792d957302e6e79dd98cc328e71df11f5dcb1 Mon Sep 17 00:00:00 2001 From: Sultan khan <> Date: Wed, 20 Sep 2023 17:15:30 +0300 Subject: [PATCH 23/28] post assessment fix --- .../SOAP/assessment/post_assessment_request_model.dart | 8 ++++++++ .../soap_update/assessment/add_assessment_details.dart | 2 ++ 2 files changed, 10 insertions(+) diff --git a/lib/core/model/SOAP/assessment/post_assessment_request_model.dart b/lib/core/model/SOAP/assessment/post_assessment_request_model.dart index 5cda0524..c71ed174 100644 --- a/lib/core/model/SOAP/assessment/post_assessment_request_model.dart +++ b/lib/core/model/SOAP/assessment/post_assessment_request_model.dart @@ -2,18 +2,24 @@ class PostAssessmentRequestModel { int patientMRN; int appointmentNo; int episodeId; + String createdByName; + int createdBy; List icdCodeDetails; PostAssessmentRequestModel( {this.patientMRN, this.appointmentNo, this.episodeId, + this.createdByName, + this.createdBy, this.icdCodeDetails}); PostAssessmentRequestModel.fromJson(Map json) { patientMRN = json['PatientMRN']; appointmentNo = json['AppointmentNo']; episodeId = json['EpisodeID']; + createdByName = json['CreatedByName']; + createdBy= json['CreatedBy']; if (json['icdCodeDetails'] != null) { icdCodeDetails = new List(); json['icdCodeDetails'].forEach((v) { @@ -27,6 +33,8 @@ class PostAssessmentRequestModel { data['PatientMRN'] = this.patientMRN; data['AppointmentNo'] = this.appointmentNo; data['EpisodeID'] = this.episodeId; + data['CreatedByName'] = this.createdByName; + data['CreatedBy'] = this.createdBy; if (this.icdCodeDetails != null) { data['icdCodeDetails'] = this.icdCodeDetails.map((v) => v.toJson()).toList(); diff --git a/lib/screens/patients/profile/soap_update/assessment/add_assessment_details.dart b/lib/screens/patients/profile/soap_update/assessment/add_assessment_details.dart index 6f564f03..958b919c 100644 --- a/lib/screens/patients/profile/soap_update/assessment/add_assessment_details.dart +++ b/lib/screens/patients/profile/soap_update/assessment/add_assessment_details.dart @@ -452,6 +452,8 @@ class _AddAssessmentDetailsState extends State { patientMRN: widget.patientInfo.patientMRN, episodeId: widget.patientInfo.episodeNo, appointmentNo: widget.patientInfo.appointmentNo, + createdByName: Provider.of(context).doctorProfile.doctorName, + createdBy: Provider.of(context).doctorProfile.doctorID, icdCodeDetails: [ new IcdCodeDetails( remarks: mySelectedAssessment.remark, From 8b515ee14d11a217b2ec2ba9eea746784b1296c2 Mon Sep 17 00:00:00 2001 From: Sultan khan <> Date: Tue, 26 Sep 2023 15:20:35 +0300 Subject: [PATCH 24/28] progress not updated --- .../post_progress_note_request_model.dart | 11 ++++++++++- .../profile/soap_update/plan/update_plan_page.dart | 2 ++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/lib/core/model/SOAP/progress_note/post_progress_note_request_model.dart b/lib/core/model/SOAP/progress_note/post_progress_note_request_model.dart index 2925819d..0476d6f2 100644 --- a/lib/core/model/SOAP/progress_note/post_progress_note_request_model.dart +++ b/lib/core/model/SOAP/progress_note/post_progress_note_request_model.dart @@ -5,6 +5,8 @@ class PostProgressNoteRequestModel { String planNote; dynamic doctorID; dynamic editedBy; + String createdByName; + int createdBy; PostProgressNoteRequestModel( {this.appointmentNo, @@ -12,7 +14,10 @@ class PostProgressNoteRequestModel { this.patientMRN, this.planNote, this.doctorID, - this.editedBy}); + this.editedBy, + this.createdByName, + this.createdBy + }); PostProgressNoteRequestModel.fromJson(Map json) { appointmentNo = json['AppointmentNo']; @@ -21,6 +26,8 @@ class PostProgressNoteRequestModel { planNote = json['PlanNote']; doctorID = json['DoctorID']; editedBy = json['EditedBy']; + createdByName = json['CreatedByName']; + createdBy = json['CreatedBy']; } Map toJson() { @@ -31,6 +38,8 @@ class PostProgressNoteRequestModel { data['PlanNote'] = this.planNote; data['DoctorID'] = this.doctorID; data['EditedBy'] = this.editedBy; + data['CreatedByName'] = this.createdByName; + data['CreatedBy'] = this.createdBy; return data; } } diff --git a/lib/screens/patients/profile/soap_update/plan/update_plan_page.dart b/lib/screens/patients/profile/soap_update/plan/update_plan_page.dart index b41cb4fe..ae472115 100644 --- a/lib/screens/patients/profile/soap_update/plan/update_plan_page.dart +++ b/lib/screens/patients/profile/soap_update/plan/update_plan_page.dart @@ -291,6 +291,8 @@ class _UpdatePlanPageState extends State implements PlanCallBack appointmentNo: widget.patientInfo.appointmentNo, planNote: patientProgressNote.planNote, doctorID: widget.patientInfo.doctorId, + createdBy:widget.patientInfo.doctorId , + createdByName:widget.patientInfo.doctorName , editedBy: ''); if (widget.sOAPViewModel.patientProgressNoteList.isEmpty) { From fde016c38bee153df3a0d38a6f42392684564a4c Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Tue, 3 Oct 2023 12:33:52 +0300 Subject: [PATCH 25/28] updates --- android/app/build.gradle | 2 +- lib/config/config.dart | 4 ++-- .../assessment/add_assessment_details.dart | 15 +++++++-------- 3 files changed, 10 insertions(+), 11 deletions(-) diff --git a/android/app/build.gradle b/android/app/build.gradle index a518ebf8..5457931e 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -30,7 +30,7 @@ android { signingConfigs { release { - storeFile file('/Users/mohamedmekawy/Documents/Work/DoctorApp/android/doctor app key') + storeFile file('/Users/mohamedmekawy/Documents/Work/DoctorApp/android/doctor_app_key') storePassword 'Hmgdoctor1234' keyAlias 'hmgdoctor' keyPassword 'Hmgdoctor1234' diff --git a/lib/config/config.dart b/lib/config/config.dart index d8dfab93..a3a12461 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -10,9 +10,9 @@ const BASE_URL_LIVE_CARE = 'https://livecare.hmg.com/'; // const BASE_URL = 'https://uat.hmgwebservices.com/'; -// const BASE_URL = 'https://vidauat.cloudsolutions.com.sa/'; //Vida Plus URL +const BASE_URL = 'https://vidauat.cloudsolutions.com.sa/'; //Vida Plus URL -const BASE_URL = 'https://vidamergeuat.cloudsolutions.com.sa/'; //Vida Plus URL +// const BASE_URL = 'https://vidamergeuat.cloudsolutions.com.sa/'; //Vida Plus URL const PHARMACY_ITEMS_URL = "Services/Lists.svc/REST/GetPharmcyItems_Region_enh"; const PHARMACY_LIST_URL = "Services/Patients.svc/REST/GetPharmcyList"; diff --git a/lib/screens/patients/profile/soap_update/assessment/add_assessment_details.dart b/lib/screens/patients/profile/soap_update/assessment/add_assessment_details.dart index 597bd150..ef0c8cd7 100644 --- a/lib/screens/patients/profile/soap_update/assessment/add_assessment_details.dart +++ b/lib/screens/patients/profile/soap_update/assessment/add_assessment_details.dart @@ -378,14 +378,13 @@ class _AddAssessmentDetailsState extends State { } else { Map profile = await sharedPref.getObj(DOCTOR_PROFILE); DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile); - PostAssessmentRequestModel postAssessmentRequestModel = - new PostAssessmentRequestModel( - patientMRN: widget.patientInfo.patientMRN, - episodeId: widget.patientInfo.episodeNo, - appointmentNo: widget.patientInfo.appointmentNo, - createdByName: doctorProfile.doctorName, - createdBy: doctorProfile.doctorID, - icdCodeDetails: [ + PostAssessmentRequestModel postAssessmentRequestModel = new PostAssessmentRequestModel( + patientMRN: widget.patientInfo.patientMRN, + episodeId: widget.patientInfo.episodeNo, + appointmentNo: widget.patientInfo.appointmentNo, + createdByName: doctorProfile.doctorName, + createdBy: doctorProfile.doctorID, + icdCodeDetails: [ new IcdCodeDetails( remarks: mySelectedAssessment.remark, complexDiagnosis: true, From bee21f1123e6106bd30ee7bda97df954ccad66f7 Mon Sep 17 00:00:00 2001 From: Sultan khan <> Date: Wed, 4 Oct 2023 09:50:02 +0300 Subject: [PATCH 26/28] scroll added on add assessment --- .../assessment/add_assessment_details.dart | 190 ++++++++++-------- 1 file changed, 108 insertions(+), 82 deletions(-) diff --git a/lib/screens/patients/profile/soap_update/assessment/add_assessment_details.dart b/lib/screens/patients/profile/soap_update/assessment/add_assessment_details.dart index ef0c8cd7..af217257 100644 --- a/lib/screens/patients/profile/soap_update/assessment/add_assessment_details.dart +++ b/lib/screens/patients/profile/soap_update/assessment/add_assessment_details.dart @@ -124,8 +124,8 @@ class _AddAssessmentDetailsState extends State { SizedBox( height: 10, ), - Container( - child: InkWell( + Column( + children:[ InkWell( onTap: model.listOfICD10 != null ? () { setState(() { @@ -134,87 +134,113 @@ class _AddAssessmentDetailsState extends State { }); } : null, - child: widget.mySelectedAssessment.selectedICD == null - ? CustomAutoCompleteTextField( - isShowError: isFormSubmitted && widget.mySelectedAssessment.selectedICD == null, - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - mainAxisSize: MainAxisSize.min, - children: [ - Expanded( - flex: 4, - child: AutoCompleteTextField( - decoration: TextFieldsUtils.textFieldSelectorDecoration(TranslationBase.of(context).nameOrICD, null, true, suffixIcon: null), - controller: icdNameController, - itemSubmitted: (item) => setState(() { - widget.mySelectedAssessment.selectedICD = item; - // icdNameController.text = '${item.code.trim()}/${item.description}'; - icdNameController.text = '${item.description}'; - }), - key: key, - suggestions: model.listOfICD10, - suggestionsAmount: 10, - itemBuilder: (context, suggestion) => - new Padding(child: AppText(suggestion.description + " / " + suggestion.code.toString(), fontSize: 12.0), padding: EdgeInsets.all(8.0)), - itemSorter: (a, b) => 1, - itemFilter: (suggestion, input) => - // suggestion.description.toLowerCase().startsWith(input.toLowerCase()) || - // suggestion.description.toLowerCase().startsWith(input.toLowerCase()) || - // suggestion.code.toLowerCase().startsWith(input.toLowerCase()), - suggestion.description.toLowerCase().contains(input.toLowerCase()) || - // suggestion.description.toLowerCase().startsWith(input.toLowerCase()) || - suggestion.code.toLowerCase().contains(input.toLowerCase()), - ), - ), - Expanded( - child: IconButton( - onPressed: () { - print(icdNameController.text); - if (icdNameController.text.length <= 3) { - DrAppToastMsg.showErrorToast("Please enter 4 or more characters"); - } else { - model.listOfICD10.clear(); - model.callAddAssessmentLookupsServices(searchKey: icdNameController.text); - } - }, - icon: Icon(Icons.search), - ), - ), - ], - ), - ) - : AppTextFieldCustom( - height: Utils.getTextFieldHeight(), - onClick: model.listOfICD10 != null - ? () { - setState(() { - widget.mySelectedAssessment.selectedICD = null; - icdNameController.text = null; - }); - } - : null, - hintText: TranslationBase.of(context).nameOrICD, - maxLines: 1, - minLines: 1, - controller: icdNameController, - enabled: true, - isTextFieldHasSuffix: true, - suffixIcon: IconButton( - onPressed: () { - print(icdNameController.text); - if (icdNameController.text.length <= 3) { - DrAppToastMsg.showErrorToast("Please enter 4 or more characters"); - } else { - model.listOfICD10.clear(); - model.callAddAssessmentLookupsServices(searchKey: icdNameController.text); - } - }, - icon: Icon( - Icons.search, - color: Colors.grey.shade600, - )), + child: AppTextFieldCustom( + onChanged: (text){ + setState(() { + icdNameController.text; + }); + }, + height: Utils.getTextFieldHeight(), + onClick: model.listOfICD10 != null + ? () { + setState(() { + widget.mySelectedAssessment.selectedICD = null; + icdNameController.text = null; + }); + } + : null, + hintText: TranslationBase.of(context).nameOrICD, + maxLines: 1, + minLines: 1, + controller: icdNameController, + enabled: true, + isTextFieldHasSuffix: true, + suffixIcon: IconButton( + onPressed: () { + print(icdNameController.text); + if (icdNameController.text.length <= 3) { + DrAppToastMsg.showErrorToast("Please enter 4 or more characters"); + } else { + model.listOfICD10.clear(); + model.callAddAssessmentLookupsServices(searchKey: icdNameController.text); + } + }, + icon: Icon( + Icons.search, + color: Colors.grey.shade600, )), - ), + )), + + model.listOfICD10.length >0 && icdNameController.text.isNotEmpty ? Container( + color: Colors.white, + height: MediaQuery.of(context).size.height * 0.4, //height to 9% of screen height, + child:ListView.builder( + shrinkWrap: true, + itemCount: model.listOfICD10.length, + itemBuilder: (context, index) { + return InkWell(child:ListTile( + title: AppText( model.listOfICD10[index].description + " / " + model.listOfICD10[index].code.toString(), fontSize: 12.0)), + onTap: (){ + + widget.mySelectedAssessment.selectedICD = model.listOfICD10[index]; + icdNameController.text = model.listOfICD10[index].description; + model.listOfICD10.clear(); + setState(() { + + }); + } + ); + + }, + )) :SizedBox() + // CustomAutoCompleteTextField( + // isShowError: isFormSubmitted && widget.mySelectedAssessment.selectedICD == null, + // child: Row( + // mainAxisAlignment: MainAxisAlignment.spaceBetween, + // mainAxisSize: MainAxisSize.min, + // children: [ + // AutoCompleteTextField( + // decoration: TextFieldsUtils.textFieldSelectorDecoration(TranslationBase.of(context).nameOrICD, null, true, suffixIcon: null), + // controller: icdNameController, + // itemSubmitted: (item) => setState(() { + // widget.mySelectedAssessment.selectedICD = item; + // // icdNameController.text = '${item.code.trim()}/${item.description}'; + // icdNameController.text = '${item.description}'; + // }), + // key: key, + // suggestions: model.listOfICD10, + // suggestionsAmount: model.listOfICD10.length, + // itemBuilder: (context, suggestion) => + // new Padding(child: AppText(suggestion.description + " / " + suggestion.code.toString(), fontSize: 12.0), padding: EdgeInsets.all(8.0)), + // itemSorter: (a, b) => 1, + // itemFilter: (suggestion, input) => + // // suggestion.description.toLowerCase().startsWith(input.toLowerCase()) || + // // suggestion.description.toLowerCase().startsWith(input.toLowerCase()) || + // // suggestion.code.toLowerCase().startsWith(input.toLowerCase()), + // suggestion.description.toLowerCase().contains(input.toLowerCase()) || + // // suggestion.description.toLowerCase().startsWith(input.toLowerCase()) || + // suggestion.code.toLowerCase().contains(input.toLowerCase()), + // + // ), + // Expanded( + // child: IconButton( + // onPressed: () { + // print(icdNameController.text); + // if (icdNameController.text.length <= 3) { + // DrAppToastMsg.showErrorToast("Please enter 4 or more characters"); + // } else { + // model.listOfICD10.clear(); + // model.callAddAssessmentLookupsServices(searchKey: icdNameController.text); + // } + // }, + // icon: Icon(Icons.search), + // ), + // ), + // ], + // ), + // ) + + ]), if (widget.mySelectedAssessment.selectedICD != null) Column( children: [ From 320af7d9e00462e768000a7f4f8acff5d6fad33b Mon Sep 17 00:00:00 2001 From: Sultan khan <> Date: Tue, 10 Oct 2023 16:09:17 +0300 Subject: [PATCH 27/28] patch allergies updated. --- .../profile/soap_update/subjective/update_subjective_page.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/screens/patients/profile/soap_update/subjective/update_subjective_page.dart b/lib/screens/patients/profile/soap_update/subjective/update_subjective_page.dart index 6d7c7f51..de4fa392 100644 --- a/lib/screens/patients/profile/soap_update/subjective/update_subjective_page.dart +++ b/lib/screens/patients/profile/soap_update/subjective/update_subjective_page.dart @@ -270,6 +270,6 @@ class _UpdateSubjectivePageState extends State implements @override Function nextFunction(model) { - addSubjectiveInfo(model: model, myAllergiesList: myAllergiesList, myHistoryList: myHistoryList); + addSubjectiveInfo(model: model, myAllergiesList: myAllergiesList.where((i) => i.isChecked).toList(), myHistoryList: myHistoryList); } } From b5851f384d0b20a5b4fd20733f30dd7129068f8c Mon Sep 17 00:00:00 2001 From: Sultan khan <> Date: Thu, 7 Dec 2023 12:29:19 +0300 Subject: [PATCH 28/28] DOCTOR ROTA AND LAB RAD CHANGES --- lib/client/base_app_client.dart | 16 + lib/config/config.dart | 10 +- lib/config/localized_values.dart | 5 + lib/core/model/dashboard/doctor_schedule.dart | 80 +++ lib/core/model/labs/patient_lab_orders.dart | 8 +- lib/core/model/radiology/final_radiology.dart | 6 +- lib/core/service/home/dasboard_service.dart | 4 +- lib/core/service/home/schedule_service.dart | 25 +- .../lab_order/labs_service.dart | 2 +- .../radiology/radiology_service.dart | 4 +- lib/core/viewModel/dashboard_view_model.dart | 4 +- lib/core/viewModel/radiology_view_model.dart | 4 +- lib/core/viewModel/schedule_view_model.dart | 14 + .../doctor_schedule/doctor_schedule.dart | 465 ++++++++++++++++++ .../laboratory_result_page.dart | 1 + .../laboratory_result_widget.dart | 8 +- .../radiology/radiology_details_page.dart | 5 +- .../translations_delegate_base_utils.dart | 5 +- lib/widgets/shared/app_drawer_widget.dart | 24 + lib/widgets/shared/app_scaffold_widget.dart | 6 +- 20 files changed, 674 insertions(+), 22 deletions(-) create mode 100644 lib/core/model/dashboard/doctor_schedule.dart create mode 100644 lib/screens/doctor_schedule/doctor_schedule.dart diff --git a/lib/client/base_app_client.dart b/lib/client/base_app_client.dart index 8e7a227f..2faae2c9 100644 --- a/lib/client/base_app_client.dart +++ b/lib/client/base_app_client.dart @@ -167,6 +167,7 @@ class BaseAppClient { } } + postPatient(String endPoint, {Map body, Function(dynamic response, int statusCode) onSuccess, @@ -346,4 +347,19 @@ class BaseAppClient { } return error; } + get({String endPoint, + Function(dynamic response, int statusCode) onSuccess, + Function(String error, int statusCode) onFailure}) async{ + String token = await sharedPref.getString(TOKEN); + String url = DOCTOR_ROTATION + endPoint+'&token='+token; + + final response = await http.get(Uri.parse(url)); + final int statusCode = response.statusCode; + if (statusCode < 200 || statusCode >= 400) { + onFailure(Utils.generateContactAdminMsg(), statusCode); + } else { + var parsed = json.decode(response.body.toString()); + onSuccess(parsed,statusCode); + } + } } diff --git a/lib/config/config.dart b/lib/config/config.dart index a3a12461..e248f70e 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -5,12 +5,15 @@ const ONLY_NUMBERS = "[0-9]"; const ONLY_LETTERS = "[a-zA-Z &'\"]"; const ONLY_DATE = "[0-9/]"; const BASE_URL_LIVE_CARE = 'https://livecare.hmg.com/'; +const DOCTOR_ROTATION = 'https://doctorrota.hmg.com/'; // const BASE_URL_LIVE_CARE = 'https://livecareuat.hmg.com/'; // const BASE_URL = 'https://hmgwebservices.com/'; -// const BASE_URL = 'https://uat.hmgwebservices.com/'; +const BASE_URL = 'https://uat.hmgwebservices.com/'; -const BASE_URL = 'https://vidauat.cloudsolutions.com.sa/'; //Vida Plus URL +// const BASE_URL = 'https://webservices.hmg.com/'; + +// const BASE_URL = 'https://vidauat.cloudsolutions.com.sa/'; //Vida Plus URL // const BASE_URL = 'https://vidamergeuat.cloudsolutions.com.sa/'; //Vida Plus URL @@ -272,6 +275,9 @@ const GET_STP_MASTER_LIST = "Services/DoctorApplication.svc/REST/DoctorApp_GetST const DOCTOR_ER_SIGN_ASSESSMENT = "Services/DoctorApplication.svc/REST/DoctorApp_DoctorERSignAssessment"; + +const DOCTOR_SCHEDULE = "api/ScheduledSchedule/GetallSchedulebyUser"; + var selectedPatientType = 1; //*********change value to decode json from Dropdown ************ diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 1dac83f3..dfdcbd8e 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -1146,4 +1146,9 @@ const Map> localizedValues = { "yourOrderAddedSuccessfully": {"en": "Your Order Added Successfully", "ar":"تم إضافة طلبك بنجاح"}, "youCannotAddOnlySpaces": {"en": "You Can't Add Only Spaces", "ar":""}, "conditionDescription": {"en": "Condition Description", "ar":"لا يمكنك إضافة مسافات فقط"}, + "doctorSchedule": {"en": "Doctor Schedule", "ar":"جدول الطبيب"}, + "doctorRota": {"en": "Doctor Rota", "ar":"دوران الطبيب"}, + "dateFrom": {"en": "Date From", "ar":"التاريخ من"}, + "searchFindSchedule": {"en": "Search and find out the doctor’s schedule ", "ar":"بحث ومعرفة جدول الطبيب"} + }; diff --git a/lib/core/model/dashboard/doctor_schedule.dart b/lib/core/model/dashboard/doctor_schedule.dart new file mode 100644 index 00000000..ab8cf192 --- /dev/null +++ b/lib/core/model/dashboard/doctor_schedule.dart @@ -0,0 +1,80 @@ +import 'dart:convert'; +List doctorScheduleFromJson(String str) => List.from(json.decode(str).map((x) => DoctorSchedule.fromJson(x))); + +String doctorScheduleToJson(List data) => json.encode(List.from(data.map((x) => x.toJson()))); + +class DoctorSchedule { + int scheduledid; + int status; + String clinicname; + int clinicid; + List scheduleforuser; + + DoctorSchedule({ + this.scheduledid, + this.status, + this.clinicname, + this.clinicid, + this.scheduleforuser, + }); + + factory DoctorSchedule.fromJson(Map json) => DoctorSchedule( + scheduledid: json["scheduledid"], + status: json["status"], + clinicname: json["clinicname"], + clinicid: json["clinicid"], + scheduleforuser: List.from(json["scheduleforuser"].map((x) => Scheduleforuser.fromJson(x))), + ); + + Map toJson() => { + "scheduledid": scheduledid, + "status": status, + "clinicname": clinicname, + "clinicid": clinicid, + "scheduleforuser": List.from(scheduleforuser.map((x) => x.toJson())), + }; +} + +class Scheduleforuser { + DateTime days; + int duration; + List shiftforuser; + + Scheduleforuser({ + this.days, + this.duration, + this.shiftforuser, + }); + + factory Scheduleforuser.fromJson(Map json) => Scheduleforuser( + days: DateTime.parse(json["days"]), + duration: json["duration"], + shiftforuser: List.from(json["shiftforuser"].map((x) => Shiftforuser.fromJson(x))), + ); + + Map toJson() => { + "days": days.toIso8601String(), + "duration": duration, + "shiftforuser": List.from(shiftforuser.map((x) => x.toJson())), + }; +} + +class Shiftforuser { + int fromtime; + int totime; + + Shiftforuser({ + this.fromtime, + this.totime, + }); + + factory Shiftforuser.fromJson(Map json) => Shiftforuser( + fromtime: json["fromtime"], + totime: json["totime"], + ); + + Map toJson() => { + "fromtime": fromtime, + "totime": totime, + }; +} diff --git a/lib/core/model/labs/patient_lab_orders.dart b/lib/core/model/labs/patient_lab_orders.dart index b481df54..d4d621b0 100644 --- a/lib/core/model/labs/patient_lab_orders.dart +++ b/lib/core/model/labs/patient_lab_orders.dart @@ -36,7 +36,7 @@ class PatientLabOrders { String setupID; List speciality; bool isLiveCareAppointment; - + String invoiceType; PatientLabOrders( {this.actualDoctorRate, this.clinicDescription, @@ -71,7 +71,9 @@ class PatientLabOrders { this.qR, this.setupID, this.speciality, - this.isLiveCareAppointment}); + this.isLiveCareAppointment, + this.invoiceType + }); PatientLabOrders.fromJson(Map json) { actualDoctorRate = json['ActualDoctorRate']; @@ -108,6 +110,7 @@ class PatientLabOrders { qR = json['QR']; setupID = json['SetupID']; isLiveCareAppointment = json['IsLiveCareAppointment']; + invoiceType = json["InvoiceType"]; // speciality = json['Speciality'].cast(); } @@ -147,6 +150,7 @@ class PatientLabOrders { data['SetupID'] = this.setupID; data['Speciality'] = this.speciality; data['IsLiveCareAppointment'] = this.isLiveCareAppointment; + data['InvoiceType'] = this.invoiceType; return data; } } diff --git a/lib/core/model/radiology/final_radiology.dart b/lib/core/model/radiology/final_radiology.dart index 90eb7d18..f5fae7c6 100644 --- a/lib/core/model/radiology/final_radiology.dart +++ b/lib/core/model/radiology/final_radiology.dart @@ -45,7 +45,7 @@ class FinalRadiology { bool isRadMedicalReport; bool isLiveCareAppodynamicment; bool isRecordFromVidaPlus; - + String invoiceType; FinalRadiology( {this.setupID, this.projectID, @@ -89,7 +89,7 @@ class FinalRadiology { this.speciality, this.isCVI, this.isRadMedicalReport, - this.isLiveCareAppodynamicment, this.isRecordFromVidaPlus}); + this.isLiveCareAppodynamicment, this.isRecordFromVidaPlus, this.invoiceType}); FinalRadiology.fromJson(Map json) { try { @@ -137,6 +137,7 @@ class FinalRadiology { isCVI = json['isCVI']; isRadMedicalReport = json['isRadMedicalReport']; isRecordFromVidaPlus = json['IsRecordFromVidaPlus']; + invoiceType = json["InvoiceType"]; } catch (e) { print(e); } @@ -186,6 +187,7 @@ class FinalRadiology { data['isCVI'] = this.isCVI; data['isRadMedicalReport'] = this.isRadMedicalReport; data['IsRecordFromVidaPlus'] = this.isRecordFromVidaPlus; + data["InvoiceType"] =invoiceType; return data; } } diff --git a/lib/core/service/home/dasboard_service.dart b/lib/core/service/home/dasboard_service.dart index 43d76c80..fe664baa 100644 --- a/lib/core/service/home/dasboard_service.dart +++ b/lib/core/service/home/dasboard_service.dart @@ -2,11 +2,13 @@ import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/core/service/base/base_service.dart'; import 'package:doctor_app_flutter/core/model/dashboard/dashboard_model.dart'; +import '../../model/dashboard/doctor_schedule.dart'; + class DashboardService extends BaseService { List _dashboardItemsList = []; List get dashboardItemsList => _dashboardItemsList; - + bool hasVirtualClinic = false; String sServiceID; diff --git a/lib/core/service/home/schedule_service.dart b/lib/core/service/home/schedule_service.dart index f884516f..c0167592 100644 --- a/lib/core/service/home/schedule_service.dart +++ b/lib/core/service/home/schedule_service.dart @@ -3,13 +3,17 @@ import 'package:doctor_app_flutter/core/service/base/base_service.dart'; import 'package:doctor_app_flutter/core/model/doctor/list_doctor_working_hours_table_model.dart'; import 'package:doctor_app_flutter/core/model/doctor/request_schedule.dart'; +import '../../../config/shared_pref_kay.dart'; +import '../../model/dashboard/doctor_schedule.dart'; + class ScheduleService extends BaseService { List get listDoctorWorkingHoursTable => _listDoctorWorkingHoursTable; List _listDoctorWorkingHoursTable = []; RequestSchedule _requestSchedule = RequestSchedule(); - + List _doctorRota= []; + List get doctorRotation => _doctorRota; Future getDoctorSchedule() async { await baseAppClient.post(GET_DOCTOR_WORKING_HOURS_TABLE, onSuccess: (dynamic response, int statusCode) { @@ -23,4 +27,23 @@ class ScheduleService extends BaseService { super.error = error; }, body: _requestSchedule.toJson(), isFallLanguage: true); } + + + Future getDoctorRota(String fromDate, String toDate,{int pageNo = 1}) async{ + hasError = false; + String doctorId = '7826'; //await sharedPref.getString(DOCTOR_ID); + String url = DOCTOR_SCHEDULE + '?userid='+doctorId+'&fromDate='+fromDate+'&toDate='+toDate+'&pagenumber='+pageNo.toString()+'&pagesize=10'; + await baseAppClient.get( endPoint: url, onSuccess: (dynamic response, int statusCode) { + _doctorRota =[]; + + response['response'].forEach((res){ + _doctorRota.add(DoctorSchedule.fromJson(res)); + }); + print(_doctorRota); + }, onFailure: (String error, int statusCode) { + print(error); + }, + + ); + } } diff --git a/lib/core/service/patient_medical_file/lab_order/labs_service.dart b/lib/core/service/patient_medical_file/lab_order/labs_service.dart index e4cb93bf..0e0e99c0 100644 --- a/lib/core/service/patient_medical_file/lab_order/labs_service.dart +++ b/lib/core/service/patient_medical_file/lab_order/labs_service.dart @@ -112,7 +112,7 @@ class LabsService extends BaseService { body['SetupID'] = patientLabOrder.setupID; body['ProjectID'] = patientLabOrder.projectID; body['ClinicID'] = patientLabOrder.clinicID ?? 0; - + body['InvoiceType'] = patientLabOrder.invoiceType ??""; await baseAppClient.postPatient(url, patient: patient, onSuccess: (dynamic response, int statusCode) { patientLabSpecialResult = []; diff --git a/lib/core/service/patient_medical_file/radiology/radiology_service.dart b/lib/core/service/patient_medical_file/radiology/radiology_service.dart index 22765c6d..1dca2462 100644 --- a/lib/core/service/patient_medical_file/radiology/radiology_service.dart +++ b/lib/core/service/patient_medical_file/radiology/radiology_service.dart @@ -10,14 +10,14 @@ class RadiologyService extends BaseService { String url = ''; bool isRadiologyVIDAPlus = false; - Future getRadImageURL({int invoiceNo, int lineItem, int projectId, bool isVidaPlus, @required PatiantInformtion patient}) async { + Future getRadImageURL({int invoiceNo, int lineItem, int projectId, bool isVidaPlus, @required PatiantInformtion patient,String invoiceType}) async { hasError = false; final Map body = new Map(); body['InvoiceNo'] = isVidaPlus ? "0" : invoiceNo; body['InvoiceNo_VP'] = isVidaPlus ? invoiceNo : "0"; body['LineItemNo'] = lineItem; body['ProjectID'] = projectId; - + body["InvoiceType"] = invoiceType; await baseAppClient.postPatient(GET_RAD_IMAGE_URL, patient: patient, onSuccess: (dynamic response, int statusCode) { url = response['Data']; }, onFailure: (String error, int statusCode) { diff --git a/lib/core/viewModel/dashboard_view_model.dart b/lib/core/viewModel/dashboard_view_model.dart index 7b1529fd..76e4efcd 100644 --- a/lib/core/viewModel/dashboard_view_model.dart +++ b/lib/core/viewModel/dashboard_view_model.dart @@ -1,4 +1,5 @@ import 'package:doctor_app_flutter/core/enum/view_state.dart'; +import 'package:doctor_app_flutter/core/model/dashboard/doctor_schedule.dart'; import 'package:doctor_app_flutter/core/service/home/dasboard_service.dart'; import 'package:doctor_app_flutter/core/service/home/doctor_reply_service.dart'; import 'package:doctor_app_flutter/core/service/special_clinics/special_clinic_service.dart'; @@ -30,7 +31,6 @@ class DashboardViewModel extends BaseViewModel { List get specialClinicalCareList => _specialClinicsService.specialClinicalCareList; - Future startHomeScreenServices(ProjectViewModel projectsProvider, AuthenticationViewModel authProvider) async { setState(ViewState.Busy); @@ -130,4 +130,6 @@ class DashboardViewModel extends BaseViewModel { setState(ViewState.Idle); } } + + } diff --git a/lib/core/viewModel/radiology_view_model.dart b/lib/core/viewModel/radiology_view_model.dart index e49af610..a5241ed9 100644 --- a/lib/core/viewModel/radiology_view_model.dart +++ b/lib/core/viewModel/radiology_view_model.dart @@ -53,9 +53,9 @@ class RadiologyViewModel extends BaseViewModel { String get radImageURL => _radiologyService.url; - getRadImageURL({int invoiceNo, int lineItem, int projectId, bool isVidaPlus, @required PatiantInformtion patient}) async { + getRadImageURL({int invoiceNo, int lineItem, int projectId, bool isVidaPlus, @required PatiantInformtion patient, String invoiceType}) async { setState(ViewState.Busy); - await _radiologyService.getRadImageURL(invoiceNo: invoiceNo, lineItem: lineItem, projectId: projectId, isVidaPlus: isVidaPlus, patient: patient); + await _radiologyService.getRadImageURL(invoiceNo: invoiceNo, lineItem: lineItem, projectId: projectId, isVidaPlus: isVidaPlus, patient: patient, invoiceType: invoiceType); if (_radiologyService.hasError) { error = _radiologyService.error; setState(ViewState.Error); diff --git a/lib/core/viewModel/schedule_view_model.dart b/lib/core/viewModel/schedule_view_model.dart index d5bc45b7..234199ea 100644 --- a/lib/core/viewModel/schedule_view_model.dart +++ b/lib/core/viewModel/schedule_view_model.dart @@ -1,4 +1,5 @@ import 'package:doctor_app_flutter/core/enum/view_state.dart'; +import 'package:doctor_app_flutter/core/model/dashboard/doctor_schedule.dart'; import 'package:doctor_app_flutter/core/service/home/schedule_service.dart'; import 'package:doctor_app_flutter/core/model/doctor/list_doctor_working_hours_table_model.dart'; @@ -11,6 +12,8 @@ class ScheduleViewModel extends BaseViewModel { List get listDoctorWorkingHoursTable => _scheduleService.listDoctorWorkingHoursTable; + List get getDoctorRotation => + _scheduleService.doctorRotation; Future getDoctorSchedule() async { setState(ViewState.Busy); await _scheduleService.getDoctorSchedule(); @@ -20,4 +23,15 @@ class ScheduleViewModel extends BaseViewModel { } else setState(ViewState.Idle); } + + Future getDoctorRota(String fromDate, String toDate,{int pageNo=1}) async { + setState(ViewState.Busy); + await _scheduleService.getDoctorRota(fromDate,toDate,pageNo:pageNo); + if (_scheduleService.hasError) { + error = _scheduleService.error; + setState(ViewState.ErrorLocal); + } else { + setState(ViewState.Idle); + } + } } diff --git a/lib/screens/doctor_schedule/doctor_schedule.dart b/lib/screens/doctor_schedule/doctor_schedule.dart new file mode 100644 index 00000000..9bdd4b62 --- /dev/null +++ b/lib/screens/doctor_schedule/doctor_schedule.dart @@ -0,0 +1,465 @@ +import 'package:doctor_app_flutter/core/service/home/dasboard_service.dart'; +import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_datetime_picker/flutter_datetime_picker.dart'; +import 'package:intl/intl.dart'; +import 'package:provider/provider.dart'; +import 'package:flutter_svg/flutter_svg.dart'; +import '../../core/viewModel/project_view_model.dart'; +import '../../core/viewModel/schedule_view_model.dart'; +import '../../icons_app/doctor_app_icons.dart'; +import '../../utils/date-utils.dart'; +import '../../utils/dr_app_toast_msg.dart'; +import '../../utils/translations_delegate_base_utils.dart'; +import '../../widgets/shared/app_scaffold_widget.dart'; +import '../../widgets/shared/errors/error_message.dart'; +import '../base/base_view.dart'; +import '../patients/register_patient/CustomEditableText.dart'; + +class DoctorSchedulePage extends StatefulWidget { + @override + _DoctorSchedulePageState createState() => _DoctorSchedulePageState(); +} + +class _DoctorSchedulePageState extends State { + DashboardService service; + PageController _pageController = PageController(); + double currentPage = 0; + int selectedindex = 0; + List weeks = []; + // List doctorScheduleResponse = []; + int weekMS = 604800 * 1000; + // DoctorList? doctorList; + List freeSlots = []; + bool isPageChange = false; + String fromDate = DateFormat('yyyy-MM-dd').format(DateTime.now()); + String toDate = + DateFormat('yyyy-MM-dd').format(DateTime.now().add(Duration(days: 30))); + // AppSharedPreferences sharedPref = AppSharedPreferences(); + + @override + void initState() { + // this.doctorList = widget.doctorList; + + super.initState(); + } + + @override + Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); + return BaseView( + onModelReady: (model) => model.getDoctorRota(fromDate, toDate), + builder: (_, model, widget2) { + return AppScaffold( + appBarTitle: TranslationBase.of(context).doctorSchedule, + isShowAppBar: true, + baseViewModel: model, + isHomeIcon: false, + isLoading: true, + actionButton: IconButton( + icon: Icon(DoctorApp.search_1), + color: Colors.black, //Colors.black, + onPressed: () => searchSchedule(model), + ), + body: SizedBox( + height: MediaQuery.of(context).size.height, + child: Stack( + children: [ + Column( + children: [ + Padding( + padding: EdgeInsets.only(left: 20), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text( + TranslationBase.of(context).dateFrom + + " " + + DateFormat("dd-MMM").format( + DateFormat('yyyy-MM-dd') + .parse(fromDate)) + + " " + + TranslationBase.of(context).to + + " " + + DateFormat("dd-MMM").format( + DateFormat('yyyy-MM-dd') + .parse(toDate)), + style: TextStyle(fontWeight: FontWeight.w600), + ), + Row( + children: [ + IconButton( + onPressed: () { + + model.getDoctorRota(fromDate, toDate,); + }, + icon: SvgPicture.asset( + 'assets/images/svgs/prev.svg', + height: 25, + width: 10)), + IconButton( + onPressed: () {}, + icon: SvgPicture.asset( + 'assets/images/svgs/next.svg', + height: 25, + width: 10)) + ], + ), + ], + )), + ], + ), + model.getDoctorRotation.length ==0 ? Center( + child: ErrorMessage( + error: TranslationBase.of(context).noDataAvailable, + )) : + Container( + margin: EdgeInsets.only(top: 45), + child: PageView.builder( + controller: _pageController, + itemCount: model.getDoctorRotation.length, + onPageChanged: (index) { + setState(() { + isPageChange = true; + this.currentPage = index.toDouble(); + }); + }, + itemBuilder: (context, index) { + return Container( + child: ListView.builder( + itemCount: model.getDoctorRotation[index] + .scheduleforuser.length, + itemBuilder: (context, index2) => InkWell( + onTap: () { + // final weekDay = weeks[index][index2]['DayName']; + }, + child: Row( + children: [ + Expanded( + flex: 1, + child: Padding( + padding: + projectViewModel.isArabic + ? EdgeInsets.only( + right: 17) + : EdgeInsets.only( + left: 17), + child: Row(children: [ + Column( + children: [ + Text(DateFormat('EEEE') + .format(model + .getDoctorRotation[ + index] + .scheduleforuser[ + index2] + .days) + + // fontSize: 13, + // fontWeight: projectViewModel.isArabic ? FontWeight.w600 : FontWeight.w500, + ), + Text(getDayMonths(model + .getDoctorRotation[ + index] + .scheduleforuser[ + index2] + .days)) + + // fontWeight: FontWeight.bold, + // fontSize: 18, + ], + ) + ])), + ), + Expanded( + flex: 3, + child: ClipRRect( + borderRadius: + const BorderRadius.all( + Radius.circular( + 20.0)), + child: Container( + padding: EdgeInsets.only( + left: 10, + right: 10, + top: 15, + bottom: 20), + margin: EdgeInsets.only( + left: 20, + right: 20, + top: 7, + bottom: 7), + decoration: BoxDecoration( + boxShadow: [ + model + .getDoctorRotation[ + index] + .scheduleforuser[ + index2] + .days + .toString() + .substring( + 0, + 10) == + DateTime.now() + .toString() + .substring( + 0, 10) + ? BoxShadow( + color: Colors + .green, + offset: Offset( + projectViewModel.isArabic + ? 5 + : -5, + 0)) + : BoxShadow( + color: Colors + .grey[ + 100], + blurRadius: + 5, + spreadRadius: + 4, + offset: + Offset( + 0, + 10), + ), + ], + borderRadius: + const BorderRadius.all( + Radius.circular( + 10.0)), + color: Colors.white), + child: Column( + crossAxisAlignment: + CrossAxisAlignment + .start, + children: [ + model + .getDoctorRotation[ + index] + .scheduleforuser[ + index2] + .days + .toString() + .substring( + 0, + 10) == + DateTime.now() + .toString() + .substring( + 0, + 10) + ? Text( + TranslationBase.of( + context) + .today, + style: + TextStyle( + color: Colors + .green, + fontWeight: + FontWeight + .w600, + fontSize: + 12, + )) + : SizedBox(), + // : SizedBox(), + Row( + children: [ + Expanded( + child: Text( + model + .getDoctorRotation[ + index] + .clinicname, + style: + TextStyle( + fontWeight: + FontWeight + .w600, + ), + ), + ), + // Icon(Icons.arrow_forward, size: 16.0), + ], + ), + Container( + height: 45, + child: ListView + .builder( + itemCount: model + .getDoctorRotation[ + index] + .scheduleforuser[ + index2] + .shiftforuser + .length, + itemBuilder: (context, + index3) => + Row(children: [ + Text(model.getDoctorRotation[index].scheduleforuser[index2].shiftforuser[index3].fromtime.toString()), + Text(" To "), + Text(model.getDoctorRotation[index].scheduleforuser[index2].shiftforuser[index3].totime.toString()) + ]))) + + // ],) + ]))), + ), + ], + )))); + }, + )), + // PageViewIndicator( + // isActive: true, + // currentPage: this.currentPage, + // length: weeks.length, + // ) + ], + )), + ); + }); + } + + searchSchedule(model) { + showDialog( + context: context, + builder: (BuildContext context) { + return StatefulBuilder( + builder:(context, setState) { + return + AlertDialog( + title: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + TranslationBase.of(context).search, + style: TextStyle(fontSize: 22), + ), + Text( + TranslationBase.of(context).searchFindSchedule, + style: TextStyle(fontSize: 16), + ) + ], + ), + content: Container( + height: 150, + child: Column(children: [ + InkWell( + onTap: () { + DatePicker.showDatePicker( + context, + showTitleActions: true, + minTime: DateTime(DateTime.now().year - 1, 1, 1), + maxTime: DateTime.now().add(Duration(days:365)), + onConfirm: (date) { + setState(() { + fromDate = DateFormat('yyyy-MM-dd').format(date); + }); + }, + ); + }, + child: Container( + padding: + EdgeInsets.only(top: 5, left: 12, right: 12, bottom: 5), + width: double.infinity, + height: 55, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(12), + color: Colors.white, + boxShadow: [ + BoxShadow( + blurRadius: .26, + spreadRadius: 1 * 1.5, + color: Colors.black.withOpacity(.05)) + ]), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + TranslationBase.of(context).dateFrom, + style: TextStyle(fontSize: 12), + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text(fromDate), + Icon(Icons.calendar_month_outlined) + ]) + ], + ))), + SizedBox(height: 20,), + InkWell( + onTap: () { + DatePicker.showDatePicker( + context, + showTitleActions: true, + minTime: DateTime(DateTime.now().year - 1, 1, 1), + maxTime: DateTime.now().add(Duration(days:365)), + onConfirm: (date) { + setState(() { + toDate = DateFormat('yyyy-MM-dd').format(date); + }); + }, + ); + }, + child: Container( + padding: + EdgeInsets.only(top: 5, left: 12, right: 12, bottom: 5), + width: double.infinity, + height: 55, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(12), + color: Colors.white, + boxShadow: [ + BoxShadow( + blurRadius: .26, + spreadRadius: 1 * 1.5, + color: Colors.black.withOpacity(.05)) + ]), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + TranslationBase.of(context).toDate, + style: TextStyle(fontSize: 12), + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text(toDate), + Icon(Icons.calendar_month_outlined) + ]) + ], + ))) + ]), + ), + actions: [ + AppButton( + title:TranslationBase.of(context).search, + onPressed: () { + setState((){ + model.getDoctorRota(fromDate, toDate); + Navigator.pop(context); + }); + }, + ) + ], + ); + ; + } + ); + + }, + ); + } + + String getDayMonths(DateTime dateTime) { + String dateFormat = + '${dateTime.day} ${AppDateUtils.getMonth(dateTime.month).toString().substring(0, 3)}'; + return dateFormat; + } +} diff --git a/lib/screens/patients/profile/lab_result/laboratory_result/laboratory_result_page.dart b/lib/screens/patients/profile/lab_result/laboratory_result/laboratory_result_page.dart index c377d04e..29aaf2b5 100644 --- a/lib/screens/patients/profile/lab_result/laboratory_result/laboratory_result_page.dart +++ b/lib/screens/patients/profile/lab_result/laboratory_result/laboratory_result_page.dart @@ -58,6 +58,7 @@ class _LaboratoryResultPageState extends State { patientLabOrder: widget.patientLabOrders, patient: widget.patient, isInpatient: widget.patientType == "1", + invoiceType:widget.patientLabOrders.invoiceType ), ), ), diff --git a/lib/screens/patients/profile/lab_result/laboratory_result/laboratory_result_widget.dart b/lib/screens/patients/profile/lab_result/laboratory_result/laboratory_result_widget.dart index 97d10d88..2248b4f6 100644 --- a/lib/screens/patients/profile/lab_result/laboratory_result/laboratory_result_widget.dart +++ b/lib/screens/patients/profile/lab_result/laboratory_result/laboratory_result_widget.dart @@ -23,8 +23,8 @@ class LaboratoryResultWidget extends StatefulWidget { final PatientLabOrders patientLabOrder; final PatiantInformtion patient; final bool isInpatient; - - const LaboratoryResultWidget( + final String invoiceType; + const LaboratoryResultWidget( {Key key, this.onTap, this.billNo, @@ -32,7 +32,9 @@ class LaboratoryResultWidget extends StatefulWidget { this.orderNo, this.patientLabOrder, this.patient, - this.isInpatient}) + this.isInpatient, + this.invoiceType + }) : super(key: key); @override diff --git a/lib/screens/patients/profile/radiology/radiology_details_page.dart b/lib/screens/patients/profile/radiology/radiology_details_page.dart index a71bc59d..f6989964 100644 --- a/lib/screens/patients/profile/radiology/radiology_details_page.dart +++ b/lib/screens/patients/profile/radiology/radiology_details_page.dart @@ -35,8 +35,11 @@ class RadiologyDetailsPage extends StatelessWidget { patient: patient, projectId: finalRadiology.projectID, lineItem: finalRadiology.invoiceLineItemNo, + invoiceType:finalRadiology.invoiceType, invoiceNo: Utils.isVidaPlusProject(projectViewModel, finalRadiology.projectID) ? finalRadiology.invoiceNo_VP : finalRadiology.invoiceNo, - isVidaPlus: Utils.isVidaPlusProject(projectViewModel, finalRadiology.projectID), + isVidaPlus: Utils.isVidaPlusProject(projectViewModel, finalRadiology.projectID, + + ), ), builder: (_, model, widget) => AppScaffold( appBar: PatientProfileAppBar( diff --git a/lib/utils/translations_delegate_base_utils.dart b/lib/utils/translations_delegate_base_utils.dart index ae709ba2..462f6372 100644 --- a/lib/utils/translations_delegate_base_utils.dart +++ b/lib/utils/translations_delegate_base_utils.dart @@ -1725,7 +1725,10 @@ class TranslationBase { String get conditionDescription => localizedValues['conditionDescription'][locale.languageCode]; - + String get doctorSchedule => localizedValues['doctorSchedule'][locale.languageCode]; + String get doctorRota => localizedValues['doctorRota'][locale.languageCode]; + String get dateFrom => localizedValues['dateFrom'][locale.languageCode]; + String get searchFindSchedule => localizedValues['searchFindSchedule'][locale.languageCode]; } class TranslationBaseDelegate extends LocalizationsDelegate { diff --git a/lib/widgets/shared/app_drawer_widget.dart b/lib/widgets/shared/app_drawer_widget.dart index 5700db9c..1e755d6e 100644 --- a/lib/widgets/shared/app_drawer_widget.dart +++ b/lib/widgets/shared/app_drawer_widget.dart @@ -1,6 +1,7 @@ import 'package:doctor_app_flutter/core/viewModel/authentication_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; +import 'package:doctor_app_flutter/screens/doctor_schedule/doctor_schedule.dart'; import 'package:doctor_app_flutter/screens/reschedule_leaves/add_reschedule_leave.dart'; import 'package:doctor_app_flutter/utils/utils.dart'; import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; @@ -136,6 +137,28 @@ class _AppDrawerState extends State { }, ), SizedBox(height: 15), + + InkWell( + child: DrawerItem( + TranslationBase.of(context).doctorRota, + icon: Icons.punch_clock, + + // subTitle: , + ), + onTap: () { + Navigator.pop(context); + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => DoctorSchedulePage(), + settings: RouteSettings( + name: 'doctorSchedule') + // MyReferredPatient(), + )); + }, + ), + SizedBox(height: 15), + InkWell( child: DrawerItem( TranslationBase.of(context).myQRCode, @@ -143,6 +166,7 @@ class _AppDrawerState extends State { // subTitle: , ), ), + SizedBox(height: MediaQuery.of(context).size.height * 0.02), InkWell( child: Container( diff --git a/lib/widgets/shared/app_scaffold_widget.dart b/lib/widgets/shared/app_scaffold_widget.dart index c214a040..44106147 100644 --- a/lib/widgets/shared/app_scaffold_widget.dart +++ b/lib/widgets/shared/app_scaffold_widget.dart @@ -24,7 +24,7 @@ class AppScaffold extends StatelessWidget { final String subtitle; final bool isHomeIcon; final bool extendBody; - + final Widget actionButton; AppScaffold( {this.appBarTitle = '', this.body, @@ -36,7 +36,7 @@ class AppScaffold extends StatelessWidget { this.isHomeIcon = true, this.appBar, this.subtitle, - this.drawer, + this.drawer, this.actionButton, this.extendBody = false, this.bottomNavigationBar}); @@ -92,7 +92,7 @@ class AppScaffold extends StatelessWidget { onPressed: () => Navigator.pushNamedAndRemoveUntil( context, HOME, (r) => false), ) - : SizedBox() + : actionButton !=null ? actionButton :SizedBox() ], ) : null,