diff --git a/android/.gitignore b/android/.gitignore deleted file mode 100644 index be3943c..0000000 --- a/android/.gitignore +++ /dev/null @@ -1,14 +0,0 @@ -gradle-wrapper.jar -/.gradle -/captures/ -/gradlew -/gradlew.bat -/local.properties -GeneratedPluginRegistrant.java -.cxx/ - -# Remember to never publicly share your keystore. -# See https://flutter.dev/to/reference-keystore -key.properties -**/*.keystore -**/*.jks diff --git a/android/app/agconnect-services.json b/android/app/agconnect-services.json deleted file mode 100644 index 91aad2c..0000000 --- a/android/app/agconnect-services.json +++ /dev/null @@ -1,74 +0,0 @@ -{ - "agcgw":{ - "backurl":"connect-drcn.hispace.hicloud.com", - "url":"connect-drcn.dbankcloud.cn", - "websocketbackurl":"connect-ws-drcn.hispace.dbankcloud.com", - "websocketurl":"connect-ws-drcn.hispace.dbankcloud.cn" - }, - "agcgw_all":{ - "CN":"connect-drcn.dbankcloud.cn", - "CN_back":"connect-drcn.hispace.hicloud.com", - "DE":"connect-dre.dbankcloud.cn", - "DE_back":"connect-dre.hispace.hicloud.com", - "RU":"connect-drru.dbankcloud.cn", - "RU_back":"connect-drru.hispace.hicloud.com", - "SG":"connect-dra.dbankcloud.cn", - "SG_back":"connect-dra.hispace.hicloud.com" - }, - "client":{ - "cp_id":"2640966000002322881", - "product_id":"736430079244816567", - "client_id":"563735388191982656", - "client_secret":"650C7C799812AFFD53A10C7756CF05FB9F215A7E49032ABA8EBF3E14B77535CF", - "project_id":"736430079244816567", - "app_id":"102857389", - "api_key":"CgB6e3x9DJzMgRCmnT6dyUEkp6UsIfddb6l3w0ZEXzeiRMHEFi3400Z5fJ5qaHneU0OrAI/JRpk+DMGVs3QpUxlI", - "package_name":"com.ejada.hmg" - }, - "oauth_client":{ - "client_id":"102857389", - "client_type":1 - }, - "app_info":{ - "app_id":"102857389", - "package_name":"com.ejada.hmg" - }, - "service":{ - "analytics":{ - "collector_url":"datacollector-drcn.dt.hicloud.com,datacollector-drcn.dt.dbankcloud.cn", - "collector_url_ru":"datacollector-drru.dt.hicloud.com,datacollector-drru.dt.dbankcloud.cn", - "collector_url_sg":"datacollector-dra.dt.hicloud.com,datacollector-dra.dt.dbankcloud.cn", - "collector_url_de":"datacollector-dre.dt.hicloud.com,datacollector-dre.dt.dbankcloud.cn", - "collector_url_cn":"datacollector-drcn.dt.hicloud.com,datacollector-drcn.dt.dbankcloud.cn", - "resource_id":"p1", - "channel_id":"" - }, - "search":{ - "url":"https://search-drcn.cloud.huawei.com" - }, - "cloudstorage":{ - "storage_url":"https://agc-storage-drcn.platform.dbankcloud.cn" - }, - "ml":{ - "mlservice_url":"ml-api-drcn.ai.dbankcloud.com,ml-api-drcn.ai.dbankcloud.cn" - } - }, - "region":"CN", - "configuration_version":"3.0", - "appInfos":[ - { - "package_name":"com.ejada.hmg", - "client":{ - "app_id":"102857389" - }, - "app_info":{ - "package_name":"com.ejada.hmg", - "app_id":"102857389" - }, - "oauth_client":{ - "client_type":1, - "client_id":"102857389" - } - } - ] -} diff --git a/android/app/build.gradle.kts b/android/app/build.gradle.kts deleted file mode 100644 index 226d4dd..0000000 --- a/android/app/build.gradle.kts +++ /dev/null @@ -1,188 +0,0 @@ -import java.util.Properties -import java.io.FileInputStream - -plugins { - id("com.android.application") - id("kotlin-android") - id("com.google.gms.google-services") version "4.4.1" // Add the version here - id("dev.flutter.flutter-gradle-plugin") - id("com.huawei.agconnect") - // id("com.mapbox.gradle.application") - // id("com.mapbox.gradle.plugins.ndk") -} - -val keystoreProperties = Properties() -val keystorePropertiesFile = rootProject.file("key.properties") -if (keystorePropertiesFile.exists()) { - keystoreProperties.load(FileInputStream(keystorePropertiesFile)) -} - -android { - namespace = "com.ejada.hmg" - compileSdk = 36 - ndkVersion = "28.2.13676358" - - defaultConfig { - applicationId = "com.ejada.hmg" - // minSdk = 24 - minSdk = 26 - targetSdk = 35 - compileSdk = 35 - // targetSdk = flutter.targetSdkVersion - versionCode = flutter.versionCode - versionName = flutter.versionName - multiDexEnabled = true - } - - buildFeatures { - viewBinding = true - dataBinding = true - } - - sourceSets { -// getByName("main") { -// java.srcDirs += "src/main/kotlin" -// jniLibs.srcDir("src/main/libs") -// jni.srcDirs = listOf() // disables automatic ndk-build -// } - getByName("main") { - java.srcDir("src/main/kotlin") - jniLibs.srcDir("src/main/libs") - // To disable automatic ndk-build, do not set jni.srcDirs - // If you need to clear jni.srcDirs: - // set("jni.srcDirs", emptyList()) - } - } - - signingConfigs { - create("release") { - keyAlias = keystoreProperties.getProperty("keyAlias") - keyPassword = keystoreProperties.getProperty("keyPassword") - storeFile = keystoreProperties.getProperty("storeFile")?.let { file(it) } - storePassword = keystoreProperties.getProperty("storePassword") - } - } - - buildTypes { - getByName("debug") { - isDebuggable = true - signingConfig = signingConfigs.getByName("debug") - isMinifyEnabled = false - isShrinkResources = false - } - getByName("release") { - isDebuggable = false - signingConfig = signingConfigs.getByName("release") - isMinifyEnabled = true - isShrinkResources = true - proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro") - } - create("staging") { - matchingFallbacks += listOf("debug", "qa", "release") - } - } - - packagingOptions { - jniLibs { - pickFirsts += listOf( - "lib/x86/libc++_shared.so", - "lib/x86_64/libc++_shared.so", - "lib/armeabi-v7a/libc++_shared.so", - "lib/arm64-v8a/libc++_shared.so", - "**/*.so" - ) - useLegacyPackaging = true - } - resources { - excludes += listOf("META-INF/proguard/androidx-annotations.pro") - } - } - - compileOptions { - sourceCompatibility = JavaVersion.VERSION_21 - targetCompatibility = JavaVersion.VERSION_21 - isCoreLibraryDesugaringEnabled = true - } - - // kotlinOptions { - // jvmTarget = "17" - // } - - lint { - disable += "MissingTranslation" - checkReleaseBuilds = false - } -} - -flutter { - source = "../.." -} - -dependencies { - implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8:2.1.20") - implementation("com.google.firebase:firebase-messaging:24.1.2") - implementation("pub.devrel:easypermissions:3.0.0") - implementation("com.google.guava:guava:33.4.0-android") - implementation(fileTree(mapOf("dir" to "libs", "include" to listOf("*.jar"), "exclude" to listOf("bcprov-jdk16-1.46.jar")))) - implementation("com.google.code.gson:gson:2.12.0") - - // Zoom SDKs - implementation("us.zoom.videosdk:zoomvideosdk-core:1.12.10") - implementation("us.zoom.videosdk:zoomvideosdk-annotation:1.12.10") - implementation("us.zoom.videosdk:zoomvideosdk-videoeffects:1.12.10") - - // Networking - implementation("com.squareup.okhttp3:logging-interceptor:5.0.0-alpha.11") - implementation("com.squareup.okhttp3:okhttp:5.0.0-alpha.11") - implementation("com.squareup.retrofit2:retrofit:2.11.0") - implementation("com.squareup.retrofit2:converter-gson:2.11.0") - implementation("com.squareup.retrofit2:adapter-java8:2.11.0") - - // Google Services - implementation("com.google.android.gms:play-services-location:21.3.0") - implementation("com.google.android.gms:play-services-basement:18.7.0") - - implementation("com.android.volley:volley:1.2.1") - implementation("androidx.constraintlayout:constraintlayout:2.2.1") - implementation("androidx.navigation:navigation-fragment-ktx:2.9.0") - implementation("androidx.navigation:navigation-ui-ktx:2.9.0") - implementation("androidx.activity:activity-ktx:1.10.1") - -// val room_version = "2.6.1" -// implementation("androidx.room:room-runtime:$room_version") -// annotationProcessor("androidx.room:room-compiler:$room_version") - - implementation("net.zetetic:android-database-sqlcipher:4.5.4") - implementation("com.intuit.ssp:ssp-android:1.1.0") - implementation("com.intuit.sdp:sdp-android:1.1.0") - -// implementation("com.github.bumptech.glide:glide:4.16.0") -// annotationProcessor("com.github.bumptech.glide:compiler:4.16.0") - - implementation("com.mapbox.maps:android:11.5.0") - // implementation("com.mapbox.maps:android:11.4.0") - - // AARs -// implementation(files("libs/PenNavUI.aar")) -// implementation(files("libs/Penguin.aar")) -// implementation(files("libs/PenguinRenderer.aar")) - - implementation("com.github.kittinunf.fuel:fuel:2.3.1") - implementation("com.github.kittinunf.fuel:fuel-android:2.3.1") - -// implementation("com.opentok.android:opentok-android-sdk:2.25.2") - -// implementation("com.facebook.stetho:stetho:1.6.0") -// implementation("com.facebook.stetho:stetho-urlconnection:1.6.0") - - implementation("androidx.core:core-ktx:1.16.0") - implementation("androidx.appcompat:appcompat:1.7.1") - implementation("com.google.android.material:material:1.12.0") - - implementation("pl.droidsonroids.gif:android-gif-drawable:1.2.25") - - androidTestImplementation("androidx.test:core:1.6.1") - implementation("com.whatsapp.otp:whatsapp-otp-android-sdk:0.1.0") - coreLibraryDesugaring("com.android.tools:desugar_jdk_libs:2.1.5") - // implementation(project(":vitalSignEngine")) -} \ No newline at end of file diff --git a/android/app/google-services.json b/android/app/google-services.json deleted file mode 100644 index 3707617..0000000 --- a/android/app/google-services.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "project_info": { - "project_number": "815750722565", - "firebase_url": "https://api-project-815750722565.firebaseio.com", - "project_id": "api-project-815750722565", - "storage_bucket": "api-project-815750722565.appspot.com" - }, - "client": [ - { - "client_info": { - "mobilesdk_app_id": "1:815750722565:android:62281cd3e5df4063", - "android_client_info": { - "package_name": "com.ejada.hmg" - } - }, - "oauth_client": [ - { - "client_id": "815750722565-3a0gc7neins0eoahdrimrfksk0sqice8.apps.googleusercontent.com", - "client_type": 3 - } - ], - "api_key": [ - { - "current_key": "AIzaSyDZDeWcBlRE3YfJWYt_DCiToVnANfaj8qg" - } - ], - "services": { - "appinvite_service": { - "other_platform_oauth_client": [ - { - "client_id": "815750722565-3a0gc7neins0eoahdrimrfksk0sqice8.apps.googleusercontent.com", - "client_type": 3 - }, - { - "client_id": "815750722565-0cq9366orvsk5ipivq6lijcj56u03fr7.apps.googleusercontent.com", - "client_type": 2, - "ios_info": { - "bundle_id": "com.void.demo" - } - } - ] - } - } - } - ], - "configuration_version": "1" -} \ No newline at end of file diff --git a/android/app/key b/android/app/key deleted file mode 100644 index 15b9f5d..0000000 Binary files a/android/app/key and /dev/null differ diff --git a/android/app/keystores/keystore b/android/app/keystores/keystore deleted file mode 100644 index e69de29..0000000 diff --git a/android/app/libs/PenNavUI.aar b/android/app/libs/PenNavUI.aar deleted file mode 100644 index d423bc1..0000000 Binary files a/android/app/libs/PenNavUI.aar and /dev/null differ diff --git a/android/app/libs/Penguin.aar b/android/app/libs/Penguin.aar deleted file mode 100644 index 5c789c6..0000000 Binary files a/android/app/libs/Penguin.aar and /dev/null differ diff --git a/android/app/libs/PenguinRenderer.aar b/android/app/libs/PenguinRenderer.aar deleted file mode 100644 index b657ac6..0000000 Binary files a/android/app/libs/PenguinRenderer.aar and /dev/null differ diff --git a/android/app/proguard-rules.pro b/android/app/proguard-rules.pro deleted file mode 100644 index 9c1827a..0000000 --- a/android/app/proguard-rules.pro +++ /dev/null @@ -1,75 +0,0 @@ --keep class tvi.webrtc.** { *; } --keep class com.twilio.video.** { *; } --keep class com.twilio.common.** { *; } --keepattributes InnerClasses - --keep class com.ejada.** { *; } --keep class org.webrtc.** { *; } - --keep class com.builttoroam.devicecalendar.** { *; } - --ignorewarnings --keepattributes *Annotation* --keepattributes Exceptions --keepattributes InnerClasses --keepattributes Signature --keep class com.hianalytics.android.**{*;} --keep class com.huawei.updatesdk.**{*;} --keep class com.huawei.hms.**{*;} - -## Flutter wrapper --keep class io.flutter.app.** { *; } --keep class io.flutter.plugin.** { *; } --keep class io.flutter.util.** { *; } --keep class io.flutter.view.** { *; } --keep class io.flutter.** { *; } --keep class io.flutter.plugins.** { *; } --dontwarn io.flutter.embedding.** --keep class com.huawei.hms.flutter.** { *; } --repackageclasses - -## Flutter WebRTC --keep class com.cloudwebrtc.webrtc.** { *; } --keep class org.webrtc.** { *; } - -## Flutter OpenTok --keep class com.opentok.android.** { *; } --keep class com.opentok.otc.** { *; } --keep class org.otwebrtc.** { *; } - - -##Flutter Zoom --keep class us.zoom**{ - *; -} --keep interface us.zoom**{ - *; -} --keep class org.webrtc**{ - *; -} --keep class com.zipow**{ - *; -} - --dontwarn com.opentok.android.** --dontwarn com.opentok.otc.** - --dontwarn penguin.com.pennav.Model.Navigation.NearLandmark - --keep,includedescriptorclasses class net.sqlcipher.** { *; } --keep,includedescriptorclasses interface net.sqlcipher.** { *; } - --keep class retrofit2.** { *; } --keep class okhttp3.** { *; } --dontwarn retrofit2.** - --keep class com.google.gson.** { *; } --dontwarn com.google.gson.** - -# Penguin classes --keep class com.peng.pennavmap.models.** { *; } --keep class com.peng.pennavmap.db.** { *; } - --keep class com.hiennv.flutter_callkit_incoming.** { *; } --keepattributes Signature, Annotation, InnerClasses, EnclosingMethod \ No newline at end of file diff --git a/android/app/src/debug/AndroidManifest.xml b/android/app/src/debug/AndroidManifest.xml deleted file mode 100644 index 399f698..0000000 --- a/android/app/src/debug/AndroidManifest.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml deleted file mode 100644 index 4f7ef74..0000000 --- a/android/app/src/main/AndroidManifest.xml +++ /dev/null @@ -1,264 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/android/app/src/main/kotlin/com/ejada/hmg/Application.kt b/android/app/src/main/kotlin/com/ejada/hmg/Application.kt deleted file mode 100644 index 32eb97c..0000000 --- a/android/app/src/main/kotlin/com/ejada/hmg/Application.kt +++ /dev/null @@ -1,27 +0,0 @@ -//package com.cloud.diplomaticquarterapp -package com.ejada.hmg - - -import io.flutter.app.FlutterApplication - -class Application : FlutterApplication() { - override fun onCreate() { - super.onCreate() - } -} - -//import io.flutter.app.FlutterApplication -//import io.flutter.plugin.common.PluginRegistry -//import io.flutter.plugin.common.PluginRegistry.PluginRegistrantCallback -//import io.flutter.plugins.firebasemessaging.FlutterFirebaseMessagingService -// -//class Application : FlutterApplication(), PluginRegistrantCallback { -// override fun onCreate() { -// super.onCreate() -// FlutterFirebaseMessagingService.setPluginRegistrant(this) -// } -// -// override fun registerWith(registry: PluginRegistry?) { -// FirebaseCloudMessagingPluginRegistrant.registerWith(registry) -// } -//} \ No newline at end of file diff --git a/android/app/src/main/kotlin/com/ejada/hmg/MainActivity.kt b/android/app/src/main/kotlin/com/ejada/hmg/MainActivity.kt deleted file mode 100644 index 6170727..0000000 --- a/android/app/src/main/kotlin/com/ejada/hmg/MainActivity.kt +++ /dev/null @@ -1,6 +0,0 @@ -package com.ejada.hmg - -import io.flutter.embedding.android.FlutterFragmentActivity - - -class MainActivity : FlutterFragmentActivity() diff --git a/android/app/src/main/kotlin/com/ejada/hmg/live_activity/CustomActiviy.kt b/android/app/src/main/kotlin/com/ejada/hmg/live_activity/CustomActiviy.kt new file mode 100644 index 0000000..9919fed --- /dev/null +++ b/android/app/src/main/kotlin/com/ejada/hmg/live_activity/CustomActiviy.kt @@ -0,0 +1,95 @@ +package com.ejada.hmg.live_activity + +import android.app.Notification +import android.app.NotificationChannel +import android.app.NotificationManager +import android.app.PendingIntent +import android.content.Context +import android.content. Intent +import android.os.Build +import android.util.Log +import android.widget.RemoteViews +import androidx.annotation.RequiresApi +import androidx.core.app.NotificationCompat +import androidx.core.content.ContextCompat +import androidx.core.graphics.drawable.IconCompat +import com. example.live_activities.LiveActivityManager +import com.ejada. hmg.MainActivity +import com. ejada.hmg.R + +class CustomLiveActivityManager(context: Context) : + LiveActivityManager(context) { + private val context: Context = context.applicationContext + + private val pendingIntent = PendingIntent.getActivity( + context, 200, Intent(context, MainActivity::class.java).apply { + flags = Intent.FLAG_ACTIVITY_REORDER_TO_FRONT + }, PendingIntent.FLAG_UPDATE_CURRENT or PendingIntent.FLAG_IMMUTABLE + ) + + private val remoteViews = RemoteViews( + context. packageName, R.layout.live_activity + ) + + private val collapesView = RemoteViews( + context.packageName, R.layout.live_activity_collapsed + ) + + private suspend fun updateRemoteViews(data: Map) { + val (background, textColor, containerBackground) = when (data["nextStepBackground"] as? Int) { + 0 -> Triple(R. drawable.grey_rounded_corner_widget, R.color.text_color, R.drawable.whitebg_yellow_border_rounded_corner_widget) + 1 -> Triple(R.drawable.dark_red_rounded_corner_widget, R.color.colorWhite, R.drawable.whitebg_red_border_rounded_corner_widget) + 2 -> Triple(R.drawable.green_rounded_corner_widget, R. color.colorWhite, R. drawable.whitebg_green_border_rounded_corner_widget) + else -> Triple(R. drawable.grey_rounded_corner_widget, R.color.text_color, R.drawable.whitebg_yellow_border_rounded_corner_widget) + } + + remoteViews.setInt(R.id.nextStep, "setBackgroundResource", background) + remoteViews.setInt(R.id.container, "setBackgroundResource", containerBackground) + remoteViews.setTextColor(R.id.nextStep, ContextCompat.getColor(context, textColor)) + remoteViews.setTextViewText(R.id.countvalue, data["currentTicket"] as? String ?: "") + remoteViews.setTextViewText(R.id.status, data["status"] as? String ?: "") + remoteViews.setTextViewText(R. id.currentlyserving, data["currentlyServing"] as? String ?: "") + remoteViews.setTextViewText(R.id.nextStep, data["nextStep"] as? String ?: "") + } + + private suspend fun updateCollapsedView(data: Map) { + Log.d("updateCollapsedView", "current ticket is ${data["currentTicket"] as? String ?: ""}") + + val containerBackground = when (data["nextStepBackground"] as? Int) { + 0 -> R.drawable.whitebg_yellow_border_rounded_corner_widget + 1 -> R. drawable.whitebg_red_border_rounded_corner_widget + 2 -> R.drawable. whitebg_green_border_rounded_corner_widget + else -> R.drawable.whitebg_yellow_border_rounded_corner_widget + } + collapesView.setInt(R.id.container, "setBackgroundResource", containerBackground) + collapesView.setTextViewText(R.id.countvalue_collapsed, data["currentTicket"] as? String ?: "") + } + + override suspend fun buildNotification( + notification: Notification.Builder, + event: String, + data: Map + ): Notification { + collapesView.apply { + updateCollapsedView(data) + } + remoteViews.apply { + updateRemoteViews(data) + } + + return notification + .setSmallIcon(R.drawable.hmg) + .setContentTitle(data["title"] as? String ?: "Patient Queue") + .setContentIntent(pendingIntent) + .setContentText(data["content"] as? String ?: "Patient Queue") + .setStyle(Notification.DecoratedCustomViewStyle()) + .setCustomContentView(collapesView) + .setCustomBigContentView(remoteViews) + .setAutoCancel(false) + .setOngoing(true) + .setPriority(Notification.PRIORITY_LOW) + .setCategory(Notification.CATEGORY_EVENT) + .setVisibility(Notification.VISIBILITY_PUBLIC) + .build() + } +} \ No newline at end of file diff --git a/android/app/src/main/res/drawable-v21/launch_background.xml b/android/app/src/main/res/drawable-v21/launch_background.xml deleted file mode 100644 index f74085f..0000000 --- a/android/app/src/main/res/drawable-v21/launch_background.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - diff --git a/android/app/src/main/res/drawable/app_icon.png b/android/app/src/main/res/drawable/app_icon.png deleted file mode 100755 index 2d394f8..0000000 Binary files a/android/app/src/main/res/drawable/app_icon.png and /dev/null differ diff --git a/android/app/src/main/res/drawable/dark_red_rounded_corner_widget.xml b/android/app/src/main/res/drawable/dark_red_rounded_corner_widget.xml new file mode 100644 index 0000000..7f6098a --- /dev/null +++ b/android/app/src/main/res/drawable/dark_red_rounded_corner_widget.xml @@ -0,0 +1,11 @@ + + + + + + + + + + \ No newline at end of file diff --git a/android/app/src/main/res/drawable/food.png b/android/app/src/main/res/drawable/food.png deleted file mode 100644 index 41b394d..0000000 Binary files a/android/app/src/main/res/drawable/food.png and /dev/null differ diff --git a/android/app/src/main/res/drawable/green_rounded_corner_widget.xml b/android/app/src/main/res/drawable/green_rounded_corner_widget.xml new file mode 100644 index 0000000..79e7f56 --- /dev/null +++ b/android/app/src/main/res/drawable/green_rounded_corner_widget.xml @@ -0,0 +1,11 @@ + + + + + + + + + + \ No newline at end of file diff --git a/android/app/src/main/res/drawable/grey_rounded_corner_widget.xml b/android/app/src/main/res/drawable/grey_rounded_corner_widget.xml new file mode 100644 index 0000000..eda8779 --- /dev/null +++ b/android/app/src/main/res/drawable/grey_rounded_corner_widget.xml @@ -0,0 +1,11 @@ + + + + + + + + + + \ No newline at end of file diff --git a/android/app/src/main/res/drawable/hmc.xml b/android/app/src/main/res/drawable/hmc.xml new file mode 100644 index 0000000..5dffd39 --- /dev/null +++ b/android/app/src/main/res/drawable/hmc.xml @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/android/app/src/main/res/drawable/hmg.xml b/android/app/src/main/res/drawable/hmg.xml new file mode 100644 index 0000000..ba3a4b2 --- /dev/null +++ b/android/app/src/main/res/drawable/hmg.xml @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/android/app/src/main/res/drawable/ic_notification.png b/android/app/src/main/res/drawable/ic_notification.png new file mode 100644 index 0000000..e4a0815 Binary files /dev/null and b/android/app/src/main/res/drawable/ic_notification.png differ diff --git a/android/app/src/main/res/drawable/launch_background.xml b/android/app/src/main/res/drawable/launch_background.xml deleted file mode 100644 index 304732f..0000000 --- a/android/app/src/main/res/drawable/launch_background.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - diff --git a/android/app/src/main/res/drawable/me.png b/android/app/src/main/res/drawable/me.png deleted file mode 100644 index ba75bc5..0000000 Binary files a/android/app/src/main/res/drawable/me.png and /dev/null differ diff --git a/android/app/src/main/res/drawable/red_rounded_corner_widget.xml b/android/app/src/main/res/drawable/red_rounded_corner_widget.xml new file mode 100644 index 0000000..5e1395a --- /dev/null +++ b/android/app/src/main/res/drawable/red_rounded_corner_widget.xml @@ -0,0 +1,11 @@ + + + + + + + + + + \ No newline at end of file diff --git a/android/app/src/main/res/drawable/sample_large_icon.png b/android/app/src/main/res/drawable/sample_large_icon.png deleted file mode 100644 index f354ca2..0000000 Binary files a/android/app/src/main/res/drawable/sample_large_icon.png and /dev/null differ diff --git a/android/app/src/main/res/drawable/secondary_icon.png b/android/app/src/main/res/drawable/secondary_icon.png deleted file mode 100644 index 9de9ff4..0000000 Binary files a/android/app/src/main/res/drawable/secondary_icon.png and /dev/null differ diff --git a/android/app/src/main/res/drawable/whitebg_green_border_rounded_corner_widget.xml b/android/app/src/main/res/drawable/whitebg_green_border_rounded_corner_widget.xml new file mode 100644 index 0000000..d75af99 --- /dev/null +++ b/android/app/src/main/res/drawable/whitebg_green_border_rounded_corner_widget.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/android/app/src/main/res/drawable/whitebg_red_border_rounded_corner_widget.xml b/android/app/src/main/res/drawable/whitebg_red_border_rounded_corner_widget.xml new file mode 100644 index 0000000..246c961 --- /dev/null +++ b/android/app/src/main/res/drawable/whitebg_red_border_rounded_corner_widget.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/android/app/src/main/res/drawable/whitebg_yellow_border_rounded_corner_widget.xml b/android/app/src/main/res/drawable/whitebg_yellow_border_rounded_corner_widget.xml new file mode 100644 index 0000000..92e8144 --- /dev/null +++ b/android/app/src/main/res/drawable/whitebg_yellow_border_rounded_corner_widget.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/android/app/src/main/res/font/poppins_medium.ttf b/android/app/src/main/res/font/poppins_medium.ttf new file mode 100644 index 0000000..e90e87e Binary files /dev/null and b/android/app/src/main/res/font/poppins_medium.ttf differ diff --git a/android/app/src/main/res/layout/activity_whats_app_code.xml b/android/app/src/main/res/layout/activity_whats_app_code.xml deleted file mode 100644 index 3cd824c..0000000 --- a/android/app/src/main/res/layout/activity_whats_app_code.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - \ No newline at end of file diff --git a/android/app/src/main/res/layout/live_activity.xml b/android/app/src/main/res/layout/live_activity.xml new file mode 100644 index 0000000..fb92989 --- /dev/null +++ b/android/app/src/main/res/layout/live_activity.xml @@ -0,0 +1,116 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/android/app/src/main/res/layout/live_activity_collapsed.xml b/android/app/src/main/res/layout/live_activity_collapsed.xml new file mode 100644 index 0000000..188b63f --- /dev/null +++ b/android/app/src/main/res/layout/live_activity_collapsed.xml @@ -0,0 +1,32 @@ + + + + + + + + + diff --git a/android/app/src/main/res/layout/local_video.xml b/android/app/src/main/res/layout/local_video.xml deleted file mode 100644 index f47c48c..0000000 --- a/android/app/src/main/res/layout/local_video.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - \ No newline at end of file diff --git a/android/app/src/main/res/layout/remote_video.xml b/android/app/src/main/res/layout/remote_video.xml deleted file mode 100644 index cfdbeb0..0000000 --- a/android/app/src/main/res/layout/remote_video.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/android/app/src/main/res/mipmap-hdpi/ic_launcher.png b/android/app/src/main/res/mipmap-hdpi/ic_launcher.png deleted file mode 100644 index db77bb4..0000000 Binary files a/android/app/src/main/res/mipmap-hdpi/ic_launcher.png and /dev/null differ diff --git a/android/app/src/main/res/mipmap-hdpi/ic_launcher_local.png b/android/app/src/main/res/mipmap-hdpi/ic_launcher_local.png deleted file mode 100644 index 348b511..0000000 Binary files a/android/app/src/main/res/mipmap-hdpi/ic_launcher_local.png and /dev/null differ diff --git a/android/app/src/main/res/mipmap-mdpi/ic_launcher.png b/android/app/src/main/res/mipmap-mdpi/ic_launcher.png deleted file mode 100644 index 17987b7..0000000 Binary files a/android/app/src/main/res/mipmap-mdpi/ic_launcher.png and /dev/null differ diff --git a/android/app/src/main/res/mipmap-mdpi/ic_launcher_local.png b/android/app/src/main/res/mipmap-mdpi/ic_launcher_local.png deleted file mode 100644 index 410b1b1..0000000 Binary files a/android/app/src/main/res/mipmap-mdpi/ic_launcher_local.png and /dev/null differ diff --git a/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png deleted file mode 100644 index 09d4391..0000000 Binary files a/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png and /dev/null differ diff --git a/android/app/src/main/res/mipmap-xhdpi/ic_launcher_local.png b/android/app/src/main/res/mipmap-xhdpi/ic_launcher_local.png deleted file mode 100644 index bb9943a..0000000 Binary files a/android/app/src/main/res/mipmap-xhdpi/ic_launcher_local.png and /dev/null differ diff --git a/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png deleted file mode 100644 index d5f1c8d..0000000 Binary files a/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png and /dev/null differ diff --git a/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_local.png b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_local.png deleted file mode 100644 index 0b9d935..0000000 Binary files a/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_local.png and /dev/null differ diff --git a/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png deleted file mode 100644 index 4d6372e..0000000 Binary files a/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png and /dev/null differ diff --git a/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_local.png b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_local.png deleted file mode 100644 index aaa9808..0000000 Binary files a/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_local.png and /dev/null differ diff --git a/android/app/src/main/res/raw/keep.xml b/android/app/src/main/res/raw/keep.xml deleted file mode 100644 index 944a7ac..0000000 --- a/android/app/src/main/res/raw/keep.xml +++ /dev/null @@ -1,3 +0,0 @@ - - \ No newline at end of file diff --git a/android/app/src/main/res/raw/slow_spring_board.mp3 b/android/app/src/main/res/raw/slow_spring_board.mp3 deleted file mode 100644 index 60dbf97..0000000 Binary files a/android/app/src/main/res/raw/slow_spring_board.mp3 and /dev/null differ diff --git a/android/app/src/main/res/values-night/styles.xml b/android/app/src/main/res/values-night/styles.xml deleted file mode 100644 index 06952be..0000000 --- a/android/app/src/main/res/values-night/styles.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - diff --git a/android/app/src/main/res/values/colors.xml b/android/app/src/main/res/values/colors.xml new file mode 100644 index 0000000..474cff4 --- /dev/null +++ b/android/app/src/main/res/values/colors.xml @@ -0,0 +1,9 @@ + + + #ED1C2B + #FFAF15 + #18C273 + #332E3039 + #A2A2A2 + #FFFF + \ No newline at end of file diff --git a/android/app/src/main/res/values/mapbox_access_token.xml b/android/app/src/main/res/values/mapbox_access_token.xml deleted file mode 100644 index f1daf69..0000000 --- a/android/app/src/main/res/values/mapbox_access_token.xml +++ /dev/null @@ -1,3 +0,0 @@ - - sk.eyJ1IjoicndhaWQiLCJhIjoiY2x6NWo0bTMzMWZodzJrcGZpemYzc3Z4dSJ9.uSSZuwNSGCcCdPAiORECmg - \ No newline at end of file diff --git a/android/app/src/main/res/values/strings.xml b/android/app/src/main/res/values/strings.xml deleted file mode 100644 index 6c4ac3d..0000000 --- a/android/app/src/main/res/values/strings.xml +++ /dev/null @@ -1,23 +0,0 @@ - - HMG Patient App - - - Unknown error: the Geofence service is not available now. - - - Geofence service is not available now. Go to Settings>Location>Mode and choose High accuracy. - - - Your app has registered too many geofences. - - - You have provided too many PendingIntents to the addGeofences() call. - - - App do not have permission to access location service. - - - Geofence requests happened too frequently. - - sk.eyJ1IjoicndhaWQiLCJhIjoiY2x6NWo0bTMzMWZodzJrcGZpemYzc3Z4dSJ9.uSSZuwNSGCcCdPAiORECmg - diff --git a/android/app/src/main/res/values/styles.xml b/android/app/src/main/res/values/styles.xml deleted file mode 100644 index 1f83a33..0000000 --- a/android/app/src/main/res/values/styles.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - diff --git a/android/app/src/profile/AndroidManifest.xml b/android/app/src/profile/AndroidManifest.xml deleted file mode 100644 index 399f698..0000000 --- a/android/app/src/profile/AndroidManifest.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - diff --git a/android/build.gradle.kts b/android/build.gradle.kts deleted file mode 100644 index 4b24dd7..0000000 --- a/android/build.gradle.kts +++ /dev/null @@ -1,104 +0,0 @@ -buildscript { - repositories { - mavenCentral() - google() - maven { url = uri("https://developer.huawei.com/repo/") } - maven { - url = uri("https://api.mapbox.com/downloads/v2/releases/maven") - credentials { - username = "mapbox" - password = "sk.eyJ1IjoicndhaWQiLCJhIjoiY2x6NWo0bTMzMWZodzJrcGZpemYzc3Z4dSJ9.uSSZuwNSGCcCdPAiORECmg" - if (password.isNullOrEmpty()) { - throw GradleException("MAPBOX_DOWNLOADS_TOKEN isn't set. Set it to the project properties or to the environment variables.") - } - } - authentication { - create("basic") - } - } - } - dependencies { - classpath("com.android.tools.build:gradle:8.1.0") - classpath("com.huawei.agconnect:agcp:1.9.1.304") - } -} - -allprojects { - repositories { - google() - mavenCentral() - maven { url = uri("https://developer.huawei.com/repo/") } - maven { url = uri("https://artifactory.ess-dev.com/artifactory/gradle-dev-local") } - maven { - url = uri("https://api.mapbox.com/downloads/v2/releases/maven") - credentials { - username = "mapbox" - password = "sk.eyJ1IjoicndhaWQiLCJhIjoiY2x6NWo0bTMzMWZodzJrcGZpemYzc3Z4dSJ9.uSSZuwNSGCcCdPAiORECmg" - if (password.isNullOrEmpty()) { - throw GradleException("MAPBOX_DOWNLOADS_TOKEN isn't set. Set it to the project properties or to the environment variables.") - } - } - authentication { - create("basic") - } - } - } - - configurations.all { - exclude(group = "org.bouncycastle", module = "bcprov-jdk16") - } - - tasks.withType().configureEach { - sourceCompatibility = JavaVersion.VERSION_21.toString() - targetCompatibility = JavaVersion.VERSION_21.toString() - } - - tasks.withType().configureEach { - kotlinOptions { - jvmTarget = "21" - } - } - - subprojects { - afterEvaluate { - if (project.hasProperty("android")) { - project.extensions.findByName("android")?.let { androidExt -> - val android = androidExt as com.android.build.gradle.BaseExtension - if (android.namespace == null) { - android.namespace = project.group.toString() - } - android.buildFeatures.apply { - if (buildConfig == null) { - buildConfig = true - } - } - android.compileOptions.apply { - sourceCompatibility = JavaVersion.VERSION_21 - targetCompatibility = JavaVersion.VERSION_21 - } - } - } - project.tasks.withType().configureEach { - sourceCompatibility = JavaVersion.VERSION_21.toString() - targetCompatibility = JavaVersion.VERSION_21.toString() - } - project.tasks.withType().configureEach { - kotlinOptions { - jvmTarget = "21" - } - } - } - } -} - -rootProject.buildDir = File("../build") -subprojects { - project.buildDir = File("${rootProject.buildDir}/${project.name}") -} -subprojects { - project.evaluationDependsOn(":app") -} - -tasks.register("clean") { - delete(rootProject.layout.buildDirectory) -} \ No newline at end of file diff --git a/android/build/reports/problems/problems-report.html b/android/build/reports/problems/problems-report.html deleted file mode 100644 index 866b270..0000000 --- a/android/build/reports/problems/problems-report.html +++ /dev/null @@ -1,663 +0,0 @@ - - - - - - - - - - - - - Gradle Configuration Cache - - - -
- -
- Loading... -
- - - - - - diff --git a/android/google-services.json b/android/google-services.json deleted file mode 100644 index 3707617..0000000 --- a/android/google-services.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "project_info": { - "project_number": "815750722565", - "firebase_url": "https://api-project-815750722565.firebaseio.com", - "project_id": "api-project-815750722565", - "storage_bucket": "api-project-815750722565.appspot.com" - }, - "client": [ - { - "client_info": { - "mobilesdk_app_id": "1:815750722565:android:62281cd3e5df4063", - "android_client_info": { - "package_name": "com.ejada.hmg" - } - }, - "oauth_client": [ - { - "client_id": "815750722565-3a0gc7neins0eoahdrimrfksk0sqice8.apps.googleusercontent.com", - "client_type": 3 - } - ], - "api_key": [ - { - "current_key": "AIzaSyDZDeWcBlRE3YfJWYt_DCiToVnANfaj8qg" - } - ], - "services": { - "appinvite_service": { - "other_platform_oauth_client": [ - { - "client_id": "815750722565-3a0gc7neins0eoahdrimrfksk0sqice8.apps.googleusercontent.com", - "client_type": 3 - }, - { - "client_id": "815750722565-0cq9366orvsk5ipivq6lijcj56u03fr7.apps.googleusercontent.com", - "client_type": 2, - "ios_info": { - "bundle_id": "com.void.demo" - } - } - ] - } - } - } - ], - "configuration_version": "1" -} \ No newline at end of file diff --git a/android/gradle.properties b/android/gradle.properties deleted file mode 100644 index f018a61..0000000 --- a/android/gradle.properties +++ /dev/null @@ -1,3 +0,0 @@ -org.gradle.jvmargs=-Xmx8G -XX:MaxMetaspaceSize=4G -XX:ReservedCodeCacheSize=512m -XX:+HeapDumpOnOutOfMemoryError -android.useAndroidX=true -android.enableJetifier=true diff --git a/android/gradle/wrapper/gradle-wrapper.properties b/android/gradle/wrapper/gradle-wrapper.properties deleted file mode 100644 index ac3b479..0000000 --- a/android/gradle/wrapper/gradle-wrapper.properties +++ /dev/null @@ -1,5 +0,0 @@ -distributionBase=GRADLE_USER_HOME -distributionPath=wrapper/dists -zipStoreBase=GRADLE_USER_HOME -zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.12-all.zip diff --git a/android/key b/android/key deleted file mode 100644 index 15b9f5d..0000000 Binary files a/android/key and /dev/null differ diff --git a/android/settings.gradle.kts b/android/settings.gradle.kts deleted file mode 100644 index ab39a10..0000000 --- a/android/settings.gradle.kts +++ /dev/null @@ -1,25 +0,0 @@ -pluginManagement { - val flutterSdkPath = run { - val properties = java.util.Properties() - file("local.properties").inputStream().use { properties.load(it) } - val flutterSdkPath = properties.getProperty("flutter.sdk") - require(flutterSdkPath != null) { "flutter.sdk not set in local.properties" } - flutterSdkPath - } - - includeBuild("$flutterSdkPath/packages/flutter_tools/gradle") - - repositories { - google() - mavenCentral() - gradlePluginPortal() - } -} - -plugins { - id("dev.flutter.flutter-plugin-loader") version "1.0.0" - id("com.android.application") version "8.7.3" apply false - id("org.jetbrains.kotlin.android") version "2.1.0" apply false -} - -include(":app") diff --git a/assets/files/rule.txt b/assets/files/rule.txt new file mode 100644 index 0000000..49c1cb4 --- /dev/null +++ b/assets/files/rule.txt @@ -0,0 +1 @@ +this is a match \ No newline at end of file diff --git a/ios/AppWidget/AppWidgetLiveActivity.swift b/ios/AppWidget/AppWidgetLiveActivity.swift index d558748..8702b3b 100644 --- a/ios/AppWidget/AppWidgetLiveActivity.swift +++ b/ios/AppWidget/AppWidgetLiveActivity.swift @@ -108,16 +108,26 @@ struct NotificationWidgetData { let imageName: String let colorConfig: WidgetColorConfig } - -// MARK: - Main Widget View struct NotificationWidgetView: View { private let data: NotificationWidgetData - + init(data: NotificationWidgetData) { self.data = data } - var body: some View { + + var body : some View{ +// ZStack(){ + body2 +// .frame(width: .infinity, height: 400 ) +// .padding(.top, 340) +// .cornerRadius(20) +// }.background(data.colorConfig.containerBorderColor) +// .cornerRadius(20) + + } + + var body2: some View { VStack(alignment: .leading, spacing: 0) { // Top section with current ticket and image HStack(alignment: .top, spacing: 0) { @@ -128,15 +138,15 @@ struct NotificationWidgetView: View { .foregroundColor(.black) .padding(.trailing, 10) .frame(maxWidth: .infinity, alignment: .leading) - - // Image - Image(systemName: data.imageName) + + Image(data.imageName) .resizable() .scaledToFit() - .frame(width: 24, height: 24) - .foregroundColor(.gray) + .frame(width: 34, height: 34) } - + .padding(.top, 16) + .padding(.horizontal, 16) + // Currently Serving Header Text(data.currentlyServingHeader) .font(.custom("Poppins-Medium", size: 14)) @@ -144,7 +154,8 @@ struct NotificationWidgetView: View { .foregroundColor(.black) .padding(.trailing, 12) .padding(.bottom, 10) - + .padding(.horizontal, 16) + // Currently Serving section with status HStack(alignment: .center, spacing: 0) { // Currently serving text @@ -153,7 +164,7 @@ struct NotificationWidgetView: View { .fontWeight(.bold) .foregroundColor(.black) .frame(maxWidth: .infinity, alignment: .leading) - + // Status badge Text(data.status) .font(.custom("Poppins-Medium", size: 12)) @@ -165,7 +176,8 @@ struct NotificationWidgetView: View { .fill(Color.inactiveColor.opacity(0.2)) ) } - + .padding(.horizontal, 16) + Spacer() // Next Step badge Text(data.nextStep) .font(.custom("Poppins-Medium", size: 12)) @@ -176,22 +188,229 @@ struct NotificationWidgetView: View { RoundedRectangle(cornerRadius: 8) .fill(data.colorConfig.nextStepBackground) ) - .padding(.top, 10) + .padding(.horizontal, 16) + .padding(.bottom, 16) } - .padding(12) - .background( - // 1. Use a Material for the glass/frosted effect - .thinMaterial, - // Define the shape for the material and the stroke - in: RoundedRectangle(cornerRadius: 12, style: .continuous) - ) - .overlay( - // 2. Add the stroke (border) around the shape - RoundedRectangle(cornerRadius: 12, style: .continuous) - .stroke(data.colorConfig.containerBorderColor, lineWidth: 5) - ) + .background(Color.black.opacity(0.01)) + .cornerRadius(20) + +// .border(width: 10, edges: [.top, .bottom], color: data.colorConfig.containerBorderColor) +// .border(width: 2, edges: [.leading, .trailing], color: data.colorConfig.containerBorderColor) +// .overlay( +// RoundedRectangle(cornerRadius: 20) +// .stroke(data.colorConfig.containerBorderColor, lineWidth: 20) +// ) + } +} + +extension View { + func border(width: CGFloat, edges: [Edge], color: Color) -> some View { + overlay(EdgeBorder(width: width, edges: edges).foregroundColor(color)) + .cornerRadius(20) + + } +} + +struct EdgeBorder: Shape { + var width: CGFloat + var edges: [Edge] + + func path(in rect: CGRect) -> Path { + edges.map { edge -> Path in + switch edge { + case .top: return Path(.init(x: rect.minX, y: rect.minY, width: rect.width, height: width)) + case .bottom: return Path(.init(x: rect.minX, y: rect.maxY - width, width: rect.width, height: width)) + case .leading: return Path(.init(x: rect.minX, y: rect.minY, width: width, height: rect.height)) + case .trailing: return Path(.init(x: rect.maxX - width, y: rect.minY, width: width, height: rect.height)) + } + }.reduce(into: Path()) { $0.addPath($1) } } } +// MARK: - Main Widget View +//working widget but the border is not appearing +// struct NotificationWidgetView: View { +// private let data: NotificationWidgetData +// +// init(data: NotificationWidgetData) { +// self.data = data +// } +// +// var body: some View { +// VStack(alignment: .leading, spacing: 0) { +// +// VStack(alignment: .leading, spacing: 0) { +// // Top section with current ticket and image +// HStack(alignment: .top, spacing: 0) { +// // Current ticket value +// Text(data.currentTicket) +// .font(.custom("Poppins-Medium", size: 28)) +// .fontWeight(.bold) +// .foregroundColor(.black) +// .padding(.trailing, 10) +// +// .frame(maxWidth: .infinity, alignment: .leading) +// +// Image(data.imageName) +// .resizable() +// .scaledToFit() +// .frame(width: 34, height: 34) +// } +// +// // Currently Serving Header +// Text(data.currentlyServingHeader) +// .font(.custom("Poppins-Medium", size: 14)) +// .fontWeight(.bold) +// .foregroundColor(.black) +// .padding(.trailing, 12) +// .padding(.bottom, 10) +// +// // Currently Serving section with status +// HStack(alignment: .center, spacing: 0) { +// // Currently serving text +// Text(data.currentlyServing) +// .font(.custom("Poppins-Medium", size: 16)) +// .fontWeight(.bold) +// .foregroundColor(.black) +// .frame(maxWidth: .infinity, alignment: .leading) +// +// // Status badge +// Text(data.status) +// .font(.custom("Poppins-Medium", size: 12)) +// .foregroundColor(data.colorConfig.nextStepTextColor) +// .padding(.horizontal, 12) +// .padding(.vertical, 8) +// .background( +// RoundedRectangle(cornerRadius: 8) +// .fill(Color.inactiveColor.opacity(0.2)) +// ) +// } +// +// // Next Step badge +// Text(data.nextStep) +// .font(.custom("Poppins-Medium", size: 12)) +// .foregroundColor(data.colorConfig.nextStepTextColor) +// .padding(.horizontal, 12) +// .padding(.vertical, 8) +// .background( +// RoundedRectangle(cornerRadius: 8) +// .fill(data.colorConfig.nextStepBackground) +// ) +// +// } +// +// +// }.padding() +// .background( RoundedRectangle(cornerRadius: 20) +// +// .fill(Color.white) +// ) +// // .border(data.colorConfig.containerBorderColor, width: 2) +// +// .overlay( +// RoundedRectangle(cornerRadius: 20) +// .stroke(data.colorConfig.containerBorderColor, lineWidth: 1) +// // RoundedRectangle(cornerRadius: 12, style: .continuous) +// // .stroke(data.colorConfig.containerBorderColor, lineWidth: 5) +// ) +// +// // .padding(12) +// } +// } + + +// MARK: - Main Widget View +// struct NotificationWidgetView: View { +// private let data: NotificationWidgetData +// +// init(data: NotificationWidgetData) { +// self.data = data +// } +// +// var body: some View { +// // Use a ZStack as the base to layer the background and content +// ZStack { +// // Layer 1: Glass effect background with border on all sides +// RoundedRectangle(cornerRadius: 12, style: .continuous) +// .strokeBorder(data.colorConfig.containerBorderColor, lineWidth: 3) +// .background( +// RoundedRectangle(cornerRadius: 12, style: .continuous) +// +// .background( +// RoundedRectangle(cornerRadius: 12, style: .continuous) +// .fill(Color.white) +// ) +// ) +// .shadow(color: Color.black.opacity(0.1), radius: 8, x: 0, y: 4) +// +// +// // Layer 2: Your content, padded from the edges +// VStack(alignment: .leading, spacing: 0) { +// // Top section with current ticket and image +// HStack(alignment: .top, spacing: 0) { +// Text(data.currentTicket) +// .font(.custom("Poppins-Medium", size: 28)) +// .fontWeight(.bold) +// .foregroundColor(.black) +// .padding(.trailing, 10) +// +// Spacer() // Pushes the image to the trailing edge +// +// Image(systemName: data.imageName) +// .resizable() +// .scaledToFit() +// .frame(width: 24, height: 24) +// .foregroundColor(.gray) +// } +// +// // Currently Serving Header +// Text(data.currentlyServingHeader) +// .font(.custom("Poppins-Medium", size: 14)) +// .fontWeight(.bold) +// .foregroundColor(.black) +// .padding(.top, 4) // Adjusted padding +// .padding(.bottom, 10) +// +// // Currently Serving section with status +// HStack(alignment: .center, spacing: 0) { +// Text(data.currentlyServing) +// .font(.custom("Poppins-Medium", size: 16)) +// .fontWeight(.bold) +// .foregroundColor(.black) +// +// Spacer() // Pushes status to the trailing edge +// +// Text(data.status) +// .font(.custom("Poppins-Medium", size: 12)) +// .foregroundColor(data.colorConfig.nextStepTextColor) +// .padding(.horizontal, 12) +// .padding(.vertical, 8) +// .background( +// RoundedRectangle(cornerRadius: 8) +// .fill(Color.inactiveColor.opacity(0.2)) +// ) +// } +// +// // Next Step badge +// Text(data.nextStep) +// .font(.custom("Poppins-Medium", size: 12)) +// .foregroundColor(data.colorConfig.nextStepTextColor) +// .padding(.horizontal, 12) +// .padding(.vertical, 8) +// .background( +// RoundedRectangle(cornerRadius: 8) +// .fill(data.colorConfig.nextStepBackground) +// ) +// .padding(.top, 10) +// +// // **CRITICAL FIX**: Pushes all content to the top +// // and makes the VStack fill the available height. +// Spacer(minLength: 0) +// } +// .padding(15) // Apply padding to the content VStack instead +// } +// } +// } + // MARK: - Live Activity Widget struct AppWidgetLiveActivity: Widget { @@ -217,7 +436,7 @@ struct AppWidgetLiveActivity: Widget { currentlyServing: currentlyServing, status: status, nextStep: nextStep, - imageName: "bell.fill", + imageName:"hmg", colorConfig: colorConfig ) @@ -247,7 +466,10 @@ struct AppWidgetLiveActivity: Widget { } DynamicIslandExpandedRegion(.trailing) { - Image(systemName: "bell.fill") + Image("hmg") + .resizable() + .scaledToFit() + .frame(width: 34, height: 34) .foregroundColor(.gray) } @@ -296,15 +518,27 @@ struct AppWidgetLiveActivity: Widget { .fontWeight(.bold) } compactTrailing: { // Compact trailing view - Image(systemName: "bell.fill") - .foregroundColor(colorConfig.containerBorderColor) + Image("hmg") + .resizable() + .scaledToFit() + .frame(width: 12, height: 12) + .foregroundColor(colorConfig.containerBorderColor).padding(4) } minimal: { // Minimal view - Image(systemName: "bell.fill") - .foregroundColor(colorConfig.containerBorderColor) + HStack{ + Text(currentTicket) + .font(.caption2) + .fontWeight(.bold) + Spacer() + Image("hmg") + .resizable() + .scaledToFit() + .frame(width: 4, height: 4) + .foregroundColor(colorConfig.containerBorderColor) + }.padding(2) + } - .widgetURL(URL(string: "http://www.apple.com")) - .keylineTint(colorConfig.containerBorderColor) + .contentMargins(.all, 20,for: .expanded) } } } diff --git a/ios/AppWidget/Assets.xcassets/AccentColor.colorset/Contents.json b/ios/AppWidget/Assets.xcassets/AccentColor.colorset/Contents.json new file mode 100644 index 0000000..eb87897 --- /dev/null +++ b/ios/AppWidget/Assets.xcassets/AccentColor.colorset/Contents.json @@ -0,0 +1,11 @@ +{ + "colors" : [ + { + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/ios/AppWidget/Assets.xcassets/AppIcon.appiconset/Contents.json b/ios/AppWidget/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..2305880 --- /dev/null +++ b/ios/AppWidget/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,35 @@ +{ + "images" : [ + { + "idiom" : "universal", + "platform" : "ios", + "size" : "1024x1024" + }, + { + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "dark" + } + ], + "idiom" : "universal", + "platform" : "ios", + "size" : "1024x1024" + }, + { + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "tinted" + } + ], + "idiom" : "universal", + "platform" : "ios", + "size" : "1024x1024" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/ios/AppWidget/Assets.xcassets/Contents.json b/ios/AppWidget/Assets.xcassets/Contents.json new file mode 100644 index 0000000..73c0059 --- /dev/null +++ b/ios/AppWidget/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/ios/AppWidget/Assets.xcassets/WidgetBackground.colorset/Contents.json b/ios/AppWidget/Assets.xcassets/WidgetBackground.colorset/Contents.json new file mode 100644 index 0000000..eb87897 --- /dev/null +++ b/ios/AppWidget/Assets.xcassets/WidgetBackground.colorset/Contents.json @@ -0,0 +1,11 @@ +{ + "colors" : [ + { + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/ios/AppWidget/Assets.xcassets/hmg.imageset/Contents.json b/ios/AppWidget/Assets.xcassets/hmg.imageset/Contents.json new file mode 100644 index 0000000..3b5c69a --- /dev/null +++ b/ios/AppWidget/Assets.xcassets/hmg.imageset/Contents.json @@ -0,0 +1,26 @@ +{ + "images" : [ + { + "filename" : "hmg.svg", + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "hmg 1.svg", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "hmg 2.svg", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + }, + "properties" : { + "preserves-vector-representation" : true + } +} diff --git a/ios/AppWidget/Assets.xcassets/hmg.imageset/hmg 1.svg b/ios/AppWidget/Assets.xcassets/hmg.imageset/hmg 1.svg new file mode 100644 index 0000000..ccaed0c --- /dev/null +++ b/ios/AppWidget/Assets.xcassets/hmg.imageset/hmg 1.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/ios/AppWidget/Assets.xcassets/hmg.imageset/hmg 2.svg b/ios/AppWidget/Assets.xcassets/hmg.imageset/hmg 2.svg new file mode 100644 index 0000000..ccaed0c --- /dev/null +++ b/ios/AppWidget/Assets.xcassets/hmg.imageset/hmg 2.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/ios/AppWidget/Assets.xcassets/hmg.imageset/hmg.svg b/ios/AppWidget/Assets.xcassets/hmg.imageset/hmg.svg new file mode 100644 index 0000000..ccaed0c --- /dev/null +++ b/ios/AppWidget/Assets.xcassets/hmg.imageset/hmg.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/ios/AppWidget/Poppins-Medium.ttf b/ios/AppWidget/Poppins-Medium.ttf new file mode 100644 index 0000000..e90e87e Binary files /dev/null and b/ios/AppWidget/Poppins-Medium.ttf differ diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index 2eab03a..8a05a2c 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -11,6 +11,9 @@ 331C808B294A63AB00263BE5 /* RunnerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 331C807B294A618700263BE5 /* RunnerTests.swift */; }; 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; 478CFA942E638C8E0064F3D7 /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 478CFA932E638C8E0064F3D7 /* GoogleService-Info.plist */; }; + 61769DE72EEFDD0F000EC14A /* WidgetKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 61769DE62EEFDD0F000EC14A /* WidgetKit.framework */; }; + 61769DE92EEFDD0F000EC14A /* SwiftUI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 61769DE82EEFDD0F000EC14A /* SwiftUI.framework */; }; + 61769DFA2EEFDD13000EC14A /* AppWidgetExtension.appex in Embed Foundation Extensions */ = {isa = PBXBuildFile; fileRef = 61769DE52EEFDD0F000EC14A /* AppWidgetExtension.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; }; 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; @@ -26,9 +29,27 @@ remoteGlobalIDString = 97C146ED1CF9000F007C117D; remoteInfo = Runner; }; + 61769DF82EEFDD13000EC14A /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 97C146E61CF9000F007C117D /* Project object */; + proxyType = 1; + remoteGlobalIDString = 61769DE42EEFDD0F000EC14A; + remoteInfo = AppWidgetExtension; + }; /* End PBXContainerItemProxy section */ /* Begin PBXCopyFilesBuildPhase section */ + 61769DFB2EEFDD13000EC14A /* Embed Foundation Extensions */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 13; + files = ( + 61769DFA2EEFDD13000EC14A /* AppWidgetExtension.appex in Embed Foundation Extensions */, + ); + name = "Embed Foundation Extensions"; + runOnlyForDeploymentPostprocessing = 0; + }; 9705A1C41CF9048500538489 /* Embed Frameworks */ = { isa = PBXCopyFilesBuildPhase; buildActionMask = 2147483647; @@ -49,6 +70,10 @@ 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; 478CFA932E638C8E0064F3D7 /* GoogleService-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "GoogleService-Info.plist"; sourceTree = ""; }; 478CFA952E6E20A60064F3D7 /* Runner.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = Runner.entitlements; sourceTree = ""; }; + 61769DE52EEFDD0F000EC14A /* AppWidgetExtension.appex */ = {isa = PBXFileReference; explicitFileType = "wrapper.app-extension"; includeInIndex = 0; path = AppWidgetExtension.appex; sourceTree = BUILT_PRODUCTS_DIR; }; + 61769DE62EEFDD0F000EC14A /* WidgetKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = WidgetKit.framework; path = System/Library/Frameworks/WidgetKit.framework; sourceTree = SDKROOT; }; + 61769DE82EEFDD0F000EC14A /* SwiftUI.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SwiftUI.framework; path = System/Library/Frameworks/SwiftUI.framework; sourceTree = SDKROOT; }; + 61769E012EEFDD98000EC14A /* AppWidgetExtension.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = AppWidgetExtension.entitlements; sourceTree = ""; }; 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; }; 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 7595037DD52211B91157B0F3 /* 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 = ""; }; @@ -66,7 +91,49 @@ D6BB17A036DF7FCE75271203 /* 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 = ""; }; /* End PBXFileReference section */ +/* Begin PBXFileSystemSynchronizedBuildFileExceptionSet section */ + 6147DFA32EF2D46300A0F0AA /* Exceptions for "AppWidget" folder in "Runner" target */ = { + isa = PBXFileSystemSynchronizedBuildFileExceptionSet; + membershipExceptions = ( + "Poppins-Medium.ttf", + ); + target = 97C146ED1CF9000F007C117D /* Runner */; + }; + 61769DFF2EEFDD13000EC14A /* Exceptions for "AppWidget" folder in "AppWidgetExtension" target */ = { + isa = PBXFileSystemSynchronizedBuildFileExceptionSet; + membershipExceptions = ( + Info.plist, + ); + target = 61769DE42EEFDD0F000EC14A /* AppWidgetExtension */; + }; +/* End PBXFileSystemSynchronizedBuildFileExceptionSet section */ + +/* Begin PBXFileSystemSynchronizedRootGroup section */ + 61769DEA2EEFDD0F000EC14A /* AppWidget */ = { + isa = PBXFileSystemSynchronizedRootGroup; + exceptions = ( + 6147DFA32EF2D46300A0F0AA /* Exceptions for "AppWidget" folder in "Runner" target */, + 61769DFF2EEFDD13000EC14A /* Exceptions for "AppWidget" folder in "AppWidgetExtension" target */, + ); + explicitFileTypes = { + }; + explicitFolders = ( + ); + path = AppWidget; + sourceTree = ""; + }; +/* End PBXFileSystemSynchronizedRootGroup section */ + /* Begin PBXFrameworksBuildPhase section */ + 61769DE22EEFDD0F000EC14A /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 61769DE92EEFDD0F000EC14A /* SwiftUI.framework in Frameworks */, + 61769DE72EEFDD0F000EC14A /* WidgetKit.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; 97C146EB1CF9000F007C117D /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; @@ -110,8 +177,10 @@ 97C146E51CF9000F007C117D = { isa = PBXGroup; children = ( + 61769E012EEFDD98000EC14A /* AppWidgetExtension.entitlements */, 9740EEB11CF90186004384FC /* Flutter */, 97C146F01CF9000F007C117D /* Runner */, + 61769DEA2EEFDD0F000EC14A /* AppWidget */, 97C146EF1CF9000F007C117D /* Products */, 331C8082294A63A400263BE5 /* RunnerTests */, 79DD2093A1D9674C94359FC8 /* Pods */, @@ -124,6 +193,7 @@ children = ( 97C146EE1CF9000F007C117D /* Runner.app */, 331C8081294A63A400263BE5 /* RunnerTests.xctest */, + 61769DE52EEFDD0F000EC14A /* AppWidgetExtension.appex */, ); name = Products; sourceTree = ""; @@ -150,6 +220,8 @@ isa = PBXGroup; children = ( ACE60DF9393168FD748550B3 /* Pods_Runner.framework */, + 61769DE62EEFDD0F000EC14A /* WidgetKit.framework */, + 61769DE82EEFDD0F000EC14A /* SwiftUI.framework */, ); name = Frameworks; sourceTree = ""; @@ -174,6 +246,26 @@ productReference = 331C8081294A63A400263BE5 /* RunnerTests.xctest */; productType = "com.apple.product-type.bundle.unit-test"; }; + 61769DE42EEFDD0F000EC14A /* AppWidgetExtension */ = { + isa = PBXNativeTarget; + buildConfigurationList = 61769E002EEFDD13000EC14A /* Build configuration list for PBXNativeTarget "AppWidgetExtension" */; + buildPhases = ( + 61769DE12EEFDD0F000EC14A /* Sources */, + 61769DE22EEFDD0F000EC14A /* Frameworks */, + 61769DE32EEFDD0F000EC14A /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + fileSystemSynchronizedGroups = ( + 61769DEA2EEFDD0F000EC14A /* AppWidget */, + ); + name = AppWidgetExtension; + productName = AppWidgetExtension; + productReference = 61769DE52EEFDD0F000EC14A /* AppWidgetExtension.appex */; + productType = "com.apple.product-type.app-extension"; + }; 97C146ED1CF9000F007C117D /* Runner */ = { isa = PBXNativeTarget; buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; @@ -183,6 +275,7 @@ 97C146EA1CF9000F007C117D /* Sources */, 97C146EB1CF9000F007C117D /* Frameworks */, 97C146EC1CF9000F007C117D /* Resources */, + 61769DFB2EEFDD13000EC14A /* Embed Foundation Extensions */, 9705A1C41CF9048500538489 /* Embed Frameworks */, 3B06AD1E1E4923F5004D2608 /* Thin Binary */, 8372B02399CDF54531650AD4 /* [CP] Embed Pods Frameworks */, @@ -191,6 +284,7 @@ buildRules = ( ); dependencies = ( + 61769DF92EEFDD13000EC14A /* PBXTargetDependency */, ); name = Runner; productName = Runner; @@ -204,6 +298,7 @@ isa = PBXProject; attributes = { BuildIndependentTargetsInParallel = YES; + LastSwiftUpdateCheck = 1640; LastUpgradeCheck = 1510; ORGANIZATIONNAME = ""; TargetAttributes = { @@ -211,6 +306,9 @@ CreatedOnToolsVersion = 14.0; TestTargetID = 97C146ED1CF9000F007C117D; }; + 61769DE42EEFDD0F000EC14A = { + CreatedOnToolsVersion = 16.4; + }; 97C146ED1CF9000F007C117D = { CreatedOnToolsVersion = 7.3.1; LastSwiftMigration = 1100; @@ -232,6 +330,7 @@ targets = ( 97C146ED1CF9000F007C117D /* Runner */, 331C8080294A63A400263BE5 /* RunnerTests */, + 61769DE42EEFDD0F000EC14A /* AppWidgetExtension */, ); }; /* End PBXProject section */ @@ -244,6 +343,13 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + 61769DE32EEFDD0F000EC14A /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; 97C146EC1CF9000F007C117D /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; @@ -357,6 +463,13 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + 61769DE12EEFDD0F000EC14A /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; 97C146EA1CF9000F007C117D /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; @@ -374,6 +487,11 @@ target = 97C146ED1CF9000F007C117D /* Runner */; targetProxy = 331C8085294A63A400263BE5 /* PBXContainerItemProxy */; }; + 61769DF92EEFDD13000EC14A /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 61769DE42EEFDD0F000EC14A /* AppWidgetExtension */; + targetProxy = 61769DF82EEFDD13000EC14A /* PBXContainerItemProxy */; + }; /* End PBXTargetDependency section */ /* Begin PBXVariantGroup section */ @@ -461,7 +579,7 @@ DEVELOPMENT_TEAM = 3A359E86ZF; ENABLE_BITCODE = NO; INFOPLIST_FILE = Runner/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 15.6; + IPHONEOS_DEPLOYMENT_TARGET = 17.6; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", @@ -523,6 +641,129 @@ }; name = Profile; }; + 61769DFC2EEFDD13000EC14A /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + ASSETCATALOG_COMPILER_WIDGET_BACKGROUND_COLOR_NAME = WidgetBackground; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CODE_SIGN_ENTITLEMENTS = AppWidgetExtension.entitlements; + CODE_SIGN_IDENTITY = "Apple Development"; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + DEVELOPMENT_TEAM = 3A359E86ZF; + ENABLE_USER_SCRIPT_SANDBOXING = YES; + GCC_C_LANGUAGE_STANDARD = gnu17; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_FILE = AppWidget/Info.plist; + INFOPLIST_KEY_CFBundleDisplayName = AppWidget; + INFOPLIST_KEY_NSHumanReadableCopyright = ""; + IPHONEOS_DEPLOYMENT_TARGET = 17.6; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@executable_path/../../Frameworks", + ); + LOCALIZATION_PREFERS_STRING_CATALOGS = YES; + MARKETING_VERSION = 1.0; + MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; + MTL_FAST_MATH = YES; + PRODUCT_BUNDLE_IDENTIFIER = "com.HMG.HMG-Smartphone.AppWidget"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SKIP_INSTALL = YES; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = "DEBUG $(inherited)"; + SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + 61769DFD2EEFDD13000EC14A /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + ASSETCATALOG_COMPILER_WIDGET_BACKGROUND_COLOR_NAME = WidgetBackground; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CODE_SIGN_ENTITLEMENTS = AppWidgetExtension.entitlements; + CODE_SIGN_IDENTITY = "Apple Development"; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + DEVELOPMENT_TEAM = 3A359E86ZF; + ENABLE_USER_SCRIPT_SANDBOXING = YES; + GCC_C_LANGUAGE_STANDARD = gnu17; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_FILE = AppWidget/Info.plist; + INFOPLIST_KEY_CFBundleDisplayName = AppWidget; + INFOPLIST_KEY_NSHumanReadableCopyright = ""; + IPHONEOS_DEPLOYMENT_TARGET = 17.6; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@executable_path/../../Frameworks", + ); + LOCALIZATION_PREFERS_STRING_CATALOGS = YES; + MARKETING_VERSION = 1.0; + MTL_FAST_MATH = YES; + PRODUCT_BUNDLE_IDENTIFIER = "com.HMG.HMG-Smartphone.AppWidget"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SKIP_INSTALL = YES; + SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; + 61769DFE2EEFDD13000EC14A /* Profile */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + ASSETCATALOG_COMPILER_WIDGET_BACKGROUND_COLOR_NAME = WidgetBackground; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CODE_SIGN_ENTITLEMENTS = AppWidgetExtension.entitlements; + CODE_SIGN_IDENTITY = "Apple Development"; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + DEVELOPMENT_TEAM = 3A359E86ZF; + ENABLE_USER_SCRIPT_SANDBOXING = YES; + GCC_C_LANGUAGE_STANDARD = gnu17; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_FILE = AppWidget/Info.plist; + INFOPLIST_KEY_CFBundleDisplayName = AppWidget; + INFOPLIST_KEY_NSHumanReadableCopyright = ""; + IPHONEOS_DEPLOYMENT_TARGET = 17.6; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@executable_path/../../Frameworks", + ); + LOCALIZATION_PREFERS_STRING_CATALOGS = YES; + MARKETING_VERSION = 1.0; + MTL_FAST_MATH = YES; + PRODUCT_BUNDLE_IDENTIFIER = "com.HMG.HMG-Smartphone.AppWidget"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SKIP_INSTALL = YES; + SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Profile; + }; 97C147031CF9000F007C117D /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { @@ -647,7 +888,7 @@ DEVELOPMENT_TEAM = 3A359E86ZF; ENABLE_BITCODE = NO; INFOPLIST_FILE = Runner/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 15.6; + IPHONEOS_DEPLOYMENT_TARGET = 17.6; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", @@ -676,7 +917,7 @@ DEVELOPMENT_TEAM = 3A359E86ZF; ENABLE_BITCODE = NO; INFOPLIST_FILE = Runner/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 15.6; + IPHONEOS_DEPLOYMENT_TARGET = 17.6; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", @@ -704,6 +945,16 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Debug; }; + 61769E002EEFDD13000EC14A /* Build configuration list for PBXNativeTarget "AppWidgetExtension" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 61769DFC2EEFDD13000EC14A /* Debug */, + 61769DFD2EEFDD13000EC14A /* Release */, + 61769DFE2EEFDD13000EC14A /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Debug; + }; 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = { isa = XCConfigurationList; buildConfigurations = ( diff --git a/ios/Runner/Info.plist b/ios/Runner/Info.plist index 8f2ef94..87ca03a 100644 --- a/ios/Runner/Info.plist +++ b/ios/Runner/Info.plist @@ -91,8 +91,14 @@ This app requires calendar access to set reminders for Virtual & Normal Appointments. NSSpeechRecognitionUsageDescription This app requires speech recognition access to access voice command features. + NSSupportsLiveActivities + NSUserActivityTypes + UIAppFonts + + Poppins-Medium.ttf + UIApplicationSupportsIndirectInputEvents UIBackgroundModes diff --git a/ios/Runner/Runner.entitlements b/ios/Runner/Runner.entitlements index 319178a..a852dac 100644 --- a/ios/Runner/Runner.entitlements +++ b/ios/Runner/Runner.entitlements @@ -13,5 +13,9 @@ TAG + com.apple.security.application-groups + + group.alhabib.patientApp + diff --git a/lib/presentation/appointments/appointment_details_page.dart b/lib/presentation/appointments/appointment_details_page.dart index 7f863a1..4deef99 100644 --- a/lib/presentation/appointments/appointment_details_page.dart +++ b/lib/presentation/appointments/appointment_details_page.dart @@ -331,8 +331,6 @@ class _AppointmentDetailsPageState extends State { myAppointmentsViewModel.setAppointmentReminder(!isEventAddedOrRemoved, widget.patientAppointmentHistoryResponseModel); }); } - - }, ), ], diff --git a/lib/presentation/home/landing_page.dart b/lib/presentation/home/landing_page.dart index 88b9274..ca56131 100644 --- a/lib/presentation/home/landing_page.dart +++ b/lib/presentation/home/landing_page.dart @@ -556,7 +556,7 @@ class _LandingPageState extends State { }), SizedBox(height: 16.h), Container( - height: 121.h, + height: 250.h, decoration: RoundedRectangleBorder().toSmoothCornerDecoration(color: AppColors.whiteColor, borderRadius: 24.r), child: Column( children: [ @@ -596,7 +596,7 @@ class _LandingPageState extends State { ], ) : Container( - height: 127.h, + height: 250.h, decoration: RoundedRectangleBorder().toSmoothCornerDecoration(color: AppColors.whiteColor, borderRadius: 24.r), child: Column( children: [ diff --git a/lib/presentation/home/widgets/small_service_card.dart b/lib/presentation/home/widgets/small_service_card.dart index f54f442..520f359 100644 --- a/lib/presentation/home/widgets/small_service_card.dart +++ b/lib/presentation/home/widgets/small_service_card.dart @@ -1,4 +1,8 @@ +import 'dart:async' show StreamSubscription; +import 'dart:io'; + import 'package:flutter/material.dart'; +import 'package:hmg_patient_app_new/core/app_assets.dart'; import 'package:hmg_patient_app_new/core/utils/size_utils.dart'; import 'package:hmg_patient_app_new/extensions/string_extensions.dart'; import 'package:hmg_patient_app_new/extensions/widget_extensions.dart'; @@ -11,13 +15,43 @@ import 'package:hmg_patient_app_new/presentation/medical_file/patient_sickleaves import 'package:hmg_patient_app_new/presentation/prescriptions/prescriptions_list_page.dart'; import 'package:hmg_patient_app_new/widgets/routes/custom_page_route.dart'; import 'package:hmg_patient_app_new/widgets/transitions/fade_page.dart'; +import 'package:live_activities/live_activities.dart'; +// import 'package:live_activities/models/live_activity_file.dart'; +import 'package:live_activities/models/url_scheme_data.dart'; +import 'package:permission_handler/permission_handler.dart'; import 'package:provider/provider.dart'; import '../../../core/utils/utils.dart'; import '../../../theme/colors.dart'; import '../../radiology/radiology_orders_page.dart' show RadiologyOrdersPage; +class PatientQueue { + + final String? title; // for title of the notification + final String? contentText; // for the content of the notification + final String? currentTicket; + final String? status; + final String? currentlyServing; + final String? nextStep; + final int? nextStepBackground;// background will be same as of the [Utils.getCardButtonColor] + + const PatientQueue({this.title, this.contentText, this.currentTicket, this.status, this.currentlyServing, this.nextStep, this.nextStepBackground}); + + /// Converts this PatientQueue object to a map. + /// This is used for passing data to the native side for Live Activities. + Map toMap() { + return { + 'title': title, + 'contentText': contentText, + 'currentTicket': currentTicket, + 'status': status, + 'currentlyServing': currentlyServing, + 'nextStep': nextStep, + 'nextStepBackground': nextStepBackground, + }; + } +} -class SmallServiceCard extends StatelessWidget { +class SmallServiceCard extends StatefulWidget { final String serviceName; final String icon; final String title; @@ -39,89 +73,204 @@ class SmallServiceCard extends StatelessWidget { this.isBold = false, }); + @override + State createState() => _SmallServiceCardState(); +} + +class _SmallServiceCardState extends State { + StreamSubscription? urlSchemeSubscription; + final _liveActivitiesPlugin = LiveActivities(); + + String? _latestActivityId; + + + + PatientQueue? _patientQueue; + @override + void initState() { + _liveActivitiesPlugin.init( + appGroupId: 'group.alhabib.patientApp'); + super.initState(); + } + + + @override + void dispose() { + urlSchemeSubscription?.cancel(); + _liveActivitiesPlugin.dispose(); + super.dispose(); + } + @override Widget build(BuildContext context) { - return Padding( - padding: EdgeInsets.symmetric(horizontal: 0.h, vertical: 12.h), - child: Container( - decoration: RoundedRectangleBorder().toSmoothCornerDecoration( - color: backgroundColor, - borderRadius: 16, - ), - child: Padding( - padding: EdgeInsets.all(12.0), - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Utils.buildSvgWithAssets(icon: icon, iconColor: iconColor, width: 32.h, height: 32.h), - SizedBox(height: 6.h), - title.toText11(color: textColor, isBold: isBold, isCenter: true), - subtitle.toText11(color: textColor, isBold: isBold, isCenter: true), - ], - ), - ), - ), - ).onPress(() { - switch (serviceName) { - case "lab_results": - Navigator.of(context).push( - CustomPageRoute( - page: LabOrdersPage(), - ), - ); - break; - case "radiology_results": - Navigator.of(context).push( - CustomPageRoute( - page: RadiologyOrdersPage(), + return Column( + children: [ + Padding( + padding: EdgeInsets.symmetric(horizontal: 0.h, vertical: 12.h), + child: Container( + decoration: RoundedRectangleBorder().toSmoothCornerDecoration( + color: widget.backgroundColor, + borderRadius: 16, ), - ); - break; - case "prescriptions": - Navigator.of(context).push( - CustomPageRoute( - page: PrescriptionsListPage(), + child: Padding( + padding: EdgeInsets.all(12.0), + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Utils.buildSvgWithAssets(icon: widget.icon, iconColor: widget.iconColor, width: 32.h, height: 32.h), + SizedBox(height: 6.h), + widget.title.toText11(color: widget.textColor, isBold: widget.isBold, isCenter: true), + widget.subtitle.toText11(color: widget.textColor, isBold: widget.isBold, isCenter: true), + ], + ), ), - ); - break; - case "insurance_update": - Navigator.of(context).push( - CustomPageRoute( - page: InsuranceHomePage(), - ), - ); - break; + ), + ).onPress(() { + switch (widget.serviceName) { + case "lab_results": + Navigator.of(context).push( + CustomPageRoute( + page: LabOrdersPage(), + ), + ); + break; + case "radiology_results": + Navigator.of(context).push( + CustomPageRoute( + page: RadiologyOrdersPage(), + ), + ); + break; + case "prescriptions": + Navigator.of(context).push( + CustomPageRoute( + page: PrescriptionsListPage(), + ), + ); + break; + case "insurance_update": + Navigator.of(context).push( + CustomPageRoute( + page: InsuranceHomePage(), + ), + ); + break; - case "my_doctors": - Navigator.of(context).push( - CustomPageRoute( - page: MyDoctorsPage(), - ), - ); - break; + case "my_doctors": + Navigator.of(context).push( + CustomPageRoute( + page: MyDoctorsPage(), + ), + ); + break; + + case "sick_leaves": + Navigator.of(context).push( + CustomPageRoute( + page: PatientSickleavesListPage(), + ), + ); + break; + case "emergency": + context.read().flushData(); + context.read().getTransportationOrders(showLoader: false,); + context.read().getRRTOrders(showLoader: false,); + Navigator.of(context).push( + CustomPageRoute( + page: EmergencyServicesPage(), + settings: const RouteSettings(name: '/EmergencyServicesPage'), + ), + ); + break; + default: + // Handle unknown service + break; + } + }), + if (_latestActivityId == null) + TextButton( + onPressed: () async { + await _liveActivitiesPlugin.endAllActivities(); + await Permission.notification.request(); + _patientQueue = + PatientQueue( + title: "HMG", + contentText: "HMG Queue line", + currentTicket: "IME-1", + status: "Call for vital signs", + currentlyServing: "IME-3", + nextStep: "Please wait! you will be called for vital signs", + nextStepBackground: 2 + ); - case "sick_leaves": - Navigator.of(context).push( - CustomPageRoute( - page: PatientSickleavesListPage(), + final activityId = + await _liveActivitiesPlugin.createActivity( + DateTime.now().millisecondsSinceEpoch.toString(), + _patientQueue!.toMap(), + ); + print("ActivityID: $activityId"); + setState(() => _latestActivityId = activityId); + }, + child: const Column( + children: [ + Text('Start football match ⚽️'), + Text( + '(start a new live activity)', + style: TextStyle( + fontSize: 10, + fontStyle: FontStyle.italic, + ), + ), + ], ), - ); - break; - case "emergency": - context.read().flushData(); - context.read().getTransportationOrders(showLoader: false,); - context.read().getRRTOrders(showLoader: false,); - Navigator.of(context).push( - CustomPageRoute( - page: EmergencyServicesPage(), - settings: const RouteSettings(name: '/EmergencyServicesPage'), + ), + if (_latestActivityId == null) + TextButton( + onPressed: () async { + final supported = + await _liveActivitiesPlugin.areActivitiesEnabled(); + if (context.mounted) { + showDialog( + context: context, + builder: (BuildContext context) { + return AlertDialog( + content: Text( + supported ? 'Supported' : 'Not supported', + ), + actions: [ + TextButton( + onPressed: () => Navigator.of(context).pop(), + child: const Text('Close'), + ), + ], + ); + }, + ); + } + }, + child: const Text('Is live activities supported ? 🤔'), + ), + if (_latestActivityId != null) + TextButton( + onPressed: () { + _liveActivitiesPlugin.endAllActivities(); + _latestActivityId = null; + setState(() {}); + }, + child: const Column( + children: [ + Text('Stop match ✋'), + Text( + '(end all live activities)', + style: TextStyle( + fontSize: 10, + fontStyle: FontStyle.italic, + ), + ), + ], ), - ); - break; - default: - // Handle unknown service - break; - } - }); + ), + ], + ); } } diff --git a/lib/presentation/tele_consultation/zoom/call_screen.dart b/lib/presentation/tele_consultation/zoom/call_screen.dart index 21ad42f..a07eacf 100644 --- a/lib/presentation/tele_consultation/zoom/call_screen.dart +++ b/lib/presentation/tele_consultation/zoom/call_screen.dart @@ -1,1840 +1,1840 @@ -import 'dart:async'; -import 'dart:convert'; -import 'dart:io'; - -import 'package:flutter/cupertino.dart'; -import 'package:flutter/foundation.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter/services.dart'; -import 'package:flutter_hooks/flutter_hooks.dart'; -import 'package:flutter_ios_voip_kit_karmm/flutter_ios_voip_kit.dart'; -import 'package:flutter_zoom_videosdk/flutter_zoom_view.dart'; -import 'package:flutter_zoom_videosdk/native/zoom_videosdk.dart'; -import 'package:flutter_zoom_videosdk/native/zoom_videosdk_camera_device.dart'; -import 'package:flutter_zoom_videosdk/native/zoom_videosdk_cmd_channel.dart'; -import 'package:flutter_zoom_videosdk/native/zoom_videosdk_event_listener.dart'; -import 'package:flutter_zoom_videosdk/native/zoom_videosdk_live_transcription_message_info.dart'; -import 'package:flutter_zoom_videosdk/native/zoom_videosdk_share_action.dart'; -import 'package:flutter_zoom_videosdk/native/zoom_videosdk_user.dart'; -import 'package:get_it/get_it.dart'; -import 'package:hmg_patient_app_new/core/app_export.dart'; -import 'package:hmg_patient_app_new/core/cache_consts.dart'; -import 'package:hmg_patient_app_new/core/utils/jwt.dart'; -import 'package:hmg_patient_app_new/core/utils/utils.dart'; -import 'package:hmg_patient_app_new/extensions/string_extensions.dart'; -import 'package:hmg_patient_app_new/presentation/home/navigation_screen.dart'; -import 'package:hmg_patient_app_new/presentation/tele_consultation/zoom/video_view.dart'; -import 'package:hmg_patient_app_new/services/cache_service.dart'; -import 'package:hmg_patient_app_new/theme/colors.dart'; -import 'package:hmg_patient_app_new/widgets/routes/custom_page_route.dart'; -import 'package:image_picker/image_picker.dart'; - -class CallScreen extends StatefulHookWidget { - const CallScreen({Key? key}) : super(key: key); - - @override - State createState() => _CallScreenState(); -} - -class _CallScreenState extends State { - static TextEditingController changeNameController = TextEditingController(); - double opacityLevel = 1.0; - - final voIPKit = FlutterIOSVoIPKit.instance; - - bool isScreenBeingShared = false; - - void _changeOpacity() { - setState(() => opacityLevel = opacityLevel == 0 ? 1.0 : 0.0); - } - - @override - Widget build(BuildContext context) { - var zoom = ZoomVideoSdk(); - var eventListener = ZoomVideoSdkEventListener(); - var isInSession = useState(false); - var sessionName = useState(''); - var sessionPassword = useState(''); - var users = useState([]); - var fullScreenUser = useState(null); - var sharingUser = useState(null); - var videoInfo = useState(''); - var isSharing = useState(false); - var isMuted = useState(true); - var isVideoOn = useState(false); - var isSpeakerOn = useState(false); - var isRenameModalVisible = useState(false); - var isRecordingStarted = useState(false); - var isMicOriginalOn = useState(false); - var isMounted = useIsMounted(); - var audioStatusFlag = useState(false); - var videoStatusFlag = useState(false); - var userNameFlag = useState(false); - var userShareStatusFlag = useState(false); - var isReceiveSpokenLanguageContentEnabled = useState(false); - var isVideoMirrored = useState(false); - var isOriginalAspectRatio = useState(false); - var isPiPView = useState(false); - var isSharedCamera = useState(false); - CameraShareView cameraShareView = const CameraShareView(creationParams: {}); - - //hide status bar - SystemChrome.setEnabledSystemUIMode(SystemUiMode.leanBack); - var circleButtonSize = 65.0; - Color backgroundColor = const Color(0xFF232323); - Color buttonBackgroundColor = const Color.fromRGBO(0, 0, 0, 0.6); - Color chatTextColor = const Color(0xFFAAAAAA); - Widget changeNamePopup; - final args = ModalRoute.of(context)!.settings.arguments as CallArguments; - - useEffect(() { - Future.microtask(() async { - var token = generateJwt(args.sessionName, args.role); - - Utils.removeFromPrefs(CacheConst.isAppOpenedFromCall); - - try { - Map SDKaudioOptions = {"connect": true, "mute": false, "autoAdjustSpeakerVolume": false}; - Map SDKvideoOptions = { - "localVideoOn": true, - }; - JoinSessionConfig joinSession = JoinSessionConfig( - sessionName: args.sessionName, - sessionPassword: args.sessionPwd, - token: token, - userName: args.displayName, - audioOptions: SDKaudioOptions, - videoOptions: SDKvideoOptions, - sessionIdleTimeoutMins: int.parse(args.sessionIdleTimeoutMins), - ); - await zoom.joinSession(joinSession); - } catch (e) { - const AlertDialog( - title: Text("Error"), - content: Text("Failed to join the session"), - ); - Future.delayed(const Duration(milliseconds: 1000)).asStream().listen((event) { - Navigator.pushAndRemoveUntil( - context, - CustomPageRoute( - page: LandingNavigation(), - ), - (r) => false); - }); - } - }); - return null; - }, []); - - useEffect(() { - final sessionJoinListener = eventListener.addListener(EventType.onSessionJoin, (data) async { - data = data as Map; - isInSession.value = true; - zoom.session.getSessionName().then((value) => sessionName.value = value!); - sessionPassword.value = await zoom.session.getSessionPassword(); - debugPrint("sessionPhonePasscode: ${await zoom.session.getSessionPhonePasscode()}"); - ZoomVideoSdkUser mySelf = ZoomVideoSdkUser.fromJson(jsonDecode(data['sessionUser'])); - List? remoteUsers = await zoom.session.getRemoteUsers(); - var muted = await mySelf.audioStatus?.isMuted(); - var videoOn = await mySelf.videoStatus?.isOn(); - var speakerOn = await zoom.audioHelper.getSpeakerStatus(); - fullScreenUser.value = mySelf; - remoteUsers?.insert(0, mySelf); - isMuted.value = muted!; - isSpeakerOn.value = speakerOn; - isVideoOn.value = videoOn!; - users.value = remoteUsers!; - isReceiveSpokenLanguageContentEnabled.value = await zoom.liveTranscriptionHelper.isReceiveSpokenLanguageContentEnabled(); - }); - - final sessionLeaveListener = eventListener.addListener(EventType.onSessionLeave, (data) async { - data = data as Map; - debugPrint("onSessionLeave: ${data['reason']}"); - isInSession.value = false; - users.value = []; - fullScreenUser.value = null; - // Navigator.popAndPushNamed( - // context, - // "Join", - // arguments: JoinArguments(args.isJoin, sessionName.value, sessionPassword.value, args.displayName, args.sessionIdleTimeoutMins, args.role), - // ); - Navigator.pushAndRemoveUntil( - context, - CustomPageRoute( - page: LandingNavigation(), - ), - (r) => false); - }); - - final sessionNeedPasswordListener = eventListener.addListener(EventType.onSessionNeedPassword, (data) async { - showDialog( - context: context, - builder: (BuildContext context) => AlertDialog( - title: const Text('Session Need Password'), - content: const Text('Password is required'), - actions: [ - TextButton( - onPressed: () async => { - Navigator.pushAndRemoveUntil( - context, - CustomPageRoute( - page: LandingNavigation(), - ), - (r) => false), - await zoom.leaveSession(false), - }, - child: const Text('OK'), - ), - ], - ), - ); - }); - - final sessionPasswordWrongListener = eventListener.addListener(EventType.onSessionPasswordWrong, (data) async { - showDialog( - context: context, - builder: (BuildContext context) => AlertDialog( - title: const Text('Session Password Incorrect'), - content: const Text('Password is wrong'), - actions: [ - TextButton( - onPressed: () async => { - Navigator.popAndPushNamed(context, 'Join', arguments: JoinArguments(args.isJoin, args.sessionName, "", args.displayName, args.sessionIdleTimeoutMins, args.role)), - await zoom.leaveSession(false), - }, - child: const Text('OK'), - ), - ], - ), - ); - }); - - final userVideoStatusChangedListener = eventListener.addListener(EventType.onUserVideoStatusChanged, (data) async { - data = data as Map; - ZoomVideoSdkUser? mySelf = await zoom.session.getMySelf(); - var userListJson = jsonDecode(data['changedUsers']) as List; - List userList = userListJson.map((userJson) => ZoomVideoSdkUser.fromJson(userJson)).toList(); - for (var user in userList) { - { - if (user.userId == mySelf?.userId) { - mySelf?.videoStatus?.isOn().then((on) => isVideoOn.value = on); - } - } - } - videoStatusFlag.value = !videoStatusFlag.value; - }); - - final userAudioStatusChangedListener = eventListener.addListener(EventType.onUserAudioStatusChanged, (data) async { - data = data as Map; - ZoomVideoSdkUser? mySelf = await zoom.session.getMySelf(); - var userListJson = jsonDecode(data['changedUsers']) as List; - List userList = userListJson.map((userJson) => ZoomVideoSdkUser.fromJson(userJson)).toList(); - for (var user in userList) { - { - if (user.userId == mySelf?.userId) { - mySelf?.audioStatus?.isMuted().then((muted) => isMuted.value = muted); - } - } - } - audioStatusFlag.value = !audioStatusFlag.value; - }); - - final userShareStatusChangeListener = eventListener.addListener(EventType.onUserShareStatusChanged, (data) async { - data = data as Map; - ZoomVideoSdkUser? mySelf = await zoom.session.getMySelf(); - ZoomVideoSdkUser shareUser = ZoomVideoSdkUser.fromJson(jsonDecode(data['user'].toString())); - ZoomVideoSdkShareAction? shareAction = ZoomVideoSdkShareAction.fromJson(jsonDecode(data['shareAction'])); - - if (shareAction.shareStatus == ShareStatus.Start || shareAction.shareStatus == ShareStatus.Resume) { - sharingUser.value = shareUser; - fullScreenUser.value = shareUser; - isSharing.value = (shareUser.userId == mySelf?.userId); - - setState(() { - isScreenBeingShared = true; - }); - Future.delayed(const Duration(seconds: 2), () { - setState(() { - isScreenBeingShared = false; - }); - }); - } else { - sharingUser.value = null; - isSharing.value = false; - isSharedCamera.value = false; - fullScreenUser.value = mySelf; - isScreenBeingShared = false; - setState(() { - isScreenBeingShared = true; - }); - Future.delayed(const Duration(seconds: 2), () { - setState(() { - isScreenBeingShared = false; - }); - }); - } - userShareStatusFlag.value = !userShareStatusFlag.value; - }); - - final shareContentChangedListener = eventListener.addListener(EventType.onShareContentChanged, (data) async { - data = data as Map; - ZoomVideoSdkUser? mySelf = await zoom.session.getMySelf(); - ZoomVideoSdkUser shareUser = ZoomVideoSdkUser.fromJson(jsonDecode(data['user'].toString())); - ZoomVideoSdkShareAction? shareAction = ZoomVideoSdkShareAction.fromJson(jsonDecode(data['shareAction'])); - if (shareAction.shareType == ShareType.Camera) { - debugPrint("Camera share started"); - isSharedCamera.value = (shareUser.userId == mySelf?.userId); - } - }); - - final userJoinListener = eventListener.addListener(EventType.onUserJoin, (data) async { - if (!isMounted()) return; - data = data as Map; - ZoomVideoSdkUser? mySelf = await zoom.session.getMySelf(); - var userListJson = jsonDecode(data['remoteUsers']) as List; - List remoteUserList = userListJson.map((userJson) => ZoomVideoSdkUser.fromJson(userJson)).toList(); - remoteUserList.insert(0, mySelf!); - users.value = remoteUserList; - }); - - final userLeaveListener = eventListener.addListener(EventType.onUserLeave, (data) async { - if (!isMounted()) return; - ZoomVideoSdkUser? mySelf = await zoom.session.getMySelf(); - data = data as Map; - List? remoteUserList = await zoom.session.getRemoteUsers(); - var leftUserListJson = jsonDecode(data['leftUsers']) as List; - List leftUserLis = leftUserListJson.map((userJson) => ZoomVideoSdkUser.fromJson(userJson)).toList(); - if (fullScreenUser.value != null) { - for (var user in leftUserLis) { - { - if (fullScreenUser.value?.userId == user.userId) { - fullScreenUser.value = mySelf; - } - } - } - } else { - fullScreenUser.value = mySelf; - } - remoteUserList?.add(mySelf!); - users.value = remoteUserList!; - }); - - final userNameChangedListener = eventListener.addListener(EventType.onUserNameChanged, (data) async { - if (!isMounted()) return; - data = data as Map; - ZoomVideoSdkUser? changedUser = ZoomVideoSdkUser.fromJson(jsonDecode(data['changedUser'])); - int index; - for (var user in users.value) { - if (user.userId == changedUser.userId) { - index = users.value.indexOf(user); - users.value[index] = changedUser; - } - } - userNameFlag.value = !userNameFlag.value; - }); - - final commandReceived = eventListener.addListener(EventType.onCommandReceived, (data) async { - data = data as Map; - debugPrint("sender: ${ZoomVideoSdkUser.fromJson(jsonDecode(data['sender']))}, command: ${data['command']}"); - }); - - final liveStreamStatusChangeListener = eventListener.addListener(EventType.onLiveStreamStatusChanged, (data) async { - data = data as Map; - debugPrint("onLiveStreamStatusChanged: status: ${data['status']}"); - }); - - final liveTranscriptionStatusChangeListener = eventListener.addListener(EventType.onLiveTranscriptionStatus, (data) async { - data = data as Map; - debugPrint("onLiveTranscriptionStatus: status: ${data['status']}"); - }); - - final cloudRecordingStatusListener = eventListener.addListener(EventType.onCloudRecordingStatus, (data) async { - data = data as Map; - debugPrint("onCloudRecordingStatus: status: ${data['status']}"); - ZoomVideoSdkUser? mySelf = await zoom.session.getMySelf(); - if (data['status'] == RecordingStatus.Start) { - if (mySelf != null && !mySelf.isHost!) { - showDialog( - context: context, - builder: (BuildContext context) => AlertDialog( - content: const Text('The session is being recorded.'), - actions: [ - TextButton( - onPressed: () async { - await zoom.acceptRecordingConsent(); - if (context.mounted) { - Navigator.pop(context); - } - ; - }, - child: const Text('accept'), - ), - TextButton( - onPressed: () async { - String currentConsentType = await zoom.getRecordingConsentType(); - if (currentConsentType == ConsentType.ConsentType_Individual) { - await zoom.declineRecordingConsent(); - Navigator.pop(context); - } else { - await zoom.declineRecordingConsent(); - zoom.leaveSession(false); - if (!context.mounted) return; - Navigator.popAndPushNamed( - context, - "Join", - arguments: JoinArguments(args.isJoin, sessionName.value, sessionPassword.value, args.displayName, args.sessionIdleTimeoutMins, args.role), - ); - } - }, - child: const Text('decline'), - ), - ], - ), - ); - } - isRecordingStarted.value = true; - } else { - isRecordingStarted.value = false; - } - }); - - final liveTranscriptionMsgInfoReceivedListener = eventListener.addListener(EventType.onLiveTranscriptionMsgInfoReceived, (data) async { - data = data as Map; - ZoomVideoSdkLiveTranscriptionMessageInfo? messageInfo = ZoomVideoSdkLiveTranscriptionMessageInfo.fromJson(jsonDecode(data['messageInfo'])); - debugPrint("onLiveTranscriptionMsgInfoReceived: content: ${messageInfo.messageContent}"); - }); - - final inviteByPhoneStatusListener = eventListener.addListener(EventType.onInviteByPhoneStatus, (data) async { - data = data as Map; - debugPrint("onInviteByPhoneStatus: status: ${data['status']}, reason: ${data['reason']}"); - }); - - final multiCameraStreamStatusChangedListener = eventListener.addListener(EventType.onMultiCameraStreamStatusChanged, (data) async { - data = data as Map; - ZoomVideoSdkUser? changedUser = ZoomVideoSdkUser.fromJson(jsonDecode(data['changedUser'])); - var status = data['status']; - for (var user in users.value) { - { - if (changedUser.userId == user.userId) { - if (status == MultiCameraStreamStatus.Joined) { - user.hasMultiCamera = true; - } else if (status == MultiCameraStreamStatus.Left) { - user.hasMultiCamera = false; - } - } - } - } - }); - - final requireSystemPermission = eventListener.addListener(EventType.onRequireSystemPermission, (data) async { - data = data as Map; - ZoomVideoSdkUser? changedUser = ZoomVideoSdkUser.fromJson(jsonDecode(data['changedUser'])); - var permissionType = data['permissionType']; - switch (permissionType) { - case SystemPermissionType.Camera: - showDialog( - context: context, - builder: (BuildContext context) => AlertDialog( - title: const Text("Can't Access Camera"), - content: const Text("please turn on the toggle in system settings to grant permission"), - actions: [ - TextButton( - onPressed: () => Navigator.pop(context, 'OK'), - child: const Text('OK'), - ), - ], - ), - ); - break; - case SystemPermissionType.Microphone: - showDialog( - context: context, - builder: (BuildContext context) => AlertDialog( - title: const Text("Can't Access Microphone"), - content: const Text("please turn on the toggle in system settings to grant permission"), - actions: [ - TextButton( - onPressed: () => Navigator.pop(context, 'OK'), - child: const Text('OK'), - ), - ], - ), - ); - break; - } - }); - - final networkStatusChangeListener = eventListener.addListener(EventType.onUserVideoNetworkStatusChanged, (data) async { - data = data as Map; - ZoomVideoSdkUser? networkUser = ZoomVideoSdkUser.fromJson(jsonDecode(data['user'])); - - if (data['status'] == NetworkStatus.Bad) { - debugPrint("onUserVideoNetworkStatusChanged: status: ${data['status']}, user: ${networkUser.userName}"); - } - }); - - final eventErrorListener = eventListener.addListener(EventType.onError, (data) async { - data = data as Map; - String errorType = data['errorType']; - showDialog( - context: context, - builder: (BuildContext context) => AlertDialog( - title: const Text("Error"), - content: Text(errorType), - actions: [ - TextButton( - onPressed: () => Navigator.pop(context, 'OK'), - child: const Text('OK'), - ), - ], - ), - ); - if (errorType == Errors.SessionJoinFailed || errorType == Errors.SessionDisconnecting) { - Timer( - const Duration(milliseconds: 1000), - () => { - Navigator.popAndPushNamed( - context, - "Join", - arguments: JoinArguments(args.isJoin, sessionName.value, sessionPassword.value, args.displayName, args.sessionIdleTimeoutMins, args.role), - ), - }); - } - }); - - final userRecordingConsentListener = eventListener.addListener(EventType.onUserRecordingConsent, (data) async { - data = data as Map; - ZoomVideoSdkUser? user = ZoomVideoSdkUser.fromJson(jsonDecode(data['user'])); - debugPrint('userRecordingConsentListener: user= ${user.userName}'); - }); - - final callCRCDeviceStatusListener = eventListener.addListener(EventType.onCallCRCDeviceStatusChanged, (data) async { - data = data as Map; - debugPrint('onCallCRCDeviceStatusChanged: status = ${data['status']}'); - }); - - final originalLanguageMsgReceivedListener = eventListener.addListener(EventType.onOriginalLanguageMsgReceived, (data) async { - data = data as Map; - ZoomVideoSdkLiveTranscriptionMessageInfo? messageInfo = ZoomVideoSdkLiveTranscriptionMessageInfo.fromJson(jsonDecode(data['messageInfo'])); - debugPrint("onOriginalLanguageMsgReceived: content: ${messageInfo.messageContent}"); - }); - - final chatPrivilegeChangedListener = eventListener.addListener(EventType.onChatPrivilegeChanged, (data) async { - data = data as Map; - String type = data['privilege']; - debugPrint('chatPrivilegeChangedListener: type= $type'); - }); - - final testMicStatusListener = eventListener.addListener(EventType.onTestMicStatusChanged, (data) async { - data = data as Map; - String status = data['status']; - debugPrint('testMicStatusListener: status= $status'); - }); - - final micSpeakerVolumeChangedListener = eventListener.addListener(EventType.onMicSpeakerVolumeChanged, (data) async { - data = data as Map; - int type = data['micVolume']; - debugPrint('onMicSpeakerVolumeChanged: micVolume= $type, speakerVolume'); - }); - - final cameraControlRequestResultListener = eventListener.addListener(EventType.onCameraControlRequestResult, (data) async { - data = data as Map; - bool approved = data['approved']; - debugPrint('onCameraControlRequestResult: approved= $approved'); - }); - - final callOutUserJoinListener = eventListener.addListener(EventType.onCalloutJoinSuccess, (data) async { - data = data as Map; - String phoneNumber = data['phoneNumber']; - ZoomVideoSdkUser? user = ZoomVideoSdkUser.fromJson(jsonDecode(data['user'])); - debugPrint('onCalloutJoinSuccess: phoneNumber= $phoneNumber, user= ${user.userName}'); - }); - - return () => { - sessionJoinListener.cancel(), - sessionLeaveListener.cancel(), - sessionPasswordWrongListener.cancel(), - sessionNeedPasswordListener.cancel(), - userVideoStatusChangedListener.cancel(), - userAudioStatusChangedListener.cancel(), - userJoinListener.cancel(), - userLeaveListener.cancel(), - userNameChangedListener.cancel(), - userShareStatusChangeListener.cancel(), - liveStreamStatusChangeListener.cancel(), - cloudRecordingStatusListener.cancel(), - inviteByPhoneStatusListener.cancel(), - eventErrorListener.cancel(), - commandReceived.cancel(), - liveTranscriptionStatusChangeListener.cancel(), - liveTranscriptionMsgInfoReceivedListener.cancel(), - multiCameraStreamStatusChangedListener.cancel(), - requireSystemPermission.cancel(), - userRecordingConsentListener.cancel(), - networkStatusChangeListener.cancel(), - callCRCDeviceStatusListener.cancel(), - originalLanguageMsgReceivedListener.cancel(), - chatPrivilegeChangedListener.cancel(), - testMicStatusListener.cancel(), - micSpeakerVolumeChangedListener.cancel(), - cameraControlRequestResultListener.cancel(), - callOutUserJoinListener.cancel(), - shareContentChangedListener.cancel(), - }; - }, [zoom, users.value, isMounted]); - - void selectVirtualBackgroundItem() async { - final ImagePicker picker = ImagePicker(); - // Pick an image. - final XFile? image = await picker.pickImage(source: ImageSource.gallery); - await zoom.virtualBackgroundHelper.addVirtualBackgroundItem(image!.path); - } - - void onPressAudio() async { - ZoomVideoSdkUser? mySelf = await zoom.session.getMySelf(); - if (mySelf != null) { - final audioStatus = mySelf.audioStatus; - if (audioStatus != null) { - var muted = await audioStatus.isMuted(); - if (muted) { - await zoom.audioHelper.unMuteAudio(mySelf.userId); - } else { - await zoom.audioHelper.muteAudio(mySelf.userId); - } - } - } - } - - void onPressVideo() async { - ZoomVideoSdkUser? mySelf = await zoom.session.getMySelf(); - if (mySelf != null) { - final videoStatus = mySelf.videoStatus; - if (videoStatus != null) { - var videoOn = await videoStatus.isOn(); - if (videoOn) { - await zoom.videoHelper.stopVideo(); - } else { - await zoom.videoHelper.startVideo(); - } - } - } - } - - void onPressShare() async { - var isOtherSharing = await zoom.shareHelper.isOtherSharing(); - var isShareLocked = await zoom.shareHelper.isShareLocked(); - String? shareCameraViewResult = Errors.InternalError; - - if (isOtherSharing) { - showDialog( - context: context, - builder: (BuildContext context) => AlertDialog( - title: const Text("Error"), - content: const Text('Other is sharing'), - actions: [ - TextButton( - onPressed: () => Navigator.pop(context, 'OK'), - child: const Text('OK'), - ), - ], - ), - ); - } else if (isShareLocked) { - showDialog( - context: context, - builder: (BuildContext context) => AlertDialog( - title: const Text("Error"), - content: const Text('Share is locked by host'), - actions: [ - TextButton( - onPressed: () => Navigator.pop(context, 'OK'), - child: const Text('OK'), - ), - ], - ), - ); - } else if (isSharing.value) { - zoom.shareHelper.stopShare(); - } else { - List options = [ - ListTile( - title: Text( - 'Share Device Screen', - style: TextStyle( - fontSize: 14, - fontWeight: FontWeight.normal, - color: Colors.black, - ), - ), - onTap: () async => { - zoom.shareHelper.shareScreen(), - Navigator.of(context).pop(), - }, - ), - ListTile( - title: Text( - 'Share Camera', - style: TextStyle( - fontSize: 14, - fontWeight: FontWeight.normal, - color: Colors.black, - ), - ), - onTap: () async => { - shareCameraViewResult = await zoom.shareHelper.startShareCamera(cameraShareView), - debugPrint('start camera: $shareCameraViewResult'), - Navigator.of(context).pop(), - }, - ), - ]; - showDialog( - context: context, - builder: (context) { - return Dialog( - elevation: 0.0, - insetPadding: const EdgeInsets.symmetric(horizontal: 40), - shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(20)), - child: SizedBox( - height: options.length * 60, - child: Scrollbar( - child: ListView( - shrinkWrap: true, - scrollDirection: Axis.vertical, - children: ListTile.divideTiles( - context: context, - tiles: options, - ).toList(), - ), - ), - ), - ); - }); - } - } - - void onSelectedUserVolume(ZoomVideoSdkUser user) async { - var isShareAudio = user.isSharing; - bool canSetVolume = await user.canSetUserVolume(user.userId, isShareAudio); - num userVolume; - - List options = [ - ListTile( - title: Text( - 'Adjust Volume', - style: const TextStyle( - fontSize: 18, - fontWeight: FontWeight.w600, - color: Colors.black, - ), - ), - ), - ListTile( - title: Text( - 'Current volume', - style: const TextStyle( - fontSize: 14, - fontWeight: FontWeight.normal, - color: Colors.black, - ), - ), - onTap: () async => { - debugPrint('user volume'), - userVolume = await user.getUserVolume(user.userId, isShareAudio), - debugPrint('user ${user.userName}\'s volume is ${userVolume!}'), - }, - ), - ]; - if (canSetVolume) { - options.add( - ListTile( - title: Text( - 'Volume up', - style: const TextStyle( - fontSize: 14, - fontWeight: FontWeight.normal, - color: Colors.black, - ), - ), - onTap: () async => { - userVolume = await user.getUserVolume(user.userId, isShareAudio), - if (userVolume < 10) - { - await user.setUserVolume(user.userId, userVolume + 1, isShareAudio), - } - else - { - debugPrint("Cannot volume up."), - } - }, - ), - ); - options.add( - ListTile( - title: Text( - 'Volume down', - style: const TextStyle( - fontSize: 14, - fontWeight: FontWeight.normal, - color: Colors.black, - ), - ), - onTap: () async => { - userVolume = await user.getUserVolume(user.userId, isShareAudio), - if (userVolume > 0) - { - await user.setUserVolume(user.userId, userVolume - 1, isShareAudio), - } - else - { - debugPrint("Cannot volume down."), - } - }, - ), - ); - } - showDialog( - context: context, - builder: (context) { - return Dialog( - elevation: 0.0, - insetPadding: const EdgeInsets.symmetric(horizontal: 40), - shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(20)), - child: SizedBox( - height: options.length * 58, - child: Column( - crossAxisAlignment: CrossAxisAlignment.stretch, - children: [ - ListView( - shrinkWrap: true, - children: ListTile.divideTiles( - context: context, - tiles: options, - ).toList(), - ), - ], - ), - )); - }); - } - - void onPressCameraList() async { - List options = []; - List cameraList = await zoom.videoHelper.getCameraList(); - for (var camera in cameraList) { - options.add( - ListTile( - title: Text( - camera.deviceName, - style: const TextStyle( - fontSize: 14, - fontWeight: FontWeight.normal, - color: Colors.black, - ), - ), - onTap: () async => { - await zoom.videoHelper.switchCamera(camera.deviceId), - Navigator.of(context).pop(), - }, - ), - ); - } - options.add( - ListTile( - title: Text( - "Cancel", - style: const TextStyle( - fontSize: 14, - fontWeight: FontWeight.normal, - color: Colors.black, - ), - ), - onTap: () async => { - Navigator.of(context).pop(), - }, - ), - ); - showDialog( - context: context, - builder: (context) { - return Dialog( - elevation: 0.0, - insetPadding: const EdgeInsets.symmetric(horizontal: 40), - shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(20)), - child: SizedBox( - height: options.length * 60, - child: Scrollbar( - child: ListView( - shrinkWrap: true, - scrollDirection: Axis.vertical, - children: ListTile.divideTiles( - context: context, - tiles: options, - ).toList(), - ), - ), - ), - ); - }); - } - - // Future onPressMore() async { - // ZoomVideoSdkUser? mySelf = await zoom.session.getMySelf(); - // bool isShareLocked = await zoom.shareHelper.isShareLocked(); - // bool canSwitchSpeaker = await zoom.audioHelper.canSwitchSpeaker(); - // bool canStartRecording = (await zoom.recordingHelper.canStartRecording()) == Errors.Success; - // debugPrint("canStartRecording ${await zoom.recordingHelper.canStartRecording()}"); - // var startLiveTranscription = (await zoom.liveTranscriptionHelper.getLiveTranscriptionStatus()) == LiveTranscriptionStatus.Start; - // bool canStartLiveTranscription = await zoom.liveTranscriptionHelper.canStartLiveTranscription(); - // bool isHost = (mySelf != null) ? (await mySelf.getIsHost()) : false; - // isOriginalAspectRatio.value = await zoom.videoHelper.isOriginalAspectRatioEnabled(); - // bool canCallOutToCRC = await zoom.CRCHelper.isCRCEnabled(); - // bool supportVB = await zoom.virtualBackgroundHelper.isSupportVirtualBackground(); - // List? shareActionList = await mySelf?.getShareActionList(); - // - // List options = [ - // ListTile( - // title: Text( - // 'More', - // style: GoogleFonts.lato( - // textStyle: const TextStyle( - // fontSize: 18, - // fontWeight: FontWeight.w600, - // color: Colors.black, - // ), - // ), - // ), - // ), - // ListTile( - // title: Text( - // 'Get Chat Privilege', - // style: GoogleFonts.lato( - // textStyle: const TextStyle( - // fontSize: 14, - // fontWeight: FontWeight.normal, - // color: Colors.black, - // ), - // ), - // ), - // onTap: () async => { - // debugPrint("Chat Privilege = ${await zoom.chatHelper.getChatPrivilege()}"), - // Navigator.of(context).pop(), - // }, - // ), - // ListTile( - // title: Text( - // 'Get Session Dial-in Number infos', - // style: GoogleFonts.lato( - // textStyle: const TextStyle( - // fontSize: 14, - // fontWeight: FontWeight.normal, - // color: Colors.black, - // ), - // ), - // ), - // onTap: () async => { - // debugPrint("session number = ${await zoom.session.getSessionNumber()}"), - // Navigator.of(context).pop(), - // }, - // ), - // ListTile( - // title: Text( - // 'Get Camera List', - // style: GoogleFonts.lato( - // textStyle: const TextStyle( - // fontSize: 14, - // fontWeight: FontWeight.normal, - // color: Colors.black, - // ), - // ), - // ), - // onTap: () async => { - // debugPrint("camera list= ${await zoom.videoHelper.getCameraList()}"), - // onPressCameraList(), - // Navigator.of(context).pop(), - // }, - // ), - // ListTile( - // title: Text( - // '${isMicOriginalOn.value ? 'Disable' : 'Enable'} Original Sound', - // style: GoogleFonts.lato( - // textStyle: const TextStyle( - // fontSize: 14, - // fontWeight: FontWeight.normal, - // color: Colors.black, - // ), - // ), - // ), - // onTap: () async => { - // debugPrint("${isMicOriginalOn.value}"), - // await zoom.audioSettingHelper.enableMicOriginalInput(!isMicOriginalOn.value), - // isMicOriginalOn.value = await zoom.audioSettingHelper.isMicOriginalInputEnable(), - // debugPrint("Original sound ${isMicOriginalOn.value ? 'Enabled' : 'Disabled'}"), - // Navigator.of(context).pop(), - // }, - // ) - // ]; - // - // if (supportVB) { - // options.add( - // ListTile( - // title: Text( - // 'Add Virtual Background', - // style: GoogleFonts.lato( - // textStyle: const TextStyle( - // fontSize: 14, - // fontWeight: FontWeight.normal, - // color: Colors.black, - // ), - // ), - // ), - // onTap: () async => { - // selectVirtualBackgroundItem(), - // Navigator.of(context).pop(), - // }, - // ), - // ); - // } - // - // if (canCallOutToCRC) { - // options.add(ListTile( - // title: Text( - // 'Call-out to CRC devices', - // style: GoogleFonts.lato( - // textStyle: const TextStyle( - // fontSize: 14, - // fontWeight: FontWeight.normal, - // color: Colors.black, - // ), - // ), - // ), - // onTap: () async => { - // debugPrint('CRC result = ${await zoom.CRCHelper.callCRCDevice("bjn.vc", ZoomVideoSdkCRCProtocolType.SIP)}'), - // Navigator.of(context).pop(), - // }, - // )); - // options.add(ListTile( - // title: Text( - // 'Cancel call-out to CRC devices', - // style: GoogleFonts.lato( - // textStyle: const TextStyle( - // fontSize: 14, - // fontWeight: FontWeight.normal, - // color: Colors.black, - // ), - // ), - // ), - // onTap: () async => { - // debugPrint('cancel result= ${await zoom.CRCHelper.cancelCallCRCDevice()}'), - // Navigator.of(context).pop(), - // }, - // )); - // } - // - // if (canSwitchSpeaker) { - // options.add(ListTile( - // title: Text( - // 'Turn ${isSpeakerOn.value ? 'off' : 'on'} Speaker', - // style: GoogleFonts.lato( - // textStyle: const TextStyle( - // fontSize: 14, - // fontWeight: FontWeight.normal, - // color: Colors.black, - // ), - // ), - // ), - // onTap: () async => { - // await zoom.audioHelper.setSpeaker(!isSpeakerOn.value), - // isSpeakerOn.value = await zoom.audioHelper.getSpeakerStatus(), - // debugPrint('Turned ${isSpeakerOn.value ? 'on' : 'off'} Speaker'), - // Navigator.of(context).pop(), - // }, - // )); - // } - // - // if (isHost) { - // options.add(ListTile( - // title: Text( - // '${isShareLocked ? 'Unlock' : 'Lock'} Share', - // style: GoogleFonts.lato( - // textStyle: const TextStyle( - // fontSize: 14, - // fontWeight: FontWeight.normal, - // color: Colors.black, - // ), - // ), - // ), - // onTap: () async => { - // debugPrint("isShareLocked = ${await zoom.shareHelper.lockShare(!isShareLocked)}"), - // Navigator.of(context).pop(), - // })); - // options.add(ListTile( - // title: Text( - // 'Change Name', - // style: GoogleFonts.lato( - // textStyle: const TextStyle( - // fontSize: 14, - // fontWeight: FontWeight.normal, - // color: Colors.black, - // ), - // ), - // ), - // onTap: () => { - // isRenameModalVisible.value = true, - // Navigator.of(context).pop(), - // }, - // )); - // } - // - // if (canStartLiveTranscription) { - // options.add(ListTile( - // title: Text( - // "${startLiveTranscription ? 'Stop' : 'Start'} Live Transcription", - // style: GoogleFonts.lato( - // textStyle: const TextStyle( - // fontSize: 14, - // fontWeight: FontWeight.normal, - // color: Colors.black, - // ), - // ), - // ), - // onTap: () async => { - // if (startLiveTranscription) - // { - // debugPrint('stopLiveTranscription= ${await zoom.liveTranscriptionHelper.stopLiveTranscription()}'), - // } - // else - // { - // debugPrint('startLiveTranscription= ${await zoom.liveTranscriptionHelper.startLiveTranscription()}'), - // }, - // Navigator.of(context).pop(), - // }, - // )); - // options.add(ListTile( - // title: Text( - // '${isReceiveSpokenLanguageContentEnabled.value ? 'Disable' : 'Enable'} receiving original caption', - // style: GoogleFonts.lato( - // textStyle: const TextStyle( - // fontSize: 14, - // fontWeight: FontWeight.normal, - // color: Colors.black, - // ), - // ), - // ), - // onTap: () async => { - // await zoom.liveTranscriptionHelper.enableReceiveSpokenLanguageContent(!isReceiveSpokenLanguageContentEnabled.value), - // isReceiveSpokenLanguageContentEnabled.value = await zoom.liveTranscriptionHelper.isReceiveSpokenLanguageContentEnabled(), - // debugPrint("isReceiveSpokenLanguageContentEnabled = ${isReceiveSpokenLanguageContentEnabled.value}"), - // Navigator.of(context).pop(), - // })); - // } - // - // if (canStartRecording) { - // options.add(ListTile( - // title: Text( - // '${isRecordingStarted.value ? 'Stop' : 'Start'} Recording', - // style: GoogleFonts.lato( - // textStyle: const TextStyle( - // fontSize: 14, - // fontWeight: FontWeight.normal, - // color: Colors.black, - // ), - // ), - // ), - // onTap: () async => { - // if (!isRecordingStarted.value) - // { - // debugPrint('isRecordingStarted = ${await zoom.recordingHelper.startCloudRecording()}'), - // } - // else - // { - // debugPrint('isRecordingStarted = ${await zoom.recordingHelper.stopCloudRecording()}'), - // }, - // Navigator.of(context).pop(), - // })); - // } - // - // if (Platform.isAndroid) { - // bool isFlashlightSupported = await zoom.videoHelper.isSupportFlashlight(); - // bool isFlashlightOn = await zoom.videoHelper.isFlashlightOn(); - // if (isFlashlightSupported) { - // options.add(ListTile( - // title: Text( - // '${isFlashlightOn ? 'Turn Off' : 'Turn On'} Flashlight', - // style: GoogleFonts.lato( - // textStyle: const TextStyle( - // fontSize: 14, - // fontWeight: FontWeight.normal, - // color: Colors.black, - // ), - // ), - // ), - // onTap: () async => { - // if (!isFlashlightOn) - // { - // await zoom.videoHelper.turnOnOrOffFlashlight(true), - // } - // else - // { - // await zoom.videoHelper.turnOnOrOffFlashlight(false), - // }, - // Navigator.of(context).pop(), - // })); - // } - // } - // - // if (Platform.isIOS) { - // options.add(ListTile( - // title: Text( - // '${isPiPView.value ? 'Disable' : 'Enable'} picture in picture view', - // style: GoogleFonts.lato( - // textStyle: const TextStyle( - // fontSize: 14, - // fontWeight: FontWeight.normal, - // color: Colors.black, - // ), - // ), - // ), - // onTap: () async => { - // isPiPView.value = !isPiPView.value, - // Navigator.of(context).pop(), - // })); - // } - // - // if (isVideoOn.value) { - // options.add(ListTile( - // title: Text( - // 'Mirror the video', - // style: GoogleFonts.lato( - // textStyle: const TextStyle( - // fontSize: 14, - // fontWeight: FontWeight.normal, - // color: Colors.black, - // ), - // ), - // ), - // onTap: () async => { - // await zoom.videoHelper.mirrorMyVideo(!isVideoMirrored.value), - // isVideoMirrored.value = await zoom.videoHelper.isMyVideoMirrored(), - // Navigator.of(context).pop(), - // })); - // options.add(ListTile( - // title: Text( - // '${isOriginalAspectRatio.value ? 'Enable' : 'Disable'} original aspect ratio', - // style: GoogleFonts.lato( - // textStyle: const TextStyle( - // fontSize: 14, - // fontWeight: FontWeight.normal, - // color: Colors.black, - // ), - // ), - // ), - // onTap: () async => { - // await zoom.videoHelper.enableOriginalAspectRatio(!isOriginalAspectRatio.value), - // isOriginalAspectRatio.value = await zoom.videoHelper.isOriginalAspectRatioEnabled(), - // debugPrint("isOriginalAspectRatio= ${isOriginalAspectRatio.value}"), - // Navigator.of(context).pop(), - // })); - // } - // - // showDialog( - // context: context, - // builder: (context) { - // return Dialog( - // elevation: 0.0, - // insetPadding: const EdgeInsets.symmetric(horizontal: 40), - // shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(20)), - // child: SizedBox( - // height: 500, - // child: Scrollbar( - // child: ListView( - // shrinkWrap: true, - // scrollDirection: Axis.vertical, - // children: ListTile.divideTiles( - // context: context, - // tiles: options, - // ).toList(), - // ), - // ), - // ), - // ); - // }); - // } - - void onLeaveSession(bool isEndSession) async { - await zoom.leaveSession(isEndSession); - Navigator.pushAndRemoveUntil( - context, - CustomPageRoute( - page: LandingNavigation(), - ), - (r) => false); - } - - void showLeaveOptions() async { - ZoomVideoSdkUser? mySelf = await zoom.session.getMySelf(); - bool isHost = await mySelf!.getIsHost(); - - Widget endSession; - Widget leaveSession; - Widget cancel = TextButton( - child: const Text('Cancel'), - onPressed: () { - Navigator.pop(context); //close Dialog - }, - ); - - switch (defaultTargetPlatform) { - case TargetPlatform.android: - endSession = TextButton( - child: const Text('End Session'), - onPressed: () => onLeaveSession(true), - ); - leaveSession = TextButton( - child: const Text('Leave Session'), - onPressed: () => onLeaveSession(false), - ); - break; - default: - endSession = CupertinoActionSheetAction( - isDestructiveAction: true, - child: const Text('End Session'), - onPressed: () => onLeaveSession(true), - ); - leaveSession = CupertinoActionSheetAction( - child: const Text('Leave Session'), - onPressed: () => onLeaveSession(false), - ); - break; - } - - List options = [ - leaveSession, - cancel, - ]; - - if (Platform.isAndroid) { - if (isHost) { - options.removeAt(1); - options.insert(0, endSession); - } - showDialog( - context: context, - builder: (context) { - return AlertDialog( - content: const Text("Do you want to leave this session?"), - shape: const RoundedRectangleBorder(borderRadius: BorderRadius.all(Radius.circular(2.0))), - actions: options, - ); - }); - } else { - options.removeAt(1); - if (isHost) { - options.insert(1, endSession); - } - showCupertinoModalPopup( - context: context, - builder: (context) => CupertinoActionSheet( - message: const Text('Are you sure that you want to leave the session?'), - actions: options, - cancelButton: cancel, - ), - ); - } - } - - final chatMessageController = TextEditingController(); - - void sendChatMessage(String message) async { - await zoom.chatHelper.sendChatToAll(message); - ZoomVideoSdkUser? self = await zoom.session.getMySelf(); - ZoomVideoSdkCmdChannel cmdChannel = zoom.cmdChannel; - for (var user in users.value) { - if (user.userId != self?.userId) { - await zoom.cmdChannel.sendCommand(user.userId, message); - } - } - chatMessageController.clear(); - // send the chat as a command - } - - void onSelectedUser(ZoomVideoSdkUser user) async { - setState(() { - fullScreenUser.value = user; - }); - } - - changeNamePopup = Center( - child: Stack( - children: [ - Visibility( - visible: isRenameModalVisible.value, - child: Row( - mainAxisSize: MainAxisSize.min, - children: [ - Container( - alignment: Alignment.bottomLeft, - decoration: const BoxDecoration( - borderRadius: BorderRadius.all(Radius.circular(10)), - color: Colors.white, - ), - width: MediaQuery.of(context).size.width - 130, - height: MediaQuery.of(context).size.height * 0.2, - child: Center( - child: (Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Padding( - padding: const EdgeInsets.only(top: 20, left: 20), - child: Text( - 'Change Name', - style: const TextStyle( - fontSize: 18, - fontWeight: FontWeight.w500, - ), - ), - ), - Padding( - padding: const EdgeInsets.only(top: 10, left: 20), - child: SizedBox( - width: MediaQuery.of(context).size.width - 230, - child: TextField( - onEditingComplete: () {}, - autofocus: true, - cursorColor: Colors.black, - controller: changeNameController, - decoration: InputDecoration( - isDense: true, - hintText: 'New name', - hintStyle: TextStyle( - fontSize: 14.0, - color: chatTextColor, - ), - ), - ), - ), - ), - Padding( - padding: const EdgeInsets.only(top: 15), - child: Row( - children: [ - Padding( - padding: const EdgeInsets.only(left: 40), - child: InkWell( - child: Text( - 'Apply', - style: const TextStyle( - fontSize: 16, - ), - ), - onTap: () async { - if (fullScreenUser.value != null) { - ZoomVideoSdkUser? mySelf = await zoom.session.getMySelf(); - await zoom.userHelper.changeName((mySelf?.userId)!, changeNameController.text); - changeNameController.clear(); - } - isRenameModalVisible.value = false; - }, - ), - ), - Padding( - padding: const EdgeInsets.only(left: 40), - child: InkWell( - child: Text( - 'Cancel', - style: const TextStyle( - fontSize: 16, - ), - ), - onTap: () async { - isRenameModalVisible.value = false; - }, - ), - ) - ], - ), - ) - ], - )), - ), - ), - ], - )), - ], - ), - ); - - Widget fullScreenView; - Widget smallView; - Widget cameraView; - - if (isInSession.value && fullScreenUser.value != null && users.value.isNotEmpty) { - fullScreenView = AnimatedOpacity( - opacity: opacityLevel, - duration: const Duration(seconds: 3), - child: VideoView( - user: users.value.length > 1 ? users.value[1] : users.value[0], - hasMultiCamera: false, - isPiPView: isPiPView.value, - sharing: sharingUser.value == null ? false : (sharingUser.value?.userId == fullScreenUser.value?.userId), - preview: false, - focused: false, - multiCameraIndex: "0", - videoAspect: VideoAspect.Original, - fullScreen: true, - resolution: VideoResolution.Resolution360, - ), - ); - - smallView = Container( - height: 110, - margin: const EdgeInsets.only(left: 20, right: 20), - alignment: Alignment.center, - child: ListView.separated( - scrollDirection: Axis.horizontal, - itemCount: users.value.length, - itemBuilder: (BuildContext context, int index) { - return InkWell( - onTap: () async { - onSelectedUser(users.value[index]); - }, - onDoubleTap: () async { - onSelectedUserVolume(users.value[index]); - }, - child: Center( - child: VideoView( - user: users.value[index], - hasMultiCamera: false, - isPiPView: false, - sharing: false, - preview: false, - focused: false, - multiCameraIndex: "0", - videoAspect: VideoAspect.Original, - fullScreen: false, - resolution: VideoResolution.Resolution180, - ), - ), - ); - }, - separatorBuilder: (BuildContext context, int index) => const Divider(), - ), - ); - } else { - fullScreenView = Container( - color: Colors.black, - child: const Center( - child: Text( - "Connecting...", - style: TextStyle( - fontSize: 20, - color: Colors.white, - ), - ), - )); - smallView = Container( - height: 110, - color: Colors.transparent, - ); - } - - cameraView = Offstage( - offstage: !isSharedCamera.value, - child: AnimatedOpacity( - opacity: isSharedCamera.value ? 1.0 : 0.0, - duration: const Duration(milliseconds: 300), - child: cameraShareView, - ), - ); - - _changeOpacity; - return Scaffold( - resizeToAvoidBottomInset: false, - backgroundColor: backgroundColor, - body: Stack( - children: [ - // isScreenBeingShared ? fullScreenView : SizedBox.shrink(), - isScreenBeingShared ? SizedBox.shrink() : fullScreenView, - cameraView, - Container( - padding: const EdgeInsets.only(top: 35), - child: Stack( - children: [ - Row( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Container( - height: 80, - width: 180, - margin: const EdgeInsets.only(top: 16, left: 8), - padding: const EdgeInsets.all(8), - alignment: Alignment.topLeft, - decoration: BoxDecoration( - borderRadius: const BorderRadius.all(Radius.circular(8.0)), - // color: buttonBackgroundColor, - ), - // child: InkWell( - // onTap: () async { - // showDialog( - // context: context, - // builder: (context) { - // return Dialog( - // elevation: 0.0, - // insetPadding: const EdgeInsets.symmetric(horizontal: 40), - // shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(20)), - // child: FractionallySizedBox( - // heightFactor: 0.2, - // widthFactor: 0.3, - // child: Column( - // crossAxisAlignment: CrossAxisAlignment.stretch, - // children: [ - // ListView( - // shrinkWrap: true, - // children: ListTile.divideTiles( - // context: context, - // tiles: [ - // ListTile( - // title: Text( - // 'Session Information', - // style: GoogleFonts.lato( - // textStyle: const TextStyle( - // fontSize: 18, - // fontWeight: FontWeight.w600, - // ), - // ), - // ), - // ), - // ListTile( - // title: Text( - // 'Session Name', - // style: GoogleFonts.lato( - // textStyle: const TextStyle( - // fontSize: 14, - // ), - // ), - // ), - // subtitle: Text( - // sessionName.value, - // style: GoogleFonts.lato( - // textStyle: const TextStyle( - // fontSize: 12, - // ), - // ), - // ), - // ), - // ListTile( - // title: Text( - // 'Session Password', - // style: GoogleFonts.lato( - // textStyle: const TextStyle( - // fontSize: 14, - // ), - // ), - // ), - // subtitle: Text( - // sessionPassword.value, - // style: GoogleFonts.lato( - // textStyle: const TextStyle( - // fontSize: 12, - // ), - // ), - // ), - // ), - // ListTile( - // title: Text( - // 'Participants', - // style: GoogleFonts.lato( - // textStyle: const TextStyle( - // fontSize: 14, - // ), - // ), - // ), - // subtitle: Text( - // '${users.value.length}', - // style: GoogleFonts.lato( - // textStyle: const TextStyle( - // fontSize: 12, - // ), - // ), - // ), - // ), - // ], - // ).toList(), - // ), - // ], - // ), - // )); - // }); - // }, - // child: Stack( - // children: [ - // Column( - // children: [ - // const Padding(padding: EdgeInsets.symmetric(vertical: 4)), - // Align( - // alignment: Alignment.centerLeft, - // child: Text( - // sessionName.value, - // overflow: TextOverflow.ellipsis, - // style: GoogleFonts.lato( - // textStyle: const TextStyle( - // fontSize: 14, - // fontWeight: FontWeight.w600, - // color: Colors.white, - // ), - // ), - // ), - // ), - // const Padding(padding: EdgeInsets.symmetric(vertical: 5)), - // Align( - // alignment: Alignment.centerLeft, - // child: Text( - // "Participants: ${users.value.length}", - // style: GoogleFonts.lato( - // textStyle: const TextStyle( - // fontSize: 14, - // fontWeight: FontWeight.w600, - // color: Colors.white, - // ), - // ), - // ), - // ) - // ], - // ), - // Container( - // alignment: Alignment.centerRight, - // child: Image.asset( - // "assets/icons/unlocked@2x.png", - // height: 22, - // )), - // ], - // ), - // ), - ), - TextButton( - onPressed: (showLeaveOptions), - child: Container( - alignment: Alignment.topRight, - margin: const EdgeInsets.only(top: 16, right: 8), - padding: const EdgeInsets.only(top: 5, bottom: 5, left: 16, right: 16), - height: 28, - decoration: BoxDecoration( - borderRadius: const BorderRadius.all(Radius.circular(20.0)), - color: buttonBackgroundColor, - ), - child: const Text( - "LEAVE", - style: TextStyle( - fontSize: 14, - fontWeight: FontWeight.bold, - color: Color(0xFFE02828), - ), - ), - )), - ], - ), - Align( - alignment: Alignment.centerRight, - child: FractionallySizedBox( - widthFactor: 0.2, - heightFactor: 0.6, - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - IconButton( - onPressed: onPressAudio, - icon: isMuted.value ? Image.asset("assets/images/png/zoom/unmute@2x.png") : Image.asset("assets/images/png/zoom/mute@2x.png"), - iconSize: circleButtonSize, - tooltip: isMuted.value == true ? "Unmute" : "Mute", - ), - IconButton( - onPressed: onPressShare, - icon: isSharing.value ? Image.asset("assets/images/png/zoom/share-off@2x.png") : Image.asset("assets/images/png/zoom/share-on@2x.png"), - iconSize: circleButtonSize, - ), - IconButton( - onPressed: onPressVideo, - iconSize: circleButtonSize, - icon: isVideoOn.value ? Image.asset("assets/images/png/zoom/video-off@2x.png") : Image.asset("assets/images/png/zoom/video-on@2x.png"), - ), - Column( - children: [ - IconButton( - onPressed: () async { - onPressCameraList(); - }, - icon: Icon(Icons.cameraswitch, color: Colors.white), - color: Colors.white, - iconSize: 40.h, - ), - "Switch Camera".toText12(color: AppColors.whiteColor, isCenter: true, isBold: true) - ], - ), - ], - ), - )), - Container( - margin: const EdgeInsets.only(left: 16, right: 16, bottom: 40, top: 10), - alignment: Alignment.bottomCenter, - child: SizedBox( - height: MediaQuery.of(context).viewInsets.bottom == 0 ? 65 : MediaQuery.of(context).viewInsets.bottom + 18, - child: TextField( - maxLines: 1, - textAlign: TextAlign.left, - style: TextStyle(color: chatTextColor), - cursorColor: chatTextColor, - textAlignVertical: TextAlignVertical.center, - controller: chatMessageController, - decoration: InputDecoration( - contentPadding: const EdgeInsets.only(left: 16, top: 10, bottom: 10, right: 16), - enabledBorder: OutlineInputBorder( - borderSide: BorderSide(width: 1, color: chatTextColor), //<-- SEE HERE - ), - hintText: 'Type your message here...', - hintStyle: TextStyle( - fontSize: 14.0, - color: chatTextColor, - ), - ), - onSubmitted: (String str) { - sendChatMessage(str); - }, - ), - ), - ), - Container( - alignment: Alignment.bottomLeft, - margin: const EdgeInsets.only(bottom: 120), - child: smallView, - ), - // CommentList(zoom: zoom, eventListener: eventListener), - changeNamePopup, - ], - )), - ], - )); - } -} - -class CallArguments { - final bool isJoin; - final String sessionName; - final String sessionPwd; - final String displayName; - final String sessionIdleTimeoutMins; - final String role; - final int callType; - - CallArguments(this.sessionName, this.sessionPwd, this.displayName, this.sessionIdleTimeoutMins, this.role, this.isJoin, this.callType); -} - -class JoinArguments { - final bool isJoin; - final String sessionName; - final String sessionPwd; - final String displayName; - final String sessionTimeout; - final String roleType; - - JoinArguments(this.isJoin, this.sessionName, this.sessionPwd, this.displayName, this.sessionTimeout, this.roleType); -} +// import 'dart:async'; +// import 'dart:convert'; +// import 'dart:io'; +// +// import 'package:flutter/cupertino.dart'; +// import 'package:flutter/foundation.dart'; +// import 'package:flutter/material.dart'; +// import 'package:flutter/services.dart'; +// import 'package:flutter_hooks/flutter_hooks.dart'; +// import 'package:flutter_ios_voip_kit_karmm/flutter_ios_voip_kit.dart'; +// import 'package:flutter_zoom_videosdk/flutter_zoom_view.dart'; +// import 'package:flutter_zoom_videosdk/native/zoom_videosdk.dart'; +// import 'package:flutter_zoom_videosdk/native/zoom_videosdk_camera_device.dart'; +// import 'package:flutter_zoom_videosdk/native/zoom_videosdk_cmd_channel.dart'; +// import 'package:flutter_zoom_videosdk/native/zoom_videosdk_event_listener.dart'; +// import 'package:flutter_zoom_videosdk/native/zoom_videosdk_live_transcription_message_info.dart'; +// import 'package:flutter_zoom_videosdk/native/zoom_videosdk_share_action.dart'; +// import 'package:flutter_zoom_videosdk/native/zoom_videosdk_user.dart'; +// import 'package:get_it/get_it.dart'; +// import 'package:hmg_patient_app_new/core/app_export.dart'; +// import 'package:hmg_patient_app_new/core/cache_consts.dart'; +// import 'package:hmg_patient_app_new/core/utils/jwt.dart'; +// import 'package:hmg_patient_app_new/core/utils/utils.dart'; +// import 'package:hmg_patient_app_new/extensions/string_extensions.dart'; +// import 'package:hmg_patient_app_new/presentation/home/navigation_screen.dart'; +// import 'package:hmg_patient_app_new/presentation/tele_consultation/zoom/video_view.dart'; +// import 'package:hmg_patient_app_new/services/cache_service.dart'; +// import 'package:hmg_patient_app_new/theme/colors.dart'; +// import 'package:hmg_patient_app_new/widgets/routes/custom_page_route.dart'; +// import 'package:image_picker/image_picker.dart'; +// +// class CallScreen extends StatefulHookWidget { +// const CallScreen({Key? key}) : super(key: key); +// +// @override +// State createState() => _CallScreenState(); +// } +// +// class _CallScreenState extends State { +// static TextEditingController changeNameController = TextEditingController(); +// double opacityLevel = 1.0; +// +// final voIPKit = FlutterIOSVoIPKit.instance; +// +// bool isScreenBeingShared = false; +// +// void _changeOpacity() { +// setState(() => opacityLevel = opacityLevel == 0 ? 1.0 : 0.0); +// } +// +// @override +// Widget build(BuildContext context) { +// var zoom = ZoomVideoSdk(); +// var eventListener = ZoomVideoSdkEventListener(); +// var isInSession = useState(false); +// var sessionName = useState(''); +// var sessionPassword = useState(''); +// var users = useState([]); +// var fullScreenUser = useState(null); +// var sharingUser = useState(null); +// var videoInfo = useState(''); +// var isSharing = useState(false); +// var isMuted = useState(true); +// var isVideoOn = useState(false); +// var isSpeakerOn = useState(false); +// var isRenameModalVisible = useState(false); +// var isRecordingStarted = useState(false); +// var isMicOriginalOn = useState(false); +// var isMounted = useIsMounted(); +// var audioStatusFlag = useState(false); +// var videoStatusFlag = useState(false); +// var userNameFlag = useState(false); +// var userShareStatusFlag = useState(false); +// var isReceiveSpokenLanguageContentEnabled = useState(false); +// var isVideoMirrored = useState(false); +// var isOriginalAspectRatio = useState(false); +// var isPiPView = useState(false); +// var isSharedCamera = useState(false); +// CameraShareView cameraShareView = const CameraShareView(creationParams: {}); +// +// //hide status bar +// SystemChrome.setEnabledSystemUIMode(SystemUiMode.leanBack); +// var circleButtonSize = 65.0; +// Color backgroundColor = const Color(0xFF232323); +// Color buttonBackgroundColor = const Color.fromRGBO(0, 0, 0, 0.6); +// Color chatTextColor = const Color(0xFFAAAAAA); +// Widget changeNamePopup; +// final args = ModalRoute.of(context)!.settings.arguments as CallArguments; +// +// useEffect(() { +// Future.microtask(() async { +// var token = generateJwt(args.sessionName, args.role); +// +// Utils.removeFromPrefs(CacheConst.isAppOpenedFromCall); +// +// try { +// Map SDKaudioOptions = {"connect": true, "mute": false, "autoAdjustSpeakerVolume": false}; +// Map SDKvideoOptions = { +// "localVideoOn": true, +// }; +// JoinSessionConfig joinSession = JoinSessionConfig( +// sessionName: args.sessionName, +// sessionPassword: args.sessionPwd, +// token: token, +// userName: args.displayName, +// audioOptions: SDKaudioOptions, +// videoOptions: SDKvideoOptions, +// sessionIdleTimeoutMins: int.parse(args.sessionIdleTimeoutMins), +// ); +// await zoom.joinSession(joinSession); +// } catch (e) { +// const AlertDialog( +// title: Text("Error"), +// content: Text("Failed to join the session"), +// ); +// Future.delayed(const Duration(milliseconds: 1000)).asStream().listen((event) { +// Navigator.pushAndRemoveUntil( +// context, +// CustomPageRoute( +// page: LandingNavigation(), +// ), +// (r) => false); +// }); +// } +// }); +// return null; +// }, []); +// +// useEffect(() { +// final sessionJoinListener = eventListener.addListener(EventType.onSessionJoin, (data) async { +// data = data as Map; +// isInSession.value = true; +// zoom.session.getSessionName().then((value) => sessionName.value = value!); +// sessionPassword.value = await zoom.session.getSessionPassword(); +// debugPrint("sessionPhonePasscode: ${await zoom.session.getSessionPhonePasscode()}"); +// ZoomVideoSdkUser mySelf = ZoomVideoSdkUser.fromJson(jsonDecode(data['sessionUser'])); +// List? remoteUsers = await zoom.session.getRemoteUsers(); +// var muted = await mySelf.audioStatus?.isMuted(); +// var videoOn = await mySelf.videoStatus?.isOn(); +// var speakerOn = await zoom.audioHelper.getSpeakerStatus(); +// fullScreenUser.value = mySelf; +// remoteUsers?.insert(0, mySelf); +// isMuted.value = muted!; +// isSpeakerOn.value = speakerOn; +// isVideoOn.value = videoOn!; +// users.value = remoteUsers!; +// isReceiveSpokenLanguageContentEnabled.value = await zoom.liveTranscriptionHelper.isReceiveSpokenLanguageContentEnabled(); +// }); +// +// final sessionLeaveListener = eventListener.addListener(EventType.onSessionLeave, (data) async { +// data = data as Map; +// debugPrint("onSessionLeave: ${data['reason']}"); +// isInSession.value = false; +// users.value = []; +// fullScreenUser.value = null; +// // Navigator.popAndPushNamed( +// // context, +// // "Join", +// // arguments: JoinArguments(args.isJoin, sessionName.value, sessionPassword.value, args.displayName, args.sessionIdleTimeoutMins, args.role), +// // ); +// Navigator.pushAndRemoveUntil( +// context, +// CustomPageRoute( +// page: LandingNavigation(), +// ), +// (r) => false); +// }); +// +// final sessionNeedPasswordListener = eventListener.addListener(EventType.onSessionNeedPassword, (data) async { +// showDialog( +// context: context, +// builder: (BuildContext context) => AlertDialog( +// title: const Text('Session Need Password'), +// content: const Text('Password is required'), +// actions: [ +// TextButton( +// onPressed: () async => { +// Navigator.pushAndRemoveUntil( +// context, +// CustomPageRoute( +// page: LandingNavigation(), +// ), +// (r) => false), +// await zoom.leaveSession(false), +// }, +// child: const Text('OK'), +// ), +// ], +// ), +// ); +// }); +// +// final sessionPasswordWrongListener = eventListener.addListener(EventType.onSessionPasswordWrong, (data) async { +// showDialog( +// context: context, +// builder: (BuildContext context) => AlertDialog( +// title: const Text('Session Password Incorrect'), +// content: const Text('Password is wrong'), +// actions: [ +// TextButton( +// onPressed: () async => { +// Navigator.popAndPushNamed(context, 'Join', arguments: JoinArguments(args.isJoin, args.sessionName, "", args.displayName, args.sessionIdleTimeoutMins, args.role)), +// await zoom.leaveSession(false), +// }, +// child: const Text('OK'), +// ), +// ], +// ), +// ); +// }); +// +// final userVideoStatusChangedListener = eventListener.addListener(EventType.onUserVideoStatusChanged, (data) async { +// data = data as Map; +// ZoomVideoSdkUser? mySelf = await zoom.session.getMySelf(); +// var userListJson = jsonDecode(data['changedUsers']) as List; +// List userList = userListJson.map((userJson) => ZoomVideoSdkUser.fromJson(userJson)).toList(); +// for (var user in userList) { +// { +// if (user.userId == mySelf?.userId) { +// mySelf?.videoStatus?.isOn().then((on) => isVideoOn.value = on); +// } +// } +// } +// videoStatusFlag.value = !videoStatusFlag.value; +// }); +// +// final userAudioStatusChangedListener = eventListener.addListener(EventType.onUserAudioStatusChanged, (data) async { +// data = data as Map; +// ZoomVideoSdkUser? mySelf = await zoom.session.getMySelf(); +// var userListJson = jsonDecode(data['changedUsers']) as List; +// List userList = userListJson.map((userJson) => ZoomVideoSdkUser.fromJson(userJson)).toList(); +// for (var user in userList) { +// { +// if (user.userId == mySelf?.userId) { +// mySelf?.audioStatus?.isMuted().then((muted) => isMuted.value = muted); +// } +// } +// } +// audioStatusFlag.value = !audioStatusFlag.value; +// }); +// +// final userShareStatusChangeListener = eventListener.addListener(EventType.onUserShareStatusChanged, (data) async { +// data = data as Map; +// ZoomVideoSdkUser? mySelf = await zoom.session.getMySelf(); +// ZoomVideoSdkUser shareUser = ZoomVideoSdkUser.fromJson(jsonDecode(data['user'].toString())); +// ZoomVideoSdkShareAction? shareAction = ZoomVideoSdkShareAction.fromJson(jsonDecode(data['shareAction'])); +// +// if (shareAction.shareStatus == ShareStatus.Start || shareAction.shareStatus == ShareStatus.Resume) { +// sharingUser.value = shareUser; +// fullScreenUser.value = shareUser; +// isSharing.value = (shareUser.userId == mySelf?.userId); +// +// setState(() { +// isScreenBeingShared = true; +// }); +// Future.delayed(const Duration(seconds: 2), () { +// setState(() { +// isScreenBeingShared = false; +// }); +// }); +// } else { +// sharingUser.value = null; +// isSharing.value = false; +// isSharedCamera.value = false; +// fullScreenUser.value = mySelf; +// isScreenBeingShared = false; +// setState(() { +// isScreenBeingShared = true; +// }); +// Future.delayed(const Duration(seconds: 2), () { +// setState(() { +// isScreenBeingShared = false; +// }); +// }); +// } +// userShareStatusFlag.value = !userShareStatusFlag.value; +// }); +// +// final shareContentChangedListener = eventListener.addListener(EventType.onShareContentChanged, (data) async { +// data = data as Map; +// ZoomVideoSdkUser? mySelf = await zoom.session.getMySelf(); +// ZoomVideoSdkUser shareUser = ZoomVideoSdkUser.fromJson(jsonDecode(data['user'].toString())); +// ZoomVideoSdkShareAction? shareAction = ZoomVideoSdkShareAction.fromJson(jsonDecode(data['shareAction'])); +// if (shareAction.shareType == ShareType.Camera) { +// debugPrint("Camera share started"); +// isSharedCamera.value = (shareUser.userId == mySelf?.userId); +// } +// }); +// +// final userJoinListener = eventListener.addListener(EventType.onUserJoin, (data) async { +// if (!isMounted()) return; +// data = data as Map; +// ZoomVideoSdkUser? mySelf = await zoom.session.getMySelf(); +// var userListJson = jsonDecode(data['remoteUsers']) as List; +// List remoteUserList = userListJson.map((userJson) => ZoomVideoSdkUser.fromJson(userJson)).toList(); +// remoteUserList.insert(0, mySelf!); +// users.value = remoteUserList; +// }); +// +// final userLeaveListener = eventListener.addListener(EventType.onUserLeave, (data) async { +// if (!isMounted()) return; +// ZoomVideoSdkUser? mySelf = await zoom.session.getMySelf(); +// data = data as Map; +// List? remoteUserList = await zoom.session.getRemoteUsers(); +// var leftUserListJson = jsonDecode(data['leftUsers']) as List; +// List leftUserLis = leftUserListJson.map((userJson) => ZoomVideoSdkUser.fromJson(userJson)).toList(); +// if (fullScreenUser.value != null) { +// for (var user in leftUserLis) { +// { +// if (fullScreenUser.value?.userId == user.userId) { +// fullScreenUser.value = mySelf; +// } +// } +// } +// } else { +// fullScreenUser.value = mySelf; +// } +// remoteUserList?.add(mySelf!); +// users.value = remoteUserList!; +// }); +// +// final userNameChangedListener = eventListener.addListener(EventType.onUserNameChanged, (data) async { +// if (!isMounted()) return; +// data = data as Map; +// ZoomVideoSdkUser? changedUser = ZoomVideoSdkUser.fromJson(jsonDecode(data['changedUser'])); +// int index; +// for (var user in users.value) { +// if (user.userId == changedUser.userId) { +// index = users.value.indexOf(user); +// users.value[index] = changedUser; +// } +// } +// userNameFlag.value = !userNameFlag.value; +// }); +// +// final commandReceived = eventListener.addListener(EventType.onCommandReceived, (data) async { +// data = data as Map; +// debugPrint("sender: ${ZoomVideoSdkUser.fromJson(jsonDecode(data['sender']))}, command: ${data['command']}"); +// }); +// +// final liveStreamStatusChangeListener = eventListener.addListener(EventType.onLiveStreamStatusChanged, (data) async { +// data = data as Map; +// debugPrint("onLiveStreamStatusChanged: status: ${data['status']}"); +// }); +// +// final liveTranscriptionStatusChangeListener = eventListener.addListener(EventType.onLiveTranscriptionStatus, (data) async { +// data = data as Map; +// debugPrint("onLiveTranscriptionStatus: status: ${data['status']}"); +// }); +// +// final cloudRecordingStatusListener = eventListener.addListener(EventType.onCloudRecordingStatus, (data) async { +// data = data as Map; +// debugPrint("onCloudRecordingStatus: status: ${data['status']}"); +// ZoomVideoSdkUser? mySelf = await zoom.session.getMySelf(); +// if (data['status'] == RecordingStatus.Start) { +// if (mySelf != null && !mySelf.isHost!) { +// showDialog( +// context: context, +// builder: (BuildContext context) => AlertDialog( +// content: const Text('The session is being recorded.'), +// actions: [ +// TextButton( +// onPressed: () async { +// await zoom.acceptRecordingConsent(); +// if (context.mounted) { +// Navigator.pop(context); +// } +// ; +// }, +// child: const Text('accept'), +// ), +// TextButton( +// onPressed: () async { +// String currentConsentType = await zoom.getRecordingConsentType(); +// if (currentConsentType == ConsentType.ConsentType_Individual) { +// await zoom.declineRecordingConsent(); +// Navigator.pop(context); +// } else { +// await zoom.declineRecordingConsent(); +// zoom.leaveSession(false); +// if (!context.mounted) return; +// Navigator.popAndPushNamed( +// context, +// "Join", +// arguments: JoinArguments(args.isJoin, sessionName.value, sessionPassword.value, args.displayName, args.sessionIdleTimeoutMins, args.role), +// ); +// } +// }, +// child: const Text('decline'), +// ), +// ], +// ), +// ); +// } +// isRecordingStarted.value = true; +// } else { +// isRecordingStarted.value = false; +// } +// }); +// +// final liveTranscriptionMsgInfoReceivedListener = eventListener.addListener(EventType.onLiveTranscriptionMsgInfoReceived, (data) async { +// data = data as Map; +// ZoomVideoSdkLiveTranscriptionMessageInfo? messageInfo = ZoomVideoSdkLiveTranscriptionMessageInfo.fromJson(jsonDecode(data['messageInfo'])); +// debugPrint("onLiveTranscriptionMsgInfoReceived: content: ${messageInfo.messageContent}"); +// }); +// +// final inviteByPhoneStatusListener = eventListener.addListener(EventType.onInviteByPhoneStatus, (data) async { +// data = data as Map; +// debugPrint("onInviteByPhoneStatus: status: ${data['status']}, reason: ${data['reason']}"); +// }); +// +// final multiCameraStreamStatusChangedListener = eventListener.addListener(EventType.onMultiCameraStreamStatusChanged, (data) async { +// data = data as Map; +// ZoomVideoSdkUser? changedUser = ZoomVideoSdkUser.fromJson(jsonDecode(data['changedUser'])); +// var status = data['status']; +// for (var user in users.value) { +// { +// if (changedUser.userId == user.userId) { +// if (status == MultiCameraStreamStatus.Joined) { +// user.hasMultiCamera = true; +// } else if (status == MultiCameraStreamStatus.Left) { +// user.hasMultiCamera = false; +// } +// } +// } +// } +// }); +// +// final requireSystemPermission = eventListener.addListener(EventType.onRequireSystemPermission, (data) async { +// data = data as Map; +// ZoomVideoSdkUser? changedUser = ZoomVideoSdkUser.fromJson(jsonDecode(data['changedUser'])); +// var permissionType = data['permissionType']; +// switch (permissionType) { +// case SystemPermissionType.Camera: +// showDialog( +// context: context, +// builder: (BuildContext context) => AlertDialog( +// title: const Text("Can't Access Camera"), +// content: const Text("please turn on the toggle in system settings to grant permission"), +// actions: [ +// TextButton( +// onPressed: () => Navigator.pop(context, 'OK'), +// child: const Text('OK'), +// ), +// ], +// ), +// ); +// break; +// case SystemPermissionType.Microphone: +// showDialog( +// context: context, +// builder: (BuildContext context) => AlertDialog( +// title: const Text("Can't Access Microphone"), +// content: const Text("please turn on the toggle in system settings to grant permission"), +// actions: [ +// TextButton( +// onPressed: () => Navigator.pop(context, 'OK'), +// child: const Text('OK'), +// ), +// ], +// ), +// ); +// break; +// } +// }); +// +// final networkStatusChangeListener = eventListener.addListener(EventType.onUserVideoNetworkStatusChanged, (data) async { +// data = data as Map; +// ZoomVideoSdkUser? networkUser = ZoomVideoSdkUser.fromJson(jsonDecode(data['user'])); +// +// if (data['status'] == NetworkStatus.Bad) { +// debugPrint("onUserVideoNetworkStatusChanged: status: ${data['status']}, user: ${networkUser.userName}"); +// } +// }); +// +// final eventErrorListener = eventListener.addListener(EventType.onError, (data) async { +// data = data as Map; +// String errorType = data['errorType']; +// showDialog( +// context: context, +// builder: (BuildContext context) => AlertDialog( +// title: const Text("Error"), +// content: Text(errorType), +// actions: [ +// TextButton( +// onPressed: () => Navigator.pop(context, 'OK'), +// child: const Text('OK'), +// ), +// ], +// ), +// ); +// if (errorType == Errors.SessionJoinFailed || errorType == Errors.SessionDisconnecting) { +// Timer( +// const Duration(milliseconds: 1000), +// () => { +// Navigator.popAndPushNamed( +// context, +// "Join", +// arguments: JoinArguments(args.isJoin, sessionName.value, sessionPassword.value, args.displayName, args.sessionIdleTimeoutMins, args.role), +// ), +// }); +// } +// }); +// +// final userRecordingConsentListener = eventListener.addListener(EventType.onUserRecordingConsent, (data) async { +// data = data as Map; +// ZoomVideoSdkUser? user = ZoomVideoSdkUser.fromJson(jsonDecode(data['user'])); +// debugPrint('userRecordingConsentListener: user= ${user.userName}'); +// }); +// +// final callCRCDeviceStatusListener = eventListener.addListener(EventType.onCallCRCDeviceStatusChanged, (data) async { +// data = data as Map; +// debugPrint('onCallCRCDeviceStatusChanged: status = ${data['status']}'); +// }); +// +// final originalLanguageMsgReceivedListener = eventListener.addListener(EventType.onOriginalLanguageMsgReceived, (data) async { +// data = data as Map; +// ZoomVideoSdkLiveTranscriptionMessageInfo? messageInfo = ZoomVideoSdkLiveTranscriptionMessageInfo.fromJson(jsonDecode(data['messageInfo'])); +// debugPrint("onOriginalLanguageMsgReceived: content: ${messageInfo.messageContent}"); +// }); +// +// final chatPrivilegeChangedListener = eventListener.addListener(EventType.onChatPrivilegeChanged, (data) async { +// data = data as Map; +// String type = data['privilege']; +// debugPrint('chatPrivilegeChangedListener: type= $type'); +// }); +// +// final testMicStatusListener = eventListener.addListener(EventType.onTestMicStatusChanged, (data) async { +// data = data as Map; +// String status = data['status']; +// debugPrint('testMicStatusListener: status= $status'); +// }); +// +// final micSpeakerVolumeChangedListener = eventListener.addListener(EventType.onMicSpeakerVolumeChanged, (data) async { +// data = data as Map; +// int type = data['micVolume']; +// debugPrint('onMicSpeakerVolumeChanged: micVolume= $type, speakerVolume'); +// }); +// +// final cameraControlRequestResultListener = eventListener.addListener(EventType.onCameraControlRequestResult, (data) async { +// data = data as Map; +// bool approved = data['approved']; +// debugPrint('onCameraControlRequestResult: approved= $approved'); +// }); +// +// final callOutUserJoinListener = eventListener.addListener(EventType.onCalloutJoinSuccess, (data) async { +// data = data as Map; +// String phoneNumber = data['phoneNumber']; +// ZoomVideoSdkUser? user = ZoomVideoSdkUser.fromJson(jsonDecode(data['user'])); +// debugPrint('onCalloutJoinSuccess: phoneNumber= $phoneNumber, user= ${user.userName}'); +// }); +// +// return () => { +// sessionJoinListener.cancel(), +// sessionLeaveListener.cancel(), +// sessionPasswordWrongListener.cancel(), +// sessionNeedPasswordListener.cancel(), +// userVideoStatusChangedListener.cancel(), +// userAudioStatusChangedListener.cancel(), +// userJoinListener.cancel(), +// userLeaveListener.cancel(), +// userNameChangedListener.cancel(), +// userShareStatusChangeListener.cancel(), +// liveStreamStatusChangeListener.cancel(), +// cloudRecordingStatusListener.cancel(), +// inviteByPhoneStatusListener.cancel(), +// eventErrorListener.cancel(), +// commandReceived.cancel(), +// liveTranscriptionStatusChangeListener.cancel(), +// liveTranscriptionMsgInfoReceivedListener.cancel(), +// multiCameraStreamStatusChangedListener.cancel(), +// requireSystemPermission.cancel(), +// userRecordingConsentListener.cancel(), +// networkStatusChangeListener.cancel(), +// callCRCDeviceStatusListener.cancel(), +// originalLanguageMsgReceivedListener.cancel(), +// chatPrivilegeChangedListener.cancel(), +// testMicStatusListener.cancel(), +// micSpeakerVolumeChangedListener.cancel(), +// cameraControlRequestResultListener.cancel(), +// callOutUserJoinListener.cancel(), +// shareContentChangedListener.cancel(), +// }; +// }, [zoom, users.value, isMounted]); +// +// void selectVirtualBackgroundItem() async { +// final ImagePicker picker = ImagePicker(); +// // Pick an image. +// final XFile? image = await picker.pickImage(source: ImageSource.gallery); +// await zoom.virtualBackgroundHelper.addVirtualBackgroundItem(image!.path); +// } +// +// void onPressAudio() async { +// ZoomVideoSdkUser? mySelf = await zoom.session.getMySelf(); +// if (mySelf != null) { +// final audioStatus = mySelf.audioStatus; +// if (audioStatus != null) { +// var muted = await audioStatus.isMuted(); +// if (muted) { +// await zoom.audioHelper.unMuteAudio(mySelf.userId); +// } else { +// await zoom.audioHelper.muteAudio(mySelf.userId); +// } +// } +// } +// } +// +// void onPressVideo() async { +// ZoomVideoSdkUser? mySelf = await zoom.session.getMySelf(); +// if (mySelf != null) { +// final videoStatus = mySelf.videoStatus; +// if (videoStatus != null) { +// var videoOn = await videoStatus.isOn(); +// if (videoOn) { +// await zoom.videoHelper.stopVideo(); +// } else { +// await zoom.videoHelper.startVideo(); +// } +// } +// } +// } +// +// void onPressShare() async { +// var isOtherSharing = await zoom.shareHelper.isOtherSharing(); +// var isShareLocked = await zoom.shareHelper.isShareLocked(); +// String? shareCameraViewResult = Errors.InternalError; +// +// if (isOtherSharing) { +// showDialog( +// context: context, +// builder: (BuildContext context) => AlertDialog( +// title: const Text("Error"), +// content: const Text('Other is sharing'), +// actions: [ +// TextButton( +// onPressed: () => Navigator.pop(context, 'OK'), +// child: const Text('OK'), +// ), +// ], +// ), +// ); +// } else if (isShareLocked) { +// showDialog( +// context: context, +// builder: (BuildContext context) => AlertDialog( +// title: const Text("Error"), +// content: const Text('Share is locked by host'), +// actions: [ +// TextButton( +// onPressed: () => Navigator.pop(context, 'OK'), +// child: const Text('OK'), +// ), +// ], +// ), +// ); +// } else if (isSharing.value) { +// zoom.shareHelper.stopShare(); +// } else { +// List options = [ +// ListTile( +// title: Text( +// 'Share Device Screen', +// style: TextStyle( +// fontSize: 14, +// fontWeight: FontWeight.normal, +// color: Colors.black, +// ), +// ), +// onTap: () async => { +// zoom.shareHelper.shareScreen(), +// Navigator.of(context).pop(), +// }, +// ), +// ListTile( +// title: Text( +// 'Share Camera', +// style: TextStyle( +// fontSize: 14, +// fontWeight: FontWeight.normal, +// color: Colors.black, +// ), +// ), +// onTap: () async => { +// shareCameraViewResult = await zoom.shareHelper.startShareCamera(cameraShareView), +// debugPrint('start camera: $shareCameraViewResult'), +// Navigator.of(context).pop(), +// }, +// ), +// ]; +// showDialog( +// context: context, +// builder: (context) { +// return Dialog( +// elevation: 0.0, +// insetPadding: const EdgeInsets.symmetric(horizontal: 40), +// shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(20)), +// child: SizedBox( +// height: options.length * 60, +// child: Scrollbar( +// child: ListView( +// shrinkWrap: true, +// scrollDirection: Axis.vertical, +// children: ListTile.divideTiles( +// context: context, +// tiles: options, +// ).toList(), +// ), +// ), +// ), +// ); +// }); +// } +// } +// +// void onSelectedUserVolume(ZoomVideoSdkUser user) async { +// var isShareAudio = user.isSharing; +// bool canSetVolume = await user.canSetUserVolume(user.userId, isShareAudio); +// num userVolume; +// +// List options = [ +// ListTile( +// title: Text( +// 'Adjust Volume', +// style: const TextStyle( +// fontSize: 18, +// fontWeight: FontWeight.w600, +// color: Colors.black, +// ), +// ), +// ), +// ListTile( +// title: Text( +// 'Current volume', +// style: const TextStyle( +// fontSize: 14, +// fontWeight: FontWeight.normal, +// color: Colors.black, +// ), +// ), +// onTap: () async => { +// debugPrint('user volume'), +// userVolume = await user.getUserVolume(user.userId, isShareAudio), +// debugPrint('user ${user.userName}\'s volume is ${userVolume!}'), +// }, +// ), +// ]; +// if (canSetVolume) { +// options.add( +// ListTile( +// title: Text( +// 'Volume up', +// style: const TextStyle( +// fontSize: 14, +// fontWeight: FontWeight.normal, +// color: Colors.black, +// ), +// ), +// onTap: () async => { +// userVolume = await user.getUserVolume(user.userId, isShareAudio), +// if (userVolume < 10) +// { +// await user.setUserVolume(user.userId, userVolume + 1, isShareAudio), +// } +// else +// { +// debugPrint("Cannot volume up."), +// } +// }, +// ), +// ); +// options.add( +// ListTile( +// title: Text( +// 'Volume down', +// style: const TextStyle( +// fontSize: 14, +// fontWeight: FontWeight.normal, +// color: Colors.black, +// ), +// ), +// onTap: () async => { +// userVolume = await user.getUserVolume(user.userId, isShareAudio), +// if (userVolume > 0) +// { +// await user.setUserVolume(user.userId, userVolume - 1, isShareAudio), +// } +// else +// { +// debugPrint("Cannot volume down."), +// } +// }, +// ), +// ); +// } +// showDialog( +// context: context, +// builder: (context) { +// return Dialog( +// elevation: 0.0, +// insetPadding: const EdgeInsets.symmetric(horizontal: 40), +// shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(20)), +// child: SizedBox( +// height: options.length * 58, +// child: Column( +// crossAxisAlignment: CrossAxisAlignment.stretch, +// children: [ +// ListView( +// shrinkWrap: true, +// children: ListTile.divideTiles( +// context: context, +// tiles: options, +// ).toList(), +// ), +// ], +// ), +// )); +// }); +// } +// +// void onPressCameraList() async { +// List options = []; +// List cameraList = await zoom.videoHelper.getCameraList(); +// for (var camera in cameraList) { +// options.add( +// ListTile( +// title: Text( +// camera.deviceName, +// style: const TextStyle( +// fontSize: 14, +// fontWeight: FontWeight.normal, +// color: Colors.black, +// ), +// ), +// onTap: () async => { +// await zoom.videoHelper.switchCamera(camera.deviceId), +// Navigator.of(context).pop(), +// }, +// ), +// ); +// } +// options.add( +// ListTile( +// title: Text( +// "Cancel", +// style: const TextStyle( +// fontSize: 14, +// fontWeight: FontWeight.normal, +// color: Colors.black, +// ), +// ), +// onTap: () async => { +// Navigator.of(context).pop(), +// }, +// ), +// ); +// showDialog( +// context: context, +// builder: (context) { +// return Dialog( +// elevation: 0.0, +// insetPadding: const EdgeInsets.symmetric(horizontal: 40), +// shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(20)), +// child: SizedBox( +// height: options.length * 60, +// child: Scrollbar( +// child: ListView( +// shrinkWrap: true, +// scrollDirection: Axis.vertical, +// children: ListTile.divideTiles( +// context: context, +// tiles: options, +// ).toList(), +// ), +// ), +// ), +// ); +// }); +// } +// +// // Future onPressMore() async { +// // ZoomVideoSdkUser? mySelf = await zoom.session.getMySelf(); +// // bool isShareLocked = await zoom.shareHelper.isShareLocked(); +// // bool canSwitchSpeaker = await zoom.audioHelper.canSwitchSpeaker(); +// // bool canStartRecording = (await zoom.recordingHelper.canStartRecording()) == Errors.Success; +// // debugPrint("canStartRecording ${await zoom.recordingHelper.canStartRecording()}"); +// // var startLiveTranscription = (await zoom.liveTranscriptionHelper.getLiveTranscriptionStatus()) == LiveTranscriptionStatus.Start; +// // bool canStartLiveTranscription = await zoom.liveTranscriptionHelper.canStartLiveTranscription(); +// // bool isHost = (mySelf != null) ? (await mySelf.getIsHost()) : false; +// // isOriginalAspectRatio.value = await zoom.videoHelper.isOriginalAspectRatioEnabled(); +// // bool canCallOutToCRC = await zoom.CRCHelper.isCRCEnabled(); +// // bool supportVB = await zoom.virtualBackgroundHelper.isSupportVirtualBackground(); +// // List? shareActionList = await mySelf?.getShareActionList(); +// // +// // List options = [ +// // ListTile( +// // title: Text( +// // 'More', +// // style: GoogleFonts.lato( +// // textStyle: const TextStyle( +// // fontSize: 18, +// // fontWeight: FontWeight.w600, +// // color: Colors.black, +// // ), +// // ), +// // ), +// // ), +// // ListTile( +// // title: Text( +// // 'Get Chat Privilege', +// // style: GoogleFonts.lato( +// // textStyle: const TextStyle( +// // fontSize: 14, +// // fontWeight: FontWeight.normal, +// // color: Colors.black, +// // ), +// // ), +// // ), +// // onTap: () async => { +// // debugPrint("Chat Privilege = ${await zoom.chatHelper.getChatPrivilege()}"), +// // Navigator.of(context).pop(), +// // }, +// // ), +// // ListTile( +// // title: Text( +// // 'Get Session Dial-in Number infos', +// // style: GoogleFonts.lato( +// // textStyle: const TextStyle( +// // fontSize: 14, +// // fontWeight: FontWeight.normal, +// // color: Colors.black, +// // ), +// // ), +// // ), +// // onTap: () async => { +// // debugPrint("session number = ${await zoom.session.getSessionNumber()}"), +// // Navigator.of(context).pop(), +// // }, +// // ), +// // ListTile( +// // title: Text( +// // 'Get Camera List', +// // style: GoogleFonts.lato( +// // textStyle: const TextStyle( +// // fontSize: 14, +// // fontWeight: FontWeight.normal, +// // color: Colors.black, +// // ), +// // ), +// // ), +// // onTap: () async => { +// // debugPrint("camera list= ${await zoom.videoHelper.getCameraList()}"), +// // onPressCameraList(), +// // Navigator.of(context).pop(), +// // }, +// // ), +// // ListTile( +// // title: Text( +// // '${isMicOriginalOn.value ? 'Disable' : 'Enable'} Original Sound', +// // style: GoogleFonts.lato( +// // textStyle: const TextStyle( +// // fontSize: 14, +// // fontWeight: FontWeight.normal, +// // color: Colors.black, +// // ), +// // ), +// // ), +// // onTap: () async => { +// // debugPrint("${isMicOriginalOn.value}"), +// // await zoom.audioSettingHelper.enableMicOriginalInput(!isMicOriginalOn.value), +// // isMicOriginalOn.value = await zoom.audioSettingHelper.isMicOriginalInputEnable(), +// // debugPrint("Original sound ${isMicOriginalOn.value ? 'Enabled' : 'Disabled'}"), +// // Navigator.of(context).pop(), +// // }, +// // ) +// // ]; +// // +// // if (supportVB) { +// // options.add( +// // ListTile( +// // title: Text( +// // 'Add Virtual Background', +// // style: GoogleFonts.lato( +// // textStyle: const TextStyle( +// // fontSize: 14, +// // fontWeight: FontWeight.normal, +// // color: Colors.black, +// // ), +// // ), +// // ), +// // onTap: () async => { +// // selectVirtualBackgroundItem(), +// // Navigator.of(context).pop(), +// // }, +// // ), +// // ); +// // } +// // +// // if (canCallOutToCRC) { +// // options.add(ListTile( +// // title: Text( +// // 'Call-out to CRC devices', +// // style: GoogleFonts.lato( +// // textStyle: const TextStyle( +// // fontSize: 14, +// // fontWeight: FontWeight.normal, +// // color: Colors.black, +// // ), +// // ), +// // ), +// // onTap: () async => { +// // debugPrint('CRC result = ${await zoom.CRCHelper.callCRCDevice("bjn.vc", ZoomVideoSdkCRCProtocolType.SIP)}'), +// // Navigator.of(context).pop(), +// // }, +// // )); +// // options.add(ListTile( +// // title: Text( +// // 'Cancel call-out to CRC devices', +// // style: GoogleFonts.lato( +// // textStyle: const TextStyle( +// // fontSize: 14, +// // fontWeight: FontWeight.normal, +// // color: Colors.black, +// // ), +// // ), +// // ), +// // onTap: () async => { +// // debugPrint('cancel result= ${await zoom.CRCHelper.cancelCallCRCDevice()}'), +// // Navigator.of(context).pop(), +// // }, +// // )); +// // } +// // +// // if (canSwitchSpeaker) { +// // options.add(ListTile( +// // title: Text( +// // 'Turn ${isSpeakerOn.value ? 'off' : 'on'} Speaker', +// // style: GoogleFonts.lato( +// // textStyle: const TextStyle( +// // fontSize: 14, +// // fontWeight: FontWeight.normal, +// // color: Colors.black, +// // ), +// // ), +// // ), +// // onTap: () async => { +// // await zoom.audioHelper.setSpeaker(!isSpeakerOn.value), +// // isSpeakerOn.value = await zoom.audioHelper.getSpeakerStatus(), +// // debugPrint('Turned ${isSpeakerOn.value ? 'on' : 'off'} Speaker'), +// // Navigator.of(context).pop(), +// // }, +// // )); +// // } +// // +// // if (isHost) { +// // options.add(ListTile( +// // title: Text( +// // '${isShareLocked ? 'Unlock' : 'Lock'} Share', +// // style: GoogleFonts.lato( +// // textStyle: const TextStyle( +// // fontSize: 14, +// // fontWeight: FontWeight.normal, +// // color: Colors.black, +// // ), +// // ), +// // ), +// // onTap: () async => { +// // debugPrint("isShareLocked = ${await zoom.shareHelper.lockShare(!isShareLocked)}"), +// // Navigator.of(context).pop(), +// // })); +// // options.add(ListTile( +// // title: Text( +// // 'Change Name', +// // style: GoogleFonts.lato( +// // textStyle: const TextStyle( +// // fontSize: 14, +// // fontWeight: FontWeight.normal, +// // color: Colors.black, +// // ), +// // ), +// // ), +// // onTap: () => { +// // isRenameModalVisible.value = true, +// // Navigator.of(context).pop(), +// // }, +// // )); +// // } +// // +// // if (canStartLiveTranscription) { +// // options.add(ListTile( +// // title: Text( +// // "${startLiveTranscription ? 'Stop' : 'Start'} Live Transcription", +// // style: GoogleFonts.lato( +// // textStyle: const TextStyle( +// // fontSize: 14, +// // fontWeight: FontWeight.normal, +// // color: Colors.black, +// // ), +// // ), +// // ), +// // onTap: () async => { +// // if (startLiveTranscription) +// // { +// // debugPrint('stopLiveTranscription= ${await zoom.liveTranscriptionHelper.stopLiveTranscription()}'), +// // } +// // else +// // { +// // debugPrint('startLiveTranscription= ${await zoom.liveTranscriptionHelper.startLiveTranscription()}'), +// // }, +// // Navigator.of(context).pop(), +// // }, +// // )); +// // options.add(ListTile( +// // title: Text( +// // '${isReceiveSpokenLanguageContentEnabled.value ? 'Disable' : 'Enable'} receiving original caption', +// // style: GoogleFonts.lato( +// // textStyle: const TextStyle( +// // fontSize: 14, +// // fontWeight: FontWeight.normal, +// // color: Colors.black, +// // ), +// // ), +// // ), +// // onTap: () async => { +// // await zoom.liveTranscriptionHelper.enableReceiveSpokenLanguageContent(!isReceiveSpokenLanguageContentEnabled.value), +// // isReceiveSpokenLanguageContentEnabled.value = await zoom.liveTranscriptionHelper.isReceiveSpokenLanguageContentEnabled(), +// // debugPrint("isReceiveSpokenLanguageContentEnabled = ${isReceiveSpokenLanguageContentEnabled.value}"), +// // Navigator.of(context).pop(), +// // })); +// // } +// // +// // if (canStartRecording) { +// // options.add(ListTile( +// // title: Text( +// // '${isRecordingStarted.value ? 'Stop' : 'Start'} Recording', +// // style: GoogleFonts.lato( +// // textStyle: const TextStyle( +// // fontSize: 14, +// // fontWeight: FontWeight.normal, +// // color: Colors.black, +// // ), +// // ), +// // ), +// // onTap: () async => { +// // if (!isRecordingStarted.value) +// // { +// // debugPrint('isRecordingStarted = ${await zoom.recordingHelper.startCloudRecording()}'), +// // } +// // else +// // { +// // debugPrint('isRecordingStarted = ${await zoom.recordingHelper.stopCloudRecording()}'), +// // }, +// // Navigator.of(context).pop(), +// // })); +// // } +// // +// // if (Platform.isAndroid) { +// // bool isFlashlightSupported = await zoom.videoHelper.isSupportFlashlight(); +// // bool isFlashlightOn = await zoom.videoHelper.isFlashlightOn(); +// // if (isFlashlightSupported) { +// // options.add(ListTile( +// // title: Text( +// // '${isFlashlightOn ? 'Turn Off' : 'Turn On'} Flashlight', +// // style: GoogleFonts.lato( +// // textStyle: const TextStyle( +// // fontSize: 14, +// // fontWeight: FontWeight.normal, +// // color: Colors.black, +// // ), +// // ), +// // ), +// // onTap: () async => { +// // if (!isFlashlightOn) +// // { +// // await zoom.videoHelper.turnOnOrOffFlashlight(true), +// // } +// // else +// // { +// // await zoom.videoHelper.turnOnOrOffFlashlight(false), +// // }, +// // Navigator.of(context).pop(), +// // })); +// // } +// // } +// // +// // if (Platform.isIOS) { +// // options.add(ListTile( +// // title: Text( +// // '${isPiPView.value ? 'Disable' : 'Enable'} picture in picture view', +// // style: GoogleFonts.lato( +// // textStyle: const TextStyle( +// // fontSize: 14, +// // fontWeight: FontWeight.normal, +// // color: Colors.black, +// // ), +// // ), +// // ), +// // onTap: () async => { +// // isPiPView.value = !isPiPView.value, +// // Navigator.of(context).pop(), +// // })); +// // } +// // +// // if (isVideoOn.value) { +// // options.add(ListTile( +// // title: Text( +// // 'Mirror the video', +// // style: GoogleFonts.lato( +// // textStyle: const TextStyle( +// // fontSize: 14, +// // fontWeight: FontWeight.normal, +// // color: Colors.black, +// // ), +// // ), +// // ), +// // onTap: () async => { +// // await zoom.videoHelper.mirrorMyVideo(!isVideoMirrored.value), +// // isVideoMirrored.value = await zoom.videoHelper.isMyVideoMirrored(), +// // Navigator.of(context).pop(), +// // })); +// // options.add(ListTile( +// // title: Text( +// // '${isOriginalAspectRatio.value ? 'Enable' : 'Disable'} original aspect ratio', +// // style: GoogleFonts.lato( +// // textStyle: const TextStyle( +// // fontSize: 14, +// // fontWeight: FontWeight.normal, +// // color: Colors.black, +// // ), +// // ), +// // ), +// // onTap: () async => { +// // await zoom.videoHelper.enableOriginalAspectRatio(!isOriginalAspectRatio.value), +// // isOriginalAspectRatio.value = await zoom.videoHelper.isOriginalAspectRatioEnabled(), +// // debugPrint("isOriginalAspectRatio= ${isOriginalAspectRatio.value}"), +// // Navigator.of(context).pop(), +// // })); +// // } +// // +// // showDialog( +// // context: context, +// // builder: (context) { +// // return Dialog( +// // elevation: 0.0, +// // insetPadding: const EdgeInsets.symmetric(horizontal: 40), +// // shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(20)), +// // child: SizedBox( +// // height: 500, +// // child: Scrollbar( +// // child: ListView( +// // shrinkWrap: true, +// // scrollDirection: Axis.vertical, +// // children: ListTile.divideTiles( +// // context: context, +// // tiles: options, +// // ).toList(), +// // ), +// // ), +// // ), +// // ); +// // }); +// // } +// +// void onLeaveSession(bool isEndSession) async { +// await zoom.leaveSession(isEndSession); +// Navigator.pushAndRemoveUntil( +// context, +// CustomPageRoute( +// page: LandingNavigation(), +// ), +// (r) => false); +// } +// +// void showLeaveOptions() async { +// ZoomVideoSdkUser? mySelf = await zoom.session.getMySelf(); +// bool isHost = await mySelf!.getIsHost(); +// +// Widget endSession; +// Widget leaveSession; +// Widget cancel = TextButton( +// child: const Text('Cancel'), +// onPressed: () { +// Navigator.pop(context); //close Dialog +// }, +// ); +// +// switch (defaultTargetPlatform) { +// case TargetPlatform.android: +// endSession = TextButton( +// child: const Text('End Session'), +// onPressed: () => onLeaveSession(true), +// ); +// leaveSession = TextButton( +// child: const Text('Leave Session'), +// onPressed: () => onLeaveSession(false), +// ); +// break; +// default: +// endSession = CupertinoActionSheetAction( +// isDestructiveAction: true, +// child: const Text('End Session'), +// onPressed: () => onLeaveSession(true), +// ); +// leaveSession = CupertinoActionSheetAction( +// child: const Text('Leave Session'), +// onPressed: () => onLeaveSession(false), +// ); +// break; +// } +// +// List options = [ +// leaveSession, +// cancel, +// ]; +// +// if (Platform.isAndroid) { +// if (isHost) { +// options.removeAt(1); +// options.insert(0, endSession); +// } +// showDialog( +// context: context, +// builder: (context) { +// return AlertDialog( +// content: const Text("Do you want to leave this session?"), +// shape: const RoundedRectangleBorder(borderRadius: BorderRadius.all(Radius.circular(2.0))), +// actions: options, +// ); +// }); +// } else { +// options.removeAt(1); +// if (isHost) { +// options.insert(1, endSession); +// } +// showCupertinoModalPopup( +// context: context, +// builder: (context) => CupertinoActionSheet( +// message: const Text('Are you sure that you want to leave the session?'), +// actions: options, +// cancelButton: cancel, +// ), +// ); +// } +// } +// +// final chatMessageController = TextEditingController(); +// +// void sendChatMessage(String message) async { +// await zoom.chatHelper.sendChatToAll(message); +// ZoomVideoSdkUser? self = await zoom.session.getMySelf(); +// ZoomVideoSdkCmdChannel cmdChannel = zoom.cmdChannel; +// for (var user in users.value) { +// if (user.userId != self?.userId) { +// await zoom.cmdChannel.sendCommand(user.userId, message); +// } +// } +// chatMessageController.clear(); +// // send the chat as a command +// } +// +// void onSelectedUser(ZoomVideoSdkUser user) async { +// setState(() { +// fullScreenUser.value = user; +// }); +// } +// +// changeNamePopup = Center( +// child: Stack( +// children: [ +// Visibility( +// visible: isRenameModalVisible.value, +// child: Row( +// mainAxisSize: MainAxisSize.min, +// children: [ +// Container( +// alignment: Alignment.bottomLeft, +// decoration: const BoxDecoration( +// borderRadius: BorderRadius.all(Radius.circular(10)), +// color: Colors.white, +// ), +// width: MediaQuery.of(context).size.width - 130, +// height: MediaQuery.of(context).size.height * 0.2, +// child: Center( +// child: (Column( +// crossAxisAlignment: CrossAxisAlignment.start, +// children: [ +// Padding( +// padding: const EdgeInsets.only(top: 20, left: 20), +// child: Text( +// 'Change Name', +// style: const TextStyle( +// fontSize: 18, +// fontWeight: FontWeight.w500, +// ), +// ), +// ), +// Padding( +// padding: const EdgeInsets.only(top: 10, left: 20), +// child: SizedBox( +// width: MediaQuery.of(context).size.width - 230, +// child: TextField( +// onEditingComplete: () {}, +// autofocus: true, +// cursorColor: Colors.black, +// controller: changeNameController, +// decoration: InputDecoration( +// isDense: true, +// hintText: 'New name', +// hintStyle: TextStyle( +// fontSize: 14.0, +// color: chatTextColor, +// ), +// ), +// ), +// ), +// ), +// Padding( +// padding: const EdgeInsets.only(top: 15), +// child: Row( +// children: [ +// Padding( +// padding: const EdgeInsets.only(left: 40), +// child: InkWell( +// child: Text( +// 'Apply', +// style: const TextStyle( +// fontSize: 16, +// ), +// ), +// onTap: () async { +// if (fullScreenUser.value != null) { +// ZoomVideoSdkUser? mySelf = await zoom.session.getMySelf(); +// await zoom.userHelper.changeName((mySelf?.userId)!, changeNameController.text); +// changeNameController.clear(); +// } +// isRenameModalVisible.value = false; +// }, +// ), +// ), +// Padding( +// padding: const EdgeInsets.only(left: 40), +// child: InkWell( +// child: Text( +// 'Cancel', +// style: const TextStyle( +// fontSize: 16, +// ), +// ), +// onTap: () async { +// isRenameModalVisible.value = false; +// }, +// ), +// ) +// ], +// ), +// ) +// ], +// )), +// ), +// ), +// ], +// )), +// ], +// ), +// ); +// +// Widget fullScreenView; +// Widget smallView; +// Widget cameraView; +// +// if (isInSession.value && fullScreenUser.value != null && users.value.isNotEmpty) { +// fullScreenView = AnimatedOpacity( +// opacity: opacityLevel, +// duration: const Duration(seconds: 3), +// child: VideoView( +// user: users.value.length > 1 ? users.value[1] : users.value[0], +// hasMultiCamera: false, +// isPiPView: isPiPView.value, +// sharing: sharingUser.value == null ? false : (sharingUser.value?.userId == fullScreenUser.value?.userId), +// preview: false, +// focused: false, +// multiCameraIndex: "0", +// videoAspect: VideoAspect.Original, +// fullScreen: true, +// resolution: VideoResolution.Resolution360, +// ), +// ); +// +// smallView = Container( +// height: 110, +// margin: const EdgeInsets.only(left: 20, right: 20), +// alignment: Alignment.center, +// child: ListView.separated( +// scrollDirection: Axis.horizontal, +// itemCount: users.value.length, +// itemBuilder: (BuildContext context, int index) { +// return InkWell( +// onTap: () async { +// onSelectedUser(users.value[index]); +// }, +// onDoubleTap: () async { +// onSelectedUserVolume(users.value[index]); +// }, +// child: Center( +// child: VideoView( +// user: users.value[index], +// hasMultiCamera: false, +// isPiPView: false, +// sharing: false, +// preview: false, +// focused: false, +// multiCameraIndex: "0", +// videoAspect: VideoAspect.Original, +// fullScreen: false, +// resolution: VideoResolution.Resolution180, +// ), +// ), +// ); +// }, +// separatorBuilder: (BuildContext context, int index) => const Divider(), +// ), +// ); +// } else { +// fullScreenView = Container( +// color: Colors.black, +// child: const Center( +// child: Text( +// "Connecting...", +// style: TextStyle( +// fontSize: 20, +// color: Colors.white, +// ), +// ), +// )); +// smallView = Container( +// height: 110, +// color: Colors.transparent, +// ); +// } +// +// cameraView = Offstage( +// offstage: !isSharedCamera.value, +// child: AnimatedOpacity( +// opacity: isSharedCamera.value ? 1.0 : 0.0, +// duration: const Duration(milliseconds: 300), +// child: cameraShareView, +// ), +// ); +// +// _changeOpacity; +// return Scaffold( +// resizeToAvoidBottomInset: false, +// backgroundColor: backgroundColor, +// body: Stack( +// children: [ +// // isScreenBeingShared ? fullScreenView : SizedBox.shrink(), +// isScreenBeingShared ? SizedBox.shrink() : fullScreenView, +// cameraView, +// Container( +// padding: const EdgeInsets.only(top: 35), +// child: Stack( +// children: [ +// Row( +// crossAxisAlignment: CrossAxisAlignment.start, +// mainAxisAlignment: MainAxisAlignment.spaceBetween, +// children: [ +// Container( +// height: 80, +// width: 180, +// margin: const EdgeInsets.only(top: 16, left: 8), +// padding: const EdgeInsets.all(8), +// alignment: Alignment.topLeft, +// decoration: BoxDecoration( +// borderRadius: const BorderRadius.all(Radius.circular(8.0)), +// // color: buttonBackgroundColor, +// ), +// // child: InkWell( +// // onTap: () async { +// // showDialog( +// // context: context, +// // builder: (context) { +// // return Dialog( +// // elevation: 0.0, +// // insetPadding: const EdgeInsets.symmetric(horizontal: 40), +// // shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(20)), +// // child: FractionallySizedBox( +// // heightFactor: 0.2, +// // widthFactor: 0.3, +// // child: Column( +// // crossAxisAlignment: CrossAxisAlignment.stretch, +// // children: [ +// // ListView( +// // shrinkWrap: true, +// // children: ListTile.divideTiles( +// // context: context, +// // tiles: [ +// // ListTile( +// // title: Text( +// // 'Session Information', +// // style: GoogleFonts.lato( +// // textStyle: const TextStyle( +// // fontSize: 18, +// // fontWeight: FontWeight.w600, +// // ), +// // ), +// // ), +// // ), +// // ListTile( +// // title: Text( +// // 'Session Name', +// // style: GoogleFonts.lato( +// // textStyle: const TextStyle( +// // fontSize: 14, +// // ), +// // ), +// // ), +// // subtitle: Text( +// // sessionName.value, +// // style: GoogleFonts.lato( +// // textStyle: const TextStyle( +// // fontSize: 12, +// // ), +// // ), +// // ), +// // ), +// // ListTile( +// // title: Text( +// // 'Session Password', +// // style: GoogleFonts.lato( +// // textStyle: const TextStyle( +// // fontSize: 14, +// // ), +// // ), +// // ), +// // subtitle: Text( +// // sessionPassword.value, +// // style: GoogleFonts.lato( +// // textStyle: const TextStyle( +// // fontSize: 12, +// // ), +// // ), +// // ), +// // ), +// // ListTile( +// // title: Text( +// // 'Participants', +// // style: GoogleFonts.lato( +// // textStyle: const TextStyle( +// // fontSize: 14, +// // ), +// // ), +// // ), +// // subtitle: Text( +// // '${users.value.length}', +// // style: GoogleFonts.lato( +// // textStyle: const TextStyle( +// // fontSize: 12, +// // ), +// // ), +// // ), +// // ), +// // ], +// // ).toList(), +// // ), +// // ], +// // ), +// // )); +// // }); +// // }, +// // child: Stack( +// // children: [ +// // Column( +// // children: [ +// // const Padding(padding: EdgeInsets.symmetric(vertical: 4)), +// // Align( +// // alignment: Alignment.centerLeft, +// // child: Text( +// // sessionName.value, +// // overflow: TextOverflow.ellipsis, +// // style: GoogleFonts.lato( +// // textStyle: const TextStyle( +// // fontSize: 14, +// // fontWeight: FontWeight.w600, +// // color: Colors.white, +// // ), +// // ), +// // ), +// // ), +// // const Padding(padding: EdgeInsets.symmetric(vertical: 5)), +// // Align( +// // alignment: Alignment.centerLeft, +// // child: Text( +// // "Participants: ${users.value.length}", +// // style: GoogleFonts.lato( +// // textStyle: const TextStyle( +// // fontSize: 14, +// // fontWeight: FontWeight.w600, +// // color: Colors.white, +// // ), +// // ), +// // ), +// // ) +// // ], +// // ), +// // Container( +// // alignment: Alignment.centerRight, +// // child: Image.asset( +// // "assets/icons/unlocked@2x.png", +// // height: 22, +// // )), +// // ], +// // ), +// // ), +// ), +// TextButton( +// onPressed: (showLeaveOptions), +// child: Container( +// alignment: Alignment.topRight, +// margin: const EdgeInsets.only(top: 16, right: 8), +// padding: const EdgeInsets.only(top: 5, bottom: 5, left: 16, right: 16), +// height: 28, +// decoration: BoxDecoration( +// borderRadius: const BorderRadius.all(Radius.circular(20.0)), +// color: buttonBackgroundColor, +// ), +// child: const Text( +// "LEAVE", +// style: TextStyle( +// fontSize: 14, +// fontWeight: FontWeight.bold, +// color: Color(0xFFE02828), +// ), +// ), +// )), +// ], +// ), +// Align( +// alignment: Alignment.centerRight, +// child: FractionallySizedBox( +// widthFactor: 0.2, +// heightFactor: 0.6, +// child: Column( +// mainAxisAlignment: MainAxisAlignment.center, +// children: [ +// IconButton( +// onPressed: onPressAudio, +// icon: isMuted.value ? Image.asset("assets/images/png/zoom/unmute@2x.png") : Image.asset("assets/images/png/zoom/mute@2x.png"), +// iconSize: circleButtonSize, +// tooltip: isMuted.value == true ? "Unmute" : "Mute", +// ), +// IconButton( +// onPressed: onPressShare, +// icon: isSharing.value ? Image.asset("assets/images/png/zoom/share-off@2x.png") : Image.asset("assets/images/png/zoom/share-on@2x.png"), +// iconSize: circleButtonSize, +// ), +// IconButton( +// onPressed: onPressVideo, +// iconSize: circleButtonSize, +// icon: isVideoOn.value ? Image.asset("assets/images/png/zoom/video-off@2x.png") : Image.asset("assets/images/png/zoom/video-on@2x.png"), +// ), +// Column( +// children: [ +// IconButton( +// onPressed: () async { +// onPressCameraList(); +// }, +// icon: Icon(Icons.cameraswitch, color: Colors.white), +// color: Colors.white, +// iconSize: 40.h, +// ), +// "Switch Camera".toText12(color: AppColors.whiteColor, isCenter: true, isBold: true) +// ], +// ), +// ], +// ), +// )), +// Container( +// margin: const EdgeInsets.only(left: 16, right: 16, bottom: 40, top: 10), +// alignment: Alignment.bottomCenter, +// child: SizedBox( +// height: MediaQuery.of(context).viewInsets.bottom == 0 ? 65 : MediaQuery.of(context).viewInsets.bottom + 18, +// child: TextField( +// maxLines: 1, +// textAlign: TextAlign.left, +// style: TextStyle(color: chatTextColor), +// cursorColor: chatTextColor, +// textAlignVertical: TextAlignVertical.center, +// controller: chatMessageController, +// decoration: InputDecoration( +// contentPadding: const EdgeInsets.only(left: 16, top: 10, bottom: 10, right: 16), +// enabledBorder: OutlineInputBorder( +// borderSide: BorderSide(width: 1, color: chatTextColor), //<-- SEE HERE +// ), +// hintText: 'Type your message here...', +// hintStyle: TextStyle( +// fontSize: 14.0, +// color: chatTextColor, +// ), +// ), +// onSubmitted: (String str) { +// sendChatMessage(str); +// }, +// ), +// ), +// ), +// Container( +// alignment: Alignment.bottomLeft, +// margin: const EdgeInsets.only(bottom: 120), +// child: smallView, +// ), +// // CommentList(zoom: zoom, eventListener: eventListener), +// changeNamePopup, +// ], +// )), +// ], +// )); +// } +// } +// +// class CallArguments { +// final bool isJoin; +// final String sessionName; +// final String sessionPwd; +// final String displayName; +// final String sessionIdleTimeoutMins; +// final String role; +// final int callType; +// +// CallArguments(this.sessionName, this.sessionPwd, this.displayName, this.sessionIdleTimeoutMins, this.role, this.isJoin, this.callType); +// } +// +// class JoinArguments { +// final bool isJoin; +// final String sessionName; +// final String sessionPwd; +// final String displayName; +// final String sessionTimeout; +// final String roleType; +// +// JoinArguments(this.isJoin, this.sessionName, this.sessionPwd, this.displayName, this.sessionTimeout, this.roleType); +// } diff --git a/lib/presentation/tele_consultation/zoom/video_view.dart b/lib/presentation/tele_consultation/zoom/video_view.dart index 4c1e049..a6b2428 100644 --- a/lib/presentation/tele_consultation/zoom/video_view.dart +++ b/lib/presentation/tele_consultation/zoom/video_view.dart @@ -1,258 +1,258 @@ -import 'dart:async'; - -import 'package:flutter/material.dart'; -import 'package:flutter_hooks/flutter_hooks.dart'; -import 'package:flutter_zoom_videosdk/flutter_zoom_view.dart' as FlutterZoomView; -import 'package:flutter_zoom_videosdk/native/zoom_videosdk.dart'; - -const SHOW_TALKING_ICON_DURATION = 2000; - -class VideoView extends FlutterZoomView.ZoomView { - const VideoView({ - super.key, - required super.user, - required super.sharing, - required super.preview, - required super.focused, - required super.hasMultiCamera, - required super.multiCameraIndex, - required super.videoAspect, - required super.fullScreen, - required super.resolution, - required super.isPiPView, - }); - - @override - Widget build(BuildContext context) { - var isVideoOn = useState(false); - var isTalking = useState(false); - var isMuted = useState(false); - var isMounted = useIsMounted(); - var zoom = ZoomVideoSdk(); - var isSharing = useState(false); - user?.audioStatus?.isMuted().then((muted) => isMuted.value = muted); - - useEffect(() { - updateVideoStatus() { - if (user == null) return; - Future.microtask(() async { - if (isMounted()) { - isVideoOn.value = (await user!.videoStatus!.isOn()); - isSharing.value = sharing; - } - }); - } - - resetAudioStatus() { - isTalking.value = false; - isMuted.value = false; - } - - updateAudioStatus() async { - if (!isMounted()) return; - var talking = await user?.audioStatus?.isTalking(); - var muted = await user?.audioStatus?.isMuted(); - isMuted.value = muted!; - isTalking.value = talking!; - if (talking) { - Timer( - const Duration(milliseconds: SHOW_TALKING_ICON_DURATION), - () => { - if (isMounted()) - { - isTalking.value = false, - } - }); - } - } - - updateVideoStatus(); - return null; - }, [zoom, user]); - - ImageIcon audioStatusIcon; - if (isTalking.value) { - audioStatusIcon = const ImageIcon( - AssetImage("assets/images/png/zoom/talking@2x.png"), - ); - } else if (isMuted.value) { - audioStatusIcon = const ImageIcon( - AssetImage("assets/images/png/zoom/muted@2x.png"), - ); - } - // Pass parameters to the platform side. - final Map creationParams = {}; - creationParams.putIfAbsent("userId", () => user?.userId); - creationParams.putIfAbsent("sharing", () => sharing); - creationParams.putIfAbsent("preview", () => preview); - creationParams.putIfAbsent("focused", () => focused); - creationParams.putIfAbsent("hasMultiCamera", () => hasMultiCamera); - if (videoAspect.isEmpty) { - creationParams.putIfAbsent("videoAspect", () => VideoAspect.PanAndScan); - } else { - creationParams.putIfAbsent("videoAspect", () => videoAspect); - } - creationParams.putIfAbsent("fullScreen", () => fullScreen); - if (resolution.isNotEmpty) { - creationParams.putIfAbsent("videoAspect", () => videoAspect); - } - - if (fullScreen) { - if (sharing) { - return Container( - height: MediaQuery.of(context).size.height, - width: MediaQuery.of(context).size.width, - alignment: Alignment.center, - child: FlutterZoomView.View(creationParams: creationParams), - ); - } else if (isVideoOn.value) { - return Container( - height: MediaQuery.of(context).size.height, - width: MediaQuery.of(context).size.width, - alignment: Alignment.center, - child: FlutterZoomView.View(creationParams: creationParams), - ); - } else { - return Container( - margin: const EdgeInsets.symmetric(vertical: 0), - child: Container( - alignment: Alignment.center, - child: const Image( - image: AssetImage("assets/images/png/zoom/default-avatar.png"), - )), - ); - } - } else { - if (isVideoOn.value || sharing) { - return Container( - padding: const EdgeInsets.symmetric(horizontal: 8), - height: 110, - width: 110, - child: Stack( - children: [ - Container( - height: 110, - width: 110, - decoration: BoxDecoration( - color: const Color(0xff232323), - border: Border.all( - color: const Color(0xff666666), - width: 1, - ), - borderRadius: const BorderRadius.all(Radius.circular(8)), - ), - alignment: Alignment.center, - child: FlutterZoomView.View(creationParams: creationParams), - ), - Container( - height: 110, - width: 110, - decoration: const BoxDecoration( - borderRadius: BorderRadius.all(Radius.circular(8)), - ), - ), - Container( - alignment: Alignment.bottomCenter, - child: Container( - height: 20, - width: 110, - decoration: const BoxDecoration( - color: Colors.black26, - borderRadius: BorderRadius.all(Radius.circular(8)), - ), - ), - ), - Container( - alignment: Alignment.bottomLeft, - margin: const EdgeInsets.only(left: 5), - child: Text( - user!.userName, - textAlign: TextAlign.left, - style: const TextStyle( - color: Colors.white, - fontSize: 12, - ), - ), - ), - Container( - alignment: Alignment.bottomRight, - margin: const EdgeInsets.only(right: 5, bottom: 5), - // height: 110, - // width: 110, - child: Image( - height: 12, - width: 12, - image: isMuted.value ? const AssetImage("assets/images/png/zoom/muted@2x.png") : const AssetImage("assets/images/png/zoom/talking@2x.png"), - fit: BoxFit.cover, - ), - ) - ], - ), - ); - } else { - return Container( - padding: const EdgeInsets.symmetric(horizontal: 8), - height: 110, - width: 110, - child: Stack( - children: [ - Container( - height: 110, - width: 110, - decoration: BoxDecoration( - color: const Color(0xff232323), - border: Border.all( - color: const Color(0xff666666), - width: 1, - ), - borderRadius: const BorderRadius.all(Radius.circular(8)), - ), - alignment: Alignment.center, - child: Container( - alignment: Alignment.center, - child: const Image( - height: 60, - width: 60, - image: AssetImage("assets/images/png/zoom/default-avatar.png"), - )), - ), - Align( - alignment: Alignment.bottomCenter, - child: Container( - height: 20, - width: 110, - decoration: const BoxDecoration( - color: Colors.black26, - borderRadius: BorderRadius.all(Radius.circular(8)), - ), - ), - ), - Container( - alignment: Alignment.bottomLeft, - margin: const EdgeInsets.only(left: 5), - child: Text( - user!.userName, - textAlign: TextAlign.left, - style: const TextStyle( - color: Colors.white, - fontSize: 12, - ), - ), - ), - Container( - alignment: Alignment.bottomRight, - margin: const EdgeInsets.only(right: 5, bottom: 5), - child: Image( - height: 12, - width: 12, - image: isMuted.value ? const AssetImage("assets/images/png/zoom/muted@2x.png") : const AssetImage("assets/images/png/zoom/talking@2x.png"), - fit: BoxFit.cover, - ), - ), - ], - ), - ); - } - } - } -} +// import 'dart:async'; +// +// import 'package:flutter/material.dart'; +// import 'package:flutter_hooks/flutter_hooks.dart'; +// import 'package:flutter_zoom_videosdk/flutter_zoom_view.dart' as FlutterZoomView; +// import 'package:flutter_zoom_videosdk/native/zoom_videosdk.dart'; +// +// const SHOW_TALKING_ICON_DURATION = 2000; +// +// class VideoView extends FlutterZoomView.ZoomView { +// const VideoView({ +// super.key, +// required super.user, +// required super.sharing, +// required super.preview, +// required super.focused, +// required super.hasMultiCamera, +// required super.multiCameraIndex, +// required super.videoAspect, +// required super.fullScreen, +// required super.resolution, +// required super.isPiPView, +// }); +// +// @override +// Widget build(BuildContext context) { +// var isVideoOn = useState(false); +// var isTalking = useState(false); +// var isMuted = useState(false); +// var isMounted = useIsMounted(); +// var zoom = ZoomVideoSdk(); +// var isSharing = useState(false); +// user?.audioStatus?.isMuted().then((muted) => isMuted.value = muted); +// +// useEffect(() { +// updateVideoStatus() { +// if (user == null) return; +// Future.microtask(() async { +// if (isMounted()) { +// isVideoOn.value = (await user!.videoStatus!.isOn()); +// isSharing.value = sharing; +// } +// }); +// } +// +// resetAudioStatus() { +// isTalking.value = false; +// isMuted.value = false; +// } +// +// updateAudioStatus() async { +// if (!isMounted()) return; +// var talking = await user?.audioStatus?.isTalking(); +// var muted = await user?.audioStatus?.isMuted(); +// isMuted.value = muted!; +// isTalking.value = talking!; +// if (talking) { +// Timer( +// const Duration(milliseconds: SHOW_TALKING_ICON_DURATION), +// () => { +// if (isMounted()) +// { +// isTalking.value = false, +// } +// }); +// } +// } +// +// updateVideoStatus(); +// return null; +// }, [zoom, user]); +// +// ImageIcon audioStatusIcon; +// if (isTalking.value) { +// audioStatusIcon = const ImageIcon( +// AssetImage("assets/images/png/zoom/talking@2x.png"), +// ); +// } else if (isMuted.value) { +// audioStatusIcon = const ImageIcon( +// AssetImage("assets/images/png/zoom/muted@2x.png"), +// ); +// } +// // Pass parameters to the platform side. +// final Map creationParams = {}; +// creationParams.putIfAbsent("userId", () => user?.userId); +// creationParams.putIfAbsent("sharing", () => sharing); +// creationParams.putIfAbsent("preview", () => preview); +// creationParams.putIfAbsent("focused", () => focused); +// creationParams.putIfAbsent("hasMultiCamera", () => hasMultiCamera); +// if (videoAspect.isEmpty) { +// creationParams.putIfAbsent("videoAspect", () => VideoAspect.PanAndScan); +// } else { +// creationParams.putIfAbsent("videoAspect", () => videoAspect); +// } +// creationParams.putIfAbsent("fullScreen", () => fullScreen); +// if (resolution.isNotEmpty) { +// creationParams.putIfAbsent("videoAspect", () => videoAspect); +// } +// +// if (fullScreen) { +// if (sharing) { +// return Container( +// height: MediaQuery.of(context).size.height, +// width: MediaQuery.of(context).size.width, +// alignment: Alignment.center, +// child: FlutterZoomView.View(creationParams: creationParams), +// ); +// } else if (isVideoOn.value) { +// return Container( +// height: MediaQuery.of(context).size.height, +// width: MediaQuery.of(context).size.width, +// alignment: Alignment.center, +// child: FlutterZoomView.View(creationParams: creationParams), +// ); +// } else { +// return Container( +// margin: const EdgeInsets.symmetric(vertical: 0), +// child: Container( +// alignment: Alignment.center, +// child: const Image( +// image: AssetImage("assets/images/png/zoom/default-avatar.png"), +// )), +// ); +// } +// } else { +// if (isVideoOn.value || sharing) { +// return Container( +// padding: const EdgeInsets.symmetric(horizontal: 8), +// height: 110, +// width: 110, +// child: Stack( +// children: [ +// Container( +// height: 110, +// width: 110, +// decoration: BoxDecoration( +// color: const Color(0xff232323), +// border: Border.all( +// color: const Color(0xff666666), +// width: 1, +// ), +// borderRadius: const BorderRadius.all(Radius.circular(8)), +// ), +// alignment: Alignment.center, +// child: FlutterZoomView.View(creationParams: creationParams), +// ), +// Container( +// height: 110, +// width: 110, +// decoration: const BoxDecoration( +// borderRadius: BorderRadius.all(Radius.circular(8)), +// ), +// ), +// Container( +// alignment: Alignment.bottomCenter, +// child: Container( +// height: 20, +// width: 110, +// decoration: const BoxDecoration( +// color: Colors.black26, +// borderRadius: BorderRadius.all(Radius.circular(8)), +// ), +// ), +// ), +// Container( +// alignment: Alignment.bottomLeft, +// margin: const EdgeInsets.only(left: 5), +// child: Text( +// user!.userName, +// textAlign: TextAlign.left, +// style: const TextStyle( +// color: Colors.white, +// fontSize: 12, +// ), +// ), +// ), +// Container( +// alignment: Alignment.bottomRight, +// margin: const EdgeInsets.only(right: 5, bottom: 5), +// // height: 110, +// // width: 110, +// child: Image( +// height: 12, +// width: 12, +// image: isMuted.value ? const AssetImage("assets/images/png/zoom/muted@2x.png") : const AssetImage("assets/images/png/zoom/talking@2x.png"), +// fit: BoxFit.cover, +// ), +// ) +// ], +// ), +// ); +// } else { +// return Container( +// padding: const EdgeInsets.symmetric(horizontal: 8), +// height: 110, +// width: 110, +// child: Stack( +// children: [ +// Container( +// height: 110, +// width: 110, +// decoration: BoxDecoration( +// color: const Color(0xff232323), +// border: Border.all( +// color: const Color(0xff666666), +// width: 1, +// ), +// borderRadius: const BorderRadius.all(Radius.circular(8)), +// ), +// alignment: Alignment.center, +// child: Container( +// alignment: Alignment.center, +// child: const Image( +// height: 60, +// width: 60, +// image: AssetImage("assets/images/png/zoom/default-avatar.png"), +// )), +// ), +// Align( +// alignment: Alignment.bottomCenter, +// child: Container( +// height: 20, +// width: 110, +// decoration: const BoxDecoration( +// color: Colors.black26, +// borderRadius: BorderRadius.all(Radius.circular(8)), +// ), +// ), +// ), +// Container( +// alignment: Alignment.bottomLeft, +// margin: const EdgeInsets.only(left: 5), +// child: Text( +// user!.userName, +// textAlign: TextAlign.left, +// style: const TextStyle( +// color: Colors.white, +// fontSize: 12, +// ), +// ), +// ), +// Container( +// alignment: Alignment.bottomRight, +// margin: const EdgeInsets.only(right: 5, bottom: 5), +// child: Image( +// height: 12, +// width: 12, +// image: isMuted.value ? const AssetImage("assets/images/png/zoom/muted@2x.png") : const AssetImage("assets/images/png/zoom/talking@2x.png"), +// fit: BoxFit.cover, +// ), +// ), +// ], +// ), +// ); +// } +// } +// } +// } diff --git a/lib/routes/app_routes.dart b/lib/routes/app_routes.dart index d09a6c0..4bd7288 100644 --- a/lib/routes/app_routes.dart +++ b/lib/routes/app_routes.dart @@ -34,7 +34,7 @@ class AppRoutes { eReferralPage: (context) => NewReferralPage(), comprehensiveCheckupPage: (context) => ComprehensiveCheckupPage(), homeHealthCarePage: (context) => HhcProceduresPage(), - zoomCallPage: (context) => CallScreen(), + // zoomCallPage: (context) => CallScreen(), bloodDonationPage: (context) => BloodDonationPage() }; } diff --git a/lib/splashPage.dart b/lib/splashPage.dart index b5b752b..2c123cf 100644 --- a/lib/splashPage.dart +++ b/lib/splashPage.dart @@ -7,7 +7,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_callkit_incoming/entities/call_event.dart'; import 'package:flutter_callkit_incoming/flutter_callkit_incoming.dart'; import 'package:flutter_svg/flutter_svg.dart'; -import 'package:flutter_zoom_videosdk/native/zoom_videosdk.dart'; +// import 'package:flutter_zoom_videosdk/native/zoom_videosdk.dart'; import 'package:get_it/get_it.dart'; import 'package:hmg_patient_app_new/presentation/lab/lab_orders_page.dart'; import 'package:hmg_patient_app_new/presentation/onboarding/onboarding_screen.dart'; @@ -70,12 +70,12 @@ class _SplashScreenState extends State { } } }); - var zoom = ZoomVideoSdk(); - InitConfig initConfig = InitConfig( - domain: "zoom.us", - enableLog: false, - ); - zoom.initSdk(initConfig); + // var zoom = ZoomVideoSdk(); + // InitConfig initConfig = InitConfig( + // domain: "zoom.us", + // enableLog: false, + // ); + // zoom.initSdk(initConfig); } navigateToTeleConsult() async { @@ -91,7 +91,7 @@ class _SplashScreenState extends State { GetIt.instance().navigatorKey.currentContext!, AppRoutes.zoomCallPage, // arguments: CallArguments(appointmentID, "111", "Patient", "40", "1", true, 1), - arguments: CallArguments(roomID, "123", "Patient", "40", "0", true, 1), + // arguments: CallArguments(roomID, "123", "Patient", "40", "0", true, 1), // arguments: CallArguments("SmallDailyStandup9875", "123", "Patient", "40", "0", false, int.parse(widget.incomingCallData!.appointmentNo!)), ); } diff --git a/pubspec.yaml b/pubspec.yaml index c4fa97b..7567b9b 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -60,7 +60,7 @@ dependencies: geolocator: ^14.0.2 dropdown_search: ^6.0.2 google_maps_flutter: ^2.13.1 - flutter_zoom_videosdk: 2.1.10 +# flutter_zoom_videosdk: 2.1.10 dart_jsonwebtoken: ^3.2.0 dartz: ^0.10.1 equatable: ^2.0.7 @@ -94,6 +94,7 @@ dependencies: path: flutter-hms-map scrollable_positioned_list: ^0.3.8 + live_activities: ^2.4.2 dev_dependencies: flutter_test: