WIP: huawei watch integration. the watch is integrated but some items are not being fetched
parent
f84d5c6769
commit
7be7e99ea7
@ -1 +1,110 @@
|
|||||||
{"agcgw":{"url":"connect-drcn.dbankcloud.cn","backurl":"connect-drcn.hispace.hicloud.com","websocketurl":"connect-ws-drcn.hispace.dbankcloud.cn","websocketbackurl":"connect-ws-drcn.hispace.dbankcloud.com"},"agcgw_all":{"SG":"connect-dra.dbankcloud.cn","SG_back":"connect-dra.hispace.hicloud.com","CN":"connect-drcn.dbankcloud.cn","CN_back":"connect-drcn.hispace.hicloud.com","RU":"connect-drru.hispace.dbankcloud.ru","RU_back":"connect-drru.hispace.dbankcloud.cn","DE":"connect-dre.dbankcloud.cn","DE_back":"connect-dre.hispace.hicloud.com"},"websocketgw_all":{"SG":"connect-ws-dra.hispace.dbankcloud.cn","SG_back":"connect-ws-dra.hispace.dbankcloud.com","CN":"connect-ws-drcn.hispace.dbankcloud.cn","CN_back":"connect-ws-drcn.hispace.dbankcloud.com","RU":"connect-ws-drru.hispace.dbankcloud.ru","RU_back":"connect-ws-drru.hispace.dbankcloud.cn","DE":"connect-ws-dre.hispace.dbankcloud.cn","DE_back":"connect-ws-dre.hispace.dbankcloud.com"},"client":{"cp_id":"2640966000002322881","product_id":"736430079244816567","client_id":"563735388191982656","client_secret":"650C7C799812AFFD53A10C7756CF05FB9F215A7E49032ABA8EBF3E14B77535CF","project_id":"736430079244816567","app_id":"116912301","api_key":"CgB6e3x9DJzMgRCmnT6dyUEkp6UsIfddb6l3w0ZEXzeiRMHEFi3400Z5fJ5qaHneU0OrAI/JRpk+DMGVs3QpUxlI","package_name":"com.cloudsolutions.HMGPatientApp"},"oauth_client":{"client_id":"116912301","client_type":1},"app_info":{"app_id":"116912301","package_name":"com.cloudsolutions.HMGPatientApp"},"service":{"analytics":{"collector_url":"datacollector-drcn.dt.hicloud.com,datacollector-drcn.dt.dbankcloud.cn","collector_url_cn":"datacollector-drcn.dt.hicloud.com,datacollector-drcn.dt.dbankcloud.cn","collector_url_de":"datacollector-dre.dt.hicloud.com,datacollector-dre.dt.dbankcloud.cn","collector_url_ru":"datacollector-drru.dt.dbankcloud.ru,datacollector-drru.dt.hicloud.com","collector_url_sg":"datacollector-dra.dt.hicloud.com,datacollector-dra.dt.dbankcloud.cn","resource_id":"p1","channel_id":""},"ml":{"mlservice_url":"ml-api-drcn.ai.dbankcloud.com,ml-api-drcn.ai.dbankcloud.cn"},"cloudstorage":{"storage_url":"https://agc-storage-drcn.platform.dbankcloud.cn","storage_url_ru":"https://agc-storage-drru.cloud.huawei.ru","storage_url_sg":"https://ops-dra.agcstorage.link","storage_url_de":"https://ops-dre.agcstorage.link","storage_url_cn":"https://agc-storage-drcn.platform.dbankcloud.cn","storage_url_ru_back":"https://agc-storage-drru.cloud.huawei.ru","storage_url_sg_back":"https://agc-storage-dra.cloud.huawei.asia","storage_url_de_back":"https://agc-storage-dre.cloud.huawei.eu","storage_url_cn_back":"https://agc-storage-drcn.cloud.huawei.com.cn"},"search":{"url":"https://search-drcn.cloud.huawei.com"},"edukit":{"edu_url":"edukit.cloud.huawei.com.cn","dh_url":"edukit.cloud.huawei.com.cn"}},"region":"CN","configuration_version":"3.0","appInfos":[{"package_name":"com.cloudsolutions.HMGPatientApp","client":{"app_id":"116912301"},"app_info":{"package_name":"com.cloudsolutions.HMGPatientApp","app_id":"116912301"},"oauth_client":{"client_type":1,"client_id":"116912301"}},{"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"}}]}
|
{
|
||||||
|
"agcgw": {
|
||||||
|
"url": "connect-drcn.dbankcloud.cn",
|
||||||
|
"backurl": "connect-drcn.hispace.hicloud.com",
|
||||||
|
"websocketurl": "connect-ws-drcn.hispace.dbankcloud.cn",
|
||||||
|
"websocketbackurl": "connect-ws-drcn.hispace.dbankcloud.com"
|
||||||
|
},
|
||||||
|
"agcgw_all": {
|
||||||
|
"SG": "connect-dra.dbankcloud.cn",
|
||||||
|
"SG_back": "connect-dra.hispace.hicloud.com",
|
||||||
|
"CN": "connect-drcn.dbankcloud.cn",
|
||||||
|
"CN_back": "connect-drcn.hispace.hicloud.com",
|
||||||
|
"RU": "connect-drru.hispace.dbankcloud.ru",
|
||||||
|
"RU_back": "connect-drru.hispace.dbankcloud.cn",
|
||||||
|
"DE": "connect-dre.dbankcloud.cn",
|
||||||
|
"DE_back": "connect-dre.hispace.hicloud.com"
|
||||||
|
},
|
||||||
|
"websocketgw_all": {
|
||||||
|
"SG": "connect-ws-dra.hispace.dbankcloud.cn",
|
||||||
|
"SG_back": "connect-ws-dra.hispace.dbankcloud.com",
|
||||||
|
"CN": "connect-ws-drcn.hispace.dbankcloud.cn",
|
||||||
|
"CN_back": "connect-ws-drcn.hispace.dbankcloud.com",
|
||||||
|
"RU": "connect-ws-drru.hispace.dbankcloud.ru",
|
||||||
|
"RU_back": "connect-ws-drru.hispace.dbankcloud.cn",
|
||||||
|
"DE": "connect-ws-dre.hispace.dbankcloud.cn",
|
||||||
|
"DE_back": "connect-ws-dre.hispace.dbankcloud.com"
|
||||||
|
},
|
||||||
|
"client": {
|
||||||
|
"cp_id": "2640966000002322881",
|
||||||
|
"product_id": "736430079244816567",
|
||||||
|
"client_id": "563735388191982656",
|
||||||
|
"client_secret": "650C7C799812AFFD53A10C7756CF05FB9F215A7E49032ABA8EBF3E14B77535CF",
|
||||||
|
"project_id": "736430079244816567",
|
||||||
|
"app_id": "116912301",
|
||||||
|
"api_key": "CgB6e3x9DJzMgRCmnT6dyUEkp6UsIfddb6l3w0ZEXzeiRMHEFi3400Z5fJ5qaHneU0OrAI/JRpk+DMGVs3QpUxlI",
|
||||||
|
"package_name": "com.cloudsolutions.HMGPatientApp"
|
||||||
|
},
|
||||||
|
"oauth_client": {
|
||||||
|
"client_id": "116912301",
|
||||||
|
"client_type": 1
|
||||||
|
},
|
||||||
|
"app_info": {
|
||||||
|
"app_id": "116912301",
|
||||||
|
"package_name": "com.cloudsolutions.HMGPatientApp"
|
||||||
|
},
|
||||||
|
"service": {
|
||||||
|
"analytics": {
|
||||||
|
"collector_url": "datacollector-drcn.dt.hicloud.com,datacollector-drcn.dt.dbankcloud.cn",
|
||||||
|
"collector_url_cn": "datacollector-drcn.dt.hicloud.com,datacollector-drcn.dt.dbankcloud.cn",
|
||||||
|
"collector_url_de": "datacollector-dre.dt.hicloud.com,datacollector-dre.dt.dbankcloud.cn",
|
||||||
|
"collector_url_ru": "datacollector-drru.dt.dbankcloud.ru,datacollector-drru.dt.hicloud.com",
|
||||||
|
"collector_url_sg": "datacollector-dra.dt.hicloud.com,datacollector-dra.dt.dbankcloud.cn",
|
||||||
|
"resource_id": "p1",
|
||||||
|
"channel_id": ""
|
||||||
|
},
|
||||||
|
"ml": {
|
||||||
|
"mlservice_url": "ml-api-drcn.ai.dbankcloud.com,ml-api-drcn.ai.dbankcloud.cn"
|
||||||
|
},
|
||||||
|
"cloudstorage": {
|
||||||
|
"storage_url": "https://agc-storage-drcn.platform.dbankcloud.cn",
|
||||||
|
"storage_url_ru": "https://agc-storage-drru.cloud.huawei.ru",
|
||||||
|
"storage_url_sg": "https://ops-dra.agcstorage.link",
|
||||||
|
"storage_url_de": "https://ops-dre.agcstorage.link",
|
||||||
|
"storage_url_cn": "https://agc-storage-drcn.platform.dbankcloud.cn",
|
||||||
|
"storage_url_ru_back": "https://agc-storage-drru.cloud.huawei.ru",
|
||||||
|
"storage_url_sg_back": "https://agc-storage-dra.cloud.huawei.asia",
|
||||||
|
"storage_url_de_back": "https://agc-storage-dre.cloud.huawei.eu",
|
||||||
|
"storage_url_cn_back": "https://agc-storage-drcn.cloud.huawei.com.cn"
|
||||||
|
},
|
||||||
|
"search": {
|
||||||
|
"url": "https://search-drcn.cloud.huawei.com"
|
||||||
|
},
|
||||||
|
"edukit": {
|
||||||
|
"edu_url": "edukit.cloud.huawei.com.cn",
|
||||||
|
"dh_url": "edukit.cloud.huawei.com.cn"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"region": "CN",
|
||||||
|
"configuration_version": "3.0",
|
||||||
|
"appInfos": [
|
||||||
|
{
|
||||||
|
"package_name": "com.cloudsolutions.HMGPatientApp",
|
||||||
|
"client": {
|
||||||
|
"app_id": "116912301"
|
||||||
|
},
|
||||||
|
"app_info": {
|
||||||
|
"package_name": "com.cloudsolutions.HMGPatientApp",
|
||||||
|
"app_id": "116912301"
|
||||||
|
},
|
||||||
|
"oauth_client": {
|
||||||
|
"client_type": 1,
|
||||||
|
"client_id": "116912301"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"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"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
@ -0,0 +1,83 @@
|
|||||||
|
package com.cloudsolutions.HMGPatientApp.watch.huawei
|
||||||
|
|
||||||
|
import android.os.Build
|
||||||
|
import android.util.Log
|
||||||
|
import androidx.annotation.RequiresApi
|
||||||
|
import com.cloudsolutions.HMGPatientApp.MainActivity
|
||||||
|
import com.cloudsolutions.HMGPatientApp.watch.samsung_watch.model.Vitals
|
||||||
|
import com.huawei.hms.adapter.AvailableAdapter
|
||||||
|
import com.huawei.hms.adapter.internal.AvailableCode
|
||||||
|
import com.samsung.android.sdk.health.data.HealthDataStore
|
||||||
|
import com.samsung.android.sdk.health.data.permission.AccessType
|
||||||
|
import com.samsung.android.sdk.health.data.permission.Permission
|
||||||
|
import com.samsung.android.sdk.health.data.request.DataType
|
||||||
|
import com.samsung.android.sdk.health.data.request.DataTypes
|
||||||
|
import com.samsung.android.sdk.health.data.request.LocalTimeFilter
|
||||||
|
import com.samsung.android.sdk.health.data.request.LocalTimeGroup
|
||||||
|
import com.samsung.android.sdk.health.data.request.LocalTimeGroupUnit
|
||||||
|
import com.samsung.android.sdk.health.data.request.Ordering
|
||||||
|
import io.flutter.embedding.engine.FlutterEngine
|
||||||
|
import io.flutter.plugin.common.MethodCall
|
||||||
|
import io.flutter.plugin.common.MethodChannel
|
||||||
|
import kotlinx.coroutines.CoroutineScope
|
||||||
|
import kotlinx.coroutines.Dispatchers
|
||||||
|
import kotlinx.coroutines.SupervisorJob
|
||||||
|
import kotlinx.coroutines.launch
|
||||||
|
import java.time.LocalDateTime
|
||||||
|
import java.time.LocalTime
|
||||||
|
|
||||||
|
|
||||||
|
class HuaweiWatch(
|
||||||
|
private var flutterEngine: FlutterEngine,
|
||||||
|
private var mainActivity: MainActivity
|
||||||
|
) {
|
||||||
|
|
||||||
|
private lateinit var channel: MethodChannel
|
||||||
|
private lateinit var dataStore: HealthDataStore
|
||||||
|
private val scope = CoroutineScope(SupervisorJob() + Dispatchers.IO)
|
||||||
|
private val TAG = "HuaweiWatch"
|
||||||
|
|
||||||
|
|
||||||
|
private lateinit var vitals: MutableMap<String, List<Vitals>>
|
||||||
|
companion object {
|
||||||
|
private const val CHANNEL = "huawei_watch"
|
||||||
|
|
||||||
|
}
|
||||||
|
init{
|
||||||
|
create()
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@RequiresApi(Build.VERSION_CODES.O)
|
||||||
|
fun create() {
|
||||||
|
Log.d(TAG, "create: is called")
|
||||||
|
// openTok = OpenTok(mainActivity, flutterEngine)
|
||||||
|
channel = MethodChannel(flutterEngine.dartExecutor.binaryMessenger, CHANNEL)
|
||||||
|
channel.setMethodCallHandler { call: MethodCall, result: MethodChannel.Result ->
|
||||||
|
when (call.method) {
|
||||||
|
"init" -> {
|
||||||
|
init(result)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
else -> {
|
||||||
|
result.notImplemented()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fun init(methodResult: MethodChannel.Result) {
|
||||||
|
val availableAdapter = AvailableAdapter(60400312)
|
||||||
|
val result = availableAdapter.isHuaweiMobileServicesAvailable(mainActivity) // context indicates a context object.
|
||||||
|
if (result != AvailableCode.SUCCESS) {
|
||||||
|
availableAdapter.startResolution(mainActivity, object : AvailableAdapter.AvailableCallBack {
|
||||||
|
override fun onComplete(result: Int) {
|
||||||
|
Log.d(TAG, "onComplete result: " + result)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}else {
|
||||||
|
methodResult.error("failure", "Unable to install hms" , null )
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,333 @@
|
|||||||
|
package com.ejada.hmg.watch.huawei
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
import android.content.Intent
|
||||||
|
import android.os.Build
|
||||||
|
import android.util.Log
|
||||||
|
import androidx.annotation.RequiresApi
|
||||||
|
import com.ejada.hmg.MainActivity
|
||||||
|
import com.ejada.hmg.watch.huawei.samsung_watch.model.Vitals
|
||||||
|
import com.huawei.hms.adapter.AvailableAdapter
|
||||||
|
import com.huawei.hms.adapter.internal.AvailableCode
|
||||||
|
import com.huawei.hms.hihealth.HuaweiHiHealth
|
||||||
|
import com.huawei.hms.hihealth.SettingController
|
||||||
|
import com.huawei.hms.hihealth.data.Scopes
|
||||||
|
|
||||||
|
import io.flutter.embedding.engine.FlutterEngine
|
||||||
|
import io.flutter.plugin.common.MethodCall
|
||||||
|
import io.flutter.plugin.common.MethodChannel
|
||||||
|
import kotlinx.coroutines.CoroutineScope
|
||||||
|
import kotlinx.coroutines.Dispatchers
|
||||||
|
import kotlinx.coroutines.SupervisorJob
|
||||||
|
import kotlinx.coroutines.cancel
|
||||||
|
import java.time.Instant
|
||||||
|
import java.time.temporal.ChronoUnit
|
||||||
|
import java.util.Date
|
||||||
|
|
||||||
|
|
||||||
|
class HuaweiWatch(
|
||||||
|
private var flutterEngine: FlutterEngine,
|
||||||
|
private var mainActivity: MainActivity
|
||||||
|
) {
|
||||||
|
|
||||||
|
private lateinit var channel: MethodChannel
|
||||||
|
lateinit var mSettingController: SettingController
|
||||||
|
val REQUEST_AUTH: Int = 1002
|
||||||
|
|
||||||
|
|
||||||
|
private val scope = CoroutineScope(SupervisorJob() + Dispatchers.IO)
|
||||||
|
val TAG = "HuaweiWatch"
|
||||||
|
|
||||||
|
var result : MethodChannel.Result? = null
|
||||||
|
var startDate: Date? = null
|
||||||
|
var endDate: Date? = null
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
private lateinit var vitals: MutableMap<String, List<Vitals>>
|
||||||
|
companion object {
|
||||||
|
private const val CHANNEL = "huawei_watch"
|
||||||
|
|
||||||
|
}
|
||||||
|
init{
|
||||||
|
create()
|
||||||
|
val now = Instant.now()
|
||||||
|
endDate = Date.from(now)
|
||||||
|
startDate = Date.from(now.minus(365, ChronoUnit.DAYS))
|
||||||
|
}
|
||||||
|
|
||||||
|
@RequiresApi(Build.VERSION_CODES.O)
|
||||||
|
fun create() {
|
||||||
|
Log.d(TAG, "create: is called")
|
||||||
|
// openTok = OpenTok(mainActivity, flutterEngine)
|
||||||
|
channel = MethodChannel(flutterEngine.dartExecutor.binaryMessenger, CHANNEL)
|
||||||
|
channel.setMethodCallHandler { call: MethodCall, result: MethodChannel.Result ->
|
||||||
|
when (call.method) {
|
||||||
|
"init" -> {
|
||||||
|
this.result = result
|
||||||
|
|
||||||
|
Log.d(TAG, "onMethodCall: init called")
|
||||||
|
mSettingController = HuaweiHiHealth.getSettingController(mainActivity);
|
||||||
|
val availableAdapter = AvailableAdapter(60400312)
|
||||||
|
val results= availableAdapter.isHuaweiMobileServicesAvailable(mainActivity) // context indicates a context object.
|
||||||
|
if (results != AvailableCode.SUCCESS) {
|
||||||
|
availableAdapter.startResolution(mainActivity, object : AvailableAdapter.AvailableCallBack {
|
||||||
|
override fun onComplete(result: Int) {
|
||||||
|
Log.d(TAG, "onComplete result: " + result)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
result.success("init success")
|
||||||
|
}
|
||||||
|
|
||||||
|
"getPermission"->{
|
||||||
|
if(!this::mSettingController.isInitialized)
|
||||||
|
result.error("DataStoreNotInitialized", "Please call init before requesting permissions", null)
|
||||||
|
|
||||||
|
// Add scopes to apply for. The following only shows an example. You need to add scopes according to your specific needs.
|
||||||
|
val scopes = arrayOf<String?>( // View and store step count data in Health Service Kit.
|
||||||
|
Scopes.HEALTHKIT_STEP_READ, Scopes.HEALTHKIT_OXYGEN_SATURATION_READ, // View and store height and weight data in Health Service Kit.
|
||||||
|
Scopes.HEALTHKIT_HEARTRATE_READ, Scopes.HEALTHKIT_SLEEP_READ,
|
||||||
|
Scopes.HEALTHKIT_BODYTEMPERATURE_READ, Scopes.HEALTHKIT_CALORIES_READ
|
||||||
|
)
|
||||||
|
// Obtain the intent of the authorization process. Value true indicates that the authorization process of the Huawei Health app is enabled, and false indicates that the authorization process is disabled.
|
||||||
|
val intent: Intent? = mSettingController.requestAuthorizationIntent(scopes, true)
|
||||||
|
|
||||||
|
// Open the authorization process screen.
|
||||||
|
Log.i(TAG, "start authorization activity")
|
||||||
|
intent?.let{
|
||||||
|
mainActivity.startActivityForResult(intent, REQUEST_AUTH)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
"getHeartRate"->{
|
||||||
|
val dateTime = LocalDateTime.now().with(LocalTime.MIDNIGHT).minusDays(365)
|
||||||
|
val localTimeFilter = LocalTimeFilter.of(dateTime, LocalDateTime.now())
|
||||||
|
val readRequest = DataTypes.HEART_RATE.readDataRequestBuilder
|
||||||
|
.setLocalTimeFilter(localTimeFilter)
|
||||||
|
.setOrdering(Ordering.DESC)
|
||||||
|
.build()
|
||||||
|
|
||||||
|
scope.launch {
|
||||||
|
val heartRateList = dataStore.readData(readRequest).dataList
|
||||||
|
processHeartVital(heartRateList)
|
||||||
|
Log.d("TAG"," the data is ${vitals}")
|
||||||
|
print("the data is ${vitals}")
|
||||||
|
result.success("Data is obtained")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// "getSleepData" -> {
|
||||||
|
// val dateTime = LocalDateTime.now().with(LocalTime.MIDNIGHT).minusDays(365)
|
||||||
|
// val localTimeFilter = LocalTimeFilter.of(dateTime, LocalDateTime.now())
|
||||||
|
// val readRequest = DataTypes.SLEEP.readDataRequestBuilder
|
||||||
|
// .setLocalTimeFilter(localTimeFilter)
|
||||||
|
// .setOrdering(Ordering.ASC)
|
||||||
|
// .build()
|
||||||
|
// scope.launch {
|
||||||
|
// val sleepData = dataStore.readData(readRequest).dataList
|
||||||
|
// processSleepVital(sleepData)
|
||||||
|
// print("the data is $vitals")
|
||||||
|
// Log.d(TAG, "the data is $vitals")
|
||||||
|
// result.success("Data is obtained")
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// "steps"->{
|
||||||
|
// val dateTime = LocalDateTime.now().with(LocalTime.MIDNIGHT).minusDays(365)
|
||||||
|
// val localTimeFilter = LocalTimeFilter.of(dateTime, LocalDateTime.now())
|
||||||
|
// val localTimeGroup = LocalTimeGroup.of(LocalTimeGroupUnit.HOURLY, 1)
|
||||||
|
// val aggregateRequest = DataType.StepsType.TOTAL.requestBuilder
|
||||||
|
// .setLocalTimeFilterWithGroup(localTimeFilter, localTimeGroup)
|
||||||
|
// .setOrdering(Ordering.ASC)
|
||||||
|
// .build()
|
||||||
|
//
|
||||||
|
// scope.launch {
|
||||||
|
// val steps = dataStore.aggregateData(aggregateRequest)
|
||||||
|
// processStepsCount(steps)
|
||||||
|
// print("the data is $vitals")
|
||||||
|
// Log.d(TAG, "the data is $vitals")
|
||||||
|
// result.success("Data is obtained")
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// "activitySummary"->{
|
||||||
|
// val dateTime = LocalDateTime.now().with(LocalTime.MIDNIGHT).minusDays(365)
|
||||||
|
// val localTimeFilter = LocalTimeFilter.of(dateTime, LocalDateTime.now())
|
||||||
|
// val localTimeGroup = LocalTimeGroup.of(LocalTimeGroupUnit.HOURLY, 1)
|
||||||
|
// val readRequest = DataType.ActivitySummaryType.TOTAL_CALORIES_BURNED.requestBuilder
|
||||||
|
// .setLocalTimeFilterWithGroup(localTimeFilter, localTimeGroup)
|
||||||
|
// .setOrdering(Ordering.DESC)
|
||||||
|
// .build()
|
||||||
|
//
|
||||||
|
// scope.launch {
|
||||||
|
// val activityResult = dataStore.aggregateData(readRequest).dataList
|
||||||
|
// processActivity(activityResult)
|
||||||
|
// Log.d("TAG"," the data is ${vitals}")
|
||||||
|
// print("the data is ${vitals}")
|
||||||
|
// result.success("Data is obtained")
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// "bloodOxygen"->{
|
||||||
|
// val dateTime = LocalDateTime.now().with(LocalTime.MIDNIGHT).minusDays(365)
|
||||||
|
// val localTimeFilter = LocalTimeFilter.of(dateTime, LocalDateTime.now())
|
||||||
|
// val readRequest = DataTypes.BLOOD_OXYGEN.readDataRequestBuilder
|
||||||
|
// .setLocalTimeFilter(localTimeFilter)
|
||||||
|
// .setOrdering(Ordering.DESC)
|
||||||
|
// .build()
|
||||||
|
//
|
||||||
|
// scope.launch {
|
||||||
|
// val bloodOxygenList = dataStore.readData(readRequest).dataList
|
||||||
|
// processBloodOxygen(bloodOxygenList)
|
||||||
|
// Log.d("TAG"," the data is ${vitals}")
|
||||||
|
// print("the data is ${vitals["bloodOxygen"]}")
|
||||||
|
// result.success("Data is obtained")
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// "bodyTemperature"->{
|
||||||
|
// val dateTime = LocalDateTime.now().with(LocalTime.MIDNIGHT).minusDays(365)
|
||||||
|
// val localTimeFilter = LocalTimeFilter.of(dateTime, LocalDateTime.now())
|
||||||
|
// val readRequest = DataTypes.BODY_TEMPERATURE.readDataRequestBuilder
|
||||||
|
// .setLocalTimeFilter(localTimeFilter)
|
||||||
|
// .setOrdering(Ordering.DESC)
|
||||||
|
// .build()
|
||||||
|
//
|
||||||
|
// scope.launch {
|
||||||
|
// val bodyTemperatureList = dataStore.readData(readRequest).dataList
|
||||||
|
// processBodyTemperature(bodyTemperatureList)
|
||||||
|
// Log.d("TAG"," the data is ${vitals}")
|
||||||
|
// print("the data is ${vitals["bodyTemperature"]}")
|
||||||
|
// result.success("Data is obtained")
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// "retrieveData"->{
|
||||||
|
// if(vitals.isEmpty()){
|
||||||
|
// result.error("NoDataFound", "No Data was obtained", null)
|
||||||
|
// return@setMethodCallHandler
|
||||||
|
// }
|
||||||
|
// result.success("""
|
||||||
|
// {
|
||||||
|
// "heartRate": ${vitals["heartRate"]},
|
||||||
|
// "steps": ${vitals["steps"]},
|
||||||
|
// "sleep": ${vitals["sleep"]},
|
||||||
|
// "activity": ${vitals["activity"]},
|
||||||
|
// "bloodOxygen": ${vitals["bloodOxygen"]},
|
||||||
|
// "bodyTemperature": ${vitals["bodyTemperature"]}
|
||||||
|
// }
|
||||||
|
// """.trimIndent())
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
"closeCoroutineScope"->{
|
||||||
|
destroy()
|
||||||
|
result.success("Coroutine Scope Cancelled")
|
||||||
|
}
|
||||||
|
|
||||||
|
else -> {
|
||||||
|
result.notImplemented()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check whether users have enabled Health Service Kit.
|
||||||
|
*/
|
||||||
|
fun getHealthAppAuthorization() {
|
||||||
|
|
||||||
|
mSettingController.healthAppAuthorization
|
||||||
|
.addOnFailureListener { result?.error("UnAuthorized", "User denied the permission", null) }
|
||||||
|
.addOnSuccessListener { result?.success("permission granted"); }
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun CoroutineScope.processBodyTemperature( bodyTemperatureList :List<HealthDataPoint>) {
|
||||||
|
vitals["bodyTemperature"] = mutableListOf()
|
||||||
|
bodyTemperatureList.forEach { stepData ->
|
||||||
|
val vitalData = Vitals().apply {
|
||||||
|
value = stepData.getValue(DataType.BodyTemperatureType.BODY_TEMPERATURE).toString()
|
||||||
|
timeStamp = stepData.endTime.toString()
|
||||||
|
}
|
||||||
|
(vitals["bodyTemperature"] as MutableList).add(vitalData)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun CoroutineScope.processBloodOxygen( bloodOxygenList :List<HealthDataPoint>) {
|
||||||
|
vitals["bloodOxygen"] = mutableListOf()
|
||||||
|
bloodOxygenList.forEach { stepData ->
|
||||||
|
val vitalData = Vitals().apply {
|
||||||
|
value = stepData.getValue(DataType.BloodOxygenType.OXYGEN_SATURATION).toString()
|
||||||
|
timeStamp = stepData.endTime.toString()
|
||||||
|
}
|
||||||
|
(vitals["bloodOxygen"] as MutableList).add(vitalData)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private fun CoroutineScope.processActivity(activityResult: List<AggregatedData<Float>>) {
|
||||||
|
|
||||||
|
vitals["activity"] = mutableListOf()
|
||||||
|
activityResult.forEach { stepData ->
|
||||||
|
val vitalData = Vitals().apply {
|
||||||
|
value = stepData.value.toString()
|
||||||
|
timeStamp = stepData.endTime.toString()
|
||||||
|
}
|
||||||
|
(vitals["activity"] as MutableList).add(vitalData)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun CoroutineScope.processStepsCount(result: DataResponse<AggregatedData<Long>>) {
|
||||||
|
val stepCount = ArrayList<AggregatedData<Long>>()
|
||||||
|
var totalSteps: Long = 0
|
||||||
|
vitals["steps"] = mutableListOf()
|
||||||
|
result.dataList.forEach { stepData ->
|
||||||
|
val vitalData = Vitals().apply {
|
||||||
|
value = (stepData.value as Long).toString()
|
||||||
|
timeStamp = stepData.startTime.toString()
|
||||||
|
}
|
||||||
|
(vitals["steps"] as MutableList).add(vitalData)
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun CoroutineScope.processSleepVital(sleepData: List<HealthDataPoint>) {
|
||||||
|
vitals["sleep"] = mutableListOf()
|
||||||
|
sleepData.forEach {
|
||||||
|
(vitals["sleep"] as MutableList).add(
|
||||||
|
Vitals().apply {
|
||||||
|
timeStamp = it.startTime.toString()
|
||||||
|
value = (it.getValue(DataType.SleepType.DURATION)?.toString().toString())
|
||||||
|
}
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private suspend fun CoroutineScope.processHeartVital(
|
||||||
|
heartRateList: List<HealthDataPoint>,
|
||||||
|
) {
|
||||||
|
vitals["heartRate"] = mutableListOf()
|
||||||
|
heartRateList.forEach {
|
||||||
|
(vitals["heartRate"] as MutableList).add(processHeartRateData(it))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun processHeartRateData(heartRateData: HealthDataPoint) =
|
||||||
|
Vitals().apply {
|
||||||
|
heartRateData.getValue(DataType.HeartRateType.MAX_HEART_RATE)?.let {
|
||||||
|
value = it.toString()
|
||||||
|
}
|
||||||
|
timeStamp = heartRateData.startTime.toString()
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
fun destroy() {
|
||||||
|
scope.cancel()
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -1,4 +1,4 @@
|
|||||||
storePassword=HmGsa123
|
storePassword=HmGsa123
|
||||||
keyPassword=HmGsa123
|
keyPassword=HmGsa123
|
||||||
keyAlias=hmg
|
keyAlias=hmg
|
||||||
storeFile=key
|
storeFile=./key
|
||||||
File diff suppressed because it is too large
Load Diff
@ -1,258 +1,258 @@
|
|||||||
import 'dart:async';
|
// import 'dart:async';
|
||||||
|
//
|
||||||
import 'package:flutter/material.dart';
|
// import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_hooks/flutter_hooks.dart';
|
// import 'package:flutter_hooks/flutter_hooks.dart';
|
||||||
import 'package:flutter_zoom_videosdk/flutter_zoom_view.dart' as FlutterZoomView;
|
// import 'package:flutter_zoom_videosdk/flutter_zoom_view.dart' as FlutterZoomView;
|
||||||
import 'package:flutter_zoom_videosdk/native/zoom_videosdk.dart';
|
// import 'package:flutter_zoom_videosdk/native/zoom_videosdk.dart';
|
||||||
|
//
|
||||||
const SHOW_TALKING_ICON_DURATION = 2000;
|
// const SHOW_TALKING_ICON_DURATION = 2000;
|
||||||
|
//
|
||||||
class VideoView extends FlutterZoomView.ZoomView {
|
// class VideoView extends FlutterZoomView.ZoomView {
|
||||||
const VideoView({
|
// const VideoView({
|
||||||
super.key,
|
// super.key,
|
||||||
required super.user,
|
// required super.user,
|
||||||
required super.sharing,
|
// required super.sharing,
|
||||||
required super.preview,
|
// required super.preview,
|
||||||
required super.focused,
|
// required super.focused,
|
||||||
required super.hasMultiCamera,
|
// required super.hasMultiCamera,
|
||||||
required super.multiCameraIndex,
|
// required super.multiCameraIndex,
|
||||||
required super.videoAspect,
|
// required super.videoAspect,
|
||||||
required super.fullScreen,
|
// required super.fullScreen,
|
||||||
required super.resolution,
|
// required super.resolution,
|
||||||
required super.isPiPView,
|
// required super.isPiPView,
|
||||||
});
|
// });
|
||||||
|
//
|
||||||
@override
|
// @override
|
||||||
Widget build(BuildContext context) {
|
// Widget build(BuildContext context) {
|
||||||
var isVideoOn = useState(false);
|
// var isVideoOn = useState(false);
|
||||||
var isTalking = useState(false);
|
// var isTalking = useState(false);
|
||||||
var isMuted = useState(false);
|
// var isMuted = useState(false);
|
||||||
var isMounted = useIsMounted();
|
// var isMounted = useIsMounted();
|
||||||
var zoom = ZoomVideoSdk();
|
// var zoom = ZoomVideoSdk();
|
||||||
var isSharing = useState(false);
|
// var isSharing = useState(false);
|
||||||
user?.audioStatus?.isMuted().then((muted) => isMuted.value = muted);
|
// user?.audioStatus?.isMuted().then((muted) => isMuted.value = muted);
|
||||||
|
//
|
||||||
useEffect(() {
|
// useEffect(() {
|
||||||
updateVideoStatus() {
|
// updateVideoStatus() {
|
||||||
if (user == null) return;
|
// if (user == null) return;
|
||||||
Future<void>.microtask(() async {
|
// Future<void>.microtask(() async {
|
||||||
if (isMounted()) {
|
// if (isMounted()) {
|
||||||
isVideoOn.value = (await user!.videoStatus!.isOn());
|
// isVideoOn.value = (await user!.videoStatus!.isOn());
|
||||||
isSharing.value = sharing;
|
// isSharing.value = sharing;
|
||||||
}
|
// }
|
||||||
});
|
// });
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
resetAudioStatus() {
|
// resetAudioStatus() {
|
||||||
isTalking.value = false;
|
// isTalking.value = false;
|
||||||
isMuted.value = false;
|
// isMuted.value = false;
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
updateAudioStatus() async {
|
// updateAudioStatus() async {
|
||||||
if (!isMounted()) return;
|
// if (!isMounted()) return;
|
||||||
var talking = await user?.audioStatus?.isTalking();
|
// var talking = await user?.audioStatus?.isTalking();
|
||||||
var muted = await user?.audioStatus?.isMuted();
|
// var muted = await user?.audioStatus?.isMuted();
|
||||||
isMuted.value = muted!;
|
// isMuted.value = muted!;
|
||||||
isTalking.value = talking!;
|
// isTalking.value = talking!;
|
||||||
if (talking) {
|
// if (talking) {
|
||||||
Timer(
|
// Timer(
|
||||||
const Duration(milliseconds: SHOW_TALKING_ICON_DURATION),
|
// const Duration(milliseconds: SHOW_TALKING_ICON_DURATION),
|
||||||
() => {
|
// () => {
|
||||||
if (isMounted())
|
// if (isMounted())
|
||||||
{
|
// {
|
||||||
isTalking.value = false,
|
// isTalking.value = false,
|
||||||
}
|
// }
|
||||||
});
|
// });
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
updateVideoStatus();
|
// updateVideoStatus();
|
||||||
return null;
|
// return null;
|
||||||
}, [zoom, user]);
|
// }, [zoom, user]);
|
||||||
|
//
|
||||||
ImageIcon audioStatusIcon;
|
// ImageIcon audioStatusIcon;
|
||||||
if (isTalking.value) {
|
// if (isTalking.value) {
|
||||||
audioStatusIcon = const ImageIcon(
|
// audioStatusIcon = const ImageIcon(
|
||||||
AssetImage("assets/images/png/zoom/talking@2x.png"),
|
// AssetImage("assets/images/png/zoom/talking@2x.png"),
|
||||||
);
|
// );
|
||||||
} else if (isMuted.value) {
|
// } else if (isMuted.value) {
|
||||||
audioStatusIcon = const ImageIcon(
|
// audioStatusIcon = const ImageIcon(
|
||||||
AssetImage("assets/images/png/zoom/muted@2x.png"),
|
// AssetImage("assets/images/png/zoom/muted@2x.png"),
|
||||||
);
|
// );
|
||||||
}
|
// }
|
||||||
// Pass parameters to the platform side.
|
// // Pass parameters to the platform side.
|
||||||
final Map<String, dynamic> creationParams = <String, dynamic>{};
|
// final Map<String, dynamic> creationParams = <String, dynamic>{};
|
||||||
creationParams.putIfAbsent("userId", () => user?.userId);
|
// creationParams.putIfAbsent("userId", () => user?.userId);
|
||||||
creationParams.putIfAbsent("sharing", () => sharing);
|
// creationParams.putIfAbsent("sharing", () => sharing);
|
||||||
creationParams.putIfAbsent("preview", () => preview);
|
// creationParams.putIfAbsent("preview", () => preview);
|
||||||
creationParams.putIfAbsent("focused", () => focused);
|
// creationParams.putIfAbsent("focused", () => focused);
|
||||||
creationParams.putIfAbsent("hasMultiCamera", () => hasMultiCamera);
|
// creationParams.putIfAbsent("hasMultiCamera", () => hasMultiCamera);
|
||||||
if (videoAspect.isEmpty) {
|
// if (videoAspect.isEmpty) {
|
||||||
creationParams.putIfAbsent("videoAspect", () => VideoAspect.PanAndScan);
|
// creationParams.putIfAbsent("videoAspect", () => VideoAspect.PanAndScan);
|
||||||
} else {
|
// } else {
|
||||||
creationParams.putIfAbsent("videoAspect", () => videoAspect);
|
// creationParams.putIfAbsent("videoAspect", () => videoAspect);
|
||||||
}
|
// }
|
||||||
creationParams.putIfAbsent("fullScreen", () => fullScreen);
|
// creationParams.putIfAbsent("fullScreen", () => fullScreen);
|
||||||
if (resolution.isNotEmpty) {
|
// if (resolution.isNotEmpty) {
|
||||||
creationParams.putIfAbsent("videoAspect", () => videoAspect);
|
// creationParams.putIfAbsent("videoAspect", () => videoAspect);
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
if (fullScreen) {
|
// if (fullScreen) {
|
||||||
if (sharing) {
|
// if (sharing) {
|
||||||
return Container(
|
// return Container(
|
||||||
height: MediaQuery.of(context).size.height,
|
// height: MediaQuery.of(context).size.height,
|
||||||
width: MediaQuery.of(context).size.width,
|
// width: MediaQuery.of(context).size.width,
|
||||||
alignment: Alignment.center,
|
// alignment: Alignment.center,
|
||||||
child: FlutterZoomView.View(creationParams: creationParams),
|
// child: FlutterZoomView.View(creationParams: creationParams),
|
||||||
);
|
// );
|
||||||
} else if (isVideoOn.value) {
|
// } else if (isVideoOn.value) {
|
||||||
return Container(
|
// return Container(
|
||||||
height: MediaQuery.of(context).size.height,
|
// height: MediaQuery.of(context).size.height,
|
||||||
width: MediaQuery.of(context).size.width,
|
// width: MediaQuery.of(context).size.width,
|
||||||
alignment: Alignment.center,
|
// alignment: Alignment.center,
|
||||||
child: FlutterZoomView.View(creationParams: creationParams),
|
// child: FlutterZoomView.View(creationParams: creationParams),
|
||||||
);
|
// );
|
||||||
} else {
|
// } else {
|
||||||
return Container(
|
// return Container(
|
||||||
margin: const EdgeInsets.symmetric(vertical: 0),
|
// margin: const EdgeInsets.symmetric(vertical: 0),
|
||||||
child: Container(
|
// child: Container(
|
||||||
alignment: Alignment.center,
|
// alignment: Alignment.center,
|
||||||
child: const Image(
|
// child: const Image(
|
||||||
image: AssetImage("assets/images/png/zoom/default-avatar.png"),
|
// image: AssetImage("assets/images/png/zoom/default-avatar.png"),
|
||||||
)),
|
// )),
|
||||||
);
|
// );
|
||||||
}
|
// }
|
||||||
} else {
|
// } else {
|
||||||
if (isVideoOn.value || sharing) {
|
// if (isVideoOn.value || sharing) {
|
||||||
return Container(
|
// return Container(
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 8),
|
// padding: const EdgeInsets.symmetric(horizontal: 8),
|
||||||
height: 110,
|
// height: 110,
|
||||||
width: 110,
|
// width: 110,
|
||||||
child: Stack(
|
// child: Stack(
|
||||||
children: [
|
// children: [
|
||||||
Container(
|
// Container(
|
||||||
height: 110,
|
// height: 110,
|
||||||
width: 110,
|
// width: 110,
|
||||||
decoration: BoxDecoration(
|
// decoration: BoxDecoration(
|
||||||
color: const Color(0xff232323),
|
// color: const Color(0xff232323),
|
||||||
border: Border.all(
|
// border: Border.all(
|
||||||
color: const Color(0xff666666),
|
// color: const Color(0xff666666),
|
||||||
width: 1,
|
// width: 1,
|
||||||
),
|
// ),
|
||||||
borderRadius: const BorderRadius.all(Radius.circular(8)),
|
// borderRadius: const BorderRadius.all(Radius.circular(8)),
|
||||||
),
|
// ),
|
||||||
alignment: Alignment.center,
|
// alignment: Alignment.center,
|
||||||
child: FlutterZoomView.View(creationParams: creationParams),
|
// child: FlutterZoomView.View(creationParams: creationParams),
|
||||||
),
|
// ),
|
||||||
Container(
|
// Container(
|
||||||
height: 110,
|
// height: 110,
|
||||||
width: 110,
|
// width: 110,
|
||||||
decoration: const BoxDecoration(
|
// decoration: const BoxDecoration(
|
||||||
borderRadius: BorderRadius.all(Radius.circular(8)),
|
// borderRadius: BorderRadius.all(Radius.circular(8)),
|
||||||
),
|
// ),
|
||||||
),
|
// ),
|
||||||
Container(
|
// Container(
|
||||||
alignment: Alignment.bottomCenter,
|
// alignment: Alignment.bottomCenter,
|
||||||
child: Container(
|
// child: Container(
|
||||||
height: 20,
|
// height: 20,
|
||||||
width: 110,
|
// width: 110,
|
||||||
decoration: const BoxDecoration(
|
// decoration: const BoxDecoration(
|
||||||
color: Colors.black26,
|
// color: Colors.black26,
|
||||||
borderRadius: BorderRadius.all(Radius.circular(8)),
|
// borderRadius: BorderRadius.all(Radius.circular(8)),
|
||||||
),
|
// ),
|
||||||
),
|
// ),
|
||||||
),
|
// ),
|
||||||
Container(
|
// Container(
|
||||||
alignment: Alignment.bottomLeft,
|
// alignment: Alignment.bottomLeft,
|
||||||
margin: const EdgeInsets.only(left: 5),
|
// margin: const EdgeInsets.only(left: 5),
|
||||||
child: Text(
|
// child: Text(
|
||||||
user!.userName,
|
// user!.userName,
|
||||||
textAlign: TextAlign.left,
|
// textAlign: TextAlign.left,
|
||||||
style: const TextStyle(
|
// style: const TextStyle(
|
||||||
color: Colors.white,
|
// color: Colors.white,
|
||||||
fontSize: 12,
|
// fontSize: 12,
|
||||||
),
|
// ),
|
||||||
),
|
// ),
|
||||||
),
|
// ),
|
||||||
Container(
|
// Container(
|
||||||
alignment: Alignment.bottomRight,
|
// alignment: Alignment.bottomRight,
|
||||||
margin: const EdgeInsets.only(right: 5, bottom: 5),
|
// margin: const EdgeInsets.only(right: 5, bottom: 5),
|
||||||
// height: 110,
|
// // height: 110,
|
||||||
// width: 110,
|
// // width: 110,
|
||||||
child: Image(
|
// child: Image(
|
||||||
height: 12,
|
// height: 12,
|
||||||
width: 12,
|
// width: 12,
|
||||||
image: isMuted.value ? const AssetImage("assets/images/png/zoom/muted@2x.png") : const AssetImage("assets/images/png/zoom/talking@2x.png"),
|
// image: isMuted.value ? const AssetImage("assets/images/png/zoom/muted@2x.png") : const AssetImage("assets/images/png/zoom/talking@2x.png"),
|
||||||
fit: BoxFit.cover,
|
// fit: BoxFit.cover,
|
||||||
),
|
// ),
|
||||||
)
|
// )
|
||||||
],
|
// ],
|
||||||
),
|
// ),
|
||||||
);
|
// );
|
||||||
} else {
|
// } else {
|
||||||
return Container(
|
// return Container(
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 8),
|
// padding: const EdgeInsets.symmetric(horizontal: 8),
|
||||||
height: 110,
|
// height: 110,
|
||||||
width: 110,
|
// width: 110,
|
||||||
child: Stack(
|
// child: Stack(
|
||||||
children: [
|
// children: [
|
||||||
Container(
|
// Container(
|
||||||
height: 110,
|
// height: 110,
|
||||||
width: 110,
|
// width: 110,
|
||||||
decoration: BoxDecoration(
|
// decoration: BoxDecoration(
|
||||||
color: const Color(0xff232323),
|
// color: const Color(0xff232323),
|
||||||
border: Border.all(
|
// border: Border.all(
|
||||||
color: const Color(0xff666666),
|
// color: const Color(0xff666666),
|
||||||
width: 1,
|
// width: 1,
|
||||||
),
|
// ),
|
||||||
borderRadius: const BorderRadius.all(Radius.circular(8)),
|
// borderRadius: const BorderRadius.all(Radius.circular(8)),
|
||||||
),
|
// ),
|
||||||
alignment: Alignment.center,
|
// alignment: Alignment.center,
|
||||||
child: Container(
|
// child: Container(
|
||||||
alignment: Alignment.center,
|
// alignment: Alignment.center,
|
||||||
child: const Image(
|
// child: const Image(
|
||||||
height: 60,
|
// height: 60,
|
||||||
width: 60,
|
// width: 60,
|
||||||
image: AssetImage("assets/images/png/zoom/default-avatar.png"),
|
// image: AssetImage("assets/images/png/zoom/default-avatar.png"),
|
||||||
)),
|
// )),
|
||||||
),
|
// ),
|
||||||
Align(
|
// Align(
|
||||||
alignment: Alignment.bottomCenter,
|
// alignment: Alignment.bottomCenter,
|
||||||
child: Container(
|
// child: Container(
|
||||||
height: 20,
|
// height: 20,
|
||||||
width: 110,
|
// width: 110,
|
||||||
decoration: const BoxDecoration(
|
// decoration: const BoxDecoration(
|
||||||
color: Colors.black26,
|
// color: Colors.black26,
|
||||||
borderRadius: BorderRadius.all(Radius.circular(8)),
|
// borderRadius: BorderRadius.all(Radius.circular(8)),
|
||||||
),
|
// ),
|
||||||
),
|
// ),
|
||||||
),
|
// ),
|
||||||
Container(
|
// Container(
|
||||||
alignment: Alignment.bottomLeft,
|
// alignment: Alignment.bottomLeft,
|
||||||
margin: const EdgeInsets.only(left: 5),
|
// margin: const EdgeInsets.only(left: 5),
|
||||||
child: Text(
|
// child: Text(
|
||||||
user!.userName,
|
// user!.userName,
|
||||||
textAlign: TextAlign.left,
|
// textAlign: TextAlign.left,
|
||||||
style: const TextStyle(
|
// style: const TextStyle(
|
||||||
color: Colors.white,
|
// color: Colors.white,
|
||||||
fontSize: 12,
|
// fontSize: 12,
|
||||||
),
|
// ),
|
||||||
),
|
// ),
|
||||||
),
|
// ),
|
||||||
Container(
|
// Container(
|
||||||
alignment: Alignment.bottomRight,
|
// alignment: Alignment.bottomRight,
|
||||||
margin: const EdgeInsets.only(right: 5, bottom: 5),
|
// margin: const EdgeInsets.only(right: 5, bottom: 5),
|
||||||
child: Image(
|
// child: Image(
|
||||||
height: 12,
|
// height: 12,
|
||||||
width: 12,
|
// width: 12,
|
||||||
image: isMuted.value ? const AssetImage("assets/images/png/zoom/muted@2x.png") : const AssetImage("assets/images/png/zoom/talking@2x.png"),
|
// image: isMuted.value ? const AssetImage("assets/images/png/zoom/muted@2x.png") : const AssetImage("assets/images/png/zoom/talking@2x.png"),
|
||||||
fit: BoxFit.cover,
|
// fit: BoxFit.cover,
|
||||||
),
|
// ),
|
||||||
),
|
// ),
|
||||||
],
|
// ],
|
||||||
),
|
// ),
|
||||||
);
|
// );
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|||||||
Loading…
Reference in New Issue