Target SDK & Compile SDK bumped to 33

merge-update-with-lab-changes
haroon amjad 3 years ago
parent 2e72d6a550
commit 0e01835327

@ -21,6 +21,12 @@ if (flutterVersionName == null) {
flutterVersionName = '1.0' 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.android.application'
apply plugin: 'com.huawei.agconnect' apply plugin: 'com.huawei.agconnect'
apply plugin: 'kotlin-android' 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). // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.ejada.hmg" applicationId "com.ejada.hmg"
minSdkVersion 21 minSdkVersion 21
targetSdkVersion 30 targetSdkVersion 33
versionCode flutterVersionCode.toInteger() versionCode flutterVersionCode.toInteger()
versionName flutterVersionName versionName flutterVersionName
multiDexEnabled true multiDexEnabled true
} }
signingConfigs { signingConfigs {
config{ release {
storeFile file('key') keyAlias keystoreProperties['keyAlias']
keyAlias 'hmg' keyPassword keystoreProperties['keyPassword']
storePassword 'HmGsa123' storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null
keyPassword 'HmGsa123' storePassword keystoreProperties['storePassword']
} }
} }
buildTypes { buildTypes {
debug { debug {
debuggable true debuggable true
signingConfig signingConfigs.config signingConfig signingConfigs.release
} }
release { release {
debuggable false debuggable false
signingConfig signingConfigs.config signingConfig signingConfigs.release
minifyEnabled true minifyEnabled true
shrinkResources true shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 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.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-location:17.1.0'//for Android
implementation 'com.google.android.gms:play-services-basement:17.5.0' 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:1.5.1'
implementation 'com.facebook.stetho:stetho-urlconnection:1.5.1' implementation 'com.facebook.stetho:stetho-urlconnection:1.5.1'
implementation 'androidx.core:core-ktx:1.6.0' implementation 'androidx.core:core-ktx:1.6.0'
implementation 'androidx.appcompat:appcompat:1.3.1' implementation 'androidx.appcompat:appcompat:1.3.1'
androidTestImplementation "androidx.test:core:1.4.0"
} }

@ -4,4 +4,4 @@
to allow setting breakpoints, to provide hot reload, etc. to allow setting breakpoints, to provide hot reload, etc.
--> -->
<uses-permission android:name="android.permission.INTERNET"/> <uses-permission android:name="android.permission.INTERNET"/>
</manifest> </manifest>

@ -34,9 +34,9 @@
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/> <uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE"/> <uses-permission android:name="android.permission.CHANGE_WIFI_STATE"/>
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/> <!-- <uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>-->
<!-- Detect Reboot Permission --> <!-- Detect Reboot Permission -->
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/> <!-- <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>-->
<queries> <queries>
<intent> <intent>
<action android:name="android.speech.RecognitionService" /> <action android:name="android.speech.RecognitionService" />
@ -49,7 +49,6 @@
android:showOnLockScreen="true" android:showOnLockScreen="true"
android:screenOrientation="sensorPortrait" android:screenOrientation="sensorPortrait"
android:allowBackup="false" android:allowBackup="false"
tools:replace="android:allowBackup,android:label"
android:label="Dr. Alhabib"> android:label="Dr. Alhabib">
<meta-data android:name="push_kit_auto_init_enabled" android:value="true" /> <meta-data android:name="push_kit_auto_init_enabled" android:value="true" />
@ -89,23 +88,23 @@
</intent-filter> </intent-filter>
</activity> </activity>
<receiver android:exported="true" tools:replace="android:exported" android:name="com.dexterous.flutterlocalnotifications.ScheduledNotificationBootReceiver"> <!-- <receiver android:name="com.dexterous.flutterlocalnotifications.ScheduledNotificationBootReceiver" android:exported="true">-->
<intent-filter> <!-- <intent-filter>-->
<action android:name="android.intent.action.BOOT_COMPLETED"/> <!-- <action android:name="android.intent.action.BOOT_COMPLETED"/>-->
<action android:name="android.intent.action.MY_PACKAGE_REPLACED"/> <!-- <action android:name="android.intent.action.MY_PACKAGE_REPLACED"/>-->
</intent-filter> <!-- </intent-filter>-->
</receiver> <!-- </receiver>-->
<!-- Geofencing --> <!-- Geofencing -->
<service android:name=".geofence.intent_receivers.GeofenceTransitionsJobIntentService" android:exported="true" android:permission="android.permission.BIND_JOB_SERVICE" /> <service android:name=".geofence.intent_receivers.GeofenceTransitionsJobIntentService" android:exported="true" android:permission="android.permission.BIND_JOB_SERVICE" />
<receiver android:name=".geofence.intent_receivers.GeofenceBroadcastReceiver" android:enabled="true" /> <receiver android:name=".geofence.intent_receivers.GeofenceBroadcastReceiver" android:enabled="true" android:exported="false" />
<receiver android:exported="true" android:name=".geofence.intent_receivers.GeofencingRebootBroadcastReceiver" android:enabled="true"> <receiver android:name=".geofence.intent_receivers.GeofencingRebootBroadcastReceiver" android:enabled="true" android:exported="false">
<intent-filter> <intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED"/> <action android:name="android.intent.action.BOOT_COMPLETED"/>
<action android:name="android.intent.action.MY_PACKAGE_REPLACED"/> <action android:name="android.intent.action.MY_PACKAGE_REPLACED"/>
</intent-filter> </intent-filter>
</receiver> </receiver>
<receiver android:exported="true" android:name=".geofence.intent_receivers.LocationProviderChangeReceiver"> <receiver android:name=".geofence.intent_receivers.LocationProviderChangeReceiver" android:exported="false">
<intent-filter> <intent-filter>
<action android:name="android.location.PROVIDERS_CHANGED"/> <action android:name="android.location.PROVIDERS_CHANGED"/>
</intent-filter> </intent-filter>
@ -117,20 +116,19 @@
Huawei Push Notifications Huawei Push Notifications
Set push kit auto enable to true (for obtaining the token on initialize) Set push kit auto enable to true (for obtaining the token on initialize)
--> -->
<meta-data <!-- <meta-data-->
android:name="push_kit_auto_init_enabled" <!-- android:name="push_kit_auto_init_enabled"-->
android:value="true" /> <!-- android:value="true" />-->
<!-- These receivers are for sending scheduled local notifications --> <!-- These receivers are for sending scheduled local notifications -->
<receiver android:exported="true" android:name="com.huawei.hms.flutter.push.receiver.local.HmsLocalNotificationBootEventReceiver"> <receiver android:name="com.huawei.hms.flutter.push.receiver.local.HmsLocalNotificationBootEventReceiver" android:exported="false">
<intent-filter> <intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" /> <action android:name="android.intent.action.BOOT_COMPLETED" />
</intent-filter> </intent-filter>
</receiver> </receiver>
<receiver <receiver
android:name="com.huawei.hms.flutter.push.receiver.local.HmsLocalNotificationScheduledPublisher" android:name="com.huawei.hms.flutter.push.receiver.local.HmsLocalNotificationScheduledPublisher"
android:exported="true" android:enabled="true"
android:enabled="true" /> android:exported="false" />
<receiver <receiver
android:name="com.huawei.hms.flutter.push.receiver.BackgroundMessageBroadcastReceiver" android:name="com.huawei.hms.flutter.push.receiver.BackgroundMessageBroadcastReceiver"
android:enabled="true" android:enabled="true"
@ -153,10 +151,10 @@
</application> </application>
<uses-permission android:name="android.permission.INTERNET" /> <!-- <uses-permission android:name="android.permission.INTERNET" />-->
<uses-permission android:name="android.permission.USE_FINGERPRINT" /> <!-- <uses-permission android:name="android.permission.USE_FINGERPRINT" />-->
<uses-permission android:name="android.permission.READ_CALENDAR" /> <!-- <uses-permission android:name="android.permission.READ_CALENDAR" />-->
<uses-permission android:name="android.permission.WRITE_CALENDAR" /> <!-- <uses-permission android:name="android.permission.WRITE_CALENDAR" />-->

@ -1,7 +1,6 @@
package com.ejada.hmg.geofence.intent_receivers package com.ejada.hmg.geofence.intent_receivers
import android.annotation.SuppressLint
import android.content.BroadcastReceiver import android.content.BroadcastReceiver
import android.content.Context import android.content.Context
import android.content.Intent import android.content.Intent
@ -13,37 +12,60 @@ import com.google.android.gms.location.GeofenceStatusCodes
import com.google.android.gms.location.GeofencingEvent import com.google.android.gms.location.GeofencingEvent
class GeofenceBroadcastReceiver : BroadcastReceiver() { class GeofenceBroadcastReceiver : BroadcastReceiver() {
private val LOG_TAG = "GeofenceBroadcastReceiver" private val LOG_TAG = "GeofenceBroadcastReceiver"
override fun onReceive(context: Context, intent: Intent) {
@SuppressLint("LongLogTag")
val geofencingEvent = GeofencingEvent.fromIntent(intent) override fun onReceive(context: Context, intent: Intent) {
if (geofencingEvent.hasError()) {
val errorMessage = GeofenceErrorMessages.getErrorString(context, geofencingEvent.errorCode) val geofencingEvent = GeofencingEvent.fromIntent(intent)
Log.e(LOG_TAG, errorMessage) if (geofencingEvent != null) {
if (geofencingEvent.hasError()) {
Logs.GeofenceEvent.save(context,LOG_TAG,"Error while triggering geofence event",Logs.STATUS.ERROR) val errorMessage =
doReRegisterIfRequired(context,geofencingEvent.errorCode) GeofenceErrorMessages.getErrorString(context, geofencingEvent.errorCode)
Log.e(LOG_TAG, errorMessage)
return
}
Logs.GeofenceEvent.save(context,LOG_TAG,"Geofence event triggered: ${GeofenceTransition.fromInt(geofencingEvent.geofenceTransition).value} for ${geofencingEvent.triggeringGeofences.map {it.requestId}}",Logs.STATUS.SUCCESS) Logs.GeofenceEvent.save(
HMG_Geofence.shared(context).handleEvent(geofencingEvent.triggeringGeofences,geofencingEvent.triggeringLocation, GeofenceTransition.fromInt(geofencingEvent.geofenceTransition)); context,
LOG_TAG,
} "Error while triggering geofence event",
Logs.STATUS.ERROR
)
doReRegisterIfRequired(context, geofencingEvent.errorCode)
fun doReRegisterIfRequired(context: Context, errorCode: Int){ return
val errorRequiredReregister = listOf( }
}
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_NOT_AVAILABLE,
GeofenceStatusCodes.GEOFENCE_TOO_MANY_GEOFENCES, GeofenceStatusCodes.GEOFENCE_TOO_MANY_GEOFENCES,
GeofenceStatusCodes.GEOFENCE_TOO_MANY_PENDING_INTENTS, GeofenceStatusCodes.GEOFENCE_TOO_MANY_PENDING_INTENTS,
GeofenceStatusCodes.GEOFENCE_REQUEST_TOO_FREQUENT GeofenceStatusCodes.GEOFENCE_REQUEST_TOO_FREQUENT
) )
if(errorRequiredReregister.contains(errorCode)) if (errorRequiredReregister.contains(errorCode))
HMG_Geofence.shared(context).register(){ status, error -> HMG_Geofence.shared(context).register() { status, error ->
} }
} }
} }

@ -59,18 +59,25 @@ class GeofenceTransitionsJobIntentService : JobIntentService() {
override fun onHandleWork(intent: Intent) { override fun onHandleWork(intent: Intent) {
val geofencingEvent = GeofencingEvent.fromIntent(intent) val geofencingEvent = GeofencingEvent.fromIntent(intent)
if (geofencingEvent.hasError()) { if (geofencingEvent != null) {
val errorMessage = GeofenceErrorMessages.getErrorString(context_!!, geofencingEvent.errorCode) if (geofencingEvent.hasError()) {
Log.e(LOG_TAG, errorMessage) val errorMessage = GeofenceErrorMessages.getErrorString(context_!!, geofencingEvent.errorCode)
Log.e(LOG_TAG, errorMessage)
saveLog(context_!!,LOG_TAG,errorMessage) saveLog(context_!!,LOG_TAG,errorMessage)
doReRegisterIfRequired(context_!!, geofencingEvent.errorCode) 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))
} }
};
} }

@ -11,7 +11,7 @@ buildscript {
} }
dependencies { 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 "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.google.gms:google-services:4.3.8' classpath 'com.google.gms:google-services:4.3.8'
// classpath 'com.google.firebase:firebase-crashlytics-gradle:2.8.1' // classpath 'com.google.firebase:firebase-crashlytics-gradle:2.8.1'

@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists 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

@ -19,10 +19,10 @@
76815B27275F381C00E66E94 /* HealthKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 76815B26275F381C00E66E94 /* HealthKit.framework */; }; 76815B27275F381C00E66E94 /* HealthKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 76815B26275F381C00E66E94 /* HealthKit.framework */; };
76962ECE28AE5C10004EAE09 /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 76962ECD28AE5C10004EAE09 /* GoogleService-Info.plist */; }; 76962ECE28AE5C10004EAE09 /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 76962ECD28AE5C10004EAE09 /* GoogleService-Info.plist */; };
76F2556127F1FFED0062C1CD /* PassKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 76F2556027F1FFED0062C1CD /* PassKit.framework */; }; 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 */; }; 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; };
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; };
97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; 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 */; }; E91B5396256AAA6500E96549 /* GlobalHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = E91B538D256AAA6500E96549 /* GlobalHelper.swift */; };
E91B5397256AAA6500E96549 /* Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = E91B538E256AAA6500E96549 /* Extensions.swift */; }; E91B5397256AAA6500E96549 /* Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = E91B538E256AAA6500E96549 /* Extensions.swift */; };
E91B5398256AAA6500E96549 /* API.swift in Sources */ = {isa = PBXBuildFile; fileRef = E91B538F256AAA6500E96549 /* API.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 = "<group>"; }; 306FE6C7271D790C002D6EFC /* OpenTokPlatformBridge.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OpenTokPlatformBridge.swift; sourceTree = "<group>"; };
306FE6CA271D8B73002D6EFC /* OpenTok.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OpenTok.swift; sourceTree = "<group>"; }; 306FE6CA271D8B73002D6EFC /* OpenTok.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OpenTok.swift; sourceTree = "<group>"; };
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = "<group>"; }; 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = "<group>"; };
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 = "<group>"; };
74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = "<group>"; }; 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = "<group>"; };
74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; }; 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
762D738C274E42650063CE73 /* ring_30Sec.caf */ = {isa = PBXFileReference; lastKnownFileType = file; name = ring_30Sec.caf; path = ../../assets/sounds/ring_30Sec.caf; sourceTree = "<group>"; }; 762D738C274E42650063CE73 /* ring_30Sec.caf */ = {isa = PBXFileReference; lastKnownFileType = file; name = ring_30Sec.caf; path = ../../assets/sounds/ring_30Sec.caf; sourceTree = "<group>"; };
@ -71,7 +70,9 @@
76815B26275F381C00E66E94 /* HealthKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = HealthKit.framework; path = System/Library/Frameworks/HealthKit.framework; sourceTree = SDKROOT; }; 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 = "<group>"; }; 76962ECD28AE5C10004EAE09 /* GoogleService-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "GoogleService-Info.plist"; sourceTree = "<group>"; };
76F2556027F1FFED0062C1CD /* PassKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = PassKit.framework; path = System/Library/Frameworks/PassKit.framework; sourceTree = SDKROOT; }; 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 = "<group>"; };
7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = "<group>"; }; 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = "<group>"; };
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 = "<group>"; }; 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = "<group>"; };
9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = "<group>"; }; 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = "<group>"; };
97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; 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 = "<group>"; }; 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; }; 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; }; 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
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 = "<group>"; }; 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 = "<group>"; };
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 = "<group>"; };
E91B538D256AAA6500E96549 /* GlobalHelper.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GlobalHelper.swift; sourceTree = "<group>"; }; E91B538D256AAA6500E96549 /* GlobalHelper.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GlobalHelper.swift; sourceTree = "<group>"; };
E91B538E256AAA6500E96549 /* Extensions.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Extensions.swift; sourceTree = "<group>"; }; E91B538E256AAA6500E96549 /* Extensions.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Extensions.swift; sourceTree = "<group>"; };
E91B538F256AAA6500E96549 /* API.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = API.swift; sourceTree = "<group>"; }; E91B538F256AAA6500E96549 /* API.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = API.swift; sourceTree = "<group>"; };
@ -100,6 +99,7 @@
E9C8C135256BACDA00EFFB62 /* HMG_Guest.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HMG_Guest.swift; sourceTree = "<group>"; }; E9C8C135256BACDA00EFFB62 /* HMG_Guest.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HMG_Guest.swift; sourceTree = "<group>"; };
E9E27167256E3A4000F49B69 /* LocalizedFromFlutter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LocalizedFromFlutter.swift; sourceTree = "<group>"; }; E9E27167256E3A4000F49B69 /* LocalizedFromFlutter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LocalizedFromFlutter.swift; sourceTree = "<group>"; };
E9F7623A25922BCE00FB5CCF /* FlutterConstants.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FlutterConstants.swift; sourceTree = "<group>"; }; E9F7623A25922BCE00FB5CCF /* FlutterConstants.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FlutterConstants.swift; sourceTree = "<group>"; };
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 = "<group>"; };
/* End PBXFileReference section */ /* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */ /* Begin PBXFrameworksBuildPhase section */
@ -110,7 +110,7 @@
76F2556127F1FFED0062C1CD /* PassKit.framework in Frameworks */, 76F2556127F1FFED0062C1CD /* PassKit.framework in Frameworks */,
76815B27275F381C00E66E94 /* HealthKit.framework in Frameworks */, 76815B27275F381C00E66E94 /* HealthKit.framework in Frameworks */,
E9620805255C2ED100D3A35D /* NetworkExtension.framework in Frameworks */, E9620805255C2ED100D3A35D /* NetworkExtension.framework in Frameworks */,
888788C5457DD4B4291ED407 /* Pods_Runner.framework in Frameworks */, B40C32A62DF065A3A0414845 /* Pods_Runner.framework in Frameworks */,
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
}; };
@ -133,7 +133,7 @@
76F2556027F1FFED0062C1CD /* PassKit.framework */, 76F2556027F1FFED0062C1CD /* PassKit.framework */,
76815B26275F381C00E66E94 /* HealthKit.framework */, 76815B26275F381C00E66E94 /* HealthKit.framework */,
E9620804255C2ED100D3A35D /* NetworkExtension.framework */, E9620804255C2ED100D3A35D /* NetworkExtension.framework */,
DBECDFA177FC32F0D92001A8 /* Pods_Runner.framework */, 8B99ADD0B93AC14DD8D0BAB0 /* Pods_Runner.framework */,
); );
name = Frameworks; name = Frameworks;
sourceTree = "<group>"; sourceTree = "<group>";
@ -141,9 +141,9 @@
605039E5DDF72C245F9765FE /* Pods */ = { 605039E5DDF72C245F9765FE /* Pods */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
C43E6143D6D42F3BF36E6E30 /* Pods-Runner.debug.xcconfig */, EBA301C32F4CA9F09D2D7713 /* Pods-Runner.debug.xcconfig */,
7339683046E679D7577A50D3 /* Pods-Runner.release.xcconfig */, 7805E271E86E72F39E68ADCC /* Pods-Runner.release.xcconfig */,
E88A1DAFD417EE86EE2F7F02 /* Pods-Runner.profile.xcconfig */, BC1BA79F1F6E9D7BE59D2AE4 /* Pods-Runner.profile.xcconfig */,
); );
path = Pods; path = Pods;
sourceTree = "<group>"; sourceTree = "<group>";
@ -246,15 +246,15 @@
isa = PBXNativeTarget; isa = PBXNativeTarget;
buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */;
buildPhases = ( buildPhases = (
6CEC06A85A1BC01F415967B9 /* [CP] Check Pods Manifest.lock */, A37FFD337A0067237A8DACD6 /* [CP] Check Pods Manifest.lock */,
9740EEB61CF901F6004384FC /* Run Script */, 9740EEB61CF901F6004384FC /* Run Script */,
97C146EA1CF9000F007C117D /* Sources */, 97C146EA1CF9000F007C117D /* Sources */,
97C146EB1CF9000F007C117D /* Frameworks */, 97C146EB1CF9000F007C117D /* Frameworks */,
97C146EC1CF9000F007C117D /* Resources */, 97C146EC1CF9000F007C117D /* Resources */,
9705A1C41CF9048500538489 /* Embed Frameworks */, 9705A1C41CF9048500538489 /* Embed Frameworks */,
3B06AD1E1E4923F5004D2608 /* Thin Binary */, 3B06AD1E1E4923F5004D2608 /* Thin Binary */,
EB708D648E256F1D924823C6 /* [CP] Embed Pods Frameworks */, E1D6AED972DEFC56AA7DB402 /* [CP] Embed Pods Frameworks */,
1FDB0C9B620EC9533D2358F3 /* [CP] Copy Pods Resources */, 541D1D49FBD13BE6BA6DA5BC /* [CP] Copy Pods Resources */,
); );
buildRules = ( buildRules = (
); );
@ -320,7 +320,21 @@
/* End PBXResourcesBuildPhase section */ /* End PBXResourcesBuildPhase section */
/* Begin PBXShellScriptBuildPhase 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; isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
@ -337,21 +351,21 @@
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources.sh\"\n"; shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources.sh\"\n";
showEnvVarsInLog = 0; showEnvVarsInLog = 0;
}; };
3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { 9740EEB61CF901F6004384FC /* Run Script */ = {
isa = PBXShellScriptBuildPhase; isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
); );
inputPaths = ( inputPaths = (
); );
name = "Thin Binary"; name = "Run Script";
outputPaths = ( outputPaths = (
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh; 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; isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( 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"; 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; showEnvVarsInLog = 0;
}; };
9740EEB61CF901F6004384FC /* Run Script */ = { E1D6AED972DEFC56AA7DB402 /* [CP] Embed Pods Frameworks */ = {
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 */ = {
isa = PBXShellScriptBuildPhase; isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
@ -538,7 +538,7 @@
"$(inherited)", "$(inherited)",
"$(PROJECT_DIR)/Flutter", "$(PROJECT_DIR)/Flutter",
); );
MARKETING_VERSION = 4.5.56; MARKETING_VERSION = 4.5.57;
PRODUCT_BUNDLE_IDENTIFIER = "com.HMG.HMG-Smartphone"; PRODUCT_BUNDLE_IDENTIFIER = "com.HMG.HMG-Smartphone";
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = ""; PROVISIONING_PROFILE_SPECIFIER = "";
@ -682,7 +682,7 @@
"$(inherited)", "$(inherited)",
"$(PROJECT_DIR)/Flutter", "$(PROJECT_DIR)/Flutter",
); );
MARKETING_VERSION = 4.5.56; MARKETING_VERSION = 4.5.57;
PRODUCT_BUNDLE_IDENTIFIER = "com.HMG.HMG-Smartphone"; PRODUCT_BUNDLE_IDENTIFIER = "com.HMG.HMG-Smartphone";
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = ""; PROVISIONING_PROFILE_SPECIFIER = "";
@ -720,7 +720,7 @@
"$(inherited)", "$(inherited)",
"$(PROJECT_DIR)/Flutter", "$(PROJECT_DIR)/Flutter",
); );
MARKETING_VERSION = 4.5.56; MARKETING_VERSION = 4.5.57;
PRODUCT_BUNDLE_IDENTIFIER = "com.HMG.HMG-Smartphone"; PRODUCT_BUNDLE_IDENTIFIER = "com.HMG.HMG-Smartphone";
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = ""; PROVISIONING_PROFILE_SPECIFIER = "";

@ -411,7 +411,7 @@ var UPDATE_COVID_QUESTIONNAIRE = 'Services/Doctors.svc/REST/COVID19_Questionnar
var CHANNEL = 3; var CHANNEL = 3;
var GENERAL_ID = 'Cs2020@2016\$2958'; var GENERAL_ID = 'Cs2020@2016\$2958';
var IP_ADDRESS = '10.20.10.20'; var IP_ADDRESS = '10.20.10.20';
var VERSION_ID = 9.8; var VERSION_ID = 9.9;
var SETUP_ID = '91877'; var SETUP_ID = '91877';
var LANGUAGE = 2; var LANGUAGE = 2;
// var PATIENT_OUT_SA = 0; // var PATIENT_OUT_SA = 0;
@ -773,7 +773,6 @@ class AppGlobal {
request.generalid = GENERAL_ID; //'Cs2020@2016\$2958'; request.generalid = GENERAL_ID; //'Cs2020@2016\$2958';
request.PatientOutSA = 0; request.PatientOutSA = 0;
request.SessionID = "wEVNbagIkaNhGECWZjHaA"; request.SessionID = "wEVNbagIkaNhGECWZjHaA";
request.TokenID = "@dm!n";
request.isDentalAllowedBackend = false; request.isDentalAllowedBackend = false;
request.DeviceTypeID = Platform.isIOS ? 1 : 2; request.DeviceTypeID = Platform.isIOS ? 1 : 2;
request.DeviceType = Platform.isIOS ? "iOS" : "Android"; request.DeviceType = Platform.isIOS ? "iOS" : "Android";

@ -178,7 +178,7 @@ class AppoimentAllHistoryResultList {
doctorImageURL = json['DoctorImageURL']; doctorImageURL = json['DoctorImageURL'];
doctorNameObj = json['DoctorNameObj']; doctorNameObj = json['DoctorNameObj'];
doctorRate = json['DoctorRate']; doctorRate = json['DoctorRate'];
doctorSpeciality = json['DoctorSpeciality'].cast<String>(); if (doctorSpeciality != null) doctorSpeciality = json['DoctorSpeciality'].cast<String>();
doctorTitle = json['DoctorTitle']; doctorTitle = json['DoctorTitle'];
gender = json['Gender']; gender = json['Gender'];
genderDescription = json['GenderDescription']; genderDescription = json['GenderDescription'];

@ -149,7 +149,7 @@ class BaseAppClient {
// body['IdentificationNo'] = 1023854217; // body['IdentificationNo'] = 1023854217;
// body['MobileNo'] = "531940021"; // body['MobileNo'] = "531940021";
// body['PatientID'] = 3649158; //3844083 // body['PatientID'] = 2001273; //3844083
// body['TokenID'] = "@dm!n"; // body['TokenID'] = "@dm!n";
// Patient ID: 3027574 // Patient ID: 3027574

@ -5,7 +5,7 @@ import 'package:diplomaticquarterapp/core/service/AlHabibMedicalService/customer
import 'package:diplomaticquarterapp/services/pharmacy_services/pharmacyAddress_service.dart'; import 'package:diplomaticquarterapp/services/pharmacy_services/pharmacyAddress_service.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:geocoding/geocoding.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 '../../../locator.dart';
import '../base_view_model.dart'; import '../base_view_model.dart';

@ -25,7 +25,7 @@ import 'package:flutter/material.dart';
import 'package:geocoding/geocoding.dart'; import 'package:geocoding/geocoding.dart';
import 'package:geolocator/geolocator.dart'; import 'package:geolocator/geolocator.dart';
import 'package:google_maps_flutter/google_maps_flutter.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:huawei_hmsavailability/huawei_hmsavailability.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';

@ -20,7 +20,7 @@ import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:geolocator/geolocator.dart'; import 'package:geolocator/geolocator.dart';
import 'package:google_maps_flutter/google_maps_flutter.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 'package:permission_handler/permission_handler.dart';
import 'cmc_location_page.dart'; import 'cmc_location_page.dart';

@ -23,7 +23,7 @@ import 'package:flutter/material.dart';
import 'package:geocoding/geocoding.dart'; import 'package:geocoding/geocoding.dart';
import 'package:geolocator/geolocator.dart'; import 'package:geolocator/geolocator.dart';
import 'package:google_maps_flutter/google_maps_flutter.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:huawei_hmsavailability/huawei_hmsavailability.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';

@ -12,7 +12,7 @@ import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.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'; import 'package:provider/provider.dart';
class NewHomeHealthCareStepOnePage extends StatefulWidget { class NewHomeHealthCareStepOnePage extends StatefulWidget {

@ -9,6 +9,7 @@ import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/HomeHealthCare/
import 'package:diplomaticquarterapp/services/permission/permission_service.dart'; import 'package:diplomaticquarterapp/services/permission/permission_service.dart';
import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.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/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart'; import 'package:diplomaticquarterapp/uitl/utils_new.dart';
@ -21,7 +22,7 @@ import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:geolocator/geolocator.dart'; import 'package:geolocator/geolocator.dart';
import 'package:google_maps_flutter/google_maps_flutter.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'; import 'location_page.dart';
@ -53,6 +54,7 @@ class _NewHomeHealthCareStepTowPageState extends State<NewHomeHealthCareStepTowP
); );
LatLng currentPostion; LatLng currentPostion;
Completer<GoogleMapController> mapController = Completer(); Completer<GoogleMapController> mapController = Completer();
LocationUtils locationUtils;
@override @override
void initState() { void initState() {
@ -62,7 +64,6 @@ class _NewHomeHealthCareStepTowPageState extends State<NewHomeHealthCareStepTowP
_updatePosition(camera); _updatePosition(camera);
}, },
onMapCreated: () { onMapCreated: () {
// goToCurrentLocation();
_getUserLocation(); _getUserLocation();
setState(() {}); setState(() {});
}, },
@ -82,31 +83,36 @@ class _NewHomeHealthCareStepTowPageState extends State<NewHomeHealthCareStepTowP
currentPostion = LatLng(lat, long); currentPostion = LatLng(lat, long);
setMap(); setMap();
} else { } else {
if (await PermissionService.isLocationEnabled()) { locationUtils = new LocationUtils(isShowConfirmDialog: true, context: context);
Geolocator.getLastKnownPosition().then((value) { locationUtils.getCurrentLocation(callBack: (value) {
latitude = value.latitude; print(value);
longitude = value.longitude; setMap();
currentPostion = LatLng(latitude, longitude); });
setMap(); // if (await PermissionService.isLocationEnabled()) {
}); // Geolocator.getLastKnownPosition().then((value) {
} else { // latitude = value.latitude;
if (Platform.isAndroid) { // longitude = value.longitude;
Utils.showPermissionConsentDialog(context, TranslationBase.of(context).locationPermissionDialog, () { // currentPostion = LatLng(latitude, longitude);
Geolocator.getLastKnownPosition().then((value) { // setMap();
latitude = value.latitude; // });
longitude = value.longitude; // } else {
currentPostion = LatLng(latitude, longitude); // if (Platform.isAndroid) {
setMap(); // Utils.showPermissionConsentDialog(context, TranslationBase.of(context).locationPermissionDialog, () {
}); // Geolocator.getLastKnownPosition().then((value) {
}); // latitude = value.latitude;
} else { // longitude = value.longitude;
Geolocator.getLastKnownPosition().then((value) { // currentPostion = LatLng(latitude, longitude);
latitude = value.latitude; // setMap();
longitude = value.longitude; // });
setMap(); // });
}); // } else {
} // Geolocator.getLastKnownPosition().then((value) {
} // latitude = value.latitude;
// longitude = value.longitude;
// setMap();
// });
// }
// }
} }
} }

@ -148,7 +148,7 @@ class _AnicllaryOrdersState extends State<AnicllaryOrders> with SingleTickerProv
return DoctorCard( return DoctorCard(
onTap: () => ancillaryOrdersDetails(model.ancillaryLists[0].ancillaryOrderList[index], model.ancillaryLists[0].projectID), onTap: () => ancillaryOrdersDetails(model.ancillaryLists[0].ancillaryOrderList[index], model.ancillaryLists[0].projectID),
isInOutPatient: true, 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(), billNo: model.ancillaryLists[0].ancillaryOrderList[index].orderNo.toString(),
profileUrl: "https://hmgwebservices.com/Images/MobileImages/DUBAI/unkown.png", profileUrl: "https://hmgwebservices.com/Images/MobileImages/DUBAI/unkown.png",
subName: model.ancillaryLists[0].projectName, subName: model.ancillaryLists[0].projectName,

@ -300,9 +300,10 @@ class _DocAvailableAppointmentsState extends State<DocAvailableAppointments> wit
} }
getDoctorFreeSlots(context, DoctorList docObject) { getDoctorFreeSlots(context, DoctorList docObject) {
print(DocAvailableAppointments.initialSlotDuration);
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService(); 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); GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
if (res['FreeTimeSlots'].length != 0) { if (res['FreeTimeSlots'].length != 0) {

@ -102,19 +102,23 @@ class _PickupLocationState extends State<PickupLocation> {
), ),
child: InkWell( child: InkWell(
onTap: () { onTap: () {
Navigator.push( if (projectViewModel.latitude != null && projectViewModel.longitude != null) {
context, Navigator.push(
FadePage( context,
page: PickupLocationFromMap( FadePage(
latitude: projectViewModel.latitude ?? 0, page: PickupLocationFromMap(
longitude: projectViewModel.longitude ?? 0, latitude: projectViewModel.latitude ?? 0,
onPick: (value) { longitude: projectViewModel.longitude ?? 0,
setState(() { onPick: (value) {
_result = value; setState(() {
}); _result = value;
}, });
)), },
); )),
);
} else {
locationUtils.getCurrentLocation();
}
}, },
child: Row( child: Row(
children: [ children: [
@ -438,20 +442,24 @@ class _PickupLocationState extends State<PickupLocation> {
), ),
child: InkWell( child: InkWell(
onTap: () { onTap: () {
Navigator.push( if (projectViewModel.latitude != null && projectViewModel.longitude != null) {
context, Navigator.push(
FadePage( context,
page: PickupLocationFromMap( FadePage(
latitude: projectViewModel.latitude, page: PickupLocationFromMap(
longitude: projectViewModel.longitude, latitude: projectViewModel.latitude,
onPick: (value) { longitude: projectViewModel.longitude,
setState(() { onPick: (value) {
_result = value; setState(() {
}); _result = value;
}, });
},
),
), ),
), );
); } else {
locationUtils.getCurrentLocation();
}
}, },
child: Row( child: Row(
children: [ children: [

@ -309,6 +309,11 @@ class RRTRequestPickupAddressPageState extends State<RRTRequestPickupAddressPage
} }
void _getUserLocation() async { void _getUserLocation() async {
LocationSettings locationSettings = LocationSettings(
accuracy: LocationAccuracy.low
);
if (await this.sharedPref.getDouble(USER_LAT) != null && await this.sharedPref.getDouble(USER_LONG) != null) { if (await this.sharedPref.getDouble(USER_LAT) != null && await this.sharedPref.getDouble(USER_LONG) != null) {
var lat = await this.sharedPref.getDouble(USER_LAT); var lat = await this.sharedPref.getDouble(USER_LAT);
var long = await this.sharedPref.getDouble(USER_LONG); var long = await this.sharedPref.getDouble(USER_LONG);
@ -318,7 +323,7 @@ class RRTRequestPickupAddressPageState extends State<RRTRequestPickupAddressPage
setMap(); setMap();
} else { } else {
if (await Permission.location.request().isGranted) { if (await Permission.location.request().isGranted) {
var position = await GeolocatorPlatform.instance.getCurrentPosition(desiredAccuracy: LocationAccuracy.low); var position = await GeolocatorPlatform.instance.getCurrentPosition(locationSettings: locationSettings);
currentPostion = LatLng(position.latitude, position.longitude); currentPostion = LatLng(position.latitude, position.longitude);
latitude = position.latitude; latitude = position.latitude;
longitude = position.longitude; longitude = position.longitude;
@ -327,7 +332,7 @@ class RRTRequestPickupAddressPageState extends State<RRTRequestPickupAddressPage
requestPermissions().then( requestPermissions().then(
(value) async { (value) async {
if (value[Permission.location].isGranted) { if (value[Permission.location].isGranted) {
var position = await GeolocatorPlatform.instance.getCurrentPosition(desiredAccuracy: LocationAccuracy.low); var position = await GeolocatorPlatform.instance.getCurrentPosition(locationSettings: locationSettings);
currentPostion = LatLng(position.latitude, position.longitude); currentPostion = LatLng(position.latitude, position.longitude);
latitude = position.latitude; latitude = position.latitude;
longitude = position.longitude; longitude = position.longitude;

@ -360,7 +360,7 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
return DoctorCard( return DoctorCard(
onTap: () => ancillaryOrdersDetails(widget.ancillaryLists[0].ancillaryOrderList[index], widget.ancillaryLists[0].projectID), onTap: () => ancillaryOrdersDetails(widget.ancillaryLists[0].ancillaryOrderList[index], widget.ancillaryLists[0].projectID),
isInOutPatient: true, 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(), billNo: widget.ancillaryLists[0].ancillaryOrderList[index].orderNo.toString(),
profileUrl: "https://hmgwebservices.com/Images/MobileImages/DUBAI/unkown.png", profileUrl: "https://hmgwebservices.com/Images/MobileImages/DUBAI/unkown.png",
subName: widget.ancillaryLists[0].projectName, subName: widget.ancillaryLists[0].projectName,

@ -25,8 +25,8 @@ import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:permission_handler/permission_handler.dart'; import 'package:permission_handler/permission_handler.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:speech_to_text/speech_recognition_error.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_to_text.dart' as stt;
class SendFeedbackPage extends StatefulWidget { class SendFeedbackPage extends StatefulWidget {
final AppoitmentAllHistoryResultList appointment; final AppoitmentAllHistoryResultList appointment;
@ -49,7 +49,7 @@ class _SendFeedbackPageState extends State<SendFeedbackPage> {
final formKey = GlobalKey<FormState>(); final formKey = GlobalKey<FormState>();
MessageType messageType = MessageType.NON; MessageType messageType = MessageType.NON;
var _currentLocaleId; var _currentLocaleId;
stt.SpeechToText speech = stt.SpeechToText(); // stt.SpeechToText speech = stt.SpeechToText();
var reconizedWord; var reconizedWord;
int selectedStatusIndex = 5; int selectedStatusIndex = 5;
var event = RobotProvider(); var event = RobotProvider();
@ -218,17 +218,17 @@ class _SendFeedbackPageState extends State<SendFeedbackPage> {
inputWidget(TranslationBase.of(context).subject, "", titleController), inputWidget(TranslationBase.of(context).subject, "", titleController),
SizedBox(height: 12), SizedBox(height: 12),
inputWidget(TranslationBase.of(context).message, "", messageController, lines: 11, suffixTap: () async { inputWidget(TranslationBase.of(context).message, "", messageController, lines: 11, suffixTap: () async {
if (Platform.isAndroid) { // if (Platform.isAndroid) {
if (await PermissionService.isMicrophonePermissionEnabled()) { // if (await PermissionService.isMicrophonePermissionEnabled()) {
openSpeechReco(); // openSpeechReco();
} else { // } else {
Utils.showPermissionConsentDialog(context, TranslationBase.of(context).recordAudioPermission, () { // Utils.showPermissionConsentDialog(context, TranslationBase.of(context).recordAudioPermission, () {
openSpeechReco(); // openSpeechReco();
}); // });
} // }
} else { // } else {
openSpeechReco(); // openSpeechReco();
} // }
}), }),
SizedBox(height: 12), SizedBox(height: 12),
InkWell( InkWell(
@ -517,26 +517,26 @@ class _SendFeedbackPageState extends State<SendFeedbackPage> {
return; return;
} }
openSpeechReco() async { // openSpeechReco() async {
new RoboSearch(context: context).showAlertDialog(context); // new RoboSearch(context: context).showAlertDialog(context);
_currentLocaleId = TranslationBase.of(AppGlobal.context).locale.languageCode; // _currentLocaleId = TranslationBase.of(AppGlobal.context).locale.languageCode;
bool available = await speech.initialize(onStatus: statusListener, onError: errorListener); // bool available = await speech.initialize(onStatus: statusListener, onError: errorListener);
if (available) { // if (available) {
speech.listen( // speech.listen(
onResult: resultListener, // onResult: resultListener,
listenMode: stt.ListenMode.confirmation, // listenMode: stt.ListenMode.confirmation,
localeId: _currentLocaleId == 'en' ? 'en-US' : 'ar-SA', // localeId: _currentLocaleId == 'en' ? 'en-US' : 'ar-SA',
); // );
} else { // } else {
print("The user has denied the use of speech recognition."); // print("The user has denied the use of speech recognition.");
} // }
} // }
//
void errorListener(SpeechRecognitionError error) { // void errorListener(SpeechRecognitionError error) {
event.setValue({"searchText": 'null'}); // event.setValue({"searchText": 'null'});
//SpeechToText.closeAlertDialog(context); // //SpeechToText.closeAlertDialog(context);
print(error); // print(error);
} // }
void statusListener(String status) { void statusListener(String status) {
reconizedWord = status == 'listening' ? 'Lisening...' : 'Sorry....'; reconizedWord = status == 'listening' ? 'Lisening...' : 'Sorry....';
@ -556,14 +556,14 @@ class _SendFeedbackPageState extends State<SendFeedbackPage> {
setState(() { setState(() {
messageController.text += reconizedWord + '\n'; messageController.text += reconizedWord + '\n';
RoboSearch.closeAlertDialog(context); RoboSearch.closeAlertDialog(context);
speech.stop(); // speech.stop();
}); });
} }
} }
Future<void> initSpeechState() async { // Future<void> initSpeechState() async {
bool hasSpeech = await speech.initialize(onError: errorListener, onStatus: statusListener); // bool hasSpeech = await speech.initialize(onError: errorListener, onStatus: statusListener);
print(hasSpeech); // print(hasSpeech);
if (!mounted) return; // if (!mounted) return;
} // }
} }

@ -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}) { getDetails({String setupID, int projectID, String patientIdentificationID, int patientID, String name, bool isFamily, int parentID = 0, BuildContext context}) {
// GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
// _insuranceCardService.getPatientInsuranceDetails(setupID: setupID, projectID: projectID, patientID: patientID, patientIdentificationID: patientIdentificationID, isFamily: isFamily, parentID: parentID).then((value) { _insuranceCardService.getPatientInsuranceDetails(setupID: setupID, projectID: projectID, patientID: patientID, patientIdentificationID: patientIdentificationID, isFamily: isFamily, parentID: parentID).then((value) {
// GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
// if (!_insuranceCardService.hasError && _insuranceCardService.isHaveInsuranceCard) { if (!_insuranceCardService.hasError && _insuranceCardService.isHaveInsuranceCard) {
Navigator.push( Navigator.push(
context, context,
FadePage( FadePage(
@ -158,9 +158,9 @@ class InsurancePage extends StatelessWidget {
))).then((value) { ))).then((value) {
model.getInsuranceUpdated(); model.getInsuranceUpdated();
}); });
// } else { } else {
// AppToast.showErrorToast(message: _insuranceCardService.error); AppToast.showErrorToast(message: _insuranceCardService.error);
// } }
// }); });
} }
} }

@ -112,6 +112,12 @@ class _LiveCarePendingRequestState extends State<LiveCarePendingRequest> {
// cancelLiveCareRequest(); // cancelLiveCareRequest();
}), }),
), ),
// DefaultButton(
// TranslationBase.of(context).cancel,
// () {
// cancelLiveCareRequest();
// },
// ),
], ],
), ),
), ),
@ -200,30 +206,6 @@ class _LiveCarePendingRequestState extends State<LiveCarePendingRequest> {
// " Patients", // " Patients",
// style: TextStyle(fontSize: 20.0, fontWeight: FontWeight.bold)), // 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)),
// ),
// ),
// ),
// ], // ],
// ), // ),
); );

@ -57,8 +57,8 @@ class _PatientSickLeavePageState extends State<PatientSickLeavePage> {
subName: model.sickLeaveList[index].clinicName, subName: model.sickLeaveList[index].clinicName,
isSortByClinic: false, isSortByClinic: false,
isInOutPatient: model.sickLeaveList[index].isInOutPatient, isInOutPatient: model.sickLeaveList[index].isInOutPatient,
isSickLeave: true, // isSickLeave: true,
sickLeaveStatus: model.sickLeaveList[index].status, // sickLeaveStatus: model.sickLeaveList[index].status,
onEmailTap: () { onEmailTap: () {
showConfirmMessage(model, index); showConfirmMessage(model, index);
}, },
@ -69,13 +69,13 @@ class _PatientSickLeavePageState extends State<PatientSickLeavePage> {
} }
void showConfirmMessage(PatientSickLeaveViewMode model, int index) { void showConfirmMessage(PatientSickLeaveViewMode model, int index) {
if (model.sickLeaveList[index].status == 1) { // if (model.sickLeaveList[index].status == 1) {
openWorkPlaceUpdatePage(model.sickLeaveList[index].requestNo, model.sickLeaveList[index].setupID, model, index, model.sickLeaveList[index].projectID); // openWorkPlaceUpdatePage(model.sickLeaveList[index].requestNo, model.sickLeaveList[index].setupID, model, index, model.sickLeaveList[index].projectID);
} else if (model.sickLeaveList[index].status == 2) { // } else if (model.sickLeaveList[index].status == 2) {
showEmailDialog(model, index); showEmailDialog(model, index);
} else { // } else {
showApprovalDialog(); // showApprovalDialog();
} // }
} }
void showApprovalDialog() { void showApprovalDialog() {

@ -1,22 +1,20 @@
import 'dart:async'; 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/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/pharmacyModule/PharmacyAddressesViewModel.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.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/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/app_map/google_huawei_map.dart'; import 'package:diplomaticquarterapp/widgets/app_map/google_huawei_map.dart';
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/pickupLocation/PickupLocationFromMap.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:geocoding/geocoding.dart'; import 'package:geocoding/geocoding.dart';
import 'package:geolocator/geolocator.dart';
import 'package:google_maps_flutter/google_maps_flutter.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'; import 'package:provider/provider.dart';
class AddAddressPage extends StatefulWidget { class AddAddressPage extends StatefulWidget {
@ -37,6 +35,7 @@ class _AddAddressPageState extends State<AddAddressPage> {
LatLng currentPostion; LatLng currentPostion;
Completer<GoogleMapController> mapController = Completer(); Completer<GoogleMapController> mapController = Completer();
Placemark selectedPlace; Placemark selectedPlace;
LocationUtils locationUtils;
static CameraPosition _kGooglePlex = CameraPosition( static CameraPosition _kGooglePlex = CameraPosition(
target: LatLng(37.42796133580664, -122.085749655962), target: LatLng(37.42796133580664, -122.085749655962),
@ -93,13 +92,28 @@ class _AddAddressPageState extends State<AddAddressPage> {
} }
_getCurrentLocation() async { _getCurrentLocation() async {
await Geolocator.getLastKnownPosition().then((value) { if (await this.sharedPref.getDouble(USER_LAT) != null && await this.sharedPref.getDouble(USER_LONG) != null) {
_latitude = value.latitude; var lat = await this.sharedPref.getDouble(USER_LAT);
_longitude = value.longitude; var long = await this.sharedPref.getDouble(USER_LONG);
}).catchError((e) { _latitude = lat;
_longitude = 0; _longitude = long;
_latitude = 0; 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 @override
@ -184,8 +198,8 @@ class _AddAddressPageState extends State<AddAddressPage> {
// widget.onPick(value); // widget.onPick(value);
// }, // },
// ), // ),
), ),
); );
// ); // );
} }
} }

@ -253,7 +253,7 @@ class DoctorsListService extends BaseService {
return Future.value(localRes); return Future.value(localRes);
} }
Future<Map> getDoctorFreeSlots(int docID, int clinicID, int projectID, BuildContext context) async { Future<Map> getDoctorFreeSlots(int docID, int clinicID, int projectID, BuildContext context, [ProjectViewModel projectViewModel]) async {
Map<String, dynamic> request; Map<String, dynamic> request;
var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
Request req = appGlobal.getPublicRequest(); Request req = appGlobal.getPublicRequest();
@ -276,6 +276,16 @@ class DoctorsListService extends BaseService {
"DeviceTypeID": 1 "DeviceTypeID": 1
}; };
if (clinicID == 253) {
List<String> 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; dynamic localRes;
await baseAppClient.post(GET_DOCTOR_FREE_SLOTS, onSuccess: (response, statusCode) async { await baseAppClient.post(GET_DOCTOR_FREE_SLOTS, onSuccess: (response, statusCode) async {

@ -28,109 +28,158 @@ class LocalNotification {
} }
} }
_initialize() { _initialize() async {
var initializationSettingsAndroid = new AndroidInitializationSettings('app_icon'); try {
var initializationSettingsIOS = IOSInitializationSettings(onDidReceiveLocalNotification: null); var initializationSettingsAndroid = new AndroidInitializationSettings('app_icon');
var initializationSettings = InitializationSettings(android: initializationSettingsAndroid, iOS: initializationSettingsIOS); var initializationSettingsIOS = DarwinInitializationSettings(onDidReceiveLocalNotification: null);
flutterLocalNotificationsPlugin.initialize(initializationSettings, onSelectNotification: _onNotificationClick); var initializationSettings = InitializationSettings(android: initializationSettingsAndroid, iOS: initializationSettingsIOS);
} await flutterLocalNotificationsPlugin.initialize(
initializationSettings,
var _random = new Random(); 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}) { void notificationTapBackground(NotificationResponse notificationResponse) {
return _random.nextInt(from); // 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 _random = new Random();
var vibrationPattern = Int64List(4);
vibrationPattern[0] = 0;
vibrationPattern[1] = 1000;
vibrationPattern[2] = 5000;
vibrationPattern[3] = 2000;
return vibrationPattern; _randomNumber({int from = 100000}) {
} return _random.nextInt(from);
}
Future showNow({@required String title, @required String subtitle, String payload}) { _vibrationPattern() {
Future.delayed(Duration(seconds: 1)).then((result) async { var vibrationPattern = Int64List(4);
var androidPlatformChannelSpecifics = AndroidNotificationDetails('com.hmg.local_notification', 'HMG', vibrationPattern[0] = 0;
channelDescription: 'HMG', importance: Importance.max, priority: Priority.high, ticker: 'ticker', vibrationPattern: _vibrationPattern()); vibrationPattern[1] = 1000;
var iOSPlatformChannelSpecifics = IOSNotificationDetails(); vibrationPattern[2] = 5000;
var platformChannelSpecifics = NotificationDetails(android: androidPlatformChannelSpecifics, iOS: iOSPlatformChannelSpecifics); vibrationPattern[3] = 2000;
await flutterLocalNotificationsPlugin.show(_randomNumber(), title, subtitle, platformChannelSpecifics, payload: payload).catchError((err) {
print(err); return vibrationPattern;
}); }
});
}
Future scheduleNotification({@required DateTime scheduledNotificationDateTime, @required String title, @required String description}) async { Future showNow({@required String title, @required String subtitle, String payload}) {
///vibrationPattern Future.delayed(Duration(seconds: 1)).then((result) async {
var vibrationPattern = Int64List(4); var androidPlatformChannelSpecifics = AndroidNotificationDetails('com.hmg.local_notification', 'HMG',
vibrationPattern[0] = 0; channelDescription: 'HMG',
vibrationPattern[1] = 1000; importance: Importance.max,
vibrationPattern[2] = 5000; priority: Priority.high,
vibrationPattern[3] = 2000; ticker: 'ticker',
vibrationPattern: _vibrationPattern());
var androidPlatformChannelSpecifics = AndroidNotificationDetails('active-prescriptions', 'ActivePrescriptions', var iOSPlatformChannelSpecifics = DarwinNotificationDetails();
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
var platformChannelSpecifics = NotificationDetails(android: androidPlatformChannelSpecifics, iOS: iOSPlatformChannelSpecifics); 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 scheduleNotification({@required DateTime scheduledNotificationDateTime, @required String title, @required String description}) async {
Future showDailyAtTime() async { ///vibrationPattern
var time = Time(10, 0, 0); var vibrationPattern = Int64List(4);
var androidPlatformChannelSpecifics = AndroidNotificationDetails('repeatDailyAtTime channel id', 'repeatDailyAtTime channel name', channelDescription: 'repeatDailyAtTime description'); vibrationPattern[0] = 0;
var iOSPlatformChannelSpecifics = IOSNotificationDetails(); vibrationPattern[1] = 1000;
// var platformChannelSpecifics = NotificationDetails( vibrationPattern[2] = 5000;
// androidPlatformChannelSpecifics, iOSPlatformChannelSpecifics); vibrationPattern[3] = 2000;
// await flutterLocalNotificationsPlugin.showDailyAtTime(
// 0, var androidPlatformChannelSpecifics = AndroidNotificationDetails('active-prescriptions', 'ActivePrescriptions',
// 'show daily title', channelDescription: 'ActivePrescriptionsDescription',
// 'Daily notification shown at approximately ${_toTwoDigitString(time.hour)}:${_toTwoDigitString(time.minute)}:${_toTwoDigitString(time.second)}', // icon: 'secondary_icon',
// time, sound: RawResourceAndroidNotificationSound('slow_spring_board'),
// platformChannelSpecifics);
} ///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 ///Repeat notification every day at approximately 10:00:00 am
Future showWeeklyAtDayAndTime() async { Future showDailyAtTime() async {
var time = Time(10, 0, 0); var time = Time(10, 0, 0);
var androidPlatformChannelSpecifics = AndroidNotificationDetails('show weekly channel id', 'show weekly channel name', channelDescription: 'show weekly description'); var androidPlatformChannelSpecifics = AndroidNotificationDetails('repeatDailyAtTime channel id', 'repeatDailyAtTime channel name', channelDescription: 'repeatDailyAtTime description');
var iOSPlatformChannelSpecifics = IOSNotificationDetails(); var iOSPlatformChannelSpecifics = DarwinNotificationDetails();
// var platformChannelSpecifics = NotificationDetails( // var platformChannelSpecifics = NotificationDetails(
// androidPlatformChannelSpecifics, iOSPlatformChannelSpecifics); // androidPlatformChannelSpecifics, iOSPlatformChannelSpecifics);
// await flutterLocalNotificationsPlugin.showWeeklyAtDayAndTime( // await flutterLocalNotificationsPlugin.showDailyAtTime(
// 0, // 0,
// 'show weekly title', // 'show daily title',
// 'Weekly notification shown on Monday at approximately ${_toTwoDigitString(time.hour)}:${_toTwoDigitString(time.minute)}:${_toTwoDigitString(time.second)}', // 'Daily notification shown at approximately ${_toTwoDigitString(time.hour)}:${_toTwoDigitString(time.minute)}:${_toTwoDigitString(time.second)}',
// Day.Monday, // time,
// time, // platformChannelSpecifics);
// platformChannelSpecifics); }
}
String _toTwoDigitString(int value) { ///Repeat notification weekly on Monday at approximately 10:00:00 am
return value.toString().padLeft(2, '0'); 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 { String _toTwoDigitString(int value) {
await flutterLocalNotificationsPlugin.cancel(0); return value.toString().padLeft(2, '0');
} }
Future cancelAllNotifications() async { Future cancelNotification() async {
await flutterLocalNotificationsPlugin.cancelAll(); await flutterLocalNotificationsPlugin.cancel(0);
}
} }
Future cancelAllNotifications() async {
await flutterLocalNotificationsPlugin.cancelAll();
}}

@ -24,6 +24,7 @@ class LocationUtils {
bool isShowConfirmDialog; bool isShowConfirmDialog;
BuildContext context; BuildContext context;
bool isHuawei; bool isHuawei;
final GeolocatorPlatform _geolocatorPlatform = GeolocatorPlatform.instance;
LocationUtils({@required this.isShowConfirmDialog, @required this.context, this.isHuawei = false}); LocationUtils({@required this.isShowConfirmDialog, @required this.context, this.isHuawei = false});
@ -43,11 +44,16 @@ class LocationUtils {
if (permission == LocationPermission.denied || permission == LocationPermission.deniedForever) { if (permission == LocationPermission.denied || permission == LocationPermission.deniedForever) {
if (Platform.isAndroid) { if (Platform.isAndroid) {
Utils.showPermissionConsentDialog(context, TranslationBase.of(context).locationPermissionDialog, () { Utils.showPermissionConsentDialog(context, TranslationBase.of(context).locationPermissionDialog, () async {
Geolocator.getCurrentPosition(desiredAccuracy: LocationAccuracy.medium, timeLimit: Duration(seconds: 10)).then((value) { final hasPermission = await _handlePermission();
setLocation(value); if (hasPermission) {
if (callBack != null) callBack(LatLng(value.latitude, value.longitude)); 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 { } else {
if (await Permission.location.request().isGranted) { if (await Permission.location.request().isGranted) {
@ -70,6 +76,29 @@ class LocationUtils {
} }
} }
Future<bool> _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; LocationCallback _locationCallback;
_getHMSCurrentLocation(Function(LatLng) callBack) async { _getHMSCurrentLocation(Function(LatLng) callBack) async {

@ -223,12 +223,14 @@ class PushNotificationHandler {
// if (Platform.isAndroid && (!await FlutterHmsGmsAvailability.isHmsAvailable)) { // if (Platform.isAndroid && (!await FlutterHmsGmsAvailability.isHmsAvailable)) {
if (Platform.isAndroid) { if (Platform.isAndroid) {
await hmsApiAvailability.isHMSAvailable().then((value) async { try {
if (value != 0) { await hmsApiAvailability.isHMSAvailable().then((value) async {
final fcmToken = await FirebaseMessaging.instance.getToken(); if (value != 0) {
if (fcmToken != null) onToken(fcmToken); final fcmToken = await FirebaseMessaging.instance.getToken();
} if (fcmToken != null) onToken(fcmToken);
}); }
});
} catch (ex) {}
} }
if (Platform.isIOS) { if (Platform.isIOS) {

@ -47,6 +47,7 @@ class AppMapState extends State<AppMap> {
checkIsHuawei() async { checkIsHuawei() async {
await hmsApiAvailability.isHMSAvailable().then((value) { await hmsApiAvailability.isHMSAvailable().then((value) {
isHuawei = value == 0 ? true : false; isHuawei = value == 0 ? true : false;
hmsMap.HuaweiMapInitializer.initializeMap();
}); });
print(isHuawei); print(isHuawei);
setState(() {}); setState(() {});

@ -33,9 +33,9 @@ import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_tts/flutter_tts.dart'; import 'package:flutter_tts/flutter_tts.dart';
import 'package:permission_handler/permission_handler.dart'; import 'package:permission_handler/permission_handler.dart';
import 'package:speech_to_text/speech_recognition_error.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_recognition_result.dart';
import 'package:speech_to_text/speech_to_text.dart'; // import 'package:speech_to_text/speech_to_text.dart';
class BottomBarSearch extends StatefulWidget { class BottomBarSearch extends StatefulWidget {
@override @override
@ -47,7 +47,7 @@ class _SearchBot extends State<BottomBarSearch> {
RobotProvider Provider = RobotProvider(); RobotProvider Provider = RobotProvider();
bool isLoading = false; bool isLoading = false;
bool isError = false; bool isError = false;
final SpeechToText speech = SpeechToText(); // final SpeechToText speech = SpeechToText();
String error = ''; String error = '';
String _currentLocaleId = ""; String _currentLocaleId = "";
String lastError; String lastError;
@ -98,8 +98,8 @@ class _SearchBot extends State<BottomBarSearch> {
}); });
// await flutterTts.speak("Hello!"); // await flutterTts.speak("Hello!");
//Future.delayed(const Duration(seconds: 1), () { //Future.delayed(const Duration(seconds: 1), () {
initSpeechState() // initSpeechState()
.then((value) => startVoiceSearch()); // .then((value) => startVoiceSearch());
//}); //});
}, },
)), )),
@ -111,34 +111,34 @@ class _SearchBot extends State<BottomBarSearch> {
); );
} }
startVoiceSearch() async { // startVoiceSearch() async {
speech.listen( // speech.listen(
onResult: resultListener, // onResult: resultListener,
listenFor: Duration(seconds: 10), // listenFor: Duration(seconds: 10),
localeId: _currentLocaleId, // localeId: _currentLocaleId,
onSoundLevelChange: soundLevelListener, // onSoundLevelChange: soundLevelListener,
cancelOnError: true, // cancelOnError: true,
partialResults: true, // partialResults: true,
onDevice: true, // onDevice: true,
listenMode: ListenMode.confirmation); // listenMode: ListenMode.confirmation);
} // }
void resultListener(SpeechRecognitionResult result) { // void resultListener(SpeechRecognitionResult result) {
// lastWords = "${result.recognizedWords} - ${result.finalResult}"; // // lastWords = "${result.recognizedWords} - ${result.finalResult}";
//
if (result.finalResult == true) { // if (result.finalResult == true) {
// setState(() { // // setState(() {
reconizedWord = result.recognizedWords; // reconizedWord = result.recognizedWords;
//}); // //});
setState(() { // setState(() {
searchController.text = reconizedWord; // searchController.text = reconizedWord;
}); // });
Future.delayed(const Duration(seconds: 1), () { // Future.delayed(const Duration(seconds: 1), () {
_speak(reconizedWord); // _speak(reconizedWord);
}); // });
} // }
//}); // //});
} // }
Future _speak(reconizedWord) async { Future _speak(reconizedWord) async {
//await flutterTts.speak(reconizedWord); //await flutterTts.speak(reconizedWord);
@ -161,23 +161,23 @@ class _SearchBot extends State<BottomBarSearch> {
].request(); ].request();
} }
Future<void> initSpeechState() async { // Future<void> initSpeechState() async {
await speech.initialize(onError: errorListener, onStatus: statusListener); // await speech.initialize(onError: errorListener, onStatus: statusListener);
//
_currentLocaleId = // _currentLocaleId =
TranslationBase.of(AppGlobal.context).locale.languageCode == 'en' // TranslationBase.of(AppGlobal.context).locale.languageCode == 'en'
? 'en-GB' // ? 'en-GB'
: 'ar-SA'; // systemLocale.localeId; // : 'ar-SA'; // systemLocale.localeId;
flutterTts.setLanguage(_currentLocaleId); // flutterTts.setLanguage(_currentLocaleId);
//
// if (!mounted) return; // // if (!mounted) return;
} // }
void errorListener(SpeechRecognitionError error) { // void errorListener(SpeechRecognitionError error) {
//setState(() { // //setState(() {
// reconizedWord = "${error.errorMsg} - ${error.permanent}"; // // reconizedWord = "${error.errorMsg} - ${error.permanent}";
//}); // //});
} // }
void statusListener(String status) { void statusListener(String status) {
//setState(() { //setState(() {

@ -66,8 +66,8 @@ import 'package:flutter/material.dart';
import 'package:flutter_tts/flutter_tts.dart'; import 'package:flutter_tts/flutter_tts.dart';
import 'package:permission_handler/permission_handler.dart'; import 'package:permission_handler/permission_handler.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:speech_to_text/speech_recognition_error.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_to_text.dart' as stt;
import 'package:url_launcher/url_launcher.dart'; import 'package:url_launcher/url_launcher.dart';
class FloatingSearchButton extends StatefulWidget { class FloatingSearchButton extends StatefulWidget {
@ -83,7 +83,7 @@ class _FloatingSearchButton extends State<FloatingSearchButton> with TickerProvi
RobotProvider eventProvider = RobotProvider(); RobotProvider eventProvider = RobotProvider();
bool isLoading = false; bool isLoading = false;
bool isError = false; bool isError = false;
stt.SpeechToText speech = stt.SpeechToText(); // stt.SpeechToText speech = stt.SpeechToText();
String error = ''; String error = '';
String _currentLocaleId = ""; String _currentLocaleId = "";
String lastError; String lastError;
@ -143,7 +143,7 @@ class _FloatingSearchButton extends State<FloatingSearchButton> with TickerProvi
if (p['startPopUp'] == 'true') { if (p['startPopUp'] == 'true') {
if (this.mounted) { if (this.mounted) {
new RoboSearch(context: context).showAlertDialog(context); new RoboSearch(context: context).showAlertDialog(context);
initSpeechState().then((value) => {startVoiceSearch()}); // initSpeechState().then((value) => {startVoiceSearch()});
} }
} }
}); });
@ -192,20 +192,20 @@ class _FloatingSearchButton extends State<FloatingSearchButton> with TickerProvi
: Image.asset('assets/images/gif/robot-idle.gif'), : Image.asset('assets/images/gif/robot-idle.gif'),
), ),
onTap: () async { onTap: () async {
if (Platform.isAndroid) { // if (Platform.isAndroid) {
if (await PermissionService.isMicrophonePermissionEnabled()) { // if (await PermissionService.isMicrophonePermissionEnabled()) {
new RoboSearch(context: context).showAlertDialog(context); // new RoboSearch(context: context).showAlertDialog(context);
initSpeechState().then((value) => {startVoiceSearch()}); // initSpeechState().then((value) => {startVoiceSearch()});
} else { // } else {
Utils.showPermissionConsentDialog(context, TranslationBase.of(context).recordAudioPermission, () { // Utils.showPermissionConsentDialog(context, TranslationBase.of(context).recordAudioPermission, () {
new RoboSearch(context: context).showAlertDialog(context); // new RoboSearch(context: context).showAlertDialog(context);
initSpeechState().then((value) => {startVoiceSearch()}); // initSpeechState().then((value) => {startVoiceSearch()});
}); // });
} // }
} else { // } else {
new RoboSearch(context: context).showAlertDialog(context); // new RoboSearch(context: context).showAlertDialog(context);
initSpeechState().then((value) => {startVoiceSearch()}); // initSpeechState().then((value) => {startVoiceSearch()});
} // }
}, },
), ),
Positioned( Positioned(
@ -234,31 +234,31 @@ class _FloatingSearchButton extends State<FloatingSearchButton> with TickerProvi
])); ]));
} }
startVoiceSearch() async { // startVoiceSearch() async {
bool available = await speech.initialize(onStatus: statusListener, onError: errorListener); // bool available = await speech.initialize(onStatus: statusListener, onError: errorListener);
_currentLocaleId = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); // _currentLocaleId = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
//
if (available) { // if (available) {
speech.listen( // speech.listen(
onResult: resultListener, // onResult: resultListener,
//listenMode: ListenMode.confirmation, // //listenMode: ListenMode.confirmation,
localeId: _currentLocaleId == 'en' ? 'en_US' : 'ar_SA', // localeId: _currentLocaleId == 'en' ? 'en_US' : 'ar_SA',
); // );
} else { // } else {
print("The user has denied the use of speech recognition."); // print("The user has denied the use of speech recognition.");
} // }
// some time later... // // some time later...
//speech.stop(); // //speech.stop();
// speech.listen( // // speech.listen(
// onResult: resultListener, // // onResult: resultListener,
// listenFor: Duration(seconds: 10), // // listenFor: Duration(seconds: 10),
// localeId: _currentLocaleId == 'en' ? 'en-US' : 'ar-SA', // // localeId: _currentLocaleId == 'en' ? 'en-US' : 'ar-SA',
// onSoundLevelChange: soundLevelListener, // // onSoundLevelChange: soundLevelListener,
// cancelOnError: true, // // cancelOnError: true,
// partialResults: true, // // partialResults: true,
// onDevice: true, // // onDevice: true,
// listenMode: ListenMode.deviceDefault); // // listenMode: ListenMode.deviceDefault);
} // }
void resultListener(result) { void resultListener(result) {
reconizedWord = result.recognizedWords; reconizedWord = result.recognizedWords;
@ -305,7 +305,7 @@ class _FloatingSearchButton extends State<FloatingSearchButton> with TickerProvi
isArabic = Provider.of<ProjectViewModel>(context, listen: false).isArabic; isArabic = Provider.of<ProjectViewModel>(context, listen: false).isArabic;
await requestPermissions(); await requestPermissions();
getUserData(); getUserData();
await speech.initialize(onError: errorListener, onStatus: statusListener); // await speech.initialize(onError: errorListener, onStatus: statusListener);
//initialSpeak(); //initialSpeak();
if (!mounted) return; if (!mounted) return;
@ -315,10 +315,10 @@ class _FloatingSearchButton extends State<FloatingSearchButton> with TickerProvi
// }); // });
} }
void errorListener(SpeechRecognitionError error) { // void errorListener(SpeechRecognitionError error) {
event.setValue({"searchText": 'null'}); // event.setValue({"searchText": 'null'});
RoboSearch.closeAlertDialog(context); // RoboSearch.closeAlertDialog(context);
} // }
void statusListener(String status) { void statusListener(String status) {
//setState(() { //setState(() {
@ -951,7 +951,7 @@ class _MyStatefulBuilderState extends State<MyStatefulBuilder> {
var searchText; var searchText;
static StreamSubscription<dynamic> streamSubscription; static StreamSubscription<dynamic> streamSubscription;
static var isClosed = false; static var isClosed = false;
stt.SpeechToText speech = stt.SpeechToText(); // stt.SpeechToText speech = stt.SpeechToText();
@override @override
void initState() { void initState() {
@ -1019,7 +1019,7 @@ class _MyStatefulBuilderState extends State<MyStatefulBuilder> {
TranslationBase.of(context).ok, TranslationBase.of(context).ok,
() { () {
RoboSearch.closeAlertDialog(context); RoboSearch.closeAlertDialog(context);
speech.stop(); // speech.stop();
// event.setValue({"searchText": { // event.setValue({"searchText": {
// 'isIOSFeedback':true, // 'isIOSFeedback':true,
// //

@ -13,7 +13,7 @@ import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:geocoding/geocoding.dart'; import 'package:geocoding/geocoding.dart';
import 'package:google_maps_flutter/google_maps_flutter.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:huawei_hmsavailability/huawei_hmsavailability.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';

@ -1,7 +1,7 @@
name: diplomaticquarterapp name: diplomaticquarterapp
description: A new Flutter application. description: A new Flutter application.
version: 4.5.005+4050005 version: 4.5.008+4050008
environment: environment:
sdk: ">=2.7.0 <3.0.0" sdk: ">=2.7.0 <3.0.0"
@ -22,7 +22,8 @@ dependencies:
connectivity: ^3.0.6 connectivity: ^3.0.6
async: ^2.8.1 async: ^2.8.1
audio_wave: ^0.1.2 audio_wave: ^0.1.4
# audio_session: ^0.1.13
# State Management # State Management
provider: ^6.0.1 provider: ^6.0.1
@ -36,7 +37,7 @@ dependencies:
fl_chart: ^0.40.2 fl_chart: ^0.40.2
#Camera Preview #Camera Preview
camera: ^0.9.4+5 camera: ^0.10.1
# Permissions # Permissions
permission_handler: ^8.3.0 permission_handler: ^8.3.0
@ -89,8 +90,8 @@ dependencies:
google_maps_flutter: ^2.1.1 google_maps_flutter: ^2.1.1
# Huawei # Huawei
huawei_map: 6.0.1+305 huawei_map: 6.5.0+301
huawei_push: ^5.3.0+304 huawei_push: ^6.5.0+300
# Qr code Scanner TODO fix it # Qr code Scanner TODO fix it
# barcode_scanner: ^1.0.1 # barcode_scanner: ^1.0.1
@ -98,7 +99,7 @@ dependencies:
location: ^4.3.0 location: ^4.3.0
# Qr code Scanner # Qr code Scanner
# barcode_scan_fix: ^1.0.2 # barcode_scan_fix: ^1.0.2
barcode_scan2: ^4.2.1 barcode_scan2: ^4.2.2
# Rating Stars # Rating Stars
rating_bar: ^0.2.0 rating_bar: ^0.2.0
@ -113,13 +114,13 @@ dependencies:
manage_calendar_events: ^2.0.1 manage_calendar_events: ^2.0.1
#InAppBrowser #InAppBrowser
# flutter_inappwebview: ^5.3.2 flutter_inappwebview: 5.7.2+3
#Circular progress bar for reverse timer #Circular progress bar for reverse timer
circular_countdown_timer: ^0.2.0 circular_countdown_timer: ^0.2.0
#Just Audio to play ringing for incoming video call #Just Audio to play ringing for incoming video call
just_audio: ^0.9.18 just_audio: ^0.9.30
#hijri #hijri
hijri: ^2.0.3 hijri: ^2.0.3
@ -130,13 +131,13 @@ dependencies:
carousel_pro: ^1.0.0 carousel_pro: ^1.0.0
#local_notifications #local_notifications
flutter_local_notifications: ^9.1.4 flutter_local_notifications: ^10.0.0
#device_calendar #device_calendar
device_calendar: ^4.2.0 device_calendar: ^4.2.0
#Handle Geolocation #Handle Geolocation
geolocator: ^7.7.1 geolocator: ^9.0.2
#Handle lat long to address #Handle lat long to address
geocoding: ^2.0.1 geocoding: ^2.0.1
@ -150,7 +151,8 @@ dependencies:
#google maps places #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 map_launcher: ^1.1.3
#countdown timer for Upcoming List #countdown timer for Upcoming List
flutter_countdown_timer: ^4.1.0 flutter_countdown_timer: ^4.1.0
@ -170,8 +172,8 @@ dependencies:
flutter_nfc_kit: ^3.3.1 flutter_nfc_kit: ^3.3.1
speech_to_text: # speech_to_text: ^6.1.1
path: speech_to_text # path: speech_to_text
in_app_update: ^3.0.0 in_app_update: ^3.0.0
@ -209,9 +211,9 @@ dependency_overrides:
permission_handler : ^6.0.1+1 permission_handler : ^6.0.1+1
flutter_svg: ^1.0.0 flutter_svg: ^1.0.0
# firebase_messaging_platform_interface: any # firebase_messaging_platform_interface: any
flutter_inappwebview: # flutter_inappwebview: 5.7.2+3
git: # git:
url: https://github.com/CodeEagle/flutter_inappwebview # url: https://github.com/CodeEagle/flutter_inappwebview
dev_dependencies: dev_dependencies:

Loading…
Cancel
Save