no message

geofencing_wifi
Zohaib Kambrani 5 years ago
parent c2be303418
commit 27182ee8db

@ -78,16 +78,15 @@ dependencies {
implementation 'com.google.guava:guava:27.0.1-android'
// Dependency on local binaries
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
// Dependency on a remote binary
// implementation 'com.example.android:app-magic:12.3'
// Native Dependency
implementation "org.jetbrains.anko:anko-commons:0.10.4"
implementation 'com.github.kittinunf.fuel:fuel:2.3.0' //for JVM
implementation 'com.github.kittinunf.fuel:fuel-android:2.3.0' //for Android
implementation 'com.wang.avi:library:2.1.3'
// Dependency on a remote binary
// implementation 'com.example.android:app-magic:12.3'
}

@ -1,13 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.cloud.diplomaticquarterapp">
<!--
io.flutter.app.FlutterApplication is an android.app.Application that
<!-- io.flutter.app.FlutterApplication is an android.app.Application that
calls FlutterMain.startInitialization(this); in its onCreate method.
In most cases you can leave this as-is, but you if you want to provide
additional functionality it is fine to subclass or reimplement
FlutterApplication and put your custom class here.
-->
FlutterApplication and put your custom class here. -->
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.INTERNET" />
@ -20,72 +17,38 @@
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_CALENDAR" />
<uses-permission android:name="android.permission.WRITE_CALENDAR" />
<uses-feature android:name="android.hardware.location.network" android:required="false" />
<uses-feature android:name="android.hardware.location.gps" android:required="false" />
<uses-feature
android:name="android.hardware.location.network"
android:required="false" />
<uses-feature
android:name="android.hardware.location.gps"
android:required="false" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.USE_FINGERPRINT" />
<uses-permission android:name="android.permission.READ_CALENDAR" />
<uses-permission android:name="android.permission.WRITE_CALENDAR" />
<!-- Wifi Permissions-->
<!-- Wifi Permissions-->
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE"/>
<application
android:name="io.flutter.app.FlutterApplication"
android:icon="@mipmap/ic_launcher"
android:label="diplomaticquarterapp"
android:usesCleartextTraffic="true">
<!-- <activity android:name=".FlutterMainActivity"-->
<!-- android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"-->
<!-- android:hardwareAccelerated="true"-->
<!-- android:launchMode="singleTop"-->
<!-- android:theme="@style/Theme.AppCompat.NoActionBar"-->
<!-- android:windowSoftInputMode="adjustResize">-->
<!-- <intent-filter>-->
<!-- <action android:name="android.intent.action.MAIN" />-->
<!-- <category android:name="android.intent.category.LAUNCHER" />-->
<!-- </intent-filter>-->
<!-- </activity>-->
android:usesCleartextTraffic="true"
android:label="diplomaticquarterapp">
<activity
android:name=".FlutterMainActivity"
android:name=".MainActivity"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:hardwareAccelerated="true"
android:launchMode="singleTop"
android:theme="@style/Theme.AppCompat.NoActionBar"
android:theme="@style/LaunchTheme"
android:windowSoftInputMode="adjustResize">
<!--
Specifies an Android theme to apply to this Activity as soon as
<!-- Specifies an Android theme to apply to this Activity as soon as
the Android process has started. This theme is visible to the user
while the Flutter UI initializes. After that, this theme continues
to determine the Window background behind the Flutter UI.
-->
to determine the Window background behind the Flutter UI. -->
<meta-data
android:name="io.flutter.embedding.android.NormalTheme"
android:resource="@style/NormalTheme" />
<!--
Displays an Android View that continues showing the launch screen
<!-- Displays an Android View that continues showing the launch screen
Drawable until Flutter paints its first frame, then this splash
screen fades out. A splash screen is useful to avoid any visual
gap between the end of Android's launch screen and the painting of
Flutter's first frame.
-->
Flutter's first frame. -->
<meta-data
android:name="io.flutter.embedding.android.SplashScreenDrawable"
android:resource="@drawable/launch_background" />
@ -94,20 +57,18 @@
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
<action android:name="FLUTTER_NOTIFICATION_CLICK" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<!--
Don't delete the meta-data below.
This is used by the Flutter tool to generate GeneratedPluginRegistrant.java
-->
<!-- Don't delete the meta-data below.
This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
<receiver android:name="com.dexterous.flutterlocalnotifications.ScheduledNotificationBootReceiver">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
<action android:name="android.intent.action.MY_PACKAGE_REPLACED" />
<action android:name="android.intent.action.BOOT_COMPLETED"/>
<action android:name="android.intent.action.MY_PACKAGE_REPLACED"/>
</intent-filter>
</receiver>
<receiver android:name="com.dexterous.flutterlocalnotifications.ScheduledNotificationReceiver" />
@ -115,9 +76,14 @@
<meta-data
android:name="flutterEmbedding"
android:value="2" />
<meta-data
android:name="com.google.android.geo.API_KEY"
android:value="AIzaSyCmevVlr2Bh-c8W1VUzo8gt8JRY7n5PANw" />
<meta-data android:name="com.google.android.geo.API_KEY"
android:value="AIzaSyCmevVlr2Bh-c8W1VUzo8gt8JRY7n5PANw"/>
</application>
</manifest>
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.USE_FINGERPRINT" />
<uses-permission android:name="android.permission.READ_CALENDAR" />
<uses-permission android:name="android.permission.WRITE_CALENDAR" />
</manifest>

@ -1,51 +0,0 @@
package com.cloud.diplomaticquarterapp
import android.content.Intent
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.widget.RelativeLayout
import android.widget.TextView
import com.cloud.diplomaticquarterapp.utils.PlatformBridge
import com.wang.avi.AVLoadingIndicatorView
import io.flutter.embedding.android.FlutterView
import io.flutter.embedding.engine.FlutterEngine
import io.flutter.embedding.engine.dart.DartExecutor
import io.flutter.plugin.common.MethodChannel
import io.flutter.view.FlutterMain
import org.jetbrains.anko.find
import java.util.ArrayList
open class BaseActivity : AppCompatActivity() {
lateinit var loadingView:RelativeLayout
lateinit var lblLoadingView:TextView
lateinit var avLoadingView:AVLoadingIndicatorView
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
}
override fun setContentView(layoutResID: Int) {
super.setContentView(layoutResID)
loadingView = find(R.id.loadingView)
lblLoadingView = find(R.id.lblLoadingView)
avLoadingView = find(R.id.avLoadingView)
}
override fun onResume() {
super.onResume()
}
override fun onPause() {
super.onPause()
}
override fun onStop() {
super.onStop()
}
override fun onDestroy() {
super.onDestroy()
}
}

@ -1,93 +0,0 @@
package com.cloud.diplomaticquarterapp
import android.content.Intent
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import com.cloud.diplomaticquarterapp.utils.PlatformBridge
import io.flutter.embedding.android.FlutterView
import io.flutter.embedding.engine.FlutterEngine
import io.flutter.embedding.engine.dart.DartExecutor
import io.flutter.plugin.common.MethodChannel
import io.flutter.view.FlutterMain
import java.util.ArrayList
class FlutterMainActivity : BaseActivity() {
private var flutterView: FlutterView? = null
companion object {
private var flutterEngine: FlutterEngine? = null
private lateinit var instance:FlutterMainActivity
fun getInstance() : FlutterMainActivity{
return instance
}
}
// to get and check returned intent
private fun getArgsFromIntent(intent: Intent): Array<String>? {
// Before adding more entries to this list, consider that arbitrary
// Android applications can generate intents with extra data and that
// there are many security-sensitive args in the binary.
val args = ArrayList<String>()
if (intent.getBooleanExtra("trace-startup", false)) {
args.add("--trace-startup")
}
if (intent.getBooleanExtra("start-paused", false)) {
args.add("--start-paused")
}
if (intent.getBooleanExtra("enable-dart-profiling", false)) {
args.add("--enable-dart-profiling")
}
if (!args.isEmpty()) {
return args.toTypedArray()
}
return null
}
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
val args = getArgsFromIntent(intent)
// check if flutterEngine is null
if (flutterEngine == null) {
println(args)
flutterEngine = FlutterEngine(this, args)
flutterEngine!!.dartExecutor.executeDartEntrypoint(
// set which of dart methode will be used here
DartExecutor.DartEntrypoint(FlutterMain.findAppBundlePath(), "main")
)
}
setContentView(R.layout.activity_flutter_main)
flutterView = findViewById(R.id.flutterView)
flutterView!!.attachToFlutterEngine(flutterEngine!!)
PlatformBridge(flutterEngine!!.dartExecutor.binaryMessenger, this).create()
}
override fun onResume() {
super.onResume()
flutterEngine!!.lifecycleChannel.appIsResumed()
instance = this
}
override fun onPause() {
super.onPause()
flutterEngine!!.lifecycleChannel.appIsInactive()
}
override fun onStop() {
super.onStop()
flutterEngine!!.lifecycleChannel.appIsPaused()
}
override fun onDestroy() {
flutterView!!.detachFromFlutterEngine()
super.onDestroy()
}
}

@ -1,21 +1,23 @@
package com.cloud.diplomaticquarterapp
import android.os.Bundle
import android.os.PersistableBundle
import android.util.Log
import androidx.annotation.NonNull;
import io.flutter.embedding.android.FlutterFragmentActivity
import com.cloud.diplomaticquarterapp.utils.FlutterText
import com.cloud.diplomaticquarterapp.utils.PlatformBridge
import io.flutter.embedding.android.FlutterFragmentActivity
import io.flutter.embedding.engine.FlutterEngine
import io.flutter.plugins.GeneratedPluginRegistrant
import io.flutter.plugin.common.MethodChannel
import io.flutter.plugin.common.MethodCall
import io.flutter.plugins.GeneratedPluginRegistrant
class MainActivity: FlutterFragmentActivity() {
override fun configureFlutterEngine(@NonNull flutterEngine: FlutterEngine) {
GeneratedPluginRegistrant.registerWith(flutterEngine);
// Create Flutter Platform Bridge
PlatformBridge(flutterEngine.dartExecutor.binaryMessenger, this).create()
}
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
override fun onResume() {
super.onResume()
}
override fun configureFlutterEngine(@NonNull flutterEngine: FlutterEngine) {
GeneratedPluginRegistrant.registerWith(flutterEngine);
}
}

@ -0,0 +1,177 @@
package com.cloud.diplomaticquarterapp.hmgwifi
import android.content.Context
import android.net.ConnectivityManager
import android.net.wifi.WifiConfiguration
import android.net.wifi.WifiInfo
import android.net.wifi.WifiManager
import android.os.Build
import android.util.Log
import android.widget.Toast
import com.cloud.diplomaticquarterapp.MainActivity
import com.cloud.diplomaticquarterapp.utils.FlutterText
import com.cloud.diplomaticquarterapp.utils.HMGUtils
class HMG_Guest(context: MainActivity) {
private var wifiManager: WifiManager? = context.applicationContext.getSystemService(Context.WIFI_SERVICE) as WifiManager?
private var connectivityManager: ConnectivityManager? = context.applicationContext.getSystemService(Context.CONNECTIVITY_SERVICE) as ConnectivityManager?
private var context = context
private val TAG = "HMG_Guest"
private val TEST = false
private var SSID = """"HMG-MobileApp""""
private lateinit var completionListener: ((status: Boolean, message: String) -> Unit)
fun completionOnUiThread(status: Boolean, message: String){
context.runOnUiThread {
completionListener(status, message)
}
}
/*
* Helpful:
* http://stackoverflow.com/questions/8818290/how-to-connect-to-a-specific-wifi-network-in-android-programmatically
*/
fun connectToHMGGuestNetwork(completion: (status: Boolean, message: String) -> Unit) {
wifiManager?.let { wm ->
completionListener = completion
if (!wm.isWifiEnabled){
wm.isWifiEnabled = true
HMGUtils.popFlutterText(context,"enablingWifi");
HMGUtils.timer(2000,false){
connect()
}
}else{
connect()
}
}
}
private fun connect(){
val security = "OPEN"
val networkPass = ""
Log.d(TAG, "Connecting to SSID \"$SSID\" with password \"$networkPass\" and with security \"$security\" ...")
// You need to create WifiConfiguration instance like this:
val conf = WifiConfiguration()
conf.SSID = SSID
conf.allowedKeyManagement.set(WifiConfiguration.KeyMgmt.NONE)
conf.networkId = ssidToNetworkId(SSID)
val wm = wifiManager!!
if (conf.networkId == -1) {
wm.addNetwork(conf)
} else {
Log.v(TAG, "WiFi found - updating it.\n")
wm.updateNetwork(conf)
}
conf.networkId = ssidToNetworkId(SSID)
Log.d(TAG, "Network ID: ${conf.networkId}")
val networkIdToConnect = conf.networkId
if (networkIdToConnect >= 0) {
Log.v(TAG, "Start connecting to $SSID Wifi...")
// We disable the network before connecting, because if this was the last connection before
// a disconnect(), this will not reconnect.
wm.disableNetwork(networkIdToConnect)
val result = wm.enableNetwork(networkIdToConnect, true)
if(result){
HMGUtils.timer(8000,false){
if(wm.getConnectionInfo().getSSID() == SSID){
FlutterText.with("successConnectingHmgNetwork"){ localized ->
completionOnUiThread(true, localized)
}
}else{
errorConnecting()
}
}
}else{
errorConnecting()
}
}else{
Log.v(TAG, "Cannot connect to $SSID network")
errorConnecting()
}
}
private fun errorConnecting(){
FlutterText.with("errorConnectingHmgNetwork"){ localized ->
completionOnUiThread(false, localized)
}
}
// If CompileSDK is greater and equals to APILevel 29
private fun connectNewer(wm:WifiManager){
// Log.e(TAG, "connection wifi Q")
//
// val wifiNetworkSpecifier: WifiNetworkSpecifier = WifiNetworkSpecifier.Builder()
// .setSsid(ssid)
// .setWpa2Passphrase(password)
// .build()
//
// val networkRequest: NetworkRequest = NetworkRequest.Builder()
// .addTransportType(NetworkCapabilities.TRANSPORT_WIFI)
// .setNetworkSpecifier(wifiNetworkSpecifier)
// .build()
//
// var connectivityManager = context.getSystemService(Context.CONNECTIVITY_SERVICE) as ConnectivityManager
// var networkCallback = object : ConnectivityManager.NetworkCallback() {
// override fun onAvailable(network: Network) {
// super.onAvailable(network)
// connectivityManager.bindProcessToNetwork(network)
// Log.e(TAG, "onAvailable")
// }
//
// override fun onLosing(network: Network, maxMsToLive: Int) {
// super.onLosing(network, maxMsToLive)
// Log.e(TAG, "onLosing")
// }
//
// override fun onLost(network: Network) {
// super.onLost(network)
// Log.e(TAG, "onLosing")
// Log.e(TAG, "losing active connection")
// }
//
// override fun onUnavailable() {
// super.onUnavailable()
// Log.e(TAG, "onUnavailable")
// }
// }
// connectivityManager.requestNetwork(networkRequest, networkCallback)
}
/**
* This method takes a given String, searches the current list of configured WiFi
* networks, and returns the networkId for the network if the SSID matches. If not,
* it returns -1.
*/
private fun ssidToNetworkId(ssid: String): Int {
val currentNetworks = wifiManager!!.configuredNetworks
var networkId = -1
// For each network in the list, compare the SSID with the given one
for (test in currentNetworks) {
if (test.SSID == ssid) {
networkId = test.networkId
break
}
}
return networkId
}
}

@ -1,21 +1,20 @@
package com.cloud.diplomaticquarterapp.hmgwifi
import android.annotation.SuppressLint
import android.util.Log
import com.cloud.diplomaticquarterapp.API
import com.cloud.diplomaticquarterapp.FlutterMainActivity
import com.github.kittinunf.fuel.Fuel
import com.cloud.diplomaticquarterapp.utils.API
import com.cloud.diplomaticquarterapp.MainActivity
import com.cloud.diplomaticquarterapp.utils.FlutterText
import com.github.kittinunf.fuel.core.extensions.jsonBody
import com.github.kittinunf.fuel.httpGet
import com.github.kittinunf.fuel.httpPost
import org.jetbrains.anko.doAsync
import org.json.JSONObject
import java.util.*
@SuppressLint("MissingPermission")
class HMG_Wifi(flutterMainActivity: FlutterMainActivity) {
class HMG_Internet(flutterMainActivity: MainActivity) {
private val TAG = "HMG_Wifi"
private val TEST = true
private val TEST = false
private var context = flutterMainActivity;
@ -35,7 +34,7 @@ class HMG_Wifi(flutterMainActivity: FlutterMainActivity) {
* Helpful:
* http://stackoverflow.com/questions/8818290/how-to-connect-to-a-specific-wifi-network-in-android-programmatically
*/
fun connectToHMGGuestNetwork(patientId: String, completion: (status: Boolean, message: String) -> Unit): HMG_Wifi {
fun connectToHMGGuestNetwork(patientId: String, completion: (status: Boolean, message: String) -> Unit): HMG_Internet {
completionListener = completion
getWifiCredentials(patientId) {
WPA(context,SSID).connect(USER_NAME,PASSWORD) { status, message ->
@ -50,19 +49,27 @@ class HMG_Wifi(flutterMainActivity: FlutterMainActivity) {
completion(true)
"https://captive.apple.com".httpGet().response { request, response, result ->
val have = response.statusCode == 200 && String(response.data).contains("<TITLE>Success</TITLE>", true)
completion(have)
result.fold(success = {
val html = String(it).toLowerCase(Locale.ENGLISH)
.replace(" ", "", true)
.replace("\n","",true)
val have = html.contains("<title>success</title>", true)
completion(have)
},failure = {
completion(false)
})
}
}
private fun getWifiCredentials(patientId:String, completion: (() -> Unit)){
// if (TEST){
// SSID = "GUEST-POC"
// USER_NAME = "0696"
// PASSWORD = "0000"
// completion()
// return
// }
private fun getWifiCredentials(patientId:String, success: (() -> Unit)){
if (TEST){
SSID = "GUEST-POC"
USER_NAME = "0696"
PASSWORD = "0000"
success()
return
}
val jsonBody = """{"PatientID":$patientId}"""
API.WIFI_CREDENTIALS.
@ -83,16 +90,20 @@ class HMG_Wifi(flutterMainActivity: FlutterMainActivity) {
if (object_.has("UserName") && object_.has("UserName")){
USER_NAME = object_.getString("UserName")
PASSWORD = object_.getString("Password")
completion()
success()
}else{
completionOnUiThread(false, "Failed to get your internet credentials")
FlutterText.with("somethingWentWrong"){localized ->
completionOnUiThread(false, localized)
}
}
}
}
}
},failure = { error ->
completionOnUiThread(false, error.localizedMessage )
FlutterText.with("somethingWentWrong"){localized ->
completionOnUiThread(false, error.localizedMessage )
}
})
}
}

@ -1,13 +1,17 @@
package com.cloud.diplomaticquarterapp.hmgwifi
import android.annotation.SuppressLint
import android.content.Context
import android.net.ConnectivityManager
import android.net.wifi.*
import android.net.wifi.SupplicantState.ASSOCIATED
import android.net.wifi.SupplicantState.COMPLETED
import android.util.Log
import com.cloud.diplomaticquarterapp.FlutterMainActivity
import com.cloud.diplomaticquarterapp.MainActivity
import com.cloud.diplomaticquarterapp.utils.FlutterText
import com.cloud.diplomaticquarterapp.utils.HMGUtils
class WPA(mainActivity: FlutterMainActivity, SSID:String) {
class WPA(mainActivity: MainActivity, SSID:String) {
private var TAG = "WPA"
private var SSID = "GUEST-POC"
private var wifiManager_: WifiManager? = null
@ -20,7 +24,9 @@ class WPA(mainActivity: FlutterMainActivity, SSID:String) {
fun connect(identity:String, password:String, completion: (status: Boolean, message: String) -> Unit) {
if(wifiManager_ == null || connectivityManager_ == null){
completion(false, "Failed to access system connectivity services")
FlutterText.with("errorConnectingHmgNetwork"){ localized ->
completion(false,localized)
}
return
}
@ -65,15 +71,24 @@ class WPA(mainActivity: FlutterMainActivity, SSID:String) {
HMGUtils.timer(5000,false){
supState = wifiInfo.supplicantState
Log.i(TAG, "WifiWizard: Done connect to network : status = $supState")
if (supState == SupplicantState.COMPLETED)
completion(true,"Connected to Wifi")
val successStates = listOf(COMPLETED, ASSOCIATED)
if (successStates.contains(COMPLETED /*supState*/))
FlutterText.with("Connected to internet Wifi"){ localized ->
completion(true,localized)
}
else
completion(false,"Failed to connect with HMG network")
FlutterText.with("errorConnectingHmgNetwork"){ localized ->
completion(false,localized)
}
}
} else {
Log.v(TAG, "WifiWizard: cannot connect to network")
completion(false,"Failed to connect to Wifi")
FlutterText.with("errorConnectingHmgNetwork"){ localized ->
completion(false,localized)
}
}
}
@ -82,6 +97,7 @@ class WPA(mainActivity: FlutterMainActivity, SSID:String) {
* networks, and returns the networkId for the network if the SSID matches. If not,
* it returns -1.
*/
@SuppressLint("MissingPermission")
private fun ssidToNetworkId(ssid: String): Int {
val currentNetworks = wifiManager_!!.configuredNetworks
var networkId = -1

@ -1,9 +1,10 @@
package com.cloud.diplomaticquarterapp
package com.cloud.diplomaticquarterapp.utils
class API {
companion object{
private val BASE = "https://uat.hmgwebservices.com"
private val SERVICE = "Services/Patients.svc/REST"
val WIFI_CREDENTIALS = "$BASE/$SERVICE/Hmg_SMS_Get_By_ProjectID_And_PatientID"
}
}

@ -0,0 +1,36 @@
package com.cloud.diplomaticquarterapp.utils
import io.flutter.plugin.common.MethodChannel
import io.flutter.plugin.common.MethodChannel.Result
class FlutterText{
companion object{
fun with(key:String, completion:(String)->Unit){
HMGUtils.getPlatformChannel().invokeMethod("localizedValue",key, object:MethodChannel.Result{
override fun success(result: Any?) {
val localized = result as String?
if (localized != null){
completion(localized)
}else{
completion(key)
}
}
override fun error(errorCode: String?, errorMessage: String?, errorDetails: Any?) {
completion(key)
require(false){
"'localizedValue' $errorMessage"
}
}
override fun notImplemented() {
require(false){
"'localizedValue' method not implemented at flutter"
}
}
})
}
}
}

@ -1,15 +1,23 @@
package com.cloud.diplomaticquarterapp.utils
import android.opengl.Visibility
import android.view.View
import android.widget.Toast
import com.cloud.diplomaticquarterapp.BaseActivity
import com.cloud.diplomaticquarterapp.MainActivity
import io.flutter.plugin.common.MethodChannel
import java.util.*
import kotlin.concurrent.timerTask
class HMGUtils {
companion object{
private lateinit var platformChannel: MethodChannel
fun getPlatformChannel():MethodChannel{
return platformChannel
}
fun setPlatformChannel(channel:MethodChannel){
platformChannel = channel
}
fun timer(delay:Long, repeat:Boolean, tick:(Timer)->Unit) : Timer{
val timer = Timer()
if(repeat)
@ -24,22 +32,14 @@ class HMGUtils {
return timer
}
fun showLoading(context: BaseActivity, show:Boolean = true, message:String = "Please wait"){
if(show){
context.loadingView.visibility = View.VISIBLE
context.avLoadingView.smoothToShow()
context.lblLoadingView.text = message
}else{
context.loadingView.visibility = View.GONE
context.avLoadingView.smoothToHide()
context.lblLoadingView.text = ""
}
fun popMessage(context:MainActivity, message:String){
Toast.makeText(context,message,Toast.LENGTH_LONG).show()
}
fun showMessage(context:BaseActivity, title:String = "", message:String){
Toast.makeText(context,message,Toast.LENGTH_LONG).show()
fun popFlutterText(context:MainActivity, key:String){
FlutterText.with(key){
Toast.makeText(context,it,Toast.LENGTH_LONG).show()
}
}
}

@ -1,256 +1,256 @@
package com.cloud.diplomaticquarterapp.utils
import android.annotation.SuppressLint
import android.content.Context
import android.net.ConnectivityManager
import android.net.Network
import android.net.NetworkCapabilities
import android.net.NetworkRequest
import android.net.wifi.ScanResult
import android.net.wifi.WifiConfiguration
import android.net.wifi.WifiManager
import android.util.Log
import com.cloud.diplomaticquarterapp.API
import com.cloud.diplomaticquarterapp.FlutterMainActivity
import com.github.kittinunf.fuel.core.extensions.jsonBody
import com.github.kittinunf.fuel.httpGet
import com.github.kittinunf.fuel.httpPost
import org.json.JSONObject
import java.util.*
@SuppressLint("MissingPermission")
class HMG_Wifi_(flutterMainActivity: FlutterMainActivity) {
val TAG = "WIFI"
val TEST = true
var context = flutterMainActivity;
var completionListener: ((status: Boolean, message: String) -> Unit)? = null
private var SSID = "HMG-GUEST"
private var USER_NAME = ""
private var PASSWORD = ""
var NETWORK_ID = -1 // HMG-GUEST Assigned Network ID by Android
private lateinit var PATIENT_ID:String
/*
* Helpful:
* http://stackoverflow.com/questions/5452940/how-can-i-get-android-wifi-scan-results-into-a-list
*/
fun triggerWifiScan(context: Context) {
val wifi = context.getSystemService(Context.WIFI_SERVICE) as WifiManager
wifi.startScan()
}
/*
* Helpful:
* http://stackoverflow.com/questions/8818290/how-to-connect-to-a-specific-wifi-network-in-android-programmatically
*/
fun connectToWifiNetworkWith(patientId: String): HMG_Wifi_ {
val connectivityManager = context.applicationContext.getSystemService(Context.CONNECTIVITY_SERVICE) as ConnectivityManager
PATIENT_ID = patientId
val security = "OPEN"
val networkPass = ""
Log.d(TAG, "Connecting to SSID \"$SSID\" with password \"$networkPass\" and with security \"$security\" ...")
// You need to create WifiConfiguration instance like this:
val conf = WifiConfiguration()
conf.SSID = "\"" + SSID + "\""
if (security == "OPEN") {
conf.allowedKeyManagement.set(WifiConfiguration.KeyMgmt.NONE)
} else if (security == "WEP") {
conf.wepKeys[0] = "\"" + networkPass + "\""
conf.wepTxKeyIndex = 0
conf.allowedKeyManagement.set(WifiConfiguration.KeyMgmt.NONE)
conf.allowedGroupCiphers.set(WifiConfiguration.GroupCipher.WEP40)
} else {
conf.preSharedKey = "\"" + networkPass + "\""
}
// Then, you need to add it to Android wifi manager settings:
val wifiManager = context.applicationContext.getSystemService(Context.WIFI_SERVICE) as WifiManager
NETWORK_ID = wifiManager.addNetwork(conf)
Log.d(TAG, "Network ID: $NETWORK_ID")
//wifiManager.disconnect();
val result = wifiManager.enableNetwork(NETWORK_ID, true)
//wifiManager.reconnect();
wifiManager.saveConfiguration()
if(result == true){
authNetworkConnection(NETWORK_ID);
}else{
completionListener?.let { it(false, "Error connecting to HMG network") }
}
return this
}
private var authTimer:Timer? = null
fun authNetworkConnection(networkId: Int){
authTimer = Timer()
authTimer?.scheduleAtFixedRate(object : TimerTask() {
override fun run() {
if (connectedNetworkId() == networkId && connectedNetworkIPAddress() > 0) {
authServerCall()
authTimer?.cancel()
}
}
}, 2000, 1000)
// If wifi not connected in 5 sec terminate with fail status
Timer().schedule(object : TimerTask() {
override fun run() {
if (null != authTimer) {
authTimer?.cancel()
completionListener?.let { it(false, "Error connecting to HMG network") }
}
}
}, 5000)
}
fun authServerCall(){
fun call(){
forceNetworkCallOverWifi()
val params = listOf("cmd" to "authenticate", "password" to PASSWORD, "user" to USER_NAME)
val serverUrl = "https://captiveportal-login.hmg.com/cgi-bin/login"
// val serverUrl = "http://192.168.102.223/cgi-bin/login"
serverUrl
.httpPost(params)
.timeout(10000)
.response { request, response, result ->
Log.v(TAG, response.statusCode.toString())
haveInternet { have ->
if(have){
Log.v(TAG, "Connected to internet via $SSID network at HMG")
completionListener?.let { it(true, "Successfully connected to the internet") }
}else{
Log.e(TAG, "failed to connect to internet via $SSID network at HMG")
completionListener?.let { it(false, "Authentication failed or you are already using your credentials on another device") }
}
}
}
}
haveInternet { has ->
if (has){
getAuthCredentials {
call()
}
}else{
completionListener?.let { it(false, "You must have active internet connection to connect with HMG Network") }
}
}
}
fun haveInternet(completion: ((status: Boolean) -> Unit)){
if (TEST)
completion(true)
"https://captive.apple.com".httpGet().response { request, response, result ->
val have = response.statusCode == 200 && String(response.data).contains("<TITLE>Success</TITLE>", true)
completion(have)
}
}
fun getAuthCredentials(completion: (() -> Unit)){
if (TEST){
USER_NAME = "2300"
PASSWORD = "1820"
completion()
return
}
val jsonBody = """{"PatientID":$PATIENT_ID}"""
API.WIFI_CREDENTIALS
.httpPost()
.jsonBody(jsonBody, Charsets.UTF_8)
.response { request, response, result ->
val jsonString = String(response.data)
Log.d(TAG, "JSON $jsonString")
if (response.statusCode == 200){
val jsonObject = JSONObject(jsonString)
if(!jsonObject.getString("ErrorMessage").equals("null")){
val errorMsg = jsonObject.getString("ErrorMessage")
completionListener?.let { it(false, errorMsg) }
}else{
jsonObject.getJSONArray("Hmg_SMS_Get_By_ProjectID_And_PatientIDList").let { array ->
array.getJSONObject(0).let { object_ ->
if (object_.has("UserName") && object_.has("UserName")){
USER_NAME = object_.getString("UserName")
PASSWORD = object_.getString("Password")
completion()
}else{
completionListener?.let { it(false, "Failed to get your internet credentials") }
}
}
}
}
}else{
completionListener?.let { it(false, "Failed to get your internet credentials") }
}
}
}
fun forceNetworkCallOverWifi(){
val connectivityManager = context.applicationContext.getSystemService(Context.CONNECTIVITY_SERVICE) as ConnectivityManager
// val network = Network
// connectivityManager.activeNetwork
// Exit app if Network disappears.
// Exit app if Network disappears.
// val networkCapabilities: NetworkCapabilities = ConnectivityManager.from(context).getNetworkCapabilities(network)
// val networkCapabilities: NetworkCapabilities = connectivityManager.getNetworkCapabilities(network)
// if (networkCapabilities == null) {
//package com.cloud.diplomaticquarterapp.utils
//
//import android.annotation.SuppressLint
//import android.content.Context
//import android.net.ConnectivityManager
//import android.net.Network
//import android.net.NetworkCapabilities
//import android.net.NetworkRequest
//import android.net.wifi.ScanResult
//import android.net.wifi.WifiConfiguration
//import android.net.wifi.WifiManager
//import android.util.Log
//import com.cloud.diplomaticquarterapp.utils.API
//import com.cloud.diplomaticquarterapp.FlutterMainActivity
//import com.github.kittinunf.fuel.core.extensions.jsonBody
//import com.github.kittinunf.fuel.httpGet
//import com.github.kittinunf.fuel.httpPost
//import org.json.JSONObject
//import java.util.*
//
//
//@SuppressLint("MissingPermission")
//class HMG_Wifi_(flutterMainActivity: FlutterMainActivity) {
// val TAG = "WIFI"
// val TEST = true
//
// var context = flutterMainActivity;
// var completionListener: ((status: Boolean, message: String) -> Unit)? = null
//
//
// private var SSID = "HMG-GUEST"
// private var USER_NAME = ""
// private var PASSWORD = ""
// var NETWORK_ID = -1 // HMG-GUEST Assigned Network ID by Android
// private lateinit var PATIENT_ID:String
// /*
// * Helpful:
// * http://stackoverflow.com/questions/5452940/how-can-i-get-android-wifi-scan-results-into-a-list
// */
// fun triggerWifiScan(context: Context) {
// val wifi = context.getSystemService(Context.WIFI_SERVICE) as WifiManager
// wifi.startScan()
// }
//
// /*
// * Helpful:
// * http://stackoverflow.com/questions/8818290/how-to-connect-to-a-specific-wifi-network-in-android-programmatically
// */
// fun connectToWifiNetworkWith(patientId: String): HMG_Wifi_ {
//
// val connectivityManager = context.applicationContext.getSystemService(Context.CONNECTIVITY_SERVICE) as ConnectivityManager
//
// PATIENT_ID = patientId
//
// val security = "OPEN"
// val networkPass = ""
// Log.d(TAG, "Connecting to SSID \"$SSID\" with password \"$networkPass\" and with security \"$security\" ...")
//
// // You need to create WifiConfiguration instance like this:
// val conf = WifiConfiguration()
// conf.SSID = "\"" + SSID + "\""
//
// if (security == "OPEN") {
// conf.allowedKeyManagement.set(WifiConfiguration.KeyMgmt.NONE)
// } else if (security == "WEP") {
// conf.wepKeys[0] = "\"" + networkPass + "\""
// conf.wepTxKeyIndex = 0
// conf.allowedKeyManagement.set(WifiConfiguration.KeyMgmt.NONE)
// conf.allowedGroupCiphers.set(WifiConfiguration.GroupCipher.WEP40)
// } else {
// conf.preSharedKey = "\"" + networkPass + "\""
// }
//
// // Then, you need to add it to Android wifi manager settings:
// val wifiManager = context.applicationContext.getSystemService(Context.WIFI_SERVICE) as WifiManager
//
// NETWORK_ID = wifiManager.addNetwork(conf)
// Log.d(TAG, "Network ID: $NETWORK_ID")
//
// //wifiManager.disconnect();
// val result = wifiManager.enableNetwork(NETWORK_ID, true)
// //wifiManager.reconnect();
// wifiManager.saveConfiguration()
//
// if(result == true){
// authNetworkConnection(NETWORK_ID);
// }else{
// completionListener?.let { it(false, "Error connecting to HMG network") }
// }
// return this
// }
//
// private var authTimer:Timer? = null
// fun authNetworkConnection(networkId: Int){
// authTimer = Timer()
// authTimer?.scheduleAtFixedRate(object : TimerTask() {
// override fun run() {
// if (connectedNetworkId() == networkId && connectedNetworkIPAddress() > 0) {
// authServerCall()
// authTimer?.cancel()
// }
// }
//
// }, 2000, 1000)
//
// // If wifi not connected in 5 sec terminate with fail status
// Timer().schedule(object : TimerTask() {
// override fun run() {
// if (null != authTimer) {
// authTimer?.cancel()
// completionListener?.let { it(false, "Error connecting to HMG network") }
// }
// }
// }, 5000)
//
// }
//
// fun authServerCall(){
//
// fun call(){
//
// forceNetworkCallOverWifi()
//
// val params = listOf("cmd" to "authenticate", "password" to PASSWORD, "user" to USER_NAME)
// val serverUrl = "https://captiveportal-login.hmg.com/cgi-bin/login"
//// val serverUrl = "http://192.168.102.223/cgi-bin/login"
// serverUrl
// .httpPost(params)
// .timeout(10000)
// .response { request, response, result ->
// Log.v(TAG, response.statusCode.toString())
//
// haveInternet { have ->
// if(have){
// Log.v(TAG, "Connected to internet via $SSID network at HMG")
// completionListener?.let { it(true, "Successfully connected to the internet") }
// }else{
// Log.e(TAG, "failed to connect to internet via $SSID network at HMG")
// completionListener?.let { it(false, "Authentication failed or you are already using your credentials on another device") }
// }
// }
// }
// }
//
// haveInternet { has ->
// if (has){
// getAuthCredentials {
// call()
// }
// }else{
// completionListener?.let { it(false, "You must have active internet connection to connect with HMG Network") }
// }
// }
// }
//
// fun haveInternet(completion: ((status: Boolean) -> Unit)){
// if (TEST)
// completion(true)
//
// "https://captive.apple.com".httpGet().response { request, response, result ->
// val have = response.statusCode == 200 && String(response.data).contains("<TITLE>Success</TITLE>", true)
// completion(have)
// }
// }
//
// fun getAuthCredentials(completion: (() -> Unit)){
// if (TEST){
// USER_NAME = "2300"
// PASSWORD = "1820"
// completion()
// return
// }
val mNetworkCallback = object : ConnectivityManager.NetworkCallback() {
override fun onLost(lostNetwork: Network?) {
// if (network.equals(lostNetwork)){
// //GlyphLayout.done(false)
//
// val jsonBody = """{"PatientID":$PATIENT_ID}"""
// API.WIFI_CREDENTIALS
// .httpPost()
// .jsonBody(jsonBody, Charsets.UTF_8)
// .response { request, response, result ->
// val jsonString = String(response.data)
// Log.d(TAG, "JSON $jsonString")
//
// if (response.statusCode == 200){
//
// val jsonObject = JSONObject(jsonString)
// if(!jsonObject.getString("ErrorMessage").equals("null")){
// val errorMsg = jsonObject.getString("ErrorMessage")
// completionListener?.let { it(false, errorMsg) }
//
// }else{
// jsonObject.getJSONArray("Hmg_SMS_Get_By_ProjectID_And_PatientIDList").let { array ->
// array.getJSONObject(0).let { object_ ->
// if (object_.has("UserName") && object_.has("UserName")){
// USER_NAME = object_.getString("UserName")
// PASSWORD = object_.getString("Password")
// completion()
// }else{
// completionListener?.let { it(false, "Failed to get your internet credentials") }
// }
// }
// }
// }
//
// }else{
// completionListener?.let { it(false, "Failed to get your internet credentials") }
// }
// }
}
}
val builder: NetworkRequest.Builder = NetworkRequest.Builder()
// for (transportType in networkCapabilities.getTransportTypes()) {
// builder.addTransportType(transportType)
// }
//
// fun forceNetworkCallOverWifi(){
// val connectivityManager = context.applicationContext.getSystemService(Context.CONNECTIVITY_SERVICE) as ConnectivityManager
//// val network = Network
//// connectivityManager.activeNetwork
// // Exit app if Network disappears.
// // Exit app if Network disappears.
//// val networkCapabilities: NetworkCapabilities = ConnectivityManager.from(context).getNetworkCapabilities(network)
//// val networkCapabilities: NetworkCapabilities = connectivityManager.getNetworkCapabilities(network)
//
//// if (networkCapabilities == null) {
//// return
//// }
//
// val mNetworkCallback = object : ConnectivityManager.NetworkCallback() {
// override fun onLost(lostNetwork: Network?) {
//// if (network.equals(lostNetwork)){
//// //GlyphLayout.done(false)
//// }
// }
// }
connectivityManager.registerNetworkCallback(builder.build(), mNetworkCallback)
}
/*
* Helpful:
* http://stackoverflow.com/questions/6517314/android-wifi-connection-programmatically
*/
fun getScanResultSecurity(result: ScanResult): String? {
val capabilities: String = result.capabilities
val securityModes = arrayOf("WEP", "PSK", "EAP")
for (securityMode in securityModes) {
if (capabilities.contains(securityMode)) {
return securityMode
}
}
return "OPEN"
}
//connects to the given ssid
fun connectToWPAWiFi(ssid: String, password: String){
// val builder: NetworkRequest.Builder = NetworkRequest.Builder()
//// for (transportType in networkCapabilities.getTransportTypes()) {
//// builder.addTransportType(transportType)
//// }
// connectivityManager.registerNetworkCallback(builder.build(), mNetworkCallback)
// }
//
// /*
// * Helpful:
// * http://stackoverflow.com/questions/6517314/android-wifi-connection-programmatically
// */
// fun getScanResultSecurity(result: ScanResult): String? {
// val capabilities: String = result.capabilities
// val securityModes = arrayOf("WEP", "PSK", "EAP")
// for (securityMode in securityModes) {
// if (capabilities.contains(securityMode)) {
// return securityMode
// }
// }
// return "OPEN"
// }
//
// //connects to the given ssid
// fun connectToWPAWiFi(ssid: String, password: String){
//
// WifiUtils.withContext(context)
// .connectWith(ssid, "")
// .setTimeout(40000)
@ -327,25 +327,25 @@ class HMG_Wifi_(flutterMainActivity: FlutterMainActivity) {
// Log.v(TAG,"HMG-GUEST failed to connect")
// }
// }
}
fun connectedNetworkId():Int{
val wm:WifiManager= context.applicationContext.getSystemService(Context.WIFI_SERVICE) as WifiManager
return wm.connectionInfo.networkId
}
fun connectedNetworkIPAddress():Int{
val wm:WifiManager= context.applicationContext.getSystemService(Context.WIFI_SERVICE) as WifiManager
return wm.connectionInfo.ipAddress
}
fun isConnectedTo(bssid: String):Boolean{
val wm:WifiManager= context.applicationContext.getSystemService(Context.WIFI_SERVICE) as WifiManager
if(wm.connectionInfo.bssid == bssid){
return true
}
return false
}
}
//
// }
//
// fun connectedNetworkId():Int{
// val wm:WifiManager= context.applicationContext.getSystemService(Context.WIFI_SERVICE) as WifiManager
// return wm.connectionInfo.networkId
// }
//
// fun connectedNetworkIPAddress():Int{
// val wm:WifiManager= context.applicationContext.getSystemService(Context.WIFI_SERVICE) as WifiManager
// return wm.connectionInfo.ipAddress
// }
//
// fun isConnectedTo(bssid: String):Boolean{
// val wm:WifiManager= context.applicationContext.getSystemService(Context.WIFI_SERVICE) as WifiManager
// if(wm.connectionInfo.bssid == bssid){
// return true
// }
// return false
// }
//
//}

@ -1,8 +1,5 @@
package com.cloud.diplomaticquarterapp.utils
import android.os.AsyncTask
import android.os.Parcel
import android.os.Parcelable
import android.util.Log
import java.io.BufferedReader
import java.io.InputStreamReader

@ -1,14 +1,16 @@
package com.cloud.diplomaticquarterapp.utils
import android.content.Context
import android.net.wifi.WifiManager
import android.util.Log
import android.widget.Toast
import com.cloud.diplomaticquarterapp.FlutterMainActivity
import com.cloud.diplomaticquarterapp.hmgwifi.HMG_Wifi
import com.cloud.diplomaticquarterapp.MainActivity
import com.cloud.diplomaticquarterapp.hmgwifi.HMG_Guest
import com.cloud.diplomaticquarterapp.hmgwifi.HMG_Internet
import io.flutter.plugin.common.BinaryMessenger
import io.flutter.plugin.common.MethodCall
import io.flutter.plugin.common.MethodChannel
class PlatformBridge(binaryMessenger: BinaryMessenger, flutterMainActivity: FlutterMainActivity) {
class PlatformBridge(binaryMessenger: BinaryMessenger, flutterMainActivity: MainActivity) {
private var binaryMessenger = binaryMessenger
private var mainActivity = flutterMainActivity
@ -16,40 +18,51 @@ class PlatformBridge(binaryMessenger: BinaryMessenger, flutterMainActivity: Flut
companion object {
private const val CHANNEL = "HMG-Platform-Bridge"
private const val METHOD_CONNECT_WIFI = "connectHMGGuestWifi"
private const val METHOD_SHOW_LOADING = "loading"
private const val HMG_INTERNET_WIFI_CONNECT_METHOD = "connectHMGInternetWifi"
private const val HMG_GUEST_WIFI_CONNECT_METHOD = "connectHMGGuestWifi"
private const val ENABLE_WIFI_IF_NOT = "enableWifiIfNot"
}
fun create(){
channel = MethodChannel(binaryMessenger, CHANNEL)
HMGUtils.setPlatformChannel(channel)
channel.setMethodCallHandler { methodCall: MethodCall, result: MethodChannel.Result ->
if (methodCall.method == METHOD_CONNECT_WIFI) {
if (methodCall.method == HMG_INTERNET_WIFI_CONNECT_METHOD) {
connectHMGInternetWifi(methodCall,result)
}else if (methodCall.method == HMG_GUEST_WIFI_CONNECT_METHOD) {
connectHMGGuestWifi(methodCall,result)
}else if (methodCall.method == METHOD_SHOW_LOADING) {
showLoading(methodCall,result)
}else if (methodCall.method == ENABLE_WIFI_IF_NOT) {
enableWifiIfNot(methodCall,result)
}else{
}else {
result.notImplemented()
}
}
val res = channel.invokeMethod("localizedValue","errorConnectingHmgNetwork")
print(res)
}
private fun connectHMGGuestWifi(methodCall: MethodCall, result: MethodChannel.Result){
private fun connectHMGInternetWifi(methodCall: MethodCall, result: MethodChannel.Result){
(methodCall.arguments as ArrayList<*>).let {
require(it.size > 0 && (it[0] is String),lazyMessage = {
"Missing or invalid arguments (Must have one argument 'String at 0'"
})
val patientId = it[0].toString()
// HMGUtils.showLoading(mainActivity,true,"Connecting...")
HMG_Wifi(mainActivity)
HMG_Internet(mainActivity)
.connectToHMGGuestNetwork(patientId){ status, message ->
HMGUtils.showLoading(mainActivity,false)
result.success(if(status) 1 else 0)
if(status){
HMGUtils.showMessage(mainActivity,"Error", message)
HMGUtils.popMessage(mainActivity, message)
}else{
HMGUtils.showMessage(mainActivity,"Success",message)
HMGUtils.popMessage(mainActivity,message)
}
Log.v(this.javaClass.simpleName, "$status | $message")
@ -57,15 +70,28 @@ class PlatformBridge(binaryMessenger: BinaryMessenger, flutterMainActivity: Flut
}
}
private fun showLoading(methodCall: MethodCall, result: MethodChannel.Result){
(methodCall.arguments as ArrayList<*>).let {
require(it.size > 1 && (it[0] is String) && (it[1] is Boolean),lazyMessage = {
"Missing or invalid arguments (Must have two argument 'String at 1' and 'Boolean at 1'"
})
val message = it[0] as String
val show = it[1] as Boolean
HMGUtils.showLoading(mainActivity,show,message)
private fun connectHMGGuestWifi(methodCall: MethodCall, result: MethodChannel.Result){
HMG_Guest(mainActivity).connectToHMGGuestNetwork { status, message ->
result.success(if(status) 1 else 0)
if(status){
HMGUtils.popMessage(mainActivity, message)
}else{
HMGUtils.popMessage(mainActivity,message)
}
Log.v(this.javaClass.simpleName, "$status | $message")
}
}
private fun enableWifiIfNot(methodCall: MethodCall, result: MethodChannel.Result) {
val wm = mainActivity.applicationContext.getSystemService(Context.WIFI_SERVICE) as WifiManager?
if (wm != null){
if (!wm.isWifiEnabled)
wm.isWifiEnabled = true
result.success(true)
}else{
result.error("101","Error while opening wifi, Please try to open wifi yourself and try again","'WifiManager' service failed");
}
}
}

@ -1,17 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".FlutterMainActivity">
<io.flutter.embedding.android.FlutterView
android:background="#FFFFFF"
android:id="@+id/flutterView"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
<include layout="@layout/loading_view" android:visibility="gone"/>
</RelativeLayout>

@ -1,42 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/loadingView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#B3000000">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_margin="60dp"
android:layout_centerInParent="true"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<com.wang.avi.AVLoadingIndicatorView
android:id="@+id/avLoadingView"
style="@style/AVLoadingIndicatorView"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_centerInParent="true"
android:visibility="visible"
app:indicatorColor="#4CAF50"
app:indicatorName="BallScaleMultipleIndicator"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintDimensionRatio="w,1:1"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
<TextView
android:id="@+id/lblLoadingView"
android:textSize="12sp"
android:textColor="#FFFFFF"
android:layout_centerInParent="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
</RelativeLayout>

@ -1,5 +1,5 @@
buildscript {
ext.kotlin_version = '1.4.10'
ext.kotlin_version = '1.3.50'
repositories {
google()
jcenter()

File diff suppressed because one or more lines are too long

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 142 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 445 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 47 KiB

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 244 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 644 B

After

Width:  |  Height:  |  Size: 475 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.2 KiB

After

Width:  |  Height:  |  Size: 475 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 139 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 606 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

1
ios/.gitignore vendored

@ -32,3 +32,4 @@ Runner/GeneratedPluginRegistrant.*
!default.perspectivev3
/Runner.xcworkspace/contents.xcworkspacedata
/Runner.xcodeproj/project.pbxproj
/Flutter/.last_build_id

@ -1 +1 @@
c948a9de8d5fb4b791dcd366c30ba789
4592a16118bc51c556d89309892cf794

@ -1,5 +1,5 @@
# Uncomment this line to define a global platform for your project
platform :ios, '11.0'
# platform :ios, '11.0'
# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
@ -12,7 +12,6 @@ project 'Runner', {
# pod 'FBSDKCoreKit'
# pod 'FBSDKLoginKit'
pod 'NVActivityIndicatorView'
def parse_KV_file(file, separator='=')
file_abs_path = File.expand_path(file)
@ -40,8 +39,11 @@ target 'Runner' do
use_frameworks!
use_modular_headers!
# Native Pods
pod 'NVActivityIndicatorView'
# Flutter Pod
copied_flutter_dir = File.join(__dir__, 'Flutter')
copied_framework_path = File.join(copied_flutter_dir, 'Flutter.framework')
copied_podspec_path = File.join(copied_flutter_dir, 'Flutter.podspec')
@ -89,3 +91,4 @@ post_install do |installer|
end
end
end

@ -1,4 +1,9 @@
PODS:
- android_intent (0.0.1):
- Flutter
- barcode_scan_fix (0.0.1):
- Flutter
- MTBBarcodeScanner
- connectivity (0.0.1):
- Flutter
- Reachability
@ -111,6 +116,7 @@ PODS:
- Flutter
- maps_launcher (0.0.1):
- Flutter
- MTBBarcodeScanner (5.0.11)
- nanopb (1.30906.0):
- nanopb/decode (= 1.30906.0)
- nanopb/encode (= 1.30906.0)
@ -175,8 +181,12 @@ PODS:
- Flutter
- webview_flutter (0.0.1):
- Flutter
- wifi (0.0.1):
- Flutter
DEPENDENCIES:
- android_intent (from `.symlinks/plugins/android_intent/ios`)
- barcode_scan_fix (from `.symlinks/plugins/barcode_scan_fix/ios`)
- connectivity (from `.symlinks/plugins/connectivity/ios`)
- connectivity_for_web (from `.symlinks/plugins/connectivity_for_web/ios`)
- connectivity_macos (from `.symlinks/plugins/connectivity_macos/ios`)
@ -227,6 +237,7 @@ DEPENDENCIES:
- video_player_web (from `.symlinks/plugins/video_player_web/ios`)
- wakelock (from `.symlinks/plugins/wakelock/ios`)
- webview_flutter (from `.symlinks/plugins/webview_flutter/ios`)
- wifi (from `.symlinks/plugins/wifi/ios`)
SPEC REPOS:
trunk:
@ -239,6 +250,7 @@ SPEC REPOS:
- GoogleDataTransport
- GoogleMaps
- GoogleUtilities
- MTBBarcodeScanner
- nanopb
- NVActivityIndicatorView
- PromisesObjC
@ -249,6 +261,10 @@ SPEC REPOS:
- TwilioVideo
EXTERNAL SOURCES:
android_intent:
:path: ".symlinks/plugins/android_intent/ios"
barcode_scan_fix:
:path: ".symlinks/plugins/barcode_scan_fix/ios"
connectivity:
:path: ".symlinks/plugins/connectivity/ios"
connectivity_for_web:
@ -347,8 +363,12 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/wakelock/ios"
webview_flutter:
:path: ".symlinks/plugins/webview_flutter/ios"
wifi:
:path: ".symlinks/plugins/wifi/ios"
SPEC CHECKSUMS:
android_intent: 367df2f1277a74e4a90e14a8ab3df3112d087052
barcode_scan_fix: 80dd65de55f27eec6591dd077c8b85f2b79e31f1
connectivity: c4130b2985d4ef6fd26f9702e886bd5260681467
connectivity_for_web: 2b8584556930d4bd490d82b836bcf45067ce345b
connectivity_macos: e2e9731b6b22dda39eb1b128f6969d574460e191
@ -383,6 +403,7 @@ SPEC CHECKSUMS:
manage_calendar_events: 0338d505ea26cdfd20cd883279bc28afa11eca34
map_launcher: e325db1261d029ff33e08e03baccffe09593ffea
maps_launcher: eae38ee13a9c3f210fa04e04bb4c073fa4c6ed92
MTBBarcodeScanner: f453b33c4b7dfe545d8c6484ed744d55671788cb
nanopb: 59317e09cf1f1a0af72f12af412d54edf52603fc
native_device_orientation: e24d00be281de72996640885d80e706142707660
native_progress_hud: f95f5529742b36a3c7fdecfa88dc018319e39bf9
@ -415,7 +436,8 @@ SPEC CHECKSUMS:
video_player_web: da8cadb8274ed4f8dbee8d7171b420dedd437ce7
wakelock: 0d4a70faf8950410735e3f61fb15d517c8a6efc4
webview_flutter: d2b4d6c66968ad042ad94cbb791f5b72b4678a96
wifi: d7d77c94109e36c4175d845f0a5964eadba71060
PODFILE CHECKSUM: fd41bba6db38332890981ce38f0747bdb94c61f2
PODFILE CHECKSUM: ac5efa1ac3c9555d0008dc18004313c84746da62
COCOAPODS: 1.10.0

@ -7,10 +7,10 @@
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
<!--Main View Controller-->
<!--Main FlutterVC-->
<scene sceneID="tne-QT-ifu">
<objects>
<viewController id="BYZ-38-t0r" customClass="MainViewController" customModule="Runner" customModuleProvider="target" sceneMemberID="viewController">
<viewController id="BYZ-38-t0r" customClass="MainFlutterVC" customModule="Runner" customModuleProvider="target" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="y3c-jy-aDJ"/>
<viewControllerLayoutGuide type="bottom" id="wfy-db-euE"/>
@ -18,85 +18,12 @@
<view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC">
<rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<containerView opaque="NO" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="iiB-nC-lWt">
<rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
<connections>
<segue destination="07U-8g-TSJ" kind="embed" id="0mo-Dk-ROY"/>
</connections>
</containerView>
<view hidden="YES" alpha="0.90000000000000002" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="zXb-Rz-9uK">
<rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="BSu-be-Z1V" customClass="NVActivityIndicatorView" customModule="NVActivityIndicatorView">
<rect key="frame" x="30" y="271" width="354" height="354"/>
<color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
<constraints>
<constraint firstAttribute="width" secondItem="BSu-be-Z1V" secondAttribute="height" id="xGa-6d-w1R"/>
</constraints>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="string" keyPath="typeName" value="ballGridBeat"/>
<userDefinedRuntimeAttribute type="color" keyPath="color">
<color key="value" red="0.34742879999999998" green="0.67916901529999996" blue="0.35416535329999999" alpha="1" colorSpace="custom" customColorSpace="displayP3"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
</view>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="5Wd-a2-Mgt">
<rect key="frame" x="207" y="448" width="0.0" height="0.0"/>
<fontDescription key="fontDescription" type="system" pointSize="12"/>
<color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
<constraints>
<constraint firstItem="5Wd-a2-Mgt" firstAttribute="centerX" secondItem="BSu-be-Z1V" secondAttribute="centerX" id="4kE-50-iBD"/>
<constraint firstItem="BSu-be-Z1V" firstAttribute="centerY" secondItem="zXb-Rz-9uK" secondAttribute="centerY" id="Ek3-H4-Tks"/>
<constraint firstItem="5Wd-a2-Mgt" firstAttribute="centerY" secondItem="BSu-be-Z1V" secondAttribute="centerY" id="HTw-sL-a5g"/>
<constraint firstItem="BSu-be-Z1V" firstAttribute="leading" secondItem="zXb-Rz-9uK" secondAttribute="leading" constant="30" id="Xas-Sl-2GU"/>
<constraint firstAttribute="trailing" secondItem="BSu-be-Z1V" secondAttribute="trailing" constant="30" id="jEB-tN-wf8"/>
<constraint firstItem="BSu-be-Z1V" firstAttribute="centerX" secondItem="zXb-Rz-9uK" secondAttribute="centerX" id="yie-B7-m91"/>
</constraints>
</view>
</subviews>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstAttribute="trailing" secondItem="zXb-Rz-9uK" secondAttribute="trailing" id="DK6-ZR-0qc"/>
<constraint firstItem="zXb-Rz-9uK" firstAttribute="leading" secondItem="8bC-Xf-vdC" secondAttribute="leading" id="Msu-br-SZp"/>
<constraint firstItem="zXb-Rz-9uK" firstAttribute="top" secondItem="8bC-Xf-vdC" secondAttribute="top" id="W9Y-rE-AmS"/>
<constraint firstAttribute="bottom" secondItem="zXb-Rz-9uK" secondAttribute="bottom" id="Zjo-yK-nHj"/>
<constraint firstAttribute="trailing" secondItem="iiB-nC-lWt" secondAttribute="trailing" id="fcK-dc-bwG"/>
<constraint firstItem="iiB-nC-lWt" firstAttribute="leading" secondItem="8bC-Xf-vdC" secondAttribute="leading" id="idX-Jw-Ma9"/>
<constraint firstItem="iiB-nC-lWt" firstAttribute="top" secondItem="8bC-Xf-vdC" secondAttribute="top" id="uKn-QU-Ka7"/>
<constraint firstAttribute="bottom" secondItem="iiB-nC-lWt" secondAttribute="bottom" id="zPu-2M-aXt"/>
</constraints>
</view>
<connections>
<outlet property="lblLoadingText" destination="5Wd-a2-Mgt" id="hGl-tJ-FUV"/>
<outlet property="loading" destination="BSu-be-Z1V" id="4Nx-DH-P42"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="95.652173913043484" y="-21.428571428571427"/>
</scene>
<!--Main FlutterVC-->
<scene sceneID="J1x-mD-FM4">
<objects>
<viewController id="07U-8g-TSJ" customClass="MainFlutterVC" customModule="Runner" customModuleProvider="target" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="dzx-FI-nKH"/>
<viewControllerLayoutGuide type="bottom" id="q3b-GI-trV"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="y53-TK-Smi">
<rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="jK2-7S-ThF" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="1022" y="-21"/>
<point key="canvasLocation" x="96" y="-21"/>
</scene>
</scenes>
</document>

@ -0,0 +1,102 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="16097" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="BYZ-38-t0r">
<device id="retina6_1" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="16087"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
<!--Main View Controller-->
<scene sceneID="tne-QT-ifu">
<objects>
<viewController id="BYZ-38-t0r" customClass="MainViewController" customModule="Runner" customModuleProvider="target" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="y3c-jy-aDJ"/>
<viewControllerLayoutGuide type="bottom" id="wfy-db-euE"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC">
<rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<containerView opaque="NO" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="iiB-nC-lWt">
<rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
<connections>
<segue destination="07U-8g-TSJ" kind="embed" id="0mo-Dk-ROY"/>
</connections>
</containerView>
<view hidden="YES" alpha="0.90000000000000002" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="zXb-Rz-9uK">
<rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="BSu-be-Z1V" customClass="NVActivityIndicatorView" customModule="NVActivityIndicatorView">
<rect key="frame" x="30" y="271" width="354" height="354"/>
<color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
<constraints>
<constraint firstAttribute="width" secondItem="BSu-be-Z1V" secondAttribute="height" id="xGa-6d-w1R"/>
</constraints>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="string" keyPath="typeName" value="ballGridBeat"/>
<userDefinedRuntimeAttribute type="color" keyPath="color">
<color key="value" red="0.34742879999999998" green="0.67916901529999996" blue="0.35416535329999999" alpha="1" colorSpace="custom" customColorSpace="displayP3"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
</view>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="5Wd-a2-Mgt">
<rect key="frame" x="207" y="448" width="0.0" height="0.0"/>
<fontDescription key="fontDescription" type="system" pointSize="12"/>
<color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
<constraints>
<constraint firstItem="5Wd-a2-Mgt" firstAttribute="centerX" secondItem="BSu-be-Z1V" secondAttribute="centerX" id="4kE-50-iBD"/>
<constraint firstItem="BSu-be-Z1V" firstAttribute="centerY" secondItem="zXb-Rz-9uK" secondAttribute="centerY" id="Ek3-H4-Tks"/>
<constraint firstItem="5Wd-a2-Mgt" firstAttribute="centerY" secondItem="BSu-be-Z1V" secondAttribute="centerY" id="HTw-sL-a5g"/>
<constraint firstItem="BSu-be-Z1V" firstAttribute="leading" secondItem="zXb-Rz-9uK" secondAttribute="leading" constant="30" id="Xas-Sl-2GU"/>
<constraint firstAttribute="trailing" secondItem="BSu-be-Z1V" secondAttribute="trailing" constant="30" id="jEB-tN-wf8"/>
<constraint firstItem="BSu-be-Z1V" firstAttribute="centerX" secondItem="zXb-Rz-9uK" secondAttribute="centerX" id="yie-B7-m91"/>
</constraints>
</view>
</subviews>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstAttribute="trailing" secondItem="zXb-Rz-9uK" secondAttribute="trailing" id="DK6-ZR-0qc"/>
<constraint firstItem="zXb-Rz-9uK" firstAttribute="leading" secondItem="8bC-Xf-vdC" secondAttribute="leading" id="Msu-br-SZp"/>
<constraint firstItem="zXb-Rz-9uK" firstAttribute="top" secondItem="8bC-Xf-vdC" secondAttribute="top" id="W9Y-rE-AmS"/>
<constraint firstAttribute="bottom" secondItem="zXb-Rz-9uK" secondAttribute="bottom" id="Zjo-yK-nHj"/>
<constraint firstAttribute="trailing" secondItem="iiB-nC-lWt" secondAttribute="trailing" id="fcK-dc-bwG"/>
<constraint firstItem="iiB-nC-lWt" firstAttribute="leading" secondItem="8bC-Xf-vdC" secondAttribute="leading" id="idX-Jw-Ma9"/>
<constraint firstItem="iiB-nC-lWt" firstAttribute="top" secondItem="8bC-Xf-vdC" secondAttribute="top" id="uKn-QU-Ka7"/>
<constraint firstAttribute="bottom" secondItem="iiB-nC-lWt" secondAttribute="bottom" id="zPu-2M-aXt"/>
</constraints>
</view>
<connections>
<outlet property="lblLoadingText" destination="5Wd-a2-Mgt" id="hGl-tJ-FUV"/>
<outlet property="loading" destination="BSu-be-Z1V" id="4Nx-DH-P42"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="95.652173913043484" y="-21.428571428571427"/>
</scene>
<!--Main FlutterVC-->
<scene sceneID="J1x-mD-FM4">
<objects>
<viewController id="07U-8g-TSJ" customClass="MainFlutterVC" customModule="Runner" customModuleProvider="target" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="dzx-FI-nKH"/>
<viewControllerLayoutGuide type="bottom" id="q3b-GI-trV"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="y53-TK-Smi">
<rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="jK2-7S-ThF" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="1022" y="-21"/>
</scene>
</scenes>
</document>

@ -7,25 +7,126 @@
import UIKit
import Flutter
import NetworkExtension
import SystemConfiguration.CaptiveNetwork
var flutterMethodChannel:FlutterMethodChannel? = nil
class MainFlutterVC: FlutterViewController {
var root_view:MainViewController?
override func viewDidLoad() {
super.viewDidLoad()
flutterMethodChannel = FlutterMethodChannel(name: "HMG-Platform-Bridge",binaryMessenger: binaryMessenger)
flutterMethodChannel?.setMethodCallHandler { (methodCall, result) in
if methodCall.method == "connectHMGInternetWifi"{
self.connectHMGInternetWifi(methodCall:methodCall, result: result)
}else if methodCall.method == "connectHMGGuestWifi"{
self.connectHMGGuestWifi(methodCall:methodCall, result: result)
}else if methodCall.method == "isHMGNetworkAvailable"{
self.isHMGNetworkAvailable(methodCall:methodCall, result: result)
}else{
}
print("")
}
FlutterText.with(key: "errorConnectingHmgNetwork") { (localized) in
print(localized)
}
}
/*
// MARK: - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
// Get the new view controller using segue.destination.
// Pass the selected object to the new view controller.
// Connect HMG Wifi and Internet
func connectHMGInternetWifi(methodCall:FlutterMethodCall ,result: @escaping FlutterResult){
guard let pateintId = (methodCall.arguments as? [Any])?.first as? String
else { return assert(true, "Missing or invalid arguments (Must have one argument 'String at 0'") }
HMG_Internet.shared.connect(patientId: pateintId) { (status, message) in
result(status ? 1 : 0)
if status{
self.showMessage(title:"Congratulations", message:message)
}else{
self.showMessage(title:"Ooops,", message:message)
}
}
}
*/
// Connect HMG-Guest for App Access
func connectHMGGuestWifi(methodCall:FlutterMethodCall ,result: @escaping FlutterResult){
HMG_GUEST.shared.connect() { (status, message) in
result(status ? 1 : 0)
if status{
self.showMessage(title:"Congratulations", message:message)
}else{
self.showMessage(title:"Ooops,", message:message)
}
}
}
func isHMGNetworkAvailable(methodCall:FlutterMethodCall ,result: @escaping FlutterResult) -> Bool{
guard let ssid = methodCall.arguments as? String else {
assert(true, "Missing or invalid arguments (Must have one argument 'String at 0'")
return false
}
let queue = DispatchQueue.init(label: "com.hmg.wifilist")
NEHotspotHelper.register(options: nil, queue: queue) { (command) in
print(command)
if(command.commandType == NEHotspotHelperCommandType.filterScanList) {
if let networkList = command.networkList{
for network in networkList{
print(network.ssid)
}
}
}
}
// [NEHotspotHelper registerWithOptions:nil queue:queue handler: ^(NEHotspotHelperCommand * cmd) {
// if(cmd.commandType == kNEHotspotHelperCommandTypeFilterScanList) {
// for (NEHotspotNetwork* network in cmd.networkList) {
// NSLog(@"network.SSID = %@",network.SSID);
// }
// }
// }];
return false
}
// Message Dailog
func showMessage(title:String, message:String){
DispatchQueue.main.async {
let alert = UIAlertController(title: title, message: message, preferredStyle: .alert )
alert.addAction(UIAlertAction(title: "OK", style: .destructive, handler: nil))
self.present(alert, animated: true) {
}
}
}
/*
// MARK: - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
// Get the new view controller using segue.destination.
// Pass the selected object to the new view controller.
}
*/
}

@ -1,96 +0,0 @@
//
// MainViewController.swift
// Runner
//
// Created by ZiKambrani on 26/03/1442 AH.
//
import UIKit
import NVActivityIndicatorView
class MainViewController: UIViewController {
@IBOutlet weak var lblLoadingText: UILabel!
@IBOutlet weak var loading: NVActivityIndicatorView!
override func viewDidLoad() {
super.viewDidLoad()
print(loading)
}
func createBridge(flutterViewController:FlutterViewController){
let connectHMGGuestWifi = FlutterMethodChannel(name: "HMG-Platform-Bridge",binaryMessenger: flutterViewController.binaryMessenger)
connectHMGGuestWifi.setMethodCallHandler { (methodCall, result) in
if methodCall.method == "connectHMGGuestWifi"{
self.connectWifi(result: result)
}else if methodCall.method == "loading"{
self.showLoading(flutterMethodCall: methodCall)
}else{
}
print("")
}
}
// Connect HMG-Guest Wifi and Internet
func connectWifi(result: @escaping FlutterResult){
showLoading(message: "Connecting...")
HMG_GUEST.shared.connect { (status, message) in
result(status ? 1 : 0)
self.showLoading(false);
if status{
self.showMessage(title:"Congratulations", message:message)
}else{
self.showMessage(title:"Ooops,", message:message)
}
}
}
// Loading/Progress
private func showLoading(flutterMethodCall:FlutterMethodCall){
if let args = flutterMethodCall.arguments as? [Any],
let message = args.first as? String, let show = args.last as? Bool{
showLoading(message: message, show)
}else{
assert(true, "Missing or invalid arguments (Must have two argument 'String at 0' and Boolean at 1)")
}
}
func showLoading(message:String = "Please wait...", _ show:Bool = true){
DispatchQueue.main.async {
if show{
self.lblLoadingText.text = message
self.loading.superview?.isHidden = false
self.loading.startAnimating()
}else{
self.lblLoadingText.text = ""
self.loading.superview?.isHidden = true
self.loading.stopAnimating()
}
}
}
// Message Dailog
func showMessage(title:String, message:String){
DispatchQueue.main.async {
let alert = UIAlertController(title: title, message: message, preferredStyle: .alert )
alert.addAction(UIAlertAction(title: "OK", style: .destructive, handler: nil))
self.present(alert, animated: true) {
}
}
}
// MARK: - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
if let flutterVC = segue.destination as? MainFlutterVC{
flutterVC.root_view = self
createBridge(flutterViewController: flutterVC)
}
}
}

@ -0,0 +1,17 @@
//
// API.swift
// Runner
//
// Created by ZiKambrani on 04/04/1442 AH.
//
import UIKit
fileprivate let DOMAIN = "https://uat.hmgwebservices.com"
fileprivate let SERVICE = "Services/Patients.svc/REST"
fileprivate let BASE_URL = "\(DOMAIN)/\(SERVICE)"
struct API {
static let WIFI_CREDENTIALS = "\(BASE_URL)/Hmg_SMS_Get_By_ProjectID_And_PatientID"
}

@ -0,0 +1,118 @@
//
// Extensions.swift
// Runner
//
// Created by ZiKambrani on 04/04/1442 AH.
//
import UIKit
extension String{
func toUrl() -> URL?{
return URL(string: self)
}
}
extension Bundle {
func certificate(named name: String) -> SecCertificate {
let cerURL = self.url(forResource: name, withExtension: "cer")!
let cerData = try! Data(contentsOf: cerURL)
let cer = SecCertificateCreateWithData(nil, cerData as CFData)!
return cer
}
func identity(named name: String, password: String) -> SecIdentity {
let p12URL = self.url(forResource: name, withExtension: "p12")!
let p12Data = try! Data(contentsOf: p12URL)
var importedCF: CFArray? = nil
let options = [kSecImportExportPassphrase as String: password]
let err = SecPKCS12Import(p12Data as CFData, options as CFDictionary, &importedCF)
precondition(err == errSecSuccess)
let imported = importedCF! as NSArray as! [[String:AnyObject]]
precondition(imported.count == 1)
return (imported[0][kSecImportItemIdentity as String]!) as! SecIdentity
}
}
extension SecCertificate{
func trust() -> Bool?{
var optionalTrust: SecTrust?
let policy = SecPolicyCreateBasicX509()
let status = SecTrustCreateWithCertificates([self] as AnyObject,
policy,
&optionalTrust)
guard status == errSecSuccess else { return false}
let trust = optionalTrust!
let stat = optionalTrust?.evaluateAllowing(rootCertificates: [self])
return stat
}
func secTrustObject() -> SecTrust?{
var optionalTrust: SecTrust?
let policy = SecPolicyCreateBasicX509()
let status = SecTrustCreateWithCertificates([self] as AnyObject,
policy,
&optionalTrust)
return optionalTrust
}
}
extension SecTrust {
func evaluate() -> Bool {
var trustResult: SecTrustResultType = .invalid
let err = SecTrustEvaluate(self, &trustResult)
guard err == errSecSuccess else { return false }
return [.proceed, .unspecified].contains(trustResult)
}
func evaluateAllowing(rootCertificates: [SecCertificate]) -> Bool {
// Apply our custom root to the trust object.
var err = SecTrustSetAnchorCertificates(self, rootCertificates as CFArray)
guard err == errSecSuccess else { return false }
// Re-enable the system's built-in root certificates.
err = SecTrustSetAnchorCertificatesOnly(self, false)
guard err == errSecSuccess else { return false }
// Run a trust evaluation and only allow the connection if it succeeds.
return self.evaluate()
}
}
extension UIView{
func show(){
self.alpha = 0.0
self.isHidden = false
UIView.animate(withDuration: 0.25, animations: {
self.alpha = 1
}) { (complete) in
}
}
func hide(){
UIView.animate(withDuration: 0.25, animations: {
self.alpha = 0.0
}) { (complete) in
self.isHidden = true
}
}
}

@ -0,0 +1,22 @@
//
// LocalizedFromFlutter.swift
// Runner
//
// Created by ZiKambrani on 10/04/1442 AH.
//
import UIKit
class FlutterText{
class func with(key:String,completion: @escaping (String)->Void){
flutterMethodChannel?.invokeMethod("localizedValue", arguments: key, result: { (result) in
if let localized = result as? String{
completion(localized)
}else{
completion(key)
}
})
}
}

@ -2,11 +2,6 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleExecutable</key>
@ -27,22 +22,20 @@
<string>$(FLUTTER_BUILD_NUMBER)</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>io.flutter.embedded_views_preview</key>
<true/>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIMainStoryboardFile</key>
<string>Main</string>
<key>NSMicrophoneUsageDescription</key>
<string>Need microphone access for uploading videos</string>
<key>NSCameraUsageDescription</key>
<string>Need camera access for uploading images</string>
<key>NSLocationUsageDescription</key>
<string>Need location access for updating nearby friends</string>
<key>NSLocationWhenInUseUsageDescription</key>
<string>This app will use your location to show cool stuffs near you.</string>
<key>NSMicrophoneUsageDescription</key>
<string>Need microphone access for uploading videos</string>
<key>NSPhotoLibraryUsageDescription</key>
<string>Need photo library access for uploading images</string>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIMainStoryboardFile</key>
<string>Main</string>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
@ -58,5 +51,7 @@
</array>
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>
<key>io.flutter.embedded_views_preview</key>
<true/>
</dict>
</plist>

@ -2,6 +2,8 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<!-- <key>com.apple.developer.networking.HotspotHelper</key>-->
<!-- <true/>-->
<key>aps-environment</key>
<string>development</string>
<key>com.apple.developer.networking.HotspotConfiguration</key>

@ -10,25 +10,18 @@ import UIKit
import NetworkExtension
import SystemConfiguration.CaptiveNetwork
fileprivate let SSID = "HMG-MobileApp"
class HMG_GUEST{
static let shared = HMG_GUEST()
private let SSID = "HMG-GUEST"
private let USER = "1301"
private let PASS = "8928"
var complete:((_ status:Bool, _ message:String) -> Void)!
private var complete:((_ status:Bool, _ message:String) -> Void)!
func connect(completion:@escaping ((_ status:Bool, _ message:String) -> Void)){
complete = completion
if isAlreadyConnected() {
hasInternet { (has) in
if has == true{
self.complete(true, "You already connected to internet")
return
}else{
self.authenticate()
}
FlutterText.with(key: "alreadyConnectedHmgNetwork") { (localized) in
self.complete(true, localized )
}
}else{
connect()
@ -36,56 +29,33 @@ class HMG_GUEST{
}
private func connect() {
let hotspotConfig = NEHotspotConfiguration(ssid: SSID)
hotspotConfig.joinOnce = true
let hotspotConfig = NEHotspotConfiguration(ssid: "\(SSID)")
hotspotConfig.joinOnce = false
NEHotspotConfigurationManager.shared.apply(hotspotConfig) {[weak self] (error) in
guard let self = self else { return; }
if let error = error {
self.complete(false, error.localizedDescription ?? "Error connecting to HMG wifi network" )
FlutterText.with(key: "errorConnectingHmgNetwork") { (localized) in
self.complete(false, localized )
}
}else{
_ = Timer.scheduledTimer(withTimeInterval: 2, repeats: false) { (timer) in
self.authenticate()
_ = Timer.scheduledTimer(withTimeInterval: 10, repeats: false) { (timer) in
let connected = self.isAlreadyConnected()
let message = connected ? "successConnectingHmgNetwork" : "failedConnectingHmgNetwork"
FlutterText.with(key: message) { (localized) in
self.complete(false, localized )
}
}
}
}
}
func authenticate(){
func callLogin(){
let parameters = "Login=Log%20In&cmd=authenticate&password=1820&user=2300"
let postData = parameters.data(using: .utf8)
var request = URLRequest(url: URL(string: "https://captiveportal-login.hmg.com/cgi-bin/login")!,timeoutInterval: 5)
request.addValue("application/x-www-form-urlencoded", forHTTPHeaderField: "Content-Type")
request.httpMethod = "POST"
request.httpBody = postData
let task = URLSession.shared.dataTask(with: request) { data, response, error in
// guard let data = data else {
// self.complete(false, "Error at authentication")
// return
// }
self.hasInternet { (has) in
self.complete(has, has ? "Successfully connected to the internet" : "Authentication failed or you are already using your credentials on another device")
}
}
task.resume()
}
self.hasInternet { (has) in
if has == true{
self.complete(true, "Your internet account is already authenticated")
}else{
callLogin()
}
}
// NSMutableURLRequest(url: URL(string: "www.google.com")!).bind(to: command)
// NEHotspotHelper.register(options: [:], queue: DispatchQueue.global()) { (command) in
// command
// print(command)
// }
}
@ -104,26 +74,4 @@ class HMG_GUEST{
return currentSSID == SSID
}
func hasInternet( completion:@escaping ((Bool)->Void)){
let testUrl = "https://captive.apple.com"
var request = URLRequest(url: URL(string: testUrl)!,timeoutInterval: 5)
request.httpMethod = "GET"
let task = URLSession.shared.dataTask(with: request) { data, response, error in
guard let data = data else {
completion(false)
return
}
let resp = String(data: data, encoding: .utf8)!
if resp.contains("<TITLE>Success</TITLE>"){
completion(true)
}else{
completion(false)
}
}
task.resume()
}
}

@ -0,0 +1,129 @@
////
//// HMG_GUEST.swift
//// HMG-iOS-Wifi
////
//// Created by ZiKambrani on 23/03/1442 AH.
//// Copyright © 1442 ZiKambrani. All rights reserved.
////
//
//import UIKit
//import NetworkExtension
//import SystemConfiguration.CaptiveNetwork
//
//
//class HMG_GUEST{
// static let shared = HMG_GUEST()
// private let SSID = "GUEST-POC"
// private let USER = "1301"
// private let PASS = "8928"
//
// var complete:((_ status:Bool, _ message:String) -> Void)!
// func connect(completion:@escaping ((_ status:Bool, _ message:String) -> Void)){
// complete = completion
//
// if isAlreadyConnected() {
// hasInternet { (has) in
// if has == true{
// self.complete(true, "You already connected to internet")
// return
// }else{
// self.authenticate()
// }
// }
// }else{
// connect()
// }
// }
//
// private func connect() {
// let hotspotConfig = NEHotspotConfiguration(ssid: SSID)
// hotspotConfig.joinOnce = true
//
// NEHotspotConfigurationManager.shared.apply(hotspotConfig) {[weak self] (error) in
// guard let self = self else { return; }
//
// if let error = error {
// self.complete(false, error.localizedDescription ?? "Error connecting to HMG wifi network" )
// }else{
// _ = Timer.scheduledTimer(withTimeInterval: 2, repeats: false) { (timer) in
// self.authenticate()
// }
// }
// }
// }
//
// func authenticate(){
//
// func callLogin(){
//
// let parameters = "Login=Log%20In&cmd=authenticate&password=1820&user=2300"
// let postData = parameters.data(using: .utf8)
//
// var request = URLRequest(url: URL(string: "https://captiveportal-login.hmg.com/cgi-bin/login")!,timeoutInterval: 5)
// request.addValue("application/x-www-form-urlencoded", forHTTPHeaderField: "Content-Type")
//
// request.httpMethod = "POST"
// request.httpBody = postData
//
// let task = URLSession.shared.dataTask(with: request) { data, response, error in
// // guard let data = data else {
// // self.complete(false, "Error at authentication")
// // return
// // }
//
// self.hasInternet { (has) in
// self.complete(has, has ? "Successfully connected to the internet" : "Authentication failed or you are already using your credentials on another device")
// }
// }
// task.resume()
//
// }
//
// self.hasInternet { (has) in
// if has == true{
// self.complete(true, "Your internet account is already authenticated")
// }else{
// callLogin()
// }
// }
//
// }
//
// private func isAlreadyConnected() -> Bool{
// var currentSSID: String?
// if let interfaces = CNCopySupportedInterfaces() as NSArray? {
// for interface in interfaces {
// if let interfaceInfo = CNCopyCurrentNetworkInfo(interface as! CFString) as NSDictionary? {
// currentSSID = interfaceInfo[kCNNetworkInfoKeySSID as String] as? String
// break
// }
// }
// }
//
// print("CurrentConnectedSSID: \(currentSSID)")
// return currentSSID == SSID
// }
//
//
// func hasInternet( completion:@escaping ((Bool)->Void)){
//
// let testUrl = "https://captive.apple.com"
// var request = URLRequest(url: URL(string: testUrl)!,timeoutInterval: 5)
// request.httpMethod = "GET"
// let task = URLSession.shared.dataTask(with: request) { data, response, error in
// guard let data = data else {
// completion(false)
// return
// }
// let resp = String(data: data, encoding: .utf8)!
// if resp.contains("<TITLE>Success</TITLE>"){
// completion(true)
// }else{
// completion(false)
// }
//
// }
// task.resume()
// }
//
//}

@ -0,0 +1,193 @@
//
// HMG_GUEST.swift
// HMG-iOS-Wifi
//
// Created by ZiKambrani on 23/03/1442 AH.
// Copyright © 1442 ZiKambrani. All rights reserved.
//
import UIKit
import NetworkExtension
import SystemConfiguration.SCNetworkConnection
fileprivate var TEST = false
fileprivate let SSID = "GUEST-POC"
fileprivate var USER = ""
fileprivate var PASS = ""
fileprivate func supportedEAPTypes() -> [NSNumber]{
let peap = NEHotspotEAPSettings.EAPType.EAPPEAP.rawValue
let fast = NEHotspotEAPSettings.EAPType.EAPFAST.rawValue
let tls = NEHotspotEAPSettings.EAPType.EAPTLS.rawValue
let ttls = NEHotspotEAPSettings.EAPType.EAPTTLS.rawValue
return [NSNumber(value: peap), NSNumber(value: fast), NSNumber(value: tls), NSNumber(value: ttls)]
}
class HMG_Internet{
static let shared = HMG_Internet()
private var complete:((_ status:Bool, _ message:String) -> Void)!
func connect(patientId:String, completion:@escaping ((_ status:Bool, _ message:String) -> Void)){
complete = completion
if isAlreadyConnected() {
hasInternet { (has) in
if has == true{
FlutterText.with(key: "alreadyConnectedHmgNetwork"){ localized in
self.complete(true, localized)
}
return
}else{
FlutterText.with(key: "connectedToHmgNetworkWithNoInternet"){ localized in
self.complete(false, localized)
}
}
}
}else{
connect(patientId: patientId)
}
}
private func connect(patientId:String) {
getWifiCredentials(patientId: patientId) {
let trust_cert = Bundle.main.certificate(named: "GuestPOC_Certificate")
guard trust_cert.trust() == true else{
FlutterText.with(key: "notConnectedToHmgNetworkSecurityIssue"){ localized in
self.complete(false,localized)
}
return
}
let eapSettings = NEHotspotEAPSettings()
eapSettings.username = USER
eapSettings.password = PASS
eapSettings.trustedServerNames = ["*.hmg.com","onboard.hmg.com","hmg.com"]
eapSettings.supportedEAPTypes = [supportedEAPTypes().first!]
// eapSettings.isTLSClientCertificateRequired = true
// eapSettings.ttlsInnerAuthenticationType = .eapttlsInnerAuthenticationMSCHAPv2 // MSCHAPv2
// eapSettings.setIdentity(Bundle.main.identity(named: "GuestPOC_Certificate", password: "1"))
// eapSettings.setTrustedServerCertificates([trust_cert])
let hotspotConfig = NEHotspotConfiguration(ssid: SSID, eapSettings: eapSettings)
NEHotspotConfigurationManager.shared.apply(hotspotConfig) {[weak self] (error) in
guard let self = self else { return; }
if let error = error {
FlutterText.with(key: "errorConnectingHmgNetwork"){ localized in
self.complete(false,localized)
}
}else{
_ = Timer.scheduledTimer(withTimeInterval: 5, repeats: false) { (timer) in
self.hasInternet { (has) in
if has == true{
FlutterText.with(key: "connectedHmgNetworkWithInternet"){ localized in
self.complete(true,localized)
}
return
}else{
FlutterText.with(key: "connectedToHmgNetworkWithNoInternet"){ localized in
self.complete(false,localized)
}
}
}
}
}
}
}
}
private func isAlreadyConnected() -> Bool{
var currentSSID: String?
if let interfaces = CNCopySupportedInterfaces() as NSArray? {
for interface in interfaces {
if let interfaceInfo = CNCopyCurrentNetworkInfo(interface as! CFString) as NSDictionary? {
currentSSID = interfaceInfo[kCNNetworkInfoKeySSID as String] as? String
break
}
}
}
print("CurrentConnectedSSID: \(currentSSID)")
return currentSSID == SSID
}
private func getWifiCredentials(patientId:String, success: @escaping (() -> Void)){
if TEST {
success()
return
}
guard let url = API.WIFI_CREDENTIALS.toUrl() else { return assert(true, "Invalid URL: \(API.WIFI_CREDENTIALS)") }
// JSON Body for HTTP Request
let json: [String: Any] = ["PatientID": patientId]
let jsonData = try? JSONSerialization.data(withJSONObject: json)
var request = URLRequest(url: url, timeoutInterval: 20)
request.httpMethod = "POST"
request.setValue("application/json", forHTTPHeaderField: "Content-Type")
request.httpBody = jsonData
let task = URLSession.shared.dataTask(with: request) { data, response, error in
guard let data = data else {
self.somethingWentWrong()
return
}
if let responseJSON = try? JSONSerialization.jsonObject(with: data, options: []) as? [String: Any]{
if let requiredData = (responseJSON["Hmg_SMS_Get_By_ProjectID_And_PatientIDList"] as? [[String:Any]])?.first,
let userName = requiredData["UserName"] as? String, let password = requiredData["Password"] as? String{
USER = userName
PASS = password
success()
}else if let errorMessage = responseJSON["ErrorMessage"] as? String{
self.complete(false, errorMessage)
}else{
self.somethingWentWrong()
}
}else{
self.somethingWentWrong()
}
}
task.resume()
}
private func somethingWentWrong(){
FlutterText.with(key: "somethingWentWrong") { (localized) in
self.complete(false, localized)
}
}
func hasInternet( completion:@escaping ((Bool)->Void)){
let testUrl = "https://captive.apple.com"
var request = URLRequest(url: URL(string: testUrl)!,timeoutInterval: 5)
request.httpMethod = "GET"
let task = URLSession.shared.dataTask(with: request) { data, response, error in
guard let data = data else {
completion(false)
return
}
completion(
String(data: data, encoding: .utf8)!
.replacingOccurrences(of: " ", with: "")
.replacingOccurrences(of: "\n", with: "")
.lowercased()
.contains("<title>success</title>")
)
}
task.resume()
}
}

@ -0,0 +1,172 @@
//
// HMG_GUEST.swift
// HMG-iOS-Wifi
//
// Created by ZiKambrani on 23/03/1442 AH.
// Copyright © 1442 ZiKambrani. All rights reserved.
//
import UIKit
import NetworkExtension
import SystemConfiguration.CaptiveNetwork
fileprivate var TEST = true
fileprivate let SSID = "GUEST-POC"
fileprivate var USER = "0696"
fileprivate var PASS = "0000"
fileprivate func supportedEAPTypes() -> [NSNumber]{
let peap = NEHotspotEAPSettings.EAPType.EAPPEAP.rawValue
let fast = NEHotspotEAPSettings.EAPType.EAPFAST.rawValue
let tls = NEHotspotEAPSettings.EAPType.EAPTLS.rawValue
let ttls = NEHotspotEAPSettings.EAPType.EAPTTLS.rawValue
return [NSNumber(value: peap), NSNumber(value: fast), NSNumber(value: tls), NSNumber(value: ttls)]
}
class HMG_Internet{
static let shared = HMG_Wifi()
private var complete:((_ status:Bool, _ message:String) -> Void)!
func connect(patientId:String, completion:@escaping ((_ status:Bool, _ message:String) -> Void)){
complete = completion
if isAlreadyConnected() {
hasInternet { (has) in
if has == true{
self.complete(true, "You already connected to HMG network to access internet")
return
}else{
self.complete(false, "You are connected to HMG network but it have no internet access")
}
}
}else{
connect(patientId: patientId)
}
}
private func connect(patientId:String) {
getWifiCredentials(patientId: patientId) {
let trust_cert = Bundle.main.certificate(named: "GuestPOC_Certificate")
guard trust_cert.trust() == true else{
self.complete(false,"We are not able to connect you to HMG network due to security certificate")
return
}
let eapSettings = NEHotspotEAPSettings()
eapSettings.username = USER
eapSettings.password = PASS
eapSettings.trustedServerNames = ["*.hmg.com","onboard.hmg.com","hmg.com"]
eapSettings.supportedEAPTypes = [supportedEAPTypes().first!]
// eapSettings.isTLSClientCertificateRequired = true
// eapSettings.ttlsInnerAuthenticationType = .eapttlsInnerAuthenticationMSCHAPv2 // MSCHAPv2
// eapSettings.setIdentity(Bundle.main.identity(named: "GuestPOC_Certificate", password: "1"))
// eapSettings.setTrustedServerCertificates([trust_cert])
let hotspotConfig = NEHotspotConfiguration(ssid: SSID, eapSettings: eapSettings)
NEHotspotConfigurationManager.shared.apply(hotspotConfig) {[weak self] (error) in
guard let self = self else { return; }
if let error = error {
self.complete(false, "Error connecting to HMG network" /*error.localizedDescription*/ )
}else{
_ = Timer.scheduledTimer(withTimeInterval: 3, repeats: false) { (timer) in
self.hasInternet { (has) in
if has == true{
self.complete(true, "Successfully connected to the HMG network to access internet")
return
}else{
self.complete(false, "Successfully connected to the HMG network but it have no internet access")
}
}
}
}
}
}
}
private func isAlreadyConnected() -> Bool{
var currentSSID: String?
if let interfaces = CNCopySupportedInterfaces() as NSArray? {
for interface in interfaces {
if let interfaceInfo = CNCopyCurrentNetworkInfo(interface as! CFString) as NSDictionary? {
currentSSID = interfaceInfo[kCNNetworkInfoKeySSID as String] as? String
break
}
}
}
print("CurrentConnectedSSID: \(currentSSID)")
return currentSSID == SSID
}
private func getWifiCredentials(patientId:String, completion: @escaping (() -> Void)){
if TEST {
completion()
return
}
guard let url = API.WIFI_CREDENTIALS.toUrl() else { return assert(true, "Invalid URL: \(API.WIFI_CREDENTIALS)") }
// JSON Body for HTTP Request
let json: [String: Any] = ["PatientID": patientId]
let jsonData = try? JSONSerialization.data(withJSONObject: json)
var request = URLRequest(url: url, timeoutInterval: 20)
request.httpMethod = "POST"
request.setValue("application/json", forHTTPHeaderField: "Content-Type")
request.httpBody = jsonData
let task = URLSession.shared.dataTask(with: request) { data, response, error in
guard let data = data else {
self.complete(false, "Failed to get your internet credentials")
return
}
if let responseJSON = try? JSONSerialization.jsonObject(with: data, options: []) as? [String: Any]{
if let requiredData = responseJSON["Hmg_SMS_Get_By_ProjectID_And_PatientIDList"] as? [String:Any],
let userName = requiredData["UserName"] as? String, let password = requiredData["Password"] as? String{
USER = userName
PASS = password
completion()
}else if let errorMessage = responseJSON["ErrorMessage"] as? String{
self.complete(false, errorMessage)
}
}else{
self.complete(false, "Failed to get your internet credentials")
}
}
task.resume()
}
func hasInternet( completion:@escaping ((Bool)->Void)){
let testUrl = "https://captive.apple.com"
var request = URLRequest(url: URL(string: testUrl)!,timeoutInterval: 5)
request.httpMethod = "GET"
let task = URLSession.shared.dataTask(with: request) { data, response, error in
guard let data = data else {
completion(false)
return
}
completion(
String(data: data, encoding: .utf8)!
.replacingOccurrences(of: " ", with: "")
.replacingOccurrences(of: "\n", with: "")
.lowercased()
.contains("<title>success</title>")
)
}
task.resume()
}
}

@ -7,40 +7,33 @@ import 'package:diplomaticquarterapp/widgets/mobile-no/mobile_no.dart';
const MAX_SMALL_SCREEN = 660;
const BASE_URL = 'https://uat.hmgwebservices.com/';
const PING_SERVICE = 'Services/Weather.svc/REST/CheckConnectivity';
// const BASE_URL = 'https://hmgwebservices.com/';
const GET_PROJECT = 'Services/Lists.svc/REST/GetProject';
///Doctor
const GET_MY_DOCTOR =
'Services/Doctors.svc/REST/GetPatientDoctorAppointmentResult';
const GET_MY_DOCTOR = 'Services/Doctors.svc/REST/GetPatientDoctorAppointmentResult';
const GET_DOCTOR_PROFILE = 'Services/Doctors.svc/REST/GetDocProfiles';
const GET_DOCTOR_RATING = 'Services/Doctors.svc/REST/dr_GetAvgDoctorRating';
///Prescriptions
const PRESCRIPTIONS = 'Services/Patients.svc/REST/GetPrescriptionApptList';
const GET_PRESCRIPTIONS_ALL_ORDERS =
'Services/Patients.svc/REST/PatientER_GetPatientAllPresOrders';
const GET_PRESCRIPTION_REPORT =
'Services/Patients.svc/REST/INP_GetPrescriptionReport';
const SEND_PRESCRIPTION_EMAIL =
'Services/Notifications.svc/REST/SendPrescriptionEmail';
const GET_PRESCRIPTION_REPORT_ENH =
'Services/Patients.svc/REST/GetPrescriptionReport_enh';
const GET_PRESCRIPTIONS_ALL_ORDERS = 'Services/Patients.svc/REST/PatientER_GetPatientAllPresOrders';
const GET_PRESCRIPTION_REPORT = 'Services/Patients.svc/REST/INP_GetPrescriptionReport';
const SEND_PRESCRIPTION_EMAIL = 'Services/Notifications.svc/REST/SendPrescriptionEmail';
const GET_PRESCRIPTION_REPORT_ENH = 'Services/Patients.svc/REST/GetPrescriptionReport_enh';
///Lab Order
const GET_Patient_LAB_ORDERS = 'Services/Patients.svc/REST/GetPatientLabOrders';
const GET_Patient_LAB_SPECIAL_RESULT =
'Services/Patients.svc/REST/GetPatientLabSpecialResults';
const GET_Patient_LAB_RESULT =
'/Services/Patients.svc/REST/GetPatientLabResults';
const GET_Patient_LAB_SPECIAL_RESULT = 'Services/Patients.svc/REST/GetPatientLabSpecialResults';
const GET_Patient_LAB_RESULT = 'Services/Patients.svc/REST/GetPatientLabResults';
///
const GET_PATIENT_ORDERS = 'Services/Patients.svc/REST/GetPatientRadOrders';
const GET_PATIENT_ORDERS_DETAILS =
'Services/Patients.svc/REST/Rad_UpdatePatientRadOrdersToRead';
const GET_PATIENT_ORDERS_DETAILS = 'Services/Patients.svc/REST/Rad_UpdatePatientRadOrdersToRead';
const GET_RAD_IMAGE_URL = 'Services/Patients.svc/Rest/GetRadImageURL';
const SEND_RAD_REPORT_EMAIL =
'Services/Notifications.svc/REST/SendRadReportEmail';
const SEND_RAD_REPORT_EMAIL = 'Services/Notifications.svc/REST/SendRadReportEmail';
///Feedback
const SEND_FEEDBACK = 'Services/COCWS.svc/REST/InsertCOCItemInSPList';
@ -49,24 +42,17 @@ const GET_PATIENT_AppointmentHistory = 'Services'
'/Doctors.svc/REST/PateintHasAppoimentHistory';
///VITAL SIGN
const GET_PATIENT_VITAL_SIGN =
'Services/Doctors.svc/REST/Doctor_GetPatientVitalSign';
const GET_PATIENT_VITAL_SIGN = 'Services/Doctors.svc/REST/Doctor_GetPatientVitalSign';
///Er Nearest
const GET_NEAREST_HOSPITAL =
'Services/Patients.svc/REST/Patient_GetProjectAvgERWaitingTime';
const GET_NEAREST_HOSPITAL = 'Services/Patients.svc/REST/Patient_GetProjectAvgERWaitingTime';
///Er Nearest
const GET_AMBULANCE_REQUEST =
'Services/Patients.svc/REST/PatientER_RRT_GetAllTransportationMethod';
const GET_PATIENT_ALL_PRES_ORDERS =
'Services/Patients.svc/REST/PatientER_GetPatientAllPresOrders';
const GET_PICK_UP_REQUEST_BY_PRES_ORDER_ID =
'Services/Patients.svc/REST/PatientER_RRT_GetPickUpRequestByPresOrderID';
const UPDATE_PRESS_ORDER =
'Services/Patients.svc/REST/PatientER_UpdatePresOrder';
const INSERT_ER_INERT_PRES_ORDER =
'Services/Patients.svc/REST/PatientER_InsertPresOrder';
const GET_AMBULANCE_REQUEST = 'Services/Patients.svc/REST/PatientER_RRT_GetAllTransportationMethod';
const GET_PATIENT_ALL_PRES_ORDERS = 'Services/Patients.svc/REST/PatientER_GetPatientAllPresOrders';
const GET_PICK_UP_REQUEST_BY_PRES_ORDER_ID = 'Services/Patients.svc/REST/PatientER_RRT_GetPickUpRequestByPresOrderID';
const UPDATE_PRESS_ORDER = 'Services/Patients.svc/REST/PatientER_UpdatePresOrder';
const INSERT_ER_INERT_PRES_ORDER = 'Services/Patients.svc/REST/PatientER_InsertPresOrder';
///FindUs
const GET_FINDUS_REQUEST = 'Services/Lists.svc/REST/Get_HMG_Locations';
@ -75,15 +61,13 @@ const GET_FINDUS_REQUEST = 'Services/Lists.svc/REST/Get_HMG_Locations';
const GET_LIVECHAT_REQUEST = 'Services/Patients.svc/REST/GetPatientICProjects';
///babyInformation
const GET_BABYINFORMATION_REQUEST =
'Services/Community.svc/REST/GetBabyByUserID';
const GET_BABYINFORMATION_REQUEST = 'Services/Community.svc/REST/GetBabyByUserID';
///Get Baby By User ID
const GET_BABY_BY_USER_ID = 'Services/Community.svc/REST/GetBabyByUserID';
///userInformation
const GET_USERINFORMATION_REQUEST =
'Services/Community.svc/REST/GetUserInformation_New';
const GET_USERINFORMATION_REQUEST = 'Services/Community.svc/REST/GetUserInformation_New';
///addNewChild
const GET_NEWCHILD_REQUEST = 'Services/Community.svc/REST/CreateNewBaby';
@ -101,19 +85,15 @@ const GET_TABLE_REQUEST = 'Services/Community.svc/REST/CreateVaccinationTable';
const GET_CITIES_REQUEST = 'Services/Lists.svc/REST/GetAllCities';
///BloodDetails
const GET_BLOOD_REQUEST =
'services/PatientVarification.svc/REST/BloodDonation_GetBloodGroupDetails';
const GET_BLOOD_REQUEST = 'services/PatientVarification.svc/REST/BloodDonation_GetBloodGroupDetails';
///Reports
const REPORTS = 'Services/Doctors.svc/REST/GetPatientMedicalReportStatusInfo';
const INSERT_REQUEST_FOR_MEDICAL_REPORT =
'Services/Doctors.svc/REST/InsertRequestForMedicalReport';
const INSERT_REQUEST_FOR_MEDICAL_REPORT = 'Services/Doctors.svc/REST/InsertRequestForMedicalReport';
///Rate
const IS_LAST_APPOITMENT_RATED =
'Services/Doctors.svc/REST/IsLastAppoitmentRated';
const GET_APPOINTMENT_DETAILS_BY_NO =
'Services/MobileNotifications.svc/REST/GetAppointmentDetailsByApptNo';
const IS_LAST_APPOITMENT_RATED = 'Services/Doctors.svc/REST/IsLastAppoitmentRated';
const GET_APPOINTMENT_DETAILS_BY_NO = 'Services/MobileNotifications.svc/REST/GetAppointmentDetailsByApptNo';
const GET_QR_PARKING = 'Services/SWP.svc/REST/GetQRParkingByID';
@ -124,6 +104,9 @@ const GET_QR_PARKING = 'Services/SWP.svc/REST/GetQRParkingByID';
//URL to get clinic list
const GET_CLINICS_LIST_URL = "Services/lists.svc/REST/GetClinicCentralized";
//URL to get active appointment list
const GET_ACTIVE_APPOINTMENTS_LIST_URL = "Services/Doctors.svc/Rest/Dr_GetAppointmentActiveNumber";
//URL to get projects list
const GET_PROJECTS_LIST = 'Services/Lists.svc/REST/GetProject';
@ -131,100 +114,76 @@ const GET_PROJECTS_LIST = 'Services/Lists.svc/REST/GetProject';
const GET_DOCTORS_LIST_URL = "Services/Doctors.svc/REST/SearchDoctorsByTime";
//URL to dental doctors list
const GET_DENTAL_DOCTORS_LIST_URL =
"Services/Doctors.svc/REST/Dental_DoctorChiefComplaintMapping";
const GET_DENTAL_DOCTORS_LIST_URL = "Services/Doctors.svc/REST/Dental_DoctorChiefComplaintMapping";
//URL to get doctor free slots
const GET_DOCTOR_FREE_SLOTS = "Services/Doctors.svc/REST/GetDoctorFreeSlots";
//URL to insert appointment
const INSERT_SPECIFIC_APPOINTMENT =
"Services/Doctors.svc/REST/InsertSpecificAppointment";
const INSERT_SPECIFIC_APPOINTMENT = "Services/Doctors.svc/REST/InsertSpecificAppointment";
//URL to get patient share
const GET_PATIENT_SHARE =
"Services/Doctors.svc/REST/GetCheckinScreenAppointmentDetailsByAppointmentNO";
const GET_PATIENT_SHARE = "Services/Doctors.svc/REST/GetCheckinScreenAppointmentDetailsByAppointmentNO";
//URL to get patient appointment history
const GET_PATIENT_APPOINTMENT_HISTORY =
"Services/Doctors.svc/REST/PateintHasAppoimentHistory";
const GET_PATIENT_APPOINTMENT_HISTORY = "Services/Doctors.svc/REST/PateintHasAppoimentHistory";
//URL to get patient appointment curfew history
const GET_PATIENT_APPOINTMENT_CURFEW_HISTORY =
"Services/Doctors.svc/REST/AppoimentHistoryForCurfew";
const GET_PATIENT_APPOINTMENT_CURFEW_HISTORY = "Services/Doctors.svc/REST/AppoimentHistoryForCurfew";
//URL to confirm appointment
const CONFIRM_APPOINTMENT =
"Services/MobileNotifications.svc/REST/ConfirmAppointment";
const CONFIRM_APPOINTMENT = "Services/MobileNotifications.svc/REST/ConfirmAppointment";
const INSERT_VIDA_REQUEST =
"Services/ER_VirtualCall.svc/REST/PatientER_VidaRequestInseart";
const INSERT_VIDA_REQUEST = "Services/ER_VirtualCall.svc/REST/PatientER_VidaRequestInseart";
//URL to cancel appointment
const CANCEL_APPOINTMENT = "Services/Doctors.svc/REST/CancelAppointment";
//URL get appointment QR
const GENERATE_QR_APPOINTMENT =
"Services/Doctors.svc/REST/GenerateQRAppointmentNo";
const GENERATE_QR_APPOINTMENT = "Services/Doctors.svc/REST/GenerateQRAppointmentNo";
//URL send email appointment QR
const EMAIL_QR_APPOINTMENT =
"Services/Notifications.svc/REST/sendEmailForOnLineCheckin";
const EMAIL_QR_APPOINTMENT = "Services/Notifications.svc/REST/sendEmailForOnLineCheckin";
//URL check payment status
const CHECK_PAYMENT_STATUS =
"Services/PayFort_Serv.svc/REST/GetRequestStatusByRequestID";
const CHECK_PAYMENT_STATUS = "Services/PayFort_Serv.svc/REST/GetRequestStatusByRequestID";
//URL create advance payment
const CREATE_ADVANCE_PAYMENT = "Services/Doctors.svc/REST/CreateAdvancePayment";
const ADD_ADVANCE_NUMBER_REQUEST =
'Services/PayFort_Serv.svc/REST/AddAdvancedNumberRequest';
const HIS_CREATE_ADVANCE_PAYMENT = "Services/Patients.svc/REST/HIS_CreateAdvancePayment";
const ADD_ADVANCE_NUMBER_REQUEST = 'Services/PayFort_Serv.svc/REST/AddAdvancedNumberRequest';
const IS_ALLOW_ASK_DOCTOR =
'Services/Doctors.svc/REST/GetPatientDoctorAppointmentResult';
const GET_CALL_REQUEST_TYPE =
'Services/Doctors.svc/REST/GetCallRequestType_LOV';
const IS_ALLOW_ASK_DOCTOR = 'Services/Doctors.svc/REST/GetPatientDoctorAppointmentResult';
const GET_CALL_REQUEST_TYPE = 'Services/Doctors.svc/REST/GetCallRequestType_LOV';
const SEND_CALL_REQUEST = 'Services/Doctors.svc/REST/InsertCallInfo';
const GET_LIVECARE_CLINICS =
'Services/ER_VirtualCall.svc/REST/PatientER_GetClinics';
const GET_LIVECARE_CLINICS = 'Services/ER_VirtualCall.svc/REST/PatientER_GetClinics';
const GET_LIVECARE_SCHEDULE_CLINICS =
'Services/Doctors.svc/REST/PatientER_GetClinicsHaveSchedule';
const GET_LIVECARE_SCHEDULE_CLINICS = 'Services/Doctors.svc/REST/PatientER_GetClinicsHaveSchedule';
const GET_LIVECARE_SCHEDULE_CLINIC_DOCTOR_LIST =
'Services/Doctors.svc/REST/PatientER_GetDoctorByClinicID';
const GET_LIVECARE_SCHEDULE_CLINIC_DOCTOR_LIST = 'Services/Doctors.svc/REST/PatientER_GetDoctorByClinicID';
const GET_LIVECARE_SCHEDULE_DOCTOR_TIME_SLOTS =
'Services/Doctors.svc/REST/PatientER_GetDoctorFreeSlots';
const GET_LIVECARE_SCHEDULE_DOCTOR_TIME_SLOTS = 'Services/Doctors.svc/REST/PatientER_GetDoctorFreeSlots';
const INSERT_LIVECARE_SCHEDULE_APPOINTMENT =
'Services/Doctors.svc/REST/InsertSpecificAppoitmentForSchedule';
const INSERT_LIVECARE_SCHEDULE_APPOINTMENT = 'Services/Doctors.svc/REST/InsertSpecificAppoitmentForSchedule';
const GET_PATIENT_SHARE_LIVECARE =
"Services/Doctors.svc/REST/GetCheckinScreenAppointmentDetailsByAppointmentNOForLiveCare";
const GET_PATIENT_SHARE_LIVECARE = "Services/Doctors.svc/REST/GetCheckinScreenAppointmentDetailsByAppointmentNOForLiveCare";
const GET_LIVECARE_CLINIC_TIMING =
'Services/ER_VirtualCall.svc/REST/PatientER_GetClinicsServiceTimingsSchedule';
const GET_LIVECARE_CLINIC_TIMING = 'Services/ER_VirtualCall.svc/REST/PatientER_GetClinicsServiceTimingsSchedule';
const GET_ER_APPOINTMENT_FEES =
'Services/DoctorApplication.svc/REST/GetERAppointmentFees';
const GET_ER_APPOINTMENT_FEES = 'Services/DoctorApplication.svc/REST/GetERAppointmentFees';
const GET_ER_APPOINTMENT_TIME = 'Services/ER_VirtualCall.svc/REST/GetRestTime';
const ADD_NEW_CALL_FOR_PATIENT_ER =
'Services/DoctorApplication.svc/REST/NewCallForPatientER';
const ADD_NEW_CALL_FOR_PATIENT_ER = 'Services/DoctorApplication.svc/REST/NewCallForPatientER';
const GET_LIVECARE_HISTORY =
'Services/ER_VirtualCall.svc/REST/GetPatientErVirtualHistory';
const CANCEL_LIVECARE_REQUEST =
'Services/ER_VirtualCall.svc/REST/DeleteErRequest';
const SEND_LIVECARE_INVOICE_EMAIL =
'Services/Notifications.svc/REST/SendInvoiceForLiveCare';
const GET_LIVECARE_HISTORY = 'Services/ER_VirtualCall.svc/REST/GetPatientErVirtualHistory';
const CANCEL_LIVECARE_REQUEST = 'Services/ER_VirtualCall.svc/REST/DeleteErRequest';
const SEND_LIVECARE_INVOICE_EMAIL = 'Services/Notifications.svc/REST/SendInvoiceForLiveCare';
const GET_USER_TERMS = '/Services/Patients.svc/REST/GetUserTermsAndConditions';
const UPDATE_HEALTH_TERMS =
'/services/Patients.svc/REST/UpdatePateintHealthSummaryReport';
const UPDATE_HEALTH_TERMS = '/services/Patients.svc/REST/UpdatePateintHealthSummaryReport';
//URL to get medicine and pharmacies list
const CHANNEL = 3;
@ -236,20 +195,21 @@ const LANGUAGE = 2;
const PATIENT_OUT_SA = 0;
const SESSION_ID = 'TMRhVmkGhOsvamErw';
const IS_DENTAL_ALLOWED_BACKEND = false;
const PATIENT_TYPE = 1;
const PATIENT_TYPE_ID = 1;
const PATIENT_TYPE = 2;
const PATIENT_TYPE_ID = 2;
var DEVICE_TOKEN = "";
var DeviceTypeID = Platform.isIOS ? 1 : 2;
const LANGUAGE_ID = 2;
const GET_PHARMCY_ITEMS = "Services/Lists.svc/REST/GetPharmcyItems_Region";
const GET_PHARMACY_LIST = "Services/Patients.svc/REST/GetPharmcyList";
const GET_PAtIENTS_INSURANCE =
"Services/Patients.svc/REST/Get_PatientInsuranceDetails";
const GET_PAtIENTS_INSURANCE_UPDATED =
"Services/Patients.svc/REST/PatientER_GetPatientInsuranceCardUpdateHistory";
const GET_PAtIENTS_INSURANCE = "Services/Patients.svc/REST/Get_PatientInsuranceDetails";
const GET_PAtIENTS_INSURANCE_UPDATED = "Services/Patients.svc/REST/PatientER_GetPatientInsuranceCardUpdateHistory";
const INSURANCE_DETAILS = "Services/Patients.svc/REST/Get_InsuranceCheckList";
const GET_VACCINES = "Services/Patients.svc/REST/GetDoneVaccinesByPatientID";
const GET_VACCINES_EMAIL = "Services/Notifications.svc/REST/SendVaccinesEmail";
const GET_PAtIENTS_INSURANCE_APPROVALS =
"Services/Patients.svc/REST/GetApprovalStatus";
const GET_PAtIENTS_INSURANCE_APPROVALS = "Services/Patients.svc/REST/GetApprovalStatus";
const SEARCH_BOT = 'HabibiChatBotApi/BotInterface/GetVoiceCommandResponse';
const GET_VACCINATIONS_ITEMS = "/Services/ERP.svc/REST/GET_VACCINATIONS_ITEMS";
@ -259,59 +219,38 @@ const GET_PATIENT_SICK_LEAVE = 'Services/Patients.svc/REST/GetPatientSickLeave';
const SendSickLeaveEmail = 'Services/Notifications.svc/REST/SendSickLeaveEmail';
const GET_PATIENT_AdVANCE_BALANCE_AMOUNT =
'Services/Patients.svc/REST/GetPatientAdvanceBalanceAmount';
const GET_PATIENT_INFO_BY_ID =
'Services/Doctors.svc/REST/GetPatientInfoByPatientID';
const GET_PATIENT_INFO_BY_ID_AND_MOBILE_NUMBER =
'Services/Patients.svc/REST/AP_GetPatientInfoByPatientIDandMobileNumber';
const SEND_ACTIVATION_CODE_FOR_ADVANCE_PAYMENT =
'Services/Authentication.svc/REST/SendActivationCodeForAdvancePayment';
const CHECK_ACTIVATION_CODE_FOR_ADVANCE_PAYMENT =
'Services/Authentication.svc/REST/CheckActivationCodeForAdvancePayment';
const GET_PATIENT_AdVANCE_BALANCE_AMOUNT = 'Services/Patients.svc/REST/GetPatientAdvanceBalanceAmount';
const GET_PATIENT_INFO_BY_ID = 'Services/Doctors.svc/REST/GetPatientInfoByPatientID';
const GET_PATIENT_INFO_BY_ID_AND_MOBILE_NUMBER = 'Services/Patients.svc/REST/AP_GetPatientInfoByPatientIDandMobileNumber';
const SEND_ACTIVATION_CODE_FOR_ADVANCE_PAYMENT = 'Services/Authentication.svc/REST/SendActivationCodeForAdvancePayment';
const CHECK_ACTIVATION_CODE_FOR_ADVANCE_PAYMENT = 'Services/Authentication.svc/REST/CheckActivationCodeForAdvancePayment';
const GET_COVID_DRIVETHRU_PROJECT_LIST =
'Services/Doctors.svc/REST/COVID19_ProjectDriveThroughTestingCenter';
const GET_COVID_DRIVETHRU_PROJECT_LIST = 'Services/Doctors.svc/REST/COVID19_ProjectDriveThroughTestingCenter';
const GET_COVID_DRIVETHRU_PAYMENT_INFO =
'Services/Doctors.svc/REST/COVID19_GetPatientPaymentInormation';
const GET_COVID_DRIVETHRU_PAYMENT_INFO = 'Services/Doctors.svc/REST/COVID19_GetPatientPaymentInormation';
const GET_COVID_DRIVETHRU_FREE_SLOTS =
'Services/Doctors.svc/REST/COVID19_GetFreeSlots';
const GET_COVID_DRIVETHRU_FREE_SLOTS = 'Services/Doctors.svc/REST/COVID19_GetFreeSlots';
///Smartwatch Integration Services
const GET_PATIENT_LAST_RECORD =
'Services/Patients.svc/REST/Med_GetPatientLastRecord';
const GET_PATIENT_LAST_RECORD = 'Services/Patients.svc/REST/Med_GetPatientLastRecord';
///My Trackers
const GET_DIABETIC_RESULT_AVERAGE =
'Services/Patients.svc/REST/Patient_GetDiabeticResultAverage';
const GET_DIABTEC_RESULT =
'Services/Patients.svc/REST/Patient_GetDiabtecResults';
const ADD_DIABTEC_RESULT =
'Services/Patients.svc/REST/Patient_AddDiabtecResult';
const GET_BLOOD_PRESSURE_RESULT_AVERAGE =
'Services/Patients.svc/REST/Patient_GetBloodPressureResultAverage';
const GET_BLOOD_PRESSURE_RESULT =
'Services/Patients.svc/REST/Patient_GetBloodPressureResult';
const ADD_BLOOD_PRESSURE_RESULT =
'Services/Patients.svc/REST/Patient_AddBloodPressureResult';
const GET_WEIGHT_PRESSURE_RESULT_AVERAGE =
'Services/Patients.svc/REST/Patient_GetWeightMeasurementResultAverage';
const GET_WEIGHT_PRESSURE_RESULT =
'Services/Patients.svc/REST/Patient_GetWeightMeasurementResult';
const ADD_WEIGHT_PRESSURE_RESULT =
'Services/Patients.svc/REST/Patient_AddWeightMeasurementResult';
const ADD_ACTIVE_PRESCRIPTIONS_REPORT_BY_PATIENT_ID =
'Services/Patients.svc/Rest/GetActivePrescriptionReportByPatientID';
const GET_CALL_INFO_HOURS_RESULT =
'Services/Doctors.svc/REST/GetCallInfoHoursResult';
const GET_CALL_REQUEST_TYPE_LOV =
'Services/Doctors.svc/REST/GetCallRequestType_LOV';
const GET_DIABETIC_RESULT_AVERAGE = 'Services/Patients.svc/REST/Patient_GetDiabeticResultAverage';
const GET_DIABTEC_RESULT = 'Services/Patients.svc/REST/Patient_GetDiabtecResults';
const ADD_DIABTEC_RESULT = 'Services/Patients.svc/REST/Patient_AddDiabtecResult';
const GET_BLOOD_PRESSURE_RESULT_AVERAGE = 'Services/Patients.svc/REST/Patient_GetBloodPressureResultAverage';
const GET_BLOOD_PRESSURE_RESULT = 'Services/Patients.svc/REST/Patient_GetBloodPressureResult';
const ADD_BLOOD_PRESSURE_RESULT = 'Services/Patients.svc/REST/Patient_AddBloodPressureResult';
const GET_WEIGHT_PRESSURE_RESULT_AVERAGE = 'Services/Patients.svc/REST/Patient_GetWeightMeasurementResultAverage';
const GET_WEIGHT_PRESSURE_RESULT = 'Services/Patients.svc/REST/Patient_GetWeightMeasurementResult';
const ADD_WEIGHT_PRESSURE_RESULT = 'Services/Patients.svc/REST/Patient_AddWeightMeasurementResult';
const ADD_ACTIVE_PRESCRIPTIONS_REPORT_BY_PATIENT_ID = 'Services/Patients.svc/Rest/GetActivePrescriptionReportByPatientID';
const GET_CALL_INFO_HOURS_RESULT = 'Services/Doctors.svc/REST/GetCallInfoHoursResult';
const GET_CALL_REQUEST_TYPE_LOV = 'Services/Doctors.svc/REST/GetCallRequestType_LOV';
const GET_DOCTOR_RESPONSE = 'Services/Patients.svc/REST/GetDoctorResponse';
const UPDATE_READ_STATUS = 'Services/Patients.svc/REST/UpdateReadStatus';
const INSERT_CALL_INFO = 'Services/Doctors.svc/REST/InsertCallInfo';
@ -319,18 +258,13 @@ const INSERT_CALL_INFO = 'Services/Doctors.svc/REST/InsertCallInfo';
const GET_PATIENT_ALLERGIES = 'Services/Patients.svc/REST/GetPatientAllergies';
// H2O
const H2O_GET_USER_PROGRESS =
"Services/H2ORemainder.svc/REST/H2O_GetUserProgress";
const H2O_INSERT_USER_ACTIVITY =
"Services/H2ORemainder.svc/REST/H2O_InsertUserActivity";
const H2O_GET_USER_PROGRESS = "Services/H2ORemainder.svc/REST/H2O_GetUserProgress";
const H2O_INSERT_USER_ACTIVITY = "Services/H2ORemainder.svc/REST/H2O_InsertUserActivity";
//E_Referral Services
const GET_ALL_RELATIONSHIP_TYPES =
"Services/Patients.svc/REST/GetAllRelationshipTypes";
const SEND_ACTIVATION_CODE_FOR_E_REFERRAL =
'Services/Authentication.svc/REST/SendActivationCodeForEReferral';
const CHECK_ACTIVATION_CODE_FOR_E_REFERRAL =
'Services/Authentication.svc/REST/CheckActivationCodeForEReferral';
const GET_ALL_RELATIONSHIP_TYPES = "Services/Patients.svc/REST/GetAllRelationshipTypes";
const SEND_ACTIVATION_CODE_FOR_E_REFERRAL = 'Services/Authentication.svc/REST/SendActivationCodeForEReferral';
const CHECK_ACTIVATION_CODE_FOR_E_REFERRAL = 'Services/Authentication.svc/REST/CheckActivationCodeForEReferral';
const GET_ALL_CITIES = 'services/Lists.svc/rest/GetAllCities';
const CREATE_E_REFERRAL = "Services/Patients.svc/REST/CreateEReferral";
const GET_E_REFERRALS = "Services/Patients.svc/REST/GetEReferrals";
@ -343,18 +277,14 @@ const GET_PHARMACY_PRODUCTs_BY_IDS = "epharmacy/api/productsbyids/";
const GET_CUSTOMERS_ADDRESSES = "epharmacy/api/Customers/";
// Home Health Care
const HHC_GET_ALL_SERVICES =
"Services/Patients.svc/REST/PatientER_HHC_GetAllServices";
const HHC_GET_ALL_CMC_SERVICES =
"Services/Patients.svc/REST/PatientER_CMC_GetAllServices";
const PATIENT_ER_UPDATE_PRES_ORDER =
"Services/Patients.svc/REST/PatientER_UpdatePresOrder";
const GET_ORDER_DETAIL_BY_ID =
"Services/Patients.svc/REST/PatientER_HHC_GetTransactionsForOrder";
const GET_CMC_ORDER_DETAIL_BY_ID =
"Services/Patients.svc/REST/PatientER_CMC_GetTransactionsForOrder";
const HHC_GET_ALL_SERVICES = "Services/Patients.svc/REST/PatientER_HHC_GetAllServices";
const HHC_GET_ALL_CMC_SERVICES = "Services/Patients.svc/REST/PatientER_CMC_GetAllServices";
const PATIENT_ER_UPDATE_PRES_ORDER = "Services/Patients.svc/REST/PatientER_UpdatePresOrder";
const GET_ORDER_DETAIL_BY_ID = "Services/Patients.svc/REST/PatientER_HHC_GetTransactionsForOrder";
const GET_CMC_ORDER_DETAIL_BY_ID = "Services/Patients.svc/REST/PatientER_CMC_GetTransactionsForOrder";
const GET_CHECK_UP_ITEMS = "Services/Patients.svc/REST/GetCheckUpItems";
const PUSH_NOTIFICATION_GET_ALL_NOTIFICATIONS = 'Services/MobileNotifications.svc/REST/PushNotification_GetAllNotifications';
const PUSH_NOTIFICATION_SET_MESSAGES_FROM_POOL_AS_READ = 'Services/MobileNotifications.svc/REST/PushNotification_SetMessagesFromPoolAsRead';
const TIMER_MIN = 10;
const GOOGLE_API_KEY = "AIzaSyCmevVlr2Bh-c8W1VUzo8gt8JRY7n5PANw";

@ -1,4 +1,28 @@
const Map<String, Map<String, String>> localizedValues = {
// --------- - -- - - - - - - - - ----------------
// Used for Native through Platform Method Channel
// --------- - -- - - - - - - - - ----------------
const Map platformLocalizedValues = {
"errorConnectingHmgNetwork": {"en": "Sorry you are not connecting to HMG network", "ar": "نعتذر لست متصل في شكبة مستشفى د.سليمان الحبيب"},
"successConnectingHmgNetwork": {"en": "You connected to HMG network successfully, you can access the app", "ar": "تم التصال بشبكة د.سليمان الحبيب بنجاح, تستطيع الان استخدام تطبيق الحبيب"},
"failedConnectingHmgNetwork": {
"en": "Sorry the connection to HMG network had been failed, make sure you are in range of HMG network",
"ar": "نعتذر لقد فشل الاتصال بشبكة د.سليمان الحبيب, تاكد من وجودك داخل نطاق الشبكة"
},
"alreadyConnectedHmgNetwork": {"en": " You already connected to HMG network to access Alhabib app", "ar": "انت متصل مسبقاً بالشبكة تستطيع استخدام تطبيق الحبيب"},
"somethingWentWrong": {"en": "Sorry something went wrong please try again later", "ar": "نعتذر لخدمتكم يرجى المحاولة لاحقا"},
"enablingWifi": {"en": "Enabling wifi...", "ar": "Enabling wifi..."},
"connectedHmgNetworkWithInternet": {"en": "Successfully connected to the HMG network to access internet", "ar": "Successfully connected to the HMG network to access internet"},
"connectedToHmgNetworkWithNoInternet": {
"en": "Successfully connected to the HMG network but it have no internet access",
"ar": "Successfully connected to the HMG network but it have no internet access"
},
"notConnectedToHmgNetworkSecurityIssue": {
"en": "We are not able to connect you to HMG network due to security reasons",
"ar": "We are not able to connect you to HMG network due to security reasons"
}
};
const Map localizedValues = {
'dashboardScreenToolbarTitle': {'ar': 'الرئيسة', 'en': 'Home'},
'settings': {'en': 'Settings', 'ar': 'الاعدادات'},
'language': {'en': 'App Language', 'ar': 'لغة التطبيق'},
@ -21,10 +45,7 @@ const Map<String, Map<String, String>> localizedValues = {
'clinicName': {'en': 'Clinic Name', 'ar': 'اسم العيادة'},
'doctorName': {'en': 'Doctor Name', 'ar': 'إسم الطبيب'},
'nearestAppo': {'en': 'Nearest appointment', 'ar': 'أقرب موعد'},
'searchByDocText': {
'en': 'Type the name of the doctor to help you find him',
'ar': 'اكتب اسم الطبيب لمساعدتك في العثور عليه'
},
'searchByDocText': {'en': 'Type the name of the doctor to help you find him', 'ar': 'اكتب اسم الطبيب لمساعدتك في العثور عليه'},
'enterDocName': {'en': 'Enter Doctor name', 'ar': 'أدخل إسم الطبيب'},
'search': {'en': 'Search', 'ar': 'بحث'},
'bookNow': {'en': 'BOOK NOW', 'ar': 'احجز الآن'},
@ -34,17 +55,11 @@ const Map<String, Map<String, String>> localizedValues = {
'gender': {'en': 'Gender', 'ar': 'الجنس'},
'nationality': {'en': 'Nationality', 'ar': 'الجنسية'},
'docQualifications': {'en': 'Doctor Qualifications', 'ar': 'مؤهلات الطبيب'},
'confirmAppoHeading': {
'en': 'Kindly confirm your Appointment',
'ar': 'يرجى تأكيد موعدك'
},
'confirmAppoHeading': {'en': 'Kindly confirm your Appointment', 'ar': 'يرجى تأكيد موعدك'},
'patientInfo': {'en': 'Patient Information', 'ar': 'معلومات المريض'},
'bookSuccess': {'en': 'Book Success', 'ar': 'تم حجز الموعد بنجاح'},
'patientShare': {'en': 'Patient Share', 'ar': 'المبلغ المستحق'},
'patientShareWithTax': {
'en': 'Patient Share with Tax',
'ar': 'المبلغ الإجمالي المستحق'
},
'patientShareWithTax': {'en': 'Patient Share with Tax', 'ar': 'المبلغ الإجمالي المستحق'},
'confirmAppo': {'en': 'Confirm Appointment', 'ar': 'تأكيد الموعد'},
'confirm': {'en': 'Confirm', 'ar': 'تأكيد'},
'confirmLiveCare': {'en': 'Confirm LiveCare', 'ar': 'تأكيد لايف كير'},
@ -61,41 +76,15 @@ const Map<String, Map<String, String>> localizedValues = {
'instruction': {'en': 'Instructions', 'ar': 'تعليمات'},
'livecare': {'en': 'LiveCare', 'ar': 'لايف كير'},
'livecareAppo': {'en': 'LiveCare Appointment', 'ar': 'الموعد لايف كير'},
'cancelAppoMsg': {
'en': 'Are you sure you want to cancel this appointment?',
'ar': 'هل أنت متأكد أنك تريد إلغاء هذا الموعد؟'
},
'cancelAppoMsg': {'en': 'Are you sure you want to cancel this appointment?', 'ar': 'هل أنت متأكد أنك تريد إلغاء هذا الموعد؟'},
'upcoming-noAction': {
'en': 'No Action Required',
'ar': 'لا يوجد إجراء مطلوب'
},
'upcoming-confirm': {
'en': 'Please confirm the appointment to avoid cancellation',
'ar': 'يرجى تأكيد الموعد لتفادي الإلغاء'
},
'upcoming-payment-pending': {
'en':
'Online Payment will be Activated before 24 Hours of Appointment Time',
'ar': 'سيتم تفعيل خدمة الدفع الالكتروني قبل 24 ساعة من موعد الحجز'
},
'upcoming-payment-now': {
'en': 'Pay Online now to avoid long waiting queue',
'ar': 'ادفع الآن لتفادي الانتظار'
},
'upcoming-QR': {
'en': 'Use the QR Code to Check-In in hospital',
'ar': 'استخدم الرمز لتسجيل الحضور في المستشفى'
},
'upcoming-virtual': {
'en':
'This is a virtual appointment, Please adhere to the instructions for a seamless experience.',
'ar': 'هذا موعد اتصال مرئي عن بعد ، يرجى اتباع تعليمات الخدمة.'
},
'upcoming-livecare': {
'en': 'This is a LiveCare appointment',
'ar': 'هذا موعد لايف كير'
},
'upcoming-noAction': {'en': 'No Action Required', 'ar': 'لا يوجد إجراء مطلوب'},
'upcoming-confirm': {'en': 'Please confirm the appointment to avoid cancellation', 'ar': 'يرجى تأكيد الموعد لتفادي الإلغاء'},
'upcoming-payment-pending': {'en': 'Online Payment will be Activated before 24 Hours of Appointment Time', 'ar': 'سيتم تفعيل خدمة الدفع الالكتروني قبل 24 ساعة من موعد الحجز'},
'upcoming-payment-now': {'en': 'Pay Online now to avoid long waiting queue', 'ar': 'ادفع الآن لتفادي الانتظار'},
'upcoming-QR': {'en': 'Use the QR Code to Check-In in hospital', 'ar': 'استخدم الرمز لتسجيل الحضور في المستشفى'},
'upcoming-virtual': {'en': 'This is a virtual appointment, Please adhere to the instructions for a seamless experience.', 'ar': 'هذا موعد اتصال مرئي عن بعد ، يرجى اتباع تعليمات الخدمة.'},
'upcoming-livecare': {'en': 'This is a LiveCare appointment', 'ar': 'هذا موعد لايف كير'},
'upcoming-details': {'en': 'More Details', 'ar': 'المزيد'},
'reschedule': {'en': 'Reschedule', 'ar': 'إعادة جدولة'},
'raise': {'en': 'Raise', 'ar': 'رفع'},
@ -109,46 +98,30 @@ const Map<String, Map<String, String>> localizedValues = {
'set-reminder': {'en': 'Set Reminder', 'ar': 'تعيين تذكير'},
'login': {'en': 'Login', 'ar': 'تسجيل الدخول'},
'loginregister': {'en': 'Login / Register', 'ar': 'دخولتسجيل'},
'welcome': {'en': 'Welcome', 'ar': 'أهلا بك'},
'welcome_text': {
'en': 'Dr. Sulaiman Al Habib Mobile Application ',
'ar': 'الدكتور سليمان الحبيب لتطبيقات الهاتف المتحرك'
},
'welcome_text2': {
'en': 'Have you visited AlHabib Medical Group before? ',
'ar': 'الدكتور سليمان الحبيب لتطبيقات الهاتف المتحرك'
},
'loginregister': {'en': 'Login / Register', 'ar': 'تسجيل الدخول'},
'poweredBy': {'en': 'Powered By', 'ar': 'مشغل بواسطة'},
"welcome": {"en": "Welcome", "ar": "مرحبا"},
"welcome_text": {"en": "Dr. Sulaiman Al Habib Mobile Application", "ar": "الدكتور سليمان الحبيب لتطبيقات الهاتف المتحرك"},
'welcome_text2': {'en': 'Have you visited AlHabib Medical Group before? ', 'ar': 'هل قمت بزيارة مجموعة الحبيب الطبية من قبل؟'},
'yes': {'en': 'Yes', 'ar': 'نعم'},
'no': {'en': 'No', 'ar': 'لا'},
"logintyperadio": {
"en": "Choose from below options to login to your medical file.",
"ar": "اختر من الخيارات أدناه لتسجيل الدخول إلى ملفك الطبي."
},
"logintyperadio": {"en": "Choose from below options to login to your medical file.", "ar": "اختر من الخيارات أدناه لتسجيل الدخول إلى ملفك الطبي."},
"registernow": {"en": "Register Now", "ar": "تسجيل الان"},
"nationalID": {"en": "National ID", "ar": "رقم الهوية"},
"nationalID": {"en": "Enter the Identification Number", "ar": "أدخل رقم الهوية الوطنية او الاقامة"},
"national-id": {"en": "National ID", "ar": "رقم الهوية"},
"fileNo": {"en": "File Number", "ar": "رقم الملف"},
"fileno": {"en": "File No", "ar": "رقم الملف"},
"forgotFileNo": {"en": "Forgot file Number?", "ar": "نسيت رقم الملف الطبي؟"},
"enter-national-id": {
"en": "Please enter mobile number and national ID / Iqama",
"ar": "الرجاء إدخال رقم الجوال والهوية الوطنية / الاقامة"
},
"profile-info": {
"en": "Please enter profile information",
"ar": "الرجاء إدخال معلومات الملف الشخصي"
},
"forgotFileNoTitle": {"en": "Forgot medical file Number", "ar": "نسيت رقم الملف"},
"enter-national-id": {"en": "Please enter mobile number and identification number", "ar": "الرجاء إدخال رقم الجوال ورقم الهوية"},
"profile-info": {"en": "Please enter profile information", "ar": "الرجاء إدخال معلومات الملف الشخصي"},
"submit": {"en": "Submit", "ar": "ارسال"},
"forgot-desc": {
"en": "Enter the mobile number to receive the Medical file Number via SMS",
"ar": "أدخل رقم الجوال المسجل لاستلام رقم الملف عن طريق الرسائل النصية"
},
"forgot-desc": {"en": "Enter the mobile number to receive the Medical file Number via SMS", "ar": "أدخل رقم الجوال المسجل لاستلام رقم الملف عن طريق الرسائل النصية"},
"dob": {"en": "Birth Date:", "ar": "تاريخ الميلاد"},
"hijri-date": {"en": "Hijri Date", "ar": "التاريخ الهجري"},
"gregorian-date": {"en": "Gregorian Date", "ar": "التاريخ الميلادي"},
"verify-login-with": {
"en": "Please choose one of the following options to verify",
"ar": "الرجاء اختيار احدى الخيارات التالية للتحقق من البيانات"
},
"verify-login-with": {"en": "Please choose one of the following options to verify", "ar": "الرجاء اختيار احدى الخيارات التالية للتحقق من البيانات"},
"register-user": {"en": "Register", "ar": "تسجيل"},
"verify-with-fingerprint": {"en": "Fingerprint", "ar": "بصمة"},
"verify-with-faceid": {"en": "Face ID", "ar": "معرف الوجه"},
@ -157,32 +130,18 @@ const Map<String, Map<String, String>> localizedValues = {
"last-login": {"en": "LAST LOGIN AT:", "ar": "آخر تسجيل دخول"},
"last-login-with": {"en": "VERIFICATION TYPE:", "ar": "نوع التحقق:"},
"verify-fingerprint": {
"en":
"To activate the fingerprint login service, please verify data by using one of the following options.",
"ar":
"لتفعيل خدمة الدخول بالبصمة، يرجى اختيار احدى القنوات التالية للتحقق من البيانات"
"en": "To activate the fingerprint login service, please verify data by using one of the following options.",
"ar": "لتفعيل خدمة الدخول بالبصمة، يرجى اختيار احدى القنوات التالية للتحقق من البيانات"
},
'searchMedicine': {'en': 'Search Medicine', 'ar': 'البحث عن الدواء'},
'pharmaciesList': {'en': 'Pharmacies List', 'ar': 'قائمة الصيدلايات'},
'searchMedicineHere': {
'en': 'Search Medicine Here',
'ar': 'ابحث عن الدواء هنا'
},
'searchMedicineHere': {'en': 'Search Medicine Here', 'ar': 'ابحث عن الدواء هنا'},
'description': {'en': 'Description', 'ar': 'الوصف'},
'price': {'en': 'Price', 'ar': 'السعر'},
'youCanFindItIn': {'en': 'You can find it in', 'ar': 'يمكنكة ان تجده في'},
'pleaseEnterMedicineName': {
'en': 'Please Enter Medicine Name',
'ar': 'الرجائ ادخال اسم الدواء'
},
"verification_message": {
"en": "Please enter verification code",
"ar": "الرجاء إدخال رمز التحقق"
},
"validation_message": {
"en": "The verification code expires in",
"ar": "تنتهي صلاحية رمز التحقق خلال"
},
'pleaseEnterMedicineName': {'en': 'Please Enter Medicine Name', 'ar': 'الرجائ ادخال اسم الدواء'},
"verification_message": {"en": "Please enter verification code", "ar": "الرجاء إدخال رمز التحقق"},
"validation_message": {"en": "The verification code expires in", "ar": "تنتهي صلاحية رمز التحقق خلال"},
"arabic-change": {"en": "عربي", "ar": "English"},
"notification": {"en": "Notifications", "ar": "إشعارات"},
"app-settings": {"en": "App Settings", "ar": "إعدادات التطبيق"},
@ -190,80 +149,31 @@ const Map<String, Map<String, String>> localizedValues = {
"before": {"en": "Before", "ar": "قبل"},
"minute": {"en": "Minutes", "ar": "دقيقة"},
"hour": {"en": "Hour", "ar": "ساعة"},
"reminderSuccess": {
"en": "The reminder has been added successfully",
"ar": "يضاف التذكير بنجاح"
},
"patientShareToDo": {
"en": "Amount before tax: ",
"ar": "المبلغ قبل الضريبة:"
},
"reminderSuccess": {"en": "The reminder has been added successfully", "ar": "يضاف التذكير بنجاح"},
"patientShareToDo": {"en": "Amount before tax: ", "ar": "المبلغ قبل الضريبة:"},
"patientTaxToDo": {"en": "Tax amount: ", "ar": "قيمة الضريبة:"},
"patientShareTotalToDo": {
"en": "Total amount Due: ",
"ar": "المبلغ الإجمالي المستحق:"
},
"patientShareTotalToDo": {"en": "Total amount Due: ", "ar": "المبلغ الإجمالي المستحق:"},
'paymentMethod': {'en': 'Payment Method', 'ar': 'طريقة الدفع او السداد'},
'noNeedToWaitInLine': {
'en': 'No need to stand in line.',
'ar': 'لا داعي للوقوف في الطابور.'
},
'useQRAppoAttend': {
'en': 'Use the QR code to register the appointment attendance.',
'ar': 'استخدم الكود لتسجيل الحضور في المستشفى.'
},
'passQRAppoAttend': {
'en':
'Pass the QR code through the attendance devices available in the Hospital.',
'ar': 'تمرير الكود من خلال اجهزة تسجيل الحضور المتوفرة في الفرع.'
},
'sitWaitingQR': {
'en': 'Sit in the waiting rooms until called by the nurse.',
'ar': 'الجلوس في غرف الانتظار لحين منادتك من قبل الممرضة.'
},
'attendRegisterCode': {
'en': 'Attendance registration code',
'ar': 'رمز تسجيل الحضور'
},
'scanQRHospital': {
'en': 'Scan above QR Code to Check-In on the Machine in Hospital',
'ar': 'مسح فوق رمز الاستجابة السريعة للتحقق في الجهاز في المستشفى'
},
'noNeedToWaitInLine': {'en': 'No need to stand in line.', 'ar': 'لا داعي للوقوف في الطابور.'},
'useQRAppoAttend': {'en': 'Use the QR code to register the appointment attendance.', 'ar': 'استخدم الكود لتسجيل الحضور في المستشفى.'},
'passQRAppoAttend': {'en': 'Pass the QR code through the attendance devices available in the Hospital.', 'ar': 'تمرير الكود من خلال اجهزة تسجيل الحضور المتوفرة في الفرع.'},
'sitWaitingQR': {'en': 'Sit in the waiting rooms until called by the nurse.', 'ar': 'الجلوس في غرف الانتظار لحين منادتك من قبل الممرضة.'},
'attendRegisterCode': {'en': 'Attendance registration code', 'ar': 'رمز تسجيل الحضور'},
'scanQRHospital': {'en': 'Scan above QR Code to Check-In on the Machine in Hospital', 'ar': 'مسح فوق رمز الاستجابة السريعة للتحقق في الجهاز في المستشفى'},
"sendEmail": {"en": "Send Email", "ar": "ارسال نسخة"},
"EmailSentSuccessfully": {
"en": "Email Sent Successfully",
"ar": "تم إرسال البريد الإلكتروني بنجاح"
},
"EmailSentSuccessfully": {"en": "Email Sent Successfully", "ar": "تم إرسال البريد الإلكتروني بنجاح"},
"close": {"en": "Close", "ar": "مغلق"},
"booked": {"en": "Booked", "ar": "محجوز"},
"confirmed": {"en": "Confirmed", "ar": "مؤكد"},
"arrived": {"en": "Arrived", "ar": "تم الحضور"},
"payNowBookSuccess": {
"en": "Pay now via Al Habib App",
"ar": "ادفع الآن عبر تطبيق الحبيب"
},
"payNowBookSuccesstext1": {
"en": "Pay Now using online payment service From secure payment gateways",
"ar": "ادفع الآن باستخدام خدمة الدفع عبر الإنترنت من بوابات الدفع الآمنة"
},
"payNowBookSuccesstext2": {
"en": "You can also Pay Later via online payment Or in Hospital",
"ar": "يمكنك أيضًا الدفع لاحقًا عبر الدفع عبر الإنترنت أو في المستشفى"
},
"payNowBookSuccess": {"en": "Pay now via Al Habib App", "ar": "ادفع الآن عبر تطبيق الحبيب"},
"payNowBookSuccesstext1": {"en": "Pay Now using online payment service From secure payment gateways", "ar": "ادفع الآن باستخدام خدمة الدفع عبر الإنترنت من بوابات الدفع الآمنة"},
"payNowBookSuccesstext2": {"en": "You can also Pay Later via online payment Or in Hospital", "ar": "يمكنك أيضًا الدفع لاحقًا عبر الدفع عبر الإنترنت أو في المستشفى"},
'payLater': {'en': 'Pay Later', 'ar': 'ادفع لاحقا'},
'askDocNotAllowed': {
'en': 'This service will be available for last 15 days doctor Visit only',
'ar': 'هذه الخدمة متاحة للزيارات خلال اخر 15 يوم فقط'
},
"more-verify": {
"en": "More Verification Options",
"ar": "المزيد من خيارات التحقق"
},
'askDocNotAllowed': {'en': 'This service will be available for last 15 days doctor Visit only', 'ar': 'هذه الخدمة متاحة للزيارات خلال اخر 15 يوم فقط'},
"more-verify": {"en": "More Verification Options", "ar": "المزيد من خيارات التحقق"},
"welcome-back": {"en": "Welcome back!", "ar": "مرحبا بعودتك!"},
"account-info": {
"en": "Would you like to login with current username?",
"ar": "هل ترغب في تسجيل الدخول باسم المستخدم الحالي؟"
},
"account-info": {"en": "Would you like to login with current username?", "ar": "هل ترغب في تسجيل الدخول باسم المستخدم الحالي؟"},
"another-acc": {"en": "Use Another Account", "ar": "استخدم حسابا آخر"},
"next": {"en": "Next", "ar": 'التالى'},
"first-name": {"en": "First Name", "ar": "الاسم الأول"},
@ -274,15 +184,13 @@ const Map<String, Map<String, String>> localizedValues = {
"preferred-language": {"en": "Preferred Language", "ar": "اللغة المفضلة"},
"english": {"en": "English", "ar": "الإنجليزية"},
"arabic": {"en": "Arabic", "ar": "العربية"},
"locations-register": {
"en": "Where do you want to create this file?",
"ar": "أين تريد فتح هذا الملف؟"
},
"locations-register": {"en": "Where do you want to create this file?", "ar": "أين تريد فتح هذا الملف؟"},
"ksa": {"en": "KSA", "ar": "السعودية"},
"dubai": {"en": "Dubai", "ar": "دبي"},
"enter-email": {"en": "Enter Email", "ar": "ادخل البريد الالكتروني"},
"family": {"en": "My Family", "ar": "عائلتي"},
"family-title": {"en": "My Family Files", "ar": "ملفات العائلة"},
"myFamily": {"en": "My Family", "ar": "ملفات العائلة"},
"add-new-member": {"en": "Add Family Member", "ar": "إضافة عضو جديد"},
"sent-requests": {"en": "Sent Requests", "ar": "الطلبات المرسلة"},
"recieved-requests": {"en": "Recieved Requests", "ar": "الطلبات المستلمة"},
@ -315,10 +223,7 @@ const Map<String, Map<String, String>> localizedValues = {
"procedureStatus": {"en": "Procedure Status: ", "ar": "حالة الاجراء"},
"usageStatus": {"en": "Usage Status", "ar": "جالة الاستخدام"},
"unusedCount": {"en": "Unused Count: ", "ar": "غير مستخدم: "},
"totalApproval": {
"en": "Total approval unused",
"ar": "اجمالي الموافقات الغير مستخدمة"
},
"totalApproval": {"en": "Total approval unused", "ar": "اجمالي الموافقات الغير مستخدمة"},
"category": {"en": "Category: ", "ar": "الفئة"},
"expirationDate": {"en": "Expiration Date: ", "ar": "تاريخ الانتهاء"},
"patientCard": {"en": "Patient Card ID: ", "ar": "رقم الاشتراك"},
@ -326,68 +231,33 @@ const Map<String, Map<String, String>> localizedValues = {
"seeDetails": {"en": "SEE DETAILS", "ar": "منافعك التامينية"},
"insuranceCards": {"en": "Insurance Cards", "ar": "بطاقات التأمين"},
"requestType": {"en": "Request Type", "ar": "نوع الاستفسار"},
"register-info-family": {
"en": "How would like to add the new member?",
"ar": "كيف ترغب باضافة العضو الجديد؟"
},
"remove-family-member": {
"en": "Remove this member?",
"ar": "إزالة ملف العضو؟"
},
"register-info-family": {"en": "How would like to add the new member?", "ar": "كيف ترغب باضافة العضو الجديد؟"},
"remove-family-member": {"en": "Remove this member?", "ar": "إزالة ملف العضو؟"},
"MyMedicalFile": {"en": "My Medical File", 'ar': 'ملف الطبي الالكتروني'},
"myMedicalFileSubTitle": {
"en": "All your medical records",
'ar': 'جميع سجلاتك البية'
},
"myMedicalFileSubTitle": {"en": "All your medical records", 'ar': 'جميع سجلاتك الطبية'},
"viewMore": {"en": "View More", 'ar': 'عرض المزيد'},
"homeHealthCareService": {
"en": "Home Health Care Service",
'ar': 'الرعاية الصحية المنزلية'
},
"homeHealthCareService": {"en": "Home Health Care Service", 'ar': 'الرعاية الصحية المنزلية'},
"OnlinePharmacy": {"en": "Online Pharmacy", 'ar': 'صيدليات الحبيب'},
"EmergencyService": {"en": "Emergency Service", 'ar': 'الفحص الطبي الشامل'},
"OnlinePaymentService": {
"en": "Online Payment Service",
'ar': 'خدمة الدفع عبر الإلكتدوني'
},
"OffersAndPackages": {
"en": "Online transfer request",
'ar': 'طلب التحويل الالكتروني'
},
"ComprehensiveMedicalCheckup": {
"en": "Comprehensive Medical Check up",
'ar': 'فحص طبي شامل'
},
"OnlinePaymentService": {"en": "Online Payment Service", 'ar': 'خدمة الدفع الإلكتدوني'},
"OffersAndPackages": {"en": "Online transfer request", 'ar': 'طلب التحويل الالكتروني'},
"ComprehensiveMedicalCheckup": {"en": "Comprehensive Medical Check up", 'ar': 'فحص طبي شامل'},
"HMGService": {"en": "HMG Service", 'ar': 'جميع خدمات الحبيب'},
"ViewAllHabibMedicalService": {
"en": "View All Habib Medical Service",
'ar': 'عرض خدمات الحبيب الطبية'
},
"ViewAllHabibMedicalService": {"en": "View All Habib Medical Service", 'ar': 'عرض خدمات الحبيب الطبية'},
"viewAll": {"en": "View All", 'ar': 'عرض الكل'},
"ContactUs": {"en": "Contact Us", 'ar': 'الوصول إلينا'},
"ViewAllWaysReachUs": {
"en": "View All Ways Reach Us",
'ar': 'جميع طرق الاتصال بنا'
},
"ViewAllWaysReachUs": {"en": "View All Ways Reach Us", 'ar': 'جميع طرق الاتصال بنا'},
"medicalProfile": {"en": "Medical Profile", 'ar': 'الملف الطبي'},
"consultation": {"en": "Consultation", "ar": "استشارة"},
"logs": {"en": "Logs", "ar": "السجلات"},
"textToSpeech": {"en": "How May I Help You?", "ar": "كيف يمكنني مساعدتك؟"},
"locationDialogMessage": {
"en":
"Allow the HMG app to access your location will assist you in showing the hospitals according to the nearest to you.",
"ar":
"السماح لتطبيق مجموعة الحبيب الطبية بالوصول إلى موقعك سيساعدك في إظهار المستشفيات وفقًا للأقرب إليك."
"en": "Allow the HMG app to access your location will assist you in showing the hospitals according to the nearest to you.",
"ar": "السماح لتطبيق مجموعة الحبيب الطبية بالوصول إلى موقعك سيساعدك في إظهار المستشفيات وفقًا للأقرب إليك."
},
"user-view-requester": {
"en": "User Wants To View Your Medical File",
"ar": "أشخاص يرغبون الاطلاع على ملفك الطبي"
},
"user-view": {
"en": "User Can View Your Medical File",
"ar": "أشخاص يمكنهم الاطلاع على ملفك الطبي"
},
"user-view-requester": {"en": "User Wants To View Your Medical File", "ar": "أشخاص يرغبون الاطلاع على ملفك الطبي"},
"user-view": {"en": "User Can View Your Medical File", "ar": "أشخاص يمكنهم الاطلاع على ملفك الطبي"},
"parking": {"en": "Parking", "ar": "مواقف"},
"alhabiServices": {"en": "HMG Service", "ar": "خدمات الحبيب"},
@ -409,19 +279,10 @@ const Map<String, Map<String, String>> localizedValues = {
"locationa": {"en": "location:", "ar": "الموقع"},
"ambulancerequest": {"en": "Ambulance :", "ar": "طلب نقل "},
"requestA": {"en": "Request:", "ar": "اسعاف"},
"MyAppointments": {"en": "My Appointments", "ar": "مواعيدي"},
"NoBookedAppointments": {
"en": "No Booked Appointments",
"ar": "لا توجد مواعيد محجوزة"
},
"NoConfirmedAppointments": {
"en": "No Confirmed Appointments",
"ar": "لا توجد مواعيد مؤكدة"
},
"noArrivedAppointments": {
"en": "No Arrived Appointments",
"ar": "لم تصل المواعيد"
},
"MyAppointments": {"en": "Appointments", "ar": "مواعيدي"},
"NoBookedAppointments": {"en": "No Booked Appointments", "ar": "لا توجد مواعيد محجوزة"},
"NoConfirmedAppointments": {"en": "No Confirmed Appointments", "ar": "لا توجد مواعيد مؤكدة"},
"noArrivedAppointments": {"en": "No Arrived Appointments", "ar": "لم تصل المواعيد"},
"MyAppointmentsList": {"en": "List", "ar": "قائمة بمواعدي"},
"Radiology": {"en": "Radiology", "ar": "الأشعة"},
"RadiologySubtitle": {"en": "Result", "ar": "صور وتقارير"},
@ -477,19 +338,10 @@ const Map<String, Map<String, String>> localizedValues = {
"VitalSign": {"en": "Vital Sign", "ar": "العلامة حيوية"},
"MonthlyReports": {"en": "Monthly Reports", "ar": "تقارير شهرية"},
"km": {"en": "KMs:", "ar": "كم"},
"PatientHealthSummaryReport": {
"en": "Patient Health Summary Report",
"ar": " ملخص التقارير الشهرية"
},
"ToViewTheTermsAndConditions": {
"en": "To View The Terms And Conditions Report",
"ar": " عرض الشروط والأحكام "
},
"PatientHealthSummaryReport": {"en": "Patient Health Summary Report", "ar": " ملخص التقارير الشهرية"},
"ToViewTheTermsAndConditions": {"en": "To View The Terms And Conditions Report", "ar": " عرض الشروط والأحكام "},
"ClickHere": {"en": "Click here", "ar": "أنقر هنا"},
"IAgreeToTheTermsAndConditions": {
"en": "I agree to the terms and conditions ",
"ar": "أوافق على الشروط والاحكام "
},
"IAgreeToTheTermsAndConditions": {"en": "I agree to the terms and conditions ", "ar": "أوافق على الشروط والاحكام "},
"IAgreeToTheTermsAndConditionsSubtitle": {
"en": "I agree to the terms and conditions ",
"ar":
@ -498,36 +350,20 @@ const Map<String, Map<String, String>> localizedValues = {
"Save": {"en": "Save", "ar": "حفظ "},
"UserAgreement": {"en": "User Agreement", "ar": "اتفاقية الخصوصية "},
"UpdateSuccessfully": {"en": "Update Successfully", "ar": "تم التحديث بنجاح"},
"CHECK_VACCINE_AVAILABILITY": {
"en": "CHECK VACCINE AVAILABILITY",
"ar": "تحقق من توافر اللقاح"
},
"MyVaccinesAvailability": {
"en": "MyVaccinesAvailability",
"ar": "توفر لقاحي"
},
"CHECK_VACCINE_AVAILABILITY": {"en": "CHECK VACCINE AVAILABILITY", "ar": "تحقق من توافر اللقاح"},
"MyVaccinesAvailability": {"en": "MyVaccinesAvailability", "ar": "توفر لقاحي"},
"PaymentService": {"en": "Payment Service", "ar": "خدمة المدفوعات"},
"PaymentOnline": {"en": "Service", "ar": "الالكتروني"},
"OnlineCheckIn": {"en": "Online Check-In", "ar": "مدفوعات معلقة"},
"MyBalances": {"en": "My Balances", "ar": "رصيدي"},
"BalanceAmount": {"en": "Balance Amount", "ar": "رصيدالحساب"},
"TotalBalance": {"en": "Total Balance", "ar": "الرصيد الكلي"},
"CreateAdvancedPayment": {
"en": "Create Advanced Payment",
"ar": "إنشاء دفعة مقدمة"
},
"CreateAdvancedPayment": {"en": "Create Advanced Payment", "ar": "إنشاء دفعة مقدمة"},
"AdvancePayment": {"en": "Advance Payment", "ar": "الدفع مقدما"},
"AdvancePaymentLabel": {
"en":
"You can create and add an Advanced Payment for you account or other accounts.",
"ar": "يمكنك تحويل مبلغ لحسابك لدى المجموعة أو لحساب احد المراجعين"
},
"AdvancePaymentLabel": {"en": "You can create and add an Advanced Payment for you account or other accounts.", "ar": "يمكنك تحويل مبلغ لحسابك لدى المجموعة أو لحساب احد المراجعين"},
"FileNumber": {"en": "File Number", "ar": "رقم الملف"},
"Amount": {"en": "Amount *", "ar": "المبلغ *"},
"DepositorEmail": {
"en": "Depositor Email *",
"ar": "البريد الإلكتروني للمودع *"
},
"DepositorEmail": {"en": "Depositor Email *", "ar": "البريد الإلكتروني للمودع *"},
"Notes": {"en": "Notes", "ar": "ملاحظات"},
"SelectPatientName": {"en": "Select Patient Name", "ar": "اختر اسم المريض"},
"SelectFamilyPatientName": {"en": "Family Members", "ar": "أفراد الأسرة"},
@ -539,14 +375,8 @@ const Map<String, Map<String, String>> localizedValues = {
"DepositorName": {"en": "Depositor Name", "ar": "اسم المودع *"},
"MobileNumber": {"en": "Mobile Number", "ar": "رقم الجوال"},
"Ok": {"en": "Ok", "ar": "حسنا"},
"TheVerificationCodeExpiresIn": {
"en": "The Verification Code Expires In",
"ar": "تنتهي صلاحية رمز التحقق في"
},
"PleaseEnterTheVerificationCode": {
"en": "Please enter the verification code send to",
"ar": "الرجاء إدخال رمز التحقق المرسل إلى"
},
"TheVerificationCodeExpiresIn": {"en": "The Verification Code Expires In", "ar": "تنتهي صلاحية رمز التحقق في"},
"PleaseEnterTheVerificationCode": {"en": "Please enter the verification code send to", "ar": "الرجاء إدخال رمز التحقق المرسل إلى"},
"EyeMeasurements": {"en": "Eye Measurements", "ar": "قياسات النظر"},
"Measurements": {"en": "Measurements", "ar": "قياسات"},
"Classes": {"en": "Classes", "ar": "نظارات"},
@ -569,10 +399,8 @@ const Map<String, Map<String, String>> localizedValues = {
"DailyQuantity": {"en": "Daily Quantity :", "ar": "جرعات يومية"},
"AddReminder": {"en": "Add Reminder", "ar": "إضافة تذكير"},
"reminderDes": {
"en":
"Please select treatment start day and time to be notified when it\'s time to take the medicine",
"ar":
" يرجى تحديد يوم بدء العلاج والوقت ليتم ارسال تنبيه عندما يحين الوقت لتناول الدواء"
"en": "Please select treatment start day and time to be notified when it\'s time to take the medicine",
"ar": " يرجى تحديد يوم بدء العلاج والوقت ليتم ارسال تنبيه عندما يحين الوقت لتناول الدواء"
},
"StartDay": {"en": "Start Day", "ar": "يوم البداية"},
"EndDay": {"en": "End Day", "ar": "يوم الانتهاء"},
@ -582,24 +410,12 @@ const Map<String, Map<String, String>> localizedValues = {
"DoctorResponses": {"en": "Doctor Responses", "ar": "ردود الأطباء"},
"New": {"en": "New", "ar": "جديد"},
"All": {"en": "All", "ar": "الكل"},
"QuestionHere": {
"en": "Enter the question here...",
"ar": "اضف الاستفسار هنا"
},
"ViewDoctorResponses": {
"en": "View Doctor Responses",
"ar": "الاطلاع على ردود الأطباء"
},
"QuestionHere": {"en": "Enter the question here...", "ar": "اضف الاستفسار هنا"},
"ViewDoctorResponses": {"en": "View Doctor Responses", "ar": "الاطلاع على ردود الأطباء"},
"ServiceInformationButton": {"en": "LOGIN / REGISTER", "ar": "دخول / تسجيل"},
"ServiceInformationTitle": {
"en": "Service Information",
"ar": "معلومات الخدمة"
},
"ServiceInformationTitle": {"en": "Service Information", "ar": "معلومات الخدمة"},
"ServiceInformation": {"en": "Service Information", "ar": "معلومات الخدمة"},
"HomeHealthCare": {
"en": "Home Health Care",
"ar": " الرعاية الصحية المنزلية "
},
"HomeHealthCare": {"en": "Home Health Care", "ar": " الرعاية الصحية المنزلية "},
"HomeHealthCareText": {
"en":
"This service provides a set of home health care services, continuous and comprehensive follow-up in their places of residence for those who cannot access health facilities, such as (laboratory analyzes - radiology - vaccinations - physical therapy), etc.",
@ -609,96 +425,233 @@ const Map<String, Map<String, String>> localizedValues = {
"LoginRegister": {"en": "Login/Register", "ar": "دخول / تسجيل"},
"OrderLog": {"en": "Order Log", "ar": " سجل الطلبات"},
"info-lab": {
"en":
"This service allows you to view the results of all laboratory tests performed in Al Habib Medical Group as well as sending the report via e-mail.",
"ar":
"خدمة نتائج المختبر: هذه الخدمة تمكنك من الاطلاع على نتائج جميع الفحوصات المخبرية التي تمت في مجموعة الحبيب الطبية."
"en": "This service allows you to view the results of all laboratory tests performed in Al Habib Medical Group as well as sending the report via e-mail.",
"ar": "خدمة نتائج المختبر: هذه الخدمة تمكنك من الاطلاع على نتائج جميع الفحوصات المخبرية التي تمت في مجموعة الحبيب الطبية."
},
"info-radiology": {
"en":
"This service allows you to view the reports and photos of radiology in Al Habib Medical Group as well as send the report by e-mail.",
"ar":
"خدمة الاشعة: هذه الخدمة تمكنك من الاطلاع على تقارير وصور الاشعة التي تمت في مجموعة الحبيب الطبية وكذلك ارسال التقرير عن طريق الايميل."
"en": "This service allows you to view the reports and photos of radiology in Al Habib Medical Group as well as send the report by e-mail.",
"ar": "خدمة الاشعة: هذه الخدمة تمكنك من الاطلاع على تقارير وصور الاشعة التي تمت في مجموعة الحبيب الطبية وكذلك ارسال التقرير عن طريق الايميل."
},
"TermsService": {"en": "Terms of Service", "ar": "شروط الخدمه"},
"Beforeusing": {
"en": "Before using the checkup, please read Terms of Service.",
"ar": "قبل استخدام الفحص ، يرجى قراءة شروط الخدمة"
},
"accept": {
"en": "I read and accept Terms of Service and Privacy Policy",
"ar": "قرأت ووافقت على شروط الخدمة وسياسة الخصوصية"
},
"data-safe-info": {
"en":
"Information that you provide is anonymous and not shared with anyone.",
"ar": "المعلومات التي تقدمها لا تتم مشاركتها مع أي شخص"
},
"Beforeusing": {"en": "Before using the checkup, please read Terms of Service.", "ar": "قبل استخدام الفحص ، يرجى قراءة شروط الخدمة"},
"accept": {"en": "I read and accept Terms of Service and Privacy Policy", "ar": "قرأت ووافقت على شروط الخدمة وسياسة الخصوصية"},
"data-safe-info": {"en": "Information that you provide is anonymous and not shared with anyone.", "ar": "المعلومات التي تقدمها لا تتم مشاركتها مع أي شخص"},
"data-safe": {"en": " Your data is safe.", "ar": "بياناتك آمنة"},
"informational": {
"en":
"Checkup is for informational purposes and is not a qualified medical opinion",
"ar": "الفحص هو لأغراض معلوماتية وليس رأي طبي مؤهل"
},
"not-use-in-emerbency": {
"en": "Do not use in emergencies.",
"ar": "لا تستخدم في حالات الطوارئ"
},
"not-use-in-emerbency-details": {
"en": "In case of health emergency, ",
"ar": "في حالة الطوارئ اتصل بأقرب رقم للطوارئ على الفور"
},
"not-use-in-emerbency-details-call": {
"en": "call the nearest emergency number immediately",
"ar": " اتصل بأقرب رقم للطوارئ على الفور"
},
"check-diagnosis": {
"en": "Checkup is not a diagnosis.",
"ar": "الفحص ليس تشخيص."
},
"informational": {"en": "Checkup is for informational purposes and is not a qualified medical opinion", "ar": "الفحص هو لأغراض معلوماتية وليس رأي طبي مؤهل"},
"not-use-in-emerbency": {"en": "Do not use in emergencies.", "ar": "لا تستخدم في حالات الطوارئ"},
"not-use-in-emerbency-details": {"en": "In case of health emergency, ", "ar": "في حالة الطوارئ اتصل بأقرب رقم للطوارئ على الفور"},
"not-use-in-emerbency-details-call": {"en": "call the nearest emergency number immediately", "ar": " اتصل بأقرب رقم للطوارئ على الفور"},
"check-diagnosis": {"en": "Checkup is not a diagnosis.", "ar": "الفحص ليس تشخيص."},
"remeberthat": {"en": "Remember that", "ar": "تذكر ذلك:"},
"loginToUseService": {"en": "You need to login to use this service", "ar": "هذة الخدمة تتطلب تسجيل الدخول"},
// pharmacy module
"medicationRefill": {
"en": "MEDICATION REFILL",
"ar": "إعادة تعبئة الدواء"
},
"offersAndPromotions": {
"en": "OFFERS & SPECIAL PROMOTIONS",
"ar": "العروض والترقيات الخاصة"
},
"myPrescriptions": {
"en": "MY PRESCRIPTIONS",
"ar": "وصفاتي"
"medicationRefill": {"en": "MEDICATION REFILL", "ar": "إعادة تعبئة الدواء"},
"offersAndPromotions": {"en": "OFFERS & SPECIAL PROMOTIONS", "ar": "العروض والترقيات الخاصة"},
"myPrescriptions": {"en": "MY PRESCRIPTIONS", "ar": "وصفاتي"},
"searchAndScanMedication": {"en": "SEARCH & SCAN FOR MEDICATION", "ar": "البحث والمسح للأدوية"},
"shopByBrands": {"en": "Shop By Brands", "ar": "تسوق حسب الماركات"},
"recentlyViewed": {"en": "Recently Viewed", "ar": "شوهدت مؤخرا"},
"bestSellers": {"en": "Best Sellers", "ar": "أفضل البائعين"},
"deleteAllItems": {"en": "Delete All Items", "ar": "حذف كافة العناصر"},
"select-gender": {"en": "Select Gender", "ar": "اختر الجنس"},
"i-am-a": {"en": "I am a ...", "ar": "أنا ..."},
"select-age": {"en": "Select Your Age", "ar": "حدد العمر"},
"i-am": {"en": "I am", "ar": "أنا"},
"years-old": {"en": "years old", "ar": "سنة"},
"drag-point": {"en": "Drag point to change your age", "ar": "اسحب لتغيير عمرك"},
"email": {"en": "Email", "ar": "البريد الالكتروني"},
"Book": {"en": "Book", "ar": "احجز"},
"AppointmentLabel": {"en": "Appointment", "ar": "موعد"},
"BloodType": {"en": "Blood Type", "ar": "فصيلة الدم"},
"marital-status": {"en": "Marital status", "ar": "الحالة الإجتماعية"},
"general": {"en": "General", "ar": "عام"},
"profile": {"en": "Profile", "ar": "ملفي"},
"notifications": {"en": "Notifications", "ar": "إشعارات"},
"notificationDetails": {"en": "Notification Details", "ar": "تفاصيل الاشعار"},
"notificationDetailsa": {"en": "Notification Details", "ar": "تفاصيل الاشعار"},
"info-my-doctor-points": {
"en": [
"View the doctor's profile and qualifications.",
"View the doctor's schedule.",
"View details of your appointments with the selected doctor.",
"Book appointment with the doctor. ",
],
"ar": ["الاطلاع على معلومات الطبيب ومؤهلاته.", "الاطلاع على جدول الطبيب.", "الاطلاع على تفاصيل المواعيد التي تمت مع الطبيب.", "حجز موعد مع الطبيب."]
},
"info-my-doctor": {
"en": "This service allows you to see all the doctors you have visited in Al Habib Medical Group, and through this service:",
"ar": "خدمة اطبائي: هذه الخدمة تمكنك من الاطلاع على جميع الاطباء الذين قمت بزيارتهم في مجموعة الحبيب الطبية, كما تستطيع من خلال هذه الخدمة:"
},
"info-prescriptions": {
"en": "This service allows you to view all the medical prescriptions issued by Al Habib Medical Group, and through this service, you can:",
"ar": "خدمة الوصفات الطبية: هذه الخدمة تمكنك من الاطلاع على جميع الوصفات الطبية التي تم اصدارها في مجموعة الحبيب الطبية، كما تستطيع من خلال هذه الخدمة:"
},
"info-my-prescription-points": {
"en": [
"View the duration days.",
"View the frequency timing.",
"View the doctor's remarks.",
"Add a reminder to remind you when to take medicine doses.",
"Search in AlHabib Pharmacies about the branches where medicines are available, pharmacies locations and contact numbers.",
"Ordering and delivery medications online.",
"View the prices of the drug. ",
],
"ar": [
"الاطلاع على طريقة تناول العلاج.",
"الاطلاع على مدة تناول العلاج.",
"الاطلاع على ملاحظات الطبيب.",
"اضافة منبه للتذكير بموعد تناول جرعات الادوية.",
"البحث في صيدليات الحبيب عن الفروع التي يتوفر فيها العلاج وكذلك مواقع الصيدليات وارقام الاتصال. ",
"امكانية شراء وتوصيل العلاج عن طريق الانترنت.",
"الاطلاع على اسعار الادوية المصروفة."
]
},
"searchAndScanMedication": {
"en": "SEARCH & SCAN FOR MEDICATION",
"ar": "البحث والمسح للأدوية"
"info-insurance-cards": {
"en": "This service allows you to view all the insurance cards that recorded during your visits to Al Habib Medical Group in addition to:",
"ar": "خدمة بطاقات التامين: هذه الخدمة تمكنك من الاطلاع على جميع بطاقات التامين والتي تم تسجيلها اثناء زياراتك لمجموعة الحبيب الطبية بالاضافة الى:"
},
"shopByBrands": {
"en": "Shop By Brands",
"ar": "تسوق حسب الماركات"
"info-insurance-cards-points": {
"en": [
"Name of the insurance company.",
"Insurance category.",
"Insurance policy number.",
"The expiry date of insurance.",
"The status of the insurance card (active or inactive).",
"Details of the coverage, e.x the room category covered as well some cases covered by the insurance.",
],
"ar": [
"اسم شركة التامين.",
"فئة التامين.",
"رقم بوليصة التامين.",
"تاريخ انتهاء التامين.",
"حالة بطاقة التامين (فعالة او غير فعالة).",
"تفاصيل التامين، مثلاً: مستوى الغرفة التي يغطيها التامين وكذلك الحالات التي يغطيها التامين.",
]
},
"recentlyViewed": {
"en": "Recently Viewed",
"ar": "شوهدت مؤخرا"
"info-allergies": {
"en": "This service allows you to view all types of allergies recorded during your visits to Al Habib Medical Group.",
"ar": "خدمة الحساسية: هذه الخدمة تمكنك من الاطلاع على جميع انواع الحساسية التي تم تسجيلها خلال زياراتك في مجموعة الحبيب الطبية."
},
"bestSellers": {
"en": "Best Sellers",
"ar": "أفضل البائعين"
"sick-leaves": {"en": "Sick Leaves", "ar": "الاجازات المرضية"},
"info-sick-leaves": {
"en": "This service allows you to view all sick leaves that were taken in Al Habib Medical Group in addition to:",
"ar": "الاجازات المرضية: هذه الخدمة تمكنك من الاطلاع على جميع الاجازات المرضية والتي تم اصدارها في مجموعة الحبيب الطبية بالاضافة الى:"
},
"info-sick-leave-points": {
"en": [
"Doctor Name",
"Sick leave date ",
"Sick leave days",
"Branch that patient take the vaccination form.",
"Sending a report of vaccinations to the email. ",
],
"ar": ["اسم الطبيب", "تاريخ الاجازة.", "عدد ايام الاجازة.", "الفرع الذي تم اصدار الاجازة منه.", "ارسال نسخة مختومة من الاجازة الى البريد الالكتروني."]
},
"deleteAllItems": {
"en": "Delete All Items",
"ar": "حذف كافة العناصر"
"info-approvals": {
"en": "This service allows you to view all approvals requests that have been sent to the insurance companies in addition to:",
"ar": "خدمة الموافقات: هذه الخدمة تمكنك من الاطلاع على جميع طلبات الموافقات والتي تم ارسالها الى شركات التامين بالاضافة الى:"
},
"select-gender": {"en": "Select Gender", "ar": "اختر الجنس"},
"i-am-a": {"en": "I am a ...", "ar": "أنا ..."},
"select-age": {"en": "Select Your Age", "ar": "حدد العمر"},
"i-am": {"en": "I am", "ar": "أنا"},
"years-old": {"en": "years old", "ar": "سنة"},
"drag-point": {
"en": "Drag point to change your age",
"ar": "اسحب لتغيير عمرك"
"info-approval-points": {
"en": [
"View the total unused approvals.",
"Track the approvals status.",
],
"ar": [
"الاطلاع على اجمالي الموافقات الغير مستخدمة.",
"تتبع حالة الموافقة.",
]
},
"month-report": {"en": "Monthly Reports", "ar": "تقاريري الشهرية"},
"info-month-report": {
"en":
"Upon activation of this service, the system will send a monthly report automatically to the registered email which lists the vital signs and the results for the last visits made in AlHabib Medical Group.",
"ar": "خدمة التقارير الشهرية: عند تفعيل هذه الخدمة سيقوم النظام بارسال تقرير شهري بشكل آلي على الايميل المسجل والذي يسرد المؤشرات الحيوية ونتائج التحاليل لآخر زيارات تمت بمجموعة الحبيب الطبية."
},
"language-setting": {"en": "SMS and Confirmation Calls Language", "ar": "لغة الرسائل القصيرة و الاتصال الآلي"},
"alert": {"en": "Alerts", "ar": "التنبيهات"},
"email-alert": {"en": "Alert By Email", "ar": "استلام التنبيهات بالبريد الالكتروني"},
"sms-alert": {"en": "Alert By SMS", "ar": "استلام التنبيهات بالرسائل القصيرة"},
"contact-info": {"en": "Contact Information", "ar": "معلومات التواصل"},
"emrg-name": {"en": "Emergency Contact Name", "ar": "اسم للتواصل في حالة الطوارئ"},
"emrg-no": {"en": "Emergency Contact Number", "ar": "رقم للتواصل في حالة الطوارئ"},
"modes": {"en": "Modes", "ar": "الاوضاع"},
"vibration": {"en": "Vibration Touch Feedback", "ar": "الاهتزاز عند اللمس"},
"blind-modes": {"en": "Modes for Partially Blind", "ar": "تأثيرات لدعم ضعاف البصر"},
"invert-theme": {"en": "Invert", "ar": "ألوان سلبية"},
"off-theme": {"en": "Off", "ar": "إيقاف"},
"dim-theme": {"en": "Dim", "ar": "ضوء خافت"},
"bw-theme": {"en": "Black and White", "ar": "أبيض و أسود"},
"permissions": {"en": "Permission", "ar": "الصلاحيات"},
"camera-permission": {"en": "Camera", "ar": "الكاميرا"},
"location-permission": {"en": "Location", "ar": "تحديد المواقع"},
"accessibility": {"en": "Accessibility Mode", "ar": "وضع امكانية الوصول"},
"orderStatus": {"en": "Order Status", "ar": "حالة الطلب"},
"CancelOrder": {"en": "Cancel Order", "ar": "الغاء الطلب"},
"FindUs": {"en": "Find Us", "ar": "اين تجدنا"},
"Feedback": {"en": "Feedback", "ar": "رأيك يهمنا"},
"LiveChat": {"en": "Live Chat", "ar": "محادثة مباشرة"},
"Service": {"en": "Service", "ar": "خدمة"},
"HMGServiceLabel": {"en": "HMG Service", 'ar': 'خدمات الحبيب'},
"HealthWeatherIndicators": {"en": "Health Weather Indicators", 'ar': ' مؤشرات الطقس الصحية '},
"HealthTipsBasedOnCurrentWeather": {"en": "Health Tips Based On Current Weather", 'ar': ' نصائح صحية على أساس الطقس الحالي '},
"MoreDetails": {"en": "More details", "ar": " المزيد من التفاصيل "},
"SendCopy": {"en": "Send Copy", "ar": "ارسال نسخة"},
"ResendOrder": {"en": "Resend order & deliver", "ar": "إعادة طلب و توصيل"},
"Ports": {"en": "Ports", "ar": "المنافذ"},
"Way": {"en": "Way", "ar": "الطزيقة"},
"Average": {"en": "Average", "ar": "المعدل"},
"DailyDoses": {"en": "Daily Doses", "ar": "جرعات يومية"},
"Period": {"en": "Period", "ar": "الفترة"},
"cm": {"en": "CM", "ar": "سم"},
"kg": {"en": "kg", "ar": "كجم"},
"mass": {"en": "Mass", "ar": "كتلة"},
"temp-c": {"en": "°C", "ar": "°س"},
"bpm": {"en": "bpm", "ar": "نبضة"},
"respiration-signs": {"en": "Respiration", "ar": "تنفس"},
"sys-dias": {"en": "SBP/DBP", "ar": "إنقباض/إنبساط"},
"body": {"en": "Body \n Mass", "ar": "كتلة\nالجسم"},
"feedback": {"en": "Feedback", "ar": "رأيك يهمنا"},
"send": {"en": "Send", "ar": "أرسل"},
"status": {"en": "Status", "ar": "الحالة"},
"like-to-hear": {
"en": "We would love to hear the feedback, concerns on healthcare services and eServices experience. Please use the below form",
"ar": "يسعدنا سماع ملاحظاتك حول خدمات الرعاية الصحية والخدمات الإلكترونية. يرجى تعبئة الحقول المطلوبة"
},
"subject": {"en": "Subject", "ar": "الموضوع"},
"message": {"en": "Message", "ar": "رسالة"},
"empty-subject": {"en": "Please enter the subject", "ar": "يرجى ادخال الموضوع"},
"empty-message": {"en": "Please enter message", "ar": "يرجى ادخال الموضوع"},
"select-attachment": {"en": "Select Attachment", "ar": "إختر المرفق"},
"complain-appo": {"en": "Complaint for appointment", "ar": "شكوى على موعد"},
"complain-without-appo": {"en": "Complaint without appointment", "ar": "شكوى بدون موعد"},
"question": {"en": "Question", "ar": "سؤال"},
"message-type": {"en": "Message Type", "ar": "نوع الرسالة"},
"compliment": {"en": "compliment", "ar": "ثناء"},
"suggestion": {"en": "Suggestion", "ar": "إقتراح"},
"your-feedback": {"en": "Your feedback was sent", "ar": "إقتراح"},
"select-part": {"en": "Please select the part that complain about", "ar": "يرجى تحديد الجزء الذي تشكو منه"},
"number": {"en": "Number", "ar": "الرقم"},
"not-classified": {"en": "Not classified", "ar": "غير محدد"},
"selectClinic": {"en": "Select Clinic", "ar": " بحث بالعيادة"},
"reviews": {"en": "Reviews", "ar": "تقييمات"},
"searchItemError": {"en": "Item name should be more than 3 character ", "ar": "يجب أن يكون اسم العنصر أكثر من 3 أحرف"},
"YouCanFind": {"en": "YouCanFind", "ar": "باستطاعتك العثور على "},
"ItemInSearch": {"en": " Item In Search", "ar": " عنصر في البحث "},
"wantConnectHmgNetwork": {
"en": "Dear customer there is no internet access, Do you want to connect with HMG network to use our app, make sure you are in range of HMG network",
"ar": "عزيز العميل لا يوجد اتصال بالإنترنت, هل تريد الاتصال بشبكة مستشفى د. سليمان الحبيب لاستخدام التطبيق. يجب عليك ان تكون في نطاق شبكة المستشفى"
},
"failedToAccessHmgServices": {"en": "Connected with HMG Network,\n\nBut failed to access HMG services", "ar": "Connected with HMG Network,\n\nBut failed to access HMG services"},
};

@ -16,4 +16,7 @@ const USER_LONG = 'user-long';
const IS_GO_TO_PARKING = 'IS_GO_TO_PARKING';
const IS_SEARCH_APPO = 'is-search-appo';
const IS_LIVECARE_APPOINTMENT = 'is_livecare_appointment';
const IS_VIBRATION = 'is_vibration';
const THEME_VALUE = 'is_vibration';
const MAIN_USER = 'main-user';
const PHARMACY_LAST_VISITED_PRODUCTS = 'last-visited';

@ -16,7 +16,9 @@ class InsuranceCardModel {
int patientType;
String groupName;
String companyName;
int companyID;
String subCategoryDesc;
int subCategoryID;
String patientCardID;
String insurancePolicyNumber;
bool isActive;
@ -25,6 +27,7 @@ class InsuranceCardModel {
InsuranceCardModel({
this.insurancePolicyNumber,
this.subCategoryDesc,
this.subCategoryID,
this.versionID,
this.channel,
this.languageID,
@ -40,6 +43,7 @@ class InsuranceCardModel {
this.patientType,
this.groupName,
this.companyName,
this.companyID,
this.patientCardID,
this.isActive,
this.cardValidTo
@ -50,6 +54,7 @@ class InsuranceCardModel {
insurancePolicyNumber = json['InsurancePolicyNo'];
patientCardID = json['PatientCardID'];
companyName = json['CompanyName'];
companyID = json['CompanyID'];
groupName = json['GroupName'];
versionID = json['VersionID'];
channel = json['Channel'];
@ -65,6 +70,7 @@ class InsuranceCardModel {
patientTypeID = json['PatientTypeID'];
patientType = json['PatientType'];
subCategoryDesc = json['SubCategoryDesc'];
subCategoryID = json["SubCategoryID"];
cardValidTo = json['CardValidTo'];
}

@ -86,3 +86,14 @@ class LabResult {
return data;
}
}
class LabResultList {
String filterName = "";
List<LabResult> patientLabResultList = List();
LabResultList(
{this.filterName, LabResult lab}) {
patientLabResultList.add(lab);
}
}

@ -8,6 +8,9 @@ class AdvanceModel {
String email;
String note;
String depositorName;
String mobileNumber;
String patientName;
int projectID;
CitiesModel citiessModel;
AdvanceModel(
@ -17,5 +20,8 @@ class AdvanceModel {
this.hospitalsModel,
this.fileNumber,
this.depositorName,
this.mobileNumber,
this.patientName,
this.projectID,
this.citiessModel});
}

@ -0,0 +1,22 @@
class GetNotificationsRequestModel {
int notificationStatusID;
int pagingSize;
int currentPage;
GetNotificationsRequestModel(
{this.notificationStatusID, this.pagingSize, this.currentPage});
GetNotificationsRequestModel.fromJson(Map<String, dynamic> json) {
notificationStatusID = json['NotificationStatusID'];
pagingSize = json['pagingSize'];
currentPage = json['currentPage'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['NotificationStatusID'] = this.notificationStatusID;
data['pagingSize'] = this.pagingSize;
data['currentPage'] = this.currentPage;
return data;
}
}

@ -0,0 +1,96 @@
class GetNotificationsResponseModel {
int id;
int recordId;
int patientID;
bool projectOutSA;
String deviceType;
String deviceToken;
String message;
String messageType;
String messageTypeData;
dynamic videoURL;
bool isQueue;
String isQueueOn;
String createdOn;
String createdBy;
String notificationType;
bool isSent;
String isSentOn;
bool isRead;
String isReadOn;
int channelID;
int projectID;
GetNotificationsResponseModel(
{this.id,
this.recordId,
this.patientID,
this.projectOutSA,
this.deviceType,
this.deviceToken,
this.message,
this.messageType,
this.messageTypeData,
this.videoURL,
this.isQueue,
this.isQueueOn,
this.createdOn,
this.createdBy,
this.notificationType,
this.isSent,
this.isSentOn,
this.isRead,
this.isReadOn,
this.channelID,
this.projectID});
GetNotificationsResponseModel.fromJson(Map<String, dynamic> json) {
id = json['Id'];
recordId = json['RecordId'];
patientID = json['PatientID'];
projectOutSA = json['ProjectOutSA'];
deviceType = json['DeviceType'];
deviceToken = json['DeviceToken'];
message = json['Message'];
messageType = json['MessageType'];
messageTypeData = json['MessageTypeData'];
videoURL = json['VideoURL'];
isQueue = json['IsQueue'];
isQueueOn = json['IsQueueOn'];
createdOn = json['CreatedOn'];
createdBy = json['CreatedBy'];
notificationType = json['NotificationType'];
isSent = json['IsSent'];
isSentOn = json['IsSentOn'];
isRead = json['IsRead'];
isReadOn = json['IsReadOn'];
channelID = json['ChannelID'];
projectID = json['ProjectID'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['Id'] = this.id;
data['RecordId'] = this.recordId;
data['PatientID'] = this.patientID;
data['ProjectOutSA'] = this.projectOutSA;
data['DeviceType'] = this.deviceType;
data['DeviceToken'] = this.deviceToken;
data['Message'] = this.message;
data['MessageType'] = this.messageType;
data['MessageTypeData'] = this.messageTypeData;
data['VideoURL'] = this.videoURL;
data['IsQueue'] = this.isQueue;
data['IsQueueOn'] = this.isQueueOn;
data['CreatedOn'] = this.createdOn;
data['CreatedBy'] = this.createdBy;
data['NotificationType'] = this.notificationType;
data['IsSent'] = this.isSent;
data['IsSentOn'] = this.isSentOn;
data['IsRead'] = this.isRead;
data['IsReadOn'] = this.isReadOn;
data['ChannelID'] = this.channelID;
data['ProjectID'] = this.projectID;
return data;
}
}

@ -0,0 +1,15 @@
class MarkMessageAsReadRequestModel {
int notificationPoolID;
MarkMessageAsReadRequestModel({this.notificationPoolID});
MarkMessageAsReadRequestModel.fromJson(Map<String, dynamic> json) {
notificationPoolID = json['NotificationPoolID'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['NotificationPoolID'] = this.notificationPoolID;
return data;
}
}

@ -1,6 +1,6 @@
class PharmacyPrescriptions {
String expiryDate;
double sellingPrice;
dynamic sellingPrice;
int quantity;
int itemID;
int locationID;

@ -14,6 +14,7 @@ class RequestPrescriptionReportEnh {
int patientType;
int appointmentNo;
String setupID;
int dischargeNo;
int episodeID;
int clinicID;
int projectID;
@ -36,7 +37,7 @@ class RequestPrescriptionReportEnh {
this.setupID,
this.episodeID,
this.clinicID,
this.projectID});
this.projectID,this.dischargeNo});
RequestPrescriptionReportEnh.fromJson(Map<String, dynamic> json) {
versionID = json['VersionID'];
@ -79,6 +80,7 @@ class RequestPrescriptionReportEnh {
data['EpisodeID'] = this.episodeID;
data['ClinicID'] = this.clinicID;
data['ProjectID'] = this.projectID;
data['DischargeNo'] = this.dischargeNo;
return data;
}
}

@ -5,13 +5,13 @@ class AppointmentDetails {
int appointmentNo;
int clinicID;
int doctorID;
String startTime;
String endTime;
String appointmentDate;
String clinicName;
String doctorImageURL;
String doctorName;
String projectName;
dynamic startTime;
dynamic endTime;
dynamic appointmentDate;
dynamic clinicName;
dynamic doctorImageURL;
dynamic doctorName;
dynamic projectName;
AppointmentDetails(
{this.setupID,

@ -17,8 +17,8 @@ class AuthenticatedUserObject {
if (userData != null) user = AuthenticatedUser.fromJson(userData);
}
var isLogin = await sharedPref.getString(LOGIN_TOKEN_ID);
this.isLogin = isLogin != null;
// var isLogin = await sharedPref.getString(LOGIN_TOKEN_ID);
this.isLogin = user != null;
}
logout() async {

@ -2,12 +2,16 @@ import 'dart:convert';
import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:flutter/cupertino.dart';
import 'package:http/http.dart' as http;
import 'package:provider/provider.dart';
import '../../../locator.dart';
import '../../../routes.dart';
import '../AuthenticatedUserObject.dart';
AppSharedPreferences sharedPref = new AppSharedPreferences();
@ -16,19 +20,16 @@ AppSharedPreferences sharedPref = new AppSharedPreferences();
/// onSuccess: (dynamic response, int statusCode) {},
/// onFailure: (String error, int statusCode) {},
/// body: Map();
///
AuthenticatedUserObject authenticatedUserObject = locator<AuthenticatedUserObject>();
class BaseAppClient {
post(String endPoint,
{Map<String, dynamic> body,
Function(dynamic response, int statusCode) onSuccess,
Function(String error, int statusCode) onFailure,
bool isAllowAny = false}) async {
post(String endPoint, {Map<String, dynamic> body, Function(dynamic response, int statusCode) onSuccess, Function(String error, int statusCode) onFailure, bool isAllowAny = false}) async {
String url = BASE_URL + endPoint;
try {
//Map profile = await sharedPref.getObj(DOCTOR_PROFILE);
String token = await sharedPref.getString(TOKEN);
var languageID =
await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'en');
var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
var user = await sharedPref.getObject(USER_PROFILE);
if (body.containsKey('SetupID')) {
body['SetupID'] = body.containsKey('SetupID')
@ -39,7 +40,16 @@ class BaseAppClient {
}
body['VersionID'] = VERSION_ID;
body['Channel'] = CHANNEL;
body['LanguageID'] = languageID == 'ar' ? 1 : 2;
body['LanguageID'] = body.containsKey('LanguageID')
? body['LanguageID'] != null
? body['LanguageID']
: languageID == 'ar'
? 1
: 2
: languageID == 'ar'
? 1
: 2;
body['IPAdress'] = IP_ADDRESS;
body['generalid'] = GENERAL_ID;
body['PatientOutSA'] = body.containsKey('PatientOutSA')
@ -49,12 +59,11 @@ class BaseAppClient {
: PATIENT_OUT_SA;
if (body.containsKey('isDentalAllowedBackend')) {
body['isDentalAllowedBackend'] =
body.containsKey('isDentalAllowedBackend')
? body['isDentalAllowedBackend'] != null
? body['isDentalAllowedBackend']
: IS_DENTAL_ALLOWED_BACKEND
: IS_DENTAL_ALLOWED_BACKEND;
body['isDentalAllowedBackend'] = body.containsKey('isDentalAllowedBackend')
? body['isDentalAllowedBackend'] != null
? body['isDentalAllowedBackend']
: IS_DENTAL_ALLOWED_BACKEND
: IS_DENTAL_ALLOWED_BACKEND;
}
body['DeviceTypeID'] = DeviceTypeID;
@ -63,19 +72,21 @@ class BaseAppClient {
body['PatientType'] = body.containsKey('PatientType')
? body['PatientType'] != null
? body['PatientType']
: PATIENT_TYPE
: user['PatientType'] != null
? user['PatientType']
: PATIENT_TYPE
: PATIENT_TYPE;
body['PatientTypeID'] = body.containsKey('PatientTypeID')
? body['PatientTypeID'] != null
? body['PatientTypeID']
: PATIENT_TYPE_ID
: user['PatientTypeID'] != null
? user['PatientTypeID']
: PATIENT_TYPE_ID
: PATIENT_TYPE_ID;
if (user != null) {
body['TokenID'] = token;
body['PatientID'] =
body['PatientID'] != null ? body['PatientID'] : user['PatientID'];
body['PatientID'] = body['PatientID'] != null ? body['PatientID'] : user['PatientID'];
body['PatientOutSA'] = user['OutSA'];
body['SessionID'] = SESSION_ID; //getSessionId(token);
}
@ -86,12 +97,7 @@ class BaseAppClient {
var ss = json.encode(body);
if (await Utils.checkConnection()) {
final response = await http.post(url.trim(),
body: json.encode(body),
headers: {
'Content-Type': 'application/json',
'Accept': 'application/json'
});
final response = await http.post(url.trim(), body: json.encode(body), headers: {'Content-Type': 'application/json', 'Accept': 'application/json'});
final int statusCode = response.statusCode;
print("statusCode :$statusCode");
if (statusCode < 200 || statusCode >= 400 || json == null) {
@ -111,21 +117,19 @@ class BaseAppClient {
} else if (parsed['Result'] == 'OK') {
onSuccess(parsed, statusCode);
} else {
onFailure(
parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'],
statusCode);
logout();
onFailure(parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], statusCode);
}
} else if (parsed['MessageStatus'] == 1 ||
parsed['SMSLoginRequired'] == true) {
} else if (parsed['MessageStatus'] == 1 || parsed['SMSLoginRequired'] == true) {
onSuccess(parsed, statusCode);
} else if (!parsed['IsAuthenticated']) {
await logout();
//helpers.showErrorToast('Your session expired Please login agian');
} else {
if (parsed['SameClinicApptList'] != null) {
onSuccess(parsed, statusCode);
} else {
onFailure(
parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'],
statusCode);
onFailure(parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], statusCode);
}
}
}
@ -139,10 +143,7 @@ class BaseAppClient {
}
}
get(String endPoint,
{Function(dynamic response, int statusCode) onSuccess,
Function(String error, int statusCode) onFailure,
Map<String, String> queryParams}) async {
get(String endPoint, {Function(dynamic response, int statusCode) onSuccess, Function(String error, int statusCode) onFailure, Map<String, String> queryParams}) async {
String url = BASE_URL + endPoint;
if (queryParams != null) {
String queryString = Uri(queryParameters: queryParams).query;
@ -152,10 +153,10 @@ class BaseAppClient {
print("URL : $url");
if (await Utils.checkConnection()) {
final response = await http.get(url.trim(), headers: {
'Content-Type': 'application/json',
'Accept': 'application/json'
},);
final response = await http.get(
url.trim(),
headers: {'Content-Type': 'application/json', 'Accept': 'application/json'},
);
final int statusCode = response.statusCode;
print("statusCode :$statusCode");
@ -170,9 +171,39 @@ class BaseAppClient {
}
}
simpleGet(String fullUrl, {Function(dynamic response, int statusCode) onSuccess, Function(String error, int statusCode) onFailure, Map<String, String> queryParams}) async {
String url = fullUrl;
if (queryParams != null) {
String queryString = Uri(queryParameters: queryParams).query;
url += '?' + queryString;
}
print("URL : $url");
if (await Utils.checkConnection()) {
final response = await http.get(
url.trim(),
headers: {'Content-Type': 'application/json', 'Accept': 'application/json'},
);
final int statusCode = response.statusCode;
print("statusCode :$statusCode");
if (statusCode < 200 || statusCode >= 400 || json == null) {
onFailure('Error While Fetching data', statusCode);
} else {
onSuccess(response.body.toString(), statusCode);
}
} else {
onFailure('Please Check The Internet Connection', -1);
}
}
logout() async {
await sharedPref.remove(LOGIN_TOKEN_ID);
Navigator.of(AppGlobal.context).pushReplacementNamed(LOGIN_TYPE);
await authenticatedUserObject.getUser();
Provider.of<ProjectViewModel>(AppGlobal.context, listen: false).isLogin = false;
Navigator.of(AppGlobal.context).pushReplacementNamed(HOME);
}
String getSessionId(String id) {

@ -1,5 +1,4 @@
import 'dart:io';
import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/model/feedback/COC_items.dart';
@ -45,8 +44,7 @@ class FeedbackService extends BaseService {
if (appointHistory != null) {
body['AppoinmentNo'] = appointHistory.appointmentNo;
body['AppointmentDate'] =
DateUtil.convertDateToString(appointHistory.appointmentDate);
body['AppointmentDate'] = DateUtil.convertDateToString(appointHistory.appointmentDate);
body['ClinicID'] = appointHistory.clinicID;
body['ClinicName'] = appointHistory.clinicName;
body['DoctorID'] = appointHistory.doctorID;

@ -31,48 +31,9 @@ class InsuranceCardService extends BaseService {
_cardUpdated.clear();
}
InsuranceCardModel _insuranceCardModel = InsuranceCardModel(
channel: 3,
deviceTypeID: 2,
generalid: "Cs2020@2016\$2958",
iPAdress: "10.20.10.20",
isDentalAllowedBackend: false,
languageID: 1,
patientID: 1231755,
patientOutSA: 0,
patientType: 1,
patientTypeID: 1,
sessionID: "uoKFXSLUwEaHYPwKZNA",
tokenID: "@dm!n",
versionID: 5.5,
);
InsuranceUpdateModel _insuranceUpdateModel = InsuranceUpdateModel(
channel: 3,
deviceTypeID: 2,
generalid: "Cs2020@2016\$2958",
iPAdress: "10.20.10.20",
isDentalAllowedBackend: false,
patientID: 1231755,
patientType: 1,
versionID: 5.5,
languageID: 2,
patientOutSA: 0,
sessionID: "ENRSJBKXnzCuuVQ",
);
InsuranceApprovalModel _insuranceApprovalModel = InsuranceApprovalModel(
versionID: 5.5,
channel: 3,
languageID: LANGUAGE_ID,
iPAdress: "10.20.10.20",
generalid: "Cs2020@2016\$2958",
patientOutSA: 0,
sessionID: "DypNmtMkivzURHjeYg",
isDentalAllowedBackend: false,
deviceTypeID: 2,
patientID: 1231755,
tokenID: "@dm!n",
patientTypeID: 1,
patientType: 1,
eXuldAPPNO: 0,
@ -89,21 +50,22 @@ class InsuranceCardService extends BaseService {
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: _insuranceCardModel.toJson());
}, body: Map());
}
Future getInsuranceUpdate() async {
hasError = false;
// _cardList.clear();
_cardList.clear();
await baseAppClient.post(GET_PAtIENTS_INSURANCE_UPDATED,
onSuccess: (dynamic response, int statusCode) {
_cardUpdated.clear();
response['List_PatientInsuranceCardHistory'].forEach((item) {
_cardUpdated.add(InsuranceUpdateModel.fromJson(item));
});
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: _insuranceUpdateModel.toJson());
}, body: Map());
}
Future getInsuranceApproval({int appointmentNo}) async {
@ -163,4 +125,15 @@ class InsuranceCardService extends BaseService {
throw error;
}
}
Future getInsuranceDetails(data) async{
dynamic localRes;
await baseAppClient.post(INSURANCE_DETAILS,
onSuccess: (dynamic response, int statusCode) {
localRes = response['List_InsuranceCheckList'];
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body:{'CompanyID': data.companyID,'SubCategoryID':data.subCategoryID },);
return Future.value(localRes);
}
}

@ -3,10 +3,6 @@ import 'package:diplomaticquarterapp/core/model/my_trakers/blood_pressur/BloodPr
import 'package:diplomaticquarterapp/core/model/my_trakers/blood_pressur/MonthBloodPressureResultAverage.dart';
import 'package:diplomaticquarterapp/core/model/my_trakers/blood_pressur/WeekBloodPressureResultAverage.dart';
import 'package:diplomaticquarterapp/core/model/my_trakers/blood_pressur/YearBloodPressureResultAverage.dart';
import 'package:diplomaticquarterapp/core/model/my_trakers/blood_sugar/DiabtecPatientResult.dart';
import 'package:diplomaticquarterapp/core/model/my_trakers/blood_sugar/MonthDiabtectResultAverage.dart';
import 'package:diplomaticquarterapp/core/model/my_trakers/blood_sugar/WeekDiabtectResultAverage.dart';
import 'package:diplomaticquarterapp/core/model/my_trakers/blood_sugar/YearDiabtecResultAverage.dart';
import 'package:diplomaticquarterapp/core/service/base_service.dart';
class BloodPressureService extends BaseService {

@ -1,12 +1,4 @@
import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/core/model/my_trakers/blood_pressur/BloodPressureResult.dart';
import 'package:diplomaticquarterapp/core/model/my_trakers/blood_pressur/MonthBloodPressureResultAverage.dart';
import 'package:diplomaticquarterapp/core/model/my_trakers/blood_pressur/WeekBloodPressureResultAverage.dart';
import 'package:diplomaticquarterapp/core/model/my_trakers/blood_pressur/YearBloodPressureResultAverage.dart';
import 'package:diplomaticquarterapp/core/model/my_trakers/blood_sugar/DiabtecPatientResult.dart';
import 'package:diplomaticquarterapp/core/model/my_trakers/blood_sugar/MonthDiabtectResultAverage.dart';
import 'package:diplomaticquarterapp/core/model/my_trakers/blood_sugar/WeekDiabtectResultAverage.dart';
import 'package:diplomaticquarterapp/core/model/my_trakers/blood_sugar/YearDiabtecResultAverage.dart';
import 'package:diplomaticquarterapp/core/model/my_trakers/weight/MonthWeightMeasurementResultAverage.dart';
import 'package:diplomaticquarterapp/core/model/my_trakers/weight/WeekWeightMeasurementResultAverage.dart';
import 'package:diplomaticquarterapp/core/model/my_trakers/weight/WeightMeasurementResult.dart';

@ -9,10 +9,12 @@ import 'package:diplomaticquarterapp/core/service/base_service.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
class LabsService extends BaseService {
RequestPatientLabOrders _requestPatientLabOrders = RequestPatientLabOrders();
List<PatientLabOrders> patientLabOrdersList = List();
Future getPatientLabOrdersList() async {
hasError = false;
Map<String,dynamic> body = Map();
body['isDentalAllowedBackend'] = false;
await baseAppClient.post(GET_Patient_LAB_ORDERS,
onSuccess: (dynamic response, int statusCode) {
patientLabOrdersList.clear();
@ -22,7 +24,7 @@ class LabsService extends BaseService {
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: _requestPatientLabOrders.toJson());
}, body: body);
}
RequestPatientLabSpecialResult _requestPatientLabSpecialResult =
@ -39,7 +41,7 @@ class LabsService extends BaseService {
hasError = false;
_requestPatientLabSpecialResult.projectID = projectID;
_requestPatientLabSpecialResult.clinicID = clinicID;
_requestPatientLabSpecialResult.invoiceNo = invoiceNo; //'1800296522';//;
_requestPatientLabSpecialResult.invoiceNo = invoiceNo;
_requestPatientLabSpecialResult.orderNo = orderNo;
await baseAppClient.post(GET_Patient_LAB_SPECIAL_RESULT,
@ -59,10 +61,10 @@ class LabsService extends BaseService {
Map<String, dynamic> body = Map();
body['InvoiceNo'] = patientLabOrder.invoiceNo;
body['OrderNo'] = patientLabOrder.orderNo;
body['Procedure'] = "U/A";
body['isDentalAllowedBackend'] = false;
body['SetupID'] = patientLabOrder.setupID;
body['ProjectID'] = patientLabOrder.projectID;
body['ClinicID'] = patientLabOrder.clinicID;
//TODO Check the res
await baseAppClient.post(GET_Patient_LAB_RESULT,
onSuccess: (dynamic response, int statusCode) {
patientLabSpecialResult.clear();

@ -2,10 +2,13 @@ import 'dart:convert';
import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/model/my_balance/AdvanceModel.dart';
import 'package:diplomaticquarterapp/core/model/my_balance/patient_advance_balance_amount.dart';
import 'package:diplomaticquarterapp/core/model/my_balance/patient_info.dart';
import 'package:diplomaticquarterapp/core/model/my_balance/patient_info_and_mobile_number.dart';
import 'package:diplomaticquarterapp/core/service/AuthenticatedUserObject.dart';
import 'package:diplomaticquarterapp/core/service/base_service.dart';
import 'package:diplomaticquarterapp/locator.dart';
import 'package:diplomaticquarterapp/models/FamilyFiles/GetAllSharedRecordByStatusResponse.dart';
import 'package:diplomaticquarterapp/models/FamilyFiles/GetAllSharedRecordsByStatusReq.dart';
import 'package:diplomaticquarterapp/services/family_files/family_files_provider.dart';
@ -21,6 +24,8 @@ class MyBalanceService extends BaseService {
String logInTokenID;
String verificationCode;
AuthenticatedUserObject authenticatedUserObject = locator<AuthenticatedUserObject>();
getPatientAdvanceBalanceAmount() async {
hasError = false;
super.error = "";
@ -61,8 +66,8 @@ class MyBalanceService extends BaseService {
super.error = "";
Map<String, dynamic> body = Map();
body['isDentalAllowedBackend'] = false;
body['MobileNo'] = user.mobileNumber;
body['ProjectID'] = user.projectID;
body['MobileNo'] = authenticatedUserObject.user.mobileNumber;
body['ProjectID'] = authenticatedUserObject.user.projectID;
await baseAppClient.post(GET_PATIENT_INFO_BY_ID_AND_MOBILE_NUMBER,
onSuccess: (response, statusCode) async {
@ -143,7 +148,7 @@ class MyBalanceService extends BaseService {
await sharedPref.getObject(FAMILY_FILE));
return getAllSharedRecordsByStatusResponse;
} else {
return getSharedRecordByStatus();
return await getSharedRecordByStatus();
}
}
}

@ -22,12 +22,6 @@ class MyDoctorService extends BaseService {
channel: 3,
deviceTypeID: 2,
doctorID: 2477,
iPAdress: '10.20.10.20',
languageID: 2,
patientOutSA: 0,
sessionID: 'CvsUFeJkyLDnFQqw',
versionID: 5.5,
generalid: 'Cs2020@2016\$2958',
isDentalAllowedBackend: false);
Future getPatientDoctorAppointmentList({int top = 0, int beforeDays = 0,int exludType=4}) async {
@ -52,18 +46,6 @@ class MyDoctorService extends BaseService {
RequestDoctorProfile _requestDoctorProfile = RequestDoctorProfile(
license: true,
isRegistered: true,
projectID: 12,
clinicID: 501,
patientID: 1231755,
versionID: 5.5,
channel: 3,
languageID: 2,
iPAdress: '10.20.10.20',
generalid: 'Cs2020@2016\$2958',
patientOutSA: 0,
sessionID: 'nstatCtNEmuwxeuVAOUmw',
isDentalAllowedBackend: false,
deviceTypeID: 2,
);
Future getDoctorProfileAndRating(
@ -87,7 +69,7 @@ class MyDoctorService extends BaseService {
}, body: _requestDoctorProfile.toJson());
///GET DOCTOR RATING
//_requestDoctorRating.doctorID = doctorId;
_requestDoctorRating.doctorID = doctorId;
await baseAppClient.post(GET_DOCTOR_RATING,
onSuccess: (dynamic response, int statusCode) {
doctorRating = DoctorRating.fromJson(response['AvgDoctorRatingList'][0]);

@ -11,40 +11,17 @@ import 'package:diplomaticquarterapp/core/model/prescriptions/request_prescripti
import 'package:diplomaticquarterapp/core/model/prescriptions/request_prescriptions_orders.dart';
import 'package:diplomaticquarterapp/core/model/prescriptions/request_send_prescription_email.dart';
import 'package:diplomaticquarterapp/core/service/base_service.dart';
import 'package:flutter/cupertino.dart';
class PrescriptionsService extends BaseService {
List<Prescriptions> prescriptionsList = List();
RequestPrescriptions _requestPrescriptions = RequestPrescriptions(
versionID: 5.5,
channel: 3,
languageID: 2,
iPAdress: '10.20.10.20',
generalid: 'Cs2020@2016\$2958',
patientOutSA: 0,
sessionID: 'KIbLoqkytuKJEWECHQ',
isDentalAllowedBackend: false,
deviceTypeID: 2,
patientID: 1231755,
tokenID: '@dm!n',
patientTypeID: 1,
patientType: 1);
List<PrescriptionsOrder> prescriptionsOrderList = List();
RequestPrescriptionsOrders _requestPrescriptionsOrders =
RequestPrescriptionsOrders(
patientID: 1231755,
patientOutSA: 0,
versionID: 5.5,
channel: 3,
languageID: 1,
iPAdress: '10.20.10.20',
generalid: 'Cs2020@2016\$2958',
sessionID: 'KIbLoqkytuKJEWECHQ',
isDentalAllowedBackend: false,
deviceTypeID: 2);
Future getPrescriptions() async {
hasError = false;
Map<String, dynamic> body = Map();
body['isDentalAllowedBackend'] = false;
await baseAppClient.post(PRESCRIPTIONS,
onSuccess: (dynamic response, int statusCode) {
prescriptionsList.clear();
@ -54,10 +31,12 @@ class PrescriptionsService extends BaseService {
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: _requestPrescriptions.toJson());
}, body: body);
}
Future getPrescriptionsOrders() async {
Map<String, dynamic> body = Map();
body['isDentalAllowedBackend'] = false;
await baseAppClient.post(GET_PRESCRIPTIONS_ALL_ORDERS,
onSuccess: (dynamic response, int statusCode) {
prescriptionsOrderList.clear();
@ -69,35 +48,23 @@ class PrescriptionsService extends BaseService {
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: _requestPrescriptionsOrders.toJson());
}, body: body);
}
RequestPrescriptionReport _requestPrescriptionReport =
RequestPrescriptionReport(
appointmentNo: 0,
channel: 3,
clinicID: 4,
deviceTypeID: 2,
dischargeNo: 2018003246,
episodeID: 0,
iPAdress: '10.20.10.20',
languageID: 1,
patientID: 1231755,
patientOutSA: 0,
patientType: 1,
patientTypeID: 1,
projectID: 12,
sessionID: 'wgKuHpsPsEuLnlJhAYCQ',
tokenID: '@dm!n',
setupID: "91877",
versionID: 5.5,
generalid: 'Cs2020@2016\$2958',
isDentalAllowedBackend: false);
appointmentNo: 0, isDentalAllowedBackend: false);
List<PrescriptionReport> prescriptionReportList = List();
Future getPrescriptionReport({int dischargeNo}) async {
Future getPrescriptionReport(
{int dischargeNo, int projectId, int clinicID, String setupID,int episodeID}) async {
hasError = false;
_requestPrescriptionReport.dischargeNo = dischargeNo;
_requestPrescriptionReport.projectID = projectId;
_requestPrescriptionReport.clinicID = clinicID;
_requestPrescriptionReport.setupID = setupID;
_requestPrescriptionReport.episodeID = episodeID;
await baseAppClient.post(GET_PRESCRIPTION_REPORT,
onSuccess: (dynamic response, int statusCode) {
prescriptionReportList.clear();
@ -112,24 +79,7 @@ class PrescriptionsService extends BaseService {
RequestSendPrescriptionEmail _requestSendPrescriptionEmail =
RequestSendPrescriptionEmail(
versionID: 5.5,
languageID: 2,
channel: 3,
iPAdress: '10.20.10.20',
generalid: 'Cs2020@2016\$2958',
patientOutSA: 0,
sessionID: 'twIUmHfOHqFdDfVcyw',
isDentalAllowedBackend: false,
deviceTypeID: 2,
tokenID: '@dm!n',
patientTypeID: 1,
patientType: 1,
to: 'aljammalzmohammad@outlook.com',
dateofBirth: '/Date(536743800000+0300)/',
patientIditificationNum: '2344670985',
patientMobileNumber: '537503378',
patientName: 'TAMER FANASHEH',
setupID: '91877');
isDentalAllowedBackend: false,);
Future sendPrescriptionEmail(String appointmentDate, int patientID,
String clinicName, String doctorName, int projectID) async {
@ -139,28 +89,25 @@ class PrescriptionsService extends BaseService {
_requestSendPrescriptionEmail.clinicName = clinicName;
_requestSendPrescriptionEmail.doctorName = doctorName;
_requestSendPrescriptionEmail.projectID = projectID;
_requestSendPrescriptionEmail.to = user.emailAddress;
_requestSendPrescriptionEmail.dateofBirth = user.dateofBirth;
_requestSendPrescriptionEmail.patientIditificationNum = user.patientIdentificationNo;
_requestSendPrescriptionEmail.patientMobileNumber = user.mobileNumber;
_requestSendPrescriptionEmail.patientName = user.firstName +" "+ user.lastName;
_requestSendPrescriptionEmail.setupID = user.setupID;
hasError = false;
await baseAppClient.post(SEND_PRESCRIPTION_EMAIL,
onFailure: (String error, int statusCode) {
await baseAppClient.post(SEND_PRESCRIPTION_EMAIL, onSuccess: (response, statusCode) {},
onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: _requestSendPrescriptionEmail.toJson());
}
RequestGetListPharmacyForPrescriptions
requestGetListPharmacyForPrescriptions =
RequestGetListPharmacyForPrescriptions(
RequestGetListPharmacyForPrescriptions requestGetListPharmacyForPrescriptions = RequestGetListPharmacyForPrescriptions(
latitude: 0,
longitude: 0,
versionID: 5.5,
channel: 3,
languageID: 2,
iPAdress: '10.20.10.20',
generalid: 'Cs2020@2016\$2958',
patientOutSA: 0,
sessionID: 'HGNerTUSXhpaHXBg',
isDentalAllowedBackend: false,
deviceTypeID: 2,
);
List<PharmacyPrescriptions> pharmacyPrescriptionsList = List();
@ -180,44 +127,85 @@ class PrescriptionsService extends BaseService {
}, body: requestGetListPharmacyForPrescriptions.toJson());
}
RequestPrescriptionReportEnh _requestPrescriptionReportEnh =
RequestPrescriptionReportEnh(isDentalAllowedBackend: false,);
RequestPrescriptionReportEnh _requestPrescriptionReportEnh = RequestPrescriptionReportEnh(
versionID: 5.5,
channel: 3,
languageID: 2,
iPAdress: '10.20.10.20',
generalid: 'Cs2020@2016\$2958',
patientOutSA: 0,
sessionID: 'bQQdesEKpyYKTFMVNeg',
isDentalAllowedBackend: false,
deviceTypeID: 2,
patientID: 1231755,
tokenID: '@dm!n',
patientTypeID: 1,
patientType: 1,
setupID: '91877',
appointmentNo: 5926390,
episodeID: 140251928,
clinicID: 25,
projectID: 12
List<PrescriptionReportEnh> prescriptionReportEnhList = List();
);
Future getPrescriptionReportEnh({PrescriptionsOrder prescriptionsOrder}) async {
///This logic copy from the old app from class [order-history.component.ts] in line 45
bool isInPatient = false;
prescriptionsList.forEach((element) {
if (prescriptionsOrder.appointmentNo == "0") {
if (element.dischargeNo == int.parse(prescriptionsOrder.dischargeID)) {
_requestPrescriptionReportEnh.appointmentNo = element.appointmentNo;
_requestPrescriptionReportEnh.clinicID = element.clinicID;
_requestPrescriptionReportEnh.projectID = element.projectID;
_requestPrescriptionReportEnh.episodeID = element.episodeID;
_requestPrescriptionReportEnh.setupID = element.setupID;
_requestPrescriptionReportEnh.dischargeNo = element.dischargeNo;
isInPatient = element.isInOutPatient;
}
} else {
if (int.parse(prescriptionsOrder.appointmentNo) == element.appointmentNo) {
_requestPrescriptionReportEnh.appointmentNo = element.appointmentNo;
_requestPrescriptionReportEnh.clinicID = element.clinicID;
_requestPrescriptionReportEnh.projectID = element.projectID;
_requestPrescriptionReportEnh.episodeID = element.episodeID;
_requestPrescriptionReportEnh.setupID = element.setupID;
_requestPrescriptionReportEnh.dischargeNo = element.dischargeNo;
isInPatient = element.isInOutPatient;///call inpGetPrescriptionReport
}
}
});
List<PrescriptionReportEnh> prescriptionReportEnhList = List();
Future getPrescriptionReportEnh({PrescriptionsOrder prescriptionsOrder})async{
hasError = false;
// _requestPrescriptionReportEnh.appointmentNo = int.parse(prescriptionsOrder.appointmentNo);
// _requestPrescriptionReportEnh.patientID = prescriptionsOrder.projectID;
await baseAppClient.post(GET_PRESCRIPTION_REPORT_ENH,
await baseAppClient.post(isInPatient? GET_PRESCRIPTION_REPORT_ENH : GET_PRESCRIPTION_REPORT,
onSuccess: (dynamic response, int statusCode) {
prescriptionReportEnhList.clear();
response['ListPRM'].forEach((prescriptions) {
prescriptionReportEnhList.add(PrescriptionReportEnh.fromJson(prescriptions));
});
prescriptionReportEnhList.clear();
if(isInPatient){
response['ListPRM'].forEach((prescriptions) {
prescriptionReportEnhList.add(PrescriptionReportEnh.fromJson(prescriptions));
});
}else{
response['INP_GetPrescriptionReport_List'].forEach((prescriptions) {
PrescriptionReportEnh reportEnh = PrescriptionReportEnh.fromJson(prescriptions);
reportEnh.itemDescription = prescriptions['ItemDescriptionN'];
prescriptionReportEnhList.add(reportEnh);
});
}
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: _requestPrescriptionReportEnh.toJson());
}
Future updatePressOrder({@required int presOrderID}) async {
hasError = false;
Map<String, dynamic> body = Map();
body['PresOrderID'] = presOrderID;
body['EditedBy'] = user.patientID;
body['RejectionReason'] = '';
body['PresOrderStatus'] = 4;
body['isDentalAllowedBackend'] = false;
await baseAppClient.post(UPDATE_PRESS_ORDER,
onSuccess: (dynamic response, int statusCode) {
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: _requestPrescriptionReportEnh.toJson());
}, body: body);
}
}

@ -12,19 +12,8 @@ class ReportsMonthlyService extends BaseService {
isReport: true,
encounterType: 1,
requestType: 1,
versionID: 5.5,
channel: 3,
languageID: 2,
iPAdress: "10.20.10.20",
generalid: 'Cs2020@2016\$2958',
patientOutSA: 0,
sessionID: 'KIbLoqkytuKJEWECHQ',
isDentalAllowedBackend: false,
deviceTypeID: 2,
patientID: 1231755,
tokenID: '@dm!n',
patientTypeID: 1,
patientType: 1);
);
Future getReports() async {
hasError = false;

@ -12,19 +12,8 @@ class ReportsService extends BaseService {
isReport: true,
encounterType: 1,
requestType: 1,
versionID: 5.5,
channel: 3,
languageID: 2,
iPAdress: "10.20.10.20",
generalid: 'Cs2020@2016\$2958',
patientOutSA: 0,
sessionID: 'KIbLoqkytuKJEWECHQ',
isDentalAllowedBackend: false,
deviceTypeID: 2,
patientID: 1231755,
tokenID: '@dm!n',
patientTypeID: 1,
patientType: 1);
);
Future getReports() async {
hasError = false;

@ -0,0 +1,40 @@
import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/core/model/notifications/get_notifications_request_model.dart';
import 'package:diplomaticquarterapp/core/model/notifications/get_notifications_response_model.dart';
import 'package:diplomaticquarterapp/core/model/notifications/mark_message_as_read_request_model.dart';
import 'package:diplomaticquarterapp/core/service/base_service.dart';
class NotificationService extends BaseService {
List<GetNotificationsResponseModel> notificationsList = List();
Future getAllNotifications(GetNotificationsRequestModel getNotificationsRequestModel ) async {
hasError = false;
await baseAppClient.post(PUSH_NOTIFICATION_GET_ALL_NOTIFICATIONS,
onSuccess: (dynamic response, int statusCode) {
if(getNotificationsRequestModel.currentPage ==0)
notificationsList.clear();
response['List_GetAllNotificationsFromPool'].forEach((appoint) {
notificationsList.add(GetNotificationsResponseModel.fromJson(appoint));
});
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: getNotificationsRequestModel.toJson());
}
Future markAsRead(MarkMessageAsReadRequestModel markMessageAsReadRequestModel ) async {
hasError = false;
await baseAppClient.post(PUSH_NOTIFICATION_SET_MESSAGES_FROM_POOL_AS_READ,
onSuccess: (dynamic response, int statusCode) {
updateNotification(markMessageAsReadRequestModel.notificationPoolID);
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: markMessageAsReadRequestModel.toJson());
}
updateNotification(id) {
int index = notificationsList.indexWhere((element) => element.id == id);
notificationsList[index].isRead = true;
}
}

@ -30,6 +30,9 @@ class BaseViewModel extends ChangeNotifier {
}
BaseViewModel() {
//authenticatedUserObject.getUser();
user = authenticatedUserObject.user;
this.isLogin = authenticatedUserObject.isLogin;
_getUser();
}

@ -10,7 +10,7 @@ class DashboardViewModel extends BaseViewModel {
String bloadType = "";
getPatientRadOrders() async {
if (!isLogin && _vitalSignService.weightKg.isEmpty) {
if (isLogin && _vitalSignService.weightKg.isEmpty) {
setState(ViewState.Busy);
await _vitalSignService.getPatientRadOrders();
if (_vitalSignService.hasError) {

@ -3,6 +3,8 @@ import 'package:diplomaticquarterapp/core/model/feedback/COC_items.dart';
import 'package:diplomaticquarterapp/core/service/feedback/feedback_service.dart';
import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart';
import 'package:diplomaticquarterapp/pages/feedback/appointment_history.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:flutter/cupertino.dart';
import '../../../locator.dart';
@ -22,7 +24,31 @@ class FeedbackViewModel extends BaseViewModel {
MessageType messageType = MessageType.NON;
MessageType messageTypeDialog = MessageType.NON;
String selected = "not selected";
String getSelected(BuildContext context) {
switch (messageType) {
case MessageType.ComplaintOnAnAppointment:
return TranslationBase.of(context).complainAppo;
break;
case MessageType.ComplaintWithoutAppointment:
return TranslationBase.of(context).complainWithoutAppo;
break;
case MessageType.Question:
return TranslationBase.of(context).question;
break;
case MessageType.Compliment:
return TranslationBase.of(context).compliment;
break;
case MessageType.Suggestion:
return TranslationBase.of(context).suggestion;
break;
case MessageType.NON:
return TranslationBase.of(context).notClassified;
break;
}
return TranslationBase.of(context).notClassified;
}
setMessageDialogType(MessageType messageType) {
messageTypeDialog = messageType;
@ -33,19 +59,14 @@ class FeedbackViewModel extends BaseViewModel {
this.messageType = messageType;
switch (messageType) {
case MessageType.ComplaintOnAnAppointment:
selected = "Complaint on an appointment";
break;
case MessageType.ComplaintWithoutAppointment:
selected = "Complaint without appointment";
break;
case MessageType.Question:
selected = "Question";
break;
case MessageType.Compliment:
selected = "Compliment";
break;
case MessageType.Suggestion:
selected = "Suggestion";
break;
case MessageType.NON:
break;

@ -65,11 +65,12 @@ class InsuranceViewModel extends BaseViewModel {
}
Future getFamilyFiles() async {
await _insuranceCardService.getFamilyFiles();
await _insuranceCardService.getSharedRecordByStatus();
if (_insuranceCardService.hasError) {
error = _insuranceCardService.error;
setState(ViewState.Error);
} else
setState(ViewState.Idle);
}
}

@ -82,6 +82,8 @@ class LabsViewModel extends BaseViewModel {
List<LabResult> get labResultList => _labsService.labResultList;
List<LabResultList> labResultLists = List();
getLaboratoryResult(
{String projectID,
int clinicID,
@ -110,6 +112,24 @@ class LabsViewModel extends BaseViewModel {
error = _labsService.error;
setState(ViewState.Error);
} else {
_labsService.labResultList.forEach((element) {
List<LabResultList> patientLabOrdersClinic =
labResultLists
.where((elementClinic) =>
elementClinic.filterName == element.testCode)
.toList();
if (patientLabOrdersClinic.length != 0) {
labResultLists[labResultLists.indexOf(patientLabOrdersClinic[0])]
.patientLabResultList
.add(element);
} else {
labResultLists.add(LabResultList(
filterName: element.testCode,
lab: element));
}
});
setState(ViewState.Idle);
}
}

@ -14,7 +14,6 @@ class MedicalViewModel extends BaseViewModel {
getAppointmentHistory() async {
if (authenticatedUserObject.isLogin) {
setState(ViewState.Busy);
if (_medicalService.appoitmentAllHistoryResultList.length == 0)
await _medicalService.getAppointmentHistory();
if (_medicalService.hasError) {
error = _medicalService.error;

@ -2,6 +2,7 @@ import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/model/blooddonation/blood_groub_details.dart';
import 'package:diplomaticquarterapp/core/model/blooddonation/get_all_cities.dart';
import 'package:diplomaticquarterapp/core/model/hospitals/hospitals_model.dart';
import 'package:diplomaticquarterapp/core/model/my_balance/AdvanceModel.dart';
import 'package:diplomaticquarterapp/core/model/my_balance/patient_advance_balance_amount.dart';
import 'package:diplomaticquarterapp/core/model/my_balance/patient_info.dart';
import 'package:diplomaticquarterapp/core/model/my_balance/patient_info_and_mobile_number.dart';
@ -25,11 +26,15 @@ class MyBalanceViewModel extends BaseViewModel {
_myBalanceService.patientAdvanceBalanceAmountList;
//========================
BloodDonationService _bloodDonationService =locator<BloodDonationService>();
List<CitiesModel> get CitiesModelList => _bloodDonationService.CitiesModelList;
BloodDetailsService _bloodDetailsService =locator<BloodDetailsService>();
List<List_BloodGroupDetailsModel> get BloodDetailsModelList => _bloodDetailsService.BloodModelList;//_bloodDonationService.CitiesModelList;
BloodDonationService _bloodDonationService = locator<BloodDonationService>();
List<CitiesModel> get CitiesModelList =>
_bloodDonationService.CitiesModelList;
BloodDetailsService _bloodDetailsService = locator<BloodDetailsService>();
List<List_BloodGroupDetailsModel> get BloodDetailsModelList =>
_bloodDetailsService
.BloodModelList; //_bloodDonationService.CitiesModelList;
//===========================
@ -44,8 +49,8 @@ class MyBalanceViewModel extends BaseViewModel {
PatientInfoAndMobileNumber get patientInfoAndMobileNumber =>
_myBalanceService.patientInfoAndMobileNumber;
String get logInTokenID => _myBalanceService.logInTokenID;
String get verificationCode => _myBalanceService.verificationCode;
getPatientAdvanceBalanceAmount() async {
@ -68,6 +73,7 @@ class MyBalanceViewModel extends BaseViewModel {
} else
setState(ViewState.Idle);
}
//==============
Future getCities() async {
setState(ViewState.Busy);
@ -79,9 +85,11 @@ class MyBalanceViewModel extends BaseViewModel {
} else
setState(ViewState.Idle);
}
Future getBlood() async {
setState(ViewState.Busy);
await _bloodDetailsService .getAllBloodOrders();;
await _bloodDetailsService.getAllBloodOrders();
;
if (_bloodDetailsService.hasError) {
error = _bloodDetailsService.error;
@ -89,6 +97,7 @@ class MyBalanceViewModel extends BaseViewModel {
} else
setState(ViewState.Idle);
}
//===============
Future getPatientInfoByPatientID({String id}) async {
@ -105,7 +114,8 @@ class MyBalanceViewModel extends BaseViewModel {
Future getPatientInfoByPatientIDAndMobileNumber() async {
setState(ViewState.Busy);
await _myBalanceService.getPatientInfoByPatientIDAndMobileNumber();
await _myBalanceService
.getPatientInfoByPatientIDAndMobileNumber();
if (_myBalanceService.hasError) {
error = _myBalanceService.error;
setState(ViewState.ErrorLocal);
@ -115,9 +125,11 @@ class MyBalanceViewModel extends BaseViewModel {
}
}
Future sendActivationCodeForAdvancePayment({int patientID,int projectID}) async {
Future sendActivationCodeForAdvancePayment(
{int patientID, int projectID}) async {
setState(ViewState.Busy);
await _myBalanceService.sendActivationCodeForAdvancePayment(patientID: patientID,projectID: projectID);
await _myBalanceService.sendActivationCodeForAdvancePayment(
patientID: patientID, projectID: projectID);
if (_myBalanceService.hasError) {
error = _myBalanceService.error;
setState(ViewState.ErrorLocal);
@ -126,9 +138,12 @@ class MyBalanceViewModel extends BaseViewModel {
setState(ViewState.Idle);
}
}
Future checkActivationCodeForAdvancePayment({String activationCode}) async {
Future checkActivationCodeForAdvancePayment(
{String activationCode, String patientMobileNumber}) async {
setState(ViewState.Busy);
await _myBalanceService.checkActivationCodeForAdvancePayment(activationCode: activationCode);
await _myBalanceService.checkActivationCodeForAdvancePayment(
activationCode: activationCode);
if (_myBalanceService.hasError) {
error = _myBalanceService.error;
setState(ViewState.ErrorLocal);

@ -3,6 +3,7 @@ import 'package:diplomaticquarterapp/core/model/prescriptions/prescription_repor
import 'package:diplomaticquarterapp/core/model/prescriptions/prescription_report_enh.dart';
import 'package:diplomaticquarterapp/core/model/prescriptions/prescriptions_order.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:flutter/cupertino.dart';
import '../../../core/enum/filter_type.dart';
import '../../../core/enum/viewstate.dart';
@ -102,9 +103,9 @@ class PrescriptionsViewModel extends BaseViewModel {
notifyListeners();
}
getPrescriptionReport({int dischargeNo}) async {
getPrescriptionReport({int dischargeNo,int projectId,int clinicID,String setupID,int episodeID}) async {
setState(ViewState.Busy);
await _prescriptionsService.getPrescriptionReport(dischargeNo: dischargeNo);
await _prescriptionsService.getPrescriptionReport(dischargeNo: dischargeNo,projectId: projectId,clinicID: clinicID,setupID: setupID,episodeID: episodeID);
if (_prescriptionsService.hasError) {
error = _prescriptionsService.error;
setState(ViewState.ErrorLocal);
@ -157,4 +158,16 @@ class PrescriptionsViewModel extends BaseViewModel {
}
}
Future updatePressOrder({@required int presOrderID}) async {
setState(ViewState.Busy);
await _prescriptionsService.updatePressOrder(presOrderID: presOrderID);
if (_prescriptionsService.hasError) {
error = _prescriptionsService.error;
setState(ViewState.Error);
} else {
await getPrescriptions();
}
}
}

@ -0,0 +1,40 @@
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/model/notifications/get_notifications_request_model.dart';
import 'package:diplomaticquarterapp/core/model/notifications/get_notifications_response_model.dart';
import 'package:diplomaticquarterapp/core/model/notifications/mark_message_as_read_request_model.dart';
import 'package:diplomaticquarterapp/core/service/notifications_service.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:flutter/material.dart';
import '../../locator.dart';
import 'base_view_model.dart';
class NotificationViewModel extends BaseViewModel {
NotificationService _notificationService = locator<NotificationService>();
List<GetNotificationsResponseModel> get notifications =>
_notificationService.notificationsList;
Future getNotifications(
GetNotificationsRequestModel getNotificationsRequestModel, BuildContext context) async {
if(getNotificationsRequestModel.currentPage == 0)
setState(ViewState.Busy);
await _notificationService
.getAllNotifications(getNotificationsRequestModel);
if (_notificationService.hasError) {
error = _notificationService.error;
setState(ViewState.Error);
} else {
setState(ViewState.Idle);
}
}
Future markAsRead(id) async {
// setState(ViewState.Busy);
MarkMessageAsReadRequestModel markMessageAsReadRequestModel =
new MarkMessageAsReadRequestModel(notificationPoolID: id);
await _notificationService.markAsRead(markMessageAsReadRequestModel);
setState(ViewState.Idle);
}
}

@ -12,32 +12,36 @@ import 'package:flutter_datetime_picker/flutter_datetime_picker.dart';
class ProjectViewModel extends BaseViewModel {
// Platform Bridge
PlatformBridge platformBridge() {
return PlatformBridge();
return PlatformBridge.shared();
}
AppSharedPreferences sharedPref = AppSharedPreferences();
Locale _appLocale;
String currentLanguage = 'en';
Locale _appLocale = Locale('ar');
String currentLanguage = 'ar';
bool _isArabic = false;
bool isInternetConnection = true;
bool isLoading = false;
bool isError = false;
String error = '';
dynamic searchvalue;
bool isLogin = false;
dynamic get searchValue => searchvalue;
Locale get appLocal => _appLocale;
LocaleType get localeType => isArabic ? LocaleType.en : LocaleType.ar;
bool get isArabic => _isArabic;
// BaseViewModel baseViewModel = locator<BaseViewModel>()
StreamSubscription subscription;
ProjectViewModel() {
// PlatformBridge.init(context); // Moved to 'main.dart' due to context availability
loadSharedPrefLanguage();
subscription = Connectivity()
.onConnectivityChanged
.listen((ConnectivityResult result) {
subscription = Connectivity().onConnectivityChanged.listen((ConnectivityResult result) {
switch (result) {
case ConnectivityResult.wifi:
isInternetConnection = true;
@ -54,13 +58,9 @@ class ProjectViewModel extends BaseViewModel {
}
void loadSharedPrefLanguage() async {
currentLanguage = await sharedPref.getString(APP_LANGUAGE);
_appLocale = Locale(currentLanguage ?? 'en');
_isArabic = currentLanguage != null
? currentLanguage == 'ar'
? true
: false
: true;
currentLanguage = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
_appLocale = Locale(currentLanguage);
_isArabic = currentLanguage == 'ar';
notifyListeners();
}

@ -1,11 +1,11 @@
import 'dart:convert';
// import 'package:barcode_scan/platform_wrapper.dart';
import 'package:barcode_scan_fix/barcode_scan.dart';
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/model/qr/qr_parking_model.dart';
import 'package:diplomaticquarterapp/core/service/qr_service.dart';
import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart';
import '../../locator.dart';
class QrViewModel extends BaseViewModel {
@ -15,25 +15,25 @@ class QrViewModel extends BaseViewModel {
readQr() async {
//TODO fix the barcode scan
// var result = await BarcodeScanner.scan();
// var data = json.decode(result.rawContent);
// var qRParkingID = data['QRParkingID'];
// setState(ViewState.BusyLocal);
// await _qrService.getQRParkingByID(qRParkingID);
// if (_qrService.hasError) {
// error = _qrService.error;
// setState(ViewState.ErrorLocal);
// } else {
// if (_qrService.qRParkingList.length > 0) {
// qrParkingModel = _qrService.qRParkingList[0];
// await sharedPref.setObject(IS_GO_TO_PARKING, qrParkingModel);
// isSavePark = true;
// setState(ViewState.Idle);
// } else {
// error = "Invalid Qr Code";
// setState(ViewState.ErrorLocal);
// }
// }
String result = await BarcodeScanner.scan();
var data = json.decode(result);
var qRParkingID = data['QRParkingID'];
setState(ViewState.BusyLocal);
await _qrService.getQRParkingByID(qRParkingID);
if (_qrService.hasError) {
error = _qrService.error;
setState(ViewState.ErrorLocal);
} else {
if (_qrService.qRParkingList.length > 0) {
qrParkingModel = _qrService.qRParkingList[0];
await sharedPref.setObject(IS_GO_TO_PARKING, qrParkingModel);
isSavePark = true;
setState(ViewState.Idle);
} else {
error = "Invalid Qr Code";
setState(ViewState.ErrorLocal);
}
}
}
getIsSaveParking() async {

@ -30,16 +30,13 @@ class DQIcons {
static const IconData thermometer = IconData(0xe806, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData weight_scale = IconData(0xe807, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData parking_icon = IconData(0xe808, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData more_menu_icon = IconData(0xe809, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData offer_icon = IconData(0xe80a, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData prescription_icon = IconData(0xe80b, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData search_scan_icon = IconData(0xe80c, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData share_icon = IconData(0xe80d, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData wishlist_add_icon = IconData(0xe80e, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData wishlist_icon = IconData(0xe80f, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData bg_1 = IconData(0xe810, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData bg_2 = IconData(0xe811, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData bg_3 = IconData(0xe812, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData bg_4 = IconData(0xe813, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData medication_icon = IconData(0xe814, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData blood_type_icon = IconData(0xe809, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData height_icon = IconData(0xe80a, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData online_payment_icon = IconData(0xe80b, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData search_medicine_icon = IconData(0xe80c, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData vital_sign_icon = IconData(0xe80d, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData weight_icon = IconData(0xe80e, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData my_medical_file = IconData(0xe80f, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData family = IconData(0xe810, fontFamily: _kFontFam, fontPackage: _kFontPkg);
static const IconData calendar__2_ = IconData(0xe811, fontFamily: _kFontFam, fontPackage: _kFontPkg);
}

@ -43,6 +43,7 @@ import 'core/service/medical/radiology_service.dart';
import 'core/service/medical/reports_monthly_service.dart';
import 'core/service/medical/vital_sign_service.dart';
import 'core/service/parmacyModule/order-preview-service.dart';
import 'core/service/notifications_service.dart';
import 'core/viewModels/AlHabibMedicalService/cmc_view_model.dart';
import 'core/service/parmacyModule/parmacy_module_service.dart';
@ -77,6 +78,7 @@ import 'core/viewModels/medical/reports_monthly_view_model.dart';
import 'core/viewModels/medical/vital_sign_view_model.dart';
import 'core/viewModels/medical/reports_view_model.dart';
import 'core/viewModels/medical/weight_pressure_view_model.dart';
import 'core/viewModels/notifications_view_model.dart';
import 'core/viewModels/pharmacies_view_model.dart';
import 'core/service/pharmacies_service.dart';
import 'core/service/insurance_service.dart';
@ -115,8 +117,6 @@ void setupLocator() {
locator.registerLazySingleton(() => EReferralService());
locator.registerLazySingleton(() => HomeHealthCareService());
locator.registerLazySingleton(() => CMCService());
locator.registerLazySingleton(() => PatientSickLeaveService());
locator.registerLazySingleton(() => MyBalanceService());
locator.registerLazySingleton(() => BloodSugarService());
@ -129,7 +129,6 @@ void setupLocator() {
locator.registerLazySingleton(() => FindusService());
locator.registerLazySingleton(() => LiveChatService());
locator.registerLazySingleton(() => H2OService());
locator.registerLazySingleton(() => BloodDonationService());
locator.registerLazySingleton(() => BloodDetailsService());
locator.registerLazySingleton(() => ChildVaccinesService());
@ -138,6 +137,7 @@ void setupLocator() {
locator.registerLazySingleton(() => DeleteBabyService());
locator.registerLazySingleton(() => VaccinationTableService());
locator.registerLazySingleton(() => NotificationService());
locator.registerLazySingleton(() => PharmacyModuleService());
@ -173,9 +173,6 @@ void setupLocator() {
locator.registerFactory(() => ChildVaccinesViewModel());
locator.registerFactory(() => UserInformationViewModel());
locator.registerFactory(() => VaccinationTableViewModel());
locator.registerFactory(() => AddNewChildViewModel());
locator.registerFactory(() => H2OViewModel());
locator.registerFactory(() => BloodSugarViewMode());
@ -188,6 +185,7 @@ void setupLocator() {
locator.registerFactory(() => AllergiesViewModel());
locator.registerFactory(() => HomeHealthCareViewModel());
locator.registerFactory(() => CMCViewModel());
locator.registerFactory(() => NotificationViewModel());

@ -1,30 +1,30 @@
import 'package:diplomaticquarterapp/theme/theme_notifier.dart';
import 'package:diplomaticquarterapp/models/Appointments/toDoCountProviderModel.dart';
import 'package:diplomaticquarterapp/routes.dart';
import 'package:diplomaticquarterapp/services/robo_search/event_provider.dart';
import 'package:diplomaticquarterapp/services/robo_search/search_provider.dart';
import 'package:diplomaticquarterapp/theme/theme_value.dart';
import 'package:diplomaticquarterapp/uitl/PlatformBridge.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:flutter/material.dart';
import 'package:flutter_localizations/flutter_localizations.dart';
import 'package:hexcolor/hexcolor.dart';
import 'package:provider/provider.dart';
import 'package:diplomaticquarterapp/services/robo_search/search_provider.dart';
import 'config/size_config.dart';
import 'core/viewModels/project_view_model.dart';
import 'locator.dart';
import 'package:diplomaticquarterapp/services/robo_search/event_provider.dart';
@pragma('vm:entry-point')
void customMainDartMethod() {
setupLocator();
runApp(MyApp());
}
void main() async {
setupLocator();
runApp(MyApp());
runApp(ChangeNotifierProvider<ThemeNotifier>(create: (context) => ThemeNotifier(defaultTheme), child: MyApp()));
}
class MyApp extends StatelessWidget {
/// static final _myTabbedPageKey = new GlobalKey<_LandingPageState>();
@override
Widget build(BuildContext context) {
PlatformBridge.init(context);
return LayoutBuilder(
builder: (context, constraints) {
return OrientationBuilder(
@ -35,8 +35,8 @@ class MyApp extends StatelessWidget {
ChangeNotifierProvider<ProjectViewModel>(
create: (context) => ProjectViewModel(),
),
ChangeNotifierProvider<SearchProvider>(
create: (context) => SearchProvider()),
ChangeNotifierProvider<ToDoCountProviderModel>(create: (context) => ToDoCountProviderModel()),
ChangeNotifierProvider<SearchProvider>(create: (context) => SearchProvider()),
ChangeNotifierProvider.value(
value: SearchProvider(),
),
@ -54,6 +54,7 @@ class MyApp extends StatelessWidget {
TranslationBaseDelegate(),
GlobalMaterialLocalizations.delegate,
GlobalWidgetsLocalizations.delegate,
GlobalCupertinoLocalizations.delegate,
],
supportedLocales: [
const Locale('ar', ''), // Arabic
@ -73,8 +74,7 @@ class MyApp extends StatelessWidget {
hintColor: Colors.grey[400],
disabledColor: Colors.grey[300],
errorColor: Color.fromRGBO(235, 80, 60, 1.0),
scaffoldBackgroundColor:
HexColor('#E9E9E9'), // Colors.grey[100],
scaffoldBackgroundColor: Color(0xffE9E9E9), // Colors.grey[100],
textSelectionColor: Color.fromRGBO(80, 100, 253, 0.5),
textSelectionHandleColor: Colors.grey,
canvasColor: Colors.white,
@ -82,8 +82,7 @@ class MyApp extends StatelessWidget {
highlightColor: Colors.grey[100].withOpacity(0.4),
splashColor: Colors.transparent,
primaryColor: Colors.grey,
bottomSheetTheme: BottomSheetThemeData(
backgroundColor: HexColor('#E0E0E0')),
bottomSheetTheme: BottomSheetThemeData(backgroundColor: HexColor('#E0E0E0')),
cursorColor: Colors.grey,
iconTheme: IconThemeData(),
appBarTheme: AppBarTheme(
@ -95,7 +94,7 @@ class MyApp extends StatelessWidget {
),
),
),
initialRoute: HOME,
initialRoute: SPLASH,
routes: routes,
debugShowCheckedModeBanner: false,
),

@ -0,0 +1,12 @@
import 'package:flutter/cupertino.dart';
class ToDoCountProviderModel with ChangeNotifier {
int _count;
int get count => _count == null ? 0 : _count;
void setState(int count) {
_count = count;
notifyListeners();
}
}

@ -60,6 +60,7 @@ class AuthenticatedUser {
dynamic strDateofBirth;
dynamic tempAddress;
dynamic zipCode;
dynamic isFamily;
// dynamic patientPayType;
// dynamic patientType;
// dynamic status;
@ -123,6 +124,7 @@ class AuthenticatedUser {
this.strDateofBirth,
this.tempAddress,
this.zipCode,
this.isFamily
});
AuthenticatedUser.fromJson(Map<String, dynamic> json) {
@ -190,6 +192,7 @@ class AuthenticatedUser {
strDateofBirth = json['StrDateofBirth'];
tempAddress = json['TempAddress'];
zipCode = json['ZipCode'];
isFamily = json['IsFamily'];
}
Map<String, dynamic> toJson() {
@ -255,7 +258,7 @@ class AuthenticatedUser {
data['StrDateofBirth'] = this.strDateofBirth;
data['TempAddress'] = this.tempAddress;
data['ZipCode'] = this.zipCode;
data['IsFamily'] = this.isFamily;
return data;
}
}

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save