Target SDK & Compile SDK bumped to 33

sultan_v3.3
haroon amjad 2 years ago
parent 2e72d6a550
commit 0e01835327

@ -21,6 +21,12 @@ if (flutterVersionName == null) {
flutterVersionName = '1.0'
}
def keystoreProperties = new Properties()
def keystorePropertiesFile = rootProject.file('key.properties')
if (keystorePropertiesFile.exists()) {
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
}
apply plugin: 'com.android.application'
apply plugin: 'com.huawei.agconnect'
apply plugin: 'kotlin-android'
@ -51,29 +57,29 @@ android {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.ejada.hmg"
minSdkVersion 21
targetSdkVersion 30
targetSdkVersion 33
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
multiDexEnabled true
}
signingConfigs {
config{
storeFile file('key')
keyAlias 'hmg'
storePassword 'HmGsa123'
keyPassword 'HmGsa123'
release {
keyAlias keystoreProperties['keyAlias']
keyPassword keystoreProperties['keyPassword']
storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null
storePassword keystoreProperties['storePassword']
}
}
buildTypes {
debug {
debuggable true
signingConfig signingConfigs.config
signingConfig signingConfigs.release
}
release {
debuggable false
signingConfig signingConfigs.config
signingConfig signingConfigs.release
minifyEnabled true
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
@ -127,10 +133,11 @@ dependencies {
implementation 'com.github.kittinunf.fuel:fuel-android:2.3.0'
implementation 'com.google.android.gms:play-services-location:17.1.0'//for Android
implementation 'com.google.android.gms:play-services-basement:17.5.0'
implementation "com.opentok.android:opentok-android-sdk:2.19.1"
implementation "com.opentok.android:opentok-android-sdk:2.21.4"
implementation 'com.facebook.stetho:stetho:1.5.1'
implementation 'com.facebook.stetho:stetho-urlconnection:1.5.1'
implementation 'androidx.core:core-ktx:1.6.0'
implementation 'androidx.appcompat:appcompat:1.3.1'
androidTestImplementation "androidx.test:core:1.4.0"
}

@ -4,4 +4,4 @@
to allow setting breakpoints, to provide hot reload, etc.
-->
<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_NETWORK_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 -->
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
<!-- <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>-->
<queries>
<intent>
<action android:name="android.speech.RecognitionService" />
@ -49,7 +49,6 @@
android:showOnLockScreen="true"
android:screenOrientation="sensorPortrait"
android:allowBackup="false"
tools:replace="android:allowBackup,android:label"
android:label="Dr. Alhabib">
<meta-data android:name="push_kit_auto_init_enabled" android:value="true" />
@ -89,23 +88,23 @@
</intent-filter>
</activity>
<receiver android:exported="true" tools:replace="android:exported" android:name="com.dexterous.flutterlocalnotifications.ScheduledNotificationBootReceiver">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED"/>
<action android:name="android.intent.action.MY_PACKAGE_REPLACED"/>
</intent-filter>
</receiver>
<!-- <receiver android:name="com.dexterous.flutterlocalnotifications.ScheduledNotificationBootReceiver" android:exported="true">-->
<!-- <intent-filter>-->
<!-- <action android:name="android.intent.action.BOOT_COMPLETED"/>-->
<!-- <action android:name="android.intent.action.MY_PACKAGE_REPLACED"/>-->
<!-- </intent-filter>-->
<!-- </receiver>-->
<!-- Geofencing -->
<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:exported="true" android:name=".geofence.intent_receivers.GeofencingRebootBroadcastReceiver" android:enabled="true">
<receiver android:name=".geofence.intent_receivers.GeofenceBroadcastReceiver" android:enabled="true" android:exported="false" />
<receiver android:name=".geofence.intent_receivers.GeofencingRebootBroadcastReceiver" android:enabled="true" android:exported="false">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED"/>
<action android:name="android.intent.action.MY_PACKAGE_REPLACED"/>
</intent-filter>
</receiver>
<receiver android:exported="true" android:name=".geofence.intent_receivers.LocationProviderChangeReceiver">
<receiver android:name=".geofence.intent_receivers.LocationProviderChangeReceiver" android:exported="false">
<intent-filter>
<action android:name="android.location.PROVIDERS_CHANGED"/>
</intent-filter>
@ -117,20 +116,19 @@
Huawei Push Notifications
Set push kit auto enable to true (for obtaining the token on initialize)
-->
<meta-data
android:name="push_kit_auto_init_enabled"
android:value="true" />
<!-- <meta-data-->
<!-- android:name="push_kit_auto_init_enabled"-->
<!-- android:value="true" />-->
<!-- 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>
<action android:name="android.intent.action.BOOT_COMPLETED" />
</intent-filter>
</receiver>
<receiver
android:name="com.huawei.hms.flutter.push.receiver.local.HmsLocalNotificationScheduledPublisher"
android:exported="true"
android:enabled="true" />
android:enabled="true"
android:exported="false" />
<receiver
android:name="com.huawei.hms.flutter.push.receiver.BackgroundMessageBroadcastReceiver"
android:enabled="true"
@ -153,10 +151,10 @@
</application>
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.USE_FINGERPRINT" />
<uses-permission android:name="android.permission.READ_CALENDAR" />
<uses-permission android:name="android.permission.WRITE_CALENDAR" />
<!-- <uses-permission android:name="android.permission.INTERNET" />-->
<!-- <uses-permission android:name="android.permission.USE_FINGERPRINT" />-->
<!-- <uses-permission android:name="android.permission.READ_CALENDAR" />-->
<!-- <uses-permission android:name="android.permission.WRITE_CALENDAR" />-->

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

@ -59,18 +59,25 @@ class GeofenceTransitionsJobIntentService : JobIntentService() {
override fun onHandleWork(intent: Intent) {
val geofencingEvent = GeofencingEvent.fromIntent(intent)
if (geofencingEvent.hasError()) {
val errorMessage = GeofenceErrorMessages.getErrorString(context_!!, geofencingEvent.errorCode)
Log.e(LOG_TAG, errorMessage)
if (geofencingEvent != null) {
if (geofencingEvent.hasError()) {
val errorMessage = GeofenceErrorMessages.getErrorString(context_!!, geofencingEvent.errorCode)
Log.e(LOG_TAG, errorMessage)
saveLog(context_!!,LOG_TAG,errorMessage)
doReRegisterIfRequired(context_!!, geofencingEvent.errorCode)
saveLog(context_!!,LOG_TAG,errorMessage)
doReRegisterIfRequired(context_!!, geofencingEvent.errorCode)
return
}
return
}
}
HMG_Geofence.shared(context_!!).handleEvent(geofencingEvent.triggeringGeofences,geofencingEvent.triggeringLocation, GeofenceTransition.fromInt(geofencingEvent.geofenceTransition));
if (geofencingEvent != null) {
geofencingEvent.triggeringGeofences?.let { geofencingEvent.triggeringLocation?.let { it1 ->
HMG_Geofence.shared(context_!!).handleEvent(it,
it1, GeofenceTransition.fromInt(geofencingEvent.geofenceTransition))
} }
};
}

@ -11,7 +11,7 @@ buildscript {
}
dependencies {
classpath 'com.android.tools.build:gradle:7.0.3'
classpath 'com.android.tools.build:gradle:7.1.3'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.google.gms:google-services:4.3.8'
// classpath 'com.google.firebase:firebase-crashlytics-gradle:2.8.1'

@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip

@ -19,10 +19,10 @@
76815B27275F381C00E66E94 /* HealthKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 76815B26275F381C00E66E94 /* HealthKit.framework */; };
76962ECE28AE5C10004EAE09 /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 76962ECD28AE5C10004EAE09 /* GoogleService-Info.plist */; };
76F2556127F1FFED0062C1CD /* PassKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 76F2556027F1FFED0062C1CD /* PassKit.framework */; };
888788C5457DD4B4291ED407 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DBECDFA177FC32F0D92001A8 /* Pods_Runner.framework */; };
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; };
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; };
97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; };
B40C32A62DF065A3A0414845 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8B99ADD0B93AC14DD8D0BAB0 /* Pods_Runner.framework */; };
E91B5396256AAA6500E96549 /* GlobalHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = E91B538D256AAA6500E96549 /* GlobalHelper.swift */; };
E91B5397256AAA6500E96549 /* Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = E91B538E256AAA6500E96549 /* Extensions.swift */; };
E91B5398256AAA6500E96549 /* API.swift in Sources */ = {isa = PBXBuildFile; fileRef = E91B538F256AAA6500E96549 /* API.swift */; };
@ -63,7 +63,6 @@
306FE6C7271D790C002D6EFC /* OpenTokPlatformBridge.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OpenTokPlatformBridge.swift; sourceTree = "<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>"; };
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>"; };
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>"; };
@ -71,7 +70,9 @@
76815B26275F381C00E66E94 /* HealthKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = HealthKit.framework; path = System/Library/Frameworks/HealthKit.framework; sourceTree = SDKROOT; };
76962ECD28AE5C10004EAE09 /* GoogleService-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "GoogleService-Info.plist"; sourceTree = "<group>"; };
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>"; };
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>"; };
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; };
@ -79,9 +80,7 @@
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>"; };
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>"; };
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>"; };
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>"; };
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>"; };
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>"; };
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>"; };
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 */
/* Begin PBXFrameworksBuildPhase section */
@ -110,7 +110,7 @@
76F2556127F1FFED0062C1CD /* PassKit.framework in Frameworks */,
76815B27275F381C00E66E94 /* HealthKit.framework in Frameworks */,
E9620805255C2ED100D3A35D /* NetworkExtension.framework in Frameworks */,
888788C5457DD4B4291ED407 /* Pods_Runner.framework in Frameworks */,
B40C32A62DF065A3A0414845 /* Pods_Runner.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@ -133,7 +133,7 @@
76F2556027F1FFED0062C1CD /* PassKit.framework */,
76815B26275F381C00E66E94 /* HealthKit.framework */,
E9620804255C2ED100D3A35D /* NetworkExtension.framework */,
DBECDFA177FC32F0D92001A8 /* Pods_Runner.framework */,
8B99ADD0B93AC14DD8D0BAB0 /* Pods_Runner.framework */,
);
name = Frameworks;
sourceTree = "<group>";
@ -141,9 +141,9 @@
605039E5DDF72C245F9765FE /* Pods */ = {
isa = PBXGroup;
children = (
C43E6143D6D42F3BF36E6E30 /* Pods-Runner.debug.xcconfig */,
7339683046E679D7577A50D3 /* Pods-Runner.release.xcconfig */,
E88A1DAFD417EE86EE2F7F02 /* Pods-Runner.profile.xcconfig */,
EBA301C32F4CA9F09D2D7713 /* Pods-Runner.debug.xcconfig */,
7805E271E86E72F39E68ADCC /* Pods-Runner.release.xcconfig */,
BC1BA79F1F6E9D7BE59D2AE4 /* Pods-Runner.profile.xcconfig */,
);
path = Pods;
sourceTree = "<group>";
@ -246,15 +246,15 @@
isa = PBXNativeTarget;
buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */;
buildPhases = (
6CEC06A85A1BC01F415967B9 /* [CP] Check Pods Manifest.lock */,
A37FFD337A0067237A8DACD6 /* [CP] Check Pods Manifest.lock */,
9740EEB61CF901F6004384FC /* Run Script */,
97C146EA1CF9000F007C117D /* Sources */,
97C146EB1CF9000F007C117D /* Frameworks */,
97C146EC1CF9000F007C117D /* Resources */,
9705A1C41CF9048500538489 /* Embed Frameworks */,
3B06AD1E1E4923F5004D2608 /* Thin Binary */,
EB708D648E256F1D924823C6 /* [CP] Embed Pods Frameworks */,
1FDB0C9B620EC9533D2358F3 /* [CP] Copy Pods Resources */,
E1D6AED972DEFC56AA7DB402 /* [CP] Embed Pods Frameworks */,
541D1D49FBD13BE6BA6DA5BC /* [CP] Copy Pods Resources */,
);
buildRules = (
);
@ -320,7 +320,21 @@
/* End PBXResourcesBuildPhase section */
/* Begin PBXShellScriptBuildPhase section */
1FDB0C9B620EC9533D2358F3 /* [CP] Copy Pods Resources */ = {
3B06AD1E1E4923F5004D2608 /* Thin Binary */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "Thin Binary";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin\n";
};
541D1D49FBD13BE6BA6DA5BC /* [CP] Copy Pods Resources */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
@ -337,21 +351,21 @@
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources.sh\"\n";
showEnvVarsInLog = 0;
};
3B06AD1E1E4923F5004D2608 /* Thin Binary */ = {
9740EEB61CF901F6004384FC /* Run Script */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "Thin Binary";
name = "Run Script";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin\n";
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build";
};
6CEC06A85A1BC01F415967B9 /* [CP] Check Pods Manifest.lock */ = {
A37FFD337A0067237A8DACD6 /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
@ -373,21 +387,7 @@
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
showEnvVarsInLog = 0;
};
9740EEB61CF901F6004384FC /* Run Script */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "Run Script";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build";
};
EB708D648E256F1D924823C6 /* [CP] Embed Pods Frameworks */ = {
E1D6AED972DEFC56AA7DB402 /* [CP] Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
@ -538,7 +538,7 @@
"$(inherited)",
"$(PROJECT_DIR)/Flutter",
);
MARKETING_VERSION = 4.5.56;
MARKETING_VERSION = 4.5.57;
PRODUCT_BUNDLE_IDENTIFIER = "com.HMG.HMG-Smartphone";
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
@ -682,7 +682,7 @@
"$(inherited)",
"$(PROJECT_DIR)/Flutter",
);
MARKETING_VERSION = 4.5.56;
MARKETING_VERSION = 4.5.57;
PRODUCT_BUNDLE_IDENTIFIER = "com.HMG.HMG-Smartphone";
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
@ -720,7 +720,7 @@
"$(inherited)",
"$(PROJECT_DIR)/Flutter",
);
MARKETING_VERSION = 4.5.56;
MARKETING_VERSION = 4.5.57;
PRODUCT_BUNDLE_IDENTIFIER = "com.HMG.HMG-Smartphone";
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";

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

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

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

@ -5,7 +5,7 @@ import 'package:diplomaticquarterapp/core/service/AlHabibMedicalService/customer
import 'package:diplomaticquarterapp/services/pharmacy_services/pharmacyAddress_service.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:geocoding/geocoding.dart';
import 'package:google_maps_place_picker/google_maps_place_picker.dart';
import 'package:google_maps_place_picker_mb/google_maps_place_picker.dart';
import '../../../locator.dart';
import '../base_view_model.dart';

@ -25,7 +25,7 @@ import 'package:flutter/material.dart';
import 'package:geocoding/geocoding.dart';
import 'package:geolocator/geolocator.dart';
import 'package:google_maps_flutter/google_maps_flutter.dart';
import 'package:google_maps_place_picker/google_maps_place_picker.dart';
import 'package:google_maps_place_picker_mb/google_maps_place_picker.dart';
import 'package:huawei_hmsavailability/huawei_hmsavailability.dart';
import 'package:provider/provider.dart';

@ -20,7 +20,7 @@ import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:geolocator/geolocator.dart';
import 'package:google_maps_flutter/google_maps_flutter.dart';
import 'package:google_maps_place_picker/google_maps_place_picker.dart';
import 'package:google_maps_place_picker_mb/google_maps_place_picker.dart';
import 'package:permission_handler/permission_handler.dart';
import 'cmc_location_page.dart';

@ -23,7 +23,7 @@ import 'package:flutter/material.dart';
import 'package:geocoding/geocoding.dart';
import 'package:geolocator/geolocator.dart';
import 'package:google_maps_flutter/google_maps_flutter.dart';
import 'package:google_maps_place_picker/google_maps_place_picker.dart';
import 'package:google_maps_place_picker_mb/google_maps_place_picker.dart';
import 'package:huawei_hmsavailability/huawei_hmsavailability.dart';
import 'package:provider/provider.dart';

@ -12,7 +12,7 @@ import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:google_maps_place_picker/google_maps_place_picker.dart';
import 'package:google_maps_place_picker_mb/google_maps_place_picker.dart';
import 'package:provider/provider.dart';
class NewHomeHealthCareStepOnePage extends StatefulWidget {

@ -9,6 +9,7 @@ import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/HomeHealthCare/
import 'package:diplomaticquarterapp/services/permission/permission_service.dart';
import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/uitl/location_util.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart';
@ -21,7 +22,7 @@ import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:geolocator/geolocator.dart';
import 'package:google_maps_flutter/google_maps_flutter.dart';
import 'package:google_maps_place_picker/google_maps_place_picker.dart';
import 'package:google_maps_place_picker_mb/google_maps_place_picker.dart';
import 'location_page.dart';
@ -53,6 +54,7 @@ class _NewHomeHealthCareStepTowPageState extends State<NewHomeHealthCareStepTowP
);
LatLng currentPostion;
Completer<GoogleMapController> mapController = Completer();
LocationUtils locationUtils;
@override
void initState() {
@ -62,7 +64,6 @@ class _NewHomeHealthCareStepTowPageState extends State<NewHomeHealthCareStepTowP
_updatePosition(camera);
},
onMapCreated: () {
// goToCurrentLocation();
_getUserLocation();
setState(() {});
},
@ -82,31 +83,36 @@ class _NewHomeHealthCareStepTowPageState extends State<NewHomeHealthCareStepTowP
currentPostion = LatLng(lat, long);
setMap();
} else {
if (await PermissionService.isLocationEnabled()) {
Geolocator.getLastKnownPosition().then((value) {
latitude = value.latitude;
longitude = value.longitude;
currentPostion = LatLng(latitude, longitude);
setMap();
});
} else {
if (Platform.isAndroid) {
Utils.showPermissionConsentDialog(context, TranslationBase.of(context).locationPermissionDialog, () {
Geolocator.getLastKnownPosition().then((value) {
latitude = value.latitude;
longitude = value.longitude;
currentPostion = LatLng(latitude, longitude);
setMap();
});
});
} else {
Geolocator.getLastKnownPosition().then((value) {
latitude = value.latitude;
longitude = value.longitude;
setMap();
});
}
}
locationUtils = new LocationUtils(isShowConfirmDialog: true, context: context);
locationUtils.getCurrentLocation(callBack: (value) {
print(value);
setMap();
});
// if (await PermissionService.isLocationEnabled()) {
// Geolocator.getLastKnownPosition().then((value) {
// latitude = value.latitude;
// longitude = value.longitude;
// currentPostion = LatLng(latitude, longitude);
// setMap();
// });
// } else {
// if (Platform.isAndroid) {
// Utils.showPermissionConsentDialog(context, TranslationBase.of(context).locationPermissionDialog, () {
// Geolocator.getLastKnownPosition().then((value) {
// latitude = value.latitude;
// longitude = value.longitude;
// currentPostion = LatLng(latitude, 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(
onTap: () => ancillaryOrdersDetails(model.ancillaryLists[0].ancillaryOrderList[index], model.ancillaryLists[0].projectID),
isInOutPatient: true,
name: TranslationBase.of(context).dr.toString() + " " + (model.ancillaryLists[0].ancillaryOrderList[index].doctorName),
name: TranslationBase.of(context).dr.toString() + " " + (model.ancillaryLists[0].ancillaryOrderList[index].doctorName ?? ""),
billNo: model.ancillaryLists[0].ancillaryOrderList[index].orderNo.toString(),
profileUrl: "https://hmgwebservices.com/Images/MobileImages/DUBAI/unkown.png",
subName: model.ancillaryLists[0].projectName,

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

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

@ -309,6 +309,11 @@ class RRTRequestPickupAddressPageState extends State<RRTRequestPickupAddressPage
}
void _getUserLocation() async {
LocationSettings locationSettings = LocationSettings(
accuracy: LocationAccuracy.low
);
if (await this.sharedPref.getDouble(USER_LAT) != null && await this.sharedPref.getDouble(USER_LONG) != null) {
var lat = await this.sharedPref.getDouble(USER_LAT);
var long = await this.sharedPref.getDouble(USER_LONG);
@ -318,7 +323,7 @@ class RRTRequestPickupAddressPageState extends State<RRTRequestPickupAddressPage
setMap();
} else {
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);
latitude = position.latitude;
longitude = position.longitude;
@ -327,7 +332,7 @@ class RRTRequestPickupAddressPageState extends State<RRTRequestPickupAddressPage
requestPermissions().then(
(value) async {
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);
latitude = position.latitude;
longitude = position.longitude;

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

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

@ -112,6 +112,12 @@ class _LiveCarePendingRequestState extends State<LiveCarePendingRequest> {
// cancelLiveCareRequest();
}),
),
// DefaultButton(
// TranslationBase.of(context).cancel,
// () {
// cancelLiveCareRequest();
// },
// ),
],
),
),
@ -200,30 +206,6 @@ class _LiveCarePendingRequestState extends State<LiveCarePendingRequest> {
// " Patients",
// style: TextStyle(fontSize: 20.0, fontWeight: FontWeight.bold)),
// ),
// Container(
// transform: Matrix4.translationValues(0.0, 110.0, 0.0),
// alignment: Alignment.bottomCenter,
// width: MediaQuery.of(context).size.width,
// child: ButtonTheme(
// shape: RoundedRectangleBorder(
// borderRadius: BorderRadius.circular(10.0),
// ),
// minWidth: MediaQuery.of(context).size.width,
// height: 45.0,
// child: RaisedButton(
// color: Colors.red[800],
// textColor: Colors.white,
// elevation: 0,
// disabledTextColor: Colors.white,
// disabledColor: new Color(0xFFbcc2c4),
// onPressed: () {
// cancelLiveCareRequest();
// },
// child: Text(TranslationBase.of(context).cancel,
// style: TextStyle(fontSize: 18.0)),
// ),
// ),
// ),
// ],
// ),
);

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

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

@ -253,7 +253,7 @@ class DoctorsListService extends BaseService {
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;
var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
Request req = appGlobal.getPublicRequest();
@ -276,6 +276,16 @@ class DoctorsListService extends BaseService {
"DeviceTypeID": 1
};
if (clinicID == 253) {
List<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;
await baseAppClient.post(GET_DOCTOR_FREE_SLOTS, onSuccess: (response, statusCode) async {

@ -28,109 +28,158 @@ class LocalNotification {
}
}
_initialize() {
var initializationSettingsAndroid = new AndroidInitializationSettings('app_icon');
var initializationSettingsIOS = IOSInitializationSettings(onDidReceiveLocalNotification: null);
var initializationSettings = InitializationSettings(android: initializationSettingsAndroid, iOS: initializationSettingsIOS);
flutterLocalNotificationsPlugin.initialize(initializationSettings, onSelectNotification: _onNotificationClick);
}
var _random = new Random();
_initialize() async {
try {
var initializationSettingsAndroid = new AndroidInitializationSettings('app_icon');
var initializationSettingsIOS = DarwinInitializationSettings(onDidReceiveLocalNotification: null);
var initializationSettings = InitializationSettings(android: initializationSettingsAndroid, iOS: initializationSettingsIOS);
await flutterLocalNotificationsPlugin.initialize(
initializationSettings,
onDidReceiveNotificationResponse:
(NotificationResponse notificationResponse) {
switch (notificationResponse.notificationResponseType) {
case NotificationResponseType.selectedNotification:
// selectNotificationStream.add(notificationResponse.payload);
break;
case NotificationResponseType.selectedNotificationAction:
// if (notificationResponse.actionId == navigationActionId) {
// selectNotificationStream.add(notificationResponse.payload);
// }
break;
}
},
onDidReceiveBackgroundNotificationResponse: notificationTapBackground,
);
} catch(ex) {}
// flutterLocalNotificationsPlugin.initialize(initializationSettings, onDidReceiveNotificationResponse: (NotificationResponse notificationResponse)
// {
// switch (notificationResponse.notificationResponseType) {
// case NotificationResponseType.selectedNotification:
// // selectNotificationStream.add(notificationResponse.payload);
// break;
// case NotificationResponseType.selectedNotificationAction:
// // if (notificationResponse.actionId == navigationActionId) {
// // selectNotificationStream.add(notificationResponse.payload);
// }
// // break;
// },}
//
// ,
//
// );
}
_randomNumber({int from = 100000}) {
return _random.nextInt(from);
void notificationTapBackground(NotificationResponse notificationResponse) {
// ignore: avoid_print
print('notification(${notificationResponse.id}) action tapped: '
'${notificationResponse.actionId} with'
' payload: ${notificationResponse.payload}');
if (notificationResponse.input?.isNotEmpty ?? false) {
// ignore: avoid_print
print(
'notification action tapped with input: ${notificationResponse.input}');
}
}
_vibrationPattern() {
var vibrationPattern = Int64List(4);
vibrationPattern[0] = 0;
vibrationPattern[1] = 1000;
vibrationPattern[2] = 5000;
vibrationPattern[3] = 2000;
var _random = new Random();
return vibrationPattern;
}
_randomNumber({int from = 100000}) {
return _random.nextInt(from);
}
Future showNow({@required String title, @required String subtitle, String payload}) {
Future.delayed(Duration(seconds: 1)).then((result) async {
var androidPlatformChannelSpecifics = AndroidNotificationDetails('com.hmg.local_notification', 'HMG',
channelDescription: 'HMG', importance: Importance.max, priority: Priority.high, ticker: 'ticker', vibrationPattern: _vibrationPattern());
var iOSPlatformChannelSpecifics = IOSNotificationDetails();
var platformChannelSpecifics = NotificationDetails(android: androidPlatformChannelSpecifics, iOS: iOSPlatformChannelSpecifics);
await flutterLocalNotificationsPlugin.show(_randomNumber(), title, subtitle, platformChannelSpecifics, payload: payload).catchError((err) {
print(err);
});
});
}
_vibrationPattern() {
var vibrationPattern = Int64List(4);
vibrationPattern[0] = 0;
vibrationPattern[1] = 1000;
vibrationPattern[2] = 5000;
vibrationPattern[3] = 2000;
return vibrationPattern;
}
Future scheduleNotification({@required DateTime scheduledNotificationDateTime, @required String title, @required String description}) async {
///vibrationPattern
var vibrationPattern = Int64List(4);
vibrationPattern[0] = 0;
vibrationPattern[1] = 1000;
vibrationPattern[2] = 5000;
vibrationPattern[3] = 2000;
var androidPlatformChannelSpecifics = AndroidNotificationDetails('active-prescriptions', 'ActivePrescriptions',
channelDescription: 'ActivePrescriptionsDescription',
// icon: 'secondary_icon',
sound: RawResourceAndroidNotificationSound('slow_spring_board'),
///change it to be as ionic
// largeIcon: DrawableResourceAndroidBitmap('sample_large_icon'),///change it to be as ionic
vibrationPattern: vibrationPattern,
enableLights: true,
color: const Color.fromARGB(255, 255, 0, 0),
ledColor: const Color.fromARGB(255, 255, 0, 0),
ledOnMs: 1000,
ledOffMs: 500);
var iOSPlatformChannelSpecifics = IOSNotificationDetails(sound: 'slow_spring_board.aiff');
// /change it to be as ionic
Future showNow({@required String title, @required String subtitle, String payload}) {
Future.delayed(Duration(seconds: 1)).then((result) async {
var androidPlatformChannelSpecifics = AndroidNotificationDetails('com.hmg.local_notification', 'HMG',
channelDescription: 'HMG',
importance: Importance.max,
priority: Priority.high,
ticker: 'ticker',
vibrationPattern: _vibrationPattern());
var iOSPlatformChannelSpecifics = DarwinNotificationDetails();
var platformChannelSpecifics = NotificationDetails(android: androidPlatformChannelSpecifics, iOS: iOSPlatformChannelSpecifics);
await flutterLocalNotificationsPlugin.schedule(0, title, description, scheduledNotificationDateTime, platformChannelSpecifics);
}
await flutterLocalNotificationsPlugin.show(_randomNumber(), title, subtitle, platformChannelSpecifics, payload: payload).catchError((err) {
print(err);
});
});
}
///Repeat notification every day at approximately 10:00:00 am
Future showDailyAtTime() async {
var time = Time(10, 0, 0);
var androidPlatformChannelSpecifics = AndroidNotificationDetails('repeatDailyAtTime channel id', 'repeatDailyAtTime channel name', channelDescription: 'repeatDailyAtTime description');
var iOSPlatformChannelSpecifics = IOSNotificationDetails();
// var platformChannelSpecifics = NotificationDetails(
// androidPlatformChannelSpecifics, iOSPlatformChannelSpecifics);
// await flutterLocalNotificationsPlugin.showDailyAtTime(
// 0,
// 'show daily title',
// 'Daily notification shown at approximately ${_toTwoDigitString(time.hour)}:${_toTwoDigitString(time.minute)}:${_toTwoDigitString(time.second)}',
// time,
// platformChannelSpecifics);
}
Future scheduleNotification({@required DateTime scheduledNotificationDateTime, @required String title, @required String description}) async {
///vibrationPattern
var vibrationPattern = Int64List(4);
vibrationPattern[0] = 0;
vibrationPattern[1] = 1000;
vibrationPattern[2] = 5000;
vibrationPattern[3] = 2000;
var androidPlatformChannelSpecifics = AndroidNotificationDetails('active-prescriptions', 'ActivePrescriptions',
channelDescription: 'ActivePrescriptionsDescription',
// icon: 'secondary_icon',
sound: RawResourceAndroidNotificationSound('slow_spring_board'),
///change it to be as ionic
// largeIcon: DrawableResourceAndroidBitmap('sample_large_icon'),///change it to be as ionic
vibrationPattern: vibrationPattern,
enableLights: true,
color: const Color.fromARGB(255, 255, 0, 0),
ledColor: const Color.fromARGB(255, 255, 0, 0),
ledOnMs: 1000,
ledOffMs: 500);
var iOSPlatformChannelSpecifics = DarwinNotificationDetails(sound: 'slow_spring_board.aiff');
// /change it to be as ionic
var platformChannelSpecifics = NotificationDetails(android: androidPlatformChannelSpecifics, iOS: iOSPlatformChannelSpecifics);
await flutterLocalNotificationsPlugin.schedule(0, title, description, scheduledNotificationDateTime, platformChannelSpecifics);
}
///Repeat notification weekly on Monday at approximately 10:00:00 am
Future showWeeklyAtDayAndTime() async {
var time = Time(10, 0, 0);
var androidPlatformChannelSpecifics = AndroidNotificationDetails('show weekly channel id', 'show weekly channel name', channelDescription: 'show weekly description');
var iOSPlatformChannelSpecifics = IOSNotificationDetails();
// var platformChannelSpecifics = NotificationDetails(
// androidPlatformChannelSpecifics, iOSPlatformChannelSpecifics);
// await flutterLocalNotificationsPlugin.showWeeklyAtDayAndTime(
// 0,
// 'show weekly title',
// 'Weekly notification shown on Monday at approximately ${_toTwoDigitString(time.hour)}:${_toTwoDigitString(time.minute)}:${_toTwoDigitString(time.second)}',
// Day.Monday,
// time,
// platformChannelSpecifics);
}
///Repeat notification every day at approximately 10:00:00 am
Future showDailyAtTime() async {
var time = Time(10, 0, 0);
var androidPlatformChannelSpecifics = AndroidNotificationDetails('repeatDailyAtTime channel id', 'repeatDailyAtTime channel name', channelDescription: 'repeatDailyAtTime description');
var iOSPlatformChannelSpecifics = DarwinNotificationDetails();
// var platformChannelSpecifics = NotificationDetails(
// androidPlatformChannelSpecifics, iOSPlatformChannelSpecifics);
// await flutterLocalNotificationsPlugin.showDailyAtTime(
// 0,
// 'show daily title',
// 'Daily notification shown at approximately ${_toTwoDigitString(time.hour)}:${_toTwoDigitString(time.minute)}:${_toTwoDigitString(time.second)}',
// time,
// platformChannelSpecifics);
}
String _toTwoDigitString(int value) {
return value.toString().padLeft(2, '0');
}
///Repeat notification weekly on Monday at approximately 10:00:00 am
Future showWeeklyAtDayAndTime() async {
var time = Time(10, 0, 0);
var androidPlatformChannelSpecifics = AndroidNotificationDetails('show weekly channel id', 'show weekly channel name', channelDescription: 'show weekly description');
var iOSPlatformChannelSpecifics = DarwinNotificationDetails();
// var platformChannelSpecifics = NotificationDetails(
// androidPlatformChannelSpecifics, iOSPlatformChannelSpecifics);
// await flutterLocalNotificationsPlugin.showWeeklyAtDayAndTime(
// 0,
// 'show weekly title',
// 'Weekly notification shown on Monday at approximately ${_toTwoDigitString(time.hour)}:${_toTwoDigitString(time.minute)}:${_toTwoDigitString(time.second)}',
// Day.Monday,
// time,
// platformChannelSpecifics);
}
Future cancelNotification() async {
await flutterLocalNotificationsPlugin.cancel(0);
}
String _toTwoDigitString(int value) {
return value.toString().padLeft(2, '0');
}
Future cancelAllNotifications() async {
await flutterLocalNotificationsPlugin.cancelAll();
}
Future cancelNotification() async {
await flutterLocalNotificationsPlugin.cancel(0);
}
Future cancelAllNotifications() async {
await flutterLocalNotificationsPlugin.cancelAll();
}}

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

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

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

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

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

@ -13,7 +13,7 @@ import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:geocoding/geocoding.dart';
import 'package:google_maps_flutter/google_maps_flutter.dart';
import 'package:google_maps_place_picker/google_maps_place_picker.dart';
import 'package:google_maps_place_picker_mb/google_maps_place_picker.dart';
import 'package:huawei_hmsavailability/huawei_hmsavailability.dart';
import 'package:provider/provider.dart';

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

Loading…
Cancel
Save