From 0e0183532775af19f959bc700fb1b456eddbcdb1 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Thu, 29 Dec 2022 10:17:08 +0300 Subject: [PATCH 01/29] Target SDK & Compile SDK bumped to 33 --- android/app/build.gradle | 25 +- android/app/src/debug/AndroidManifest.xml | 2 +- android/app/src/main/AndroidManifest.xml | 44 ++-- .../GeofenceBroadcastReceiver.kt | 74 ++++-- .../GeofenceTransitionsJobIntentService.kt | 23 +- android/build.gradle | 2 +- .../gradle/wrapper/gradle-wrapper.properties | 2 +- ios/Runner.xcodeproj/project.pbxproj | 72 +++--- lib/config/config.dart | 3 +- .../model/eye/AppoimentAllHistoryResult.dart | 2 +- lib/core/service/client/base_app_client.dart | 2 +- .../PharmacyAddressesViewModel.dart | 2 +- .../NewCMC/cmc_location_page.dart | 2 +- .../NewCMC/new_cmc_step_tow_page.dart | 2 +- .../NewHomeHealthCare/location_page.dart | 2 +- .../new_Home_health_care_step_one_page.dart | 2 +- .../new_Home_health_care_step_tow_page.dart | 60 +++-- .../ancillary-orders/ancillaryOrders.dart | 2 +- .../components/DocAvailableAppointments.dart | 3 +- .../PickupLocation.dart | 60 +++-- .../rrt-pickup-address-page.dart | 9 +- lib/pages/ToDoList/ToDo.dart | 2 +- lib/pages/feedback/send_feedback_page.dart | 80 +++--- lib/pages/insurance/insurance_page.dart | 16 +- .../widgets/LiveCarePendingRequest.dart | 30 +-- .../medical/patient_sick_leave_page.dart | 16 +- .../pharmacyAddresses/AddAddress.dart | 40 ++- .../appointment_services/GetDoctorsList.dart | 12 +- lib/uitl/LocalNotification.dart | 235 +++++++++++------- lib/uitl/location_util.dart | 39 ++- lib/uitl/push-notification-handler.dart | 14 +- lib/widgets/app_map/google_huawei_map.dart | 1 + lib/widgets/others/bottom_bar.dart | 102 ++++---- .../others/floating_button_search.dart | 100 ++++---- .../pickupLocation/PickupLocationFromMap.dart | 2 +- pubspec.yaml | 34 +-- 36 files changed, 630 insertions(+), 488 deletions(-) diff --git a/android/app/build.gradle b/android/app/build.gradle index bdabb828..965934fd 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -21,6 +21,12 @@ if (flutterVersionName == null) { flutterVersionName = '1.0' } +def keystoreProperties = new Properties() +def keystorePropertiesFile = rootProject.file('key.properties') +if (keystorePropertiesFile.exists()) { + keystoreProperties.load(new FileInputStream(keystorePropertiesFile)) +} + apply plugin: 'com.android.application' apply plugin: 'com.huawei.agconnect' apply plugin: 'kotlin-android' @@ -51,29 +57,29 @@ android { // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). applicationId "com.ejada.hmg" minSdkVersion 21 - targetSdkVersion 30 + targetSdkVersion 33 versionCode flutterVersionCode.toInteger() versionName flutterVersionName multiDexEnabled true } signingConfigs { - config{ - storeFile file('key') - keyAlias 'hmg' - storePassword 'HmGsa123' - keyPassword 'HmGsa123' + release { + keyAlias keystoreProperties['keyAlias'] + keyPassword keystoreProperties['keyPassword'] + storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null + storePassword keystoreProperties['storePassword'] } } buildTypes { debug { debuggable true - signingConfig signingConfigs.config + signingConfig signingConfigs.release } release { debuggable false - signingConfig signingConfigs.config + signingConfig signingConfigs.release minifyEnabled true shrinkResources true proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' @@ -127,10 +133,11 @@ dependencies { implementation 'com.github.kittinunf.fuel:fuel-android:2.3.0' implementation 'com.google.android.gms:play-services-location:17.1.0'//for Android implementation 'com.google.android.gms:play-services-basement:17.5.0' - implementation "com.opentok.android:opentok-android-sdk:2.19.1" + implementation "com.opentok.android:opentok-android-sdk:2.21.4" implementation 'com.facebook.stetho:stetho:1.5.1' implementation 'com.facebook.stetho:stetho-urlconnection:1.5.1' implementation 'androidx.core:core-ktx:1.6.0' implementation 'androidx.appcompat:appcompat:1.3.1' + androidTestImplementation "androidx.test:core:1.4.0" } diff --git a/android/app/src/debug/AndroidManifest.xml b/android/app/src/debug/AndroidManifest.xml index ab5e631b..6c937f09 100644 --- a/android/app/src/debug/AndroidManifest.xml +++ b/android/app/src/debug/AndroidManifest.xml @@ -4,4 +4,4 @@ to allow setting breakpoints, to provide hot reload, etc. --> - + \ No newline at end of file diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index e6601b40..ef4a8f83 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -34,9 +34,9 @@ - + - + @@ -49,7 +49,6 @@ android:showOnLockScreen="true" android:screenOrientation="sensorPortrait" android:allowBackup="false" - tools:replace="android:allowBackup,android:label" android:label="Dr. Alhabib"> @@ -89,23 +88,23 @@ - - - - - - + + + + + + - - + + - + @@ -117,20 +116,19 @@ Huawei Push Notifications Set push kit auto enable to true (for obtaining the token on initialize) --> - + + + - + - + android:enabled="true" + android:exported="false" /> - - - - + + + + diff --git a/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/intent_receivers/GeofenceBroadcastReceiver.kt b/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/intent_receivers/GeofenceBroadcastReceiver.kt index 2820daae..2ed2daf4 100644 --- a/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/intent_receivers/GeofenceBroadcastReceiver.kt +++ b/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/intent_receivers/GeofenceBroadcastReceiver.kt @@ -1,7 +1,6 @@ - - package com.ejada.hmg.geofence.intent_receivers +import android.annotation.SuppressLint import android.content.BroadcastReceiver import android.content.Context import android.content.Intent @@ -13,37 +12,60 @@ import com.google.android.gms.location.GeofenceStatusCodes import com.google.android.gms.location.GeofencingEvent class GeofenceBroadcastReceiver : BroadcastReceiver() { - private val LOG_TAG = "GeofenceBroadcastReceiver" - override fun onReceive(context: Context, intent: Intent) { - - val geofencingEvent = GeofencingEvent.fromIntent(intent) - if (geofencingEvent.hasError()) { - val errorMessage = GeofenceErrorMessages.getErrorString(context, geofencingEvent.errorCode) - Log.e(LOG_TAG, errorMessage) - - Logs.GeofenceEvent.save(context,LOG_TAG,"Error while triggering geofence event",Logs.STATUS.ERROR) - doReRegisterIfRequired(context,geofencingEvent.errorCode) - - return - } + private val LOG_TAG = "GeofenceBroadcastReceiver" + + @SuppressLint("LongLogTag") + override fun onReceive(context: Context, intent: Intent) { + + val geofencingEvent = GeofencingEvent.fromIntent(intent) + if (geofencingEvent != null) { + if (geofencingEvent.hasError()) { + val errorMessage = + GeofenceErrorMessages.getErrorString(context, geofencingEvent.errorCode) + Log.e(LOG_TAG, errorMessage) - Logs.GeofenceEvent.save(context,LOG_TAG,"Geofence event triggered: ${GeofenceTransition.fromInt(geofencingEvent.geofenceTransition).value} for ${geofencingEvent.triggeringGeofences.map {it.requestId}}",Logs.STATUS.SUCCESS) - HMG_Geofence.shared(context).handleEvent(geofencingEvent.triggeringGeofences,geofencingEvent.triggeringLocation, GeofenceTransition.fromInt(geofencingEvent.geofenceTransition)); - - } + Logs.GeofenceEvent.save( + context, + LOG_TAG, + "Error while triggering geofence event", + Logs.STATUS.ERROR + ) + doReRegisterIfRequired(context, geofencingEvent.errorCode) - fun doReRegisterIfRequired(context: Context, errorCode: Int){ - val errorRequiredReregister = listOf( + return + } + } + if (geofencingEvent != null) { + Logs.GeofenceEvent.save( + context, + LOG_TAG, + "Geofence event triggered: ${GeofenceTransition.fromInt(geofencingEvent.geofenceTransition).value} for ${geofencingEvent.triggeringGeofences?.map { it.requestId }}", + Logs.STATUS.SUCCESS + ) + geofencingEvent.triggeringLocation?.let { + geofencingEvent.triggeringGeofences?.let { it1 -> + HMG_Geofence.shared(context).handleEvent( + it1, + it, GeofenceTransition.fromInt(geofencingEvent.geofenceTransition) + ) + } + } + }; + + } + + fun doReRegisterIfRequired(context: Context, errorCode: Int) { + val errorRequiredReregister = listOf( GeofenceStatusCodes.GEOFENCE_NOT_AVAILABLE, GeofenceStatusCodes.GEOFENCE_TOO_MANY_GEOFENCES, GeofenceStatusCodes.GEOFENCE_TOO_MANY_PENDING_INTENTS, GeofenceStatusCodes.GEOFENCE_REQUEST_TOO_FREQUENT - ) + ) - if(errorRequiredReregister.contains(errorCode)) - HMG_Geofence.shared(context).register(){ status, error -> + if (errorRequiredReregister.contains(errorCode)) + HMG_Geofence.shared(context).register() { status, error -> - } + } - } + } } \ No newline at end of file diff --git a/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/intent_receivers/GeofenceTransitionsJobIntentService.kt b/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/intent_receivers/GeofenceTransitionsJobIntentService.kt index 21090f0f..b083e04e 100644 --- a/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/intent_receivers/GeofenceTransitionsJobIntentService.kt +++ b/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/intent_receivers/GeofenceTransitionsJobIntentService.kt @@ -59,18 +59,25 @@ class GeofenceTransitionsJobIntentService : JobIntentService() { override fun onHandleWork(intent: Intent) { val geofencingEvent = GeofencingEvent.fromIntent(intent) - if (geofencingEvent.hasError()) { - val errorMessage = GeofenceErrorMessages.getErrorString(context_!!, geofencingEvent.errorCode) - Log.e(LOG_TAG, errorMessage) + if (geofencingEvent != null) { + if (geofencingEvent.hasError()) { + val errorMessage = GeofenceErrorMessages.getErrorString(context_!!, geofencingEvent.errorCode) + Log.e(LOG_TAG, errorMessage) - saveLog(context_!!,LOG_TAG,errorMessage) - doReRegisterIfRequired(context_!!, geofencingEvent.errorCode) + saveLog(context_!!,LOG_TAG,errorMessage) + doReRegisterIfRequired(context_!!, geofencingEvent.errorCode) - return - } + return + } + } - HMG_Geofence.shared(context_!!).handleEvent(geofencingEvent.triggeringGeofences,geofencingEvent.triggeringLocation, GeofenceTransition.fromInt(geofencingEvent.geofenceTransition)); + if (geofencingEvent != null) { + geofencingEvent.triggeringGeofences?.let { geofencingEvent.triggeringLocation?.let { it1 -> + HMG_Geofence.shared(context_!!).handleEvent(it, + it1, GeofenceTransition.fromInt(geofencingEvent.geofenceTransition)) + } } + }; } diff --git a/android/build.gradle b/android/build.gradle index edb27f2a..e723adba 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -11,7 +11,7 @@ buildscript { } dependencies { - classpath 'com.android.tools.build:gradle:7.0.3' + classpath 'com.android.tools.build:gradle:7.1.3' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" classpath 'com.google.gms:google-services:4.3.8' // classpath 'com.google.firebase:firebase-crashlytics-gradle:2.8.1' diff --git a/android/gradle/wrapper/gradle-wrapper.properties b/android/gradle/wrapper/gradle-wrapper.properties index 6e8ae021..1acad296 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.4-bin.zip diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index f43f5eaf..5fea0490 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -19,10 +19,10 @@ 76815B27275F381C00E66E94 /* HealthKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 76815B26275F381C00E66E94 /* HealthKit.framework */; }; 76962ECE28AE5C10004EAE09 /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 76962ECD28AE5C10004EAE09 /* GoogleService-Info.plist */; }; 76F2556127F1FFED0062C1CD /* PassKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 76F2556027F1FFED0062C1CD /* PassKit.framework */; }; - 888788C5457DD4B4291ED407 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DBECDFA177FC32F0D92001A8 /* 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 */; }; + B40C32A62DF065A3A0414845 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8B99ADD0B93AC14DD8D0BAB0 /* Pods_Runner.framework */; }; E91B5396256AAA6500E96549 /* GlobalHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = E91B538D256AAA6500E96549 /* GlobalHelper.swift */; }; E91B5397256AAA6500E96549 /* Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = E91B538E256AAA6500E96549 /* Extensions.swift */; }; E91B5398256AAA6500E96549 /* API.swift in Sources */ = {isa = PBXBuildFile; fileRef = E91B538F256AAA6500E96549 /* API.swift */; }; @@ -63,7 +63,6 @@ 306FE6C7271D790C002D6EFC /* OpenTokPlatformBridge.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OpenTokPlatformBridge.swift; sourceTree = ""; }; 306FE6CA271D8B73002D6EFC /* OpenTok.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OpenTok.swift; sourceTree = ""; }; 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; - 7339683046E679D7577A50D3 /* 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 = ""; }; 762D738C274E42650063CE73 /* ring_30Sec.caf */ = {isa = PBXFileReference; lastKnownFileType = file; name = ring_30Sec.caf; path = ../../assets/sounds/ring_30Sec.caf; sourceTree = ""; }; @@ -71,7 +70,9 @@ 76815B26275F381C00E66E94 /* HealthKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = HealthKit.framework; path = System/Library/Frameworks/HealthKit.framework; sourceTree = SDKROOT; }; 76962ECD28AE5C10004EAE09 /* GoogleService-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "GoogleService-Info.plist"; sourceTree = ""; }; 76F2556027F1FFED0062C1CD /* PassKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = PassKit.framework; path = System/Library/Frameworks/PassKit.framework; sourceTree = SDKROOT; }; + 7805E271E86E72F39E68ADCC /* 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 = ""; }; 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; + 8B99ADD0B93AC14DD8D0BAB0 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 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; }; @@ -79,9 +80,7 @@ 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 = ""; }; - C43E6143D6D42F3BF36E6E30 /* 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 = ""; }; - DBECDFA177FC32F0D92001A8 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - E88A1DAFD417EE86EE2F7F02 /* 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 = ""; }; + BC1BA79F1F6E9D7BE59D2AE4 /* 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 = ""; }; E91B538D256AAA6500E96549 /* GlobalHelper.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GlobalHelper.swift; sourceTree = ""; }; E91B538E256AAA6500E96549 /* Extensions.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Extensions.swift; sourceTree = ""; }; E91B538F256AAA6500E96549 /* API.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = API.swift; sourceTree = ""; }; @@ -100,6 +99,7 @@ E9C8C135256BACDA00EFFB62 /* HMG_Guest.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HMG_Guest.swift; sourceTree = ""; }; E9E27167256E3A4000F49B69 /* LocalizedFromFlutter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LocalizedFromFlutter.swift; sourceTree = ""; }; E9F7623A25922BCE00FB5CCF /* FlutterConstants.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FlutterConstants.swift; sourceTree = ""; }; + EBA301C32F4CA9F09D2D7713 /* 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 = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -110,7 +110,7 @@ 76F2556127F1FFED0062C1CD /* PassKit.framework in Frameworks */, 76815B27275F381C00E66E94 /* HealthKit.framework in Frameworks */, E9620805255C2ED100D3A35D /* NetworkExtension.framework in Frameworks */, - 888788C5457DD4B4291ED407 /* Pods_Runner.framework in Frameworks */, + B40C32A62DF065A3A0414845 /* Pods_Runner.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -133,7 +133,7 @@ 76F2556027F1FFED0062C1CD /* PassKit.framework */, 76815B26275F381C00E66E94 /* HealthKit.framework */, E9620804255C2ED100D3A35D /* NetworkExtension.framework */, - DBECDFA177FC32F0D92001A8 /* Pods_Runner.framework */, + 8B99ADD0B93AC14DD8D0BAB0 /* Pods_Runner.framework */, ); name = Frameworks; sourceTree = ""; @@ -141,9 +141,9 @@ 605039E5DDF72C245F9765FE /* Pods */ = { isa = PBXGroup; children = ( - C43E6143D6D42F3BF36E6E30 /* Pods-Runner.debug.xcconfig */, - 7339683046E679D7577A50D3 /* Pods-Runner.release.xcconfig */, - E88A1DAFD417EE86EE2F7F02 /* Pods-Runner.profile.xcconfig */, + EBA301C32F4CA9F09D2D7713 /* Pods-Runner.debug.xcconfig */, + 7805E271E86E72F39E68ADCC /* Pods-Runner.release.xcconfig */, + BC1BA79F1F6E9D7BE59D2AE4 /* Pods-Runner.profile.xcconfig */, ); path = Pods; sourceTree = ""; @@ -246,15 +246,15 @@ isa = PBXNativeTarget; buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; buildPhases = ( - 6CEC06A85A1BC01F415967B9 /* [CP] Check Pods Manifest.lock */, + A37FFD337A0067237A8DACD6 /* [CP] Check Pods Manifest.lock */, 9740EEB61CF901F6004384FC /* Run Script */, 97C146EA1CF9000F007C117D /* Sources */, 97C146EB1CF9000F007C117D /* Frameworks */, 97C146EC1CF9000F007C117D /* Resources */, 9705A1C41CF9048500538489 /* Embed Frameworks */, 3B06AD1E1E4923F5004D2608 /* Thin Binary */, - EB708D648E256F1D924823C6 /* [CP] Embed Pods Frameworks */, - 1FDB0C9B620EC9533D2358F3 /* [CP] Copy Pods Resources */, + E1D6AED972DEFC56AA7DB402 /* [CP] Embed Pods Frameworks */, + 541D1D49FBD13BE6BA6DA5BC /* [CP] Copy Pods Resources */, ); buildRules = ( ); @@ -320,7 +320,21 @@ /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ - 1FDB0C9B620EC9533D2358F3 /* [CP] Copy Pods Resources */ = { + 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\n"; + }; + 541D1D49FBD13BE6BA6DA5BC /* [CP] Copy Pods Resources */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( @@ -337,21 +351,21 @@ shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources.sh\"\n"; showEnvVarsInLog = 0; }; - 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { + 9740EEB61CF901F6004384FC /* Run Script */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputPaths = ( ); - name = "Thin Binary"; + name = "Run Script"; outputPaths = ( ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin\n"; + shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; }; - 6CEC06A85A1BC01F415967B9 /* [CP] Check Pods Manifest.lock */ = { + A37FFD337A0067237A8DACD6 /* [CP] Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( @@ -373,21 +387,7 @@ 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"; - }; - EB708D648E256F1D924823C6 /* [CP] Embed Pods Frameworks */ = { + E1D6AED972DEFC56AA7DB402 /* [CP] Embed Pods Frameworks */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( @@ -538,7 +538,7 @@ "$(inherited)", "$(PROJECT_DIR)/Flutter", ); - MARKETING_VERSION = 4.5.56; + MARKETING_VERSION = 4.5.57; PRODUCT_BUNDLE_IDENTIFIER = "com.HMG.HMG-Smartphone"; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -682,7 +682,7 @@ "$(inherited)", "$(PROJECT_DIR)/Flutter", ); - MARKETING_VERSION = 4.5.56; + MARKETING_VERSION = 4.5.57; PRODUCT_BUNDLE_IDENTIFIER = "com.HMG.HMG-Smartphone"; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -720,7 +720,7 @@ "$(inherited)", "$(PROJECT_DIR)/Flutter", ); - MARKETING_VERSION = 4.5.56; + MARKETING_VERSION = 4.5.57; PRODUCT_BUNDLE_IDENTIFIER = "com.HMG.HMG-Smartphone"; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; diff --git a/lib/config/config.dart b/lib/config/config.dart index a7676855..ca5380d9 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -411,7 +411,7 @@ var UPDATE_COVID_QUESTIONNAIRE = 'Services/Doctors.svc/REST/COVID19_Questionnar var CHANNEL = 3; var GENERAL_ID = 'Cs2020@2016\$2958'; var IP_ADDRESS = '10.20.10.20'; -var VERSION_ID = 9.8; +var VERSION_ID = 9.9; var SETUP_ID = '91877'; var LANGUAGE = 2; // var PATIENT_OUT_SA = 0; @@ -773,7 +773,6 @@ class AppGlobal { request.generalid = GENERAL_ID; //'Cs2020@2016\$2958'; request.PatientOutSA = 0; request.SessionID = "wEVNbagIkaNhGECWZjHaA"; - request.TokenID = "@dm!n"; request.isDentalAllowedBackend = false; request.DeviceTypeID = Platform.isIOS ? 1 : 2; request.DeviceType = Platform.isIOS ? "iOS" : "Android"; diff --git a/lib/core/model/eye/AppoimentAllHistoryResult.dart b/lib/core/model/eye/AppoimentAllHistoryResult.dart index 71c9573b..b431943d 100644 --- a/lib/core/model/eye/AppoimentAllHistoryResult.dart +++ b/lib/core/model/eye/AppoimentAllHistoryResult.dart @@ -178,7 +178,7 @@ class AppoimentAllHistoryResultList { doctorImageURL = json['DoctorImageURL']; doctorNameObj = json['DoctorNameObj']; doctorRate = json['DoctorRate']; - doctorSpeciality = json['DoctorSpeciality'].cast(); + if (doctorSpeciality != null) doctorSpeciality = json['DoctorSpeciality'].cast(); doctorTitle = json['DoctorTitle']; gender = json['Gender']; genderDescription = json['GenderDescription']; diff --git a/lib/core/service/client/base_app_client.dart b/lib/core/service/client/base_app_client.dart index 38e63391..6a421073 100644 --- a/lib/core/service/client/base_app_client.dart +++ b/lib/core/service/client/base_app_client.dart @@ -149,7 +149,7 @@ class BaseAppClient { // body['IdentificationNo'] = 1023854217; // body['MobileNo'] = "531940021"; - // body['PatientID'] = 3649158; //3844083 + // body['PatientID'] = 2001273; //3844083 // body['TokenID'] = "@dm!n"; // Patient ID: 3027574 diff --git a/lib/core/viewModels/pharmacyModule/PharmacyAddressesViewModel.dart b/lib/core/viewModels/pharmacyModule/PharmacyAddressesViewModel.dart index 5a098b6f..ea9af54d 100644 --- a/lib/core/viewModels/pharmacyModule/PharmacyAddressesViewModel.dart +++ b/lib/core/viewModels/pharmacyModule/PharmacyAddressesViewModel.dart @@ -5,7 +5,7 @@ import 'package:diplomaticquarterapp/core/service/AlHabibMedicalService/customer import 'package:diplomaticquarterapp/services/pharmacy_services/pharmacyAddress_service.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:geocoding/geocoding.dart'; -import 'package:google_maps_place_picker/google_maps_place_picker.dart'; +import 'package:google_maps_place_picker_mb/google_maps_place_picker.dart'; import '../../../locator.dart'; import '../base_view_model.dart'; diff --git a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/cmc_location_page.dart b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/cmc_location_page.dart index fbef90e6..f45d2942 100644 --- a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/cmc_location_page.dart +++ b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/cmc_location_page.dart @@ -25,7 +25,7 @@ import 'package:flutter/material.dart'; import 'package:geocoding/geocoding.dart'; import 'package:geolocator/geolocator.dart'; import 'package:google_maps_flutter/google_maps_flutter.dart'; -import 'package:google_maps_place_picker/google_maps_place_picker.dart'; +import 'package:google_maps_place_picker_mb/google_maps_place_picker.dart'; import 'package:huawei_hmsavailability/huawei_hmsavailability.dart'; import 'package:provider/provider.dart'; diff --git a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_step_tow_page.dart b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_step_tow_page.dart index 87d55b72..e846d31c 100644 --- a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_step_tow_page.dart +++ b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_step_tow_page.dart @@ -20,7 +20,7 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:geolocator/geolocator.dart'; import 'package:google_maps_flutter/google_maps_flutter.dart'; -import 'package:google_maps_place_picker/google_maps_place_picker.dart'; +import 'package:google_maps_place_picker_mb/google_maps_place_picker.dart'; import 'package:permission_handler/permission_handler.dart'; import 'cmc_location_page.dart'; diff --git a/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/location_page.dart b/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/location_page.dart index e96ddcc7..78e13982 100644 --- a/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/location_page.dart +++ b/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/location_page.dart @@ -23,7 +23,7 @@ import 'package:flutter/material.dart'; import 'package:geocoding/geocoding.dart'; import 'package:geolocator/geolocator.dart'; import 'package:google_maps_flutter/google_maps_flutter.dart'; -import 'package:google_maps_place_picker/google_maps_place_picker.dart'; +import 'package:google_maps_place_picker_mb/google_maps_place_picker.dart'; import 'package:huawei_hmsavailability/huawei_hmsavailability.dart'; import 'package:provider/provider.dart'; diff --git a/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_Home_health_care_step_one_page.dart b/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_Home_health_care_step_one_page.dart index 7984cbbf..3a59b21e 100644 --- a/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_Home_health_care_step_one_page.dart +++ b/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_Home_health_care_step_one_page.dart @@ -12,7 +12,7 @@ import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -import 'package:google_maps_place_picker/google_maps_place_picker.dart'; +import 'package:google_maps_place_picker_mb/google_maps_place_picker.dart'; import 'package:provider/provider.dart'; class NewHomeHealthCareStepOnePage extends StatefulWidget { diff --git a/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_Home_health_care_step_tow_page.dart b/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_Home_health_care_step_tow_page.dart index 5328bfba..79f10be7 100644 --- a/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_Home_health_care_step_tow_page.dart +++ b/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_Home_health_care_step_tow_page.dart @@ -9,6 +9,7 @@ import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/HomeHealthCare/ import 'package:diplomaticquarterapp/services/permission/permission_service.dart'; import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; +import 'package:diplomaticquarterapp/uitl/location_util.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:diplomaticquarterapp/uitl/utils_new.dart'; @@ -21,7 +22,7 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:geolocator/geolocator.dart'; import 'package:google_maps_flutter/google_maps_flutter.dart'; -import 'package:google_maps_place_picker/google_maps_place_picker.dart'; +import 'package:google_maps_place_picker_mb/google_maps_place_picker.dart'; import 'location_page.dart'; @@ -53,6 +54,7 @@ class _NewHomeHealthCareStepTowPageState extends State mapController = Completer(); + LocationUtils locationUtils; @override void initState() { @@ -62,7 +64,6 @@ class _NewHomeHealthCareStepTowPageState extends State with SingleTickerProv return DoctorCard( onTap: () => ancillaryOrdersDetails(model.ancillaryLists[0].ancillaryOrderList[index], model.ancillaryLists[0].projectID), isInOutPatient: true, - name: TranslationBase.of(context).dr.toString() + " " + (model.ancillaryLists[0].ancillaryOrderList[index].doctorName), + name: TranslationBase.of(context).dr.toString() + " " + (model.ancillaryLists[0].ancillaryOrderList[index].doctorName ?? ""), billNo: model.ancillaryLists[0].ancillaryOrderList[index].orderNo.toString(), profileUrl: "https://hmgwebservices.com/Images/MobileImages/DUBAI/unkown.png", subName: model.ancillaryLists[0].projectName, diff --git a/lib/pages/BookAppointment/components/DocAvailableAppointments.dart b/lib/pages/BookAppointment/components/DocAvailableAppointments.dart index 9b5374ef..71c9d0b2 100644 --- a/lib/pages/BookAppointment/components/DocAvailableAppointments.dart +++ b/lib/pages/BookAppointment/components/DocAvailableAppointments.dart @@ -300,9 +300,10 @@ class _DocAvailableAppointmentsState extends State wit } getDoctorFreeSlots(context, DoctorList docObject) { + print(DocAvailableAppointments.initialSlotDuration); GifLoaderDialogUtils.showMyDialog(context); DoctorsListService service = new DoctorsListService(); - service.getDoctorFreeSlots(docObject.doctorID, docObject.clinicID, docObject.projectID, context).then((res) { + service.getDoctorFreeSlots(docObject.doctorID, docObject.clinicID, docObject.projectID, context, projectViewModel).then((res) { GifLoaderDialogUtils.hideDialog(context); if (res['MessageStatus'] == 1) { if (res['FreeTimeSlots'].length != 0) { diff --git a/lib/pages/ErService/AmbulanceRequestIndexPages/PickupLocation.dart b/lib/pages/ErService/AmbulanceRequestIndexPages/PickupLocation.dart index d69ed4f3..057cb5c2 100644 --- a/lib/pages/ErService/AmbulanceRequestIndexPages/PickupLocation.dart +++ b/lib/pages/ErService/AmbulanceRequestIndexPages/PickupLocation.dart @@ -102,19 +102,23 @@ class _PickupLocationState extends State { ), child: InkWell( onTap: () { - Navigator.push( - context, - FadePage( - page: PickupLocationFromMap( - latitude: projectViewModel.latitude ?? 0, - longitude: projectViewModel.longitude ?? 0, - onPick: (value) { - setState(() { - _result = value; - }); - }, - )), - ); + if (projectViewModel.latitude != null && projectViewModel.longitude != null) { + Navigator.push( + context, + FadePage( + page: PickupLocationFromMap( + latitude: projectViewModel.latitude ?? 0, + longitude: projectViewModel.longitude ?? 0, + onPick: (value) { + setState(() { + _result = value; + }); + }, + )), + ); + } else { + locationUtils.getCurrentLocation(); + } }, child: Row( children: [ @@ -438,20 +442,24 @@ class _PickupLocationState extends State { ), child: InkWell( onTap: () { - Navigator.push( - context, - FadePage( - page: PickupLocationFromMap( - latitude: projectViewModel.latitude, - longitude: projectViewModel.longitude, - onPick: (value) { - setState(() { - _result = value; - }); - }, + if (projectViewModel.latitude != null && projectViewModel.longitude != null) { + Navigator.push( + context, + FadePage( + page: PickupLocationFromMap( + latitude: projectViewModel.latitude, + longitude: projectViewModel.longitude, + onPick: (value) { + setState(() { + _result = value; + }); + }, + ), ), - ), - ); + ); + } else { + locationUtils.getCurrentLocation(); + } }, child: Row( children: [ diff --git a/lib/pages/ErService/rapid-response-team/rrt-pickup-address-page.dart b/lib/pages/ErService/rapid-response-team/rrt-pickup-address-page.dart index 2008ef4c..56033e8c 100644 --- a/lib/pages/ErService/rapid-response-team/rrt-pickup-address-page.dart +++ b/lib/pages/ErService/rapid-response-team/rrt-pickup-address-page.dart @@ -309,6 +309,11 @@ class RRTRequestPickupAddressPageState extends State with SingleTickerProviderStateMixin { return DoctorCard( onTap: () => ancillaryOrdersDetails(widget.ancillaryLists[0].ancillaryOrderList[index], widget.ancillaryLists[0].projectID), isInOutPatient: true, - name: TranslationBase.of(context).dr.toString() + " " + (widget.ancillaryLists[0].ancillaryOrderList[index].doctorName), + name: TranslationBase.of(context).dr.toString() + " " + (widget.ancillaryLists[0].ancillaryOrderList[index].doctorName ?? ""), billNo: widget.ancillaryLists[0].ancillaryOrderList[index].orderNo.toString(), profileUrl: "https://hmgwebservices.com/Images/MobileImages/DUBAI/unkown.png", subName: widget.ancillaryLists[0].projectName, diff --git a/lib/pages/feedback/send_feedback_page.dart b/lib/pages/feedback/send_feedback_page.dart index 39a54f1a..4bd1ae81 100644 --- a/lib/pages/feedback/send_feedback_page.dart +++ b/lib/pages/feedback/send_feedback_page.dart @@ -25,8 +25,8 @@ import 'package:flutter/material.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart'; import 'package:permission_handler/permission_handler.dart'; import 'package:provider/provider.dart'; -import 'package:speech_to_text/speech_recognition_error.dart'; -import 'package:speech_to_text/speech_to_text.dart' as stt; +// import 'package:speech_to_text/speech_recognition_error.dart'; +// import 'package:speech_to_text/speech_to_text.dart' as stt; class SendFeedbackPage extends StatefulWidget { final AppoitmentAllHistoryResultList appointment; @@ -49,7 +49,7 @@ class _SendFeedbackPageState extends State { final formKey = GlobalKey(); MessageType messageType = MessageType.NON; var _currentLocaleId; - stt.SpeechToText speech = stt.SpeechToText(); + // stt.SpeechToText speech = stt.SpeechToText(); var reconizedWord; int selectedStatusIndex = 5; var event = RobotProvider(); @@ -218,17 +218,17 @@ class _SendFeedbackPageState extends State { inputWidget(TranslationBase.of(context).subject, "", titleController), SizedBox(height: 12), inputWidget(TranslationBase.of(context).message, "", messageController, lines: 11, suffixTap: () async { - if (Platform.isAndroid) { - if (await PermissionService.isMicrophonePermissionEnabled()) { - openSpeechReco(); - } else { - Utils.showPermissionConsentDialog(context, TranslationBase.of(context).recordAudioPermission, () { - openSpeechReco(); - }); - } - } else { - openSpeechReco(); - } + // if (Platform.isAndroid) { + // if (await PermissionService.isMicrophonePermissionEnabled()) { + // openSpeechReco(); + // } else { + // Utils.showPermissionConsentDialog(context, TranslationBase.of(context).recordAudioPermission, () { + // openSpeechReco(); + // }); + // } + // } else { + // openSpeechReco(); + // } }), SizedBox(height: 12), InkWell( @@ -517,26 +517,26 @@ class _SendFeedbackPageState extends State { return; } - openSpeechReco() async { - new RoboSearch(context: context).showAlertDialog(context); - _currentLocaleId = TranslationBase.of(AppGlobal.context).locale.languageCode; - bool available = await speech.initialize(onStatus: statusListener, onError: errorListener); - if (available) { - speech.listen( - onResult: resultListener, - listenMode: stt.ListenMode.confirmation, - localeId: _currentLocaleId == 'en' ? 'en-US' : 'ar-SA', - ); - } else { - print("The user has denied the use of speech recognition."); - } - } - - void errorListener(SpeechRecognitionError error) { - event.setValue({"searchText": 'null'}); - //SpeechToText.closeAlertDialog(context); - print(error); - } + // openSpeechReco() async { + // new RoboSearch(context: context).showAlertDialog(context); + // _currentLocaleId = TranslationBase.of(AppGlobal.context).locale.languageCode; + // bool available = await speech.initialize(onStatus: statusListener, onError: errorListener); + // if (available) { + // speech.listen( + // onResult: resultListener, + // listenMode: stt.ListenMode.confirmation, + // localeId: _currentLocaleId == 'en' ? 'en-US' : 'ar-SA', + // ); + // } else { + // print("The user has denied the use of speech recognition."); + // } + // } + // + // void errorListener(SpeechRecognitionError error) { + // event.setValue({"searchText": 'null'}); + // //SpeechToText.closeAlertDialog(context); + // print(error); + // } void statusListener(String status) { reconizedWord = status == 'listening' ? 'Lisening...' : 'Sorry....'; @@ -556,14 +556,14 @@ class _SendFeedbackPageState extends State { setState(() { messageController.text += reconizedWord + '\n'; RoboSearch.closeAlertDialog(context); - speech.stop(); + // speech.stop(); }); } } - Future initSpeechState() async { - bool hasSpeech = await speech.initialize(onError: errorListener, onStatus: statusListener); - print(hasSpeech); - if (!mounted) return; - } + // Future initSpeechState() async { + // bool hasSpeech = await speech.initialize(onError: errorListener, onStatus: statusListener); + // print(hasSpeech); + // if (!mounted) return; + // } } diff --git a/lib/pages/insurance/insurance_page.dart b/lib/pages/insurance/insurance_page.dart index 75acbffb..2ea4213f 100644 --- a/lib/pages/insurance/insurance_page.dart +++ b/lib/pages/insurance/insurance_page.dart @@ -143,10 +143,10 @@ class InsurancePage extends StatelessWidget { } getDetails({String setupID, int projectID, String patientIdentificationID, int patientID, String name, bool isFamily, int parentID = 0, BuildContext context}) { - // GifLoaderDialogUtils.showMyDialog(context); - // _insuranceCardService.getPatientInsuranceDetails(setupID: setupID, projectID: projectID, patientID: patientID, patientIdentificationID: patientIdentificationID, isFamily: isFamily, parentID: parentID).then((value) { - // GifLoaderDialogUtils.hideDialog(context); - // if (!_insuranceCardService.hasError && _insuranceCardService.isHaveInsuranceCard) { + GifLoaderDialogUtils.showMyDialog(context); + _insuranceCardService.getPatientInsuranceDetails(setupID: setupID, projectID: projectID, patientID: patientID, patientIdentificationID: patientIdentificationID, isFamily: isFamily, parentID: parentID).then((value) { + GifLoaderDialogUtils.hideDialog(context); + if (!_insuranceCardService.hasError && _insuranceCardService.isHaveInsuranceCard) { Navigator.push( context, FadePage( @@ -158,9 +158,9 @@ class InsurancePage extends StatelessWidget { ))).then((value) { model.getInsuranceUpdated(); }); - // } else { - // AppToast.showErrorToast(message: _insuranceCardService.error); - // } - // }); + } else { + AppToast.showErrorToast(message: _insuranceCardService.error); + } + }); } } diff --git a/lib/pages/livecare/widgets/LiveCarePendingRequest.dart b/lib/pages/livecare/widgets/LiveCarePendingRequest.dart index 7f22c7b6..c8519cfd 100644 --- a/lib/pages/livecare/widgets/LiveCarePendingRequest.dart +++ b/lib/pages/livecare/widgets/LiveCarePendingRequest.dart @@ -112,6 +112,12 @@ class _LiveCarePendingRequestState extends State { // cancelLiveCareRequest(); }), ), + // DefaultButton( + // TranslationBase.of(context).cancel, + // () { + // cancelLiveCareRequest(); + // }, + // ), ], ), ), @@ -200,30 +206,6 @@ class _LiveCarePendingRequestState extends State { // " Patients", // style: TextStyle(fontSize: 20.0, fontWeight: FontWeight.bold)), // ), - // Container( - // transform: Matrix4.translationValues(0.0, 110.0, 0.0), - // alignment: Alignment.bottomCenter, - // width: MediaQuery.of(context).size.width, - // child: ButtonTheme( - // shape: RoundedRectangleBorder( - // borderRadius: BorderRadius.circular(10.0), - // ), - // minWidth: MediaQuery.of(context).size.width, - // height: 45.0, - // child: RaisedButton( - // color: Colors.red[800], - // textColor: Colors.white, - // elevation: 0, - // disabledTextColor: Colors.white, - // disabledColor: new Color(0xFFbcc2c4), - // onPressed: () { - // cancelLiveCareRequest(); - // }, - // child: Text(TranslationBase.of(context).cancel, - // style: TextStyle(fontSize: 18.0)), - // ), - // ), - // ), // ], // ), ); diff --git a/lib/pages/medical/patient_sick_leave_page.dart b/lib/pages/medical/patient_sick_leave_page.dart index f132741e..1ca32e02 100644 --- a/lib/pages/medical/patient_sick_leave_page.dart +++ b/lib/pages/medical/patient_sick_leave_page.dart @@ -57,8 +57,8 @@ class _PatientSickLeavePageState extends State { subName: model.sickLeaveList[index].clinicName, isSortByClinic: false, isInOutPatient: model.sickLeaveList[index].isInOutPatient, - isSickLeave: true, - sickLeaveStatus: model.sickLeaveList[index].status, + // isSickLeave: true, + // sickLeaveStatus: model.sickLeaveList[index].status, onEmailTap: () { showConfirmMessage(model, index); }, @@ -69,13 +69,13 @@ class _PatientSickLeavePageState extends State { } void showConfirmMessage(PatientSickLeaveViewMode model, int index) { - if (model.sickLeaveList[index].status == 1) { - openWorkPlaceUpdatePage(model.sickLeaveList[index].requestNo, model.sickLeaveList[index].setupID, model, index, model.sickLeaveList[index].projectID); - } else if (model.sickLeaveList[index].status == 2) { + // if (model.sickLeaveList[index].status == 1) { + // openWorkPlaceUpdatePage(model.sickLeaveList[index].requestNo, model.sickLeaveList[index].setupID, model, index, model.sickLeaveList[index].projectID); + // } else if (model.sickLeaveList[index].status == 2) { showEmailDialog(model, index); - } else { - showApprovalDialog(); - } + // } else { + // showApprovalDialog(); + // } } void showApprovalDialog() { diff --git a/lib/pages/pharmacy/pharmacyAddresses/AddAddress.dart b/lib/pages/pharmacy/pharmacyAddresses/AddAddress.dart index dcc4b299..f57bb478 100644 --- a/lib/pages/pharmacy/pharmacyAddresses/AddAddress.dart +++ b/lib/pages/pharmacy/pharmacyAddresses/AddAddress.dart @@ -1,22 +1,20 @@ import 'dart:async'; +import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/core/service/AlHabibMedicalService/customer_addresses_service.dart'; -import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/add_new_address_Request_Model.dart'; import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/PharmacyAddressesViewModel.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; +import 'package:diplomaticquarterapp/uitl/location_util.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/app_map/google_huawei_map.dart'; import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; -import 'package:diplomaticquarterapp/widgets/pickupLocation/PickupLocationFromMap.dart'; import 'package:flutter/material.dart'; import 'package:geocoding/geocoding.dart'; -import 'package:geolocator/geolocator.dart'; import 'package:google_maps_flutter/google_maps_flutter.dart'; -import 'package:google_maps_place_picker/google_maps_place_picker.dart'; import 'package:provider/provider.dart'; class AddAddressPage extends StatefulWidget { @@ -37,6 +35,7 @@ class _AddAddressPageState extends State { LatLng currentPostion; Completer mapController = Completer(); Placemark selectedPlace; + LocationUtils locationUtils; static CameraPosition _kGooglePlex = CameraPosition( target: LatLng(37.42796133580664, -122.085749655962), @@ -93,13 +92,28 @@ class _AddAddressPageState extends State { } _getCurrentLocation() async { - await Geolocator.getLastKnownPosition().then((value) { - _latitude = value.latitude; - _longitude = value.longitude; - }).catchError((e) { - _longitude = 0; - _latitude = 0; - }); + if (await this.sharedPref.getDouble(USER_LAT) != null && await this.sharedPref.getDouble(USER_LONG) != null) { + var lat = await this.sharedPref.getDouble(USER_LAT); + var long = await this.sharedPref.getDouble(USER_LONG); + _latitude = lat; + _longitude = long; + currentPostion = LatLng(lat, long); + setMap(); + } else { + locationUtils = new LocationUtils(isShowConfirmDialog: true, context: context); + locationUtils.getCurrentLocation(callBack: (value) { + print(value); + setMap(); + }); + } + + // await Geolocator.getLastKnownPosition().then((value) { + // _latitude = value.latitude; + // _longitude = value.longitude; + // }).catchError((e) { + // _longitude = 0; + // _latitude = 0; + // }); } @override @@ -184,8 +198,8 @@ class _AddAddressPageState extends State { // widget.onPick(value); // }, // ), - ), - ); + ), + ); // ); } } diff --git a/lib/services/appointment_services/GetDoctorsList.dart b/lib/services/appointment_services/GetDoctorsList.dart index ca65e4de..6cf2251b 100644 --- a/lib/services/appointment_services/GetDoctorsList.dart +++ b/lib/services/appointment_services/GetDoctorsList.dart @@ -253,7 +253,7 @@ class DoctorsListService extends BaseService { return Future.value(localRes); } - Future getDoctorFreeSlots(int docID, int clinicID, int projectID, BuildContext context) async { + Future getDoctorFreeSlots(int docID, int clinicID, int projectID, BuildContext context, [ProjectViewModel projectViewModel]) async { Map request; var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); Request req = appGlobal.getPublicRequest(); @@ -276,6 +276,16 @@ class DoctorsListService extends BaseService { "DeviceTypeID": 1 }; + if (clinicID == 253) { + List procedureID = projectViewModel.selectedBodyPartList.map((element) => element.id.toString()).toList(); + request["GeneralProcedureList"] = procedureID; + if (procedureID.length == 1 && procedureID[0] == "1") { + request["ProcedureSlotDuration"] = 90; + } else { + request["ProcedureSlotDuration"] = projectViewModel.laserSelectionDuration; + } + } + dynamic localRes; await baseAppClient.post(GET_DOCTOR_FREE_SLOTS, onSuccess: (response, statusCode) async { diff --git a/lib/uitl/LocalNotification.dart b/lib/uitl/LocalNotification.dart index 3d31e84b..af0db957 100644 --- a/lib/uitl/LocalNotification.dart +++ b/lib/uitl/LocalNotification.dart @@ -28,109 +28,158 @@ class LocalNotification { } } - _initialize() { - var initializationSettingsAndroid = new AndroidInitializationSettings('app_icon'); - var initializationSettingsIOS = IOSInitializationSettings(onDidReceiveLocalNotification: null); - var initializationSettings = InitializationSettings(android: initializationSettingsAndroid, iOS: initializationSettingsIOS); - flutterLocalNotificationsPlugin.initialize(initializationSettings, onSelectNotification: _onNotificationClick); - } - - var _random = new Random(); + _initialize() async { + try { + var initializationSettingsAndroid = new AndroidInitializationSettings('app_icon'); + var initializationSettingsIOS = DarwinInitializationSettings(onDidReceiveLocalNotification: null); + var initializationSettings = InitializationSettings(android: initializationSettingsAndroid, iOS: initializationSettingsIOS); + await flutterLocalNotificationsPlugin.initialize( + initializationSettings, + onDidReceiveNotificationResponse: + (NotificationResponse notificationResponse) { + switch (notificationResponse.notificationResponseType) { + case NotificationResponseType.selectedNotification: + // selectNotificationStream.add(notificationResponse.payload); + break; + case NotificationResponseType.selectedNotificationAction: + // if (notificationResponse.actionId == navigationActionId) { + // selectNotificationStream.add(notificationResponse.payload); + // } + break; + } + }, + onDidReceiveBackgroundNotificationResponse: notificationTapBackground, + ); + } catch(ex) {} + // flutterLocalNotificationsPlugin.initialize(initializationSettings, onDidReceiveNotificationResponse: (NotificationResponse notificationResponse) + // { + // switch (notificationResponse.notificationResponseType) { + // case NotificationResponseType.selectedNotification: + // // selectNotificationStream.add(notificationResponse.payload); + // break; + // case NotificationResponseType.selectedNotificationAction: + // // if (notificationResponse.actionId == navigationActionId) { + // // selectNotificationStream.add(notificationResponse.payload); + // } + // // break; + // },} + // + // , + // + // ); +} - _randomNumber({int from = 100000}) { - return _random.nextInt(from); + void notificationTapBackground(NotificationResponse notificationResponse) { + // ignore: avoid_print + print('notification(${notificationResponse.id}) action tapped: ' + '${notificationResponse.actionId} with' + ' payload: ${notificationResponse.payload}'); + if (notificationResponse.input?.isNotEmpty ?? false) { + // ignore: avoid_print + print( + 'notification action tapped with input: ${notificationResponse.input}'); + } } - _vibrationPattern() { - var vibrationPattern = Int64List(4); - vibrationPattern[0] = 0; - vibrationPattern[1] = 1000; - vibrationPattern[2] = 5000; - vibrationPattern[3] = 2000; +var _random = new Random(); - return vibrationPattern; - } +_randomNumber({int from = 100000}) { + return _random.nextInt(from); +} - Future showNow({@required String title, @required String subtitle, String payload}) { - Future.delayed(Duration(seconds: 1)).then((result) async { - var androidPlatformChannelSpecifics = AndroidNotificationDetails('com.hmg.local_notification', 'HMG', - channelDescription: 'HMG', importance: Importance.max, priority: Priority.high, ticker: 'ticker', vibrationPattern: _vibrationPattern()); - var iOSPlatformChannelSpecifics = IOSNotificationDetails(); - var platformChannelSpecifics = NotificationDetails(android: androidPlatformChannelSpecifics, iOS: iOSPlatformChannelSpecifics); - await flutterLocalNotificationsPlugin.show(_randomNumber(), title, subtitle, platformChannelSpecifics, payload: payload).catchError((err) { - print(err); - }); - }); - } +_vibrationPattern() { + var vibrationPattern = Int64List(4); + vibrationPattern[0] = 0; + vibrationPattern[1] = 1000; + vibrationPattern[2] = 5000; + vibrationPattern[3] = 2000; + + return vibrationPattern; +} - Future scheduleNotification({@required DateTime scheduledNotificationDateTime, @required String title, @required String description}) async { - ///vibrationPattern - var vibrationPattern = Int64List(4); - vibrationPattern[0] = 0; - vibrationPattern[1] = 1000; - vibrationPattern[2] = 5000; - vibrationPattern[3] = 2000; - - var androidPlatformChannelSpecifics = AndroidNotificationDetails('active-prescriptions', 'ActivePrescriptions', - channelDescription: 'ActivePrescriptionsDescription', - // icon: 'secondary_icon', - sound: RawResourceAndroidNotificationSound('slow_spring_board'), - - ///change it to be as ionic - // largeIcon: DrawableResourceAndroidBitmap('sample_large_icon'),///change it to be as ionic - vibrationPattern: vibrationPattern, - enableLights: true, - color: const Color.fromARGB(255, 255, 0, 0), - ledColor: const Color.fromARGB(255, 255, 0, 0), - ledOnMs: 1000, - ledOffMs: 500); - var iOSPlatformChannelSpecifics = IOSNotificationDetails(sound: 'slow_spring_board.aiff'); - - // /change it to be as ionic +Future showNow({@required String title, @required String subtitle, String payload}) { + Future.delayed(Duration(seconds: 1)).then((result) async { + var androidPlatformChannelSpecifics = AndroidNotificationDetails('com.hmg.local_notification', 'HMG', + channelDescription: 'HMG', + importance: Importance.max, + priority: Priority.high, + ticker: 'ticker', + vibrationPattern: _vibrationPattern()); + var iOSPlatformChannelSpecifics = DarwinNotificationDetails(); var platformChannelSpecifics = NotificationDetails(android: androidPlatformChannelSpecifics, iOS: iOSPlatformChannelSpecifics); - await flutterLocalNotificationsPlugin.schedule(0, title, description, scheduledNotificationDateTime, platformChannelSpecifics); - } + await flutterLocalNotificationsPlugin.show(_randomNumber(), title, subtitle, platformChannelSpecifics, payload: payload).catchError((err) { + print(err); + }); + }); +} - ///Repeat notification every day at approximately 10:00:00 am - Future showDailyAtTime() async { - var time = Time(10, 0, 0); - var androidPlatformChannelSpecifics = AndroidNotificationDetails('repeatDailyAtTime channel id', 'repeatDailyAtTime channel name', channelDescription: 'repeatDailyAtTime description'); - var iOSPlatformChannelSpecifics = IOSNotificationDetails(); - // var platformChannelSpecifics = NotificationDetails( - // androidPlatformChannelSpecifics, iOSPlatformChannelSpecifics); - // await flutterLocalNotificationsPlugin.showDailyAtTime( - // 0, - // 'show daily title', - // 'Daily notification shown at approximately ${_toTwoDigitString(time.hour)}:${_toTwoDigitString(time.minute)}:${_toTwoDigitString(time.second)}', - // time, - // platformChannelSpecifics); - } +Future scheduleNotification({@required DateTime scheduledNotificationDateTime, @required String title, @required String description}) async { + ///vibrationPattern + var vibrationPattern = Int64List(4); + vibrationPattern[0] = 0; + vibrationPattern[1] = 1000; + vibrationPattern[2] = 5000; + vibrationPattern[3] = 2000; + + var androidPlatformChannelSpecifics = AndroidNotificationDetails('active-prescriptions', 'ActivePrescriptions', + channelDescription: 'ActivePrescriptionsDescription', + // icon: 'secondary_icon', + sound: RawResourceAndroidNotificationSound('slow_spring_board'), + + ///change it to be as ionic + // largeIcon: DrawableResourceAndroidBitmap('sample_large_icon'),///change it to be as ionic + vibrationPattern: vibrationPattern, + enableLights: true, + color: const Color.fromARGB(255, 255, 0, 0), + ledColor: const Color.fromARGB(255, 255, 0, 0), + ledOnMs: 1000, + ledOffMs: 500); + var iOSPlatformChannelSpecifics = DarwinNotificationDetails(sound: 'slow_spring_board.aiff'); + + // /change it to be as ionic + var platformChannelSpecifics = NotificationDetails(android: androidPlatformChannelSpecifics, iOS: iOSPlatformChannelSpecifics); + await flutterLocalNotificationsPlugin.schedule(0, title, description, scheduledNotificationDateTime, platformChannelSpecifics); +} - ///Repeat notification weekly on Monday at approximately 10:00:00 am - Future showWeeklyAtDayAndTime() async { - var time = Time(10, 0, 0); - var androidPlatformChannelSpecifics = AndroidNotificationDetails('show weekly channel id', 'show weekly channel name', channelDescription: 'show weekly description'); - var iOSPlatformChannelSpecifics = IOSNotificationDetails(); - // var platformChannelSpecifics = NotificationDetails( - // androidPlatformChannelSpecifics, iOSPlatformChannelSpecifics); - // await flutterLocalNotificationsPlugin.showWeeklyAtDayAndTime( - // 0, - // 'show weekly title', - // 'Weekly notification shown on Monday at approximately ${_toTwoDigitString(time.hour)}:${_toTwoDigitString(time.minute)}:${_toTwoDigitString(time.second)}', - // Day.Monday, - // time, - // platformChannelSpecifics); - } +///Repeat notification every day at approximately 10:00:00 am +Future showDailyAtTime() async { + var time = Time(10, 0, 0); + var androidPlatformChannelSpecifics = AndroidNotificationDetails('repeatDailyAtTime channel id', 'repeatDailyAtTime channel name', channelDescription: 'repeatDailyAtTime description'); + var iOSPlatformChannelSpecifics = DarwinNotificationDetails(); + // var platformChannelSpecifics = NotificationDetails( + // androidPlatformChannelSpecifics, iOSPlatformChannelSpecifics); + // await flutterLocalNotificationsPlugin.showDailyAtTime( + // 0, + // 'show daily title', + // 'Daily notification shown at approximately ${_toTwoDigitString(time.hour)}:${_toTwoDigitString(time.minute)}:${_toTwoDigitString(time.second)}', + // time, + // platformChannelSpecifics); +} - String _toTwoDigitString(int value) { - return value.toString().padLeft(2, '0'); - } +///Repeat notification weekly on Monday at approximately 10:00:00 am +Future showWeeklyAtDayAndTime() async { + var time = Time(10, 0, 0); + var androidPlatformChannelSpecifics = AndroidNotificationDetails('show weekly channel id', 'show weekly channel name', channelDescription: 'show weekly description'); + var iOSPlatformChannelSpecifics = DarwinNotificationDetails(); + // var platformChannelSpecifics = NotificationDetails( + // androidPlatformChannelSpecifics, iOSPlatformChannelSpecifics); + // await flutterLocalNotificationsPlugin.showWeeklyAtDayAndTime( + // 0, + // 'show weekly title', + // 'Weekly notification shown on Monday at approximately ${_toTwoDigitString(time.hour)}:${_toTwoDigitString(time.minute)}:${_toTwoDigitString(time.second)}', + // Day.Monday, + // time, + // platformChannelSpecifics); +} - Future cancelNotification() async { - await flutterLocalNotificationsPlugin.cancel(0); - } +String _toTwoDigitString(int value) { + return value.toString().padLeft(2, '0'); +} - Future cancelAllNotifications() async { - await flutterLocalNotificationsPlugin.cancelAll(); - } +Future cancelNotification() async { + await flutterLocalNotificationsPlugin.cancel(0); } + +Future cancelAllNotifications() async { + await flutterLocalNotificationsPlugin.cancelAll(); +}} diff --git a/lib/uitl/location_util.dart b/lib/uitl/location_util.dart index bb215613..3eb6388f 100644 --- a/lib/uitl/location_util.dart +++ b/lib/uitl/location_util.dart @@ -24,6 +24,7 @@ class LocationUtils { bool isShowConfirmDialog; BuildContext context; bool isHuawei; + final GeolocatorPlatform _geolocatorPlatform = GeolocatorPlatform.instance; LocationUtils({@required this.isShowConfirmDialog, @required this.context, this.isHuawei = false}); @@ -43,11 +44,16 @@ class LocationUtils { if (permission == LocationPermission.denied || permission == LocationPermission.deniedForever) { if (Platform.isAndroid) { - Utils.showPermissionConsentDialog(context, TranslationBase.of(context).locationPermissionDialog, () { - Geolocator.getCurrentPosition(desiredAccuracy: LocationAccuracy.medium, timeLimit: Duration(seconds: 10)).then((value) { - setLocation(value); - if (callBack != null) callBack(LatLng(value.latitude, value.longitude)); - }); + Utils.showPermissionConsentDialog(context, TranslationBase.of(context).locationPermissionDialog, () async { + final hasPermission = await _handlePermission(); + if (hasPermission) { + Geolocator.getCurrentPosition(desiredAccuracy: LocationAccuracy.medium, timeLimit: Duration(seconds: 10)).then((value) { + setLocation(value); + if (callBack != null) callBack(LatLng(value.latitude, value.longitude)); + }); + } else { + if (isShowConfirmDialog) showErrorLocationDialog(false); + } }); } else { if (await Permission.location.request().isGranted) { @@ -70,6 +76,29 @@ class LocationUtils { } } + Future _handlePermission() async { + bool serviceEnabled; + LocationPermission permission; + + serviceEnabled = await _geolocatorPlatform.isLocationServiceEnabled(); + if (!serviceEnabled) { + return false; + } + + permission = await _geolocatorPlatform.checkPermission(); + if (permission == LocationPermission.denied) { + permission = await _geolocatorPlatform.requestPermission(); + if (permission == LocationPermission.denied) { + return false; + } + } + + if (permission == LocationPermission.deniedForever) { + return false; + } + return true; + } + LocationCallback _locationCallback; _getHMSCurrentLocation(Function(LatLng) callBack) async { diff --git a/lib/uitl/push-notification-handler.dart b/lib/uitl/push-notification-handler.dart index 2cea20f3..49fa571d 100644 --- a/lib/uitl/push-notification-handler.dart +++ b/lib/uitl/push-notification-handler.dart @@ -223,12 +223,14 @@ class PushNotificationHandler { // if (Platform.isAndroid && (!await FlutterHmsGmsAvailability.isHmsAvailable)) { if (Platform.isAndroid) { - await hmsApiAvailability.isHMSAvailable().then((value) async { - if (value != 0) { - final fcmToken = await FirebaseMessaging.instance.getToken(); - if (fcmToken != null) onToken(fcmToken); - } - }); + try { + await hmsApiAvailability.isHMSAvailable().then((value) async { + if (value != 0) { + final fcmToken = await FirebaseMessaging.instance.getToken(); + if (fcmToken != null) onToken(fcmToken); + } + }); + } catch (ex) {} } if (Platform.isIOS) { diff --git a/lib/widgets/app_map/google_huawei_map.dart b/lib/widgets/app_map/google_huawei_map.dart index 57e23d81..35eabfdc 100644 --- a/lib/widgets/app_map/google_huawei_map.dart +++ b/lib/widgets/app_map/google_huawei_map.dart @@ -47,6 +47,7 @@ class AppMapState extends State { checkIsHuawei() async { await hmsApiAvailability.isHMSAvailable().then((value) { isHuawei = value == 0 ? true : false; + hmsMap.HuaweiMapInitializer.initializeMap(); }); print(isHuawei); setState(() {}); diff --git a/lib/widgets/others/bottom_bar.dart b/lib/widgets/others/bottom_bar.dart index 03622a7a..a21eb817 100644 --- a/lib/widgets/others/bottom_bar.dart +++ b/lib/widgets/others/bottom_bar.dart @@ -33,9 +33,9 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_tts/flutter_tts.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'; +// 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'; class BottomBarSearch extends StatefulWidget { @override @@ -47,7 +47,7 @@ class _SearchBot extends State { RobotProvider Provider = RobotProvider(); bool isLoading = false; bool isError = false; - final SpeechToText speech = SpeechToText(); + // final SpeechToText speech = SpeechToText(); String error = ''; String _currentLocaleId = ""; String lastError; @@ -98,8 +98,8 @@ class _SearchBot extends State { }); // await flutterTts.speak("Hello!"); //Future.delayed(const Duration(seconds: 1), () { - initSpeechState() - .then((value) => startVoiceSearch()); + // initSpeechState() + // .then((value) => startVoiceSearch()); //}); }, )), @@ -111,34 +111,34 @@ class _SearchBot extends State { ); } - startVoiceSearch() async { - speech.listen( - onResult: resultListener, - listenFor: Duration(seconds: 10), - localeId: _currentLocaleId, - onSoundLevelChange: soundLevelListener, - cancelOnError: true, - partialResults: true, - onDevice: true, - listenMode: ListenMode.confirmation); - } - - void resultListener(SpeechRecognitionResult result) { - // lastWords = "${result.recognizedWords} - ${result.finalResult}"; - - if (result.finalResult == true) { - // setState(() { - reconizedWord = result.recognizedWords; - //}); - setState(() { - searchController.text = reconizedWord; - }); - Future.delayed(const Duration(seconds: 1), () { - _speak(reconizedWord); - }); - } - //}); - } + // startVoiceSearch() async { + // speech.listen( + // onResult: resultListener, + // listenFor: Duration(seconds: 10), + // localeId: _currentLocaleId, + // onSoundLevelChange: soundLevelListener, + // cancelOnError: true, + // partialResults: true, + // onDevice: true, + // listenMode: ListenMode.confirmation); + // } + + // void resultListener(SpeechRecognitionResult result) { + // // lastWords = "${result.recognizedWords} - ${result.finalResult}"; + // + // if (result.finalResult == true) { + // // setState(() { + // reconizedWord = result.recognizedWords; + // //}); + // setState(() { + // searchController.text = reconizedWord; + // }); + // Future.delayed(const Duration(seconds: 1), () { + // _speak(reconizedWord); + // }); + // } + // //}); + // } Future _speak(reconizedWord) async { //await flutterTts.speak(reconizedWord); @@ -161,23 +161,23 @@ class _SearchBot extends State { ].request(); } - Future initSpeechState() async { - await speech.initialize(onError: errorListener, onStatus: statusListener); - - _currentLocaleId = - TranslationBase.of(AppGlobal.context).locale.languageCode == 'en' - ? 'en-GB' - : 'ar-SA'; // systemLocale.localeId; - flutterTts.setLanguage(_currentLocaleId); - - // if (!mounted) return; - } - - void errorListener(SpeechRecognitionError error) { - //setState(() { - // reconizedWord = "${error.errorMsg} - ${error.permanent}"; - //}); - } + // Future initSpeechState() async { + // await speech.initialize(onError: errorListener, onStatus: statusListener); + // + // _currentLocaleId = + // TranslationBase.of(AppGlobal.context).locale.languageCode == 'en' + // ? 'en-GB' + // : 'ar-SA'; // systemLocale.localeId; + // flutterTts.setLanguage(_currentLocaleId); + // + // // if (!mounted) return; + // } + + // void errorListener(SpeechRecognitionError error) { + // //setState(() { + // // reconizedWord = "${error.errorMsg} - ${error.permanent}"; + // //}); + // } void statusListener(String status) { //setState(() { diff --git a/lib/widgets/others/floating_button_search.dart b/lib/widgets/others/floating_button_search.dart index 10f30b71..5a571df8 100644 --- a/lib/widgets/others/floating_button_search.dart +++ b/lib/widgets/others/floating_button_search.dart @@ -66,8 +66,8 @@ import 'package:flutter/material.dart'; import 'package:flutter_tts/flutter_tts.dart'; import 'package:permission_handler/permission_handler.dart'; import 'package:provider/provider.dart'; -import 'package:speech_to_text/speech_recognition_error.dart'; -import 'package:speech_to_text/speech_to_text.dart' as stt; +// import 'package:speech_to_text/speech_recognition_error.dart'; +// import 'package:speech_to_text/speech_to_text.dart' as stt; import 'package:url_launcher/url_launcher.dart'; class FloatingSearchButton extends StatefulWidget { @@ -83,7 +83,7 @@ class _FloatingSearchButton extends State with TickerProvi RobotProvider eventProvider = RobotProvider(); bool isLoading = false; bool isError = false; - stt.SpeechToText speech = stt.SpeechToText(); + // stt.SpeechToText speech = stt.SpeechToText(); String error = ''; String _currentLocaleId = ""; String lastError; @@ -143,7 +143,7 @@ class _FloatingSearchButton extends State with TickerProvi if (p['startPopUp'] == 'true') { if (this.mounted) { new RoboSearch(context: context).showAlertDialog(context); - initSpeechState().then((value) => {startVoiceSearch()}); + // initSpeechState().then((value) => {startVoiceSearch()}); } } }); @@ -192,20 +192,20 @@ class _FloatingSearchButton extends State with TickerProvi : Image.asset('assets/images/gif/robot-idle.gif'), ), onTap: () async { - if (Platform.isAndroid) { - if (await PermissionService.isMicrophonePermissionEnabled()) { - new RoboSearch(context: context).showAlertDialog(context); - initSpeechState().then((value) => {startVoiceSearch()}); - } else { - Utils.showPermissionConsentDialog(context, TranslationBase.of(context).recordAudioPermission, () { - new RoboSearch(context: context).showAlertDialog(context); - initSpeechState().then((value) => {startVoiceSearch()}); - }); - } - } else { - new RoboSearch(context: context).showAlertDialog(context); - initSpeechState().then((value) => {startVoiceSearch()}); - } + // if (Platform.isAndroid) { + // if (await PermissionService.isMicrophonePermissionEnabled()) { + // new RoboSearch(context: context).showAlertDialog(context); + // initSpeechState().then((value) => {startVoiceSearch()}); + // } else { + // Utils.showPermissionConsentDialog(context, TranslationBase.of(context).recordAudioPermission, () { + // new RoboSearch(context: context).showAlertDialog(context); + // initSpeechState().then((value) => {startVoiceSearch()}); + // }); + // } + // } else { + // new RoboSearch(context: context).showAlertDialog(context); + // initSpeechState().then((value) => {startVoiceSearch()}); + // } }, ), Positioned( @@ -234,31 +234,31 @@ class _FloatingSearchButton extends State with TickerProvi ])); } - startVoiceSearch() async { - bool available = await speech.initialize(onStatus: statusListener, onError: errorListener); - _currentLocaleId = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); - - if (available) { - speech.listen( - onResult: resultListener, - //listenMode: ListenMode.confirmation, - localeId: _currentLocaleId == 'en' ? 'en_US' : 'ar_SA', - ); - } else { - print("The user has denied the use of speech recognition."); - } - // some time later... - //speech.stop(); - // speech.listen( - // onResult: resultListener, - // listenFor: Duration(seconds: 10), - // localeId: _currentLocaleId == 'en' ? 'en-US' : 'ar-SA', - // onSoundLevelChange: soundLevelListener, - // cancelOnError: true, - // partialResults: true, - // onDevice: true, - // listenMode: ListenMode.deviceDefault); - } + // startVoiceSearch() async { + // bool available = await speech.initialize(onStatus: statusListener, onError: errorListener); + // _currentLocaleId = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + // + // if (available) { + // speech.listen( + // onResult: resultListener, + // //listenMode: ListenMode.confirmation, + // localeId: _currentLocaleId == 'en' ? 'en_US' : 'ar_SA', + // ); + // } else { + // print("The user has denied the use of speech recognition."); + // } + // // some time later... + // //speech.stop(); + // // speech.listen( + // // onResult: resultListener, + // // listenFor: Duration(seconds: 10), + // // localeId: _currentLocaleId == 'en' ? 'en-US' : 'ar-SA', + // // onSoundLevelChange: soundLevelListener, + // // cancelOnError: true, + // // partialResults: true, + // // onDevice: true, + // // listenMode: ListenMode.deviceDefault); + // } void resultListener(result) { reconizedWord = result.recognizedWords; @@ -305,7 +305,7 @@ class _FloatingSearchButton extends State with TickerProvi isArabic = Provider.of(context, listen: false).isArabic; await requestPermissions(); getUserData(); - await speech.initialize(onError: errorListener, onStatus: statusListener); + // await speech.initialize(onError: errorListener, onStatus: statusListener); //initialSpeak(); if (!mounted) return; @@ -315,10 +315,10 @@ class _FloatingSearchButton extends State with TickerProvi // }); } - void errorListener(SpeechRecognitionError error) { - event.setValue({"searchText": 'null'}); - RoboSearch.closeAlertDialog(context); - } + // void errorListener(SpeechRecognitionError error) { + // event.setValue({"searchText": 'null'}); + // RoboSearch.closeAlertDialog(context); + // } void statusListener(String status) { //setState(() { @@ -951,7 +951,7 @@ class _MyStatefulBuilderState extends State { var searchText; static StreamSubscription streamSubscription; static var isClosed = false; - stt.SpeechToText speech = stt.SpeechToText(); + // stt.SpeechToText speech = stt.SpeechToText(); @override void initState() { @@ -1019,7 +1019,7 @@ class _MyStatefulBuilderState extends State { TranslationBase.of(context).ok, () { RoboSearch.closeAlertDialog(context); - speech.stop(); + // speech.stop(); // event.setValue({"searchText": { // 'isIOSFeedback':true, // diff --git a/lib/widgets/pickupLocation/PickupLocationFromMap.dart b/lib/widgets/pickupLocation/PickupLocationFromMap.dart index e5639f5c..d8aa1642 100644 --- a/lib/widgets/pickupLocation/PickupLocationFromMap.dart +++ b/lib/widgets/pickupLocation/PickupLocationFromMap.dart @@ -13,7 +13,7 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:geocoding/geocoding.dart'; import 'package:google_maps_flutter/google_maps_flutter.dart'; -import 'package:google_maps_place_picker/google_maps_place_picker.dart'; +import 'package:google_maps_place_picker_mb/google_maps_place_picker.dart'; import 'package:huawei_hmsavailability/huawei_hmsavailability.dart'; import 'package:provider/provider.dart'; diff --git a/pubspec.yaml b/pubspec.yaml index 7acc49ed..0f8af947 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,7 +1,7 @@ name: diplomaticquarterapp description: A new Flutter application. -version: 4.5.005+4050005 +version: 4.5.008+4050008 environment: sdk: ">=2.7.0 <3.0.0" @@ -22,7 +22,8 @@ dependencies: connectivity: ^3.0.6 async: ^2.8.1 - audio_wave: ^0.1.2 + audio_wave: ^0.1.4 +# audio_session: ^0.1.13 # State Management provider: ^6.0.1 @@ -36,7 +37,7 @@ dependencies: fl_chart: ^0.40.2 #Camera Preview - camera: ^0.9.4+5 + camera: ^0.10.1 # Permissions permission_handler: ^8.3.0 @@ -89,8 +90,8 @@ dependencies: google_maps_flutter: ^2.1.1 # Huawei - huawei_map: 6.0.1+305 - huawei_push: ^5.3.0+304 + huawei_map: 6.5.0+301 + huawei_push: ^6.5.0+300 # Qr code Scanner TODO fix it # barcode_scanner: ^1.0.1 @@ -98,7 +99,7 @@ dependencies: location: ^4.3.0 # Qr code Scanner # barcode_scan_fix: ^1.0.2 - barcode_scan2: ^4.2.1 + barcode_scan2: ^4.2.2 # Rating Stars rating_bar: ^0.2.0 @@ -113,13 +114,13 @@ dependencies: manage_calendar_events: ^2.0.1 #InAppBrowser -# flutter_inappwebview: ^5.3.2 + flutter_inappwebview: 5.7.2+3 #Circular progress bar for reverse timer circular_countdown_timer: ^0.2.0 #Just Audio to play ringing for incoming video call - just_audio: ^0.9.18 + just_audio: ^0.9.30 #hijri hijri: ^2.0.3 @@ -130,13 +131,13 @@ dependencies: carousel_pro: ^1.0.0 #local_notifications - flutter_local_notifications: ^9.1.4 + flutter_local_notifications: ^10.0.0 #device_calendar device_calendar: ^4.2.0 #Handle Geolocation - geolocator: ^7.7.1 + geolocator: ^9.0.2 #Handle lat long to address geocoding: ^2.0.1 @@ -150,7 +151,8 @@ dependencies: #google maps places - google_maps_place_picker: ^2.1.0-nullsafety.3 + google_maps_place_picker_mb: ^3.0.0 +# google_maps_place_picker: ^2.1.0-nullsafety.3 map_launcher: ^1.1.3 #countdown timer for Upcoming List flutter_countdown_timer: ^4.1.0 @@ -170,8 +172,8 @@ dependencies: flutter_nfc_kit: ^3.3.1 - speech_to_text: - path: speech_to_text +# speech_to_text: ^6.1.1 +# path: speech_to_text in_app_update: ^3.0.0 @@ -209,9 +211,9 @@ dependency_overrides: permission_handler : ^6.0.1+1 flutter_svg: ^1.0.0 # firebase_messaging_platform_interface: any - flutter_inappwebview: - git: - url: https://github.com/CodeEagle/flutter_inappwebview +# flutter_inappwebview: 5.7.2+3 +# git: +# url: https://github.com/CodeEagle/flutter_inappwebview dev_dependencies: From 6bdb7a330523a3024e4ca4ef8e3676cc215dd9a9 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Tue, 10 Jan 2023 17:26:34 +0300 Subject: [PATCH 02/29] Updates & fixes --- android/app/src/main/AndroidManifest.xml | 1 + lib/config/localized_values.dart | 4 +- lib/pages/feedback/send_feedback_page.dart | 8 ++-- lib/pages/livecare/incoming_call.dart | 35 ++++++------------ .../livecare/live_care_payment_page.dart | 37 +++++++++++++++++-- lib/uitl/app-permissions.dart | 8 ++-- lib/uitl/push-notification-handler.dart | 30 ++++++++++----- pubspec.yaml | 4 +- 8 files changed, 80 insertions(+), 47 deletions(-) diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index ef4a8f83..de6f8030 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -6,6 +6,7 @@ In most cases you can leave this as-is, but you if you want to provide additional functionality it is fine to subclass or reimplement FlutterApplication and put your custom class here. --> + diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 958b451d..73f4c1fe 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -863,7 +863,7 @@ const Map localizedValues = { "question": {"en": "Question", "ar": "سؤال"}, "message-type": {"en": "Message Type", "ar": "نوع الرسالة"}, "feedback-type": {"en": "Feedback Type", "ar": "نوع الرسالة"}, - "compliment": {"en": "compliment", "ar": "شكوى"}, + "compliment": {"en": "Appreciation", "ar": "تقدير"}, "suggestion": {"en": "Suggestion", "ar": "إقتراح"}, "your-feedback": {"en": "Your feedback was sent", "ar": "لقد تم ارسال اقتراحك شكرا لك"}, "select-part": {"en": "Please select the part that complain about", "ar": "يرجى تحديد الجزء الذي تشكو منه"}, @@ -1843,7 +1843,7 @@ const Map localizedValues = { "privacyPolicy": {"en": "Privacy Policy", "ar": "سياسة الخصوصية"}, "termsConditions": {"en": "Terms & Conditions", "ar": "الأحكام والشروط"}, "prescriptionDeliveryError": {"en": "This clinic does not support refill & delivery.", "ar": "هذه العيادة لا تدعم إعادة التعبئة والتسليم."}, - "liveCarePermissions": {"en": "LiveCare requires Camera, Microphone & Location permissions, Please allow these to proceed.", "ar": "يتطلب لايف كير أذونات الكاميرا والميكروفون والموقع، يرجى السماح لها بالمتابعة."}, + "liveCarePermissions": {"en": "LiveCare requires Camera, Microphone & Location permissions to enable virtual consultation between patient & doctor, Please allow these to proceed.", "ar": "يتطلب لايف كير أذونات الكاميرا والميكروفون والموقع، يرجى السماح لها بالمتابعة."}, "lakumUnhold": { "en": "The account has already been activated", "ar": "لقد تم تفعيل الحساب من قبل" }, "lakumDiscontinue": { "en": "The account is closed", "ar": "الحساب مغلق" }, "lakumSuccess": { "en": "The account has been activated successfully", "ar": "تم تفعيل الحساب بنجاح" }, diff --git a/lib/pages/feedback/send_feedback_page.dart b/lib/pages/feedback/send_feedback_page.dart index 4bd1ae81..2badddd5 100644 --- a/lib/pages/feedback/send_feedback_page.dart +++ b/lib/pages/feedback/send_feedback_page.dart @@ -340,8 +340,8 @@ class _SendFeedbackPageState extends State { }); } }, - color: Color(0xffD02127), - textColor: (titleController.text.toString().isEmpty || messageController.text.toString().isEmpty) ? Color(0xff000000) : Colors.white, + color: (titleController.text.toString().isEmpty || messageController.text.toString().isEmpty) ? Color(0xffEAEAEA) : Color(0xffD02127), + textColor: Colors.white, disabledColor: Color(0xffEAEAEA), ), ), @@ -405,8 +405,8 @@ class _SendFeedbackPageState extends State { color: Color(0xff575757), letterSpacing: -0.56, ), - suffixIconConstraints: BoxConstraints(minWidth: 50), - suffixIcon: suffixTap == null ? null : IconButton(icon: Icon(Icons.mic, color: Color(0xff2E303A)), onPressed: suffixTap), + // suffixIconConstraints: BoxConstraints(minWidth: 50), + // suffixIcon: suffixTap == null ? null : IconButton(icon: Icon(Icons.mic, color: Color(0xff2E303A)), onPressed: suffixTap), contentPadding: EdgeInsets.zero, border: InputBorder.none, focusedBorder: InputBorder.none, diff --git a/lib/pages/livecare/incoming_call.dart b/lib/pages/livecare/incoming_call.dart index 69ae98f6..da8c507e 100644 --- a/lib/pages/livecare/incoming_call.dart +++ b/lib/pages/livecare/incoming_call.dart @@ -49,7 +49,7 @@ class _IncomingCallState extends State with SingleTickerProviderSt void dispose() { _animationController.dispose(); player.stop(); - _controller.dispose(); + // _controller.dispose(); disposeAudioResources(); super.dispose(); } @@ -62,17 +62,17 @@ class _IncomingCallState extends State with SingleTickerProviderSt body: FutureBuilder( future: _initializeControllerFuture, builder: (context, snapshot) { - if (snapshot.connectionState == ConnectionState.done) { + // if (snapshot.connectionState == ConnectionState.done) { return Stack( alignment: FractionalOffset.center, children: [ - new Positioned.fill( - child: new AspectRatio(aspectRatio: _controller.value.aspectRatio, child: new CameraPreview(_controller)), - ), + // new Positioned.fill( + // child: new AspectRatio(aspectRatio: _controller.value.aspectRatio, child: new CameraPreview(_controller)), + // ), new Positioned.fill( child: new ClipRect( - child: new BackdropFilter( - filter: new ImageFilter.blur(sigmaX: 10.0, sigmaY: 10.0), + // child: new BackdropFilter( + // filter: new ImageFilter.blur(sigmaX: 10.0, sigmaY: 10.0), child: new Container( decoration: new BoxDecoration(color: Colors.grey[800].withOpacity(0.8)), child: Column( @@ -191,29 +191,18 @@ class _IncomingCallState extends State with SingleTickerProviderSt ), ), ), - ), + // ), ], ); - } else { - return const Center(child: CircularProgressIndicator()); - } + // } else { + // return const Center(child: CircularProgressIndicator()); + // } }, ), ); } void _runAnimation() async { - final cameras = await availableCameras(); - final firstCamera = cameras[1]; - - _controller = CameraController( - // Get a specific camera from the list of available cameras. - firstCamera, - // Define the resolution to use. - ResolutionPreset.medium, - ); - _initializeControllerFuture = _controller.initialize(); - setState(() { isCameraReady = true; }); @@ -229,7 +218,7 @@ class _IncomingCallState extends State with SingleTickerProviderSt try { // backToHome(); // final roomModel = RoomModel(name: widget.incomingCallData.name, token: widget.incomingCallData.sessionId, identity: widget.incomingCallData.identity); - await _controller.dispose(); + // await _controller.dispose(); changeCallStatusAPI(4); await Navigator.of(context).pushReplacement( MaterialPageRoute( diff --git a/lib/pages/livecare/live_care_payment_page.dart b/lib/pages/livecare/live_care_payment_page.dart index 375249b3..3b0dab9b 100644 --- a/lib/pages/livecare/live_care_payment_page.dart +++ b/lib/pages/livecare/live_care_payment_page.dart @@ -10,6 +10,7 @@ import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/utils_new.dart'; import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart'; +import 'package:diplomaticquarterapp/widgets/dialogs/covid_consent_dialog.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/material.dart'; import 'package:flutter_svg/flutter_svg.dart'; @@ -290,7 +291,7 @@ class _LiveCarePatmentPageState extends State { AppToast.showErrorToast(message: TranslationBase.of(context).pleaseAcceptTerms); } else { askVideoCallPermission().then((value) async { - if (value) { + if (value == true) { locationUtils = new LocationUtils(isShowConfirmDialog: false, context: context); locationUtils.getCurrentLocation(callBack: (value) { print(value); @@ -322,10 +323,29 @@ class _LiveCarePatmentPageState extends State { } Future askVideoCallPermission() async { - if (!(await Permission.camera.request().isGranted) || !(await Permission.microphone.request().isGranted) || !(await Permission.location.request().isGranted)) { - return false; + if (Platform.isIOS) { + if (!(await Permission.camera.request().isGranted) || !(await Permission.microphone.request().isGranted) || !(await Permission.location.request().isGranted)) { + return false; + } + } else { + await showDialog( + context: context, + builder: (cxt) => CovidConsentDialog( + okTitle: TranslationBase.of(context).acceptLbl, + title: TranslationBase.of(context).covidConsentHeader, + message: TranslationBase.of(context).liveCarePermissions, + onTap: () async { + if (!(await Permission.camera.request().isGranted) || !(await Permission.microphone.request().isGranted) || !(await Permission.location.request().isGranted)) { + return false; + } + }, + )); } return true; + // if (!(await Permission.camera.request().isGranted) || !(await Permission.microphone.request().isGranted) || !(await Permission.location.request().isGranted)) { + // return false; + // } + // return true; } openPermissionsDialog() { @@ -342,6 +362,17 @@ class _LiveCarePatmentPageState extends State { dialog.showAlertDialog(context); } + openPermissionsConsentDialog() { + showDialog( + context: context, + builder: (cxt) => CovidConsentDialog( + okTitle: TranslationBase.of(context).acceptLbl, + title: TranslationBase.of(context).covidConsentHeader, + message: TranslationBase.of(context).covidConsent, + onTap: () async {}, + )); + } + Future drawOverAppsMessageDialog(BuildContext context) async { ConfirmDialog dialog = new ConfirmDialog( context: context, diff --git a/lib/uitl/app-permissions.dart b/lib/uitl/app-permissions.dart index bdd72e54..62fd484a 100644 --- a/lib/uitl/app-permissions.dart +++ b/lib/uitl/app-permissions.dart @@ -14,10 +14,10 @@ class AppPermission{ if (!(await Permission.camera.request().isGranted) || !(await Permission.microphone.request().isGranted)) { return false; } - if (Platform.isAndroid && !(await PlatformBridge.shared().isDrawOverAppsPermissionAllowed())) { - await _drawOverAppsMessageDialog(context); - return false; - } + // if (Platform.isAndroid && !(await PlatformBridge.shared().isDrawOverAppsPermissionAllowed())) { + // await _drawOverAppsMessageDialog(context); + // return false; + // } return true; } diff --git a/lib/uitl/push-notification-handler.dart b/lib/uitl/push-notification-handler.dart index 49fa571d..4cc85342 100644 --- a/lib/uitl/push-notification-handler.dart +++ b/lib/uitl/push-notification-handler.dart @@ -22,6 +22,7 @@ import 'package:flutter_ios_voip_kit/call_state_type.dart'; import 'package:flutter_ios_voip_kit/flutter_ios_voip_kit.dart'; import 'package:huawei_hmsavailability/huawei_hmsavailability.dart'; import 'package:huawei_push/huawei_push.dart' as h_push; +import 'package:permission_handler/permission_handler.dart'; import 'app_shared_preferences.dart'; import 'navigation_service.dart'; @@ -236,6 +237,11 @@ class PushNotificationHandler { if (Platform.isIOS) { final permission = await FirebaseMessaging.instance.requestPermission(); if (permission.authorizationStatus == AuthorizationStatus.denied) return; + } else { + // await Permission.notification.request().then((value) { + // }).catchError((err) { + // print(err); + // }); } // 'Android HMS' (Handle Huawei Push_Kit Streams) @@ -245,15 +251,21 @@ class PushNotificationHandler { // } else { // 'Android GMS or iOS' (Handle Firebase Messaging Streams - FirebaseMessaging.instance.getInitialMessage().then((RemoteMessage message) async { - print("Firebase getInitialMessage with message : ${message.data.toString()}"); - subscribeFCMTopic(); - if (Platform.isIOS) - await Future.delayed(Duration(milliseconds: 3000)).then((value) { - if (message != null) newMessage(message); - }); - else if (message != null) newMessage(message); - }); + try { + FirebaseMessaging.instance.getInitialMessage().then((RemoteMessage message) async { + if(message != null) { + // print("Firebase getInitialMessage with message : ${message.data.toString()}"); + subscribeFCMTopic(); + if (Platform.isIOS) + await Future.delayed(Duration(milliseconds: 3000)).then((value) { + if (message != null) newMessage(message); + }); + else if (message != null) newMessage(message); + } + }); + } catch(ex) { + + } FirebaseMessaging.onMessage.listen((RemoteMessage message) async { print("Firebase onMessage!!!"); diff --git a/pubspec.yaml b/pubspec.yaml index 0f8af947..15accfac 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,7 +1,7 @@ name: diplomaticquarterapp description: A new Flutter application. -version: 4.5.008+4050008 +version: 4.5.013+4050013 environment: sdk: ">=2.7.0 <3.0.0" @@ -40,7 +40,7 @@ dependencies: camera: ^0.10.1 # Permissions - permission_handler: ^8.3.0 + permission_handler: ^10.2.0 # Flutter Html View flutter_html: ^2.2.1 From 9683b3f42fbc6679a9e89a663a608e699855ed25 Mon Sep 17 00:00:00 2001 From: Sultan khan <> Date: Wed, 18 Jan 2023 10:05:22 +0300 Subject: [PATCH 03/29] Dubai Reminder fixed. --- .../xcshareddata/xcschemes/Runner.xcscheme | 97 ------------------- .../widgets/AppointmentActions.dart | 9 +- lib/uitl/CalendarUtils.dart | 8 +- 3 files changed, 11 insertions(+), 103 deletions(-) delete mode 100644 ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme diff --git a/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme deleted file mode 100644 index ea96fe5f..00000000 --- a/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ /dev/null @@ -1,97 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/lib/pages/MyAppointments/widgets/AppointmentActions.dart b/lib/pages/MyAppointments/widgets/AppointmentActions.dart index 35f88bed..e7e82fc6 100644 --- a/lib/pages/MyAppointments/widgets/AppointmentActions.dart +++ b/lib/pages/MyAppointments/widgets/AppointmentActions.dart @@ -33,6 +33,7 @@ import 'package:diplomaticquarterapp/widgets/data_display/medical/medical_profil import 'package:diplomaticquarterapp/widgets/in_app_browser/InAppBrowser.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/material.dart'; +import 'package:intl/intl.dart'; import 'package:map_launcher/map_launcher.dart'; import 'package:maps_launcher/maps_launcher.dart'; import 'package:provider/provider.dart'; @@ -108,11 +109,15 @@ class _AppointmentActionsState extends State { case "addReminder": showReminderDialog( context, - DateUtil.convertStringToDate(widget.appo.appointmentDate), + new DateFormat("dd MMM yyyy hh:mm") + .parse(DateUtil.formatDateToDate(DateUtil.convertStringToDate(widget.appo.appointmentDate), widget.projectViewModel.isArabic) + " " + widget.appo.startTime), + //DateUtil.convertStringToDate(widget.appo.appointmentDate), widget.appo.doctorNameObj, "", + DateUtil.formatDateToDate(DateUtil.convertStringToDate(widget.appo.appointmentDate), widget.projectViewModel.isArabic), - DateUtil.formatDateToTime(DateUtil.convertStringToDate(widget.appo.appointmentDate)), + // DateUtil.formatDateToTime(DateUtil.convertStringToDate(widget.appo.appointmentDate)), + widget.appo.startTime, onSuccess: () { AppToast.showSuccessToast(message: TranslationBase.of(context).reminderSuccess); }, diff --git a/lib/uitl/CalendarUtils.dart b/lib/uitl/CalendarUtils.dart index b79ea3ef..75af015c 100644 --- a/lib/uitl/CalendarUtils.dart +++ b/lib/uitl/CalendarUtils.dart @@ -62,10 +62,10 @@ class CalendarUtils { TZDateTime scheduleDateTimeUTZ = TZDateTime.from(scheduleDateTime, _currentLocation); - print("eventId: " + eventId); - print("writableCalendars-name: " + writableCalendars.name); - print("writableCalendars-Id: " + writableCalendars.id); - print("writableCalendarsToString: " + writableCalendars.toString()); + // print("eventId: " + eventId); + // print("writableCalendars-name: " + writableCalendars.name); + // print("writableCalendars-Id: " + writableCalendars.id); + // print("writableCalendarsToString: " + writableCalendars.toString()); Event event = Event(writableCalendars.id, start: scheduleDateTimeUTZ, end: scheduleDateTimeUTZ.add(Duration(minutes: 30)), title: title, description: description); deviceCalendarPlugin.createOrUpdateEvent(event).catchError((e) { print("catchError " + e.toString()); From 74b0acefd35180514f53abdf9f24e81318c8e08a Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Mon, 6 Feb 2023 16:42:18 +0300 Subject: [PATCH 04/29] Updates & fixes --- lib/config/localized_values.dart | 1 + .../ancillaryOrdersDetails.dart | 1 + lib/pages/Blood/confirm_payment_page.dart | 2 +- lib/pages/BookAppointment/BookSuccess.dart | 3 +- lib/pages/BookAppointment/QRCode.dart | 242 ++++++++---------- .../EdOnline/EdPaymentInformationPage.dart | 2 +- lib/pages/ToDoList/ToDo.dart | 1 + lib/pages/livecare/livecare_home.dart | 4 + lib/pages/livecare/widgets/clinic_list.dart | 13 +- .../medical/balance/confirm_payment_page.dart | 1 + lib/uitl/translations_delegate_base.dart | 1 + lib/widgets/drawer/app_drawer_widget.dart | 36 +-- lib/widgets/new_design/doctor_header.dart | 13 + lib/widgets/nfc/nfc_reader_sheet.dart | 4 + 14 files changed, 168 insertions(+), 156 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 73f4c1fe..8a9a4c40 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -183,6 +183,7 @@ const Map localizedValues = { 'sitWaitingQR': {'en': 'Sit in the waiting rooms until called by the nurse.', 'ar': 'الجلوس في غرف الانتظار لحين منادتك من قبل الممرضة.'}, 'attendRegisterCode': {'en': 'Attendance registration code', 'ar': 'رمز تسجيل الحضور'}, 'scanQRHospital': {'en': 'Approach the Online Check-In board in the hospital & scan via NFC to Check-In', 'ar': 'اقترب من لوحة تسجيل الوصول عبر الإنترنت في المستشفى وافحصها عبر NFC لتسجيل الوصول'}, + 'scanNFC': {'en': 'Scan NFC to Check-In', 'ar': 'مسح NFC لتسجيل الوصول'}, "sendEmail": {"en": "Send Email", "ar": "ارسال نسخة"}, "success": {"en": "Done successfully", "ar": "تم تنفذ الطلب بنجاح"}, "EmailSentSuccessfully": {"en": "Email Sent Successfully", "ar": "تم إرسال البريد الإلكتروني بنجاح"}, diff --git a/lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrdersDetails.dart b/lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrdersDetails.dart index e4ea7eaa..c1e75b69 100644 --- a/lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrdersDetails.dart +++ b/lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrdersDetails.dart @@ -512,6 +512,7 @@ class _AnicllaryOrdersState extends State with SingleTic "3", // Need to get new Service ID from Ayman for Ancillary Tamara "", + context, model.ancillaryListsDetails[0].appointmentDate, model.ancillaryListsDetails[0].appointmentNo, model.ancillaryListsDetails[0].clinicID, diff --git a/lib/pages/Blood/confirm_payment_page.dart b/lib/pages/Blood/confirm_payment_page.dart index e5845194..a93861f5 100644 --- a/lib/pages/Blood/confirm_payment_page.dart +++ b/lib/pages/Blood/confirm_payment_page.dart @@ -195,7 +195,7 @@ class ConfirmPaymentPage extends StatelessWidget { browser = new MyInAppBrowser(onExitCallback: onBrowserExit, appo: appo, onLoadStartCallback: onBrowserLoadStart); browser.openPaymentBrowser(amount, "Advance Payment", Utils.getAdvancePaymentTransID(authenticatedUser.projectID, authenticatedUser.patientID), appo.projectID.toString(), - authenticatedUser.emailAddress, paymentMethod, authenticatedUser.patientType, authenticatedUser.firstName, authenticatedUser.patientID, authenticatedUser, browser, false, "3", ""); + authenticatedUser.emailAddress, paymentMethod, authenticatedUser.patientType, authenticatedUser.firstName, authenticatedUser.patientID, authenticatedUser, browser, false, "3", "", null); } onBrowserLoadStart(String url) { diff --git a/lib/pages/BookAppointment/BookSuccess.dart b/lib/pages/BookAppointment/BookSuccess.dart index 6de4a31c..3ebb827c 100644 --- a/lib/pages/BookAppointment/BookSuccess.dart +++ b/lib/pages/BookAppointment/BookSuccess.dart @@ -284,7 +284,7 @@ class _BookSuccessState extends State { ), height: 45.0, child: CustomTextButton( - backgroundColor: Color(0xffc5272d), + backgroundColor: CustomColors.green, elevation: 0, onPressed: () { AppoitmentAllHistoryResultList appo = new AppoitmentAllHistoryResultList(); @@ -587,6 +587,7 @@ class _BookSuccessState extends State { widget.patientShareResponse.isLiveCareAppointment, "2", widget.patientShareResponse.isLiveCareAppointment ? widget.patientShareResponse.clinicID.toString() : "", + context, widget.patientShareResponse.appointmentDate, widget.patientShareResponse.appointmentNo, widget.patientShareResponse.clinicID, diff --git a/lib/pages/BookAppointment/QRCode.dart b/lib/pages/BookAppointment/QRCode.dart index d85f4505..2f861bd3 100644 --- a/lib/pages/BookAppointment/QRCode.dart +++ b/lib/pages/BookAppointment/QRCode.dart @@ -1,4 +1,3 @@ -import 'dart:convert'; import 'dart:typed_data'; import 'package:diplomaticquarterapp/analytics/google-analytics.dart'; @@ -8,15 +7,18 @@ import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResu import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart'; import 'package:diplomaticquarterapp/models/Appointments/PatientShareResposne.dart'; import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; +import 'package:diplomaticquarterapp/models/header_model.dart'; import 'package:diplomaticquarterapp/routes.dart'; import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart'; +import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; -import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/custom_text_button.dart'; import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart'; +import 'package:diplomaticquarterapp/widgets/new_design/doctor_header.dart'; import 'package:diplomaticquarterapp/widgets/nfc/nfc_reader_sheet.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/material.dart'; @@ -53,159 +55,131 @@ class _QRCodeState extends State { }); WidgetsBinding.instance.addPostFrameCallback((timeStamp) { - Future.delayed(const Duration(milliseconds: 500), () { - showNfcReader(context, onNcfScan: (String nfcId) { - Future.delayed(const Duration(milliseconds: 100), () { - sendNfcCheckInRequest(nfcId); - locator().todoList.to_do_list_nfc(widget.appointment); - }); - }, onCancel: () { - // Navigator.of(context).pop(); - locator().todoList.to_do_list_nfc_cancel(widget.appointment); - }); - }); + startNFCScan(); }); super.initState(); } + startNFCScan() { + Future.delayed(const Duration(milliseconds: 500), () { + showNfcReader(context, onNcfScan: (String nfcId) { + Future.delayed(const Duration(milliseconds: 100), () { + sendNfcCheckInRequest(nfcId); + locator().todoList.to_do_list_nfc(widget.appointment); + }); + }, onCancel: () { + // Navigator.of(context).pop(); + locator().todoList.to_do_list_nfc_cancel(widget.appointment); + }); + }); + } + @override Widget build(BuildContext context) { _context = context; return AppScaffold( - appBarTitle: TranslationBase.of(context).attendRegisterCode, + appBarTitle: TranslationBase.of(context).onlineCheckIn, isShowAppBar: true, showNewAppBar: true, showNewAppBarTitle: true, body: SingleChildScrollView( - child: Container( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisSize: MainAxisSize.max, - children: [ - Container( - width: double.infinity, - height: MediaQuery.of(context).size.width / 3, - child: Row( - children: [ - Expanded( - flex: 1, - child: Row( - crossAxisAlignment: CrossAxisAlignment.center, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - InkWell( - child: Container( - margin: EdgeInsets.only(top: 30.0), - alignment: Alignment.center, - padding: EdgeInsets.all(8), - decoration: BoxDecoration( - border: Border.all(color: Colors.black), - borderRadius: BorderRadius.circular(10), - ), - child: SvgPicture.asset("assets/images/nfc/contactless.svg"), - ), - onTap: () { - showNfcReader(context, onNcfScan: (String nfcId) { - Future.delayed(const Duration(milliseconds: 100), () { - sendNfcCheckInRequest(nfcId); - locator().todoList.to_do_list_nfc(widget.appointment); - }); - }, onCancel: () { - // Navigator.of(context).pop(); - locator().todoList.to_do_list_nfc_cancel(widget.appointment); - }); - }, - ), - ], - ), - ), - // Expanded( - // flex: 1, - // child: Container( - // margin: EdgeInsets.only(top: 30.0), - // alignment: Alignment.center, - // child: Image.memory( - // _bytes, - // ), - // ), - // ), - ], - ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + DoctorHeader( + headerModel: HeaderModel( + widget.appointment.doctorTitle + " " + widget.appointment.doctorNameObj, + widget.appointment.doctorID, + widget.appointment.doctorImageURL, + widget.appointment.doctorSpeciality, + "", + widget.appointment.projectName, + DateUtil.convertStringToDate(widget.appointment.appointmentDate), + widget.appointment.isLiveCareAppointment + ? DateUtil.convertStringToDate(widget.appointment.appointmentDate).toString().split(" ")[1].substring(0, 5) + : widget.appointment.startTime.substring(0, 5), + null, + widget.appointment.doctorRate, + widget.appointment.actualDoctorRate, + widget.appointment.noOfPatientsRate, + "", ), - Container( - margin: EdgeInsets.only(top: 20.0, left: 20.0, right: 20.0), - child: Divider( - color: Colors.red[700], - thickness: 0.8, + isShowName: true, + isNeedToShowButton: false, + buttonTitle: '', + onTap: () {}, + onRatingAndReviewTap: () {}, + ), + InkWell( + child: Container( + margin: EdgeInsets.only(top: 30.0), + padding: EdgeInsets.all(8), + child: SvgPicture.asset( + "assets/images/nfc/contactless.svg", + width: 80.0, + height: 80.0, ), ), - Row( - children: [ - Expanded( - child: Container( - width: double.infinity, - margin: EdgeInsets.only(top: 15.0, bottom: 10.0, left: 20.0, right: 20.0), - child: Text(TranslationBase.of(context).scanQRHospital, style: TextStyle(color: Colors.red[700], fontSize: 18.0, fontWeight: FontWeight.bold)), - ), + onTap: () { + showNfcReader(context, onNcfScan: (String nfcId) { + Future.delayed(const Duration(milliseconds: 100), () { + sendNfcCheckInRequest(nfcId); + locator().todoList.to_do_list_nfc(widget.appointment); + }); + }, onCancel: () { + // Navigator.of(context).pop(); + locator().todoList.to_do_list_nfc_cancel(widget.appointment); + }); + }, + ), + Row( + children: [ + Expanded( + child: Container( + width: double.infinity, + margin: EdgeInsets.only(top: 15.0, bottom: 10.0, left: 20.0, right: 20.0), + child: Text(TranslationBase.of(context).scanQRHospital, + style: TextStyle( + fontSize: 20, + fontWeight: FontWeight.w600, + letterSpacing: -0.48, + )), ), - ], - ), - Container( - margin: EdgeInsets.only(top: 10.0, left: 20.0, right: 20.0), - child: Divider( - color: Colors.red[700], - thickness: 0.8, ), - ), - Container( - margin: EdgeInsets.only(top: 15.0, bottom: 10.0, left: 20.0, right: 20.0), - child: Text(TranslationBase.of(context).appoInfo, style: TextStyle(fontSize: 18.0, color: Colors.grey[700], fontWeight: FontWeight.bold)), - ), - Container( - margin: EdgeInsets.only(left: 20.0, bottom: 20.0, right: 20.0), - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(10), - color: Colors.grey[200], - boxShadow: [ - BoxShadow(color: Colors.grey, spreadRadius: 2), - ], + ], + ), + ], + ), + ), + bottomSheet: Container( + color: CustomColors.appBackgroudGreyColor, + padding: EdgeInsets.all(21), + // height: 45.0, + child: Row( + children: [ + Expanded( + flex: 1, + child: ButtonTheme( + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(10.0), ), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Container( - margin: EdgeInsets.only(top: 15.0, bottom: 10.0, left: 20.0, right: 20.0), - child: Text(widget.patientShareResponse.doctorNameObj, style: TextStyle(fontSize: 18.0, color: Colors.grey[700], fontWeight: FontWeight.bold)), - ), - if (getDoctorSpeciality(widget.patientShareResponse.doctorSpeciality) != "null\n") - Container( - margin: EdgeInsets.only(bottom: 10.0, left: 20.0, right: 20.0), - child: Text(getDoctorSpeciality(widget.patientShareResponse.doctorSpeciality), style: TextStyle(fontSize: 18.0, color: Colors.grey[700])), - ), - Container( - margin: EdgeInsets.only(top: 0.0, bottom: 10.0, left: 20.0, right: 20.0), - child: Text(widget.patientShareResponse.projectName, style: TextStyle(fontSize: 18.0, color: Colors.grey[700])), - ), - Container( - margin: EdgeInsets.only(top: 0.0, bottom: 10.0, left: 20.0, right: 20.0), - child: Text(getDate(widget.patientShareResponse.appointmentDate), style: TextStyle(fontSize: 18.0, color: Colors.grey[700])), - ), - ], + height: 45.0, + child: CustomTextButton( + backgroundColor: CustomColors.green, + elevation: 0, + onPressed: () { + startNFCScan(); + }, + child: Text(TranslationBase.of(context).scanNFC, + style: TextStyle( + fontSize: 18.0, + color: Colors.white, + )), ), ), - // Container( - // margin: EdgeInsets.only(left: 20.0, right: 20.0, top: 15.0), - // alignment: Alignment.bottomCenter, - // child: Column( - // mainAxisAlignment: MainAxisAlignment.end, - // children: [ - // DefaultButton(TranslationBase.of(context).sendEmail.toUpperCase(), () => {sendEmail()}) - // ], - // ), - // ), - ], - ), + ), + ], ), ), ); diff --git a/lib/pages/ErService/EdOnline/EdPaymentInformationPage.dart b/lib/pages/ErService/EdOnline/EdPaymentInformationPage.dart index 6b313a47..4d6b072e 100644 --- a/lib/pages/ErService/EdOnline/EdPaymentInformationPage.dart +++ b/lib/pages/ErService/EdOnline/EdPaymentInformationPage.dart @@ -168,7 +168,7 @@ class _EdPaymentInformationPageState extends State { browser = new MyInAppBrowser(onExitCallback: onBrowserExit, appo: appo, onLoadStartCallback: onBrowserLoadStart); transID = Utils.getAdvancePaymentTransID(widget.selectedHospital.iD, projectViewModel.user.patientID); browser.openPaymentBrowser(amount, "ER Online Check-In", transID, appo.projectID.toString(), authenticatedUser.emailAddress, paymentMethod, authenticatedUser.patientType, - authenticatedUser.firstName, authenticatedUser.patientID, authenticatedUser, browser, false, "3", ""); + authenticatedUser.firstName, authenticatedUser.patientID, authenticatedUser, browser, false, "3", "", context); } onBrowserLoadStart(String url) { diff --git a/lib/pages/ToDoList/ToDo.dart b/lib/pages/ToDoList/ToDo.dart index b4c0e17f..c6f1e6db 100644 --- a/lib/pages/ToDoList/ToDo.dart +++ b/lib/pages/ToDoList/ToDo.dart @@ -960,6 +960,7 @@ class _ToDoState extends State with SingleTickerProviderStateMixin { appo.isLiveCareAppointment, "2", appo.isLiveCareAppointment ? widget.patientShareResponse.clinicID.toString() : "", + context, appo.appointmentDate, appo.appointmentNo, appo.clinicID, diff --git a/lib/pages/livecare/livecare_home.dart b/lib/pages/livecare/livecare_home.dart index f5e9bf53..a3942f22 100644 --- a/lib/pages/livecare/livecare_home.dart +++ b/lib/pages/livecare/livecare_home.dart @@ -17,6 +17,9 @@ import 'package:provider/provider.dart'; class LiveCareHome extends StatefulWidget { static bool showFooterButton = true; static bool isLiveCareTypeSelected = false; + final bool isPharmacyLiveCare; + + const LiveCareHome({Key key, this.isPharmacyLiveCare = false}) : super(key: key); @override _LiveCareHomeState createState() => _LiveCareHomeState(); @@ -121,6 +124,7 @@ class _LiveCareHomeState extends State with SingleTickerProviderSt isDataLoaded && !hasLiveCareRequest ? ClinicList( getLiveCareHistory: getLiveCareHistory, + isPharmacyLiveCare: widget.isPharmacyLiveCare, ) : isDataLoaded ? LiveCarePendingRequest(getLiveCareHistory: getLiveCareHistory, pendingERRequestHistoryList: pendingERRequestHistoryList) diff --git a/lib/pages/livecare/widgets/clinic_list.dart b/lib/pages/livecare/widgets/clinic_list.dart index 05dd19b1..564a3485 100644 --- a/lib/pages/livecare/widgets/clinic_list.dart +++ b/lib/pages/livecare/widgets/clinic_list.dart @@ -39,8 +39,9 @@ import '../live_care_payment_page.dart'; class ClinicList extends StatefulWidget { final Function getLiveCareHistory; + final bool isPharmacyLiveCare; - ClinicList({@required this.getLiveCareHistory}); + ClinicList({@required this.getLiveCareHistory, this.isPharmacyLiveCare = false}); @override _clinic_listState createState() => _clinic_listState(); @@ -316,7 +317,7 @@ class _clinic_listState extends State { this.amount = amount.toString(); browser.openPaymentBrowser(amount, "LiveCare Payment", Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), "12", authenticatedUser.emailAddress, paymentMethod[0], - authenticatedUser.patientType, authenticatedUser.firstName, authenticatedUser.patientID, authenticatedUser, browser, false, "4", selectedClinicID, "", "", "", "", paymentMethod[1]); + authenticatedUser.patientType, authenticatedUser.firstName, authenticatedUser.patientID, authenticatedUser, browser, false, "4", selectedClinicID, context, "", "", "", "", paymentMethod[1]); } onBrowserLoadStart(String url) { @@ -531,8 +532,12 @@ class _clinic_listState extends State { setState(() { currentSelectedLiveCareType = "immediate"; }); - getLiveCareClinicsList(); - startLiveCare(); + // if(widget.isPharmacyLiveCare) { + // + // } else { + getLiveCareClinicsList(); + startLiveCare(); + // } } else { Navigator.of(context) .push(new MaterialPageRoute( diff --git a/lib/pages/medical/balance/confirm_payment_page.dart b/lib/pages/medical/balance/confirm_payment_page.dart index b4d79d49..ab5381c9 100644 --- a/lib/pages/medical/balance/confirm_payment_page.dart +++ b/lib/pages/medical/balance/confirm_payment_page.dart @@ -367,6 +367,7 @@ class _ConfirmPaymentPageState extends State { false, "3", "0", + context, "", "", "", diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index 705118e7..95e1e438 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -2877,6 +2877,7 @@ class TranslationBase { String get pendingActivation => localizedValues["pendingActivation"][locale.languageCode]; String get awaitingApproval => localizedValues["awaitingApproval"][locale.languageCode]; String get liveCareSupportContact => localizedValues["liveCareSupportContact"][locale.languageCode]; + String get scanNFC => localizedValues["scanNFC"][locale.languageCode]; } diff --git a/lib/widgets/drawer/app_drawer_widget.dart b/lib/widgets/drawer/app_drawer_widget.dart index 79f080a5..180bfe63 100644 --- a/lib/widgets/drawer/app_drawer_widget.dart +++ b/lib/widgets/drawer/app_drawer_widget.dart @@ -1,5 +1,3 @@ -import 'dart:io'; - import 'package:barcode_scan2/barcode_scan2.dart'; import 'package:diplomaticquarterapp/analytics/google-analytics.dart'; import 'package:diplomaticquarterapp/config/config.dart'; @@ -18,6 +16,7 @@ import 'package:diplomaticquarterapp/models/FamilyFiles/GetAllSharedRecordByStat import 'package:diplomaticquarterapp/pages/Blood/user_agreement_page.dart'; import 'package:diplomaticquarterapp/pages/DrawerPages/notifications/notifications_page.dart'; import 'package:diplomaticquarterapp/pages/landing/landing_page.dart'; +import 'package:diplomaticquarterapp/pages/livecare/livecare_home.dart'; import 'package:diplomaticquarterapp/pages/rateAppointment/rate_appointment_doctor.dart'; import 'package:diplomaticquarterapp/pages/webRTC/call_page.dart'; import 'package:diplomaticquarterapp/routes.dart'; @@ -335,19 +334,19 @@ class _AppDrawerState extends State { } }, ), - // InkWell( - // child: DrawerItem(TranslationBase.of(context).pharmacyLiveCare, SvgPicture.asset("assets/images/new/Live_Care.svg"), - // isImageIcon: true, - // bottomLine: false, - // textColor: Theme.of(context).textTheme.bodyText1.color, - // iconColor: Theme.of(context).textTheme.bodyText1.color, - // sideArrow: true, - // letterSpacing: -0.84, - // projectProvider: projectProvider), - // onTap: () { - // readQRCode(); - // }, - // ), + InkWell( + child: DrawerItem(TranslationBase.of(context).pharmacyLiveCare, SvgPicture.asset("assets/images/new/Live_Care.svg"), + isImageIcon: true, + bottomLine: false, + textColor: Theme.of(context).textTheme.bodyText1.color, + iconColor: Theme.of(context).textTheme.bodyText1.color, + sideArrow: true, + letterSpacing: -0.84, + projectProvider: projectProvider), + onTap: () { + readQRCode(); + }, + ), InkWell( child: Stack( children: [ @@ -505,9 +504,16 @@ class _AppDrawerState extends State { }).catchError((err) { GifLoaderDialogUtils.hideDialog(context); print(err); + Navigator.pop(context); + startPharmacyLiveCareProcess(); }); } + startPharmacyLiveCareProcess() { + sharedPref.setString(LIVECARE_CLINIC_DATA, "Pharmacy LiveCare" + "-" + "501" + "-" + "7"); + Navigator.push(context, FadePage(page: LiveCareHome(isPharmacyLiveCare: true,))); + } + drawerNavigator(context, routeName) { Navigator.of(context).pushNamed(routeName); } diff --git a/lib/widgets/new_design/doctor_header.dart b/lib/widgets/new_design/doctor_header.dart index 5c556efb..2c9bb42a 100644 --- a/lib/widgets/new_design/doctor_header.dart +++ b/lib/widgets/new_design/doctor_header.dart @@ -22,6 +22,7 @@ class DoctorHeader extends StatelessWidget { final String buttonTitle; final String buttonIcon; final bool isNeedToShowButton; + final bool isShowName; DoctorHeader( {Key key, @@ -29,6 +30,7 @@ class DoctorHeader extends StatelessWidget { @required this.buttonTitle, @required this.onTap, this.isNeedToShowButton = true, + this.isShowName = false, this.buttonIcon, this.showConfirmMessageDialog = true, @required this.onRatingAndReviewTap}) @@ -44,7 +46,18 @@ class DoctorHeader extends StatelessWidget { color: Colors.white, child: Column( mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.start, children: [ + if (isShowName) + Padding( + padding: EdgeInsets.only(left: 21, right: 21, bottom: 12), + child: Text( + headerModel.doctorName, + maxLines: 1, + style: TextStyle( + fontSize: 24, fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), fontWeight: FontWeight.w700, color: Color(0xff2B353E), letterSpacing: -1.44, height: 35 / 24), + ), + ), Padding( padding: EdgeInsets.only(left: 21, right: 21, bottom: 12), child: Row( diff --git a/lib/widgets/nfc/nfc_reader_sheet.dart b/lib/widgets/nfc/nfc_reader_sheet.dart index 4257501f..8881cb29 100644 --- a/lib/widgets/nfc/nfc_reader_sheet.dart +++ b/lib/widgets/nfc/nfc_reader_sheet.dart @@ -44,6 +44,7 @@ class _NfcLayoutState extends State { } void readNFC() async { + FlutterNfcKit.finish(); FlutterNfcKit.poll(timeout: Duration(seconds: 10), androidPlatformSound: true, androidCheckNDEF: false, iosMultipleTagMessage: "Multiple tags found!").then((value) async { setState(() { _reading = true; @@ -55,6 +56,9 @@ class _NfcLayoutState extends State { Navigator.pop(context); }); nfcId = value.id; + }).catchError((err) { + print(err); + Navigator.of(context).pop(); }); } From 4f50c3ff8ea8ae59f9b0d250842093cdc957d814 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Tue, 14 Feb 2023 11:56:15 +0300 Subject: [PATCH 05/29] Pharmacy LiveCare revamped --- lib/config/localized_values.dart | 20 ++++---- lib/pages/BookAppointment/BookSuccess.dart | 24 ++++++++-- .../BookAppointment/DentalComplaints.dart | 5 ++ .../components/SearchByClinic.dart | 18 +++++-- lib/pages/livecare/livecare_home.dart | 4 +- lib/pages/livecare/livecare_type_select.dart | 32 ++++++++++++- .../widgets/LiveCarePendingRequest.dart | 12 ++--- lib/pages/livecare/widgets/clinic_list.dart | 48 +++++++++++++++---- .../appointment_services/GetDoctorsList.dart | 3 +- .../clinic_services/get_clinic_service.dart | 3 +- lib/widgets/drawer/app_drawer_widget.dart | 35 +++++++------- lib/widgets/in_app_browser/InAppBrowser.dart | 9 ++-- 12 files changed, 154 insertions(+), 59 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 8a9a4c40..65a6caab 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -67,7 +67,7 @@ const Map localizedValues = { 'pressAgain': {'en': 'Press again to exit the app', 'ar': 'اضغط مرة أخرى للخروج من التطبيق'}, 'laserMaxLimitReach': {'en': "Maximum limit is 90 minutes", 'ar': "الحد الأقصى هو 90 دقيقة"}, 'confirmAppoHeading': {'en': 'Kindly review your Appointment', 'ar': 'يرجى تأكيد موعدك'}, - 'patientInfo': {'en': 'Patient Information', 'ar': 'معلومات المريض'}, + 'patientInfo': {'en': 'Patient Information', 'ar': 'معلومات المراجع'}, 'doctorFilter': {'en': 'Doctors will be filtered based on your gender and age', 'ar': 'سيتم تصفية الأطباء بناءً على جنسك وعمرك'}, 'bookSuccess': {'en': 'Book Success', 'ar': 'تم حجز الموعد بنجاح'}, 'patientShare': {'en': 'Patient Share', 'ar': 'نسبة العميل'}, @@ -120,7 +120,7 @@ const Map localizedValues = { 'poweredBy': {'en': 'Powered by', 'ar': 'مشغل بواسطة'}, "welcome": {"en": "Welcome", "ar": "مرحبا بكم"}, "welcome-to": {"en": "Welcome to", "ar": "مرحبا بك في"}, - "patient-app": {"en": "Patient App", "ar": "تطبيق المرضى"}, + "patient-app": {"en": "Patient App", "ar": "تطبيق المراجعين"}, "welcome_text": {"en": "Dr. Sulaiman Al Habib Mobile Application", "ar": "الدكتور سليمان الحبيب لتطبيقات الهاتف"}, "dr-sulaiman-text": {"en": "Dr. Sulaiman Al Habib", "ar": "د. سليمان الحبيب"}, 'welcome_text2': {'en': 'Have you previously visited the hospitals or medical centers of Dr. Sulaiman Al Habib?', 'ar': 'هل قمت مسبقا بزيارة مستشفيات او مراكز الدكتور سليمان الحبيب الطبية ؟'}, @@ -419,7 +419,7 @@ const Map localizedValues = { "Amount": {"en": "Amount *", "ar": "المبلغ *"}, "DepositorEmail": {"en": "Depositor Email *", "ar": "البريد الإلكتروني للمودع *"}, "Notes": {"en": "Notes", "ar": "ملاحظات"}, - "SelectPatientName": {"en": "Select Patient Name", "ar": "اختر اسم المريض"}, + "SelectPatientName": {"en": "Select Patient Name", "ar": "اختر اسم المراجع"}, "SelectFamilyPatientName": {"en": "Family Members", "ar": "أفراد الأسرة"}, "SelectHospital": {"en": "Select Hospital", "ar": "اختر المستشفى"}, "selectCity": {"en": "Select City", "ar": "اختر المدينة"}, @@ -1119,7 +1119,7 @@ const Map localizedValues = { "visit": {"en": "Visit", "ar": "زيارة"}, "referralStatus": {"en": "Referral Status", "ar": "حالة الإحالة"}, "referralDate": {"en": "Referral Date", "ar": "تاريخ الإحالة"}, - "patientName": {"en": "Patient Name", "ar": "اسم المريض"}, + "patientName": {"en": "Patient Name", "ar": "اسم المراجع"}, "referralNumber": {"en": "Referral Number", "ar": "رقم الإحالة"}, "requestID": {"en": "Req ID", "ar": " رقم الطلب"}, "OrderStatus": {"en": "Status", "ar": "الحاله"}, @@ -1412,7 +1412,7 @@ const Map localizedValues = { "online-consultation": {"en": "Online Consultation", "ar": "استشارة مباشرة"}, "expected-weiting": {"en": "Waiting time to start LiveCare consultation ", "ar": "وقت الانتظار المتوقع لبدء استشارة لايف كير"}, "er-consult-fee": {"en": "Consultation Fee", "ar": "رسوم الاستشارة"}, - "insured-patient": {"en": "If you're Insurance patient, you have only have to pay the co-payment", "ar": "إذا كنت مريضًا في مجال التأمين ، فليس عليك سوى دفع المبلغ المشترك"}, + "insured-patient": {"en": "If you're Insurance patient, you have only have to pay the co-payment", "ar": "إذا كنت مراجع في مجال التأمين ، فليس عليك سوى دفع المبلغ المشترك"}, "i-accept-terms": {"en": "I Accept the Terms and Conditions", "ar": "موافق على الشروط والأحكام"}, "upcoming-pay-options": {"en": "You can pay by the following Options:", "ar": "يمكنك الدفع عن طريق الخيارات التالية:"}, "please-accept-terms": {"en": "Please accept terms & conditions to continue", "ar": "يرجى قبول الشروط والأحكام للمتابعة"}, @@ -1421,7 +1421,7 @@ const Map localizedValues = { "en": "This service allows you to submit a Referral request from any health care providers either inside or outside the kingdom of Saudi Arabia to any of HMG Hospitals, by filling some of the patient's data and attaching the medical reports, moreover you can track the request status (Under process, Accepted or Rejected)", "ar": - "تتيح لك هذه الخدمة إرسال طلب إحالة من أي من مقدمي الرعاية الصحية سواء داخل المملكة العربية السعودية أو خارجها إلى أي من مستشفيات HMG ، عن طريق ملء بعض بيانات المريض وإرفاق التقارير الطبية ، علاوة على ذلك يمكنك تتبع حالة الطلب (قيد المعالجة ، مقبول أو مرفوض)" + "تتيح لك هذه الخدمة إرسال طلب إحالة من أي من مقدمي الرعاية الصحية سواء داخل المملكة العربية السعودية أو خارجها إلى أي من مستشفيات HMG ، عن طريق ملء بعض بيانات المراجع وإرفاق التقارير الطبية ، علاوة على ذلك يمكنك تتبع حالة الطلب (قيد المعالجة ، مقبول أو مرفوض)" }, "er-consultation": { "en": "This service allows you to make an online virtual consultation via video call directly with the doctor from anywhere at any time.", @@ -1558,10 +1558,10 @@ const Map localizedValues = { "insuranceCompany": {"en": "Insurance Company", "ar": "شركة تأمين"}, "preferredBranch": {"en": "Preferred Branch", "ar": "الفرع المفضل"}, "selectPreferredBranch": {"en": "Select Preferred Branch", "ar": "اختر الفرع المفضل"}, - "patientLocated": {"en": "Where the patient located", "ar": "اين موقع المريض"}, + "patientLocated": {"en": "Where the patient located", "ar": "اين موقع المراجع"}, "otherInfo": {"en": "Other details", "ar": "تفاصيل أخرى"}, "medicalReport": {"en": "Medical Report", "ar": "تقرير طبي"}, - "insuredPatient": {"en": "Insured Patient", "ar": "هل لدى المريض تامين؟"}, + "insuredPatient": {"en": "Insured Patient", "ar": "هل لدى المراجع تامين؟"}, "rateDoctor": {"en": "Rate Doctor", "ar": "تقييم الطبيب"}, "rateAppointment": {"en": "Rate Appointment", "ar": "تقييم الموعد"}, "noInsuranceCardAttached": {"en": "Please attach your insurance card image to continue", "ar": "يرجى إرفاق صورة بطاقة التأمين الخاصة بك للمتابعة"}, @@ -1589,7 +1589,7 @@ const Map localizedValues = { "patientAge": {"en": "y", "ar": "سنة"}, "searchCriteria": {"en": "Select Search Criteria", "ar": "حدد معايير البحث"}, "RequesterInfo": {"en": "Requester Info", "ar": "معلومات مقدم الطلب"}, - "PatientInfo": {"en": "Patient Info", "ar": "معلومات المريض"}, + "PatientInfo": {"en": "Patient Info", "ar": "معلومات المراجع"}, "OtherInfo": {"en": "Other Info", "ar": "معلومات اخرى"}, "inPrgress": {"en": "In Progress", "ar": "في تقدم"}, "locked": {"en": "Locked", "ar": "مقفل"}, @@ -1810,7 +1810,7 @@ const Map localizedValues = { }, "cameraPermissionDialog": { "en": "Dr. Al Habib app needs to access Camera to enable virtual consultation between patient & doctor, attach images and scan QR for parking service.", - "ar": "يحتاج تطبيق دكتور الحبيب الى صلاحية الوصول إلى الكاميرا لخدمة الاستشارة الافتراضية بين المريض والطبيب وإرفاق الصور ومسح رمز الاستجابة السريع لخدمة مواقف السيارات." + "ar": "يحتاج تطبيق دكتور الحبيب الى صلاحية الوصول إلى الكاميرا لخدمة الاستشارة الافتراضية بين المراجع والطبيب وإرفاق الصور ومسح رمز الاستجابة السريع لخدمة مواقف السيارات." }, "galleryPermission": { "en": "Dr. Al Habib app needs to access Read & write external storage to upload images & documents in the E-Referral module and renew and update the insurance cards.", diff --git a/lib/pages/BookAppointment/BookSuccess.dart b/lib/pages/BookAppointment/BookSuccess.dart index 3ebb827c..9b6a4736 100644 --- a/lib/pages/BookAppointment/BookSuccess.dart +++ b/lib/pages/BookAppointment/BookSuccess.dart @@ -284,8 +284,8 @@ class _BookSuccessState extends State { ), height: 45.0, child: CustomTextButton( - backgroundColor: CustomColors.green, - elevation: 0, + backgroundColor: CustomColors.green, + elevation: 0, onPressed: () { AppoitmentAllHistoryResultList appo = new AppoitmentAllHistoryResultList(); appo.clinicID = widget.docObject.clinicID; @@ -300,7 +300,8 @@ class _BookSuccessState extends State { confirmAppointment(appo); } }, - child: Text(widget.patientShareResponse.isLiveCareAppointment ? TranslationBase.of(context).confirmLiveCare : TranslationBase.of(context).confirm, style: TextStyle(fontSize: 16.0, color: Colors.white)), + child: Text(widget.patientShareResponse.isLiveCareAppointment ? TranslationBase.of(context).confirmLiveCare : TranslationBase.of(context).confirm, + style: TextStyle(fontSize: 16.0, color: Colors.white)), ), ), ), @@ -955,12 +956,29 @@ class _BookSuccessState extends State { } Future navigateToQR(context, String appoQR) async { + AppoitmentAllHistoryResultList appointment = new AppoitmentAllHistoryResultList(); + + appointment.doctorTitle = "Dr. "; + appointment.doctorNameObj = widget.patientShareResponse.doctorNameObj; + appointment.doctorImageURL = widget.patientShareResponse.doctorImageURL; + appointment.doctorSpeciality = widget.patientShareResponse.doctorSpeciality; + appointment.projectName = widget.patientShareResponse.projectName; + appointment.projectID = widget.patientShareResponse.projectID; + appointment.appointmentDate = widget.patientShareResponse.appointmentDate; + appointment.isLiveCareAppointment = widget.patientShareResponse.isLiveCareAppointment; + appointment.startTime = widget.patientShareResponse.startTime; + appointment.doctorRate = 5; + appointment.actualDoctorRate = 5; + appointment.noOfPatientsRate = 0; + appointment.clinicName = widget.patientShareResponse.clinicName; + Navigator.push( context, FadePage( page: QRCode( patientShareResponse: widget.patientShareResponse, appoQR: appoQR, + appointment: appointment, ))); } diff --git a/lib/pages/BookAppointment/DentalComplaints.dart b/lib/pages/BookAppointment/DentalComplaints.dart index 25bb200b..27cb951e 100644 --- a/lib/pages/BookAppointment/DentalComplaints.dart +++ b/lib/pages/BookAppointment/DentalComplaints.dart @@ -1,5 +1,6 @@ import 'package:diplomaticquarterapp/analytics/google-analytics.dart'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/locator.dart'; import 'package:diplomaticquarterapp/models/Appointments/DentalChiefComplaintsModel.dart'; import 'package:diplomaticquarterapp/models/Appointments/DentalProceduresModel.dart'; @@ -19,6 +20,7 @@ import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart'; import 'package:diplomaticquarterapp/widgets/others/app_expandable_notifier.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; class DentalComplaints extends StatefulWidget { SearchInfo searchInfo; @@ -44,6 +46,8 @@ class _DentalComplaintsState extends State { DentalProceduresModel dentalProceduresModel; List patientDoctorAppointmentListHospital = List(); + ProjectViewModel projectViewModel; + @override void initState() { WidgetsBinding.instance.addPostFrameCallback((_) => checkIfHasDentalPlan()); @@ -52,6 +56,7 @@ class _DentalComplaintsState extends State { @override Widget build(BuildContext context) { + projectViewModel = Provider.of(context); return AppScaffold( isShowAppBar: true, appBarTitle: TranslationBase.of(context).chiefComplaints, diff --git a/lib/pages/BookAppointment/components/SearchByClinic.dart b/lib/pages/BookAppointment/components/SearchByClinic.dart index b8f1a378..891d01cb 100644 --- a/lib/pages/BookAppointment/components/SearchByClinic.dart +++ b/lib/pages/BookAppointment/components/SearchByClinic.dart @@ -531,7 +531,15 @@ class _SearchByClinicState extends State { searchInfo.clinic = selectedClinic; searchInfo.date = DateTime.now(); - navigateToDentalComplaints(context, searchInfo); + if(projectViewModel.isLogin) { + if(projectViewModel.user.age > 12) { + navigateToDentalComplaints(context, searchInfo); + } else { + callDoctorsSearchAPI(17); + } + } else { + navigateToDentalComplaints(context, searchInfo); + } } else if (dropdownValue.split("-")[0] == "253") { navigateToLaserClinic(context); // callDoctorsSearchAPI(); @@ -552,15 +560,15 @@ class _SearchByClinicState extends State { Navigator.push(context, FadePage(page: LiveCareHome())); } if (value == "schedule") { - callDoctorsSearchAPI(); + callDoctorsSearchAPI(int.parse(dropdownValue.split("-")[0])); } }); } else { - callDoctorsSearchAPI(); + callDoctorsSearchAPI(int.parse(dropdownValue.split("-")[0])); } } - callDoctorsSearchAPI() { + callDoctorsSearchAPI(int clinicID) { GifLoaderDialogUtils.showMyDialog(context); List doctorsList = []; List arr = []; @@ -570,7 +578,7 @@ class _SearchByClinicState extends State { List _patientDoctorAppointmentListHospital = List(); DoctorsListService service = new DoctorsListService(); - service.getDoctorsList(int.parse(dropdownValue.split("-")[0]), projectDropdownValue != "" ? int.parse(projectDropdownValue) : 0, nearestAppo, context).then((res) { + service.getDoctorsList(clinicID, projectDropdownValue != "" ? int.parse(projectDropdownValue) : 0, nearestAppo, context).then((res) { GifLoaderDialogUtils.hideDialog(context); if (res['MessageStatus'] == 1) { setState(() { diff --git a/lib/pages/livecare/livecare_home.dart b/lib/pages/livecare/livecare_home.dart index a3942f22..f7656d37 100644 --- a/lib/pages/livecare/livecare_home.dart +++ b/lib/pages/livecare/livecare_home.dart @@ -18,8 +18,9 @@ class LiveCareHome extends StatefulWidget { static bool showFooterButton = true; static bool isLiveCareTypeSelected = false; final bool isPharmacyLiveCare; + final String pharmacyLiveCareQRCode; - const LiveCareHome({Key key, this.isPharmacyLiveCare = false}) : super(key: key); + const LiveCareHome({Key key, this.isPharmacyLiveCare = false, this.pharmacyLiveCareQRCode = ""}) : super(key: key); @override _LiveCareHomeState createState() => _LiveCareHomeState(); @@ -125,6 +126,7 @@ class _LiveCareHomeState extends State with SingleTickerProviderSt ? ClinicList( getLiveCareHistory: getLiveCareHistory, isPharmacyLiveCare: widget.isPharmacyLiveCare, + pharmacyLiveCareQRCode: widget.pharmacyLiveCareQRCode, ) : isDataLoaded ? LiveCarePendingRequest(getLiveCareHistory: getLiveCareHistory, pendingERRequestHistoryList: pendingERRequestHistoryList) diff --git a/lib/pages/livecare/livecare_type_select.dart b/lib/pages/livecare/livecare_type_select.dart index 4c8fadce..11c60ddc 100644 --- a/lib/pages/livecare/livecare_type_select.dart +++ b/lib/pages/livecare/livecare_type_select.dart @@ -1,9 +1,14 @@ +import 'package:barcode_scan2/barcode_scan2.dart'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; +import 'package:diplomaticquarterapp/pages/livecare/livecare_home.dart'; +import 'package:diplomaticquarterapp/services/livecare_services/livecare_provider.dart'; import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; +import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/material.dart'; import 'package:flutter_svg/flutter_svg.dart'; import 'package:provider/provider.dart'; @@ -18,6 +23,7 @@ class _LiveCareTypeSelectState extends State { AppSharedPreferences sharedPref = AppSharedPreferences(); ProjectViewModel projectViewModel; + String pharmacyLiveCareQRCode = ""; @override void initState() { @@ -89,7 +95,6 @@ class _LiveCareTypeSelectState extends State { Container( margin: EdgeInsets.only(top: 20.0), child: Text(TranslationBase.of(context).livecareSummary, style: TextStyle(fontSize: 14.0, letterSpacing: -0.64, color: CustomColors.textColor, fontWeight: FontWeight.w600))), - GridView( gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 2, crossAxisSpacing: 13, mainAxisSpacing: 9), physics: NeverScrollableScrollPhysics(), @@ -98,6 +103,7 @@ class _LiveCareTypeSelectState extends State { children: [ _loginOptionButton(TranslationBase.of(context).livecareOption1, 'assets/images/new/Live_Care.svg', 1), _loginOptionButton(TranslationBase.of(context).livecareOption4, 'assets/images/new/book appointment.svg', 2), + _loginOptionButton("Pharmacy LiveCare", 'assets/images/new/Live_Care.svg', 3), ], ), SizedBox( @@ -116,9 +122,12 @@ class _LiveCareTypeSelectState extends State { if (_loginIndex == 1) { Navigator.pop(context, "immediate"); projectViewModel.analytics.liveCare.livecare_immediate_consultation(); - } else { + } else if (_loginIndex == 2) { Navigator.pop(context, "schedule"); projectViewModel.analytics.liveCare.livecare_schedule_video_call(); + } else { + //Pharmacy LiveCare + readQRCode(); } }, child: Container( @@ -150,6 +159,25 @@ class _LiveCareTypeSelectState extends State { ); } + readQRCode() async { + pharmacyLiveCareQRCode = (await BarcodeScanner.scan())?.rawContent; + GifLoaderDialogUtils.showMyDialog(context); + LiveCareService service = new LiveCareService(); + service.getPatientInfoByQR(pharmacyLiveCareQRCode, context).then((res) { + GifLoaderDialogUtils.hideDialog(context); + }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); + print(err); + startPharmacyLiveCareProcess(); + }); + } + + startPharmacyLiveCareProcess() { + sharedPref.setString(LIVECARE_CLINIC_DATA, "Pharmacy LiveCare" + "-" + "501" + "-" + "7"); + Navigator.pop(context, "pharmacy/$pharmacyLiveCareQRCode"); + // Navigator.push(context, FadePage(page: LiveCareHome(isPharmacyLiveCare: true, pharmacyLiveCareQRCode: pharmacyLiveCareQRCode,))); + } + getLanguageID() async { var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); setState(() { diff --git a/lib/pages/livecare/widgets/LiveCarePendingRequest.dart b/lib/pages/livecare/widgets/LiveCarePendingRequest.dart index c8519cfd..dbe6e697 100644 --- a/lib/pages/livecare/widgets/LiveCarePendingRequest.dart +++ b/lib/pages/livecare/widgets/LiveCarePendingRequest.dart @@ -112,12 +112,12 @@ class _LiveCarePendingRequestState extends State { // cancelLiveCareRequest(); }), ), - // DefaultButton( - // TranslationBase.of(context).cancel, - // () { - // cancelLiveCareRequest(); - // }, - // ), + DefaultButton( + TranslationBase.of(context).cancel, + () { + cancelLiveCareRequest(); + }, + ), ], ), ), diff --git a/lib/pages/livecare/widgets/clinic_list.dart b/lib/pages/livecare/widgets/clinic_list.dart index 564a3485..c008a7a4 100644 --- a/lib/pages/livecare/widgets/clinic_list.dart +++ b/lib/pages/livecare/widgets/clinic_list.dart @@ -39,9 +39,10 @@ import '../live_care_payment_page.dart'; class ClinicList extends StatefulWidget { final Function getLiveCareHistory; - final bool isPharmacyLiveCare; + bool isPharmacyLiveCare; + String pharmacyLiveCareQRCode; - ClinicList({@required this.getLiveCareHistory, this.isPharmacyLiveCare = false}); + ClinicList({@required this.getLiveCareHistory, this.isPharmacyLiveCare = false, this.pharmacyLiveCareQRCode = ""}); @override _clinic_listState createState() => _clinic_listState(); @@ -300,6 +301,7 @@ class _clinic_listState extends State { setState(() {}); }, patientShare: num.parse(getERAppointmentFeesList.total), + isFromAdvancePayment: widget.isPharmacyLiveCare, ))).then((value) { print(value); if (value != null) { @@ -316,8 +318,27 @@ class _clinic_listState extends State { selectedInstallmentPlan = paymentMethod[1]; this.amount = amount.toString(); - browser.openPaymentBrowser(amount, "LiveCare Payment", Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), "12", authenticatedUser.emailAddress, paymentMethod[0], - authenticatedUser.patientType, authenticatedUser.firstName, authenticatedUser.patientID, authenticatedUser, browser, false, "4", selectedClinicID, context, "", "", "", "", paymentMethod[1]); + browser.openPaymentBrowser( + amount, + "LiveCare Payment", + widget.isPharmacyLiveCare ? widget.pharmacyLiveCareQRCode : Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), + "12", + authenticatedUser.emailAddress, + paymentMethod[0], + authenticatedUser.patientType, + authenticatedUser.firstName, + authenticatedUser.patientID, + authenticatedUser, + browser, + false, + "4", + selectedClinicID, + context, + "", + "", + "", + "", + paymentMethod[1]); } onBrowserLoadStart(String url) { @@ -425,13 +446,13 @@ class _clinic_listState extends State { final currency = projectViewModel.user.outSA == 0 ? "sar" : 'aed'; DoctorsListService service = new DoctorsListService(); GifLoaderDialogUtils.showMyDialog(context); - service.checkPaymentStatus(Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), context).then((res) { + service.checkPaymentStatus(widget.isPharmacyLiveCare ? widget.pharmacyLiveCareQRCode : Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), context).then((res) { GifLoaderDialogUtils.hideDialog(context); String paymentInfo = res['Response_Message']; amount = res['Amount'].toString(); payment_method = res['PaymentMethod']; if (paymentInfo == 'Success') { - addNewCallForPatientER(Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo)); + addNewCallForPatientER(widget.isPharmacyLiveCare ? widget.pharmacyLiveCareQRCode : Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo)); } else { AppToast.showErrorToast(message: res['Response_Message']); projectViewModel.analytics.liveCare.livecare_immediate_consultation_payment_failed( @@ -527,6 +548,7 @@ class _clinic_listState extends State { openLiveCareSelectionDialog() async { liveCareClinicIDs = await sharedPref.getString(LIVECARE_CLINIC_DATA); + sharedPref.remove(LIVECARE_CLINIC_DATA); if (liveCareClinicIDs != null) { selectedClinicID = int.parse(liveCareClinicIDs.split("-")[2]); setState(() { @@ -535,8 +557,8 @@ class _clinic_listState extends State { // if(widget.isPharmacyLiveCare) { // // } else { - getLiveCareClinicsList(); - startLiveCare(); + getLiveCareClinicsList(); + startLiveCare(); // } } else { Navigator.of(context) @@ -545,9 +567,17 @@ class _clinic_listState extends State { return LiveCareTypeSelect(); }, fullscreenDialog: true)) - .then((value) { + .then((value) async { if (value == null) { Navigator.pop(context); + } else if (value.contains("-")) { + widget.isPharmacyLiveCare = true; + widget.pharmacyLiveCareQRCode = value.split("/")[1]; + liveCareClinicIDs = await sharedPref.getString(LIVECARE_CLINIC_DATA); + selectedClinicID = int.parse(liveCareClinicIDs.split("-")[2]); + selectedClinicName = liveCareClinicIDs.split("-")[0]; + sharedPref.remove(LIVECARE_CLINIC_DATA); + startLiveCare(); } else { print(value); if (value == "immediate") { diff --git a/lib/services/appointment_services/GetDoctorsList.dart b/lib/services/appointment_services/GetDoctorsList.dart index 6cf2251b..5ba66ea9 100644 --- a/lib/services/appointment_services/GetDoctorsList.dart +++ b/lib/services/appointment_services/GetDoctorsList.dart @@ -65,12 +65,13 @@ class DoctorsListService extends BaseService { "PatientID": authUser.patientID != null ? authUser.patientID : 0, "gender": authUser.gender != null ? authUser.gender : 0, "age": authUser.age != null ? authUser.age : 0, + "DateofBirth": authUser.dateofBirth != null ? authUser.dateofBirth : null, "IsGetNearAppointment": false, "SearchForVoiceCommand": doctorId != null && doctorId.length > 0 ? true : false, "DoctorIDsList": doctorId, "Latitude": lat != null ? lat.toString() : 0, "Longitude": long != null ? long.toString() : 0, - "isDentalAllowedBackend": isContinueDentalPlan, + "isDentalAllowedBackend": clinicID == 17 ? true : isContinueDentalPlan, "IsGetNearAppointment": isNearest, if (isNearest) "SelectedDate": DateUtil.convertDateToString(DateTime.now()), "License": true diff --git a/lib/services/clinic_services/get_clinic_service.dart b/lib/services/clinic_services/get_clinic_service.dart index e6efb110..5079fc9b 100644 --- a/lib/services/clinic_services/get_clinic_service.dart +++ b/lib/services/clinic_services/get_clinic_service.dart @@ -123,7 +123,8 @@ class ClinicListService extends BaseService { "DeviceTypeID": 1, "PatientID": 1, "ContinueDentalPlan": true, - "IsSearchAppointmnetByClinicID": false + "IsSearchAppointmnetByClinicID": false, + "DateofBirth": authUser.dateofBirth }; dynamic localRes; diff --git a/lib/widgets/drawer/app_drawer_widget.dart b/lib/widgets/drawer/app_drawer_widget.dart index 180bfe63..6069520d 100644 --- a/lib/widgets/drawer/app_drawer_widget.dart +++ b/lib/widgets/drawer/app_drawer_widget.dart @@ -75,6 +75,7 @@ class _AppDrawerState extends State { String booldType; String notificationCount; final authService = new AuthProvider(); + String pharmacyLiveCareQRCode = ""; @override Widget build(BuildContext context) { @@ -334,19 +335,19 @@ class _AppDrawerState extends State { } }, ), - InkWell( - child: DrawerItem(TranslationBase.of(context).pharmacyLiveCare, SvgPicture.asset("assets/images/new/Live_Care.svg"), - isImageIcon: true, - bottomLine: false, - textColor: Theme.of(context).textTheme.bodyText1.color, - iconColor: Theme.of(context).textTheme.bodyText1.color, - sideArrow: true, - letterSpacing: -0.84, - projectProvider: projectProvider), - onTap: () { - readQRCode(); - }, - ), + // InkWell( + // child: DrawerItem(TranslationBase.of(context).pharmacyLiveCare, SvgPicture.asset("assets/images/new/Live_Care.svg"), + // isImageIcon: true, + // bottomLine: false, + // textColor: Theme.of(context).textTheme.bodyText1.color, + // iconColor: Theme.of(context).textTheme.bodyText1.color, + // sideArrow: true, + // letterSpacing: -0.84, + // projectProvider: projectProvider), + // onTap: () { + // readQRCode(); + // }, + // ), InkWell( child: Stack( children: [ @@ -495,11 +496,11 @@ class _AppDrawerState extends State { } readQRCode() async { - String result = (await BarcodeScanner.scan())?.rawContent; - print(result); + pharmacyLiveCareQRCode = (await BarcodeScanner.scan())?.rawContent; + print(pharmacyLiveCareQRCode); GifLoaderDialogUtils.showMyDialog(context); LiveCareService service = new LiveCareService(); - service.getPatientInfoByQR(result, context).then((res) { + service.getPatientInfoByQR(pharmacyLiveCareQRCode, context).then((res) { GifLoaderDialogUtils.hideDialog(context); }).catchError((err) { GifLoaderDialogUtils.hideDialog(context); @@ -511,7 +512,7 @@ class _AppDrawerState extends State { startPharmacyLiveCareProcess() { sharedPref.setString(LIVECARE_CLINIC_DATA, "Pharmacy LiveCare" + "-" + "501" + "-" + "7"); - Navigator.push(context, FadePage(page: LiveCareHome(isPharmacyLiveCare: true,))); + Navigator.push(context, FadePage(page: LiveCareHome(isPharmacyLiveCare: true, pharmacyLiveCareQRCode: pharmacyLiveCareQRCode,))); } drawerNavigator(context, routeName) { diff --git a/lib/widgets/in_app_browser/InAppBrowser.dart b/lib/widgets/in_app_browser/InAppBrowser.dart index 3bdf50ce..4fbc41cc 100644 --- a/lib/widgets/in_app_browser/InAppBrowser.dart +++ b/lib/widgets/in_app_browser/InAppBrowser.dart @@ -37,9 +37,9 @@ class MyInAppBrowser extends InAppBrowser { // static String APPLE_PAY_PAYFORT_URL = 'https://hmgwebservices.com/PayFortWebLive/PayFortApi/MakeApplePayRequest'; // Payfort Payment Gateway URL LIVE static String APPLE_PAY_PAYFORT_URL = 'https://hmgwebservices.com/PayFortWebLive/PayFortApi/MakeApplePayRequest'; // Payfort Payment Gateway URL UAT - // static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort Payment Gateway URL UAT + static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort Payment Gateway URL UAT - static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL LIVE + // static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL LIVE // static String PRESCRIPTION_PAYMENT_WITH_ORDERID = // 'https://uat.hmgwebservices.com/epharmacy/checkout/OpcCompleteRedirectionPaymentClientbyOrder?orderID='; @@ -143,7 +143,7 @@ class MyInAppBrowser extends InAppBrowser { } openPaymentBrowser(num amount, String orderDesc, String transactionID, String projId, String emailId, String paymentMethod, dynamic patientType, String patientName, dynamic patientID, - AuthenticatedUser authenticatedUser, InAppBrowser browser, bool isLiveCareAppo, var servID, var LiveServID, + AuthenticatedUser authenticatedUser, InAppBrowser browser, bool isLiveCareAppo, var servID, var LiveServID, BuildContext context, [var appoDate, var appoNo, var clinicID, var doctorID, var installments]) async { this.browser = browser; await getPatientData(); @@ -187,7 +187,8 @@ class MyInAppBrowser extends InAppBrowser { service.applePayInsertRequest(applePayInsertRequest, context).then((res) { if (context != null) GifLoaderDialogUtils.hideDialog(context); - String url = "https://hmgwebservices.com/HMGApplePayLive/applepay/pay?apq=" + res['result']; + String url = "https://hmgwebservices.com/HMGApplePayLive/applepay/pay?apq=" + res['result']; // Prod + // String url = "https://uat.hmgwebservices.com/HMGApplePayLiveNew/applepay/pay?apq=" + res['result']; // UAT // safariBrowser.open(url: Uri.parse(url)); this.browser.openUrlRequest(urlRequest: URLRequest(url: Uri.parse(url)), options: _InAppBrowserOptions); }).catchError((err) { From f686013692670dffc532ef7e193e4402aa47a0a4 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Sun, 19 Feb 2023 09:52:15 +0300 Subject: [PATCH 06/29] Pharma LiveCare updates --- lib/config/config.dart | 859 +++++++----------- lib/pages/livecare/livecare_type_select.dart | 2 +- .../widgets/LiveCarePendingRequest.dart | 12 +- lib/pages/livecare/widgets/clinic_list.dart | 2 + 4 files changed, 354 insertions(+), 521 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index ca5380d9..30ce29b2 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -3,756 +3,587 @@ import 'dart:io'; import 'package:diplomaticquarterapp/models/Request.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; -var MAX_SMALL_SCREEN = 660; +var MAX_SMALL_SCREEN = 660; final OPENTOK_API_KEY = '46209962'; // final OPENTOK_API_KEY = '47464241'; // PACKAGES and OFFERS -var EXA_CART_API_BASE_URL = 'https://mdlaboratories.com/offersdiscounts'; +var EXA_CART_API_BASE_URL = 'https://mdlaboratories.com/offersdiscounts'; // var EXA_CART_API_BASE_URL = 'http://10.200.101.75:9000'; -var PACKAGES_CATEGORIES = '/api/categories'; -var PACKAGES_STORES = '/api/stores'; -var PACKAGES_TOKEN = '/api/token'; -var PACKAGES_PRODUCTS = '/api/products'; -var PACKAGES_CUSTOMER = '/api/customers'; -var PACKAGES_SHOPPING_CART = '/api/shopping_cart_items'; -var PACKAGES_ORDERS = '/api/orders'; -var PACKAGES_ORDER_HISTORY = '/api/orders/items'; -var PACKAGES_TAMARA_OPT = '/api/orders/paymentoptions/tamara'; +var PACKAGES_CATEGORIES = '/api/categories'; +var PACKAGES_STORES = '/api/stores'; +var PACKAGES_TOKEN = '/api/token'; +var PACKAGES_PRODUCTS = '/api/products'; +var PACKAGES_CUSTOMER = '/api/customers'; +var PACKAGES_SHOPPING_CART = '/api/shopping_cart_items'; +var PACKAGES_ORDERS = '/api/orders'; +var PACKAGES_ORDER_HISTORY = '/api/orders/items'; +var PACKAGES_TAMARA_OPT = '/api/orders/paymentoptions/tamara'; // var BASE_URL = 'http://10.50.100.198:3334/'; -// var BASE_URL = 'https://uat.hmgwebservices.com/'; -var BASE_URL = 'https://hmgwebservices.com/'; + var BASE_URL = 'https://uat.hmgwebservices.com/'; +// var BASE_URL = 'https://hmgwebservices.com/'; // Pharmacy UAT URLs // var BASE_PHARMACY_URL = 'https://uat.hmgwebservices.com/epharmacy/api/'; // var PHARMACY_BASE_URL = 'https://uat.hmgwebservices.com/epharmacy/api/'; // // Pharmacy Production URLs -var BASE_PHARMACY_URL = 'https://mdlaboratories.com/exacartapi/api/'; -var PHARMACY_BASE_URL = 'https://mdlaboratories.com/exacartapi/api/'; +var BASE_PHARMACY_URL = 'https://mdlaboratories.com/exacartapi/api/'; +var PHARMACY_BASE_URL = 'https://mdlaboratories.com/exacartapi/api/'; // // Pharmacy Pre-Production URLs // var BASE_PHARMACY_URL = 'https://mdlaboratories.com/exacartapitest/api/'; // var PHARMACY_BASE_URL = 'https://mdlaboratories.com/exacartapitest/api/'; // RC API URL -var RC_BASE_URL = 'https://rc.hmg.com/'; +var RC_BASE_URL = 'https://rc.hmg.com/'; -var PING_SERVICE = 'Services/Weather.svc/REST/CheckConnectivity'; +var PING_SERVICE = 'Services/Weather.svc/REST/CheckConnectivity'; -var GET_PROJECT = 'Services/Lists.svc/REST/GetProject'; +var GET_PROJECT = 'Services/Lists.svc/REST/GetProject'; ///Geofencing -var GET_GEO_ZONES = 'Services/Patients.svc/REST/GeoF_GetAllPoints'; -var LOG_GEO_ZONES = 'Services/Patients.svc/REST/GeoF_InsertPatientFileInfo'; +var GET_GEO_ZONES = 'Services/Patients.svc/REST/GeoF_GetAllPoints'; +var LOG_GEO_ZONES = 'Services/Patients.svc/REST/GeoF_InsertPatientFileInfo'; // Delivery Driver -var DRIVER_LOCATION = - 'Services/Patients.svc/REST/PatientER_GetDriverLocation'; +var DRIVER_LOCATION = 'Services/Patients.svc/REST/PatientER_GetDriverLocation'; //weather -var WEATHER_INDICATOR = 'Services/Weather.svc/REST/GetCityInfo'; +var WEATHER_INDICATOR = 'Services/Weather.svc/REST/GetCityInfo'; -var GET_PRIVILEGE = 'Services/Patients.svc/REST/Service_Privilege'; +var GET_PRIVILEGE = 'Services/Patients.svc/REST/Service_Privilege'; // Wifi Credentials -var WIFI_CREDENTIALS = - "Services/Patients.svc/Hmg_SMS_Get_By_ProjectID_And_PatientID"; +var WIFI_CREDENTIALS = "Services/Patients.svc/Hmg_SMS_Get_By_ProjectID_And_PatientID"; ///Doctor -var GET_MY_DOCTOR = - 'Services/Doctors.svc/REST/GetPatientDoctorAppointmentResult'; -var GET_DOCTOR_PROFILE = 'Services/Doctors.svc/REST/GetDocProfiles'; -var GET_DOCTOR_PRE_POST_IMAGES = - 'Services/Doctors.svc/REST/GetDoctorPrePostImages'; -var GET_DOCTOR_RATING_NOTES = - 'Services/Doctors.svc/REST/dr_GetNotesDoctorRating'; -var GET_DOCTOR_RATING_DETAILS = - 'Services/Doctors.svc/REST/dr_GetDoctorRatingDetails'; - -var GET_DOCTOR_RATING = 'Services/Doctors.svc/REST/dr_GetAvgDoctorRating'; +var GET_MY_DOCTOR = 'Services/Doctors.svc/REST/GetPatientDoctorAppointmentResult'; +var GET_DOCTOR_PROFILE = 'Services/Doctors.svc/REST/GetDocProfiles'; +var GET_DOCTOR_PRE_POST_IMAGES = 'Services/Doctors.svc/REST/GetDoctorPrePostImages'; +var GET_DOCTOR_RATING_NOTES = 'Services/Doctors.svc/REST/dr_GetNotesDoctorRating'; +var GET_DOCTOR_RATING_DETAILS = 'Services/Doctors.svc/REST/dr_GetDoctorRatingDetails'; + +var GET_DOCTOR_RATING = 'Services/Doctors.svc/REST/dr_GetAvgDoctorRating'; ///Prescriptions // var PRESCRIPTIONS = 'Services/Patients.svc/REST/GetPrescriptionApptList'; -var PRESCRIPTIONS = 'Services/Patients.svc/REST/GetPrescriptionApptList_Async'; +var PRESCRIPTIONS = 'Services/Patients.svc/REST/GetPrescriptionApptList_Async'; -var GET_PRESCRIPTIONS_ALL_ORDERS = - 'Services/Patients.svc/REST/PatientER_GetPatientAllPresOrders'; -var GET_PRESCRIPTION_REPORT = - 'Services/Patients.svc/REST/INP_GetPrescriptionReport'; -var SEND_PRESCRIPTION_EMAIL = - 'Services/Notifications.svc/REST/SendPrescriptionEmail'; -var GET_PRESCRIPTION_REPORT_ENH = - 'Services/Patients.svc/REST/GetPrescriptionReport_enh'; +var GET_PRESCRIPTIONS_ALL_ORDERS = 'Services/Patients.svc/REST/PatientER_GetPatientAllPresOrders'; +var GET_PRESCRIPTION_REPORT = 'Services/Patients.svc/REST/INP_GetPrescriptionReport'; +var SEND_PRESCRIPTION_EMAIL = 'Services/Notifications.svc/REST/SendPrescriptionEmail'; +var GET_PRESCRIPTION_REPORT_ENH = 'Services/Patients.svc/REST/GetPrescriptionReport_enh'; ///Lab Order -var GET_Patient_LAB_ORDERS = 'Services/Patients.svc/REST/GetPatientLabOrders'; -var GET_Patient_LAB_SPECIAL_RESULT = - 'Services/Patients.svc/REST/GetPatientLabSpecialResults'; -var SEND_LAB_RESULT_EMAIL = - 'Services/Notifications.svc/REST/SendLabReportEmail'; -var GET_Patient_LAB_RESULT = - 'Services/Patients.svc/REST/GetPatientLabResults'; -var GET_Patient_LAB_ORDERS_RESULT = - 'Services/Patients.svc/REST/GetPatientLabOrdersResults'; -var SEND_COVID_LAB_RESULT_EMAIL = - 'Services/Notifications.svc/REST/GenerateCOVIDReport'; -var COVID_PASSPORT_UPDATE = - 'Services/Patients.svc/REST/Covid19_Certificate_PassportUpdate'; -var GET_PATIENT_PASSPORT_NUMBER = - 'Services/Patients.svc/REST/Covid19_Certificate_GetPassport'; - -var UPDATE_WORKPLACE_NAME = - 'Services/Patients.svc/REST/ActivateSickLeave_FromVida'; +var GET_Patient_LAB_ORDERS = 'Services/Patients.svc/REST/GetPatientLabOrders'; +var GET_Patient_LAB_SPECIAL_RESULT = 'Services/Patients.svc/REST/GetPatientLabSpecialResults'; +var SEND_LAB_RESULT_EMAIL = 'Services/Notifications.svc/REST/SendLabReportEmail'; +var GET_Patient_LAB_RESULT = 'Services/Patients.svc/REST/GetPatientLabResults'; +var GET_Patient_LAB_ORDERS_RESULT = 'Services/Patients.svc/REST/GetPatientLabOrdersResults'; +var SEND_COVID_LAB_RESULT_EMAIL = 'Services/Notifications.svc/REST/GenerateCOVIDReport'; +var COVID_PASSPORT_UPDATE = 'Services/Patients.svc/REST/Covid19_Certificate_PassportUpdate'; +var GET_PATIENT_PASSPORT_NUMBER = 'Services/Patients.svc/REST/Covid19_Certificate_GetPassport'; + +var UPDATE_WORKPLACE_NAME = 'Services/Patients.svc/REST/ActivateSickLeave_FromVida'; /// -var GET_PATIENT_ORDERS = 'Services/Patients.svc/REST/GetPatientRadOrders'; -var GET_PATIENT_LAB_ORDERS_BY_APPOINTMENT = - 'Services/Patients.svc/REST/GetPatientLabResultsByAppointmentNo'; +var GET_PATIENT_ORDERS = 'Services/Patients.svc/REST/GetPatientRadOrders'; +var GET_PATIENT_LAB_ORDERS_BY_APPOINTMENT = 'Services/Patients.svc/REST/GetPatientLabResultsByAppointmentNo'; -var GET_PATIENT_ORDERS_DETAILS = - 'Services/Patients.svc/REST/Rad_UpdatePatientRadOrdersToRead'; -var GET_RAD_IMAGE_URL = 'Services/Patients.svc/Rest/GetRadImageURL'; -var SEND_RAD_REPORT_EMAIL = - 'Services/Notifications.svc/REST/SendRadReportEmail'; +var GET_PATIENT_ORDERS_DETAILS = 'Services/Patients.svc/REST/Rad_UpdatePatientRadOrdersToRead'; +var GET_RAD_IMAGE_URL = 'Services/Patients.svc/Rest/GetRadImageURL'; +var SEND_RAD_REPORT_EMAIL = 'Services/Notifications.svc/REST/SendRadReportEmail'; ///Feedback -var SEND_FEEDBACK = 'Services/COCWS.svc/REST/InsertCOCItemInSPList'; -var GET_STATUS_FOR_COCO = 'Services/COCWS.svc/REST/GetStatusforCOC'; +var SEND_FEEDBACK = 'Services/COCWS.svc/REST/InsertCOCItemInSPList'; +var GET_STATUS_FOR_COCO = 'Services/COCWS.svc/REST/GetStatusforCOC'; // var GET_PATIENT_AppointmentHistory = 'Services' // '/Doctors.svc/REST/PateintHasAppoimentHistory'; -var GET_PATIENT_AppointmentHistory = 'Services' +var GET_PATIENT_AppointmentHistory = 'Services' '/Doctors.svc/REST/PateintHasAppoimentHistory_Async'; ///VITAL SIGN -var GET_PATIENT_VITAL_SIGN = - 'Services/Doctors.svc/REST/Doctor_GetPatientVitalSign'; +var GET_PATIENT_VITAL_SIGN = 'Services/Doctors.svc/REST/Doctor_GetPatientVitalSign'; ///Er Nearest -var GET_NEAREST_HOSPITAL = - 'Services/Patients.svc/REST/Patient_GetProjectAvgERWaitingTime'; +var GET_NEAREST_HOSPITAL = 'Services/Patients.svc/REST/Patient_GetProjectAvgERWaitingTime'; ///ED Online -var ER_GET_VISUAL_TRIAGE_QUESTIONS = - "services/Doctors.svc/REST/ER_GetVisualTriageQuestions"; -var ER_SAVE_TRIAGE_INFORMATION = - "services/Doctors.svc/REST/ER_SaveTriageInformation"; -var ER_GetPatientPaymentInformationForERClinic = - "services/Doctors.svc/REST/ER_GetPatientPaymentInformationForERClinic"; +var ER_GET_VISUAL_TRIAGE_QUESTIONS = "services/Doctors.svc/REST/ER_GetVisualTriageQuestions"; +var ER_SAVE_TRIAGE_INFORMATION = "services/Doctors.svc/REST/ER_SaveTriageInformation"; +var ER_GetPatientPaymentInformationForERClinic = "services/Doctors.svc/REST/ER_GetPatientPaymentInformationForERClinic"; ///Er Nearest -var GET_AMBULANCE_REQUEST = - 'Services/Patients.svc/REST/PatientER_RRT_GetAllTransportationMethod'; -var GET_PATIENT_ALL_PRES_ORDERS = - 'Services/Patients.svc/REST/PatientER_GetPatientAllPresOrders'; -var GET_PICK_UP_REQUEST_BY_PRES_ORDER_ID = - 'Services/Patients.svc/REST/PatientER_RRT_GetPickUpRequestByPresOrderID'; -var UPDATE_PRESS_ORDER = - 'Services/Patients.svc/REST/PatientER_UpdatePresOrder'; -var INSERT_ER_INERT_PRES_ORDER = - 'Services/Patients.svc/REST/PatientER_InsertPresOrder'; +var GET_AMBULANCE_REQUEST = 'Services/Patients.svc/REST/PatientER_RRT_GetAllTransportationMethod'; +var GET_PATIENT_ALL_PRES_ORDERS = 'Services/Patients.svc/REST/PatientER_GetPatientAllPresOrders'; +var GET_PICK_UP_REQUEST_BY_PRES_ORDER_ID = 'Services/Patients.svc/REST/PatientER_RRT_GetPickUpRequestByPresOrderID'; +var UPDATE_PRESS_ORDER = 'Services/Patients.svc/REST/PatientER_UpdatePresOrder'; +var INSERT_ER_INERT_PRES_ORDER = 'Services/Patients.svc/REST/PatientER_InsertPresOrder'; /// ER RRT -var GET_ALL_RC_TRANSPORTATION = 'api/Transportation/getalltransportation'; -var GET_ALL_TRANSPORTATIONS_RC = 'api/Transportation/getalltransportation'; -var GET_ALL_RRT_QUESTIONS = - 'Services/Patients.svc/REST/PatientER_RRT_GetAllQuestions'; -var GET_RRT_SERVICE_PRICE = - 'Services/Patients.svc/REST/PatientE_RealRRT_GetServicePrice'; +var GET_ALL_RC_TRANSPORTATION = 'api/Transportation/getalltransportation'; +var GET_ALL_TRANSPORTATIONS_RC = 'api/Transportation/getalltransportation'; +var GET_ALL_RRT_QUESTIONS = 'Services/Patients.svc/REST/PatientER_RRT_GetAllQuestions'; +var GET_RRT_SERVICE_PRICE = 'Services/Patients.svc/REST/PatientE_RealRRT_GetServicePrice'; -var GET_ALL_TRANSPORTATIONS_ORDERS = 'api/Transportation/get'; +var GET_ALL_TRANSPORTATIONS_ORDERS = 'api/Transportation/get'; -var CANCEL_AMBULANCE_REQUEST = "api/Transportation/update"; +var CANCEL_AMBULANCE_REQUEST = "api/Transportation/update"; -var INSERT_TRANSPORTATION_ORDER_RC = "api/Transportation/add"; +var INSERT_TRANSPORTATION_ORDER_RC = "api/Transportation/add"; ///FindUs -var GET_FINDUS_REQUEST = 'Services/Lists.svc/REST/Get_HMG_Locations'; +var GET_FINDUS_REQUEST = 'Services/Lists.svc/REST/Get_HMG_Locations'; ///LiveChat -var GET_LIVECHAT_REQUEST = 'Services/Patients.svc/REST/GetPatientICProjects'; +var GET_LIVECHAT_REQUEST = 'Services/Patients.svc/REST/GetPatientICProjects'; ///babyInformation -var GET_BABYINFORMATION_REQUEST = - 'Services/Community.svc/REST/GetBabyByUserID'; +var GET_BABYINFORMATION_REQUEST = 'Services/Community.svc/REST/GetBabyByUserID'; ///Get Baby By User ID -var GET_BABY_BY_USER_ID = 'Services/Community.svc/REST/GetBabyByUserID'; +var GET_BABY_BY_USER_ID = 'Services/Community.svc/REST/GetBabyByUserID'; ///userInformation -var GET_USERINFORMATION_REQUEST = - 'Services/Community.svc/REST/GetUserInformation_New'; +var GET_USERINFORMATION_REQUEST = 'Services/Community.svc/REST/GetUserInformation_New'; ///Update email -var UPDATE_PATENT_EMAIL = 'Services/Patients.svc/REST/UpdatePateintEmail'; -var UPDATE_PATENT_INFO = 'Services/Community.svc/REST/UpdateUserInfo_New'; +var UPDATE_PATENT_EMAIL = 'Services/Patients.svc/REST/UpdatePateintEmail'; +var UPDATE_PATENT_INFO = 'Services/Community.svc/REST/UpdateUserInfo_New'; ///addNewChild -var GET_NEWCHILD_REQUEST = 'Services/Community.svc/REST/CreateNewBaby'; +var GET_NEWCHILD_REQUEST = 'Services/Community.svc/REST/CreateNewBaby'; ///newUserId -var GET_NEW_USER_REQUEST = 'Services/Community.svc/REST/CreateNewUser_New'; +var GET_NEW_USER_REQUEST = 'Services/Community.svc/REST/CreateNewUser_New'; ///delete Child -var DELETE_CHILD_REQUEST = 'Services/Community.svc/REST/DeleteBaby'; +var DELETE_CHILD_REQUEST = 'Services/Community.svc/REST/DeleteBaby'; ///addNewTABLE -var GET_TABLE_REQUEST = 'Services/Community.svc/REST/CreateVaccinationTable'; +var GET_TABLE_REQUEST = 'Services/Community.svc/REST/CreateVaccinationTable'; ///BloodDenote -var GET_CITIES_REQUEST = 'Services/Lists.svc/REST/GetAllCities'; +var GET_CITIES_REQUEST = 'Services/Lists.svc/REST/GetAllCities'; ///BloodDetails -var GET_BLOOD_REQUEST = - 'services/PatientVarification.svc/REST/BloodDonation_GetBloodGroupDetails'; +var GET_BLOOD_REQUEST = 'services/PatientVarification.svc/REST/BloodDonation_GetBloodGroupDetails'; -var SAVE_BLOOD_REQUEST = - 'Services/PatientVarification.svc/REST/BloodDonation_RegisterBloodType'; +var SAVE_BLOOD_REQUEST = 'Services/PatientVarification.svc/REST/BloodDonation_RegisterBloodType'; -var GET_BLOOD_AGREEMENT = - 'Services/PatientVarification.svc/REST/CheckUserAgreementForBloodDonation'; -var SAVE_BLOOD_AGREEMENT = - 'Services/PatientVarification.svc/REST/AddUserAgreementForBloodDonation'; +var GET_BLOOD_AGREEMENT = 'Services/PatientVarification.svc/REST/CheckUserAgreementForBloodDonation'; +var SAVE_BLOOD_AGREEMENT = 'Services/PatientVarification.svc/REST/AddUserAgreementForBloodDonation'; ///Reports -var REPORTS = 'Services/Doctors.svc/REST/GetPatientMedicalReportStatusInfo'; -var INSERT_REQUEST_FOR_MEDICAL_REPORT = - 'Services/Doctors.svc/REST/InsertRequestForMedicalReport'; -var SEND_MEDICAL_REPORT_EMAIL = - 'Services/Notifications.svc/REST/SendMedicalReportEmail'; +var REPORTS = 'Services/Doctors.svc/REST/GetPatientMedicalReportStatusInfo'; +var INSERT_REQUEST_FOR_MEDICAL_REPORT = 'Services/Doctors.svc/REST/InsertRequestForMedicalReport'; +var SEND_MEDICAL_REPORT_EMAIL = 'Services/Notifications.svc/REST/SendMedicalReportEmail'; ///Rate // var IS_LAST_APPOITMENT_RATED = 'Services/Doctors.svc/REST/IsLastAppoitmentRated'; -var IS_LAST_APPOITMENT_RATED = - 'Services/Doctors.svc/REST/IsLastAppoitmentRated_Async'; -var GET_APPOINTMENT_DETAILS_BY_NO = - 'Services/MobileNotifications.svc/REST/GetAppointmentDetailsByApptNo'; -var NEW_RATE_APPOINTMENT_URL = - "Services/Doctors.svc/REST/AppointmentsRating_InsertAppointmentRate"; -var NEW_RATE_DOCTOR_URL = - "Services/Doctors.svc/REST/DoctorsRating_InsertDoctorRate"; +var IS_LAST_APPOITMENT_RATED = 'Services/Doctors.svc/REST/IsLastAppoitmentRated_Async'; +var GET_APPOINTMENT_DETAILS_BY_NO = 'Services/MobileNotifications.svc/REST/GetAppointmentDetailsByApptNo'; +var NEW_RATE_APPOINTMENT_URL = "Services/Doctors.svc/REST/AppointmentsRating_InsertAppointmentRate"; +var NEW_RATE_DOCTOR_URL = "Services/Doctors.svc/REST/DoctorsRating_InsertDoctorRate"; -var GET_QR_PARKING = 'Services/SWP.svc/REST/GetQRParkingByID'; +var GET_QR_PARKING = 'Services/SWP.svc/REST/GetQRParkingByID'; //URL to get clinic list -var GET_CLINICS_LIST_URL = "Services/lists.svc/REST/GetClinicCentralized"; +var GET_CLINICS_LIST_URL = "Services/lists.svc/REST/GetClinicCentralized"; //URL to get active appointment list -var GET_ACTIVE_APPOINTMENTS_LIST_URL = - "Services/Doctors.svc/Rest/Dr_GetAppointmentActiveNumber"; +var GET_ACTIVE_APPOINTMENTS_LIST_URL = "Services/Doctors.svc/Rest/Dr_GetAppointmentActiveNumber"; //URL to get projects list -var GET_PROJECTS_LIST = 'Services/Lists.svc/REST/GetProject'; +var GET_PROJECTS_LIST = 'Services/Lists.svc/REST/GetProject'; //URL to get doctors list -var GET_DOCTORS_LIST_URL = "Services/Doctors.svc/REST/SearchDoctorsByTime"; +var GET_DOCTORS_LIST_URL = "Services/Doctors.svc/REST/SearchDoctorsByTime"; //URL to dental doctors list -var GET_DENTAL_DOCTORS_LIST_URL = - "Services/Doctors.svc/REST/Dental_DoctorChiefComplaintMapping"; +var GET_DENTAL_DOCTORS_LIST_URL = "Services/Doctors.svc/REST/Dental_DoctorChiefComplaintMapping"; //URL to get doctor free slots -var GET_DOCTOR_FREE_SLOTS = "Services/Doctors.svc/REST/GetDoctorFreeSlots"; +var GET_DOCTOR_FREE_SLOTS = "Services/Doctors.svc/REST/GetDoctorFreeSlots"; //URL to insert appointment -var INSERT_SPECIFIC_APPOINTMENT = - "Services/Doctors.svc/REST/InsertSpecificAppointment"; +var INSERT_SPECIFIC_APPOINTMENT = "Services/Doctors.svc/REST/InsertSpecificAppointment"; //URL to get patient share -var GET_PATIENT_SHARE = - "Services/Doctors.svc/REST/GetCheckinScreenAppointmentDetailsByAppointmentNO"; +var GET_PATIENT_SHARE = "Services/Doctors.svc/REST/GetCheckinScreenAppointmentDetailsByAppointmentNO"; //URL to get patient appointment history -var GET_PATIENT_APPOINTMENT_HISTORY = - "Services/Doctors.svc/REST/PateintHasAppoimentHistory"; +var GET_PATIENT_APPOINTMENT_HISTORY = "Services/Doctors.svc/REST/PateintHasAppoimentHistory"; -var GET_OBGYNE_ORDERS_LIST = - "services/Patients.svc/REST/HIS_OBGYNEProcedureGet"; +var GET_OBGYNE_ORDERS_LIST = "services/Patients.svc/REST/HIS_OBGYNEProcedureGet"; -var GET_OBGYNE_DOCTORS_LIST = - "services/Doctors.svc/REST/HIS_ObgyneUltrasoundDoctors"; +var GET_OBGYNE_DOCTORS_LIST = "services/Doctors.svc/REST/HIS_ObgyneUltrasoundDoctors"; -var OBGYNE_PROCEDURE_UPDATE = - "services/Patients.svc/REST/HIS_OBGYNEProcedure_Update"; +var OBGYNE_PROCEDURE_UPDATE = "services/Patients.svc/REST/HIS_OBGYNEProcedure_Update"; -var GET_RRT_PROCEDURE_LIST = - "Services/Patients.svc/REST/GetRRTProcedureDetailsListFromVida"; +var GET_RRT_PROCEDURE_LIST = "Services/Patients.svc/REST/GetRRTProcedureDetailsListFromVida"; -var DOCTOR_SCHEDULE_URL = - 'Services/Doctors.svc/REST/GetDoctorWorkingHoursTable'; +var DOCTOR_SCHEDULE_URL = 'Services/Doctors.svc/REST/GetDoctorWorkingHoursTable'; -var SEND_REPORT_EYE_EMAIL = - "Services/Notifications.svc/REST/SendGlassesPrescriptionEmail"; +var SEND_REPORT_EYE_EMAIL = "Services/Notifications.svc/REST/SendGlassesPrescriptionEmail"; -var SEND_CONTACT_LENS_PRESCRIPTION_EMAIL = - "Services/Notifications.svc/REST/SendContactLensPrescriptionEmail"; +var SEND_CONTACT_LENS_PRESCRIPTION_EMAIL = "Services/Notifications.svc/REST/SendContactLensPrescriptionEmail"; //URL to get patient appointment curfew history // var GET_PATIENT_APPOINTMENT_CURFEW_HISTORY = "Services/Doctors.svc/REST/AppoimentHistoryForCurfew"; -var GET_PATIENT_APPOINTMENT_CURFEW_HISTORY = - "Services/Doctors.svc/REST/AppoimentHistoryForCurfew_Async"; +var GET_PATIENT_APPOINTMENT_CURFEW_HISTORY = "Services/Doctors.svc/REST/AppoimentHistoryForCurfew_Async"; //URL to confirm appointment -var CONFIRM_APPOINTMENT = - "Services/MobileNotifications.svc/REST/ConfirmAppointment"; +var CONFIRM_APPOINTMENT = "Services/MobileNotifications.svc/REST/ConfirmAppointment"; -var INSERT_VIDA_REQUEST = - "Services/ER_VirtualCall.svc/REST/PatientER_VidaRequestInseart"; +var INSERT_VIDA_REQUEST = "Services/ER_VirtualCall.svc/REST/PatientER_VidaRequestInseart"; //URL to cancel appointment -var CANCEL_APPOINTMENT = "Services/Doctors.svc/REST/CancelAppointment"; +var CANCEL_APPOINTMENT = "Services/Doctors.svc/REST/CancelAppointment"; //URL get appointment QR -var GENERATE_QR_APPOINTMENT = - "Services/Doctors.svc/REST/GenerateQRAppointmentNo"; +var GENERATE_QR_APPOINTMENT = "Services/Doctors.svc/REST/GenerateQRAppointmentNo"; //URL send email appointment QR -var EMAIL_QR_APPOINTMENT = - "Services/Notifications.svc/REST/sendEmailForOnLineCheckin"; +var EMAIL_QR_APPOINTMENT = "Services/Notifications.svc/REST/sendEmailForOnLineCheckin"; //URL check payment status -var CHECK_PAYMENT_STATUS = - "Services/PayFort_Serv.svc/REST/GetRequestStatusByRequestID"; +var CHECK_PAYMENT_STATUS = "Services/PayFort_Serv.svc/REST/GetRequestStatusByRequestID"; //URL create advance payment -var CREATE_ADVANCE_PAYMENT = "Services/Doctors.svc/REST/CreateAdvancePayment"; +var CREATE_ADVANCE_PAYMENT = "Services/Doctors.svc/REST/CreateAdvancePayment"; -var HIS_CREATE_ADVANCE_PAYMENT = - "Services/Patients.svc/REST/HIS_CreateAdvancePayment"; +var HIS_CREATE_ADVANCE_PAYMENT = "Services/Patients.svc/REST/HIS_CreateAdvancePayment"; -var ER_CREATE_ADVANCE_PAYMENT = - "services/Doctors.svc/REST/ER_CreateAdvancePaymentForClinic"; +var ER_CREATE_ADVANCE_PAYMENT = "services/Doctors.svc/REST/ER_CreateAdvancePaymentForClinic"; -var ER_INSERT_ADVANCE_PAYMENT = - "services/Doctors.svc/REST/ER_InsertEROnlinePaymentDetails"; +var ER_INSERT_ADVANCE_PAYMENT = "services/Doctors.svc/REST/ER_InsertEROnlinePaymentDetails"; -var ADD_ADVANCE_NUMBER_REQUEST = - 'Services/PayFort_Serv.svc/REST/AddAdvancedNumberRequest'; +var ADD_ADVANCE_NUMBER_REQUEST = 'Services/PayFort_Serv.svc/REST/AddAdvancedNumberRequest'; -var GENERATE_ANCILLARY_ORDERS_INVOICE = - 'Services/Doctors.svc/REST/AutoGenerateAncillaryOrderInvoice'; +var GENERATE_ANCILLARY_ORDERS_INVOICE = 'Services/Doctors.svc/REST/AutoGenerateAncillaryOrderInvoice'; -var IS_ALLOW_ASK_DOCTOR = - 'Services/Doctors.svc/REST/GetPatientDoctorAppointmentResult'; -var GET_CALL_REQUEST_TYPE = - 'Services/Doctors.svc/REST/GetCallRequestType_LOV'; -var ADD_VIDA_REQUEST = - 'Services/ER_VirtualCall.svc/REST/PatientER_VidaRequestInseart'; +var IS_ALLOW_ASK_DOCTOR = 'Services/Doctors.svc/REST/GetPatientDoctorAppointmentResult'; +var GET_CALL_REQUEST_TYPE = 'Services/Doctors.svc/REST/GetCallRequestType_LOV'; +var ADD_VIDA_REQUEST = 'Services/ER_VirtualCall.svc/REST/PatientER_VidaRequestInseart'; -var SEND_CALL_REQUEST = 'Services/Doctors.svc/REST/InsertCallInfo'; +var SEND_CALL_REQUEST = 'Services/Doctors.svc/REST/InsertCallInfo'; -var GET_LIVECARE_CLINICS = - 'Services/ER_VirtualCall.svc/REST/PatientER_GetClinics'; +var GET_LIVECARE_CLINICS = 'Services/ER_VirtualCall.svc/REST/PatientER_GetClinics'; -var GET_LIVECARE_SCHEDULE_CLINICS = - 'Services/Doctors.svc/REST/PatientER_GetClinicsHaveSchedule'; +var GET_LIVECARE_SCHEDULE_CLINICS = 'Services/Doctors.svc/REST/PatientER_GetClinicsHaveSchedule'; -var GET_LIVECARE_SCHEDULE_CLINIC_DOCTOR_LIST = - 'Services/Doctors.svc/REST/PatientER_GetDoctorByClinicID'; +var GET_LIVECARE_SCHEDULE_CLINIC_DOCTOR_LIST = 'Services/Doctors.svc/REST/PatientER_GetDoctorByClinicID'; -var GET_LIVECARE_SCHEDULE_DOCTOR_TIME_SLOTS = - 'Services/Doctors.svc/REST/PatientER_GetDoctorFreeSlots'; +var GET_LIVECARE_SCHEDULE_DOCTOR_TIME_SLOTS = 'Services/Doctors.svc/REST/PatientER_GetDoctorFreeSlots'; -var INSERT_LIVECARE_SCHEDULE_APPOINTMENT = - 'Services/Doctors.svc/REST/InsertSpecificAppoitmentForSchedule'; +var INSERT_LIVECARE_SCHEDULE_APPOINTMENT = 'Services/Doctors.svc/REST/InsertSpecificAppoitmentForSchedule'; -var GET_PATIENT_SHARE_LIVECARE = - "Services/Doctors.svc/REST/GetCheckinScreenAppointmentDetailsByAppointmentNOForLiveCare"; +var GET_PATIENT_SHARE_LIVECARE = "Services/Doctors.svc/REST/GetCheckinScreenAppointmentDetailsByAppointmentNOForLiveCare"; -var SET_ONLINE_CHECKIN_FOR_APPOINTMENT = - "Services/Patients.svc/REST/SetOnlineCheckInForAppointment"; +var SET_ONLINE_CHECKIN_FOR_APPOINTMENT = "Services/Patients.svc/REST/SetOnlineCheckInForAppointment"; -var GET_LIVECARE_CLINIC_TIMING = - 'Services/ER_VirtualCall.svc/REST/PatientER_GetClinicsServiceTimingsSchedule'; +var GET_LIVECARE_CLINIC_TIMING = 'Services/ER_VirtualCall.svc/REST/PatientER_GetClinicsServiceTimingsSchedule'; -var GET_ER_APPOINTMENT_FEES = - 'Services/DoctorApplication.svc/REST/GetERAppointmentFees'; -var GET_ER_APPOINTMENT_TIME = 'Services/ER_VirtualCall.svc/REST/GetRestTime'; +var GET_ER_APPOINTMENT_FEES = 'Services/DoctorApplication.svc/REST/GetERAppointmentFees'; +var GET_ER_APPOINTMENT_TIME = 'Services/ER_VirtualCall.svc/REST/GetRestTime'; -var ADD_NEW_CALL_FOR_PATIENT_ER = - 'Services/DoctorApplication.svc/REST/NewCallForPatientER'; +var ADD_NEW_CALL_FOR_PATIENT_ER = 'Services/DoctorApplication.svc/REST/NewCallForPatientER'; -var GET_LIVECARE_HISTORY = - 'Services/ER_VirtualCall.svc/REST/GetPatientErVirtualHistory'; -var CANCEL_LIVECARE_REQUEST = - 'Services/ER_VirtualCall.svc/REST/DeleteErRequest'; -var SEND_LIVECARE_INVOICE_EMAIL = - 'Services/Notifications.svc/REST/SendInvoiceForLiveCare'; +var GET_LIVECARE_HISTORY = 'Services/ER_VirtualCall.svc/REST/GetPatientErVirtualHistory'; +var CANCEL_LIVECARE_REQUEST = 'Services/ER_VirtualCall.svc/REST/DeleteErRequest'; +var SEND_LIVECARE_INVOICE_EMAIL = 'Services/Notifications.svc/REST/SendInvoiceForLiveCare'; -var CHANGE_PATIENT_ER_SESSION = - 'Services/DoctorApplication.svc/REST/ChangePatientERSession'; +var CHANGE_PATIENT_ER_SESSION = 'Services/DoctorApplication.svc/REST/ChangePatientERSession'; -var APPLE_PAY_INSERT_REQUEST = - 'Services/PayFort_Serv.svc/REST/PayFort_ApplePayRequestData_Insert'; +var APPLE_PAY_INSERT_REQUEST = 'Services/PayFort_Serv.svc/REST/PayFort_ApplePayRequestData_Insert'; -var GET_USER_TERMS = 'Services/Patients.svc/REST/GetUserTermsAndConditions'; +var GET_USER_TERMS = 'Services/Patients.svc/REST/GetUserTermsAndConditions'; -var TAMARA_REQUEST_INSERT = 'Services/PayFort_Serv.svc/REST/AddTamaraRequest'; +var TAMARA_REQUEST_INSERT = 'Services/PayFort_Serv.svc/REST/AddTamaraRequest'; -var UPDATE_HEALTH_TERMS = - 'services/Patients.svc/REST/UpdatePateintHealthSummaryReport'; +var UPDATE_HEALTH_TERMS = 'services/Patients.svc/REST/UpdatePateintHealthSummaryReport'; -var GET_PATIENT_HEALTH_STATS = - 'Services/Patients.svc/REST/Med_GetTransactionsSts'; +var GET_PATIENT_HEALTH_STATS = 'Services/Patients.svc/REST/Med_GetTransactionsSts'; -var SEND_CHECK_IN_NFC_REQUEST = - 'Services/Patients.svc/REST/Patient_CheckAppointmentValidation_ForNFC'; +var SEND_CHECK_IN_NFC_REQUEST = 'Services/Patients.svc/REST/Patient_CheckAppointmentValidation_ForNFC'; -var HAS_DENTAL_PLAN = - 'Services/Doctors.svc/REST/Dental_IsPatientHasOnGoingEstimation'; +var HAS_DENTAL_PLAN = 'Services/Doctors.svc/REST/Dental_IsPatientHasOnGoingEstimation'; -var LASER_BODY_PARTS = 'Services/Patients.svc/REST/Laser_GetBodyPartsByCategory'; +var LASER_BODY_PARTS = 'Services/Patients.svc/REST/Laser_GetBodyPartsByCategory'; -var INSERT_COVID_QUESTIONNAIRE = 'Services/Doctors.svc/REST/COVID19_Questionnarie_Insert'; -var UPDATE_COVID_QUESTIONNAIRE = 'Services/Doctors.svc/REST/COVID19_Questionnarie_Update'; +var INSERT_COVID_QUESTIONNAIRE = 'Services/Doctors.svc/REST/COVID19_Questionnarie_Insert'; +var UPDATE_COVID_QUESTIONNAIRE = 'Services/Doctors.svc/REST/COVID19_Questionnarie_Update'; //URL to get medicine and pharmacies list -var CHANNEL = 3; -var GENERAL_ID = 'Cs2020@2016\$2958'; -var IP_ADDRESS = '10.20.10.20'; -var VERSION_ID = 9.9; -var SETUP_ID = '91877'; -var LANGUAGE = 2; +var CHANNEL = 3; +var GENERAL_ID = 'Cs2020@2016\$2958'; +var IP_ADDRESS = '10.20.10.20'; +var VERSION_ID = 9.91; +var SETUP_ID = '91877'; +var LANGUAGE = 2; // var PATIENT_OUT_SA = 0; -var SESSION_ID = 'TMRhVmkGhOsvamErw'; -var IS_DENTAL_ALLOWED_BACKEND = false; -var PATIENT_TYPE = 1; -var PATIENT_TYPE_ID = 1; +var SESSION_ID = 'TMRhVmkGhOsvamErw'; +var IS_DENTAL_ALLOWED_BACKEND = false; +var PATIENT_TYPE = 1; +var PATIENT_TYPE_ID = 1; var DEVICE_TOKEN = ""; var IS_VOICE_COMMAND_CLOSED = true; var IS_TEXT_COMPLETED = false; // var DeviceTypeID = Platform.isIOS ? 1 : 2; // var LANGUAGE_ID = 2; -var GET_PHARMCY_ITEMS = "Services/Lists.svc/REST/GetPharmcyItems_Region"; -var GET_PHARMACY_LIST = "Services/Patients.svc/REST/GetPharmcyList"; -var GET_PAtIENTS_INSURANCE = - "Services/Patients.svc/REST/Get_PatientInsuranceDetails"; -var GET_PAtIENTS_INSURANCE_UPDATED = - "Services/Patients.svc/REST/PatientER_GetPatientInsuranceCardUpdateHistory"; - -var INSURANCE_DETAILS = "Services/Patients.svc/REST/Get_InsuranceCheckList"; -var INSURANCE_SCHEMES = "Services/Patients.svc/REST/PatientER_SchemesOfAactiveCompaniesGet"; -var UPDATE_MANUAL_INSURANCE = "Services/Patients.svc/REST/PatientER_PatientInfoForInsuranceCardUpdate"; -var INSURANCE_COMPANIES = "Services/Patients.svc/REST/PatientER_InsuranceCompanyGet"; -var GET_PATIENT_INSURANCE_DETAILS = - "Services/Patients.svc/REST/PatientER_GetPatientInsuranceDetails"; -var UPLOAD_INSURANCE_CARD = - 'Services/Patients.svc/REST/PatientER_PatientInfoForInsuranceCardUpdate'; - -var GET_VACCINES = "Services/Patients.svc/REST/GetDoneVaccinesByPatientID"; -var GET_VACCINES_EMAIL = "Services/Notifications.svc/REST/SendVaccinesEmail"; -var GET_PAtIENTS_INSURANCE_APPROVALS = - "Services/Patients.svc/REST/GetApprovalStatus_Async"; +var GET_PHARMCY_ITEMS = "Services/Lists.svc/REST/GetPharmcyItems_Region"; +var GET_PHARMACY_LIST = "Services/Patients.svc/REST/GetPharmcyList"; +var GET_PAtIENTS_INSURANCE = "Services/Patients.svc/REST/Get_PatientInsuranceDetails"; +var GET_PAtIENTS_INSURANCE_UPDATED = "Services/Patients.svc/REST/PatientER_GetPatientInsuranceCardUpdateHistory"; + +var INSURANCE_DETAILS = "Services/Patients.svc/REST/Get_InsuranceCheckList"; +var INSURANCE_SCHEMES = "Services/Patients.svc/REST/PatientER_SchemesOfAactiveCompaniesGet"; +var UPDATE_MANUAL_INSURANCE = "Services/Patients.svc/REST/PatientER_PatientInfoForInsuranceCardUpdate"; +var INSURANCE_COMPANIES = "Services/Patients.svc/REST/PatientER_InsuranceCompanyGet"; +var GET_PATIENT_INSURANCE_DETAILS = "Services/Patients.svc/REST/PatientER_GetPatientInsuranceDetails"; +var UPLOAD_INSURANCE_CARD = 'Services/Patients.svc/REST/PatientER_PatientInfoForInsuranceCardUpdate'; + +var GET_VACCINES = "Services/Patients.svc/REST/GetDoneVaccinesByPatientID"; +var GET_VACCINES_EMAIL = "Services/Notifications.svc/REST/SendVaccinesEmail"; +var GET_PAtIENTS_INSURANCE_APPROVALS = "Services/Patients.svc/REST/GetApprovalStatus_Async"; // var GET_PAtIENTS_INSURANCE_APPROVALS = "Services/Patients.svc/REST/GetApprovalStatus"; -var SEARCH_BOT = 'HabibiChatBotApi/BotInterface/GetVoiceCommandResponse'; +var SEARCH_BOT = 'HabibiChatBotApi/BotInterface/GetVoiceCommandResponse'; -var GET_VACCINATIONS_ITEMS = "/Services/ERP.svc/REST/GET_VACCINATIONS_ITEMS"; -var GET_VACCINATION_ONHAND = "/Services/ERP.svc/REST/GET_VACCINATION_ONHAND"; +var GET_VACCINATIONS_ITEMS = "/Services/ERP.svc/REST/GET_VACCINATIONS_ITEMS"; +var GET_VACCINATION_ONHAND = "/Services/ERP.svc/REST/GET_VACCINATION_ONHAND"; -var GET_PATIENT_SICK_LEAVE = 'Services/Patients.svc/REST/GetPatientSickLeave'; +var GET_PATIENT_SICK_LEAVE = 'Services/Patients.svc/REST/GetPatientSickLeave'; -var GET_PATIENT_SICK_LEAVE_STATUS = 'Services/Patients.svc/REST/GetPatientSickLeave_Status'; +var GET_PATIENT_SICK_LEAVE_STATUS = 'Services/Patients.svc/REST/GetPatientSickLeave_Status'; -var SendSickLeaveEmail = 'Services/Notifications.svc/REST/SendSickLeaveEmail'; +var SendSickLeaveEmail = 'Services/Notifications.svc/REST/SendSickLeaveEmail'; -var GET_PATIENT_AdVANCE_BALANCE_AMOUNT = - 'Services/Patients.svc/REST/GetPatientAdvanceBalanceAmount'; -var GET_PATIENT_INFO_BY_ID = - 'Services/Doctors.svc/REST/GetPatientInfoByPatientID'; -var GET_PATIENT_INFO_BY_ID_AND_MOBILE_NUMBER = - 'Services/Patients.svc/REST/AP_GetPatientInfoByPatientIDandMobileNumber'; -var SEND_ACTIVATION_CODE_FOR_ADVANCE_PAYMENT = - 'Services/Authentication.svc/REST/SendActivationCodeForAdvancePayment'; -var CHECK_ACTIVATION_CODE_FOR_ADVANCE_PAYMENT = - 'Services/Authentication.svc/REST/CheckActivationCodeForAdvancePayment'; +var GET_PATIENT_AdVANCE_BALANCE_AMOUNT = 'Services/Patients.svc/REST/GetPatientAdvanceBalanceAmount'; +var GET_PATIENT_INFO_BY_ID = 'Services/Doctors.svc/REST/GetPatientInfoByPatientID'; +var GET_PATIENT_INFO_BY_ID_AND_MOBILE_NUMBER = 'Services/Patients.svc/REST/AP_GetPatientInfoByPatientIDandMobileNumber'; +var SEND_ACTIVATION_CODE_FOR_ADVANCE_PAYMENT = 'Services/Authentication.svc/REST/SendActivationCodeForAdvancePayment'; +var CHECK_ACTIVATION_CODE_FOR_ADVANCE_PAYMENT = 'Services/Authentication.svc/REST/CheckActivationCodeForAdvancePayment'; -var GET_COVID_DRIVETHRU_PROJECT_LIST = - 'Services/Doctors.svc/REST/COVID19_ProjectDriveThroughTestingCenter'; +var GET_COVID_DRIVETHRU_PROJECT_LIST = 'Services/Doctors.svc/REST/COVID19_ProjectDriveThroughTestingCenter'; -var GET_COVID_DRIVETHRU_PAYMENT_INFO = - 'Services/Doctors.svc/REST/COVID19_GetPatientPaymentInormation'; +var GET_COVID_DRIVETHRU_PAYMENT_INFO = 'Services/Doctors.svc/REST/COVID19_GetPatientPaymentInormation'; -var GET_COVID_DRIVETHRU_FREE_SLOTS = - 'Services/Doctors.svc/REST/COVID19_GetFreeSlots'; +var GET_COVID_DRIVETHRU_FREE_SLOTS = 'Services/Doctors.svc/REST/COVID19_GetFreeSlots'; -var GET_COVID_DRIVETHRU_PROCEDURES_LIST = - 'Services/Doctors.svc/REST/COVID19_GetTestProcedures'; +var GET_COVID_DRIVETHRU_PROCEDURES_LIST = 'Services/Doctors.svc/REST/COVID19_GetTestProcedures'; ///Smartwatch Integration Services -var GET_PATIENT_LAST_RECORD = - 'Services/Patients.svc/REST/Med_GetPatientLastRecord'; -var INSERT_PATIENT_HEALTH_DATA = - 'Services/Patients.svc/REST/Med_InsertTransactions'; +var GET_PATIENT_LAST_RECORD = 'Services/Patients.svc/REST/Med_GetPatientLastRecord'; +var INSERT_PATIENT_HEALTH_DATA = 'Services/Patients.svc/REST/Med_InsertTransactions'; ///My Trackers -var GET_DIABETIC_RESULT_AVERAGE = - 'Services/Patients.svc/REST/Patient_GetDiabeticResultAverage'; -var GET_DIABTEC_RESULT = - 'Services/Patients.svc/REST/Patient_GetDiabtecResults'; -var ADD_DIABTEC_RESULT = - 'Services/Patients.svc/REST/Patient_AddDiabtecResult'; - -var GET_BLOOD_PRESSURE_RESULT_AVERAGE = - 'Services/Patients.svc/REST/Patient_GetBloodPressureResultAverage'; -var GET_BLOOD_PRESSURE_RESULT = - 'Services/Patients.svc/REST/Patient_GetBloodPressureResult'; -var ADD_BLOOD_PRESSURE_RESULT = - 'Services/Patients.svc/REST/Patient_AddBloodPressureResult'; - -var GET_WEIGHT_PRESSURE_RESULT_AVERAGE = - 'Services/Patients.svc/REST/Patient_GetWeightMeasurementResultAverage'; -var GET_WEIGHT_PRESSURE_RESULT = - 'Services/Patients.svc/REST/Patient_GetWeightMeasurementResult'; -var ADD_WEIGHT_PRESSURE_RESULT = - 'Services/Patients.svc/REST/Patient_AddWeightMeasurementResult'; - -var ADD_ACTIVE_PRESCRIPTIONS_REPORT_BY_PATIENT_ID = - 'Services/Patients.svc/Rest/GetActivePrescriptionReportByPatientID'; - -var GET_CALL_INFO_HOURS_RESULT = - 'Services/Doctors.svc/REST/GetCallInfoHoursResult'; -var GET_CALL_REQUEST_TYPE_LOV = - 'Services/Doctors.svc/REST/GetCallRequestType_LOV'; - -var UPDATE_DIABETIC_RESULT = - 'Services/Patients.svc/REST/Patient_UpdateDiabeticResult'; - -var SEND_AVERAGE_BLOOD_SUGAR_REPORT = - 'Services/Notifications.svc/REST/SendAverageBloodSugarReport'; -var DEACTIVATE_DIABETIC_STATUS = - 'services/Patients.svc/REST/Patient_DeactivateDiabeticStatus'; -var DEACTIVATE_BLOOD_PRESSURES_STATUS = - 'services/Patients.svc/REST/Patient_DeactivateBloodPressureStatus'; - -var UPDATE_BLOOD_PRESSURE_RESULT = - 'Services/Patients.svc/REST/Patient_UpdateBloodPressureResult'; -var SEND_AVERAGE_BLOOD_WEIGHT_REPORT = - 'Services/Notifications.svc/REST/SendAverageBodyWeightReport'; -var SEND_AVERAGE_BLOOD_PRESSURE_REPORT = - 'Services/Notifications.svc/REST/SendAverageBloodPressureReport'; - -var UPDATE_WEIGHT_PRESSURE_RESULT = - 'Services/Patients.svc/REST/Patient_UpdateWeightMeasurementResult'; -var DEACTIVATE_WEIGHT_PRESSURE_RESULT = - 'services/Patients.svc/REST/Patient_DeactivateWeightMeasurementStatus'; -var GET_DOCTOR_RESPONSE = 'Services/Patients.svc/REST/GetDoctorResponse'; -var UPDATE_READ_STATUS = 'Services/Patients.svc/REST/UpdateReadStatus'; -var INSERT_CALL_INFO = 'Services/Doctors.svc/REST/InsertCallInfo'; - -var GET_PATIENT_ALLERGIES = 'Services/Patients.svc/REST/GetPatientAllergies'; +var GET_DIABETIC_RESULT_AVERAGE = 'Services/Patients.svc/REST/Patient_GetDiabeticResultAverage'; +var GET_DIABTEC_RESULT = 'Services/Patients.svc/REST/Patient_GetDiabtecResults'; +var ADD_DIABTEC_RESULT = 'Services/Patients.svc/REST/Patient_AddDiabtecResult'; + +var GET_BLOOD_PRESSURE_RESULT_AVERAGE = 'Services/Patients.svc/REST/Patient_GetBloodPressureResultAverage'; +var GET_BLOOD_PRESSURE_RESULT = 'Services/Patients.svc/REST/Patient_GetBloodPressureResult'; +var ADD_BLOOD_PRESSURE_RESULT = 'Services/Patients.svc/REST/Patient_AddBloodPressureResult'; + +var GET_WEIGHT_PRESSURE_RESULT_AVERAGE = 'Services/Patients.svc/REST/Patient_GetWeightMeasurementResultAverage'; +var GET_WEIGHT_PRESSURE_RESULT = 'Services/Patients.svc/REST/Patient_GetWeightMeasurementResult'; +var ADD_WEIGHT_PRESSURE_RESULT = 'Services/Patients.svc/REST/Patient_AddWeightMeasurementResult'; + +var ADD_ACTIVE_PRESCRIPTIONS_REPORT_BY_PATIENT_ID = 'Services/Patients.svc/Rest/GetActivePrescriptionReportByPatientID'; + +var GET_CALL_INFO_HOURS_RESULT = 'Services/Doctors.svc/REST/GetCallInfoHoursResult'; +var GET_CALL_REQUEST_TYPE_LOV = 'Services/Doctors.svc/REST/GetCallRequestType_LOV'; + +var UPDATE_DIABETIC_RESULT = 'Services/Patients.svc/REST/Patient_UpdateDiabeticResult'; + +var SEND_AVERAGE_BLOOD_SUGAR_REPORT = 'Services/Notifications.svc/REST/SendAverageBloodSugarReport'; +var DEACTIVATE_DIABETIC_STATUS = 'services/Patients.svc/REST/Patient_DeactivateDiabeticStatus'; +var DEACTIVATE_BLOOD_PRESSURES_STATUS = 'services/Patients.svc/REST/Patient_DeactivateBloodPressureStatus'; + +var UPDATE_BLOOD_PRESSURE_RESULT = 'Services/Patients.svc/REST/Patient_UpdateBloodPressureResult'; +var SEND_AVERAGE_BLOOD_WEIGHT_REPORT = 'Services/Notifications.svc/REST/SendAverageBodyWeightReport'; +var SEND_AVERAGE_BLOOD_PRESSURE_REPORT = 'Services/Notifications.svc/REST/SendAverageBloodPressureReport'; + +var UPDATE_WEIGHT_PRESSURE_RESULT = 'Services/Patients.svc/REST/Patient_UpdateWeightMeasurementResult'; +var DEACTIVATE_WEIGHT_PRESSURE_RESULT = 'services/Patients.svc/REST/Patient_DeactivateWeightMeasurementStatus'; +var GET_DOCTOR_RESPONSE = 'Services/Patients.svc/REST/GetDoctorResponse'; +var UPDATE_READ_STATUS = 'Services/Patients.svc/REST/UpdateReadStatus'; +var INSERT_CALL_INFO = 'Services/Doctors.svc/REST/InsertCallInfo'; + +var GET_PATIENT_ALLERGIES = 'Services/Patients.svc/REST/GetPatientAllergies'; // H2O -var H2O_GET_USER_PROGRESS = - "Services/H2ORemainder.svc/REST/H2O_GetUserProgress"; -var H2O_INSERT_USER_ACTIVITY = - "Services/H2ORemainder.svc/REST/H2O_InsertUserActivity"; -var H2O_GET_USER_DETAIL = - "Services/H2ORemainder.svc/REST/H2O_GetUserDetails_New"; -var H2O_UPDATE_USER_DETAIL = - "Services/H2ORemainder.svc/REST/H2O_UpdateUserDetails_New"; -var H2O_UNDO_USER_ACTIVITY = - "Services/H2ORemainder.svc/REST/H2o_UndoUserActivity"; +var H2O_GET_USER_PROGRESS = "Services/H2ORemainder.svc/REST/H2O_GetUserProgress"; +var H2O_INSERT_USER_ACTIVITY = "Services/H2ORemainder.svc/REST/H2O_InsertUserActivity"; +var H2O_GET_USER_DETAIL = "Services/H2ORemainder.svc/REST/H2O_GetUserDetails_New"; +var H2O_UPDATE_USER_DETAIL = "Services/H2ORemainder.svc/REST/H2O_UpdateUserDetails_New"; +var H2O_UNDO_USER_ACTIVITY = "Services/H2ORemainder.svc/REST/H2o_UndoUserActivity"; //E_Referral Services -var GET_ALL_RELATIONSHIP_TYPES = - "Services/Patients.svc/REST/GetAllRelationshipTypes"; -var SEND_ACTIVATION_CODE_FOR_E_REFERRAL = - 'Services/Authentication.svc/REST/SendActivationCodeForEReferral'; -var CHECK_ACTIVATION_CODE_FOR_E_REFERRAL = - 'Services/Authentication.svc/REST/CheckActivationCodeForEReferral'; -var GET_ALL_CITIES = 'services/Lists.svc/rest/GetAllCities'; -var CREATE_E_REFERRAL = "Services/Patients.svc/REST/CreateEReferral"; -var GET_E_REFERRALS = "Services/Patients.svc/REST/GetEReferrals"; +var GET_ALL_RELATIONSHIP_TYPES = "Services/Patients.svc/REST/GetAllRelationshipTypes"; +var SEND_ACTIVATION_CODE_FOR_E_REFERRAL = 'Services/Authentication.svc/REST/SendActivationCodeForEReferral'; +var CHECK_ACTIVATION_CODE_FOR_E_REFERRAL = 'Services/Authentication.svc/REST/CheckActivationCodeForEReferral'; +var GET_ALL_CITIES = 'services/Lists.svc/rest/GetAllCities'; +var CREATE_E_REFERRAL = "Services/Patients.svc/REST/CreateEReferral"; +var GET_E_REFERRALS = "Services/Patients.svc/REST/GetEReferrals"; // Encillary Orders -var GET_ANCILLARY_ORDERS = - 'Services/Doctors.svc/REST/GetOnlineAncillaryOrderList'; +var GET_ANCILLARY_ORDERS = 'Services/Doctors.svc/REST/GetOnlineAncillaryOrderList'; -var GET_ANCILLARY_ORDERS_DETAILS = - 'Services/Doctors.svc/REST/GetOnlineAncillaryOrderProcList'; +var GET_ANCILLARY_ORDERS_DETAILS = 'Services/Doctors.svc/REST/GetOnlineAncillaryOrderProcList'; //Pharmacy wishlist // var GET_WISHLIST = "http://swd-pharapp-01:7200/api/shopping_cart_items/"; -var GET_DOCTOR_LIST_BY_TIME = "Services/Doctors.svc/REST/SearchDoctorsByTime"; +var GET_DOCTOR_LIST_BY_TIME = "Services/Doctors.svc/REST/SearchDoctorsByTime"; // pharmacy -var PHARMACY_AUTORZIE_CUSTOMER = "AutorizeCustomer"; -var PHARMACY_VERIFY_CUSTOMER = "VerifyCustomer"; -var PHARMACY_GET_COUNTRY = "countries"; +var PHARMACY_AUTORZIE_CUSTOMER = "AutorizeCustomer"; +var PHARMACY_VERIFY_CUSTOMER = "VerifyCustomer"; +var PHARMACY_GET_COUNTRY = "countries"; // var PHARMACY_CREATE_CUSTOMER = "epharmacy/api/CreateCustomer"; -var PHARMACY_CREATE_CUSTOMER = "getorcreateCustomer"; -var GET_PHARMACY_BANNER = "promotionbanners"; -var GET_PHARMACY_TOP_MANUFACTURER = "topmanufacturer"; -var GET_PHARMACY_BEST_SELLER_PRODUCT = "bestsellerproducts"; -var GET_PHARMACY_PRODUCTs_BY_IDS = "productsbyids/"; -var GET_PHARMACY_PRODUCTs_BY_SKU = "productbysku/"; -var GET_CUSTOMERS_ADDRESSES = "Customers/"; -var SUBSCRIBE_PRODUCT = "subscribe?"; -var GET_ORDER = "orders?"; -var GET_ORDER_DETAILS = "orders/"; -var ADD_CUSTOMER_ADDRESS = "addcustomeraddress"; -var EDIT_CUSTOMER_ADDRESS = "editcustomeraddress"; -var DELETE_CUSTOMER_ADDRESS = "deletecustomeraddress"; -var GET_ADDRESS = "Customers/"; -var GET_Cancel_ORDER = "cancelorder/"; -var WRITE_REVIEW = "Content-Type" + "text/plain; charset=utf-8"; -var GET_SHOPPING_CART = "shopping_cart_items/"; -var GET_SHIPPING_OPTIONS = "get_shipping_option/"; -var DELETE_SHOPPING_CART = "delete_shopping_cart_items/"; -var DELETE_SHOPPING_CART_ALL = "delete_shopping_cart_item_by_customer/"; -var ORDER_SHOPPING_CART = "orders"; -var GET_LACUM_ACCOUNT_INFORMATION = - "Services/Patients.svc/REST/GetLakumAccountInformation"; -var GET_LACUM_GROUP_INFORMATION = - "Services/Patients.svc/REST/GetlakumInQueryInfoGrouping"; -var LACUM_ACCOUNT_ACTIVATE = - "Services/Patients.svc/REST/LakumAccountActivation"; -var LACUM_ACCOUNT_DEACTIVATE = - "Services/Patients.svc/REST/LakumAccountDeactivation"; -var CREATE_LAKUM_ACCOUNT = - "Services/Patients.svc/REST/PHR_CreateLakumAccount"; -var TRANSFER_YAHALA_LOYALITY_POINTS = - "Services/Patients.svc/REST/TransferYaHalaLoyaltyPoints"; -var LAKUM_GET_USER_TERMS_AND_CONDITIONS = - "Services/ERP.svc/REST/GetUserTermsAndConditionsForEPharmcy"; +var PHARMACY_CREATE_CUSTOMER = "getorcreateCustomer"; +var GET_PHARMACY_BANNER = "promotionbanners"; +var GET_PHARMACY_TOP_MANUFACTURER = "topmanufacturer"; +var GET_PHARMACY_BEST_SELLER_PRODUCT = "bestsellerproducts"; +var GET_PHARMACY_PRODUCTs_BY_IDS = "productsbyids/"; +var GET_PHARMACY_PRODUCTs_BY_SKU = "productbysku/"; +var GET_CUSTOMERS_ADDRESSES = "Customers/"; +var SUBSCRIBE_PRODUCT = "subscribe?"; +var GET_ORDER = "orders?"; +var GET_ORDER_DETAILS = "orders/"; +var ADD_CUSTOMER_ADDRESS = "addcustomeraddress"; +var EDIT_CUSTOMER_ADDRESS = "editcustomeraddress"; +var DELETE_CUSTOMER_ADDRESS = "deletecustomeraddress"; +var GET_ADDRESS = "Customers/"; +var GET_Cancel_ORDER = "cancelorder/"; +var WRITE_REVIEW = "Content-Type" + "text/plain; charset=utf-8"; +var GET_SHOPPING_CART = "shopping_cart_items/"; +var GET_SHIPPING_OPTIONS = "get_shipping_option/"; +var DELETE_SHOPPING_CART = "delete_shopping_cart_items/"; +var DELETE_SHOPPING_CART_ALL = "delete_shopping_cart_item_by_customer/"; +var ORDER_SHOPPING_CART = "orders"; +var GET_LACUM_ACCOUNT_INFORMATION = "Services/Patients.svc/REST/GetLakumAccountInformation"; +var GET_LACUM_GROUP_INFORMATION = "Services/Patients.svc/REST/GetlakumInQueryInfoGrouping"; +var LACUM_ACCOUNT_ACTIVATE = "Services/Patients.svc/REST/LakumAccountActivation"; +var LACUM_ACCOUNT_DEACTIVATE = "Services/Patients.svc/REST/LakumAccountDeactivation"; +var CREATE_LAKUM_ACCOUNT = "Services/Patients.svc/REST/PHR_CreateLakumAccount"; +var TRANSFER_YAHALA_LOYALITY_POINTS = "Services/Patients.svc/REST/TransferYaHalaLoyaltyPoints"; +var LAKUM_GET_USER_TERMS_AND_CONDITIONS = "Services/ERP.svc/REST/GetUserTermsAndConditionsForEPharmcy"; // var PRESCRIPTION = 'Services/Patients.svc/REST/GetPrescriptionApptList'; -var PRESCRIPTION = 'Services/Patients.svc/REST/GetPrescriptionApptList_Async'; +var PRESCRIPTION = 'Services/Patients.svc/REST/GetPrescriptionApptList_Async'; -var GET_RECOMMENDED_PRODUCT = 'alsoProduct/'; -var GET_MOST_VIEWED_PRODUCTS = "mostview"; -var GET_NEW_PRODUCTS = "newproducts"; +var GET_RECOMMENDED_PRODUCT = 'alsoProduct/'; +var GET_MOST_VIEWED_PRODUCTS = "mostview"; +var GET_NEW_PRODUCTS = "newproducts"; // Home Health Care -var HHC_GET_ALL_SERVICES = - "Services/Patients.svc/REST/PatientER_HHC_GetAllServices"; -var HHC_GET_ALL_CMC_SERVICES = - "Services/Patients.svc/REST/PatientER_CMC_GetAllServices"; -var PATIENT_ER_UPDATE_PRES_ORDER = - "Services/Patients.svc/REST/PatientER_UpdatePresOrder"; -var GET_ORDER_DETAIL_BY_ID = - "Services/Patients.svc/REST/PatientER_HHC_GetTransactionsForOrder"; -var GET_CMC_ORDER_DETAIL_BY_ID = - "Services/Patients.svc/REST/PatientER_CMC_GetTransactionsForOrder"; -var GET_CHECK_UP_ITEMS = "Services/Patients.svc/REST/GetCheckUpItems"; -var PUSH_NOTIFICATION_GET_ALL_NOTIFICATIONS = - 'Services/MobileNotifications.svc/REST/PushNotification_GetAllNotifications'; -var PUSH_NOTIFICATION_SET_MESSAGES_FROM_POOL_AS_READ = - 'Services/MobileNotifications.svc/REST/PushNotification_SetMessagesFromPoolAsRead'; -var GET_PATIENT_ALL_PRES_ORD = - 'Services/Patients.svc/REST/PatientER_GetPatientAllPresOrders'; -var PATIENT_ER_INSERT_PRES_ORDER = - 'Services/Patients.svc/REST/PatientER_InsertPresOrder'; -var BLOOD_DONATION_REGISTER_BLOOD_TYPE = - 'Services/PatientVarification.svc/REST/BloodDonation_RegisterBloodType'; -var ADD_USER_AGREEMENT_FOR_BLOOD_DONATION = - 'Services/PatientVarification.svc/REST/AddUserAgreementForBloodDonation'; +var HHC_GET_ALL_SERVICES = "Services/Patients.svc/REST/PatientER_HHC_GetAllServices"; +var HHC_GET_ALL_CMC_SERVICES = "Services/Patients.svc/REST/PatientER_CMC_GetAllServices"; +var PATIENT_ER_UPDATE_PRES_ORDER = "Services/Patients.svc/REST/PatientER_UpdatePresOrder"; +var GET_ORDER_DETAIL_BY_ID = "Services/Patients.svc/REST/PatientER_HHC_GetTransactionsForOrder"; +var GET_CMC_ORDER_DETAIL_BY_ID = "Services/Patients.svc/REST/PatientER_CMC_GetTransactionsForOrder"; +var GET_CHECK_UP_ITEMS = "Services/Patients.svc/REST/GetCheckUpItems"; +var PUSH_NOTIFICATION_GET_ALL_NOTIFICATIONS = 'Services/MobileNotifications.svc/REST/PushNotification_GetAllNotifications'; +var PUSH_NOTIFICATION_SET_MESSAGES_FROM_POOL_AS_READ = 'Services/MobileNotifications.svc/REST/PushNotification_SetMessagesFromPoolAsRead'; +var GET_PATIENT_ALL_PRES_ORD = 'Services/Patients.svc/REST/PatientER_GetPatientAllPresOrders'; +var PATIENT_ER_INSERT_PRES_ORDER = 'Services/Patients.svc/REST/PatientER_InsertPresOrder'; +var BLOOD_DONATION_REGISTER_BLOOD_TYPE = 'Services/PatientVarification.svc/REST/BloodDonation_RegisterBloodType'; +var ADD_USER_AGREEMENT_FOR_BLOOD_DONATION = 'Services/PatientVarification.svc/REST/AddUserAgreementForBloodDonation'; // HHC RC SERVICES -var HHC_GET_ALL_SERVICES_RC = "api/HHC/getallhhc"; -var ADD_HHC_ORDER_RC = "api/HHC/add"; -var GET_ALL_HHC_ORDERS_RC = 'api/hhc/list'; -var UPDATE_HHC_ORDER_RC = 'api/hhc/update'; +var HHC_GET_ALL_SERVICES_RC = "api/HHC/getallhhc"; +var ADD_HHC_ORDER_RC = "api/HHC/add"; +var GET_ALL_HHC_ORDERS_RC = 'api/hhc/list'; +var UPDATE_HHC_ORDER_RC = 'api/hhc/update'; // CMC RC SERVICES -var GET_ALL_CMC_SERVICES_RC = 'api/cmc/getallcmc'; -var ADD_CMC_ORDER_RC = 'api/cmc/add'; -var GET_ALL_CMC_ORDERS_RC = 'api/cmc/list'; -var UPDATE_CMC_ORDER_RC = 'api/cmc/update'; +var GET_ALL_CMC_SERVICES_RC = 'api/cmc/getallcmc'; +var ADD_CMC_ORDER_RC = 'api/cmc/add'; +var GET_ALL_CMC_ORDERS_RC = 'api/cmc/list'; +var UPDATE_CMC_ORDER_RC = 'api/cmc/update'; // RRT RC SERVICES -var ADD_RRT_ORDER_RC = "api/rrt/add"; -var GET_ALL_RRT_ORDERS_RC = "api/rrt/list"; -var UPDATE_RRT_ORDER_RC = 'api/rrt/update'; +var ADD_RRT_ORDER_RC = "api/rrt/add"; +var GET_ALL_RRT_ORDERS_RC = "api/rrt/list"; +var UPDATE_RRT_ORDER_RC = 'api/rrt/update'; // PRESCRIPTION RC SERVICES -var ADD_PRESCRIPTION_ORDER_RC = "api/prescription/add"; -var GET_ALL_PRESCRIPTION_ORDERS_RC = "api/prescription/list"; -var GET_ALL_PRESCRIPTION_INFO_RC = "api/Prescription/info"; -var UPDATE_PRESCRIPTION_ORDER_RC = 'api/prescription/update'; +var ADD_PRESCRIPTION_ORDER_RC = "api/prescription/add"; +var GET_ALL_PRESCRIPTION_ORDERS_RC = "api/prescription/list"; +var GET_ALL_PRESCRIPTION_INFO_RC = "api/Prescription/info"; +var UPDATE_PRESCRIPTION_ORDER_RC = 'api/prescription/update'; //Pharmacy wishlist -var GET_WISHLIST = "shopping_cart_items/"; -var DELETE_WISHLIST = "delete_shopping_cart_item_by_product?customer_id="; -var GET_REVIEW = "customerreviews/"; -var GET_BRANDS = "manufacturer"; -var GET_TOP_BRANDS = "topmanufacturer?page=1&limit=8"; -var GET_PRODUCT_DETAIL = "products/"; -var GET_LOCATION = "Services/Patients.svc/REST/GetPharmcyListBySKU"; -var GET_SPECIFICATION = "productspecification/"; -var GET_BRAND_ITEMS = "products"; -var PHARMACY_MAKE_REVIEW = 'insertreviews'; +var GET_WISHLIST = "shopping_cart_items/"; +var DELETE_WISHLIST = "delete_shopping_cart_item_by_product?customer_id="; +var GET_REVIEW = "customerreviews/"; +var GET_BRANDS = "manufacturer"; +var GET_TOP_BRANDS = "topmanufacturer?page=1&limit=8"; +var GET_PRODUCT_DETAIL = "products/"; +var GET_LOCATION = "Services/Patients.svc/REST/GetPharmcyListBySKU"; +var GET_SPECIFICATION = "productspecification/"; +var GET_BRAND_ITEMS = "products"; +var PHARMACY_MAKE_REVIEW = 'insertreviews'; // External API -var ADD_ADDRESS_INFO = "addcustomeraddress"; -var GET_CUSTOMER_ADDRESSES = "Customers/"; -var GET_CUSTOMER_INFO = "VerifyCustomer"; +var ADD_ADDRESS_INFO = "addcustomeraddress"; +var GET_CUSTOMER_ADDRESSES = "Customers/"; +var GET_CUSTOMER_INFO = "VerifyCustomer"; //Pharmacy -var GET_PHARMACY_CATEGORISE = - 'categories?fields=id,name,namen,description,image,localized_names,display_order,parent_category_id,is_leaf&parent_id=0'; -var GET_OFFERS_CATEGORISE = 'discountcategories'; -var GET_OFFERS_PRODUCTS = 'offerproducts/'; -var GET_CATEGORISE_PARENT = - 'categories?fields=id,name,namen,description,image,localized_names,display_order,parent_category_id,is_leaf&parent_id='; -var GET_PARENT_PRODUCTS = 'products?categoryid='; -var GET_SUB_CATEGORISE = - 'categories?fields=id,name,namen,description,image,localized_names,display_order,parent_category_id,is_leaf&parent_id='; -var GET_SUB_PRODUCTS = 'products?categoryid='; -var GET_FINAL_PRODUCTS = +var GET_PHARMACY_CATEGORISE = 'categories?fields=id,name,namen,description,image,localized_names,display_order,parent_category_id,is_leaf&parent_id=0'; +var GET_OFFERS_CATEGORISE = 'discountcategories'; +var GET_OFFERS_PRODUCTS = 'offerproducts/'; +var GET_CATEGORISE_PARENT = 'categories?fields=id,name,namen,description,image,localized_names,display_order,parent_category_id,is_leaf&parent_id='; +var GET_PARENT_PRODUCTS = 'products?categoryid='; +var GET_SUB_CATEGORISE = 'categories?fields=id,name,namen,description,image,localized_names,display_order,parent_category_id,is_leaf&parent_id='; +var GET_SUB_PRODUCTS = 'products?categoryid='; +var GET_FINAL_PRODUCTS = 'products?fields=id,reviews,discount_ids,name,namen,localized_names,display_order,short_description,full_description,full_descriptionn,sku,order_minimum_quantity,order_maximum_quantity,price,old_price,images,is_rx,rx_message,rx_messagen,discount_name,discount_namen,approved_rating_sum,approved_total_reviews,allow_back_in_stock_subscriptions,stock_quantity,stock_availability,stock_availabilityn,discount_percentage&CategoryId='; -var GET_CLINIC_CATEGORY = 'Services/Doctors.svc/REST/DP_GetClinicCategory'; -var GET_DISEASE_BY_CLINIC_ID = - 'Services/Doctors.svc/REST/DP_GetDiseasesByClinicID'; -var SEARCH_DOCTOR_BY_TIME = 'Services/Doctors.svc/REST/SearchDoctorsByTime'; +var GET_CLINIC_CATEGORY = 'Services/Doctors.svc/REST/DP_GetClinicCategory'; +var GET_DISEASE_BY_CLINIC_ID = 'Services/Doctors.svc/REST/DP_GetDiseasesByClinicID'; +var SEARCH_DOCTOR_BY_TIME = 'Services/Doctors.svc/REST/SearchDoctorsByTime'; -var TIMER_MIN = 10; +var TIMER_MIN = 10; -var GOOGLE_API_KEY = "AIzaSyCmevVlr2Bh-c8W1VUzo8gt8JRY7n5PANw"; +var GOOGLE_API_KEY = "AIzaSyCmevVlr2Bh-c8W1VUzo8gt8JRY7n5PANw"; -var GET_BRANDS_LIST = 'categoryManufacturer?categoryids='; +var GET_BRANDS_LIST = 'categoryManufacturer?categoryids='; -var GET_SEARCH_PRODUCTS = +var GET_SEARCH_PRODUCTS = 'searchproducts?fields=id,discount_ids,reviews,name,namen,localized_names,display_order,short_description,full_description,full_descriptionn,sku,order_minimum_quantity,order_maximum_quantity,price,old_price,images,is_rx,rx_message,rx_messagen,discount_name,discount_namen,approved_rating_sum,approved_total_reviews,allow_back_in_stock_subscriptions,stock_quantity,stock_availability,stock_availabilityn,discount_percentage&search_key='; -var SCAN_QR_CODE = 'productbysku/'; +var SCAN_QR_CODE = 'productbysku/'; -var FILTERED_PRODUCTS = 'products?categoryids='; +var FILTERED_PRODUCTS = 'products?categoryids='; -var GET_DOCTOR_LIST_CALCULATION = - "Services/Doctors.svc/REST/GetCallculationDoctors"; +var GET_DOCTOR_LIST_CALCULATION = "Services/Doctors.svc/REST/GetCallculationDoctors"; -var GET_ALL_APPOINTMENTS_FOR_DENTAL_CLINIC = - "Services/Patients.svc/REST/GetDentalAppointments"; +var GET_ALL_APPOINTMENTS_FOR_DENTAL_CLINIC = "Services/Patients.svc/REST/GetDentalAppointments"; -var GET_DENTAL_APPOINTMENT_INVOICE = - "Services/Patients.svc/REST/HIS_eInvoiceForDentalByAppointmentNo"; +var GET_DENTAL_APPOINTMENT_INVOICE = "Services/Patients.svc/REST/HIS_eInvoiceForDentalByAppointmentNo"; -var SEND_DENTAL_APPOINTMENT_INVOICE_EMAIL = - "Services/Notifications.svc/REST/SendInvoiceForDental"; +var SEND_DENTAL_APPOINTMENT_INVOICE_EMAIL = "Services/Notifications.svc/REST/SendInvoiceForDental"; -var GET_TAMARA_PLAN = - 'https://mdlaboratories.com/tamaralive/Home/GetInstallments'; +var GET_TAMARA_PLAN = 'https://mdlaboratories.com/tamaralive/Home/GetInstallments'; -var GET_TAMARA_PAYMENT_STATUS = - 'https://mdlaboratories.com/tamaralive/api/OnlineTamara/order_status?orderid='; +var GET_TAMARA_PAYMENT_STATUS = 'https://mdlaboratories.com/tamaralive/api/OnlineTamara/order_status?orderid='; -var UPDATE_TAMARA_STATUS = - 'Services/PayFort_Serv.svc/REST/Tamara_UpdateRequestStatus'; +var UPDATE_TAMARA_STATUS = 'Services/PayFort_Serv.svc/REST/Tamara_UpdateRequestStatus'; -var MARK_APPOINTMENT_TAMARA_STATUS = - 'Services/Patients.svc/REST/MarkAppointmentForTamaraPayment_FromVida'; +var MARK_APPOINTMENT_TAMARA_STATUS = 'Services/Patients.svc/REST/MarkAppointmentForTamaraPayment_FromVida'; -var AUTO_GENERATE_INVOICE_TAMARA = - 'Services/PayFort_Serv.svc/REST/Tamara_GetinfoByAppointmentNo_AutoGenerateInvoice'; +var AUTO_GENERATE_INVOICE_TAMARA = 'Services/PayFort_Serv.svc/REST/Tamara_GetinfoByAppointmentNo_AutoGenerateInvoice'; -var GET_ONESIGNAL_VOIP_TOKEN = - 'https://onesignal.com/api/v1/players'; +var GET_ONESIGNAL_VOIP_TOKEN = 'https://onesignal.com/api/v1/players'; class AppGlobal { static var context; diff --git a/lib/pages/livecare/livecare_type_select.dart b/lib/pages/livecare/livecare_type_select.dart index 11c60ddc..13087901 100644 --- a/lib/pages/livecare/livecare_type_select.dart +++ b/lib/pages/livecare/livecare_type_select.dart @@ -103,7 +103,7 @@ class _LiveCareTypeSelectState extends State { children: [ _loginOptionButton(TranslationBase.of(context).livecareOption1, 'assets/images/new/Live_Care.svg', 1), _loginOptionButton(TranslationBase.of(context).livecareOption4, 'assets/images/new/book appointment.svg', 2), - _loginOptionButton("Pharmacy LiveCare", 'assets/images/new/Live_Care.svg', 3), + _loginOptionButton("Pharma LiveCare", 'assets/images/new/Live_Care.svg', 3), ], ), SizedBox( diff --git a/lib/pages/livecare/widgets/LiveCarePendingRequest.dart b/lib/pages/livecare/widgets/LiveCarePendingRequest.dart index dbe6e697..c8519cfd 100644 --- a/lib/pages/livecare/widgets/LiveCarePendingRequest.dart +++ b/lib/pages/livecare/widgets/LiveCarePendingRequest.dart @@ -112,12 +112,12 @@ class _LiveCarePendingRequestState extends State { // cancelLiveCareRequest(); }), ), - DefaultButton( - TranslationBase.of(context).cancel, - () { - cancelLiveCareRequest(); - }, - ), + // DefaultButton( + // TranslationBase.of(context).cancel, + // () { + // cancelLiveCareRequest(); + // }, + // ), ], ), ), diff --git a/lib/pages/livecare/widgets/clinic_list.dart b/lib/pages/livecare/widgets/clinic_list.dart index c008a7a4..c59d7ef4 100644 --- a/lib/pages/livecare/widgets/clinic_list.dart +++ b/lib/pages/livecare/widgets/clinic_list.dart @@ -213,6 +213,8 @@ class _clinic_listState extends State { // } // } // }); + } else { + Navigator.pop(context); } }, ); From da423fe12a05ac79b1f1503778d2661e787f2ed6 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Thu, 23 Feb 2023 16:06:56 +0300 Subject: [PATCH 07/29] Pharma LiveCare updates --- lib/config/config.dart | 4 +- lib/config/localized_values.dart | 1 + lib/pages/livecare/livecare_type_select.dart | 101 ++++++++++++------- lib/pages/livecare/widgets/clinic_list.dart | 6 +- lib/uitl/translations_delegate_base.dart | 1 + lib/widgets/in_app_browser/InAppBrowser.dart | 4 +- 6 files changed, 72 insertions(+), 45 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index 30ce29b2..b30ba215 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -20,8 +20,8 @@ var PACKAGES_ORDERS = '/api/orders'; var PACKAGES_ORDER_HISTORY = '/api/orders/items'; var PACKAGES_TAMARA_OPT = '/api/orders/paymentoptions/tamara'; // var BASE_URL = 'http://10.50.100.198:3334/'; - var BASE_URL = 'https://uat.hmgwebservices.com/'; -// var BASE_URL = 'https://hmgwebservices.com/'; +// var BASE_URL = 'https://uat.hmgwebservices.com/'; +var BASE_URL = 'https://hmgwebservices.com/'; // Pharmacy UAT URLs // var BASE_PHARMACY_URL = 'https://uat.hmgwebservices.com/epharmacy/api/'; diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 65a6caab..30c05f52 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -1870,4 +1870,5 @@ const Map localizedValues = { "pendingActivation": {"en": "Pending Activation", "ar": "في انتظار التنشيط"}, "awaitingApproval": {"en": "Awaiting Approval", "ar": "انتظر القبول"}, "liveCareSupportContact": {"en": "LiveCare Support Contact: ", "ar": "اتصل لايف كير: "}, + "pharmaLiveCare": {"en": "Pharma LiveCare", "ar": "لايف كير الصيدلية"}, }; \ No newline at end of file diff --git a/lib/pages/livecare/livecare_type_select.dart b/lib/pages/livecare/livecare_type_select.dart index 13087901..44b5c2fe 100644 --- a/lib/pages/livecare/livecare_type_select.dart +++ b/lib/pages/livecare/livecare_type_select.dart @@ -1,14 +1,12 @@ import 'package:barcode_scan2/barcode_scan2.dart'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; -import 'package:diplomaticquarterapp/pages/livecare/livecare_home.dart'; import 'package:diplomaticquarterapp/services/livecare_services/livecare_provider.dart'; import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; -import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/material.dart'; import 'package:flutter_svg/flutter_svg.dart'; import 'package:provider/provider.dart'; @@ -103,7 +101,9 @@ class _LiveCareTypeSelectState extends State { children: [ _loginOptionButton(TranslationBase.of(context).livecareOption1, 'assets/images/new/Live_Care.svg', 1), _loginOptionButton(TranslationBase.of(context).livecareOption4, 'assets/images/new/book appointment.svg', 2), - _loginOptionButton("Pharma LiveCare", 'assets/images/new/Live_Care.svg', 3), + _loginOptionButton(TranslationBase.of(context).pharmaLiveCare, 'assets/images/new/pharma.svg', 3, + // isEnable: projectViewModel.havePrivilege(99) + ), ], ), SizedBox( @@ -116,7 +116,7 @@ class _LiveCareTypeSelectState extends State { ); } - Widget _loginOptionButton(String _title, String _icon, int _loginIndex) { + Widget _loginOptionButton(String _title, String _icon, int _loginIndex, {bool isEnable = true}) { return InkWell( onTap: () { if (_loginIndex == 1) { @@ -127,53 +127,78 @@ class _LiveCareTypeSelectState extends State { projectViewModel.analytics.liveCare.livecare_schedule_video_call(); } else { //Pharmacy LiveCare - readQRCode(); + if (isEnable) readQRCode(); } }, - child: Container( - padding: EdgeInsets.only(left: 20, right: 20, bottom: 3, top: 28), - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(15), - color: Colors.white, - border: Border.all( - color: Color(0xffefefef), - width: 1, - ), - ), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - SvgPicture.asset( - _icon, - height: _loginIndex == 1 ? 60 : 50, - width: _loginIndex == 1 ? 60 : 50, + child: Stack(children: [ + AspectRatio( + aspectRatio: 1.0, + child: Container( + padding: EdgeInsets.only(left: 20, right: 20, bottom: 3, top: 28), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(15), + color: Colors.white, + border: Border.all( + color: Color(0xffefefef), + width: 1, + ), ), - Text( - _title, - style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48, height: 20 / 16), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + SvgPicture.asset( + _icon, + height: _loginIndex == 3 ? 80 : 60, + width: _loginIndex == 3 ? 80 : 60, + ), + Text( + _title, + style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48, height: 20 / 16), + ), + ], ), - ], + ), ), - ), + isEnable + ? Container() + : Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(15), + color: Colors.grey.withOpacity(0.6), + border: Border.all( + color: Color(0xffefefef), + width: 1, + ), + ), + width: double.infinity, + height: double.infinity, + child: Icon( + Icons.lock_outline, + size: 40, + ), + ) + ]), ); } readQRCode() async { pharmacyLiveCareQRCode = (await BarcodeScanner.scan())?.rawContent; - GifLoaderDialogUtils.showMyDialog(context); - LiveCareService service = new LiveCareService(); - service.getPatientInfoByQR(pharmacyLiveCareQRCode, context).then((res) { - GifLoaderDialogUtils.hideDialog(context); - }).catchError((err) { - GifLoaderDialogUtils.hideDialog(context); - print(err); - startPharmacyLiveCareProcess(); - }); + if (pharmacyLiveCareQRCode != "") { + GifLoaderDialogUtils.showMyDialog(context); + LiveCareService service = new LiveCareService(); + service.getPatientInfoByQR(pharmacyLiveCareQRCode, context).then((res) { + GifLoaderDialogUtils.hideDialog(context); + }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); + print(err); + startPharmacyLiveCareProcess(); + }); + } else {} } startPharmacyLiveCareProcess() { - sharedPref.setString(LIVECARE_CLINIC_DATA, "Pharmacy LiveCare" + "-" + "501" + "-" + "7"); + sharedPref.setString(LIVECARE_CLINIC_DATA, "Pharmacy LiveCare" + "-" + "501" + "-" + "1"); Navigator.pop(context, "pharmacy/$pharmacyLiveCareQRCode"); // Navigator.push(context, FadePage(page: LiveCareHome(isPharmacyLiveCare: true, pharmacyLiveCareQRCode: pharmacyLiveCareQRCode,))); } diff --git a/lib/pages/livecare/widgets/clinic_list.dart b/lib/pages/livecare/widgets/clinic_list.dart index c59d7ef4..62f91fcb 100644 --- a/lib/pages/livecare/widgets/clinic_list.dart +++ b/lib/pages/livecare/widgets/clinic_list.dart @@ -572,12 +572,12 @@ class _clinic_listState extends State { .then((value) async { if (value == null) { Navigator.pop(context); - } else if (value.contains("-")) { + } else if (value.contains("/")) { widget.isPharmacyLiveCare = true; widget.pharmacyLiveCareQRCode = value.split("/")[1]; liveCareClinicIDs = await sharedPref.getString(LIVECARE_CLINIC_DATA); - selectedClinicID = int.parse(liveCareClinicIDs.split("-")[2]); - selectedClinicName = liveCareClinicIDs.split("-")[0]; + selectedClinicID = 1; + selectedClinicName = TranslationBase.of(context).pharmaLiveCare; sharedPref.remove(LIVECARE_CLINIC_DATA); startLiveCare(); } else { diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index 95e1e438..f68738a5 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -2878,6 +2878,7 @@ class TranslationBase { String get awaitingApproval => localizedValues["awaitingApproval"][locale.languageCode]; String get liveCareSupportContact => localizedValues["liveCareSupportContact"][locale.languageCode]; String get scanNFC => localizedValues["scanNFC"][locale.languageCode]; + String get pharmaLiveCare => localizedValues["pharmaLiveCare"][locale.languageCode]; } diff --git a/lib/widgets/in_app_browser/InAppBrowser.dart b/lib/widgets/in_app_browser/InAppBrowser.dart index 4fbc41cc..96eb99cb 100644 --- a/lib/widgets/in_app_browser/InAppBrowser.dart +++ b/lib/widgets/in_app_browser/InAppBrowser.dart @@ -37,9 +37,9 @@ class MyInAppBrowser extends InAppBrowser { // static String APPLE_PAY_PAYFORT_URL = 'https://hmgwebservices.com/PayFortWebLive/PayFortApi/MakeApplePayRequest'; // Payfort Payment Gateway URL LIVE static String APPLE_PAY_PAYFORT_URL = 'https://hmgwebservices.com/PayFortWebLive/PayFortApi/MakeApplePayRequest'; // Payfort Payment Gateway URL UAT - static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort Payment Gateway URL UAT + // static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort Payment Gateway URL UAT - // static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL LIVE + static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL LIVE // static String PRESCRIPTION_PAYMENT_WITH_ORDERID = // 'https://uat.hmgwebservices.com/epharmacy/checkout/OpcCompleteRedirectionPaymentClientbyOrder?orderID='; From 4ecab57173caa2374e21e9a9c07915ffa081d072 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Sun, 26 Feb 2023 11:44:47 +0300 Subject: [PATCH 08/29] Pharma LiveCare updates --- assets/images/new/booth_image.png | Bin 0 -> 16367 bytes lib/config/config.dart | 6 +- lib/config/localized_values.dart | 12 + lib/pages/livecare/livecare_type_select.dart | 20 +- .../livecare/pharma_livecare_intro_page.dart | 207 ++++++++++++++++++ .../widgets/LiveCarePendingRequest.dart | 85 ------- lib/pages/livecare/widgets/clinic_list.dart | 7 +- lib/uitl/translations_delegate_base.dart | 12 + lib/widgets/in_app_browser/InAppBrowser.dart | 4 +- 9 files changed, 258 insertions(+), 95 deletions(-) create mode 100644 assets/images/new/booth_image.png create mode 100644 lib/pages/livecare/pharma_livecare_intro_page.dart diff --git a/assets/images/new/booth_image.png b/assets/images/new/booth_image.png new file mode 100644 index 0000000000000000000000000000000000000000..0a3427e420b5aa3b76e871b8af7d66027f1007b2 GIT binary patch literal 16367 zcmV;w`5At68#5;iTHvI-Q+o*i(# zwotgz-fEB1()Q@3i@icwVFn1f-eb4WC z_pn3$!N*&#zZgt$x&n?Ar=&PjBqhcAbfgG>hcEbW=-P?a1Ha`z;VV8z z^N~y@g`b0igLqwsB=CJa9+yNS@xQ*>kLADdlRw+v^Ev!^U|>L8F4xfe^LPA6CKJ|I z{LKI1=XiWjV$rC?V=;VoAzuGr<;@^2F=3w}|{{DXPcs&4>H+urGWCFkqT?DT|uLJ;Cfa386+@!<+gdQy4 z-#RS&X6*yvvv~kr-8~WpP{)oPlkAK%0BfEbS74L4B8LnB=x|@3#Be=XSy}o?P_r_9 z3TQ@phNPu?LYH54{m7vH@|Qmk;=}`9j~6WTiW7jPrKRKhG=SjL>m(q&!9*giC#pA# zPqKucPN#F|d%dFl(f~hW7AO$B! z@d9MhHxM%-ivLOq3Wh{)05{-rr5ax1;&Ik`x{ZxZxXFk_`Uj-DE3B;bdR!94&v+?u zIa6hzKO%$iBu?EY>1k%|D93T$QiB}p-C~$=ZMKZQ}0$5?xjFACLD$EfLsR}Yu zRRI|}7_-y_4v^sDULuix>4rE{#3PYD=>folu>pK-7a8owHM(VU%^p14p^xdqV^UL7 z0V04TpqALDlcl&$kH;Ol;F8Nm2KD0=p9G!IsZN|aMIzmuDt!LoE4l_+kM?*|nn&QuS+x@;-8zEVwq;kX`Kx1Z3h zCv+@T2#H`+g~-v+QQ5U^vm7`agm5`=4KeA%!SgO?H!?EPB@>{ggQWyC&FdAn#~V8L zf{RB6^~2AX1|2Eh0F4yYQ-;?KrVbiCiFcn;Q6M=PZo?O+S5i{5m09KkdQx@j36&jc zJSsf{eG(|E1Zaa&TX$3@j2#DdW(IMI2 z^fjJK_S?pIrh5JUn?iJ~e@qv%5oc~U*01?OKlGN_+?_@`h)I6II8 zIAm*%FHOSz1l52%t~6W57yDI29AJsdo3CQ2Aglf~Of?ug%%aT3>_k^f*ge* zj155DK%K-O?z~un#lzqSU*82WFT%l7?04_kD?4hoD5wONM%3#CumIExhUzCkbwm8; zEj)i@P~TnhRPb0!PoTXU#sdHqjSUj+X_wNfaSH6`%RiT9{4NUJOhZY-O<-+6J$S!VcWUUY1?P?o>Qn#q{a|NT zcc7=I5B^$A^7D$Nsqq-ZI*u1kk%F9b89%02N=u3)x3F6Bi)UDR6t}^PrZ1~ENA@P= zU|mqMbF!oqhZ77PmjZ~OANu%&$Qie&zrR<}=pRVpJ@dgFw{(Nm-i#~&kt(mh{;F)) zxK4qhWgm>iRqyo=^n>Mb08Nj>cpVBLex{L0b$irOkAty0bm*YEQj{qC56tt5-=8B_ zUUj9El$1(OM?2iBe(~kx$!17JYJAsWN~!Vg~^!DbQ~)N^w~C{l^=mysS(z zU|A29zBW!Avqihk{x{TK=?6r(s+5`q3=k0a|4(SuLc0F zS+iE^kJYKvk*&5qrRC@AyHnkv*=Nrm8Pv~LE(=2M1dKnJfF4bes75)41$2tZ5;v?W zZ(wX8qK!0U<4%PrYqW&Zg3cm4$zZAgUgYr46FC3|1PN(q>y|d? zsj>pUG`Dw4MQI^iG&u2mz9*eNnX;t2FDg5a_KMS;E?KVF5UBgMZ;{C}=g1NGjxW6U zg6dEWO6YqE{BpdpO9DkX_rZ7=Y`M9k6FU_*vhGkyWXM7FXk1St?Jn+B+3MyYeCpTZV;yw56-lc|(ucJ{E zK&7ElKh@(2oiXp6k(v7Wr*AW)2&m2hKu%a*+HsqiG*$%BZCl$RwvxfL{sh&jY&z1? zBbm_2zO+<{^!7_(c80Rb_G@`lJ^gVx*bMg!(UH^Xmh_ZiPqleC#VGV3h;(jBE|TFE*ZoP*0x6ALn0!BZY=~8GCZluPbNzES_I^HmqXh6 zJa{c+yHWtEqfaISRDLjFl9`z$jR3V1F*|)l9w-l+AACN=kb0K7-WWaeX*_~KdE<>& zrJ=qNOeM3tQdU+1QO{O`ONO?$wX1|>1Jql;b&Iq%H7JR)a|=}b_w3xRuT3RPP}3Np zK@DUg7m%5mK04=r*|N8TxM48WSaXUEMU~kqJGbhDTSYO)wdn5@WR1tI@4+~V`SGqe zk`P`sFvWhi>ST}Cr#Hlp7<|I|PM7pV0jLHSxabssT9v23P?R&^r#3Y=Y3`P8j7h4T z0F;l>n^sH8D^(Z8N*N|)^OnuBdDA8wx={m6+>q_ORz^$AU^zjK3}obPzx7t+AOI?j z9emXd8#hYL*3Ei2%w@Q7Fk~o`K-t;MTKPf?&KpHUMNlE?NK#Yvlk%x54!oD4sDzBQ zlGkeSRpiZ$8mkIF6t`z`l!Al7zvG5I-b~5OtFSD7LRwqvq_Nv2T?2H|0T`mRbbvak z5=^BZiW{cLHa9n`h!Rx$gOWmhI3(_B-;Mvu=h~{^@WBJJ{EOvaX_`tGGfpIgNe`Oj zHnL6X7T$jAZASbpP}i(ohXdK50RV4|dX<3svJlDn{gA>efO^3wbSe@m(1`)s5*i#A ztUt7siX4F(sst#IMkN?MYKNzM44-2_wLv#v7&h^yD2`MEt$kkUjoL1m6HJW&)LbQA zb5oO)A|7ucsEFIC%ao0l?i>mr^rg*fQ+E=4lj@7ezI}TD>K9;Dminjk0C*TQW_C!; z*G+S~+$Y zW6`*lQ|QMPAb;B1gU}A|#7Kyik0-0A3l{5FFD{lA5g9GIDSVy>`jcWszEkg#Mta|j zAn5NR+M+mi$1)`nr{BoOIK>N{ILSFDg#E0$|?#YB+@ zx|GRkhPFld`I48L7g~71C_r7j_?cj+zA+GG4iz^~f6W2?*wEarqGk91Cmk2TkS`YP z2WTeB@n>g3k&}TAylI}~=Vq(e6c!dpetrq`P_9~Pit@Vk>)~t0r8sbkWagAuprXnE zP$!fl>Pn`_rnReN&b) z(fW^qjV%L#0fd-d=#T;*lF=R~#E+2-j0fJJzdr`Um5_dv8)zs7V-ZP2`%v$}O#}EQ zSk#%*PnJS}N`O;41#H0IAhE|wk&e@}2(Z`!?kr_>^R zoiXDSDaFB4{M(^ZDPfsedGgV+Ph{CAA8WpWl1fnhAVwZUzXS=Tg8Y0WsYj7dZ3{OB z54JP~HZ-(JMSg{p!cdGWDo`<|4s@xQn#!qzg*Qeqnwi2c;yBTGzr66$t8(tSi=?sy z3G5Vxs8AhFJQg}y9ME?P8FjWpLan_BWg%XCT}D2MUImp*C8)CjYHM2?GVbXr{x(Z( zHu7g1(63fm3E+VP`(+h$<0MoNYHGGY9UOweG{s8lR~Gat%ga&F%aH4@`v#o<<9Hu< z2_Vx4AAKYre(=5w;J|1n=tkxEb0KvFQdU|_)i^p(U){ANc(g4M@MoenlwU2CnQ2nw z%a&LoDy;)Z9;X$8rN-H&+vG?vV-LM4D7Z-~6526&?Um={k_*m8daw*~3MRt?NOAd8 zZ3uu(NkJk7tfy-eY70x31u7HYu6U1BBWFt`yk*@gnSB<-zqLh+Z}ds|VVAN09*8zW zZSeQ)+XwOgT$Xyd&o?I!mgG(RvBTY^{YV$Ch6SgQJbm_DlxRvc zs^e>Pw71CzOO}AelcAzqat)Z;uAnkWo+IxrT`C{EzZ3~2fC>UI5XnRM`u`2;;?>Uu z3v;RiRrvua$wrZn$>0=Z#-okW7weMp%<%v=LsA)s)3pJxl0@z`3B!g8YAn_%&;0Ri zx$KgQWYU;S=%a{40cg5Ai$@@XxI5OOT&x`6HCnm{P)4D9W2Ni|x;0lo#%-pdI(reU zf3q40x;|gE_QQYvU#=EjgE`o35c_i%ov+z3HE@i$pt`zRTIJ(cUY5eZ81cfg-*hV? zs^)t2a#+}W@4cnU)F{N?iHHx*KJ+O-h4`12mVl|F)Tys-eLa|0k{NJ03Xna@08{g! z=#tVK3rQ!$baLTj$%hlqG>iHI3FuM%3NIjmCIw{h|McQg`P%ujWL!DL7_}# zC=|wNC=y{wMahJIaBDaP&oL1eMLrSfk}{+d`I?*780+7Ro2TykM}Df!)US#@f8M)q zujc`wmO|0V=A!Wa|6Ssq|AR{&c65sY9Sr zr;fs<+Sauq*xTm}>^;^lxxNA!>#va945x$#dZi1sagRG&#$=i*rvswwPPEeG$UqW0 zv#$o;L7)8PwT*J&dGlm^RW>qO>0l_MB_vrKnd+J(_`H-%#A`9>>UT&uN?plA0{i>bjr0HR!B>JkgULW@ zIug;6C)v(w$@1c2a9SOGt&&VFkV$!CBpv$EJBaE)vI78sjgAV5^&S9t3HjY~>*V6| zPM7hBjNC3HP+-6kk}hsXCwS|Z!IT`N_>fnHC(w%suz$b`X@P1y+$P0&1T`TWSFe=0 z^A|}I#Gl7A!&OO%(kBz6zk1hrEWr%*J6rnHS-h1xU z)SnIN+wZ4}Fwqkzc>KT`oO;o>W(qz(67GhXYA- zhCyh=-L7J&0OSMcKH*@H5tInKek_qBs3mz!x={QH>OyI3Y7svi?%^)g-vihFo$Vp; z>+U_fm8lCCE*b)rYJi~kba%^ZFTI31ekPpxLb>-|f=Z?$%MYf${mwh`5!|Xlwl{&P zl$LyepATS5ii$O&8WmHY+xnYeM~@>ALG?5WYwk>D$q}T(kXDhxtV)?yRV}BKPC(fM z8FUyYTJ1PQI@+^KT!Re~OJ>URZ*G+f7M?C8es~24WfOQ@MjDKdvq<_=3ZPHnx6;SO zYj&Y}IuM1QOPRz0DN}QO7E@Qq+y&=q8<8L74eHc?#K^Dy-VSF8YE4azoU?G@5JUM5 z51^Z%zVHG>9Ucxqz5m|36;!PdKqdU`t+!;^vSlj%Oij|QqmK%wA51L*Qz8DN(W$R& z{+D2LyEhPX=SX93yQD(j)%7+=nXgpx(*sh4H;?zU!Xb{!)n}XwK+*jNV>Q@!K%B99 zO?7Vp=C%L#yZ4bI1`}3Ye0I>%ZvpMtRHL{NFu>8h$FKSHUph4lJ7?y z3;(up%?de#;@{Lf1S-K89{+zein4#UGf;c>?2(!s+hxIm1z!?>o2jon|C|~sMo16b zd#{438UA#i{O#?xhd`zESDgyc2ScR<)*p2(fI5nZ>R;b^I2g?w2=ouQr6rV*Tz4tb zb1ib(l$q$M>Xr{y{Y7dKA3t&3<8s~E7eg#E5Ye>AKzKW{B#kgeS@P<#9y#;W$x@Mn znmn{@|Bju$4^}hR%q^_4VgumXj zOnLLIx8>8%z*Jg)q%*USKTuFLOr@d93!Q)AC_sJiFE<4%DsltyWV!@{gHn=SDM>ey zwg~P1`oYhUrEh=%OO@Z<`LxWQG6`Z`j<^`c2fz(>z9!LRhP<%ME9cCG`1_h5N{G)B zO%Nf};$g&?eRrjn$)KZ3L)(UMIy`_(lSX8cd!R!qp;PIgZ&>w(oVDiDWizrdLibo-B3Y7Fqn-F91LgY54*SSEAgEc@0Kd~sVwkqT>XX2J?C5`sawEQf@+#D{vN2qL)PIg)-Hg$ zcHIWebY&rlLW9VRnl@vgP}tr^cP$rHUY9)n_~X*jP_MevjRN12C2z@RNI$ai*MLg# zFR+*jLxqIO1s9IOPknpsi@^a`G?13>mnx}{P;V?|9iV!b=gHSz8s|rM=!!Y5H=YBz_6llt&#~CBG)whGEcT2 zccY?e>PD%IT98i-6eDE_k=wiupw2ToH4hB2#ore1;o$vUrh=CQbhAy~h z6re8I^nCEWZI1*xn=vHeoQB+Jm(+LHN^ZJS3cX|H`b%$syU`~pEr$^QH%lelrc7Lb zJEa&bEd=|V@}GY`D%W3qiBx7or+Sj8I~|8Ri;)nr5~J$>c!o6-6>7=m;=ZmsOj>`>u<=am0wum?*gbfLx!pdUJxRy(SiEz z_LqW7cmE&|?P`!iLA37lpk5B8od>7=YYT3YGp1Eayki&oOb_DZn zO}&Zqx$?7Tcgb~EEOLZ>l{*6*lSoD7~mAPIscrk1c1EAKRcE1gVipgcuzJpdxNCg?nl1&0C zfuQCh6L;$^H%kM0r~Gi4+#t#;ue~m-SFKbd%jZyqP-3V$2r8L+;l&q?T=<*!!*Rj! z0STn1*Gm0SSm!2G01}0A{=C~|Ec#NN$T|%)*GRE%K+01)#er0yJ2g+T+-QYFf;t8R z_vEw9a^>Y0%FN0G2y4p`g|)zcZ4p=IRJ7ED-~(nNX*~rZUn-l9c%`|=YNdgQ<)p@B zLKzL!pll&i0qU{(dfY_GkV`e(x_>p9q7yFG_zoYp4YhlAN9Q6UW6uCp4B5&~Ydf+! zcI>z;ns)|rt*1x>+SGHPGgHCTmtTEN)~sG-fr^NV;-3#Na|x=dfzg5b=;C{Vds{yX z^bZCRhB~CB4VnFTo;>lL=cFy!1dy9#@8)%K)|iCMoLH$hT98?Q^cW(Pu8<6%g8B4| zZF1$6m&lANG%9#XB+`v&%Towuv}=kj>C6^y>UbEgBH4l_qsA_@eX{`!v3)K;om6g^ zx)nNg_Pj+>hZdgV;u6iL+Lm37m6lIX)?o#mhc4$hEb%qXj4| zz1_VM4kKJJ6Vg}{a}Ubo3LDf_a{Ac|(Slj8O}PZsW~nBc2`bpQWBq5+uxE{&Id490 z9=aQ%&HC5YjVs~b`ZZghiOfD3%uYbg9`vJV$u8-(jy^f{oNFZ7+a$F|4oZF{YHNjs zQjE^;mtKAq?${bNRCKAx)O>)N3#PJ|nU|LXP%jx-{BODc+F*Cq-ax3M4oQ$6*;fOd zIsrAL2ofp>yfWjo>GHsX-$eeZ4|%5?C~u7GIJ%_2?EsP^UE<4~@mV~c001AFNkl_3O#X| zR_Ryq+`0jUzq8Jf`ugKiga}4Kr4izcl$E_F$UD|8li=o0(YXK`pD>zrSAF^x z^dmq;T`3KHSj?fa=twE(k8-3aDovdOGXILZq`YdZGI#%h16pO}A-?qTE3$t5T7XZc zGE60?1s14qt#ZKBua5%MG1q1XJ9~Qq=}7lwqfXawBq>GNX)>|OBfD!*r}9Q*{Ma$_ zt*dXAnG?oJCd4@_5kvyJ7B_?*rO1H%;gweT#uevEdUUB&j6Fje86>h7ZW*E`r~^le z4@@nAh?dB*T}f#MsLE7;TI5a0NmcME3F>;o)Z;KzMG$}bnCuwRp3-5UM*F&@zvYOy z<9+x?7)vs>yF=D3|3Hcmqv!auwCzWSDp05D=qh$6zXd)y!5hcSif$VPKEWiLB(V8a>3NmfO^wo(}Tx5I|24A7VNm~MPwkQs4Z|l5qsKHuo?5(HZo6)djLF?24&O`! zwcT*JaKiw-r@tM^7{6qqyyAk3_QhVO)VHTlNscwj8Ycg*kL1tXc0M3Q_k(k-1W^|Ef+5|p0(k^{?5eLaZB55%k?HK>Oe+TqFE z)a*)`h-xdVys4;a6qS}~YtQp9z9btrtUm!Na=NtsG

O+#G-Cl1slnviL8$w1XF1z;*$g=|obZlzu|MLd4mzN;N^(NL{}2eAs(RCdHt|1yil*7gX# za^jFf7|p0G{PeL$<)o8Nk|sF+#bp&bfbskbFClP1FBJ|$4HZCT);|XwDyXCa)a=kD zmt8tCsPn!JP%}~j1%98bTYUu8&=l!GJ-;X)ImhBLvghDIgp4TH`rOc0rSg+oACpY9 z_;iNbkpqb68~*x_pUL%CoGDWRxEMDQ)5&HO=Q~ZA+F4=L1o8)HS(DFq^+;_S2Efp8 zL8g|W;xKb;uGaDiD(n6%rxYrvCi6c$qB4;bdj82;f~zyBR1d6sC7~17$)}%wrn%b$ z0OVsh2&Xdw8d1>$=#@FMX39fo`mH~DSW3!q-~jcx7hXgOd!x4J6I50o7^c$tYgvV$ zUOtL3%30SH1&d441MSEArR8{726`cyMNYZ$iW`x-8<3qSPi%niS6+&fN=FX>fVuk{ zx66b;HFBqz4OGiBwjW;xP^ zq&1kz>B0(lMKi%vmM{qF9Dv%0*uSv2)N1Sea^3#~OAT}F^0Xbcu35VpNs;9!>$r6S zM)L(^HD_1p(*oQuRKb*q)$)T!9+6P+fRt4Qz*MjN_3wb1i@<=OB146*{?MhP0rkuq zi-VwkV9RI6W%|r%($yZ8<`~9yFf-NN-znX$Ht9gEKDF2>zqtDkGA$n>gL$W4z3>zH z$^E}XK46lp+O%6{PO6gZbO#KB)jz7dVI31SfAlJ4rD5h1wf5yZTBQ#2wv2Sr0c<5e zodKqD4u9*$wP5OeWvUT>(@HtKnL@>$lhSNDQx#x<(#Q%C7X8dmKZE%55ZP$PI+#wg zp!3ff3Z~06vAPlol^;so;r$A#8aPW)8XV%q!%E`FA0kk8Wm^ z|3gUdvPqZj2X&o_B$&ajz%VA5DMBo&<@?iNK+tjGjL8ZxwYH5@)@Z1O2T%n=IJ4S- zx(%S7J{O>(L|p);4&_q`o_YYL?TBA(pocS+;=OL|8d{cnQBYrVyc4b&kkL7N0yY9Bj~V(daC8 zP)E?@#cpi2)D&WBu&fX{RDl2S=AhKI#WZ=Hi84l27Q73BN|y=~ey7hpTMbDrq8v^E zl9}un(GF;Kyzsway93k&}l7gwdRkC{JY8}+&XgV3nSyW@>kSDd8mn%vN<@?|J zuGAem0qUPHW>m9n+m}IwPUYC94eI4rjbh$^`c2uv_I-VUzHTryePHJDT}P#%6V+CHpMlRYSt)Y*cmwLTjq4TEqX<(Y3Dd&PYa;vExJ&1qqD)pZ z!&MzXxrPSGVlGi#5Ak2QYPB|(@$vl#qs{Y7kE-1X$Z@2Hk@~AUyjMyq$Kn7z@+Xv9 zwkxO{B*CB_n92%-8Y(1J{9x*+K%H@oC)j*oFc617M*|v#^^ZUijVqrZmDTCe9yub@ zr!JJQ&%akbUiG%z@U;iw1A4WOF9zR{n;}-Ab@8;*PStK>rUKdL>H+J+QG|QYiPWk5 zr58Xf-+NqI7~Vqsxh0}Ho1n7Y2;vXRJ8SM)Xx%v|+x8rRe{0y!*Q0)Pm7XT-&ds^6bAI#APd9YF*d0pv$?35^5q?JPvLf6_F$?aI64`H!DO@?oLe ze8m%LG?@Hl3Qd#0;5FIG)=C{#0Cs#GcKw+?LH-+h=aJ?2Kn=LzyDr_lSB|%%7)bGl z^{@7)$m|KjKt1D3*|`UeyQ{aL=L$^%)=0a?@n9T9nFpDKINx*kx4W-35s zq8gD}=!&ba8d;}4`QrzJ$NTF8>+3(1Z=Zdi%&49%n-6S)gP)WIi>{Mjzy2e+>ij!p z)=3w9sR38#0jw5F(`#mWYse~kj1)`lX|?*$^oDR~OE>RBLm{vvCglcZm%)Uzcy1CrfO3K3{@`0e>9*T-?cv2 z+SMHR+0yUG&2#USamBNs4+o_ViQM9Gr=S;}S#efBt% zsu&i)N%>&Q0cmI-(1c351?rp$1Qp_Mfl5Es4@0#9gS$WY{zG#8jW^2!-+lOm!>`#V zvopo^0_;ZMwX0Xinzd`S4U#)t46rEeShE8p1DQIus!YC%fnVy>GBk{^&i}_h{Rz3) z?aEZ+{O779Q2eRd{8?F{E3dtJWTrOmuL+_c7TDidgA#Kw#5!N~*fCgOf5k*8D5=z@ zU(-=yfTaJaBR@QM3o#?^HlX%G8S^`3EdPV9et+|RIo=V|Xo`O8c!>X;2?fg38n`p3 z&6x|A3YAb)4>qh@Cy)N~_vD)EzbOxV=le##S|O^LIAO#zJOF^7s-UjZvNIXV3M$2) z&oh%Yh6`gWOXQ&kAGDYXPyyoNKmJ*^b2v?zN<)>a_kHV5|v z;f`S77p*)Pl87Mp$QNzkx}lP4$ty-&Yz>In2&n+!1}XkV0~o-E18Xx^|5YCZ{fqy9 zf6GB>=-@aHtUo-62{{f0l^_w+S*X`H^1c0qvT5T6dE(KBFU``4G`1^9+G20<5JPxTl~jAqHu_^yQNbN zsIdAFf7PkkzR=azT{{X;YY!k7pAs-L_yjeoeqS@Xj@@}xW|xU+q|}?@Y1_p&oyMbR zTdj&3L*WMv4J~$>nO93u;HE#?2JweWg(WWv>iArToG}qh#lS|*)-4Jund-%~$RKye7I+^i{cH zY227{c@VKbBdYQ-)c`eB{%7%G*|BryP(sBRD(Y0zQi;*a&^NBXZe&o~js`KBE&&2X zG2vPx#^J3PF?Z!wiXUP~V7|mWrKLgAhL8XLm4_K(4>8#62Kc1rAgn)}fA)lusQ`8E z#3I#w+qZ0m_|Mi>N_R%CY~8X&o_zcVa?#hW1gH<<)sRVm%3!|$eNUrP%?>KtP_16^ zIg%=yw2Y%nRgaaLwT)K8^O^&{C$rs{B- z1?sgoTt70X?RB*PH5uSV@k9qKrnX|`h6^K*+2|CZKBP$4n$m8ABw#vZVPUR1mSS$H z3td7-<{CAoj9*q01XH7&o!6|Mw(Df&tOz5{A@*n^5BRTJ) zOXZetKcK6d%y1dPT;xkB(u|mfJO8UuVqS+16;^}^C|{SKd`bsJE9q3doO1*jdN+8}@!0+oYV%WG`5d$jADezq<64c4)Apii|x7En3*{4fA zGXI0l4B3N)2LJKok7d#Mm&na`JYd+Uh6;IJH)fwuhq4)~St@+4flghscD-(uFyc>8 zt(JPSRF^EoWkU5BdGP-GApQrWd@PuXpyj`x1*p3$@rO6Sh{|jiLh~;f3qSSx8*dny zsWzxO?u`@WU=}Cj+Asj-DX78}2dbf#?AwOPSaNHPoi-|%i9CDa+1}7&Z->-vJC>*L z1;W&3tZQ*4>JREn+0nGnD{hv?BymQW%Yj3{Os-~KJ z1Ft3BgAx#?SPWy$0-Lp{+i%>oMa$FNJ~>EGu>;Gt3CvWH8WXCk(Diq}rv54bD(Uh2 zXP=c_yLPEfVcsDd!xhx2LrnGgLO0xeZrY{Nvh7ssV!PEkK@;JyD>j4n$aD zY`aLt7@5uw9pOf(w{Y}A3_AXCqpQlf@u2SGg@pkiZC zA7cOg=-+?p-+m%<(Y5l;+wRfVr{OW7pHVjHU~Cp<_l*aTKr-bE1P?S5Xh+A6D{i2) z-7s69@~|h43ur54UGSh(DyR$O-oOVBx5O9{;Q6Eo*_2&(6wFj+`UDf0iwHfL)Y*km)@?m*#bZvBXofQc1 zclHGK>V3!X+Hh~s#?E~$6TsB7rP~=q>a1DX zOwoodPDc(Ol;8g1rzl%5kZW(bOP}9{!L`+2EJMwIfkr%LD40@&b|X|#m%RRp)P@?> zX}7(D2-bX%C_H_73j}q_#Bp-pJ$FO=4@m{87?gtF{_c0O3p-R;%VL7uj;JX9to>&J z)LU-**2qk4sXZJ7HUZ`%$3S+mt1HxtG1R!#4Rk->(+lu$aS>R`8g@Yd^cCfY5T06BIvD3@Jxqh{Bb;AuQoEARa6HLMG1lCcx8U(g!( zC1RT0V)Ye(Qm82Y_uPFKD#id6)}Pn^%x}R|>Qst9KqXUcol55)%WMGZt)l}KM;J(2 zOI^8=gRL_y;Q>^b(KT&?Ax#w9F+Cd?IK^jl6f-(Te-ccdI5R=&8Gz9=e7eLE|4u#I zjY;g!cQs(}D_fJ;<1o)Q|71*6>)RMTS$i}j&Ao9sR#z)e{p(|BuUsf+K?S`0++z9h zPya&`&}`>93Q%eNd*J?cx75keV=c1gi;s0sq7acFS0Gb&+d7}S3%Ea(_cXD3tlV|i z9bhWNKQK-~efl@g$ll$%HOD~pp%E3jU8qxYF?W>(m+IDU-!@86lK>UDQI;FbY<#aY zz?clU{knyMVrm$PXvPW$6$LB)SDgtQ*`#a2z+rBcst4+0qtoaatUJ`A18np)1ISX% zKdIapI6RLBup7e=%hztiLc>N`_Tjr&E>np*S-VU>b(Rk5+S?`BeCAZ~M+F!l_h3#c z+}nwaKh}XJ&E7wjxozpPS44TSjBFB^dgtx8%Tb7bCB&bS_3PjKM)qR5g<(3M`(;oe z{s>cV8x5$R z?!3cTe=wEd>#v@E8ldj6m`YHGi$5bPfO^O6BQv%6$N>eFr*D{w#sjp~G(r3#=%h9u z1|+lDmyQ6k=iCI$%@1rdAGS=9drZixF3f>Oz#fK(X#h$$O{kh6yyzn+nT#ow6e+=5 zoB``^+#bHBLqUD-qtCHOv0c`#SO%v%7wikmq6;rqDbU^6G?=!_hOgAg^iDK;r9lVg zwUD7|Ysb{$Q0mc06f;n#oIFkLg-$&RP^-p{*TUjcPyH7Hj=iP>8`TZER7R&7mns{6 z>bLK@V`Na9g8PGx1VBZDf-)68YG1e;ix4}}`eSx85e!ZmbKex#eUQyefTSTGO2?Y+ zKb>l_-Is~g!$>6Oz$s6|iV$ka2-9z9Z5+U3dE<0_+6Hqlis_e9zeho(A*sVw;IY-? zFkP};mI73^M6O-=iPp<#JkPuM3ggDHl*_|aRed5aVf&-T%`?rw^u61-=oYVU)Q{P< zb^6R1nE1O#BPs)GLY{cyF*$PN2woJG41mgE4%Vn_Kb6-1j=S#~1*nGsYBC<+(1Au( zc=HHA?SNkG4x_#U1~7zU{xel4N)XLp!2(4tiMfBWRoB#`oWel~bY zU8`jOkN@c*gsHnUiR4b>0)+x}uaa@h>YKx z0ajPyk+t}3JA7Qe4?#V1&Mdj-E{H!;f0YCkjDGUR4?w5x#9|0I{&}TnT&qMYD3jA@ zs>sVx=l_m-?->QC2lfPUtIAX=d4d|oC{HRTr(GyTo86<<-f0EO?B>@!RQ!p(j#~3K ztBy?kZ?7sgu9WS!^6MZfgRIBb)$W(p?iiZGs$||N02L~NBakOgpN^58&GP!+-ql0U zWr<+1iHg|Sf>{AHO3?Bvp7S(n}_4zmr))W7uYA@U>~wj+oTIFhHOvT6tD_oO%ETT$31P!vzBjOx|_0f+2gc zrWw;NQ)bKAr%g0rDzfgUU`y{NF!klv-&DW|9OHN9B=|nO26nF4TQeEK*<~GjF`0V2 zc$_(W^M@RC!yEpi-Iy_DqFjH&jXLYqbi7WAv6TD(T&czX^9o^l>%AO8YOxB2k$nuW zJpU}(-al1hm>qwaI$fQ>z;XnG%OwCFEtjF&?jD6st>0G@1Te@_5!5)uVZW~QD4seG z4ZR$pWUOyQ$*fN@*>eU33MgX{)nEJz7FLpltX7~+Zb0!Qu*+W==+cVd}N)vf9=P?1a?vnz}iQ!qMhzg8v0OO1!HxGv|f-ECF$QQF?l~d zQIq+h7eGJ_OYO*s&$Ck0MyIMiMRfr?S9;r;q`k%LNTn6O__C`dADz==)^60@$4{PW znl$vSxGWT}Mb%v64NsJ9BV`f!hbXIFyna&rQA7{ zXeZAciku89E&mVSYYK(;X|dP%hDJr$DnP|h8EWn4qanmxRv4|A-JPvymO#wTKNtfC z`{GOCgW~;}QTpQ3kLApT7ii-IKlCs0FnVJg4;|kRpEndbhO$c|=JlJD<&-oURrdcg z=I3^vBCP002NU&bSp9vx_m+bGtBJj-{*2tDMpJH~b59{<$ zHUX$?vSZhbu8f9SqLk>81vKM>aj9219ineokT{{FYfNd z0k$_wqPImR2FlUm2{DHOqnPXBT;&M=Y7m<5kcXgDn1ML6{1yiqI_u^ijST9Jcb^G@ zp#k<1rON4$Bu@!VGOx(C|6GmD|-_LR03D~J819X(+hH1j+&w~wfe&0_sM zU@Vr~K#VE=?Oi?6%PbSTjsyaW>dCOsSTWBP$9ygecRl#iBhA&&4NT;7zY>(3lecS@QnXsVT|eYN?w|#v@CFo=|iPq6m?ms>~|NM`Qz0WoT@>a1>LOFztuM_W(*=x?y&J@x0mrb+uTP zH9!sxzNsI~nFaG_>ApHopcPr{e?0a2QGmMr{XYevKk)ac2q@eSSUYY$OSlo5qT)#r z;K%Ufg@R1Lcyau*L~NPlpWm=b6+=B%Oam|vV1dfLtVsZ?OBfYw<2f*wOLl3n0f5x< zvqZy#G)-HU^J|m>^(UW0V0dsT_ { children: [ _loginOptionButton(TranslationBase.of(context).livecareOption1, 'assets/images/new/Live_Care.svg', 1), _loginOptionButton(TranslationBase.of(context).livecareOption4, 'assets/images/new/book appointment.svg', 2), - _loginOptionButton(TranslationBase.of(context).pharmaLiveCare, 'assets/images/new/pharma.svg', 3, - // isEnable: projectViewModel.havePrivilege(99) - ), + _loginOptionButton(TranslationBase.of(context).pharmaLiveCare, 'assets/images/new/pharma.svg', 3, isEnable: projectViewModel.havePrivilege(99)), ], ), SizedBox( @@ -127,7 +127,19 @@ class _LiveCareTypeSelectState extends State { projectViewModel.analytics.liveCare.livecare_schedule_video_call(); } else { //Pharmacy LiveCare - if (isEnable) readQRCode(); + if (isEnable) { + Navigator.push( + context, + FadePage( + page: PharmaLiveCareIntroPage(), + ), + ).then((value) { + if (value != null && value.contains("pharmacy/")) { + pharmacyLiveCareQRCode = value.split("/")[1]; + startPharmacyLiveCareProcess(); + } + }); + } } }, child: Stack(children: [ diff --git a/lib/pages/livecare/pharma_livecare_intro_page.dart b/lib/pages/livecare/pharma_livecare_intro_page.dart new file mode 100644 index 00000000..56890c32 --- /dev/null +++ b/lib/pages/livecare/pharma_livecare_intro_page.dart @@ -0,0 +1,207 @@ +import 'package:barcode_scan2/barcode_scan2.dart'; +import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; +import 'package:diplomaticquarterapp/services/livecare_services/livecare_provider.dart'; +import 'package:diplomaticquarterapp/theme/colors.dart'; +import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_svg/flutter_svg.dart'; +import 'package:provider/provider.dart'; + +import '../../uitl/utils.dart'; + +class PharmaLiveCareIntroPage extends StatefulWidget { + const PharmaLiveCareIntroPage({Key key}) : super(key: key); + + @override + State createState() => _PharmaLiveCareIntroPageState(); +} + +class _PharmaLiveCareIntroPageState extends State { + ProjectViewModel projectViewModel; + String pharmacyLiveCareQRCode = ""; + + @override + Widget build(BuildContext context) { + projectViewModel = Provider.of(context); + return AppScaffold( + appBarTitle: TranslationBase.of(context).pharmaLiveCare, + isShowAppBar: true, + showNewAppBarTitle: true, + showNewAppBar: true, + body: SingleChildScrollView( + child: Container( + margin: EdgeInsets.only(left: 20.0, right: 20.0, top: 20.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container(child: Text(TranslationBase.of(context).pharmaLiveCare1, style: TextStyle(fontWeight: FontWeight.bold, fontSize: 20.0, letterSpacing: -0.64, color: CustomColors.darkGrey))), + Container( + margin: EdgeInsets.only(top: 7.0), + child: Text(TranslationBase.of(context).pharmaLiveCareDesc1, style: TextStyle(fontSize: 14.0, letterSpacing: -0.64, color: CustomColors.textColor, fontWeight: FontWeight.w600))), + Container( + margin: EdgeInsets.only(top: 20.0), + child: Text(TranslationBase.of(context).wherePharmaLiveCare, style: TextStyle(fontWeight: FontWeight.bold, fontSize: 20.0, letterSpacing: -0.64, color: CustomColors.darkGrey))), + Container( + margin: EdgeInsets.only(top: 7.0), + child: Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Image.asset( + "assets/images/new/booth_image.png", + ), + Container( + width: MediaQuery.of(context).size.width * 0.6, + margin: EdgeInsets.only(left: 10.0, right: 10.0), + child: Text(TranslationBase.of(context).pharmaLiveCareDesc2, + style: TextStyle(fontSize: 14.0, letterSpacing: -0.64, color: CustomColors.textColor, fontWeight: FontWeight.w600))), + ], + )), + Container( + margin: EdgeInsets.only(top: 20.0), + child: Text(TranslationBase.of(context).howPharmaLiveCare, style: TextStyle(fontWeight: FontWeight.bold, fontSize: 20.0, letterSpacing: -0.64, color: CustomColors.darkGrey))), + Container( + margin: EdgeInsets.only(top: 7.0), + child: Text(TranslationBase.of(context).pharmaLiveCareDesc3, style: TextStyle(fontSize: 14.0, letterSpacing: -0.64, color: CustomColors.textColor, fontWeight: FontWeight.w600))), + Container( + margin: EdgeInsets.only(top: 7.0), + child: Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + margin: EdgeInsets.only(top: 7.0), + padding: EdgeInsets.fromLTRB(14.0, 5.0, 14.0, 5.0), + decoration: BoxDecoration(color: CustomColors.green, borderRadius: BorderRadius.all(Radius.circular(100.0))), + child: Text("1", style: TextStyle(fontSize: 16.0, letterSpacing: -0.64, color: CustomColors.white, fontWeight: FontWeight.w600))), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Padding( + padding: const EdgeInsets.all(8.0), + child: SvgPicture.asset("assets/images/new/qr_code.svg", width: 40), + ), + Container( + margin: EdgeInsets.only(left: 5.0, right: 5.0), + child: Text(TranslationBase.of(context).pharmaLiveCareScanQR, + style: TextStyle(fontWeight: FontWeight.bold, fontSize: 20.0, letterSpacing: -0.64, color: CustomColors.darkGrey))), + Container( + width: MediaQuery.of(context).size.width * 0.7, + margin: EdgeInsets.only(left: 5.0, right: 5.0), + child: Text(TranslationBase.of(context).pharmaLiveCareScanQR1, + style: TextStyle(fontSize: 14.0, letterSpacing: -0.64, color: CustomColors.textColor, fontWeight: FontWeight.w600))), + ], + ), + ], + ), + ), + Container( + margin: EdgeInsets.only(top: 7.0), + child: Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + margin: EdgeInsets.only(top: 7.0), + padding: EdgeInsets.fromLTRB(12.0, 5.0, 12.0, 5.0), + decoration: BoxDecoration(color: CustomColors.green, borderRadius: BorderRadius.all(Radius.circular(100.0))), + child: Text("2", style: TextStyle(fontSize: 16.0, letterSpacing: -0.64, color: CustomColors.white, fontWeight: FontWeight.w600))), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Padding( + padding: const EdgeInsets.all(8.0), + child: SvgPicture.asset("assets/images/new/payment.svg", width: 40), + ), + Container( + margin: EdgeInsets.only(left: 5.0, right: 5.0), + child: Text(TranslationBase.of(context).pharmaLiveCareMakePayment, + style: TextStyle(fontWeight: FontWeight.bold, fontSize: 20.0, letterSpacing: -0.64, color: CustomColors.darkGrey))), + Container( + width: MediaQuery.of(context).size.width * 0.7, + margin: EdgeInsets.only(left: 5.0, right: 5.0), + child: Text(TranslationBase.of(context).pharmaLiveCareMakePayment1, + style: TextStyle(fontSize: 14.0, letterSpacing: -0.64, color: CustomColors.textColor, fontWeight: FontWeight.w600))), + ], + ), + ], + ), + ), + Container( + margin: EdgeInsets.only(top: 7.0), + child: Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + margin: EdgeInsets.only(top: 7.0), + padding: EdgeInsets.fromLTRB(12.0, 5.0, 12.0, 5.0), + decoration: BoxDecoration(color: CustomColors.green, borderRadius: BorderRadius.all(Radius.circular(100.0))), + child: Text("3", style: TextStyle(fontSize: 16.0, letterSpacing: -0.64, color: CustomColors.white, fontWeight: FontWeight.w600))), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Padding( + padding: const EdgeInsets.all(8.0), + child: SvgPicture.asset("assets/images/new/pharmaicon.svg", width: 40), + ), + Container( + width: MediaQuery.of(context).size.width * 0.7, + margin: EdgeInsets.only(left: 5.0, right: 5.0), + child: Text(TranslationBase.of(context).pharmaLiveCareJoinConsultation, + style: TextStyle(fontWeight: FontWeight.bold, fontSize: 20.0, letterSpacing: -0.64, color: CustomColors.darkGrey))), + Container( + width: MediaQuery.of(context).size.width * 0.7, + margin: EdgeInsets.only(left: 5.0, right: 5.0), + child: Text(TranslationBase.of(context).pharmaLiveCareJoinConsultation1, + style: TextStyle(fontSize: 14.0, letterSpacing: -0.64, color: CustomColors.textColor, fontWeight: FontWeight.w600))), + ], + ), + ], + ), + ), + SizedBox( + height: 100.0, + ) + ], + ), + ), + ), + bottomSheet: Container( + height: MediaQuery.of(context).size.height * 0.08, + width: double.infinity, + color: Colors.white, + child: Column( + children: [ + Container( + width: MediaQuery.of(context).size.width * 0.9, + child: DefaultButton(TranslationBase.of(context).pharmaLiveCareScanQR, () { + readQRCode(); + }), + ), + ], + ), + ), + ); + } + + readQRCode() async { + pharmacyLiveCareQRCode = (await BarcodeScanner.scan())?.rawContent; + if (pharmacyLiveCareQRCode != "") { + GifLoaderDialogUtils.showMyDialog(context); + LiveCareService service = new LiveCareService(); + service.getPatientInfoByQR(pharmacyLiveCareQRCode, context).then((res) { + GifLoaderDialogUtils.hideDialog(context); + }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); + print(err); + startPharmacyLiveCareProcess(); + }); + } else {} + } + + startPharmacyLiveCareProcess() { + sharedPref.setString(LIVECARE_CLINIC_DATA, "Pharmacy LiveCare" + "-" + "501" + "-" + "1"); + Navigator.pop(context, "pharmacy/$pharmacyLiveCareQRCode"); + } +} diff --git a/lib/pages/livecare/widgets/LiveCarePendingRequest.dart b/lib/pages/livecare/widgets/LiveCarePendingRequest.dart index c8519cfd..a866cc0b 100644 --- a/lib/pages/livecare/widgets/LiveCarePendingRequest.dart +++ b/lib/pages/livecare/widgets/LiveCarePendingRequest.dart @@ -123,91 +123,6 @@ class _LiveCarePendingRequestState extends State { ), ], ), - // Column( - // crossAxisAlignment: CrossAxisAlignment.start, - // mainAxisSize: MainAxisSize.min, - // children: [ - // Container( - // child: Text("In Progress:", - // style: TextStyle(fontSize: 20.0, fontWeight: FontWeight.bold)), - // ), - // Container( - // alignment: Alignment.center, - // margin: EdgeInsets.only(top: 10.0), - // child: Text("Estimated Waiting Time: ", - // style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold)), - // ), - // Container( - // transform: Matrix4.translationValues(0.0, -50.0, 0.0), - // alignment: Alignment.center, - // child: CircularCountDownTimer( - // duration: - // widget.pendingERRequestHistoryList.watingtimeInteger * 60, - // width: MediaQuery.of(context).size.width / 3, - // height: MediaQuery.of(context).size.height / 3, - // color: Colors.white, - // fillColor: Colors.green[700], - // strokeWidth: 15.0, - // textStyle: TextStyle( - // fontSize: 22.0, - // color: Colors.black87, - // fontWeight: FontWeight.bold), - // isReverse: true, - // isTimerTextShown: true, - // onComplete: () { - // print('Countdown Ended'); - // }, - // ), - // ), - // Container( - // transform: Matrix4.translationValues(0.0, -60.0, 0.0), - // child: Divider( - // color: Colors.grey[500], - // thickness: 0.7, - // ), - // ), - // Container( - // transform: Matrix4.translationValues(0.0, -50.0, 0.0), - // child: Text("Requested date:", - // style: TextStyle(fontSize: 14.0, fontWeight: FontWeight.bold)), - // ), - // Container( - // transform: Matrix4.translationValues(0.0, -30.0, 0.0), - // child: Text( - // DateUtil.getDateFormatted( - // widget.pendingERRequestHistoryList.arrivalTime), - // style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold)), - // ), - // Container( - // transform: Matrix4.translationValues(0.0, -20.0, 0.0), - // padding: EdgeInsets.all(7.0), - // decoration: BoxDecoration( - // shape: BoxShape.rectangle, - // borderRadius: BorderRadius.all(Radius.circular(5)), - // color: Colors.red[800], - // ), - // margin: EdgeInsets.only(top: 5.0, bottom: 5.0), - // child: Text(widget.pendingERRequestHistoryList.stringCallStatus, - // style: TextStyle(fontSize: 14.0, color: Colors.white)), - // ), - // Container( - // transform: Matrix4.translationValues(0.0, 0.0, 0.0), - // child: Divider( - // color: Colors.grey[500], - // thickness: 0.7, - // ), - // ), - // Container( - // alignment: Alignment.center, - // transform: Matrix4.translationValues(0.0, 10.0, 0.0), - // child: Text( - // "Your turn is after " + - // widget.pendingERRequestHistoryList.patCount.toString() + - // " Patients", - // style: TextStyle(fontSize: 20.0, fontWeight: FontWeight.bold)), - // ), - // ], - // ), ); } diff --git a/lib/pages/livecare/widgets/clinic_list.dart b/lib/pages/livecare/widgets/clinic_list.dart index 62f91fcb..e67e19ea 100644 --- a/lib/pages/livecare/widgets/clinic_list.dart +++ b/lib/pages/livecare/widgets/clinic_list.dart @@ -295,6 +295,9 @@ class _clinic_listState extends State { }); } + bool isPharmacyLiveCare = widget.isPharmacyLiveCare; + String pharmaLiveCareQRCodeValue = widget.pharmacyLiveCareQRCode; + Navigator.push( context, FadePage( @@ -306,6 +309,8 @@ class _clinic_listState extends State { isFromAdvancePayment: widget.isPharmacyLiveCare, ))).then((value) { print(value); + widget.isPharmacyLiveCare = isPharmacyLiveCare; + widget.pharmacyLiveCareQRCode = pharmaLiveCareQRCodeValue; if (value != null) { openPayment(value, authUser, num.parse(getERAppointmentFeesList.total), appo); projectViewModel.analytics.liveCare.payment_method(appointment_type: 'livecare', clinic: selectedClinicName, payment_method: value[0], payment_type: 'appointment'); @@ -576,7 +581,7 @@ class _clinic_listState extends State { widget.isPharmacyLiveCare = true; widget.pharmacyLiveCareQRCode = value.split("/")[1]; liveCareClinicIDs = await sharedPref.getString(LIVECARE_CLINIC_DATA); - selectedClinicID = 1; + selectedClinicID = 7; selectedClinicName = TranslationBase.of(context).pharmaLiveCare; sharedPref.remove(LIVECARE_CLINIC_DATA); startLiveCare(); diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index f68738a5..dabe80ab 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -2879,6 +2879,18 @@ class TranslationBase { String get liveCareSupportContact => localizedValues["liveCareSupportContact"][locale.languageCode]; String get scanNFC => localizedValues["scanNFC"][locale.languageCode]; String get pharmaLiveCare => localizedValues["pharmaLiveCare"][locale.languageCode]; + String get pharmaLiveCare1 => localizedValues["pharmaLiveCare1"][locale.languageCode]; + String get pharmaLiveCareDesc1 => localizedValues["pharmaLiveCareDesc1"][locale.languageCode]; + String get wherePharmaLiveCare => localizedValues["wherePharmaLiveCare"][locale.languageCode]; + String get pharmaLiveCareDesc2 => localizedValues["pharmaLiveCareDesc2"][locale.languageCode]; + String get howPharmaLiveCare => localizedValues["howPharmaLiveCare"][locale.languageCode]; + String get pharmaLiveCareDesc3 => localizedValues["pharmaLiveCareDesc3"][locale.languageCode]; + String get pharmaLiveCareScanQR => localizedValues["pharmaLiveCareScanQR"][locale.languageCode]; + String get pharmaLiveCareScanQR1 => localizedValues["pharmaLiveCareScanQR1"][locale.languageCode]; + String get pharmaLiveCareMakePayment => localizedValues["pharmaLiveCareMakePayment"][locale.languageCode]; + String get pharmaLiveCareMakePayment1 => localizedValues["pharmaLiveCareMakePayment1"][locale.languageCode]; + String get pharmaLiveCareJoinConsultation => localizedValues["pharmaLiveCareJoinConsultation"][locale.languageCode]; + String get pharmaLiveCareJoinConsultation1 => localizedValues["pharmaLiveCareJoinConsultation1"][locale.languageCode]; } diff --git a/lib/widgets/in_app_browser/InAppBrowser.dart b/lib/widgets/in_app_browser/InAppBrowser.dart index 96eb99cb..4fbc41cc 100644 --- a/lib/widgets/in_app_browser/InAppBrowser.dart +++ b/lib/widgets/in_app_browser/InAppBrowser.dart @@ -37,9 +37,9 @@ class MyInAppBrowser extends InAppBrowser { // static String APPLE_PAY_PAYFORT_URL = 'https://hmgwebservices.com/PayFortWebLive/PayFortApi/MakeApplePayRequest'; // Payfort Payment Gateway URL LIVE static String APPLE_PAY_PAYFORT_URL = 'https://hmgwebservices.com/PayFortWebLive/PayFortApi/MakeApplePayRequest'; // Payfort Payment Gateway URL UAT - // static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort Payment Gateway URL UAT + static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort Payment Gateway URL UAT - static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL LIVE + // static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL LIVE // static String PRESCRIPTION_PAYMENT_WITH_ORDERID = // 'https://uat.hmgwebservices.com/epharmacy/checkout/OpcCompleteRedirectionPaymentClientbyOrder?orderID='; From a20d6c7c28edcb9595e7abd43356d9a3d2a39a9a Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Mon, 27 Feb 2023 12:25:43 +0300 Subject: [PATCH 09/29] Livecare updates --- lib/config/config.dart | 6 ++-- .../notification_details_page.dart | 29 ++++++++++--------- .../livecare/live_care_payment_page.dart | 13 ++++++++- lib/pages/livecare/widgets/clinic_list.dart | 4 +-- .../livecare_services/livecare_provider.dart | 23 +++++++++++---- lib/widgets/in_app_browser/InAppBrowser.dart | 4 +-- 6 files changed, 53 insertions(+), 26 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index eb728041..3766b129 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -20,8 +20,8 @@ var PACKAGES_ORDERS = '/api/orders'; var PACKAGES_ORDER_HISTORY = '/api/orders/items'; var PACKAGES_TAMARA_OPT = '/api/orders/paymentoptions/tamara'; // var BASE_URL = 'http://10.50.100.198:3334/'; - var BASE_URL = 'https://uat.hmgwebservices.com/'; -// var BASE_URL = 'https://hmgwebservices.com/'; +// var BASE_URL = 'https://uat.hmgwebservices.com/'; +var BASE_URL = 'https://hmgwebservices.com/'; // Pharmacy UAT URLs // var BASE_PHARMACY_URL = 'https://uat.hmgwebservices.com/epharmacy/api/'; @@ -585,6 +585,8 @@ var AUTO_GENERATE_INVOICE_TAMARA = 'Services/PayFort_Serv.svc/REST/Tamara_Getinf var GET_ONESIGNAL_VOIP_TOKEN = 'https://onesignal.com/api/v1/players'; +var CANCEL_PHARMA_LIVECARE_REQUEST = 'https://vcallapi.hmg.com/api/PharmaLiveCare/SendPaymentStatus'; + class AppGlobal { static var context; diff --git a/lib/pages/DrawerPages/notifications/notification_details_page.dart b/lib/pages/DrawerPages/notifications/notification_details_page.dart index ad4815d9..65547b39 100644 --- a/lib/pages/DrawerPages/notifications/notification_details_page.dart +++ b/lib/pages/DrawerPages/notifications/notification_details_page.dart @@ -87,20 +87,21 @@ class _NotificationsDetailsPageState extends State { showVideoProgressIndicator: true, ), ), - if (widget.notification.messageTypeData.length != 0 && widget.notification.notificationType != "2") - Padding( - padding: const EdgeInsets.only(top: 18), - child: Image.network(widget.notification.messageTypeData, loadingBuilder: (BuildContext context, Widget child, ImageChunkEvent loadingProgress) { - if (loadingProgress == null) return child; - return Center( - child: SizedBox( - width: 40.0, - height: 40.0, - child: AppCircularProgressIndicator(), - ), - ); - }, fit: BoxFit.fill), - ), + if (widget.notification.messageTypeData != null) + if (widget.notification.messageTypeData.length != 0 && widget.notification.notificationType != "2") + Padding( + padding: const EdgeInsets.only(top: 18), + child: Image.network(widget.notification.messageTypeData, loadingBuilder: (BuildContext context, Widget child, ImageChunkEvent loadingProgress) { + if (loadingProgress == null) return child; + return Center( + child: SizedBox( + width: 40.0, + height: 40.0, + child: AppCircularProgressIndicator(), + ), + ); + }, fit: BoxFit.fill), + ), SizedBox(height: 18), Text( widget.notification.message.trim(), diff --git a/lib/pages/livecare/live_care_payment_page.dart b/lib/pages/livecare/live_care_payment_page.dart index 3b0dab9b..b1711f94 100644 --- a/lib/pages/livecare/live_care_payment_page.dart +++ b/lib/pages/livecare/live_care_payment_page.dart @@ -2,6 +2,7 @@ import 'dart:io'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/models/LiveCare/ERAppointmentFeesResponse.dart'; +import 'package:diplomaticquarterapp/services/livecare_services/livecare_provider.dart'; import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/uitl/PlatformBridge.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; @@ -22,8 +23,10 @@ class LiveCarePatmentPage extends StatefulWidget { GetERAppointmentFeesList getERAppointmentFeesList; int waitingTime; String clinicName; + bool isPharmaLiveCare; + String pharmaLiveCareClientID; - LiveCarePatmentPage({@required this.getERAppointmentFeesList, @required this.waitingTime, @required this.clinicName}); + LiveCarePatmentPage({@required this.getERAppointmentFeesList, @required this.waitingTime, @required this.clinicName, this.isPharmaLiveCare = false, this.pharmaLiveCareClientID = ""}); @override _LiveCarePatmentPageState createState() => _LiveCarePatmentPageState(); @@ -278,6 +281,7 @@ class _LiveCarePatmentPageState extends State { child: DefaultButton( TranslationBase.of(context).cancel, () { + if (widget.isPharmaLiveCare) cancelAPI(); Navigator.pop(context, false); }, ), @@ -387,6 +391,13 @@ class _LiveCarePatmentPageState extends State { dialog.showAlertDialog(context); } + void cancelAPI() { + LiveCareService service = new LiveCareService(); + service.cancelPharmaLiveCareRequest(widget.pharmaLiveCareClientID, context).then((res) {}).catchError((err) { + print(err); + }); + } + void onRadioChanged(int value) { setState(() { _selected = value; diff --git a/lib/pages/livecare/widgets/clinic_list.dart b/lib/pages/livecare/widgets/clinic_list.dart index e67e19ea..987955c7 100644 --- a/lib/pages/livecare/widgets/clinic_list.dart +++ b/lib/pages/livecare/widgets/clinic_list.dart @@ -195,7 +195,7 @@ class _clinic_listState extends State { } showLiveCarePaymentDialog(GetERAppointmentFeesList getERAppointmentFeesList, int waitingTime) { - navigateTo(context, LiveCarePatmentPage(getERAppointmentFeesList: getERAppointmentFeesList, waitingTime: waitingTime, clinicName: selectedClinicName)).then( + navigateTo(context, LiveCarePatmentPage(getERAppointmentFeesList: getERAppointmentFeesList, waitingTime: waitingTime, clinicName: selectedClinicName, isPharmaLiveCare: widget.isPharmacyLiveCare, pharmaLiveCareClientID: widget.pharmacyLiveCareQRCode)).then( (value) { if (value) { if (getERAppointmentFeesList.total == "0" || getERAppointmentFeesList.total == "0.0") { @@ -581,7 +581,7 @@ class _clinic_listState extends State { widget.isPharmacyLiveCare = true; widget.pharmacyLiveCareQRCode = value.split("/")[1]; liveCareClinicIDs = await sharedPref.getString(LIVECARE_CLINIC_DATA); - selectedClinicID = 7; + selectedClinicID = 1; selectedClinicName = TranslationBase.of(context).pharmaLiveCare; sharedPref.remove(LIVECARE_CLINIC_DATA); startLiveCare(); diff --git a/lib/services/livecare_services/livecare_provider.dart b/lib/services/livecare_services/livecare_provider.dart index 703ff4cb..86baa552 100644 --- a/lib/services/livecare_services/livecare_provider.dart +++ b/lib/services/livecare_services/livecare_provider.dart @@ -156,7 +156,7 @@ class LiveCareService extends BaseService { request = { "ServiceID": serviceID, - "ProjectID": 15, + "ProjectID": 12, "PatientID": authUser.patientID != null ? authUser.patientID : 0, "Age": authUser.age != null ? authUser.age : 0, "Gender": authUser.gender != null ? authUser.gender : 0 @@ -182,7 +182,7 @@ class LiveCareService extends BaseService { request = { "ServiceID": serviceID, - "ProjectID": 15, + "ProjectID": 12, "Age": authUser.age != null ? authUser.age : 0, "PatientID": authUser.patientID != null ? authUser.patientID : 0, "Gender": authUser.gender != null ? authUser.gender : 0 @@ -326,9 +326,7 @@ class LiveCareService extends BaseService { Future getOneSignalVOIPToken(String voipToken, BuildContext context) async { Map request; - - // request = {"app_id": "b87a754b-9a2a-437c-960b-39a079c57586", "identifier": voipToken, "device_type": 0, "test_type": 1}; - request = { "app_id": "b87a754b-9a2a-437c-960b-39a079c57586", "identifier": voipToken, "device_type": 0 }; + request = {"app_id": "b87a754b-9a2a-437c-960b-39a079c57586", "identifier": voipToken, "device_type": 0}; dynamic localRes; @@ -339,4 +337,19 @@ class LiveCareService extends BaseService { }, body: request); return Future.value(localRes); } + + Future cancelPharmaLiveCareRequest(String pharmaClientRequestID, BuildContext context) async { + Map request; + request = {"clientid": pharmaClientRequestID, "status": "Cancel"}; + + dynamic localRes; + + await baseAppClient.post(CANCEL_PHARMA_LIVECARE_REQUEST, isExternal: true, isAllowAny: true, onSuccess: (response, statusCode) async { + localRes = response; + }, onFailure: (String error, int statusCode) { + throw error; + }, body: request); + return Future.value(localRes); + } + } diff --git a/lib/widgets/in_app_browser/InAppBrowser.dart b/lib/widgets/in_app_browser/InAppBrowser.dart index 4fbc41cc..96eb99cb 100644 --- a/lib/widgets/in_app_browser/InAppBrowser.dart +++ b/lib/widgets/in_app_browser/InAppBrowser.dart @@ -37,9 +37,9 @@ class MyInAppBrowser extends InAppBrowser { // static String APPLE_PAY_PAYFORT_URL = 'https://hmgwebservices.com/PayFortWebLive/PayFortApi/MakeApplePayRequest'; // Payfort Payment Gateway URL LIVE static String APPLE_PAY_PAYFORT_URL = 'https://hmgwebservices.com/PayFortWebLive/PayFortApi/MakeApplePayRequest'; // Payfort Payment Gateway URL UAT - static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort Payment Gateway URL UAT + // static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort Payment Gateway URL UAT - // static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL LIVE + static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL LIVE // static String PRESCRIPTION_PAYMENT_WITH_ORDERID = // 'https://uat.hmgwebservices.com/epharmacy/checkout/OpcCompleteRedirectionPaymentClientbyOrder?orderID='; From bc8a9794382c94caf714e1023a8e8cb5b35d4cb5 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Mon, 27 Feb 2023 16:25:48 +0300 Subject: [PATCH 10/29] Upload to stores --- ios/Podfile | 7 + lib/pages/landing/landing_page.dart | 6 +- .../livecare/live_care_payment_page.dart | 2 +- lib/uitl/push-notification-handler.dart | 140 ++++-------------- pubspec.yaml | 6 +- 5 files changed, 42 insertions(+), 119 deletions(-) diff --git a/ios/Podfile b/ios/Podfile index ebcf3c8c..ca8f0966 100644 --- a/ios/Podfile +++ b/ios/Podfile @@ -40,6 +40,13 @@ 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_LOCATION=1', + 'PERMISSION_CAMERA=1', + 'PERMISSION_MICROPHONE=1', + ] build_configuration.build_settings['EXCLUDED_ARCHS[sdk=iphonesimulator*]'] = 'arm64 i386' if build_configuration.build_settings['WRAPPER_EXTENSION'] == 'bundle' build_configuration.build_settings['DEVELOPMENT_TEAM'] = '3A359E86ZF' diff --git a/lib/pages/landing/landing_page.dart b/lib/pages/landing/landing_page.dart index cd9e5ac7..e9fbd62c 100644 --- a/lib/pages/landing/landing_page.dart +++ b/lib/pages/landing/landing_page.dart @@ -46,7 +46,6 @@ import 'package:flutter_local_notifications/flutter_local_notifications.dart'; import 'package:flutter_svg/flutter_svg.dart'; import 'package:permission_handler/permission_handler.dart'; import 'package:provider/provider.dart'; -import 'package:wifi/wifi.dart'; import '../../locator.dart'; import '../../routes.dart'; @@ -290,8 +289,6 @@ class _LandingPageState extends State with WidgetsBindingObserver { WidgetsBinding.instance.addObserver(this); AppGlobal.context = context; - - _requestIOSPermissions(); pageController = PageController(keepPage: true); _firebaseMessaging.setAutoInitEnabled(true); @@ -309,7 +306,7 @@ class _LandingPageState extends State with WidgetsBindingObserver { _firebaseMessaging.getToken().then((String token) { print("Firebase Token: " + token); sharedPref.setString(PUSH_TOKEN, token); - if(Platform.isIOS) { + if (Platform.isIOS) { voIPKit.getVoIPToken().then((value) { print('🎈 example: getVoIPToken: $value'); AppSharedPreferences().setString(APNS_TOKEN, value); @@ -639,6 +636,7 @@ class _LandingPageState extends State with WidgetsBindingObserver { } void checkUserStatus(token) async { + await PushNotificationHandler.getInstance().isAndroidPermissionGranted(); authService.selectDeviceImei(token).then((SelectDeviceIMEIRES value) => setUserValues(value)); if (authenticatedUserObject.isLogin) { var data = AuthenticatedUser.fromJson(await sharedPref.getObject(USER_PROFILE)); diff --git a/lib/pages/livecare/live_care_payment_page.dart b/lib/pages/livecare/live_care_payment_page.dart index b1711f94..2f998818 100644 --- a/lib/pages/livecare/live_care_payment_page.dart +++ b/lib/pages/livecare/live_care_payment_page.dart @@ -339,7 +339,7 @@ class _LiveCarePatmentPageState extends State { title: TranslationBase.of(context).covidConsentHeader, message: TranslationBase.of(context).liveCarePermissions, onTap: () async { - if (!(await Permission.camera.request().isGranted) || !(await Permission.microphone.request().isGranted) || !(await Permission.location.request().isGranted)) { + if (!(await Permission.notification.request().isGranted) || !(await Permission.camera.request().isGranted) || !(await Permission.microphone.request().isGranted) || !(await Permission.location.request().isGranted)) { return false; } }, diff --git a/lib/uitl/push-notification-handler.dart b/lib/uitl/push-notification-handler.dart index 4cc85342..2a101e94 100644 --- a/lib/uitl/push-notification-handler.dart +++ b/lib/uitl/push-notification-handler.dart @@ -10,16 +10,17 @@ import 'package:diplomaticquarterapp/pages/DrawerPages/notifications/notificatio import 'package:diplomaticquarterapp/pages/landing/landing_page.dart'; import 'package:diplomaticquarterapp/pages/livecare/incoming_call.dart'; import 'package:diplomaticquarterapp/pages/webRTC/OpenTok/OpenTok.dart'; +import 'package:diplomaticquarterapp/uitl/LocalNotification.dart'; import 'package:diplomaticquarterapp/uitl/app-permissions.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:firebase_messaging/firebase_messaging.dart'; import 'package:firebase_messaging/firebase_messaging.dart' as fir; import 'package:flutter/cupertino.dart'; +import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; - -// import 'package:flutter_hms_gms_availability/flutter_hms_gms_availability.dart'; import 'package:flutter_ios_voip_kit/call_state_type.dart'; import 'package:flutter_ios_voip_kit/flutter_ios_voip_kit.dart'; +import 'package:flutter_local_notifications/flutter_local_notifications.dart'; import 'package:huawei_hmsavailability/huawei_hmsavailability.dart'; import 'package:huawei_push/huawei_push.dart' as h_push; import 'package:permission_handler/permission_handler.dart'; @@ -253,7 +254,7 @@ class PushNotificationHandler { try { FirebaseMessaging.instance.getInitialMessage().then((RemoteMessage message) async { - if(message != null) { + if (message != null) { // print("Firebase getInitialMessage with message : ${message.data.toString()}"); subscribeFCMTopic(); if (Platform.isIOS) @@ -263,9 +264,7 @@ class PushNotificationHandler { else if (message != null) newMessage(message); } }); - } catch(ex) { - - } + } catch (ex) {} FirebaseMessaging.onMessage.listen((RemoteMessage message) async { print("Firebase onMessage!!!"); @@ -371,109 +370,28 @@ class PushNotificationHandler { _incomingCall(call_data); } } -} -/* todo verify all functionality */ -// _firebaseMessaging.configure( -// // onMessage: (Map message) async { -// // // showDialog("onMessage: $message"); -// // print("onMessage: $message"); -// // print(message); -// // print(message['name']); -// // print(message['appointmentdate']); -// // -// // if (Platform.isIOS) { -// // if (message['is_call'] == "true") { -// // var route = ModalRoute.of(context); -// // -// // if (route != null) { -// // print(route.settings.name); -// // } -// //s -// // Map myMap = new Map.from(mesage); -// // print(myMap); -// // LandingPage.isOpenCallPage = true; -// // LandingPage.incomingCallData = IncomingCallData.fromJson(myMap); -// // if (!isPageNavigated) { -// // isPageNavigated = true; -// // Navigator.push(context, MaterialPageRoute(builder: (context) => IncomingCall(incomingCallData: LandingPage.incomingCallData))).then((value) { -// // isPageNavigated = false; -// // }); -// // } -// // } else { -// // print("Is Call Not Found iOS"); -// // } -// // } else { -// // print("Is Call Not Found iOS"); -// // } -// // -// // if (Platform.isAndroid) { -// // if (message['data'].containsKey("is_call")) { -// // var route = ModalRoute.of(context); -// // -// // if (route != null) { -// // print(route.settings.name); -// // } -// // -// // Map myMap = new Map.from(message['data']); -// // print(myMap); -// // if (LandingPage.isOpenCallPage) { -// // return; -// // } -// // LandingPage.isOpenCallPage = true; -// // LandingPage.incomingCallData = IncomingCallData.fromJson(myMap); -// // if (!isPageNavigated) { -// // isPageNavigated = true; -// // Navigator.push(context, MaterialPageRoute(builder: (context) => IncomingCall(incomingCallData: LandingPage.incomingCallData))).then((value) { -// // Future.delayed(Duration(seconds: 5), () { -// // isPageNavigated = false; -// // }); -// // }); -// // } -// // } else { -// // print("Is Call Not Found Android"); -// // LocalNotification.getInstance().showNow(title: message['notification']['title'], subtitle: message['notification']['body']); -// // } -// // } else { -// // print("Is Call Not Found Android"); -// // } -// // }, -// onBackgroundMessage: Platform.isIOS ? null : myBackgroundMessageHandler, -// onLaunch: (Map message) async { -// print("onLaunch: $message"); -// // showDialog("onLaunch: $message"); -// }, -// onResume: (Map message) async { -// print("onResume: $message"); -// print(message); -// print(message['name']); -// print(message['appointmentdate']); -// -// // showDialog("onResume: $message"); -// -// if (Platform.isIOS) { -// if (message['is_call'] == "true") { -// var route = ModalRoute.of(context); -// -// if (route != null) { -// print(route.settings.name); -// } -// -// Map myMap = new Map.from(message); -// print(myMap); -// LandingPage.isOpenCallPage = true; -// LandingPage.incomingCallData = IncomingCallData.fromJson(myMap); -// if (!isPageNavigated) { -// isPageNavigated = true; -// Navigator.push(context, MaterialPageRoute(builder: (context) => IncomingCall(incomingCallData: LandingPage.incomingCallData))).then((value) { -// isPageNavigated = false; -// }); -// } -// } else { -// print("Is Call Not Found iOS"); -// } -// } else { -// print("Is Call Not Found iOS"); -// } -// }, -// ); + Future isAndroidPermissionGranted() async { + if (Platform.isAndroid) { + final bool granted = await flutterLocalNotificationsPlugin.resolvePlatformSpecificImplementation()?.areNotificationsEnabled() ?? false; + if (granted) { + print("-------------------- Permission Granted ------------------------"); + print(granted); + } else { + await requestPermissions(); + } + } + } + + Future requestPermissions() async { + try { + if (Platform.isIOS) { + await flutterLocalNotificationsPlugin.resolvePlatformSpecificImplementation()?.requestPermissions(alert: true, badge: true, sound: true); + } else if (Platform.isAndroid) { + Permission.notification.request(); + } + } catch (err) { + debugPrint(err); + } + } +} diff --git a/pubspec.yaml b/pubspec.yaml index 15accfac..d472d9cc 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,7 +1,7 @@ name: diplomaticquarterapp description: A new Flutter application. -version: 4.5.013+4050013 +version: 4.5.014+4050014 environment: sdk: ">=2.7.0 <3.0.0" @@ -131,7 +131,7 @@ dependencies: carousel_pro: ^1.0.0 #local_notifications - flutter_local_notifications: ^10.0.0 + flutter_local_notifications: any #device_calendar device_calendar: ^4.2.0 @@ -208,7 +208,7 @@ dependencies: dependency_overrides: provider : ^5.0.0 - permission_handler : ^6.0.1+1 +# permission_handler : ^10.2.0 flutter_svg: ^1.0.0 # firebase_messaging_platform_interface: any # flutter_inappwebview: 5.7.2+3 From 3bc09f792a33add0ea40a9b8f0134ada7d8d4675 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Sun, 5 Mar 2023 10:33:09 +0300 Subject: [PATCH 11/29] Pharma LiveCare fixes --- lib/config/localized_values.dart | 4 ++-- lib/pages/livecare/live_care_payment_page.dart | 15 ++++++++++++++- lib/pages/livecare/widgets/clinic_list.dart | 16 +++++++++++++++- pubspec.yaml | 2 +- 4 files changed, 32 insertions(+), 5 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index fc489d8e..1bf2bd9c 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -1881,6 +1881,6 @@ const Map localizedValues = { "pharmaLiveCareScanQR1": {"en": "Scan the QR Code in the booth to make the connection", "ar": "امسح رمز الاستجابة السريعة في المقصورة لإجراء الاتصال"}, "pharmaLiveCareMakePayment": {"en": "Make Payment Online", "ar": "قم بالدفع عبر الإنترنت"}, "pharmaLiveCareMakePayment1": {"en": "Make the payment through the mobile app", "ar": "قم بالدفع من خلال تطبيق الهاتف المحمول"}, - "pharmaLiveCareJoinConsultation": {"en": "Join the virtual consultation from booth", "ar": "انضم إلى الاستشارة الافتراضية من الكشك"}, - "pharmaLiveCareJoinConsultation1": {"en": "Wait for the doctor in the pharma booth to join you", "ar": "انتظر حتى ينضم إليك الطبيب في كابينة لايف كير الصيدلية"}, + "pharmaLiveCareJoinConsultation": {"en": "Join the virtual consultation from booth", "ar": "انضم إلى الاستشارة الافتراضية من الكبينة"}, + "pharmaLiveCareJoinConsultation1": {"en": "Wait for the doctor in the pharma booth to join you", "ar": "انتظر حتى ينضم إليك الطبيب في كبينة لايف كير الصيدلية"}, }; \ No newline at end of file diff --git a/lib/pages/livecare/live_care_payment_page.dart b/lib/pages/livecare/live_care_payment_page.dart index 2f998818..c21a293c 100644 --- a/lib/pages/livecare/live_care_payment_page.dart +++ b/lib/pages/livecare/live_care_payment_page.dart @@ -50,6 +50,10 @@ class _LiveCarePatmentPageState extends State { showNewAppBarTitle: true, showNewAppBar: true, description: TranslationBase.of(context).erConsultation, + onTap: () { + Navigator.pop(context); + Navigator.pop(context); + }, body: Container( width: double.infinity, height: double.infinity, @@ -326,6 +330,12 @@ class _LiveCarePatmentPageState extends State { ); } + @override + void dispose() { + cancelAPI(); + super.dispose(); + } + Future askVideoCallPermission() async { if (Platform.isIOS) { if (!(await Permission.camera.request().isGranted) || !(await Permission.microphone.request().isGranted) || !(await Permission.location.request().isGranted)) { @@ -339,7 +349,10 @@ class _LiveCarePatmentPageState extends State { title: TranslationBase.of(context).covidConsentHeader, message: TranslationBase.of(context).liveCarePermissions, onTap: () async { - if (!(await Permission.notification.request().isGranted) || !(await Permission.camera.request().isGranted) || !(await Permission.microphone.request().isGranted) || !(await Permission.location.request().isGranted)) { + if (!(await Permission.notification.request().isGranted) || + !(await Permission.camera.request().isGranted) || + !(await Permission.microphone.request().isGranted) || + !(await Permission.location.request().isGranted)) { return false; } }, diff --git a/lib/pages/livecare/widgets/clinic_list.dart b/lib/pages/livecare/widgets/clinic_list.dart index 987955c7..359368c0 100644 --- a/lib/pages/livecare/widgets/clinic_list.dart +++ b/lib/pages/livecare/widgets/clinic_list.dart @@ -10,6 +10,7 @@ import 'package:diplomaticquarterapp/models/LiveCare/LiveCareClinicsListResponse import 'package:diplomaticquarterapp/models/LiveCare/LiveCareScheduleClinicsListResponse.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/SearchResults.dart'; import 'package:diplomaticquarterapp/pages/ToDoList/payment_method_select.dart'; +import 'package:diplomaticquarterapp/pages/landing/landing_page.dart'; import 'package:diplomaticquarterapp/pages/livecare/livecare_home.dart'; import 'package:diplomaticquarterapp/pages/livecare/livecare_scheduling/schedule_clinic_card.dart'; import 'package:diplomaticquarterapp/pages/livecare/livecare_type_select.dart'; @@ -195,7 +196,15 @@ class _clinic_listState extends State { } showLiveCarePaymentDialog(GetERAppointmentFeesList getERAppointmentFeesList, int waitingTime) { - navigateTo(context, LiveCarePatmentPage(getERAppointmentFeesList: getERAppointmentFeesList, waitingTime: waitingTime, clinicName: selectedClinicName, isPharmaLiveCare: widget.isPharmacyLiveCare, pharmaLiveCareClientID: widget.pharmacyLiveCareQRCode)).then( + navigateTo( + context, + LiveCarePatmentPage( + getERAppointmentFeesList: getERAppointmentFeesList, + waitingTime: waitingTime, + clinicName: selectedClinicName, + isPharmaLiveCare: widget.isPharmacyLiveCare, + pharmaLiveCareClientID: widget.pharmacyLiveCareQRCode)) + .then( (value) { if (value) { if (getERAppointmentFeesList.total == "0" || getERAppointmentFeesList.total == "0.0") { @@ -464,6 +473,11 @@ class _clinic_listState extends State { AppToast.showErrorToast(message: res['Response_Message']); projectViewModel.analytics.liveCare.livecare_immediate_consultation_payment_failed( appointment_type: 'livecare', payment_type: 'appointment', payment_method: selectedPaymentMethod, txn_amount: this.amount, txn_currency: currency, error_message: res['Response_Message']); + Navigator.pushAndRemoveUntil( + context, + MaterialPageRoute(builder: (context) => LandingPage()), + (Route route) => false, + ); } }).catchError((err) { GifLoaderDialogUtils.hideDialog(context); diff --git a/pubspec.yaml b/pubspec.yaml index d472d9cc..58dc042c 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,7 +1,7 @@ name: diplomaticquarterapp description: A new Flutter application. -version: 4.5.014+4050014 +version: 4.5.015+4050015 environment: sdk: ">=2.7.0 <3.0.0" From 5045cc6faa24507e33c5382d98439c1c67483e6f Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Sun, 5 Mar 2023 17:11:15 +0300 Subject: [PATCH 12/29] Pharma LiveCare "IsPharmacy" Param added, Added Google API Availability check for Huawei devices --- lib/config/config.dart | 6 +- lib/core/viewModels/dashboard_view_model.dart | 1 + .../ancillaryOrdersDetails.dart | 2 +- lib/pages/Blood/confirm_payment_page.dart | 2 +- lib/pages/BookAppointment/BookSuccess.dart | 4 +- .../covid-payment-summary.dart | 2 +- .../EdOnline/EdPaymentInformationPage.dart | 2 +- lib/pages/ToDoList/ToDo.dart | 2 +- .../landing/widgets/logged_slider_view.dart | 2 +- lib/pages/livecare/widgets/clinic_list.dart | 10 +- .../medical/balance/confirm_payment_page.dart | 2 +- .../appointment_services/GetDoctorsList.dart | 3 +- .../livecare_services/livecare_provider.dart | 9 +- lib/uitl/push-notification-handler.dart | 146 +++++++----------- lib/uitl/utils.dart | 10 ++ lib/uitl/utils_new.dart | 1 - lib/widgets/drawer/app_drawer_widget.dart | 1 + lib/widgets/in_app_browser/InAppBrowser.dart | 4 +- pubspec.yaml | 1 + 19 files changed, 95 insertions(+), 115 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index 3766b129..ec7f6255 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -20,8 +20,8 @@ var PACKAGES_ORDERS = '/api/orders'; var PACKAGES_ORDER_HISTORY = '/api/orders/items'; var PACKAGES_TAMARA_OPT = '/api/orders/paymentoptions/tamara'; // var BASE_URL = 'http://10.50.100.198:3334/'; -// var BASE_URL = 'https://uat.hmgwebservices.com/'; -var BASE_URL = 'https://hmgwebservices.com/'; + var BASE_URL = 'https://uat.hmgwebservices.com/'; +// var BASE_URL = 'https://hmgwebservices.com/'; // Pharmacy UAT URLs // var BASE_PHARMACY_URL = 'https://uat.hmgwebservices.com/epharmacy/api/'; @@ -321,7 +321,7 @@ var UPDATE_COVID_QUESTIONNAIRE = 'Services/Doctors.svc/REST/COVID19_Questionnari var CHANNEL = 3; var GENERAL_ID = 'Cs2020@2016\$2958'; var IP_ADDRESS = '10.20.10.20'; -var VERSION_ID = 10.0; +var VERSION_ID = 10.1; var SETUP_ID = '91877'; var LANGUAGE = 2; // var PATIENT_OUT_SA = 0; diff --git a/lib/core/viewModels/dashboard_view_model.dart b/lib/core/viewModels/dashboard_view_model.dart index fca76cbf..931e94b3 100644 --- a/lib/core/viewModels/dashboard_view_model.dart +++ b/lib/core/viewModels/dashboard_view_model.dart @@ -21,6 +21,7 @@ class DashboardViewModel extends BaseViewModel { if (isLogin && _vitalSignService.weightKg.isEmpty) { setState(ViewState.Busy); await _vitalSignService.getPatientRadOrders(); + booldType = await sharedPref.getString(BLOOD_TYPE) ?? "-"; if (_vitalSignService.hasError) { error = _vitalSignService.error; diff --git a/lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrdersDetails.dart b/lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrdersDetails.dart index c1e75b69..fc2d5ecc 100644 --- a/lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrdersDetails.dart +++ b/lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrdersDetails.dart @@ -604,7 +604,7 @@ class _AnicllaryOrdersState extends State with SingleTic checkPaymentStatus(AppoitmentAllHistoryResultList appo) { GifLoaderDialogUtils.showMyDialog(localContext); DoctorsListService service = new DoctorsListService(); - service.checkPaymentStatus(transID, localContext).then((res) { + service.checkPaymentStatus(transID, false, localContext).then((res) { String paymentInfo = res['Response_Message']; if (paymentInfo == 'Success') { createAdvancePayment(res, appo); diff --git a/lib/pages/Blood/confirm_payment_page.dart b/lib/pages/Blood/confirm_payment_page.dart index a93861f5..4b3f96e2 100644 --- a/lib/pages/Blood/confirm_payment_page.dart +++ b/lib/pages/Blood/confirm_payment_page.dart @@ -227,7 +227,7 @@ class ConfirmPaymentPage extends StatelessWidget { checkPaymentStatus(AppoitmentAllHistoryResultList appo) { DoctorsListService service = new DoctorsListService(); GifLoaderDialogUtils.showMyDialog(AppGlobal.context); - service.checkPaymentStatus(Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), AppGlobal.context).then((res) { + service.checkPaymentStatus(Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), false, AppGlobal.context).then((res) { GifLoaderDialogUtils.hideDialog(AppGlobal.context); print("Printing Payment Status Reponse!!!!"); print(res); diff --git a/lib/pages/BookAppointment/BookSuccess.dart b/lib/pages/BookAppointment/BookSuccess.dart index 9b6a4736..98f370ba 100644 --- a/lib/pages/BookAppointment/BookSuccess.dart +++ b/lib/pages/BookAppointment/BookSuccess.dart @@ -731,7 +731,7 @@ class _BookSuccessState extends State { final currency = projectViewModel.user.outSA == 0 ? "sar" : 'aed'; GifLoaderDialogUtils.showMyDialog(context); DoctorsListService service = new DoctorsListService(); - service.checkPaymentStatus(Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), context).then((res) { + service.checkPaymentStatus(Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), false, context).then((res) { String paymentInfo = res['Response_Message']; if (paymentInfo == 'Success') { txn_ref = res['Merchant_Reference']; @@ -762,7 +762,7 @@ class _BookSuccessState extends State { getApplePayAPQ(AppoitmentAllHistoryResultList appo) { GifLoaderDialogUtils.showMyDialog(context); DoctorsListService service = new DoctorsListService(); - service.checkPaymentStatus(Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), context).then((res) { + service.checkPaymentStatus(Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), false, context).then((res) { GifLoaderDialogUtils.hideDialog(context); String paymentInfo = res['Response_Message']; diff --git a/lib/pages/Covid-DriveThru/covid-payment-summary.dart b/lib/pages/Covid-DriveThru/covid-payment-summary.dart index 6c814066..d23be14a 100644 --- a/lib/pages/Covid-DriveThru/covid-payment-summary.dart +++ b/lib/pages/Covid-DriveThru/covid-payment-summary.dart @@ -376,7 +376,7 @@ class _CovidPaymentSummaryState extends State { checkPaymentStatus(AppoitmentAllHistoryResultList appo) { GifLoaderDialogUtils.showMyDialog(context); DoctorsListService service = new DoctorsListService(); - service.checkPaymentStatus(Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), context).then((res) { + service.checkPaymentStatus(Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), false, context).then((res) { print("Printing Payment Status Reponse!!!!"); print(res); String paymentInfo = res['Response_Message']; diff --git a/lib/pages/ErService/EdOnline/EdPaymentInformationPage.dart b/lib/pages/ErService/EdOnline/EdPaymentInformationPage.dart index 4d6b072e..9a276ebd 100644 --- a/lib/pages/ErService/EdOnline/EdPaymentInformationPage.dart +++ b/lib/pages/ErService/EdOnline/EdPaymentInformationPage.dart @@ -200,7 +200,7 @@ class _EdPaymentInformationPageState extends State { checkPaymentStatus(AppoitmentAllHistoryResultList appo) { DoctorsListService service = new DoctorsListService(); GifLoaderDialogUtils.showMyDialog(AppGlobal.context); - service.checkPaymentStatus(transID, AppGlobal.context).then((res) { + service.checkPaymentStatus(transID, false, AppGlobal.context).then((res) { GifLoaderDialogUtils.hideDialog(AppGlobal.context); String paymentInfo = res['Response_Message']; if (paymentInfo == 'Success') { diff --git a/lib/pages/ToDoList/ToDo.dart b/lib/pages/ToDoList/ToDo.dart index c6f1e6db..d8eeded9 100644 --- a/lib/pages/ToDoList/ToDo.dart +++ b/lib/pages/ToDoList/ToDo.dart @@ -1097,7 +1097,7 @@ class _ToDoState extends State with SingleTickerProviderStateMixin { final currency = projectViewModel.user.outSA == 0 ? "sar" : 'aed'; GifLoaderDialogUtils.showMyDialog(context); DoctorsListService service = new DoctorsListService(); - service.checkPaymentStatus(Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), context).then((res) { + service.checkPaymentStatus(Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), false, context).then((res) { GifLoaderDialogUtils.hideDialog(context); String paymentInfo = res['Response_Message']; if (paymentInfo == 'Success') { diff --git a/lib/pages/landing/widgets/logged_slider_view.dart b/lib/pages/landing/widgets/logged_slider_view.dart index 54417ee4..a74e2231 100644 --- a/lib/pages/landing/widgets/logged_slider_view.dart +++ b/lib/pages/landing/widgets/logged_slider_view.dart @@ -191,7 +191,7 @@ class LoggedSliderView extends StatelessWidget { Texts( '${TranslationBase.of(context).bloodType1} ${model.booldType}', color: Colors.white, - fontSize: 8, + fontSize: 7, ) ], ), diff --git a/lib/pages/livecare/widgets/clinic_list.dart b/lib/pages/livecare/widgets/clinic_list.dart index 359368c0..6e799c89 100644 --- a/lib/pages/livecare/widgets/clinic_list.dart +++ b/lib/pages/livecare/widgets/clinic_list.dart @@ -120,7 +120,7 @@ class _clinic_listState extends State { LiveCareService service = new LiveCareService(); GifLoaderDialogUtils.showMyDialog(context); ERAppointmentFeesResponse erAppointmentFeesResponse = new ERAppointmentFeesResponse(); - service.getERAppointmentFees(selectedClinicID, context).then((res) { + service.getERAppointmentFees(selectedClinicID, widget.isPharmacyLiveCare, context).then((res) { GifLoaderDialogUtils.hideDialog(context); if (res['HasAppointment'] == true) { isError = true; @@ -185,7 +185,7 @@ class _clinic_listState extends State { getERAppointmentTime(GetERAppointmentFeesList getERAppointmentFeesList) { LiveCareService service = new LiveCareService(); GifLoaderDialogUtils.showMyDialog(context); - service.getERAppointmentTime(selectedClinicID, context).then((res) { + service.getERAppointmentTime(selectedClinicID, widget.isPharmacyLiveCare, context).then((res) { GifLoaderDialogUtils.hideDialog(context); showLiveCarePaymentDialog(getERAppointmentFeesList, res['WatingtimeInteger']); }).catchError((err) { @@ -462,7 +462,7 @@ class _clinic_listState extends State { final currency = projectViewModel.user.outSA == 0 ? "sar" : 'aed'; DoctorsListService service = new DoctorsListService(); GifLoaderDialogUtils.showMyDialog(context); - service.checkPaymentStatus(widget.isPharmacyLiveCare ? widget.pharmacyLiveCareQRCode : Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), context).then((res) { + service.checkPaymentStatus(widget.isPharmacyLiveCare ? widget.pharmacyLiveCareQRCode : Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), widget.isPharmacyLiveCare, context).then((res) { GifLoaderDialogUtils.hideDialog(context); String paymentInfo = res['Response_Message']; amount = res['Amount'].toString(); @@ -489,7 +489,7 @@ class _clinic_listState extends State { addNewCallForPatientER(String clientRequestID) { LiveCareService service = new LiveCareService(); GifLoaderDialogUtils.showMyDialog(context); - service.addNewCallForPatientER(selectedClinicID, clientRequestID, context).then((res) { + service.addNewCallForPatientER(selectedClinicID, clientRequestID, widget.isPharmacyLiveCare, context).then((res) { GifLoaderDialogUtils.hideDialog(context); AppToast.showSuccessToast(message: "New Call has been added successfully"); widget.getLiveCareHistory(); @@ -595,7 +595,7 @@ class _clinic_listState extends State { widget.isPharmacyLiveCare = true; widget.pharmacyLiveCareQRCode = value.split("/")[1]; liveCareClinicIDs = await sharedPref.getString(LIVECARE_CLINIC_DATA); - selectedClinicID = 1; + selectedClinicID = 7; selectedClinicName = TranslationBase.of(context).pharmaLiveCare; sharedPref.remove(LIVECARE_CLINIC_DATA); startLiveCare(); diff --git a/lib/pages/medical/balance/confirm_payment_page.dart b/lib/pages/medical/balance/confirm_payment_page.dart index ab5381c9..7c562b43 100644 --- a/lib/pages/medical/balance/confirm_payment_page.dart +++ b/lib/pages/medical/balance/confirm_payment_page.dart @@ -428,7 +428,7 @@ class _ConfirmPaymentPageState extends State { final currency = projectViewModel.user.outSA == 0 ? "sar" : 'aed'; GifLoaderDialogUtils.showMyDialog(AppGlobal.context); DoctorsListService service = new DoctorsListService(); - service.checkPaymentStatus(transID, AppGlobal.context).then((res) { + service.checkPaymentStatus(transID, false, AppGlobal.context).then((res) { String paymentInfo = res['Response_Message']; if (paymentInfo == 'Success') { txn_ref = res['Merchant_Reference']; diff --git a/lib/services/appointment_services/GetDoctorsList.dart b/lib/services/appointment_services/GetDoctorsList.dart index 5ba66ea9..0e8a8865 100644 --- a/lib/services/appointment_services/GetDoctorsList.dart +++ b/lib/services/appointment_services/GetDoctorsList.dart @@ -904,7 +904,7 @@ class DoctorsListService extends BaseService { return Future.value(localRes); } - Future checkPaymentStatus(String transactionID, BuildContext context) async { + Future checkPaymentStatus(String transactionID, bool isPharma, BuildContext context) async { Map request; if (await this.sharedPref.getObject(USER_PROFILE) != null) { var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE)); @@ -914,6 +914,7 @@ class DoctorsListService extends BaseService { Request req = appGlobal.getPublicRequest(); request = { "ClientRequestID": transactionID, + "IsPharmacy": isPharma, "VersionID": req.VersionID, "Channel": req.Channel, "LanguageID": languageID == 'ar' ? 1 : 2, diff --git a/lib/services/livecare_services/livecare_provider.dart b/lib/services/livecare_services/livecare_provider.dart index 86baa552..a784d161 100644 --- a/lib/services/livecare_services/livecare_provider.dart +++ b/lib/services/livecare_services/livecare_provider.dart @@ -146,7 +146,7 @@ class LiveCareService extends BaseService { return Future.value(localRes); } - Future getERAppointmentFees(int serviceID, BuildContext context) async { + Future getERAppointmentFees(int serviceID, bool isPharmaLiveCare, BuildContext context) async { Map request; if (await this.sharedPref.getObject(USER_PROFILE) != null) { @@ -155,6 +155,7 @@ class LiveCareService extends BaseService { } request = { + "IsPharmacy": isPharmaLiveCare, "ServiceID": serviceID, "ProjectID": 12, "PatientID": authUser.patientID != null ? authUser.patientID : 0, @@ -172,7 +173,7 @@ class LiveCareService extends BaseService { return Future.value(localRes); } - Future getERAppointmentTime(int serviceID, BuildContext context) async { + Future getERAppointmentTime(int serviceID, bool isPharmaLiveCare, BuildContext context) async { Map request; if (await this.sharedPref.getObject(USER_PROFILE) != null) { @@ -181,6 +182,7 @@ class LiveCareService extends BaseService { } request = { + "IsPharmacy": isPharmaLiveCare, "ServiceID": serviceID, "ProjectID": 12, "Age": authUser.age != null ? authUser.age : 0, @@ -198,7 +200,7 @@ class LiveCareService extends BaseService { return Future.value(localRes); } - Future addNewCallForPatientER(int serviceID, String clientRequestID, BuildContext context) async { + Future addNewCallForPatientER(int serviceID, String clientRequestID, bool isPharma, BuildContext context) async { Map request; String deviceToken; @@ -214,6 +216,7 @@ class LiveCareService extends BaseService { } request = { + "IsPharmacy": isPharma, "ErServiceID": serviceID, "ClientRequestID": clientRequestID, "DeviceToken": deviceToken, diff --git a/lib/uitl/push-notification-handler.dart b/lib/uitl/push-notification-handler.dart index 2a101e94..57f7fb53 100644 --- a/lib/uitl/push-notification-handler.dart +++ b/lib/uitl/push-notification-handler.dart @@ -13,6 +13,7 @@ import 'package:diplomaticquarterapp/pages/webRTC/OpenTok/OpenTok.dart'; import 'package:diplomaticquarterapp/uitl/LocalNotification.dart'; import 'package:diplomaticquarterapp/uitl/app-permissions.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; +import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:firebase_messaging/firebase_messaging.dart'; import 'package:firebase_messaging/firebase_messaging.dart' as fir; import 'package:flutter/cupertino.dart'; @@ -163,7 +164,6 @@ class PushNotificationHandler { } init() async { - hmsApiAvailability = new HmsApiAvailability(); // VoIP Callbacks voIPKit.getVoIPToken().then((value) { print('🎈 example: getVoIPToken: $value'); @@ -226,83 +226,7 @@ class PushNotificationHandler { // if (Platform.isAndroid && (!await FlutterHmsGmsAvailability.isHmsAvailable)) { if (Platform.isAndroid) { try { - await hmsApiAvailability.isHMSAvailable().then((value) async { - if (value != 0) { - final fcmToken = await FirebaseMessaging.instance.getToken(); - if (fcmToken != null) onToken(fcmToken); - } - }); - } catch (ex) {} - } - - if (Platform.isIOS) { - final permission = await FirebaseMessaging.instance.requestPermission(); - if (permission.authorizationStatus == AuthorizationStatus.denied) return; - } else { - // await Permission.notification.request().then((value) { - // }).catchError((err) { - // print(err); - // }); - } - - // 'Android HMS' (Handle Huawei Push_Kit Streams) - // if (Platform.isAndroid) { - // if (Platform.isAndroid && (await FlutterHmsGmsAvailability.isHmsAvailable)) { - - // } else { - // 'Android GMS or iOS' (Handle Firebase Messaging Streams - - try { - FirebaseMessaging.instance.getInitialMessage().then((RemoteMessage message) async { - if (message != null) { - // print("Firebase getInitialMessage with message : ${message.data.toString()}"); - subscribeFCMTopic(); - if (Platform.isIOS) - await Future.delayed(Duration(milliseconds: 3000)).then((value) { - if (message != null) newMessage(message); - }); - else if (message != null) newMessage(message); - } - }); - } catch (ex) {} - - FirebaseMessaging.onMessage.listen((RemoteMessage message) async { - print("Firebase onMessage!!!"); - // Utils.showPermissionConsentDialog(context, "onMessage", (){}); - // newMessage(message); - if (Platform.isIOS) - await Future.delayed(Duration(milliseconds: 3000)).then((value) { - newMessage(message); - }); - else - newMessage(message); - }); - - FirebaseMessaging.onMessageOpenedApp.listen((RemoteMessage message) async { - print("Firebase onMessageOpenedApp!!!"); - if (Platform.isIOS) - await Future.delayed(Duration(milliseconds: 3000)).then((value) { - newMessage(message); - }); - else - newMessage(message); - }); - - FirebaseMessaging.instance.onTokenRefresh.listen((fcm_token) { - print("Push Notification onTokenRefresh: " + fcm_token); - onToken(fcm_token); - }); - - FirebaseMessaging.instance.getToken(vapidKey: 'BHRJG8sIzcysWxPw3B6xQjz_85nUuCfU6EAmpH18kyUTmB2cj35IdFwCyWSab80SA1v6oBSWVh-p6PcHPw_y00Y').then((String token) { - print("Push Notification getToken: " + token); - onToken(token); - }); - - FirebaseMessaging.onBackgroundMessage(backgroundMessageHandler); - - if (Platform.isAndroid) { - await hmsApiAvailability.isHMSAvailable().then((value) async { - if (value == 0) { + if (!(await Utils.isGoogleServicesAvailable())) { h_push.Push.enableLogger(); final result = await h_push.Push.setAutoInitEnabled(true); @@ -320,18 +244,61 @@ class PushNotificationHandler { await h_push.Push.getToken(''); h_push.Push.registerBackgroundMessageHandler(backgroundMessageHandler); + } else { + final fcmToken = await FirebaseMessaging.instance.getToken(); + if (fcmToken != null) onToken(fcmToken); + + try { + FirebaseMessaging.instance.getInitialMessage().then((RemoteMessage message) async { + if (message != null) { + if (Platform.isIOS) + await Future.delayed(Duration(milliseconds: 3000)).then((value) { + if (message != null) newMessage(message); + }); + else if (message != null) newMessage(message); + } + }); + } catch (ex) {} + + FirebaseMessaging.onMessage.listen((RemoteMessage message) async { + print("Firebase onMessage!!!"); + if (Platform.isIOS) + await Future.delayed(Duration(milliseconds: 3000)).then((value) { + newMessage(message); + }); + else + newMessage(message); + }); + + FirebaseMessaging.onMessageOpenedApp.listen((RemoteMessage message) async { + print("Firebase onMessageOpenedApp!!!"); + if (Platform.isIOS) + await Future.delayed(Duration(milliseconds: 3000)).then((value) { + newMessage(message); + }); + else + newMessage(message); + }); + + FirebaseMessaging.instance.onTokenRefresh.listen((fcm_token) { + print("Push Notification onTokenRefresh: " + fcm_token); + onToken(fcm_token); + }); + + FirebaseMessaging.instance.getToken(vapidKey: 'BHRJG8sIzcysWxPw3B6xQjz_85nUuCfU6EAmpH18kyUTmB2cj35IdFwCyWSab80SA1v6oBSWVh-p6PcHPw_y00Y').then((String token) { + print("Push Notification getToken: " + token); + onToken(token); + }); + + FirebaseMessaging.onBackgroundMessage(backgroundMessageHandler); } - }).catchError((err) { - print(err); - }); + } catch (ex) {} } - } - subscribeFCMTopic() async { - print("subscribeFCMTopic!!!"); - await FirebaseMessaging.instance.unsubscribeFromTopic('all_hmg_patients').then((value) async { - await FirebaseMessaging.instance.subscribeToTopic('all_hmg_patients'); - }); + if (Platform.isIOS) { + final permission = await FirebaseMessaging.instance.requestPermission(); + if (permission.authorizationStatus == AuthorizationStatus.denied) return; + } else {} } newMessage(RemoteMessage remoteMessage) async { @@ -374,10 +341,7 @@ class PushNotificationHandler { Future isAndroidPermissionGranted() async { if (Platform.isAndroid) { final bool granted = await flutterLocalNotificationsPlugin.resolvePlatformSpecificImplementation()?.areNotificationsEnabled() ?? false; - if (granted) { - print("-------------------- Permission Granted ------------------------"); - print(granted); - } else { + if (!granted) { await requestPermissions(); } } diff --git a/lib/uitl/utils.dart b/lib/uitl/utils.dart index dbfdac5a..001baf50 100644 --- a/lib/uitl/utils.dart +++ b/lib/uitl/utils.dart @@ -44,6 +44,7 @@ import 'package:diplomaticquarterapp/widgets/dialogs/covid_consent_dialog.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import 'package:google_api_availability/google_api_availability.dart'; // import 'package:flutter_hms_gms_availability/flutter_hms_gms_availability.dart'; import 'package:provider/provider.dart'; @@ -772,6 +773,15 @@ class Utils { ); } + static Future isGoogleServicesAvailable() async { + GooglePlayServicesAvailability availability = await GoogleApiAvailability.instance.checkGooglePlayServicesAvailability(); + String status = availability.toString().split('.').last; + if (status == "success") { + return true; + } + return false; + } + static Widget tableColumnValueWithUnderLine(String text, {bool isLast = false, bool isCapitable = true}) { return Column( crossAxisAlignment: CrossAxisAlignment.start, diff --git a/lib/uitl/utils_new.dart b/lib/uitl/utils_new.dart index 49b213f2..822137cd 100644 --- a/lib/uitl/utils_new.dart +++ b/lib/uitl/utils_new.dart @@ -1,6 +1,5 @@ import 'dart:ui'; -import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:flutter/material.dart'; import 'package:flutter_svg/flutter_svg.dart'; diff --git a/lib/widgets/drawer/app_drawer_widget.dart b/lib/widgets/drawer/app_drawer_widget.dart index 6069520d..debf1656 100644 --- a/lib/widgets/drawer/app_drawer_widget.dart +++ b/lib/widgets/drawer/app_drawer_widget.dart @@ -601,6 +601,7 @@ class _AppDrawerState extends State { switchUser(user, context) { GifLoaderDialogUtils.showMyDialog(context); + sharedPref.remove(BLOOD_TYPE); this.familyFileProvider.silentLoggin(user is AuthenticatedUser ? null : user, mainUser: user is AuthenticatedUser).then((value) { // GifLoaderDialogUtils.hideDialog(context); // Navigator.of(context).pop(); diff --git a/lib/widgets/in_app_browser/InAppBrowser.dart b/lib/widgets/in_app_browser/InAppBrowser.dart index 96eb99cb..4fbc41cc 100644 --- a/lib/widgets/in_app_browser/InAppBrowser.dart +++ b/lib/widgets/in_app_browser/InAppBrowser.dart @@ -37,9 +37,9 @@ class MyInAppBrowser extends InAppBrowser { // static String APPLE_PAY_PAYFORT_URL = 'https://hmgwebservices.com/PayFortWebLive/PayFortApi/MakeApplePayRequest'; // Payfort Payment Gateway URL LIVE static String APPLE_PAY_PAYFORT_URL = 'https://hmgwebservices.com/PayFortWebLive/PayFortApi/MakeApplePayRequest'; // Payfort Payment Gateway URL UAT - // static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort Payment Gateway URL UAT + static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort Payment Gateway URL UAT - static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL LIVE + // static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL LIVE // static String PRESCRIPTION_PAYMENT_WITH_ORDERID = // 'https://uat.hmgwebservices.com/epharmacy/checkout/OpcCompleteRedirectionPaymentClientbyOrder?orderID='; diff --git a/pubspec.yaml b/pubspec.yaml index 58dc042c..cd09986f 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -204,6 +204,7 @@ dependencies: # sms_retriever: ^1.0.0 sms_otp_auto_verify: ^2.1.0 flutter_ios_voip_kit: ^0.0.5 + google_api_availability: ^3.0.1 # firebase_core: 1.12.0 dependency_overrides: From 63426a691dff9f2719fdcfdac13765449d6dae4c Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Tue, 7 Mar 2023 17:16:51 +0300 Subject: [PATCH 13/29] Ancillary orders family members issue resolved --- lib/config/config.dart | 4 +-- .../ancillaryOrdersDetails.dart | 18 +++++----- lib/pages/BookAppointment/BookSuccess.dart | 11 ++---- .../livecare/live_care_payment_page.dart | 36 ++++++++++--------- lib/pages/livecare/widgets/clinic_list.dart | 7 ++-- lib/widgets/in_app_browser/InAppBrowser.dart | 34 +++++++++--------- pubspec.yaml | 2 +- 7 files changed, 56 insertions(+), 56 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index ec7f6255..f050011f 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -20,8 +20,8 @@ var PACKAGES_ORDERS = '/api/orders'; var PACKAGES_ORDER_HISTORY = '/api/orders/items'; var PACKAGES_TAMARA_OPT = '/api/orders/paymentoptions/tamara'; // var BASE_URL = 'http://10.50.100.198:3334/'; - var BASE_URL = 'https://uat.hmgwebservices.com/'; -// var BASE_URL = 'https://hmgwebservices.com/'; +// var BASE_URL = 'https://uat.hmgwebservices.com/'; +var BASE_URL = 'https://hmgwebservices.com/'; // Pharmacy UAT URLs // var BASE_PHARMACY_URL = 'https://uat.hmgwebservices.com/epharmacy/api/'; diff --git a/lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrdersDetails.dart b/lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrdersDetails.dart index fc2d5ecc..1dd34876 100644 --- a/lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrdersDetails.dart +++ b/lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrdersDetails.dart @@ -484,7 +484,7 @@ class _AnicllaryOrdersState extends State with SingleTic onSelectedMethod: (String method, [String selectedInstallmentPlan]) { selectedPaymentMethod = method; this.selectedInstallmentPlan = selectedInstallmentPlan; - openPayment(selectedPaymentMethod, projectViewModel.authenticatedUserObject.user, double.parse(getTotalValue()), null, model, selectedInstallmentPlan); + openPayment(selectedPaymentMethod, projectViewModel.user, double.parse(getTotalValue()), null, model, selectedInstallmentPlan); }, patientShare: double.parse(getTotalValue()), isFromAdvancePayment: !projectViewModel.havePrivilege(94), @@ -494,18 +494,18 @@ class _AnicllaryOrdersState extends State with SingleTic openPayment(String paymentMethod, AuthenticatedUser authenticatedUser, num amount, AppoitmentAllHistoryResultList appo, AnciallryOrdersViewModel model, [String selectedInstallmentPlan]) { browser = new MyInAppBrowser(onExitCallback: onBrowserExit, appo: appo, onLoadStartCallback: onBrowserLoadStart); - transID = Utils.getAdvancePaymentTransID(widget.projectID, projectViewModel.authenticatedUserObject.user.patientID); + transID = Utils.getAdvancePaymentTransID(widget.projectID, projectViewModel.user.patientID); browser.openPaymentBrowser( amount, "Ancillary Orders Payment", transID, widget.projectID.toString(), - projectViewModel.authenticatedUserObject.user.emailAddress, + projectViewModel.user.emailAddress, paymentMethod, - projectViewModel.authenticatedUserObject.user.patientType, - projectViewModel.authenticatedUserObject.user.firstName + " " + projectViewModel.authenticatedUserObject.user.lastName, - projectViewModel.authenticatedUserObject.user.patientID, + projectViewModel.user.patientType, + projectViewModel.user.firstName + " " + projectViewModel.user.lastName, + projectViewModel.user.patientID, authenticatedUser, browser, false, @@ -628,9 +628,9 @@ class _AnicllaryOrdersState extends State with SingleTic res['Amount'], res['Fort_id'], res['PaymentMethod'], - projectViewModel.authenticatedUserObject.user.patientType, - projectViewModel.authenticatedUserObject.user.firstName + " " + projectViewModel.authenticatedUserObject.user.lastName, - projectViewModel.authenticatedUserObject.user.patientID, + projectViewModel.user.patientType, + projectViewModel.user.firstName + " " + projectViewModel.user.lastName, + projectViewModel.user.patientID, localContext) .then((res) { addAdvancedNumberRequest(res['OnlineCheckInAppointments'][0]['AdvanceNumber'].toString(), paymentReference, 0, appo); diff --git a/lib/pages/BookAppointment/BookSuccess.dart b/lib/pages/BookAppointment/BookSuccess.dart index 98f370ba..890b96d8 100644 --- a/lib/pages/BookAppointment/BookSuccess.dart +++ b/lib/pages/BookAppointment/BookSuccess.dart @@ -46,7 +46,7 @@ class BookSuccess extends StatefulWidget { class _BookSuccessState extends State { AppSharedPreferences sharedPref = AppSharedPreferences(); - AuthenticatedUser authUser; + // AuthenticatedUser authUser; ProjectViewModel projectViewModel; String selectedPaymentMethod = ""; @@ -535,13 +535,6 @@ class _BookSuccessState extends State { } Future navigateToPaymentMethod(context, PatientShareResponse patientShareResponse) async { - if (await this.sharedPref.getObject(USER_PROFILE) != null) { - var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE)); - setState(() { - authUser = data; - }); - } - AppoitmentAllHistoryResultList appo = new AppoitmentAllHistoryResultList(); appo.projectID = widget.patientShareResponse.projectID; appo.clinicID = widget.patientShareResponse.clinicID; @@ -563,7 +556,7 @@ class _BookSuccessState extends State { patientShare: widget.patientShareResponse.patientShareWithTax))) .then((value) { if (value != null) { - openPayment(value, authUser, double.parse(patientShareResponse.patientShareWithTax.toString()), patientShareResponse, appo); + openPayment(value, projectViewModel.user, double.parse(patientShareResponse.patientShareWithTax.toString()), patientShareResponse, appo); projectViewModel.analytics.appointment.payment_method(appointment_type: 'regular', clinic: widget.docObject.clinicName, payment_method: value[0], payment_type: 'appointment'); } }); diff --git a/lib/pages/livecare/live_care_payment_page.dart b/lib/pages/livecare/live_care_payment_page.dart index c21a293c..78627450 100644 --- a/lib/pages/livecare/live_care_payment_page.dart +++ b/lib/pages/livecare/live_care_payment_page.dart @@ -298,24 +298,28 @@ class _LiveCarePatmentPageState extends State { if (_selected == 0) { AppToast.showErrorToast(message: TranslationBase.of(context).pleaseAcceptTerms); } else { - askVideoCallPermission().then((value) async { - if (value == true) { - locationUtils = new LocationUtils(isShowConfirmDialog: false, context: context); - locationUtils.getCurrentLocation(callBack: (value) { - print(value); - }); - if (Platform.isAndroid && !(await PlatformBridge.shared().isDrawOverAppsPermissionAllowed())) { - await drawOverAppsMessageDialog(context).then((value) { - return false; + if (widget.isPharmaLiveCare) { + Navigator.pop(context, true); + } else { + askVideoCallPermission().then((value) async { + if (value == true) { + locationUtils = new LocationUtils(isShowConfirmDialog: false, context: context); + locationUtils.getCurrentLocation(callBack: (value) { + print(value); }); + if (Platform.isAndroid && !(await PlatformBridge.shared().isDrawOverAppsPermissionAllowed())) { + await drawOverAppsMessageDialog(context).then((value) { + return false; + }); + } else { + Navigator.pop(context, true); + projectViewModel.analytics.liveCare.livecare_immediate_consultation_TnC(clinic: widget.clinicName); + } } else { - Navigator.pop(context, true); - projectViewModel.analytics.liveCare.livecare_immediate_consultation_TnC(clinic: widget.clinicName); + openPermissionsDialog(); } - } else { - openPermissionsDialog(); - } - }); + }); + } } }, color: CustomColors.green, @@ -332,7 +336,7 @@ class _LiveCarePatmentPageState extends State { @override void dispose() { - cancelAPI(); + // cancelAPI(); super.dispose(); } diff --git a/lib/pages/livecare/widgets/clinic_list.dart b/lib/pages/livecare/widgets/clinic_list.dart index 6e799c89..361d2381 100644 --- a/lib/pages/livecare/widgets/clinic_list.dart +++ b/lib/pages/livecare/widgets/clinic_list.dart @@ -462,7 +462,10 @@ class _clinic_listState extends State { final currency = projectViewModel.user.outSA == 0 ? "sar" : 'aed'; DoctorsListService service = new DoctorsListService(); GifLoaderDialogUtils.showMyDialog(context); - service.checkPaymentStatus(widget.isPharmacyLiveCare ? widget.pharmacyLiveCareQRCode : Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), widget.isPharmacyLiveCare, context).then((res) { + service + .checkPaymentStatus( + widget.isPharmacyLiveCare ? widget.pharmacyLiveCareQRCode : Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), widget.isPharmacyLiveCare, context) + .then((res) { GifLoaderDialogUtils.hideDialog(context); String paymentInfo = res['Response_Message']; amount = res['Amount'].toString(); @@ -595,7 +598,7 @@ class _clinic_listState extends State { widget.isPharmacyLiveCare = true; widget.pharmacyLiveCareQRCode = value.split("/")[1]; liveCareClinicIDs = await sharedPref.getString(LIVECARE_CLINIC_DATA); - selectedClinicID = 7; + selectedClinicID = 1; selectedClinicName = TranslationBase.of(context).pharmaLiveCare; sharedPref.remove(LIVECARE_CLINIC_DATA); startLiveCare(); diff --git a/lib/widgets/in_app_browser/InAppBrowser.dart b/lib/widgets/in_app_browser/InAppBrowser.dart index 4fbc41cc..5d13216f 100644 --- a/lib/widgets/in_app_browser/InAppBrowser.dart +++ b/lib/widgets/in_app_browser/InAppBrowser.dart @@ -37,9 +37,9 @@ class MyInAppBrowser extends InAppBrowser { // static String APPLE_PAY_PAYFORT_URL = 'https://hmgwebservices.com/PayFortWebLive/PayFortApi/MakeApplePayRequest'; // Payfort Payment Gateway URL LIVE static String APPLE_PAY_PAYFORT_URL = 'https://hmgwebservices.com/PayFortWebLive/PayFortApi/MakeApplePayRequest'; // Payfort Payment Gateway URL UAT - static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort Payment Gateway URL UAT + // static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort Payment Gateway URL UAT - // static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL LIVE + static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL LIVE // static String PRESCRIPTION_PAYMENT_WITH_ORDERID = // 'https://uat.hmgwebservices.com/epharmacy/checkout/OpcCompleteRedirectionPaymentClientbyOrder?orderID='; @@ -63,7 +63,7 @@ class MyInAppBrowser extends InAppBrowser { AuthProvider authProvider = new AuthProvider(); InAppBrowser browser = new InAppBrowser(); - AuthenticatedUser authUser; + // AuthenticatedUser authUser; AppoitmentAllHistoryResultList appo; String deviceToken; @@ -125,16 +125,16 @@ class MyInAppBrowser extends InAppBrowser { this.deviceToken = deviceToken; } - getPatientData() async { - if (await this.sharedPref.getObject(USER_PROFILE) != null) { - var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE)); - authUser = data; - } - if (await this.sharedPref.getDouble(USER_LAT) != null && await this.sharedPref.getDouble(USER_LONG) != null) { - lat = await this.sharedPref.getDouble(USER_LAT); - long = await this.sharedPref.getDouble(USER_LONG); - } - } + // getPatientData() async { + // if (await this.sharedPref.getObject(USER_PROFILE) != null) { + // var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE)); + // authUser = data; + // } + // if (await this.sharedPref.getDouble(USER_LAT) != null && await this.sharedPref.getDouble(USER_LONG) != null) { + // lat = await this.sharedPref.getDouble(USER_LAT); + // long = await this.sharedPref.getDouble(USER_LONG); + // } + // } openPackagesPaymentBrowser({@required int customer_id, @required int order_id}) { paymentType = _PAYMENT_TYPE.PACKAGES; @@ -146,7 +146,7 @@ class MyInAppBrowser extends InAppBrowser { AuthenticatedUser authenticatedUser, InAppBrowser browser, bool isLiveCareAppo, var servID, var LiveServID, BuildContext context, [var appoDate, var appoNo, var clinicID, var doctorID, var installments]) async { this.browser = browser; - await getPatientData(); + // await getPatientData(); if (paymentMethod == "ApplePay") { getDeviceToken(); MyChromeSafariBrowser safariBrowser = new MyChromeSafariBrowser(new MyInAppBrowser(), onExitCallback: browser.onExit, onLoadStartCallback: this.browser.onLoadStart, appo: this.appo); @@ -213,7 +213,7 @@ class MyInAppBrowser extends InAppBrowser { tamaraRequestModel.orderDescription = orderDesc; tamaraRequestModel.isInstallment = true; tamaraRequestModel.projectID = num.parse(projId); - tamaraRequestModel.accessCode = authUser.mobileNumber; + tamaraRequestModel.accessCode = authenticatedUser.mobileNumber; tamaraRequestModel.appointmentNo = (appoNo != null && appoNo != "") ? appoNo.toString() : "0"; tamaraRequestModel.customerName = patientName; tamaraRequestModel.fileNumber = patientID.toString(); @@ -254,7 +254,7 @@ class MyInAppBrowser extends InAppBrowser { AuthenticatedUser authenticatedUser, InAppBrowser browser) { this.browser = browser; MyChromeSafariBrowser safariBrowser = new MyChromeSafariBrowser(new MyInAppBrowser(), onExitCallback: browser.onExit, onLoadStartCallback: this.browser.onLoadStart, appo: this.appo); - getPatientData(); + // getPatientData(); generatePharmacyURL(order, amount, orderDesc, transactionID, emailId, paymentMethod, patientName, patientID, authenticatedUser).then((value) { if (order.customValuesXml.contains("ApplePay")) { safariBrowser.open(url: Uri.parse(value)); @@ -300,7 +300,7 @@ class MyInAppBrowser extends InAppBrowser { // if (servID == "4") // form = form.replaceFirst('SERVICE_URL_VALUE', MyInAppBrowser.PREAUTH_SERVICE_URL); // else - form = form.replaceFirst('SERVICE_URL_VALUE', MyInAppBrowser.SERVICE_URL); + form = form.replaceFirst('SERVICE_URL_VALUE', MyInAppBrowser.SERVICE_URL); if (servID != null) { form = form.replaceFirst('SERV_ID', servID); diff --git a/pubspec.yaml b/pubspec.yaml index cd09986f..49f12ca2 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,7 +1,7 @@ name: diplomaticquarterapp description: A new Flutter application. -version: 4.5.015+4050015 +version: 4.5.60+1 environment: sdk: ">=2.7.0 <3.0.0" From e81a1b8bcc89e9b67ab953f83134797e881aa2cf Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Wed, 8 Mar 2023 12:15:06 +0300 Subject: [PATCH 14/29] iOS Firebase fix --- lib/config/config.dart | 2 +- lib/uitl/push-notification-handler.dart | 93 +++++++++++++------------ pubspec.yaml | 2 +- 3 files changed, 51 insertions(+), 46 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index f050011f..f8da7aa7 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -321,7 +321,7 @@ var UPDATE_COVID_QUESTIONNAIRE = 'Services/Doctors.svc/REST/COVID19_Questionnari var CHANNEL = 3; var GENERAL_ID = 'Cs2020@2016\$2958'; var IP_ADDRESS = '10.20.10.20'; -var VERSION_ID = 10.1; +var VERSION_ID = 10.2; var SETUP_ID = '91877'; var LANGUAGE = 2; // var PATIENT_OUT_SA = 0; diff --git a/lib/uitl/push-notification-handler.dart b/lib/uitl/push-notification-handler.dart index 57f7fb53..d8b59782 100644 --- a/lib/uitl/push-notification-handler.dart +++ b/lib/uitl/push-notification-handler.dart @@ -247,58 +247,63 @@ class PushNotificationHandler { } else { final fcmToken = await FirebaseMessaging.instance.getToken(); if (fcmToken != null) onToken(fcmToken); - - try { - FirebaseMessaging.instance.getInitialMessage().then((RemoteMessage message) async { - if (message != null) { - if (Platform.isIOS) - await Future.delayed(Duration(milliseconds: 3000)).then((value) { - if (message != null) newMessage(message); - }); - else if (message != null) newMessage(message); - } - }); - } catch (ex) {} - - FirebaseMessaging.onMessage.listen((RemoteMessage message) async { - print("Firebase onMessage!!!"); - if (Platform.isIOS) - await Future.delayed(Duration(milliseconds: 3000)).then((value) { - newMessage(message); - }); - else - newMessage(message); - }); - - FirebaseMessaging.onMessageOpenedApp.listen((RemoteMessage message) async { - print("Firebase onMessageOpenedApp!!!"); - if (Platform.isIOS) - await Future.delayed(Duration(milliseconds: 3000)).then((value) { - newMessage(message); - }); - else - newMessage(message); - }); - - FirebaseMessaging.instance.onTokenRefresh.listen((fcm_token) { - print("Push Notification onTokenRefresh: " + fcm_token); - onToken(fcm_token); - }); - - FirebaseMessaging.instance.getToken(vapidKey: 'BHRJG8sIzcysWxPw3B6xQjz_85nUuCfU6EAmpH18kyUTmB2cj35IdFwCyWSab80SA1v6oBSWVh-p6PcHPw_y00Y').then((String token) { - print("Push Notification getToken: " + token); - onToken(token); - }); - - FirebaseMessaging.onBackgroundMessage(backgroundMessageHandler); } } catch (ex) {} } if (Platform.isIOS) { + await FirebaseMessaging.instance.setForegroundNotificationPresentationOptions( + alert: true, // Required to display a heads up notification + badge: true, + sound: true, + ); final permission = await FirebaseMessaging.instance.requestPermission(); if (permission.authorizationStatus == AuthorizationStatus.denied) return; } else {} + + try { + FirebaseMessaging.instance.getInitialMessage().then((RemoteMessage message) async { + if (message != null) { + if (Platform.isIOS) + await Future.delayed(Duration(milliseconds: 3000)).then((value) { + if (message != null) newMessage(message); + }); + else if (message != null) newMessage(message); + } + }); + } catch (ex) {} + + FirebaseMessaging.onMessage.listen((RemoteMessage message) async { + print("Firebase onMessage!!!"); + if (Platform.isIOS) + await Future.delayed(Duration(milliseconds: 3000)).then((value) { + newMessage(message); + }); + else + newMessage(message); + }); + + FirebaseMessaging.onMessageOpenedApp.listen((RemoteMessage message) async { + print("Firebase onMessageOpenedApp!!!"); + if (Platform.isIOS) + await Future.delayed(Duration(milliseconds: 3000)).then((value) { + newMessage(message); + }); + else + newMessage(message); + }); + + FirebaseMessaging.instance.onTokenRefresh.listen((fcm_token) { + print("Push Notification onTokenRefresh: " + fcm_token); + onToken(fcm_token); + }); + + FirebaseMessaging.instance.getToken(vapidKey: 'BHRJG8sIzcysWxPw3B6xQjz_85nUuCfU6EAmpH18kyUTmB2cj35IdFwCyWSab80SA1v6oBSWVh-p6PcHPw_y00Y').then((String token) { + print("Push Notification getToken: " + token); + onToken(token); + }); + + FirebaseMessaging.onBackgroundMessage(backgroundMessageHandler); } newMessage(RemoteMessage remoteMessage) async { diff --git a/pubspec.yaml b/pubspec.yaml index 49f12ca2..a7222ce6 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,7 +1,7 @@ name: diplomaticquarterapp description: A new Flutter application. -version: 4.5.60+1 +version: 4.5.61+1 environment: sdk: ">=2.7.0 <3.0.0" From 62b9b3e35c14a16c552834df3c877f082b87ed96 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Mon, 13 Mar 2023 11:17:33 +0300 Subject: [PATCH 15/29] calendar permission handled in iOS --- ios/Podfile | 4 ++++ lib/pages/MyAppointments/widgets/AppointmentActions.dart | 1 + 2 files changed, 5 insertions(+) diff --git a/ios/Podfile b/ios/Podfile index ca8f0966..e4393e8d 100644 --- a/ios/Podfile +++ b/ios/Podfile @@ -46,6 +46,10 @@ post_install do |installer| 'PERMISSION_LOCATION=1', 'PERMISSION_CAMERA=1', 'PERMISSION_MICROPHONE=1', + ## dart: PermissionGroup.calendar + 'PERMISSION_EVENTS=1', + ## dart: PermissionGroup.reminders + 'PERMISSION_REMINDERS=1', ] build_configuration.build_settings['EXCLUDED_ARCHS[sdk=iphonesimulator*]'] = 'arm64 i386' if build_configuration.build_settings['WRAPPER_EXTENSION'] == 'bundle' diff --git a/lib/pages/MyAppointments/widgets/AppointmentActions.dart b/lib/pages/MyAppointments/widgets/AppointmentActions.dart index e7e82fc6..d0fa8669 100644 --- a/lib/pages/MyAppointments/widgets/AppointmentActions.dart +++ b/lib/pages/MyAppointments/widgets/AppointmentActions.dart @@ -107,6 +107,7 @@ class _AppointmentActionsState extends State { locator().appointment.appointment_detail_action(appointment: widget.appo, action: 'hospital location'); break; case "addReminder": + GAnalytics.APPOINTMENT_DETAIL_FLOW_TYPE = 'my appointment'; showReminderDialog( context, new DateFormat("dd MMM yyyy hh:mm") From 1eed37988902122311552e79dc84a9da306b2450 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Mon, 13 Mar 2023 15:05:30 +0300 Subject: [PATCH 16/29] Lab result flowchart fix --- lib/widgets/data_display/medical/LabResult/LabResultWidget.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/widgets/data_display/medical/LabResult/LabResultWidget.dart b/lib/widgets/data_display/medical/LabResult/LabResultWidget.dart index f2d8a693..9a974aef 100644 --- a/lib/widgets/data_display/medical/LabResult/LabResultWidget.dart +++ b/lib/widgets/data_display/medical/LabResult/LabResultWidget.dart @@ -194,7 +194,7 @@ class LabResultWidget extends StatelessWidget { context, FadePage( page: FlowChartPage( - filterName: filterName, + filterName: labResultList[i].description, patientLabOrder: patientLabOrder, ), ), From 6e9cc392696ac2b75a2616033c479547442ca557 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Tue, 21 Mar 2023 14:22:01 +0300 Subject: [PATCH 17/29] Dental fixes --- lib/pages/BookAppointment/DoctorProfile.dart | 38 ++++++++++--------- .../appointment_services/GetDoctorsList.dart | 1 + 2 files changed, 22 insertions(+), 17 deletions(-) diff --git a/lib/pages/BookAppointment/DoctorProfile.dart b/lib/pages/BookAppointment/DoctorProfile.dart index c806e818..426df212 100644 --- a/lib/pages/BookAppointment/DoctorProfile.dart +++ b/lib/pages/BookAppointment/DoctorProfile.dart @@ -492,27 +492,31 @@ class _DoctorProfileState extends State with TickerProviderStateM } void goToBookConfirm() async { - if (widget.isDoctorNameSearch && widget.doctor.clinicID == 17) { - navigateToDentalComplaints(context); - } else { - if (DocAvailableAppointments.areSlotsAvailable) { - if (projectViewModel.isLogin) { + // if (widget.isDoctorNameSearch && widget.doctor.clinicID == 17) { + // navigateToDentalComplaints(context); + // } else { + if (DocAvailableAppointments.areSlotsAvailable) { + if (projectViewModel.isLogin) { + if (widget.isDoctorNameSearch && widget.doctor.clinicID == 17 && projectViewModel.user.age > 12) { + navigateToDentalComplaints(context); + } else { final timeSlot = DocAvailableAppointments.selectedAppoDateTime; navigateToBookConfirm(context); projectViewModel.analytics.appointment.book_appointment_review(appointment_type: 'regular', dateTime: timeSlot, doctor: widget.doctor); - } else { - ConfirmDialog dialog = new ConfirmDialog( - context: context, - confirmMessage: TranslationBase.of(context).loginToUseService, - okText: TranslationBase.of(context).confirm, - cancelText: TranslationBase.of(context).cancel_nocaps, - okFunction: () => {navigateToLogin()}, - cancelFunction: () => {}); - dialog.showAlertDialog(context); } - } else - AppToast.showErrorToast(message: TranslationBase.of(context).selectSlot); - } + } else { + ConfirmDialog dialog = new ConfirmDialog( + context: context, + confirmMessage: TranslationBase.of(context).loginToUseService, + okText: TranslationBase.of(context).confirm, + cancelText: TranslationBase.of(context).cancel_nocaps, + okFunction: () => {navigateToLogin()}, + cancelFunction: () => {}); + dialog.showAlertDialog(context); + } + } else + AppToast.showErrorToast(message: TranslationBase.of(context).selectSlot); + // } } Future navigateToDentalComplaints(BuildContext context) async { diff --git a/lib/services/appointment_services/GetDoctorsList.dart b/lib/services/appointment_services/GetDoctorsList.dart index 0e8a8865..b20d2ed4 100644 --- a/lib/services/appointment_services/GetDoctorsList.dart +++ b/lib/services/appointment_services/GetDoctorsList.dart @@ -120,6 +120,7 @@ class DoctorsListService extends BaseService { "ContinueDentalPlan": false, "IsSearchAppointmnetByClinicID": false, "DoctorName": docName, + "DateofBirth": authUser.dateofBirth != null ? authUser.dateofBirth : null, "PatientID": authUser.patientID != null ? authUser.patientID : 0, "gender": authUser.gender != null ? authUser.gender : 0, "age": authUser.age != null ? authUser.age : 0, From ea82219e9e8766d5ffb269d2eec5c0db17788bc1 Mon Sep 17 00:00:00 2001 From: Sultan khan <> Date: Sun, 2 Apr 2023 11:45:36 +0300 Subject: [PATCH 18/29] Appointment logs --- lib/config/config.dart | 12 +++-- lib/core/service/client/base_app_client.dart | 2 +- lib/models/Appointments/timeSlot.dart | 4 +- lib/pages/BookAppointment/BookConfirm.dart | 15 +++++- .../components/DocAvailableAppointments.dart | 21 +++++++- .../appointment_services/GetDoctorsList.dart | 48 +++++++++++++++++++ 6 files changed, 90 insertions(+), 12 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index ec7f6255..ff79067a 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -20,9 +20,9 @@ var PACKAGES_ORDERS = '/api/orders'; var PACKAGES_ORDER_HISTORY = '/api/orders/items'; var PACKAGES_TAMARA_OPT = '/api/orders/paymentoptions/tamara'; // var BASE_URL = 'http://10.50.100.198:3334/'; - var BASE_URL = 'https://uat.hmgwebservices.com/'; -// var BASE_URL = 'https://hmgwebservices.com/'; - +// var BASE_URL = 'https://uat.hmgwebservices.com/'; +var BASE_URL = 'https://hmgwebservices.com/'; +// var BASE_URL = 'https://orash.cloudsolutions.com.sa/'; // Pharmacy UAT URLs // var BASE_PHARMACY_URL = 'https://uat.hmgwebservices.com/epharmacy/api/'; // var PHARMACY_BASE_URL = 'https://uat.hmgwebservices.com/epharmacy/api/'; @@ -36,7 +36,7 @@ var PHARMACY_BASE_URL = 'https://mdlaboratories.com/exacartapi/api/'; // var PHARMACY_BASE_URL = 'https://mdlaboratories.com/exacartapitest/api/'; // RC API URL -var RC_BASE_URL = 'https://rc.hmg.com/'; +var RC_BASE_URL = 'https://rc.hmg.com/mobile/'; var PING_SERVICE = 'Services/Weather.svc/REST/CheckConnectivity'; @@ -321,7 +321,7 @@ var UPDATE_COVID_QUESTIONNAIRE = 'Services/Doctors.svc/REST/COVID19_Questionnari var CHANNEL = 3; var GENERAL_ID = 'Cs2020@2016\$2958'; var IP_ADDRESS = '10.20.10.20'; -var VERSION_ID = 10.1; +var VERSION_ID = 10.3; var SETUP_ID = '91877'; var LANGUAGE = 2; // var PATIENT_OUT_SA = 0; @@ -587,6 +587,8 @@ var GET_ONESIGNAL_VOIP_TOKEN = 'https://onesignal.com/api/v1/players'; var CANCEL_PHARMA_LIVECARE_REQUEST = 'https://vcallapi.hmg.com/api/PharmaLiveCare/SendPaymentStatus'; +var INSERT_FREE_SLOTS_LOGS = 'Services/Doctors.svc/Rest/InsertDoctorFreeSlotsLogs'; + class AppGlobal { static var context; diff --git a/lib/core/service/client/base_app_client.dart b/lib/core/service/client/base_app_client.dart index 6a421073..a87d71e7 100644 --- a/lib/core/service/client/base_app_client.dart +++ b/lib/core/service/client/base_app_client.dart @@ -161,7 +161,7 @@ class BaseAppClient { if (AppGlobal.isNetworkDebugEnabled) { print("URL : $url"); final jsonBody = json.encode(body); - print(jsonBody); + print(jsonBody); } if (await Utils.checkConnection(bypassConnectionCheck: bypassConnectionCheck)) { diff --git a/lib/models/Appointments/timeSlot.dart b/lib/models/Appointments/timeSlot.dart index 58926fac..b7f1a8cc 100644 --- a/lib/models/Appointments/timeSlot.dart +++ b/lib/models/Appointments/timeSlot.dart @@ -4,7 +4,7 @@ class TimeSlot { String isoTime; DateTime start; DateTime end; - - TimeSlot({@required this.isoTime, @required this.start, @required this.end}); + String vidaDate; + TimeSlot({@required this.isoTime, @required this.start, @required this.end, this.vidaDate}); } diff --git a/lib/pages/BookAppointment/BookConfirm.dart b/lib/pages/BookAppointment/BookConfirm.dart index 635f74a0..473c8650 100644 --- a/lib/pages/BookAppointment/BookConfirm.dart +++ b/lib/pages/BookAppointment/BookConfirm.dart @@ -1,3 +1,5 @@ +import 'dart:convert'; + import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart'; @@ -269,9 +271,10 @@ class _BookConfirmState extends State { }); } - insertAppointment(context, DoctorList docObject, int initialSlotDuration) { + insertAppointment(context, DoctorList docObject, int initialSlotDuration) async{ final timeSlot = DocAvailableAppointments.selectedAppoDateTime; - + String logs = await sharedPref.getString('selectedLogSlots'); + List decodedLogs = json.decode(logs); GifLoaderDialogUtils.showMyDialog(context); AppoitmentAllHistoryResultList appo; widget.service @@ -284,6 +287,14 @@ class _BookConfirmState extends State { getPatientShare(context, res['AppointmentNo'], docObject.clinicID, docObject.projectID, docObject); getToDoCount(); }); + + widget.service.logDoctorFreeSlots(docObject.doctorID, docObject.clinicID, docObject.projectID, decodedLogs,res['AppointmentNo'], context).then((res) { + if (res['MessageStatus'] == 1) { + print("Logs Saved"); + }else{ + print("Error Saving logs"); + } + }); projectViewModel.analytics.appointment.book_appointment_confirmation_success(appointment_type: 'regular', dateTime: timeSlot, doctor: widget.doctor); } else { GifLoaderDialogUtils.hideDialog(context); diff --git a/lib/pages/BookAppointment/components/DocAvailableAppointments.dart b/lib/pages/BookAppointment/components/DocAvailableAppointments.dart index 71c9d0b2..04f6d1b0 100644 --- a/lib/pages/BookAppointment/components/DocAvailableAppointments.dart +++ b/lib/pages/BookAppointment/components/DocAvailableAppointments.dart @@ -16,7 +16,7 @@ import 'package:flutter/material.dart'; import 'package:intl/intl.dart'; import 'package:provider/provider.dart'; import 'package:syncfusion_flutter_calendar/calendar.dart'; - +import 'dart:convert'; import '../../../uitl/date_uitl.dart'; class DocAvailableAppointments extends StatefulWidget { @@ -58,6 +58,7 @@ class _DocAvailableAppointmentsState extends State wit var language; bool isLiveCareSchedule; + // String selectedLogSlots =''; @override void didUpdateWidget(covariant DocAvailableAppointments oldWidget) { @@ -212,6 +213,22 @@ class _DocAvailableAppointmentsState extends State wit if (dayEvents.length != 0) { DocAvailableAppointments.areSlotsAvailable = true; selectedButtonIndex = 0; + // selectedLogSlots = dayEvents[selectedButtonIndex].toString(); + List> timeList =[]; + for(var i =0; i timeSlot={ + "isoTime":dayEvents[i].isoTime, + "start":dayEvents[i].start.toString(), + "end":dayEvents[i].end.toString(), + "vidaDate":dayEvents[i].vidaDate + }; + timeList.add(timeSlot); + } + + + + AppSharedPreferences sharedPref = new AppSharedPreferences(); + sharedPref.setString('selectedLogSlots', json.encode(timeList)); DocAvailableAppointments.selectedTime = dayEvents[selectedButtonIndex].isoTime; } else DocAvailableAppointments.areSlotsAvailable = false; @@ -229,7 +246,7 @@ class _DocAvailableAppointmentsState extends State wit ? DateUtil.convertStringToDate(freeSlotsResponse[i]) : DateUtil.convertStringToDateSaudiTimezone(freeSlotsResponse[i], widget.doctor.projectID); slotsList.add(FreeSlot(date, ['slot'])); - docFreeSlots.add(TimeSlot(isoTime: formatter.format(date), start: new DateTime(date.year, date.month, date.day, 0, 0, 0, 0), end: date)); + docFreeSlots.add(TimeSlot(isoTime: formatter.format(date), start: new DateTime(date.year, date.month, date.day, 0, 0, 0, 0), end: date, vidaDate: freeSlotsResponse[i])); } _eventsParsed = Map.fromIterable(slotsList, key: (e) => e.slot, value: (e) => e.event); setState(() { diff --git a/lib/services/appointment_services/GetDoctorsList.dart b/lib/services/appointment_services/GetDoctorsList.dart index 0e8a8865..428b96fd 100644 --- a/lib/services/appointment_services/GetDoctorsList.dart +++ b/lib/services/appointment_services/GetDoctorsList.dart @@ -1,3 +1,4 @@ +import 'dart:convert'; import 'dart:io'; import 'package:diplomaticquarterapp/config/config.dart'; @@ -1754,4 +1755,51 @@ class DoctorsListService extends BaseService { return Future.value(localRes); } + + + + Future logDoctorFreeSlots(int docID, int clinicID, int projectID, List selectedfreeSlots, dynamic appoNumber, BuildContext context, [ProjectViewModel projectViewModel]) async { + Map requestFreeSlots; + Map request; + + var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + Request req = appGlobal.getPublicRequest(); + requestFreeSlots = { + "DoctorID": docID, + "IsBookingForLiveCare": 0, + "ClinicID": clinicID, + "ProjectID": projectID, + "OriginalClinicID": clinicID, + "days": 0, + "isReschadual": false, + "VersionID": req.VersionID, + "Channel": 3, + "LanguageID": languageID == 'ar' ? 1 : 2, + "IPAdress": "10.20.10.20", + "generalid": "Cs2020@2016\$2958", + "PatientOutSA": authProvider.isLogin ? authUser.outSA : 0, + "SessionID": null, + "isDentalAllowedBackend": false, + "DeviceTypeID": 1 + }; + + request = { + "ClinicID": clinicID, + "ProjectID": projectID, + "AppointmentNo":appoNumber, + "DoctorFreeSlotRequest":requestFreeSlots, + "DoctorFreeSlotResponse":selectedfreeSlots, + "Value1":docID + }; + dynamic localRes; + await baseAppClient.post(INSERT_FREE_SLOTS_LOGS, onSuccess: (response, statusCode) async { + localRes = response; + }, onFailure: (String error, int statusCode) { + throw error; + }, body: request); + + return Future.value(localRes); + } + + } From dfc2889df77ebf445f5130ae78c689379ea5ce87 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Sun, 2 Apr 2023 12:35:39 +0300 Subject: [PATCH 19/29] dental reschedule fix --- lib/pages/MyAppointments/widgets/AppointmentActions.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/pages/MyAppointments/widgets/AppointmentActions.dart b/lib/pages/MyAppointments/widgets/AppointmentActions.dart index d0fa8669..63ad920b 100644 --- a/lib/pages/MyAppointments/widgets/AppointmentActions.dart +++ b/lib/pages/MyAppointments/widgets/AppointmentActions.dart @@ -72,7 +72,7 @@ class _AppointmentActionsState extends State { padding: EdgeInsets.all(21), shrinkWrap: true, itemBuilder: (context, index) { - bool shouldEnable = (widget.appo.clinicID == 17 && widget.appo.clinicID == 47 && appoButtonsList[index].caller == "openReschedule"); + bool shouldEnable = ((widget.appo.clinicID == 17 || widget.appo.clinicID == 47) && appoButtonsList[index].caller == "openReschedule"); return InkWell( onTap: shouldEnable ? null From dc859b01f795278240529ed205698a33f9922460 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Wed, 12 Apr 2023 14:53:05 +0300 Subject: [PATCH 20/29] updates & fixes --- lib/config/localized_values.dart | 2 +- .../fragments/home_page_fragment2.dart | 202 ++++++++++-------- lib/widgets/in_app_browser/InAppBrowser.dart | 6 +- 3 files changed, 113 insertions(+), 97 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 1bf2bd9c..ea622e49 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -1788,7 +1788,7 @@ const Map localizedValues = { "productOutOfStock": {"en": "Out Of Stock", "ar": "إنتهى من المخزن"}, "productQuantity": {"en": "Quantity", "ar": "كمية"}, "yourTurn": {"en": "your turn is after", "ar": "دورك بعد"}, - "patients": {"en": "patients", "ar": "مرضي"}, + "patients": {"en": "patients", "ar": "مريض"}, "group": {"en": "Group", "ar": "مجموعة"}, "covidTestTodo": {"en": "Covid-19 Test", "ar": "فحص كورونا"}, "ancillaryOrdersPaymentConfirm": {"en": "Are you sure you want to make payment for selected orders?", "ar": "هل أنت متأكد أنك تريد سداد قيمة الطلبات المختارة؟"}, diff --git a/lib/pages/landing/fragments/home_page_fragment2.dart b/lib/pages/landing/fragments/home_page_fragment2.dart index 06229ccc..ee856487 100644 --- a/lib/pages/landing/fragments/home_page_fragment2.dart +++ b/lib/pages/landing/fragments/home_page_fragment2.dart @@ -460,112 +460,126 @@ class _HomePageFragment2State extends State { flex: 1, child: InkWell( onTap: () { - widget.onPharmacyClick(); + if (projectViewModel.havePrivilege(100)) widget.onPharmacyClick(); }, - child: Container( - width: double.infinity, - height: double.infinity, - clipBehavior: Clip.antiAlias, - decoration: containerRadiusWithGradientServices(20, lightColor: CustomColors.lightGreyColor, darkColor: CustomColors.lightGreyColor), - child: Stack( - children: [ - Container( - width: double.infinity, - height: double.infinity, - // color: Color(0xFF2B353E), - decoration: containerRadius(Color(0xFF359846), 20), - ), - Container( - width: double.infinity, - height: double.infinity, - clipBehavior: Clip.antiAlias, - decoration: projectViewModel.isArabic - ? containerBottomRightRadiusWithGradientForAr(60, lightColor: CustomColors.lightGreyColor, darkColor: CustomColors.lightGreyColor) - : containerBottomRightRadiusWithGradient(60, lightColor: CustomColors.lightGreyColor, darkColor: CustomColors.lightGreyColor), - child: Stack( - children: [ - SvgPicture.asset( - "assets/images/new/strips.svg", - width: double.infinity, - height: double.infinity, - fit: BoxFit.cover, - ), - ], + child: Stack(children: [ + Container( + width: double.infinity, + height: double.infinity, + clipBehavior: Clip.antiAlias, + decoration: containerRadiusWithGradientServices(20, lightColor: CustomColors.lightGreyColor, darkColor: CustomColors.lightGreyColor), + child: Stack( + children: [ + Container( + width: double.infinity, + height: double.infinity, + // color: Color(0xFF2B353E), + decoration: containerRadius(Color(0xFF359846), 20), ), - ), - projectViewModel.isArabic - ? Positioned( - left: 20, - top: 12, - child: Opacity( - opacity: 0.04, - child: SvgPicture.asset( - "assets/images/new/Pharmacy.svg", - height: MediaQuery.of(context).size.width * 0.15, + Container( + width: double.infinity, + height: double.infinity, + clipBehavior: Clip.antiAlias, + decoration: projectViewModel.isArabic + ? containerBottomRightRadiusWithGradientForAr(60, lightColor: CustomColors.lightGreyColor, darkColor: CustomColors.lightGreyColor) + : containerBottomRightRadiusWithGradient(60, lightColor: CustomColors.lightGreyColor, darkColor: CustomColors.lightGreyColor), + child: Stack( + children: [ + SvgPicture.asset( + "assets/images/new/strips.svg", + width: double.infinity, + height: double.infinity, + fit: BoxFit.cover, + ), + ], + ), + ), + projectViewModel.isArabic + ? Positioned( + left: 20, + top: 12, + child: Opacity( + opacity: 0.04, + child: SvgPicture.asset( + "assets/images/new/Pharmacy.svg", + height: MediaQuery.of(context).size.width * 0.15, + ), + ), + ) + : Positioned( + right: 20, + top: 12, + child: Opacity( + opacity: 0.04, + child: SvgPicture.asset( + "assets/images/new/Pharmacy.svg", + height: MediaQuery.of(context).size.width * 0.15, + ), ), ), - ) - : Positioned( - right: 20, - top: 12, - child: Opacity( - opacity: 0.04, + Container( + width: double.infinity, + height: double.infinity, + padding: EdgeInsets.all(SizeConfig.widthMultiplier * 3.4), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Container( + color: Colors.yellow, + // width: MediaQuery.of(context).size.width * 0.065, child: SvgPicture.asset( "assets/images/new/Pharmacy.svg", - height: MediaQuery.of(context).size.width * 0.15, + height: MediaQuery.of(context).size.width * 0.08, ), ), - ), - Container( - width: double.infinity, - height: double.infinity, - padding: EdgeInsets.all(SizeConfig.widthMultiplier * 3.4), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Container( - color: Colors.yellow, - // width: MediaQuery.of(context).size.width * 0.065, - child: SvgPicture.asset( - "assets/images/new/Pharmacy.svg", - height: MediaQuery.of(context).size.width * 0.08, - ), - ), - mFlex(1), - Column( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Text( - TranslationBase.of(context).onlinePharmacy, - style: TextStyle( - color: Colors.black, - fontSize: 14, - fontWeight: FontWeight.bold, - letterSpacing: -0.45, - height: 1, + mFlex(1), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Text( + TranslationBase.of(context).onlinePharmacy, + style: TextStyle( + color: Colors.black, + fontSize: 14, + fontWeight: FontWeight.bold, + letterSpacing: -0.45, + height: 1, + ), ), - ), - projectViewModel.isArabic ? mHeight(5) : Container(), - Text( - TranslationBase.of(context).ecommerceSolution, - style: TextStyle( - color: Colors.black, - fontSize: 9, - fontWeight: FontWeight.w600, - letterSpacing: -0.27, - height: projectViewModel.isArabic ? 0.2 : 1, + projectViewModel.isArabic ? mHeight(5) : Container(), + Text( + TranslationBase.of(context).ecommerceSolution, + style: TextStyle( + color: Colors.black, + fontSize: 9, + fontWeight: FontWeight.w600, + letterSpacing: -0.27, + height: projectViewModel.isArabic ? 0.2 : 1, + ), ), - ), - ], - ), - ], + ], + ), + ], + ), ), - ), - ], + ], + ), ), - ), + projectViewModel.havePrivilege(100) + ? Container() + : Container( + width: double.infinity, + height: double.infinity, + clipBehavior: Clip.antiAlias, + decoration: containerRadiusWithGradientServices(20, lightColor: CustomColors.lightGreyColor.withOpacity(0.7), darkColor: CustomColors.lightGreyColor.withOpacity(0.7)), + child: Icon( + Icons.lock_outline, + size: 40, + ), + ) + ]), ), ); } diff --git a/lib/widgets/in_app_browser/InAppBrowser.dart b/lib/widgets/in_app_browser/InAppBrowser.dart index 5d13216f..f62248b8 100644 --- a/lib/widgets/in_app_browser/InAppBrowser.dart +++ b/lib/widgets/in_app_browser/InAppBrowser.dart @@ -37,9 +37,11 @@ class MyInAppBrowser extends InAppBrowser { // static String APPLE_PAY_PAYFORT_URL = 'https://hmgwebservices.com/PayFortWebLive/PayFortApi/MakeApplePayRequest'; // Payfort Payment Gateway URL LIVE static String APPLE_PAY_PAYFORT_URL = 'https://hmgwebservices.com/PayFortWebLive/PayFortApi/MakeApplePayRequest'; // Payfort Payment Gateway URL UAT - // static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort Payment Gateway URL UAT + static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort Payment Gateway URL UAT - static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL LIVE + // static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL LIVE + + // static String SERVICE_URL = 'https://uat.hmgwebservices.com/payfortforvidaplus/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL UAT VIDA PLUS // static String PRESCRIPTION_PAYMENT_WITH_ORDERID = // 'https://uat.hmgwebservices.com/epharmacy/checkout/OpcCompleteRedirectionPaymentClientbyOrder?orderID='; From af90ab3aa31b757e39ea07028f0e7c263008dde4 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Mon, 1 May 2023 14:46:58 +0300 Subject: [PATCH 21/29] Sickleave & chart changes --- lib/config/config.dart | 7 ++++--- lib/pages/medical/patient_sick_leave_page.dart | 16 ++++++++-------- lib/widgets/charts/show_chart.dart | 12 ++++++++---- lib/widgets/in_app_browser/InAppBrowser.dart | 4 ++-- pubspec.yaml | 7 +++++-- 5 files changed, 27 insertions(+), 19 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index 74d43540..9b5b512e 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -20,9 +20,10 @@ var PACKAGES_ORDERS = '/api/orders'; var PACKAGES_ORDER_HISTORY = '/api/orders/items'; var PACKAGES_TAMARA_OPT = '/api/orders/paymentoptions/tamara'; // var BASE_URL = 'http://10.50.100.198:3334/'; -// var BASE_URL = 'https://uat.hmgwebservices.com/'; -var BASE_URL = 'https://hmgwebservices.com/'; + var BASE_URL = 'https://uat.hmgwebservices.com/'; +// var BASE_URL = 'https://hmgwebservices.com/'; // var BASE_URL = 'https://orash.cloudsolutions.com.sa/'; +// var BASE_URL = 'https://vidauat.cloudsolutions.com.sa/'; // Pharmacy UAT URLs // var BASE_PHARMACY_URL = 'https://uat.hmgwebservices.com/epharmacy/api/'; @@ -37,7 +38,7 @@ var PHARMACY_BASE_URL = 'https://mdlaboratories.com/exacartapi/api/'; // var PHARMACY_BASE_URL = 'https://mdlaboratories.com/exacartapitest/api/'; // RC API URL -var RC_BASE_URL = 'https://rc.hmg.com/mobile/'; +var RC_BASE_URL = 'https://rc.hmg.com/'; var PING_SERVICE = 'Services/Weather.svc/REST/CheckConnectivity'; diff --git a/lib/pages/medical/patient_sick_leave_page.dart b/lib/pages/medical/patient_sick_leave_page.dart index 1ca32e02..f132741e 100644 --- a/lib/pages/medical/patient_sick_leave_page.dart +++ b/lib/pages/medical/patient_sick_leave_page.dart @@ -57,8 +57,8 @@ class _PatientSickLeavePageState extends State { subName: model.sickLeaveList[index].clinicName, isSortByClinic: false, isInOutPatient: model.sickLeaveList[index].isInOutPatient, - // isSickLeave: true, - // sickLeaveStatus: model.sickLeaveList[index].status, + isSickLeave: true, + sickLeaveStatus: model.sickLeaveList[index].status, onEmailTap: () { showConfirmMessage(model, index); }, @@ -69,13 +69,13 @@ class _PatientSickLeavePageState extends State { } void showConfirmMessage(PatientSickLeaveViewMode model, int index) { - // if (model.sickLeaveList[index].status == 1) { - // openWorkPlaceUpdatePage(model.sickLeaveList[index].requestNo, model.sickLeaveList[index].setupID, model, index, model.sickLeaveList[index].projectID); - // } else if (model.sickLeaveList[index].status == 2) { + if (model.sickLeaveList[index].status == 1) { + openWorkPlaceUpdatePage(model.sickLeaveList[index].requestNo, model.sickLeaveList[index].setupID, model, index, model.sickLeaveList[index].projectID); + } else if (model.sickLeaveList[index].status == 2) { showEmailDialog(model, index); - // } else { - // showApprovalDialog(); - // } + } else { + showApprovalDialog(); + } } void showApprovalDialog() { diff --git a/lib/widgets/charts/show_chart.dart b/lib/widgets/charts/show_chart.dart index 49273611..4d69cd84 100644 --- a/lib/widgets/charts/show_chart.dart +++ b/lib/widgets/charts/show_chart.dart @@ -183,9 +183,13 @@ class ShowChart extends StatelessWidget { getMaxX(); getMin(); getMinY(); - increasingY = ((maxY - minY) / timeSeries.length - 1) * 15; - maxY += increasingY.abs(); - minY -= increasingY.abs(); + try { + increasingY = ((maxY - minY) / timeSeries.length - 1) * 15; + maxY += increasingY.abs(); + minY -= increasingY.abs(); + } catch(ex) { + print(ex); + } } double _fetchLeftTileInterval() { @@ -259,7 +263,7 @@ class ShowChart extends StatelessWidget { barWidth: 1.5, isStrokeCapRound: true, dotData: FlDotData( - show: false, + show: true, ), belowBarData: BarAreaData( show: false, diff --git a/lib/widgets/in_app_browser/InAppBrowser.dart b/lib/widgets/in_app_browser/InAppBrowser.dart index f62248b8..e91990b4 100644 --- a/lib/widgets/in_app_browser/InAppBrowser.dart +++ b/lib/widgets/in_app_browser/InAppBrowser.dart @@ -37,9 +37,9 @@ class MyInAppBrowser extends InAppBrowser { // static String APPLE_PAY_PAYFORT_URL = 'https://hmgwebservices.com/PayFortWebLive/PayFortApi/MakeApplePayRequest'; // Payfort Payment Gateway URL LIVE static String APPLE_PAY_PAYFORT_URL = 'https://hmgwebservices.com/PayFortWebLive/PayFortApi/MakeApplePayRequest'; // Payfort Payment Gateway URL UAT - static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort Payment Gateway URL UAT + // static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort Payment Gateway URL UAT - // static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL LIVE + static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL LIVE // static String SERVICE_URL = 'https://uat.hmgwebservices.com/payfortforvidaplus/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL UAT VIDA PLUS diff --git a/pubspec.yaml b/pubspec.yaml index a7222ce6..46d8b2f1 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,7 +1,7 @@ name: diplomaticquarterapp description: A new Flutter application. -version: 4.5.61+1 +version: 4.5.62+1 environment: sdk: ">=2.7.0 <3.0.0" @@ -34,7 +34,7 @@ dependencies: health: ^3.0.3 #chart - fl_chart: ^0.40.2 + fl_chart: ^0.45.0 #Camera Preview camera: ^0.10.1 @@ -172,6 +172,8 @@ dependencies: flutter_nfc_kit: ^3.3.1 + geofencing: ^0.1.0 + # speech_to_text: ^6.1.1 # path: speech_to_text @@ -205,6 +207,7 @@ dependencies: sms_otp_auto_verify: ^2.1.0 flutter_ios_voip_kit: ^0.0.5 google_api_availability: ^3.0.1 +# flutter_callkit_incoming: ^1.0.3+3 # firebase_core: 1.12.0 dependency_overrides: From 670991eca49c1363597999cb96d702277ff1341d Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Tue, 2 May 2023 18:06:10 +0300 Subject: [PATCH 22/29] Lab result fix --- lib/pages/login/register.dart | 235 +++++++++--------- .../medical/labs/laboratory_result_page.dart | 17 +- .../data_display/medical/doctor_card.dart | 2 +- 3 files changed, 134 insertions(+), 120 deletions(-) diff --git a/lib/pages/login/register.dart b/lib/pages/login/register.dart index bdb2b623..04b38e67 100644 --- a/lib/pages/login/register.dart +++ b/lib/pages/login/register.dart @@ -2,7 +2,6 @@ import 'package:diplomaticquarterapp/analytics/flows/login_registration.dart'; import 'package:diplomaticquarterapp/analytics/google-analytics.dart'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/config/size_config.dart'; -import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/locator.dart'; import 'package:diplomaticquarterapp/models/Authentication/check_user_status_reponse.dart'; import 'package:diplomaticquarterapp/models/Authentication/check_user_status_req.dart'; @@ -56,125 +55,127 @@ class _Register extends State { @override Widget build(BuildContext context) { return AppScaffold( - - appBarTitle: TranslationBase.of(context).register, - isShowAppBar: false, - isShowDecPage: false, - showNewAppBar: false, - showNewAppBarTitle: true, - body: Column( - children: [ - Expanded( - child: ListView( - padding: EdgeInsets.all(21), - physics: BouncingScrollPhysics(), - children: [ - SizedBox(height: 10), - Padding( - padding: EdgeInsets.all(10), - child: Text( - TranslationBase.of(context).enterNationalId, - style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.64, height: 23 / 16), - )), - SizedBox(height: 10), - PhoneNumberSelectorWidget(onNumberChange: (value) => {mobileNo = value, validateForm()}, onCountryChange: (value) => countryCode = value), - SizedBox(height: 12), - Directionality(textDirection: TextDirection.ltr, child: inputWidget(TranslationBase.of(context).nationalIdNumber, "Xxxxxxxxx", nationalIDorFile)), - SizedBox(height: 20), - Row( - children: [ - Expanded( - child: Row( - children: [ - Radio( - value: 1, - groupValue: isHijri, - onChanged: (value) { - setState(() { - isHijri = value; - }); - validateForm(); - }, - ), - Text(TranslationBase.of(context).hijriDate), - ], - ), + appBarTitle: TranslationBase.of(context).register, + isShowAppBar: false, + isShowDecPage: false, + showNewAppBar: false, + showNewAppBarTitle: true, + body: Column( + children: [ + Expanded( + child: ListView( + padding: EdgeInsets.all(21), + physics: BouncingScrollPhysics(), + children: [ + SizedBox(height: 10), + Padding( + padding: EdgeInsets.all(10), + child: Text( + TranslationBase.of(context).enterNationalId, + style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.64, height: 23 / 16), + )), + SizedBox(height: 10), + PhoneNumberSelectorWidget(onNumberChange: (value) => {mobileNo = value, validateForm()}, onCountryChange: (value) => countryCode = value), + SizedBox(height: 12), + Directionality(textDirection: TextDirection.ltr, child: inputWidget(TranslationBase.of(context).nationalIdNumber, "Xxxxxxxxx", nationalIDorFile)), + SizedBox(height: 20), + Row( + children: [ + Expanded( + child: Row( + children: [ + Radio( + value: 1, + groupValue: isHijri, + onChanged: (value) { + setState(() { + isHijri = value; + }); + validateForm(); + }, + ), + Text(TranslationBase.of(context).hijriDate), + ], ), - Expanded( - child: Row( - children: [ - Radio( - value: 0, - groupValue: isHijri, - onChanged: (value) { - setState(() { - isHijri = value; - }); - validateForm(); - }, - ), - Text(TranslationBase.of(context).gregorianDate), - ], - ), + ), + Expanded( + child: Row( + children: [ + Radio( + value: 0, + groupValue: isHijri, + onChanged: (value) { + setState(() { + isHijri = value; + }); + validateForm(); + }, + ), + Text(TranslationBase.of(context).gregorianDate), + ], ), - ], - ), - Row(children: [ - Container( - width: SizeConfig.realScreenWidth * .9, - child: isHijri == 1 - ? Directionality( - textDirection: TextDirection.ltr, - child: inputWidget(TranslationBase.of(context).dob, "DD/MM/YYYYY", dob, - isNumber: false, - suffix: Icon( - Icons.calendar_today, - size: 16, - ))) - : Container( - child: InkWell( - onTap: () { - if (isHijri != null) _selectDate(context); - }, - child: Directionality( - textDirection: TextDirection.ltr, - child: inputWidget(TranslationBase.of(context).dob, "DD/MM/YYYYY", dobEn, - isNumber: false, - isEnable: false, - suffix: Icon( - Icons.calendar_today, - size: 16, - )))))), - ]) - ], - ), + ), + ], + ), + Row(children: [ + Container( + width: SizeConfig.realScreenWidth * .9, + child: isHijri == 1 + ? Directionality( + textDirection: TextDirection.ltr, + child: inputWidget(TranslationBase.of(context).dob, "DD/MM/YYYYY", dob, + isNumber: false, + suffix: Icon( + Icons.calendar_today, + size: 16, + ))) + : Container( + child: InkWell( + onTap: () { + if (isHijri != null) _selectDate(context); + }, + child: Directionality( + textDirection: TextDirection.ltr, + child: inputWidget(TranslationBase.of(context).dob, "DD/MM/YYYYY", dobEn, + isNumber: false, + isEnable: false, + suffix: Icon( + Icons.calendar_today, + size: 16, + )))))), + ]) + ], ), - Container( - width: double.maxFinite, - // height: 80.0, - color: Colors.white, - // margin: EdgeInsets.only(bottom: 50.0), - child: Row( - children: [ - Expanded( - child: Padding( - padding: EdgeInsets.all(10), child: DefaultButton(TranslationBase.of(context).cancel, () { - Navigator.of(context).pop(); - locator().loginRegistration.registration_cancel(step: 'enter details'); - }, textColor: Colors.white, color: Color(0xffD02127))), - ), - Expanded( - child: Padding( - padding: EdgeInsets.all(10), - child: DefaultButton(TranslationBase.of(context).next, (){ - startRegistration(); - locator().loginRegistration.registration_enter_details(); - }, textColor: Colors.white, color: isButtonDisabled == true ? Colors.grey : Color(0xff359846))), - ), - ], - ),) - ], - ),); + ), + Container( + width: double.maxFinite, + // height: 80.0, + color: Colors.white, + // margin: EdgeInsets.only(bottom: 50.0), + child: Row( + children: [ + Expanded( + child: Padding( + padding: EdgeInsets.all(10), + child: DefaultButton(TranslationBase.of(context).cancel, () { + Navigator.of(context).pop(); + locator().loginRegistration.registration_cancel(step: 'enter details'); + }, textColor: Colors.white, color: Color(0xffD02127))), + ), + Expanded( + child: Padding( + padding: EdgeInsets.all(10), + child: DefaultButton(TranslationBase.of(context).next, () { + startRegistration(); + locator().loginRegistration.registration_enter_details(); + }, textColor: Colors.white, color: isButtonDisabled == true ? Colors.grey : Color(0xff359846))), + ), + ], + ), + ) + ], + ), + ); } Future _selectDate(BuildContext context) async { diff --git a/lib/pages/medical/labs/laboratory_result_page.dart b/lib/pages/medical/labs/laboratory_result_page.dart index 4bd29c19..847f979b 100644 --- a/lib/pages/medical/labs/laboratory_result_page.dart +++ b/lib/pages/medical/labs/laboratory_result_page.dart @@ -47,13 +47,26 @@ class _LaboratoryResultPageState extends State { GifLoaderDialogUtils.hideDialog(context); }, billNo: widget.patientLabOrders.invoiceNo, - details: model.patientLabSpecialResult[index].resultDataHTML, + // details: model.patientLabSpecialResult[index].resultDataHTML, + details: model.patientLabSpecialResult.isEmpty ? null : getSpecialResults(model), orderNo: widget.patientLabOrders.orderNo, patientLabOrder: widget.patientLabOrders, ), - itemCount: model.patientLabSpecialResult.length, + itemCount: 1, ), ), ); } + + String getSpecialResults(LabsViewModel model) { + String labResults = ""; + model.patientLabSpecialResult.forEach((element) { + if (element.resultDataHTML != null) { + labResults += (element.resultDataHTML + "

"); + } else { + labResults += ("

No Result Available
"); + } + }); + return labResults; + } } diff --git a/lib/widgets/data_display/medical/doctor_card.dart b/lib/widgets/data_display/medical/doctor_card.dart index d58dccf3..f06d508a 100644 --- a/lib/widgets/data_display/medical/doctor_card.dart +++ b/lib/widgets/data_display/medical/doctor_card.dart @@ -224,7 +224,7 @@ class DoctorCard extends StatelessWidget { onTap: onEmailTap, child: Icon( Icons.email, - color: Theme.of(context).primaryColor, + color: sickLeaveStatus != 3 ? Theme.of(context).primaryColor : Colors.grey[400], ), ) : onTap != null From 701eedf147363929368aba57229380fb66fa90c9 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Tue, 9 May 2023 09:58:00 +0300 Subject: [PATCH 23/29] updates --- lib/config/localized_values.dart | 6 +++--- lib/pages/login/register-info.dart | 9 ++++++--- lib/pages/login/register_new_dubai.dart | 0 lib/widgets/new_design/doctor_header.dart | 10 +++++----- 4 files changed, 14 insertions(+), 11 deletions(-) create mode 100644 lib/pages/login/register_new_dubai.dart diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index ea622e49..1c02644e 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -208,7 +208,7 @@ const Map localizedValues = { "last-name": {"en": "Last Name", "ar": "إسم العائلة"}, "female": {"en": "Female", "ar": "أنثى"}, "male": {"en": "Male", "ar": "ذكر"}, - "preferred-language": {"en": "Preferred Language", "ar": "اللغة المفضلة"}, + "preferred-language": {"en": "Preferred Language *", "ar": "اللغة المفضلة *"}, "english": {"en": "English", "ar": "الإنجليزية"}, "arabic": {"en": "Arabic", "ar": "العربية"}, "locations-register": {"en": "Where do you want to create this file?", "ar": "أين تريد فتح هذا الملف؟"}, @@ -682,7 +682,7 @@ const Map localizedValues = { "ar": "توفر هذه الخدمة مجموعه من خدمات الرعايه الصحيه المنزلية و متابعه مستمره وشامله للذين لا يستطيعون الوصول للمنشات الصحيه في اماكن اقامتهم (التحاليل المخبرية – الاشعة – التطعيمات – العلاج الطبيعي) ..." }, - "email": {"en": "Email", "ar": "البريد الالكتروني"}, + "email": {"en": "Email *", "ar": "البريد الالكتروني *"}, "Book": {"en": "Book", "ar": "حجز"}, "AppointmentLabel": {"en": "Appointment", "ar": "موعد"}, "BloodType": {"en": "Blood Type", "ar": "فصيلة الدم"}, @@ -1324,7 +1324,7 @@ const Map localizedValues = { "notif-permission-title": {"en": "Could not set the water reminders", "ar": "لا يمكن ضبط اشعار شرب الماء"}, "notif-permission-msg": {"en": "To recieve water reminders, please turn on notifications in the system settings", "ar": "الرجاء تفعيل الاشعارات في الاعدادات"}, "verification_message_code": {"en": "Please enter verification code", "ar": "الرجاء إدخال رمز التحقق"}, - "select-location": {"en": "Select Location", "ar": "اختر الموقع"}, + "select-location": {"en": "Select Location *", "ar": "اختر الموقع *"}, "result-header": {"en": "Get the result in Few Hours", "ar": "احصل على النتيجة خلال عدة ساعات"}, "please_select_gender": {"en": "Please select gender", "ar": "يرجى تحديد الجنس"}, "covid-info": { diff --git a/lib/pages/login/register-info.dart b/lib/pages/login/register-info.dart index 5d7db69f..53d113e3 100644 --- a/lib/pages/login/register-info.dart +++ b/lib/pages/login/register-info.dart @@ -26,7 +26,6 @@ import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; -import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:hijri/hijri_calendar.dart'; import 'package:intl/intl.dart'; @@ -278,7 +277,7 @@ class _RegisterInfo extends State { Expanded( child: Padding( padding: EdgeInsets.all(10), - child: DefaultButton(TranslationBase.of(context).cancel, () { + child: DefaultButton(page == 2 ? TranslationBase.of(context).back : TranslationBase.of(context).cancel, () { Navigator.of(context).pop(); locator().loginRegistration.registration_cancel(step: page == 1 ? 'personal info' : 'other details'); }, textColor: Colors.white, color: Color(0xffD02127))), @@ -287,7 +286,11 @@ class _RegisterInfo extends State { child: Padding( padding: EdgeInsets.all(10), child: DefaultButton(page == 1 ? TranslationBase.of(context).next : TranslationBase.of(context).register, () { - nextPage(); + if (isValid() && page == 2 || page == 1) { + nextPage(); + } else { + Utils.showErrorToast(TranslationBase.of(context).validEmail); + } page == 1 ? locator().loginRegistration.registration_personal_info() : locator().loginRegistration.registration_patient_info(); }, textColor: Colors.white, color: isValid() == true && page == 2 || page == 1 ? Color(0xff359846) : Colors.grey)), ), diff --git a/lib/pages/login/register_new_dubai.dart b/lib/pages/login/register_new_dubai.dart new file mode 100644 index 00000000..e69de29b diff --git a/lib/widgets/new_design/doctor_header.dart b/lib/widgets/new_design/doctor_header.dart index 2c9bb42a..806cbb4a 100644 --- a/lib/widgets/new_design/doctor_header.dart +++ b/lib/widgets/new_design/doctor_header.dart @@ -302,7 +302,7 @@ class DoctorHeader extends StatelessWidget { ], ), Container( - margin: EdgeInsets.only(top: 10.0, left: 20.0, right: 20.0), + margin: EdgeInsets.only(top: 10.0, left: 10.0, right: 10.0), child: Text(getRatingWidth(doctorDetailsList[0].patientNumber).round().toString() + "%", style: TextStyle(fontSize: 14.0, color: Colors.black, fontWeight: FontWeight.w600)), ), @@ -323,7 +323,7 @@ class DoctorHeader extends StatelessWidget { ], ), Container( - margin: EdgeInsets.only(top: 10.0, left: 20.0, right: 20.0), + margin: EdgeInsets.only(top: 10.0, left: 10.0, right: 10.0), child: Text(getRatingWidth(doctorDetailsList[1].patientNumber).round().toString() + "%", style: TextStyle(fontSize: 14.0, color: Colors.black, fontWeight: FontWeight.w600)), ), @@ -344,7 +344,7 @@ class DoctorHeader extends StatelessWidget { ], ), Container( - margin: EdgeInsets.only(top: 10.0, left: 20.0, right: 20.0), + margin: EdgeInsets.only(top: 10.0, left: 10.0, right: 10.0), child: Text(getRatingWidth(doctorDetailsList[2].patientNumber).round().toString() + "%", style: TextStyle(fontSize: 14.0, color: Colors.black, fontWeight: FontWeight.w600)), ), @@ -365,7 +365,7 @@ class DoctorHeader extends StatelessWidget { ], ), Container( - margin: EdgeInsets.only(top: 10.0, left: 20.0, right: 20.0), + margin: EdgeInsets.only(top: 10.0, left: 10.0, right: 10.0), child: Text(getRatingWidth(doctorDetailsList[3].patientNumber).round().toString() + "%", style: TextStyle(fontSize: 14.0, color: Colors.black, fontWeight: FontWeight.w600)), ), @@ -387,7 +387,7 @@ class DoctorHeader extends StatelessWidget { ], ), Container( - margin: EdgeInsets.only(top: 10.0, left: 20.0, right: 20.0), + margin: EdgeInsets.only(top: 10.0, left: 10.0, right: 10.0), child: Text(getRatingWidth(doctorDetailsList[4].patientNumber).round().toString() + "%", style: TextStyle(fontSize: 14.0, color: Colors.black, fontWeight: FontWeight.w600)), ), From c48f393f95ac7dd574487005a4f3cd8fb6bd3c56 Mon Sep 17 00:00:00 2001 From: Sultan khan <> Date: Tue, 9 May 2023 10:33:49 +0300 Subject: [PATCH 24/29] Dubai registration fixed --- lib/config/config.dart | 6 +- lib/config/shared_pref_kay.dart | 1 + lib/core/viewModels/project_view_model.dart | 8 +- .../check_paitent_authentication_req.dart | 16 +- lib/models/Authentication/countries_list.dart | 21 + lib/pages/login/confirm-login.dart | 19 +- lib/pages/login/register-info.dart | 1095 ++++++++++++----- lib/pages/login/register.dart | 9 +- .../authentication/auth_provider.dart | 14 +- .../clinic_services/get_clinic_service.dart | 10 + 10 files changed, 882 insertions(+), 317 deletions(-) create mode 100644 lib/models/Authentication/countries_list.dart diff --git a/lib/config/config.dart b/lib/config/config.dart index 9b5b512e..96c71d2c 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -19,9 +19,9 @@ var PACKAGES_SHOPPING_CART = '/api/shopping_cart_items'; var PACKAGES_ORDERS = '/api/orders'; var PACKAGES_ORDER_HISTORY = '/api/orders/items'; var PACKAGES_TAMARA_OPT = '/api/orders/paymentoptions/tamara'; -// var BASE_URL = 'http://10.50.100.198:3334/'; + // var BASE_URL = 'http://10.50.100.198:2018/'; var BASE_URL = 'https://uat.hmgwebservices.com/'; -// var BASE_URL = 'https://hmgwebservices.com/'; +//var BASE_URL = 'https://hmgwebservices.com/'; // var BASE_URL = 'https://orash.cloudsolutions.com.sa/'; // var BASE_URL = 'https://vidauat.cloudsolutions.com.sa/'; @@ -591,6 +591,8 @@ var CANCEL_PHARMA_LIVECARE_REQUEST = 'https://vcallapi.hmg.com/api/PharmaLiveCar var INSERT_FREE_SLOTS_LOGS = 'Services/Doctors.svc/Rest/InsertDoctorFreeSlotsLogs'; +var GET_NATIONALITY ='Services/Lists.svc/REST/GetNationality'; + class AppGlobal { static var context; diff --git a/lib/config/shared_pref_kay.dart b/lib/config/shared_pref_kay.dart index 9e5c4f27..ec82db11 100644 --- a/lib/config/shared_pref_kay.dart +++ b/lib/config/shared_pref_kay.dart @@ -42,3 +42,4 @@ const APPOINTMENT_HISTORY_MEDICAL = 'APPOINTMENT_HISTORY_MEDICAL'; const CLINICS_LIST = 'CLINICS_LIST'; const COVID_QA_LIST = 'COVID_QA_LIST'; const IS_COVID_CONSENT_SHOWN = 'IS_COVID_CONSENT_SHOWN'; +const REGISTER_INFO_DUBAI ='register-info-dubai'; diff --git a/lib/core/viewModels/project_view_model.dart b/lib/core/viewModels/project_view_model.dart index a536d527..c45e7dd8 100644 --- a/lib/core/viewModels/project_view_model.dart +++ b/lib/core/viewModels/project_view_model.dart @@ -8,6 +8,7 @@ import 'package:diplomaticquarterapp/core/model/privilege/PrivilegeModel.dart'; import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart'; import 'package:diplomaticquarterapp/locator.dart'; import 'package:diplomaticquarterapp/models/Appointments/laser_body_parts.dart'; +import 'package:diplomaticquarterapp/models/Authentication/register_info_response.dart'; import 'package:diplomaticquarterapp/uitl/PlatformBridge.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:flutter/cupertino.dart'; @@ -38,9 +39,10 @@ class ProjectViewModel extends BaseViewModel { double _latitude; double _longitude; + RegisterInfoResponse _registerInfo =RegisterInfoResponse(); double get latitude => _latitude; double get longitude => _longitude; - + RegisterInfoResponse get registerInfo=> _registerInfo; dynamic get searchValue => searchvalue; Locale get appLocal => _appLocale; @@ -164,4 +166,8 @@ class ProjectViewModel extends BaseViewModel { searchvalue = data; notifyListeners(); } + setRegisterData(RegisterInfoResponse data){ + _registerInfo =data; + notifyListeners(); + } } diff --git a/lib/models/Authentication/check_paitent_authentication_req.dart b/lib/models/Authentication/check_paitent_authentication_req.dart index 2846c1fc..76493f87 100644 --- a/lib/models/Authentication/check_paitent_authentication_req.dart +++ b/lib/models/Authentication/check_paitent_authentication_req.dart @@ -15,7 +15,9 @@ class CheckPatientAuthenticationReq { Null sessionID; bool isDentalAllowedBackend; int deviceTypeID; - + String dob; + int isHijri; + String healthId; CheckPatientAuthenticationReq( {this.patientMobileNumber, this.zipCode, @@ -32,7 +34,11 @@ class CheckPatientAuthenticationReq { this.patientOutSA, this.sessionID, this.isDentalAllowedBackend, - this.deviceTypeID}); + this.deviceTypeID, + this.dob, + this.isHijri, + this.healthId + }); CheckPatientAuthenticationReq.fromJson(Map json) { patientMobileNumber = json['PatientMobileNumber']; @@ -51,6 +57,9 @@ class CheckPatientAuthenticationReq { sessionID = json['SessionID']; isDentalAllowedBackend = json['isDentalAllowedBackend']; deviceTypeID = json['DeviceTypeID']; + dob = json['dob']; + isHijri = json['isHijri']; + healthId = json['HealthId']; } Map toJson() { @@ -71,6 +80,9 @@ class CheckPatientAuthenticationReq { data['SessionID'] = this.sessionID; data['isDentalAllowedBackend'] = this.isDentalAllowedBackend; data['DeviceTypeID'] = this.deviceTypeID; + data['dob'] =this.dob; + data['isHijri'] = this.isHijri; + data['HealthId'] = healthId; return data; } } diff --git a/lib/models/Authentication/countries_list.dart b/lib/models/Authentication/countries_list.dart new file mode 100644 index 00000000..3c314da9 --- /dev/null +++ b/lib/models/Authentication/countries_list.dart @@ -0,0 +1,21 @@ +class CountriesLists { + String iD; + String name; + dynamic nameN; + + CountriesLists({this.iD, this.name, this.nameN}); + + CountriesLists.fromJson(Map json) { + iD = json['ID']; + name = json['Name']; + nameN = json['NameN']; + } + + Map toJson() { + final Map data = new Map(); + data['ID'] = this.iD; + data['Name'] = this.name; + data['NameN'] = this.nameN; + return data; + } +} \ No newline at end of file diff --git a/lib/pages/login/confirm-login.dart b/lib/pages/login/confirm-login.dart index 1fd3bbda..73012bd5 100644 --- a/lib/pages/login/confirm-login.dart +++ b/lib/pages/login/confirm-login.dart @@ -42,8 +42,8 @@ import 'package:provider/provider.dart'; class ConfirmLogin extends StatefulWidget { final Function changePageViewIndex; final fromRegistration; - - const ConfirmLogin({Key key, this.changePageViewIndex, this.fromRegistration = false}) : super(key: key); + final bool isDubai; + const ConfirmLogin({Key key, this.changePageViewIndex, this.fromRegistration = false, this.isDubai =false}) : super(key: key); @override _ConfirmLogin createState() => _ConfirmLogin(); @@ -385,8 +385,10 @@ class _ConfirmLogin extends State { var request = this.getCommonRequest(type: type); request.sMSSignature = await SMSOTP.getSignature(); GifLoaderDialogUtils.showMyDialog(context); - if (healthId != null) { - request.dob = dob; //isHijri == 1 ? dob : dateFormat2.format(dateFormat.parse(dob)); + if (healthId != null || widget.isDubai) { + if(!widget.isDubai){ + request.dob = dob; //isHijri == 1 ? dob : dateFormat2.format(dateFormat.parse(dob)); + } request.healthId = healthId; request.isHijri = isHijri; await this.authService.sendActivationCodeRegister(request).then((result) { @@ -547,7 +549,7 @@ class _ConfirmLogin extends State { request.searchType = this.registerd_data.searchType != null ? this.registerd_data.searchType : 1; request.patientID = this.registerd_data.patientID != null ? this.registerd_data.patientID : 0; request.patientIdentificationID = request.nationalID = this.registerd_data.patientIdentificationID != null ? this.registerd_data.patientIdentificationID : '0'; - + request.dob = this.registerd_data.dob; request.isRegister = this.registerd_data.isRegister; } else { request.searchType = request.searchType != null ? request.searchType : 2; @@ -565,8 +567,10 @@ class _ConfirmLogin extends State { GifLoaderDialogUtils.showMyDialog(context); var request = this.getCommonRequest().toJson(); dynamic res; - if (healthId != null) { - request['DOB'] = dob; + if (healthId != null || widget.isDubai) { + if(!widget.isDubai) { + request['DOB'] = dob; + } request['HealthId'] = healthId; request['IsHijri'] = isHijri; @@ -579,6 +583,7 @@ class _ConfirmLogin extends State { result = CheckActivationCode.fromJson(result), if (this.registerd_data != null && this.registerd_data.isRegister == true) { + // if(widget.isDubai ==false){ widget.changePageViewIndex(1), Navigator.popUntil(context, (route) => Utils.route(route, equalsTo: RegisterNew)), } diff --git a/lib/pages/login/register-info.dart b/lib/pages/login/register-info.dart index 5d7db69f..716c2006 100644 --- a/lib/pages/login/register-info.dart +++ b/lib/pages/login/register-info.dart @@ -6,8 +6,10 @@ import 'package:diplomaticquarterapp/core/viewModels/appointment_rate_view_model import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/locator.dart'; import 'package:diplomaticquarterapp/models/Appointments/toDoCountProviderModel.dart'; -import 'package:diplomaticquarterapp/models/Authentication/check_activation_code_response.dart' as checkActivation; +import 'package:diplomaticquarterapp/models/Authentication/check_activation_code_response.dart' + as checkActivation; import 'package:diplomaticquarterapp/models/Authentication/check_paitent_authentication_req.dart'; +import 'package:diplomaticquarterapp/models/Authentication/countries_list.dart'; import 'package:diplomaticquarterapp/models/Authentication/register_info_response.dart'; import 'package:diplomaticquarterapp/pages/landing/landing_page.dart'; import 'package:diplomaticquarterapp/pages/rateAppointment/rate_appointment_doctor.dart'; @@ -36,7 +38,8 @@ class RegisterInfo extends StatefulWidget { final Function changePageViewIndex; final int page; - const RegisterInfo({Key key, this.changePageViewIndex, this.page = 1}) : super(key: key); + const RegisterInfo({Key key, this.changePageViewIndex, this.page = 1}) + : super(key: key); @override _RegisterInfo createState() => _RegisterInfo(); @@ -45,7 +48,7 @@ class RegisterInfo extends StatefulWidget { class _RegisterInfo extends State { final authService = new AuthProvider(); final sharedPref = new AppSharedPreferences(); - RegisterInfoResponse registerInfo; + RegisterInfoResponse registerInfo =RegisterInfoResponse(); bool isLoading; int page; final List locationList = [ @@ -53,31 +56,49 @@ class _RegisterInfo extends State { new Location(name: 'Dubai', value: '2'), ]; String language = '1'; - var registerd_data; + CheckPatientAuthenticationReq registerd_data; final List languageList = [ new Language(name: 'English', value: '2'), new Language(name: 'Arabic', value: '1'), ]; + final List genderList = [ + new Language(name: 'Male', value: 'M'), + new Language(name: 'Female', value: 'F'), + ]; + final List maritalList = [ + new Language(name: 'Married', value: 'M'), + new Language(name: 'Single', value: 'S'), + new Language(name: 'Divorce', value: 'D'), + ]; String email = ''; - + List countriesList = []; ToDoCountProviderModel toDoProvider; String location = '1'; - AuthenticatedUserObject authenticatedUserObject = locator(); + AuthenticatedUserObject authenticatedUserObject = + locator(); ProjectViewModel projectViewModel; - AppointmentRateViewModel appointmentRateViewModel = locator(); + AppointmentRateViewModel appointmentRateViewModel = + locator(); + bool isDubai =false; + RegisterInfoResponse data = RegisterInfoResponse(); + CheckPatientAuthenticationReq data2; + String gender = 'M'; + String maritalStatus = 'M'; + String nationality = 'SAU'; @override void initState() { - WidgetsBinding.instance.addPostFrameCallback((timeStamp) { - getRegisterInfo(); - }); - setState(() { - page = widget.page; - }); - super.initState(); + if(widget.page ==1) { + getCountries(); + } + WidgetsBinding.instance.addPostFrameCallback((timeStamp) { + getRegisterInfo(); + }); + page = widget.page; + super.initState(); } @override @@ -85,17 +106,23 @@ class _RegisterInfo extends State { projectViewModel = Provider.of(context); toDoProvider = Provider.of(context); return AppScaffold( - appBarTitle: TranslationBase.of(context).register, + appBarTitle: TranslationBase + .of(context) + .register, isShowAppBar: false, isShowDecPage: false, body: SingleChildScrollView( padding: EdgeInsets.all(30), - child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ + child: + Column(crossAxisAlignment: CrossAxisAlignment.start, children: < + Widget>[ Row( children: [ Expanded( child: AppText( - TranslationBase.of(context).personalInfo, + TranslationBase + .of(context) + .personalInfo, fontSize: 16, textAlign: TextAlign.left, fontWeight: FontWeight.bold, @@ -105,169 +132,385 @@ class _RegisterInfo extends State { ], ), SizedBox(height: 20), - registerInfo != null && page == 1 + (isDubai && page == 1) + ? Column( + children: [ + SizedBox(height: 20), + getnameField( + TranslationBase + .of(context) + .identificationNumber, + registerd_data.patientIdentificationID, + TranslationBase + .of(context) + .mobileNumber, + registerd_data.patientMobileNumber.toString()), + // SizedBox(height: 20), + getnameField( + '', + + + inputWidget( TranslationBase + .of(context) + .firstName, TranslationBase + .of(context) + .firstName,'fName'), + '', + inputWidget( TranslationBase + .of(context) + .middleName, TranslationBase + .of(context) + .middleName,'sName'), + ), + + getnameField( + '', + inputWidget( TranslationBase + .of(context) + .lastName, TranslationBase + .of(context) + .lastName, 'lName'), + + TranslationBase + .of(context) + .gender, + Container( + height: 20, + child: DropdownButtonHideUnderline( + child: DropdownButton( + isExpanded: true, + value: gender, + hint: Text(TranslationBase + .of(context) + .gender), + iconSize: 40, + elevation: 16, + onChanged: (value) => + { + setState(() { + gender = value; + registerInfo.gender = value; + }) + }, + items: genderList + .map>( + (Language value) { + return DropdownMenuItem( + value: value.value, + child: Text(value.name), + ); + }).toList()))), + ), + SizedBox(height: 20), + getnameField( + TranslationBase + .of(context) + .maritalStatus, + Container( + height: 18, + child: DropdownButtonHideUnderline( + child: DropdownButton( + isExpanded: true, + value: maritalStatus, + hint: Text(TranslationBase + .of(context) + .maritalStatus), + iconSize: 40, + elevation: 16, + onChanged: (value) => + { + setState(() { + maritalStatus = value; + registerInfo.maritalStatusCode = value; + }) + }, + items: maritalList + .map>( + (Language value) { + return DropdownMenuItem( + value: value.value, + child: Text(value.name), + ); + }).toList()))), + TranslationBase + .of(context) + .nationality, + Container( + height: 22, + child: DropdownButtonHideUnderline( + child: DropdownButton( + isExpanded: true, + value: nationality, + hint: Text(TranslationBase + .of(context) + .nationality), + iconSize: 40, + elevation: 16, + onChanged: (value) => + { + setState(() { + nationality = value; + registerInfo.nationalityCode = value; + }) + }, + items: countriesList + .map>( + (CountriesLists value) { + return DropdownMenuItem( + value: value.iD, + child: Text(value.name), + ); + }).toList())))), + SizedBox(height: 20), + getnameField( + TranslationBase + .of(context) + .dateOfBirth, + registerd_data.dob, + "", ""), + SizedBox(height: 20), + ], + ) + : (registerInfo.healthId != null && page == 1) + ? Column( + children: [ + SizedBox(height: 20), + getnameField( + TranslationBase + .of(context) + .identificationNumber, + registerInfo.idNumber, + TranslationBase + .of(context) + .firstName, + registerInfo.firstNameEn == '-' + ? registerInfo.firstNameAr + : registerInfo.firstNameEn), + SizedBox(height: 20), + getnameField( + TranslationBase + .of(context) + .middleName, + registerInfo.secondNameEn == '-' + ? registerInfo.secondNameEn + : registerInfo.secondNameEn, + TranslationBase + .of(context) + .lastName, + registerInfo.lastNameEn == '-' + ? registerInfo.lastNameEn + : registerInfo.lastNameEn), + SizedBox(height: 20), + getnameField( + TranslationBase + .of(context) + .gender, + registerInfo.maritalStatusCode == 'U' + ? 'Unknown' + : registerInfo.maritalStatusCode == 'M' + ? 'Male' + : 'Female', + TranslationBase + .of(context) + .maritalStatus, + registerInfo.maritalStatus), + SizedBox(height: 20), + getnameField( + TranslationBase + .of(context) + .nationality, + registerInfo.nationality, + TranslationBase + .of(context) + .mobileNumber, + registerd_data.patientMobileNumber.toString()), + SizedBox(height: 20), + getnameField(TranslationBase + .of(context) + .dateOfBirth, + registerInfo.dateOfBirth, "", ""), + SizedBox(height: 20), + ], + ) + : widget.page == 2 ? Column( - children: [ - SizedBox(height: 20), - getnameField(TranslationBase.of(context).identificationNumber, registerInfo.idNumber, TranslationBase.of(context).firstName, - registerInfo.firstNameEn == '-' ? registerInfo.firstNameAr : registerInfo.firstNameEn), - SizedBox(height: 20), - getnameField(TranslationBase.of(context).middleName, registerInfo.secondNameEn == '-' ? registerInfo.secondNameEn : registerInfo.secondNameEn, - TranslationBase.of(context).lastName, registerInfo.lastNameEn == '-' ? registerInfo.lastNameEn : registerInfo.lastNameEn), - SizedBox(height: 20), - getnameField( - TranslationBase.of(context).gender, - registerInfo.maritalStatusCode == 'U' - ? 'Unknown' - : registerInfo.maritalStatusCode == 'M' - ? 'Male' - : 'Female', - TranslationBase.of(context).maritalStatus, - registerInfo.maritalStatus), - SizedBox(height: 20), - getnameField(TranslationBase.of(context).nationality, registerInfo.nationality, TranslationBase.of(context).mobileNumber, registerd_data.patientMobileNumber.toString()), - SizedBox(height: 20), - getnameField(TranslationBase.of(context).dateOfBirth, registerInfo.dateOfBirth, "", ""), - SizedBox(height: 20), - ], - ) - : registerInfo != null && widget.page == 2 - ? Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Container( - width: double.infinity, - decoration: containerRadius(Colors.white, 12), - padding: EdgeInsets.only(left: 10, right: 10, top: 5, bottom: 25), - child: Row(children: [ - Flexible( - child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ - Text( - TranslationBase.of(context).prefferedLanguage, - style: TextStyle( - fontSize: 11, - letterSpacing: -0.44, - fontWeight: FontWeight.w600, - ), + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + width: double.infinity, + decoration: containerRadius(Colors.white, 12), + padding: EdgeInsets.only( + left: 10, right: 10, top: 5, bottom: 25), + child: Row(children: [ + Flexible( + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Text( + TranslationBase + .of(context) + .prefferedLanguage, + style: TextStyle( + fontSize: 11, + letterSpacing: -0.44, + fontWeight: FontWeight.w600, ), - Container( - height: 18, - child: DropdownButtonHideUnderline( - child: DropdownButton( - isExpanded: true, - value: language, - hint: Text(TranslationBase.of(context).prefferedLanguage), - iconSize: 40, - elevation: 16, - onChanged: (value) => { - setState(() { - language = value; - }) - }, - items: languageList.map>((Language value) { - return DropdownMenuItem( - value: value.value, - child: Text(value.name), - ); - }).toList()))) - ])) - ])), - SizedBox( - height: 20, - ), - Container( - width: double.infinity, - decoration: containerRadius(Colors.white, 12), - padding: EdgeInsets.only(left: 10, right: 10, top: 5, bottom: 25), - child: Row(children: [ - Flexible( - child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ - Text( - TranslationBase.of(context).selectLocation, - style: TextStyle( - fontSize: 11, - letterSpacing: -0.44, - fontWeight: FontWeight.w600, - ), + ), + Container( + height: 18, + child: + DropdownButtonHideUnderline( + child: DropdownButton( + isExpanded: true, + value: language, + hint: Text(TranslationBase + .of(context) + .prefferedLanguage), + iconSize: 40, + elevation: 16, + onChanged: (value) => + { + setState(() { + language = + value; + }) + }, + items: languageList.map< + DropdownMenuItem< + String>>( + (Language value) { + return DropdownMenuItem< + String>( + value: + value.value, + child: Text( + value.name), + ); + }).toList()))) + ])) + ])), + SizedBox( + height: 20, + ), + Container( + width: double.infinity, + decoration: containerRadius(Colors.white, 12), + padding: EdgeInsets.only( + left: 10, right: 10, top: 5, bottom: 25), + child: Row(children: [ + Flexible( + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Text( + TranslationBase + .of(context) + .selectLocation, + style: TextStyle( + fontSize: 11, + letterSpacing: -0.44, + fontWeight: FontWeight.w600, ), - Container( - height: 18, - child: DropdownButtonHideUnderline( - child: DropdownButton( - isExpanded: true, - value: location, - hint: Text(TranslationBase.of(context).selectLocation), - iconSize: 40, - elevation: 16, - onChanged: (value) => { - setState(() { - location = value; - }) - }, - items: locationList.map>((Location value) { - return DropdownMenuItem( - value: value.value, - child: Text( - value.name, - ), - ); - }).toList()))) - ])) - ])), - SizedBox( - height: 20, - ), - Container( - width: double.infinity, - decoration: containerRadius(Colors.white, 12), - padding: EdgeInsets.only(left: 10, right: 10, top: 5, bottom: 12), - margin: EdgeInsets.only(bottom: 0), - child: Row(children: [ - Flexible( - child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ - Text( - TranslationBase.of(context).email, - style: TextStyle( - fontSize: 11, - letterSpacing: -0.44, - fontWeight: FontWeight.w600, - ), + ), + Container( + height: 18, + child: + DropdownButtonHideUnderline( + child: DropdownButton( + isExpanded: true, + value: location, + hint: Text( + TranslationBase + .of( + context) + .selectLocation), + iconSize: 40, + elevation: 16, + onChanged: (value) => + { + setState(() { + location = + value; + }) + }, + items: locationList.map< + DropdownMenuItem< + String>>( + (Location value) { + return DropdownMenuItem< + String>( + value: + value.value, + child: Text( + value.name, + ), + ); + }).toList()))) + ])) + ])), + SizedBox( + height: 20, + ), + Container( + width: double.infinity, + decoration: containerRadius(Colors.white, 12), + padding: EdgeInsets.only( + left: 10, right: 10, top: 5, bottom: 12), + margin: EdgeInsets.only(bottom: 0), + child: Row(children: [ + Flexible( + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Text( + TranslationBase + .of(context) + .email, + style: TextStyle( + fontSize: 11, + letterSpacing: -0.44, + fontWeight: FontWeight.w600, ), - Container( - child: TextField( - onChanged: (value) { - setState(() { - email = value; - }); - }, - style: TextStyle( - fontSize: 14, - height: 21 / 14, - fontWeight: FontWeight.w400, - color: Color(0xff2B353E), - letterSpacing: -0.44, - ), - decoration: InputDecoration( - isDense: true, - hintStyle: TextStyle( + ), + Container( + child: TextField( + onChanged: (value) { + setState(() { + email = value; + }); + }, + style: TextStyle( fontSize: 14, height: 21 / 14, fontWeight: FontWeight.w400, - color: Color(0xff575757), - letterSpacing: -0.56, + color: Color(0xff2B353E), + letterSpacing: -0.44, + ), + decoration: InputDecoration( + isDense: true, + hintStyle: TextStyle( + fontSize: 14, + height: 21 / 14, + fontWeight: FontWeight.w400, + color: Color(0xff575757), + letterSpacing: -0.56, + ), + prefixIconConstraints: + BoxConstraints(minWidth: 50), + contentPadding: EdgeInsets.zero, + border: InputBorder.none, + focusedBorder: InputBorder.none, + enabledBorder: InputBorder.none, ), - prefixIconConstraints: BoxConstraints(minWidth: 50), - contentPadding: EdgeInsets.zero, - border: InputBorder.none, - focusedBorder: InputBorder.none, - enabledBorder: InputBorder.none, - ), - )) - ])) - ])), - ], - ) - : SizedBox(), + )) + ])) + ])), + ], + ) + : SizedBox(), ]), ), bottomSheet: Container( @@ -278,89 +521,148 @@ class _RegisterInfo extends State { Expanded( child: Padding( padding: EdgeInsets.all(10), - child: DefaultButton(TranslationBase.of(context).cancel, () { + child: + DefaultButton(TranslationBase + .of(context) + .cancel, () { Navigator.of(context).pop(); - locator().loginRegistration.registration_cancel(step: page == 1 ? 'personal info' : 'other details'); + locator() + .loginRegistration + .registration_cancel( + step: page == 1 + ? 'personal info' + : 'other details'); }, textColor: Colors.white, color: Color(0xffD02127))), ), Expanded( child: Padding( padding: EdgeInsets.all(10), - child: DefaultButton(page == 1 ? TranslationBase.of(context).next : TranslationBase.of(context).register, () { + child: DefaultButton( + page == 1 + ? TranslationBase + .of(context) + .next + : TranslationBase + .of(context) + .register, () { nextPage(); - page == 1 ? locator().loginRegistration.registration_personal_info() : locator().loginRegistration.registration_patient_info(); - }, textColor: Colors.white, color: isValid() == true && page == 2 || page == 1 ? Color(0xff359846) : Colors.grey)), + page == 1 + ? locator() + .loginRegistration + .registration_personal_info() + : locator() + .loginRegistration + .registration_patient_info(); + }, + textColor: Colors.white, + color: isValid() == true + ? Color(0xff359846) + : Colors.grey)), ), ], ))); } - nextPage() { + nextPage() async{ if (page == 1) { - setState(() { + if(isDubai) { + await setRegisterData(); widget.changePageViewIndex(2); - }); + } + else{ + widget.changePageViewIndex(2); + } } else { registerNow(); } } + setRegisterData() async{ + registerInfo.gender = gender; + registerInfo.maritalStatusCode =maritalStatus; + registerInfo.nationalityCode =nationality; + projectViewModel.setRegisterData(registerInfo); + // await sharedPref.setObject(REGISTER_INFO_DUBAI, registerInfo); + } registerNow() { - dynamic request = getTempUserRequest(); - GifLoaderDialogUtils.showMyDialog(context); + dynamic request; + if(isDubai) + request = getTempUserRequestDubai(); + else + request = getTempUserRequest(); + + GifLoaderDialogUtils.showMyDialog(context); dynamic res; this .authService .registerUser(request) - .then((result) => { - GifLoaderDialogUtils.hideDialog(context), - if (result is String) - { - new ConfirmDialog( - context: context, - confirmMessage: result, - okText: TranslationBase.of(context).ok, - cancelText: TranslationBase.of(context).cancel_nocaps, - okFunction: () => {ConfirmDialog.closeAlertDialog(context)}, - cancelFunction: () => {ConfirmDialog.closeAlertDialog(context)}).showAlertDialog(context) - } - else - { - res = result, - result = checkActivation.CheckActivationCode.fromJson(result), - // result.list.isFamily = false, - // sharedPref.setObject(USER_PROFILE, result.list), - // this.sharedPref.setObject(MAIN_USER, result.list), - // sharedPref.setObject(LOGIN_TOKEN_ID, result.logInTokenID), - // sharedPref.setString(TOKEN, result.authenticationTokenID), - // this.setUser(result), - sharedPref.remove(FAMILY_FILE), - result.list.isFamily = false, - - sharedPref.setString(BLOOD_TYPE, result.patientBloodType), - authenticatedUserObject.user = result.list, - projectViewModel.setPrivilege(privilegeList: res), - sharedPref.setObject(MAIN_USER, result.list), - sharedPref.setObject(USER_PROFILE, result.list), - - sharedPref.setObject(LOGIN_TOKEN_ID, result.logInTokenID), - sharedPref.setString(TOKEN, result.authenticationTokenID), - AppToast.showSuccessToast(message: TranslationBase.of(context).successRegister), - checkIfUserAgreedBefore(result), - projectViewModel.analytics.loginRegistration.registration_confirmation() - } - }) + .then((result) => + { + GifLoaderDialogUtils.hideDialog(context), + if (result is String) + { + new ConfirmDialog( + context: context, + confirmMessage: result, + okText: TranslationBase + .of(context) + .ok, + cancelText: TranslationBase + .of(context) + .cancel_nocaps, + okFunction: () => + {ConfirmDialog.closeAlertDialog(context)}, + cancelFunction: () => + { + ConfirmDialog.closeAlertDialog(context) + }).showAlertDialog(context) + } + else + { + res = result, + result = checkActivation.CheckActivationCode.fromJson(result), + // result.list.isFamily = false, + // sharedPref.setObject(USER_PROFILE, result.list), + // this.sharedPref.setObject(MAIN_USER, result.list), + // sharedPref.setObject(LOGIN_TOKEN_ID, result.logInTokenID), + // sharedPref.setString(TOKEN, result.authenticationTokenID), + // this.setUser(result), + sharedPref.remove(FAMILY_FILE), + result.list.isFamily = false, + + sharedPref.setString(BLOOD_TYPE, result.patientBloodType), + authenticatedUserObject.user = result.list, + projectViewModel.setPrivilege(privilegeList: res), + sharedPref.setObject(MAIN_USER, result.list), + sharedPref.setObject(USER_PROFILE, result.list), + + sharedPref.setObject(LOGIN_TOKEN_ID, result.logInTokenID), + sharedPref.setString(TOKEN, result.authenticationTokenID), + AppToast.showSuccessToast( + message: TranslationBase + .of(context) + .successRegister), + checkIfUserAgreedBefore(result), + projectViewModel.analytics.loginRegistration + .registration_confirmation() + } + }) .catchError((err) { // GifLoaderDialogUtils.hideDialog(context); ConfirmDialog dialog = new ConfirmDialog( context: context, confirmMessage: err, - okText: TranslationBase.of(context).confirm, - cancelText: TranslationBase.of(context).cancel_nocaps, + okText: TranslationBase + .of(context) + .confirm, + cancelText: TranslationBase + .of(context) + .cancel_nocaps, okFunction: () => {ConfirmDialog.closeAlertDialog(context)}, cancelFunction: () => {ConfirmDialog.closeAlertDialog(context)}); dialog.showAlertDialog(context); - projectViewModel.analytics.loginRegistration.registration_fail(errorType: err); + projectViewModel.analytics.loginRegistration + .registration_fail(errorType: err); }); } @@ -374,30 +676,44 @@ class _RegisterInfo extends State { } getRegisterInfo() async { - var data = RegisterInfoResponse.fromJson(await sharedPref.getObject(NHIC_DATA)); + + if (await sharedPref.getObject(NHIC_DATA) != null) { + data = + RegisterInfoResponse.fromJson(await sharedPref.getObject(NHIC_DATA)); + this.registerInfo = data; + } if (await sharedPref.getObject(REGISTER_DATA_FOR_LOGIIN) != null) { - var data2 = CheckPatientAuthenticationReq.fromJson(await sharedPref.getObject(REGISTER_DATA_FOR_LOGIIN)); + data2 = CheckPatientAuthenticationReq.fromJson( + await sharedPref.getObject(REGISTER_DATA_FOR_LOGIIN)); setState(() { - this.registerInfo = data; + this.registerd_data = data2; + isDubai = data2.patientOutSA == 1 ? true : false; }); } } getTempUserRequest() { + + DateFormat dateFormat = DateFormat("mm/dd/yyyy"); print(dateFormat.parse(registerInfo.dateOfBirth)); - var hDate = new HijriCalendar.fromDate(dateFormat.parse(registerInfo.dateOfBirth)); + var hDate = + new HijriCalendar.fromDate(dateFormat.parse(registerInfo.dateOfBirth)); var date = hDate.toString(); return { "Patientobject": { "TempValue": true, - "PatientIdentificationType": registerInfo.idNumber.substring(0, 1) == "1" ? 1 : 2, + "PatientIdentificationType": + registerInfo.idNumber.substring(0, 1) == "1" ? 1 : 2, "PatientIdentificationNo": registerInfo.idNumber, "MobileNumber": registerd_data.patientMobileNumber, - "PatientOutSA": (registerd_data.zipCode == '966' || registerd_data.zipCode == '+966') ? 0 : 1, + "PatientOutSA": (registerd_data.zipCode == '966' || + registerd_data.zipCode == '+966') + ? 0 + : 1, "FirstNameN": registerInfo.firstNameAr, "FirstName": registerInfo.firstNameEn, "MiddleNameN": registerInfo.secondNameAr, @@ -405,8 +721,9 @@ class _RegisterInfo extends State { "LastNameN": registerInfo.lastNameAr, "LastName": registerInfo.lastNameEn, "StrDateofBirth": registerInfo.dateOfBirth, - "DateofBirth": DateUtil.convertISODateToJsonDate(registerInfo.dateOfBirth.replaceAll('/', '-')), - "Gender": registerInfo.gender == 'M' ? 1 : 2, + "DateofBirth": DateUtil.convertISODateToJsonDate( + registerInfo.dateOfBirth.replaceAll('/', '-')), + "Gender": registerInfo.gender== 'M' ? 1 : 2, "NationalityID": registerInfo.nationalityCode, "eHealthIDField": registerInfo.healthId, "DateofBirthN": date, @@ -416,16 +733,76 @@ class _RegisterInfo extends State { "Marital": registerInfo.maritalStatusCode == 'U' ? '0' : registerInfo.maritalStatusCode == 'M' - ? '1' - : '2', + ? '1' + : '2', }, "PatientIdentificationID": registerInfo.idNumber, - "PatientMobileNumber": registerd_data.patientMobileNumber.toString()[0] == '0' ? registerd_data.patientMobileNumber : '0' + registerd_data.patientMobileNumber.toString(), + "PatientMobileNumber": + registerd_data.patientMobileNumber.toString()[0] == '0' + ? registerd_data.patientMobileNumber + : '0' + registerd_data.patientMobileNumber.toString(), + }; + } + + + getTempUserRequestDubai(){ + DateFormat dateFormat = DateFormat("mm/dd/yyyy"); + registerInfo= projectViewModel.registerInfo; + print(dateFormat.parse(registerd_data.dob)); + var hDate = + new HijriCalendar.fromDate(dateFormat.parse(registerd_data.dob)); + var date = hDate.toString(); + final DateFormat dateFormat1 = DateFormat('MM/dd/yyyy'); + final DateFormat dateFormat2 = DateFormat('dd/MM/yyyy'); + + return { + "Patientobject": { + "TempValue": true, + "PatientIdentificationType": + registerd_data.patientIdentificationID.substring(0, 1) == "1" ? 1 : 2, + "PatientIdentificationNo": registerd_data.patientIdentificationID, + "MobileNumber": registerd_data.patientMobileNumber, + "PatientOutSA": (registerd_data.zipCode == '966' || + registerd_data.zipCode == '+966') + ? 0 + : 1, + "FirstNameN": registerInfo.firstNameAr ??"", + "FirstName": registerInfo.firstNameEn??"", + "MiddleNameN": registerInfo.secondNameAr?? "", + "MiddleName": registerInfo.secondNameEn ??"", + "LastNameN": registerInfo.lastNameAr ??"", + "LastName":registerInfo.lastNameEn ??"", + "StrDateofBirth": dateFormat1.format( + dateFormat2.parse(registerd_data.dob)), + "DateofBirth": DateUtil.convertISODateToJsonDate( + registerd_data.dob.replaceAll('/', '-')), + "Gender": registerInfo.gender== 'M' ? 1 : 2, + "NationalityID": registerInfo.nationalityCode, + "eHealthIDField":null, + "DateofBirthN": date, + "EmailAddress": email, + "SourceType": location, + "PreferredLanguage": registerd_data.languageID.toString(), + "Marital": registerInfo.maritalStatusCode == 'U' + ? '0' + : registerInfo.maritalStatusCode == 'M' + ? '1' + : '2', + }, + "PatientIdentificationID": registerd_data.patientIdentificationID, + "PatientMobileNumber": + registerd_data.patientMobileNumber.toString()[0] == '0' + ? registerd_data.patientMobileNumber + : '0' + registerd_data.patientMobileNumber.toString(), + "DOB":registerd_data.dob, + "IsHijri":registerd_data.isHijri }; } bool isValid() { - if (location != null && language != null && Utils.validEmail(email) == true) { + if ((location != null && + language != null && + Utils.validEmail(email) == true) || (registerInfo.firstNameEn !=null && registerInfo.secondNameEn !=null && registerInfo.lastNameEn !=null)) { return true; } else { return false; @@ -436,49 +813,57 @@ class _RegisterInfo extends State { return Row( children: [ Expanded( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - name1, - style: TextStyle( - fontSize: 14, - fontWeight: FontWeight.bold, - letterSpacing: -0.44, - ), - ), - Text( - value1, - style: TextStyle( - fontSize: 12, - fontWeight: FontWeight.w600, - letterSpacing: -0.44, - ), - ), - ], - )), + child: Padding( + padding: EdgeInsets.only(left: 5, right: 5), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + name1, + style: TextStyle( + fontSize: 14, + fontWeight: FontWeight.bold, + letterSpacing: -0.44, + ), + ), + value1 is String + ? Text( + value1, + style: TextStyle( + fontSize: 12, + fontWeight: FontWeight.w600, + letterSpacing: -0.44, + ), + ) + : value1, + ], + ))), Expanded( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - name2, - style: TextStyle( - fontSize: 14, - fontWeight: FontWeight.bold, - letterSpacing: -0.44, - ), - ), - Text( - value2, - style: TextStyle( - fontSize: 12, - fontWeight: FontWeight.w600, - letterSpacing: -0.44, - ), - ), - ], - )) + child: Padding( + padding: EdgeInsets.only(left: 5, right: 5), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + name2, + style: TextStyle( + fontSize: 14, + fontWeight: FontWeight.bold, + letterSpacing: -0.44, + ), + ), + value2 is String + ? Text( + value2, + style: TextStyle( + fontSize: 12, + fontWeight: FontWeight.w600, + letterSpacing: -0.44, + ), + ) + : value2, + ], + ))) ], ); } @@ -494,7 +879,10 @@ class _RegisterInfo extends State { insertIMEI() async { var selectedOption = await sharedPref.getInt(LAST_LOGIN); - authService.insertDeviceImei(selectedOption).then((value) => {goToHome()}).catchError((err) { + authService + .insertDeviceImei(selectedOption) + .then((value) => {goToHome()}) + .catchError((err) { print(err); }); } @@ -507,28 +895,29 @@ class _RegisterInfo extends State { await authenticatedUserObject.getUser(getUser: true); appointmentRateViewModel .getIsLastAppointmentRatedList() - .then((value) => { - getToDoCount(), - GifLoaderDialogUtils.hideDialog(AppGlobal.context), - if (appointmentRateViewModel.isHaveAppointmentNotRate) - { - Navigator.pushAndRemoveUntil( - context, - FadePage( - page: RateAppointmentDoctor(), - ), - (r) => false) - } - else - { - Navigator.pushAndRemoveUntil( - context, - FadePage( - page: LandingPage(), - ), - (r) => false) - } - }) + .then((value) => + { + getToDoCount(), + GifLoaderDialogUtils.hideDialog(AppGlobal.context), + if (appointmentRateViewModel.isHaveAppointmentNotRate) + { + Navigator.pushAndRemoveUntil( + context, + FadePage( + page: RateAppointmentDoctor(), + ), + (r) => false) + } + else + { + Navigator.pushAndRemoveUntil( + context, + FadePage( + page: LandingPage(), + ), + (r) => false) + } + }) .catchError((err) { print(err); //GifLoaderDialogUtils.hideDialog(context); @@ -547,8 +936,114 @@ class _RegisterInfo extends State { print(err); }); } + + getCountries() { + ClinicListService service = new ClinicListService(); + service.getCountries().then((res) { + if (res['MessageStatus'] == 1) { + + res['ListNationality'].forEach((items) => { + countriesList.add(CountriesLists.fromJson(items)) + }); + + setState(() {}); + } + }).catchError((err) { + print(err); + }); + } + + + Widget inputWidget(String _labelText, String _hintText, String name, {String prefix, bool isEnable = true, bool hasSelection = false}) { + return Container( + padding: EdgeInsets.only(left: 10, right: 10, bottom: 5, top: 5), + alignment: Alignment.center, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(15), + color: Colors.white, + border: Border.all( + color: Color(0xffefefef), + width: 1, + ), + ), + child: InkWell( + onTap: hasSelection ? () {} : null, + child: Row( + children: [ + Expanded( + child: Column( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + _labelText, + style: TextStyle( + fontSize: 11, + fontWeight: FontWeight.w600, + color: Color(0xff2B353E), + letterSpacing: -0.44, + ), + ), + TextField( + enabled: isEnable, + scrollPadding: EdgeInsets.zero, + keyboardType: TextInputType.number, + // controller: _controller, + onChanged: (value) => { + setState((){ + switch(name) { + case 'fName': + registerInfo.firstNameEn = registerInfo.firstNameAr = value; + break; + case 'sName': + registerInfo.secondNameEn = registerInfo.secondNameAr = value; + break; + case 'lName': + registerInfo.lastNameEn = registerInfo.lastNameAr = value; + break; + } + }) + //_controller.text =value + + }, + style: TextStyle( + fontSize: 14, + height: 21 / 14, + fontWeight: FontWeight.w400, + color: Color(0xff2B353E), + letterSpacing: -0.44, + ), + decoration: InputDecoration( + isDense: true, + hintText: _hintText, + hintStyle: TextStyle( + fontSize: 14, + height: 21 / 14, + fontWeight: FontWeight.w400, + color: Color(0xff575757), + letterSpacing: -0.56, + ), + prefixIconConstraints: BoxConstraints(minWidth: 50), + + contentPadding: EdgeInsets.zero, + border: InputBorder.none, + focusedBorder: InputBorder.none, + enabledBorder: InputBorder.none, + ), + ), + ], + ), + ), + if (hasSelection) Icon(Icons.keyboard_arrow_down_outlined), + ], + ), + ), + ); + } + } + class Language { final String name; final String value; diff --git a/lib/pages/login/register.dart b/lib/pages/login/register.dart index bdb2b623..7c6c08a5 100644 --- a/lib/pages/login/register.dart +++ b/lib/pages/login/register.dart @@ -349,12 +349,19 @@ class _Register extends State { cancelFunction: () {}) .showAlertDialog(context); } else { + final intl.DateFormat dateFormat = intl.DateFormat('dd/MM/yyyy'); nRequest['forRegister'] = true; nRequest['isRegister'] = true; nRequest["PatientIdentificationID"] = nRequest["PatientIdentificationID"].toString(); + nRequest['dob'] = isHijri == 1 ? dob.text : dateFormat.format(selectedDate); + nRequest['isHijri'] = isHijri; sharedPref.setObject(REGISTER_DATA_FOR_LOGIIN, nRequest); sharedPref.setString(LOGIN_TOKEN_ID, response['LogInTokenID']); - this.chekUserData(response['LogInTokenID']); + if(request.patientOutSA ==0 ) { + this.chekUserData(response['LogInTokenID']); + }else{ + Navigator.of(context).push(FadePage(page: ConfirmLogin(changePageViewIndex: widget.changePageViewIndex, fromRegistration: true, isDubai:true))); + } } } else { // if (response['ErrorCode'] == '-986') { diff --git a/lib/services/authentication/auth_provider.dart b/lib/services/authentication/auth_provider.dart index f833ad5d..d61e8ef7 100644 --- a/lib/services/authentication/auth_provider.dart +++ b/lib/services/authentication/auth_provider.dart @@ -247,7 +247,7 @@ class AuthProvider with ChangeNotifier { return Future.value(localRes); } - Future checkActivationCode(request, [value]) async { + Future checkActivationCode(request, [value]) async { var neRequest = CheckActivationCodeReq.fromJson(request); neRequest.activationCode = value ?? "0000"; @@ -376,10 +376,16 @@ class AuthProvider with ChangeNotifier { requestN.patientOutSA = requestN.patientobject.patientOutSA; final DateFormat dateFormat = DateFormat('MM/dd/yyyy'); final DateFormat dateFormat2 = DateFormat('dd/MM/yyyy'); - requestN.dob = nhic['IsHijri'] ? nhic['DateOfBirth'] : dateFormat2.format(dateFormat.parse(nhic['DateOfBirth'])); + if(nhic !=null) { + requestN.dob = nhic['IsHijri'] ? nhic['DateOfBirth'] : dateFormat2.format( + dateFormat.parse(nhic['DateOfBirth'])); + requestN.isHijri = nhic['IsHijri'] ? 1 : 0; + requestN.healthId = requestN.patientobject.eHealthIDField; + } + requestN.zipCode = requestN.patientOutSA == 1 ? '971' : '966'; - requestN.healthId = requestN.patientobject.eHealthIDField; - requestN.isHijri = nhic['IsHijri'] ? 1 : 0; + + await sharedPref.remove(USER_PROFILE); dynamic localRes; diff --git a/lib/services/clinic_services/get_clinic_service.dart b/lib/services/clinic_services/get_clinic_service.dart index 5079fc9b..8bf3a0ec 100644 --- a/lib/services/clinic_services/get_clinic_service.dart +++ b/lib/services/clinic_services/get_clinic_service.dart @@ -177,4 +177,14 @@ class ClinicListService extends BaseService { }, body: request); return Future.value(localRes); } + Future getCountries() async { + Map request ={}; + dynamic localRes; + await baseAppClient.post(GET_NATIONALITY, onSuccess: (response, statusCode) async { + localRes = response; + }, onFailure: (String error, int statusCode) { + throw error; + }, body: request); + return Future.value(localRes); +} } From 907d05c3d0ce737a01f748e94d7e9170922d93de Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Tue, 9 May 2023 15:12:19 +0300 Subject: [PATCH 25/29] register --- lib/pages/login/register.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/pages/login/register.dart b/lib/pages/login/register.dart index 93f2626d..c3e8a275 100644 --- a/lib/pages/login/register.dart +++ b/lib/pages/login/register.dart @@ -119,7 +119,7 @@ class _Register extends State { ), Row(children: [ Container( - width: SizeConfig.realScreenWidth * .9, + width: SizeConfig.realScreenWidth * .89, child: isHijri == 1 ? Directionality( textDirection: TextDirection.ltr, From d59e436a9708132ec3a603084a9d827a97171be0 Mon Sep 17 00:00:00 2001 From: Sultan khan <> Date: Wed, 10 May 2023 10:15:12 +0300 Subject: [PATCH 26/29] dubai arabic change --- lib/pages/login/register-info.dart | 86 ++++++++++++++++++++++-------- 1 file changed, 65 insertions(+), 21 deletions(-) diff --git a/lib/pages/login/register-info.dart b/lib/pages/login/register-info.dart index 716c2006..ee58f8d5 100644 --- a/lib/pages/login/register-info.dart +++ b/lib/pages/login/register-info.dart @@ -52,23 +52,23 @@ class _RegisterInfo extends State { bool isLoading; int page; final List locationList = [ - new Location(name: 'KSA', value: '1'), - new Location(name: 'Dubai', value: '2'), + new Location(name: 'KSA', value: '1', nameAr: "السعودية"), + new Location(name: 'Dubai', value: '2', nameAr: "دبي"), ]; String language = '1'; CheckPatientAuthenticationReq registerd_data; final List languageList = [ - new Language(name: 'English', value: '2'), - new Language(name: 'Arabic', value: '1'), + new Language(name: 'English', value: '2', nameAr: "إنجليزي"), + new Language(name: 'Arabic', value: '1', nameAr: "عربي"), ]; final List genderList = [ - new Language(name: 'Male', value: 'M'), - new Language(name: 'Female', value: 'F'), + new Language(name: 'Male', value: 'M', nameAr: "ذكر"), + new Language(name: 'Female', value: 'F',nameAr: "أنثى"), ]; final List maritalList = [ - new Language(name: 'Married', value: 'M'), - new Language(name: 'Single', value: 'S'), - new Language(name: 'Divorce', value: 'D'), + new Language(name: 'Married', value: 'M', nameAr: "متزوج"), + new Language(name: 'Single', value: 'S',nameAr: "اعزب"), + new Language(name: 'Divorce', value: 'D',nameAr:"الطلاق"), ]; String email = ''; List countriesList = []; @@ -146,6 +146,14 @@ class _RegisterInfo extends State { .mobileNumber, registerd_data.patientMobileNumber.toString()), // SizedBox(height: 20), + projectViewModel.isArabic ? getnameField( + '', + + + inputWidget( "First Name","First Name English",'fNameEn'), + '', + inputWidget( "Last Name", "Last Name English",'lNameEn'), + ) :SizedBox(height: 0,), getnameField( '', @@ -197,7 +205,8 @@ class _RegisterInfo extends State { (Language value) { return DropdownMenuItem( value: value.value, - child: Text(value.name), + child: Text( projectViewModel.isArabic ==1 ? value.nameAr : value.name , + ), ); }).toList()))), ), @@ -229,7 +238,8 @@ class _RegisterInfo extends State { (Language value) { return DropdownMenuItem( value: value.value, - child: Text(value.name), + child: Text( projectViewModel.isArabic ==1 ? value.nameAr : value.name , + ), ); }).toList()))), TranslationBase @@ -258,7 +268,8 @@ class _RegisterInfo extends State { (CountriesLists value) { return DropdownMenuItem( value: value.iD, - child: Text(value.name), + child: Text(value.name , + ), ); }).toList())))), SizedBox(height: 20), @@ -385,7 +396,8 @@ class _RegisterInfo extends State { value: value.value, child: Text( - value.name), + projectViewModel.isArabic ==1 ? value.nameAr : value.name , + ), ); }).toList()))) ])) @@ -444,7 +456,7 @@ class _RegisterInfo extends State { value: value.value, child: Text( - value.name, + projectViewModel.isArabic ==1 ? value.nameAr : value.name , ), ); }).toList()))) @@ -691,6 +703,7 @@ class _RegisterInfo extends State { this.registerd_data = data2; isDubai = data2.patientOutSA == 1 ? true : false; + if(isDubai) location ='2'; }); } } @@ -802,7 +815,7 @@ class _RegisterInfo extends State { bool isValid() { if ((location != null && language != null && - Utils.validEmail(email) == true) || (registerInfo.firstNameEn !=null && registerInfo.secondNameEn !=null && registerInfo.lastNameEn !=null)) { + Utils.validEmail(email) == true) || (registerInfo.firstNameEn !=null && registerInfo.secondNameEn !=null && registerInfo.lastNameEn !=null) || (projectViewModel.isArabic && registerInfo.firstNameEn !=null && registerInfo.firstNameAr !=null && registerInfo.lastNameEn !=null && registerInfo.secondNameAr !=null && registerInfo.lastNameAr !=null)) { return true; } else { return false; @@ -993,13 +1006,43 @@ class _RegisterInfo extends State { setState((){ switch(name) { case 'fName': - registerInfo.firstNameEn = registerInfo.firstNameAr = value; + { + if(projectViewModel.isArabic) { + registerInfo.firstNameAr = value; + + }else{ + registerInfo.firstNameEn =value; + registerInfo.firstNameAr ='...'; + } + } break; case 'sName': - registerInfo.secondNameEn = registerInfo.secondNameAr = value; + { + if(projectViewModel.isArabic) { + registerInfo.secondNameAr = value; + registerInfo.secondNameEn ='...'; + }else{ + registerInfo.secondNameEn =value; + registerInfo.secondNameAr ='...'; + } + } break; case 'lName': - registerInfo.lastNameEn = registerInfo.lastNameAr = value; + { + if(projectViewModel.isArabic) { + registerInfo.lastNameAr = value; + + }else{ + registerInfo.lastNameEn =value; + registerInfo.lastNameAr ='...'; + } + } + break; + case 'fNameEn': + registerInfo.firstNameEn = value; + break; + case 'lNameEn': + registerInfo.lastNameEn = value; break; } }) @@ -1047,13 +1090,14 @@ class _RegisterInfo extends State { class Language { final String name; final String value; - - Language({this.name, this.value}); + final String nameAr; + Language({this.name, this.value, this.nameAr}); } class Location { final String name; final String value; + final String nameAr; - Location({this.name, this.value}); + Location({this.name, this.value, this.nameAr}); } From 5a741bf270862eedb1ceef880e476403eb12eee1 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Wed, 10 May 2023 10:41:02 +0300 Subject: [PATCH 27/29] Sickleave changes --- lib/core/service/medical/labs_service.dart | 4 ++-- lib/pages/medical/sickleave_workplace_update_page.dart | 4 +++- lib/widgets/data_display/medical/doctor_card.dart | 2 +- lib/widgets/in_app_browser/InAppBrowser.dart | 4 ++-- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/lib/core/service/medical/labs_service.dart b/lib/core/service/medical/labs_service.dart index f12e4669..484bfff8 100644 --- a/lib/core/service/medical/labs_service.dart +++ b/lib/core/service/medical/labs_service.dart @@ -115,12 +115,12 @@ class LabsService extends BaseService { return Future.value(localRes); } - Future updateWorkplaceName(String workplaceName, int requestNumber, String setupID, int projectID) async { + Future updateWorkplaceName(String workplaceName, String workplaceNameAR, int requestNumber, String setupID, int projectID) async { hasError = false; Map body = Map(); body['Placeofwork'] = workplaceName; - body['Placeofworkar'] = workplaceName; + body['Placeofworkar'] = workplaceNameAR; body['Req_ID'] = requestNumber; body['TargetSetupID'] = setupID; body['ProjectID'] = projectID; diff --git a/lib/pages/medical/sickleave_workplace_update_page.dart b/lib/pages/medical/sickleave_workplace_update_page.dart index 47ff2e1a..3b4a1f1b 100644 --- a/lib/pages/medical/sickleave_workplace_update_page.dart +++ b/lib/pages/medical/sickleave_workplace_update_page.dart @@ -222,7 +222,9 @@ class _WorkplaceUpdatePageState extends State { LabsService service = new LabsService(); GifLoaderDialogUtils.showMyDialog(context); - service.updateWorkplaceName(workplaceName.text, widget.requestNumber, widget.setupID, widget.projectID).then((res) { + service + .updateWorkplaceName(projectViewModel.isArabic ? "-" : workplaceName.text, projectViewModel.isArabic ? workplaceName.text : "-", widget.requestNumber, widget.setupID, widget.projectID) + .then((res) { GifLoaderDialogUtils.hideDialog(context); Navigator.of(context).pop(true); }).catchError((err) { diff --git a/lib/widgets/data_display/medical/doctor_card.dart b/lib/widgets/data_display/medical/doctor_card.dart index f06d508a..20b2714e 100644 --- a/lib/widgets/data_display/medical/doctor_card.dart +++ b/lib/widgets/data_display/medical/doctor_card.dart @@ -116,7 +116,7 @@ class DoctorCard extends StatelessWidget { ), Expanded( child: Padding( - padding: const EdgeInsets.only(left: 20, right: 12, top: 12, bottom: 12), + padding: const EdgeInsets.only(left: 20, right: 12, top: 12, bottom: 10), child: Column( crossAxisAlignment: CrossAxisAlignment.start, mainAxisSize: MainAxisSize.min, diff --git a/lib/widgets/in_app_browser/InAppBrowser.dart b/lib/widgets/in_app_browser/InAppBrowser.dart index e91990b4..f62248b8 100644 --- a/lib/widgets/in_app_browser/InAppBrowser.dart +++ b/lib/widgets/in_app_browser/InAppBrowser.dart @@ -37,9 +37,9 @@ class MyInAppBrowser extends InAppBrowser { // static String APPLE_PAY_PAYFORT_URL = 'https://hmgwebservices.com/PayFortWebLive/PayFortApi/MakeApplePayRequest'; // Payfort Payment Gateway URL LIVE static String APPLE_PAY_PAYFORT_URL = 'https://hmgwebservices.com/PayFortWebLive/PayFortApi/MakeApplePayRequest'; // Payfort Payment Gateway URL UAT - // static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort Payment Gateway URL UAT + static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort Payment Gateway URL UAT - static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL LIVE + // static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL LIVE // static String SERVICE_URL = 'https://uat.hmgwebservices.com/payfortforvidaplus/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL UAT VIDA PLUS From b304332526d5cbdd59e55ea85d10d871aef0547a Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Tue, 16 May 2023 09:04:10 +0300 Subject: [PATCH 28/29] Patient app release to stores 10.4 --- ios/Podfile | 1 + lib/config/config.dart | 6 +- lib/config/localized_values.dart | 2 +- lib/core/service/client/base_app_client.dart | 4 +- .../geofencing/GeofencingServices.dart | 2 + .../widgets/LiveCarePendingRequest.dart | 18 +- lib/pages/login/register-info.dart | 1124 +++++++---------- .../medical/patient_sick_leave_page.dart | 16 +- lib/uitl/push-notification-handler.dart | 4 + lib/widgets/in_app_browser/InAppBrowser.dart | 4 +- pubspec.yaml | 2 +- 11 files changed, 489 insertions(+), 694 deletions(-) diff --git a/ios/Podfile b/ios/Podfile index e4393e8d..c92f7e80 100644 --- a/ios/Podfile +++ b/ios/Podfile @@ -52,6 +52,7 @@ post_install do |installer| 'PERMISSION_REMINDERS=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 diff --git a/lib/config/config.dart b/lib/config/config.dart index 96c71d2c..cd192911 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -20,8 +20,8 @@ var PACKAGES_ORDERS = '/api/orders'; var PACKAGES_ORDER_HISTORY = '/api/orders/items'; var PACKAGES_TAMARA_OPT = '/api/orders/paymentoptions/tamara'; // var BASE_URL = 'http://10.50.100.198:2018/'; - var BASE_URL = 'https://uat.hmgwebservices.com/'; -//var BASE_URL = 'https://hmgwebservices.com/'; + // var BASE_URL = 'https://uat.hmgwebservices.com/'; +var BASE_URL = 'https://hmgwebservices.com/'; // var BASE_URL = 'https://orash.cloudsolutions.com.sa/'; // var BASE_URL = 'https://vidauat.cloudsolutions.com.sa/'; @@ -323,7 +323,7 @@ var UPDATE_COVID_QUESTIONNAIRE = 'Services/Doctors.svc/REST/COVID19_Questionnari var CHANNEL = 3; var GENERAL_ID = 'Cs2020@2016\$2958'; var IP_ADDRESS = '10.20.10.20'; -var VERSION_ID = 10.3; +var VERSION_ID = 10.4; var SETUP_ID = '91877'; var LANGUAGE = 2; // var PATIENT_OUT_SA = 0; diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 1c02644e..5fe40ec1 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -1865,7 +1865,7 @@ const Map localizedValues = { "NFCNotSupported": { "en": "Your device does not support NFC. Please visit reception to Check-In", "ar": "جهازك لا يدعم NFC. يرجى زيارة مكتب الاستقبال لتسجيل الوصول" }, "enter-workplace-name": {"en": "Please enter your workplace name:", "ar": "رجاء إدخال مكان العمل:"}, "workplaceName": {"en": "Workplace name:", "ar": "مكان العمل:"}, - "callLiveCareSupport": {"en": "Call LiveCare Support", "ar": "اتصل بدعم لايف كير"}, + "callLiveCareSupport": {"en": "Call LiveCare Support", "ar": "اتصل بدعم اللايف كير"}, "needApproval": {"en": "Your sick leave is under process in medical administration, you will be notified once approved.", "ar": "جازتك المرضية تحت الإجراء في الإدارة الطبية ، سوف يتم إشعارك فور الموافقه عليها."}, "pendingActivation": {"en": "Pending Activation", "ar": "في انتظار التنشيط"}, "awaitingApproval": {"en": "Awaiting Approval", "ar": "انتظر القبول"}, diff --git a/lib/core/service/client/base_app_client.dart b/lib/core/service/client/base_app_client.dart index a87d71e7..9cb81a41 100644 --- a/lib/core/service/client/base_app_client.dart +++ b/lib/core/service/client/base_app_client.dart @@ -158,11 +158,11 @@ class BaseAppClient { body.removeWhere((key, value) => key == null || value == null); - if (AppGlobal.isNetworkDebugEnabled) { + // if (AppGlobal.isNetworkDebugEnabled) { print("URL : $url"); final jsonBody = json.encode(body); print(jsonBody); - } + // } if (await Utils.checkConnection(bypassConnectionCheck: bypassConnectionCheck)) { final response = await http.post(Uri.parse(url.trim()), body: json.encode(body), headers: headers); diff --git a/lib/core/service/geofencing/GeofencingServices.dart b/lib/core/service/geofencing/GeofencingServices.dart index 362416da..fe679984 100644 --- a/lib/core/service/geofencing/GeofencingServices.dart +++ b/lib/core/service/geofencing/GeofencingServices.dart @@ -32,6 +32,8 @@ class GeofencingServices extends BaseService { AppSharedPreferences pref = AppSharedPreferences(); await pref.setString(HMG_GEOFENCES, _zonesJsonString); + var res = await sharedPref.getStringWithDefaultValue(HMG_GEOFENCES, "[]"); + print("-------GEO ZONES----------: $res"); return geoZones; } diff --git a/lib/pages/livecare/widgets/LiveCarePendingRequest.dart b/lib/pages/livecare/widgets/LiveCarePendingRequest.dart index a866cc0b..a5392c8d 100644 --- a/lib/pages/livecare/widgets/LiveCarePendingRequest.dart +++ b/lib/pages/livecare/widgets/LiveCarePendingRequest.dart @@ -96,15 +96,15 @@ class _LiveCarePendingRequestState extends State { child: Text(TranslationBase.of(context).yourTurn + " " + widget.pendingERRequestHistoryList.patCount.toString() + " " + TranslationBase.of(context).patients, style: TextStyle(fontSize: 12.0, fontWeight: FontWeight.w600, letterSpacing: -0.48)), ), - Row( - children: [ - Container( - padding: const EdgeInsets.all(5.0), - child: Text(TranslationBase.of(context).liveCareSupportContact, style: TextStyle(fontSize: 12.0, fontWeight: FontWeight.w600, letterSpacing: -0.48)), - ), - Directionality(textDirection: TextDirection.ltr, child: Text("011 525 9553", style: TextStyle(fontSize: 12.0, fontWeight: FontWeight.w600, letterSpacing: -0.48))) - ], - ), + // Row( + // children: [ + // Container( + // padding: const EdgeInsets.all(5.0), + // child: Text(TranslationBase.of(context).liveCareSupportContact, style: TextStyle(fontSize: 12.0, fontWeight: FontWeight.w600, letterSpacing: -0.48)), + // ), + // Directionality(textDirection: TextDirection.ltr, child: Text("011 525 9553", style: TextStyle(fontSize: 12.0, fontWeight: FontWeight.w600, letterSpacing: -0.48))) + // ], + // ), mHeight(12.0), Container( child: DefaultButton(TranslationBase.of(context).callLiveCareSupport, () { diff --git a/lib/pages/login/register-info.dart b/lib/pages/login/register-info.dart index ee58f8d5..1b81dbfb 100644 --- a/lib/pages/login/register-info.dart +++ b/lib/pages/login/register-info.dart @@ -6,8 +6,7 @@ import 'package:diplomaticquarterapp/core/viewModels/appointment_rate_view_model import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/locator.dart'; import 'package:diplomaticquarterapp/models/Appointments/toDoCountProviderModel.dart'; -import 'package:diplomaticquarterapp/models/Authentication/check_activation_code_response.dart' - as checkActivation; +import 'package:diplomaticquarterapp/models/Authentication/check_activation_code_response.dart' as checkActivation; import 'package:diplomaticquarterapp/models/Authentication/check_paitent_authentication_req.dart'; import 'package:diplomaticquarterapp/models/Authentication/countries_list.dart'; import 'package:diplomaticquarterapp/models/Authentication/register_info_response.dart'; @@ -38,8 +37,7 @@ class RegisterInfo extends StatefulWidget { final Function changePageViewIndex; final int page; - const RegisterInfo({Key key, this.changePageViewIndex, this.page = 1}) - : super(key: key); + const RegisterInfo({Key key, this.changePageViewIndex, this.page = 1}) : super(key: key); @override _RegisterInfo createState() => _RegisterInfo(); @@ -48,7 +46,7 @@ class RegisterInfo extends StatefulWidget { class _RegisterInfo extends State { final authService = new AuthProvider(); final sharedPref = new AppSharedPreferences(); - RegisterInfoResponse registerInfo =RegisterInfoResponse(); + RegisterInfoResponse registerInfo = RegisterInfoResponse(); bool isLoading; int page; final List locationList = [ @@ -63,25 +61,23 @@ class _RegisterInfo extends State { ]; final List genderList = [ new Language(name: 'Male', value: 'M', nameAr: "ذكر"), - new Language(name: 'Female', value: 'F',nameAr: "أنثى"), + new Language(name: 'Female', value: 'F', nameAr: "أنثى"), ]; final List maritalList = [ new Language(name: 'Married', value: 'M', nameAr: "متزوج"), - new Language(name: 'Single', value: 'S',nameAr: "اعزب"), - new Language(name: 'Divorce', value: 'D',nameAr:"الطلاق"), + new Language(name: 'Single', value: 'S', nameAr: "اعزب"), + new Language(name: 'Divorce', value: 'D', nameAr: "الطلاق"), ]; String email = ''; List countriesList = []; ToDoCountProviderModel toDoProvider; String location = '1'; - AuthenticatedUserObject authenticatedUserObject = - locator(); + AuthenticatedUserObject authenticatedUserObject = locator(); ProjectViewModel projectViewModel; - AppointmentRateViewModel appointmentRateViewModel = - locator(); - bool isDubai =false; + AppointmentRateViewModel appointmentRateViewModel = locator(); + bool isDubai = false; RegisterInfoResponse data = RegisterInfoResponse(); CheckPatientAuthenticationReq data2; String gender = 'M'; @@ -90,15 +86,14 @@ class _RegisterInfo extends State { @override void initState() { - - if(widget.page ==1) { - getCountries(); - } - WidgetsBinding.instance.addPostFrameCallback((timeStamp) { - getRegisterInfo(); - }); - page = widget.page; - super.initState(); + if (widget.page == 1) { + getCountries(); + } + WidgetsBinding.instance.addPostFrameCallback((timeStamp) { + getRegisterInfo(); + }); + page = widget.page; + super.initState(); } @override @@ -106,23 +101,17 @@ class _RegisterInfo extends State { projectViewModel = Provider.of(context); toDoProvider = Provider.of(context); return AppScaffold( - appBarTitle: TranslationBase - .of(context) - .register, + appBarTitle: TranslationBase.of(context).register, isShowAppBar: false, isShowDecPage: false, body: SingleChildScrollView( padding: EdgeInsets.all(30), - child: - Column(crossAxisAlignment: CrossAxisAlignment.start, children: < - Widget>[ + child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ Row( children: [ Expanded( child: AppText( - TranslationBase - .of(context) - .personalInfo, + TranslationBase.of(context).personalInfo, fontSize: 16, textAlign: TextAlign.left, fontWeight: FontWeight.bold, @@ -134,395 +123,277 @@ class _RegisterInfo extends State { SizedBox(height: 20), (isDubai && page == 1) ? Column( - children: [ - SizedBox(height: 20), - getnameField( - TranslationBase - .of(context) - .identificationNumber, - registerd_data.patientIdentificationID, - TranslationBase - .of(context) - .mobileNumber, - registerd_data.patientMobileNumber.toString()), - // SizedBox(height: 20), - projectViewModel.isArabic ? getnameField( - '', - - - inputWidget( "First Name","First Name English",'fNameEn'), - '', - inputWidget( "Last Name", "Last Name English",'lNameEn'), - ) :SizedBox(height: 0,), - getnameField( - '', - - - inputWidget( TranslationBase - .of(context) - .firstName, TranslationBase - .of(context) - .firstName,'fName'), - '', - inputWidget( TranslationBase - .of(context) - .middleName, TranslationBase - .of(context) - .middleName,'sName'), - ), - - getnameField( - '', - inputWidget( TranslationBase - .of(context) - .lastName, TranslationBase - .of(context) - .lastName, 'lName'), + children: [ + SizedBox(height: 20), + getnameField(TranslationBase.of(context).identificationNumber, registerd_data.patientIdentificationID, TranslationBase.of(context).mobileNumber, + registerd_data.patientMobileNumber.toString()), + // SizedBox(height: 20), + projectViewModel.isArabic + ? getnameField( + '', + inputWidget("First Name", "First Name English", 'fNameEn'), + '', + inputWidget("Last Name", "Last Name English", 'lNameEn'), + ) + : SizedBox( + height: 0, + ), + getnameField( + '', + inputWidget(TranslationBase.of(context).firstName, TranslationBase.of(context).firstName, 'fName'), + '', + inputWidget(TranslationBase.of(context).middleName, TranslationBase.of(context).middleName, 'sName'), + ), - TranslationBase - .of(context) - .gender, - Container( - height: 20, - child: DropdownButtonHideUnderline( - child: DropdownButton( - isExpanded: true, - value: gender, - hint: Text(TranslationBase - .of(context) - .gender), - iconSize: 40, - elevation: 16, - onChanged: (value) => - { - setState(() { - gender = value; - registerInfo.gender = value; - }) - }, - items: genderList - .map>( - (Language value) { - return DropdownMenuItem( - value: value.value, - child: Text( projectViewModel.isArabic ==1 ? value.nameAr : value.name , - ), - ); - }).toList()))), - ), - SizedBox(height: 20), - getnameField( - TranslationBase - .of(context) - .maritalStatus, - Container( - height: 18, - child: DropdownButtonHideUnderline( - child: DropdownButton( - isExpanded: true, - value: maritalStatus, - hint: Text(TranslationBase - .of(context) - .maritalStatus), - iconSize: 40, - elevation: 16, - onChanged: (value) => - { - setState(() { - maritalStatus = value; - registerInfo.maritalStatusCode = value; - }) - }, - items: maritalList - .map>( - (Language value) { + getnameField( + '', + inputWidget(TranslationBase.of(context).lastName, TranslationBase.of(context).lastName, 'lName'), + TranslationBase.of(context).gender, + Container( + height: 20, + child: DropdownButtonHideUnderline( + child: DropdownButton( + isExpanded: true, + value: gender, + hint: Text(TranslationBase.of(context).gender), + iconSize: 40, + elevation: 16, + onChanged: (value) => { + setState(() { + gender = value; + registerInfo.gender = value; + }) + }, + items: genderList.map>((Language value) { return DropdownMenuItem( value: value.value, - child: Text( projectViewModel.isArabic ==1 ? value.nameAr : value.name , + child: Text( + projectViewModel.isArabic == 1 ? value.nameAr : value.name, ), ); }).toList()))), - TranslationBase - .of(context) - .nationality, - Container( - height: 22, - child: DropdownButtonHideUnderline( - child: DropdownButton( - isExpanded: true, - value: nationality, - hint: Text(TranslationBase - .of(context) - .nationality), - iconSize: 40, - elevation: 16, - onChanged: (value) => - { - setState(() { - nationality = value; - registerInfo.nationalityCode = value; - }) - }, - items: countriesList - .map>( - (CountriesLists value) { - return DropdownMenuItem( - value: value.iD, - child: Text(value.name , - ), - ); - }).toList())))), - SizedBox(height: 20), - getnameField( - TranslationBase - .of(context) - .dateOfBirth, - registerd_data.dob, - "", ""), - SizedBox(height: 20), - ], - ) + ), + SizedBox(height: 20), + getnameField( + TranslationBase.of(context).maritalStatus, + Container( + height: 18, + child: DropdownButtonHideUnderline( + child: DropdownButton( + isExpanded: true, + value: maritalStatus, + hint: Text(TranslationBase.of(context).maritalStatus), + iconSize: 40, + elevation: 16, + onChanged: (value) => { + setState(() { + maritalStatus = value; + registerInfo.maritalStatusCode = value; + }) + }, + items: maritalList.map>((Language value) { + return DropdownMenuItem( + value: value.value, + child: Text( + projectViewModel.isArabic == 1 ? value.nameAr : value.name, + ), + ); + }).toList()))), + TranslationBase.of(context).nationality, + Container( + height: 22, + child: DropdownButtonHideUnderline( + child: DropdownButton( + isExpanded: true, + value: nationality, + hint: Text(TranslationBase.of(context).nationality), + iconSize: 40, + elevation: 16, + onChanged: (value) => { + setState(() { + nationality = value; + registerInfo.nationalityCode = value; + }) + }, + items: countriesList.map>((CountriesLists value) { + return DropdownMenuItem( + value: value.iD, + child: Text( + value.name, + ), + ); + }).toList())))), + SizedBox(height: 20), + getnameField(TranslationBase.of(context).dateOfBirth, registerd_data.dob, "", ""), + SizedBox(height: 20), + ], + ) : (registerInfo.healthId != null && page == 1) - ? Column( - children: [ - SizedBox(height: 20), - getnameField( - TranslationBase - .of(context) - .identificationNumber, - registerInfo.idNumber, - TranslationBase - .of(context) - .firstName, - registerInfo.firstNameEn == '-' - ? registerInfo.firstNameAr - : registerInfo.firstNameEn), - SizedBox(height: 20), - getnameField( - TranslationBase - .of(context) - .middleName, - registerInfo.secondNameEn == '-' - ? registerInfo.secondNameEn - : registerInfo.secondNameEn, - TranslationBase - .of(context) - .lastName, - registerInfo.lastNameEn == '-' - ? registerInfo.lastNameEn - : registerInfo.lastNameEn), - SizedBox(height: 20), - getnameField( - TranslationBase - .of(context) - .gender, - registerInfo.maritalStatusCode == 'U' - ? 'Unknown' - : registerInfo.maritalStatusCode == 'M' - ? 'Male' - : 'Female', - TranslationBase - .of(context) - .maritalStatus, - registerInfo.maritalStatus), - SizedBox(height: 20), - getnameField( - TranslationBase - .of(context) - .nationality, - registerInfo.nationality, - TranslationBase - .of(context) - .mobileNumber, - registerd_data.patientMobileNumber.toString()), - SizedBox(height: 20), - getnameField(TranslationBase - .of(context) - .dateOfBirth, - registerInfo.dateOfBirth, "", ""), - SizedBox(height: 20), - ], - ) - : widget.page == 2 - ? Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Container( - width: double.infinity, - decoration: containerRadius(Colors.white, 12), - padding: EdgeInsets.only( - left: 10, right: 10, top: 5, bottom: 25), - child: Row(children: [ - Flexible( - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Text( - TranslationBase - .of(context) - .prefferedLanguage, - style: TextStyle( - fontSize: 11, - letterSpacing: -0.44, - fontWeight: FontWeight.w600, - ), - ), - Container( - height: 18, - child: - DropdownButtonHideUnderline( - child: DropdownButton( - isExpanded: true, - value: language, - hint: Text(TranslationBase - .of(context) - .prefferedLanguage), - iconSize: 40, - elevation: 16, - onChanged: (value) => - { - setState(() { - language = - value; - }) - }, - items: languageList.map< - DropdownMenuItem< - String>>( - (Language value) { - return DropdownMenuItem< - String>( - value: - value.value, - child: Text( - projectViewModel.isArabic ==1 ? value.nameAr : value.name , - ), - ); - }).toList()))) - ])) - ])), - SizedBox( - height: 20, - ), - Container( - width: double.infinity, - decoration: containerRadius(Colors.white, 12), - padding: EdgeInsets.only( - left: 10, right: 10, top: 5, bottom: 25), - child: Row(children: [ - Flexible( - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Text( - TranslationBase - .of(context) - .selectLocation, - style: TextStyle( - fontSize: 11, - letterSpacing: -0.44, - fontWeight: FontWeight.w600, - ), - ), - Container( - height: 18, - child: - DropdownButtonHideUnderline( - child: DropdownButton( - isExpanded: true, - value: location, - hint: Text( - TranslationBase - .of( - context) - .selectLocation), - iconSize: 40, - elevation: 16, - onChanged: (value) => - { - setState(() { - location = - value; - }) - }, - items: locationList.map< - DropdownMenuItem< - String>>( - (Location value) { - return DropdownMenuItem< - String>( - value: - value.value, - child: Text( - projectViewModel.isArabic ==1 ? value.nameAr : value.name , - ), - ); - }).toList()))) - ])) - ])), - SizedBox( - height: 20, - ), - Container( - width: double.infinity, - decoration: containerRadius(Colors.white, 12), - padding: EdgeInsets.only( - left: 10, right: 10, top: 5, bottom: 12), - margin: EdgeInsets.only(bottom: 0), - child: Row(children: [ - Flexible( - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Text( - TranslationBase - .of(context) - .email, - style: TextStyle( - fontSize: 11, - letterSpacing: -0.44, - fontWeight: FontWeight.w600, - ), - ), - Container( - child: TextField( - onChanged: (value) { - setState(() { - email = value; - }); - }, - style: TextStyle( - fontSize: 14, - height: 21 / 14, - fontWeight: FontWeight.w400, - color: Color(0xff2B353E), - letterSpacing: -0.44, + ? Column( + children: [ + SizedBox(height: 20), + getnameField(TranslationBase.of(context).identificationNumber, registerInfo.idNumber, TranslationBase.of(context).firstName, + registerInfo.firstNameEn == '-' ? registerInfo.firstNameAr : registerInfo.firstNameEn), + SizedBox(height: 20), + getnameField(TranslationBase.of(context).middleName, registerInfo.secondNameEn == '-' ? registerInfo.secondNameEn : registerInfo.secondNameEn, + TranslationBase.of(context).lastName, registerInfo.lastNameEn == '-' ? registerInfo.lastNameEn : registerInfo.lastNameEn), + SizedBox(height: 20), + getnameField( + TranslationBase.of(context).gender, + registerInfo.maritalStatusCode == 'U' + ? 'Unknown' + : registerInfo.maritalStatusCode == 'M' + ? 'Male' + : 'Female', + TranslationBase.of(context).maritalStatus, + registerInfo.maritalStatus), + SizedBox(height: 20), + getnameField(TranslationBase.of(context).nationality, registerInfo.nationality, TranslationBase.of(context).mobileNumber, registerd_data.patientMobileNumber.toString()), + SizedBox(height: 20), + getnameField(TranslationBase.of(context).dateOfBirth, registerInfo.dateOfBirth, "", ""), + SizedBox(height: 20), + ], + ) + : widget.page == 2 + ? Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + width: double.infinity, + decoration: containerRadius(Colors.white, 12), + padding: EdgeInsets.only(left: 10, right: 10, top: 5, bottom: 25), + child: Row(children: [ + Flexible( + child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ + Text( + TranslationBase.of(context).prefferedLanguage, + style: TextStyle( + fontSize: 11, + letterSpacing: -0.44, + fontWeight: FontWeight.w600, + ), + ), + Container( + height: 18, + child: DropdownButtonHideUnderline( + child: DropdownButton( + isExpanded: true, + value: language, + hint: Text(TranslationBase.of(context).prefferedLanguage), + iconSize: 40, + elevation: 16, + onChanged: (value) => { + setState(() { + language = value; + }) + }, + items: languageList.map>((Language value) { + return DropdownMenuItem( + value: value.value, + child: Text( + projectViewModel.isArabic == 1 ? value.nameAr : value.name, + ), + ); + }).toList()))) + ])) + ])), + SizedBox( + height: 20, + ), + Container( + width: double.infinity, + decoration: containerRadius(Colors.white, 12), + padding: EdgeInsets.only(left: 10, right: 10, top: 5, bottom: 25), + child: Row(children: [ + Flexible( + child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ + Text( + TranslationBase.of(context).selectLocation, + style: TextStyle( + fontSize: 11, + letterSpacing: -0.44, + fontWeight: FontWeight.w600, + ), ), - decoration: InputDecoration( - isDense: true, - hintStyle: TextStyle( + Container( + height: 18, + child: DropdownButtonHideUnderline( + child: DropdownButton( + isExpanded: true, + value: location, + hint: Text(TranslationBase.of(context).selectLocation), + iconSize: 40, + elevation: 16, + onChanged: (value) => { + setState(() { + location = value; + }) + }, + items: locationList.map>((Location value) { + return DropdownMenuItem( + value: value.value, + child: Text( + projectViewModel.isArabic == 1 ? value.nameAr : value.name, + ), + ); + }).toList()))) + ])) + ])), + SizedBox( + height: 20, + ), + Container( + width: double.infinity, + decoration: containerRadius(Colors.white, 12), + padding: EdgeInsets.only(left: 10, right: 10, top: 5, bottom: 12), + margin: EdgeInsets.only(bottom: 0), + child: Row(children: [ + Flexible( + child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ + Text( + TranslationBase.of(context).email, + style: TextStyle( + fontSize: 11, + letterSpacing: -0.44, + fontWeight: FontWeight.w600, + ), + ), + Container( + child: TextField( + keyboardType: TextInputType.emailAddress, + onChanged: (value) { + setState(() { + email = value; + }); + }, + style: TextStyle( fontSize: 14, height: 21 / 14, fontWeight: FontWeight.w400, - color: Color(0xff575757), - letterSpacing: -0.56, + color: Color(0xff2B353E), + letterSpacing: -0.44, ), - prefixIconConstraints: - BoxConstraints(minWidth: 50), - contentPadding: EdgeInsets.zero, - border: InputBorder.none, - focusedBorder: InputBorder.none, - enabledBorder: InputBorder.none, - ), - )) - ])) - ])), - ], - ) - : SizedBox(), + decoration: InputDecoration( + isDense: true, + hintStyle: TextStyle( + fontSize: 14, + height: 21 / 14, + fontWeight: FontWeight.w400, + color: Color(0xff575757), + letterSpacing: -0.56, + ), + prefixIconConstraints: BoxConstraints(minWidth: 50), + contentPadding: EdgeInsets.zero, + border: InputBorder.none, + focusedBorder: InputBorder.none, + enabledBorder: InputBorder.none, + ), + )) + ])) + ])), + ], + ) + : SizedBox(), ]), ), bottomSheet: Container( @@ -533,148 +404,105 @@ class _RegisterInfo extends State { Expanded( child: Padding( padding: EdgeInsets.all(10), - child: - DefaultButton(TranslationBase - .of(context) - .cancel, () { + child: DefaultButton(TranslationBase.of(context).cancel, () { Navigator.of(context).pop(); - locator() - .loginRegistration - .registration_cancel( - step: page == 1 - ? 'personal info' - : 'other details'); + locator().loginRegistration.registration_cancel(step: page == 1 ? 'personal info' : 'other details'); }, textColor: Colors.white, color: Color(0xffD02127))), ), Expanded( child: Padding( padding: EdgeInsets.all(10), - child: DefaultButton( - page == 1 - ? TranslationBase - .of(context) - .next - : TranslationBase - .of(context) - .register, () { + child: DefaultButton(page == 1 ? TranslationBase.of(context).next : TranslationBase.of(context).register, () { nextPage(); - page == 1 - ? locator() - .loginRegistration - .registration_personal_info() - : locator() - .loginRegistration - .registration_patient_info(); - }, - textColor: Colors.white, - color: isValid() == true - ? Color(0xff359846) - : Colors.grey)), + page == 1 ? locator().loginRegistration.registration_personal_info() : locator().loginRegistration.registration_patient_info(); + }, textColor: Colors.white, color: isValid() == true ? Color(0xff359846) : Colors.grey)), ), ], ))); } - nextPage() async{ + nextPage() async { if (page == 1) { - if(isDubai) { - await setRegisterData(); + if (isDubai) { + await setRegisterData(); + widget.changePageViewIndex(2); + } else { widget.changePageViewIndex(2); - } - else{ - widget.changePageViewIndex(2); - } + } } else { registerNow(); } } - setRegisterData() async{ + setRegisterData() async { registerInfo.gender = gender; - registerInfo.maritalStatusCode =maritalStatus; - registerInfo.nationalityCode =nationality; - projectViewModel.setRegisterData(registerInfo); - // await sharedPref.setObject(REGISTER_INFO_DUBAI, registerInfo); + registerInfo.maritalStatusCode = maritalStatus; + registerInfo.nationalityCode = nationality; + projectViewModel.setRegisterData(registerInfo); + // await sharedPref.setObject(REGISTER_INFO_DUBAI, registerInfo); } + registerNow() { dynamic request; - if(isDubai) + if (isDubai) request = getTempUserRequestDubai(); - else - request = getTempUserRequest(); + else + request = getTempUserRequest(); - GifLoaderDialogUtils.showMyDialog(context); + GifLoaderDialogUtils.showMyDialog(context); dynamic res; this .authService .registerUser(request) - .then((result) => - { - GifLoaderDialogUtils.hideDialog(context), - if (result is String) - { - new ConfirmDialog( - context: context, - confirmMessage: result, - okText: TranslationBase - .of(context) - .ok, - cancelText: TranslationBase - .of(context) - .cancel_nocaps, - okFunction: () => - {ConfirmDialog.closeAlertDialog(context)}, - cancelFunction: () => - { - ConfirmDialog.closeAlertDialog(context) - }).showAlertDialog(context) - } - else - { - res = result, - result = checkActivation.CheckActivationCode.fromJson(result), - // result.list.isFamily = false, - // sharedPref.setObject(USER_PROFILE, result.list), - // this.sharedPref.setObject(MAIN_USER, result.list), - // sharedPref.setObject(LOGIN_TOKEN_ID, result.logInTokenID), - // sharedPref.setString(TOKEN, result.authenticationTokenID), - // this.setUser(result), - sharedPref.remove(FAMILY_FILE), - result.list.isFamily = false, - - sharedPref.setString(BLOOD_TYPE, result.patientBloodType), - authenticatedUserObject.user = result.list, - projectViewModel.setPrivilege(privilegeList: res), - sharedPref.setObject(MAIN_USER, result.list), - sharedPref.setObject(USER_PROFILE, result.list), - - sharedPref.setObject(LOGIN_TOKEN_ID, result.logInTokenID), - sharedPref.setString(TOKEN, result.authenticationTokenID), - AppToast.showSuccessToast( - message: TranslationBase - .of(context) - .successRegister), - checkIfUserAgreedBefore(result), - projectViewModel.analytics.loginRegistration - .registration_confirmation() - } - }) + .then((result) => { + GifLoaderDialogUtils.hideDialog(context), + if (result is String) + { + new ConfirmDialog( + context: context, + confirmMessage: result, + okText: TranslationBase.of(context).ok, + cancelText: TranslationBase.of(context).cancel_nocaps, + okFunction: () => {ConfirmDialog.closeAlertDialog(context)}, + cancelFunction: () => {ConfirmDialog.closeAlertDialog(context)}).showAlertDialog(context) + } + else + { + res = result, + result = checkActivation.CheckActivationCode.fromJson(result), + // result.list.isFamily = false, + // sharedPref.setObject(USER_PROFILE, result.list), + // this.sharedPref.setObject(MAIN_USER, result.list), + // sharedPref.setObject(LOGIN_TOKEN_ID, result.logInTokenID), + // sharedPref.setString(TOKEN, result.authenticationTokenID), + // this.setUser(result), + sharedPref.remove(FAMILY_FILE), + result.list.isFamily = false, + + sharedPref.setString(BLOOD_TYPE, result.patientBloodType), + authenticatedUserObject.user = result.list, + projectViewModel.setPrivilege(privilegeList: res), + sharedPref.setObject(MAIN_USER, result.list), + sharedPref.setObject(USER_PROFILE, result.list), + + sharedPref.setObject(LOGIN_TOKEN_ID, result.logInTokenID), + sharedPref.setString(TOKEN, result.authenticationTokenID), + AppToast.showSuccessToast(message: TranslationBase.of(context).successRegister), + checkIfUserAgreedBefore(result), + projectViewModel.analytics.loginRegistration.registration_confirmation() + } + }) .catchError((err) { // GifLoaderDialogUtils.hideDialog(context); ConfirmDialog dialog = new ConfirmDialog( context: context, confirmMessage: err, - okText: TranslationBase - .of(context) - .confirm, - cancelText: TranslationBase - .of(context) - .cancel_nocaps, + okText: TranslationBase.of(context).confirm, + cancelText: TranslationBase.of(context).cancel_nocaps, okFunction: () => {ConfirmDialog.closeAlertDialog(context)}, cancelFunction: () => {ConfirmDialog.closeAlertDialog(context)}); dialog.showAlertDialog(context); - projectViewModel.analytics.loginRegistration - .registration_fail(errorType: err); + projectViewModel.analytics.loginRegistration.registration_fail(errorType: err); }); } @@ -688,45 +516,33 @@ class _RegisterInfo extends State { } getRegisterInfo() async { - if (await sharedPref.getObject(NHIC_DATA) != null) { - data = - RegisterInfoResponse.fromJson(await sharedPref.getObject(NHIC_DATA)); + data = RegisterInfoResponse.fromJson(await sharedPref.getObject(NHIC_DATA)); this.registerInfo = data; } if (await sharedPref.getObject(REGISTER_DATA_FOR_LOGIIN) != null) { - data2 = CheckPatientAuthenticationReq.fromJson( - await sharedPref.getObject(REGISTER_DATA_FOR_LOGIIN)); + data2 = CheckPatientAuthenticationReq.fromJson(await sharedPref.getObject(REGISTER_DATA_FOR_LOGIIN)); setState(() { - - this.registerd_data = data2; isDubai = data2.patientOutSA == 1 ? true : false; - if(isDubai) location ='2'; + if (isDubai) location = '2'; }); } } getTempUserRequest() { - - DateFormat dateFormat = DateFormat("mm/dd/yyyy"); print(dateFormat.parse(registerInfo.dateOfBirth)); - var hDate = - new HijriCalendar.fromDate(dateFormat.parse(registerInfo.dateOfBirth)); + var hDate = new HijriCalendar.fromDate(dateFormat.parse(registerInfo.dateOfBirth)); var date = hDate.toString(); return { "Patientobject": { "TempValue": true, - "PatientIdentificationType": - registerInfo.idNumber.substring(0, 1) == "1" ? 1 : 2, + "PatientIdentificationType": registerInfo.idNumber.substring(0, 1) == "1" ? 1 : 2, "PatientIdentificationNo": registerInfo.idNumber, "MobileNumber": registerd_data.patientMobileNumber, - "PatientOutSA": (registerd_data.zipCode == '966' || - registerd_data.zipCode == '+966') - ? 0 - : 1, + "PatientOutSA": (registerd_data.zipCode == '966' || registerd_data.zipCode == '+966') ? 0 : 1, "FirstNameN": registerInfo.firstNameAr, "FirstName": registerInfo.firstNameEn, "MiddleNameN": registerInfo.secondNameAr, @@ -734,9 +550,8 @@ class _RegisterInfo extends State { "LastNameN": registerInfo.lastNameAr, "LastName": registerInfo.lastNameEn, "StrDateofBirth": registerInfo.dateOfBirth, - "DateofBirth": DateUtil.convertISODateToJsonDate( - registerInfo.dateOfBirth.replaceAll('/', '-')), - "Gender": registerInfo.gender== 'M' ? 1 : 2, + "DateofBirth": DateUtil.convertISODateToJsonDate(registerInfo.dateOfBirth.replaceAll('/', '-')), + "Gender": registerInfo.gender == 'M' ? 1 : 2, "NationalityID": registerInfo.nationalityCode, "eHealthIDField": registerInfo.healthId, "DateofBirthN": date, @@ -746,24 +561,19 @@ class _RegisterInfo extends State { "Marital": registerInfo.maritalStatusCode == 'U' ? '0' : registerInfo.maritalStatusCode == 'M' - ? '1' - : '2', + ? '1' + : '2', }, "PatientIdentificationID": registerInfo.idNumber, - "PatientMobileNumber": - registerd_data.patientMobileNumber.toString()[0] == '0' - ? registerd_data.patientMobileNumber - : '0' + registerd_data.patientMobileNumber.toString(), + "PatientMobileNumber": registerd_data.patientMobileNumber.toString()[0] == '0' ? registerd_data.patientMobileNumber : '0' + registerd_data.patientMobileNumber.toString(), }; } - - getTempUserRequestDubai(){ + getTempUserRequestDubai() { DateFormat dateFormat = DateFormat("mm/dd/yyyy"); - registerInfo= projectViewModel.registerInfo; + registerInfo = projectViewModel.registerInfo; print(dateFormat.parse(registerd_data.dob)); - var hDate = - new HijriCalendar.fromDate(dateFormat.parse(registerd_data.dob)); + var hDate = new HijriCalendar.fromDate(dateFormat.parse(registerd_data.dob)); var date = hDate.toString(); final DateFormat dateFormat1 = DateFormat('MM/dd/yyyy'); final DateFormat dateFormat2 = DateFormat('dd/MM/yyyy'); @@ -771,27 +581,21 @@ class _RegisterInfo extends State { return { "Patientobject": { "TempValue": true, - "PatientIdentificationType": - registerd_data.patientIdentificationID.substring(0, 1) == "1" ? 1 : 2, + "PatientIdentificationType": registerd_data.patientIdentificationID.substring(0, 1) == "1" ? 1 : 2, "PatientIdentificationNo": registerd_data.patientIdentificationID, "MobileNumber": registerd_data.patientMobileNumber, - "PatientOutSA": (registerd_data.zipCode == '966' || - registerd_data.zipCode == '+966') - ? 0 - : 1, - "FirstNameN": registerInfo.firstNameAr ??"", - "FirstName": registerInfo.firstNameEn??"", - "MiddleNameN": registerInfo.secondNameAr?? "", - "MiddleName": registerInfo.secondNameEn ??"", - "LastNameN": registerInfo.lastNameAr ??"", - "LastName":registerInfo.lastNameEn ??"", - "StrDateofBirth": dateFormat1.format( - dateFormat2.parse(registerd_data.dob)), - "DateofBirth": DateUtil.convertISODateToJsonDate( - registerd_data.dob.replaceAll('/', '-')), - "Gender": registerInfo.gender== 'M' ? 1 : 2, + "PatientOutSA": (registerd_data.zipCode == '966' || registerd_data.zipCode == '+966') ? 0 : 1, + "FirstNameN": registerInfo.firstNameAr ?? "", + "FirstName": registerInfo.firstNameEn ?? "", + "MiddleNameN": registerInfo.secondNameAr ?? ".", + "MiddleName": registerInfo.secondNameEn ?? ".", + "LastNameN": registerInfo.lastNameAr ?? "", + "LastName": registerInfo.lastNameEn ?? "", + "StrDateofBirth": dateFormat1.format(dateFormat2.parse(registerd_data.dob)), + "DateofBirth": DateUtil.convertISODateToJsonDate(registerd_data.dob.replaceAll('/', '-')), + "Gender": registerInfo.gender == 'M' ? 1 : 2, "NationalityID": registerInfo.nationalityCode, - "eHealthIDField":null, + "eHealthIDField": null, "DateofBirthN": date, "EmailAddress": email, "SourceType": location, @@ -799,23 +603,20 @@ class _RegisterInfo extends State { "Marital": registerInfo.maritalStatusCode == 'U' ? '0' : registerInfo.maritalStatusCode == 'M' - ? '1' - : '2', + ? '1' + : '2', }, "PatientIdentificationID": registerd_data.patientIdentificationID, - "PatientMobileNumber": - registerd_data.patientMobileNumber.toString()[0] == '0' - ? registerd_data.patientMobileNumber - : '0' + registerd_data.patientMobileNumber.toString(), - "DOB":registerd_data.dob, - "IsHijri":registerd_data.isHijri + "PatientMobileNumber": registerd_data.patientMobileNumber.toString()[0] == '0' ? registerd_data.patientMobileNumber : '0' + registerd_data.patientMobileNumber.toString(), + "DOB": registerd_data.dob, + "IsHijri": registerd_data.isHijri }; } bool isValid() { - if ((location != null && - language != null && - Utils.validEmail(email) == true) || (registerInfo.firstNameEn !=null && registerInfo.secondNameEn !=null && registerInfo.lastNameEn !=null) || (projectViewModel.isArabic && registerInfo.firstNameEn !=null && registerInfo.firstNameAr !=null && registerInfo.lastNameEn !=null && registerInfo.secondNameAr !=null && registerInfo.lastNameAr !=null)) { + if ((location != null && language != null && Utils.validEmail(email) == true) || + (registerInfo.firstNameEn != null && registerInfo.lastNameEn != null) || + (projectViewModel.isArabic && registerInfo.firstNameEn != null && registerInfo.firstNameAr != null && registerInfo.lastNameEn != null && registerInfo.lastNameAr != null)) { return true; } else { return false; @@ -841,13 +642,13 @@ class _RegisterInfo extends State { ), value1 is String ? Text( - value1, - style: TextStyle( - fontSize: 12, - fontWeight: FontWeight.w600, - letterSpacing: -0.44, - ), - ) + value1, + style: TextStyle( + fontSize: 12, + fontWeight: FontWeight.w600, + letterSpacing: -0.44, + ), + ) : value1, ], ))), @@ -867,13 +668,13 @@ class _RegisterInfo extends State { ), value2 is String ? Text( - value2, - style: TextStyle( - fontSize: 12, - fontWeight: FontWeight.w600, - letterSpacing: -0.44, - ), - ) + value2, + style: TextStyle( + fontSize: 12, + fontWeight: FontWeight.w600, + letterSpacing: -0.44, + ), + ) : value2, ], ))) @@ -892,10 +693,7 @@ class _RegisterInfo extends State { insertIMEI() async { var selectedOption = await sharedPref.getInt(LAST_LOGIN); - authService - .insertDeviceImei(selectedOption) - .then((value) => {goToHome()}) - .catchError((err) { + authService.insertDeviceImei(selectedOption).then((value) => {goToHome()}).catchError((err) { print(err); }); } @@ -908,29 +706,28 @@ class _RegisterInfo extends State { await authenticatedUserObject.getUser(getUser: true); appointmentRateViewModel .getIsLastAppointmentRatedList() - .then((value) => - { - getToDoCount(), - GifLoaderDialogUtils.hideDialog(AppGlobal.context), - if (appointmentRateViewModel.isHaveAppointmentNotRate) - { - Navigator.pushAndRemoveUntil( - context, - FadePage( - page: RateAppointmentDoctor(), - ), - (r) => false) - } - else - { - Navigator.pushAndRemoveUntil( - context, - FadePage( - page: LandingPage(), - ), - (r) => false) - } - }) + .then((value) => { + getToDoCount(), + GifLoaderDialogUtils.hideDialog(AppGlobal.context), + if (appointmentRateViewModel.isHaveAppointmentNotRate) + { + Navigator.pushAndRemoveUntil( + context, + FadePage( + page: RateAppointmentDoctor(), + ), + (r) => false) + } + else + { + Navigator.pushAndRemoveUntil( + context, + FadePage( + page: LandingPage(), + ), + (r) => false) + } + }) .catchError((err) { print(err); //GifLoaderDialogUtils.hideDialog(context); @@ -954,19 +751,15 @@ class _RegisterInfo extends State { ClinicListService service = new ClinicListService(); service.getCountries().then((res) { if (res['MessageStatus'] == 1) { + res['ListNationality'].forEach((items) => {countriesList.add(CountriesLists.fromJson(items))}); - res['ListNationality'].forEach((items) => { - countriesList.add(CountriesLists.fromJson(items)) - }); - - setState(() {}); + setState(() {}); } }).catchError((err) { print(err); }); } - Widget inputWidget(String _labelText, String _hintText, String name, {String prefix, bool isEnable = true, bool hasSelection = false}) { return Container( padding: EdgeInsets.only(left: 10, right: 10, bottom: 5, top: 5), @@ -1000,54 +793,51 @@ class _RegisterInfo extends State { TextField( enabled: isEnable, scrollPadding: EdgeInsets.zero, - keyboardType: TextInputType.number, + keyboardType: TextInputType.text, // controller: _controller, onChanged: (value) => { - setState((){ - switch(name) { - case 'fName': - { - if(projectViewModel.isArabic) { - registerInfo.firstNameAr = value; - - }else{ - registerInfo.firstNameEn =value; - registerInfo.firstNameAr ='...'; - } - } - break; - case 'sName': - { - if(projectViewModel.isArabic) { - registerInfo.secondNameAr = value; - registerInfo.secondNameEn ='...'; - }else{ - registerInfo.secondNameEn =value; - registerInfo.secondNameAr ='...'; - } - } - break; - case 'lName': - { - if(projectViewModel.isArabic) { - registerInfo.lastNameAr = value; - - }else{ - registerInfo.lastNameEn =value; - registerInfo.lastNameAr ='...'; - } - } - break; - case 'fNameEn': - registerInfo.firstNameEn = value; - break; - case 'lNameEn': - registerInfo.lastNameEn = value; - break; - } + setState(() { + switch (name) { + case 'fName': + { + if (projectViewModel.isArabic) { + registerInfo.firstNameAr = value; + } else { + registerInfo.firstNameEn = value; + registerInfo.firstNameAr = '...'; + } + } + break; + case 'sName': + { + if (projectViewModel.isArabic) { + registerInfo.secondNameAr = value.isEmpty ? "." : value; + registerInfo.secondNameEn = '...'; + } else { + registerInfo.secondNameEn = value.isEmpty ? "." : value; + registerInfo.secondNameAr = '...'; + } + } + break; + case 'lName': + { + if (projectViewModel.isArabic) { + registerInfo.lastNameAr = value; + } else { + registerInfo.lastNameEn = value; + registerInfo.lastNameAr = '...'; + } + } + break; + case 'fNameEn': + registerInfo.firstNameEn = value; + break; + case 'lNameEn': + registerInfo.lastNameEn = value; + break; + } }) //_controller.text =value - }, style: TextStyle( fontSize: 14, @@ -1067,7 +857,6 @@ class _RegisterInfo extends State { letterSpacing: -0.56, ), prefixIconConstraints: BoxConstraints(minWidth: 50), - contentPadding: EdgeInsets.zero, border: InputBorder.none, focusedBorder: InputBorder.none, @@ -1083,14 +872,13 @@ class _RegisterInfo extends State { ), ); } - } - class Language { final String name; final String value; final String nameAr; + Language({this.name, this.value, this.nameAr}); } diff --git a/lib/pages/medical/patient_sick_leave_page.dart b/lib/pages/medical/patient_sick_leave_page.dart index f132741e..1ca32e02 100644 --- a/lib/pages/medical/patient_sick_leave_page.dart +++ b/lib/pages/medical/patient_sick_leave_page.dart @@ -57,8 +57,8 @@ class _PatientSickLeavePageState extends State { subName: model.sickLeaveList[index].clinicName, isSortByClinic: false, isInOutPatient: model.sickLeaveList[index].isInOutPatient, - isSickLeave: true, - sickLeaveStatus: model.sickLeaveList[index].status, + // isSickLeave: true, + // sickLeaveStatus: model.sickLeaveList[index].status, onEmailTap: () { showConfirmMessage(model, index); }, @@ -69,13 +69,13 @@ class _PatientSickLeavePageState extends State { } void showConfirmMessage(PatientSickLeaveViewMode model, int index) { - if (model.sickLeaveList[index].status == 1) { - openWorkPlaceUpdatePage(model.sickLeaveList[index].requestNo, model.sickLeaveList[index].setupID, model, index, model.sickLeaveList[index].projectID); - } else if (model.sickLeaveList[index].status == 2) { + // if (model.sickLeaveList[index].status == 1) { + // openWorkPlaceUpdatePage(model.sickLeaveList[index].requestNo, model.sickLeaveList[index].setupID, model, index, model.sickLeaveList[index].projectID); + // } else if (model.sickLeaveList[index].status == 2) { showEmailDialog(model, index); - } else { - showApprovalDialog(); - } + // } else { + // showApprovalDialog(); + // } } void showApprovalDialog() { diff --git a/lib/uitl/push-notification-handler.dart b/lib/uitl/push-notification-handler.dart index d8b59782..3e765c17 100644 --- a/lib/uitl/push-notification-handler.dart +++ b/lib/uitl/push-notification-handler.dart @@ -303,6 +303,10 @@ class PushNotificationHandler { onToken(token); }); + FirebaseMessaging.instance.getAPNSToken().then((value) { + print("Push APNS getToken: " + value); + }); + FirebaseMessaging.onBackgroundMessage(backgroundMessageHandler); } diff --git a/lib/widgets/in_app_browser/InAppBrowser.dart b/lib/widgets/in_app_browser/InAppBrowser.dart index f62248b8..e91990b4 100644 --- a/lib/widgets/in_app_browser/InAppBrowser.dart +++ b/lib/widgets/in_app_browser/InAppBrowser.dart @@ -37,9 +37,9 @@ class MyInAppBrowser extends InAppBrowser { // static String APPLE_PAY_PAYFORT_URL = 'https://hmgwebservices.com/PayFortWebLive/PayFortApi/MakeApplePayRequest'; // Payfort Payment Gateway URL LIVE static String APPLE_PAY_PAYFORT_URL = 'https://hmgwebservices.com/PayFortWebLive/PayFortApi/MakeApplePayRequest'; // Payfort Payment Gateway URL UAT - static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort Payment Gateway URL UAT + // static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort Payment Gateway URL UAT - // static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL LIVE + static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL LIVE // static String SERVICE_URL = 'https://uat.hmgwebservices.com/payfortforvidaplus/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL UAT VIDA PLUS diff --git a/pubspec.yaml b/pubspec.yaml index 46d8b2f1..834913a8 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,7 +1,7 @@ name: diplomaticquarterapp description: A new Flutter application. -version: 4.5.62+1 +version: 4.5.63+1 environment: sdk: ">=2.7.0 <3.0.0" From fcf0c589a0917cfae7de1f1f1c94345e79042803 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Sun, 21 May 2023 12:21:10 +0300 Subject: [PATCH 29/29] Updates & fixes --- .../all_habib_medical_service_page2.dart | 62 ++- .../h2o/h20_setting.dart | 2 +- lib/pages/DrawerPages/family/my-family.dart | 2 +- .../fragments/home_page_fragment2.dart | 13 +- lib/pages/landing/widgets/services_view.dart | 363 ++++++++++++------ lib/pages/medical/allergies_page.dart | 2 +- .../vital_sing_chart_blood_pressure.dart | 2 +- 7 files changed, 293 insertions(+), 153 deletions(-) diff --git a/lib/pages/AlHabibMedicalService/all_habib_medical_service_page2.dart b/lib/pages/AlHabibMedicalService/all_habib_medical_service_page2.dart index 5d0694ed..779c230e 100644 --- a/lib/pages/AlHabibMedicalService/all_habib_medical_service_page2.dart +++ b/lib/pages/AlHabibMedicalService/all_habib_medical_service_page2.dart @@ -65,29 +65,53 @@ class _AllHabibMedicalSevicePage2State extends State initialiseHmgServices(bool isLogin) { hmgServices.clear(); - hmgServices.add(new HmgServices(0, TranslationBase.of(context).liveCareTitle, TranslationBase.of(context).liveCareSubtitle, "assets/images/new/Live_Care.svg", isLogin)); - hmgServices.add(new HmgServices(1, TranslationBase.of(context).covidTest, TranslationBase.of(context).driveThru, "assets/images/new/CoronaIcon.svg", isLogin)); - hmgServices.add(new HmgServices(2, TranslationBase.of(context).onlinePayment, TranslationBase.of(context).onlinePaymentSubtitle, "assets/images/new/paymentMethods.png", isLogin)); + hmgServices.add(new HmgServices(0, TranslationBase.of(context).book, TranslationBase.of(context).appointmentLabel, "assets/images/new/book appointment.svg", isLogin)); + hmgServices.add(new HmgServices(1, TranslationBase.of(context).liveCare, TranslationBase.of(context).onlineConsulting, "assets/images/new/Live_Care.svg", isLogin)); + hmgServices.add(new HmgServices(2, TranslationBase.of(context).emergencyTitle, TranslationBase.of(context).emergencySubtitle, "assets/images/new/emergency.svg", isLogin)); hmgServices.add(new HmgServices(3, TranslationBase.of(context).hhcHome, TranslationBase.of(context).healthCare, "assets/images/new/HHC.svg", isLogin)); - hmgServices.add(new HmgServices(4, TranslationBase.of(context).cmcTitle, TranslationBase.of(context).cmcSubtitle, "assets/images/new/comprehensive_checkup.svg", isLogin)); - hmgServices.add(new HmgServices(5, TranslationBase.of(context).emergencyTitle, TranslationBase.of(context).emergencySubtitle, "assets/images/new/emergency.svg", isLogin)); - hmgServices.add(new HmgServices(6, TranslationBase.of(context).ereferralTitle, TranslationBase.of(context).ereferralSubtitle, "assets/images/new/E_Referral.svg", isLogin)); - hmgServices.add(new HmgServices(7, TranslationBase.of(context).waterTitle, TranslationBase.of(context).waterSubtitle, "assets/images/new/h2o.svg", isLogin)); - hmgServices.add(new HmgServices(8, TranslationBase.of(context).connectTitle, TranslationBase.of(context).connectSubtitle, "assets/images/new/reach_us.svg", isLogin)); - hmgServices.add(new HmgServices(9, TranslationBase.of(context).medicalFileTitle2, TranslationBase.of(context).medicalFileSubtitle, "assets/images/new/medical file.svg", isLogin)); - hmgServices.add(new HmgServices(10, TranslationBase.of(context).book, TranslationBase.of(context).appointmentLabel, "assets/images/new/book appointment.svg", isLogin)); - hmgServices.add(new HmgServices(11, TranslationBase.of(context).pharmacyTitle, TranslationBase.of(context).pharmacySubtitle, "assets/images/new/Pharmacy.svg", isLogin)); - hmgServices.add(new HmgServices(12, TranslationBase.of(context).updateInsurance, TranslationBase.of(context).updateInsuranceSubtitle, "assets/images/new/update insurance card.svg", isLogin)); - hmgServices.add(new HmgServices(13, TranslationBase.of(context).familyTitle, TranslationBase.of(context).familySubtitle, "assets/images/new/my family.svg", isLogin)); - hmgServices.add(new HmgServices(14, TranslationBase.of(context).My_Child, TranslationBase.of(context).Vaccines, "assets/images/new/child vaccines.svg", isLogin)); + hmgServices.add(new HmgServices(4, TranslationBase.of(context).checkup, TranslationBase.of(context).comprehensive, "assets/images/new/comprehensive_checkup.svg", isLogin)); + hmgServices.add(new HmgServices(5, TranslationBase.of(context).pharmacyTitle, TranslationBase.of(context).pharmacySubtitle, "assets/images/new/Pharmacy.svg", isLogin)); + + hmgServices.add(new HmgServices(6, TranslationBase.of(context).medicalFileTitle2, TranslationBase.of(context).medicalFileSubtitle, "assets/images/new/medical file.svg", isLogin)); + hmgServices.add(new HmgServices(7, TranslationBase.of(context).familyTitle, TranslationBase.of(context).familySubtitle, "assets/images/new/my family.svg", isLogin)); + hmgServices.add(new HmgServices(8, TranslationBase.of(context).online, TranslationBase.of(context).payment, "assets/images/new/paymentMethods.png", isLogin)); + hmgServices.add(new HmgServices(9, TranslationBase.of(context).My_Child, TranslationBase.of(context).Vaccines, "assets/images/new/child vaccines.svg", isLogin)); + hmgServices.add(new HmgServices(10, TranslationBase.of(context).updateInsurance, TranslationBase.of(context).updateInsuranceSubtitle, "assets/images/new/update insurance card.svg", isLogin)); + hmgServices.add(new HmgServices(11, TranslationBase.of(context).ereferralTitle, TranslationBase.of(context).ereferralSubtitle, "assets/images/new/E_Referral.svg", isLogin)); + hmgServices.add(new HmgServices(12, TranslationBase.of(context).waterTitle, TranslationBase.of(context).waterSubtitle, "assets/images/new/h2o.svg", isLogin)); + hmgServices.add(new HmgServices(13, TranslationBase.of(context).healthCalculatorTitle, TranslationBase.of(context).healthCalculatorSubtitle, "assets/images/new/health calculator.svg", isLogin)); + hmgServices.add(new HmgServices(14, TranslationBase.of(context).healthConvertersTitle, TranslationBase.of(context).healthConvertersSubtitle, "assets/images/new/health converter.svg", isLogin)); hmgServices.add(new HmgServices(15, TranslationBase.of(context).Todo, TranslationBase.of(context).list, "assets/images/new/todo.svg", isLogin)); hmgServices.add(new HmgServices(16, TranslationBase.of(context).Blood, TranslationBase.of(context).Donation, "assets/images/new/blood donation.svg", isLogin)); - hmgServices.add(new HmgServices(17, TranslationBase.of(context).healthCalculatorTitle, TranslationBase.of(context).healthCalculatorSubtitle, "assets/images/new/health calculator.svg", isLogin)); - hmgServices.add(new HmgServices(18, TranslationBase.of(context).healthConvertersTitle, TranslationBase.of(context).healthConvertersSubtitle, "assets/images/new/health converter.svg", isLogin)); + + hmgServices.add(new HmgServices(17, TranslationBase.of(context).covidTest, TranslationBase.of(context).driveThru, "assets/images/new/CoronaIcon.svg", isLogin)); + + hmgServices.add(new HmgServices(18, TranslationBase.of(context).Virtual, TranslationBase.of(context).Tour, "assets/images/new/virtual tour.svg", isLogin)); hmgServices.add(new HmgServices(19, TranslationBase.of(context).smartWatches.split(" ")[0], TranslationBase.of(context).smartWatches.split(" ")[1], "assets/images/new/smart watch.svg", isLogin)); hmgServices.add(new HmgServices(20, TranslationBase.of(context).parkingTitle2, TranslationBase.of(context).parkingSubtitle, "assets/images/new/parking details.svg", isLogin)); - hmgServices.add(new HmgServices(21, TranslationBase.of(context).Virtual, TranslationBase.of(context).Tour, "assets/images/new/virtual tour.svg", isLogin)); - hmgServices.add(new HmgServices(22, TranslationBase.of(context).latestNews.split(" ")[0], TranslationBase.of(context).latestNews.split(" ")[1], "assets/images/new/latest news.svg", isLogin)); + hmgServices.add(new HmgServices(21, TranslationBase.of(context).latestNews.split(" ")[0], TranslationBase.of(context).latestNews.split(" ")[1], "assets/images/new/latest news.svg", isLogin)); + + hmgServices.add(new HmgServices(22, TranslationBase.of(context).connectTitle, TranslationBase.of(context).connectSubtitle, "assets/images/new/reach_us.svg", isLogin)); + + + // hmgServices.add(new HmgServices(5, TranslationBase.of(context).emergencyTitle, TranslationBase.of(context).emergencySubtitle, "assets/images/new/emergency.svg", isLogin)); + // hmgServices.add(new HmgServices(6, TranslationBase.of(context).ereferralTitle, TranslationBase.of(context).ereferralSubtitle, "assets/images/new/E_Referral.svg", isLogin)); + // hmgServices.add(new HmgServices(7, TranslationBase.of(context).waterTitle, TranslationBase.of(context).waterSubtitle, "assets/images/new/h2o.svg", isLogin)); + // hmgServices.add(new HmgServices(8, TranslationBase.of(context).connectTitle, TranslationBase.of(context).connectSubtitle, "assets/images/new/reach_us.svg", isLogin)); + // hmgServices.add(new HmgServices(9, TranslationBase.of(context).medicalFileTitle2, TranslationBase.of(context).medicalFileSubtitle, "assets/images/new/medical file.svg", isLogin)); + // hmgServices.add(new HmgServices(10, TranslationBase.of(context).book, TranslationBase.of(context).appointmentLabel, "assets/images/new/book appointment.svg", isLogin)); + // hmgServices.add(new HmgServices(11, TranslationBase.of(context).pharmacyTitle, TranslationBase.of(context).pharmacySubtitle, "assets/images/new/Pharmacy.svg", isLogin)); + // hmgServices.add(new HmgServices(12, TranslationBase.of(context).updateInsurance, TranslationBase.of(context).updateInsuranceSubtitle, "assets/images/new/update insurance card.svg", isLogin)); + // hmgServices.add(new HmgServices(13, TranslationBase.of(context).familyTitle, TranslationBase.of(context).familySubtitle, "assets/images/new/my family.svg", isLogin)); + // hmgServices.add(new HmgServices(14, TranslationBase.of(context).My_Child, TranslationBase.of(context).Vaccines, "assets/images/new/child vaccines.svg", isLogin)); + // hmgServices.add(new HmgServices(15, TranslationBase.of(context).Todo, TranslationBase.of(context).list, "assets/images/new/todo.svg", isLogin)); + // hmgServices.add(new HmgServices(16, TranslationBase.of(context).Blood, TranslationBase.of(context).Donation, "assets/images/new/blood donation.svg", isLogin)); + // hmgServices.add(new HmgServices(17, TranslationBase.of(context).healthCalculatorTitle, TranslationBase.of(context).healthCalculatorSubtitle, "assets/images/new/health calculator.svg", isLogin)); + // hmgServices.add(new HmgServices(18, TranslationBase.of(context).healthConvertersTitle, TranslationBase.of(context).healthConvertersSubtitle, "assets/images/new/health converter.svg", isLogin)); + // hmgServices.add(new HmgServices(19, TranslationBase.of(context).smartWatches.split(" ")[0], TranslationBase.of(context).smartWatches.split(" ")[1], "assets/images/new/smart watch.svg", isLogin)); + // hmgServices.add(new HmgServices(20, TranslationBase.of(context).parkingTitle2, TranslationBase.of(context).parkingSubtitle, "assets/images/new/parking details.svg", isLogin)); + // hmgServices.add(new HmgServices(21, TranslationBase.of(context).Virtual, TranslationBase.of(context).Tour, "assets/images/new/virtual tour.svg", isLogin)); + // hmgServices.add(new HmgServices(22, TranslationBase.of(context).latestNews.split(" ")[0], TranslationBase.of(context).latestNews.split(" ")[1], "assets/images/new/latest news.svg", isLogin)); } @override @@ -211,7 +235,7 @@ class _AllHabibMedicalSevicePage2State extends State itemCount: hmgServices.length, padding: EdgeInsets.zero, itemBuilder: (BuildContext context, int index) { - return ServicesView(hmgServices[index], index); + return ServicesView(hmgServices[index], index, false); }, ), ), diff --git a/lib/pages/AlHabibMedicalService/h2o/h20_setting.dart b/lib/pages/AlHabibMedicalService/h2o/h20_setting.dart index 38d7a568..2feb7f0f 100644 --- a/lib/pages/AlHabibMedicalService/h2o/h20_setting.dart +++ b/lib/pages/AlHabibMedicalService/h2o/h20_setting.dart @@ -350,7 +350,7 @@ class _H2oSettingState extends State { TextField( enabled: isEnable, scrollPadding: EdgeInsets.zero, - keyboardType: TextInputType.number, + keyboardType: TextInputType.text, controller: _controller, onChanged: (value) => { // validateForm() diff --git a/lib/pages/DrawerPages/family/my-family.dart b/lib/pages/DrawerPages/family/my-family.dart index d9f15af8..f7d58b36 100644 --- a/lib/pages/DrawerPages/family/my-family.dart +++ b/lib/pages/DrawerPages/family/my-family.dart @@ -447,9 +447,9 @@ class _MyFamily extends State with TickerProviderStateMixin { } refreshFamily(context) { - GifLoaderDialogUtils.hideDialog(context); setState(() { sharedPref.remove(FAMILY_FILE); + checkUserData(); }); } diff --git a/lib/pages/landing/fragments/home_page_fragment2.dart b/lib/pages/landing/fragments/home_page_fragment2.dart index ee856487..9111c2ab 100644 --- a/lib/pages/landing/fragments/home_page_fragment2.dart +++ b/lib/pages/landing/fragments/home_page_fragment2.dart @@ -52,14 +52,15 @@ class _HomePageFragment2State extends State { initialiseHmgServices(bool isLogin) { hmgServices.clear(); - hmgServices.add(new HmgServices(0, TranslationBase.of(context).liveCare, TranslationBase.of(context).onlineConsulting, "assets/images/new/Live_Care.svg", isLogin)); - hmgServices.add(new HmgServices(1, TranslationBase.of(context).covidTest, TranslationBase.of(context).driveThru, "assets/images/new/CoronaIcon.svg", isLogin)); - hmgServices.add(new HmgServices(2, TranslationBase.of(context).online, TranslationBase.of(context).payment, "assets/images/new/paymentMethods.png", isLogin)); + + hmgServices.add(new HmgServices(0, TranslationBase.of(context).book, TranslationBase.of(context).appointmentLabel, "assets/images/new/book appointment.svg", isLogin)); + hmgServices.add(new HmgServices(1, TranslationBase.of(context).liveCare, TranslationBase.of(context).onlineConsulting, "assets/images/new/Live_Care.svg", isLogin)); + hmgServices.add(new HmgServices(2, TranslationBase.of(context).emergencyTitle, TranslationBase.of(context).emergencySubtitle, "assets/images/new/emergency.svg", isLogin)); hmgServices.add(new HmgServices(3, TranslationBase.of(context).hhcHome, TranslationBase.of(context).healthCare, "assets/images/new/HHC.svg", isLogin)); hmgServices.add(new HmgServices(4, TranslationBase.of(context).checkup, TranslationBase.of(context).comprehensive, "assets/images/new/comprehensive_checkup.svg", isLogin)); - hmgServices.add(new HmgServices(5, TranslationBase.of(context).emergencyTitle, TranslationBase.of(context).emergencySubtitle, "assets/images/new/emergency.svg", isLogin)); + hmgServices.add(new HmgServices(5, TranslationBase.of(context).online, TranslationBase.of(context).payment, "assets/images/new/paymentMethods.png", isLogin)); hmgServices.add(new HmgServices(6, TranslationBase.of(context).ereferralTitle, TranslationBase.of(context).ereferralSubtitle, "assets/images/new/E_Referral.svg", isLogin)); - hmgServices.add(new HmgServices(7, "H\u2082O", TranslationBase.of(context).dailyWater, "assets/images/new/h2o.svg", isLogin)); + hmgServices.add(new HmgServices(7, TranslationBase.of(context).covidTest, TranslationBase.of(context).driveThru, "assets/images/new/CoronaIcon.svg", isLogin)); hmgServices.add(new HmgServices(8, TranslationBase.of(context).connectTitle, TranslationBase.of(context).connectSubtitle, "assets/images/new/reach_us.svg", isLogin)); } @@ -270,7 +271,7 @@ class _HomePageFragment2State extends State { itemCount: hmgServices.length, padding: EdgeInsets.zero, itemBuilder: (BuildContext context, int index) { - return ServicesView(hmgServices[index], index); + return ServicesView(hmgServices[index], index, true); }, ), ), diff --git a/lib/pages/landing/widgets/services_view.dart b/lib/pages/landing/widgets/services_view.dart index 1a505e03..f1753f3c 100644 --- a/lib/pages/landing/widgets/services_view.dart +++ b/lib/pages/landing/widgets/services_view.dart @@ -22,6 +22,7 @@ import 'package:diplomaticquarterapp/pages/Covid-DriveThru/covid-drivethru-locat import 'package:diplomaticquarterapp/pages/DrawerPages/family/my-family.dart'; import 'package:diplomaticquarterapp/pages/ErService/ErOptions.dart'; import 'package:diplomaticquarterapp/pages/insurance/insurance_update_screen.dart'; +import 'package:diplomaticquarterapp/pages/landing/landing_page.dart'; import 'package:diplomaticquarterapp/pages/livecare/livecare_home.dart'; import 'package:diplomaticquarterapp/pages/medical/medical_profile_page_new.dart'; import 'package:diplomaticquarterapp/pages/medical/smart_watch_health_data/smart_watch_instructions.dart'; @@ -39,7 +40,6 @@ import 'package:flutter_svg/flutter_svg.dart'; import 'package:url_launcher/url_launcher.dart'; import '../../../locator.dart'; -import '../landing_page.dart'; import '../landing_page_pharmcy.dart'; class ServicesView extends StatelessWidget { @@ -49,133 +49,18 @@ class ServicesView extends StatelessWidget { AuthProvider authProvider = new AuthProvider(); PharmacyModuleViewModel pharmacyModuleViewModel = locator(); LocationUtils locationUtils; + bool isHomePage; - ServicesView(this.hmgServices, this.index); + ServicesView(this.hmgServices, this.index, this.isHomePage); @override Widget build(BuildContext context) { return InkWell( onTap: () { - if (index == 0) { - openLiveCare(context); - } else if (index == 1) { - showCovidDialog(context); - locator().hmgServices.logServiceName('covid-test drive-thru'); - } else if (index == 2) { - Navigator.push(context, FadePage(page: PaymentService())); - locator().hmgServices.logServiceName('online payments'); - } else if (index == 3) { - Navigator.push(context, FadePage(page: HomeHealthCarePage())); - locator().hmgServices.logServiceName('home health care'); - } else if (index == 4) { - Navigator.push(context, FadePage(page: CMCPage())); - locator().hmgServices.logServiceName('comprehensive medical checkup'); - } else if (index == 5) { - Navigator.push(context, FadePage(page: ErOptions(isAppbar: true))); - locator().hmgServices.logServiceName('emergency service'); - } else if (index == 6) { - Navigator.push(context, FadePage(page: EReferralPage())); - locator().hmgServices.logServiceName('e-referral service'); - } else if (index == 7) { - Navigator.push(context, FadePage(page: H2OPage())); - locator().hmgServices.logServiceName('water consumption'); - } else if (index == 8) { - Navigator.push(context, FadePage(page: ContactUsPage())); - locator().hmgServices.logServiceName('find us reach us'); - } else if (index == 9) { - Navigator.push( - context, - FadePage( - page: MedicalProfilePageNew(), - ), - ); - locator().hmgServices.logServiceName('my medical details'); - } else if (index == 10) { - Navigator.push( - context, - FadePage( - page: Search(), - ), - ); - locator().hmgServices.logServiceName('book appointment'); - } else if (index == 11) { - getPharmacyToken(context); - locator().hmgServices.logServiceName('al habib pharmacy'); - } else if (index == 12) { - Navigator.push( - context, - FadePage( - page: InsuranceUpdate(), - ), - ); - locator().hmgServices.logServiceName('update insurance'); - } else if (index == 13) { - Navigator.push( - context, - FadePage( - page: MyFamily(), - ), - ); - locator().hmgServices.logServiceName('my family files'); - } else if (index == 14) { - Navigator.push( - context, - FadePage(page: ChildInitialPage()), - ); - locator().hmgServices.logServiceName('my child vaccines'); - } else if (index == 15) { - // Navigator.pop(context); - LandingPage.shared.switchToDoFromHMGServices(); - locator().hmgServices.logServiceName('todo list'); - } else if (index == 16) { - Navigator.push( - context, - FadePage(page: BloodDonationPage()), - ); - locator().hmgServices.logServiceName('blood donation'); - } else if (index == 17) { - Navigator.push( - context, - FadePage( - page: (HealthCalculators()), - ), - ); - locator().hmgServices.logServiceName('health calculator'); - } else if (index == 18) { - Navigator.push( - context, - FadePage( - page: HealthConverter(), - ), - ); - locator().hmgServices.logServiceName('heath converters'); - } else if (index == 19) { - Navigator.push( - context, - FadePage(page: SmartWatchInstructions()), - ); - locator().hmgServices.logServiceName('smart watches'); - } else if (index == 20) { - locator().hmgServices.logServiceName('car parcking service'); - Navigator.push( - context, - FadePage( - page: ParkingPage(), - ), - ); - } else if (index == 21) { - launch("https://hmgwebservices.com/vt_mobile/html/index.html"); - locator().hmgServices.logServiceName('virtual tour'); - } else if (index == 22) { - Navigator.of(context).push( - MaterialPageRoute( - builder: (BuildContext context) => MyWebView( - title: "HMG News", - selectedUrl: "https://twitter.com/hashtag/مجموعة_د_سليمان_الحبيب_الطبية?src=hashtag_click&f=live", - ), - ), - ); - locator().hmgServices.logServiceName('latest news'); + if (isHomePage) { + handleHomePageServices(hmgServices, context); + } else { + handleAllServices(hmgServices, context); } }, child: Container( @@ -202,7 +87,7 @@ class ServicesView extends StatelessWidget { padding: const EdgeInsets.all(12.0), child: Opacity( opacity: 0.04, - child: hmgServices.action == 2 + child: hmgServices.action == 5 ? Image.asset( hmgServices.icon, width: double.infinity, @@ -231,7 +116,7 @@ class ServicesView extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ mFlex(1), - hmgServices.action == 2 + hmgServices.action == (isHomePage ? 5 : 8) ? Image.asset( hmgServices.icon, height: index == 0 ? MediaQuery.of(context).size.width / 18 : MediaQuery.of(context).size.width / 18, @@ -278,6 +163,236 @@ class ServicesView extends StatelessWidget { ); } + handleHomePageServices(HmgServices hmgServices, BuildContext context) { + if (hmgServices.action == 0) { + Navigator.push(context, FadePage(page: Search())); + locator().hmgServices.logServiceName('book appointment'); + } else if (hmgServices.action == 1) { + openLiveCare(context); + } else if (hmgServices.action == 2) { + Navigator.push(context, FadePage(page: ErOptions(isAppbar: true))); + locator().hmgServices.logServiceName('emergency service'); + } else if (hmgServices.action == 3) { + Navigator.push(context, FadePage(page: HomeHealthCarePage())); + locator().hmgServices.logServiceName('home health care'); + } else if (hmgServices.action == 4) { + Navigator.push(context, FadePage(page: CMCPage())); + locator().hmgServices.logServiceName('comprehensive medical checkup'); + } else if (hmgServices.action == 5) { + Navigator.push(context, FadePage(page: PaymentService())); + locator().hmgServices.logServiceName('online payments'); + } else if (hmgServices.action == 6) { + Navigator.push(context, FadePage(page: EReferralPage())); + locator().hmgServices.logServiceName('e-referral service'); + } else if (hmgServices.action == 7) { + showCovidDialog(context); + locator().hmgServices.logServiceName('covid-test drive-thru'); + } else if (hmgServices.action == 8) { + Navigator.push(context, FadePage(page: ContactUsPage())); + locator().hmgServices.logServiceName('find us reach us'); + } + } + + handleAllServices(HmgServices hmgServices, BuildContext context) { + if (hmgServices.action == 0) { + Navigator.push(context, FadePage(page: Search())); + locator().hmgServices.logServiceName('book appointment'); + } else if (hmgServices.action == 1) { + openLiveCare(context); + } else if (hmgServices.action == 2) { + Navigator.push(context, FadePage(page: ErOptions(isAppbar: true))); + locator().hmgServices.logServiceName('emergency service'); + } else if (hmgServices.action == 3) { + Navigator.push(context, FadePage(page: HomeHealthCarePage())); + locator().hmgServices.logServiceName('home health care'); + } else if (hmgServices.action == 4) { + Navigator.push(context, FadePage(page: CMCPage())); + locator().hmgServices.logServiceName('comprehensive medical checkup'); + } else if (hmgServices.action == 5) { + getPharmacyToken(context); + locator().hmgServices.logServiceName('al habib pharmacy'); + } else if (hmgServices.action == 6) { + Navigator.push(context, FadePage(page: MedicalProfilePageNew())); + } else if (hmgServices.action == 7) { + Navigator.push(context, FadePage(page: MyFamily())); + locator().hmgServices.logServiceName('my family files'); + } else if (hmgServices.action == 8) { + Navigator.push(context, FadePage(page: PaymentService())); + locator().hmgServices.logServiceName('online payments'); + } else if (hmgServices.action == 9) { + Navigator.push(context, FadePage(page: ChildInitialPage())); + locator().hmgServices.logServiceName('my child vaccines'); + } else if (hmgServices.action == 10) { + Navigator.push(context, FadePage(page: InsuranceUpdate())); + locator().hmgServices.logServiceName('update insurance'); + } else if (hmgServices.action == 11) { + Navigator.push(context, FadePage(page: EReferralPage())); + locator().hmgServices.logServiceName('e-referral service'); + } else if (hmgServices.action == 12) { + Navigator.push(context, FadePage(page: H2OPage())); + locator().hmgServices.logServiceName('water consumption'); + } else if (hmgServices.action == 13) { + Navigator.push(context, FadePage(page: (HealthCalculators()))); + locator().hmgServices.logServiceName('health calculator'); + } else if (hmgServices.action == 14) { + Navigator.push(context, FadePage(page: HealthConverter())); + locator().hmgServices.logServiceName('heath converters'); + } else if (hmgServices.action == 15) { + Navigator.pop(context); + LandingPage.shared.switchToDoFromHMGServices(); + locator().hmgServices.logServiceName('todo list'); + } else if (hmgServices.action == 16) { + Navigator.push(context, FadePage(page: BloodDonationPage())); + locator().hmgServices.logServiceName('blood donation'); + } else if (hmgServices.action == 17) { + showCovidDialog(context); + locator().hmgServices.logServiceName('covid-test drive-thru'); + } else if (hmgServices.action == 18) { + launch("https://hmgwebservices.com/vt_mobile/html/index.html"); + locator().hmgServices.logServiceName('virtual tour'); + } else if (hmgServices.action == 19) { + Navigator.push(context, FadePage(page: SmartWatchInstructions())); + locator().hmgServices.logServiceName('smart watches'); + } else if (hmgServices.action == 20) { + Navigator.push(context, FadePage(page: ParkingPage())); + locator().hmgServices.logServiceName('car parcking service'); + } else if (hmgServices.action == 21) { + Navigator.of(context).push( + MaterialPageRoute( + builder: (BuildContext context) => MyWebView( + title: "HMG News", + selectedUrl: "https://twitter.com/hashtag/مجموعة_د_سليمان_الحبيب_الطبية?src=hashtag_click&f=live", + ), + ), + ); + locator().hmgServices.logServiceName('latest news'); + } else if (hmgServices.action == 22) { + Navigator.push(context, FadePage(page: ContactUsPage())); + locator().hmgServices.logServiceName('find us reach us'); + } + + // if (hmgServices.action == 10) { + // openLiveCare(context); + // } else if (index == 1) { + // showCovidDialog(context); + // locator().hmgServices.logServiceName('covid-test drive-thru'); + // } else if (index == 2) { + // Navigator.push(context, FadePage(page: PaymentService())); + // locator().hmgServices.logServiceName('online payments'); + // } else if (index == 3) { + // Navigator.push(context, FadePage(page: HomeHealthCarePage())); + // locator().hmgServices.logServiceName('home health care'); + // } else if (index == 4) { + // Navigator.push(context, FadePage(page: CMCPage())); + // locator().hmgServices.logServiceName('comprehensive medical checkup'); + // } else if (index == 5) { + // Navigator.push(context, FadePage(page: ErOptions(isAppbar: true))); + // locator().hmgServices.logServiceName('emergency service'); + // } else if (index == 6) { + // Navigator.push(context, FadePage(page: EReferralPage())); + // locator().hmgServices.logServiceName('e-referral service'); + // } else if (index == 7) { + // Navigator.push(context, FadePage(page: H2OPage())); + // locator().hmgServices.logServiceName('water consumption'); + // } else if (index == 8) { + // Navigator.push(context, FadePage(page: ContactUsPage())); + // locator().hmgServices.logServiceName('find us reach us'); + // } else if (index == 9) { + // Navigator.push( + // context, + // FadePage( + // page: MedicalProfilePageNew(), + // ), + // ); + // locator().hmgServices.logServiceName('my medical details'); + // } else if (index == 10) { + // Navigator.push( + // context, + // FadePage( + // page: Search(), + // ), + // ); + // locator().hmgServices.logServiceName('book appointment'); + // } else if (index == 11) { + // getPharmacyToken(context); + // locator().hmgServices.logServiceName('al habib pharmacy'); + // } else if (index == 12) { + // Navigator.push( + // context, + // FadePage( + // page: InsuranceUpdate(), + // ), + // ); + // locator().hmgServices.logServiceName('update insurance'); + // } else if (index == 13) { + // Navigator.push( + // context, + // FadePage( + // page: MyFamily(), + // ), + // ); + // locator().hmgServices.logServiceName('my family files'); + // } else if (index == 14) { + // Navigator.push( + // context, + // FadePage(page: ChildInitialPage()), + // ); + // locator().hmgServices.logServiceName('my child vaccines'); + // } else if (index == 15) { + // LandingPage.shared.switchToDoFromHMGServices(); + // locator().hmgServices.logServiceName('todo list'); + // } else if (index == 16) { + // Navigator.push( + // context, + // FadePage(page: BloodDonationPage()), + // ); + // locator().hmgServices.logServiceName('blood donation'); + // } else if (index == 17) { + // Navigator.push( + // context, + // FadePage( + // page: (HealthCalculators()), + // ), + // ); + // locator().hmgServices.logServiceName('health calculator'); + // } else if (index == 18) { + // Navigator.push( + // context, + // FadePage( + // page: HealthConverter(), + // ), + // ); + // locator().hmgServices.logServiceName('heath converters'); + // } else if (index == 19) { + // Navigator.push( + // context, + // FadePage(page: SmartWatchInstructions()), + // ); + // locator().hmgServices.logServiceName('smart watches'); + // } else if (index == 20) { + // locator().hmgServices.logServiceName('car parcking service'); + // Navigator.push( + // context, + // FadePage( + // page: ParkingPage(), + // ), + // ); + // } else if (index == 21) { + // launch("https://hmgwebservices.com/vt_mobile/html/index.html"); + // locator().hmgServices.logServiceName('virtual tour'); + // } else if (index == 22) { + // Navigator.of(context).push( + // MaterialPageRoute( + // builder: (BuildContext context) => MyWebView( + // title: "HMG News", + // selectedUrl: "https://twitter.com/hashtag/مجموعة_د_سليمان_الحبيب_الطبية?src=hashtag_click&f=live", + // ), + // ), + // ); + // locator().hmgServices.logServiceName('latest news'); + // } + } + showCovidDialog(BuildContext context) { if (Platform.isAndroid) { showDialog( diff --git a/lib/pages/medical/allergies_page.dart b/lib/pages/medical/allergies_page.dart index e83cf1d5..b3f54a60 100644 --- a/lib/pages/medical/allergies_page.dart +++ b/lib/pages/medical/allergies_page.dart @@ -47,7 +47,7 @@ class AllergiesPage extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ Texts(TranslationBase.of(context).remarks+" :"), - Texts(TranslationBase.of(context).description + model.allergies[index].description ?? ''), + Texts(TranslationBase.of(context).description + ": " + model.allergies[index].description ?? ''), ], ), ) diff --git a/lib/pages/medical/vital_sign/vital_sing_chart_blood_pressure.dart b/lib/pages/medical/vital_sign/vital_sing_chart_blood_pressure.dart index 424b0c90..2d04e91a 100644 --- a/lib/pages/medical/vital_sign/vital_sing_chart_blood_pressure.dart +++ b/lib/pages/medical/vital_sign/vital_sing_chart_blood_pressure.dart @@ -35,7 +35,7 @@ class VitalSingChartBloodPressure extends StatelessWidget { @override Widget build(BuildContext context) { - projectViewModel = Provider.of(context); + projectViewModel = Provider.of(context); generateData(); return SingleChildScrollView( child: Column(