updates
parent
bd3dca6719
commit
62bc29d450
@ -0,0 +1,52 @@
|
|||||||
|
package com.cloud.diplomaticquarterapp.whatsapp
|
||||||
|
|
||||||
|
import android.os.Build
|
||||||
|
import android.util.Log
|
||||||
|
import androidx.annotation.RequiresApi
|
||||||
|
import com.cloud.diplomaticquarterapp.penguin.PenguinView
|
||||||
|
import com.ejada.hmg.MainActivity
|
||||||
|
import io.flutter.embedding.engine.FlutterEngine
|
||||||
|
import io.flutter.plugin.common.MethodCall
|
||||||
|
import io.flutter.plugin.common.MethodChannel
|
||||||
|
import java.lang.ref.WeakReference
|
||||||
|
|
||||||
|
class WhatsAppOtpPlatformBridge(
|
||||||
|
private var flutterEngine: FlutterEngine,
|
||||||
|
private var mainActivity: MainActivity
|
||||||
|
) {
|
||||||
|
|
||||||
|
|
||||||
|
private lateinit var channel: MethodChannel
|
||||||
|
|
||||||
|
companion object {
|
||||||
|
private const val CHANNEL = "whats_app_otp"
|
||||||
|
var result: MethodChannel.Result? = null
|
||||||
|
}
|
||||||
|
|
||||||
|
fun invoke() {
|
||||||
|
channel = MethodChannel(flutterEngine.dartExecutor.binaryMessenger, CHANNEL)
|
||||||
|
channel.setMethodCallHandler { call: MethodCall, result: MethodChannel.Result ->
|
||||||
|
when (call.method) {
|
||||||
|
"isWhatsAppInstalled" -> {
|
||||||
|
val isAppInstalled =
|
||||||
|
WhatsApp.isWhatsAppInstalled(WeakReference(mainActivity))
|
||||||
|
result.success(isAppInstalled)
|
||||||
|
}
|
||||||
|
|
||||||
|
"performHandShake" -> {
|
||||||
|
WhatsApp.performHandShake(WeakReference(mainActivity))
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
"startListening" -> {
|
||||||
|
WhatsAppOtpPlatformBridge.result = result
|
||||||
|
}
|
||||||
|
|
||||||
|
else -> {
|
||||||
|
result.notImplemented()
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,19 @@
|
|||||||
|
/// Represents the pixel format of a `Frame`.
|
||||||
|
/// * `v420`: 420 YpCbCr 8 Bi-Planar Video Range
|
||||||
|
/// * `f420`: 420 YpCbCr 8 Bi-Planar Full Range
|
||||||
|
/// * `x420`: 420 YpCbCr 10 Bi-Planar Video Range
|
||||||
|
enum PixelFormat { f420, v420, x420 }
|
||||||
|
|
||||||
|
PixelFormat pixelFormatFromString(String string) {
|
||||||
|
switch (string) {
|
||||||
|
case '420f':
|
||||||
|
return PixelFormat.f420;
|
||||||
|
case '420v':
|
||||||
|
return PixelFormat.v420;
|
||||||
|
case 'x420':
|
||||||
|
return PixelFormat.x420;
|
||||||
|
default:
|
||||||
|
// ignore: fixme
|
||||||
|
return PixelFormat.f420;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,138 @@
|
|||||||
|
/// The vital signs result of a scan.
|
||||||
|
class VitalSign {
|
||||||
|
final double heartRate;
|
||||||
|
final double spo2;
|
||||||
|
final double ibi;
|
||||||
|
final double? stress;
|
||||||
|
final double? stressScore;
|
||||||
|
final double? respiratoryRate;
|
||||||
|
final double? hrvSdnn;
|
||||||
|
final double? hrvRmssd;
|
||||||
|
final double? temperature;
|
||||||
|
final String? bloodPressure;
|
||||||
|
final double? bloodPressureSystolic;
|
||||||
|
final double? bloodPressureDiastolic;
|
||||||
|
final double? facialSkinAge;
|
||||||
|
final double? bloodAlcohol;
|
||||||
|
final double? bloodSugar;
|
||||||
|
final String? version;
|
||||||
|
|
||||||
|
const VitalSign(
|
||||||
|
this.heartRate,
|
||||||
|
this.spo2,
|
||||||
|
this.ibi,
|
||||||
|
this.stress,
|
||||||
|
this.stressScore,
|
||||||
|
this.respiratoryRate,
|
||||||
|
this.hrvSdnn,
|
||||||
|
this.hrvRmssd,
|
||||||
|
this.temperature,
|
||||||
|
this.bloodPressure,
|
||||||
|
this.bloodPressureSystolic,
|
||||||
|
this.bloodPressureDiastolic,
|
||||||
|
this.facialSkinAge,
|
||||||
|
this.bloodAlcohol,
|
||||||
|
this.bloodSugar,
|
||||||
|
this.version);
|
||||||
|
|
||||||
|
factory VitalSign.fromMap(Map map) {
|
||||||
|
return VitalSign(
|
||||||
|
map['heartRate'],
|
||||||
|
map['spo2'],
|
||||||
|
map['ibi'],
|
||||||
|
map['stress'],
|
||||||
|
map['stressScore'],
|
||||||
|
map['respiratoryRate'],
|
||||||
|
map['hrvSdnn'],
|
||||||
|
map['hrvRmssd'],
|
||||||
|
map['temperature'],
|
||||||
|
map['bloodPressure'],
|
||||||
|
map['bloodPressureSystolic'],
|
||||||
|
map['bloodPressureDiastolic'],
|
||||||
|
map['facialSkinAge'],
|
||||||
|
map['bloodAlcohol'],
|
||||||
|
map['bloodSugar'],
|
||||||
|
map['version']);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// The cardiovascular risks result of a scan.
|
||||||
|
class CardiovascularRisks {
|
||||||
|
final double generalRisk;
|
||||||
|
final double coronaryHeartDisease;
|
||||||
|
final double congestiveHeartFailure;
|
||||||
|
final double intermittentClaudication;
|
||||||
|
final double stroke;
|
||||||
|
|
||||||
|
const CardiovascularRisks(this.generalRisk, this.coronaryHeartDisease,
|
||||||
|
this.congestiveHeartFailure, this.intermittentClaudication, this.stroke);
|
||||||
|
|
||||||
|
factory CardiovascularRisks.fromMap(Map map) {
|
||||||
|
return CardiovascularRisks(
|
||||||
|
map['generalRisk'],
|
||||||
|
map['coronaryHeartDisease'],
|
||||||
|
map['congestiveHeartFailure'],
|
||||||
|
map['intermittentClaudication'],
|
||||||
|
map['stroke']);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// The covid risk result of a scan.
|
||||||
|
class CovidRisk {
|
||||||
|
final double covidRisk;
|
||||||
|
|
||||||
|
const CovidRisk(this.covidRisk);
|
||||||
|
|
||||||
|
factory CovidRisk.fromMap(Map map) {
|
||||||
|
return CovidRisk(map['covidRisk']);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// The health risks result of a scan.
|
||||||
|
class HealthRisks {
|
||||||
|
final CardiovascularRisks? cardiovascularRisks;
|
||||||
|
final CovidRisk? covidRisk;
|
||||||
|
final String version;
|
||||||
|
|
||||||
|
const HealthRisks(this.cardiovascularRisks, this.covidRisk, this.version);
|
||||||
|
|
||||||
|
factory HealthRisks.fromMap(Map map) {
|
||||||
|
return HealthRisks(
|
||||||
|
map['cardiovascularRisks'] != null
|
||||||
|
? CardiovascularRisks.fromMap(map['cardiovascularRisks'])
|
||||||
|
: null,
|
||||||
|
map['covidRisk'] != null ? CovidRisk.fromMap(map['covidRisk']) : null,
|
||||||
|
map['version']);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// The holistic analysis result of a scan.
|
||||||
|
class HolisticAnalysis {
|
||||||
|
final double? generalWellness;
|
||||||
|
final double? bmi;
|
||||||
|
final double? absi;
|
||||||
|
final double? cardiacWorkload;
|
||||||
|
final double? pulseRespiratoryQuotient;
|
||||||
|
final double? waistToHeightRatio;
|
||||||
|
final String? version;
|
||||||
|
|
||||||
|
const HolisticAnalysis(
|
||||||
|
this.generalWellness,
|
||||||
|
this.bmi,
|
||||||
|
this.absi,
|
||||||
|
this.cardiacWorkload,
|
||||||
|
this.pulseRespiratoryQuotient,
|
||||||
|
this.waistToHeightRatio,
|
||||||
|
this.version);
|
||||||
|
|
||||||
|
factory HolisticAnalysis.fromMap(Map map) {
|
||||||
|
return HolisticAnalysis(
|
||||||
|
map['generalWellness'],
|
||||||
|
map['bmi'],
|
||||||
|
map['absi'],
|
||||||
|
map['cardiacWorkload'],
|
||||||
|
map['pulseRespiratoryQuotient'],
|
||||||
|
map['waistToHeightRatio'],
|
||||||
|
map['version']);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,42 @@
|
|||||||
|
import 'package:plugin_platform_interface/plugin_platform_interface.dart';
|
||||||
|
import 'camera_permission.dart';
|
||||||
|
|
||||||
|
import 'camera_device.dart';
|
||||||
|
import 'vital_sign_camera_method_channel.dart';
|
||||||
|
|
||||||
|
abstract class VitalSignCameraPlatform extends PlatformInterface {
|
||||||
|
/// Constructs a VitalSignCameraPlatform.
|
||||||
|
VitalSignCameraPlatform() : super(token: _token);
|
||||||
|
|
||||||
|
static final Object _token = Object();
|
||||||
|
|
||||||
|
static VitalSignCameraPlatform _instance = MethodChannelVitalSignCamera();
|
||||||
|
|
||||||
|
/// The default instance of [VitalSignCameraPlatform] to use.
|
||||||
|
///
|
||||||
|
/// Defaults to [MethodChannelVitalSignCamera].
|
||||||
|
static VitalSignCameraPlatform get instance => _instance;
|
||||||
|
|
||||||
|
/// Platform-specific implementations should set this with their own
|
||||||
|
/// platform-specific class that extends [VitalSignCameraPlatform] when
|
||||||
|
/// they register themselves.
|
||||||
|
static set instance(VitalSignCameraPlatform instance) {
|
||||||
|
PlatformInterface.verifyToken(instance, _token);
|
||||||
|
_instance = instance;
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<List<CameraDevice>> availableCameraDevices() {
|
||||||
|
throw UnimplementedError(
|
||||||
|
'availableCameraDevices() has not been implemented.');
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<CameraPermissionStatus> requestCameraPermission() {
|
||||||
|
throw UnimplementedError(
|
||||||
|
'availableCameraDevices() has not been implemented.');
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<CameraPermissionStatus> getCameraPermissionStatus() {
|
||||||
|
throw UnimplementedError(
|
||||||
|
'getCameraPermissionStatus() has not been implemented.');
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue