diff --git a/DQKey.jks b/DQKey.jks deleted file mode 100644 index 7c844584..00000000 Binary files a/DQKey.jks and /dev/null differ diff --git a/Keystore Pass.rtf b/Keystore Pass.rtf deleted file mode 100644 index cd33f08e..00000000 --- a/Keystore Pass.rtf +++ /dev/null @@ -1,9 +0,0 @@ -{\rtf1\ansi\ansicpg1252\cocoartf2513 -\cocoatextscaling0\cocoaplatform0{\fonttbl\f0\fswiss\fcharset0 Helvetica;} -{\colortbl;\red255\green255\blue255;} -{\*\expandedcolortbl;;} -\paperw11900\paperh16840\margl1440\margr1440\vieww10800\viewh8400\viewkind0 -\pard\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\pardirnatural\partightenfactor0 - -\f0\fs24 \cf0 keyPassword=HmGsa123\ -storePassword=HmGsa123} \ No newline at end of file diff --git a/android/app/build.gradle b/android/app/build.gradle index faff5fa6..91c15cde 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -26,65 +26,43 @@ apply plugin: 'kotlin-android' apply plugin: 'com.google.gms.google-services' apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" -def keystoreProperties = new Properties() -def keystorePropertiesFile = rootProject.file('key.properties') -if (keystorePropertiesFile.exists()) { - keystoreProperties.load(new FileInputStream(keystorePropertiesFile)) -} - android { - compileSdkVersion 30 + compileSdkVersion 28 sourceSets { main.java.srcDirs += 'src/main/kotlin' } lintOptions { -// disable 'InvalidPackage' - checkReleaseBuilds false - abortOnError false + disable 'InvalidPackage' } defaultConfig { // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). applicationId "com.cloud.diplomaticquarterapp" minSdkVersion 21 - targetSdkVersion 30 + targetSdkVersion 28 versionCode flutterVersionCode.toInteger() versionName flutterVersionName multiDexEnabled true } - signingConfigs { - release { - keyAlias keystoreProperties['keyAlias'] - keyPassword keystoreProperties['keyPassword'] - storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null - storePassword keystoreProperties['storePassword'] - } - } - buildTypes { debug {} release { // TODO: Add your own signing config for the release build. // Signing with the debug keys for now, so `flutter run --release` works. -// signingConfig signingConfigs.debug -// useProguard true - -// proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' - - signingConfigs.release + signingConfig signingConfigs.debug + } + staging { + // Specifies a sorted list of fallback build types that the + // plugin should try to use when a dependency does not include a + // "staging" build type. You may specify as many fallbacks as you + // like, and the plugin selects the first build type that's + // available in the dependency. + matchingFallbacks = ['debug', 'qa', 'release'] } -// staging { -// // Specifies a sorted list of fallback build types that the -// // plugin should try to use when a dependency does not include a -// // "staging" build type. You may specify as many fallbacks as you -// // like, and the plugin selects the first build type that's -// // available in the dependency. -// matchingFallbacks = ['debug', 'qa', 'release'] -// } } } @@ -105,4 +83,10 @@ dependencies { // 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 + + } diff --git a/android/app/google-services.json b/android/app/google-services.json index a4655794..f86832ad 100644 --- a/android/app/google-services.json +++ b/android/app/google-services.json @@ -1,37 +1,39 @@ { "project_info": { - "project_number": "864393916058", - "firebase_url": "https://diplomaticquarter-d2385.firebaseio.com", - "project_id": "diplomaticquarter-d2385", - "storage_bucket": "diplomaticquarter-d2385.appspot.com" + "project_number": "815750722565", + "firebase_url": "https://api-project-815750722565.firebaseio.com", + "project_id": "api-project-815750722565", + "storage_bucket": "api-project-815750722565.appspot.com" }, "client": [ { "client_info": { - "mobilesdk_app_id": "1:864393916058:android:5b5a65cd6d8c18b4b97923", + "mobilesdk_app_id": "1:815750722565:android:62281cd3e5df4063", "android_client_info": { "package_name": "com.cloud.diplomaticquarterapp" } }, "oauth_client": [ { - "client_id": "864393916058-tphjrn8j39ntevt32ekcvmll8aue7qql.apps.googleusercontent.com", + "client_id": "815750722565-3a0gc7neins0eoahdrimrfksk0sqice8.apps.googleusercontent.com", "client_type": 3 } ], "api_key": [ { - "current_key": "AIzaSyBdV3mos1BPhUzNKCj2KANJtiO3o2zh9IM" + "current_key": "AIzaSyDUfg6AKM1-00WyzpvLImUBC46wFrq9-qw" } ], "services": { + "analytics_service": { + "status": 1 + }, "appinvite_service": { - "other_platform_oauth_client": [ - { - "client_id": "864393916058-tphjrn8j39ntevt32ekcvmll8aue7qql.apps.googleusercontent.com", - "client_type": 3 - } - ] + "status": 1, + "other_platform_oauth_client": [] + }, + "ads_service": { + "status": 2 } } } diff --git a/android/app/src/debug/AndroidManifest.xml b/android/app/src/debug/AndroidManifest.xml index beeadd9e..d8fd4e88 100644 --- a/android/app/src/debug/AndroidManifest.xml +++ b/android/app/src/debug/AndroidManifest.xml @@ -3,6 +3,5 @@ - diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index 12ced804..b2132a0d 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -7,6 +7,7 @@ FlutterApplication and put your custom class here. --> + @@ -20,11 +21,16 @@ + + + + + + android:label="diplomaticquarterapp"> + + + + + diff --git a/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/MainActivity.kt b/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/MainActivity.kt index b8a87c8c..8b73b0c7 100644 --- a/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/MainActivity.kt +++ b/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/MainActivity.kt @@ -1,11 +1,23 @@ package com.cloud.diplomaticquarterapp +import android.os.Bundle +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.plugins.GeneratedPluginRegistrant class MainActivity: FlutterFragmentActivity() { - override fun configureFlutterEngine(@NonNull flutterEngine: FlutterEngine) { - GeneratedPluginRegistrant.registerWith(flutterEngine); - } + override fun configureFlutterEngine(@NonNull flutterEngine: FlutterEngine) { + GeneratedPluginRegistrant.registerWith(flutterEngine); + // Create Flutter Platform Bridge + PlatformBridge(flutterEngine.dartExecutor.binaryMessenger, this).create() + + } + + override fun onResume() { + super.onResume() + } } \ No newline at end of file diff --git a/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/hmgwifi/HMG_Guest.kt b/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/hmgwifi/HMG_Guest.kt new file mode 100644 index 00000000..61433596 --- /dev/null +++ b/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/hmgwifi/HMG_Guest.kt @@ -0,0 +1,172 @@ +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){ + 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){ + completionOnUiThread(true, "successConnectingHmgNetwork") + + }else{ + errorConnecting() + } + } + + }else{ + errorConnecting() + } + + + + }else{ + Log.v(TAG, "Cannot connect to $SSID network") + errorConnecting() + } + } + + private fun errorConnecting(){ + completionOnUiThread(false, "errorConnectingHmgNetwork") + } + + // 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 + } +} \ No newline at end of file diff --git a/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/hmgwifi/HMG_Internet.kt b/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/hmgwifi/HMG_Internet.kt new file mode 100644 index 00000000..332e60a5 --- /dev/null +++ b/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/hmgwifi/HMG_Internet.kt @@ -0,0 +1,110 @@ +package com.cloud.diplomaticquarterapp.hmgwifi + +import android.annotation.SuppressLint +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.json.JSONObject +import java.util.* + + +@SuppressLint("MissingPermission") +class HMG_Internet(flutterMainActivity: MainActivity) { + private val TAG = "HMG_Wifi" + private val TEST = false + + private var context = flutterMainActivity; + + private lateinit var completionListener: ((status: Boolean, message: String) -> Unit) + + private var SSID = "GUEST-POC" + private var USER_NAME = "" + private var PASSWORD = "" + + fun completionOnUiThread(status: Boolean, message: String){ + completionListener(status, message) +// context.runOnUiThread { +// +// FlutterText.with(message){localized -> +// completionListener(status, localized) +// } +// } + } + + /* + * 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_Internet { + completionListener = completion + getWifiCredentials(patientId) { + WPA(context,SSID).connect(USER_NAME,PASSWORD) { status, message -> + completionOnUiThread(status,message) + } + } + return this + } + + private fun haveInternet(completion: ((status: Boolean) -> Unit)){ + if (TEST) + completion(true) + + "https://captive.apple.com".httpGet().response { request, response, result -> + result.fold(success = { + val html = String(it).toLowerCase(Locale.ENGLISH) + .replace(" ", "", true) + .replace("\n","",true) + val have = html.contains("success", true) + completion(have) + + },failure = { + completion(false) + }) + } + } + + 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. + httpPost() + .jsonBody(jsonBody, Charsets.UTF_8) + .response { request, response, result -> + + result.fold(success = { data -> + val jsonString = String(data) + val jsonObject = JSONObject(jsonString) + if(!jsonObject.getString("ErrorMessage").equals("null")){ + val errorMsg = jsonObject.getString("ErrorMessage") + completionOnUiThread(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") + success() + }else{ + completionOnUiThread(false, "somethingWentWrong") + } + } + } + } + + },failure = { error -> + completionOnUiThread(false, "somethingWentWrong" ) + }) + } + } +} \ No newline at end of file diff --git a/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/hmgwifi/WPA.kt b/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/hmgwifi/WPA.kt new file mode 100644 index 00000000..86e67def --- /dev/null +++ b/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/hmgwifi/WPA.kt @@ -0,0 +1,105 @@ +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.MainActivity +import com.cloud.diplomaticquarterapp.utils.HMGUtils + +class WPA(mainActivity: MainActivity, SSID:String) { + private var TAG = "WPA" + private var SSID = "GUEST-POC" + private var wifiManager_: WifiManager? = null + private var connectivityManager_: ConnectivityManager? = null + + init { + wifiManager_ = mainActivity.applicationContext.getSystemService(Context.WIFI_SERVICE) as WifiManager? + connectivityManager_ = mainActivity.applicationContext.getSystemService(Context.CONNECTIVITY_SERVICE) as ConnectivityManager? + } + + fun connect(identity:String, password:String, completion: (status: Boolean, message: String) -> Unit) { + if(wifiManager_ == null || connectivityManager_ == null){ + completion(false,"errorConnectingHmgNetwork") + return + } + + val wifiManager = wifiManager_!! + val connectivityManager = connectivityManager_!! + + // Initialize the WifiConfiguration object + val enterpriseConfig = WifiEnterpriseConfig() + val wifi = WifiConfiguration() + wifi.SSID = """"$SSID"""" + wifi.allowedKeyManagement.set(WifiConfiguration.KeyMgmt.WPA_EAP) + wifi.allowedKeyManagement.set(WifiConfiguration.KeyMgmt.IEEE8021X) + enterpriseConfig.eapMethod = WifiEnterpriseConfig.Eap.PEAP + enterpriseConfig.identity = identity + enterpriseConfig.password = password + wifi.enterpriseConfig = enterpriseConfig + wifi.networkId = ssidToNetworkId(wifi.SSID) + if (wifi.networkId == -1) { + wifiManager.addNetwork(wifi) + } else { + Log.v(TAG, "WiFi found - updating it.\n") + wifiManager.updateNetwork(wifi) + } + Log.v(TAG, "saving config.\n") + wifiManager.saveConfiguration() + wifi.networkId = ssidToNetworkId(wifi.SSID) + + Log.v(TAG, "wifi ID in device = " + wifi.networkId) + + var supState: SupplicantState + val networkIdToConnect = wifi.networkId + if (networkIdToConnect >= 0) { + Log.v(TAG, "Start connecting...\n") + + // We disable the network before connecting, because if this was the last connection before + // a disconnect(), this will not reconnect. + wifiManager.disableNetwork(networkIdToConnect) + wifiManager.enableNetwork(networkIdToConnect, true) + + val wifiInfo: WifiInfo = wifiManager.connectionInfo + + HMGUtils.timer(5000,false){ + supState = wifiInfo.supplicantState + Log.i(TAG, "WifiWizard: Done connect to network : status = $supState") + val successStates = listOf(COMPLETED, ASSOCIATED) + if (successStates.contains(COMPLETED /*supState*/)) + + completion(true,"Connected to internet Wifi") + + else + completion(false,"errorConnectingHmgNetwork") + } + + } else { + Log.v(TAG, "WifiWizard: cannot connect to network") + completion(false,"errorConnectingHmgNetwork") + } + } + + /** + * 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. + */ + @SuppressLint("MissingPermission") + 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 + } +} \ No newline at end of file diff --git a/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/utils/API.kt b/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/utils/API.kt new file mode 100644 index 00000000..0d5f1e7e --- /dev/null +++ b/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/utils/API.kt @@ -0,0 +1,10 @@ +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" + } +} \ No newline at end of file diff --git a/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/utils/FlutterText.kt b/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/utils/FlutterText.kt new file mode 100644 index 00000000..419eb340 --- /dev/null +++ b/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/utils/FlutterText.kt @@ -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" + } + } + + }) + } + } +} \ No newline at end of file diff --git a/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/utils/HMGUtils.kt b/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/utils/HMGUtils.kt new file mode 100644 index 00000000..13d31d74 --- /dev/null +++ b/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/utils/HMGUtils.kt @@ -0,0 +1,55 @@ +package com.cloud.diplomaticquarterapp.utils + +import android.view.View +import android.widget.Toast +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) + timer.schedule(timerTask { + tick(timer) + },delay,delay) + else + timer.schedule(timerTask { + tick(timer) + },delay) + + return timer + } + + fun popMessage(context:MainActivity, message:String){ + context.runOnUiThread { + Toast.makeText(context,message,Toast.LENGTH_LONG).show() + } + } + + fun popFlutterText(context:MainActivity, key:String){ + context.runOnUiThread { + FlutterText.with(key){ + Toast.makeText(context,it,Toast.LENGTH_LONG).show() + } + } + } + + } + +} + +private fun Timer.schedule(timerTask: TimerTask) { + +} diff --git a/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/utils/HMG_Wifi_.kt b/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/utils/HMG_Wifi_.kt new file mode 100644 index 00000000..decc9bdf --- /dev/null +++ b/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/utils/HMG_Wifi_.kt @@ -0,0 +1,351 @@ +//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("Success", 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) { +//// return +//// } +// +// val mNetworkCallback = object : ConnectivityManager.NetworkCallback() { +// override fun onLost(lostNetwork: Network?) { +//// if (network.equals(lostNetwork)){ +//// //GlyphLayout.done(false) +//// } +// } +// } +// 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) +// .onConnectionResult(object : ConnectionSuccessListener { +// override fun success() { +// Log.v(TAG,"Success") +// } +// +// override fun failed(@NonNull errorCode: ConnectionErrorCode) { +// Log.v(TAG,"Failed") +// } +// }) +// .start() +// if(isConnectedTo(ssid)){ //see if we are already connected to the given ssid +// return +// } +// +// if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) { +// 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) +// +// }else{ +// +// try { +// val wm:WifiManager= context.applicationContext.getSystemService(Context.WIFI_SERVICE) as WifiManager +// +// Log.e(TAG, "connection wifi pre Q") +// +// var netId: Int = wm.addNetwork(getWifiConfig(ssid)) +// if (netId == -1) netId = getExistingNetworkId(ssid); +// wm.saveConfiguration() +// if(wm.enableNetwork(netId, true)){ +// Log.v(TAG,"HMG-GUEST Connected") +// }else{ +// Log.v(TAG,"HMG-GUEST failed to connect") +// } +// } catch (e: Exception) { +// e.printStackTrace() +// 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 +// } +// +//} \ No newline at end of file diff --git a/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/utils/HTTPRequest.kt b/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/utils/HTTPRequest.kt new file mode 100644 index 00000000..e34c7c9b --- /dev/null +++ b/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/utils/HTTPRequest.kt @@ -0,0 +1,46 @@ +package com.cloud.diplomaticquarterapp.utils + +import android.util.Log +import java.io.BufferedReader +import java.io.InputStreamReader +import java.io.OutputStreamWriter +import java.net.HttpURLConnection +import java.net.URL +import java.net.URLEncoder + +class HTTPRequest { + val TAG = "HTTPRequest" + + fun post(serverURL:String, params:Map){ + + var encodedParamsList = params.map { + URLEncoder.encode(it.key, "UTF-8") + "=" + URLEncoder.encode(it.value,"UTF-8") + } + + val postParam = encodedParamsList.joinToString (separator = "&") + + + val url = URL(serverURL) + + with(url.openConnection() as HttpURLConnection) { + requestMethod = "POST" + + val wr = OutputStreamWriter(outputStream) + wr.write(postParam) + wr.flush() + + BufferedReader(InputStreamReader(inputStream)).use { + val response = StringBuffer() + + var inputLIne = it.readLine() + while(inputLIne != null) { + response.append(inputLIne) + inputLIne = it.readLine() + } + + it.close() + Log.v(TAG,response.toString()) + } + } + } +} \ No newline at end of file diff --git a/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/utils/PlatformBridge.kt b/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/utils/PlatformBridge.kt new file mode 100644 index 00000000..0f69a444 --- /dev/null +++ b/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/utils/PlatformBridge.kt @@ -0,0 +1,96 @@ +package com.cloud.diplomaticquarterapp.utils + +import android.content.Context +import android.net.wifi.WifiManager +import android.util.Log +import android.widget.Toast +import androidx.annotation.UiThread +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: MainActivity) { + private var binaryMessenger = binaryMessenger + private var mainActivity = flutterMainActivity + + private lateinit var channel: MethodChannel + + companion object { + private const val CHANNEL = "HMG-Platform-Bridge" + 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 == HMG_INTERNET_WIFI_CONNECT_METHOD) { + connectHMGInternetWifi(methodCall,result) + + }else if (methodCall.method == HMG_GUEST_WIFI_CONNECT_METHOD) { + connectHMGGuestWifi(methodCall,result) + + }else if (methodCall.method == ENABLE_WIFI_IF_NOT) { + enableWifiIfNot(methodCall,result) + }else{ + + result.notImplemented() + } + + } + + val res = channel.invokeMethod("localizedValue","errorConnectingHmgNetwork") + print(res) + } + + 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() + HMG_Internet(mainActivity) + .connectToHMGGuestNetwork(patientId){ status, message -> + + mainActivity.runOnUiThread { + result.success(if(status) 1 else 0) + + HMGUtils.popFlutterText(mainActivity, message) + Log.v(this.javaClass.simpleName, "$status | $message") + } + + } + } + } + + + private fun connectHMGGuestWifi(methodCall: MethodCall, result: MethodChannel.Result){ + HMG_Guest(mainActivity).connectToHMGGuestNetwork { status, message -> + mainActivity.runOnUiThread { + result.success(if(status) 1 else 0) + + HMGUtils.popFlutterText(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"); + } + } +} \ No newline at end of file diff --git a/android/app/src/main/res/mipmap-hdpi/ic_launcher.png b/android/app/src/main/res/mipmap-hdpi/ic_launcher.png index 81bc6ebb..db77bb4b 100644 Binary files a/android/app/src/main/res/mipmap-hdpi/ic_launcher.png and b/android/app/src/main/res/mipmap-hdpi/ic_launcher.png differ diff --git a/android/app/src/main/res/mipmap-mdpi/ic_launcher.png b/android/app/src/main/res/mipmap-mdpi/ic_launcher.png index a35f0ed7..17987b79 100644 Binary files a/android/app/src/main/res/mipmap-mdpi/ic_launcher.png and b/android/app/src/main/res/mipmap-mdpi/ic_launcher.png differ diff --git a/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png index 4bfdccb8..09d43914 100644 Binary files a/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png and b/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png differ diff --git a/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png index fc595a38..d5f1c8d3 100644 Binary files a/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png and b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png differ diff --git a/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png index 605c7e4a..4d6372ee 100644 Binary files a/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png and b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png differ diff --git a/android/app/src/profile/AndroidManifest.xml b/android/app/src/profile/AndroidManifest.xml index 71c11607..d8fd4e88 100644 --- a/android/app/src/profile/AndroidManifest.xml +++ b/android/app/src/profile/AndroidManifest.xml @@ -4,5 +4,4 @@ to allow setting breakpoints, to provide hot reload, etc. --> - diff --git a/android/build.gradle b/android/build.gradle index 8c57e18a..8e56476b 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -6,7 +6,7 @@ buildscript { } dependencies { - classpath 'com.android.tools.build:gradle:3.6.2' + classpath 'com.android.tools.build:gradle:4.0.1' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" classpath 'com.google.gms:google-services:4.3.2' } diff --git a/android/gradle/wrapper/gradle-wrapper.properties b/android/gradle/wrapper/gradle-wrapper.properties index 5ffeb56f..5660070d 100644 --- a/android/gradle/wrapper/gradle-wrapper.properties +++ b/android/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Wed Nov 25 14:25:50 AST 2020 +#Thu Sep 03 16:26:30 EEST 2020 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip diff --git a/help/.gitignore b/help/.gitignore new file mode 100644 index 00000000..9d532b18 --- /dev/null +++ b/help/.gitignore @@ -0,0 +1,41 @@ +# Miscellaneous +*.class +*.log +*.pyc +*.swp +.DS_Store +.atom/ +.buildlog/ +.history +.svn/ + +# IntelliJ related +*.iml +*.ipr +*.iws +.idea/ + +# The .vscode folder contains launch configuration and tasks you configure in +# VS Code which you may wish to be included in version control, so this line +# is commented out by default. +#.vscode/ + +# Flutter/Dart/Pub related +**/doc/api/ +**/ios/Flutter/.last_build_id +.dart_tool/ +.flutter-plugins +.flutter-plugins-dependencies +.packages +.pub-cache/ +.pub/ +/build/ + +# Web related +lib/generated_plugin_registrant.dart + +# Symbolication related +app.*.symbols + +# Obfuscation related +app.*.map.json diff --git a/help/.metadata b/help/.metadata new file mode 100644 index 00000000..107fcb7b --- /dev/null +++ b/help/.metadata @@ -0,0 +1,10 @@ +# This file tracks properties of this Flutter project. +# Used by Flutter tool to assess capabilities and perform upgrades etc. +# +# This file should be version controlled and should not be manually edited. + +version: + revision: 8874f21e79d7ec66d0457c7ab338348e31b17f1d + channel: stable + +project_type: app diff --git a/help/README.md b/help/README.md new file mode 100644 index 00000000..4ac021c0 --- /dev/null +++ b/help/README.md @@ -0,0 +1,16 @@ +# help + +A new Flutter project. + +## Getting Started + +This project is a starting point for a Flutter application. + +A few resources to get you started if this is your first Flutter project: + +- [Lab: Write your first Flutter app](https://flutter.dev/docs/get-started/codelab) +- [Cookbook: Useful Flutter samples](https://flutter.dev/docs/cookbook) + +For help getting started with Flutter, view our +[online documentation](https://flutter.dev/docs), which offers tutorials, +samples, guidance on mobile development, and a full API reference. diff --git a/help/android/.gitignore b/help/android/.gitignore new file mode 100644 index 00000000..0a741cb4 --- /dev/null +++ b/help/android/.gitignore @@ -0,0 +1,11 @@ +gradle-wrapper.jar +/.gradle +/captures/ +/gradlew +/gradlew.bat +/local.properties +GeneratedPluginRegistrant.java + +# Remember to never publicly share your keystore. +# See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app +key.properties diff --git a/help/android/app/build.gradle b/help/android/app/build.gradle new file mode 100644 index 00000000..f44ed6c9 --- /dev/null +++ b/help/android/app/build.gradle @@ -0,0 +1,63 @@ +def localProperties = new Properties() +def localPropertiesFile = rootProject.file('local.properties') +if (localPropertiesFile.exists()) { + localPropertiesFile.withReader('UTF-8') { reader -> + localProperties.load(reader) + } +} + +def flutterRoot = localProperties.getProperty('flutter.sdk') +if (flutterRoot == null) { + throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") +} + +def flutterVersionCode = localProperties.getProperty('flutter.versionCode') +if (flutterVersionCode == null) { + flutterVersionCode = '1' +} + +def flutterVersionName = localProperties.getProperty('flutter.versionName') +if (flutterVersionName == null) { + flutterVersionName = '1.0' +} + +apply plugin: 'com.android.application' +apply plugin: 'kotlin-android' +apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" + +android { + compileSdkVersion 29 + + sourceSets { + main.java.srcDirs += 'src/main/kotlin' + } + + lintOptions { + disable 'InvalidPackage' + } + + defaultConfig { + // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). + applicationId "com.example.help" + minSdkVersion 16 + targetSdkVersion 29 + versionCode flutterVersionCode.toInteger() + versionName flutterVersionName + } + + buildTypes { + release { + // TODO: Add your own signing config for the release build. + // Signing with the debug keys for now, so `flutter run --release` works. + signingConfig signingConfigs.debug + } + } +} + +flutter { + source '../..' +} + +dependencies { + implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" +} diff --git a/help/android/app/src/debug/AndroidManifest.xml b/help/android/app/src/debug/AndroidManifest.xml new file mode 100644 index 00000000..fa2c5cd4 --- /dev/null +++ b/help/android/app/src/debug/AndroidManifest.xml @@ -0,0 +1,7 @@ + + + + diff --git a/help/android/app/src/main/AndroidManifest.xml b/help/android/app/src/main/AndroidManifest.xml new file mode 100644 index 00000000..125d6242 --- /dev/null +++ b/help/android/app/src/main/AndroidManifest.xml @@ -0,0 +1,47 @@ + + + + + + + + + + + + + + + + + diff --git a/help/android/app/src/main/kotlin/com/example/help/MainActivity.kt b/help/android/app/src/main/kotlin/com/example/help/MainActivity.kt new file mode 100644 index 00000000..75298a08 --- /dev/null +++ b/help/android/app/src/main/kotlin/com/example/help/MainActivity.kt @@ -0,0 +1,6 @@ +package com.example.help + +import io.flutter.embedding.android.FlutterActivity + +class MainActivity: FlutterActivity() { +} diff --git a/help/android/app/src/main/res/drawable/launch_background.xml b/help/android/app/src/main/res/drawable/launch_background.xml new file mode 100644 index 00000000..304732f8 --- /dev/null +++ b/help/android/app/src/main/res/drawable/launch_background.xml @@ -0,0 +1,12 @@ + + + + + + + + diff --git a/help/android/app/src/main/res/mipmap-hdpi/ic_launcher.png b/help/android/app/src/main/res/mipmap-hdpi/ic_launcher.png new file mode 100644 index 00000000..db77bb4b Binary files /dev/null and b/help/android/app/src/main/res/mipmap-hdpi/ic_launcher.png differ diff --git a/help/android/app/src/main/res/mipmap-mdpi/ic_launcher.png b/help/android/app/src/main/res/mipmap-mdpi/ic_launcher.png new file mode 100644 index 00000000..17987b79 Binary files /dev/null and b/help/android/app/src/main/res/mipmap-mdpi/ic_launcher.png differ diff --git a/help/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/help/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png new file mode 100644 index 00000000..09d43914 Binary files /dev/null and b/help/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png differ diff --git a/help/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/help/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png new file mode 100644 index 00000000..d5f1c8d3 Binary files /dev/null and b/help/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png differ diff --git a/help/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/help/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png new file mode 100644 index 00000000..4d6372ee Binary files /dev/null and b/help/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png differ diff --git a/help/android/app/src/main/res/values/styles.xml b/help/android/app/src/main/res/values/styles.xml new file mode 100644 index 00000000..1f83a33f --- /dev/null +++ b/help/android/app/src/main/res/values/styles.xml @@ -0,0 +1,18 @@ + + + + + + + diff --git a/help/android/app/src/profile/AndroidManifest.xml b/help/android/app/src/profile/AndroidManifest.xml new file mode 100644 index 00000000..fa2c5cd4 --- /dev/null +++ b/help/android/app/src/profile/AndroidManifest.xml @@ -0,0 +1,7 @@ + + + + diff --git a/help/android/build.gradle b/help/android/build.gradle new file mode 100644 index 00000000..3100ad2d --- /dev/null +++ b/help/android/build.gradle @@ -0,0 +1,31 @@ +buildscript { + ext.kotlin_version = '1.3.50' + repositories { + google() + jcenter() + } + + dependencies { + classpath 'com.android.tools.build:gradle:3.5.0' + classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" + } +} + +allprojects { + repositories { + google() + jcenter() + } +} + +rootProject.buildDir = '../build' +subprojects { + project.buildDir = "${rootProject.buildDir}/${project.name}" +} +subprojects { + project.evaluationDependsOn(':app') +} + +task clean(type: Delete) { + delete rootProject.buildDir +} diff --git a/help/android/gradle.properties b/help/android/gradle.properties new file mode 100644 index 00000000..94adc3a3 --- /dev/null +++ b/help/android/gradle.properties @@ -0,0 +1,3 @@ +org.gradle.jvmargs=-Xmx1536M +android.useAndroidX=true +android.enableJetifier=true diff --git a/help/android/gradle/wrapper/gradle-wrapper.properties b/help/android/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 00000000..296b146b --- /dev/null +++ b/help/android/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,6 @@ +#Fri Jun 23 08:50:38 CEST 2017 +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.2-all.zip diff --git a/help/android/settings.gradle b/help/android/settings.gradle new file mode 100644 index 00000000..44e62bcf --- /dev/null +++ b/help/android/settings.gradle @@ -0,0 +1,11 @@ +include ':app' + +def localPropertiesFile = new File(rootProject.projectDir, "local.properties") +def properties = new Properties() + +assert localPropertiesFile.exists() +localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) } + +def flutterSdkPath = properties.getProperty("flutter.sdk") +assert flutterSdkPath != null, "flutter.sdk not set in local.properties" +apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle" diff --git a/help/ios/.gitignore b/help/ios/.gitignore new file mode 100644 index 00000000..e96ef602 --- /dev/null +++ b/help/ios/.gitignore @@ -0,0 +1,32 @@ +*.mode1v3 +*.mode2v3 +*.moved-aside +*.pbxuser +*.perspectivev3 +**/*sync/ +.sconsign.dblite +.tags* +**/.vagrant/ +**/DerivedData/ +Icon? +**/Pods/ +**/.symlinks/ +profile +xcuserdata +**/.generated/ +Flutter/App.framework +Flutter/Flutter.framework +Flutter/Flutter.podspec +Flutter/Generated.xcconfig +Flutter/app.flx +Flutter/app.zip +Flutter/flutter_assets/ +Flutter/flutter_export_environment.sh +ServiceDefinitions.json +Runner/GeneratedPluginRegistrant.* + +# Exceptions to above rules. +!default.mode1v3 +!default.mode2v3 +!default.pbxuser +!default.perspectivev3 diff --git a/help/ios/Flutter/AppFrameworkInfo.plist b/help/ios/Flutter/AppFrameworkInfo.plist new file mode 100644 index 00000000..f2872cf4 --- /dev/null +++ b/help/ios/Flutter/AppFrameworkInfo.plist @@ -0,0 +1,26 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + App + CFBundleIdentifier + io.flutter.flutter.app + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + App + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1.0 + MinimumOSVersion + 9.0 + + diff --git a/help/ios/Flutter/Debug.xcconfig b/help/ios/Flutter/Debug.xcconfig new file mode 100644 index 00000000..592ceee8 --- /dev/null +++ b/help/ios/Flutter/Debug.xcconfig @@ -0,0 +1 @@ +#include "Generated.xcconfig" diff --git a/help/ios/Flutter/Release.xcconfig b/help/ios/Flutter/Release.xcconfig new file mode 100644 index 00000000..592ceee8 --- /dev/null +++ b/help/ios/Flutter/Release.xcconfig @@ -0,0 +1 @@ +#include "Generated.xcconfig" diff --git a/help/ios/Runner.xcodeproj/project.pbxproj b/help/ios/Runner.xcodeproj/project.pbxproj new file mode 100644 index 00000000..4f158fea --- /dev/null +++ b/help/ios/Runner.xcodeproj/project.pbxproj @@ -0,0 +1,495 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; + 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; + 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; + 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; + 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; + 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; +/* End PBXBuildFile section */ + +/* Begin PBXCopyFilesBuildPhase section */ + 9705A1C41CF9048500538489 /* Embed Frameworks */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + ); + name = "Embed Frameworks"; + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXCopyFilesBuildPhase section */ + +/* Begin PBXFileReference section */ + 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; + 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; + 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; + 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; }; + 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; + 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; + 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; + 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 97C146EB1CF9000F007C117D /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 9740EEB11CF90186004384FC /* Flutter */ = { + isa = PBXGroup; + children = ( + 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, + 9740EEB21CF90195004384FC /* Debug.xcconfig */, + 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, + 9740EEB31CF90195004384FC /* Generated.xcconfig */, + ); + name = Flutter; + sourceTree = ""; + }; + 97C146E51CF9000F007C117D = { + isa = PBXGroup; + children = ( + 9740EEB11CF90186004384FC /* Flutter */, + 97C146F01CF9000F007C117D /* Runner */, + 97C146EF1CF9000F007C117D /* Products */, + ); + sourceTree = ""; + }; + 97C146EF1CF9000F007C117D /* Products */ = { + isa = PBXGroup; + children = ( + 97C146EE1CF9000F007C117D /* Runner.app */, + ); + name = Products; + sourceTree = ""; + }; + 97C146F01CF9000F007C117D /* Runner */ = { + isa = PBXGroup; + children = ( + 97C146FA1CF9000F007C117D /* Main.storyboard */, + 97C146FD1CF9000F007C117D /* Assets.xcassets */, + 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, + 97C147021CF9000F007C117D /* Info.plist */, + 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, + 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, + 74858FAE1ED2DC5600515810 /* AppDelegate.swift */, + 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */, + ); + path = Runner; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 97C146ED1CF9000F007C117D /* Runner */ = { + isa = PBXNativeTarget; + buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; + buildPhases = ( + 9740EEB61CF901F6004384FC /* Run Script */, + 97C146EA1CF9000F007C117D /* Sources */, + 97C146EB1CF9000F007C117D /* Frameworks */, + 97C146EC1CF9000F007C117D /* Resources */, + 9705A1C41CF9048500538489 /* Embed Frameworks */, + 3B06AD1E1E4923F5004D2608 /* Thin Binary */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = Runner; + productName = Runner; + productReference = 97C146EE1CF9000F007C117D /* Runner.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 97C146E61CF9000F007C117D /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 1020; + ORGANIZATIONNAME = ""; + TargetAttributes = { + 97C146ED1CF9000F007C117D = { + CreatedOnToolsVersion = 7.3.1; + LastSwiftMigration = 1100; + }; + }; + }; + buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */; + compatibilityVersion = "Xcode 9.3"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 97C146E51CF9000F007C117D; + productRefGroup = 97C146EF1CF9000F007C117D /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 97C146ED1CF9000F007C117D /* Runner */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 97C146EC1CF9000F007C117D /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, + 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, + 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, + 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXShellScriptBuildPhase section */ + 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Thin Binary"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin"; + }; + 9740EEB61CF901F6004384FC /* Run Script */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Run Script"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 97C146EA1CF9000F007C117D /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */, + 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + 97C146FA1CF9000F007C117D /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 97C146FB1CF9000F007C117D /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 97C147001CF9000F007C117D /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 249021D3217E4FDB00AE95B9 /* Profile */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + SUPPORTED_PLATFORMS = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + }; + name = Profile; + }; + 249021D4217E4FDB00AE95B9 /* Profile */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + ENABLE_BITCODE = NO; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/Flutter", + ); + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + LIBRARY_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/Flutter", + ); + PRODUCT_BUNDLE_IDENTIFIER = com.example.help; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; + SWIFT_VERSION = 5.0; + VERSIONING_SYSTEM = "apple-generic"; + }; + name = Profile; + }; + 97C147031CF9000F007C117D /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + 97C147041CF9000F007C117D /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + SUPPORTED_PLATFORMS = iphoneos; + SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 97C147061CF9000F007C117D /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + ENABLE_BITCODE = NO; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/Flutter", + ); + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + LIBRARY_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/Flutter", + ); + PRODUCT_BUNDLE_IDENTIFIER = com.example.help; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 5.0; + VERSIONING_SYSTEM = "apple-generic"; + }; + name = Debug; + }; + 97C147071CF9000F007C117D /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + ENABLE_BITCODE = NO; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/Flutter", + ); + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + LIBRARY_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/Flutter", + ); + PRODUCT_BUNDLE_IDENTIFIER = com.example.help; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; + SWIFT_VERSION = 5.0; + VERSIONING_SYSTEM = "apple-generic"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 97C147031CF9000F007C117D /* Debug */, + 97C147041CF9000F007C117D /* Release */, + 249021D3217E4FDB00AE95B9 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 97C147061CF9000F007C117D /* Debug */, + 97C147071CF9000F007C117D /* Release */, + 249021D4217E4FDB00AE95B9 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 97C146E61CF9000F007C117D /* Project object */; +} diff --git a/help/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/help/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 00000000..1d526a16 --- /dev/null +++ b/help/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/help/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/help/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 00000000..18d98100 --- /dev/null +++ b/help/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/help/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/help/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings new file mode 100644 index 00000000..f9b0d7c5 --- /dev/null +++ b/help/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings @@ -0,0 +1,8 @@ + + + + + PreviewsEnabled + + + diff --git a/help/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/help/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme new file mode 100644 index 00000000..a28140cf --- /dev/null +++ b/help/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -0,0 +1,91 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/help/ios/Runner.xcworkspace/contents.xcworkspacedata b/help/ios/Runner.xcworkspace/contents.xcworkspacedata new file mode 100644 index 00000000..1d526a16 --- /dev/null +++ b/help/ios/Runner.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/help/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/help/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 00000000..18d98100 --- /dev/null +++ b/help/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/help/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/help/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings new file mode 100644 index 00000000..f9b0d7c5 --- /dev/null +++ b/help/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings @@ -0,0 +1,8 @@ + + + + + PreviewsEnabled + + + diff --git a/help/ios/Runner/AppDelegate.swift b/help/ios/Runner/AppDelegate.swift new file mode 100644 index 00000000..70693e4a --- /dev/null +++ b/help/ios/Runner/AppDelegate.swift @@ -0,0 +1,13 @@ +import UIKit +import Flutter + +@UIApplicationMain +@objc class AppDelegate: FlutterAppDelegate { + override func application( + _ application: UIApplication, + didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? + ) -> Bool { + GeneratedPluginRegistrant.register(with: self) + return super.application(application, didFinishLaunchingWithOptions: launchOptions) + } +} diff --git a/help/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json b/help/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 00000000..d36b1fab --- /dev/null +++ b/help/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,122 @@ +{ + "images" : [ + { + "size" : "20x20", + "idiom" : "iphone", + "filename" : "Icon-App-20x20@2x.png", + "scale" : "2x" + }, + { + "size" : "20x20", + "idiom" : "iphone", + "filename" : "Icon-App-20x20@3x.png", + "scale" : "3x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "Icon-App-29x29@1x.png", + "scale" : "1x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "Icon-App-29x29@2x.png", + "scale" : "2x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "Icon-App-29x29@3x.png", + "scale" : "3x" + }, + { + "size" : "40x40", + "idiom" : "iphone", + "filename" : "Icon-App-40x40@2x.png", + "scale" : "2x" + }, + { + "size" : "40x40", + "idiom" : "iphone", + "filename" : "Icon-App-40x40@3x.png", + "scale" : "3x" + }, + { + "size" : "60x60", + "idiom" : "iphone", + "filename" : "Icon-App-60x60@2x.png", + "scale" : "2x" + }, + { + "size" : "60x60", + "idiom" : "iphone", + "filename" : "Icon-App-60x60@3x.png", + "scale" : "3x" + }, + { + "size" : "20x20", + "idiom" : "ipad", + "filename" : "Icon-App-20x20@1x.png", + "scale" : "1x" + }, + { + "size" : "20x20", + "idiom" : "ipad", + "filename" : "Icon-App-20x20@2x.png", + "scale" : "2x" + }, + { + "size" : "29x29", + "idiom" : "ipad", + "filename" : "Icon-App-29x29@1x.png", + "scale" : "1x" + }, + { + "size" : "29x29", + "idiom" : "ipad", + "filename" : "Icon-App-29x29@2x.png", + "scale" : "2x" + }, + { + "size" : "40x40", + "idiom" : "ipad", + "filename" : "Icon-App-40x40@1x.png", + "scale" : "1x" + }, + { + "size" : "40x40", + "idiom" : "ipad", + "filename" : "Icon-App-40x40@2x.png", + "scale" : "2x" + }, + { + "size" : "76x76", + "idiom" : "ipad", + "filename" : "Icon-App-76x76@1x.png", + "scale" : "1x" + }, + { + "size" : "76x76", + "idiom" : "ipad", + "filename" : "Icon-App-76x76@2x.png", + "scale" : "2x" + }, + { + "size" : "83.5x83.5", + "idiom" : "ipad", + "filename" : "Icon-App-83.5x83.5@2x.png", + "scale" : "2x" + }, + { + "size" : "1024x1024", + "idiom" : "ios-marketing", + "filename" : "Icon-App-1024x1024@1x.png", + "scale" : "1x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} diff --git a/help/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png b/help/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png new file mode 100644 index 00000000..dc9ada47 Binary files /dev/null and b/help/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png differ diff --git a/help/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png b/help/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png new file mode 100644 index 00000000..28c6bf03 Binary files /dev/null and b/help/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png differ diff --git a/help/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png b/help/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png new file mode 100644 index 00000000..2ccbfd96 Binary files /dev/null and b/help/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png differ diff --git a/help/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png b/help/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png new file mode 100644 index 00000000..f091b6b0 Binary files /dev/null and b/help/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png differ diff --git a/help/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png b/help/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png new file mode 100644 index 00000000..4cde1211 Binary files /dev/null and b/help/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png differ diff --git a/help/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png b/help/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png new file mode 100644 index 00000000..d0ef06e7 Binary files /dev/null and b/help/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png differ diff --git a/help/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png b/help/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png new file mode 100644 index 00000000..dcdc2306 Binary files /dev/null and b/help/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png differ diff --git a/help/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png b/help/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png new file mode 100644 index 00000000..2ccbfd96 Binary files /dev/null and b/help/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png differ diff --git a/help/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png b/help/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png new file mode 100644 index 00000000..c8f9ed8f Binary files /dev/null and b/help/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png differ diff --git a/help/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png b/help/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png new file mode 100644 index 00000000..a6d6b860 Binary files /dev/null and b/help/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png differ diff --git a/help/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png b/help/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png new file mode 100644 index 00000000..a6d6b860 Binary files /dev/null and b/help/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png differ diff --git a/help/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png b/help/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png new file mode 100644 index 00000000..75b2d164 Binary files /dev/null and b/help/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png differ diff --git a/help/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png b/help/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png new file mode 100644 index 00000000..c4df70d3 Binary files /dev/null and b/help/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png differ diff --git a/help/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png b/help/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png new file mode 100644 index 00000000..6a84f41e Binary files /dev/null and b/help/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png differ diff --git a/help/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png b/help/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png new file mode 100644 index 00000000..d0e1f585 Binary files /dev/null and b/help/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png differ diff --git a/help/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json b/help/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json new file mode 100644 index 00000000..0bedcf2f --- /dev/null +++ b/help/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "LaunchImage.png", + "scale" : "1x" + }, + { + "idiom" : "universal", + "filename" : "LaunchImage@2x.png", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "LaunchImage@3x.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} diff --git a/help/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png b/help/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png new file mode 100644 index 00000000..9da19eac Binary files /dev/null and b/help/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png differ diff --git a/help/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png b/help/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png new file mode 100644 index 00000000..9da19eac Binary files /dev/null and b/help/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png differ diff --git a/help/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png b/help/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png new file mode 100644 index 00000000..9da19eac Binary files /dev/null and b/help/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png differ diff --git a/help/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md b/help/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md new file mode 100644 index 00000000..89c2725b --- /dev/null +++ b/help/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md @@ -0,0 +1,5 @@ +# Launch Screen Assets + +You can customize the launch screen with your own desired assets by replacing the image files in this directory. + +You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images. \ No newline at end of file diff --git a/help/ios/Runner/Base.lproj/LaunchScreen.storyboard b/help/ios/Runner/Base.lproj/LaunchScreen.storyboard new file mode 100644 index 00000000..f2e259c7 --- /dev/null +++ b/help/ios/Runner/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/help/ios/Runner/Base.lproj/Main.storyboard b/help/ios/Runner/Base.lproj/Main.storyboard new file mode 100644 index 00000000..f3c28516 --- /dev/null +++ b/help/ios/Runner/Base.lproj/Main.storyboard @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/help/ios/Runner/Info.plist b/help/ios/Runner/Info.plist new file mode 100644 index 00000000..fe4c8174 --- /dev/null +++ b/help/ios/Runner/Info.plist @@ -0,0 +1,45 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + help + CFBundlePackageType + APPL + CFBundleShortVersionString + $(FLUTTER_BUILD_NAME) + CFBundleSignature + ???? + CFBundleVersion + $(FLUTTER_BUILD_NUMBER) + LSRequiresIPhoneOS + + UILaunchStoryboardName + LaunchScreen + UIMainStoryboardFile + Main + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UIViewControllerBasedStatusBarAppearance + + + diff --git a/help/ios/Runner/Runner-Bridging-Header.h b/help/ios/Runner/Runner-Bridging-Header.h new file mode 100644 index 00000000..308a2a56 --- /dev/null +++ b/help/ios/Runner/Runner-Bridging-Header.h @@ -0,0 +1 @@ +#import "GeneratedPluginRegistrant.h" diff --git a/help/lib/main.dart b/help/lib/main.dart new file mode 100644 index 00000000..11655b66 --- /dev/null +++ b/help/lib/main.dart @@ -0,0 +1,117 @@ +import 'package:flutter/material.dart'; + +void main() { + runApp(MyApp()); +} + +class MyApp extends StatelessWidget { + // This widget is the root of your application. + @override + Widget build(BuildContext context) { + return MaterialApp( + title: 'Flutter Demo', + theme: ThemeData( + // This is the theme of your application. + // + // Try running your application with "flutter run". You'll see the + // application has a blue toolbar. Then, without quitting the app, try + // changing the primarySwatch below to Colors.green and then invoke + // "hot reload" (press "r" in the console where you ran "flutter run", + // or simply save your changes to "hot reload" in a Flutter IDE). + // Notice that the counter didn't reset back to zero; the application + // is not restarted. + primarySwatch: Colors.blue, + // This makes the visual density adapt to the platform that you run + // the app on. For desktop platforms, the controls will be smaller and + // closer together (more dense) than on mobile platforms. + visualDensity: VisualDensity.adaptivePlatformDensity, + ), + home: MyHomePage(title: 'Flutter Demo Home Page'), + ); + } +} + +class MyHomePage extends StatefulWidget { + MyHomePage({Key key, this.title}) : super(key: key); + + // This widget is the home page of your application. It is stateful, meaning + // that it has a State object (defined below) that contains fields that affect + // how it looks. + + // This class is the configuration for the state. It holds the values (in this + // case the title) provided by the parent (in this case the App widget) and + // used by the build method of the State. Fields in a Widget subclass are + // always marked "final". + + final String title; + + @override + _MyHomePageState createState() => _MyHomePageState(); +} + +class _MyHomePageState extends State { + int _counter = 0; + + void _incrementCounter() { + setState(() { + // This call to setState tells the Flutter framework that something has + // changed in this State, which causes it to rerun the build method below + // so that the display can reflect the updated values. If we changed + // _counter without calling setState(), then the build method would not be + // called again, and so nothing would appear to happen. + _counter++; + }); + } + + @override + Widget build(BuildContext context) { + // This method is rerun every time setState is called, for instance as done + // by the _incrementCounter method above. + // + // The Flutter framework has been optimized to make rerunning build methods + // fast, so that you can just rebuild anything that needs updating rather + // than having to individually change instances of widgets. + return Scaffold( + appBar: AppBar( + // Here we take the value from the MyHomePage object that was created by + // the App.build method, and use it to set our appbar title. + title: Text(widget.title), + ), + body: Center( + // Center is a layout widget. It takes a single child and positions it + // in the middle of the parent. + child: Column( + // Column is also a layout widget. It takes a list of children and + // arranges them vertically. By default, it sizes itself to fit its + // children horizontally, and tries to be as tall as its parent. + // + // Invoke "debug painting" (press "p" in the console, choose the + // "Toggle Debug Paint" action from the Flutter Inspector in Android + // Studio, or the "Toggle Debug Paint" command in Visual Studio Code) + // to see the wireframe for each widget. + // + // Column has various properties to control how it sizes itself and + // how it positions its children. Here we use mainAxisAlignment to + // center the children vertically; the main axis here is the vertical + // axis because Columns are vertical (the cross axis would be + // horizontal). + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Text( + 'You have pushed the button this many times:', + ), + Text( + '$_counter', + style: Theme.of(context).textTheme.headline4, + ), + ], + ), + ), + floatingActionButton: FloatingActionButton( + onPressed: _incrementCounter, + tooltip: 'Increment', + child: Icon(Icons.add), + ), // This trailing comma makes auto-formatting nicer for build methods. + ); + } +} diff --git a/help/pubspec.yaml b/help/pubspec.yaml new file mode 100644 index 00000000..66af3d9e --- /dev/null +++ b/help/pubspec.yaml @@ -0,0 +1,76 @@ +name: help +description: A new Flutter project. + +# The following line prevents the package from being accidentally published to +# pub.dev using `pub publish`. This is preferred for private packages. +publish_to: 'none' # Remove this line if you wish to publish to pub.dev + +# The following defines the version and build number for your application. +# A version number is three numbers separated by dots, like 1.2.43 +# followed by an optional build number separated by a +. +# Both the version and the builder number may be overridden in flutter +# build by specifying --build-name and --build-number, respectively. +# In Android, build-name is used as versionName while build-number used as versionCode. +# Read more about Android versioning at https://developer.android.com/studio/publish/versioning +# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. +# Read more about iOS versioning at +# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html +version: 1.0.0+1 + +environment: + sdk: ">=2.7.0 <3.0.0" + +dependencies: + flutter: + sdk: flutter + + + # The following adds the Cupertino Icons font to your application. + # Use with the CupertinoIcons class for iOS style icons. + cupertino_icons: ^1.0.0 + +dev_dependencies: + flutter_test: + sdk: flutter + +# For information on the generic Dart part of this file, see the +# following page: https://dart.dev/tools/pub/pubspec + +# The following section is specific to Flutter. +flutter: + + # The following line ensures that the Material Icons font is + # included with your application, so that you can use the icons in + # the material Icons class. + uses-material-design: true + + # To add assets to your application, add an assets section, like this: + # assets: + # - images/a_dot_burr.jpeg + # - images/a_dot_ham.jpeg + + # An image asset can refer to one or more resolution-specific "variants", see + # https://flutter.dev/assets-and-images/#resolution-aware. + + # For details regarding adding assets from package dependencies, see + # https://flutter.dev/assets-and-images/#from-packages + + # To add custom fonts to your application, add a fonts section here, + # in this "flutter" section. Each entry in this list should have a + # "family" key with the font family name, and a "fonts" key with a + # list giving the asset and other descriptors for the font. For + # example: + # fonts: + # - family: Schyler + # fonts: + # - asset: fonts/Schyler-Regular.ttf + # - asset: fonts/Schyler-Italic.ttf + # style: italic + # - family: Trajan Pro + # fonts: + # - asset: fonts/TrajanPro.ttf + # - asset: fonts/TrajanPro_Bold.ttf + # weight: 700 + # + # For details regarding fonts from package dependencies, + # see https://flutter.dev/custom-fonts/#from-packages diff --git a/help/test/widget_test.dart b/help/test/widget_test.dart new file mode 100644 index 00000000..0d8435b7 --- /dev/null +++ b/help/test/widget_test.dart @@ -0,0 +1,30 @@ +// This is a basic Flutter widget test. +// +// To perform an interaction with a widget in your test, use the WidgetTester +// utility that Flutter provides. For example, you can send tap and scroll +// gestures. You can also use WidgetTester to find child widgets in the widget +// tree, read text, and verify that the values of widget properties are correct. + +import 'package:flutter/material.dart'; +import 'package:flutter_test/flutter_test.dart'; + +import 'package:help/main.dart'; + +void main() { + testWidgets('Counter increments smoke test', (WidgetTester tester) async { + // Build our app and trigger a frame. + await tester.pumpWidget(MyApp()); + + // Verify that our counter starts at 0. + expect(find.text('0'), findsOneWidget); + expect(find.text('1'), findsNothing); + + // Tap the '+' icon and trigger a frame. + await tester.tap(find.byIcon(Icons.add)); + await tester.pump(); + + // Verify that our counter has incremented. + expect(find.text('0'), findsNothing); + expect(find.text('1'), findsOneWidget); + }); +} diff --git a/ios/Flutter/.last_build_id b/ios/Flutter/.last_build_id index 6bca0336..3aa2cd1e 100644 --- a/ios/Flutter/.last_build_id +++ b/ios/Flutter/.last_build_id @@ -1 +1 @@ -f4a819c27119d0f472892c1088ad1ca3 \ No newline at end of file +3f3d14a0ae775b56806906c2cb14a1f0 \ No newline at end of file diff --git a/ios/Flutter/AppFrameworkInfo.plist b/ios/Flutter/AppFrameworkInfo.plist index f2872cf4..6b4c0f78 100644 --- a/ios/Flutter/AppFrameworkInfo.plist +++ b/ios/Flutter/AppFrameworkInfo.plist @@ -21,6 +21,6 @@ CFBundleVersion 1.0 MinimumOSVersion - 9.0 + 8.0 diff --git a/ios/GoogleService-Info.plist b/ios/GoogleService-Info.plist new file mode 100644 index 00000000..0c093a2a --- /dev/null +++ b/ios/GoogleService-Info.plist @@ -0,0 +1,36 @@ + + + + + CLIENT_ID + 864393916058-ekeb4s8tgfo58dutv0l54399t7ivr06r.apps.googleusercontent.com + REVERSED_CLIENT_ID + com.googleusercontent.apps.864393916058-ekeb4s8tgfo58dutv0l54399t7ivr06r + API_KEY + AIzaSyA_6ayGCk4fly7o7eTVBrj9kuHBYHMAOfs + GCM_SENDER_ID + 864393916058 + PLIST_VERSION + 1 + BUNDLE_ID + com.cloud.diplomaticquarterapp + PROJECT_ID + diplomaticquarter-d2385 + STORAGE_BUCKET + diplomaticquarter-d2385.appspot.com + IS_ADS_ENABLED + + IS_ANALYTICS_ENABLED + + IS_APPINVITE_ENABLED + + IS_GCM_ENABLED + + IS_SIGNIN_ENABLED + + GOOGLE_APP_ID + 1:864393916058:ios:13f787bbfe6051f8b97923 + DATABASE_URL + https://diplomaticquarter-d2385.firebaseio.com + + \ No newline at end of file diff --git a/ios/Podfile b/ios/Podfile index 1d1a003e..5579d926 100644 --- a/ios/Podfile +++ b/ios/Podfile @@ -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' @@ -10,32 +10,85 @@ project 'Runner', { 'Release' => :release, } -def flutter_root - generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__) - unless File.exist?(generated_xcode_build_settings_path) - raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first" - end +# pod 'FBSDKCoreKit' +# pod 'FBSDKLoginKit' - File.foreach(generated_xcode_build_settings_path) do |line| - matches = line.match(/FLUTTER_ROOT\=(.*)/) - return matches[1].strip if matches +def parse_KV_file(file, separator='=') + file_abs_path = File.expand_path(file) + if !File.exists? file_abs_path + return []; + end + generated_key_values = {} + skip_line_start_symbols = ["#", "/"] + File.foreach(file_abs_path) do |line| + next if skip_line_start_symbols.any? { |symbol| line =~ /^\s*#{symbol}/ } + plugin = line.split(pattern=separator) + if plugin.length == 2 + podname = plugin[0].strip() + path = plugin[1].strip() + podpath = File.expand_path("#{path}", file_abs_path) + generated_key_values[podname] = podpath + else + puts "Invalid plugin specification: #{line}" + end end - raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get" + generated_key_values end -require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) - -flutter_ios_podfile_setup - target 'Runner' do use_frameworks! use_modular_headers! - flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__)) + # 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') + unless File.exist?(copied_framework_path) && File.exist?(copied_podspec_path) + # Copy Flutter.framework and Flutter.podspec to Flutter/ to have something to link against if the xcode backend script has not run yet. + # That script will copy the correct debug/profile/release version of the framework based on the currently selected Xcode configuration. + # CocoaPods will not embed the framework on pod install (before any build phases can generate) if the dylib does not exist. + + generated_xcode_build_settings_path = File.join(copied_flutter_dir, 'Generated.xcconfig') + unless File.exist?(generated_xcode_build_settings_path) + raise "Generated.xcconfig must exist. If you're running pod install manually, make sure flutter pub get is executed first" + end + generated_xcode_build_settings = parse_KV_file(generated_xcode_build_settings_path) + cached_framework_dir = generated_xcode_build_settings['FLUTTER_FRAMEWORK_DIR']; + + unless File.exist?(copied_framework_path) + FileUtils.cp_r(File.join(cached_framework_dir, 'Flutter.framework'), copied_flutter_dir) + end + unless File.exist?(copied_podspec_path) + FileUtils.cp(File.join(cached_framework_dir, 'Flutter.podspec'), copied_flutter_dir) + end + end + + # Keep pod path relative so it can be checked into Podfile.lock. + pod 'Flutter', :path => 'Flutter' + + # Plugin Pods + + # Prepare symlinks folder. We use symlinks to avoid having Podfile.lock + # referring to absolute paths on developers' machines. + system('rm -rf .symlinks') + system('mkdir -p .symlinks/plugins') + plugin_pods = parse_KV_file('../.flutter-plugins') + plugin_pods.each do |name, path| + symlink = File.join('.symlinks', 'plugins', name) + File.symlink(path, symlink) + pod name, :path => File.join(symlink, 'ios') + end end post_install do |installer| installer.pods_project.targets.each do |target| - flutter_additional_ios_build_settings(target) + target.build_configurations.each do |config| + config.build_settings['ENABLE_BITCODE'] = 'NO' + end end -end \ No newline at end of file +end + diff --git a/ios/Podfile.lock b/ios/Podfile.lock new file mode 100644 index 00000000..6a965de8 --- /dev/null +++ b/ios/Podfile.lock @@ -0,0 +1,443 @@ +PODS: + - android_intent (0.0.1): + - Flutter + - barcode_scan_fix (0.0.1): + - Flutter + - MTBBarcodeScanner + - connectivity (0.0.1): + - Flutter + - Reachability + - connectivity_for_web (0.1.0): + - Flutter + - connectivity_macos (0.0.1): + - Flutter + - device_calendar (0.0.1): + - Flutter + - device_info (0.0.1): + - Flutter + - Firebase/CoreOnly (6.33.0): + - FirebaseCore (= 6.10.3) + - Firebase/Messaging (6.33.0): + - Firebase/CoreOnly + - FirebaseMessaging (~> 4.7.0) + - firebase_core (0.5.2): + - Firebase/CoreOnly (~> 6.33.0) + - Flutter + - firebase_core_web (0.1.0): + - Flutter + - firebase_messaging (7.0.3): + - Firebase/CoreOnly (~> 6.33.0) + - Firebase/Messaging (~> 6.33.0) + - firebase_core + - Flutter + - FirebaseCore (6.10.3): + - FirebaseCoreDiagnostics (~> 1.6) + - GoogleUtilities/Environment (~> 6.7) + - GoogleUtilities/Logger (~> 6.7) + - FirebaseCoreDiagnostics (1.7.0): + - GoogleDataTransport (~> 7.4) + - GoogleUtilities/Environment (~> 6.7) + - GoogleUtilities/Logger (~> 6.7) + - nanopb (~> 1.30906.0) + - FirebaseInstallations (1.7.0): + - FirebaseCore (~> 6.10) + - GoogleUtilities/Environment (~> 6.7) + - GoogleUtilities/UserDefaults (~> 6.7) + - PromisesObjC (~> 1.2) + - FirebaseInstanceID (4.8.0): + - FirebaseCore (~> 6.10) + - FirebaseInstallations (~> 1.6) + - GoogleUtilities/Environment (~> 6.7) + - GoogleUtilities/UserDefaults (~> 6.7) + - FirebaseMessaging (4.7.1): + - FirebaseCore (~> 6.10) + - FirebaseInstanceID (~> 4.7) + - GoogleUtilities/AppDelegateSwizzler (~> 6.7) + - GoogleUtilities/Environment (~> 6.7) + - GoogleUtilities/Reachability (~> 6.7) + - GoogleUtilities/UserDefaults (~> 6.7) + - Protobuf (>= 3.9.2, ~> 3.9) + - Flutter (1.0.0) + - flutter_email_sender (0.0.1): + - Flutter + - flutter_flexible_toast (0.0.1): + - Flutter + - flutter_inappwebview (0.0.1): + - Flutter + - flutter_local_notifications (0.0.1): + - Flutter + - flutter_plugin_android_lifecycle (0.0.1): + - Flutter + - flutter_tts (0.0.1): + - Flutter + - "geolocator (6.0.0+4)": + - Flutter + - google_maps_flutter (0.0.1): + - Flutter + - GoogleMaps (< 3.10) + - GoogleDataTransport (7.5.1): + - nanopb (~> 1.30906.0) + - GoogleMaps (3.9.0): + - GoogleMaps/Maps (= 3.9.0) + - GoogleMaps/Base (3.9.0) + - GoogleMaps/Maps (3.9.0): + - GoogleMaps/Base + - GoogleUtilities/AppDelegateSwizzler (6.7.2): + - GoogleUtilities/Environment + - GoogleUtilities/Logger + - GoogleUtilities/Network + - GoogleUtilities/Environment (6.7.2): + - PromisesObjC (~> 1.2) + - GoogleUtilities/Logger (6.7.2): + - GoogleUtilities/Environment + - GoogleUtilities/Network (6.7.2): + - GoogleUtilities/Logger + - "GoogleUtilities/NSData+zlib" + - GoogleUtilities/Reachability + - "GoogleUtilities/NSData+zlib (6.7.2)" + - GoogleUtilities/Reachability (6.7.2): + - GoogleUtilities/Logger + - GoogleUtilities/UserDefaults (6.7.2): + - GoogleUtilities/Logger + - hexcolor (0.0.1): + - Flutter + - image_cropper (0.0.3): + - Flutter + - TOCropViewController (~> 2.5.4) + - image_picker (0.0.1): + - Flutter + - just_audio (0.0.1): + - Flutter + - local_auth (0.0.1): + - Flutter + - manage_calendar_events (0.0.1): + - Flutter + - map_launcher (0.0.1): + - 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) + - nanopb/decode (1.30906.0) + - nanopb/encode (1.30906.0) + - native_device_orientation (0.0.1): + - Flutter + - native_progress_hud (0.0.1): + - Flutter + - NVActivityIndicatorView (5.1.1): + - NVActivityIndicatorView/Base (= 5.1.1) + - NVActivityIndicatorView/Base (5.1.1) + - path_provider (0.0.1): + - Flutter + - path_provider_linux (0.0.1): + - Flutter + - path_provider_macos (0.0.1): + - Flutter + - path_provider_windows (0.0.1): + - Flutter + - "permission_handler (5.0.1+1)": + - Flutter + - PromisesObjC (1.2.11) + - Protobuf (3.13.0) + - Reachability (3.2) + - screen (0.0.1): + - Flutter + - shared_preferences (0.0.1): + - Flutter + - shared_preferences_linux (0.0.1): + - Flutter + - shared_preferences_macos (0.0.1): + - Flutter + - shared_preferences_web (0.0.1): + - Flutter + - shared_preferences_windows (0.0.1): + - Flutter + - speech_to_text (0.0.1): + - Flutter + - Try + - TOCropViewController (2.5.5) + - Try (2.1.1) + - "twilio_programmable_video (0.5.0+4)": + - Flutter + - TwilioVideo (~> 3.4) + - TwilioVideo (3.7.2) + - url_launcher (0.0.1): + - Flutter + - url_launcher_linux (0.0.1): + - Flutter + - url_launcher_macos (0.0.1): + - Flutter + - url_launcher_web (0.0.1): + - Flutter + - url_launcher_windows (0.0.1): + - Flutter + - video_player (0.0.1): + - Flutter + - video_player_web (0.0.1): + - Flutter + - wakelock (0.0.1): + - 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`) + - device_calendar (from `.symlinks/plugins/device_calendar/ios`) + - device_info (from `.symlinks/plugins/device_info/ios`) + - firebase_core (from `.symlinks/plugins/firebase_core/ios`) + - firebase_core_web (from `.symlinks/plugins/firebase_core_web/ios`) + - firebase_messaging (from `.symlinks/plugins/firebase_messaging/ios`) + - Flutter (from `Flutter`) + - flutter_email_sender (from `.symlinks/plugins/flutter_email_sender/ios`) + - flutter_flexible_toast (from `.symlinks/plugins/flutter_flexible_toast/ios`) + - flutter_inappwebview (from `.symlinks/plugins/flutter_inappwebview/ios`) + - flutter_local_notifications (from `.symlinks/plugins/flutter_local_notifications/ios`) + - flutter_plugin_android_lifecycle (from `.symlinks/plugins/flutter_plugin_android_lifecycle/ios`) + - flutter_tts (from `.symlinks/plugins/flutter_tts/ios`) + - geolocator (from `.symlinks/plugins/geolocator/ios`) + - google_maps_flutter (from `.symlinks/plugins/google_maps_flutter/ios`) + - hexcolor (from `.symlinks/plugins/hexcolor/ios`) + - image_cropper (from `.symlinks/plugins/image_cropper/ios`) + - image_picker (from `.symlinks/plugins/image_picker/ios`) + - just_audio (from `.symlinks/plugins/just_audio/ios`) + - local_auth (from `.symlinks/plugins/local_auth/ios`) + - manage_calendar_events (from `.symlinks/plugins/manage_calendar_events/ios`) + - map_launcher (from `.symlinks/plugins/map_launcher/ios`) + - maps_launcher (from `.symlinks/plugins/maps_launcher/ios`) + - native_device_orientation (from `.symlinks/plugins/native_device_orientation/ios`) + - native_progress_hud (from `.symlinks/plugins/native_progress_hud/ios`) + - NVActivityIndicatorView + - path_provider (from `.symlinks/plugins/path_provider/ios`) + - path_provider_linux (from `.symlinks/plugins/path_provider_linux/ios`) + - path_provider_macos (from `.symlinks/plugins/path_provider_macos/ios`) + - path_provider_windows (from `.symlinks/plugins/path_provider_windows/ios`) + - permission_handler (from `.symlinks/plugins/permission_handler/ios`) + - screen (from `.symlinks/plugins/screen/ios`) + - shared_preferences (from `.symlinks/plugins/shared_preferences/ios`) + - shared_preferences_linux (from `.symlinks/plugins/shared_preferences_linux/ios`) + - shared_preferences_macos (from `.symlinks/plugins/shared_preferences_macos/ios`) + - shared_preferences_web (from `.symlinks/plugins/shared_preferences_web/ios`) + - shared_preferences_windows (from `.symlinks/plugins/shared_preferences_windows/ios`) + - speech_to_text (from `.symlinks/plugins/speech_to_text/ios`) + - twilio_programmable_video (from `.symlinks/plugins/twilio_programmable_video/ios`) + - url_launcher (from `.symlinks/plugins/url_launcher/ios`) + - url_launcher_linux (from `.symlinks/plugins/url_launcher_linux/ios`) + - url_launcher_macos (from `.symlinks/plugins/url_launcher_macos/ios`) + - url_launcher_web (from `.symlinks/plugins/url_launcher_web/ios`) + - url_launcher_windows (from `.symlinks/plugins/url_launcher_windows/ios`) + - video_player (from `.symlinks/plugins/video_player/ios`) + - 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: + - Firebase + - FirebaseCore + - FirebaseCoreDiagnostics + - FirebaseInstallations + - FirebaseInstanceID + - FirebaseMessaging + - GoogleDataTransport + - GoogleMaps + - GoogleUtilities + - MTBBarcodeScanner + - nanopb + - NVActivityIndicatorView + - PromisesObjC + - Protobuf + - Reachability + - TOCropViewController + - Try + - 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: + :path: ".symlinks/plugins/connectivity_for_web/ios" + connectivity_macos: + :path: ".symlinks/plugins/connectivity_macos/ios" + device_calendar: + :path: ".symlinks/plugins/device_calendar/ios" + device_info: + :path: ".symlinks/plugins/device_info/ios" + firebase_core: + :path: ".symlinks/plugins/firebase_core/ios" + firebase_core_web: + :path: ".symlinks/plugins/firebase_core_web/ios" + firebase_messaging: + :path: ".symlinks/plugins/firebase_messaging/ios" + Flutter: + :path: Flutter + flutter_email_sender: + :path: ".symlinks/plugins/flutter_email_sender/ios" + flutter_flexible_toast: + :path: ".symlinks/plugins/flutter_flexible_toast/ios" + flutter_inappwebview: + :path: ".symlinks/plugins/flutter_inappwebview/ios" + flutter_local_notifications: + :path: ".symlinks/plugins/flutter_local_notifications/ios" + flutter_plugin_android_lifecycle: + :path: ".symlinks/plugins/flutter_plugin_android_lifecycle/ios" + flutter_tts: + :path: ".symlinks/plugins/flutter_tts/ios" + geolocator: + :path: ".symlinks/plugins/geolocator/ios" + google_maps_flutter: + :path: ".symlinks/plugins/google_maps_flutter/ios" + hexcolor: + :path: ".symlinks/plugins/hexcolor/ios" + image_cropper: + :path: ".symlinks/plugins/image_cropper/ios" + image_picker: + :path: ".symlinks/plugins/image_picker/ios" + just_audio: + :path: ".symlinks/plugins/just_audio/ios" + local_auth: + :path: ".symlinks/plugins/local_auth/ios" + manage_calendar_events: + :path: ".symlinks/plugins/manage_calendar_events/ios" + map_launcher: + :path: ".symlinks/plugins/map_launcher/ios" + maps_launcher: + :path: ".symlinks/plugins/maps_launcher/ios" + native_device_orientation: + :path: ".symlinks/plugins/native_device_orientation/ios" + native_progress_hud: + :path: ".symlinks/plugins/native_progress_hud/ios" + path_provider: + :path: ".symlinks/plugins/path_provider/ios" + path_provider_linux: + :path: ".symlinks/plugins/path_provider_linux/ios" + path_provider_macos: + :path: ".symlinks/plugins/path_provider_macos/ios" + path_provider_windows: + :path: ".symlinks/plugins/path_provider_windows/ios" + permission_handler: + :path: ".symlinks/plugins/permission_handler/ios" + screen: + :path: ".symlinks/plugins/screen/ios" + shared_preferences: + :path: ".symlinks/plugins/shared_preferences/ios" + shared_preferences_linux: + :path: ".symlinks/plugins/shared_preferences_linux/ios" + shared_preferences_macos: + :path: ".symlinks/plugins/shared_preferences_macos/ios" + shared_preferences_web: + :path: ".symlinks/plugins/shared_preferences_web/ios" + shared_preferences_windows: + :path: ".symlinks/plugins/shared_preferences_windows/ios" + speech_to_text: + :path: ".symlinks/plugins/speech_to_text/ios" + twilio_programmable_video: + :path: ".symlinks/plugins/twilio_programmable_video/ios" + url_launcher: + :path: ".symlinks/plugins/url_launcher/ios" + url_launcher_linux: + :path: ".symlinks/plugins/url_launcher_linux/ios" + url_launcher_macos: + :path: ".symlinks/plugins/url_launcher_macos/ios" + url_launcher_web: + :path: ".symlinks/plugins/url_launcher_web/ios" + url_launcher_windows: + :path: ".symlinks/plugins/url_launcher_windows/ios" + video_player: + :path: ".symlinks/plugins/video_player/ios" + video_player_web: + :path: ".symlinks/plugins/video_player_web/ios" + wakelock: + :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 + device_calendar: 23b28a5f1ab3bf77e34542fb1167e1b8b29a98f5 + device_info: d7d233b645a32c40dfdc212de5cf646ca482f175 + Firebase: 8db6f2d1b2c5e2984efba4949a145875a8f65fe5 + firebase_core: 350ba329d1641211bc6183a3236893cafdacfea7 + firebase_core_web: d501d8b946b60c8af265428ce483b0fff5ad52d1 + firebase_messaging: 0aea2cd5885b65e19ede58ee3507f485c992cc75 + FirebaseCore: d889d9e12535b7f36ac8bfbf1713a0836a3012cd + FirebaseCoreDiagnostics: 770ac5958e1372ce67959ae4b4f31d8e127c3ac1 + FirebaseInstallations: 466c7b4d1f58fe16707693091da253726a731ed2 + FirebaseInstanceID: bd3ffc24367f901a43c063b36c640b345a4a5dd1 + FirebaseMessaging: 5eca4ef173de76253352511aafef774caa1cba2a + Flutter: 0e3d915762c693b495b44d77113d4970485de6ec + flutter_email_sender: f787522d0e82f50e5766c1213dbffff22fdcf009 + flutter_flexible_toast: 0547e740cae0c33bb7c51bcd931233f4584e1143 + flutter_inappwebview: 69dfbac46157b336ffbec19ca6dfd4638c7bf189 + flutter_local_notifications: 9e4738ce2471c5af910d961a6b7eadcf57c50186 + flutter_plugin_android_lifecycle: dc0b544e129eebb77a6bfb1239d4d1c673a60a35 + flutter_tts: 0f492aab6accf87059b72354fcb4ba934304771d + geolocator: 1ae40084cc6c1586ce5ad12cfc3fd38c64d05f2f + google_maps_flutter: c7f9c73576de1fbe152a227bfd6e6c4ae8088619 + GoogleDataTransport: f56af7caa4ed338dc8e138a5d7c5973e66440833 + GoogleMaps: 4b5346bddfe6911bb89155d43c903020170523ac + GoogleUtilities: 7f2f5a07f888cdb145101d6042bc4422f57e70b3 + hexcolor: fdfb9c4258ad96e949c2dbcdf790a62194b8aa89 + image_cropper: c8f9b4157933c7bb965a66d1c5e6c8fd408c6eb4 + image_picker: 9c3312491f862b28d21ecd8fdf0ee14e601b3f09 + just_audio: baa7252489dbcf47a4c7cc9ca663e9661c99aafa + local_auth: 25938960984c3a7f6e3253e3f8d962fdd16852bd + manage_calendar_events: 0338d505ea26cdfd20cd883279bc28afa11eca34 + map_launcher: e325db1261d029ff33e08e03baccffe09593ffea + maps_launcher: eae38ee13a9c3f210fa04e04bb4c073fa4c6ed92 + MTBBarcodeScanner: f453b33c4b7dfe545d8c6484ed744d55671788cb + nanopb: 59317e09cf1f1a0af72f12af412d54edf52603fc + native_device_orientation: e24d00be281de72996640885d80e706142707660 + native_progress_hud: f95f5529742b36a3c7fdecfa88dc018319e39bf9 + NVActivityIndicatorView: 1f6c5687f1171810aa27a3296814dc2d7dec3667 + path_provider: abfe2b5c733d04e238b0d8691db0cfd63a27a93c + path_provider_linux: 4d630dc393e1f20364f3e3b4a2ff41d9674a84e4 + path_provider_macos: f760a3c5b04357c380e2fddb6f9db6f3015897e0 + path_provider_windows: a2b81600c677ac1959367280991971cb9a1edb3b + permission_handler: eac8e15b4a1a3fba55b761d19f3f4e6b005d15b6 + PromisesObjC: 8c196f5a328c2cba3e74624585467a557dcb482f + Protobuf: 3dac39b34a08151c6d949560efe3f86134a3f748 + Reachability: 33e18b67625424e47b6cde6d202dce689ad7af96 + screen: abd91ca7bf3426e1cc3646d27e9b2358d6bf07b0 + shared_preferences: af6bfa751691cdc24be3045c43ec037377ada40d + shared_preferences_linux: afefbfe8d921e207f01ede8b60373d9e3b566b78 + shared_preferences_macos: f3f29b71ccbb56bf40c9dd6396c9acf15e214087 + shared_preferences_web: 141cce0c3ed1a1c5bf2a0e44f52d31eeb66e5ea9 + shared_preferences_windows: 36b76d6f54e76ead957e60b49e2f124b4cd3e6ae + speech_to_text: b43a7d99aef037bd758ed8e45d79bbac035d2dfe + TOCropViewController: da59f531f8ac8a94ef6d6c0fc34009350f9e8bfe + Try: 5ef669ae832617b3cee58cb2c6f99fb767a4ff96 + twilio_programmable_video: 6a41593640f3d86af60b22541fd457b22deaae7f + TwilioVideo: 5257640fab00d1b9f44db060815b03516a9eb0e8 + url_launcher: 6fef411d543ceb26efce54b05a0a40bfd74cbbef + url_launcher_linux: ac237cb7a8058736e4aae38bdbcc748a4b394cc0 + url_launcher_macos: fd7894421cd39320dce5f292fc99ea9270b2a313 + url_launcher_web: e5527357f037c87560776e36436bf2b0288b965c + url_launcher_windows: 683d7c283894db8d1914d3ab2223b20cc1ad95d5 + video_player: 9cc823b1d9da7e8427ee591e8438bfbcde500e6e + video_player_web: da8cadb8274ed4f8dbee8d7171b420dedd437ce7 + wakelock: 0d4a70faf8950410735e3f61fb15d517c8a6efc4 + webview_flutter: d2b4d6c66968ad042ad94cbb791f5b72b4678a96 + wifi: d7d77c94109e36c4175d845f0a5964eadba71060 + +PODFILE CHECKSUM: ac5efa1ac3c9555d0008dc18004313c84746da62 + +COCOAPODS: 1.10.0 diff --git a/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme index 31d8d1f5..fb2dffc4 100644 --- a/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ b/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -1,6 +1,6 @@ - DisableBuildSystemDeprecationWarning - PreviewsEnabled diff --git a/ios/Runner/AppDelegate.swift b/ios/Runner/AppDelegate.swift index 70693e4a..e686619c 100644 --- a/ios/Runner/AppDelegate.swift +++ b/ios/Runner/AppDelegate.swift @@ -1,13 +1,47 @@ import UIKit import Flutter +import GoogleMaps + @UIApplicationMain @objc class AppDelegate: FlutterAppDelegate { - override func application( - _ application: UIApplication, - didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? - ) -> Bool { - GeneratedPluginRegistrant.register(with: self) - return super.application(application, didFinishLaunchingWithOptions: launchOptions) + let locationManager = CLLocationManager() + + override func application( _ application: UIApplication,didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { +// initLocationManager() + + GMSServices.provideAPIKey("AIzaSyCiiJiHkocPbcziHt9O8rGWavDrxHRQys8") + GeneratedPluginRegistrant.register(with: self) + + if let mainViewController = window.rootViewController as? MainFlutterVC{ + HMGPlatformBridge.initialize(flutterViewController: mainViewController) + } + + if let _ = launchOptions?[.location] { + HMG_Geofence.initGeofencing() + } + + return super.application(application, didFinishLaunchingWithOptions: launchOptions) + } +} + +extension AppDelegate: CLLocationManagerDelegate { + + func initLocationManager(){ + locationManager.allowsBackgroundLocationUpdates = true + locationManager.desiredAccuracy = kCLLocationAccuracyNearestTenMeters + locationManager.activityType = .other + locationManager.delegate = self + locationManager.requestAlwaysAuthorization() + } + + func locationManager(_ manager: CLLocationManager, didEnterRegion region: CLRegion) { + if region is CLCircularRegion { + } + } + + func locationManager(_ manager: CLLocationManager, didExitRegion region: CLRegion) { + if region is CLCircularRegion { + } } } diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json index 65b74d7e..d36b1fab 100644 --- a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json +++ b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -1 +1,122 @@ -{"images":[{"size":"60x60","expected-size":"180","filename":"180.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"iphone","scale":"3x"},{"size":"40x40","expected-size":"80","filename":"80.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"iphone","scale":"2x"},{"size":"40x40","expected-size":"120","filename":"120.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"iphone","scale":"3x"},{"size":"60x60","expected-size":"120","filename":"120.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"iphone","scale":"2x"},{"size":"57x57","expected-size":"57","filename":"57.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"iphone","scale":"1x"},{"size":"29x29","expected-size":"58","filename":"58.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"iphone","scale":"2x"},{"size":"29x29","expected-size":"29","filename":"29.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"iphone","scale":"1x"},{"size":"29x29","expected-size":"87","filename":"87.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"iphone","scale":"3x"},{"size":"57x57","expected-size":"114","filename":"114.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"iphone","scale":"2x"},{"size":"20x20","expected-size":"40","filename":"40.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"iphone","scale":"2x"},{"size":"20x20","expected-size":"60","filename":"60.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"iphone","scale":"3x"},{"size":"1024x1024","filename":"1024.png","expected-size":"1024","idiom":"ios-marketing","folder":"Assets.xcassets/AppIcon.appiconset/","scale":"1x"},{"size":"40x40","expected-size":"80","filename":"80.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"ipad","scale":"2x"},{"size":"72x72","expected-size":"72","filename":"72.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"ipad","scale":"1x"},{"size":"76x76","expected-size":"152","filename":"152.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"ipad","scale":"2x"},{"size":"50x50","expected-size":"100","filename":"100.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"ipad","scale":"2x"},{"size":"29x29","expected-size":"58","filename":"58.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"ipad","scale":"2x"},{"size":"76x76","expected-size":"76","filename":"76.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"ipad","scale":"1x"},{"size":"29x29","expected-size":"29","filename":"29.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"ipad","scale":"1x"},{"size":"50x50","expected-size":"50","filename":"50.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"ipad","scale":"1x"},{"size":"72x72","expected-size":"144","filename":"144.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"ipad","scale":"2x"},{"size":"40x40","expected-size":"40","filename":"40.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"ipad","scale":"1x"},{"size":"83.5x83.5","expected-size":"167","filename":"167.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"ipad","scale":"2x"},{"size":"20x20","expected-size":"20","filename":"20.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"ipad","scale":"1x"},{"size":"20x20","expected-size":"40","filename":"40.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"ipad","scale":"2x"}]} \ No newline at end of file +{ + "images" : [ + { + "size" : "20x20", + "idiom" : "iphone", + "filename" : "Icon-App-20x20@2x.png", + "scale" : "2x" + }, + { + "size" : "20x20", + "idiom" : "iphone", + "filename" : "Icon-App-20x20@3x.png", + "scale" : "3x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "Icon-App-29x29@1x.png", + "scale" : "1x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "Icon-App-29x29@2x.png", + "scale" : "2x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "Icon-App-29x29@3x.png", + "scale" : "3x" + }, + { + "size" : "40x40", + "idiom" : "iphone", + "filename" : "Icon-App-40x40@2x.png", + "scale" : "2x" + }, + { + "size" : "40x40", + "idiom" : "iphone", + "filename" : "Icon-App-40x40@3x.png", + "scale" : "3x" + }, + { + "size" : "60x60", + "idiom" : "iphone", + "filename" : "Icon-App-60x60@2x.png", + "scale" : "2x" + }, + { + "size" : "60x60", + "idiom" : "iphone", + "filename" : "Icon-App-60x60@3x.png", + "scale" : "3x" + }, + { + "size" : "20x20", + "idiom" : "ipad", + "filename" : "Icon-App-20x20@1x.png", + "scale" : "1x" + }, + { + "size" : "20x20", + "idiom" : "ipad", + "filename" : "Icon-App-20x20@2x.png", + "scale" : "2x" + }, + { + "size" : "29x29", + "idiom" : "ipad", + "filename" : "Icon-App-29x29@1x.png", + "scale" : "1x" + }, + { + "size" : "29x29", + "idiom" : "ipad", + "filename" : "Icon-App-29x29@2x.png", + "scale" : "2x" + }, + { + "size" : "40x40", + "idiom" : "ipad", + "filename" : "Icon-App-40x40@1x.png", + "scale" : "1x" + }, + { + "size" : "40x40", + "idiom" : "ipad", + "filename" : "Icon-App-40x40@2x.png", + "scale" : "2x" + }, + { + "size" : "76x76", + "idiom" : "ipad", + "filename" : "Icon-App-76x76@1x.png", + "scale" : "1x" + }, + { + "size" : "76x76", + "idiom" : "ipad", + "filename" : "Icon-App-76x76@2x.png", + "scale" : "2x" + }, + { + "size" : "83.5x83.5", + "idiom" : "ipad", + "filename" : "Icon-App-83.5x83.5@2x.png", + "scale" : "2x" + }, + { + "size" : "1024x1024", + "idiom" : "ios-marketing", + "filename" : "Icon-App-1024x1024@1x.png", + "scale" : "1x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png new file mode 100644 index 00000000..dc9ada47 Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png new file mode 100644 index 00000000..28c6bf03 Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png new file mode 100644 index 00000000..2ccbfd96 Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png new file mode 100644 index 00000000..f091b6b0 Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png new file mode 100644 index 00000000..4cde1211 Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png new file mode 100644 index 00000000..d0ef06e7 Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png new file mode 100644 index 00000000..dcdc2306 Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png new file mode 100644 index 00000000..2ccbfd96 Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png new file mode 100644 index 00000000..c8f9ed8f Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png new file mode 100644 index 00000000..a6d6b860 Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png new file mode 100644 index 00000000..a6d6b860 Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png new file mode 100644 index 00000000..75b2d164 Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png new file mode 100644 index 00000000..c4df70d3 Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png new file mode 100644 index 00000000..6a84f41e Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png differ diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png new file mode 100644 index 00000000..d0e1f585 Binary files /dev/null and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png differ diff --git a/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json b/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json new file mode 100644 index 00000000..0bedcf2f --- /dev/null +++ b/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "LaunchImage.png", + "scale" : "1x" + }, + { + "idiom" : "universal", + "filename" : "LaunchImage@2x.png", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "LaunchImage@3x.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} diff --git a/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png b/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png new file mode 100644 index 00000000..9da19eac Binary files /dev/null and b/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png differ diff --git a/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png b/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png new file mode 100644 index 00000000..9da19eac Binary files /dev/null and b/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png differ diff --git a/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png b/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png new file mode 100644 index 00000000..9da19eac Binary files /dev/null and b/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png differ diff --git a/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md b/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md new file mode 100644 index 00000000..89c2725b --- /dev/null +++ b/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md @@ -0,0 +1,5 @@ +# Launch Screen Assets + +You can customize the launch screen with your own desired assets by replacing the image files in this directory. + +You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images. \ No newline at end of file diff --git a/ios/Runner/Base.lproj/Main.storyboard b/ios/Runner/Base.lproj/Main.storyboard index f3c28516..8ae1ba59 100644 --- a/ios/Runner/Base.lproj/Main.storyboard +++ b/ios/Runner/Base.lproj/Main.storyboard @@ -1,26 +1,29 @@ - - + + + - + + - + - + - + - + + diff --git a/ios/Runner/Base.lproj/Main_Custom.storyboard b/ios/Runner/Base.lproj/Main_Custom.storyboard new file mode 100644 index 00000000..de2d580c --- /dev/null +++ b/ios/Runner/Base.lproj/Main_Custom.storyboard @@ -0,0 +1,102 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ios/Runner/Controllers/MainFlutterVC.swift b/ios/Runner/Controllers/MainFlutterVC.swift new file mode 100644 index 00000000..4f91d052 --- /dev/null +++ b/ios/Runner/Controllers/MainFlutterVC.swift @@ -0,0 +1,118 @@ +// +// MainFlutterVC.swift +// Runner +// +// Created by ZiKambrani on 25/03/1442 AH. +// + +import UIKit +import Flutter +import NetworkExtension +import SystemConfiguration.CaptiveNetwork + +class MainFlutterVC: FlutterViewController { + + override func viewDidLoad() { + super.viewDidLoad() + +// 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 if methodCall.method == "registerHmgGeofences"{ +// self.registerHmgGeofences(result: result) +// } +// +// print("") +// } +// +// FlutterText.with(key: "errorConnectingHmgNetwork") { (localized) in +// print(localized) +// } + + } + + + // 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) + } + } + } + } + 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) { + + } + } + } + + // Register Geofence + func registerHmgGeofences(result: @escaping FlutterResult){ + flutterMethodChannel?.invokeMethod("getGeofencePreferenceKey", arguments: nil){ geoFencesJsonString in + if let jsonString = geoFencesJsonString as? String{ + let allZones = GeoZoneModel.list(from: jsonString) + HMG_Geofence().register(geoZones: allZones) + + }else{ + } + } + } + +} diff --git a/ios/Runner/GoogleService-Info.plist b/ios/Runner/GoogleService-Info.plist new file mode 100644 index 00000000..0c093a2a --- /dev/null +++ b/ios/Runner/GoogleService-Info.plist @@ -0,0 +1,36 @@ + + + + + CLIENT_ID + 864393916058-ekeb4s8tgfo58dutv0l54399t7ivr06r.apps.googleusercontent.com + REVERSED_CLIENT_ID + com.googleusercontent.apps.864393916058-ekeb4s8tgfo58dutv0l54399t7ivr06r + API_KEY + AIzaSyA_6ayGCk4fly7o7eTVBrj9kuHBYHMAOfs + GCM_SENDER_ID + 864393916058 + PLIST_VERSION + 1 + BUNDLE_ID + com.cloud.diplomaticquarterapp + PROJECT_ID + diplomaticquarter-d2385 + STORAGE_BUCKET + diplomaticquarter-d2385.appspot.com + IS_ADS_ENABLED + + IS_ANALYTICS_ENABLED + + IS_APPINVITE_ENABLED + + IS_GCM_ENABLED + + IS_SIGNIN_ENABLED + + GOOGLE_APP_ID + 1:864393916058:ios:13f787bbfe6051f8b97923 + DATABASE_URL + https://diplomaticquarter-d2385.firebaseio.com + + \ No newline at end of file diff --git a/ios/Runner/GuestPOC_Certificate.cer b/ios/Runner/GuestPOC_Certificate.cer new file mode 100644 index 00000000..f3804f6e Binary files /dev/null and b/ios/Runner/GuestPOC_Certificate.cer differ diff --git a/ios/Runner/GuestPOC_Certificate.p12 b/ios/Runner/GuestPOC_Certificate.p12 new file mode 100644 index 00000000..8e289212 Binary files /dev/null and b/ios/Runner/GuestPOC_Certificate.p12 differ diff --git a/ios/Runner/Helper/API.swift b/ios/Runner/Helper/API.swift new file mode 100644 index 00000000..763147c8 --- /dev/null +++ b/ios/Runner/Helper/API.swift @@ -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" + +} diff --git a/ios/Runner/Helper/Extensions.swift b/ios/Runner/Helper/Extensions.swift new file mode 100644 index 00000000..a8793617 --- /dev/null +++ b/ios/Runner/Helper/Extensions.swift @@ -0,0 +1,132 @@ +// +// Extensions.swift +// Runner +// +// Created by ZiKambrani on 04/04/1442 AH. +// + +import UIKit + + +extension String{ + func toUrl() -> URL?{ + return URL(string: self) + } + + func removeSpace() -> String?{ + return self.replacingOccurrences(of: " ", with: "") + } +} + +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 + } + } +} + + +extension UIViewController{ + func showAlert(withTitle: String, message: String){ + let alert = UIAlertController(title: withTitle, message: message, preferredStyle: .alert) + alert.addAction(UIAlertAction(title: "OK", style: .destructive, handler: nil)) + present(alert, animated: true) { + + } + } +} + diff --git a/ios/Runner/Helper/GeoZoneModel.swift b/ios/Runner/Helper/GeoZoneModel.swift new file mode 100644 index 00000000..a6e10a45 --- /dev/null +++ b/ios/Runner/Helper/GeoZoneModel.swift @@ -0,0 +1,67 @@ +// +// GeoZoneModel.swift +// Runner +// +// Created by ZiKambrani on 13/12/2020. +// + +import UIKit +import CoreLocation + +class GeoZoneModel{ + var geofenceId:Int = -1 + var description:String = "" + var descriptionN:String? + var latitude:String? + var longitude:String? + var radius:Int? + var type:Int? + var projectID:Int? + var imageURL:String? + var isCity:String? + + func identifier() -> String{ + return "\(geofenceId)_hmg_geozone" + } + + func message() -> String{ + return description + } + + func toRegion(locationManager:CLLocationManager) -> CLCircularRegion?{ + if let rad = radius, let lat = latitude?.removeSpace(), let long = longitude?.removeSpace(), + let radius_d = Double("\(rad)"), let lat_d = Double(lat), let long_d = Double(long){ + + let coordinate = CLLocationCoordinate2D(latitude: lat_d, longitude: long_d) + let validatedRadius = min(radius_d, locationManager.maximumRegionMonitoringDistance) + + let region = CLCircularRegion(center: coordinate, radius: validatedRadius, identifier: identifier()) + region.notifyOnExit = true + region.notifyOnEntry = true + return region + } + return nil + } + + class func from(json:[String:Any]) -> GeoZoneModel{ + let model = GeoZoneModel() + model.geofenceId = json["GEOF_ID"] as? Int ?? 0 + model.radius = json["Radius"] as? Int + model.projectID = json["ProjectID"] as? Int + model.type = json["Type"] as? Int + model.description = json["Description"] as? String ?? "" + model.descriptionN = json["DescriptionN"] as? String + model.latitude = json["Latitude"] as? String + model.longitude = json["Longitude"] as? String + model.imageURL = json["ImageURL"] as? String + model.isCity = json["IsCity"] as? String + + return model + } + + class func list(from jsonString:String) -> [GeoZoneModel]{ + let value = dictionaryArray(from: jsonString) + let geoZones = value.map { GeoZoneModel.from(json: $0) } + return geoZones + } +} diff --git a/ios/Runner/Helper/GlobalHelper.swift b/ios/Runner/Helper/GlobalHelper.swift new file mode 100644 index 00000000..c5eb7295 --- /dev/null +++ b/ios/Runner/Helper/GlobalHelper.swift @@ -0,0 +1,85 @@ +// +// GlobalHelper.swift +// Runner +// +// Created by ZiKambrani on 29/03/1442 AH. +// + +import UIKit + +func dictionaryArray(from:String) -> [[String:Any]]{ + if let data = from.data(using: .utf8) { + do { + return try JSONSerialization.jsonObject(with: data, options: []) as? [[String: Any]] ?? [] + } catch { + print(error.localizedDescription) + } + } + return [] + +} + +func dictionary(from:String) -> [String:Any]?{ + if let data = from.data(using: .utf8) { + do { + return try? JSONSerialization.jsonObject(with: data, options: []) as? [String: Any] + } catch { + print(error.localizedDescription) + } + } + return nil + +} + +func showNotification(identifier:String? = nil, title:String?, subtitle:String?, message:String?, sound:UNNotificationSound = UNNotificationSound.default){ + let notificationContent = UNMutableNotificationContent() + + if identifier != nil { notificationContent.categoryIdentifier = identifier! } + if title != nil { notificationContent.title = title! } + if subtitle != nil { notificationContent.body = message! } + if message != nil { notificationContent.subtitle = subtitle! } + + notificationContent.sound = UNNotificationSound.default + let trigger = UNTimeIntervalNotificationTrigger(timeInterval: 1, repeats: false) + let request = UNNotificationRequest(identifier: "\(Date().timeIntervalSinceNow)", content: notificationContent, trigger: trigger) + UNUserNotificationCenter.current().add(request) { error in + if let error = error { + print("Error: \(error)") + } + } +} + + +func httpPostRequest(urlString:String, jsonBody:[String:Any], completion:((Bool,[String:Any]?)->Void)?){ + let json: [String: Any] = jsonBody + let jsonData = try? JSONSerialization.data(withJSONObject: json) + + // create post request + let url = URL(string: urlString)! + var request = URLRequest(url: url) + request.addValue("application/json", forHTTPHeaderField: "Content-Type") + request.addValue("*/*", forHTTPHeaderField: "Accept") + request.httpMethod = "POST" + request.httpBody = jsonData + + let task = URLSession.shared.dataTask(with: request) { data, response, error in + guard let data = data, error == nil else { + print(error?.localizedDescription ?? "No data") + return + } + + let responseJSON = try? JSONSerialization.jsonObject(with: data, options: []) + if let responseJSON = responseJSON as? [String: Any], let status = responseJSON["MessageStatus"] as? Int{ + print(responseJSON) + if status == 1{ + completion?(true,responseJSON) + }else{ + completion?(false,responseJSON) + } + + } + } + + task.resume() + +} diff --git a/ios/Runner/Helper/HMGPlatformBridge.swift b/ios/Runner/Helper/HMGPlatformBridge.swift new file mode 100644 index 00000000..1e8ee735 --- /dev/null +++ b/ios/Runner/Helper/HMGPlatformBridge.swift @@ -0,0 +1,128 @@ +// +// HMGPlatformBridge.swift +// Runner +// +// Created by ZiKambrani on 14/12/2020. +// + +import UIKit +import NetworkExtension +import SystemConfiguration.CaptiveNetwork + +var flutterMethodChannel:FlutterMethodChannel? = nil +var mainViewController:MainFlutterVC! + +class HMGPlatformBridge{ + private let channelName = "HMG-Platform-Bridge" + private static var shared_:HMGPlatformBridge? + + class func initialize(flutterViewController:MainFlutterVC){ + shared_ = HMGPlatformBridge() + mainViewController = flutterViewController + shared_?.openChannel() + } + + func shared() -> HMGPlatformBridge{ + assert((HMGPlatformBridge.shared_ != nil), "HMGPlatformBridge is not initialized, call initialize(mainViewController:MainFlutterVC) function first.") + return HMGPlatformBridge.shared_! + } + + private func openChannel(){ + flutterMethodChannel = FlutterMethodChannel(name: channelName, binaryMessenger: mainViewController.binaryMessenger) + flutterMethodChannel?.setMethodCallHandler { (methodCall, result) in + print("Called function \(methodCall.method)") + 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 if methodCall.method == "registerHmgGeofences"{ + self.registerHmgGeofences(result: result) + } + + print("") + } + } + + + + // 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) + } + } + } + } + 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)) + mainViewController.present(alert, animated: true) { + + } + } + } + + // Register Geofence + func registerHmgGeofences(result: @escaping FlutterResult){ + flutterMethodChannel?.invokeMethod("getGeoZones", arguments: nil){ geoFencesJsonString in + if let jsonString = geoFencesJsonString as? String{ + let allZones = GeoZoneModel.list(from: jsonString) + HMG_Geofence.shared().register(geoZones: allZones) + + }else{ + } + } + } + +} diff --git a/ios/Runner/Helper/HMG_Geofence.swift b/ios/Runner/Helper/HMG_Geofence.swift new file mode 100644 index 00000000..20d2d1e8 --- /dev/null +++ b/ios/Runner/Helper/HMG_Geofence.swift @@ -0,0 +1,188 @@ +// +// HMG_Geofence.swift +// Runner +// +// Created by ZiKambrani on 13/12/2020. +// + +import UIKit +import CoreLocation + +fileprivate var df = DateFormatter() +fileprivate var transition = "" + +enum Transition:Int { + case entry = 1 + case exit = 2 + func name() -> String{ + return self.rawValue == 1 ? "Enter" : "Exit" + } +} + +class HMG_Geofence:NSObject{ + + var geoZones:[GeoZoneModel]? + var locationManager:CLLocationManager!{ + didSet{ + // https://developer.apple.com/documentation/corelocation/cllocationmanager/1423531-startmonitoringsignificantlocati + + locationManager.allowsBackgroundLocationUpdates = true + locationManager.desiredAccuracy = kCLLocationAccuracyNearestTenMeters + locationManager.activityType = .other + locationManager.delegate = self + locationManager.requestAlwaysAuthorization() + // locationManager.distanceFilter = 500 + // locationManager.startMonitoringSignificantLocationChanges() + } + } + + private static var shared_:HMG_Geofence? + class func shared() -> HMG_Geofence{ + if HMG_Geofence.shared_ == nil{ + HMG_Geofence.initGeofencing() + } + return shared_! + } + + class func initGeofencing(){ + shared_ = HMG_Geofence() + shared_?.locationManager = CLLocationManager() + } + + func register(geoZones:[GeoZoneModel]){ + + self.geoZones = geoZones + + let monitoredRegions_ = monitoredRegions() + self.geoZones?.forEach({ (zone) in + if let region = zone.toRegion(locationManager: locationManager){ + if let already = monitoredRegions_.first(where: {$0.identifier == zone.identifier()}){ + debugPrint("Already monitering region: \(already)") + }else{ + startMonitoring(region: region) + } + }else{ + debugPrint("Invalid region: \(zone.latitude ?? "invalid_latitude"),\(zone.longitude ?? "invalid_longitude"),r\(zone.radius ?? 0) | \(zone.identifier())") + } + }) + } + + func monitoredRegions() -> Set{ + return locationManager.monitoredRegions + } + +} + +// CLLocationManager Delegates +extension HMG_Geofence : CLLocationManagerDelegate{ + + func startMonitoring(region: CLCircularRegion) { + if !CLLocationManager.isMonitoringAvailable(for: CLCircularRegion.self) { + return + } + + if CLLocationManager.authorizationStatus() != .authorizedAlways { + let message = """ + Your geotification is saved but will only be activated once you grant + HMG permission to access the device location. + """ + debugPrint(message) + } + + locationManager.startMonitoring(for: region) + locationManager.requestState(for: region) + debugPrint("Starts monitering region: \(region)") + } + + func locationManager(_ manager: CLLocationManager, didEnterRegion region: CLRegion) { + debugPrint("didEnterRegion: \(region)") + if region is CLCircularRegion { + handleEvent(for: region,transition: .entry, location: manager.location) + } + } + + func locationManager(_ manager: CLLocationManager, didExitRegion region: CLRegion) { + debugPrint("didExitRegion: \(region)") + if region is CLCircularRegion { + handleEvent(for: region,transition: .exit, location: manager.location) + } + } + + func locationManager(_ manager: CLLocationManager, didDetermineState state: CLRegionState, for region: CLRegion) { + debugPrint("didDetermineState: \(state)") + } + + func locationManager(_ manager: CLLocationManager, didUpdateLocations locations: [CLLocation]) { + debugPrint("didUpdateLocations: \(locations)") + } + + +} + +// Helpers +extension HMG_Geofence{ + + func handleEvent(for region: CLRegion!, transition:Transition, location:CLLocation?) { + notifyUser(forRegion: region, transition: transition, location: locationManager.location) + notifyServer(forRegion: region, transition: transition, location: locationManager.location) + } + + func geoZone(by id: String) -> GeoZoneModel? { + var zone:GeoZoneModel? = nil + if let zones_ = geoZones{ + zone = zones_.first(where: { $0.identifier() == id}) + }else{ + // let jsonArray = UserDefaults.standard.string(forKey: "hmg-geo-fences") + } + return zone + } + + + func notifyUser(forRegion:CLRegion, transition:Transition, location:CLLocation?){ + if let zone = geoZone(by: forRegion.identifier){ + if UIApplication.shared.applicationState == .active { + mainViewController.showAlert(withTitle: transition.name(), message: zone.message()) + }else{ + + } + } + } + + func notifyServer(forRegion:CLRegion, transition:Transition, location:CLLocation?){ + showNotification(title: "Notifying server..." , subtitle: forRegion.identifier, message: "") + if let userProfileJson = UserDefaults.standard.string(forKey: "user-profile"), + let userProfile = dictionary(from: userProfileJson), let patientId = userProfile["PatientID"] as? String{ + + if let idString = forRegion.identifier.split(separator: "_").first, let idInt = Int(idString){ + let body:[String:Any] = [ + "PointsID":idInt, + "GeoType":transition.rawValue, + "PatientID":patientId + ] + + let url = "https://hmgwebservices.com/Services/Patients.svc/REST/GeoF_InsertPatientFileInfo" + httpPostRequest(urlString: url, jsonBody: body){ (status,json) in + showNotification(title: transition.name(), subtitle: forRegion.identifier, message: status ? "Success: notified to server ✔️" : "Failed to notified server ✖️") + } + } + } + } + + // func notifyServer(forRegion:GeoZoneModel, transition:Transition, location:CLLocation?){ + // flutterMethodChannel?.invokeMethod("getLogGeofenceFullUrl", arguments: nil){ fullUrlString in + // if let url = fullUrlString as? String{ + // flutterMethodChannel?.invokeMethod("getDefaultHttpParameters", arguments: nil){ params in + // if var body = params as? [String : Any]{ + // body.updateValue(forZone.geofenceId, forKey: "PointsID") + // body.updateValue(transition.rawValue, forKey: "GeoType") + // httpPostRequest(urlString: url, jsonBody: body){ (status,json) in + // showNotification(title: transition.name(), subtitle: forZone.identifier(), message: status ? "Success: sent to server ✔️" : "Failed: sent to server ✖️") + // } + // } + // } + // } + // } + // } + +} + diff --git a/ios/Runner/Helper/LocalizedFromFlutter.swift b/ios/Runner/Helper/LocalizedFromFlutter.swift new file mode 100644 index 00000000..88530649 --- /dev/null +++ b/ios/Runner/Helper/LocalizedFromFlutter.swift @@ -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) + } + }) + } + +} diff --git a/ios/Runner/Info.plist b/ios/Runner/Info.plist index 6a2a87ce..ae084167 100644 --- a/ios/Runner/Info.plist +++ b/ios/Runner/Info.plist @@ -4,8 +4,6 @@ CFBundleDevelopmentRegion $(DEVELOPMENT_LANGUAGE) - CFBundleDisplayName - Dr. Alhabib MC CFBundleExecutable $(EXECUTABLE_NAME) CFBundleIdentifier @@ -13,7 +11,7 @@ CFBundleInfoDictionaryVersion 6.0 CFBundleName - DiplomaticQuarter + diplomaticquarterapp CFBundlePackageType APPL CFBundleShortVersionString @@ -24,47 +22,43 @@ $(FLUTTER_BUILD_NUMBER) LSRequiresIPhoneOS - NSBluetoothAlwaysUsageDescription - This App requires access to Bluetooth to connect blood pressure & blood sugar devices with the app to analyze the data. - NSBluetoothPeripheralUsageDescription - This App requires access to Bluetooth to connect blood pressure & blood sugar devices with the app to analyze the data. NSCalendarsUsageDescription - This app requires calendar access to set reminders for Virtual & Normal Appointments. + We need access to record you event in to calender. NSCameraUsageDescription - This app requires camera access to enable virtual consultation between patient & doctor - NSContactsUsageDescription - This app requires contacts access to show incoming virtual consultation request. - NSFaceIDUsageDescription - This app requires Face ID to allow biometric authentication for app login. + Need camera access for uploading images NSLocationAlwaysAndWhenInUseUsageDescription - This App requires access to your location to show the nearest hospitals & ER Locations from your location. + This app will use your location to show cool stuffs near you. NSLocationAlwaysUsageDescription - This App requires access to your location to show the nearest hospitals from your location. + This app will use your location to show cool stuffs near you. + NSLocationUsageDescription + Need location access for updating nearby friends NSLocationWhenInUseUsageDescription - This App requires access to your location to show the nearest hospitals from your location. + This app will use your location to show cool stuffs near you. NSMicrophoneUsageDescription - This app requires microphone access to enable virtual consultation between patient & doctor - NSMotionUsageDescription - This app requires motion detection access to function properly. + Need microphone access for uploading videos NSPhotoLibraryUsageDescription - This app requires photo library access to select image as document & upload it. - NSRemindersUsageDescription - This app requires calendar access to set reminders for Virtual & Normal Appointments. - NSSpeechRecognitionUsageDescription - This app requires access to speech recognition to identify which words are spoken into the microphone. - NSAppleMusicUsageDescription - Required usage description for a Flutter dependency + Need photo library access for uploading images UIBackgroundModes - remote-notification + fetch + location + processing UILaunchStoryboardName LaunchScreen UIMainStoryboardFile Main + UIRequiredDeviceCapabilities + + location-services + gps + armv7 + UISupportedInterfaceOrientations UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight UISupportedInterfaceOrientations~ipad diff --git a/ios/Runner/Runner.entitlements b/ios/Runner/Runner.entitlements index 903def2a..be2e0283 100644 --- a/ios/Runner/Runner.entitlements +++ b/ios/Runner/Runner.entitlements @@ -2,7 +2,13 @@ + + aps-environment development + com.apple.developer.networking.HotspotConfiguration + + com.apple.developer.networking.wifi-info + diff --git a/ios/Runner/WifiConnect/HMG_GUEST.swift b/ios/Runner/WifiConnect/HMG_GUEST.swift new file mode 100644 index 00000000..ad6d3922 --- /dev/null +++ b/ios/Runner/WifiConnect/HMG_GUEST.swift @@ -0,0 +1,77 @@ +// +// 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 let SSID = "HMG-MobileApp" + +class HMG_GUEST{ + static let shared = HMG_GUEST() + + private var complete:((_ status:Bool, _ message:String) -> Void)! + func connect(completion:@escaping ((_ status:Bool, _ message:String) -> Void)){ + complete = completion + + if isAlreadyConnected() { + FlutterText.with(key: "alreadyConnectedHmgNetwork") { (localized) in + self.complete(true, localized ) + } + }else{ + connect() + } + } + + private func connect() { + + 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 { + FlutterText.with(key: "errorConnectingHmgNetwork") { (localized) in + self.complete(false, localized ) + } + }else{ + _ = 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 ) + } + } + } + } + + +// NSMutableURLRequest(url: URL(string: "www.google.com")!).bind(to: command) +// NEHotspotHelper.register(options: [:], queue: DispatchQueue.global()) { (command) in +// command +// print(command) +// } + + } + + 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 + } + +} diff --git a/ios/Runner/WifiConnect/HMG_GUEST_bkp.swift b/ios/Runner/WifiConnect/HMG_GUEST_bkp.swift new file mode 100644 index 00000000..e3dfd468 --- /dev/null +++ b/ios/Runner/WifiConnect/HMG_GUEST_bkp.swift @@ -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("Success"){ +// completion(true) +// }else{ +// completion(false) +// } +// +// } +// task.resume() +// } +// +//} diff --git a/ios/Runner/WifiConnect/HMG_Internet.swift b/ios/Runner/WifiConnect/HMG_Internet.swift new file mode 100644 index 00000000..00ac172f --- /dev/null +++ b/ios/Runner/WifiConnect/HMG_Internet.swift @@ -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("success") + ) + + } + task.resume() + } + +} diff --git a/ios/Runner/WifiConnect/HMG_Wifi.swift b/ios/Runner/WifiConnect/HMG_Wifi.swift new file mode 100644 index 00000000..1335f766 --- /dev/null +++ b/ios/Runner/WifiConnect/HMG_Wifi.swift @@ -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("success") + ) + + } + task.resume() + } + +} diff --git a/ios/gpx.gpx b/ios/gpx.gpx new file mode 100644 index 00000000..addbfa24 --- /dev/null +++ b/ios/gpx.gpx @@ -0,0 +1 @@ + Sverrir Sigmundarson Office Office Panorama Mall Panorama Mall Saudi Architects Crossing Saudi Architects Crossing Office Office \ No newline at end of file diff --git a/lib/config/config.dart b/lib/config/config.dart index 2317361f..4a420ec8 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -1,53 +1,49 @@ import 'dart:io'; +import 'package:diplomaticquarterapp/core/service/geofencing/GeofencingServices.dart'; import 'package:diplomaticquarterapp/models/Request.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/widgets/mobile-no/mobile_no.dart'; const MAX_SMALL_SCREEN = 660; +// PACKAGES and OFFERS +const EXA_CART_API_BASE_URL = 'https://mdlaboratories.com/exacartapi'; +const PACKAGES_CATEGORIES = '/api/categories'; +const PACKAGES_PRODUCTS = '/api/products'; + // 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'; -//weather -const WEATHER_INDICATOR = 'Services/Weather.svc/REST/GetCityInfo'; +///Geofencing +const GET_GEO_ZONES = 'Services/Patients.svc/REST/GeoF_GetAllPoints'; +const LOG_GEO_ZONES = 'Services/Patients.svc/REST/GeoF_InsertPatientFileInfo'; ///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_NOTES = - 'Services/Doctors.svc/REST/dr_GetNotesDoctorRating'; -const GET_DOCTOR_RATING_DETAILS = - 'Services/Doctors.svc/REST/dr_GetDoctorRatingDetails'; 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'; @@ -56,24 +52,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'; @@ -82,8 +71,7 @@ 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'; @@ -91,18 +79,14 @@ const GET_BABY_BY_USER_ID = 'Services/Community.svc/REST/GetBabyByUserID'; ///userInformation const GET_USERINFORMATION_REQUEST = 'Services/Community.svc/REST/GetUserInformation_New'; -///Update email -const UPDATE_PATENT_EMAIL = 'Services/Patients.svc/REST/UpdatePateintEmail'; -const UPDATE_PATENT_INFO = 'Services/Community.svc/REST/UpdateUserInfo_New'; - ///addNewChild const GET_NEWCHILD_REQUEST = 'Services/Community.svc/REST/CreateNewBaby'; ///newUserId const GET_NEW_USER_REQUEST = 'Services/Community.svc/REST/CreateNewUser_New'; -///delete Child -const DELETE_CHILD_REQUEST = '/Services/Community.svc/REST/DeleteBaby'; +///delteChild +const DELETE_CHILD_REQUEST = 'Services/Community.svc/REST/DeleteBaby'; ///addNewTABLE const GET_TABLE_REQUEST = 'Services/Community.svc/REST/CreateVaccinationTable'; @@ -111,19 +95,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'; @@ -135,8 +115,7 @@ const GET_QR_PARKING = 'Services/SWP.svc/REST/GetQRParkingByID'; 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"; +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'; @@ -145,106 +124,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 HIS_CREATE_ADVANCE_PAYMENT = - "Services/Patients.svc/REST/HIS_CreateAdvancePayment"; +const HIS_CREATE_ADVANCE_PAYMENT = "Services/Patients.svc/REST/HIS_CreateAdvancePayment"; -const ADD_ADVANCE_NUMBER_REQUEST = - 'Services/PayFort_Serv.svc/REST/AddAdvancedNumberRequest'; +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 GET_PRIVILEGE = 'Services/Patients.svc/REST/Service_Privilege'; +const UPDATE_HEALTH_TERMS = '/services/Patients.svc/REST/UpdatePateintHealthSummaryReport'; //URL to get medicine and pharmacies list const CHANNEL = 3; @@ -256,24 +205,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 = 1; +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"; @@ -283,59 +229,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'; @@ -343,18 +268,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"; @@ -367,31 +287,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 GET_PATIENT_ALL_PRES_ORD= 'Services/Patients.svc/REST/PatientER_GetPatientAllPresOrders'; -const PATIENT_ER_INSERT_PRES_ORDER= 'Services/Patients.svc/REST/PatientER_InsertPresOrder'; - - -// External API -const ADD_ADDRESS_INFO= "https://mdlaboratories.com/exacartapi/api/addcustomeraddress"; -const GET_CUSTOMER_ADDRESSES= "https://mdlaboratories.com/exacartapi/api/Customers/"; -const GET_CUSTOMER_INFO = "https://mdlaboratories.com/exacartapi/api/VerifyCustomer"; - - +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"; diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index df63929a..3aa066e6 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -1,3 +1,27 @@ +// --------- - -- - - - - - - - - ---------------- +// 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': 'الاعدادات'}, @@ -21,10 +45,7 @@ const Map 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 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 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': 'رفع'}, @@ -112,54 +101,27 @@ const Map localizedValues = { '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': 'هل قمت بزيارة مجموعة الحبيب الطبية من قبل؟' - }, + "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": "Enter the Identification Number", - "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": "نسيت رقم الملف الطبي؟"}, - "forgotFileNoTitle": { - "en": "Forgot medical file Number", - "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": "الرجاء إدخال معلومات الملف الشخصي" - }, + "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": "معرف الوجه"}, @@ -168,32 +130,18 @@ const Map 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 the Verification Code sent to", - "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": "إعدادات التطبيق"}, @@ -201,80 +149,31 @@ const Map 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": "الاسم الأول"}, @@ -285,10 +184,7 @@ const Map 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": "ادخل البريد الالكتروني"}, @@ -327,10 +223,7 @@ const Map 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": "رقم الاشتراك"}, @@ -338,68 +231,34 @@ const Map 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': 'عرض الكل'}, + "view": {"en": "View", '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": "خدمات الحبيب"}, @@ -422,18 +281,9 @@ const Map localizedValues = { "ambulancerequest": {"en": "Ambulance :", "ar": "طلب نقل "}, "requestA": {"en": "Request:", "ar": "اسعاف"}, "MyAppointments": {"en": "Appointments", "ar": "مواعيدي"}, - "NoBookedAppointments": { - "en": "No Booked Appointments", - "ar": "لا توجد مواعيد محجوزة" - }, - "NoConfirmedAppointments": { - "en": "No Confirmed Appointments", - "ar": "لا توجد مواعيد مؤكدة" - }, - "noArrivedAppointments": { - "en": "No Arrived 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": "صور وتقارير"}, @@ -489,19 +339,10 @@ const Map 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": @@ -510,36 +351,20 @@ const Map 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": "Wallet Amount", "ar": "مبلغ المحفظة"}, - "TotalBalance": { "en": "Total Amount", "ar": "المبلغ الإجمالي"}, - "CreateAdvancedPayment": { - "en": "Recharge Wallet", - "ar": "إعادة شحن المحفظة" - }, + "BalanceAmount": {"en": "Balance Amount", "ar": "رصيدالحساب"}, + "TotalBalance": {"en": "Total Balance", "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": "أفراد الأسرة"}, @@ -551,14 +376,8 @@ const Map 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": "نظارات"}, @@ -581,10 +400,8 @@ const Map 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": "يوم الانتهاء"}, @@ -594,24 +411,12 @@ const Map 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.", @@ -621,105 +426,42 @@ const Map 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": "هذة الخدمة تتطلب تسجيل الدخول" - }, + "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": "وصفاتي" - }, - "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": "حذف كافة العناصر" - }, + "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": "اسحب لتغيير عمرك" - },"HHCNotAuthMsg": { - "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.", - "ar": "من خلال هذه الخدمة يمكنك طلب مجموعة من الفحوصات التي تساعدك وتساعد طبيبك في فهم حالتك الصحية الحالية ومن ثم تحديد المخاطر المحتملة" - }, + "drag-point": {"en": "Drag point to change your age", "ar": "اسحب لتغيير عمرك"}, "email": {"en": "Email", "ar": "البريد الالكتروني"}, "Book": {"en": "Book", "ar": "احجز"}, "AppointmentLabel": {"en": "Appointment", "ar": "موعد"}, @@ -729,10 +471,7 @@ const Map localizedValues = { "profile": {"en": "Profile", "ar": "ملفي"}, "notifications": {"en": "Notifications", "ar": "إشعارات"}, "notificationDetails": {"en": "Notification Details", "ar": "تفاصيل الاشعار"}, - "notificationDetailsa": { - "en": "Notification Details", - "ar": "تفاصيل الاشعار" - }, + "notificationDetailsa": {"en": "Notification Details", "ar": "تفاصيل الاشعار"}, "info-my-doctor-points": { "en": [ @@ -741,24 +480,15 @@ const Map localizedValues = { "View details of your appointments with the selected doctor.", "Book appointment with the doctor. ", ], - "ar": [ - "الاطلاع على معلومات الطبيب ومؤهلاته.", - "الاطلاع على جدول الطبيب.", - "الاطلاع على تفاصيل المواعيد التي تمت مع الطبيب.", - "حجز موعد مع الطبيب." - ] + "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": - "خدمة اطبائي: هذه الخدمة تمكنك من الاطلاع على جميع الاطباء الذين قمت بزيارتهم في مجموعة الحبيب الطبية, كما تستطيع من خلال هذه الخدمة:" + "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": - "خدمة الوصفات الطبية: هذه الخدمة تمكنك من الاطلاع على جميع الوصفات الطبية التي تم اصدارها في مجموعة الحبيب الطبية، كما تستطيع من خلال هذه الخدمة:" + "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": [ @@ -782,10 +512,8 @@ const Map localizedValues = { }, "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": - "خدمة بطاقات التامين: هذه الخدمة تمكنك من الاطلاع على جميع بطاقات التامين والتي تم تسجيلها اثناء زياراتك لمجموعة الحبيب الطبية بالاضافة الى:" + "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": "خدمة بطاقات التامين: هذه الخدمة تمكنك من الاطلاع على جميع بطاقات التامين والتي تم تسجيلها اثناء زياراتك لمجموعة الحبيب الطبية بالاضافة الى:" }, "info-insurance-cards-points": { @@ -808,19 +536,15 @@ const Map localizedValues = { }, "info-allergies": { - "en": - "This service allows you to view all types of allergies recorded during your visits to Al Habib Medical Group.", - "ar": - "خدمة الحساسية: هذه الخدمة تمكنك من الاطلاع على جميع انواع الحساسية التي تم تسجيلها خلال زياراتك في مجموعة الحبيب الطبية." + "en": "This service allows you to view all types of allergies recorded during your visits to Al Habib Medical Group.", + "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": - "الاجازات المرضية: هذه الخدمة تمكنك من الاطلاع على جميع الاجازات المرضية والتي تم اصدارها في مجموعة الحبيب الطبية بالاضافة الى:" + "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": [ @@ -830,20 +554,12 @@ const Map localizedValues = { "Branch that patient take the vaccination form.", "Sending a report of vaccinations to the email. ", ], - "ar": [ - "اسم الطبيب", - "تاريخ الاجازة.", - "عدد ايام الاجازة.", - "الفرع الذي تم اصدار الاجازة منه.", - "ارسال نسخة مختومة من الاجازة الى البريد الالكتروني." - ] + "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": - "خدمة الموافقات: هذه الخدمة تمكنك من الاطلاع على جميع طلبات الموافقات والتي تم ارسالها الى شركات التامين بالاضافة الى:" + "en": "This service allows you to view all approvals requests that have been sent to the insurance companies in addition to:", + "ar": "خدمة الموافقات: هذه الخدمة تمكنك من الاطلاع على جميع طلبات الموافقات والتي تم ارسالها الى شركات التامين بالاضافة الى:" }, "info-approval-points": { @@ -861,37 +577,18 @@ const Map localizedValues = { "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": "لغة الرسائل القصيرة و الاتصال الآلي" + "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": "استلام التنبيهات بالرسائل القصيرة" - }, + "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": "رقم للتواصل في حالة الطوارئ" - }, + "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": "تأثيرات لدعم ضعاف البصر" - }, + "blind-modes": {"en": "Modes for Partially Blind", "ar": "تأثيرات لدعم ضعاف البصر"}, "invert-theme": {"en": "Invert", "ar": "ألوان سلبية"}, "off-theme": {"en": "Off", "ar": "إيقاف"}, "dim-theme": {"en": "Dim", "ar": "ضوء خافت"}, @@ -908,14 +605,8 @@ const Map localizedValues = { "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': ' نصائح صحية على أساس الطقس الحالي ' - }, + "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": "إعادة طلب و توصيل"}, @@ -936,394 +627,33 @@ const Map localizedValues = { "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": - "يسعدنا سماع ملاحظاتك حول خدمات الرعاية الصحية والخدمات الإلكترونية. يرجى تعبئة الحقول المطلوبة" + "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-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": "شكوى بدون موعد" - }, + "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": "يرجى تحديد الجزء الذي تشكو منه" - }, + "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": "You Can Find ", "ar": "باستطاعتك العثور على "}, + "searchItemError": {"en": "Item name should be more than 3 character ", "ar": "يجب أن يكون اسم العنصر أكثر من 3 أحرف"}, + "YouCanFind": {"en": "YouCanFind", "ar": "باستطاعتك العثور على "}, "ItemInSearch": {"en": " Item In Search", "ar": " عنصر في البحث "}, - "InvoiceNo": {"en": " Invoice No", "ar": "رقم الفاتورة"}, - "SpecialResult": {"en": " Special Result", "ar": "نتيجة خاصة"}, - "GeneralResult": {"en": "General Result", "ar": "نتيجة عامة"}, - "show-more-btn": {"en": "Flow Chart", "ar": "النتائج التراكمية"}, - - "value": {"en": "Value", "ar": "القيمة"}, - "range": {"en": "Range", "ar": "المدى"}, - "out-patient": {"en": "Out Patient", "ar": "عيادات خارجية"}, - "in-patient": {"en": "In Patient", "ar": "تنويم"}, - "report": {"en": "Radiology Report", "ar": "تقرير الاشعة"}, - "open-rad": {"en": "Open Image", "ar": "فتح صور الاشعة"}, - "send-copy": {"en": "Email the Report", "ar": "أرسل التقرير"}, - "appoSurvey": {"en": "Survey", "ar": "إستبيان"}, - "appoSurveySubtitle": {"en": "Survey", "ar": "إستبيان"}, - "labResults": {"en": "Lab Result", "ar": "نتيجة المختبر"}, - "doctorRating": {"en": "Doctor Rating", "ar": "تقييم الطبيب"}, - "good": {"en": "Good", "ar": "جيد"}, - "v-good": {"en": "Very Good", "ar": "جيد جدا"}, - "excellent": {"en": "Excellent", "ar": "ممتاز"}, - "average": {"en": "Average", "ar": "متوسط"}, - "below-average": {"en": "Below Average", "ar": "أقل من المتوسط"}, - "info-signs": { - "en": - "This service allows you to view all vital signs were performed in the Habib Medical Group, e.x (height, weight, body mass index, heart rate, etc.) as well shows some statistics charts.", - "ar": - "خدمة المؤشرات الحيوية: هذه الخدمة تمكنك من الاطلاع على جميع المؤشرات الحيوية على سبيل المثال (الطول، الوزن، مؤشر كتلة الجسم، معدل نبضات القلب الخ..) التي تمت في مجموعة الحبيب الطبية وكذلك رسوم بيانية على مستوى المؤشر." - }, - "info-advance-payment": { - "en": - "This service designed so that you can deposit an amount in advance either in your account or in someone else's account with Al Habib Medical Group.", - "ar": - "تم تصميم هذه الخدمة حتى تتمكن من دفع مبلغ مقدما او تحت الحساب سواء في حسابك او في حساب شخص اخر لدى مجموعة الحبيب الطبية." - }, - "info-my-balance": { - "en": "This service allows you to check your balance in all branchs", - "ar": "هذه الخدمه تتيح لك الاطلاع رصيدك في كل الفروع" - }, - "er-contant": { - "en": - "This service displays nearest branch among all the branches of Al Habib Medical Group based on your current location.", - "ar": - "تعرض هذه الخدمة أقرب فرع من بين جميع فروع مجموعة الحبيب الطبية بناءً على موقعك الحالي." - }, - "er": {"en": "ER", "ar": "الطوارىء"}, - "transportation-Service": {"en": "Ambulance Request", "ar": "طلب نقل اسعاف"}, - "info-ambulance": { - "en": - "Through this service, you can request evacuation by ambulance, whether from home or to home, in addition to a set of other services", - "ar": - "عن طريق هذه الخدمة يمكنك طلب اخلاء بواسطة سيارة اسعاف سواء من المزل او الى المنزل بالاضافة الى مجموعة من الخدمات الاخرى" - }, - "RRT-transport-heading": { - "en": "Select Transportation Method", - "ar": "حدد طريقة النقل" - }, - "sar": {"en": "SR", "ar": "ر.س"}, - "RRT-direction-heading": {"en": "Select Direction", "ar": "حدد الاتجاه"}, - "to-hospital": {"en": "To Hospital", "ar": "الى المستشفى"}, - "from-hospital": {"en": "From Hospital", "ar": "من المستشفى"}, - "one-direc": {"en": "One Way", "ar": "ذهاب"}, - "two-direc": {"en": "Two Ways", "ar": "ذهاب وعودة"}, - "pickup-location": {"en": "Pickup Location", "ar": "نقطة الانطلاق"}, - "pickup-spot": {"en": "Pickup Spot", "ar": "نقطة اللقاء"}, - "inside-home": {"en": "Inside Home", "ar": "داخل المنزل"}, - "have-appo": {"en": "Do you have an appointment?", "ar": "هل لديك موعد؟"}, - "dropoff-location": {"en": "Dropoff Location", "ar": "نقطة الوصول"}, - "select-all": { - "en": "Please select all fields", - "ar": "يرجى تحديد جميع الحقول" - }, - "select-map": {"en": "Select From Map", "ar": "حدد من الخريطة"}, - "no-appointment": { - "en": "You don't have any appointments yet", - "ar": "ليس لديك أي مواعيد حتى الآن" - }, - "patient-share": {"en": "Amount before tax: ", "ar": "المبلغ قبل الضريبة:"}, - "patient-share-tax": {"en": "Tax amount: ", "ar": "قيمة الضريبة:"}, - "patient-share-total": { - "en": "Total amount payable: ", - "ar": "المبلغ الإجمالي المستحق:" - }, - "select-ambulate": {"en": "Select Ambulate", "ar": "بحاجة للتنقل بواسطة"}, - "wheelchair": {"en": "Wheelchair", "ar": "كرسي متحرك"}, - "walker": {"en": "Walker", "ar": "مشاية"}, - "stretcher": {"en": "Stretcher", "ar": "نقالة"}, - "none": {"en": "None", "ar": "لا شيء"}, - "RRT-Summary": {"en": "Summary", "ar": "ملخص الطلب"}, - "bill-amount": {"en": "Bill Amount", "ar": "مبلغ الفاتورة"}, - "transport-method": {"en": "Transportation Method", "ar": "طريقة النقل"}, - "directions": {"en": "Directions", "ar": "الاتجاهات"}, - "info-my-appointments": { - "en": - "This service allows you to see all the appointment you have visited in Al Habib Medical Group, and through this service:", - "ar": - "خدمة مواعيدي: هذه الخدمة تمكنك من الاطلاع على جميع المواعيد التي قمت بزيارتهم في مجموعة الحبيب الطبية, كما تستطيع من خلال هذه الخدمة:" - }, - "info-todo": { - "en": - "This service is designed to enable you to have a quick link to the list of tasks that need to be done", - "ar": - "هذه الخدمة تم تصميمها لتمكنك من الوصول الى رابط سريع لقائمة المهام التي يجب القيام بها" - }, - "family-info": { - "en": - "Through this service, you will be able to link your family medical files to your medical file so that you can manage their records by login to your medical file.", - "ar": - "هذه الخدمة تم تصميمها لتتمكن من ربط الملفات الطبية للعائلة بملفك الطبي حتى تتمكن من إدارة سجلاتهم عن طريق تسجيل الدخول إلى ملفك الطبي." - }, - "dental-complains": { - "en": "Symptoms", - "ar": "الأعراض" - }, - "empty-result": { - "en": "There is no search results found", - "ar": "لايوجد نتائج" - }, - - "no-booked-appointment": { - "en": "No booked appointments", - "ar": "لا يوجد مواعيد محجوزة" - }, - "no-confirmed-appointment": { - "en": "No confirmed appointments", - "ar": "لا توجد مواعيد مؤكدة" - }, - "no-arrived-appointment": { - "en": "No arrived appointments", - "ar": "لا يوجد مواعيد" - }, - "upcoming-empty": { - "en": "You do not have any Todo actions yet.", - "ar": "ليس لديك أي إجراءات الآن." - }, - "upcoming-timeLeft": { - "en": "time left for appointment", - "ar": "الوقت المتبقي للموعد" - }, - "covid-test-all-services": { - "en": "Covid-19 Drive-Thru Test", - "ar": "فحص كورونا من داخل السيارة" - }, - "pharmacy": { - "en": "Pharmacy", - "ar": "الصيدلية" - }, - "ereferral": { - "en": "E-Referral", - "ar": "طلب التحويل" - }, - "child-vaccine": { - "en": "Child Vaccines", - "ar": "تطعيمات الأطفال" - }, - "calculators": { - "en": "Health Calculators", - "ar": "الحاسبات الصحية" - }, - "converters": { - "en": "Health Converter", - "ar": "تحويل القياسات" - }, - "h2o": { - "en": "Water Tracker", - "ar": "حساب كمية الماء" - }, - "v-tour": { - "en": "Virtual Tour", - "ar": "جولة إفتراضية" - }, - "hmg-news": { - "en": "HMG News", - "ar": "أخبار المجموعة" - }, - "blood-d": { - "en": "Blood Donation", - "ar": "تبرع بالدم" - }, - "symptomCheckerTitle": { - "en": "Symptom Checker", - "ar": "مدقق الأعراض" - }, - "latest-news": { - "en": "Latest News", - "ar": "أحدث الأخبار" - }, - "our-location": { - "en": "Our Locations", - "ar": "موقعنا" - }, - "pharmacies": { - "en": "Pharmacies", - "ar": "الصيدليات" - }, - "hospitals": { - "en": "Hospitals", - "ar": "المستشفيات" - }, - "wallet": { - "en": "Wallet", - "ar": "محفظة نقود" - }, - "hmg": { - "en": "Al Habib", - "ar": "الحبيب" - }, - - "requested": { - "en": "Requested", - "ar": "مطلوب" - }, - "ready": { - "en": "Ready", - "ar": "جاهز" - }, - "completed": { - "en": "Completed", - "ar": "مكتمل" - }, - "cancelled": { - "en": "Cancelled", - "ar": "ملغى" - }, - - "request-medical-report": { - "en": "Request medical report", - "ar": "طلب تقرير طبي" - }, - - "vaccination": { - "en": "Vaccination", - "ar": "جدول التطعيمات" - }, - "welcomeBack": { - "en": "Welcome back", - "ar": "مرحبا مرة أخرى" - }, - "instructions": { - "en": "Please ensure that the email address is up-to-date and process to view the schedule", - "ar": "يرجى التأكد من صحة عنوان البريد الالكتروني و المتابعة لعرض الجدول " - }, - "update-email": { - "en": "Update Email", - "ar": "تحديث البريد الالكتروني" - }, - - "updated-email": { - "en": "Updated email successfully", - "ar": "تم تحديث البريد الالكتروني" - }, - - "view-list-children": { - "en": "View List of Children", - "ar": "عرض قائمة الأطفال" - }, - - "add-child": { - "en": "Add New Child", - "ar": "اضافة طفل" - }, - "child-name": { - "en": "Child Name", - "ar": "اسم الطفل" - }, - "childDob": { - "en": "Birth Date", - "ar": "تاريخ الولادة" - }, - "delete": { - "en": "Delete", - "ar": "حذف" - }, - "deleted-child-mes": { - "en": "The request was successful. The children have removed from the vaccination schedule subscription service.", - "ar": "تم حذف الطفل بنجاح" - }, - "deleted-child":{ - "en":"Delete child", - "ar":"إالغاء الطفل" - }, - "visit": { - "en": "Visit", - "ar": "زيارة" - }, - "description-vaccination": { - "en": "Description", - "ar": "وصف" - }, - "due-date": { - "en": "Due date", - "ar": "تاريخ الاستحقاق" - }, - "valid-email": { - "en": "Please enter valid email", - "ar": "الرجاء إدخال عنوان بريد صحيح" - }, - "confirm-send": { - "en": "Send the child's schedule to the email?", - "ar": "ارسال جدول التطعيمات الى بريدك الالكتروني؟" - }, - "email-success": { - "en": " The request was successful. You will receive the Schedule in moments.", - "ar": "تم ارسال جدول التطعيمات " - }, - "add-instructions": { - "en": "Add the child's information below to recieve the schedule of vaccinations.", - "ar": "أضف معلومات الطفل لاستلام جدول التطعيمات" - }, - "added-child": { - "en": "The request was successful. You have added a child to the vaccination schedule subscription service.", - "ar": "تمت الاضافة بنجاح." - }, - "appUpdate": { - "en": "UPDATE THE APP", - "ar": "تحديث التطبيق" - }, - "ereferralSaveSuccess": { - "en": "The referral request has been submitted successfully, you will be contacted ASAP to complete the process. Referral request no is ", - "ar": " تم إرسال طلب الإحالة بنجاح ، وسيتم الاتصال بك في أسرع وقت ممكن لإكمال العملية. رقم طلب الإحالة" - }, - "referralStatus": { - "en": "Referral Status", - "ar": "حالة الإحالة" - }, - "referralDate": { - "en": "Referral Date", - "ar": "تاريخ الإحالة" - }, - "patientName": { - "en": "Patient Name", - "ar": "اسم المريض" - }, - "referralNumber": { - "en": "Referral Number", - "ar": "رقم الإحالة" - }, - "requestID": { - "en": "Request ID", - "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": "عزيز العميل لا يوجد اتصال بالإنترنت, هل تريد الاتصال بشبكة مستشفى د. سليمان الحبيب لاستخدام التطبيق. يجب عليك ان تكون في نطاق شبكة المستشفى" }, - "OrderStatus": { - "en": "Status", - "ar": "الحاله" - },"pickupDate": {"en": "Pickup Date", "ar": "التاريخ"}, - "serviceName": {"en": "Service Name", "ar": " اسم الخدمة"}, - "orderLocation": {"en": "Location", "ar": "الموقع"}, - "selectService": {"en": "Select Service", "ar": "حدد الخدمة"}, - "coveredService": {"en": "Covered Service : ", "ar": " الخدمات المغطاة : "}, - "selectAddress": {"en": "Select Address", "ar": "حدد العنوان"}, - "addNewAddress": {"en": "Add New Address", "ar": "أضف عنوان جديد"}, - "selectedService": {"en": "Selected Service : ", "ar": " الخدمات المختارة : "}, - "cancelOrderMsg": {"en": "Are you sure!! want to cancel this order", "ar": "هل أنت واثق!! تريد إلغاء هذا الطلب"}, - "processDoneSuccessfully": {"en": "Process Done Successfully", "ar": "تمت العملية بنجاح"}, - "selectHomeHealthCareServices": {"en": "Select Home Health Care Services", "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"}, + "offerAndPackages": {"en": "Offers And Packages", "ar": "العروض والباقات"}, }; diff --git a/lib/config/shared_pref_kay.dart b/lib/config/shared_pref_kay.dart index e5c5c965..30d866de 100644 --- a/lib/config/shared_pref_kay.dart +++ b/lib/config/shared_pref_kay.dart @@ -19,5 +19,5 @@ const IS_LIVECARE_APPOINTMENT = 'is_livecare_appointment'; const IS_VIBRATION = 'is_vibration'; const THEME_VALUE = 'is_vibration'; const MAIN_USER = 'main-user'; -const WEATHER = 'weather'; const PHARMACY_LAST_VISITED_PRODUCTS = 'last-visited'; +const HMG_GEOFENCES = 'hmg-geo-fences'; diff --git a/lib/core/model/AlHabibMedicalService/EReferral/get_all_projects_response_model.dart b/lib/core/model/AlHabibMedicalService/EReferral/get_all_projects_response_model.dart deleted file mode 100644 index 438f1630..00000000 --- a/lib/core/model/AlHabibMedicalService/EReferral/get_all_projects_response_model.dart +++ /dev/null @@ -1,76 +0,0 @@ -class GetAllProjectsResponseModel { - String desciption; - Null desciptionN; - int iD; - String legalName; - String legalNameN; - String name; - Null nameN; - String phoneNumber; - String setupID; - int distanceInKilometers; - bool isActive; - String latitude; - String longitude; - int mainProjectID; - Null projectOutSA; - bool usingInDoctorApp; - - GetAllProjectsResponseModel( - {this.desciption, - this.desciptionN, - this.iD, - this.legalName, - this.legalNameN, - this.name, - this.nameN, - this.phoneNumber, - this.setupID, - this.distanceInKilometers, - this.isActive, - this.latitude, - this.longitude, - this.mainProjectID, - this.projectOutSA, - this.usingInDoctorApp}); - - GetAllProjectsResponseModel.fromJson(Map json) { - desciption = json['Desciption']; - desciptionN = json['DesciptionN']; - iD = json['ID']; - legalName = json['LegalName']; - legalNameN = json['LegalNameN']; - name = json['Name']; - nameN = json['NameN']; - phoneNumber = json['PhoneNumber']; - setupID = json['SetupID']; - distanceInKilometers = json['DistanceInKilometers']; - isActive = json['IsActive']; - latitude = json['Latitude']; - longitude = json['Longitude']; - mainProjectID = json['MainProjectID']; - projectOutSA = json['ProjectOutSA']; - usingInDoctorApp = json['UsingInDoctorApp']; - } - - Map toJson() { - final Map data = new Map(); - data['Desciption'] = this.desciption; - data['DesciptionN'] = this.desciptionN; - data['ID'] = this.iD; - data['LegalName'] = this.legalName; - data['LegalNameN'] = this.legalNameN; - data['Name'] = this.name; - data['NameN'] = this.nameN; - data['PhoneNumber'] = this.phoneNumber; - data['SetupID'] = this.setupID; - data['DistanceInKilometers'] = this.distanceInKilometers; - data['IsActive'] = this.isActive; - data['Latitude'] = this.latitude; - data['Longitude'] = this.longitude; - data['MainProjectID'] = this.mainProjectID; - data['ProjectOutSA'] = this.projectOutSA; - data['UsingInDoctorApp'] = this.usingInDoctorApp; - return data; - } -} diff --git a/lib/core/model/AlHabibMedicalService/EReferral/get_ereferral_response_model.dart b/lib/core/model/AlHabibMedicalService/EReferral/get_ereferral_response_model.dart deleted file mode 100644 index e873261d..00000000 --- a/lib/core/model/AlHabibMedicalService/EReferral/get_ereferral_response_model.dart +++ /dev/null @@ -1,128 +0,0 @@ -class GetEReferralResponseModel { - dynamic acceptedBrachCode; - dynamic acceptedBranchName; - dynamic acceptedBranchNameAr; - Channel channel; - dynamic identityCardAttachment; - String identityNumber; - dynamic insuranceCardAttachment; - bool isInsuredPatient; - String otherRelationship; - String patientContactNo; - int patientId; - String patientName; - int preferredBranchCode; - String preferredBranchName; - String referralDate; - int referralNumber; - Channel relationshipType; - String requesterContactNo; - String requesterName; - String status; - String statusAr; - - GetEReferralResponseModel( - {this.acceptedBrachCode, - this.acceptedBranchName, - this.acceptedBranchNameAr, - this.channel, - this.identityCardAttachment, - this.identityNumber, - this.insuranceCardAttachment, - this.isInsuredPatient, - this.otherRelationship, - this.patientContactNo, - this.patientId, - this.patientName, - this.preferredBranchCode, - this.preferredBranchName, - this.referralDate, - this.referralNumber, - this.relationshipType, - this.requesterContactNo, - this.requesterName, - this.status, - this.statusAr}); - - GetEReferralResponseModel.fromJson(Map json) { - acceptedBrachCode = json['AcceptedBrachCode']; - acceptedBranchName = json['AcceptedBranchName']; - acceptedBranchNameAr = json['AcceptedBranchNameAr']; - channel = - json['Channel'] != null ? new Channel.fromJson(json['Channel']) : null; - identityCardAttachment = json['IdentityCardAttachment']; - identityNumber = json['IdentityNumber']; - insuranceCardAttachment = json['InsuranceCardAttachment']; - isInsuredPatient = json['IsInsuredPatient']; - otherRelationship = json['OtherRelationship']; - patientContactNo = json['PatientContactNo']; - patientId = json['PatientId']; - patientName = json['PatientName']; - preferredBranchCode = json['PreferredBranchCode']; - preferredBranchName = json['PreferredBranchName']; - referralDate = json['ReferralDate']; - referralNumber = json['ReferralNumber']; - relationshipType = json['RelationshipType'] != null - ? new Channel.fromJson(json['RelationshipType']) - : null; - requesterContactNo = json['RequesterContactNo']; - requesterName = json['RequesterName']; - status = json['Status']; - statusAr = json['StatusAr']; - } - - Map toJson() { - final Map data = new Map(); - data['AcceptedBrachCode'] = this.acceptedBrachCode; - data['AcceptedBranchName'] = this.acceptedBranchName; - data['AcceptedBranchNameAr'] = this.acceptedBranchNameAr; - if (this.channel != null) { - data['Channel'] = this.channel.toJson(); - } - data['IdentityCardAttachment'] = this.identityCardAttachment; - data['IdentityNumber'] = this.identityNumber; - data['InsuranceCardAttachment'] = this.insuranceCardAttachment; - data['IsInsuredPatient'] = this.isInsuredPatient; - data['OtherRelationship'] = this.otherRelationship; - data['PatientContactNo'] = this.patientContactNo; - data['PatientId'] = this.patientId; - data['PatientName'] = this.patientName; - data['PreferredBranchCode'] = this.preferredBranchCode; - data['PreferredBranchName'] = this.preferredBranchName; - data['ReferralDate'] = this.referralDate; - data['ReferralNumber'] = this.referralNumber; - if (this.relationshipType != null) { - data['RelationshipType'] = this.relationshipType.toJson(); - } - data['RequesterContactNo'] = this.requesterContactNo; - data['RequesterName'] = this.requesterName; - data['Status'] = this.status; - data['StatusAr'] = this.statusAr; - return data; - } -} - -class Channel { - int iD; - String text; - String textAr; - String textEn; - - Channel({this.iD, this.text, this.textAr, this.textEn}); - - Channel.fromJson(Map json) { - iD = json['ID']; - text = json['Text']; - textAr = json['Text_Ar']; - textEn = json['Text_En']; - } - - Map toJson() { - final Map data = new Map(); - data['ID'] = this.iD; - data['Text'] = this.text; - data['Text_Ar'] = this.textAr; - data['Text_En'] = this.textEn; - return data; - } -} diff --git a/lib/core/model/ImagesInfo.dart b/lib/core/model/ImagesInfo.dart deleted file mode 100644 index 5ab48fb3..00000000 --- a/lib/core/model/ImagesInfo.dart +++ /dev/null @@ -1,6 +0,0 @@ -class ImagesInfo { - final String imageAr; - final String imageEn; - - ImagesInfo({this.imageAr, this.imageEn}); -} diff --git a/lib/core/model/geofencing/requests/GeoZonesRequestModel.dart b/lib/core/model/geofencing/requests/GeoZonesRequestModel.dart new file mode 100644 index 00000000..219c46ae --- /dev/null +++ b/lib/core/model/geofencing/requests/GeoZonesRequestModel.dart @@ -0,0 +1,11 @@ +class GeoZonesRequestModel { + final String PatientID; + + GeoZonesRequestModel({this.PatientID}); + + Map toFlatMap() { + if (PatientID == null) return {}; + + return {"PatientID": PatientID.toString()}; + } +} diff --git a/lib/core/model/geofencing/requests/LogGeoZoneRequestModel.dart b/lib/core/model/geofencing/requests/LogGeoZoneRequestModel.dart new file mode 100644 index 00000000..e21a7d69 --- /dev/null +++ b/lib/core/model/geofencing/requests/LogGeoZoneRequestModel.dart @@ -0,0 +1,12 @@ +import 'package:flutter/cupertino.dart'; + +class LogGeoZoneRequestModel { + final int PointsID; + final int GeoType; + + LogGeoZoneRequestModel({@required this.PointsID, @required this.GeoType}); + + Map toFlatMap() { + return {"PointsID": PointsID.toString(), "GeoType": GeoType.toString()}; + } +} diff --git a/lib/core/model/geofencing/responses/GeoZonesResponseModel.dart b/lib/core/model/geofencing/responses/GeoZonesResponseModel.dart new file mode 100644 index 00000000..58771fab --- /dev/null +++ b/lib/core/model/geofencing/responses/GeoZonesResponseModel.dart @@ -0,0 +1,62 @@ +import 'package:diplomaticquarterapp/generated/json/base/json_convert_content.dart'; +import 'package:diplomaticquarterapp/generated/json/base/json_field.dart'; + +class GeoZonesResponseModel with JsonConvert { + @JSONField(name: "GEOF_ID") + int geofId; + @JSONField(name: "Description") + String description; + @JSONField(name: "DescriptionN") + String descriptionN; + @JSONField(name: "Latitude") + String latitude; + @JSONField(name: "Longitude") + String longitude; + @JSONField(name: "Radius") + int radius; + @JSONField(name: "Type") + int type; + @JSONField(name: "ProjectID") + int projectID; + @JSONField(name: "ImageURL") + String imageURL; + @JSONField(name: "IsCity") + bool isCity; + + // Outside Server Response + bool isRegistered = false; + bool onEntry = true; + bool onExit = true; + + String geofenceId() { + return "$geofId\_${description.replaceAll(" ", "")}"; + } + + static get(String coordinates, int radius, String name) { + coordinates = coordinates.replaceAll(" ", ""); + var geo = GeoZonesResponseModel(); + geo.latitude = coordinates.split(",").first; + geo.longitude = coordinates.split(",").last; + geo.radius = radius; + geo.description = name; + return geo; + } + + static GeoZonesResponseModel zkH() { + var geo = GeoZonesResponseModel(); + geo.latitude = "24.691136"; + geo.longitude = "46.650116"; + geo.radius = 150; + geo.description = "zkH"; + return geo; + } + + static GeoZonesResponseModel csO() { + var geo = GeoZonesResponseModel(); + geo.latitude = "24.7087913"; + geo.longitude = "46.6656461"; + geo.radius = 150; + geo.description = "csO"; + return geo; + } +} diff --git a/lib/core/model/geofencing/responses/LogGeoZoneResponseModel.dart b/lib/core/model/geofencing/responses/LogGeoZoneResponseModel.dart new file mode 100644 index 00000000..2242755f --- /dev/null +++ b/lib/core/model/geofencing/responses/LogGeoZoneResponseModel.dart @@ -0,0 +1,26 @@ +import 'package:diplomaticquarterapp/generated/json/base/json_convert_content.dart'; +import 'package:diplomaticquarterapp/generated/json/base/json_field.dart'; + +class LogGeoZoneResponseModel with JsonConvert { + @JSONField(name: "LanguageID") + int languageID; + @JSONField(name: "ErrorCode") + dynamic errorCode; + @JSONField(name: "ErrorEndUserMessage") + String errorEndUserMessage; + @JSONField(name: "ErrorEndUserMessageN") + dynamic errorEndUserMessageN; + @JSONField(name: "ErrorMessage") + dynamic errorMessage; + @JSONField(name: "ErrorType") + int errorType; + @JSONField(name: "IsAuthenticated") + bool isAuthenticated; + @JSONField(name: "SuccessMsg") + dynamic successMsg; + @JSONField(name: "SuccessMsgN") + dynamic successMsgN; + int statusCode; + @JSONField(name: "MessageStatus") + int messageStatus; +} diff --git a/lib/core/model/packages_offers/requests/OffersCategoriesRequestModel.dart b/lib/core/model/packages_offers/requests/OffersCategoriesRequestModel.dart new file mode 100644 index 00000000..f2f4af11 --- /dev/null +++ b/lib/core/model/packages_offers/requests/OffersCategoriesRequestModel.dart @@ -0,0 +1,11 @@ +class OffersCategoriesRequestModel { + final int limit; + final int page; + final int sinceId; + + OffersCategoriesRequestModel({this.limit, this.page, this.sinceId}); + + Map toFlatMap() { + return {"limit": limit.toString(), "page": page.toString(), "sinceId": sinceId.toString()}; + } +} diff --git a/lib/core/model/packages_offers/requests/OffersProductsRequestModel.dart b/lib/core/model/packages_offers/requests/OffersProductsRequestModel.dart new file mode 100644 index 00000000..84862568 --- /dev/null +++ b/lib/core/model/packages_offers/requests/OffersProductsRequestModel.dart @@ -0,0 +1,12 @@ +class OffersProductsRequestModel { + final int categoryId; + final int limit; + final int page; + final int sinceId; + + OffersProductsRequestModel({this.categoryId, this.limit, this.page, this.sinceId}); + + Map toFlatMap() { + return {"limit": limit.toString(), "page": page.toString(), "sinceId": sinceId.toString(), "categoryId": categoryId.toString()}; + } +} diff --git a/lib/core/model/packages_offers/responses/OfferCategoriesResponseModel.dart b/lib/core/model/packages_offers/responses/OfferCategoriesResponseModel.dart new file mode 100644 index 00000000..087f1961 --- /dev/null +++ b/lib/core/model/packages_offers/responses/OfferCategoriesResponseModel.dart @@ -0,0 +1,65 @@ +import 'package:diplomaticquarterapp/generated/json/base/json_convert_content.dart'; +import 'package:diplomaticquarterapp/generated/json/base/json_field.dart'; + +class OfferCategoriesResponseModel with JsonConvert { + String id; + String name; + String namen; + @JSONField(name: "localized_names") + List localizedNames; + dynamic description; + @JSONField(name: "category_template_id") + int categoryTemplateId; + @JSONField(name: "meta_keywords") + String metaKeywords; + @JSONField(name: "meta_description") + String metaDescription; + @JSONField(name: "meta_title") + String metaTitle; + @JSONField(name: "parent_category_id") + int parentCategoryId; + @JSONField(name: "page_size") + int pageSize; + @JSONField(name: "page_size_options") + String pageSizeOptions; + @JSONField(name: "price_ranges") + dynamic priceRanges; + @JSONField(name: "show_on_home_page") + bool showOnHomePage; + @JSONField(name: "include_in_top_menu") + bool includeInTopMenu; + @JSONField(name: "has_discounts_applied") + dynamic hasDiscountsApplied; + bool published; + bool deleted; + @JSONField(name: "display_order") + int displayOrder; + @JSONField(name: "created_on_utc") + String createdOnUtc; + @JSONField(name: "updated_on_utc") + String updatedOnUtc; + @JSONField(name: "role_ids") + List roleIds; + @JSONField(name: "discount_ids") + List discountIds; + @JSONField(name: "store_ids") + List storeIds; + OfferCategoriesResponseModelImage image; + @JSONField(name: "se_name") + String seName; + @JSONField(name: "is_leaf") + bool isLeaf; +} + +class OfferCategoriesResponseModelLocalizedName with JsonConvert { + @JSONField(name: "language_id") + int languageId; + @JSONField(name: "localized_name") + String localizedName; +} + +class OfferCategoriesResponseModelImage with JsonConvert { + String src; + dynamic thumb; + dynamic attachment; +} diff --git a/lib/core/model/packages_offers/responses/OfferProductsResponseModel.dart b/lib/core/model/packages_offers/responses/OfferProductsResponseModel.dart new file mode 100644 index 00000000..58481a8b --- /dev/null +++ b/lib/core/model/packages_offers/responses/OfferProductsResponseModel.dart @@ -0,0 +1,235 @@ +import 'package:diplomaticquarterapp/generated/json/base/json_convert_content.dart'; +import 'package:diplomaticquarterapp/generated/json/base/json_field.dart'; + +class OfferProductsResponseModel with JsonConvert { + String id; + @JSONField(name: "visible_individually") + bool visibleIndividually; + String name; + String namen; + @JSONField(name: "localized_names") + List localizedNames; + @JSONField(name: "short_description") + String shortDescription; + @JSONField(name: "short_descriptionn") + String shortDescriptionn; + @JSONField(name: "full_description") + String fullDescription; + @JSONField(name: "full_descriptionn") + String fullDescriptionn; + @JSONField(name: "markas_new") + bool markasNew; + @JSONField(name: "show_on_home_page") + bool showOnHomePage; + @JSONField(name: "meta_keywords") + dynamic metaKeywords; + @JSONField(name: "meta_description") + dynamic metaDescription; + @JSONField(name: "meta_title") + dynamic metaTitle; + @JSONField(name: "allow_customer_reviews") + bool allowCustomerReviews; + @JSONField(name: "approved_rating_sum") + int approvedRatingSum; + @JSONField(name: "not_approved_rating_sum") + int notApprovedRatingSum; + @JSONField(name: "approved_total_reviews") + int approvedTotalReviews; + @JSONField(name: "not_approved_total_reviews") + int notApprovedTotalReviews; + String sku; + @JSONField(name: "is_rx") + bool isRx; + @JSONField(name: "prescription_required") + bool prescriptionRequired; + @JSONField(name: "rx_message") + dynamic rxMessage; + @JSONField(name: "rx_messagen") + dynamic rxMessagen; + @JSONField(name: "manufacturer_part_number") + dynamic manufacturerPartNumber; + dynamic gtin; + @JSONField(name: "is_gift_card") + bool isGiftCard; + @JSONField(name: "require_other_products") + bool requireOtherProducts; + @JSONField(name: "automatically_add_required_products") + bool automaticallyAddRequiredProducts; + @JSONField(name: "is_download") + bool isDownload; + @JSONField(name: "unlimited_downloads") + bool unlimitedDownloads; + @JSONField(name: "max_number_of_downloads") + int maxNumberOfDownloads; + @JSONField(name: "download_expiration_days") + dynamic downloadExpirationDays; + @JSONField(name: "has_sample_download") + bool hasSampleDownload; + @JSONField(name: "has_user_agreement") + bool hasUserAgreement; + @JSONField(name: "is_recurring") + bool isRecurring; + @JSONField(name: "recurring_cycle_length") + int recurringCycleLength; + @JSONField(name: "recurring_total_cycles") + int recurringTotalCycles; + @JSONField(name: "is_rental") + bool isRental; + @JSONField(name: "rental_price_length") + int rentalPriceLength; + @JSONField(name: "is_ship_enabled") + bool isShipEnabled; + @JSONField(name: "is_free_shipping") + bool isFreeShipping; + @JSONField(name: "ship_separately") + bool shipSeparately; + @JSONField(name: "additional_shipping_charge") + double additionalShippingCharge; + @JSONField(name: "is_tax_exempt") + bool isTaxExempt; + @JSONField(name: "is_telecommunications_or_broadcasting_or_electronic_services") + bool isTelecommunicationsOrBroadcastingOrElectronicServices; + @JSONField(name: "use_multiple_warehouses") + bool useMultipleWarehouses; + @JSONField(name: "manage_inventory_method_id") + int manageInventoryMethodId; + @JSONField(name: "stock_quantity") + int stockQuantity; + @JSONField(name: "stock_availability") + String stockAvailability; + @JSONField(name: "stock_availabilityn") + String stockAvailabilityn; + @JSONField(name: "display_stock_availability") + bool displayStockAvailability; + @JSONField(name: "display_stock_quantity") + bool displayStockQuantity; + @JSONField(name: "min_stock_quantity") + int minStockQuantity; + @JSONField(name: "notify_admin_for_quantity_below") + int notifyAdminForQuantityBelow; + @JSONField(name: "allow_back_in_stock_subscriptions") + bool allowBackInStockSubscriptions; + @JSONField(name: "order_minimum_quantity") + int orderMinimumQuantity; + @JSONField(name: "order_maximum_quantity") + int orderMaximumQuantity; + @JSONField(name: "allowed_quantities") + dynamic allowedQuantities; + @JSONField(name: "allow_adding_only_existing_attribute_combinations") + bool allowAddingOnlyExistingAttributeCombinations; + @JSONField(name: "disable_buy_button") + bool disableBuyButton; + @JSONField(name: "disable_wishlist_button") + bool disableWishlistButton; + @JSONField(name: "available_for_pre_order") + bool availableForPreOrder; + @JSONField(name: "pre_order_availability_start_date_time_utc") + dynamic preOrderAvailabilityStartDateTimeUtc; + @JSONField(name: "call_for_price") + bool callForPrice; + double price; + @JSONField(name: "old_price") + double oldPrice; + @JSONField(name: "product_cost") + double productCost; + @JSONField(name: "special_price") + dynamic specialPrice; + @JSONField(name: "special_price_start_date_time_utc") + dynamic specialPriceStartDateTimeUtc; + @JSONField(name: "special_price_end_date_time_utc") + dynamic specialPriceEndDateTimeUtc; + @JSONField(name: "customer_enters_price") + bool customerEntersPrice; + @JSONField(name: "minimum_customer_entered_price") + double minimumCustomerEnteredPrice; + @JSONField(name: "maximum_customer_entered_price") + double maximumCustomerEnteredPrice; + @JSONField(name: "baseprice_enabled") + bool basepriceEnabled; + @JSONField(name: "baseprice_amount") + double basepriceAmount; + @JSONField(name: "baseprice_base_amount") + double basepriceBaseAmount; + @JSONField(name: "has_tier_prices") + bool hasTierPrices; + @JSONField(name: "has_discounts_applied") + bool hasDiscountsApplied; + @JSONField(name: "discount_name") + dynamic discountName; + @JSONField(name: "discount_namen") + dynamic discountNamen; + @JSONField(name: "discount_description") + dynamic discountDescription; + @JSONField(name: "discount_Descriptionn") + dynamic discountDescriptionn; + @JSONField(name: "discount_percentage") + dynamic discountPercentage; + String currency; + String currencyn; + double weight; + double length; + double width; + double height; + @JSONField(name: "available_start_date_time_utc") + dynamic availableStartDateTimeUtc; + @JSONField(name: "available_end_date_time_utc") + dynamic availableEndDateTimeUtc; + @JSONField(name: "display_order") + int displayOrder; + bool published; + bool deleted; + @JSONField(name: "created_on_utc") + String createdOnUtc; + @JSONField(name: "updated_on_utc") + String updatedOnUtc; + @JSONField(name: "product_type") + String productType; + @JSONField(name: "parent_grouped_product_id") + int parentGroupedProductId; + @JSONField(name: "role_ids") + List roleIds; + @JSONField(name: "discount_ids") + List discountIds; + @JSONField(name: "store_ids") + List storeIds; + @JSONField(name: "manufacturer_ids") + List manufacturerIds; + List reviews; + List images; + List attributes; + List specifications; + @JSONField(name: "associated_product_ids") + List associatedProductIds; + List tags; + @JSONField(name: "vendor_id") + int vendorId; + @JSONField(name: "se_name") + String seName; +} + +class OfferProductsResponseModelLocalizedName with JsonConvert { + @JSONField(name: "language_id") + int languageId; + @JSONField(name: "localized_name") + String localizedName; +} + +class OfferProductsResponseModelImage with JsonConvert { + int id; + int position; + String src; + String thumb; + String attachment; +} + +class OfferProductsResponseModelSpecification with JsonConvert { + int id; + @JSONField(name: "display_order") + int displayOrder; + @JSONField(name: "default_value") + String defaultValue; + @JSONField(name: "default_valuen") + String defaultValuen; + String name; + String nameN; +} diff --git a/lib/core/model/pharmacies/pharmacies_list_model.dart b/lib/core/model/pharmacies/pharmacies_list_model.dart index a10389b5..01a43a0a 100644 --- a/lib/core/model/pharmacies/pharmacies_list_model.dart +++ b/lib/core/model/pharmacies/pharmacies_list_model.dart @@ -4,7 +4,7 @@ class PharmaciesListModel { int languageID; String stamp; String iPAdress; - dynamic versionID; + double versionID; String tokenID; String sessionID; bool isLoginForDoctorApp; @@ -14,7 +14,7 @@ class PharmaciesListModel { int editedBy; int projectID; int clinicID; - dynamic price; + double price; String imageLocation; String desLocation; String itemDes; diff --git a/lib/core/model/prescriptions/request_prescription_report.dart b/lib/core/model/prescriptions/request_prescription_report.dart index df901a99..c8323740 100644 --- a/lib/core/model/prescriptions/request_prescription_report.dart +++ b/lib/core/model/prescriptions/request_prescription_report.dart @@ -82,7 +82,7 @@ class RequestPrescriptionReport { data['EpisodeID'] = this.episodeID; data['ClinicID'] = this.clinicID; data['ProjectID'] = this.projectID; - // data['DischargeNo'] = this.dischargeNo; + data['DischargeNo'] = this.dischargeNo; return data; } } diff --git a/lib/core/model/privilege/PrivilegeModel.dart b/lib/core/model/privilege/PrivilegeModel.dart deleted file mode 100644 index 3b629fde..00000000 --- a/lib/core/model/privilege/PrivilegeModel.dart +++ /dev/null @@ -1,24 +0,0 @@ -class PrivilegeModel { - int iD; - String serviceName; - bool privilege; - dynamic region; - - PrivilegeModel({this.iD, this.serviceName, this.privilege, this.region}); - - PrivilegeModel.fromJson(Map json) { - iD = json['ID']; - serviceName = json['ServiceName']; - privilege = json['Previlege']; - region = json['Region']; - } - - Map toJson() { - final Map data = new Map(); - data['ID'] = this.iD; - data['ServiceName'] = this.serviceName; - data['Previlege'] = this.privilege; - data['Region'] = this.region; - return data; - } -} diff --git a/lib/core/model/weahter/weather_model.dart b/lib/core/model/weahter/weather_model.dart deleted file mode 100644 index 7ee84bac..00000000 --- a/lib/core/model/weahter/weather_model.dart +++ /dev/null @@ -1,266 +0,0 @@ -class WeatherIndicatorModel { - Null date; - int languageID; - int serviceName; - Null time; - Null androidLink; - Null authenticationTokenID; - Null data; - bool dataw; - int dietType; - Null errorCode; - Null errorEndUserMessage; - Null errorEndUserMessageN; - Null errorMessage; - int errorType; - int foodCategory; - Null iOSLink; - bool isAuthenticated; - int mealOrderStatus; - int mealType; - int messageStatus; - int numberOfResultRecords; - Null patientBlodType; - Null successMsg; - Null successMsgN; - Null citiesList; - Null cityName; - Null get5DaysWeatherForecastList; - List getCityInfoList; - Null getTodayWeatherForecastList; - Null iniciesList; - - WeatherIndicatorModel( - {this.date, - this.languageID, - this.serviceName, - this.time, - this.androidLink, - this.authenticationTokenID, - this.data, - this.dataw, - this.dietType, - this.errorCode, - this.errorEndUserMessage, - this.errorEndUserMessageN, - this.errorMessage, - this.errorType, - this.foodCategory, - this.iOSLink, - this.isAuthenticated, - this.mealOrderStatus, - this.mealType, - this.messageStatus, - this.numberOfResultRecords, - this.patientBlodType, - this.successMsg, - this.successMsgN, - this.citiesList, - this.cityName, - this.get5DaysWeatherForecastList, - this.getCityInfoList, - this.getTodayWeatherForecastList, - this.iniciesList}); - - WeatherIndicatorModel.fromJson(Map json) { - date = json['Date']; - languageID = json['LanguageID']; - serviceName = json['ServiceName']; - time = json['Time']; - androidLink = json['AndroidLink']; - authenticationTokenID = json['AuthenticationTokenID']; - data = json['Data']; - dataw = json['Dataw']; - dietType = json['DietType']; - errorCode = json['ErrorCode']; - errorEndUserMessage = json['ErrorEndUserMessage']; - errorEndUserMessageN = json['ErrorEndUserMessageN']; - errorMessage = json['ErrorMessage']; - errorType = json['ErrorType']; - foodCategory = json['FoodCategory']; - iOSLink = json['IOSLink']; - isAuthenticated = json['IsAuthenticated']; - mealOrderStatus = json['MealOrderStatus']; - mealType = json['MealType']; - messageStatus = json['MessageStatus']; - numberOfResultRecords = json['NumberOfResultRecords']; - patientBlodType = json['PatientBlodType']; - successMsg = json['SuccessMsg']; - successMsgN = json['SuccessMsgN']; - citiesList = json['CitiesList']; - cityName = json['CityName']; - get5DaysWeatherForecastList = json['Get5DaysWeatherForecastList']; - if (json['GetCityInfo_List'] != null) { - getCityInfoList = new List(); - json['GetCityInfo_List'].forEach((v) { - getCityInfoList.add(new GetCityInfoList.fromJson(v)); - }); - } - getTodayWeatherForecastList = json['GetTodayWeatherForecastList']; - iniciesList = json['IniciesList']; - } - - Map toJson() { - final Map data = new Map(); - data['Date'] = this.date; - data['LanguageID'] = this.languageID; - data['ServiceName'] = this.serviceName; - data['Time'] = this.time; - data['AndroidLink'] = this.androidLink; - data['AuthenticationTokenID'] = this.authenticationTokenID; - data['Data'] = this.data; - data['Dataw'] = this.dataw; - data['DietType'] = this.dietType; - data['ErrorCode'] = this.errorCode; - data['ErrorEndUserMessage'] = this.errorEndUserMessage; - data['ErrorEndUserMessageN'] = this.errorEndUserMessageN; - data['ErrorMessage'] = this.errorMessage; - data['ErrorType'] = this.errorType; - data['FoodCategory'] = this.foodCategory; - data['IOSLink'] = this.iOSLink; - data['IsAuthenticated'] = this.isAuthenticated; - data['MealOrderStatus'] = this.mealOrderStatus; - data['MealType'] = this.mealType; - data['MessageStatus'] = this.messageStatus; - data['NumberOfResultRecords'] = this.numberOfResultRecords; - data['PatientBlodType'] = this.patientBlodType; - data['SuccessMsg'] = this.successMsg; - data['SuccessMsgN'] = this.successMsgN; - data['CitiesList'] = this.citiesList; - data['CityName'] = this.cityName; - data['Get5DaysWeatherForecastList'] = this.get5DaysWeatherForecastList; - if (this.getCityInfoList != null) { - data['GetCityInfo_List'] = - this.getCityInfoList.map((v) => v.toJson()).toList(); - } - data['GetTodayWeatherForecastList'] = this.getTodayWeatherForecastList; - data['IniciesList'] = this.iniciesList; - return data; - } -} - -class GetCityInfoList { - CategoriesNames categoriesNames; - String category; - String categoryValue; - int cityID; - String cityName; - String cityNameN; - String colorName; - String createdOn; - String iD; - int iniceID; - bool isOrderEmpty; - bool isValuesReversed; - bool language; - double latitude; - double longitude; - String name; - int orderNum; - double temperature; - String value; - - GetCityInfoList( - {this.categoriesNames, - this.category, - this.categoryValue, - this.cityID, - this.cityName, - this.cityNameN, - this.colorName, - this.createdOn, - this.iD, - this.iniceID, - this.isOrderEmpty, - this.isValuesReversed, - this.language, - this.latitude, - this.longitude, - this.name, - this.orderNum, - this.temperature, - this.value}); - - GetCityInfoList.fromJson(Map json) { - categoriesNames = json['CategoriesNames'] != null - ? new CategoriesNames.fromJson(json['CategoriesNames']) - : null; - category = json['Category']; - categoryValue = json['CategoryValue']; - cityID = json['CityID']; - cityName = json['CityName']; - cityNameN = json['CityNameN']; - colorName = json['ColorName']; - createdOn = json['CreatedOn']; - iD = json['ID']; - iniceID = json['IniceID']; - isOrderEmpty = json['IsOrderEmpty']; - isValuesReversed = json['IsValuesReversed']; - language = json['Language']; - latitude = json['Latitude']; - longitude = json['Longitude']; - name = json['Name']; - orderNum = json['OrderNum']; - temperature = json['Temperature']; - value = json['Value']; - } - - Map toJson() { - final Map data = new Map(); - if (this.categoriesNames != null) { - data['CategoriesNames'] = this.categoriesNames.toJson(); - } - data['Category'] = this.category; - data['CategoryValue'] = this.categoryValue; - data['CityID'] = this.cityID; - data['CityName'] = this.cityName; - data['CityNameN'] = this.cityNameN; - data['ColorName'] = this.colorName; - data['CreatedOn'] = this.createdOn; - data['ID'] = this.iD; - data['IniceID'] = this.iniceID; - data['IsOrderEmpty'] = this.isOrderEmpty; - data['IsValuesReversed'] = this.isValuesReversed; - data['Language'] = this.language; - data['Latitude'] = this.latitude; - data['Longitude'] = this.longitude; - data['Name'] = this.name; - data['OrderNum'] = this.orderNum; - data['Temperature'] = this.temperature; - data['Value'] = this.value; - return data; - } -} - -class CategoriesNames { - String category1; - String category2; - String category3; - String category4; - String category5; - - CategoriesNames( - {this.category1, - this.category2, - this.category3, - this.category4, - this.category5}); - - CategoriesNames.fromJson(Map json) { - category1 = json['Category1']; - category2 = json['Category2']; - category3 = json['Category3']; - category4 = json['Category4']; - category5 = json['Category5']; - } - - Map toJson() { - final Map data = new Map(); - data['Category1'] = this.category1; - data['Category2'] = this.category2; - data['Category3'] = this.category3; - data['Category4'] = this.category4; - data['Category5'] = this.category5; - return data; - } -} diff --git a/lib/core/service/AlHabibMedicalService/cmc_service.dart b/lib/core/service/AlHabibMedicalService/cmc_service.dart index 9e99f3ad..dffa6683 100644 --- a/lib/core/service/AlHabibMedicalService/cmc_service.dart +++ b/lib/core/service/AlHabibMedicalService/cmc_service.dart @@ -1,5 +1,4 @@ import 'package:diplomaticquarterapp/config/config.dart'; -import 'package:diplomaticquarterapp/core/enum/OrderService.dart'; import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_get_items_request_model.dart'; import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_get_items_response_model.dart'; import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_insert_pres_order_request_model.dart'; @@ -48,9 +47,8 @@ class CMCService extends BaseService { await baseAppClient.post(GET_PATIENT_ALL_PRES_ORDERS, onSuccess: (dynamic response, int statusCode) { cmcAllPresOrdersList.clear(); - cmcAllOrderDetail.clear(); response['PatientER_GetPatientAllPresOrdersList'].forEach((data) { - if (data['ServiceID'] == OrderService.Comprehensive_Medical_Checkup.getIdOrderService()) + if (data['ServiceID'] == 3) cmcAllPresOrdersList .add(GetHHCAllPresOrdersResponseModel.fromJson(data)); }); @@ -106,7 +104,7 @@ class CMCService extends BaseService { Future insertPresPresOrder({CMCInsertPresOrderRequestModel order}) async { hasError = false; - await baseAppClient.post(PATIENT_ER_INSERT_PRES_ORDER, + await baseAppClient.post(PATIENT_ER_UPDATE_PRES_ORDER, onSuccess: (dynamic response, int statusCode) { isOrderUpdated = true; }, onFailure: (String error, int statusCode) { diff --git a/lib/core/service/AlHabibMedicalService/customer_addresses_service.dart b/lib/core/service/AlHabibMedicalService/customer_addresses_service.dart deleted file mode 100644 index cb457735..00000000 --- a/lib/core/service/AlHabibMedicalService/customer_addresses_service.dart +++ /dev/null @@ -1,211 +0,0 @@ -import 'package:diplomaticquarterapp/config/config.dart'; -import 'package:diplomaticquarterapp/core/enum/OrderService.dart'; -import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/HHC_get_all_services_request_modle.dart'; -import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/HHC_get_all_services_response_model.dart'; -import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/get_hHC_all_pres_orders_request_model.dart'; -import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/get_hhc_all_pres_orders_response_model.dart'; -import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/get_order_detail_by_order_iD_request_model.dart'; -import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/get_order_detail_by_order_iD_response_model.dart'; -import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/patient_er_insert_pres_order_request_model.dart'; -import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/update_pres_oreder_request_model.dart'; -import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/add_new_address_Request_Model.dart'; -import 'package:intl/intl.dart'; - -import '../base_service.dart'; - -class CustomerAddressesService extends BaseService { - - List addressesList = List(); - CustomerInfo customerInfo; - - Future addAddressInfo({ AddNewAddressRequestModel - addNewAddressRequestModel }) async { - - addNewAddressRequestModel.customer.email = customerInfo.email; - addNewAddressRequestModel.customer.id = customerInfo.customerId; - addNewAddressRequestModel.customer.roleIds = [3]; - addNewAddressRequestModel.customer.addresses[0].email = customerInfo.email; - addNewAddressRequestModel.customer.addresses[0].phoneNumber = customerInfo.mobileNumber; - addNewAddressRequestModel.customer.addresses[0].firstName = user.firstName; - addNewAddressRequestModel.customer.addresses[0].lastName = user.lastName; - addNewAddressRequestModel.customer.addresses[0].countryId = 69; - - var f = DateFormat('E, d MMM yyyy HH:mm:ss'); - var date = f.format(DateTime.now().toUtc()) + " GMT"; - addNewAddressRequestModel.customer.addresses[0].createdOnUtc = date; - hasError = false; - await baseAppClient.post(ADD_ADDRESS_INFO, - onSuccess: (dynamic response, int statusCode) { - addressesList.clear(); - response["customers"][0]["addresses"].forEach((data) { - addressesList - .add(AddressInfo.fromJson(data)); - }); - }, onFailure: (String error, int statusCode) { - hasError = true; - super.error = error; - }, body: addNewAddressRequestModel.toJson(), isExternal: true, isAllowAny: true); - } - - Future getCustomerAddresses() async { - Map queryParams = { - 'fields':'addresses' - }; - hasError = false; - await baseAppClient.get("$GET_CUSTOMER_ADDRESSES${customerInfo.customerId}", - onSuccess: (dynamic response, int statusCode) { - addressesList.clear(); - response["customers"][0]["addresses"].forEach((data) { - addressesList - .add(AddressInfo.fromJson(data)); - }); - }, onFailure: (String error, int statusCode) { - hasError = true; - super.error = error; - }, queryParams: queryParams, isExternal: true); - } - - - Future getCustomerInfo() async { - Map queryParams = { - 'FileNumber':'${user.patientID}' - }; - - hasError = false; - await baseAppClient.get(GET_CUSTOMER_INFO, - onSuccess: (dynamic response, int statusCode) { - customerInfo= CustomerInfo.fromJson(response); - }, onFailure: (String error, int statusCode) { - hasError = true; - super.error = error; - }, queryParams: queryParams, isExternal: true); - } -} - - -class CustomerInfo { - bool isRegistered; - String userName; - Null password; - String email; - Null errorMessage; - String mobileNumber; - int customerId; - - CustomerInfo( - {this.isRegistered, - this.userName, - this.password, - this.email, - this.errorMessage, - this.mobileNumber, - this.customerId}); - - CustomerInfo.fromJson(Map json) { - isRegistered = json['IsRegistered']; - userName = json['UserName']; - password = json['Password']; - email = json['Email']; - errorMessage = json['ErrorMessage']; - mobileNumber = json['MobileNumber']; - customerId = json['CustomerId']; - } - - Map toJson() { - final Map data = new Map(); - data['IsRegistered'] = this.isRegistered; - data['UserName'] = this.userName; - data['Password'] = this.password; - data['Email'] = this.email; - data['ErrorMessage'] = this.errorMessage; - data['MobileNumber'] = this.mobileNumber; - data['CustomerId'] = this.customerId; - return data; - } -} - - -class AddressInfo { - String id; - String firstName; - String lastName; - String email; - Null company; - int countryId; - String country; - Null stateProvinceId; - String city; - String address1; - String address2; - String zipPostalCode; - String phoneNumber; - Null faxNumber; - String customerAttributes; - String createdOnUtc; - Null province; - String latLong; - - AddressInfo( - {this.id, - this.firstName, - this.lastName, - this.email, - this.company, - this.countryId, - this.country, - this.stateProvinceId, - this.city, - this.address1, - this.address2, - this.zipPostalCode, - this.phoneNumber, - this.faxNumber, - this.customerAttributes, - this.createdOnUtc, - this.province, - this.latLong}); - - AddressInfo.fromJson(Map json) { - id = json['id']; - firstName = json['first_name']; - lastName = json['last_name']; - email = json['email']; - company = json['company']; - countryId = json['country_id']; - country = json['country']; - stateProvinceId = json['state_province_id']; - city = json['city']; - address1 = json['address1']; - address2 = json['address2']; - zipPostalCode = json['zip_postal_code']; - phoneNumber = json['phone_number']; - faxNumber = json['fax_number']; - customerAttributes = json['customer_attributes']; - createdOnUtc = json['created_on_utc']; - province = json['province']; - latLong = json['lat_long']; - } - - Map toJson() { - final Map data = new Map(); - data['id'] = this.id; - data['first_name'] = this.firstName; - data['last_name'] = this.lastName; - data['email'] = this.email; - data['company'] = this.company; - data['country_id'] = this.countryId; - data['country'] = this.country; - data['state_province_id'] = this.stateProvinceId; - data['city'] = this.city; - data['address1'] = this.address1; - data['address2'] = this.address2; - data['zip_postal_code'] = this.zipPostalCode; - data['phone_number'] = this.phoneNumber; - data['fax_number'] = this.faxNumber; - data['customer_attributes'] = this.customerAttributes; - data['created_on_utc'] = this.createdOnUtc; - data['province'] = this.province; - data['lat_long'] = this.latLong; - return data; - } -} diff --git a/lib/core/service/AlHabibMedicalService/e_referral_service.dart b/lib/core/service/AlHabibMedicalService/e_referral_service.dart index 3670e965..6c356f5c 100644 --- a/lib/core/service/AlHabibMedicalService/e_referral_service.dart +++ b/lib/core/service/AlHabibMedicalService/e_referral_service.dart @@ -2,7 +2,6 @@ import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/EReferral/check_activation_code_for_e_referral_request_model.dart'; import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/EReferral/create_e_referral_request_model.dart'; import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/EReferral/get_all_cities_response_model.dart'; -import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/EReferral/get_all_projects_response_model.dart'; import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/EReferral/get_all_relationship_types_response_model.dart'; import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/EReferral/search_e_referral_request_model.dart'; import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/EReferral/search_e_referral_response_model.dart'; @@ -11,18 +10,11 @@ import 'package:diplomaticquarterapp/core/service/base_service.dart'; class EReferralService extends BaseService { List _relationTypes = List(); - List get relationTypes => _relationTypes; List _allCities = List(); - List get allCities => _allCities; - List _allProjects = List(); - - List get allProjects => _allProjects; - List _allReferral = List(); - List get allReferral => _allReferral; String _activationCode; String _logInTokenID; @@ -50,106 +42,84 @@ class EReferralService extends BaseService { Future getAllCities() async { await baseAppClient.post(GET_ALL_CITIES, onSuccess: (dynamic response, int statusCode) { - _allCities.clear(); - response['ListCities'].forEach((city) { - _allCities.add(GetAllCitiesResponseModel.fromJson(city)); - }); - }, onFailure: (String error, int statusCode) { - hasError = true; - super.error = error; - }, body: {}); - } - - Future getAllProjects() async { - await baseAppClient.post(GET_PROJECT, - onSuccess: (dynamic response, int statusCode) { - _allProjects.clear(); - response['ListProject'].forEach((city) { - _allProjects.add(GetAllProjectsResponseModel.fromJson(city)); - }); - }, onFailure: (String error, int statusCode) { - hasError = true; - super.error = error; - }, body: {}); + _allCities.clear(); + response['ListCities'].forEach((city) { + _allCities + .add(GetAllCitiesResponseModel.fromJson(city)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: {}); } Future sendActivationCodeForEReferral( + SendActivationCodeForEReferralRequestModel sendActivationCodeForEReferralRequestModel) async { hasError = false; await baseAppClient.post(SEND_ACTIVATION_CODE_FOR_E_REFERRAL, onSuccess: (dynamic response, int statusCode) { - print(response["VerificationCode"]); _activationCode = response["VerificationCode"]; _logInTokenID = response["LogInTokenID"]; + }, onFailure: (String error, int statusCode) { hasError = true; super.error = error; }, body: sendActivationCodeForEReferralRequestModel.toJson()); } + + Future checkActivationCodeForEReferral( CheckActivationCodeForEReferralResponseModel checkActivationCodeForEReferralRequestModel) async { checkActivationCodeForEReferralRequestModel.isDentalAllowedBackend = false; - checkActivationCodeForEReferralRequestModel.logInTokenID = _logInTokenID; - hasError = false; + checkActivationCodeForEReferralRequestModel.logInTokenID= _logInTokenID; + hasError =false; await baseAppClient.post(CHECK_ACTIVATION_CODE_FOR_E_REFERRAL, onSuccess: (dynamic response, int statusCode) { - _isActivationCodeValid = true; + _isActivationCodeValid = true; }, onFailure: (String error, int statusCode) { hasError = true; super.error = error; }, body: checkActivationCodeForEReferralRequestModel.toJson()); } - Future createEReferral( - CreateEReferralRequestModel createEReferralRequestModel) async { - hasError = false; - dynamic localRes; - await baseAppClient.post( - CREATE_E_REFERRAL /*'Services/Patients.svc/REST/CreateEReferral'*/, - onSuccess: (dynamic response, int statusCode) { - // TODO Waiting for fix service - localRes = response; - }, onFailure: (String error, int statusCode) { - hasError = true; - super.error = error; - }, body: createEReferralRequestModel.toJson()); - return Future.value(localRes); - } - - Future getEReferrals( - SearchEReferralRequestModel searchEReferralRequestModel) async { - hasError = false; - dynamic localRes; - await baseAppClient.post(GET_E_REFERRALS, + Future createEReferral( + CreateEReferralRequestModel createEReferralRequestModel + ) async { + hasError = false; + await baseAppClient.post(CREATE_E_REFERRAL/*'Services/Patients.svc/REST/CreateEReferral'*/, onSuccess: (dynamic response, int statusCode) { - print("EEEEEE"); - _allReferral.clear(); - localRes = response; - }, onFailure: (String error, int statusCode) { - hasError = true; - super.error = error; - }, body: searchEReferralRequestModel.toJson()); - return Future.value(localRes); - } + // TODO Waiting for fix service + var asd= ("EEEEEE"); - Future getEReferralsIfLogin(String mobileNo) async { - hasError = false; - dynamic localRes; - Map request = {}; - request['PatientMobileNumber'] = mobileNo; - await baseAppClient.post(GET_E_REFERRALS, - onSuccess: (dynamic response, int statusCode) { - print("EEEEEE"); - _allReferral.clear(); - localRes = response; }, onFailure: (String error, int statusCode) { hasError = true; super.error = error; - }, body: request); - return Future.value(localRes); + }, body: createEReferralRequestModel.toJson()); } + Future getEReferrals( + SearchEReferralRequestModel searchEReferralRequestModel + ) async { + hasError = false; + // TODO return this code when the fix the server + // await baseAppClient.post(GET_E_REFERRALS, + // onSuccess: (dynamic response, int statusCode) { + // print("EEEEEE"); + // // TODO Waiting for fix service + // // ToDo change this one when you have data + // _allReferral.clear(); + // // response['ListCities'].forEach((city) { + // // _allReferral + // // .add(SearchEReferralResponseModel.fromJson(city)); + // // }); + // + // }, onFailure: (String error, int statusCode) { + // hasError = true; + // super.error = error; + // }, body: searchEReferralRequestModel.toJson()); + } } diff --git a/lib/core/service/AlHabibMedicalService/home_health_care_service.dart b/lib/core/service/AlHabibMedicalService/home_health_care_service.dart index 2ec1e310..e636321b 100644 --- a/lib/core/service/AlHabibMedicalService/home_health_care_service.dart +++ b/lib/core/service/AlHabibMedicalService/home_health_care_service.dart @@ -1,5 +1,4 @@ import 'package:diplomaticquarterapp/config/config.dart'; -import 'package:diplomaticquarterapp/core/enum/OrderService.dart'; import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/HHC_get_all_services_request_modle.dart'; import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/HHC_get_all_services_response_model.dart'; import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/get_hHC_all_pres_orders_request_model.dart'; @@ -8,8 +7,6 @@ import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealth import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/get_order_detail_by_order_iD_response_model.dart'; import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/patient_er_insert_pres_order_request_model.dart'; import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/update_pres_oreder_request_model.dart'; -import 'package:diplomaticquarterapp/core/service/AlHabibMedicalService/customer_addresses_service.dart'; -import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/add_new_address_Request_Model.dart'; import '../base_service.dart'; @@ -18,10 +15,9 @@ class HomeHealthCareService extends BaseService { List hhcAllPresOrdersList = List(); List hhcAllOrderDetail = List(); - List addressesList = List(); bool isOrderUpdated; - CustomerInfo customerInfo; + Future getHHCAllServices( HHCGetAllServicesRequestModel hHCGetAllServicesRequestModel) async { hasError = false; @@ -41,11 +37,11 @@ class HomeHealthCareService extends BaseService { GetHHCAllPresOrdersRequestModel getHHCAllPresOrdersRequestModel = GetHHCAllPresOrdersRequestModel(); hasError = false; - await baseAppClient.post(GET_PATIENT_ALL_PRES_ORD, + await baseAppClient.post(GET_PATIENT_ALL_PRES_ORDERS, onSuccess: (dynamic response, int statusCode) { hhcAllPresOrdersList.clear(); response['PatientER_GetPatientAllPresOrdersList'].forEach((data) { - if (data['ServiceID'] == OrderService.HOME_HEALTH_CARE.getIdOrderService()) + if (data['ServiceID'] == 2) hhcAllPresOrdersList .add(GetHHCAllPresOrdersResponseModel.fromJson(data)); }); @@ -95,5 +91,3 @@ class HomeHealthCareService extends BaseService { }, body: order.toJson()); } } - - diff --git a/lib/core/service/childvaccines/add_new_child_service.dart b/lib/core/service/childvaccines/add_new_child_service.dart index 98e87100..5e4a4d86 100644 --- a/lib/core/service/childvaccines/add_new_child_service.dart +++ b/lib/core/service/childvaccines/add_new_child_service.dart @@ -14,12 +14,19 @@ class CreteNewBabyService extends BaseService { Future getCreateNewBabyOrders({CreateNewBaby newChild,int userID}) async { hasError = false; + await getUser(); Map body = Map.from(newChild.toJson()); body['CreatedBy'] = 102; body['EditedBy'] = 102; body['UserID'] = userID; body['AlertBy'] = 2; + body['EmailAddress'] = user.emailAddress; body['IsLogin'] = true; + body['LogInTokenID'] = await sharedPref.getString(TOKEN); + body['MobileNumber'] = user.mobileNumber; + body['NationalID'] = user.nationalityID; + body['ZipCode'] = user.zipCode; + body['isDentalAllowedBackend'] = false; await baseAppClient.post(GET_NEWCHILD_REQUEST, diff --git a/lib/core/service/childvaccines/delete_baby_service.dart b/lib/core/service/childvaccines/delete_baby_service.dart index 49cbd29e..115d13c5 100644 --- a/lib/core/service/childvaccines/delete_baby_service.dart +++ b/lib/core/service/childvaccines/delete_baby_service.dart @@ -1,5 +1,4 @@ import 'package:diplomaticquarterapp/config/config.dart'; -import 'package:diplomaticquarterapp/core/model/childvaccines/List_BabyInformationModel.dart'; import 'package:diplomaticquarterapp/core/model/childvaccines/add_newchild_model.dart'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/core/model/childvaccines/create_new_user_model.dart'; @@ -18,13 +17,22 @@ class DeleteBabyService extends BaseService{ List deleteBabyModelList= List(); - Future getDeleteBabyOrder({List_BabyInformationModel babyInfo}) async { + Future getDeleteBabyOrder({DeleteBaby deleteChild,int babyID}) async { hasError = false; await getUser(); - Map body = Map(); + Map body = Map.from(deleteChild.toJson()); + // body['CreatedBy'] = 102; body['EditedBy'] = 102; + //body['BabyID'] = babyID; + //body['BabyID'] = createNewBabyModelList ; + // body['AlertBy'] = 2; + // body['EmailAddress'] = user.emailAddress; body['IsLogin'] = true; - body['BabyID'] = babyInfo.babyID; + body['LogInTokenID'] = await sharedPref.getString(TOKEN); + body['MobileNumber'] = user.mobileNumber; + body['NationalID'] = user.nationalityID; + body['ZipCode'] = user.zipCode; + body['isDentalAllowedBackend'] = false; await baseAppClient.post(DELETE_CHILD_REQUEST, @@ -37,6 +45,31 @@ class DeleteBabyService extends BaseService{ }, body: body); } - + // Future getCreateNewBabyOrders({CreateNewBaby newChild,int userID}) async { + // hasError = false; + // await getUser(); + // Map body = Map.from(newChild.toJson()); + // body['CreatedBy'] = 102; + // body['EditedBy'] = 102; + // body['UserID'] = userID; + // body['AlertBy'] = 2; + // body['EmailAddress'] = user.emailAddress; + // body['IsLogin'] = true; + // body['LogInTokenID'] = await sharedPref.getString(TOKEN); + // body['MobileNumber'] = user.mobileNumber; + // body['NationalID'] = user.nationalityID; + // body['ZipCode'] = user.zipCode; + // + // body['isDentalAllowedBackend'] = false; + // + // await baseAppClient.post(GET_NEWCHILD_REQUEST, + // onSuccess: (dynamic response, int statusCode) { + // var asd =""; + // }, + // onFailure: (String error, int statusCode) { + // hasError = true; + // super.error = error; + // }, body: body); + // } } \ No newline at end of file diff --git a/lib/core/service/childvaccines/get_vaccinations_item_services.dart b/lib/core/service/childvaccines/get_vaccinations_item_services.dart new file mode 100644 index 00000000..5ff936af --- /dev/null +++ b/lib/core/service/childvaccines/get_vaccinations_item_services.dart @@ -0,0 +1,27 @@ +import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/core/model/childvaccines/get_vacainations_itemsmodel.dart'; + +import '../base_service.dart'; + +class GetVccinationsItemsService extends BaseService { + List getVaccinationsItemModelList = List(); + Map body = Map(); + + + + Future getaccinationsitemOrders() async { + hasError = false; + await baseAppClient.post(GET_TABLE_REQUEST, + onSuccess: (dynamic response, int statusCode) { + getVaccinationsItemModelList.clear(); + response['List_CreateVaccinationTableModel'].forEach((vital) { + getVaccinationsItemModelList.add( + GET_VACCINATIONS_ITEMSMODEL.fromJson(vital)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); + } + +} \ No newline at end of file diff --git a/lib/core/service/childvaccines/user_information_service.dart b/lib/core/service/childvaccines/user_information_service.dart index 55ddc259..0628920c 100644 --- a/lib/core/service/childvaccines/user_information_service.dart +++ b/lib/core/service/childvaccines/user_information_service.dart @@ -4,11 +4,11 @@ import 'package:diplomaticquarterapp/core/model/childvaccines/user_information_m import '../base_service.dart'; class UserInformationService extends BaseService { - List_UserInformationModel userInformationModel = List_UserInformationModel(); + List userInformationModelList = List(); + Map body = Map(); Future getUserInformationOrders() async { hasError = false; - Map body = Map(); await getUser(); body['CreatedBy'] = 102; body['EditedBy'] = 102; @@ -22,44 +22,14 @@ class UserInformationService extends BaseService { await baseAppClient.post(GET_USERINFORMATION_REQUEST, onSuccess: (dynamic response, int statusCode) { + userInformationModelList.clear(); + response['List_UserInformationModel_New'].forEach((vital) { - userInformationModel = List_UserInformationModel.fromJson(vital); + userInformationModelList.add(List_UserInformationModel.fromJson(vital)); }); }, onFailure: (String error, int statusCode) { hasError = true; super.error = error; }, body: body); } - - Future updateEmail(String email) async { - hasError = false; - Map body = Map(); - body['IsInternalRequest'] = true; - body['EmailAddress'] = email; - body['IsLogin'] = true; - body['isDentalAllowedBackend'] = false; - await baseAppClient.post(UPDATE_PATENT_EMAIL, - onSuccess: (dynamic response, int statusCode) { - var asd = ""; - }, onFailure: (String error, int statusCode) { - hasError = true; - super.error = error; - }, body: body); - } - - Future updateUserInfo(String email) async { - hasError = false; - Map body = Map(); - body['IsInternalRequest'] = true; - body['EmailAddress'] = email; - body['IsLogin'] = true; - body['isDentalAllowedBackend'] = false; - await baseAppClient.post(UPDATE_PATENT_INFO, - onSuccess: (dynamic response, int statusCode) { - var asd = ""; - }, onFailure: (String error, int statusCode) { - hasError = true; - super.error = error; - }, body: body); - } } diff --git a/lib/core/service/childvaccines/vaccination_table_service.dart b/lib/core/service/childvaccines/vaccination_table_service.dart index da3c8518..7f987b76 100644 --- a/lib/core/service/childvaccines/vaccination_table_service.dart +++ b/lib/core/service/childvaccines/vaccination_table_service.dart @@ -1,9 +1,7 @@ import 'package:diplomaticquarterapp/config/config.dart'; -import 'package:diplomaticquarterapp/core/model/childvaccines/List_BabyInformationModel.dart'; import 'package:diplomaticquarterapp/core/model/childvaccines/add_newchild_model.dart'; import 'package:diplomaticquarterapp/core/model/childvaccines/create_vaccination_table.dart'; import 'package:diplomaticquarterapp/core/model/childvaccines/user_information_model.dart'; -import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import '../base_service.dart'; class VaccinationTableService extends BaseService { @@ -12,16 +10,19 @@ class VaccinationTableService extends BaseService { - Future getCreateVaccinationTableOrders({List_BabyInformationModel babyInfo, List_UserInformationModel informationModel, bool isSendEmail=false}) async { + Future getCreateVaccinationTableOrders() async { hasError = false; await getUser(); - body['BabyName']=babyInfo.babyName; - body['DOB'] = DateUtil.convertDateToString(babyInfo.dOB); - body['EmailAddress'] = informationModel.emailAddress; + body['BabyName']="fffffffffff eeeeeeeeeeeeee"; + body['DOB'] = "/Date(1585774800000+0300)/"; + body['EmailAddress'] = user.emailAddress; body['isDentalAllowedBackend'] = false; - body['SendEmail'] = isSendEmail; + body['SendEmail'] = false; body['IsLogin'] =true; + + + await baseAppClient.post(GET_TABLE_REQUEST, onSuccess: (dynamic response, int statusCode) { createVaccinationTableModelList.clear(); diff --git a/lib/core/service/client/base_app_client.dart b/lib/core/service/client/base_app_client.dart index e7d69a31..54be167f 100644 --- a/lib/core/service/client/base_app_client.dart +++ b/lib/core/service/client/base_app_client.dart @@ -2,13 +2,10 @@ import 'dart:convert'; import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; -import 'package:diplomaticquarterapp/core/service/medical/vital_sign_service.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; -import 'package:diplomaticquarterapp/pages/appUpdatePage/app_update_page.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:flutter/cupertino.dart'; -import 'package:flutter/material.dart'; import 'package:http/http.dart' as http; import 'package:provider/provider.dart'; @@ -24,92 +21,74 @@ AppSharedPreferences sharedPref = new AppSharedPreferences(); /// onFailure: (String error, int statusCode) {}, /// body: Map(); /// -AuthenticatedUserObject authenticatedUserObject = - locator(); -VitalSignService _vitalSignService = locator(); +AuthenticatedUserObject authenticatedUserObject = locator(); class BaseAppClient { - post(String endPoint, - {Map body, - Function(dynamic response, int statusCode) onSuccess, - Function(String error, int statusCode) onFailure, - bool isAllowAny = false, - bool isExternal = false}) async { - String url; - if (isExternal) { - url = endPoint; - } else { - url = BASE_URL + endPoint; - } + post(String endPoint, {Map 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); - if (!isExternal) { - String token = await sharedPref.getString(TOKEN); - var languageID = await sharedPref.getString(APP_LANGUAGE)?? 'ar'; - var user = await sharedPref.getObject(USER_PROFILE); - if (body.containsKey('SetupID')) { - body['SetupID'] = body.containsKey('SetupID') - ? body['SetupID'] != null - ? body['SetupID'] - : SETUP_ID - : SETUP_ID; - } - - body['VersionID'] = VERSION_ID; - body['Channel'] = CHANNEL; - body['LanguageID'] = body.containsKey('LanguageID') - ? body['LanguageID'] != null - ? body['LanguageID'] - : languageID == 'ar' - ? 1 - : 2 - : languageID == 'en' - ? 2 - : 1; - - body['IPAdress'] = IP_ADDRESS; - body['generalid'] = GENERAL_ID; - body['PatientOutSA'] = body.containsKey('PatientOutSA') - ? body['PatientOutSA'] != null - ? body['PatientOutSA'] - : PATIENT_OUT_SA - : 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; - } + String token = await sharedPref.getString(TOKEN); + var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + var user = await sharedPref.getObject(USER_PROFILE); + if (body.containsKey('SetupID')) { + body['SetupID'] = body.containsKey('SetupID') + ? body['SetupID'] != null + ? body['SetupID'] + : SETUP_ID + : SETUP_ID; + } + body['VersionID'] = VERSION_ID; + body['Channel'] = CHANNEL; + 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') + ? body['PatientOutSA'] != null + ? body['PatientOutSA'] + : PATIENT_OUT_SA + : 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['DeviceTypeID'] = DeviceTypeID; - - if (!body.containsKey('IsPublicRequest')) { - body['PatientType'] = body.containsKey('PatientType') - ? body['PatientType'] != null - ? body['PatientType'] - : user['PatientType'] != null - ? user['PatientType'] - : PATIENT_TYPE - : PATIENT_TYPE; - - body['PatientTypeID'] = body.containsKey('PatientTypeID') - ? body['PatientTypeID'] != null - ? body['PatientTypeID'] - : user['PatientType'] != null - ? user['PatientType'] - : PATIENT_TYPE_ID - : PATIENT_TYPE_ID; - if (user != null) { - body['TokenID'] = token; - body['PatientID'] = body['PatientID'] != null - ? body['PatientID'] - : user['PatientID']; - body['PatientOutSA'] = user['OutSA']; - body['SessionID'] = SESSION_ID; //getSessionId(token); - } + body['DeviceTypeID'] = DeviceTypeID; + + if (!body.containsKey('IsPublicRequest')) { + body['PatientType'] = body.containsKey('PatientType') + ? body['PatientType'] != null + ? body['PatientType'] + : user['PatientType'] != null + ? user['PatientType'] + : PATIENT_TYPE + : PATIENT_TYPE; + + body['PatientTypeID'] = body.containsKey('PatientTypeID') + ? body['PatientTypeID'] != null + ? body['PatientTypeID'] + : 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['PatientOutSA'] = user['OutSA']; + body['SessionID'] = SESSION_ID; //getSessionId(token); } } @@ -118,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) { @@ -133,10 +107,6 @@ class BaseAppClient { if (parsed['Response_Message'] != null) { onSuccess(parsed, statusCode); } else { - if (parsed['ErrorType'] == 4) { - navigateToAppUpdate( - AppGlobal.context, parsed['ErrorEndUserMessage']); - } if (isAllowAny) { onSuccess(parsed, statusCode); } else if (parsed['IsAuthenticated'] == null) { @@ -147,12 +117,9 @@ class BaseAppClient { } else if (parsed['Result'] == 'OK') { onSuccess(parsed, statusCode); } else { - onFailure( - parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], - statusCode); + 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(); @@ -162,9 +129,7 @@ class BaseAppClient { if (parsed['SameClinicApptList'] != null) { onSuccess(parsed, statusCode); } else { - onFailure( - parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], - statusCode); + onFailure(parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], statusCode); } } } @@ -174,29 +139,12 @@ class BaseAppClient { } } catch (e) { print(e); - onFailure('Failed to connect to the server', -1); - // onFailure(e.toString(), -1); + onFailure(e.toString(), -1); } } - Future navigateToAppUpdate(context, String text) async { - Navigator.pushReplacement( - context, - MaterialPageRoute( - builder: (context) => AppUpdatePage(appUpdateText: text))); - } - - get(String endPoint, - {Function(dynamic response, int statusCode) onSuccess, - Function(String error, int statusCode) onFailure, - Map queryParams, - bool isExternal = false}) async { - String url; - if (isExternal) { - url = endPoint; - } else { - url = BASE_URL + endPoint; - } + get(String endPoint, {Function(dynamic response, int statusCode) onSuccess, Function(String error, int statusCode) onFailure, Map queryParams}) async { + String url = BASE_URL + endPoint; if (queryParams != null) { String queryString = Uri(queryParameters: queryParams).query; url += '?' + queryString; @@ -207,10 +155,7 @@ class BaseAppClient { if (await Utils.checkConnection()) { final response = await http.get( url.trim(), - headers: { - 'Content-Type': 'application/json', - 'Accept': 'application/json' - }, + headers: {'Content-Type': 'application/json', 'Accept': 'application/json'}, ); final int statusCode = response.statusCode; print("statusCode :$statusCode"); @@ -226,13 +171,38 @@ class BaseAppClient { } } + simpleGet(String fullUrl, {Function(dynamic response, int statusCode) onSuccess, Function(String error, int statusCode) onFailure, Map queryParams}) async { + String url = fullUrl; + var haveParams = (queryParams != null); + if (haveParams) { + String queryString = Uri(queryParameters: queryParams).query; + url += '?' + queryString; + print("URL Query String: $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); await authenticatedUserObject.getUser(); - Provider.of(AppGlobal.context, listen: false).isLogin = - false; - _vitalSignService.weightKg = ""; - _vitalSignService.heightCm = ""; + Provider.of(AppGlobal.context, listen: false).isLogin = false; Navigator.of(AppGlobal.context).pushReplacementNamed(HOME); } @@ -240,4 +210,25 @@ class BaseAppClient { ///return id.replaceAll(RegExp('/[^\w\s]/'), ''); // return id.replaceAll(RegExp('/[^a-zA-Z ]'), ''); } + + static defaultHttpParameters() async { + String token = await sharedPref.getString(TOKEN); + var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + var user = await sharedPref.getObject(USER_PROFILE); + var params = {}; + if (user != null) { + params['TokenID'] = token; + params['PatientID'] = user['PatientID']; + params['PatientOutSA'] = user['OutSA']; + params['SessionID'] = SESSION_ID; //getSessionId(token); + } + + params['IPAdress'] = IP_ADDRESS; + params['generalid'] = GENERAL_ID; + params['VersionID'] = VERSION_ID; + params['Channel'] = CHANNEL; + params['LanguageID'] = languageID == 'ar' ? 1 : 2; + + return params; + } } diff --git a/lib/core/service/geofencing/GeofencingServices.dart b/lib/core/service/geofencing/GeofencingServices.dart new file mode 100644 index 00000000..a186b4c4 --- /dev/null +++ b/lib/core/service/geofencing/GeofencingServices.dart @@ -0,0 +1,65 @@ +import 'dart:convert'; +import 'dart:developer'; + +import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; +import 'package:diplomaticquarterapp/core/model/geofencing/requests/GeoZonesRequestModel.dart'; +import 'package:diplomaticquarterapp/core/model/geofencing/requests/LogGeoZoneRequestModel.dart'; +import 'package:diplomaticquarterapp/core/model/geofencing/responses/GeoZonesResponseModel.dart'; +import 'package:diplomaticquarterapp/core/model/geofencing/responses/LogGeoZoneResponseModel.dart'; +import 'package:diplomaticquarterapp/core/service/base_service.dart'; +import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/foundation.dart'; + +import '../../../locator.dart'; + +class GeofencingServices extends BaseService { + List geoZones = List(); + bool testZones = true; + + Future> getAllGeoZones(GeoZonesRequestModel request) async { + hasError = false; + + var _zonesJsonString; + await baseAppClient.post(GET_GEO_ZONES, onSuccess: (dynamic response, int statusCode) { + var zones = response['GeoF_PointsList']; + zones.forEach((json) { + geoZones.add(GeoZonesResponseModel().fromJson(json)); + }); + + if (kDebugMode || testZones) addTestingGeoZones(zones); + + _zonesJsonString = json.encode(zones); + }, onFailure: (String error, int statusCode) { + hasError = true; + return Future.error(error); + }, body: request.toFlatMap()); + + AppSharedPreferences pref = AppSharedPreferences(); + await pref.setString(HMG_GEOFENCES, _zonesJsonString); + debugPrint("GEO ZONES saved to AppPreferences with key '$HMG_GEOFENCES'"); + + return geoZones; + } + + LogGeoZoneResponseModel logResponse; + Future logGeoZone(LogGeoZoneRequestModel request) async { + hasError = false; + await baseAppClient.post(LOG_GEO_ZONES, onSuccess: (dynamic response, int statusCode) { + logResponse = LogGeoZoneResponseModel().fromJson(response); + }, onFailure: (String error, int statusCode) { + hasError = true; + return Future.error(error); + }, body: request.toFlatMap()); + return logResponse; + } + + addTestingGeoZones(List zones) { + zones.add({"GEOF_ID": -1, "Description": "ZiK Home", "Latitude": "24.691136", "Longitude": "46.650116", "Radius": 100, "Type": 1}); + zones.add({"GEOF_ID": -2, "Description": "CS Office", "Latitude": "24.7087913", "Longitude": "46.6656461", "Radius": 100, "Type": 1}); + zones.add({"GEOF_ID": -3, "Description": "Mahmoud Shrouf Home", "Latitude": "24.777577", "Longitude": "46.652675", "Radius": 100, "Type": 1}); + zones.add({"GEOF_ID": -4, "Description": "Panorama Mall", "Latitude": "24.692453", "Longitude": "46.669168", "Radius": 450, "Type": 1}); + zones.add({"GEOF_ID": -5, "Description": "Saudi Architects Crossing", "Latitude": "24.698375", "Longitude": "46.668567", "Radius": 140, "Type": 1}); + } +} diff --git a/lib/core/service/medical/my_balance_service.dart b/lib/core/service/medical/my_balance_service.dart index e3be9bcf..c456b38c 100644 --- a/lib/core/service/medical/my_balance_service.dart +++ b/lib/core/service/medical/my_balance_service.dart @@ -1,3 +1,5 @@ +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'; @@ -22,8 +24,7 @@ class MyBalanceService extends BaseService { String logInTokenID; String verificationCode; - AuthenticatedUserObject authenticatedUserObject = - locator(); + AuthenticatedUserObject authenticatedUserObject = locator(); getPatientAdvanceBalanceAmount() async { hasError = false; @@ -60,14 +61,13 @@ class MyBalanceService extends BaseService { }, body: body); } - getPatientInfoByPatientIDAndMobileNumber(AdvanceModel advanceModel) async { + getPatientInfoByPatientIDAndMobileNumber() async { hasError = false; super.error = ""; Map body = Map(); body['isDentalAllowedBackend'] = false; - body['MobileNo'] = advanceModel.mobileNumber; - body['ProjectID'] = advanceModel.hospitalsModel.iD; - body['PatientID'] = advanceModel.fileNumber; + 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 { @@ -81,7 +81,7 @@ class MyBalanceService extends BaseService { }, body: body); } - sendActivationCodeForAdvancePayment({int patientID, int projectID}) async { + sendActivationCodeForAdvancePayment({int patientID,int projectID}) async { hasError = false; super.error = ""; Map body = Map(); @@ -111,8 +111,9 @@ class MyBalanceService extends BaseService { body['LogInTokenID'] = logInTokenID; await baseAppClient.post(CHECK_ACTIVATION_CODE_FOR_ADVANCE_PAYMENT, - onSuccess: (response, statusCode) async {}, - onFailure: (String error, int statusCode) { + onSuccess: (response, statusCode) async { + + }, onFailure: (String error, int statusCode) { hasError = true; super.error = error; super.error = error; diff --git a/lib/core/service/medical/prescriptions_service.dart b/lib/core/service/medical/prescriptions_service.dart index d6ad3732..b920499c 100644 --- a/lib/core/service/medical/prescriptions_service.dart +++ b/lib/core/service/medical/prescriptions_service.dart @@ -57,30 +57,20 @@ class PrescriptionsService extends BaseService { List prescriptionReportList = List(); Future getPrescriptionReport( - {Prescriptions prescriptions}) async { + {int dischargeNo, int projectId, int clinicID, String setupID,int episodeID}) async { hasError = false; - _requestPrescriptionReport.dischargeNo = prescriptions.dischargeNo; - _requestPrescriptionReport.projectID = prescriptions.projectID; - _requestPrescriptionReport.clinicID = prescriptions.clinicID; - _requestPrescriptionReport.setupID = prescriptions.setupID; - _requestPrescriptionReport.episodeID = prescriptions.episodeID; - _requestPrescriptionReport.appointmentNo = prescriptions.appointmentNo; - - await baseAppClient.post(prescriptions.isInOutPatient? GET_PRESCRIPTION_REPORT_ENH : GET_PRESCRIPTION_REPORT, + _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(); - prescriptionReportEnhList.clear(); - if(prescriptions.isInOutPatient){ - response['ListPRM'].forEach((prescriptions) { - prescriptionReportEnhList.add(PrescriptionReportEnh.fromJson(prescriptions)); - }); - }else{ - response['INP_GetPrescriptionReport_List'].forEach((prescriptions) { - prescriptionReportList.add(PrescriptionReport.fromJson(prescriptions)); - }); - } - - + response['INP_GetPrescriptionReport_List'].forEach((prescriptions) { + prescriptionReportList.add(PrescriptionReport.fromJson(prescriptions)); + }); }, onFailure: (String error, int statusCode) { hasError = true; super.error = error; diff --git a/lib/core/service/packages_offers/PackagesOffersServices.dart b/lib/core/service/packages_offers/PackagesOffersServices.dart new file mode 100644 index 00000000..e58c3fa3 --- /dev/null +++ b/lib/core/service/packages_offers/PackagesOffersServices.dart @@ -0,0 +1,51 @@ +import 'dart:convert'; +import 'dart:developer'; + +import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/core/model/packages_offers/requests/OffersCategoriesRequestModel.dart'; +import 'package:diplomaticquarterapp/core/model/packages_offers/requests/OffersProductsRequestModel.dart'; +import 'package:diplomaticquarterapp/core/model/packages_offers/responses/OfferCategoriesResponseModel.dart'; +import 'package:diplomaticquarterapp/core/model/packages_offers/responses/OfferProductsResponseModel.dart'; +import 'package:diplomaticquarterapp/core/service/base_service.dart'; +import 'package:diplomaticquarterapp/core/service/client/base_app_client.dart'; + +import '../../../locator.dart'; + +class OffersAndPackagesServices extends BaseService { + List categoryList = List(); + + Future> getAllCategories(OffersCategoriesRequestModel request) async { + hasError = false; + var url = EXA_CART_API_BASE_URL + PACKAGES_CATEGORIES; + await baseAppClient.simpleGet(url, onSuccess: (dynamic stringResponse, int statusCode) { + if (statusCode == 200) { + var jsonResponse = json.decode(stringResponse); + jsonResponse['categories'].forEach((json) { + categoryList.add(OfferCategoriesResponseModel().fromJson(json)); + }); + } + }, onFailure: (String error, int statusCode) { + log(error); + }, queryParams: request.toFlatMap()); + + return categoryList; + } + + List productList = List(); + Future> getAllProducts(OffersProductsRequestModel request) async { + hasError = false; + var url = EXA_CART_API_BASE_URL + PACKAGES_PRODUCTS; + await baseAppClient.simpleGet(url, onSuccess: (dynamic stringResponse, int statusCode) { + if (statusCode == 200) { + var jsonResponse = json.decode(stringResponse); + jsonResponse['products'].forEach((json) { + productList.add(OfferProductsResponseModel().fromJson(json)); + }); + } + }, onFailure: (String error, int statusCode) { + log(error); + }, queryParams: request.toFlatMap()); + + return productList; + } +} diff --git a/lib/core/service/privilege_service.dart b/lib/core/service/privilege_service.dart deleted file mode 100644 index 5beef992..00000000 --- a/lib/core/service/privilege_service.dart +++ /dev/null @@ -1,22 +0,0 @@ -import 'package:diplomaticquarterapp/config/config.dart'; -import 'package:diplomaticquarterapp/core/model/privilege/PrivilegeModel.dart'; -import 'package:diplomaticquarterapp/core/service/base_service.dart'; - -class PrivilegeService extends BaseService { - - List privilegeModelList = List(); - - Future getPrivilege() async { - Map body = Map(); - body['PatientType'] = 4; - await baseAppClient.post(GET_PRIVILEGE, - onSuccess: (dynamic response, int statusCode) { - response['ServicePrivilegeList'].forEach((item) { - privilegeModelList.add(PrivilegeModel.fromJson(item)); - }); - }, onFailure: (String error, int statusCode) { - hasError = true; - super.error = error; - }, body: body); - } -} diff --git a/lib/core/service/weather_service.dart b/lib/core/service/weather_service.dart deleted file mode 100644 index b2dcf0ef..00000000 --- a/lib/core/service/weather_service.dart +++ /dev/null @@ -1,37 +0,0 @@ -import 'package:diplomaticquarterapp/config/config.dart'; -import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; -import 'package:diplomaticquarterapp/core/model/weahter/weather_model.dart'; -import 'package:diplomaticquarterapp/core/service/base_service.dart'; - -class WeatherService extends BaseService { - List weatherIndicatorData = List(); - - Map body = Map(); - String Latitude = ""; - String Longitude = ""; - String PhoneNumber = ""; - - Future getWeatherData() async { - hasError = false; - - var lat = await sharedPref.getDouble(USER_LAT); - var long = await sharedPref.getDouble(USER_LONG); - body['Latitude'] = lat ?? 0; - body['Longitude'] = long ?? 0; - - await baseAppClient.post(WEATHER_INDICATOR, - onSuccess: (dynamic response, int statusCode) { - - - response['GetCityInfo_List'].forEach((data) { - weatherIndicatorData.add(GetCityInfoList.fromJson(data)); - }); - print(weatherIndicatorData); - - }, onFailure: (String error, int statusCode) { - hasError = true; - super.error = error; - }, body: body); - await this.sharedPref.setObject(WEATHER,weatherIndicatorData[0]); - } -} diff --git a/lib/core/viewModels/AlHabibMedicalService/add_new_address_Request_Model.dart b/lib/core/viewModels/AlHabibMedicalService/add_new_address_Request_Model.dart deleted file mode 100644 index 5bde5a5f..00000000 --- a/lib/core/viewModels/AlHabibMedicalService/add_new_address_Request_Model.dart +++ /dev/null @@ -1,136 +0,0 @@ -class AddNewAddressRequestModel { - Customer customer; - - AddNewAddressRequestModel({this.customer}); - - AddNewAddressRequestModel.fromJson(Map json) { - customer = json['customer'] != null - ? new Customer.fromJson(json['customer']) - : null; - } - - Map toJson() { - final Map data = new Map(); - if (this.customer != null) { - data['customer'] = this.customer.toJson(); - } - return data; - } -} - -class Customer { - List addresses; - int id; - String email; - List roleIds; - - Customer({this.addresses, this.id, this.email, this.roleIds}); - - Customer.fromJson(Map json) { - if (json['addresses'] != null) { - addresses = new List(); - json['addresses'].forEach((v) { - addresses.add(new Addresses.fromJson(v)); - }); - } - id = json['id']; - email = json['email']; - roleIds = json['role_ids'].cast(); - } - - Map toJson() { - final Map data = new Map(); - if (this.addresses != null) { - data['addresses'] = this.addresses.map((v) => v.toJson()).toList(); - } - data['id'] = this.id; - data['email'] = this.email; - data['role_ids'] = this.roleIds; - return data; - } -} - -class Addresses { - int id; - String firstName; - String lastName; - String email; - Null company; - int countryId; - String country; - Null stateProvinceId; - String city; - String address1; - String address2; - String zipPostalCode; - String phoneNumber; - Null faxNumber; - String customerAttributes; - String createdOnUtc; - Null province; - String latLong; - - Addresses( - {this.id, - this.firstName, - this.lastName, - this.email, - this.company, - this.countryId, - this.country, - this.stateProvinceId, - this.city, - this.address1, - this.address2, - this.zipPostalCode, - this.phoneNumber, - this.faxNumber, - this.customerAttributes, - this.createdOnUtc, - this.province, - this.latLong}); - - Addresses.fromJson(Map json) { - id = json['id']; - firstName = json['first_name']; - lastName = json['last_name']; - email = json['email']; - company = json['company']; - countryId = json['country_id']; - country = json['country']; - stateProvinceId = json['state_province_id']; - city = json['city']; - address1 = json['address1']; - address2 = json['address2']; - zipPostalCode = json['zip_postal_code']; - phoneNumber = json['phone_number']; - faxNumber = json['fax_number']; - customerAttributes = json['customer_attributes']; - createdOnUtc = json['created_on_utc']; - province = json['province']; - latLong = json['lat_long']; - } - - Map toJson() { - final Map data = new Map(); - data['id'] = this.id; - data['first_name'] = this.firstName; - data['last_name'] = this.lastName; - data['email'] = this.email; - data['company'] = this.company; - data['country_id'] = this.countryId; - data['country'] = this.country; - data['state_province_id'] = this.stateProvinceId; - data['city'] = this.city; - data['address1'] = this.address1; - data['address2'] = this.address2; - data['zip_postal_code'] = this.zipPostalCode; - data['phone_number'] = this.phoneNumber; - data['fax_number'] = this.faxNumber; - data['customer_attributes'] = this.customerAttributes; - data['created_on_utc'] = this.createdOnUtc; - data['province'] = this.province; - data['lat_long'] = this.latLong; - return data; - } -} diff --git a/lib/core/viewModels/AlHabibMedicalService/cmc_view_model.dart b/lib/core/viewModels/AlHabibMedicalService/cmc_view_model.dart index 0774e5a7..bf3404a9 100644 --- a/lib/core/viewModels/AlHabibMedicalService/cmc_view_model.dart +++ b/lib/core/viewModels/AlHabibMedicalService/cmc_view_model.dart @@ -9,19 +9,14 @@ import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealth import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/get_order_detail_by_order_iD_response_model.dart'; import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/update_pres_oreder_request_model.dart'; import 'package:diplomaticquarterapp/core/service/AlHabibMedicalService/cmc_service.dart'; -import 'package:diplomaticquarterapp/core/service/AlHabibMedicalService/customer_addresses_service.dart'; import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart'; import '../../../locator.dart'; -import 'add_new_address_Request_Model.dart'; class CMCViewModel extends BaseViewModel { CMCService _cMCService = locator(); - CustomerAddressesService _customerAddressesService = - locator(); - List get addressesList => - _customerAddressesService.addressesList; + List get cmcAllServicesList => _cMCService.cmcAllServicesList; @@ -99,6 +94,7 @@ class CMCViewModel extends BaseViewModel { await _cMCService .getOrderDetailByOrderID(getOrderDetailByOrderIDRequestModel); } + //TODO check it in uat Future insertPresPresOrder({CMCInsertPresOrderRequestModel order}) async { setState(ViewState.Busy); order.createdBy = user.patientID; @@ -111,44 +107,4 @@ class CMCViewModel extends BaseViewModel { getCmcAllPresOrders(); } } - - Future getCustomerAddresses() async { - setState(ViewState.Busy); - await _customerAddressesService.getCustomerAddresses( - ); - if (_customerAddressesService.hasError) { - error = _customerAddressesService.error; - setState(ViewState.ErrorLocal); - } else { - setState(ViewState.Idle); - } - } - - Future getCustomerInfo() async { - setState(ViewState.Busy); - await _customerAddressesService.getCustomerInfo( - ); - if (_customerAddressesService.hasError) { - error = _customerAddressesService.error; - setState(ViewState.ErrorLocal); - } else { - await getCustomerAddresses(); - } - } - - Future addAddressInfo( - {AddNewAddressRequestModel addNewAddressRequestModel}) async { - - - setState(ViewState.Busy); - await _customerAddressesService.addAddressInfo( - addNewAddressRequestModel: addNewAddressRequestModel - ); - if (_customerAddressesService.hasError) { - error = _customerAddressesService.error; - setState(ViewState.ErrorLocal); - } else { - setState(ViewState.Idle); - } - } } \ No newline at end of file diff --git a/lib/core/viewModels/AlHabibMedicalService/home_health_care_view_model.dart b/lib/core/viewModels/AlHabibMedicalService/home_health_care_view_model.dart index 20a19b23..031d0a0c 100644 --- a/lib/core/viewModels/AlHabibMedicalService/home_health_care_view_model.dart +++ b/lib/core/viewModels/AlHabibMedicalService/home_health_care_view_model.dart @@ -8,28 +8,18 @@ import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealth import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/get_order_detail_by_order_iD_response_model.dart'; import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/patient_er_insert_pres_order_request_model.dart'; import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/update_pres_oreder_request_model.dart'; -import 'package:diplomaticquarterapp/core/service/AlHabibMedicalService/customer_addresses_service.dart'; import 'package:diplomaticquarterapp/core/service/AlHabibMedicalService/home_health_care_service.dart'; import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart'; -import 'package:intl/intl.dart'; import '../../../locator.dart'; -import 'add_new_address_Request_Model.dart'; class HomeHealthCareViewModel extends BaseViewModel { HomeHealthCareService _homeHealthCareService = locator(); - CustomerAddressesService _customerAddressesService = - locator(); - List get hhcAllServicesList => _homeHealthCareService.hhcAllServicesList; - - List get addressesList => - _customerAddressesService.addressesList; - List get hhcAllPresOrders => _homeHealthCareService.hhcAllPresOrdersList; @@ -103,44 +93,5 @@ class HomeHealthCareViewModel extends BaseViewModel { } - Future getCustomerAddresses() async { - setState(ViewState.Busy); - await _customerAddressesService.getCustomerAddresses( - ); - if (_customerAddressesService.hasError) { - error = _customerAddressesService.error; - setState(ViewState.ErrorLocal); - } else { - setState(ViewState.Idle); - } - } - - Future getCustomerInfo() async { - setState(ViewState.Busy); - await _customerAddressesService.getCustomerInfo( - ); - if (_customerAddressesService.hasError) { - error = _customerAddressesService.error; - setState(ViewState.ErrorLocal); - } else { - await getCustomerAddresses(); - } - } - - Future addAddressInfo( - {AddNewAddressRequestModel addNewAddressRequestModel}) async { - - setState(ViewState.Busy); - await _customerAddressesService.addAddressInfo( - addNewAddressRequestModel: addNewAddressRequestModel - ); - if (_customerAddressesService.hasError) { - error = _customerAddressesService.error; - setState(ViewState.ErrorLocal); - } else { - setState(ViewState.Idle); - } - } - } \ No newline at end of file diff --git a/lib/core/viewModels/all_habib_medical_services/e_referral_view_model.dart b/lib/core/viewModels/all_habib_medical_services/e_referral_view_model.dart index 047e06f2..1972e08f 100644 --- a/lib/core/viewModels/all_habib_medical_services/e_referral_view_model.dart +++ b/lib/core/viewModels/all_habib_medical_services/e_referral_view_model.dart @@ -4,7 +4,6 @@ import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/EReferral/check_activation_code_for_e_referral_request_model.dart'; import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/EReferral/create_e_referral_request_model.dart'; import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/EReferral/get_all_cities_response_model.dart'; -import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/EReferral/get_all_projects_response_model.dart'; import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/EReferral/get_all_relationship_types_response_model.dart'; import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/EReferral/search_e_referral_request_model.dart'; import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/EReferral/search_e_referral_response_model.dart'; @@ -19,108 +18,74 @@ class EReferralViewModel extends BaseViewModel { List get relationTypes => _eReferralService.relationTypes; - List get allCities => _eReferralService.allCities; + List get allReferral => _eReferralService.allReferral; - List get allHospitals => - _eReferralService.allProjects; - List get allReferral => - _eReferralService.allReferral; - void getRelationTypes() async { + void getRelationTypes() async { setState(ViewState.Busy); await _eReferralService.getRelationTypes(); if (_eReferralService.hasError) { error = _eReferralService.error; setState(ViewState.Error); - } else { + } else{ setState(ViewState.Idle); } } - - void getAllCities() async { + void getAllCities() async { setState(ViewState.Busy); await _eReferralService.getAllCities(); if (_eReferralService.hasError) { error = _eReferralService.error; setState(ViewState.Error); - } else { + } else{ setState(ViewState.Idle); } } - void getAllProjects() async { - setState(ViewState.Busy); - await _eReferralService.getAllProjects(); - if (_eReferralService.hasError) { - error = _eReferralService.error; - setState(ViewState.Error); - } else { - setState(ViewState.Idle); - } - } - - void sendActivationCodeForEReferral( - SendActivationCodeForEReferralRequestModel - sendActivationCodeForEReferralRequestModel) async { + void sendActivationCodeForEReferral(SendActivationCodeForEReferralRequestModel sendActivationCodeForEReferralRequestModel) async { setState(ViewState.BusyLocal); - await _eReferralService.sendActivationCodeForEReferral( - sendActivationCodeForEReferralRequestModel); + await _eReferralService.sendActivationCodeForEReferral(sendActivationCodeForEReferralRequestModel); if (_eReferralService.hasError) { error = _eReferralService.error; setState(ViewState.ErrorLocal); - } else { + } else{ setState(ViewState.Idle); } } - checkActivationCodeForEReferral( - CheckActivationCodeForEReferralResponseModel - checkActivationCodeForEReferralRequestModel) async { + checkActivationCodeForEReferral(CheckActivationCodeForEReferralResponseModel checkActivationCodeForEReferralRequestModel) async { setState(ViewState.BusyLocal); - await _eReferralService.checkActivationCodeForEReferral( - checkActivationCodeForEReferralRequestModel); + await _eReferralService.checkActivationCodeForEReferral(checkActivationCodeForEReferralRequestModel); if (_eReferralService.hasError) { error = _eReferralService.error; setState(ViewState.ErrorLocal); - } else { + } else{ setState(ViewState.Idle); } } - Future createEReferral( + void createEReferral( CreateEReferralRequestModel createEReferralRequestModel) async { - dynamic localRes; setState(ViewState.BusyLocal); - await _eReferralService - .createEReferral(createEReferralRequestModel) - .then((response) { - localRes = response; - }); + await _eReferralService.createEReferral(createEReferralRequestModel); if (_eReferralService.hasError) { error = _eReferralService.error; setState(ViewState.ErrorLocal); } else { setState(ViewState.Idle); } - return Future.value(localRes); } - Future getEReferrals(SearchEReferralRequestModel searchEReferralRequestModel) async { + getEReferrals(SearchEReferralRequestModel searchEReferralRequestModel) async { setState(ViewState.BusyLocal); - dynamic localRes; - await _eReferralService.getEReferrals(searchEReferralRequestModel).then((response) { - localRes = response; - }); + await _eReferralService.getEReferrals(searchEReferralRequestModel); if (_eReferralService.hasError) { error = _eReferralService.error; setState(ViewState.ErrorLocal); } else { setState(ViewState.Idle); } - - return Future.value(localRes); - } } diff --git a/lib/core/viewModels/child_vaccines/add_new_child_view_model.dart b/lib/core/viewModels/child_vaccines/add_new_child_view_model.dart index 2559c074..eebaca02 100644 --- a/lib/core/viewModels/child_vaccines/add_new_child_view_model.dart +++ b/lib/core/viewModels/child_vaccines/add_new_child_view_model.dart @@ -13,6 +13,7 @@ class AddNewChildViewModel extends BaseViewModel { CreteNewBabyService _creteNewBabyService = locator(); ChildVaccinesService _childVaccinesService = locator(); + // DeleteBabyService _deleteBabyService = locator(); bool isAdded = false; ///create new baby createNewBabyOrders({ CreateNewBaby newChild}) async { @@ -24,7 +25,13 @@ class AddNewChildViewModel extends BaseViewModel { } else { isAdded = true; setState(ViewState.Idle); + await _childVaccinesService.getAllBabyInformationOrders(); + if (_childVaccinesService.hasError) { + error = _childVaccinesService.error; + setState(ViewState.Error); + } else{ + } } } diff --git a/lib/core/viewModels/child_vaccines/child_vaccines_view_model.dart b/lib/core/viewModels/child_vaccines/child_vaccines_view_model.dart index a713b6ec..7c4af285 100644 --- a/lib/core/viewModels/child_vaccines/child_vaccines_view_model.dart +++ b/lib/core/viewModels/child_vaccines/child_vaccines_view_model.dart @@ -16,11 +16,14 @@ class ChildVaccinesViewModel extends BaseViewModel{ List get babyInformationModelList=> _childVaccinesService.babyInformationModelList; + +//=========== CreteNewBabyService _creteNewBabyService = locator(); DeleteBabyService _deleteBabyService = locator(); bool isAdded = false; bool isDeleted = false; + //============ getNewUserOrders() async { @@ -45,15 +48,25 @@ class ChildVaccinesViewModel extends BaseViewModel{ ///delete baby - deleteBabyOrders({ List_BabyInformationModel babyInfo}) async { + deleteBabyOrders({ DeleteBaby newChild}) async { setState(ViewState.Busy); - await _deleteBabyService.getDeleteBabyOrder(babyInfo: babyInfo); - if (_deleteBabyService.hasError) { - error = _deleteBabyService.error; + //await _creteNewBabyService.getCreateNewBabyOrders(newChild: newChild, userID: _childVaccinesService.userID); + await _deleteBabyService.getDeleteBabyOrder(deleteChild: newChild,babyID: newChild.babyID); + //getDeleteBabyOrder(deleteChild: newChild,); + // getDeleteBabyOrder + if (_creteNewBabyService.hasError) { + error = _creteNewBabyService.error; setState(ViewState.Error); } else { isDeleted = true; - getBabyInformatioRequestOrders(); + setState(ViewState.Idle); + await _childVaccinesService.getAllBabyInformationOrders(); + if (_childVaccinesService.hasError) { + error = _childVaccinesService.error; + setState(ViewState.Error); + } else{ + + } } } diff --git a/lib/core/viewModels/child_vaccines/user_information_view_model.dart b/lib/core/viewModels/child_vaccines/user_information_view_model.dart index e183ee42..43269f42 100644 --- a/lib/core/viewModels/child_vaccines/user_information_view_model.dart +++ b/lib/core/viewModels/child_vaccines/user_information_view_model.dart @@ -8,7 +8,8 @@ class UserInformationViewModel extends BaseViewModel { UserInformationService _userInformationService = locator(); - List_UserInformationModel get userInformationModelList => _userInformationService.userInformationModel; + List get userInformationModelList => + _userInformationService.userInformationModelList; getUserInformationRequestOrders() async { setState(ViewState.Busy); @@ -19,15 +20,4 @@ class UserInformationViewModel extends BaseViewModel { } else setState(ViewState.Idle); } - - updateEmail(String email)async{ - setState(ViewState.Busy); - await _userInformationService.updateEmail(email); - await _userInformationService.updateUserInfo(email); - if (_userInformationService.hasError) { - error = _userInformationService.error; - setState(ViewState.Error); - } else - await getUserInformationRequestOrders(); - } } diff --git a/lib/core/viewModels/child_vaccines/vaccination_table_view_model.dart b/lib/core/viewModels/child_vaccines/vaccination_table_view_model.dart index 25559b81..3b72dd50 100644 --- a/lib/core/viewModels/child_vaccines/vaccination_table_view_model.dart +++ b/lib/core/viewModels/child_vaccines/vaccination_table_view_model.dart @@ -1,27 +1,30 @@ import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; -import 'package:diplomaticquarterapp/core/model/childvaccines/List_BabyInformationModel.dart'; +import 'package:diplomaticquarterapp/core/model/childvaccines/add_newchild_model.dart'; import 'package:diplomaticquarterapp/core/model/childvaccines/create_vaccination_table.dart'; -import 'package:diplomaticquarterapp/core/model/childvaccines/user_information_model.dart'; +import 'package:diplomaticquarterapp/core/service/childvaccines/add_new_child_service.dart'; import 'package:diplomaticquarterapp/core/service/childvaccines/vaccination_table_service.dart'; import '../../../locator.dart'; import '../base_view_model.dart'; -class VaccinationTableViewModel extends BaseViewModel { - VaccinationTableService _creteVaccinationTableService = - locator(); - List get creteVaccinationTableModelList => - _creteVaccinationTableService.createVaccinationTableModelList; +class VaccinationTableViewModel extends BaseViewModel{ - getCreateVaccinationTable({List_BabyInformationModel babyInfo, List_UserInformationModel informationModel, bool isSendEmail =false}) async { + VaccinationTableService _creteVaccinationTableService = locator(); + + // String get creteVaccinationTableContent => _creteVaccinationTableService.userAgreementContent; + //String get userAgreementContent => _creteNewBabyService.v//_reportsService.userAgreementContent; + List get creteVaccinationTableModelList=> _creteVaccinationTableService.createVaccinationTableModelList;//.createNewBabyModelList; + getCreateVaccinationTable() async { setState(ViewState.Busy); - await _creteVaccinationTableService.getCreateVaccinationTableOrders(babyInfo: babyInfo,informationModel: informationModel,isSendEmail: isSendEmail); - if (_creteVaccinationTableService.hasError) { - error = _creteVaccinationTableService.error; + await _creteVaccinationTableService.getCreateVaccinationTableOrders();//getCreateNewBabyOrders(); + + if ( _creteVaccinationTableService.hasError) { + error = _creteVaccinationTableService.error; setState(ViewState.Error); } else setState(ViewState.Idle); } + } diff --git a/lib/core/viewModels/dashboard_view_model.dart b/lib/core/viewModels/dashboard_view_model.dart index e98ca341..4cf22b23 100644 --- a/lib/core/viewModels/dashboard_view_model.dart +++ b/lib/core/viewModels/dashboard_view_model.dart @@ -1,20 +1,14 @@ import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; import 'package:diplomaticquarterapp/core/service/medical/vital_sign_service.dart'; import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart'; - import '../../locator.dart'; class DashboardViewModel extends BaseViewModel { VitalSignService _vitalSignService = locator(); - - String get weightKg => _vitalSignService.weightKg; - - String get heightCm => _vitalSignService.heightCm; + String get weightKg => _vitalSignService.weightKg; + String get heightCm => _vitalSignService.heightCm; String bloadType = ""; - // ToDoCountProviderModel toDoProvider = - // Provider.of(AppGlobal.context); - getPatientRadOrders() async { if (isLogin && _vitalSignService.weightKg.isEmpty) { setState(ViewState.Busy); @@ -23,21 +17,7 @@ class DashboardViewModel extends BaseViewModel { error = _vitalSignService.error; setState(ViewState.Error); } else - setState(ViewState.Idle); - // getToDoCount(); + setState(ViewState.Idle); } } - -// getToDoCount() { -// toDoProvider.setState(0); -// ClinicListService service = new ClinicListService(); -// service.getActiveAppointmentNo(AppGlobal.context).then((res) { -// print(res['AppointmentActiveNumber']); -// if (res['MessageStatus'] == 1) { -// toDoProvider.setState(res['AppointmentActiveNumber']); -// } else {} -// }).catchError((err) { -// print(err); -// }); -// } } diff --git a/lib/core/viewModels/medical/my_balance_view_model.dart b/lib/core/viewModels/medical/my_balance_view_model.dart index 62b7868b..af4e126e 100644 --- a/lib/core/viewModels/medical/my_balance_view_model.dart +++ b/lib/core/viewModels/medical/my_balance_view_model.dart @@ -112,10 +112,10 @@ class MyBalanceViewModel extends BaseViewModel { } } - Future getPatientInfoByPatientIDAndMobileNumber(AdvanceModel advanceModel) async { + Future getPatientInfoByPatientIDAndMobileNumber() async { setState(ViewState.Busy); await _myBalanceService - .getPatientInfoByPatientIDAndMobileNumber(advanceModel); + .getPatientInfoByPatientIDAndMobileNumber(); if (_myBalanceService.hasError) { error = _myBalanceService.error; setState(ViewState.ErrorLocal); @@ -154,7 +154,7 @@ class MyBalanceViewModel extends BaseViewModel { Future getFamilyFiles() async { setState(ViewState.Busy); - await _myBalanceService.getSharedRecordByStatus(); + await _myBalanceService.getFamilyFiles(); if (_myBalanceService.hasError) { error = _myBalanceService.error; setState(ViewState.ErrorLocal); diff --git a/lib/core/viewModels/medical/prescriptions_view_model.dart b/lib/core/viewModels/medical/prescriptions_view_model.dart index 1cd934e2..054dc4ef 100644 --- a/lib/core/viewModels/medical/prescriptions_view_model.dart +++ b/lib/core/viewModels/medical/prescriptions_view_model.dart @@ -103,9 +103,9 @@ class PrescriptionsViewModel extends BaseViewModel { notifyListeners(); } - getPrescriptionReport({Prescriptions prescriptions}) async { + getPrescriptionReport({int dischargeNo,int projectId,int clinicID,String setupID,int episodeID}) async { setState(ViewState.Busy); - await _prescriptionsService.getPrescriptionReport(prescriptions: prescriptions); + await _prescriptionsService.getPrescriptionReport(dischargeNo: dischargeNo,projectId: projectId,clinicID: clinicID,setupID: setupID,episodeID: episodeID); if (_prescriptionsService.hasError) { error = _prescriptionsService.error; setState(ViewState.ErrorLocal); diff --git a/lib/core/viewModels/packages_offers/PackagesOffersViewModel.dart b/lib/core/viewModels/packages_offers/PackagesOffersViewModel.dart new file mode 100644 index 00000000..21df52bc --- /dev/null +++ b/lib/core/viewModels/packages_offers/PackagesOffersViewModel.dart @@ -0,0 +1,19 @@ +import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/model/packages_offers/responses/OfferCategoriesResponseModel.dart'; +import 'package:diplomaticquarterapp/core/model/packages_offers/responses/OfferProductsResponseModel.dart'; +import 'package:diplomaticquarterapp/core/service/base_service.dart'; +import 'package:diplomaticquarterapp/core/service/client/base_app_client.dart'; +import 'package:diplomaticquarterapp/core/service/packages_offers/PackagesOffersServices.dart'; +import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:diplomaticquarterapp/locator.dart'; + +class OfferCategoriesViewModel extends BaseViewModel { + OffersAndPackagesServices service = locator(); + List get list => service.categoryList; +} + +class OfferProductsViewModel extends BaseViewModel { + OffersAndPackagesServices service = locator(); + List get list => service.productList; +} diff --git a/lib/core/viewModels/project_view_model.dart b/lib/core/viewModels/project_view_model.dart index 700ab2a4..e65a70f7 100644 --- a/lib/core/viewModels/project_view_model.dart +++ b/lib/core/viewModels/project_view_model.dart @@ -2,15 +2,19 @@ import 'dart:async'; import 'package:connectivity/connectivity.dart'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; -import 'package:diplomaticquarterapp/core/model/privilege/PrivilegeModel.dart'; -import 'package:diplomaticquarterapp/core/service/privilege_service.dart'; import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart'; import 'package:diplomaticquarterapp/locator.dart'; +import 'package:diplomaticquarterapp/uitl/PlatformBridge.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter_datetime_picker/flutter_datetime_picker.dart'; class ProjectViewModel extends BaseViewModel { + // Platform Bridge + PlatformBridge platformBridge() { + return PlatformBridge.shared(); + } + AppSharedPreferences sharedPref = AppSharedPreferences(); Locale _appLocale = Locale('ar'); String currentLanguage = 'ar'; @@ -30,21 +34,14 @@ class ProjectViewModel extends BaseViewModel { bool get isArabic => _isArabic; - - bool isLoginChild = false; - List privilegeRootUser = List(); - List privilegeChildUser = List(); - - List get privileges => - isLoginChild ? privilegeChildUser : privilegeChildUser; - + // BaseViewModel baseViewModel = locator() 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; @@ -61,8 +58,7 @@ class ProjectViewModel extends BaseViewModel { } void loadSharedPrefLanguage() async { - currentLanguage = - await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + currentLanguage = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); _appLocale = Locale(currentLanguage); _isArabic = currentLanguage == 'ar'; notifyListeners(); @@ -84,49 +80,6 @@ class ProjectViewModel extends BaseViewModel { notifyListeners(); } - setPrivilegeModelList( - {List privilege}) { - this.isLoginChild = isLoginChild; - privilegeRootUser = privilege; - - notifyListeners(); - } - - setPrivilege({privilegeList, bool isLoginChild = false}) { - List privilege = List(); - - privilegeList['List'][0]['ListPrivilege'].forEach((item) { - privilege.add(PrivilegeModel.fromJson(item)); - }); - - this.isLoginChild = isLoginChild; - if (isLoginChild) - privilegeChildUser = privilege; - else - privilegeRootUser = privilege; - - notifyListeners(); - } - - setIsLoginChild({@required bool isLoginChild}){ - this.isLoginChild = isLoginChild; - notifyListeners(); - } - - bool havePrivilege(int id) { - bool isHavePrivilege = false; - if(isLoginChild) - privilegeChildUser.forEach((element) { - if (element.iD == id) isHavePrivilege = element.privilege; - }); - else{ - privilegeRootUser.forEach((element) { - if (element.iD == id) isHavePrivilege = element.privilege; - }); - } - return isHavePrivilege; - } - @override void dispose() { if (subscription != null) subscription.cancel(); diff --git a/lib/core/viewModels/weather/weather_view_model.dart b/lib/core/viewModels/weather/weather_view_model.dart deleted file mode 100644 index bb201843..00000000 --- a/lib/core/viewModels/weather/weather_view_model.dart +++ /dev/null @@ -1,31 +0,0 @@ -import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; -import 'package:diplomaticquarterapp/core/model/er/projectavgerwaitingtime.dart'; -import 'package:diplomaticquarterapp/core/model/weahter/weather_model.dart'; - -import 'package:diplomaticquarterapp/core/service/er/er_service.dart'; -import 'package:diplomaticquarterapp/core/service/weather_service.dart'; -import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart'; -import 'package:diplomaticquarterapp/pages/BookAppointment/widgets/BranchView.dart'; - -import '../../../locator.dart'; - -class WeatherViewModel extends BaseViewModel { - WeatherService _weatherService = locator(); - List get weatherIndicatorData => - _weatherService.weatherIndicatorData; - getWeatherData() async { - setState(ViewState.Busy); - - // if (id != null && projectID != null) { - // await _erService.getProjectAvgERWaitingTimeOrders( - // id: id, projectID: projectID); - // } else { - await _weatherService.getWeatherData(); - // } - if (_weatherService.hasError) { - error = _weatherService.error; - setState(ViewState.Error); - } else - setState(ViewState.Idle); - } -} diff --git a/lib/generated/json/GeoZonesResponseModel_helper.dart b/lib/generated/json/GeoZonesResponseModel_helper.dart new file mode 100644 index 00000000..7cf3cc5f --- /dev/null +++ b/lib/generated/json/GeoZonesResponseModel_helper.dart @@ -0,0 +1,50 @@ +import 'package:diplomaticquarterapp/core/model/geofencing/responses/GeoZonesResponseModel.dart'; + +geoZonesResponseModelEntityFromJson(GeoZonesResponseModel data, Map json) { + if (json['GEOF_ID'] != null) { + data.geofId = json['GEOF_ID']?.toInt(); + } + if (json['Description'] != null) { + data.description = json['Description']?.toString(); + } + if (json['DescriptionN'] != null) { + data.descriptionN = json['DescriptionN']?.toString(); + } + if (json['Latitude'] != null) { + data.latitude = json['Latitude']?.toString(); + } + if (json['Longitude'] != null) { + data.longitude = json['Longitude']?.toString(); + } + if (json['Radius'] != null) { + data.radius = json['Radius']?.toInt(); + } + if (json['Type'] != null) { + data.type = json['Type']?.toInt(); + } + if (json['ProjectID'] != null) { + data.projectID = json['ProjectID']?.toInt(); + } + if (json['ImageURL'] != null) { + data.imageURL = json['ImageURL']?.toString(); + } + if (json['IsCity'] != null) { + data.isCity = json['IsCity']; + } + return data; +} + +Map geoZonesResponseModelEntityToJson(GeoZonesResponseModel entity) { + final Map data = new Map(); + data['GEOF_ID'] = entity.geofId; + data['Description'] = entity.description; + data['DescriptionN'] = entity.descriptionN; + data['Latitude'] = entity.latitude; + data['Longitude'] = entity.longitude; + data['Radius'] = entity.radius; + data['Type'] = entity.type; + data['ProjectID'] = entity.projectID; + data['ImageURL'] = entity.imageURL; + data['IsCity'] = entity.isCity; + return data; +} diff --git a/lib/generated/json/OfferCategoriesResponseModel_helper.dart b/lib/generated/json/OfferCategoriesResponseModel_helper.dart new file mode 100644 index 00000000..e5ebc914 --- /dev/null +++ b/lib/generated/json/OfferCategoriesResponseModel_helper.dart @@ -0,0 +1,172 @@ +import 'package:diplomaticquarterapp/core/model/packages_offers/responses/OfferCategoriesResponseModel.dart'; + +offerCategoriesResponseModelFromJson(OfferCategoriesResponseModel data, Map json) { + if (json['id'] != null) { + data.id = json['id']?.toString(); + } + if (json['name'] != null) { + data.name = json['name']?.toString(); + } + if (json['namen'] != null) { + data.namen = json['namen']?.toString(); + } + if (json['localized_names'] != null) { + data.localizedNames = new List(); + (json['localized_names'] as List).forEach((v) { + data.localizedNames.add(new OfferCategoriesResponseModelLocalizedName().fromJson(v)); + }); + } + if (json['description'] != null) { + data.description = json['description']; + } + if (json['category_template_id'] != null) { + data.categoryTemplateId = json['category_template_id']?.toInt(); + } + if (json['meta_keywords'] != null) { + data.metaKeywords = json['meta_keywords']?.toString(); + } + if (json['meta_description'] != null) { + data.metaDescription = json['meta_description']?.toString(); + } + if (json['meta_title'] != null) { + data.metaTitle = json['meta_title']?.toString(); + } + if (json['parent_category_id'] != null) { + data.parentCategoryId = json['parent_category_id']?.toInt(); + } + if (json['page_size'] != null) { + data.pageSize = json['page_size']?.toInt(); + } + if (json['page_size_options'] != null) { + data.pageSizeOptions = json['page_size_options']?.toString(); + } + if (json['price_ranges'] != null) { + data.priceRanges = json['price_ranges']; + } + if (json['show_on_home_page'] != null) { + data.showOnHomePage = json['show_on_home_page']; + } + if (json['include_in_top_menu'] != null) { + data.includeInTopMenu = json['include_in_top_menu']; + } + if (json['has_discounts_applied'] != null) { + data.hasDiscountsApplied = json['has_discounts_applied']; + } + if (json['published'] != null) { + data.published = json['published']; + } + if (json['deleted'] != null) { + data.deleted = json['deleted']; + } + if (json['display_order'] != null) { + data.displayOrder = json['display_order']?.toInt(); + } + if (json['created_on_utc'] != null) { + data.createdOnUtc = json['created_on_utc']?.toString(); + } + if (json['updated_on_utc'] != null) { + data.updatedOnUtc = json['updated_on_utc']?.toString(); + } + if (json['role_ids'] != null) { + data.roleIds = new List(); + data.roleIds.addAll(json['role_ids']); + } + if (json['discount_ids'] != null) { + data.discountIds = new List(); + data.discountIds.addAll(json['discount_ids']); + } + if (json['store_ids'] != null) { + data.storeIds = new List(); + data.storeIds.addAll(json['store_ids']); + } + if (json['image'] != null) { + data.image = new OfferCategoriesResponseModelImage().fromJson(json['image']); + } + if (json['se_name'] != null) { + data.seName = json['se_name']?.toString(); + } + if (json['is_leaf'] != null) { + data.isLeaf = json['is_leaf']; + } + return data; +} + +Map offerCategoriesResponseModelToJson(OfferCategoriesResponseModel entity) { + final Map data = new Map(); + data['id'] = entity.id; + data['name'] = entity.name; + data['namen'] = entity.namen; + if (entity.localizedNames != null) { + data['localized_names'] = entity.localizedNames.map((v) => v.toJson()).toList(); + } + data['description'] = entity.description; + data['category_template_id'] = entity.categoryTemplateId; + data['meta_keywords'] = entity.metaKeywords; + data['meta_description'] = entity.metaDescription; + data['meta_title'] = entity.metaTitle; + data['parent_category_id'] = entity.parentCategoryId; + data['page_size'] = entity.pageSize; + data['page_size_options'] = entity.pageSizeOptions; + data['price_ranges'] = entity.priceRanges; + data['show_on_home_page'] = entity.showOnHomePage; + data['include_in_top_menu'] = entity.includeInTopMenu; + data['has_discounts_applied'] = entity.hasDiscountsApplied; + data['published'] = entity.published; + data['deleted'] = entity.deleted; + data['display_order'] = entity.displayOrder; + data['created_on_utc'] = entity.createdOnUtc; + data['updated_on_utc'] = entity.updatedOnUtc; + if (entity.roleIds != null) { + data['role_ids'] = []; + } + if (entity.discountIds != null) { + data['discount_ids'] = []; + } + if (entity.storeIds != null) { + data['store_ids'] = []; + } + if (entity.image != null) { + data['image'] = entity.image.toJson(); + } + data['se_name'] = entity.seName; + data['is_leaf'] = entity.isLeaf; + return data; +} + +offerCategoriesResponseModelLocalizedNameFromJson(OfferCategoriesResponseModelLocalizedName data, Map json) { + if (json['language_id'] != null) { + data.languageId = json['language_id']?.toInt(); + } + if (json['localized_name'] != null) { + data.localizedName = json['localized_name']?.toString(); + } + return data; +} + +Map offerCategoriesResponseModelLocalizedNameToJson(OfferCategoriesResponseModelLocalizedName entity) { + final Map data = new Map(); + data['language_id'] = entity.languageId; + data['localized_name'] = entity.localizedName; + return data; +} + +offerCategoriesResponseModelImageFromJson(OfferCategoriesResponseModelImage data, Map json) { + if (json['src'] != null) { + data.src = json['src']?.toString(); + } + if (json['thumb'] != null) { + data.thumb = json['thumb']; + } + if (json['attachment'] != null) { + data.attachment = json['attachment']; + } + return data; +} + +Map offerCategoriesResponseModelImageToJson(OfferCategoriesResponseModelImage entity) { + final Map data = new Map(); + data['src'] = entity.src; + data['thumb'] = entity.thumb; + data['attachment'] = entity.attachment; + return data; +} diff --git a/lib/generated/json/OfferProductsResponseModel_helper.dart b/lib/generated/json/OfferProductsResponseModel_helper.dart new file mode 100644 index 00000000..dc0edeca --- /dev/null +++ b/lib/generated/json/OfferProductsResponseModel_helper.dart @@ -0,0 +1,569 @@ +import 'package:diplomaticquarterapp/core/model/packages_offers/responses/OfferProductsResponseModel.dart'; + +offerProductsResponseModelFromJson(OfferProductsResponseModel data, Map json) { + if (json['id'] != null) { + data.id = json['id']?.toString(); + } + if (json['visible_individually'] != null) { + data.visibleIndividually = json['visible_individually']; + } + if (json['name'] != null) { + data.name = json['name']?.toString(); + } + if (json['namen'] != null) { + data.namen = json['namen']?.toString(); + } + if (json['localized_names'] != null) { + data.localizedNames = new List(); + (json['localized_names'] as List).forEach((v) { + data.localizedNames.add(new OfferProductsResponseModelLocalizedName().fromJson(v)); + }); + } + if (json['short_description'] != null) { + data.shortDescription = json['short_description']?.toString(); + } + if (json['short_descriptionn'] != null) { + data.shortDescriptionn = json['short_descriptionn']?.toString(); + } + if (json['full_description'] != null) { + data.fullDescription = json['full_description']?.toString(); + } + if (json['full_descriptionn'] != null) { + data.fullDescriptionn = json['full_descriptionn']?.toString(); + } + if (json['markas_new'] != null) { + data.markasNew = json['markas_new']; + } + if (json['show_on_home_page'] != null) { + data.showOnHomePage = json['show_on_home_page']; + } + if (json['meta_keywords'] != null) { + data.metaKeywords = json['meta_keywords']; + } + if (json['meta_description'] != null) { + data.metaDescription = json['meta_description']; + } + if (json['meta_title'] != null) { + data.metaTitle = json['meta_title']; + } + if (json['allow_customer_reviews'] != null) { + data.allowCustomerReviews = json['allow_customer_reviews']; + } + if (json['approved_rating_sum'] != null) { + data.approvedRatingSum = json['approved_rating_sum']?.toInt(); + } + if (json['not_approved_rating_sum'] != null) { + data.notApprovedRatingSum = json['not_approved_rating_sum']?.toInt(); + } + if (json['approved_total_reviews'] != null) { + data.approvedTotalReviews = json['approved_total_reviews']?.toInt(); + } + if (json['not_approved_total_reviews'] != null) { + data.notApprovedTotalReviews = json['not_approved_total_reviews']?.toInt(); + } + if (json['sku'] != null) { + data.sku = json['sku']?.toString(); + } + if (json['is_rx'] != null) { + data.isRx = json['is_rx']; + } + if (json['prescription_required'] != null) { + data.prescriptionRequired = json['prescription_required']; + } + if (json['rx_message'] != null) { + data.rxMessage = json['rx_message']; + } + if (json['rx_messagen'] != null) { + data.rxMessagen = json['rx_messagen']; + } + if (json['manufacturer_part_number'] != null) { + data.manufacturerPartNumber = json['manufacturer_part_number']; + } + if (json['gtin'] != null) { + data.gtin = json['gtin']; + } + if (json['is_gift_card'] != null) { + data.isGiftCard = json['is_gift_card']; + } + if (json['require_other_products'] != null) { + data.requireOtherProducts = json['require_other_products']; + } + if (json['automatically_add_required_products'] != null) { + data.automaticallyAddRequiredProducts = json['automatically_add_required_products']; + } + if (json['is_download'] != null) { + data.isDownload = json['is_download']; + } + if (json['unlimited_downloads'] != null) { + data.unlimitedDownloads = json['unlimited_downloads']; + } + if (json['max_number_of_downloads'] != null) { + data.maxNumberOfDownloads = json['max_number_of_downloads']?.toInt(); + } + if (json['download_expiration_days'] != null) { + data.downloadExpirationDays = json['download_expiration_days']; + } + if (json['has_sample_download'] != null) { + data.hasSampleDownload = json['has_sample_download']; + } + if (json['has_user_agreement'] != null) { + data.hasUserAgreement = json['has_user_agreement']; + } + if (json['is_recurring'] != null) { + data.isRecurring = json['is_recurring']; + } + if (json['recurring_cycle_length'] != null) { + data.recurringCycleLength = json['recurring_cycle_length']?.toInt(); + } + if (json['recurring_total_cycles'] != null) { + data.recurringTotalCycles = json['recurring_total_cycles']?.toInt(); + } + if (json['is_rental'] != null) { + data.isRental = json['is_rental']; + } + if (json['rental_price_length'] != null) { + data.rentalPriceLength = json['rental_price_length']?.toInt(); + } + if (json['is_ship_enabled'] != null) { + data.isShipEnabled = json['is_ship_enabled']; + } + if (json['is_free_shipping'] != null) { + data.isFreeShipping = json['is_free_shipping']; + } + if (json['ship_separately'] != null) { + data.shipSeparately = json['ship_separately']; + } + if (json['additional_shipping_charge'] != null) { + data.additionalShippingCharge = json['additional_shipping_charge']?.toDouble(); + } + if (json['is_tax_exempt'] != null) { + data.isTaxExempt = json['is_tax_exempt']; + } + if (json['is_telecommunications_or_broadcasting_or_electronic_services'] != null) { + data.isTelecommunicationsOrBroadcastingOrElectronicServices = json['is_telecommunications_or_broadcasting_or_electronic_services']; + } + if (json['use_multiple_warehouses'] != null) { + data.useMultipleWarehouses = json['use_multiple_warehouses']; + } + if (json['manage_inventory_method_id'] != null) { + data.manageInventoryMethodId = json['manage_inventory_method_id']?.toInt(); + } + if (json['stock_quantity'] != null) { + data.stockQuantity = json['stock_quantity']?.toInt(); + } + if (json['stock_availability'] != null) { + data.stockAvailability = json['stock_availability']?.toString(); + } + if (json['stock_availabilityn'] != null) { + data.stockAvailabilityn = json['stock_availabilityn']?.toString(); + } + if (json['display_stock_availability'] != null) { + data.displayStockAvailability = json['display_stock_availability']; + } + if (json['display_stock_quantity'] != null) { + data.displayStockQuantity = json['display_stock_quantity']; + } + if (json['min_stock_quantity'] != null) { + data.minStockQuantity = json['min_stock_quantity']?.toInt(); + } + if (json['notify_admin_for_quantity_below'] != null) { + data.notifyAdminForQuantityBelow = json['notify_admin_for_quantity_below']?.toInt(); + } + if (json['allow_back_in_stock_subscriptions'] != null) { + data.allowBackInStockSubscriptions = json['allow_back_in_stock_subscriptions']; + } + if (json['order_minimum_quantity'] != null) { + data.orderMinimumQuantity = json['order_minimum_quantity']?.toInt(); + } + if (json['order_maximum_quantity'] != null) { + data.orderMaximumQuantity = json['order_maximum_quantity']?.toInt(); + } + if (json['allowed_quantities'] != null) { + data.allowedQuantities = json['allowed_quantities']; + } + if (json['allow_adding_only_existing_attribute_combinations'] != null) { + data.allowAddingOnlyExistingAttributeCombinations = json['allow_adding_only_existing_attribute_combinations']; + } + if (json['disable_buy_button'] != null) { + data.disableBuyButton = json['disable_buy_button']; + } + if (json['disable_wishlist_button'] != null) { + data.disableWishlistButton = json['disable_wishlist_button']; + } + if (json['available_for_pre_order'] != null) { + data.availableForPreOrder = json['available_for_pre_order']; + } + if (json['pre_order_availability_start_date_time_utc'] != null) { + data.preOrderAvailabilityStartDateTimeUtc = json['pre_order_availability_start_date_time_utc']; + } + if (json['call_for_price'] != null) { + data.callForPrice = json['call_for_price']; + } + if (json['price'] != null) { + data.price = json['price']?.toDouble(); + } + if (json['old_price'] != null) { + data.oldPrice = json['old_price']?.toDouble(); + } + if (json['product_cost'] != null) { + data.productCost = json['product_cost']?.toDouble(); + } + if (json['special_price'] != null) { + data.specialPrice = json['special_price']; + } + if (json['special_price_start_date_time_utc'] != null) { + data.specialPriceStartDateTimeUtc = json['special_price_start_date_time_utc']; + } + if (json['special_price_end_date_time_utc'] != null) { + data.specialPriceEndDateTimeUtc = json['special_price_end_date_time_utc']; + } + if (json['customer_enters_price'] != null) { + data.customerEntersPrice = json['customer_enters_price']; + } + if (json['minimum_customer_entered_price'] != null) { + data.minimumCustomerEnteredPrice = json['minimum_customer_entered_price']?.toDouble(); + } + if (json['maximum_customer_entered_price'] != null) { + data.maximumCustomerEnteredPrice = json['maximum_customer_entered_price']?.toDouble(); + } + if (json['baseprice_enabled'] != null) { + data.basepriceEnabled = json['baseprice_enabled']; + } + if (json['baseprice_amount'] != null) { + data.basepriceAmount = json['baseprice_amount']?.toDouble(); + } + if (json['baseprice_base_amount'] != null) { + data.basepriceBaseAmount = json['baseprice_base_amount']?.toDouble(); + } + if (json['has_tier_prices'] != null) { + data.hasTierPrices = json['has_tier_prices']; + } + if (json['has_discounts_applied'] != null) { + data.hasDiscountsApplied = json['has_discounts_applied']; + } + if (json['discount_name'] != null) { + data.discountName = json['discount_name']; + } + if (json['discount_namen'] != null) { + data.discountNamen = json['discount_namen']; + } + if (json['discount_description'] != null) { + data.discountDescription = json['discount_description']; + } + if (json['discount_Descriptionn'] != null) { + data.discountDescriptionn = json['discount_Descriptionn']; + } + if (json['discount_percentage'] != null) { + data.discountPercentage = json['discount_percentage']; + } + if (json['currency'] != null) { + data.currency = json['currency']?.toString(); + } + if (json['currencyn'] != null) { + data.currencyn = json['currencyn']?.toString(); + } + if (json['weight'] != null) { + data.weight = json['weight']?.toDouble(); + } + if (json['length'] != null) { + data.length = json['length']?.toDouble(); + } + if (json['width'] != null) { + data.width = json['width']?.toDouble(); + } + if (json['height'] != null) { + data.height = json['height']?.toDouble(); + } + if (json['available_start_date_time_utc'] != null) { + data.availableStartDateTimeUtc = json['available_start_date_time_utc']; + } + if (json['available_end_date_time_utc'] != null) { + data.availableEndDateTimeUtc = json['available_end_date_time_utc']; + } + if (json['display_order'] != null) { + data.displayOrder = json['display_order']?.toInt(); + } + if (json['published'] != null) { + data.published = json['published']; + } + if (json['deleted'] != null) { + data.deleted = json['deleted']; + } + if (json['created_on_utc'] != null) { + data.createdOnUtc = json['created_on_utc']?.toString(); + } + if (json['updated_on_utc'] != null) { + data.updatedOnUtc = json['updated_on_utc']?.toString(); + } + if (json['product_type'] != null) { + data.productType = json['product_type']?.toString(); + } + if (json['parent_grouped_product_id'] != null) { + data.parentGroupedProductId = json['parent_grouped_product_id']?.toInt(); + } + if (json['role_ids'] != null) { + data.roleIds = new List(); + data.roleIds.addAll(json['role_ids']); + } + if (json['discount_ids'] != null) { + data.discountIds = new List(); + data.discountIds.addAll(json['discount_ids']); + } + if (json['store_ids'] != null) { + data.storeIds = new List(); + data.storeIds.addAll(json['store_ids']); + } + if (json['manufacturer_ids'] != null) { + data.manufacturerIds = json['manufacturer_ids']?.map((v) => v?.toInt())?.toList()?.cast(); + } + if (json['reviews'] != null) { + data.reviews = new List(); + data.reviews.addAll(json['reviews']); + } + if (json['images'] != null) { + data.images = new List(); + (json['images'] as List).forEach((v) { + data.images.add(new OfferProductsResponseModelImage().fromJson(v)); + }); + } + if (json['attributes'] != null) { + data.attributes = new List(); + data.attributes.addAll(json['attributes']); + } + if (json['specifications'] != null) { + data.specifications = new List(); + (json['specifications'] as List).forEach((v) { + data.specifications.add(new OfferProductsResponseModelSpecification().fromJson(v)); + }); + } + if (json['associated_product_ids'] != null) { + data.associatedProductIds = new List(); + data.associatedProductIds.addAll(json['associated_product_ids']); + } + if (json['tags'] != null) { + data.tags = new List(); + data.tags.addAll(json['tags']); + } + if (json['vendor_id'] != null) { + data.vendorId = json['vendor_id']?.toInt(); + } + if (json['se_name'] != null) { + data.seName = json['se_name']?.toString(); + } + return data; +} + +Map offerProductsResponseModelToJson(OfferProductsResponseModel entity) { + final Map data = new Map(); + data['id'] = entity.id; + data['visible_individually'] = entity.visibleIndividually; + data['name'] = entity.name; + data['namen'] = entity.namen; + if (entity.localizedNames != null) { + data['localized_names'] = entity.localizedNames.map((v) => v.toJson()).toList(); + } + data['short_description'] = entity.shortDescription; + data['short_descriptionn'] = entity.shortDescriptionn; + data['full_description'] = entity.fullDescription; + data['full_descriptionn'] = entity.fullDescriptionn; + data['markas_new'] = entity.markasNew; + data['show_on_home_page'] = entity.showOnHomePage; + data['meta_keywords'] = entity.metaKeywords; + data['meta_description'] = entity.metaDescription; + data['meta_title'] = entity.metaTitle; + data['allow_customer_reviews'] = entity.allowCustomerReviews; + data['approved_rating_sum'] = entity.approvedRatingSum; + data['not_approved_rating_sum'] = entity.notApprovedRatingSum; + data['approved_total_reviews'] = entity.approvedTotalReviews; + data['not_approved_total_reviews'] = entity.notApprovedTotalReviews; + data['sku'] = entity.sku; + data['is_rx'] = entity.isRx; + data['prescription_required'] = entity.prescriptionRequired; + data['rx_message'] = entity.rxMessage; + data['rx_messagen'] = entity.rxMessagen; + data['manufacturer_part_number'] = entity.manufacturerPartNumber; + data['gtin'] = entity.gtin; + data['is_gift_card'] = entity.isGiftCard; + data['require_other_products'] = entity.requireOtherProducts; + data['automatically_add_required_products'] = entity.automaticallyAddRequiredProducts; + data['is_download'] = entity.isDownload; + data['unlimited_downloads'] = entity.unlimitedDownloads; + data['max_number_of_downloads'] = entity.maxNumberOfDownloads; + data['download_expiration_days'] = entity.downloadExpirationDays; + data['has_sample_download'] = entity.hasSampleDownload; + data['has_user_agreement'] = entity.hasUserAgreement; + data['is_recurring'] = entity.isRecurring; + data['recurring_cycle_length'] = entity.recurringCycleLength; + data['recurring_total_cycles'] = entity.recurringTotalCycles; + data['is_rental'] = entity.isRental; + data['rental_price_length'] = entity.rentalPriceLength; + data['is_ship_enabled'] = entity.isShipEnabled; + data['is_free_shipping'] = entity.isFreeShipping; + data['ship_separately'] = entity.shipSeparately; + data['additional_shipping_charge'] = entity.additionalShippingCharge; + data['is_tax_exempt'] = entity.isTaxExempt; + data['is_telecommunications_or_broadcasting_or_electronic_services'] = entity.isTelecommunicationsOrBroadcastingOrElectronicServices; + data['use_multiple_warehouses'] = entity.useMultipleWarehouses; + data['manage_inventory_method_id'] = entity.manageInventoryMethodId; + data['stock_quantity'] = entity.stockQuantity; + data['stock_availability'] = entity.stockAvailability; + data['stock_availabilityn'] = entity.stockAvailabilityn; + data['display_stock_availability'] = entity.displayStockAvailability; + data['display_stock_quantity'] = entity.displayStockQuantity; + data['min_stock_quantity'] = entity.minStockQuantity; + data['notify_admin_for_quantity_below'] = entity.notifyAdminForQuantityBelow; + data['allow_back_in_stock_subscriptions'] = entity.allowBackInStockSubscriptions; + data['order_minimum_quantity'] = entity.orderMinimumQuantity; + data['order_maximum_quantity'] = entity.orderMaximumQuantity; + data['allowed_quantities'] = entity.allowedQuantities; + data['allow_adding_only_existing_attribute_combinations'] = entity.allowAddingOnlyExistingAttributeCombinations; + data['disable_buy_button'] = entity.disableBuyButton; + data['disable_wishlist_button'] = entity.disableWishlistButton; + data['available_for_pre_order'] = entity.availableForPreOrder; + data['pre_order_availability_start_date_time_utc'] = entity.preOrderAvailabilityStartDateTimeUtc; + data['call_for_price'] = entity.callForPrice; + data['price'] = entity.price; + data['old_price'] = entity.oldPrice; + data['product_cost'] = entity.productCost; + data['special_price'] = entity.specialPrice; + data['special_price_start_date_time_utc'] = entity.specialPriceStartDateTimeUtc; + data['special_price_end_date_time_utc'] = entity.specialPriceEndDateTimeUtc; + data['customer_enters_price'] = entity.customerEntersPrice; + data['minimum_customer_entered_price'] = entity.minimumCustomerEnteredPrice; + data['maximum_customer_entered_price'] = entity.maximumCustomerEnteredPrice; + data['baseprice_enabled'] = entity.basepriceEnabled; + data['baseprice_amount'] = entity.basepriceAmount; + data['baseprice_base_amount'] = entity.basepriceBaseAmount; + data['has_tier_prices'] = entity.hasTierPrices; + data['has_discounts_applied'] = entity.hasDiscountsApplied; + data['discount_name'] = entity.discountName; + data['discount_namen'] = entity.discountNamen; + data['discount_description'] = entity.discountDescription; + data['discount_Descriptionn'] = entity.discountDescriptionn; + data['discount_percentage'] = entity.discountPercentage; + data['currency'] = entity.currency; + data['currencyn'] = entity.currencyn; + data['weight'] = entity.weight; + data['length'] = entity.length; + data['width'] = entity.width; + data['height'] = entity.height; + data['available_start_date_time_utc'] = entity.availableStartDateTimeUtc; + data['available_end_date_time_utc'] = entity.availableEndDateTimeUtc; + data['display_order'] = entity.displayOrder; + data['published'] = entity.published; + data['deleted'] = entity.deleted; + data['created_on_utc'] = entity.createdOnUtc; + data['updated_on_utc'] = entity.updatedOnUtc; + data['product_type'] = entity.productType; + data['parent_grouped_product_id'] = entity.parentGroupedProductId; + if (entity.roleIds != null) { + data['role_ids'] = []; + } + if (entity.discountIds != null) { + data['discount_ids'] = []; + } + if (entity.storeIds != null) { + data['store_ids'] = []; + } + data['manufacturer_ids'] = entity.manufacturerIds; + if (entity.reviews != null) { + data['reviews'] = []; + } + if (entity.images != null) { + data['images'] = entity.images.map((v) => v.toJson()).toList(); + } + if (entity.attributes != null) { + data['attributes'] = []; + } + if (entity.specifications != null) { + data['specifications'] = entity.specifications.map((v) => v.toJson()).toList(); + } + if (entity.associatedProductIds != null) { + data['associated_product_ids'] = []; + } + if (entity.tags != null) { + data['tags'] = []; + } + data['vendor_id'] = entity.vendorId; + data['se_name'] = entity.seName; + return data; +} + +offerProductsResponseModelLocalizedNameFromJson(OfferProductsResponseModelLocalizedName data, Map json) { + if (json['language_id'] != null) { + data.languageId = json['language_id']?.toInt(); + } + if (json['localized_name'] != null) { + data.localizedName = json['localized_name']?.toString(); + } + return data; +} + +Map offerProductsResponseModelLocalizedNameToJson(OfferProductsResponseModelLocalizedName entity) { + final Map data = new Map(); + data['language_id'] = entity.languageId; + data['localized_name'] = entity.localizedName; + return data; +} + +offerProductsResponseModelImageFromJson(OfferProductsResponseModelImage data, Map json) { + if (json['id'] != null) { + data.id = json['id']?.toInt(); + } + if (json['position'] != null) { + data.position = json['position']?.toInt(); + } + if (json['src'] != null) { + data.src = json['src']?.toString(); + } + if (json['thumb'] != null) { + data.thumb = json['thumb']?.toString(); + } + if (json['attachment'] != null) { + data.attachment = json['attachment']?.toString(); + } + return data; +} + +Map offerProductsResponseModelImageToJson(OfferProductsResponseModelImage entity) { + final Map data = new Map(); + data['id'] = entity.id; + data['position'] = entity.position; + data['src'] = entity.src; + data['thumb'] = entity.thumb; + data['attachment'] = entity.attachment; + return data; +} + +offerProductsResponseModelSpecificationFromJson(OfferProductsResponseModelSpecification data, Map json) { + if (json['id'] != null) { + data.id = json['id']?.toInt(); + } + if (json['display_order'] != null) { + data.displayOrder = json['display_order']?.toInt(); + } + if (json['default_value'] != null) { + data.defaultValue = json['default_value']?.toString(); + } + if (json['default_valuen'] != null) { + data.defaultValuen = json['default_valuen']?.toString(); + } + if (json['name'] != null) { + data.name = json['name']?.toString(); + } + if (json['nameN'] != null) { + data.nameN = json['nameN']?.toString(); + } + return data; +} + +Map offerProductsResponseModelSpecificationToJson(OfferProductsResponseModelSpecification entity) { + final Map data = new Map(); + data['id'] = entity.id; + data['display_order'] = entity.displayOrder; + data['default_value'] = entity.defaultValue; + data['default_valuen'] = entity.defaultValuen; + data['name'] = entity.name; + data['nameN'] = entity.nameN; + return data; +} diff --git a/lib/generated/json/base/json_convert_content.dart b/lib/generated/json/base/json_convert_content.dart new file mode 100644 index 00000000..9fab946e --- /dev/null +++ b/lib/generated/json/base/json_convert_content.dart @@ -0,0 +1,128 @@ +// ignore_for_file: non_constant_identifier_names +// ignore_for_file: camel_case_types +// ignore_for_file: prefer_single_quotes + +// This file is automatically generated. DO NOT EDIT, all your changes would be lost. +import 'package:diplomaticquarterapp/core/model/packages_offers/responses/OfferCategoriesResponseModel.dart'; +import 'package:diplomaticquarterapp/generated/json/OfferCategoriesResponseModel_helper.dart'; +import 'package:diplomaticquarterapp/core/model/geofencing/responses/LogGeoZoneResponseModel.dart'; +import 'package:diplomaticquarterapp/generated/json/log_geo_zone_response_model_entity_helper.dart'; +import 'package:diplomaticquarterapp/core/model/packages_offers/responses/OfferProductsResponseModel.dart'; +import 'package:diplomaticquarterapp/generated/json/OfferProductsResponseModel_helper.dart'; +import 'package:diplomaticquarterapp/core/model/geofencing/responses/GeoZonesResponseModel.dart'; +import 'package:diplomaticquarterapp/generated/json/GeoZonesResponseModel_helper.dart'; + +class JsonConvert { + T fromJson(Map json) { + return _getFromJson(runtimeType, this, json); + } + + Map toJson() { + return _getToJson(runtimeType, this); + } + + static _getFromJson(Type type, data, json) { + switch (type) { + case OfferCategoriesResponseModel: + return offerCategoriesResponseModelFromJson(data as OfferCategoriesResponseModel, json) as T; + case OfferCategoriesResponseModelLocalizedName: + return offerCategoriesResponseModelLocalizedNameFromJson(data as OfferCategoriesResponseModelLocalizedName, json) as T; + case OfferCategoriesResponseModelImage: + return offerCategoriesResponseModelImageFromJson(data as OfferCategoriesResponseModelImage, json) as T; + case LogGeoZoneResponseModel: + return logGeoZoneResponseModelEntityFromJson(data as LogGeoZoneResponseModel, json) as T; + case OfferProductsResponseModel: + return offerProductsResponseModelFromJson(data as OfferProductsResponseModel, json) as T; + case OfferProductsResponseModelLocalizedName: + return offerProductsResponseModelLocalizedNameFromJson(data as OfferProductsResponseModelLocalizedName, json) as T; + case OfferProductsResponseModelImage: + return offerProductsResponseModelImageFromJson(data as OfferProductsResponseModelImage, json) as T; + case OfferProductsResponseModelSpecification: + return offerProductsResponseModelSpecificationFromJson(data as OfferProductsResponseModelSpecification, json) as T; + case GeoZonesResponseModel: + return geoZonesResponseModelEntityFromJson(data as GeoZonesResponseModel, json) as T; + } + return data as T; + } + + static _getToJson(Type type, data) { + switch (type) { + case OfferCategoriesResponseModel: + return offerCategoriesResponseModelToJson(data as OfferCategoriesResponseModel); + case OfferCategoriesResponseModelLocalizedName: + return offerCategoriesResponseModelLocalizedNameToJson(data as OfferCategoriesResponseModelLocalizedName); + case OfferCategoriesResponseModelImage: + return offerCategoriesResponseModelImageToJson(data as OfferCategoriesResponseModelImage); + case LogGeoZoneResponseModel: + return logGeoZoneResponseModelEntityToJson(data as LogGeoZoneResponseModel); + case OfferProductsResponseModel: + return offerProductsResponseModelToJson(data as OfferProductsResponseModel); + case OfferProductsResponseModelLocalizedName: + return offerProductsResponseModelLocalizedNameToJson(data as OfferProductsResponseModelLocalizedName); + case OfferProductsResponseModelImage: + return offerProductsResponseModelImageToJson(data as OfferProductsResponseModelImage); + case OfferProductsResponseModelSpecification: + return offerProductsResponseModelSpecificationToJson(data as OfferProductsResponseModelSpecification); + case GeoZonesResponseModel: + return geoZonesResponseModelEntityToJson(data as GeoZonesResponseModel); + } + return data as T; + } + + //Go back to a single instance by type + static _fromJsonSingle(json) { + String type = M.toString(); + if (type == (OfferCategoriesResponseModel).toString()) { + return OfferCategoriesResponseModel().fromJson(json); + } else if (type == (OfferCategoriesResponseModelLocalizedName).toString()) { + return OfferCategoriesResponseModelLocalizedName().fromJson(json); + } else if (type == (OfferCategoriesResponseModelImage).toString()) { + return OfferCategoriesResponseModelImage().fromJson(json); + } else if (type == (LogGeoZoneResponseModel).toString()) { + return LogGeoZoneResponseModel().fromJson(json); + } else if (type == (OfferProductsResponseModel).toString()) { + return OfferProductsResponseModel().fromJson(json); + } else if (type == (OfferProductsResponseModelLocalizedName).toString()) { + return OfferProductsResponseModelLocalizedName().fromJson(json); + } else if (type == (OfferProductsResponseModelImage).toString()) { + return OfferProductsResponseModelImage().fromJson(json); + } else if (type == (OfferProductsResponseModelSpecification).toString()) { + return OfferProductsResponseModelSpecification().fromJson(json); + } else if (type == (GeoZonesResponseModel).toString()) { + return GeoZonesResponseModel().fromJson(json); + } + return null; + } + + //list is returned by type + static M _getListChildType(List data) { + if (List() is M) { + return data.map((e) => OfferCategoriesResponseModel().fromJson(e)).toList() as M; + } else if (List() is M) { + return data.map((e) => OfferCategoriesResponseModelLocalizedName().fromJson(e)).toList() as M; + } else if (List() is M) { + return data.map((e) => OfferCategoriesResponseModelImage().fromJson(e)).toList() as M; + } else if (List() is M) { + return data.map((e) => LogGeoZoneResponseModel().fromJson(e)).toList() as M; + } else if (List() is M) { + return data.map((e) => OfferProductsResponseModel().fromJson(e)).toList() as M; + } else if (List() is M) { + return data.map((e) => OfferProductsResponseModelLocalizedName().fromJson(e)).toList() as M; + } else if (List() is M) { + return data.map((e) => OfferProductsResponseModelImage().fromJson(e)).toList() as M; + } else if (List() is M) { + return data.map((e) => OfferProductsResponseModelSpecification().fromJson(e)).toList() as M; + } else if (List() is M) { + return data.map((e) => GeoZonesResponseModel().fromJson(e)).toList() as M; + } + return null; + } + + static M fromJsonAsT(json) { + if (json is List) { + return _getListChildType(json); + } else { + return _fromJsonSingle(json) as M; + } + } +} diff --git a/lib/generated/json/base/json_field.dart b/lib/generated/json/base/json_field.dart new file mode 100644 index 00000000..bc92972b --- /dev/null +++ b/lib/generated/json/base/json_field.dart @@ -0,0 +1,21 @@ +// ignore_for_file: non_constant_identifier_names +// ignore_for_file: camel_case_types +// ignore_for_file: prefer_single_quotes + +// This file is automatically generated. DO NOT EDIT, all your changes would be lost. + +class JSONField { + //Specify the parse field name + final String name; + + //Specify the time resolution format + final String format; + + //Whether to participate in toJson + final bool serialize; + + //Whether to participate in fromMap + final bool deserialize; + + const JSONField({this.name, this.format, this.serialize, this.deserialize}); +} diff --git a/lib/generated/json/log_geo_zone_response_model_entity_helper.dart b/lib/generated/json/log_geo_zone_response_model_entity_helper.dart new file mode 100644 index 00000000..28b8c996 --- /dev/null +++ b/lib/generated/json/log_geo_zone_response_model_entity_helper.dart @@ -0,0 +1,54 @@ +import 'package:diplomaticquarterapp/core/model/geofencing/responses/LogGeoZoneResponseModel.dart'; + +logGeoZoneResponseModelEntityFromJson(LogGeoZoneResponseModel data, Map json) { + if (json['LanguageID'] != null) { + data.languageID = json['LanguageID']?.toInt(); + } + if (json['ErrorCode'] != null) { + data.errorCode = json['ErrorCode']; + } + if (json['ErrorEndUserMessage'] != null) { + data.errorEndUserMessage = json['ErrorEndUserMessage']?.toString(); + } + if (json['ErrorEndUserMessageN'] != null) { + data.errorEndUserMessageN = json['ErrorEndUserMessageN']; + } + if (json['ErrorMessage'] != null) { + data.errorMessage = json['ErrorMessage']; + } + if (json['ErrorType'] != null) { + data.errorType = json['ErrorType']?.toInt(); + } + if (json['IsAuthenticated'] != null) { + data.isAuthenticated = json['IsAuthenticated']; + } + if (json['SuccessMsg'] != null) { + data.successMsg = json['SuccessMsg']; + } + if (json['SuccessMsgN'] != null) { + data.successMsgN = json['SuccessMsgN']; + } + if (json['statusCode'] != null) { + data.statusCode = json['statusCode']?.toInt(); + } + if (json['MessageStatus'] != null) { + data.messageStatus = json['MessageStatus']?.toInt(); + } + return data; +} + +Map logGeoZoneResponseModelEntityToJson(LogGeoZoneResponseModel entity) { + final Map data = new Map(); + data['LanguageID'] = entity.languageID; + data['ErrorCode'] = entity.errorCode; + data['ErrorEndUserMessage'] = entity.errorEndUserMessage; + data['ErrorEndUserMessageN'] = entity.errorEndUserMessageN; + data['ErrorMessage'] = entity.errorMessage; + data['ErrorType'] = entity.errorType; + data['IsAuthenticated'] = entity.isAuthenticated; + data['SuccessMsg'] = entity.successMsg; + data['SuccessMsgN'] = entity.successMsgN; + data['statusCode'] = entity.statusCode; + data['MessageStatus'] = entity.messageStatus; + return data; +} diff --git a/lib/locator.dart b/lib/locator.dart index 812bff98..f00cc1f6 100644 --- a/lib/locator.dart +++ b/lib/locator.dart @@ -1,16 +1,14 @@ import 'package:diplomaticquarterapp/core/service/AlHabibMedicalService/H2O_service.dart'; import 'package:diplomaticquarterapp/core/service/qr_service.dart'; -import 'package:diplomaticquarterapp/core/service/weather_service.dart'; import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/H2O_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/child_vaccines/user_information_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/home_health_care_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/dashboard_view_model.dart'; -import 'package:diplomaticquarterapp/core/viewModels/weather/weather_view_model.dart'; import 'package:diplomaticquarterapp/uitl/navigation_service.dart'; +import 'package:flutter_local_notifications/flutter_local_notifications.dart'; import 'package:get_it/get_it.dart'; import 'core/service/AlHabibMedicalService/cmc_service.dart'; -import 'core/service/AlHabibMedicalService/customer_addresses_service.dart'; import 'core/service/AlHabibMedicalService/e_referral_service.dart'; import 'core/service/AlHabibMedicalService/home_health_care_service.dart'; import 'core/service/AuthenticatedUserObject.dart'; @@ -28,6 +26,7 @@ import 'core/service/dashboard_service.dart'; import 'core/service/er/am_service.dart'; import 'core/service/er/er_service.dart'; import 'core/service/feedback/feedback_service.dart'; +import 'core/service/geofencing/GeofencingServices.dart'; import 'core/service/hospital_service.dart'; import 'core/service/medical/ActiveMedicationsService.dart'; import 'core/service/medical/AllergiesService.dart'; @@ -45,9 +44,9 @@ import 'core/service/medical/prescriptions_service.dart'; 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/packages_offers/PackagesOffersServices.dart'; import 'core/service/parmacyModule/order-preview-service.dart'; import 'core/service/notifications_service.dart'; -import 'core/service/privilege_service.dart'; import 'core/viewModels/AlHabibMedicalService/cmc_view_model.dart'; import 'core/service/parmacyModule/parmacy_module_service.dart'; @@ -83,6 +82,7 @@ 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/packages_offers/PackagesOffersViewModel.dart'; import 'core/viewModels/pharmacies_view_model.dart'; import 'core/service/pharmacies_service.dart'; import 'core/service/insurance_service.dart'; @@ -97,6 +97,9 @@ GetIt locator = GetIt.instance; ///di void setupLocator() { + /// Others + locator.registerLazySingleton(() => FlutterLocalNotificationsPlugin()); + /// Services locator.registerLazySingleton(() => AuthenticatedUserObject()); locator.registerLazySingleton(() => HospitalService()); @@ -139,14 +142,12 @@ void setupLocator() { locator.registerLazySingleton(() => UserInformationService()); locator.registerLazySingleton(() => CreteNewBabyService()); locator.registerLazySingleton(() => DeleteBabyService()); + locator.registerLazySingleton(() => VaccinationTableService()); locator.registerLazySingleton(() => NotificationService()); - locator.registerLazySingleton(() => WeatherService()); + locator.registerLazySingleton(() => PharmacyModuleService()); locator.registerLazySingleton(() => OrderPreviewService()); - locator.registerLazySingleton(() => CustomerAddressesService()); - locator.registerLazySingleton(() => PrivilegeService()); - /// View Model locator.registerFactory(() => HospitalViewModel()); @@ -166,7 +167,6 @@ void setupLocator() { locator.registerFactory(() => QrViewModel()); locator.registerFactory(() => ReportsMonthlyViewModel()); locator.registerFactory(() => NearHospitalViewModel()); - locator.registerFactory(() => WeatherViewModel()); locator.registerFactory(() => AmRequestViewModel()); locator.registerFactory(() => PatientSickLeaveViewMode()); locator.registerFactory(() => MyBalanceViewModel()); @@ -192,9 +192,16 @@ void setupLocator() { locator.registerFactory(() => CMCViewModel()); locator.registerFactory(() => NotificationViewModel()); - - locator.registerFactory(() => PharmacyModuleViewModel()); locator.registerFactory(() => OrderPreviewViewModel()); + // Offer And Packages + //---------------------- + locator.registerLazySingleton(() => OffersAndPackagesServices()); // offerPackagesServices Service + locator.registerFactory(() => OfferCategoriesViewModel()); // Categories View Model + locator.registerFactory(() => OfferProductsViewModel()); // Products View Model + + // Geofencing + // --------------------- + locator.registerLazySingleton(() => GeofencingServices()); // Geofencing Services } diff --git a/lib/main.dart b/lib/main.dart index 218fbf07..19304516 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -4,6 +4,9 @@ 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/HMG_Geofence.dart'; +import 'package:diplomaticquarterapp/uitl/LocalNotification.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'; @@ -11,19 +14,23 @@ import 'package:hexcolor/hexcolor.dart'; import 'package:provider/provider.dart'; import 'config/size_config.dart'; +import 'core/model/geofencing/requests/GeoZonesRequestModel.dart'; +import 'core/service/geofencing/GeofencingServices.dart'; import 'core/viewModels/project_view_model.dart'; import 'locator.dart'; void main() async { setupLocator(); - runApp(ChangeNotifierProvider( - create: (context) => ThemeNotifier(defaultTheme), child: MyApp() )); + runApp(ChangeNotifierProvider(create: (context) => ThemeNotifier(defaultTheme), child: MyApp())); } class MyApp extends StatelessWidget { @override Widget build(BuildContext context) { - final themeNotifier = Provider.of(context); + PlatformBridge.init(context); + LocalNotification.init(onNotificationClick: (payload){ + LocalNotification.getInstance().showNow(title: "Payload", subtitle: payload, payload: payload); + }); return LayoutBuilder( builder: (context, constraints) { @@ -35,10 +42,8 @@ class MyApp extends StatelessWidget { ChangeNotifierProvider( create: (context) => ProjectViewModel(), ), - ChangeNotifierProvider( - create: (context) => ToDoCountProviderModel()), - ChangeNotifierProvider( - create: (context) => SearchProvider()), + ChangeNotifierProvider(create: (context) => ToDoCountProviderModel()), + ChangeNotifierProvider(create: (context) => SearchProvider()), ChangeNotifierProvider.value( value: SearchProvider(), ), @@ -49,7 +54,6 @@ class MyApp extends StatelessWidget { ], child: Consumer( builder: (context, projectProvider, child) => MaterialApp( - showSemanticsDebugger: false, title: 'Diplomatic Quarter App', locale: projectProvider.appLocal, @@ -63,9 +67,8 @@ class MyApp extends StatelessWidget { const Locale('ar', ''), // Arabic const Locale('en', ''), // English ], - // theme: themeNotifier.getTheme(), - theme:ThemeData( - fontFamily:projectProvider.isArabic ? 'Cairo' : 'WorkSans', + theme: ThemeData( + fontFamily: projectProvider.isArabic ? 'Cairo' : 'WorkSans', primarySwatch: Colors.blue, visualDensity: VisualDensity.adaptivePlatformDensity, brightness: Brightness.light, @@ -76,11 +79,6 @@ class MyApp extends StatelessWidget { }, ), hintColor: Colors.grey[400], - textTheme: TextTheme( - headline1: TextStyle( - color: Color(0xffB8382C), - ), - ), disabledColor: Colors.grey[300], errorColor: Color.fromRGBO(235, 80, 60, 1.0), scaffoldBackgroundColor: Color(0xffE9E9E9), // Colors.grey[100], @@ -91,8 +89,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( diff --git a/lib/models/Appointments/DoctorRateDetails.dart b/lib/models/Appointments/DoctorRateDetails.dart deleted file mode 100644 index b29a5db9..00000000 --- a/lib/models/Appointments/DoctorRateDetails.dart +++ /dev/null @@ -1,32 +0,0 @@ -class DoctorRateDetails { - dynamic doctorID; - dynamic projectID; - dynamic clinicID; - dynamic rate; - dynamic patientNumber; - - DoctorRateDetails( - {this.doctorID, - this.projectID, - this.clinicID, - this.rate, - this.patientNumber}); - - DoctorRateDetails.fromJson(Map json) { - doctorID = json['DoctorID']; - projectID = json['ProjectID']; - clinicID = json['ClinicID']; - rate = json['Rate']; - patientNumber = json['PatientNumber']; - } - - Map toJson() { - final Map data = new Map(); - data['DoctorID'] = this.doctorID; - data['ProjectID'] = this.projectID; - data['ClinicID'] = this.clinicID; - data['Rate'] = this.rate; - data['PatientNumber'] = this.patientNumber; - return data; - } -} diff --git a/lib/models/Authentication/check_activation_code_response.dart b/lib/models/Authentication/check_activation_code_response.dart index 55ba6559..3a0aed65 100644 --- a/lib/models/Authentication/check_activation_code_response.dart +++ b/lib/models/Authentication/check_activation_code_response.dart @@ -270,7 +270,7 @@ class CheckActivationCode { } } -class Lists { +class List { String setupID; int patientType; int patientID; @@ -330,7 +330,7 @@ class Lists { dynamic tempAddress; dynamic zipCode; - Lists({ + List({ this.setupID, this.patientType, this.patientID, @@ -391,7 +391,7 @@ class Lists { this.zipCode, }); - Lists.fromJson(Map json) { + List.fromJson(Map json) { setupID = json['SetupID']; patientType = json['PatientType']; patientID = json['PatientID']; diff --git a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/Dialog/confirm_cancel_order_dialog.dart b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/Dialog/confirm_cancel_order_dialog.dart index 549f90b8..45bf01b7 100644 --- a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/Dialog/confirm_cancel_order_dialog.dart +++ b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/Dialog/confirm_cancel_order_dialog.dart @@ -30,7 +30,7 @@ class _ConfirmCancelOrderDialogState extends State { contentPadding: EdgeInsets.fromLTRB(28.0, 24.0, 28.0, 0.0), title: Center( child: Texts( - TranslationBase.of(context).confirm, + "Confirm", color: Colors.black, ), ), @@ -40,7 +40,7 @@ class _ConfirmCancelOrderDialogState extends State { Divider(), Center( child: Texts( - TranslationBase.of(context).cancelOrderMsg , + "Are you sure!! want to cancel this order", color: Colors.grey, ), ), diff --git a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/cmc_location_page.dart b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/cmc_location_page.dart deleted file mode 100644 index c584a21e..00000000 --- a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/cmc_location_page.dart +++ /dev/null @@ -1,148 +0,0 @@ -import 'package:diplomaticquarterapp/config/config.dart'; -import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; -import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/add_new_address_Request_Model.dart'; -import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/cmc_view_model.dart'; -import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/home_health_care_view_model.dart'; -import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; -import 'package:diplomaticquarterapp/pages/base/base_view.dart'; -import 'package:diplomaticquarterapp/uitl/app_toast.dart'; -import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; -import 'package:diplomaticquarterapp/uitl/utils.dart'; -import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; -import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; -import 'package:flutter/cupertino.dart'; -import 'package:flutter/material.dart'; -import 'package:google_maps_flutter/google_maps_flutter.dart'; -import 'package:google_maps_place_picker/google_maps_place_picker.dart'; -import 'package:provider/provider.dart'; - -class CMCLocationPage extends StatefulWidget { - final Function(PickResult) onPick; - final double latitude; - final double longitude; - final dynamic model; - - const CMCLocationPage({Key key, this.onPick, this.latitude, this.longitude, this.model}) - : super(key: key); - - @override - _CMCLocationPageState createState() => - _CMCLocationPageState(); -} - -class _CMCLocationPageState - extends State { - double latitude = 0; - double longitude = 0; - - @override - void initState() { - - latitude = widget.latitude; - longitude = widget.longitude; - super.initState(); - } - - - @override - Widget build(BuildContext context) { - ProjectViewModel projectViewModel = Provider.of(context); - return BaseView( - onModelReady: (model) {}, - builder: (_, model, widget) => AppScaffold( - isShowDecPage: false, - isShowAppBar: true, - baseViewModel: model, - body: PlacePicker( - apiKey: GOOGLE_API_KEY, - enableMyLocationButton: true, - automaticallyImplyAppBarLeading: false, - autocompleteOnTrailingWhitespace: true, - selectInitialPosition: true, - autocompleteLanguage: projectViewModel.currentLanguage, - enableMapTypeButton: true, - searchForInitialValue: false, - onPlacePicked: (PickResult result) { - print(result.adrAddress); - - }, - selectedPlaceWidgetBuilder: - (_, selectedPlace, state, isSearchBarFocused) { - print("state: $state, isSearchBarFocused: $isSearchBarFocused"); - return isSearchBarFocused - ? Container() - : FloatingCard( - bottomPosition: 0.0, - leftPosition: 0.0, - rightPosition: 0.0, - width: 500, - borderRadius: BorderRadius.circular(12.0), - child: state == SearchingState.Searching - ? Center(child: CircularProgressIndicator()) - : Container( - margin: EdgeInsets.all(12), - child: Column( - children: [ - SecondaryButton( - color: Colors.grey[800], - textColor: Colors.white, - onTap: () async { - print(selectedPlace); - AddNewAddressRequestModel - addNewAddressRequestModel = - new AddNewAddressRequestModel( - customer: Customer(addresses: [ - Addresses( - address1: - selectedPlace.formattedAddress, - address2: selectedPlace - .formattedAddress, - customerAttributes: "", - city: "", - createdOnUtc: "", - id: 0, - latLong: "$latitude,$longitude", - email: "") - ]), - ); - - selectedPlace.addressComponents.forEach((e) { - if (e.types.contains("country")) { - addNewAddressRequestModel.customer - .addresses[0].country = e.longName; - } - if (e.types.contains("postal_code")) { - addNewAddressRequestModel.customer - .addresses[0].zipPostalCode = - e.longName; - } - if (e.types.contains("locality")) { - addNewAddressRequestModel.customer - .addresses[0].city = - e.longName; - } - }); - - await model.addAddressInfo( - addNewAddressRequestModel: addNewAddressRequestModel); - if (model.state == ViewState.ErrorLocal) { - Utils.showErrorToast(model.error); - } else { - AppToast.showSuccessToast( - message: "Address Added Successfully"); - } - Navigator.of(context).pop(); - }, - label: TranslationBase.of(context).addNewAddress, - ), - ], - ), - ), - ); - }, - initialPosition: LatLng(latitude, longitude), - useCurrentLocation: false, - ), - )); - } -} diff --git a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_page.dart b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_page.dart index ecfe31fb..532396cc 100644 --- a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_page.dart +++ b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_page.dart @@ -3,18 +3,15 @@ import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/Comprehens import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/get_order_detail_by_order_iD_response_model.dart'; import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/update_pres_oreder_request_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/cmc_view_model.dart'; -import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/Dialog/confirm_cancel_order_dialog.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/HomeHealthCare/StepsWidget.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; -import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:flutter/material.dart'; import 'package:geolocator/geolocator.dart'; -import 'package:provider/provider.dart'; import 'new_cmc_step_one_page.dart'; import 'new_cmc_step_three_page.dart'; @@ -49,7 +46,7 @@ class _NewCMCPageState extends State price: widget.model.cmcAllServicesList[0].price, serviceID: widget.model.cmcAllServicesList[0].serviceID.toString(), selectedServiceName: widget.model.cmcAllServicesList[0].description, - selectedServiceNameAR: widget.model.cmcAllServicesList[0].descriptionN, + selectedServiceNameAR: widget.model.cmcAllServicesList[0].description, recordID: 1, totalPrice: widget.model.cmcAllServicesList[0].totalPrice, vAT: widget.model.cmcAllServicesList[0].vAT); @@ -88,8 +85,6 @@ class _NewCMCPageState extends State @override Widget build(BuildContext context) { - ProjectViewModel projectViewModel = Provider.of(context); - void showConfirmMessage( CMCViewModel model, GetOrderDetailByOrderIDResponseModel order) { showDialog( @@ -106,7 +101,7 @@ class _NewCMCPageState extends State if (model.state == ViewState.ErrorLocal) { Utils.showErrorToast(model.error); } else { - AppToast.showSuccessToast(message:TranslationBase.of(context).processDoneSuccessfully ); + AppToast.showSuccessToast(message: "Done Successfully"); await model.getCmcAllPresOrders(); } }, @@ -139,192 +134,183 @@ class _NewCMCPageState extends State children: [ widget.model.cmcAllOrderDetail.length != 0 ? FractionallySizedBox( + heightFactor: 0.8, widthFactor: 0.9, - child: SingleChildScrollView( + child: Container( + width: double.infinity, + margin: EdgeInsets.only(top: 15), + decoration: BoxDecoration( + border: + Border.all(color: Colors.grey, width: 1), + borderRadius: BorderRadius.circular(12), + color: Colors.white), child: Column( + crossAxisAlignment: CrossAxisAlignment.start, children: [ + SizedBox( + height: 12, + ), Container( width: double.infinity, - margin: EdgeInsets.only(top: 15), + padding: EdgeInsets.only( + left: 15, bottom: 15, top: 15), decoration: BoxDecoration( - border: - Border.all(color: Colors.grey, width: 1), - borderRadius: BorderRadius.circular(12), + border: Border( + bottom: BorderSide( + color: Colors.grey, + width: 1.0, + ), + ), + // borderRadius: BorderRadius.circular(12), color: Colors.white), child: Column( - crossAxisAlignment: CrossAxisAlignment.start, + crossAxisAlignment: + CrossAxisAlignment.start, children: [ + Texts( + "Request ID", + bold: false, + fontSize: 13, + ), SizedBox( - height: 12, + height: 4, ), - Container( - width: double.infinity, - padding: EdgeInsets.only( - left: 15, bottom: 15, top: 15,right: 15), - decoration: BoxDecoration( - border: Border( - bottom: BorderSide( - color: Colors.grey, - width: 1.0, - ), - ), - // borderRadius: BorderRadius.circular(12), - color: Colors.white), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Texts( - TranslationBase - .of(context) - .requestID, - bold: false, - fontSize: 13, - ), - SizedBox( - height: 4, - ), - Texts( - widget.model.cmcAllOrderDetail[0].iD.toString(), - fontSize: 22, - ), - ], - ), + Texts( + widget.model.cmcAllOrderDetail[0].iD.toString(), + fontSize: 22, ), - Container( - width: double.infinity, - padding: EdgeInsets.only( - left: 15, bottom: 15, top: 15,right: 15), - decoration: BoxDecoration( - border: Border( - bottom: BorderSide( - color: Colors.grey, - width: 1.0, - ), - ), - // borderRadius: BorderRadius.circular(12), - color: Colors.white), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Texts( - TranslationBase - .of(context) - .OrderStatus, - bold: false, - fontSize: 13, - ), - SizedBox( - height: 4, - ), - Texts( - - projectViewModel.isArabic ? widget.model.cmcAllOrderDetail[0] - .descriptionN : widget.model.cmcAllOrderDetail[0].description, - fontSize: 22, - ), - ], + ], + ), + ), + Container( + width: double.infinity, + padding: EdgeInsets.only( + left: 15, bottom: 15, top: 15), + decoration: BoxDecoration( + border: Border( + bottom: BorderSide( + color: Colors.grey, + width: 1.0, ), ), - Container( - width: double.infinity, - padding: EdgeInsets.only( - left: 15, bottom: 15, top: 15,right: 15), - decoration: BoxDecoration( - border: Border( - bottom: BorderSide( - color: Colors.grey, - width: 1.0, - ), - ), - // borderRadius: BorderRadius.circular(12), - color: Colors.white), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Texts( - TranslationBase.of(context).pickupDate, - bold: false, - fontSize: 13, - ), - SizedBox( - height: 4, - ), - Texts( - DateUtil.getDayMonthYearDateFormatted( - DateUtil.convertStringToDate(widget.model.cmcAllOrderDetail[0].createdOn)), - fontSize: 22, - ), - ], - ), + // borderRadius: BorderRadius.circular(12), + color: Colors.white), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Texts( + "Status", + bold: false, + fontSize: 13, ), - Container( - width: double.infinity, - padding: EdgeInsets.only( - left: 15, bottom: 15, top: 15), - decoration: BoxDecoration( - border: Border( - bottom: BorderSide( - color: Colors.grey, - width: 1.0, - ), - ), - // borderRadius: BorderRadius.circular(12), - color: Colors.white), - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Texts( - TranslationBase.of(context).serviceName, - bold: false, - fontSize: 13, - ), - SizedBox( - height: 4, - ), - Texts( - !projectViewModel.isArabic?widget.model.cmcAllOrderDetail[0].description - .toString() : - widget.model.cmcAllOrderDetail[0] - .descriptionN - .toString(), - fontSize: 22, - ), - ], + SizedBox( + height: 4, + ), + Texts( + "Pending", + fontSize: 22, + ), + ], + ), + ), + Container( + width: double.infinity, + padding: EdgeInsets.only( + left: 15, bottom: 15, top: 15), + decoration: BoxDecoration( + border: Border( + bottom: BorderSide( + color: Colors.grey, + width: 1.0, ), ), + // borderRadius: BorderRadius.circular(12), + color: Colors.white), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Texts( + "Pickup Date", + bold: false, + fontSize: 13, + ), SizedBox( - height: 12, + height: 4, + ), + Texts( + DateUtil.getDayMonthYearDateFormatted( + DateUtil.convertStringToDate( + widget.model.cmcAllOrderDetail[0] + .createdOn)), + fontSize: 22, ), - Center( - child: Container( - width: MediaQuery - .of(context) - .size - .width * - 0.85, - child: SecondaryButton( - label: TranslationBase.of(context).cancel.toUpperCase(), - onTap: () { - showConfirmMessage(widget.model, - widget.model.cmcAllOrderDetail[0]); - } - , - color: Colors.red[800], - disabled: false, - textColor: Theme - .of(context) - .backgroundColor), + ], + ), + ), + Container( + width: double.infinity, + padding: EdgeInsets.only( + left: 15, bottom: 15, top: 15), + decoration: BoxDecoration( + border: Border( + bottom: BorderSide( + color: Colors.grey, + width: 1.0, ), ), + // borderRadius: BorderRadius.circular(12), + color: Colors.white), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Texts( + "Service Name", + bold: false, + fontSize: 13, + ), SizedBox( - height: 22, + height: 4, + ), + Texts( + widget.model.cmcAllOrderDetail[0].description + .toString() ?? + widget.model.cmcAllOrderDetail[0] + .descriptionN + .toString(), + fontSize: 22, ), ], ), ), SizedBox( - height: 22, + height: 12, + ), + Center( + child: Container( + width: MediaQuery + .of(context) + .size + .width * + 0.85, + child: SecondaryButton( + label: "Cancel".toUpperCase(), + onTap: () { + showConfirmMessage(widget.model, + widget.model.cmcAllOrderDetail[0]); + } + , + color: Colors.red[800], + disabled: false, + textColor: Theme + .of(context) + .backgroundColor), + ), + ), + SizedBox( + height: 12, ), ], ), diff --git a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_step_one_page.dart b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_step_one_page.dart index b80d125a..02d099b4 100644 --- a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_step_one_page.dart +++ b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_step_one_page.dart @@ -1,16 +1,11 @@ -import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_get_items_request_model.dart'; import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_insert_pres_order_request_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/cmc_view_model.dart'; -import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; -import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; -import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -import 'package:provider/provider.dart'; class NewCMCStepOnePage extends StatefulWidget { final CMCInsertPresOrderRequestModel cMCInsertPresOrderRequestModel; @@ -36,8 +31,6 @@ class _NewCMCStepOnePageState extends State { @override Widget build(BuildContext context) { - ProjectViewModel projectViewModel = Provider.of(context); - return AppScaffold( isShowAppBar: false, baseViewModel: widget.model, @@ -57,17 +50,17 @@ class _NewCMCStepOnePageState extends State { height: 20, ), Texts( - TranslationBase.of(context).selectService, + "Select Home Health Care Services", textAlign: TextAlign.center, ), Column( children: - widget.model.cmcAllServicesList.map((service) { + widget.model.cmcAllServicesList.map((service) { return Container( margin: EdgeInsets.only(top: 15), decoration: BoxDecoration( border: - Border.all(color: Colors.grey, width: 1), + Border.all(color: Colors.grey, width: 1), borderRadius: BorderRadius.circular(12), color: Colors.white), child: Column( @@ -79,53 +72,50 @@ class _NewCMCStepOnePageState extends State { activeColor: Colors.red[800], onChanged: (newValue) async { PatientERCMCInsertServicesList - patientERCMCInsertServicesList = - new PatientERCMCInsertServicesList( - price: service.price, - serviceID: service.serviceID - .toString(), - selectedServiceName: - service.description, - selectedServiceNameAR: - service.descriptionN, - recordID: 1, - totalPrice: - service.totalPrice, - vAT: service.vAT); + patientERCMCInsertServicesList = + new PatientERCMCInsertServicesList( + price: service.price, + serviceID: service.serviceID + .toString(), + selectedServiceName: + service.description, + selectedServiceNameAR: + service.description, + recordID: 1, + totalPrice: + service.totalPrice, + vAT: service.vAT); setState(() { widget .cMCInsertPresOrderRequestModel - .patientERCMCInsertServicesList = - [ + .patientERCMCInsertServicesList = [ patientERCMCInsertServicesList ]; }); CMCGetItemsRequestModel - cMCGetItemsRequestModel = - new CMCGetItemsRequestModel( - checkupType: newValue); + cMCGetItemsRequestModel = + new CMCGetItemsRequestModel( + checkupType: newValue); await widget.model.getCheckupItems( cMCGetItemsRequestModel: - cMCGetItemsRequestModel); + cMCGetItemsRequestModel); }, groupValue: widget - .cMCInsertPresOrderRequestModel - .patientERCMCInsertServicesList - .length > - 0 + .cMCInsertPresOrderRequestModel + .patientERCMCInsertServicesList + .length > + 0 ? int.parse(widget - .cMCInsertPresOrderRequestModel - .patientERCMCInsertServicesList[ - 0] - .serviceID) + .cMCInsertPresOrderRequestModel + .patientERCMCInsertServicesList[ + 0] + .serviceID) : 1), Expanded( child: Padding( padding: const EdgeInsets.all(20.0), child: Texts( - projectViewModel.isArabic ? service - .descriptionN : service - .description, + service.description, fontSize: 15, ), ), @@ -147,67 +137,52 @@ class _NewCMCStepOnePageState extends State { color: Colors.white, width: double.infinity, child: Column( - children: [ - Row( - children: [ - Container(margin: EdgeInsets.only( - right: 10, left: 10), child: Texts(TranslationBase.of(context).coveredService, fontWeight: FontWeight.bold,)) - ], - ), - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: widget.model.checkupItems.map((item) { - return Center( - child: FractionallySizedBox( - widthFactor: 1, - child: Container( - margin: EdgeInsets.only(top: 15), - decoration: BoxDecoration( - color: Colors.white), - child: Column( - crossAxisAlignment: CrossAxisAlignment - .start, - children: [ - SizedBox( - height: 12, - ), - Container( - width: double.infinity, - padding: EdgeInsets.only( - left: 15, bottom: 5, top: 5), - decoration: BoxDecoration( - border: BorderDirectional( - bottom: BorderSide( - style: BorderStyle.solid, - width: 0.5, - color: Colors.grey)), - //borderRadius: , - color: Colors.white), - child: Column( - crossAxisAlignment: + crossAxisAlignment: CrossAxisAlignment.start, + children: widget.model.checkupItems.map((item) { + return Center( + child: FractionallySizedBox( + widthFactor: 1, + child: Container( + margin: EdgeInsets.only(top: 15), + decoration: BoxDecoration(color: Colors.white), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 12, + ), + Container( + width: double.infinity, + padding: EdgeInsets.only( + left: 15, bottom: 5, top: 5), + decoration: BoxDecoration( + border: BorderDirectional( + bottom: BorderSide( + style: BorderStyle.solid, + width: 0.5, + color: Colors.grey)), + //borderRadius: , + color: Colors.white), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Container(margin: EdgeInsets.only( - right: 10, left: 10), - child: Texts( - item.itemName, - fontSize: 15, fontWeight: FontWeight.bold - ), - ), - ], + children: [ + Texts( + item.itemName, + fontSize: 15, ), - ), - SizedBox( - height: 12, - ), - ], + ], + ), ), - ), + SizedBox( + height: 12, + ), + ], ), - ); - }).toList()), - ], - ), + ), + ), + ); + }).toList()), ) ], ), @@ -222,48 +197,28 @@ class _NewCMCStepOnePageState extends State { Container( width: MediaQuery.of(context).size.width * 0.9, child: SecondaryButton( - label: TranslationBase - .of(context) - .next, - textColor: Theme - .of(context) - .backgroundColor, - color: Colors.grey[800], - onTap: () async { - if (widget.cMCInsertPresOrderRequestModel - .patientERCMCInsertServicesList.length != - 0 || - widget.cMCInsertPresOrderRequestModel - .patientERCMCInsertServicesList == - null) { + label: "Next", + textColor: Theme.of(context).backgroundColor, + onTap: () { + if (widget.cMCInsertPresOrderRequestModel.patientERCMCInsertServicesList.length = null) { int index = widget.model.cmcAllServicesList.length; PatientERCMCInsertServicesList - patientERCMCInsertServicesList = - new PatientERCMCInsertServicesList( - price: widget - .model.cmcAllServicesList[index - 1].price, - serviceID: widget - .model.cmcAllServicesList[index - 1].serviceID - .toString(), - selectedServiceName: widget.model - .cmcAllServicesList[index - 1].description, - selectedServiceNameAR: widget.model - .cmcAllServicesList[index - 1].descriptionN, - recordID: 1, - totalPrice: widget - .model.cmcAllServicesList[index - 1].totalPrice, - vAT: widget.model.cmcAllServicesList[index - 1].vAT); + patientERCMCInsertServicesList = + new PatientERCMCInsertServicesList( + price: widget.model.cmcAllServicesList[index-1].price, + serviceID: widget.model.cmcAllServicesList[index-1].serviceID.toString(), + selectedServiceName: widget.model.cmcAllServicesList[index-1].description, + selectedServiceNameAR: widget.model.cmcAllServicesList[index-1].description, + recordID: 1, + totalPrice: widget.model.cmcAllServicesList[index-1].totalPrice, + vAT: widget.model.cmcAllServicesList[index-1].vAT); widget.cMCInsertPresOrderRequestModel .patientERCMCInsertServicesList = [ patientERCMCInsertServicesList ]; - await widget.model.getCustomerInfo(); - if (widget.model.state == ViewState.ErrorLocal) { - Utils.showErrorToast(); - } else { - widget.changePageViewIndex(1); - } + + widget.changePageViewIndex(1); } }, ), diff --git a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_step_three_page.dart b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_step_three_page.dart index eea9853b..e48bb5d5 100644 --- a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_step_three_page.dart +++ b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_step_three_page.dart @@ -2,16 +2,15 @@ import 'dart:async'; import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_insert_pres_order_request_model.dart'; +import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/patient_er_insert_pres_order_request_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/cmc_view_model.dart'; -import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; -import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/home_health_care_view_model.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:google_maps_flutter/google_maps_flutter.dart'; -import 'package:provider/provider.dart'; class NewCMCStepThreePage extends StatefulWidget { final CMCInsertPresOrderRequestModel cmcInsertPresOrderRequestModel; @@ -64,23 +63,19 @@ class _NewCMCStepThreePageState @override Widget build(BuildContext context) { - ProjectViewModel projectViewModel = Provider.of(context); return AppScaffold( isShowDecPage: false, baseViewModel: widget.model, body: SingleChildScrollView( physics: BouncingScrollPhysics(), child: Container( - height: 500, + height: 400, width: double.maxFinite, margin: EdgeInsets.only(left: 12, right: 12), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Texts( - TranslationBase.of(context).orderDetails, - fontWeight: FontWeight.bold, - ), + Texts('Order Details'), SizedBox( height: 12, ), @@ -92,9 +87,7 @@ class _NewCMCStepThreePageState child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Texts(TranslationBase - .of(context) - .orderLocation + " : ", fontWeight: FontWeight.bold,), + Texts('Location :'), SizedBox( height: 12, ), @@ -115,40 +108,30 @@ class _NewCMCStepThreePageState SizedBox( height: 12, ), - Texts(TranslationBase - .of(context) - .selectedService), + Texts('Selected Service :'), ...List.generate( - widget.cmcInsertPresOrderRequestModel - .patientERCMCInsertServicesList.length, - (index) => - Container( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Texts( - TranslationBase - .of(context) - .serviceName, - fontSize: 12, fontWeight: FontWeight.bold, - ), - SizedBox( - height: 5, - ), - Texts( - projectViewModel.isArabic ? widget - .cmcInsertPresOrderRequestModel - .patientERCMCInsertServicesList[index] - .selectedServiceNameAR : widget - .cmcInsertPresOrderRequestModel - .patientERCMCInsertServicesList[index] - .selectedServiceName, - fontSize: 15, - bold: true, - ), - ], + widget.cmcInsertPresOrderRequestModel.patientERCMCInsertServicesList.length, + (index) => Container( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts( + 'Service Name :', + fontSize: 12, + ), + SizedBox( + height: 5, + ), + Texts( + widget + .cmcInsertPresOrderRequestModel.patientERCMCInsertServicesList[index] + .selectedServiceName, + fontSize: 15, + bold: true, ), - ), + ], + ), + ), ) ], ), @@ -165,20 +148,14 @@ class _NewCMCStepThreePageState Container( width: MediaQuery.of(context).size.width * 0.9, child: SecondaryButton( - label: TranslationBase - .of(context) - .confirm, - color: Colors.grey[800], + label: "Confirm", onTap: () async { - await widget.model.insertPresPresOrder( - order: widget.cmcInsertPresOrderRequestModel); + await widget.model.insertPresPresOrder(order: widget.cmcInsertPresOrderRequestModel); if (widget.model.state != ViewState.ErrorLocal) { widget.changePageViewIndex(0); } }, - textColor: Theme - .of(context) - .backgroundColor), + textColor: Theme.of(context).backgroundColor), ), ], ), diff --git a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_step_tow_page.dart b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_step_tow_page.dart index cc8ea8dd..27cddfe3 100644 --- a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_step_tow_page.dart +++ b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_step_tow_page.dart @@ -1,22 +1,19 @@ import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_insert_pres_order_request_model.dart'; -import 'package:diplomaticquarterapp/core/service/AlHabibMedicalService/customer_addresses_service.dart'; +import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/patient_er_insert_pres_order_request_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/cmc_view_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/home_health_care_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; -import 'package:diplomaticquarterapp/widgets/dialogs/select_location_dialog.dart'; -import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/location_page.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; -import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:diplomaticquarterapp/widgets/others/close_back.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -import 'package:google_maps_flutter/google_maps_flutter.dart'; import 'package:google_maps_place_picker/google_maps_place_picker.dart'; +import 'package:google_maps_flutter/google_maps_flutter.dart'; import 'package:provider/provider.dart'; -import 'cmc_location_page.dart'; - class NewCMCStepTowPage extends StatefulWidget { final Function(PickResult) onPick; final double latitude; @@ -44,13 +41,12 @@ class _NewCMCStepTowPageState extends State { double latitude = 0; double longitude = 0; - AddressInfo _selectedAddress; - @override void initState() { if (widget.cmcInsertPresOrderRequestModel.latitude == null) { - setLatitudeAndLongitude(); + latitude = widget.latitude; + longitude = widget.longitude; } else { latitude = widget.cmcInsertPresOrderRequestModel.latitude; longitude = widget.cmcInsertPresOrderRequestModel.longitude; @@ -58,152 +54,60 @@ class _NewCMCStepTowPageState super.initState(); } - setLatitudeAndLongitude({bool isSetState = false, String latLong}) { - if (latLong == null) - latLong = widget.model.addressesList[widget.model.addressesList - .length - 1].latLong; - List latLongArr = latLong.split(','); - - latitude = double.parse(latLongArr[0]); - longitude = double.parse(latLongArr[1]); - } @override Widget build(BuildContext context) { ProjectViewModel projectViewModel = Provider.of(context); - return AppScaffold( + return AppScaffold( isShowDecPage: false, - body: Stack( - children: [ - PlacePicker( - apiKey: GOOGLE_API_KEY, - enableMyLocationButton: true, - automaticallyImplyAppBarLeading: false, - autocompleteOnTrailingWhitespace: true, - selectInitialPosition: true, - autocompleteLanguage: projectViewModel.currentLanguage, - enableMapTypeButton: true, - searchForInitialValue: false, - - onPlacePicked: (PickResult result) { - print(result.adrAddress); - widget.changePageViewIndex(3); - }, - selectedPlaceWidgetBuilder: - (_, selectedPlace, state, isSearchBarFocused) { - print("state: $state, isSearchBarFocused: $isSearchBarFocused"); - return isSearchBarFocused - ? Container() - : FloatingCard( - bottomPosition: 0.0, - leftPosition: 0.0, - rightPosition: 0.0, - width: 500, - borderRadius: BorderRadius.circular(12.0), - child: state == SearchingState.Searching - ? Center(child: CircularProgressIndicator()) - : Container( - margin: EdgeInsets.all(12), - child: Column( - children: [ - SecondaryButton( - color: Colors.grey[800], - textColor: Colors.white, - onTap: () { - Navigator.push( - context, - MaterialPageRoute( - builder: (BuildContext context) => - CMCLocationPage( - latitude: latitude, - longitude: longitude, - - ), - ), - ); - }, - label: TranslationBase.of(context).addNewAddress, - ), - SizedBox(height: 10,), - SecondaryButton( - color: Colors.red - [800], - textColor: Colors.white, - onTap: () { - setState(() { - widget.cmcInsertPresOrderRequestModel - .latitude = - selectedPlace.geometry.location.lat; - widget.cmcInsertPresOrderRequestModel - .longitude = - selectedPlace.geometry.location.lng; - }); - widget.changePageViewIndex(3); - }, - label: TranslationBase.of(context).confirm, + body: PlacePicker( + apiKey: GOOGLE_API_KEY, + enableMyLocationButton: true, + automaticallyImplyAppBarLeading: false, + autocompleteOnTrailingWhitespace: true, + selectInitialPosition: true, + autocompleteLanguage: projectViewModel.currentLanguage, + enableMapTypeButton: true, + onPlacePicked: (PickResult result) { + print(result.adrAddress); + widget.changePageViewIndex(3); + }, + selectedPlaceWidgetBuilder: + (_, selectedPlace, state, isSearchBarFocused) { + print("state: $state, isSearchBarFocused: $isSearchBarFocused"); + return isSearchBarFocused + ? Container() + : FloatingCard( + bottomPosition: 0.0, + leftPosition: 0.0, + rightPosition: 0.0, + width: 500, + borderRadius: BorderRadius.circular(12.0), + child: state == SearchingState.Searching + ? Center(child: CircularProgressIndicator()) + : Container( + margin: EdgeInsets.all(12), + child: SecondaryButton( + color: Colors.grey[800], + textColor: Colors.white, + onTap: () { + setState(() { + widget.cmcInsertPresOrderRequestModel + .latitude = + selectedPlace.geometry.location.lat; + widget.cmcInsertPresOrderRequestModel + .longitude = + selectedPlace.geometry.location.lng; + }); + widget.changePageViewIndex(3); + }, + label: TranslationBase.of(context).next, + ), ), - ], - ) - ), - ); - }, - initialPosition: LatLng(latitude, longitude), - useCurrentLocation: false, - ), - Container( - child: InkWell( - onTap: () => - confirmSelectLocationDialog(widget.model.addressesList), - child: Container( - padding: EdgeInsets.all(10), - width: double.infinity, - // height: 65, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(10), - color: Colors.white), - child: Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - children: [ - Expanded(child: Texts(getAddressName(), fontSize: 14,),), - Icon(Icons.arrow_drop_down) - ], - ), - ), - ), - height: 56, width: double.infinity, color: Theme - .of(context) - .scaffoldBackgroundColor, - - ) - ], - ), - ); - - - } - - - void confirmSelectLocationDialog(List addresses) { - showDialog( - context: context, - child: SelectLocationDialog( - addresses: addresses, - selectedAddress: _selectedAddress - , - onValueSelected: (value) { - setLatitudeAndLongitude(latLong: value.latLong); - setState(() { - _selectedAddress = value; - }); + ); }, + initialPosition: LatLng(latitude, longitude), + useCurrentLocation: true, ), ); } - - String getAddressName() { - if (_selectedAddress != null) - return _selectedAddress.address1; - else - return TranslationBase.of(context).selectAddress; - } } diff --git a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_index_page.dart b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_index_page.dart new file mode 100644 index 00000000..e8e9eccc --- /dev/null +++ b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_index_page.dart @@ -0,0 +1,68 @@ +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:hexcolor/hexcolor.dart'; +import 'cmc_page.dart'; + +class CMCIndexPage extends StatelessWidget { + @override + Widget build(BuildContext context) { + return AppScaffold( + isShowAppBar: true, + appBarTitle: TranslationBase.of(context).serviceInformation, + body: SingleChildScrollView( + padding: EdgeInsets.all(12), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts( + "CMC", + fontWeight: FontWeight.normal, + fontSize: 25, + color: Color(0xff60686b), + ), + SizedBox( + height: 12, + ), + Texts( + "This service is designed to help you to set drinking water goals and track the volume of water you are drinking on a daily basis. This service allows for schedule reminders and offers a basic statistical analysis of the amount of what you have consumed over the course of a day, week or month.", + fontWeight: FontWeight.normal, + fontSize: 17, + ), + SizedBox( + height: 22, + ), + Center( + child: Image.asset( + 'assets/images/AlHabibMedicalService/Wifi-AR.png')), + SizedBox( + height: 77, + ), + ], + )), + bottomSheet: Container( + height: MediaQuery.of(context).size.height * 0.10, + width: double.infinity, + child: Column( + children: [ + Container( + width: MediaQuery.of(context).size.width * 0.9, + child: SecondaryButton( + onTap: () => Navigator.push( + context, + FadePage( + page: CMCPage(), + ), + ), + label: "CMC", + textColor: Theme.of(context).backgroundColor), + ), + ], + ), + )); + } +} diff --git a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_page.dart b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_page.dart index 06a83cc1..385d0da3 100644 --- a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_page.dart +++ b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_page.dart @@ -40,8 +40,7 @@ class _CMCPageState extends State }, builder: (_, model, widget) => AppScaffold( isShowAppBar: true, - description: TranslationBase.of(context).HHCNotAuthMsg, - appBarTitle: TranslationBase.of(context).comprehensiveMedicalCheckup, + appBarTitle: TranslationBase.of(context).homeHealthCare, body: Scaffold( extendBodyBehindAppBar: true, appBar: PreferredSize( @@ -89,8 +88,7 @@ class _CMCPageState extends State Container( width: MediaQuery.of(context).size.width * 0.37, child: Center( - child: Texts(TranslationBase.of(context) - .comprehensiveMedicalCheckup), + child: Texts("CMC Service"), ), ), Container( diff --git a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/orders_log_details_page.dart b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/orders_log_details_page.dart index ec686e70..6c915a4c 100644 --- a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/orders_log_details_page.dart +++ b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/orders_log_details_page.dart @@ -2,16 +2,13 @@ import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/get_hhc_all_pres_orders_response_model.dart'; import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/update_pres_oreder_request_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/cmc_view_model.dart'; -import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; -import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/material.dart'; -import 'package:provider/provider.dart'; import 'Dialog/confirm_cancel_order_dialog.dart'; @@ -22,9 +19,6 @@ class OrdersLogDetailsPage extends StatelessWidget { @override Widget build(BuildContext context) { - - ProjectViewModel projectViewModel = Provider.of(context); - void showConfirmMessage( CMCViewModel model, GetHHCAllPresOrdersResponseModel order) { showDialog( @@ -41,7 +35,7 @@ class OrdersLogDetailsPage extends StatelessWidget { if(model.state == ViewState.ErrorLocal) { Utils.showErrorToast(model.error); } else { - AppToast.showSuccessToast(message:TranslationBase.of(context).processDoneSuccessfully ); + AppToast.showSuccessToast(message: "Done Successfully"); await model.getCmcAllPresOrders(); } }, @@ -84,7 +78,7 @@ class OrdersLogDetailsPage extends StatelessWidget { Container( width: double.infinity, padding: EdgeInsets.only( - left: 15, bottom: 15, top: 15,right: 15), + left: 15, bottom: 15, top: 15), decoration: BoxDecoration( border: Border( bottom: BorderSide( @@ -95,12 +89,11 @@ class OrdersLogDetailsPage extends StatelessWidget { // borderRadius: BorderRadius.circular(12), color: Colors.white), child: Column( - crossAxisAlignment: CrossAxisAlignment.start, + crossAxisAlignment: + CrossAxisAlignment.start, children: [ Texts( - TranslationBase - .of(context) - .requestID, + "Request ID", bold: false, fontSize: 13, ), @@ -117,7 +110,7 @@ class OrdersLogDetailsPage extends StatelessWidget { Container( width: double.infinity, padding: EdgeInsets.only( - left: 15, bottom: 15, top: 15,right: 15), + left: 15, bottom: 15, top: 15), decoration: BoxDecoration( border: Border( bottom: BorderSide( @@ -128,12 +121,11 @@ class OrdersLogDetailsPage extends StatelessWidget { // borderRadius: BorderRadius.circular(12), color: Colors.white), child: Column( - crossAxisAlignment: CrossAxisAlignment.start, + crossAxisAlignment: + CrossAxisAlignment.start, children: [ Texts( - TranslationBase - .of(context) - .OrderStatus, + "Status", bold: false, fontSize: 13, ), @@ -141,9 +133,7 @@ class OrdersLogDetailsPage extends StatelessWidget { height: 4, ), Texts( - - projectViewModel.isArabic ? order - .descriptionN : order.description, + order.description, fontSize: 22, ), ], @@ -152,7 +142,7 @@ class OrdersLogDetailsPage extends StatelessWidget { Container( width: double.infinity, padding: EdgeInsets.only( - left: 15, bottom: 15, top: 15,right: 15), + left: 15, bottom: 15, top: 15), decoration: BoxDecoration( border: Border( bottom: BorderSide( @@ -163,10 +153,11 @@ class OrdersLogDetailsPage extends StatelessWidget { // borderRadius: BorderRadius.circular(12), color: Colors.white), child: Column( - crossAxisAlignment: CrossAxisAlignment.start, + crossAxisAlignment: + CrossAxisAlignment.start, children: [ Texts( - TranslationBase.of(context).pickupDate, + "Pickup Date", bold: false, fontSize: 13, ), @@ -175,7 +166,8 @@ class OrdersLogDetailsPage extends StatelessWidget { ), Texts( DateUtil.getDayMonthYearDateFormatted( - DateUtil.convertStringToDate(order.createdOn)), + DateUtil.convertStringToDate( + order.createdOn)), fontSize: 22, ), ], @@ -184,7 +176,7 @@ class OrdersLogDetailsPage extends StatelessWidget { Container( width: double.infinity, padding: EdgeInsets.only( - left: 15, bottom: 15, top: 15,right: 15), + left: 15, bottom: 15, top: 15), decoration: BoxDecoration( border: Border( bottom: BorderSide( @@ -199,7 +191,7 @@ class OrdersLogDetailsPage extends StatelessWidget { CrossAxisAlignment.start, children: [ Texts( - TranslationBase.of(context).orderLocation, + "Location", bold: false, fontSize: 13, ), @@ -207,11 +199,10 @@ class OrdersLogDetailsPage extends StatelessWidget { height: 4, ), Texts( - !projectViewModel.isArabic?order. - projectDescription.toString() : - order - .projectDescriptionN - .toString(), + order.nearestProjectDescription + .toString() ?? + order.nearestProjectDescriptionN + .toString(), fontSize: 22, ), ], @@ -221,33 +212,32 @@ class OrdersLogDetailsPage extends StatelessWidget { height: 12, ), if (order.status == 1 ||order.status == 2 ) - Center( - child: Container( - width: MediaQuery - .of(context) - .size - .width * - 0.85, - child: SecondaryButton( - label: TranslationBase.of(context).cancel.toUpperCase(), - onTap: () { - showConfirmMessage(model, - order); - } - , - color: Colors.red[800], - disabled: false, - textColor: Theme - .of(context) - .backgroundColor), + Center( + child: Container( + width: MediaQuery + .of(context) + .size + .width * + 0.85, + child: SecondaryButton( + label: "Cancel".toUpperCase(), + onTap: () { + showConfirmMessage(model, order); + } + , + color: Colors.red[800], + disabled: false, + textColor: Theme + .of(context) + .backgroundColor), + ), ), - ), SizedBox( - height: 22, - ), - ], - ), - ); + height: 12, + ), + ], + ), + ); }).toList()) ], ), diff --git a/lib/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_index_page.dart b/lib/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_index_page.dart index 2cb179b8..fb2b94c6 100644 --- a/lib/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_index_page.dart +++ b/lib/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_index_page.dart @@ -40,32 +40,34 @@ class _StartIndexForNewEReferralState extends State @override Widget build(BuildContext context) { return Scaffold( - body: SingleChildScrollView( - child: Container( - height: MediaQuery.of(context).size.height * 0.9, - child: PageView( - physics: NeverScrollableScrollPhysics(), - controller: _controller, - onPageChanged: (index) { - setState(() { - _currentIndex = index; - }); - }, - scrollDirection: Axis.horizontal, - children: [ - NewEReferralStepOnePage( - changePageViewIndex: changePageViewIndex, - createEReferralRequestModel: createEReferralRequestModel, - ), - NewEReferralStepTowPage( - changePageViewIndex: changePageViewIndex, - createEReferralRequestModel: createEReferralRequestModel, - ), - NewEReferralStepThreePage( - changePageViewIndex: changePageViewIndex, - createEReferralRequestModel: createEReferralRequestModel, - ), - ], + body: SafeArea( + child: SingleChildScrollView( + child: Container( + height: MediaQuery.of(context).size.height * 0.9, + child: PageView( + physics: NeverScrollableScrollPhysics(), + controller: _controller, + onPageChanged: (index) { + setState(() { + _currentIndex = index; + }); + }, + scrollDirection: Axis.horizontal, + children: [ + NewEReferralStepOnePage( + changePageViewIndex: changePageViewIndex, + createEReferralRequestModel: createEReferralRequestModel, + ), + NewEReferralStepTowPage( + changePageViewIndex: changePageViewIndex, + createEReferralRequestModel: createEReferralRequestModel, + ), + NewEReferralStepThreePage( + changePageViewIndex: changePageViewIndex, + createEReferralRequestModel: createEReferralRequestModel, + ), + ], + ), ), ), ), diff --git a/lib/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_step_one_page.dart b/lib/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_step_one_page.dart index e486d9aa..62799c6d 100644 --- a/lib/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_step_one_page.dart +++ b/lib/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_step_one_page.dart @@ -6,9 +6,9 @@ import 'package:diplomaticquarterapp/core/model/my_balance/AdvanceModel.dart'; import 'package:diplomaticquarterapp/core/viewModels/all_habib_medical_services/e_referral_view_model.dart'; import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; import 'package:diplomaticquarterapp/models/FamilyFiles/GetAllSharedRecordByStatusResponse.dart'; +import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/E-Referral/e_referral_confirm_sms_dialog.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/E-Referral/dialogs/select_country_ingo_Dialog.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/E-Referral/dialogs/select_relation_type_dialog.dart'; -import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/E-Referral/e_referral_confirm_sms_dialog.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/medical/balance/new_text_Field.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; @@ -19,17 +19,15 @@ import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; + class NewEReferralStepOnePage extends StatefulWidget { final CreateEReferralRequestModel createEReferralRequestModel; final Function changePageViewIndex; - const NewEReferralStepOnePage( - {Key key, this.createEReferralRequestModel, this.changePageViewIndex}) - : super(key: key); + const NewEReferralStepOnePage({Key key, this.createEReferralRequestModel, this.changePageViewIndex}) : super(key: key); @override - _NewEReferralStepOnePageState createState() => - _NewEReferralStepOnePageState(); + _NewEReferralStepOnePageState createState() => _NewEReferralStepOnePageState(); } class _NewEReferralStepOnePageState extends State { @@ -66,25 +64,27 @@ class _NewEReferralStepOnePageState extends State { context: context, barrierDismissible: false, child: EReferralConfirmSMSDialog( - phoneNumber: _selectedCountry['code'] + _mobileTextController.text, - onSucces: () { - Navigator.of(context).pop(); - widget.changePageViewIndex(1); - widget.createEReferralRequestModel.requesterName = - _nameTextController.text; - widget.createEReferralRequestModel.requesterContactNo = - _selectedCountry['code'].toString().substring(1) + - _mobileTextController.text; - widget.createEReferralRequestModel.requesterRelationship = - _selectedRelation.iD; - }), + phoneNumber: _selectedCountry['code']+_mobileTextController.text, + onSucces: (){ + Navigator.of(context).pop(); + widget.changePageViewIndex(1); + widget.createEReferralRequestModel.requesterName=_nameTextController.text; + widget.createEReferralRequestModel.requesterContactNo = _selectedCountry['code'].toString().substring(1)+_mobileTextController.text; + widget.createEReferralRequestModel.requesterRelationship=_selectedRelation.iD; + + + } + + + ), ).then((value) { print("dialog dismissed"); print(value); - if (value != null && value) {} + if (value != null && value) { + + } }); } - return BaseView( onModelReady: (model) => model.getRelationTypes(), builder: (_, model, widget) => AppScaffold( @@ -92,7 +92,7 @@ class _NewEReferralStepOnePageState extends State { body: SingleChildScrollView( physics: ScrollPhysics(), child: Container( - margin: EdgeInsets.all(10), + margin: EdgeInsets.all(12), child: Center( child: FractionallySizedBox( widthFactor: 0.9, @@ -100,10 +100,11 @@ class _NewEReferralStepOnePageState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ SizedBox( - height: 80, + height: 20, ), Center( child: Texts( +// TranslationBase.of(context).advancePaymentLabel, "Referral requester information", textAlign: TextAlign.center, ), @@ -184,30 +185,34 @@ class _NewEReferralStepOnePageState extends State { ), ), bottomSheet: Container( - height: MediaQuery.of(context).size.height * 0.1, + height: MediaQuery + .of(context) + .size + .height * 0.1, width: double.infinity, padding: EdgeInsets.all(9), child: SecondaryButton( textColor: Colors.white, - label: TranslationBase.of(context).next, - onTap: () async { - SendActivationCodeForEReferralRequestModel - sendActivationCodeForEReferralRequestModel = - SendActivationCodeForEReferralRequestModel( + label: "Next", + onTap: () async { + SendActivationCodeForEReferralRequestModel sendActivationCodeForEReferralRequestModel = + SendActivationCodeForEReferralRequestModel( zipCode: _selectedCountry['code'], - patientMobileNumber: int.parse(_mobileTextController.text), - ); - await model.sendActivationCodeForEReferral( - sendActivationCodeForEReferralRequestModel); + patientMobileNumber: int.parse( + _mobileTextController.text),); + await model.sendActivationCodeForEReferral(sendActivationCodeForEReferralRequestModel); showSMSDialog(); }, loading: model.state == ViewState.BusyLocal, - disabled: _nameTextController.text.isEmpty || + disabled: + _nameTextController.text.isEmpty || _selectedRelation == null || _mobileTextController.text.isEmpty, ), ))); + + } void confirmSelectRelationTypeDialog( @@ -256,8 +261,12 @@ class _NewEReferralStepOnePageState extends State { } class MobileNumberTextFiled extends StatelessWidget { - const MobileNumberTextFiled({Key key, this.controller, this.code}) - : super(key: key); + const MobileNumberTextFiled({ + Key key, + this.controller, + this.code + }) : super(key: key); + final TextEditingController controller; final String code; diff --git a/lib/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_step_three_page.dart b/lib/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_step_three_page.dart index cb9f03df..d84b9d61 100644 --- a/lib/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_step_three_page.dart +++ b/lib/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_step_three_page.dart @@ -1,23 +1,21 @@ import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/EReferral/create_e_referral_request_model.dart'; -import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/EReferral/get_all_projects_response_model.dart'; +import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/EReferral/get_all_cities_response_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/all_habib_medical_services/e_referral_view_model.dart'; import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; import 'package:diplomaticquarterapp/models/FamilyFiles/GetAllSharedRecordByStatusResponse.dart'; -import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/E-Referral/dialogs/select_project_dialog.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; -import 'package:diplomaticquarterapp/routes.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; -import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/bottom_options/BottomSheet.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; -import 'package:diplomaticquarterapp/widgets/dialogs/alert_dialog.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart'; +import '../dialogs/select_city_dialog.dart'; + class NewEReferralStepThreePage extends StatefulWidget { final CreateEReferralRequestModel createEReferralRequestModel; final Function changePageViewIndex; @@ -34,8 +32,7 @@ class NewEReferralStepThreePage extends StatefulWidget { class _NewEReferralStepThreePageState extends State { TextEditingController _nameTextController = TextEditingController(); TextEditingController _mobileTextController = TextEditingController(); - - GetAllProjectsResponseModel _selectedHospital; + GetAllCitiesResponseModel _selectedCity; GetAllSharedRecordsByStatusList selectedPatientFamily; List medicalReportImages = []; @@ -53,7 +50,6 @@ class _NewEReferralStepThreePageState extends State { @override Widget build(BuildContext context) { return BaseView( - onModelReady: (model) => model.getAllProjects(), builder: (_, model, widget) => AppScaffold( isShowAppBar: false, body: SingleChildScrollView( @@ -68,7 +64,7 @@ class _NewEReferralStepThreePageState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ SizedBox( - height: 80, + height: 20, ), Center( child: Texts( @@ -107,13 +103,8 @@ class _NewEReferralStepThreePageState extends State { ImageOptions.showImageOptions(context, (String image) { setState(() { - EReferralAttachment eReferralAttachment = - new EReferralAttachment( - fileName: - 'image ${medicalReportImages.length + 1}.png', - base64String: image); - medicalReportImages - .add(eReferralAttachment); + EReferralAttachment eReferralAttachment = new EReferralAttachment(fileName: 'image ${ medicalReportImages.length +1}.png',base64String: image ); + medicalReportImages.add(eReferralAttachment); }); }); }, @@ -167,17 +158,15 @@ class _NewEReferralStepThreePageState extends State { width: 8, ), Texts( - medicalReportImages[index] - .fileName, + medicalReportImages[index].fileName, ), ], ), InkWell( onTap: () { setState(() { - medicalReportImages.remove( - medicalReportImages[ - index]); + medicalReportImages + .remove(medicalReportImages[index]); }); }, child: Icon( @@ -216,7 +205,7 @@ class _NewEReferralStepThreePageState extends State { ), InkWell( onTap: () => - confirmSelectHospital(model.allHospitals), + confirmSelectCityDialog(model.allCities), child: Container( padding: EdgeInsets.all(12), width: double.infinity, @@ -273,12 +262,12 @@ class _NewEReferralStepThreePageState extends State { ], ), ), - if (isPatientInsured) - SizedBox( - height: 12, - ), + if(isPatientInsured) + SizedBox( + height: 12, + ), Opacity( - opacity: isPatientInsured ? 1 : 0, + opacity: isPatientInsured?1:0, child: Container( padding: EdgeInsets.only(top: 10), decoration: BoxDecoration( @@ -287,21 +276,16 @@ class _NewEReferralStepThreePageState extends State { ), child: Column( children: [ + InkWell( onTap: () { ImageOptions.showImageOptions(context, (String image) { setState(() { - EReferralAttachment - eReferralAttachment = - new EReferralAttachment( - fileName: - 'image ${medicalReportImages.length + 1}.png', - base64String: image); - insuredPatientImages = [ - eReferralAttachment - ]; + EReferralAttachment eReferralAttachment = new EReferralAttachment(fileName: 'image ${ medicalReportImages.length +1}.png',base64String: image ); + + insuredPatientImages=[eReferralAttachment]; }); }); }, @@ -349,8 +333,8 @@ class _NewEReferralStepThreePageState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ - Icon(FontAwesomeIcons - .paperclip), + Icon( + FontAwesomeIcons.paperclip), SizedBox( width: 8, ), @@ -362,9 +346,8 @@ class _NewEReferralStepThreePageState extends State { InkWell( onTap: () { setState(() { - insuredPatientImages.remove( - insuredPatientImages[ - index]); + insuredPatientImages + .remove(insuredPatientImages[index]); }); }, child: Icon( @@ -395,72 +378,50 @@ class _NewEReferralStepThreePageState extends State { textColor: Colors.white, label: "Submit", onTap: () async { - this - .widget - .createEReferralRequestModel - .medicalReportAttachment = medicalReportImages; - this - .widget - .createEReferralRequestModel - .insuranceCardAttachment = - insuredPatientImages.length != 0 - ? insuredPatientImages[0] - : null; - this.widget.createEReferralRequestModel.isInsuredPatient = - isPatientInsured; + this.widget.createEReferralRequestModel.medicalReportAttachment = medicalReportImages; + this.widget.createEReferralRequestModel.insuranceCardAttachment = insuredPatientImages.length !=0?insuredPatientImages[0]:null; + this.widget.createEReferralRequestModel.isInsuredPatient = isPatientInsured; // ToDo make the preferred Branch info dynamic - this.widget.createEReferralRequestModel.preferredBranchCode = - _selectedHospital.iD; - this.widget.createEReferralRequestModel.preferredBranchName = - _selectedHospital.desciption; + this.widget.createEReferralRequestModel.preferredBranchCode = 15; + this.widget.createEReferralRequestModel. preferredBranchName= "Arryan Hospital"; + - this.widget.createEReferralRequestModel.otherRelationship = - ""; - await model - .createEReferral(this.widget.createEReferralRequestModel) - .then((value) { - AlertDialogBox( - context: context, - confirmMessage: - TranslationBase.of(context).ereferralSaveSuccess + - value['ReferralNumber'].toString(), - okText: TranslationBase.of(context).ok, - okFunction: () { - AlertDialogBox.closeAlertDialog(context); - navigateToHome(context); - }).showAlertDialog(context); - }); + // this.widget.createEReferralRequestModel.fullName= ""; + this.widget.createEReferralRequestModel.otherRelationship= ""; + // this.widget.createEReferralRequestModel.; + // this.widget.createEReferralRequestModel. preferredBranchName= "Arryan Hospital"; + // this.widget.createEReferralRequestModel. preferredBranchName= "Arryan Hospital"; + + await model.createEReferral(this.widget.createEReferralRequestModel); }, loading: model.state == ViewState.BusyLocal, - disabled: medicalReportImages.length == 0, + disabled: medicalReportImages.length == 0 , ), ))); } - Future navigateToHome(context) async { - Navigator.of(context).popAndPushNamed(HOME); - } - - void confirmSelectHospital(List projects) { + void confirmSelectCityDialog(List cities) { showDialog( context: context, - child: SelectHospitalDialog( - hospitals: projects, - selectedHospital: _selectedHospital, + child: SelectCityDialog( + cities: cities, + selectedCity: _selectedCity, onValueSelected: (value) { setState(() { - _selectedHospital = value; + _selectedCity = value; }); }, ), ); } + String getRelationName() { - if (_selectedHospital != null) - return _selectedHospital.desciption; + if (_selectedCity != null) + return _selectedCity.description; else - return "Select Hospital*" /*TranslationBase.of(context).selectHospital*/; + return "Select Relationship" /*TranslationBase.of(context).selectHospital*/; } + } diff --git a/lib/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_step_two_page.dart b/lib/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_step_two_page.dart index 1ecd2e07..5f85fe12 100644 --- a/lib/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_step_two_page.dart +++ b/lib/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_step_two_page.dart @@ -8,7 +8,6 @@ import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/E-Referral/dial import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/medical/balance/new_text_Field.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; -import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/bottom_options/BottomSheet.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; @@ -72,7 +71,7 @@ class _NewEReferralStepTowPageState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ SizedBox( - height: 80, + height: 30, ), Center( child: Texts( @@ -180,7 +179,7 @@ class _NewEReferralStepTowPageState extends State { padding: EdgeInsets.all(9), child: SecondaryButton( textColor: Colors.white, - label: TranslationBase.of(context).next, + label: "Next", onTap: () async { this.widget.changePageViewIndex(2); this.widget.createEReferralRequestModel.identificationNo = int.parse( _patientIdentificationTextController.text); diff --git a/lib/pages/AlHabibMedicalService/E-Referral/dialogs/select_project_dialog.dart b/lib/pages/AlHabibMedicalService/E-Referral/dialogs/select_project_dialog.dart deleted file mode 100644 index 3a3cc083..00000000 --- a/lib/pages/AlHabibMedicalService/E-Referral/dialogs/select_project_dialog.dart +++ /dev/null @@ -1,129 +0,0 @@ -import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/EReferral/get_all_projects_response_model.dart'; -import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; -import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; -import 'package:flutter/material.dart'; - -class SelectHospitalDialog extends StatefulWidget { - - final List hospitals; - final Function(GetAllProjectsResponseModel) onValueSelected; - GetAllProjectsResponseModel selectedHospital; - - SelectHospitalDialog( - {Key key, this.hospitals, this.onValueSelected, this.selectedHospital}); - - @override - _SelectHospitalDialogState createState() => _SelectHospitalDialogState(); -} - -class _SelectHospitalDialogState extends State { - - @override - void initState() { - super.initState(); - widget.selectedHospital = widget.selectedHospital ?? widget.hospitals[0]; - } - - @override - Widget build(BuildContext context) { - return SimpleDialog( - children: [ - Column( - children: [ - Divider(), - ...List.generate( - widget.hospitals.length, - (index) => Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - SizedBox( - height: 2, - ), - Row( - children: [ - Expanded( - flex: 1, - child: InkWell( - onTap: () { - setState(() { - widget.selectedHospital = widget.hospitals[index]; - }); - }, - child: ListTile( - title: Text(widget.hospitals[index].desciption), - leading: Radio( - value: widget.hospitals[index], - groupValue: widget.selectedHospital, - activeColor: Colors.red[800], - onChanged: (value) { - setState(() { - widget.selectedHospital = value; - }); - }, - ), - ), - ), - ) - ], - ), - SizedBox( - height: 5.0, - ), - ], - ), - ), - SizedBox( - height: 5.0, - ), - Row( - // mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Expanded( - flex: 1, - child: InkWell( - onTap: () { - Navigator.pop(context); - }, - child: Padding( - padding: const EdgeInsets.all(8.0), - child: Container( - child: Center( - child: Texts( - TranslationBase.of(context).cancel.toUpperCase(), - color: Colors.red, - ), - ), - ), - ), - ), - ), - Container( - width: 1, - height: 30, - color: Colors.grey[500], - ), - Expanded( - flex: 1, - child: InkWell( - onTap: () { - widget.onValueSelected(widget.selectedHospital); - Navigator.pop(context); - }, - child: Padding( - padding: const EdgeInsets.all(8.0), - child: Center( - child: Texts( - TranslationBase.of(context).ok, - fontWeight: FontWeight.w400, - )), - ), - ), - ), - ], - ) - ], - ) - ], - ); - } -} diff --git a/lib/pages/AlHabibMedicalService/E-Referral/e_referral_page.dart b/lib/pages/AlHabibMedicalService/E-Referral/e_referral_page.dart index f50e67fa..9f836860 100644 --- a/lib/pages/AlHabibMedicalService/E-Referral/e_referral_page.dart +++ b/lib/pages/AlHabibMedicalService/E-Referral/e_referral_page.dart @@ -88,13 +88,13 @@ class _EReferralPageState extends State Container( width: MediaQuery.of(context).size.width * 0.37, child: Center( - child: Texts("New Referral", fontSize: 14.0), + child: Texts("New Referral"), ), ), Container( width: MediaQuery.of(context).size.width * 0.37, child: Center( - child: Texts("Search for Referrals", fontSize: 14.0), + child: Texts("Search for Referrals"), ), ), ], diff --git a/lib/pages/AlHabibMedicalService/E-Referral/referral_details.dart b/lib/pages/AlHabibMedicalService/E-Referral/referral_details.dart deleted file mode 100644 index 925d20cd..00000000 --- a/lib/pages/AlHabibMedicalService/E-Referral/referral_details.dart +++ /dev/null @@ -1,100 +0,0 @@ -import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/EReferral/get_ereferral_response_model.dart'; -import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; -import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; -import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; -import 'package:flutter/material.dart'; - -class ReferralDetails extends StatefulWidget { - GetEReferralResponseModel getEReferralResponseModel; - - ReferralDetails({@required this.getEReferralResponseModel}); - - @override - _ReferralDetailsState createState() => _ReferralDetailsState(); -} - -class _ReferralDetailsState extends State { - @override - Widget build(BuildContext context) { - return AppScaffold( - isShowDecPage: false, - isShowAppBar: true, - appBarTitle: "Referral Details", - body: Container( - margin: EdgeInsets.only(top: 20.0, left: 20.0, right: 20.0), - child: Table( - border: TableBorder.all(color: Colors.grey[600]), - children: [ - TableRow(children: [ - TableCell( - child: _getNormalText( - TranslationBase.of(context).referralStatus)), - TableCell( - child: - _getNormalText(widget.getEReferralResponseModel.status)), - ]), - TableRow(children: [ - TableCell( - child: - _getNormalText(TranslationBase.of(context).patientName)), - TableCell( - child: _getNormalText( - widget.getEReferralResponseModel.patientName)), - ]), - TableRow(children: [ - TableCell( - child: _getNormalText( - TranslationBase.of(context).referralNumber)), - TableCell( - child: _getNormalText(widget - .getEReferralResponseModel.referralNumber - .toString())), - ]), - TableRow(children: [ - TableCell( - child: _getNormalText( - TranslationBase.of(context).referralDate)), - TableCell( - child: _getNormalText(DateUtil.getMonthDayYearDateFormatted( - DateUtil.convertStringToDateNoTimeZone( - widget.getEReferralResponseModel.referralDate)))), - ]), - TableRow(children: [ - TableCell( - child: _getNormalText(TranslationBase.of(context).hospital)), - TableCell( - child: _getNormalText( - widget.getEReferralResponseModel.preferredBranchName)), - ]), - ], - ), - ), - ); - } - - _getNormalText(text) { - return Container( - color: Colors.white, - padding: EdgeInsets.only(top: 12.0, bottom: 12.0), - child: Text(text, - textAlign: TextAlign.center, - style: TextStyle( - fontSize: 14, - fontFamily: 'Open-Sans', - letterSpacing: 0.5, - color: Colors.grey[800])), - ); - } - - _getHeadingText(text) { - return Container( - padding: EdgeInsets.only(bottom: 10.0), - child: Text(text, - textAlign: TextAlign.center, - style: TextStyle( - fontSize: 26.0, - fontFamily: 'Open-Sans', - letterSpacing: 0.5, - color: Colors.white))); - } -} diff --git a/lib/pages/AlHabibMedicalService/E-Referral/search_for_referrals_page.dart b/lib/pages/AlHabibMedicalService/E-Referral/search_for_referrals_page.dart index 49c5dd60..0b75705d 100644 --- a/lib/pages/AlHabibMedicalService/E-Referral/search_for_referrals_page.dart +++ b/lib/pages/AlHabibMedicalService/E-Referral/search_for_referrals_page.dart @@ -1,25 +1,17 @@ -import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; -import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/EReferral/get_ereferral_response_model.dart'; import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/EReferral/search_criteria_model.dart'; import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/EReferral/search_e_referral_request_model.dart'; -import 'package:diplomaticquarterapp/core/service/AlHabibMedicalService/e_referral_service.dart'; import 'package:diplomaticquarterapp/core/viewModels/all_habib_medical_services/e_referral_view_model.dart'; -import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; -import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/E-Referral/referral_details.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/medical/balance/new_text_Field.dart'; -import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; -import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; -import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/errors/app_embedded_error.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; -import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; +import 'package:diplomaticquarterapp/widgets/others/network_base_view.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -import '../../../locator.dart'; import 'New_E_Referral/new_e_referral_step_one_page.dart'; import 'dialogs/select_country_ingo_Dialog.dart'; import 'dialogs/select_search_criteria_dialog.dart'; @@ -36,9 +28,6 @@ class _SearchForReferralsPageState extends State { TextEditingController _mobileTextController = TextEditingController(); bool _isSubmitted = false; - AuthenticatedUser authUser; - - List allReferrals = List(); dynamic _selectedCountry = { "name": "Saudi Arabia", @@ -52,13 +41,6 @@ class _SearchForReferralsPageState extends State { SearchCriteriaModel selectedCriteria = SearchCriteriaModel( name: "Identification Number", nameAr: "رقم المحول", value: 1); - @override - void initState() { - authUser = new AuthenticatedUser(); - WidgetsBinding.instance.addPostFrameCallback((_) => getPatientData()); - super.initState(); - } - @override Widget build(BuildContext context) { return BaseView( @@ -135,102 +117,35 @@ class _SearchForReferralsPageState extends State { ? "11" : _selectedCountry["code"], ), - allReferrals.length != 0 - ? Container( - transform: - Matrix4.translationValues(0.0, -40.0, 0.0), - child: ListView.builder( - shrinkWrap: true, - scrollDirection: Axis.vertical, - physics: ScrollPhysics(), - itemCount: allReferrals.length, - itemBuilder: - (BuildContext context, int index) { - return Container( - child: InkWell( - onTap: () { - navigateToReferralDetails( - allReferrals[index]); - }, - child: Card( - margin: EdgeInsets.only(bottom: 10.0), - color: Colors.white, - shape: RoundedRectangleBorder( - borderRadius: - BorderRadius.circular(10), - ), - child: Container( - margin: EdgeInsets.only( - left: 10.0, right: 10.0), - padding: EdgeInsets.all(5.0), - child: Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - children: [ - Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Container( - margin: - EdgeInsets.all(5.0), - child: Text( - allReferrals[index] - .status, - style: TextStyle( - fontSize: 16.0))), - Container( - margin: - EdgeInsets.all(5.0), - child: Text( - allReferrals[index] - .patientName, - style: TextStyle( - fontSize: 16.0, - color: Colors - .grey[600]))), - Container( - margin: - EdgeInsets.all(5.0), - child: Text( - allReferrals[index] - .preferredBranchName, - style: TextStyle( - fontSize: 16.0, - color: Colors - .grey[600]))), - Container( - margin: - EdgeInsets.all(5.0), - child: Text( - DateUtil.getMonthDayYearDateFormatted( - DateUtil.convertStringToDateNoTimeZone( - allReferrals[ - index] - .referralDate)), - style: TextStyle( - fontSize: 16.0, - color: Colors - .grey[600]))), - ], - ), - Container( - child: Icon(Icons.arrow_forward, - size: 20.0, - color: Colors.grey[700]), - ), - ], - ), - ), - ), - )); - }, - ), - ) - : Container(), SizedBox( - height: 70.0, - ) + height: 12, + ), + if ((model.state == ViewState.Idle && + model.allReferral.length == 0)) + Text("There's No Referral To deliver"), + if (( + model.state == ViewState.ErrorLocal)) + AppEmbeddedError( error:model.error), + NetworkBaseView( + baseViewModel: model, + child: ListView.builder( + shrinkWrap: true, + scrollDirection: Axis.vertical, + itemCount: model.allReferral == null + ? 0 + : model.allReferral.length < 3 + ? model.allReferral.length + : 3, + itemBuilder: (BuildContext context, int index) { + return Padding( + padding: EdgeInsets.symmetric(horizontal: 0.2), + child: Container( + child: Texts("TODO add referral info"), + ), + ); + }, + ), + ), ], ), ), @@ -245,13 +160,10 @@ class _SearchForReferralsPageState extends State { textColor: Colors.white, label: "Search", onTap: () async { - GifLoaderDialogUtils.showMyDialog(context); SearchEReferralRequestModel searchEReferralRequestModel = new SearchEReferralRequestModel( - patientMobileNumber: _selectedCountry['code'] - .toString() - .replaceFirst("+", "") + - _mobileTextController.text, + patientMobileNumber: + _selectedCountry['code'] + _mobileTextController.text, ); if (selectedCriteria.value == 1) { searchEReferralRequestModel.identificationNo = @@ -262,19 +174,9 @@ class _SearchForReferralsPageState extends State { int.parse(_searchTextController.text); searchEReferralRequestModel.identificationNo = ''; } - await model - .getEReferrals(searchEReferralRequestModel) - .then((response) { - GifLoaderDialogUtils.hideDialog(context); - print(response['List_EReferrals']); - allReferrals.clear(); - setState(() { - response['List_EReferrals'].forEach((data) { - allReferrals - .add(GetEReferralResponseModel.fromJson(data)); - _isSubmitted = true; - }); - }); + await model.getEReferrals(searchEReferralRequestModel); + setState(() { + _isSubmitted = true; }); }, loading: model.state == ViewState.BusyLocal, @@ -284,49 +186,6 @@ class _SearchForReferralsPageState extends State { ))); } - void getEreferralsIsLogin() { - EReferralService _eReferralService = locator(); - - String mobileNumber; - String zipCode; - - if (authUser.mobileNumber.length > 9) { - mobileNumber = - authUser.mobileNumber.substring(1, authUser.mobileNumber.length); - } else { - mobileNumber = authUser.mobileNumber; - } - - if (authUser.outSA == 0) { - zipCode = "966"; - } else { - zipCode = "971"; - } - - _eReferralService - .getEReferralsIfLogin(zipCode + mobileNumber) - .then((response) { - allReferrals.clear(); - setState(() { - response['List_EReferrals'].forEach((data) { - allReferrals.add(GetEReferralResponseModel.fromJson(data)); - }); - }); - }).catchError(() {}); - } - - getPatientData() async { - AppSharedPreferences sharedPref = AppSharedPreferences(); - if (await sharedPref.getObject(USER_PROFILE) != null) { - var data = - AuthenticatedUser.fromJson(await sharedPref.getObject(USER_PROFILE)); - setState(() { - authUser = data; - getEreferralsIsLogin(); - }); - } - } - void confirmSelectCountryTypeDialog() { showDialog( context: context, @@ -341,15 +200,6 @@ class _SearchForReferralsPageState extends State { ); } - navigateToReferralDetails( - GetEReferralResponseModel getEReferralResponseModel) { - Navigator.push( - context, - FadePage( - page: ReferralDetails( - getEReferralResponseModel: getEReferralResponseModel))); - } - String getCountryName() { if (_selectedCountry != null) return _selectedCountry["name"]; diff --git a/lib/pages/AlHabibMedicalService/HomeHealthCare/Dialog/confirm_cancel_order_dialog.dart b/lib/pages/AlHabibMedicalService/HomeHealthCare/Dialog/confirm_cancel_order_dialog.dart index bfab0324..17be8edd 100644 --- a/lib/pages/AlHabibMedicalService/HomeHealthCare/Dialog/confirm_cancel_order_dialog.dart +++ b/lib/pages/AlHabibMedicalService/HomeHealthCare/Dialog/confirm_cancel_order_dialog.dart @@ -29,7 +29,7 @@ class _ConfirmCancelOrderDialogState extends State { contentPadding: EdgeInsets.fromLTRB(28.0, 24.0, 28.0, 0.0), title: Center( child: Texts( - TranslationBase.of(context).confirm, + "Confirm", color: Colors.black, ), ), @@ -39,7 +39,7 @@ class _ConfirmCancelOrderDialogState extends State { Divider(), Center( child: Texts( - TranslationBase.of(context).cancelOrderMsg , + "Are you sure!! want to cancel this order", color: Colors.grey, ), ), diff --git a/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/location_page.dart b/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/location_page.dart deleted file mode 100644 index d7434b97..00000000 --- a/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/location_page.dart +++ /dev/null @@ -1,146 +0,0 @@ -import 'package:diplomaticquarterapp/config/config.dart'; -import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; -import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/add_new_address_Request_Model.dart'; -import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/home_health_care_view_model.dart'; -import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; -import 'package:diplomaticquarterapp/pages/base/base_view.dart'; -import 'package:diplomaticquarterapp/uitl/app_toast.dart'; -import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; -import 'package:diplomaticquarterapp/uitl/utils.dart'; -import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; -import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; -import 'package:flutter/cupertino.dart'; -import 'package:flutter/material.dart'; -import 'package:google_maps_flutter/google_maps_flutter.dart'; -import 'package:google_maps_place_picker/google_maps_place_picker.dart'; -import 'package:provider/provider.dart'; - -class LocationPage extends StatefulWidget { - final Function(PickResult) onPick; - final double latitude; - final double longitude; - final dynamic model; - - const LocationPage({Key key, this.onPick, this.latitude, this.longitude, this.model}) - : super(key: key); - - @override - _LocationPageState createState() => - _LocationPageState(); -} - -class _LocationPageState - extends State { - double latitude = 0; - double longitude = 0; - - @override - void initState() { - - latitude = widget.latitude; - longitude = widget.longitude; - super.initState(); - } - - - @override - Widget build(BuildContext context) { - ProjectViewModel projectViewModel = Provider.of(context); - return BaseView( - onModelReady: (model) {}, - builder: (_, model, widget) => AppScaffold( - isShowDecPage: false, - isShowAppBar: true, - baseViewModel: model, - body: PlacePicker( - apiKey: GOOGLE_API_KEY, - enableMyLocationButton: true, - automaticallyImplyAppBarLeading: false, - autocompleteOnTrailingWhitespace: true, - selectInitialPosition: true, - autocompleteLanguage: projectViewModel.currentLanguage, - enableMapTypeButton: true, - searchForInitialValue: false, - onPlacePicked: (PickResult result) { - print(result.adrAddress); - - }, - selectedPlaceWidgetBuilder: - (_, selectedPlace, state, isSearchBarFocused) { - print("state: $state, isSearchBarFocused: $isSearchBarFocused"); - return isSearchBarFocused - ? Container() - : FloatingCard( - bottomPosition: 0.0, - leftPosition: 0.0, - rightPosition: 0.0, - width: 500, - borderRadius: BorderRadius.circular(12.0), - child: state == SearchingState.Searching - ? Center(child: CircularProgressIndicator()) - : Container( - margin: EdgeInsets.all(12), - child: Column( - children: [ - SecondaryButton( - color: Colors.grey[800], - textColor: Colors.white, - onTap: () async { - AddNewAddressRequestModel - addNewAddressRequestModel = - new AddNewAddressRequestModel( - customer: Customer(addresses: [ - Addresses( - address1: - selectedPlace.formattedAddress, - address2: selectedPlace - .formattedAddress, - customerAttributes: "", - city: "", - createdOnUtc: "", - id: 0, - latLong: "$latitude,$longitude", - email: "") - ]), - ); - - selectedPlace.addressComponents.forEach((e) { - if (e.types.contains("country")) { - addNewAddressRequestModel.customer - .addresses[0].country = e.longName; - } - if (e.types.contains("postal_code")) { - addNewAddressRequestModel.customer - .addresses[0].zipPostalCode = - e.longName; - } - if (e.types.contains("locality")) { - addNewAddressRequestModel.customer - .addresses[0].city = - e.longName; - } - }); - - await model.addAddressInfo( - addNewAddressRequestModel: addNewAddressRequestModel); - if (model.state == ViewState.ErrorLocal) { - Utils.showErrorToast(model.error); - } else { - AppToast.showSuccessToast( - message: "Address Added Successfully"); - } - Navigator.of(context).pop(); - }, - label: TranslationBase.of(context).addNewAddress, - ), - ], - ), - ), - ); - }, - initialPosition: LatLng(latitude, longitude), - useCurrentLocation: false, - ), - )); - } -} diff --git a/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_Home_health_care_step_one_page.dart b/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_Home_health_care_step_one_page.dart index 447ba177..1dbee1b5 100644 --- a/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_Home_health_care_step_one_page.dart +++ b/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_Home_health_care_step_one_page.dart @@ -2,16 +2,15 @@ import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/PatientERHHCInsertServicesList.dart'; import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/patient_er_insert_pres_order_request_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/home_health_care_view_model.dart'; -import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; -import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; -import 'package:diplomaticquarterapp/uitl/utils.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:diplomaticquarterapp/widgets/pickupLocation/PickupLocationFromMap.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import 'package:geolocator/geolocator.dart'; import 'package:google_maps_place_picker/google_maps_place_picker.dart'; -import 'package:provider/provider.dart'; class NewHomeHealthCareStepOnePage extends StatefulWidget { final PatientERInsertPresOrderRequestModel @@ -46,8 +45,6 @@ class _NewHomeHealthCareStepOnePageState extends State { double latitude = 0; double longitude = 0; - AddressInfo _selectedAddress; @override void initState() { if (widget.patientERInsertPresOrderRequestModel.latitude == null) { - setLatitudeAndLongitude(); + latitude = widget.latitude; + longitude = widget.longitude; } else { latitude = widget.patientERInsertPresOrderRequestModel.latitude; longitude = widget.patientERInsertPresOrderRequestModel.longitude; } - super.initState(); } - setLatitudeAndLongitude({bool isSetState = false, String latLong}) { - if (latLong == null) - latLong = widget.model.addressesList[widget.model.addressesList - .length - 1].latLong; - List latLongArr = latLong.split(','); - - latitude = double.parse(latLongArr[0]); - longitude = double.parse(latLongArr[1]); - } - @override Widget build(BuildContext context) { ProjectViewModel projectViewModel = Provider.of(context); return AppScaffold( isShowDecPage: false, - body: Stack( - children: [ - PlacePicker( - apiKey: GOOGLE_API_KEY, - enableMyLocationButton: true, - automaticallyImplyAppBarLeading: false, - autocompleteOnTrailingWhitespace: true, - selectInitialPosition: true, - autocompleteLanguage: projectViewModel.currentLanguage, - enableMapTypeButton: true, - searchForInitialValue: false, - - onPlacePicked: (PickResult result) { - print(result.adrAddress); - widget.changePageViewIndex(3); - }, - selectedPlaceWidgetBuilder: - (_, selectedPlace, state, isSearchBarFocused) { - print("state: $state, isSearchBarFocused: $isSearchBarFocused"); - return isSearchBarFocused - ? Container() - : FloatingCard( - bottomPosition: 0.0, - leftPosition: 0.0, - rightPosition: 0.0, - width: 500, - borderRadius: BorderRadius.circular(12.0), - child: state == SearchingState.Searching - ? Center(child: CircularProgressIndicator()) - : Container( - margin: EdgeInsets.all(12), - child: Column( - children: [ - SecondaryButton( - color: Colors.grey[800], - textColor: Colors.white, - onTap: () { - Navigator.push( - context, - MaterialPageRoute( - builder: (BuildContext context) => - LocationPage( - latitude: latitude, - longitude: longitude, - ), - ), - ); - }, - label: TranslationBase.of(context).addNewAddress, - ), - SizedBox(height: 10,), - SecondaryButton( - color: Colors.red[800], - textColor: Colors.white, - onTap: () { - setState(() { - widget.patientERInsertPresOrderRequestModel - .latitude = - selectedPlace.geometry.location.lat; - widget.patientERInsertPresOrderRequestModel - .longitude = - selectedPlace.geometry.location.lng; - }); - widget.changePageViewIndex(3); - }, - label: TranslationBase.of(context).confirm, - ), - ], - ), - ), - ); - }, - initialPosition: LatLng(latitude, longitude), - useCurrentLocation: false, - ), - Container( - child: InkWell( - onTap: () => - confirmSelectLocationDialog(widget.model.addressesList), - child: Container( - padding: EdgeInsets.all(10), - width: double.infinity, - // height: 65, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(10), - color: Colors.white), - child: Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - children: [ - Expanded(child: Texts(getAddressName(), fontSize: 14,),), - Icon(Icons.arrow_drop_down) - ], - ), - ), - ), - height: 56, width: double.infinity, color: Theme - .of(context) - .scaffoldBackgroundColor, - - ) - ], - ), - ); - } - - - void confirmSelectLocationDialog(List addresses) { - showDialog( - context: context, - child: SelectLocationDialog( - addresses: addresses, - selectedAddress: _selectedAddress - , - onValueSelected: (value) { - setLatitudeAndLongitude(latLong: value.latLong); - setState(() { - _selectedAddress = value; - }); + body: PlacePicker( + apiKey: GOOGLE_API_KEY, + enableMyLocationButton: true, + automaticallyImplyAppBarLeading: false, + autocompleteOnTrailingWhitespace: true, + selectInitialPosition: true, + autocompleteLanguage: projectViewModel.currentLanguage, + enableMapTypeButton: true, + onPlacePicked: (PickResult result) { + print(result.adrAddress); + widget.changePageViewIndex(3); + }, + selectedPlaceWidgetBuilder: + (_, selectedPlace, state, isSearchBarFocused) { + print("state: $state, isSearchBarFocused: $isSearchBarFocused"); + return isSearchBarFocused + ? Container() + : FloatingCard( + bottomPosition: 0.0, + leftPosition: 0.0, + rightPosition: 0.0, + width: 500, + borderRadius: BorderRadius.circular(12.0), + child: state == SearchingState.Searching + ? Center(child: CircularProgressIndicator()) + : Container( + margin: EdgeInsets.all(12), + child: SecondaryButton( + color: Colors.grey[800], + textColor: Colors.white, + onTap: () { + setState(() { + widget.patientERInsertPresOrderRequestModel + .latitude = + selectedPlace.geometry.location.lat; + widget.patientERInsertPresOrderRequestModel + .longitude = + selectedPlace.geometry.location.lng; + }); + widget.changePageViewIndex(3); + }, + label: TranslationBase.of(context).next, + ), + ), + ); }, + initialPosition: LatLng(latitude, longitude), + useCurrentLocation: true, ), ); } - - String getAddressName() { - if (_selectedAddress != null) - return _selectedAddress.address1; - else - return TranslationBase.of(context).selectAddress; - } } diff --git a/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_home_health_care_page.dart b/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_home_health_care_page.dart index d9bf67d8..87a33c6d 100644 --- a/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_home_health_care_page.dart +++ b/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_home_health_care_page.dart @@ -3,19 +3,16 @@ import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealth import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/patient_er_insert_pres_order_request_model.dart'; import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/update_pres_oreder_request_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/home_health_care_view_model.dart'; -import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/HomeHealthCare/Dialog/confirm_cancel_order_dialog.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_Home_health_care_step_three_page.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_Home_health_care_step_tow_page.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; -import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:flutter/material.dart'; import 'package:geolocator/geolocator.dart'; -import 'package:provider/provider.dart'; import '../StepsWidget.dart'; import 'new_Home_health_care_step_one_page.dart'; @@ -87,7 +84,7 @@ class _NewHomeHealthCarePageState extends State if (model.state == ViewState.ErrorLocal) { Utils.showErrorToast(model.error); } else { - AppToast.showSuccessToast(message:TranslationBase.of(context).processDoneSuccessfully ); + AppToast.showSuccessToast(message: "Done Successfully"); await model.getHHCAllPresOrders(); // await model.getHHCAllServices(); } @@ -95,8 +92,6 @@ class _NewHomeHealthCarePageState extends State )); } - ProjectViewModel projectViewModel = Provider.of(context); - return Scaffold( body: SafeArea( child: SingleChildScrollView( @@ -104,6 +99,7 @@ class _NewHomeHealthCarePageState extends State height: MediaQuery.of(context).size.height * 0.8, child: Column( children: [ + Container( margin: EdgeInsets.only(left: MediaQuery.of(context).size.width*0.05, right: MediaQuery.of(context).size.width*0.05), child: StepsWidget( @@ -142,7 +138,7 @@ class _NewHomeHealthCarePageState extends State Container( width: double.infinity, padding: EdgeInsets.only( - left: 15, bottom: 15, top: 15,right: 15), + left: 15, bottom: 15, top: 15), decoration: BoxDecoration( border: Border( bottom: BorderSide( @@ -156,9 +152,7 @@ class _NewHomeHealthCarePageState extends State crossAxisAlignment: CrossAxisAlignment.start, children: [ Texts( - TranslationBase - .of(context) - .requestID, + "Request ID", bold: false, fontSize: 13, ), @@ -175,7 +169,7 @@ class _NewHomeHealthCarePageState extends State Container( width: double.infinity, padding: EdgeInsets.only( - left: 15, bottom: 15, top: 15,right: 15), + left: 15, bottom: 15, top: 15), decoration: BoxDecoration( border: Border( bottom: BorderSide( @@ -189,9 +183,7 @@ class _NewHomeHealthCarePageState extends State crossAxisAlignment: CrossAxisAlignment.start, children: [ Texts( - TranslationBase - .of(context) - .OrderStatus, + "Status", bold: false, fontSize: 13, ), @@ -199,11 +191,7 @@ class _NewHomeHealthCarePageState extends State height: 4, ), Texts( - - projectViewModel.isArabic ? widget - .model.pendingOrder - .descriptionN : widget.model - .pendingOrder.description, + widget.model.pendingOrder.description, fontSize: 22, ), ], @@ -212,7 +200,7 @@ class _NewHomeHealthCarePageState extends State Container( width: double.infinity, padding: EdgeInsets.only( - left: 15, bottom: 15, top: 15,right: 15), + left: 15, bottom: 15, top: 15), decoration: BoxDecoration( border: Border( bottom: BorderSide( @@ -226,7 +214,7 @@ class _NewHomeHealthCarePageState extends State crossAxisAlignment: CrossAxisAlignment.start, children: [ Texts( - TranslationBase.of(context).pickupDate, + "Pickup Date", bold: false, fontSize: 13, ), @@ -247,7 +235,7 @@ class _NewHomeHealthCarePageState extends State (index) => Container( width: double.infinity, padding: EdgeInsets.only( - left: 15, bottom: 15, top: 15,right: 15), + left: 15, bottom: 15, top: 15), decoration: BoxDecoration( border: Border( bottom: BorderSide( @@ -262,9 +250,7 @@ class _NewHomeHealthCarePageState extends State CrossAxisAlignment.start, children: [ Texts( - TranslationBase - .of(context) - .serviceName, + "Service Name", bold: false, fontSize: 13, ), @@ -272,12 +258,7 @@ class _NewHomeHealthCarePageState extends State height: 4, ), Texts( - projectViewModel.isArabic - ? widget.model - .hhcAllOrderDetail[index] - .descriptionN - : widget.model - .hhcAllOrderDetail[index] + widget.model.hhcAllOrderDetail[index] .description, fontSize: 22, bold: true, @@ -294,7 +275,7 @@ class _NewHomeHealthCarePageState extends State width: MediaQuery.of(context).size.width * 0.85, child: SecondaryButton( - label: TranslationBase.of(context).cancel.toUpperCase(), + label: "Cancel".toUpperCase(), onTap: () { showConfirmMessage(widget.model, widget.model.hhcAllOrderDetail[0]); diff --git a/lib/pages/AlHabibMedicalService/HomeHealthCare/home_health_care_index_page.dart b/lib/pages/AlHabibMedicalService/HomeHealthCare/home_health_care_index_page.dart new file mode 100644 index 00000000..fa0799f9 --- /dev/null +++ b/lib/pages/AlHabibMedicalService/HomeHealthCare/home_health_care_index_page.dart @@ -0,0 +1,69 @@ +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:hexcolor/hexcolor.dart'; + +import 'home_health_care_page.dart'; + +class HomeHealthCareIndexPage extends StatelessWidget { + @override + Widget build(BuildContext context) { + return AppScaffold( + isShowAppBar: true, + appBarTitle: TranslationBase.of(context).serviceInformation, + body: SingleChildScrollView( + padding: EdgeInsets.all(12), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts( + TranslationBase.of(context).homeHealthCare, + fontWeight: FontWeight.normal, + fontSize: 25, + color: Color(0xff60686b), + ), + SizedBox( + height: 12, + ), + Texts( + TranslationBase.of(context).homeHealthCareText, + fontWeight: FontWeight.normal, + fontSize: 17, + ), + SizedBox( + height: 22, + ), + Center( + child: Image.asset( + 'assets/images/AlHabibMedicalService/Wifi-AR.png')), + SizedBox( + height: 77, + ), + ], + )), + bottomSheet: Container( + height: MediaQuery.of(context).size.height * 0.10, + width: double.infinity, + child: Column( + children: [ + Container( + width: MediaQuery.of(context).size.width * 0.9, + child: SecondaryButton( + onTap: () => Navigator.push( + context, + FadePage( + page: HomeHealthCarePage(), + ), + ), + label: TranslationBase.of(context).loginRegister, + textColor: Theme.of(context).backgroundColor), + ), + ], + ), + )); + } +} diff --git a/lib/pages/AlHabibMedicalService/HomeHealthCare/home_health_care_page.dart b/lib/pages/AlHabibMedicalService/HomeHealthCare/home_health_care_page.dart index fcdc144a..8f4821f6 100644 --- a/lib/pages/AlHabibMedicalService/HomeHealthCare/home_health_care_page.dart +++ b/lib/pages/AlHabibMedicalService/HomeHealthCare/home_health_care_page.dart @@ -42,7 +42,6 @@ class _HomeHealthCarePageState extends State }, builder: (_, model, widget) => AppScaffold( isShowAppBar: true, - description: TranslationBase.of(context).HHCNotAuthMsg, appBarTitle: TranslationBase.of(context).homeHealthCare, body: Scaffold( extendBodyBehindAppBar: true, diff --git a/lib/pages/AlHabibMedicalService/HomeHealthCare/orders_log_details_page.dart b/lib/pages/AlHabibMedicalService/HomeHealthCare/orders_log_details_page.dart index f0ca5fe4..0cfedb41 100644 --- a/lib/pages/AlHabibMedicalService/HomeHealthCare/orders_log_details_page.dart +++ b/lib/pages/AlHabibMedicalService/HomeHealthCare/orders_log_details_page.dart @@ -2,16 +2,13 @@ import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/get_hhc_all_pres_orders_response_model.dart'; import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/update_pres_oreder_request_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/home_health_care_view_model.dart'; -import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; -import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/material.dart'; -import 'package:provider/provider.dart'; import 'Dialog/confirm_cancel_order_dialog.dart'; @@ -22,8 +19,6 @@ class OrdersLogDetailsPage extends StatelessWidget { @override Widget build(BuildContext context) { - ProjectViewModel projectViewModel = Provider.of(context); - void showConfirmMessage( HomeHealthCareViewModel model, GetHHCAllPresOrdersResponseModel order) { showDialog( @@ -34,219 +29,212 @@ class OrdersLogDetailsPage extends StatelessWidget { UpdatePresOrderRequestModel updatePresOrderRequestModel = UpdatePresOrderRequestModel( presOrderID: order.iD, - rejectionReason: "", - presOrderStatus: 4, editedBy: 3); + rejectionReason: "", + presOrderStatus: 4, editedBy: 3); await model.updateHHCPresOrder(updatePresOrderRequestModel); if(model.state == ViewState.ErrorLocal) { - Utils.showErrorToast(model.error); + Utils.showErrorToast(model.error); } else { - AppToast.showSuccessToast(message:TranslationBase.of(context).processDoneSuccessfully ); + AppToast.showSuccessToast(message: "Done Successfully"); await model.getHHCAllPresOrders(); - // await model.getHHCAllServices(); + // await model.getHHCAllServices(); } }, )); } return AppScaffold( - isShowAppBar: false, - baseViewModel: model, - body: SingleChildScrollView( - physics: ScrollPhysics(), - child: Container( - margin: EdgeInsets.all(12), - child: Center( - child: FractionallySizedBox( - widthFactor: 0.94, - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - SizedBox( - height: 50, - ), - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: model.hhcAllPresOrders.map((order) { - return Container( - width: double.infinity, - margin: EdgeInsets.only(top: 15), - decoration: BoxDecoration( - border: - Border.all(color: Colors.grey, width: 1), - borderRadius: BorderRadius.circular(12), - color: Colors.white), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - SizedBox( - height: 12, - ), - Container( - width: double.infinity, - padding: EdgeInsets.only( - left: 15, bottom: 15, top: 15, right: 15), - decoration: BoxDecoration( - border: Border( - bottom: BorderSide( - color: Colors.grey, - width: 1.0, - ), - ), - // borderRadius: BorderRadius.circular(12), - color: Colors.white), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Texts( - TranslationBase - .of(context) - .requestID, - bold: false, - fontSize: 13, - ), - SizedBox( - height: 4, - ), - Texts( - order.iD.toString(), - fontSize: 22, - ), - ], + isShowAppBar: false, + baseViewModel: model, + body: SingleChildScrollView( + physics: ScrollPhysics(), + child: Container( + margin: EdgeInsets.all(12), + child: Center( + child: FractionallySizedBox( + widthFactor: 0.94, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 50, + ), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: model.hhcAllPresOrders.map((order) { + return Container( + width: double.infinity, + margin: EdgeInsets.only(top: 15), + decoration: BoxDecoration( + border: + Border.all(color: Colors.grey, width: 1), + borderRadius: BorderRadius.circular(12), + color: Colors.white), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 12, ), - ), - Container( - width: double.infinity, - padding: EdgeInsets.only( - left: 15, bottom: 15, top: 15, right: 15), - decoration: BoxDecoration( - border: Border( - bottom: BorderSide( - color: Colors.grey, - width: 1.0, + Container( + width: double.infinity, + padding: EdgeInsets.only( + left: 15, bottom: 15, top: 15), + decoration: BoxDecoration( + border: Border( + bottom: BorderSide( + color: Colors.grey, + width: 1.0, + ), ), - ), - // borderRadius: BorderRadius.circular(12), - color: Colors.white), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Texts( - TranslationBase - .of(context) - .OrderStatus, - bold: false, - fontSize: 13, - ), - SizedBox( - height: 4, - ), - Texts( - - projectViewModel.isArabic ? order.descriptionN : order.description, - fontSize: 22, - ), - ], + // borderRadius: BorderRadius.circular(12), + color: Colors.white), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Texts( + "Request ID", + bold: false, + fontSize: 13, + ), + SizedBox( + height: 4, + ), + Texts( + order.iD.toString(), + fontSize: 22, + ), + ], + ), ), - ), - Container( - width: double.infinity, - padding: EdgeInsets.only( - left: 15, bottom: 15, top: 15, right: 15), - decoration: BoxDecoration( - border: Border( - bottom: BorderSide( - color: Colors.grey, - width: 1.0, + Container( + width: double.infinity, + padding: EdgeInsets.only( + left: 15, bottom: 15, top: 15), + decoration: BoxDecoration( + border: Border( + bottom: BorderSide( + color: Colors.grey, + width: 1.0, + ), ), - ), - // borderRadius: BorderRadius.circular(12), - color: Colors.white), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Texts( - TranslationBase - .of(context) - .pickupDate, - bold: false, - fontSize: 13, - ), - SizedBox( - height: 4, - ), - Texts( - DateUtil.getDayMonthYearDateFormatted( - DateUtil.convertStringToDate(order.createdOn)), - fontSize: 22, - ), - ], + // borderRadius: BorderRadius.circular(12), + color: Colors.white), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Texts( + "Status", + bold: false, + fontSize: 13, + ), + SizedBox( + height: 4, + ), + Texts( + order.description, + fontSize: 22, + ), + ], + ), ), - ), - - SizedBox( - height: 12, - ), - Container( - width: double.infinity, - padding: EdgeInsets.only( - left: 15, bottom: 15, top: 15, right: 15), - decoration: BoxDecoration( - border: Border( - bottom: BorderSide( - color: Colors.grey, - width: 1.0, + Container( + width: double.infinity, + padding: EdgeInsets.only( + left: 15, bottom: 15, top: 15), + decoration: BoxDecoration( + border: Border( + bottom: BorderSide( + color: Colors.grey, + width: 1.0, + ), ), - ), - // borderRadius: BorderRadius.circular(12), - color: Colors.white), - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Texts( - TranslationBase.of(context).orderLocation, - bold: false, - fontSize: 13, - ), - SizedBox( - height: 4, - ), - Texts( - !projectViewModel.isArabic ?order.nearestProjectDescription - .toString() : - order.nearestProjectDescriptionN - .toString(), - fontSize: 22, - ), - ], + // borderRadius: BorderRadius.circular(12), + color: Colors.white), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Texts( + "Pickup Date", + bold: false, + fontSize: 13, + ), + SizedBox( + height: 4, + ), + Texts( + DateUtil.getDayMonthYearDateFormatted( + DateUtil.convertStringToDate( + order.createdOn)), + fontSize: 22, + ), + ], + ), ), - ), - SizedBox( - height: 12, - ), - if (order.status == 1 ||order.status == 2 ) - Center( - child: Container( - width: MediaQuery - .of(context) - .size - .width * - 0.85, - child: SecondaryButton( - label: "Cancel".toUpperCase(), - onTap: () { - showConfirmMessage(model, order); - } - , - color: Colors.red[800], - disabled: false, - textColor: Theme - .of(context) - .backgroundColor), + Container( + width: double.infinity, + padding: EdgeInsets.only( + left: 15, bottom: 15, top: 15), + decoration: BoxDecoration( + border: Border( + bottom: BorderSide( + color: Colors.grey, + width: 1.0, + ), + ), + // borderRadius: BorderRadius.circular(12), + color: Colors.white), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Texts( + "Location", + bold: false, + fontSize: 13, + ), + SizedBox( + height: 4, + ), + Texts( + order.nearestProjectDescription + .toString() ?? + order.nearestProjectDescriptionN + .toString(), + fontSize: 22, + ), + ], ), ), - SizedBox( - height: 12, + SizedBox( + height: 12, + ), + if (order.status == 1 ||order.status == 2 ) + Center( + child: Container( + width: MediaQuery + .of(context) + .size + .width * + 0.85, + child: SecondaryButton( + label: "Cancel".toUpperCase(), + onTap: () { + showConfirmMessage(model, order); + } + , + color: Colors.red[800], + disabled: false, + textColor: Theme + .of(context) + .backgroundColor), + ), + ), + SizedBox( + height: 12, ), ], ), diff --git a/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart b/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart index 60d643c5..7e3d4181 100644 --- a/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart +++ b/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart @@ -1,11 +1,9 @@ import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; -import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/%E2%80%8B%20health_calculators.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/E-Referral/e_referral_index_page.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/E-Referral/e_referral_page.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/h2o/h2o_index_page.dart'; -import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health-weather/health-weather-indicator.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health_converter.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/my_web_view.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/parking_page.dart'; @@ -23,16 +21,13 @@ import 'package:diplomaticquarterapp/pages/paymentService/payment_service.dart'; import 'package:diplomaticquarterapp/pages/symptom-checker/info.dart'; import 'package:diplomaticquarterapp/routes.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; -import 'package:diplomaticquarterapp/uitl/location_util.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/data_display/services)contaniner.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; -import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -import 'package:provider/provider.dart'; import 'package:url_launcher/url_launcher.dart'; class AllHabibMedicalService extends StatefulWidget { @@ -59,7 +54,6 @@ class _AllHabibMedicalServiceState extends State { @override Widget build(BuildContext context) { - ProjectViewModel projectViewModel = Provider.of(context); return AppScaffold( isShowAppBar: true, appBarTitle: TranslationBase.of(context).alhabiServices, @@ -129,16 +123,7 @@ class _AllHabibMedicalServiceState extends State { 'assets/images/new-design/my_file_bottom_bar.png', title: TranslationBase.of(context).myMedicalFile, ), - ServicesContainer( - onTap: () => Navigator.push( - context, - FadePage( - page: LiveCareHome(), - ), - ), - imageLocation: 'assets/images/new-design/liveCare_ar_bg.png', - title: TranslationBase.of(context).livecare, - ), + ServicesContainer( onTap: () => Navigator.push( context, @@ -152,7 +137,6 @@ class _AllHabibMedicalServiceState extends State { 'assets/images/new-design/booking_icon_active.png', title: TranslationBase.of(context).bookAppo, ), - if(projectViewModel.havePrivilege(58)) ServicesContainer( onTap: () => Navigator.push( context, @@ -164,15 +148,7 @@ class _AllHabibMedicalServiceState extends State { 'assets/images/al-habib_online_payment_service_icon.png', title: TranslationBase.of(context).onlinePaymentService, ), - ServicesContainer( - onTap: () => Navigator.push( - context, - FadePage(), - ), - imageLocation: - 'assets/images/al-habib_online_payment_service_icon.png', - title: 'Covid-19- Drive-Thru Test', - ), + ServicesContainer( onTap: () { Navigator.push( @@ -187,37 +163,7 @@ class _AllHabibMedicalServiceState extends State { imageLocation: 'assets/images/emergency_service_image.png', title: TranslationBase.of(context).emergencyService, ), - ServicesContainer( - onTap: () => Navigator.push( - context, - FadePage( - page: ParkingPage(), - ), - ), - imageLocation: 'assets/images/pharmacy_logo.png', - title: 'Pharmacy'), - ServicesContainer( - onTap: () => Navigator.push( - context, - FadePage( - page: InsuranceUpdate(), - ), - ), - imageLocation: - 'assets/images/medical/insurance_card_icon.png', - title: TranslationBase.of(context).updateInsurance, - ), - ServicesContainer( - onTap: () => Navigator.push( - context, - FadePage( - page: authUser.patientID == null - ? EReferralIndexPage() - : EReferralPage()), - ), - imageLocation: 'assets/images/ereferral_service_icon.png', - title: 'E-Referral', - ), + ServicesContainer( onTap: () => Navigator.push( context, @@ -227,18 +173,9 @@ class _AllHabibMedicalServiceState extends State { ), imageLocation: 'assets/images/new-design/family_menu_icon_red.png', - title: TranslationBase.of(context).family, - ), - if(projectViewModel.havePrivilege(35)) - ServicesContainer( - onTap: () => Navigator.push( - context, - FadePage(page: ChildVaccinesPage()), - ), - imageLocation: - 'assets/images/new-design/children_vaccines_icon.png', - title: 'Child Vaccines', + title: 'My Family', ), + ServicesContainer( onTap: () => Navigator.push( context, @@ -250,65 +187,7 @@ class _AllHabibMedicalServiceState extends State { 'assets/images/new-design/upcoming_icon_bottom_bar.png', title: TranslationBase.of(context).todoList, ), - if(projectViewModel.havePrivilege(42)) - ServicesContainer( - onTap: () => Navigator.push( - context, - FadePage(page: SymptomInfo()), - ), - imageLocation: 'assets/images/new-design/body_icon.png', - title: 'Symptom Checker'), - if(projectViewModel.havePrivilege(36)) - ServicesContainer( - onTap: () => Navigator.push( - context, - FadePage(page: BloodDonationPage()), - ), - imageLocation: 'assets/images/new-design/blood_icon.png', - title: 'Blood Donation', - ), - ServicesContainer( - onTap: () => Navigator.push( - context, - FadePage( - page: (HealthCalculators()), - ), - ), - imageLocation: - 'assets/images/new-design/health_calculator_icon.png', - title: 'Health Calculators', - ), - ServicesContainer( - onTap: () => Navigator.push( - context, - FadePage( - page: HealthConverter(), - ), - ), - imageLocation: - 'assets/images/new-design/health_convertor_icon.png', - title: 'Health Converter', - ), - if(projectViewModel.havePrivilege(38)) - ServicesContainer( - onTap: () => Navigator.push( - context, - FadePage( - page: H2OPageIndexPage(), - ), - ), - imageLocation: 'assets/images/new-design/water_icon.png', - title: 'H2O', - ), - if(projectViewModel.havePrivilege(41)) - ServicesContainer( - onTap: () => Navigator.push( - context, - FadePage(), - ), - imageLocation: 'assets/images/new-design/smartwatch_icon.png', - title: TranslationBase.of(context).smartWatches, - ), + ServicesContainer( onTap: () => Navigator.push( context, @@ -325,23 +204,20 @@ class _AllHabibMedicalServiceState extends State { "https://hmgwebservices.com/vt_mobile/html/index.html"), imageLocation: 'assets/images/new-design/virtual_tour_icon.png', - title: TranslationBase.of(context).vTour, + title: 'Virtual Tour', ), ServicesContainer( onTap: () { - Navigator.of(context).push( - MaterialPageRoute( + Navigator.of(context).push(MaterialPageRoute( builder: (BuildContext context) => MyWebView( - title: TranslationBase.of(context).hmgNews, - selectedUrl: - "https://twitter.com/hashtag/مجموعة_د_سليمان_الحبيب_الطبية?src=hashtag_click&f=live", - ), - ), - ); + title: "HMG News", + selectedUrl: + "https://twitter.com/hashtag/مجموعة_د_سليمان_الحبيب_الطبية?src=hashtag_click&f=live", + ))); }, imageLocation: 'assets/images/new-design/twitter_dashboard_icon.png', - title: TranslationBase.of(context).latestNews, + title: 'Latest News', ), ServicesContainer( onTap: () => Navigator.push( @@ -351,7 +227,7 @@ class _AllHabibMedicalServiceState extends State { ), ), imageLocation: 'assets/images/new-design/find_us_icon.png', - title: TranslationBase.of(context).findUs, + title: 'Find Us', ), ], ), diff --git a/lib/pages/AlHabibMedicalService/health-weather/health-weather-indicator.dart b/lib/pages/AlHabibMedicalService/health-weather/health-weather-indicator.dart deleted file mode 100644 index 343c6e3e..00000000 --- a/lib/pages/AlHabibMedicalService/health-weather/health-weather-indicator.dart +++ /dev/null @@ -1,137 +0,0 @@ -import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; -import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; -import 'package:diplomaticquarterapp/core/viewModels/weather/weather_view_model.dart'; -import 'package:diplomaticquarterapp/pages/base/base_view.dart'; -import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; -import 'package:diplomaticquarterapp/uitl/location_util.dart'; -import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; -import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; -import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart'; -import 'package:diplomaticquarterapp/widgets/weather_slider/weather_slider.dart'; -import 'package:flutter/cupertino.dart'; -import 'package:flutter/material.dart'; -import 'package:provider/provider.dart'; -import 'package:diplomaticquarterapp/widgets/progress_indicator/app_circular_progress_Indeicator.dart'; - -class HealthWeatherIndicator extends StatefulWidget { - @override - _HospitalsPageState createState() => _HospitalsPageState(); -} - -class _HospitalsPageState extends State { - var data; - LocationUtils locationUtils; - AppSharedPreferences sharedPref = AppSharedPreferences(); - var weather = '--'; - @override - void initState() { - locationUtils = - new LocationUtils(isShowConfirmDialog: true, context: context); - WidgetsBinding.instance - .addPostFrameCallback((_) => locationUtils.getCurrentLocation()); - getWeather(); - super.initState(); - } - - @override - Widget build(BuildContext context) { - ProjectViewModel projectViewModel = Provider.of(context); - return BaseView( - onModelReady: (model) => model.getWeatherData(), - allowAny: true, - builder: (_, mode, widget) => AppScaffold( - isShowDecPage: false, - appBarTitle: TranslationBase.of(context).healthWeatherIndicators, - isShowAppBar: true, - body: mode.weatherIndicatorData.length > 0 - ? SingleChildScrollView( - child: Column(children: [ - Container( - margin: EdgeInsets.all(8), - width: double.infinity, - height: 150, - decoration: BoxDecoration( - image: DecorationImage( - image: - ExactAssetImage('assets/images/Weather_img.png'), - fit: BoxFit.cover, - ), - borderRadius: BorderRadius.circular(8.0)), - child: Padding( - padding: EdgeInsets.symmetric(horizontal: 10.0), - child: Row( - children: [ - Expanded( - flex: 3, - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( - TranslationBase.of(context) - .healthWeatherIndicators, - color: Colors.white, - fontWeight: FontWeight.w600, - ), - AppText( - TranslationBase.of(context) - .healthTipsBasedOnCurrentWeather, - color: Colors.white, - fontSize: 14, - ), - ], - )), - Expanded( - flex: 2, - child: InkWell( - onTap: () {}, - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Row( - mainAxisAlignment: - MainAxisAlignment.center, - children: [ - Image.asset( - 'assets/images/Weather_ico.png', - width: 60, - height: 60, - ), - AppText(weather, - fontSize: 22, color: Colors.white) - ], - ), - ], - )), - ) - ], - ), - ), - ), - Padding( - padding: EdgeInsets.all(15), - child: AppText( - projectViewModel.isArabic - ? mode.weatherIndicatorData[0].cityNameN - : mode.weatherIndicatorData[0].cityName, - fontSize: 24, - fontWeight: FontWeight.bold, - )), - Padding( - padding: EdgeInsets.all(15), - child: Column( - children: mode.weatherIndicatorData.map((data) { - return WeatherSlider(data); - }).toList())) - ])) - : Center(child: AppCircularProgressIndicator())), - ); - } - - getWeather() async { - var data = await this.sharedPref.getObject(WEATHER); - setState(() { - weather = data['Temperature'].toString() + '\u2103' ?? '--'; - }); - } -} diff --git a/lib/pages/AlHabibMedicalService/parking_page.dart b/lib/pages/AlHabibMedicalService/parking_page.dart index a49a4b20..82c390ea 100644 --- a/lib/pages/AlHabibMedicalService/parking_page.dart +++ b/lib/pages/AlHabibMedicalService/parking_page.dart @@ -18,7 +18,6 @@ class ParkingPage extends StatelessWidget { onModelReady: (model) => model.getIsSaveParking(), builder: (_, model, widget) => AppScaffold( isShowAppBar: true, - isShowDecPage: false, appBarTitle: TranslationBase.of(context).parking, body: SingleChildScrollView( padding: EdgeInsets.all(12), diff --git a/lib/pages/Blood/blood_donation.dart b/lib/pages/Blood/blood_donation.dart index ad1d8785..99e5242e 100644 --- a/lib/pages/Blood/blood_donation.dart +++ b/lib/pages/Blood/blood_donation.dart @@ -27,6 +27,7 @@ import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:giffy_dialog/giffy_dialog.dart'; +import 'package:smart_progress_bar/smart_progress_bar.dart'; //import '../../../core/model/my_balance/AdvanceModel.dart'; import 'confirm_payment_page.dart'; diff --git a/lib/pages/Blood/confirm_payment_page.dart b/lib/pages/Blood/confirm_payment_page.dart index 75282190..3d9fccb2 100644 --- a/lib/pages/Blood/confirm_payment_page.dart +++ b/lib/pages/Blood/confirm_payment_page.dart @@ -2,7 +2,6 @@ import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; import 'package:diplomaticquarterapp/core/model/my_balance/AdvanceModel.dart'; import 'package:diplomaticquarterapp/core/model/my_balance/patient_info_and_mobile_number.dart'; -import 'package:diplomaticquarterapp/core/viewModels/appointment_rate_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/my_balance_view_model.dart'; import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart'; import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; @@ -11,7 +10,6 @@ import 'package:diplomaticquarterapp/routes.dart'; import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; -import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; @@ -20,6 +18,7 @@ import 'package:diplomaticquarterapp/widgets/in_app_browser/InAppBrowser.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import 'package:smart_progress_bar/smart_progress_bar.dart'; import 'dialogs/ConfirmSMSDialog.dart'; import 'new_text_Field.dart'; @@ -160,16 +159,16 @@ class ConfirmPaymentPage extends StatelessWidget { label: TranslationBase.of(context).confirm.toUpperCase(), disabled: model.state == ViewState.Busy, onTap: () { - GifLoaderDialogUtils.showMyDialog(context); model .sendActivationCodeForAdvancePayment( patientID: int.parse(advanceModel.fileNumber), projectID: advanceModel.hospitalsModel.iD) .then((value) { - GifLoaderDialogUtils.hideDialog(context); if (model.state != ViewState.ErrorLocal && model.state != ViewState.Error) showSMSDialog(); - }); + }).showProgressBar( + text: "Loading", + backgroundColor: Colors.blue.withOpacity(0.6)); }, ), ), @@ -214,9 +213,6 @@ class ConfirmPaymentPage extends StatelessWidget { appo.projectID.toString(), authenticatedUser.emailAddress, paymentMethod, - authenticatedUser.patientType, - authenticatedUser.firstName, - authenticatedUser.patientID, authenticatedUser, browser); } @@ -249,14 +245,12 @@ class ConfirmPaymentPage extends StatelessWidget { checkPaymentStatus(AppoitmentAllHistoryResultList appo) { DoctorsListService service = new DoctorsListService(); - GifLoaderDialogUtils.showMyDialog(AppGlobal.context); service .checkPaymentStatus( Utils.getAppointmentTransID( appo.projectID, appo.clinicID, appo.appointmentNo), AppGlobal.context) .then((res) { - GifLoaderDialogUtils.hideDialog(AppGlobal.context); print("Printing Payment Status Reponse!!!!"); print(res); String paymentInfo = res['Response_Message']; @@ -266,21 +260,18 @@ class ConfirmPaymentPage extends StatelessWidget { AppToast.showErrorToast(message: res['Response_Message']); } }).catchError((err) { - GifLoaderDialogUtils.hideDialog(AppGlobal.context); - AppToast.showErrorToast(message: err); print(err); - }); + }).showProgressBar( + text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); } createAdvancePayment(res, AppoitmentAllHistoryResultList appo) { DoctorsListService service = new DoctorsListService(); String paymentReference = res['Fort_id'].toString(); - GifLoaderDialogUtils.showMyDialog(AppGlobal.context); service .createAdvancePayment(appo, appo.projectID.toString(), res['Amount'], res['Fort_id'], res['PaymentMethod'], AppGlobal.context) .then((res) { - GifLoaderDialogUtils.hideDialog(AppGlobal.context); print(res['OnlineCheckInAppointments'][0]['AdvanceNumber']); addAdvancedNumberRequest( res['OnlineCheckInAppointments'][0]['AdvanceNumber'].toString(), @@ -288,28 +279,24 @@ class ConfirmPaymentPage extends StatelessWidget { appo.appointmentNo.toString(), appo); }).catchError((err) { - GifLoaderDialogUtils.hideDialog(AppGlobal.context); - AppToast.showErrorToast(message: err); print(err); - }); + }).showProgressBar( + text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); } addAdvancedNumberRequest(String advanceNumber, String paymentReference, String appointmentID, AppoitmentAllHistoryResultList appo) { DoctorsListService service = new DoctorsListService(); - GifLoaderDialogUtils.showMyDialog(AppGlobal.context); service .addAdvancedNumberRequest( advanceNumber, paymentReference, appointmentID, AppGlobal.context) .then((res) { - GifLoaderDialogUtils.hideDialog(AppGlobal.context); print(res); navigateToHome(AppGlobal.context); }).catchError((err) { - GifLoaderDialogUtils.hideDialog(AppGlobal.context); - AppToast.showErrorToast(message: err); print(err); - }); + }).showProgressBar( + text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); } Future navigateToHome(context) async { diff --git a/lib/pages/Blood/dialogs/ConfirmSMSDialog.dart b/lib/pages/Blood/dialogs/ConfirmSMSDialog.dart index e08d2f28..d165a895 100644 --- a/lib/pages/Blood/dialogs/ConfirmSMSDialog.dart +++ b/lib/pages/Blood/dialogs/ConfirmSMSDialog.dart @@ -8,13 +8,13 @@ import 'package:diplomaticquarterapp/core/model/my_balance/patient_info_and_mobi import 'package:diplomaticquarterapp/core/viewModels/medical/my_balance_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; -import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; +import 'package:smart_progress_bar/smart_progress_bar.dart'; class ConfirmSMSDialog extends StatefulWidget { final String phoneNumber; @@ -112,31 +112,32 @@ class _ConfirmSMSDialogState extends State { height: 40, color: Theme.of(context).primaryColor, child: Stack( + children: [ Center( - child: Texts( - 'SMS', - color: Colors.white, - textAlign: TextAlign.center, - ), - ), - Positioned( - child: Container( - child: InkWell( - onTap: () => Navigator.pop(context), - child: Container( - decoration: BoxDecoration( - shape: BoxShape.circle, color: Colors.white), - child: Icon( - Icons.clear, - color: Colors.grey[900], - )), + child: Texts( + 'SMS', + color: Colors.white, + textAlign: TextAlign.center, ), + ), + Positioned(child: Container( + child: InkWell( + onTap: () => Navigator.pop(context), + child: Container( + decoration: BoxDecoration( + shape: BoxShape.circle, color: Colors.white), + child: Icon( + Icons.clear, + color: Colors.grey[900], + )), ), - left: projectViewModel.isArabic ? 2 : 0, - right: projectViewModel.isArabic ? 0 : 2, + ), + left: projectViewModel.isArabic? 2:0, + right: projectViewModel.isArabic? 0:2, ) ], + ), ), Image.asset( @@ -333,14 +334,15 @@ class _ConfirmSMSDialogState extends State { } void submit(MyBalanceViewModel model) { - GifLoaderDialogUtils.showMyDialog(context); if (verifyAccountForm.currentState.validate()) { final activationCode = digit1.text + digit2.text + digit3.text + digit4.text; model .checkActivationCodeForAdvancePayment(activationCode: activationCode) + .then((value) {}) + .showProgressBar( + text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)) .then((value) { - GifLoaderDialogUtils.hideDialog(context); Navigator.pop(context, true); }); } diff --git a/lib/pages/BookAppointment/BookConfirm.dart b/lib/pages/BookAppointment/BookConfirm.dart index 7a247b78..fa69d913 100644 --- a/lib/pages/BookAppointment/BookConfirm.dart +++ b/lib/pages/BookAppointment/BookConfirm.dart @@ -2,11 +2,9 @@ import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart'; import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart'; import 'package:diplomaticquarterapp/models/Appointments/PatientShareResposne.dart'; -import 'package:diplomaticquarterapp/models/Appointments/toDoCountProviderModel.dart'; import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; import 'package:diplomaticquarterapp/routes.dart'; import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart'; -import 'package:diplomaticquarterapp/services/clinic_services/get_clinic_service.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; @@ -16,8 +14,8 @@ import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/material.dart'; import 'package:intl/intl.dart'; -import 'package:provider/provider.dart'; import 'package:rating_bar/rating_bar.dart'; +import 'package:smart_progress_bar/smart_progress_bar.dart'; import 'BookSuccess.dart'; @@ -45,8 +43,6 @@ class BookConfirm extends StatefulWidget { } class _BookConfirmState extends State { - ToDoCountProviderModel toDoProvider; - @override void initState() { widget.authUser = new AuthenticatedUser(); @@ -58,7 +54,6 @@ class _BookConfirmState extends State { @override Widget build(BuildContext context) { - toDoProvider = Provider.of(context); return AppScaffold( appBarTitle: TranslationBase.of(context).bookAppo, isShowAppBar: true, @@ -426,10 +421,9 @@ class _BookConfirmState extends State { AppToast.showSuccessToast(message: "Appointment Booked Successfully"); print(res['AppointmentNo']); - Future.delayed(new Duration(milliseconds: 500), () { + Future.delayed(new Duration(milliseconds: 1800), () { getPatientShare(context, res['AppointmentNo'], docObject.clinicID, docObject.projectID, docObject); - getToDoCount(); }); } else { GifLoaderDialogUtils.hideDialog(context); @@ -477,10 +471,9 @@ class _BookConfirmState extends State { AppToast.showSuccessToast(message: "Appointment Booked Successfully"); print(res['AppointmentNo']); - Future.delayed(new Duration(milliseconds: 500), () { + Future.delayed(new Duration(milliseconds: 1800), () { getLiveCareAppointmentPatientShare(context, res['AppointmentNo'], docObject.clinicID, docObject.projectID, docObject); - getToDoCount(); }); } else { GifLoaderDialogUtils.hideDialog(context); @@ -506,23 +499,10 @@ class _BookConfirmState extends State { dialog.showAlertDialog(context); } }).catchError((err) { - GifLoaderDialogUtils.hideDialog(context); AppToast.showErrorToast(message: err); print(err); - }); - } - - getToDoCount() { - toDoProvider.setState(0); - ClinicListService service = new ClinicListService(); - service.getActiveAppointmentNo(context).then((res) { - print(res['AppointmentActiveNumber']); - if (res['MessageStatus'] == 1) { - toDoProvider.setState(res['AppointmentActiveNumber']); - } else {} - }).catchError((err) { - print(err); - }); + }).showProgressBar( + text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); } getPatientShare(context, String appointmentNo, int clinicID, int projectID, diff --git a/lib/pages/BookAppointment/BookSuccess.dart b/lib/pages/BookAppointment/BookSuccess.dart index 70a5b1fb..39e290a1 100644 --- a/lib/pages/BookAppointment/BookSuccess.dart +++ b/lib/pages/BookAppointment/BookSuccess.dart @@ -14,6 +14,7 @@ import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:diplomaticquarterapp/widgets/in_app_browser/InAppBrowser.dart'; import 'package:flutter/material.dart'; import 'package:flutter_inappwebview/flutter_inappwebview.dart'; +import 'package:smart_progress_bar/smart_progress_bar.dart'; import 'QRCode.dart'; @@ -348,37 +349,36 @@ class _BookSuccessState extends State { confirmAppointment(AppoitmentAllHistoryResultList appo) { DoctorsListService service = new DoctorsListService(); - GifLoaderDialogUtils.showMyDialog(context); service .confirmAppointment(appo.appointmentNo, appo.clinicID, appo.projectID, appo.isLiveCareAppointment, context) .then((res) { - GifLoaderDialogUtils.hideDialog(context); - if (res['MessageStatus'] == 1) { - AppToast.showSuccessToast(message: res['ErrorEndUserMessage']); - if (appo.isLiveCareAppointment) { - insertLiveCareVIDARequest(appo); - } else { - navigateToHome(context); - } - } else { - AppToast.showErrorToast(message: res['ErrorEndUserMessage']); - } - }).catchError((err) { - GifLoaderDialogUtils.hideDialog(context); - AppToast.showErrorToast(message: err); - print(err); - }); + if (res['MessageStatus'] == 1) { + AppToast.showSuccessToast(message: res['ErrorEndUserMessage']); + } else { + AppToast.showErrorToast(message: res['ErrorEndUserMessage']); + } + }) + .catchError((err) { + print(err); + }) + .showProgressBar( + text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)) + .then((value) { + if (appo.isLiveCareAppointment) { + insertLiveCareVIDARequest(appo); + } else { + navigateToHome(context); + } + }); } insertLiveCareVIDARequest(AppoitmentAllHistoryResultList appo) { DoctorsListService service = new DoctorsListService(); - GifLoaderDialogUtils.showMyDialog(context); service .insertVIDARequest(appo.appointmentNo, appo.clinicID, appo.projectID, appo.serviceID, appo.doctorID, context) .then((res) { - GifLoaderDialogUtils.hideDialog(context); if (res['MessageStatus'] == 1) { AppToast.showSuccessToast(message: res['ErrorEndUserMessage']); navigateToHome(context); @@ -386,10 +386,9 @@ class _BookSuccessState extends State { AppToast.showErrorToast(message: res['ErrorEndUserMessage']); } }).catchError((err) { - GifLoaderDialogUtils.hideDialog(context); - AppToast.showErrorToast(message: err); print(err); - }); + }).showProgressBar( + text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); } Widget _getPayNowAppo() { @@ -555,7 +554,7 @@ class _BookSuccessState extends State { AppoitmentAllHistoryResultList appo) async { if (paymentMethod == "ApplePay") { await widget.chromeBrowser.open( - url: "https://applepay-datatrans-sample.herokuapp.com/", + url: "https://flutter.dev/", options: ChromeSafariBrowserClassOptions( android: AndroidChromeCustomTabsOptions( addDefaultShareMenuItem: false), @@ -574,9 +573,6 @@ class _BookSuccessState extends State { appo.projectID.toString(), authenticatedUser.emailAddress, paymentMethod, - authenticatedUser.patientType, - authenticatedUser.firstName, - authenticatedUser.patientID, authenticatedUser, widget.browser); } @@ -634,7 +630,6 @@ class _BookSuccessState extends State { } getApplePayAPQ(AppoitmentAllHistoryResultList appo) { - GifLoaderDialogUtils.showMyDialog(context); DoctorsListService service = new DoctorsListService(); service .checkPaymentStatus( @@ -642,7 +637,6 @@ class _BookSuccessState extends State { appo.projectID, appo.clinicID, appo.appointmentNo), context) .then((res) { - GifLoaderDialogUtils.hideDialog(context); print("Printing Payment Status Reponse!!!!"); print(res); String paymentInfo = res['Response_Message']; @@ -652,10 +646,9 @@ class _BookSuccessState extends State { AppToast.showErrorToast(message: res['Response_Message']); } }).catchError((err) { - GifLoaderDialogUtils.hideDialog(context); - AppToast.showErrorToast(message: err); print(err); - }); + }).showProgressBar( + text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); } createAdvancePayment(res, AppoitmentAllHistoryResultList appo) { diff --git a/lib/pages/BookAppointment/BookingOptions.dart b/lib/pages/BookAppointment/BookingOptions.dart index b90c3b34..83af454f 100644 --- a/lib/pages/BookAppointment/BookingOptions.dart +++ b/lib/pages/BookAppointment/BookingOptions.dart @@ -52,10 +52,11 @@ class _BookingOptionsState extends State { children: [ Expanded( child: CardCommon( - image: 'assets/images/new-design/search_by_clinic.png', - text: TranslationBase.of(context).clinic, - subText: TranslationBase.of(context).name, - type: 0), + image: 'assets/images/new-design/search_by_clinic.png', + text: TranslationBase.of(context).clinic, + subText: TranslationBase.of(context).name, + type: 0, + ), ), Expanded( child: CardCommon( diff --git a/lib/pages/BookAppointment/DentalComplaints.dart b/lib/pages/BookAppointment/DentalComplaints.dart index 043eaff1..34a7e1e1 100644 --- a/lib/pages/BookAppointment/DentalComplaints.dart +++ b/lib/pages/BookAppointment/DentalComplaints.dart @@ -2,13 +2,12 @@ import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/models/Appointments/DentalChiefComplaintsModel.dart'; import 'package:diplomaticquarterapp/models/Appointments/SearchInfoModel.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/widgets/DentalComplaintCard.dart'; +import 'package:diplomaticquarterapp/pages/livecare/widgets/clinic_card.dart'; import 'package:diplomaticquarterapp/services/clinic_services/get_clinic_service.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; -import 'package:diplomaticquarterapp/uitl/app_toast.dart'; -import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; -import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/material.dart'; +import 'package:smart_progress_bar/smart_progress_bar.dart'; class DentalComplaints extends StatefulWidget { SearchInfo searchInfo; @@ -36,8 +35,7 @@ class _DentalComplaintsState extends State { Widget build(BuildContext context) { return AppScaffold( isShowAppBar: true, - appBarTitle: TranslationBase.of(context).dentalComplaints, - isShowDecPage: false, + appBarTitle: "Symptoms", body: Container( margin: EdgeInsets.fromLTRB(10.0, 10.0, 10.0, 0.0), child: ListView.builder( @@ -61,14 +59,12 @@ class _DentalComplaintsState extends State { } getChiefComplaintsList() { - GifLoaderDialogUtils.showMyDialog(context); getLanguageID(); ClinicListService service = new ClinicListService(); service .getChiefComplaintsList( widget.searchInfo.ClinicID, widget.searchInfo.ProjectID, context) .then((res) { - GifLoaderDialogUtils.hideDialog(context); if (res['MessageStatus'] == 1) { print(res['List_DentalChiefComplain']); setState(() { @@ -77,13 +73,10 @@ class _DentalComplaintsState extends State { }); print(complaintsList.length); }); - } else { - - } + } else {} }).catchError((err) { - GifLoaderDialogUtils.hideDialog(context); - AppToast.showErrorToast(message: err); print(err); - }); + }).showProgressBar( + text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); } } diff --git a/lib/pages/BookAppointment/DoctorProfile.dart b/lib/pages/BookAppointment/DoctorProfile.dart index 20e4ae09..6864e6b1 100644 --- a/lib/pages/BookAppointment/DoctorProfile.dart +++ b/lib/pages/BookAppointment/DoctorProfile.dart @@ -1,14 +1,11 @@ import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart'; import 'package:diplomaticquarterapp/models/Appointments/DoctorProfile.dart'; -import 'package:diplomaticquarterapp/models/Appointments/DoctorRateDetails.dart'; import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; import 'package:diplomaticquarterapp/routes.dart'; -import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart'; import 'package:diplomaticquarterapp/services/robo_search/event_provider.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; -import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; @@ -45,8 +42,6 @@ class _DoctorProfileState extends State AppSharedPreferences sharedPref = AppSharedPreferences(); - List doctorDetailsList = List(); - @override void initState() { _tabController = new TabController( @@ -155,26 +150,19 @@ class _DoctorProfileState extends State emptyIcon: Icons.star, ), ), - InkWell( - onTap: () { - getDoctorRatingsDetails(); - }, - child: Container( - margin: EdgeInsets.only(top: 5.0), - alignment: Alignment.center, - child: Text( - "(" + - widget.doctor.noOfPatientsRate.toString() + - " " + - TranslationBase.of(context).reviews + - ")", - style: TextStyle( - fontSize: 14.0, - color: Colors.blue[800], - letterSpacing: 1.0, - decoration: TextDecoration.underline, - )), - ), + Container( + margin: EdgeInsets.only(top: 5.0), + alignment: Alignment.center, + child: Text( + "(" + + widget.doctor.noOfPatientsRate.toString() + + " " + TranslationBase.of(context).reviews + ")", + style: TextStyle( + fontSize: 14.0, + color: Colors.blue[800], + letterSpacing: 1.0, + decoration: TextDecoration.underline, + )), ), Container( margin: EdgeInsets.only(top: 10.0), @@ -225,281 +213,6 @@ class _DoctorProfileState extends State ); } - getDoctorRatings() { - GifLoaderDialogUtils.showMyDialog(context); - DoctorsListService service = new DoctorsListService(); - service.getDoctorsRating(widget.doctor.doctorID, context).then((res) { - GifLoaderDialogUtils.hideDialog(context); - if (res['MessageStatus'] == 1) { - print(res['NotesDoctorRatingList']); - } else { - AppToast.showErrorToast(message: res['ErrorEndUserMessage']); - } - }).catchError((err) { - GifLoaderDialogUtils.hideDialog(context); - AppToast.showErrorToast(message: err); - print(err); - }); - } - - getDoctorRatingsDetails() { - GifLoaderDialogUtils.showMyDialog(context); - DoctorsListService service = new DoctorsListService(); - service - .getDoctorsRatingDetails(widget.doctor.doctorID, context) - .then((res) { - GifLoaderDialogUtils.hideDialog(context); - if (res['MessageStatus'] == 1) { - doctorDetailsList.clear(); - res['DoctorRatingDetailsList'].forEach((v) { - doctorDetailsList.add(new DoctorRateDetails.fromJson(v)); - }); - showRatingDialog(doctorDetailsList); - } else { - AppToast.showErrorToast(message: res['ErrorEndUserMessage']); - } - }).catchError((err) { - GifLoaderDialogUtils.hideDialog(context); - AppToast.showErrorToast(message: err); - print(err); - }); - } - - void showRatingDialog(List doctorDetailsList) { - showGeneralDialog( - barrierColor: Colors.black.withOpacity(0.5), - transitionBuilder: (context, a1, a2, widget) { - final curvedValue = Curves.easeInOutBack.transform(a1.value) - 1.0; - return Transform( - transform: Matrix4.translationValues(0.0, curvedValue * 200, 0.0), - child: Opacity( - opacity: a1.value, - child: Dialog( - child: Column( - mainAxisSize: MainAxisSize.min, - children: [ - Container( - // height: 400.0, - width: MediaQuery.of(context).size.width * 0.8, - color: Colors.white, - child: Column( - children: [ - Container( - alignment: Alignment.center, - width: MediaQuery.of(context).size.width, - color: Theme.of(context).primaryColor, - margin: EdgeInsets.only(bottom: 5.0), - padding: EdgeInsets.all(10.0), - child: Text(TranslationBase.of(context).doctorRating, - style: TextStyle( - fontSize: 22.0, color: Colors.white))), - Container( - margin: EdgeInsets.only(top: 0.0), - child: Text( - this - .widget - .doctor - .actualDoctorRate - .ceilToDouble() - .toString(), - style: TextStyle( - fontSize: 32.0, color: Colors.black))), - Container( - margin: EdgeInsets.only(top: 5.0), - alignment: Alignment.center, - child: RatingBar.readOnly( - initialRating: - this.widget.doctor.actualDoctorRate.toDouble(), - size: 35.0, - filledColor: Colors.yellow[700], - emptyColor: Colors.grey[500], - isHalfAllowed: true, - halfFilledIcon: Icons.star_half, - filledIcon: Icons.star, - emptyIcon: Icons.star, - ), - ), - Container( - margin: EdgeInsets.only(top: 10.0), - child: Text( - this.widget.doctor.noOfPatientsRate.toString() + - " " + - TranslationBase.of(context).reviews, - style: TextStyle( - fontSize: 14.0, color: Colors.black))), - Container( - margin: EdgeInsets.only(top: 10.0), - child: Row( - children: [ - Container( - width: 100.0, - margin: EdgeInsets.only( - top: 10.0, left: 15.0, right: 15.0), - child: Text( - TranslationBase.of(context).excellent, - style: TextStyle( - fontSize: 13.0, color: Colors.black))), - Container( - margin: EdgeInsets.only(top: 10.0), - child: SizedBox( - width: getRatingWidth( - doctorDetailsList[0].patientNumber), - height: 6.0, - child: Container( - color: Colors.green[700], - ), - ), - ), - ], - ), - ), - Container( - child: Row( - children: [ - Container( - width: 100.0, - margin: EdgeInsets.only( - top: 10.0, left: 15.0, right: 15.0), - child: Text(TranslationBase.of(context).v_good, - style: TextStyle( - fontSize: 13.0, color: Colors.black))), - Container( - margin: EdgeInsets.only(top: 10.0), - child: SizedBox( - width: getRatingWidth( - doctorDetailsList[1].patientNumber), - height: 6.0, - child: Container( - color: Color(0xffB7B723), - ), - ), - ), - ], - ), - ), - Container( - child: Row( - children: [ - Container( - width: 100.0, - margin: EdgeInsets.only( - top: 10.0, left: 15.0, right: 15.0), - child: Text(TranslationBase.of(context).good, - style: TextStyle( - fontSize: 13.0, color: Colors.black))), - Container( - margin: EdgeInsets.only(top: 10.0), - child: SizedBox( - width: getRatingWidth( - doctorDetailsList[2].patientNumber), - height: 6.0, - child: Container( - color: Color(0xffEBA727), - ), - ), - ), - ], - ), - ), - Container( - child: Row( - children: [ - Container( - width: 100.0, - margin: EdgeInsets.only( - top: 10.0, left: 15.0, right: 15.0), - child: Text(TranslationBase.of(context).average, - style: TextStyle( - fontSize: 13.0, color: Colors.black))), - Container( - margin: EdgeInsets.only(top: 10.0), - child: SizedBox( - width: getRatingWidth( - doctorDetailsList[3].patientNumber), - height: 6.0, - child: Container( - color: Color(0xffEB7227), - ), - ), - ), - ], - ), - ), - Container( - child: Row( - children: [ - Container( - width: 100.0, - margin: EdgeInsets.only( - top: 10.0, left: 15.0, right: 15.0), - child: Text( - TranslationBase.of(context).below_average, - style: TextStyle( - fontSize: 13.0, color: Colors.black))), - Container( - margin: EdgeInsets.only(top: 10.0), - child: SizedBox( - width: getRatingWidth( - doctorDetailsList[4].patientNumber), - height: 6.0, - child: Container( - color: Color(0xffE20C0C), - ), - ), - ), - ], - ), - ), - Container( - margin: EdgeInsets.only(top: 40.0), child: Divider()), - Container( - margin: EdgeInsets.only(top: 0.0), - child: Align( - alignment: FractionalOffset.bottomCenter, - child: ButtonTheme( - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(10.0), - ), - minWidth: MediaQuery.of(context).size.width, - height: 40.0, - child: RaisedButton( - elevation: 0.0, - color: Colors.white, - textColor: Colors.red, - hoverColor: Colors.transparent, - focusColor: Colors.transparent, - highlightColor: Colors.transparent, - disabledColor: new Color(0xFFbcc2c4), - onPressed: () { - Navigator.of(context).pop(); - }, - child: Text(TranslationBase.of(context).cancel, - style: TextStyle(fontSize: 18.0)), - ), - ), - ), - ), - ], - ), - ), - ], - ), - ), - ), - ); - }, - transitionDuration: Duration(milliseconds: 500), - barrierDismissible: true, - barrierLabel: '', - context: context, - pageBuilder: (context, animation1, animation2) {}); - } - - double getRatingWidth(int patientNumber) { - var width = (patientNumber / this.widget.doctor.noOfPatientsRate) * 100; - return width; - } - getPatientData() async { if (await sharedPref.getObject(USER_PROFILE) != null) { var data = diff --git a/lib/pages/BookAppointment/QRCode.dart b/lib/pages/BookAppointment/QRCode.dart index 487d1be7..e92c2348 100644 --- a/lib/pages/BookAppointment/QRCode.dart +++ b/lib/pages/BookAppointment/QRCode.dart @@ -10,11 +10,11 @@ import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsLis import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; -import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/material.dart'; +import 'package:smart_progress_bar/smart_progress_bar.dart'; class QRCode extends StatefulWidget { PatientShareResponse patientShareResponse; @@ -235,7 +235,6 @@ class _QRCodeState extends State { okText: TranslationBase.of(context).confirm, cancelText: TranslationBase.of(context).cancel_nocaps, okFunction: () { - GifLoaderDialogUtils.showMyDialog(context); service .sendAppointmentQREmail( widget.authUser.emailAddress, @@ -248,15 +247,15 @@ class _QRCodeState extends State { widget.patientShareResponse.doctorSpeciality), context) .then((res) { - GifLoaderDialogUtils.hideDialog(context); print(res); ConfirmDialog.closeAlertDialog(context); }).catchError((err) { - GifLoaderDialogUtils.hideDialog(context); ConfirmDialog.closeAlertDialog(context); AppToast.showErrorToast(message: err); print(err); - }); + }).showProgressBar( + text: "Loading", + backgroundColor: Colors.blue.withOpacity(0.6)); }, cancelFunction: () => {}); dialog.showAlertDialog(context); diff --git a/lib/pages/BookAppointment/Search.dart b/lib/pages/BookAppointment/Search.dart index 44cf46c3..095d72a6 100644 --- a/lib/pages/BookAppointment/Search.dart +++ b/lib/pages/BookAppointment/Search.dart @@ -1,16 +1,18 @@ import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/components/SearchByClinic.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/components/SearchByDoctor.dart'; +import 'package:diplomaticquarterapp/uitl/location_util.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart'; import 'package:diplomaticquarterapp/widgets/others/arrow_back.dart'; +import 'package:diplomaticquarterapp/widgets/others/bottom_bar.dart'; import 'package:flutter/material.dart'; +import 'package:geolocator/geolocator.dart'; class Search extends StatefulWidget { final int type; final List clnicIds; - Search({this.type = 0, this.clnicIds}); - @override _SearchState createState() => _SearchState(); } diff --git a/lib/pages/BookAppointment/SearchResults.dart b/lib/pages/BookAppointment/SearchResults.dart index 72226c2e..055b0c41 100644 --- a/lib/pages/BookAppointment/SearchResults.dart +++ b/lib/pages/BookAppointment/SearchResults.dart @@ -27,7 +27,6 @@ class _SearchResultsState extends State { return AppScaffold( appBarTitle: TranslationBase.of(context).bookAppo, isShowAppBar: true, - isShowDecPage: false, body: Container( margin: EdgeInsets.all(10.0), child: SingleChildScrollView( diff --git a/lib/pages/BookAppointment/components/SearchByClinic.dart b/lib/pages/BookAppointment/components/SearchByClinic.dart index 355bb52b..7943e423 100644 --- a/lib/pages/BookAppointment/components/SearchByClinic.dart +++ b/lib/pages/BookAppointment/components/SearchByClinic.dart @@ -13,6 +13,7 @@ import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/card/rounded_container.dart'; import 'package:flutter/material.dart'; +import 'package:smart_progress_bar/smart_progress_bar.dart'; class SearchByClinic extends StatefulWidget { final List clnicIds; @@ -136,8 +137,7 @@ class _SearchByClinicState extends State { margin: EdgeInsets.only(top: 15.0), child: DropdownButtonHideUnderline( child: DropdownButton( - hint: - new Text(TranslationBase.of(context).selectHospital), + hint: new Text("Select Project"), value: projectDropdownValue, items: projectsList.map((item) { return new DropdownMenuItem( diff --git a/lib/pages/BookAppointment/components/SearchByDoctor.dart b/lib/pages/BookAppointment/components/SearchByDoctor.dart index 8d2b9387..1e1945b5 100644 --- a/lib/pages/BookAppointment/components/SearchByDoctor.dart +++ b/lib/pages/BookAppointment/components/SearchByDoctor.dart @@ -4,6 +4,7 @@ import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:flutter/material.dart'; +import 'package:smart_progress_bar/smart_progress_bar.dart'; import '../SearchResults.dart'; @@ -128,12 +129,9 @@ class _SearchByDoctorState extends State { navigateToSearchResults( context, doctorsList, _patientDoctorAppointmentListHospital); } else { - GifLoaderDialogUtils.hideDialog(context); AppToast.showErrorToast(message: res['ErrorEndUserMessage']); } }).catchError((err) { - GifLoaderDialogUtils.hideDialog(context); - AppToast.showErrorToast(message: err); print(err); }); } diff --git a/lib/pages/BookAppointment/widgets/CardCommon.dart b/lib/pages/BookAppointment/widgets/CardCommon.dart index 6a7e2bdd..e56ba965 100644 --- a/lib/pages/BookAppointment/widgets/CardCommon.dart +++ b/lib/pages/BookAppointment/widgets/CardCommon.dart @@ -1,16 +1,12 @@ -import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/Search.dart'; import 'package:flutter/material.dart'; -import 'package:provider/provider.dart'; class CardCommon extends StatelessWidget { - var languageID; final image; final text; final subText; final type; - - CardCommon( + const CardCommon( {@required this.image, @required this.text, @required this.subText, @@ -18,7 +14,6 @@ class CardCommon extends StatelessWidget { @override Widget build(BuildContext context) { - ProjectViewModel projectViewModel = Provider.of(context); return GestureDetector( onTap: () { navigateToSearch(context, this.type); @@ -48,12 +43,8 @@ class CardCommon extends StatelessWidget { color: Colors.black, letterSpacing: 1.0, fontSize: 15.0)), ), Container( - alignment: projectViewModel.isArabic - ? Alignment.bottomLeft - : Alignment.bottomRight, - margin: projectViewModel.isArabic - ? EdgeInsets.fromLTRB(10.0, 0.0, 00.0, 8.0) - : EdgeInsets.fromLTRB(0.0, 0.0, 10.0, 8.0), + alignment: Alignment.bottomRight, + margin: EdgeInsets.fromLTRB(0.0, 0.0, 10.0, 8.0), child: Image.asset(this.image, width: 60.0, height: 60.0), ), ], diff --git a/lib/pages/BookAppointment/widgets/DentalComplaintCard.dart b/lib/pages/BookAppointment/widgets/DentalComplaintCard.dart index eb434cad..27f37d0a 100644 --- a/lib/pages/BookAppointment/widgets/DentalComplaintCard.dart +++ b/lib/pages/BookAppointment/widgets/DentalComplaintCard.dart @@ -3,9 +3,8 @@ import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart import 'package:diplomaticquarterapp/pages/BookAppointment/SearchResults.dart'; import 'package:diplomaticquarterapp/services/clinic_services/get_clinic_service.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; -import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; -import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:flutter/material.dart'; +import 'package:smart_progress_bar/smart_progress_bar.dart'; // ignore: must_be_immutable class DentalComplaintCard extends StatefulWidget { @@ -70,15 +69,14 @@ class _DentalComplaintCardState extends State { List doctorsList = []; List _patientDoctorAppointmentListHospital = List(); - GifLoaderDialogUtils.showMyDialog(context); + ClinicListService service = new ClinicListService(); service .getChiefComplaintDoctorList(widget.listDentalChiefComplain.iD, widget.listDentalChiefComplain.projectID, context) .then((res) { - GifLoaderDialogUtils.hideDialog(context); if (res['MessageStatus'] == 1) { - print(res['ErrorEndUserMessage']); + print(res['List_DentalDoctorChiefComplaintMapping']); setState(() { doctorsList.clear(); res['List_DentalDoctorChiefComplaintMapping'].forEach((v) { @@ -109,21 +107,16 @@ class _DentalComplaintCardState extends State { patientDoctorAppointment: element)); } }); - if (doctorsList.length != 0) { - navigateToSearchResults( - context, doctorsList, _patientDoctorAppointmentListHospital); - } else { - AppToast.showErrorToast(message: TranslationBase.of(context).emptyResult); - } + navigateToSearchResults( + context, doctorsList, _patientDoctorAppointmentListHospital); }); } else { AppToast.showErrorToast(message: res['ErrorEndUserMessage']); } }).catchError((err) { - GifLoaderDialogUtils.hideDialog(context); - AppToast.showErrorToast(message: err); print(err); - }); + }).showProgressBar( + text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); } Future navigateToSearchResults( diff --git a/lib/pages/BookAppointment/widgets/DoctorView.dart b/lib/pages/BookAppointment/widgets/DoctorView.dart index bd4fb429..d419e4af 100644 --- a/lib/pages/BookAppointment/widgets/DoctorView.dart +++ b/lib/pages/BookAppointment/widgets/DoctorView.dart @@ -6,6 +6,7 @@ import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:flutter/material.dart'; import 'package:rating_bar/rating_bar.dart'; +import 'package:smart_progress_bar/smart_progress_bar.dart'; import '../DoctorProfile.dart'; diff --git a/lib/pages/ChildVaccines/ChidDetailsWidget.dart b/lib/pages/ChildVaccines/ChidDetailsWidget.dart deleted file mode 100644 index c06c5422..00000000 --- a/lib/pages/ChildVaccines/ChidDetailsWidget.dart +++ /dev/null @@ -1,120 +0,0 @@ -import 'package:diplomaticquarterapp/core/model/childvaccines/List_BabyInformationModel.dart'; -import 'package:diplomaticquarterapp/core/model/childvaccines/delete_baby_model.dart'; -import 'package:diplomaticquarterapp/core/model/childvaccines/user_information_model.dart'; -import 'package:diplomaticquarterapp/core/viewModels/child_vaccines/child_vaccines_view_model.dart'; -import 'package:diplomaticquarterapp/pages/ChildVaccines/vaccinationtable_page.dart'; -import 'package:diplomaticquarterapp/uitl/app_toast.dart'; -import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; -import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; -import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; -import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; -import 'package:flutter/cupertino.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter_flexible_toast/flutter_flexible_toast.dart'; - -import 'dialogs/delete_child.dart'; - -class ChildDetailsWidget extends StatelessWidget { - final ChildVaccinesViewModel model; - final List_BabyInformationModel babyInfo; - final List_UserInformationModel informationModel; - final Function onTapDelete; - - ChildDetailsWidget({this.model, this.babyInfo, this.informationModel, this.onTapDelete}); - - @override - Widget build(BuildContext context) { - return InkWell( - onTap: (){ - Navigator.push( - context, - FadePage( - page: VaccinationTablePage( - babyInfo: babyInfo, - informationModel: informationModel, - ), - ), - ); - }, - child: Container( - margin: EdgeInsets.only(left: 5, right: 5, bottom: 10), - decoration: BoxDecoration( - shape: BoxShape.rectangle, - border: Border.all(color: Colors.white, width: 0.5), - borderRadius: BorderRadius.all(Radius.circular(5)), - color: Colors.white, - ), - padding: EdgeInsets.all(12), - width: 200, - //double.infinity, - child: Column( - children: [ - Row(children: [ - Texts(TranslationBase.of(context).childName), - ]), - Row(children: [ - Texts(babyInfo.babyName.trim()), - ]), - Row(children: [ - IconButton( - icon: Image.asset(babyInfo.gender == 1 - ? 'assets/images/new-design/male.png' - : 'assets/images/new-design/female.png'), - tooltip: '', - onPressed: () { - }, - ), - Texts(babyInfo.genderDescription), - IconButton( - icon: Icon( - Icons.remove_red_eye, - color: Colors.red, - ), - tooltip: '', - onPressed: () { - Navigator.push( - context, - FadePage( - page: VaccinationTablePage( - babyInfo: babyInfo, - informationModel: informationModel, - ), - ), - ); - }, - ) - ]), - Row(children: [ - Texts(TranslationBase.of(context).childDob), - ]), - Row( - children: [ - IconButton( - icon: new Image.asset( - 'assets/images/new-design/calender-secondary.png'), - tooltip: '', - ), - Texts( - DateUtil.yearMonthDay(babyInfo.dOB), - ), - ], - ), - Row(children: [ - IconButton( - icon: new Image.asset('assets/images/new-design/garbage.png'), - tooltip: '', - onPressed: () async { - onTapDelete(); - }, - ), - Texts(TranslationBase.of(context).delete), - ]), - SizedBox( - height: 12, - ), - ], - ), - ), - ); - } -} diff --git a/lib/pages/ChildVaccines/add_newchild_page.dart b/lib/pages/ChildVaccines/add_newchild_page.dart index 10dea666..51b89f98 100644 --- a/lib/pages/ChildVaccines/add_newchild_page.dart +++ b/lib/pages/ChildVaccines/add_newchild_page.dart @@ -11,7 +11,6 @@ import 'package:diplomaticquarterapp/pages/ChildVaccines/child_page.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/medical/active_medications/DayCheckBoxDialog.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; -import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; @@ -22,16 +21,39 @@ import 'package:flutter_datetime_picker/flutter_datetime_picker.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; enum Gender { Male, Female, NON } +enum BeneficiaryType { MyAccount, MyFamilyFiles, OtherAccount, NON } class AddNewChildPage extends StatefulWidget { + final int frequency; + final int days; + final String itemDescription; String dateAdd; + List _scheduleList = List(); + List daysOfWeek = [ + DayOfWeek.Monday, + DayOfWeek.Tuesday, + DayOfWeek.Wednesday, + DayOfWeek.Thursday, + DayOfWeek.Friday, + DayOfWeek.Saturday, + DayOfWeek.Sunday + ]; + DateTime startDay; DateTime endDay; - AddNewChildPage() { + //AddNewChildPage({Key key, this.frequency, this.days, this.itemDescription}) : super(key: key); + AddNewChildPage({Key key, this.frequency, this.days, this.itemDescription}) { startDay = DateTime.now(); - endDay = DateTime.now(); + endDay = + DateTime.now(); //endDay = DateTime.now().add(Duration(days: days)); + int hour = 24; //(24 / frequency).round(); + int durations = 24 ~/ hour; + for (int count = 0; count < durations; count++) { + _scheduleList.add(DateTime(DateTime.now().year, DateTime.now().month, + DateTime.now().day, (hour * count))); + } } @override @@ -39,140 +61,150 @@ class AddNewChildPage extends StatefulWidget { } class _AddNewChildPageState extends State { + int tappedIndex; int checkedValue; + @override + void initState() { + super.initState(); + tappedIndex = -1; + } + TextEditingController _firstTextController = TextEditingController(); TextEditingController _secondTextController = TextEditingController(); + TextEditingController _notesTextController = TextEditingController(); + BeneficiaryType beneficiaryType = BeneficiaryType.NON; Gender gender = Gender.Male; CreateNewUser_New newUserChild = CreateNewUser_New(); + //ChildVaccinesViewModel addvancedModel = ChildVaccinesViewModel(); + List_BabyInformationModel addvancedModel = List_BabyInformationModel(); CreateNewBaby newChild = CreateNewBaby(); - - String firstName = ""; - String secondName = ""; + List_UserInformationModel informationModel = List_UserInformationModel(); @override Widget build(BuildContext context) { return BaseView( builder: (_, model, w) => AppScaffold( isShowAppBar: true, - appBarTitle: TranslationBase.of(context).vaccination, + appBarTitle: "Vaccintion", body: SingleChildScrollView( physics: ScrollPhysics(), child: Container( margin: EdgeInsets.all(12), child: Column( - crossAxisAlignment: CrossAxisAlignment.start, + // crossAxisAlignment: CrossAxisAlignment.center, children: [ SizedBox( - height: 25, + height: 50, + ), + Texts( + "Add the child's information below to recieve the schedule of vaccinations.", + //+model.user.firstName, + textAlign: TextAlign.center, ), - Texts(TranslationBase.of(context).addInstructions), SizedBox( - height: 20, + height: 12, ), NewTextFields( - hintText: TranslationBase.of(context).firstName, + hintText: "First Name", controller: _firstTextController, - onChanged: (value) { - setState(() { - firstName = value; - }); - }, ), SizedBox( height: 12, ), NewTextFields( - hintText: TranslationBase.of(context).lastName, + hintText: "Second Name", controller: _secondTextController, - onChanged: (value) { - secondName = value; - }, ), SizedBox( - height: 20, + height: 12, ), Row( crossAxisAlignment: CrossAxisAlignment.start, children: [ Text( - TranslationBase.of(context).gender + " :", + "Gender:", textAlign: TextAlign.end, ), ], ), - SizedBox( - height: 15, - ), Container( - height: 60, + height: MediaQuery.of(context).size.height * 0.12, width: double.infinity, + padding: EdgeInsets.all(12), + + child: Row( crossAxisAlignment: CrossAxisAlignment.stretch, mainAxisAlignment: MainAxisAlignment.center, children: [ - Expanded( - child: AnimatedContainer( - duration: Duration(milliseconds: 400), - height: 60, - color: Colors.white, - child: SecondaryButton( - textColor: - checkedValue == 1 ? Colors.white : Colors.black, - color: - checkedValue == 1 ? Colors.red : Colors.white, - label: TranslationBase.of(context).male, - onTap: () { - setState(() { - checkedValue = 1; - }); - }, - ), + Container( + height: MediaQuery.of(context).size.height * 0.12, + width: 175, + color: Colors.white, + child: SecondaryButton( + textColor: + checkedValue == 1 ? Colors.white : Colors.black, + color: checkedValue == 1 ? Colors.red : Colors.white, + + label: "Male", + // + onTap: () { + + setState(() { + checkedValue = 1; + print("checkedValue=" + checkedValue.toString()); + }); + + // bloodDetails. + }, ), ), - Expanded( - child: AnimatedContainer( - duration: Duration(milliseconds: 400), - height: 60, - color: Colors.white, - child: SecondaryButton( - textColor: - checkedValue == 2 ? Colors.white : Colors.black, - color: - checkedValue == 2 ? Colors.red : Colors.white, - label: TranslationBase.of(context).female, - onTap: () { - setState(() { - checkedValue = 2; - }); - }, - ), + Container( + height: MediaQuery.of(context).size.height * 0.12, + width: 175, + color: Colors.white, + child: SecondaryButton( + textColor: + checkedValue == 2 ? Colors.white : Colors.black, + color: checkedValue == 2 ? Colors.red : Colors.white, + label: "Female", + // + onTap: () { + setState(() { + checkedValue = 2; + print("checkedValue=" + checkedValue.toString()); + }); + // bloodDetails.city=_selectedHospital.toString(); + + // bloodDetails. + }, ), ) ], ), ), + //========== SizedBox( - height: 20, + height: 6, ), Row( crossAxisAlignment: CrossAxisAlignment.start, children: [ Text( - TranslationBase.of(context).dob + " :", + "Date Of Birth::", textAlign: TextAlign.end, ), ], ), - SizedBox( - height: 8, - ), InkWell( onTap: () { DatePicker.showDatePicker( context, showTitleActions: true, + // minTime: DateTime( + // DateTime.now().year, DateTime.now().month - 1, 1), minTime: DateTime(1, 1, 1), maxTime: DateTime.now(), onConfirm: (date) { @@ -181,6 +213,7 @@ class _AddNewChildPageState extends State { }); }, currentTime: widget.startDay, + // locale: projectViewModel.localeType ); }, child: Container( @@ -191,63 +224,99 @@ class _AddNewChildPageState extends State { borderRadius: BorderRadius.circular(12), color: Colors.white), child: Row( - // mainAxisAlignment: MainAxisAlignment.spaceBetween, + mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ + Texts(//getStartDay() + // DateUtil.yearMonthDay(DateTime.now()) + getStartDay()), Icon( Icons.calendar_today, color: Colors.black, - ), - SizedBox( - width: 25, - ), - Expanded(child: Texts(getStartDay())), + ) ], ), ), ), SizedBox( - height: 25, + height: 12, ), Container( - height: 60, + height: MediaQuery.of(context).size.height * 0.12, width: double.infinity, + padding: EdgeInsets.all(15), child: SecondaryButton( textColor: Colors.white, - color: Colors.grey[800], - disabled: (checkedValue == null || - firstName.isEmpty || - secondName.isEmpty), - label: TranslationBase.of(context).add, - onTap: () async { - newChild.babyName = _firstTextController.text + - " " + - _secondTextController.text; + color: checkedValue == false + ? Colors.white24 + : Color.fromRGBO( + 63, + 72, + 74, + 1, + ), + label: "Add", + // + onTap: () async{ + newChild.babyName = _firstTextController.text + " " + _secondTextController.text; newChild.gender = checkedValue.toString(); - newChild.strDOB = widget.startDay.toIso8601String(); + newChild.strDOB = getStartDay(); newChild.tempValue = true; newChild.isLogin = true; await model.createNewBabyOrders(newChild: newChild); - if (model.isAdded) { - AppToast.showSuccessToast( - message: TranslationBase.of(context).addedChild); - Navigator.pop(context, model.isAdded); - } else { - AppToast.showSuccessToast(message: model.error); + if(model.isAdded){ + AppToast.showSuccessToast(message: "Record Added"); + Navigator.pop(context,model.isAdded); + }else{ + + //TODO handling error } + }, ), ), + //========= ], ), ), ), - // bottomSheet: + // bottomSheet: ), ); } String getStartDay() { - return "${widget.startDay.day}-${widget.startDay.month}-${widget.startDay.year}"; + return "${DateUtil.getMonth(widget.startDay.month)} ${widget.startDay.day}, ${widget.startDay.year}"; + } + + String getEndDay() { + return "${DateUtil.getMonth(widget.endDay.month)} ${widget.endDay.day}, ${widget.endDay.year}"; + } + + String getDateTime(DateTime dateTime) { + return '${dateTime.hour}:${dateTime.minute}'; + } + + String getDays() { + String days = ""; + widget.daysOfWeek.forEach((element) { + days += "${DateUtil.getDay(element)},"; + }); + return days; + } + + void confirmSelectDayDialog() { + showDialog( + context: context, + child: DayCheckBoxDialog( + title: 'Select Day', + selectedDaysOfWeek: widget.daysOfWeek, + onValueSelected: (value) { + setState(() { + widget.daysOfWeek = value; + }); + }, + ), + ); } } diff --git a/lib/pages/ChildVaccines/child_page.dart b/lib/pages/ChildVaccines/child_page.dart index 45020f79..806a5b71 100644 --- a/lib/pages/ChildVaccines/child_page.dart +++ b/lib/pages/ChildVaccines/child_page.dart @@ -1,12 +1,10 @@ import 'package:diplomaticquarterapp/core/model/childvaccines/List_BabyInformationModel.dart'; import 'package:diplomaticquarterapp/core/model/childvaccines/delete_baby_model.dart'; -import 'package:diplomaticquarterapp/core/model/childvaccines/user_information_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/child_vaccines/child_vaccines_view_model.dart'; import 'package:diplomaticquarterapp/pages/ChildVaccines/add_newchild_page.dart'; import 'package:diplomaticquarterapp/pages/ChildVaccines/vaccinationtable_page.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; -import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; @@ -14,109 +12,191 @@ import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; -import 'package:flutter_flexible_toast/flutter_flexible_toast.dart'; -import 'ChidDetailsWidget.dart'; import 'dialogs/delete_child.dart'; class ChildPage extends StatefulWidget { - final List_UserInformationModel informationModel; - - const ChildPage({Key key, this.informationModel}) : super(key: key); - @override _ChildPageState createState() => _ChildPageState(); } class _ChildPageState extends State with SingleTickerProviderStateMixin { + DeleteBaby deleteBaby = DeleteBaby(); @override Widget build(BuildContext context) { var checkedValue = true; return BaseView( - onModelReady: (model) => model.getNewUserOrders(), - builder: (_, model, w) => AppScaffold( - isShowAppBar: true, - appBarTitle: TranslationBase.of(context).vaccination, - baseViewModel: model, - body: SingleChildScrollView( - child: Container( - margin: EdgeInsets.only(left: 10, right: 10, top: 10), - child: Column( - children: [ - GridView.builder( - shrinkWrap: true, - primary: false, - physics: NeverScrollableScrollPhysics(), - gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( - crossAxisCount: 2, - childAspectRatio: MediaQuery.of(context).size.width / - (MediaQuery.of(context).size.height / 1.45), - ), - itemCount: model.babyInformationModelList.length, - itemBuilder: (BuildContext context, int index) { - return ChildDetailsWidget( - model: model, - babyInfo: model.babyInformationModelList[index], - informationModel: widget.informationModel, - onTapDelete: () { - showDialog( - context: context, - child: DeleteChild(onTap: () async { - await model.deleteBabyOrders(babyInfo: model.babyInformationModelList[index]); - if (model.isDeleted) { - AppToast.showSuccessToast( - message: - TranslationBase.of(context).emailSuccess, - toastLength: Toast.LENGTH_LONG); - } else { - AppToast.showSuccessToast(message: model.error); - } - }), - ); - }, - ); + onModelReady: (model) => model.getNewUserOrders(), + builder: (_, model, widget) => AppScaffold( + isShowAppBar: true, + appBarTitle: " Vaccination", + baseViewModel: model, + body: SingleChildScrollView( + child: Container( + margin: EdgeInsets.only(left: 15, right: 15, top: 70), + child: Column( + children: [ + ...List.generate( + model.babyInformationModelList.length, + (index) => Container( + margin: EdgeInsets.only( + left: 0, right: 0, bottom: 20), + + decoration: BoxDecoration( + shape: BoxShape.rectangle, + border: Border.all( + color: Colors.white, width: 0.5), + borderRadius: + BorderRadius.all(Radius.circular(5)), + color: Colors.white, + ), + padding: EdgeInsets.all(12), + width: 200,//double.infinity, + child: Column( + children: [ + Row(children: [ + Texts("CHILD NAME"), + ]), + Row(children: [ + Texts(model + .babyInformationModelList[index] + .babyName + .trim()), + ]), + Row(children: [ + IconButton( + icon: Image.asset(model + .babyInformationModelList[ + index] + .gender == + 1 + ? 'assets/images/new-design/male.png' + : 'assets/images/new-design/female.png'), + tooltip: '', + onPressed: () { + setState(() { + // _volume += 10; + // launch("tel://" +model.FindusHospitalModelList[index].phoneNumber); + }); + }, + ), + Texts(model + .babyInformationModelList[index] + .genderDescription), + IconButton( + icon: Icon( + Icons.remove_red_eye, + color: Colors.red, + ), + tooltip: '', + onPressed: () { + Navigator.push( + context, + FadePage( + + + page: VaccinationTablePage(), + + + ), + ); + + }, + ) + ]), + Row(children: [ + Texts("Birthday"), + ]), + Row(children: [ + IconButton( + icon: new Image.asset( + 'assets/images/new-design/calender-secondary.png'), + tooltip: '', + onPressed: () { + setState(() { + + }); + }, + ), + Texts(DateUtil.yearMonthDay(model + .babyInformationModelList[index] + .dOB)), + ]), + Row(children: [ + IconButton( + icon: new Image.asset( + 'assets/images/new-design/garbage.png'), + tooltip: '', + onPressed: ()async { + + //===================== + await model.deleteBabyOrders(newChild:deleteBaby ); + + + deleteBaby.babyID=model.babyInformationModelList[index] + .babyID; + + await model.deleteBabyOrders(newChild:deleteBaby ); + if(model.isDeleted){ + AppToast.showSuccessToast(message: "Record Deleted"); + Navigator.pop(context,model.isDeleted); + }else{ + + //TODO handling error + } + + + + + + }, + ), + Texts("Delete"), + ]), + SizedBox( + height: 12, + ), + ], + ), + + ), + + + ) + ], + )) + ), + bottomSheet: Container( + height: MediaQuery.of(context).size.height * 0.12, + width: double.infinity, + padding: EdgeInsets.all(15), + child: SecondaryButton( + textColor: Colors.white, + color: checkedValue == false + ? Colors.white24 + : Color.fromRGBO( + 63, + 72, + 74, + 1, + ), + label: "ADD NEW CHILD ", + // + onTap: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => AddNewChildPage(), + ), + ).then((value) { + if (value) model.getNewUserOrders(); + }); }, ), - SizedBox( - height: 15, - ), - ], - ), - ), - ), - bottomSheet: Container( - height: MediaQuery.of(context).size.height * 0.10, - width: double.infinity, - padding: EdgeInsets.all(15), - child: SecondaryButton( - textColor: Colors.white, - color: checkedValue == false - ? Colors.white24 - : Color.fromRGBO( - 63, - 72, - 74, - 1, - ), - label: TranslationBase.of(context).addChild, - // - onTap: () { - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => AddNewChildPage(), - ), - ).then((value) { - if (value!=null) - model.getNewUserOrders(); - }); - }, - ), - ), - ), - ); + ), + )); } } diff --git a/lib/pages/ChildVaccines/child_vaccines_page.dart b/lib/pages/ChildVaccines/child_vaccines_page.dart index e3503894..92f3a0be 100644 --- a/lib/pages/ChildVaccines/child_vaccines_page.dart +++ b/lib/pages/ChildVaccines/child_vaccines_page.dart @@ -1,10 +1,10 @@ + import 'package:diplomaticquarterapp/core/viewModels/child_vaccines/child_vaccines_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/child_vaccines/user_information_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/my_balance_view_model.dart'; import 'package:diplomaticquarterapp/pages/ChildVaccines/child_page.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; -import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/input/text_field.dart'; @@ -13,142 +13,214 @@ import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; + + class ChildVaccinesPage extends StatefulWidget { @override _ChildVaccinesPageState createState() => _ChildVaccinesPageState(); } class _ChildVaccinesPageState extends State - with SingleTickerProviderStateMixin { + with SingleTickerProviderStateMixin{ TextEditingController titleController = TextEditingController(); - var checkedValue = false; - String addEmail = ""; - final updateEmailFormKey = GlobalKey(); - + var checkedValue=false; + String addEmail=""; @override Widget build(BuildContext context) { + return BaseView( onModelReady: (model) => model.getUserInformationRequestOrders(), builder: (_, model, w) => AppScaffold( - isShowAppBar: true, - baseViewModel: model, - appBarTitle: TranslationBase.of(context).vaccination, - body: SingleChildScrollView( - physics: ScrollPhysics(), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisAlignment: MainAxisAlignment.spaceAround, - children: [ - SizedBox( - height: 20, - ), - Padding( - padding: const EdgeInsets.all(10.0), - child: Container( - child: Texts( - TranslationBase.of(context).welcomeBackV, - fontSize: 20, + isShowAppBar: true, + baseViewModel: model, + appBarTitle: " Vaccination",//TranslationBase.of(context).advancePayment, + body: SingleChildScrollView( + physics: ScrollPhysics(), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.spaceAround, + children: [ + SizedBox( + height: 20, ), - ), - ), - Divider( - color: Colors.black, - indent: 10, - endIndent: 10, - ), - SizedBox( - height: 20, - ), - Padding( - padding: const EdgeInsets.all(10.0), - child: Container( - child: Texts( - TranslationBase.of(context).instructions, - fontSize: 20, + + Padding( + padding: const EdgeInsets.all(10.0), + child:Container( + child: Texts("Welcome back",fontSize: 20,), + ) , ), - ), - ), - Divider( - color: Colors.black, - indent: 10, - endIndent: 10, - ), - Form( - key: updateEmailFormKey, - child: Padding( - padding: const EdgeInsets.all(10.0), - child: Container( - margin: EdgeInsets.only(left: 10, right: 10, top: 15), - child: TextFields( - fillColor: Colors.red, - initialValue: model.userInformationModelList.emailAddress, - fontSize: 20, - hintColor: Colors.black, - fontWeight: FontWeight.w600, - onChanged: (text) { - setState(() { - addEmail = text; - }); - }, - validator: (value) { - if (value.isEmpty) - return TranslationBase.of(context).enterEmail; - else if (!RegExp(r"^[a-zA-Z0-9.a-zA-Z0-9.!#$%&'*+-/=?^_`{|}~]+@[a-zA-Z0-9]+\.[a-zA-Z]+").hasMatch(value)) - return TranslationBase.of(context).validEmail; - return null; - }, + Divider(color:Colors.black , indent: 10, + endIndent: 10,), + SizedBox( + height: 20, + ), + Padding( + padding: const EdgeInsets.all(10.0), + child:Container( + child: Texts("Please ensure that the email address is up-to-date and process to view the schedule",fontSize: 20,), + ) , + ), + + Divider(color:Colors.black , indent: 10, + endIndent: 10,), + Padding( + padding: const EdgeInsets.all(10.0), + child:Container( + + margin: EdgeInsets.only(left: 10, right: 10, top: 15), + child: TextFields( + fillColor: Colors.red, + + hintText: model.user.emailAddress, + controller: titleController, + fontSize: 20, + hintColor: Colors.black, + fontWeight: FontWeight.w600, + onChanged: (text) { + addEmail=text; + model.user.emailAddress==addEmail?checkedValue=false:checkedValue=true; + + + }, + validator: (value) { + + if (value == null) + { + return model.user.emailAddress; + + } + else + + { + return model.user.emailAddress;} + }, + ), ), ), - ), - ), - Container( - height: MediaQuery.of(context).size.height * 0.10, - width: double.infinity, - padding: EdgeInsets.all(15), - child: SecondaryButton( - textColor: Colors.white, - color: model.userInformationModelList.emailAddress == addEmail ? Colors.white24 : Color.fromRGBO(63, 72, 74, 1,), - disabled: addEmail.isEmpty, - label: TranslationBase.of(context).updateEmail, - onTap: () async{ - final form = updateEmailFormKey.currentState; - if (form.validate()) { - form.save(); - await model.updateEmail(addEmail); - AppToast.showSuccessToast(message: TranslationBase.of(context).updatedEmail); - } - - }, - ), - ), - Container( - height: MediaQuery.of(context).size.height * 0.10, - width: double.infinity, - padding: EdgeInsets.all(15), - child: SecondaryButton( - textColor: Colors.white, - color: Color.fromRGBO( - 63, - 72, - 74, - 1, + Container( + height: MediaQuery.of(context).size.height * 0.12, + width: double.infinity, + + padding: EdgeInsets.all(15), + child: SecondaryButton( + textColor: Colors.white, + color: checkedValue== false ?Colors.white24:Color.fromRGBO(63, 72, 74, 1,), + label: "UPDATE EMAIL", + // + onTap: (){ + model.user.emailAddress=addEmail.toString(); + AppToast.showSuccessToast( + message: "Email updated"); + // bloodDetails.city=_selectedHospital.toString(); + + // bloodDetails. + }, + + + ), ), - label: TranslationBase.of(context).viewListChildren, - onTap: () => Navigator.push( - context, - FadePage( - page: ChildPage(informationModel: model.userInformationModelList,), + Container( + height: MediaQuery.of(context).size.height * 0.12, + width: double.infinity, + + padding: EdgeInsets.all(15), + child: SecondaryButton( + textColor: Colors.white, + color: Color.fromRGBO(63, 72, 74, 1,), + label: " VIEW LIST OF CHILDREN", + // + onTap: () => Navigator.push( + context, + FadePage( + page: ChildPage(), + + + + ), + ), + + ), ), - ), + + // Texts( + // // TranslationBase.of(context).advancePaymentLabel, + // model.user.emailAddress, + // textAlign: TextAlign.center, + // ), + SizedBox( + height: 12, + ), + SizedBox( + height: 12, + ), + SizedBox( + height: 12, + ), + + SizedBox( + height: 12, + ), + + SizedBox( + height: 12, + ), + + SizedBox( + height: 10, + ), + // Row( + // mainAxisAlignment: MainAxisAlignment.center, + // crossAxisAlignment: CrossAxisAlignment.center, + // children: [ + // Center( + // child: Container( + // color: Colors.white, + // width: 350, + // child: InkWell( + // onTap: () { + // showDialog( + // context: context, + // builder: (_) => + // AssetGiffyDialog( + // title: Text( + // "", + // style: TextStyle( + // fontSize: 22.0, + // fontWeight: + // FontWeight + // .w600), + // ), + // image: Image.asset( + // 'assets/images/BloodChrt_EN.png'), + // buttonCancelText: + // Text('cancel'), + // buttonCancelColor: + // Colors.grey, + // onlyCancelButton: true, + // )); + // }, + // child: Container( + // width: 250, + // height: 200, + // child:Image.asset( + // 'assets/images/BloodChrt_EN.png')), + // ), + // ), + // ), + // ], + // ), + + SizedBox( + height: MediaQuery.of(context).size.height * 0.15, + ) + ], ), - SizedBox( - height: MediaQuery.of(context).size.height * 0.15, - ) - ], + + ), ), - ), - ), ); } } + diff --git a/lib/pages/ChildVaccines/dialogs/ConfirmSendEmailDialog.dart b/lib/pages/ChildVaccines/dialogs/SelectGenderDialog.dart similarity index 70% rename from lib/pages/ChildVaccines/dialogs/ConfirmSendEmailDialog.dart rename to lib/pages/ChildVaccines/dialogs/SelectGenderDialog.dart index 2279dd51..259bbdb7 100644 --- a/lib/pages/ChildVaccines/dialogs/ConfirmSendEmailDialog.dart +++ b/lib/pages/ChildVaccines/dialogs/SelectGenderDialog.dart @@ -5,18 +5,15 @@ import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -class ConfirmSendEmailDialog extends StatefulWidget { - final email; - final Function onTap; - - const ConfirmSendEmailDialog({Key key, this.email, this.onTap}) - : super(key: key); +class SelectGenderDialog extends StatefulWidget { + final Email; + const SelectGenderDialog({Key key, this.Email}) : super(key: key); @override - _ConfirmSendEmailDialogState createState() => _ConfirmSendEmailDialogState(); + _SelectGenderDialogState createState() => _SelectGenderDialogState(); } -class _ConfirmSendEmailDialogState extends State { +class _SelectGenderDialogState extends State { @override Widget build(BuildContext context) { return SimpleDialog( @@ -24,15 +21,22 @@ class _ConfirmSendEmailDialogState extends State { Container( child: Column( children: [ - Texts(TranslationBase.of(context).confirm), Divider(), Row( children: [ Expanded( flex: 1, - child: ListTile( - title: Text(TranslationBase.of(context).confirmSend + - "\n ${widget.email} "), + child: InkWell( + onTap: () { + setState(() { + //beneficiaryType = Gender.Male; + }); + }, + child: ListTile( + title: Text("Send the child's schedule to the email\n Tamer.dasdasdas@gmail.com "), + + + ), ), ) ], @@ -40,7 +44,15 @@ class _ConfirmSendEmailDialogState extends State { SizedBox( height: 5.0, ), + + SizedBox( + height: 5.0, + ), + SizedBox( + height: 5.0, + ), Row( + // mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Expanded( flex: 1, @@ -70,7 +82,8 @@ class _ConfirmSendEmailDialogState extends State { flex: 1, child: InkWell( onTap: () { - widget.onTap(); + AppToast.showSuccessToast(message: "Email Sended"); + // widget.onValueSelected(beneficiaryType); Navigator.pop(context); }, child: Padding( @@ -92,4 +105,7 @@ class _ConfirmSendEmailDialogState extends State { ], ); } + + + } diff --git a/lib/pages/ChildVaccines/dialogs/delete_child.dart b/lib/pages/ChildVaccines/dialogs/delete_child.dart index 41b02bd5..250f40d3 100644 --- a/lib/pages/ChildVaccines/dialogs/delete_child.dart +++ b/lib/pages/ChildVaccines/dialogs/delete_child.dart @@ -6,10 +6,6 @@ import 'package:flutter/material.dart'; class DeleteChild extends StatefulWidget { - final Function onTap; - - const DeleteChild({Key key, this.onTap}) : super(key: key); - @override _DeleteChildState createState() => _DeleteChildState(); } @@ -22,14 +18,21 @@ class _DeleteChildState extends State { Container( child: Column( children: [ - Texts(TranslationBase.of(context).confirm), Divider(), Row( children: [ Expanded( - child: ListTile( - title: Texts(TranslationBase.of(context).deletedChild), + flex: 1, + child: InkWell( + onTap: () { + setState(() { + //beneficiaryType = Gender.Male; + }); + }, + child: ListTile( + title: Text("Delete the child "), + ), ), ) ], @@ -37,7 +40,15 @@ class _DeleteChildState extends State { SizedBox( height: 5.0, ), + + SizedBox( + height: 5.0, + ), + SizedBox( + height: 5.0, + ), Row( + // mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Expanded( flex: 1, @@ -67,7 +78,7 @@ class _DeleteChildState extends State { flex: 1, child: InkWell( onTap: () { - widget.onTap(); + // widget.onValueSelected(beneficiaryType); Navigator.pop(context); }, child: Padding( diff --git a/lib/pages/ChildVaccines/vaccinationtable_page.dart b/lib/pages/ChildVaccines/vaccinationtable_page.dart index 68734c9a..c160acfb 100644 --- a/lib/pages/ChildVaccines/vaccinationtable_page.dart +++ b/lib/pages/ChildVaccines/vaccinationtable_page.dart @@ -1,181 +1,101 @@ -import 'package:diplomaticquarterapp/core/model/childvaccines/List_BabyInformationModel.dart'; -import 'package:diplomaticquarterapp/core/model/childvaccines/user_information_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/child_vaccines/vaccination_table_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/reports_monthly_view_model.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; -import 'package:diplomaticquarterapp/uitl/app_toast.dart'; -import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; -import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -import 'package:flutter_flexible_toast/flutter_flexible_toast.dart'; import 'package:flutter_html/flutter_html.dart'; -import 'package:font_awesome_flutter/font_awesome_flutter.dart'; -import 'dialogs/ConfirmSendEmailDialog.dart'; +import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; -class VaccinationTablePage extends StatelessWidget { - final List_BabyInformationModel babyInfo; - final List_UserInformationModel informationModel; - - const VaccinationTablePage({Key key, this.babyInfo, this.informationModel}) - : super(key: key); +import 'dialogs/SelectGenderDialog.dart'; +class VaccinationTablePage extends StatelessWidget { @override Widget build(BuildContext context) { var checkedValue; return BaseView( - onModelReady: (model) => model.getCreateVaccinationTable(babyInfo: babyInfo, informationModel: informationModel), + onModelReady: (model) => model.getCreateVaccinationTable(),//getUserTermsAndConditions(), builder: (_, model, w) => AppScaffold( isShowAppBar: true, baseViewModel: model, - appBarTitle: TranslationBase.of(context).vaccination, + appBarTitle: "Vaccination", body: SingleChildScrollView( - child: Container( - margin: EdgeInsets.only(left: 15, right: 15, top: 10), + child:Container( + margin: EdgeInsets.only(left: 15,right: 15,top: 70), child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - children: [ - Expanded( - child: Column( - children: [ - Texts(TranslationBase.of(context).childName), - Texts( - babyInfo.babyName ?? '', - fontWeight: FontWeight.w600, - ), - ], - ), - ), - Expanded( - child: Column( - children: [ - Texts(TranslationBase.of(context).childDob), - Row( - crossAxisAlignment: CrossAxisAlignment.center, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Icon( - FontAwesomeIcons.calendarCheck, - color: Colors.red, - ), - SizedBox( - width: 15, - ), - Texts(DateUtil.yearMonthDay(babyInfo.dOB) ?? ''), - ], - ), - ], - ), - ), - ], - ), - SizedBox( - height: 15, - ), - Divider(), - Column( - children: [ - Row( - children: [ - Texts(TranslationBase.of(context).visit), - SizedBox( - width: 10, - ), - Expanded( - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Texts(TranslationBase.of(context) - .descriptionVaccination), - ], - ), + children: [//babyInformationModelList.length + ...List.generate(model.creteVaccinationTableModelList.length, (index) => + Container( + decoration: BoxDecoration( + shape: BoxShape.rectangle, + border: Border.all(color: Colors.white, width: 0.5), + borderRadius: BorderRadius.all(Radius.circular(5)), + color: Colors.white, + ), - Texts(TranslationBase.of(context).dueDate), - ], - ), - ], - ), - ...List.generate( - model.creteVaccinationTableModelList.length, - (index) => Container( - padding: EdgeInsets.all(12), - width: double.infinity, - child: Column( - children: [ - Row( + padding: EdgeInsets.all(12), + width: double.infinity, + child: Column( + children: [ - Texts(model - .creteVaccinationTableModelList[index].visit), - SizedBox( - width: 10, - ), - Expanded( - child: Column( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Html( - data: model - .creteVaccinationTableModelList[index] - .vaccinesDescription, - ), - ], - ), - ), - Texts(model - .creteVaccinationTableModelList[index].givenAt), + Row(children: [ + Text(model.creteVaccinationTableModelList[index].visit), + SizedBox(width: 10,), + + Expanded( + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Html( + // data:"
BCG
HEPATITIS B
"//model.creteVaccinationTableModelList[index].vaccinesDescription + data:model.creteVaccinationTableModelList[index].vaccinesDescription, + + ), + ],), + ), + Text(model.creteVaccinationTableModelList[index].givenAt), + + + ],), + Divider(color:Colors.black ,), + ], - ), - Divider( - color: Colors.white, - height: 3, - thickness: 1.0, - ), - ], - ), - ), + ) + + + ) + ) ], ), - ), + ), - bottomSheet: Padding( - padding: const EdgeInsets.all(8.0), - child: Container( - height: MediaQuery.of(context).size.height * 0.10, - width: double.infinity, - padding: EdgeInsets.all(12), - child: SecondaryButton( - textColor: Colors.white, - color: checkedValue == false - ? Colors.white24 - : Color.fromRGBO( - 63, - 72, - 74, - 1, - ), - label: TranslationBase.of(context).sendEmail, - onTap: () { - showDialog( - context: context, - child: ConfirmSendEmailDialog( - email: informationModel.emailAddress, - onTap: () async { - await model.getCreateVaccinationTable(babyInfo: babyInfo, informationModel: informationModel,isSendEmail: true); - AppToast.showSuccessToast(message: TranslationBase.of(context).emailSuccess,toastLength: Toast.LENGTH_LONG); - - }, - ), - ); - }, - ), + ), + bottomSheet: Container( + height: MediaQuery.of(context).size.height * 0.12, + width: double.infinity, + + padding: EdgeInsets.all(12), + child: SecondaryButton( + textColor: Colors.white, + color: checkedValue== false ?Colors.white24:Color.fromRGBO(63, 72, 74, 1,), + label: "Send Email ", + // + onTap: () { + //SelectGenderDialog(); +//=============== + showDialog( + context: context, + child: SelectGenderDialog( + ), + ); + //========= + } + + ), ), ), diff --git a/lib/pages/ContactUs/findus/findus_page.dart b/lib/pages/ContactUs/findus/findus_page.dart index f920de9f..807ac1c7 100644 --- a/lib/pages/ContactUs/findus/findus_page.dart +++ b/lib/pages/ContactUs/findus/findus_page.dart @@ -4,7 +4,6 @@ import 'package:diplomaticquarterapp/core/viewModels/contactus/findus_view_model import 'package:diplomaticquarterapp/pages/ContactUs/findus/hospitrals_page.dart'; import 'package:diplomaticquarterapp/pages/ContactUs/findus/pharmacies_page.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; -import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; @@ -40,7 +39,7 @@ class _FindUsPageState extends State builder: (_, model, w) => AppScaffold( isShowAppBar: true, isShowDecPage: false, - appBarTitle: TranslationBase.of(context).ourLocation, + appBarTitle: 'Locations', baseViewModel: model, body: Scaffold( extendBodyBehindAppBar: true, @@ -91,13 +90,13 @@ class _FindUsPageState extends State Container( width: MediaQuery.of(context).size.width * 0.30, child: Center( - child: Texts(TranslationBase.of(context).hospitals), + child: Texts(' Hospitals '), ), ), Container( width: MediaQuery.of(context).size.width * 0.30, child: Center( - child: Texts(TranslationBase.of(context).pharmacies), + child: Texts(' Pharmacies '), ), ), ], diff --git a/lib/pages/Covid-DriveThru/Covid-TimeSlots.dart b/lib/pages/Covid-DriveThru/Covid-TimeSlots.dart index 8375e337..3e58b657 100644 --- a/lib/pages/Covid-DriveThru/Covid-TimeSlots.dart +++ b/lib/pages/Covid-DriveThru/Covid-TimeSlots.dart @@ -9,13 +9,13 @@ import 'package:diplomaticquarterapp/services/covid-drivethru/covid-drivethru.da import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; -import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/material.dart'; import 'package:flutter_svg/flutter_svg.dart'; import 'package:intl/intl.dart'; +import 'package:smart_progress_bar/smart_progress_bar.dart'; import 'package:table_calendar/table_calendar.dart'; class CovidTimeSlots extends StatefulWidget { @@ -481,7 +481,6 @@ class _CovidTimeSlotsState extends State insertAppointmentCovidTest(context, DoctorList docObject) { DoctorsListService service = new DoctorsListService(); - GifLoaderDialogUtils.showMyDialog(context); AppoitmentAllHistoryResultList appo; service .insertAppointment( @@ -492,7 +491,7 @@ class _CovidTimeSlotsState extends State CovidTimeSlots.selectedDate, context) .then((res) { - GifLoaderDialogUtils.hideDialog(context); + print(res); if (res['MessageStatus'] == 1) { AppToast.showSuccessToast(message: "Appointment Booked Successfully"); Future.delayed(new Duration(milliseconds: 1800), () { @@ -522,19 +521,17 @@ class _CovidTimeSlotsState extends State dialog.showAlertDialog(context); } }).catchError((err) { - GifLoaderDialogUtils.hideDialog(context); AppToast.showErrorToast(message: err); print(err); - }); + }).showProgressBar( + text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); } cancelAppointment(DoctorList docObject, AppoitmentAllHistoryResultList appo, BuildContext context) { ConfirmDialog.closeAlertDialog(context); - GifLoaderDialogUtils.showMyDialog(context); DoctorsListService service = new DoctorsListService(); service.cancelAppointment(appo, context).then((res) { - GifLoaderDialogUtils.hideDialog(context); if (res['MessageStatus'] == 1) { Future.delayed(new Duration(milliseconds: 1500), () { insertAppointmentCovidTest(context, docObject); @@ -543,27 +540,28 @@ class _CovidTimeSlotsState extends State AppToast.showErrorToast(message: res['ErrorEndUserMessage']); } }).catchError((err) { - GifLoaderDialogUtils.hideDialog(context); - AppToast.showErrorToast(message: err); print(err); - }); + }).showProgressBar( + text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); } getPatientShare(context, String appointmentNo, int clinicID, int projectID, DoctorList docObject) { - GifLoaderDialogUtils.showMyDialog(context); DoctorsListService service = new DoctorsListService(); service .getPatientShare(appointmentNo, clinicID, projectID, context) .then((res) { - GifLoaderDialogUtils.hideDialog(context); - widget.patientShareResponse = new PatientShareResponse.fromJson(res); - navigateToPaymentAlert(); - }).catchError((err) { - GifLoaderDialogUtils.hideDialog(context); - AppToast.showErrorToast(message: err); - print(err); - }); + print(res); + widget.patientShareResponse = new PatientShareResponse.fromJson(res); + }) + .catchError((err) { + print(err); + }) + .showProgressBar( + text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)) + .then((value) { + navigateToPaymentAlert(); + }); } navigateToPaymentAlert() { @@ -575,10 +573,8 @@ class _CovidTimeSlotsState extends State } getCovidFreeSlots(BuildContext context, int projectID) { - GifLoaderDialogUtils.showMyDialog(context); CovidDriveThruService service = new CovidDriveThruService(); service.getCovidFreeSlots(context, projectID).then((res) { - GifLoaderDialogUtils.hideDialog(context); print(res['COVID19_FreeTimeSlots']); if (res['MessageStatus'] == 1) { if (res['COVID19_FreeTimeSlots'].length != 0) { @@ -599,9 +595,8 @@ class _CovidTimeSlotsState extends State AppToast.showErrorToast(message: res['ErrorEndUserMessage']); } }).catchError((err) { - GifLoaderDialogUtils.hideDialog(context); - AppToast.showErrorToast(message: err); print(err); - }); + }).showProgressBar( + text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); } } diff --git a/lib/pages/Covid-DriveThru/covid-drivethru-location.dart b/lib/pages/Covid-DriveThru/covid-drivethru-location.dart index 245bcbaf..0563c4bd 100644 --- a/lib/pages/Covid-DriveThru/covid-drivethru-location.dart +++ b/lib/pages/Covid-DriveThru/covid-drivethru-location.dart @@ -3,12 +3,11 @@ import 'package:diplomaticquarterapp/models/CovidDriveThru/DriveThroughTestingCe import 'package:diplomaticquarterapp/pages/Covid-DriveThru/covid-payment-details.dart'; import 'package:diplomaticquarterapp/routes.dart'; import 'package:diplomaticquarterapp/services/covid-drivethru/covid-drivethru.dart'; -import 'package:diplomaticquarterapp/uitl/app_toast.dart'; -import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/material.dart'; import 'package:maps_launcher/maps_launcher.dart'; +import 'package:smart_progress_bar/smart_progress_bar.dart'; class CovidDrivethruLocation extends StatefulWidget { @override @@ -259,38 +258,37 @@ class _CovidDrivethruLocationState extends State { CovidPaymentInfoResponse covidPaymentInfoResponse = new CovidPaymentInfoResponse(); - GifLoaderDialogUtils.showMyDialog(context); - service .getCovidPaymentInformation(context, int.parse(projectID)) .then((res) { - GifLoaderDialogUtils.hideDialog(context); if (res['MessageStatus'] == 1) { setState(() { covidPaymentInfoResponse = CovidPaymentInfoResponse.fromJson( res['COVID19_PatientShare']); + print(covidPaymentInfoResponse.procedureNameField); }); - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => CovidPaymentDetails( - covidPaymentInfoResponse: covidPaymentInfoResponse, - projectID: int.parse(projectID), - ))); } else {} }) .catchError((err) { - GifLoaderDialogUtils.hideDialog(context); - AppToast.showErrorToast(message: err); print(err); + }) + .showProgressBar( + text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)) + .then((value) { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => CovidPaymentDetails( + covidPaymentInfoResponse: covidPaymentInfoResponse, + projectID: int.parse(projectID), + ))); }); } getProjectsList(BuildContext context) { CovidDriveThruService service = new CovidDriveThruService(); - GifLoaderDialogUtils.showMyDialog(context); service.getCovidProjectsList(context).then((res) { - GifLoaderDialogUtils.hideDialog(context); + print(res); if (res['MessageStatus'] == 1) { print(res); setState(() { @@ -300,9 +298,8 @@ class _CovidDrivethruLocationState extends State { }); } else {} }).catchError((err) { - GifLoaderDialogUtils.hideDialog(context); - AppToast.showErrorToast(message: err); print(err); - }); + }).showProgressBar( + text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); } } diff --git a/lib/pages/DrawerPages/family/add-family-member.dart b/lib/pages/DrawerPages/family/add-family-member.dart index 084b43e6..35b19ccd 100644 --- a/lib/pages/DrawerPages/family/add-family-member.dart +++ b/lib/pages/DrawerPages/family/add-family-member.dart @@ -5,7 +5,6 @@ import 'package:diplomaticquarterapp/routes.dart'; import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart'; import 'package:diplomaticquarterapp/services/family_files/family_files_provider.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; -import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; @@ -145,7 +144,7 @@ class _AddMember extends State { request.zipCode = countryCode; request.isRegister = false; request.patientStatus = 2; - GifLoaderDialogUtils.showMyDialog(context); + loading(true); familyFileProvider .addFamilyFile(request) .then((value) => manageFamily(value)) @@ -155,21 +154,18 @@ class _AddMember extends State { } manageFamily(addMemberResult) { - GifLoaderDialogUtils.hideDialog(context); - if(addMemberResult is String ==false){ - ConfirmDialog dialog = new ConfirmDialog( - context: context, - confirmMessage: addMemberResult['ShareFamilyFileObj']['Message'], - okText: TranslationBase.of(context).confirm, - cancelText: TranslationBase.of(context).cancel_nocaps, - okFunction: () => { - insertFamilyData(addMemberResult), - ConfirmDialog.closeAlertDialog(context) - }, - cancelFunction: () => {}); - dialog.showAlertDialog(context); - } - + loading(false); + ConfirmDialog dialog = new ConfirmDialog( + context: context, + confirmMessage: addMemberResult['ShareFamilyFileObj']['Message'], + okText: TranslationBase.of(context).confirm, + cancelText: TranslationBase.of(context).cancel_nocaps, + okFunction: () => { + insertFamilyData(addMemberResult), + ConfirmDialog.closeAlertDialog(context) + }, + cancelFunction: () => {}); + dialog.showAlertDialog(context); } insertFamilyData(addMemberResult) { diff --git a/lib/pages/DrawerPages/family/add-family_type.dart b/lib/pages/DrawerPages/family/add-family_type.dart index 2c85b043..96e055b3 100644 --- a/lib/pages/DrawerPages/family/add-family_type.dart +++ b/lib/pages/DrawerPages/family/add-family_type.dart @@ -75,7 +75,7 @@ class AddFamilyMemberType extends StatelessWidget { ), AppText( TranslationBase.of(context) - .idNo, + .nationalID, fontSize: SizeConfig .textMultiplier * 2, @@ -113,10 +113,9 @@ class AddFamilyMemberType extends StatelessWidget { AppText( TranslationBase.of(context) .fileNo, - textAlign: TextAlign.center, fontSize: SizeConfig .textMultiplier * - 1.8, + 2, ) ], ), diff --git a/lib/pages/DrawerPages/family/my-family.dart b/lib/pages/DrawerPages/family/my-family.dart index 196f9e19..d3de1b62 100644 --- a/lib/pages/DrawerPages/family/my-family.dart +++ b/lib/pages/DrawerPages/family/my-family.dart @@ -1,29 +1,24 @@ -import 'dart:ui'; - import 'package:diplomaticquarterapp/config/size_config.dart'; -import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/models/Authentication/check_activation_code_response.dart'; -import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart'; -import 'package:diplomaticquarterapp/core/service/AuthenticatedUserObject.dart'; -import 'package:diplomaticquarterapp/core/viewModels/appointment_rate_view_model.dart'; -import 'package:diplomaticquarterapp/locator.dart'; -import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; import 'package:diplomaticquarterapp/models/FamilyFiles/GetAllSharedRecordByStatusResponse.dart'; +import 'package:diplomaticquarterapp/pages/BookAppointment/widgets/BranchView.dart'; import 'package:diplomaticquarterapp/services/family_files/family_files_provider.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; -import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:diplomaticquarterapp/widgets/card/rounded_container.dart'; import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:diplomaticquarterapp/widgets/others/bottom_bar.dart'; +import 'package:diplomaticquarterapp/widgets/progress_indicator/app_circular_progress_Indeicator.dart'; import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/routes.dart'; -import 'package:provider/provider.dart'; + class MyFamily extends StatefulWidget { final bool isAppbarVisible; MyFamily({this.isAppbarVisible =true}); @@ -36,136 +31,51 @@ class _MyFamily extends State with TickerProviderStateMixin { AppSharedPreferences sharedPref = new AppSharedPreferences(); var userID; TabController _tabController; - int _tabIndex = 0; - AuthenticatedUserObject authenticatedUserObject = - locator(); - AppointmentRateViewModel appointmentRateViewModel = - locator(); - ProjectViewModel projectViewModel; - AuthenticatedUser user; - List imagesInfo = List(); + @override void initState() { _tabController = new TabController(length: 2, vsync: this, initialIndex: 0); - checkUserData(); + super.initState(); } bool expandFlag = false; - Widget build(BuildContext context) { - imagesInfo.add(ImagesInfo( - imageEn: - 'https://hmgwebservices.com/Images/MobileApp/images-info-home/family-file/en/0.png', - imageAr: - 'https://hmgwebservices.com/Images/MobileApp/images-info-home/family-file/ar/0.png'), - ); - - imagesInfo.add(ImagesInfo( - imageEn: - 'https://hmgwebservices.com/Images/MobileApp/images-info-home/family-file/en/1.png', - imageAr: - 'https://hmgwebservices.com/Images/MobileApp/images-info-home/family-file/ar/1.png'), - ); - projectViewModel = Provider.of(context); - return AppScaffold( - appBarTitle: TranslationBase.of(context).myFamilyFiles, - isShowAppBar: widget.isAppbarVisible, - imagesInfo: imagesInfo, - description: TranslationBase.of(context).familyInfo, - body: Scaffold( - extendBodyBehindAppBar: true, - appBar: PreferredSize( - preferredSize: Size.fromHeight(65.0), - child: Stack( - children: [ - Positioned( - bottom: 1, - left: 0, - right: 0, - child: BackdropFilter( - filter: ImageFilter.blur(sigmaX: 10, sigmaY: 10), - child: Container( - color: Theme.of(context) - .scaffoldBackgroundColor - .withOpacity(0.8), - height: 70.0, - ), - ), - ), - Center( - child: Container( - height: 60.0, - margin: EdgeInsets.only(top: 10.0), - width: MediaQuery.of(context).size.width * 0.92, // 0.9, - decoration: BoxDecoration( - border: Border( - bottom: BorderSide( - color: Theme.of(context).dividerColor, - width: 0.9), //width: 0.7 - ), - color: Colors.white), - child: Center( - child: TabBar( - isScrollable: true, - controller: _tabController, - indicatorWeight: 5.0, - //indicatorSize: TabBarIndicatorSize.label, - indicatorSize: TabBarIndicatorSize.tab, - - indicatorColor: Theme.of(context).primaryColor, - labelColor: Theme.of(context).primaryColor, - labelPadding: - EdgeInsets.only(top: 4.0, left: 35.0, right: 35.0), - unselectedLabelColor: Colors.grey[800], - tabs: [ - - Container( - width: MediaQuery.of(context).size.width * 0.30, - child: Center( - child: AppText(TranslationBase.of(context).family), - ), - ), - Container( - width: MediaQuery.of(context).size.width * 0.30, - child: Center( - child: AppText(TranslationBase.of(context).request), - ), - ), - ], - ), - ), - ), - ), - ], - ), - ), - body: Column( - children: [ - Expanded( - child: (user != null && projectViewModel.isLogin) ? TabBarView( - physics: BouncingScrollPhysics(), - controller: _tabController, - children: [ - myFamilyDetails(context), - myFamilyRequest(context) - ], - ) : Container(child:AppText('Loading..')), - ) - ], - ), - ), - ); - - - + // return Scaffold( + // appBar: AppBar( + // bottom: TabBar( + // indicatorColor: Colors.red, + // tabs: [ + // Padding( + // padding: EdgeInsets.all(6), + // child: AppText( + // TranslationBase.of(context).family, + // color: Colors.white, + // )), + // Padding( + // padding: EdgeInsets.all(6), + // child: AppText( + // TranslationBase.of(context).request, + // color: Colors.white, + // )), + // ], + // controller: _tabController, + // ), + // + // ), + // body: TabBarView( + // // physics: NeverScrollableScrollPhysics(), + // children: [myFamilyDetails(context), myFamilyRequest(context)], + // controller: _tabController), + // ); + // //bottomNavigationBar: BottomBarSearch()); return AppScaffold( appBarTitle: TranslationBase.of(context).myFamilyFiles, isShowAppBar: widget.isAppbarVisible, body: SingleChildScrollView( child: Container( - height: SizeConfig.screenHeight *.9, + height: SizeConfig.screenHeight, width: SizeConfig.realScreenWidth, padding: EdgeInsets.all(20), child: Stack( @@ -174,11 +84,12 @@ class _MyFamily extends State with TickerProviderStateMixin { controller: _tabController, indicatorColor: Colors.red, tabs: [ - Tab( // padding: EdgeInsets.all(6), - child:AppText(TranslationBase.of(context).family)), - Tab( - // padding: EdgeInsets.all(6), - child:AppText(TranslationBase.of(context).request)), + Padding( + padding: EdgeInsets.all(6), + child: Text(TranslationBase.of(context).family)), + Padding( + padding: EdgeInsets.all(6), + child: Text(TranslationBase.of(context).request)), ], ), TabBarView( @@ -195,7 +106,7 @@ class _MyFamily extends State with TickerProviderStateMixin { Widget myFamilyDetails(context) { return Container( height: MediaQuery.of(context).size.height, - margin: EdgeInsets.fromLTRB(20.0, 25.0, 20.0, 0.0), + margin: EdgeInsets.fromLTRB(20.0, 0, 20.0, 0.0), child: Column( children: [ Expanded( @@ -317,7 +228,7 @@ class _MyFamily extends State with TickerProviderStateMixin { SingleChildScrollView( child: Container( height: MediaQuery.of(context).size.height, - margin: EdgeInsets.only(top:65), + margin: EdgeInsets.only(top:50), child: Column( children: [ RoundedContainer( @@ -344,37 +255,34 @@ class _MyFamily extends State with TickerProviderStateMixin { else return Column( children: [ - // Padding(padding: EdgeInsets.only(left:10, right:10), - // child: - // Row( - // mainAxisAlignment: - // MainAxisAlignment.spaceBetween, - // children: [ - // Expanded( - // flex: 3, - // child: Text(TranslationBase.of(context) - // .request)), - // Expanded( - // flex: 2, - // child: Text( - // TranslationBase.of(context) - // .switchUser, - // )), - // Expanded( - // flex: 1, - // child: Text( - // TranslationBase.of(context) - // .deleteView, - // )), - // ], - // )), + Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + Expanded( + flex: 3, + child: Text(TranslationBase.of(context) + .request)), + Expanded( + flex: 2, + child: Text( + TranslationBase.of(context) + .switchUser, + )), + Expanded( + flex: 1, + child: Text( + TranslationBase.of(context) + .deleteView, + )), + ], + ), Column(children: [ - Padding( - padding: EdgeInsets.only(left:10, right:10), child:Row(children: [ + Row(children: [ Expanded(flex: 3, child: AppText('Name')), Expanded(flex: 1, child: AppText('Allow')), Expanded(flex: 1, child: AppText('Reject')), - ])), + ]), Column( children:familyFileProvider.allSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList .map((result) { @@ -394,8 +302,8 @@ class _MyFamily extends State with TickerProviderStateMixin { color: Colors.black, ), onPressed: () { - acceptRemoveRequest( - result.iD, 3, context); + acceptRequest( + result, context); }, )), Expanded( @@ -406,8 +314,8 @@ class _MyFamily extends State with TickerProviderStateMixin { color: Colors.black, ), onPressed: () { - acceptRemoveRequest( - result.iD,4, context); + deleteRequest( + result, context); }, )) ], @@ -463,7 +371,7 @@ class _MyFamily extends State with TickerProviderStateMixin { flex: 2, child: AppText( result.statusDescription, - color: result.status==3 ? Colors.green: Colors.red, + color: Colors.red, )), ], )); @@ -497,36 +405,31 @@ class _MyFamily extends State with TickerProviderStateMixin { else return Column( children: [ - // Padding( - // padding:EdgeInsets.only(left:10, right:10), - // child: Row( - // mainAxisAlignment: - // MainAxisAlignment.spaceBetween, - // children: [ - // Expanded( - // flex: 3, - // child: AppText( - // TranslationBase.of(context).request), - // ), - // Expanded( - // flex: 2, - // child: AppText( - // TranslationBase.of(context).switchUser, - // )), - // Expanded( - // flex: 1, - // child: AppText( - // TranslationBase.of(context).deleteView, - // )), - // ], - // )), + Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + Expanded( + flex: 3, + child: Text( + TranslationBase.of(context).request)), + Expanded( + flex: 2, + child: Text( + TranslationBase.of(context).switchUser, + )), + Expanded( + flex: 1, + child: Text( + TranslationBase.of(context).deleteView, + )), + ], + ), Column(children: [ - Padding( - padding:EdgeInsets.only(left:10, right:10), - child: Row(children: [ + Row(children: [ Expanded(flex: 3, child: AppText('Name')), Expanded(flex: 1, child: AppText('Delete')), - ])), + ]), Column( children: familyFileProvider.allSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList .map((result) { @@ -536,7 +439,7 @@ class _MyFamily extends State with TickerProviderStateMixin { children: [ Expanded( flex: 3, - child: AppText(result.patientName)), + child: Text(result.patientName)), Expanded( flex: 1, child: IconButton( @@ -545,8 +448,8 @@ class _MyFamily extends State with TickerProviderStateMixin { color: Colors.black, ), onPressed: () { - deactivateRequest(result.iD, - 5, context); + deleteRequest( + result, context); }, )), ], @@ -566,14 +469,12 @@ class _MyFamily extends State with TickerProviderStateMixin { } Future getFamilyFiles() async { - if (user != null) { - if (await sharedPref.getObject(FAMILY_FILE) != null) { - // print(await sharedPref.getObject(FAMILY_FILE)); - return Future.value(GetAllSharedRecordsByStatusResponse.fromJson( - await sharedPref.getObject(FAMILY_FILE))); - } else { - return familyFileProvider.getSharedRecordByStatus(); - } + if (await sharedPref.getObject(FAMILY_FILE) != null) { + // print(await sharedPref.getObject(FAMILY_FILE)); + return Future.value(GetAllSharedRecordsByStatusResponse.fromJson( + await sharedPref.getObject(FAMILY_FILE))); + } else { + return familyFileProvider.getSharedRecordByStatus(); } } @@ -613,45 +514,25 @@ class _MyFamily extends State with TickerProviderStateMixin { } refreshFamily(context) { - //sharedPref.remove(FAMILY_FILE); - setState(() { - sharedPref.remove(FAMILY_FILE); - }); + sharedPref.remove(FAMILY_FILE); + (context as Element).reassemble(); } switchUser(user, context) { - GifLoaderDialogUtils.showMyDialog(context); - // this - // .familyFileProvider - // .silentLoggin(user) - // .then((value) => loginAfter(value, context)); - - // Utils.showProgressDialog(context); + GifLoaderDialogUtils.showMyDialog(context); this .familyFileProvider - .silentLoggin(user is AuthenticatedUser ? null : user, - mainUser: user is AuthenticatedUser) - .then((value) => loginAfter(value, context)) - .catchError((err) { - print(err); - AppToast.showErrorToast(message: err); - Navigator.of(context).pop(); - }); + .silentLoggin(user) + .then((value) => loginAfter(value, context)); } loginAfter(result, context) async{ GifLoaderDialogUtils.hideDialog(context); var familyFile = await sharedPref.getObject(FAMILY_FILE); - Provider.of(context, listen: false).setPrivilege(privilegeList: result,isLoginChild: true); result = CheckActivationCode.fromJson(result); - var mainUser = await sharedPref.getObject(MAIN_USER); this.sharedPref.clear(); - if (mainUser["PatientID"] != result.list.patientID) { - result.list.isFamily = true; - } - this.sharedPref.setObject(MAIN_USER, mainUser); - this.sharedPref.setObject(USER_PROFILE, result.list); this.sharedPref.setObject(FAMILY_FILE, familyFile); + this.sharedPref.setObject(USER_PROFILE, result.list); this.sharedPref.setObject(LOGIN_TOKEN_ID, result.logInTokenID); this.sharedPref.setString(TOKEN, result.authenticationTokenID); //this.checkIfUserAgreedBefore(result), @@ -660,37 +541,6 @@ class _MyFamily extends State with TickerProviderStateMixin { ); } - deactivateRequest(ID, status, context) { - GifLoaderDialogUtils.showMyDialog(context); - Map request = {}; - request["ID"] = ID; - request["Status"] = status; - this.familyFileProvider.deactivateFamily(request).then((value) => { - GifLoaderDialogUtils.hideDialog(context), - refreshFamily(context) - }); - } - acceptRemoveRequest(ID, status, context) { - GifLoaderDialogUtils.showMyDialog(context); - Map request = {}; - request["ID"] = ID; - request["Status"] = status; - this.familyFileProvider.acceptRejectFamily(request).then((value) => { - GifLoaderDialogUtils.hideDialog(context), - refreshFamily(context) - }); - } - checkUserData() async{ - if (await this.sharedPref.getObject(USER_PROFILE) != null) { - var data = AuthenticatedUser.fromJson( - await this.sharedPref.getObject(USER_PROFILE)); - - var data2 = AuthenticatedUser.fromJson( - await this.sharedPref.getObject(MAIN_USER)); - print(data2); - setState(() { - this.user = data; - }); - } - } + deleteRequest(result, context) {} + acceptRequest(result, context) {} } diff --git a/lib/pages/ErService/AmbulanceReq.dart b/lib/pages/ErService/AmbulanceReq.dart index 1690254a..413d80e6 100644 --- a/lib/pages/ErService/AmbulanceReq.dart +++ b/lib/pages/ErService/AmbulanceReq.dart @@ -1,4 +1,3 @@ -import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart'; import 'package:diplomaticquarterapp/core/viewModels/er/am_request_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/prescriptions_view_model.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; @@ -25,7 +24,6 @@ class AmbulanceReq extends StatefulWidget { class _AmbulanceReqState extends State with SingleTickerProviderStateMixin { TabController _tabController; - List imagesInfo = List(); @override void initState() { @@ -41,19 +39,11 @@ class _AmbulanceReqState extends State @override Widget build(BuildContext context) { - imagesInfo.add(ImagesInfo( - imageEn: - 'https://hmgwebservices.com/Images/MobileApp/Ambulance/en/0.png', - imageAr: - 'https://hmgwebservices.com/Images/MobileApp/Ambulance/ar/0.png')); - return BaseView( onModelReady: (model) => model.getAmRequestOrders(), builder: (_, model, widget) => AppScaffold( isShowAppBar: true, - appBarTitle: TranslationBase.of(context).transportationService, - description: TranslationBase.of(context).infoAmbulance, - imagesInfo: imagesInfo, + appBarTitle: "Ambulance Request", baseViewModel: model, body: Scaffold( extendBodyBehindAppBar: true, @@ -102,7 +92,8 @@ class _AmbulanceReqState extends State Container( width: MediaQuery.of(context).size.width * 0.40, child: Center( - child: Texts(TranslationBase.of(context).transportationService), + child: Texts( + "Ambulance Request"), //TranslationBase.of(context).prescriptions ), ), Container( @@ -127,8 +118,8 @@ class _AmbulanceReqState extends State controller: _tabController, children: [ AmbulanceRequestIndexPage( - amRequestViewModel: model, - ), + amRequestViewModel: model, + ), OrderLogPage( amRequestViewModel: model, ) diff --git a/lib/pages/ErService/AmbulanceRequestIndexPages/BillAmount.dart b/lib/pages/ErService/AmbulanceRequestIndexPages/BillAmount.dart index 16945a1e..cc6af0f2 100644 --- a/lib/pages/ErService/AmbulanceRequestIndexPages/BillAmount.dart +++ b/lib/pages/ErService/AmbulanceRequestIndexPages/BillAmount.dart @@ -2,7 +2,6 @@ import 'package:diplomaticquarterapp/core/enum/Ambulate.dart'; import 'package:diplomaticquarterapp/core/model/er/PatientER.dart'; import 'package:diplomaticquarterapp/core/viewModels/er/am_request_view_model.dart'; import 'package:diplomaticquarterapp/pages/Blood/new_text_Field.dart'; -import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:flutter/cupertino.dart'; @@ -52,7 +51,7 @@ class _BillAmountState extends State { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Texts(TranslationBase.of(context).billAmount), + Texts('Bill Amount '), SizedBox( height: 10, ), @@ -74,7 +73,7 @@ class _BillAmountState extends State { child: Padding( padding: const EdgeInsets.all(8.0), child: Texts( - TranslationBase.of(context).patientShareB, + 'Amount before tax: ', textAlign: TextAlign.start, color: Colors.black, fontSize: 15, @@ -92,7 +91,7 @@ class _BillAmountState extends State { child: Padding( padding: const EdgeInsets.all(8.0), child: Texts( - TranslationBase.of(context).sar+' ${widget.patientER.patientERTransportationMethod.price}', + 'SR ${widget.patientER.patientERTransportationMethod.price}', color: Colors.black, textAlign: TextAlign.start, fontSize: 15, @@ -109,7 +108,7 @@ class _BillAmountState extends State { child: Padding( padding: const EdgeInsets.all(8.0), child: Texts( - TranslationBase.of(context).patientShareTax, + 'Tax amount :', color: Colors.black, fontSize: 15, textAlign: TextAlign.start, @@ -122,7 +121,7 @@ class _BillAmountState extends State { child: Padding( padding: const EdgeInsets.all(8.0), child: Texts( - TranslationBase.of(context).sar+' ${widget.patientER.patientERTransportationMethod.vAT}', + 'SR ${widget.patientER.patientERTransportationMethod.vAT}', color: Colors.black, fontSize: 15, textAlign: TextAlign.start, @@ -144,7 +143,7 @@ class _BillAmountState extends State { child: Padding( padding: const EdgeInsets.all(8.0), child: Texts( - TranslationBase.of(context).patientShareTotal, + 'Total amount payable', color: Colors.black, fontSize: 15, textAlign: TextAlign.start, @@ -163,7 +162,7 @@ class _BillAmountState extends State { child: Padding( padding: const EdgeInsets.all(8.0), child: Texts( - TranslationBase.of(context).sar+' ${widget.patientER.patientERTransportationMethod.totalPrice}', + 'SR ${widget.patientER.patientERTransportationMethod.totalPrice}', color: Colors.black, fontSize: 15, textAlign: TextAlign.start, @@ -177,7 +176,7 @@ class _BillAmountState extends State { SizedBox( height: 10, ), - Texts(TranslationBase.of(context).selectAmbulate,bold: true,), + Texts('Select Ambulate',bold: true,), SizedBox(height: 5,), Row( children: [ @@ -197,11 +196,11 @@ class _BillAmountState extends State { color: Colors.white, ), child: ListTile( - title: Text(TranslationBase.of(context).wheelchair), + title: Text('Wheelchair'), leading: Radio( value: Ambulate.Wheelchair, groupValue: _ambulate, - activeColor: Theme.of(context).primaryColor, + activeColor: Colors.red[800], onChanged: (value) { setState(() { _ambulate = value; @@ -228,11 +227,11 @@ class _BillAmountState extends State { color: Colors.white, ), child: ListTile( - title: Text(TranslationBase.of(context).walker), + title: Text('Walker'), leading: Radio( value: Ambulate.Walker, groupValue: _ambulate, - activeColor: Theme.of(context).primaryColor, + activeColor: Colors.red[800], onChanged: (value) { setState(() { _ambulate = value; @@ -264,11 +263,11 @@ class _BillAmountState extends State { color: Colors.white, ), child: ListTile( - title: Text(TranslationBase.of(context).stretcher), + title: Text('Stretcher'), leading: Radio( value: Ambulate.Stretcher, groupValue: _ambulate, - activeColor: Theme.of(context).primaryColor, + activeColor: Colors.red[800], onChanged: (value) { setState(() { _ambulate = value; @@ -295,11 +294,11 @@ class _BillAmountState extends State { color: Colors.white, ), child: ListTile( - title: Text(TranslationBase.of(context).none), + title: Text('None'), leading: Radio( value: Ambulate.None, groupValue: _ambulate, - activeColor: Theme.of(context).primaryColor, + activeColor: Colors.red[800], onChanged: (value) { setState(() { _ambulate = value; @@ -314,7 +313,7 @@ class _BillAmountState extends State { ), SizedBox(height: 12,), NewTextFields( - hintText: TranslationBase.of(context).notes, + hintText: 'Note', initialValue: note, onChanged: (value){ setState(() { @@ -341,7 +340,7 @@ class _BillAmountState extends State { widget.changeCurrentTab(3); }); }, - label: TranslationBase.of(context).next, + label: 'Next', ), ) ], diff --git a/lib/pages/ErService/AmbulanceRequestIndexPages/PickupLocation.dart b/lib/pages/ErService/AmbulanceRequestIndexPages/PickupLocation.dart index 78574e06..b99596c8 100644 --- a/lib/pages/ErService/AmbulanceRequestIndexPages/PickupLocation.dart +++ b/lib/pages/ErService/AmbulanceRequestIndexPages/PickupLocation.dart @@ -9,7 +9,6 @@ import 'package:diplomaticquarterapp/pages/landing/home_page.dart'; import 'package:diplomaticquarterapp/uitl/ProgressDialog.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; -import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/pickupLocation/PickupLocationFromMap.dart'; @@ -79,7 +78,7 @@ class _PickupLocationState extends State { Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Texts(TranslationBase.of(context).pickupLocation), + Texts('Pickup Location'), SizedBox( height: 15, ), @@ -111,7 +110,7 @@ class _PickupLocationState extends State { child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Texts(getSelectFromMapName(context)), + Texts(getSelectFromMapName()), Icon( FontAwesomeIcons.mapMarkerAlt, size: 24, @@ -124,7 +123,7 @@ class _PickupLocationState extends State { SizedBox( height: 12, ), - Texts(TranslationBase.of(context).pickupSpot), + Texts('Pickup Spot'), SizedBox( height: 5, ), @@ -142,7 +141,7 @@ class _PickupLocationState extends State { color: Colors.white, ), child: ListTile( - title: Texts(TranslationBase.of(context).insideHome), + title: Texts('Inside Home'), leading: Checkbox( activeColor: Colors.red[800], value: _isInsideHome, @@ -158,7 +157,7 @@ class _PickupLocationState extends State { SizedBox( height: 12, ), - Texts(TranslationBase.of(context).haveAppo), + Texts('Do you have an appointment ?'), SizedBox( height: 5, ), @@ -183,7 +182,7 @@ class _PickupLocationState extends State { color: Colors.white, ), child: ListTile( - title: Text(TranslationBase.of(context).yes), + title: Text('Yes'), leading: Radio( value: HaveAppointment.YES, groupValue: _haveAppointment, @@ -218,7 +217,7 @@ class _PickupLocationState extends State { color: Colors.white, ), child: ListTile( - title: Text(TranslationBase.of(context).no), + title: Text('No'), leading: Radio( value: HaveAppointment.NO, groupValue: _haveAppointment, @@ -251,7 +250,7 @@ class _PickupLocationState extends State { SizedBox( height: 12, ), - Texts(TranslationBase.of(context).dropoffLocation), + Texts('Drop off Location'), SizedBox( height: 8, ), @@ -271,7 +270,7 @@ class _PickupLocationState extends State { child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Texts(getHospitalName(TranslationBase.of(context).pickupLocation)), + Texts(getHospitalName('Pickup Location')), Icon( Icons.arrow_drop_down, size: 24, @@ -307,7 +306,7 @@ class _PickupLocationState extends State { child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Texts(getHospitalName(TranslationBase.of(context).pickupLocation)), + Texts(getHospitalName('Pickup Location')), Icon( Icons.arrow_drop_down, size: 24, @@ -320,7 +319,7 @@ class _PickupLocationState extends State { SizedBox( height: 12, ), - Texts(TranslationBase.of(context).dropoffLocation), + Texts('Drop off Location'), SizedBox( height: 8, ), @@ -352,7 +351,7 @@ class _PickupLocationState extends State { child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Texts(getSelectFromMapName(context)), + Texts(getSelectFromMapName()), Icon( FontAwesomeIcons.mapMarkerAlt, size: 24, @@ -378,7 +377,7 @@ class _PickupLocationState extends State { onTap: () { if (_result == null || _selectedHospital == null) AppToast.showErrorToast( - message: TranslationBase.of(context).selectAll); + message: 'please select all fields'); else setState(() { widget.patientER.pickupSpot = _isInsideHome ? 1 : 0; @@ -428,7 +427,7 @@ class _PickupLocationState extends State { widget.changeCurrentTab(2); }); }, - label: TranslationBase.of(context).next, + label: 'Next', ), ) ], @@ -456,8 +455,8 @@ class _PickupLocationState extends State { return _selectedHospital == null ? title : _selectedHospital.name; } - String getSelectFromMapName(BuildContext context) { - return _result != null ? _result.formattedAddress : TranslationBase.of(context).selectMap; + String getSelectFromMapName() { + return _result != null ? _result.formattedAddress : 'Select From Map'; } getAppointment() { @@ -495,7 +494,7 @@ class _PickupLocationState extends State { setState(() { _haveAppointment = HaveAppointment.NO; }); - AppToast.showErrorToast(message: TranslationBase.of(context).noAppointment); + AppToast.showErrorToast(message: 'You don\'t have any appointment'); } }).catchError((e) { ProgressDialogUtil.hideProgressDialog(context); diff --git a/lib/pages/ErService/AmbulanceRequestIndexPages/SelectTransportationMethod.dart b/lib/pages/ErService/AmbulanceRequestIndexPages/SelectTransportationMethod.dart index 952716c8..01683b55 100644 --- a/lib/pages/ErService/AmbulanceRequestIndexPages/SelectTransportationMethod.dart +++ b/lib/pages/ErService/AmbulanceRequestIndexPages/SelectTransportationMethod.dart @@ -5,7 +5,6 @@ import 'package:diplomaticquarterapp/core/enum/OrderService.dart'; import 'package:diplomaticquarterapp/core/model/er/PatientER.dart'; import 'package:diplomaticquarterapp/core/model/er/get_all_transportation_method_list_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/er/am_request_view_model.dart'; -import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:flutter/cupertino.dart'; @@ -68,7 +67,7 @@ class _SelectTransportationMethodState SizedBox( height: 12, ), - Texts(TranslationBase.of(context).transportHeading), + Texts('Select Transportation Method'), ...List.generate( widget.amRequestViewModel.amRequestModeList.length, (index) => InkWell( @@ -97,7 +96,7 @@ class _SelectTransportationMethodState value: widget .amRequestViewModel.amRequestModeList[index], groupValue: _erTransportationMethod, - activeColor: Theme.of(context).primaryColor, + activeColor: Colors.red[800], onChanged: (value) { setState(() { _erTransportationMethod = value; @@ -109,7 +108,7 @@ class _SelectTransportationMethodState Expanded( flex: 1, child: Texts( - TranslationBase.of(context).sar+' ${widget.amRequestViewModel.amRequestModeList[index].price}'), + 'SR ${widget.amRequestViewModel.amRequestModeList[index].price}'), ) ], ), @@ -119,7 +118,7 @@ class _SelectTransportationMethodState SizedBox( height: 12, ), - Texts(TranslationBase.of(context).directionHeading), + Texts('Select Direction'), SizedBox( height: 5, ), @@ -145,11 +144,11 @@ class _SelectTransportationMethodState color: Colors.white, ), child: ListTile( - title: Text(TranslationBase.of(context).toHospital), + title: Text('To Hospital'), leading: Radio( value: Direction.ToHospital, groupValue: _direction, - activeColor: Theme.of(context).primaryColor, + activeColor: Colors.red[800], onChanged: (value) { setState(() { _direction = value; @@ -176,11 +175,11 @@ class _SelectTransportationMethodState color: Colors.white, ), child: ListTile( - title: Text(TranslationBase.of(context).fromHospital), + title: Text('Form Hospital'), leading: Radio( value: Direction.FromHospital, groupValue: _direction, - activeColor: Theme.of(context).primaryColor, + activeColor: Colors.red[800], onChanged: (value) { setState(() { _direction = value; @@ -201,7 +200,7 @@ class _SelectTransportationMethodState SizedBox( height: 8, ), - Texts(TranslationBase.of(context).directionHeading), + Texts('Select Direction'), SizedBox( height: 5, ), @@ -223,11 +222,11 @@ class _SelectTransportationMethodState color: Colors.white, ), child: ListTile( - title: Text(TranslationBase.of(context).oneDirec), + title: Text('One Way'), leading: Radio( value: Way.OneWay, groupValue: _way, - activeColor:Theme.of(context).primaryColor, + activeColor: Colors.red[800], onChanged: (value) { setState(() { _way = value; @@ -254,11 +253,11 @@ class _SelectTransportationMethodState color: Colors.white, ), child: ListTile( - title: Text(TranslationBase.of(context).twoDirec), + title: Text('Two Ways'), leading: Radio( value: Way.TwoWays, groupValue: _way, - activeColor: Theme.of(context).primaryColor, + activeColor: Colors.red[800], onChanged: (value) { setState(() { _way = value; @@ -299,7 +298,7 @@ class _SelectTransportationMethodState widget.changeCurrentTab(1); }); }, - label: TranslationBase.of(context).next, + label: 'Next', ), ) ], diff --git a/lib/pages/ErService/AmbulanceRequestIndexPages/Summary.dart b/lib/pages/ErService/AmbulanceRequestIndexPages/Summary.dart index 66da39df..7696dd09 100644 --- a/lib/pages/ErService/AmbulanceRequestIndexPages/Summary.dart +++ b/lib/pages/ErService/AmbulanceRequestIndexPages/Summary.dart @@ -1,6 +1,5 @@ import 'package:diplomaticquarterapp/core/model/er/PatientER.dart'; import 'package:diplomaticquarterapp/core/viewModels/er/am_request_view_model.dart'; -import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:flutter/cupertino.dart'; @@ -18,7 +17,7 @@ class Summary extends StatefulWidget { _SummaryState createState() => _SummaryState(); } -//TODO it should be dynamic fix it +//TODO it should be dynamic class _SummaryState extends State { @override Widget build(BuildContext context) { @@ -28,7 +27,7 @@ class _SummaryState extends State { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Texts(TranslationBase.of(context).RRTSummary), + Texts('Summary'), SizedBox(height: 5,), Container( width: double.infinity, @@ -40,11 +39,11 @@ class _SummaryState extends State { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Texts(TranslationBase.of(context).transportMethod,color: Colors.grey,), + Texts('Transportation Method',color: Colors.grey,), Texts('${widget.patientER.patientERTransportationMethod.title}',bold: true,), SizedBox(height: 8,), - Texts(TranslationBase.of(context).directions,color: Colors.grey,), + Texts('Direction',color: Colors.grey,), Texts('From Hospital',bold: true,), SizedBox(height: 8,), @@ -67,7 +66,7 @@ class _SummaryState extends State { ), ), SizedBox(height: 20,), - Texts(TranslationBase.of(context).RRTSummary,textAlign: TextAlign.start,), + Texts('Bill Amount',textAlign: TextAlign.start,), SizedBox(height: 5,), Container( height: 55, @@ -93,7 +92,7 @@ class _SummaryState extends State { child:SecondaryButton( color: Colors.grey[800], textColor: Colors.white, - label: TranslationBase.of(context).send, + label: 'Send', onTap: () async { await widget.amRequestViewModel.insertERPressOrder(patientER: widget.patientER); diff --git a/lib/pages/ErService/ErOptions.dart b/lib/pages/ErService/ErOptions.dart index e3438af5..886d47d2 100644 --- a/lib/pages/ErService/ErOptions.dart +++ b/lib/pages/ErService/ErOptions.dart @@ -31,13 +31,13 @@ class _ErOptionsState extends State { Widget build(BuildContext context) { return AppScaffold( isShowAppBar: widget.isAppbar, - isShowDecPage: false, appBarTitle: TranslationBase.of(context).bookAppo, body: Container( margin: EdgeInsets.fromLTRB(10.0, 20.0, 10.0, 10.0), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ + Container( margin: EdgeInsets.fromLTRB(0.0, 10.0, 0.0, 10.0), child: Row( diff --git a/lib/pages/ErService/NearestEr.dart b/lib/pages/ErService/NearestEr.dart index 1c786954..227cfb3b 100644 --- a/lib/pages/ErService/NearestEr.dart +++ b/lib/pages/ErService/NearestEr.dart @@ -27,15 +27,14 @@ class NearestEr extends StatelessWidget { : (model) => model.getProjectAvgERWaitingTimeOrders(), builder: (_, mode, widget) => AppScaffold( isShowAppBar: true, - appBarTitle: TranslationBase.of(context).er, - description: TranslationBase.of(context).erContant, + appBarTitle: 'Nearest ER', baseViewModel: mode, body: mode.ProjectAvgERWaitingTimeModeList.length > 0 ? Container( child: ListView( children: [ Text( - TranslationBase.of(context).erContant, + "\nThis service Displays nearest branch\n among all the branches of All Habib \n medical Group based on your current Location", textAlign: TextAlign.center, style: TextStyle( fontSize: 18.0, diff --git a/lib/pages/ErService/widgets/StepsWidget.dart b/lib/pages/ErService/widgets/StepsWidget.dart index 40af61d0..c5864710 100644 --- a/lib/pages/ErService/widgets/StepsWidget.dart +++ b/lib/pages/ErService/widgets/StepsWidget.dart @@ -13,7 +13,7 @@ class StepsWidget extends StatelessWidget { @override Widget build(BuildContext context) { ProjectViewModel projectViewModel = Provider.of(context); - return !projectViewModel.isArabic? Stack( + return projectViewModel.isArabic? Stack( children: [ Container( height: 50, diff --git a/lib/pages/ErService/widgets/card_common.dart b/lib/pages/ErService/widgets/card_common.dart index 0796a5bc..35ece966 100644 --- a/lib/pages/ErService/widgets/card_common.dart +++ b/lib/pages/ErService/widgets/card_common.dart @@ -11,7 +11,6 @@ class CardCommonEr extends StatelessWidget { final text; final subText; final type; - const CardCommonEr( {@required this.image, @required this.text, @@ -23,6 +22,7 @@ class CardCommonEr extends StatelessWidget { return GestureDetector( onTap: () { navigateToSearch(context, this.type); + }, child: Container( margin: EdgeInsets.fromLTRB(9.0, 9.0, 9.0, 9.0), @@ -60,10 +60,24 @@ class CardCommonEr extends StatelessWidget { } Future navigateToSearch(context, type) async { - if (type == 0) { - Navigator.push(context, FadePage(page: AmbulanceReq())); - } else { - Navigator.push(context, FadePage(page: NearestEr())); +//===Switch case=== + if(type==0) + { + + Navigator.push( + context, + FadePage( + page: AmbulanceReq())); + } + else{ + + Navigator.push( + context, + FadePage( + page: NearestEr())); + } + + } } diff --git a/lib/pages/MyAppointments/AppointmentDetails.dart b/lib/pages/MyAppointments/AppointmentDetails.dart index 109af9d1..db2b0643 100644 --- a/lib/pages/MyAppointments/AppointmentDetails.dart +++ b/lib/pages/MyAppointments/AppointmentDetails.dart @@ -203,7 +203,6 @@ class _AppointmentDetailsState extends State MaterialPageRoute( builder: (context) => BookConfirm( doctor: getDoctorObject(), - isLiveCareAppointment: widget.appo.isLiveCareAppointment, selectedDate: DocAvailableAppointments.selectedDate, selectedTime: DocAvailableAppointments.selectedTime))); } diff --git a/lib/pages/MyAppointments/MyAppointments.dart b/lib/pages/MyAppointments/MyAppointments.dart index aa3b72ae..95485da5 100644 --- a/lib/pages/MyAppointments/MyAppointments.dart +++ b/lib/pages/MyAppointments/MyAppointments.dart @@ -1,5 +1,4 @@ import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; -import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart'; import 'package:diplomaticquarterapp/core/service/AuthenticatedUserObject.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/locator.dart'; @@ -41,25 +40,12 @@ class _MyAppointmentsState extends State AuthenticatedUserObject authenticatedUserObject = locator(); - List imagesInfo = List(); - @override void initState() { _tabController = new TabController(length: 3, vsync: this); WidgetsBinding.instance.addPostFrameCallback((_) { - if (Provider.of(context, listen: false).isLogin) - getPatientAppointmentHistory(); + if (Provider.of(context, listen: false).isLogin) getPatientAppointmentHistory(); }); - imagesInfo.add(ImagesInfo( - imageEn: - 'https://hmgwebservices.com/Images/MobileApp/imges-info/my-appointment/en/0.png', - imageAr: - 'https://hmgwebservices.com/Images/MobileApp/imges-info/my-appointment/ar/0.png')); - imagesInfo.add(ImagesInfo( - imageEn: - 'https://hmgwebservices.com/Images/MobileApp/imges-info/my-appointment/en/1.png', - imageAr: - 'https://hmgwebservices.com/Images/MobileApp/imges-info/my-appointment/ar/1.png')); super.initState(); } @@ -68,8 +54,6 @@ class _MyAppointmentsState extends State return AppScaffold( appBarTitle: TranslationBase.of(context).myAppointments, isShowAppBar: true, - imagesInfo: imagesInfo, - description: TranslationBase.of(context).infoMyAppointments, body: Container( child: Column(children: [ TabBar( @@ -117,14 +101,14 @@ class _MyAppointmentsState extends State if (res['MessageStatus'] == 1) { GifLoaderDialogUtils.hideDialog(context); setState(() { - isDataLoaded = true; if (res['AppoimentAllHistoryResultList'].length != 0) { - isDataLoaded = true; res['AppoimentAllHistoryResultList'].forEach((v) { widget.appoList .add(new AppoitmentAllHistoryResultList.fromJson(v)); }); sortAppointmentList(); + openAppointmentsTab(); + isDataLoaded = true; } else {} }); } else { @@ -233,7 +217,6 @@ class _MyAppointmentsState extends State filterName: element.clinicName, patientDoctorAppointment: element)); } - openAppointmentsTab(); }); } @@ -300,7 +283,7 @@ class _MyAppointmentsState extends State "assets/images/new-design/noAppointmentIcon.png"), Container( margin: EdgeInsets.only(top: 10.0), - child: Text(TranslationBase.of(context).noBookedAppo, + child: Text("No Booked Appointments", style: TextStyle( fontSize: 16.0, )), @@ -355,7 +338,8 @@ class _MyAppointmentsState extends State Image.asset("assets/images/new-design/noAppointmentIcon.png"), Container( margin: EdgeInsets.only(top: 10.0), - child: Text(TranslationBase.of(context).noConfirmedAppo, + child: Text( + TranslationBase.of(context).noConfirmedAppointments, style: TextStyle( fontSize: 16.0, )), @@ -409,10 +393,11 @@ class _MyAppointmentsState extends State Image.asset("assets/images/new-design/noAppointmentIcon.png"), Container( margin: EdgeInsets.only(top: 10.0), - child: Text(TranslationBase.of(context).noArrivedAppo, - style: TextStyle( - fontSize: 16.0, - )), + child: + Text(TranslationBase.of(context).noArrivedAppointments, + style: TextStyle( + fontSize: 16.0, + )), ), ], ), diff --git a/lib/pages/MyAppointments/VisitTicket.dart b/lib/pages/MyAppointments/VisitTicket.dart index 6f1dbdf8..54dcf13f 100644 --- a/lib/pages/MyAppointments/VisitTicket.dart +++ b/lib/pages/MyAppointments/VisitTicket.dart @@ -2,11 +2,11 @@ import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart import 'package:diplomaticquarterapp/pages/BookAppointment/widgets/DoctorView.dart'; import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; -import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/progress_indicator/app_circular_progress_Indeicator.dart'; import 'package:flutter/material.dart'; +import 'package:smart_progress_bar/smart_progress_bar.dart'; class VisitTicket extends StatefulWidget { List appoList = []; @@ -48,10 +48,9 @@ class _VisitTicketState extends State { } getPatientAppointmentCurfewHistory(BuildContext context) { + loading(true); DoctorsListService service = new DoctorsListService(); - GifLoaderDialogUtils.showMyDialog(context); service.getPatientAppointmentHistory(true, context).then((res) { - GifLoaderDialogUtils.hideDialog(context); print(res['AppoimentAllHistoryResultList']); if (res['MessageStatus'] == 1) { setState(() { @@ -62,13 +61,20 @@ class _VisitTicketState extends State { }); } else {} }); + loading(false); } else { AppToast.showErrorToast(message: res['ErrorEndUserMessage']); + loading(false); } }).catchError((err) { - GifLoaderDialogUtils.hideDialog(context); - AppToast.showErrorToast(message: err); print(err); + loading(false); + }).showProgressBar(text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); + } + + loading(bool flag) { + setState(() { + isLoading = flag; }); } } diff --git a/lib/pages/MyAppointments/models/ArrivedButtons.dart b/lib/pages/MyAppointments/models/ArrivedButtons.dart index a30349ba..a89253c6 100644 --- a/lib/pages/MyAppointments/models/ArrivedButtons.dart +++ b/lib/pages/MyAppointments/models/ArrivedButtons.dart @@ -4,32 +4,32 @@ import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; class ArrivedButtons { static var buttons = [ { - "title": TranslationBase.of(AppGlobal.context).arrived, - "subtitle": TranslationBase.of(AppGlobal.context).status, + "title": "Arrived", + "subtitle": "Status", "icon": "assets/images/new-design/waiting-room.png", "caller": "openReschedule" }, { - "title": TranslationBase.of(AppGlobal.context).medicines, - "subtitle": TranslationBase.of(AppGlobal.context).medicinesSubtitle, + "title": "Medicines", + "subtitle": "Prescriptions", "icon": "assets/images/new-design/medicine_prescriptions_icon.png", "caller": "prescriptions" }, { - "title": TranslationBase.of(AppGlobal.context).radiology, - "subtitle": TranslationBase.of(AppGlobal.context).radiologySubtitle, + "title": "Radiology", + "subtitle": "Services", "icon": "assets/images/new-design/radiology_service_icon.png", "caller": "radiology" }, { - "title": TranslationBase.of(AppGlobal.context).lab, - "subtitle": TranslationBase.of(AppGlobal.context).labSubtitle, + "title": "Lab", + "subtitle": "Result", "icon": "assets/images/new-design/lab_result_icon.png", "caller": "labResult" }, { - "title": TranslationBase.of(AppGlobal.context).vitalSigns, - "subtitle": TranslationBase.of(AppGlobal.context).vitalSignsSubtitle, + "title": "Vital Signs", + "subtitle": "Values", "icon": "assets/images/new-design/vital_signs.png", "caller": "VitalSigns" }, @@ -40,20 +40,20 @@ class ArrivedButtons { "caller": "insertComplaint" }, { - "title": TranslationBase.of(AppGlobal.context).insurance, - "subtitle": TranslationBase.of(AppGlobal.context).insuranceSubtitle, + "title": "Insurance", + "subtitle": "Approvals", "icon": "assets/images/new-design/insurance_approvals_icon.png", "caller": "Insurance" }, { - "title": TranslationBase.of(AppGlobal.context).askYour, - "subtitle": TranslationBase.of(AppGlobal.context).askYourSubtitle, + "title": "Ask Your", + "subtitle": "Doctor", "icon": "assets/images/new-design/ask_doctor_icon.png", "caller": "askDoc" }, { - "title": TranslationBase.of(AppGlobal.context).appoSurvey, - "subtitle": TranslationBase.of(AppGlobal.context).service, + "title": "Survey", + "subtitle": "Service", "icon": "assets/images/new-design/survey.png", "caller": "Survey" } diff --git a/lib/pages/MyAppointments/widgets/AppointmentActions.dart b/lib/pages/MyAppointments/widgets/AppointmentActions.dart index c0399b8a..7bb45bad 100644 --- a/lib/pages/MyAppointments/widgets/AppointmentActions.dart +++ b/lib/pages/MyAppointments/widgets/AppointmentActions.dart @@ -1,9 +1,7 @@ import 'package:diplomaticquarterapp/core/model/prescriptions/prescription_report_enh.dart'; import 'package:diplomaticquarterapp/core/model/radiology/final_radiology.dart'; -import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart'; import 'package:diplomaticquarterapp/models/Appointments/appoDetailsButtons.dart'; -import 'package:diplomaticquarterapp/models/Appointments/toDoCountProviderModel.dart'; import 'package:diplomaticquarterapp/pages/MyAppointments/models/AppointmentType.dart'; import 'package:diplomaticquarterapp/pages/MyAppointments/models/ArrivedButtons.dart'; import 'package:diplomaticquarterapp/pages/MyAppointments/models/AskDocRequestTypeModel.dart'; @@ -19,7 +17,6 @@ import 'package:diplomaticquarterapp/pages/insurance/insurance_approval_screen.d import 'package:diplomaticquarterapp/pages/medical/radiology/radiology_details_page.dart'; import 'package:diplomaticquarterapp/pages/medical/vital_sign/vital_sign_details_screen.dart'; import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart'; -import 'package:diplomaticquarterapp/services/clinic_services/get_clinic_service.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; @@ -27,7 +24,6 @@ import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart'; import 'package:diplomaticquarterapp/widgets/in_app_browser/InAppBrowser.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/material.dart'; -import 'package:provider/provider.dart'; import 'package:url_launcher/url_launcher.dart'; class AppointmentActions extends StatefulWidget { @@ -48,8 +44,6 @@ class AppointmentActions extends StatefulWidget { class _AppointmentActionsState extends State { List appoButtonsList = []; - ToDoCountProviderModel toDoProvider; - @override void initState() { _getAppointmentActionButtons(); @@ -58,12 +52,8 @@ class _AppointmentActionsState extends State { @override Widget build(BuildContext context) { - ProjectViewModel projectViewModel = Provider.of(context); - toDoProvider = Provider.of(context); var size = MediaQuery.of(context).size; - final double itemHeight = projectViewModel.isArabic - ? ((size.height - kToolbarHeight - 24) * 0.47) / 2 - : ((size.height - kToolbarHeight - 24) * 0.4) / 2; + final double itemHeight = ((size.height - kToolbarHeight - 24) * 0.42) / 2; final double itemWidth = size.width / 2; return Container( @@ -82,62 +72,51 @@ class _AppointmentActionsState extends State { onTap: () { _handleButtonClicks(e); }, - child: Column( - mainAxisSize: MainAxisSize.min, - children: [ - Container( - // height: 100.0, - margin: EdgeInsets.all(7.0), - padding: EdgeInsets.only(bottom: 15.0), - decoration: BoxDecoration( - boxShadow: [ - BoxShadow( - color: Colors.grey[400], - blurRadius: 2.0, - spreadRadius: 0.0) - ], - borderRadius: BorderRadius.circular(10), - color: Colors.white), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisSize: MainAxisSize.min, - children: [ - Container( - margin: - EdgeInsets.fromLTRB(5.0, 5.0, 5.0, 0.0), - child: Text(e.title, - overflow: TextOverflow.clip, - style: TextStyle( - color: new Color(0xFF40ACC9), - letterSpacing: 1.0, - fontSize: 18.0)), - ), - Container( - margin: - EdgeInsets.fromLTRB(5.0, 0.0, 5.0, 0.0), - child: Text(e.subtitle, - overflow: TextOverflow.clip, - style: TextStyle( - color: Colors.black, - letterSpacing: 1.0, - fontSize: 15.0)), - ), - Container( - alignment: projectViewModel.isArabic - ? Alignment.bottomLeft - : Alignment.bottomRight, - margin: projectViewModel.isArabic - ? EdgeInsets.fromLTRB( - 10.0, 7.0, 0.0, 8.0) - : EdgeInsets.fromLTRB( - 0.0, 7.0, 10.0, 8.0), - child: Image.asset(e.icon, - width: 45.0, height: 45.0), - ), - ], + child: Container( + height: 100.0, + margin: EdgeInsets.all(9.0), + decoration: BoxDecoration( + boxShadow: [ + BoxShadow( + color: Colors.grey[400], + blurRadius: 2.0, + spreadRadius: 0.0) + ], + borderRadius: BorderRadius.circular(10), + color: Colors.white), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.min, + children: [ + Container( + margin: + EdgeInsets.fromLTRB(10.0, 10.0, 10.0, 0.0), + child: Text(e.title, + overflow: TextOverflow.clip, + style: TextStyle( + color: new Color(0xFF40ACC9), + letterSpacing: 1.0, + fontSize: 20.0)), + ), + Container( + margin: + EdgeInsets.fromLTRB(10.0, 0.0, 10.0, 0.0), + child: Text(e.subtitle, + overflow: TextOverflow.clip, + style: TextStyle( + color: Colors.black, + letterSpacing: 1.0, + fontSize: 15.0)), + ), + Container( + alignment: Alignment.bottomRight, + margin: + EdgeInsets.fromLTRB(0.0, 10.0, 10.0, 7.0), + child: Image.asset(e.icon, + width: 45.0, height: 45.0), ), - ), - ], + ], + ), ), )) .toList(), @@ -378,7 +357,6 @@ class _AppointmentActionsState extends State { GifLoaderDialogUtils.hideDialog(context); print(res); if (res['MessageStatus'] == 1) { - getToDoCount(); AppToast.showSuccessToast(message: res['ErrorEndUserMessage']); Navigator.of(context).pop(); } else { @@ -390,19 +368,6 @@ class _AppointmentActionsState extends State { }); } - getToDoCount() { - toDoProvider.setState(0); - ClinicListService service = new ClinicListService(); - service.getActiveAppointmentNo(context).then((res) { - print(res['AppointmentActiveNumber']); - if (res['MessageStatus'] == 1) { - toDoProvider.setState(res['AppointmentActiveNumber']); - } else {} - }).catchError((err) { - print(err); - }); - } - openAppointmentRadiology() { GifLoaderDialogUtils.showMyDialog(context); DoctorsListService service = new DoctorsListService(); diff --git a/lib/pages/MyAppointments/widgets/AppointmentCardView.dart b/lib/pages/MyAppointments/widgets/AppointmentCardView.dart index 1bbe471a..71bde484 100644 --- a/lib/pages/MyAppointments/widgets/AppointmentCardView.dart +++ b/lib/pages/MyAppointments/widgets/AppointmentCardView.dart @@ -1,10 +1,6 @@ import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart'; -import 'package:diplomaticquarterapp/pages/MyAppointments/models/AppointmentType.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; -import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:flutter/material.dart'; -import 'package:flutter_countdown_timer/current_remaining_time.dart'; -import 'package:flutter_countdown_timer/flutter_countdown_timer.dart'; import 'package:rating_bar/rating_bar.dart'; import '../AppointmentDetails.dart'; @@ -108,23 +104,6 @@ class _ApointmentCardState extends State { ), ], ), - widget.appo.patientStatusType == AppointmentType.BOOKED ? - Container( - child: CountdownTimer( - endTime: DateTime.now().millisecondsSinceEpoch + - (widget.appo.remaniningHoursTocanPay * 1000) * - 60, - widgetBuilder: (_, CurrentRemainingTime time) { - return Text( - '${time.days}:${time.hours}:${time.min}:${time.sec} ' + - TranslationBase.of(context) - .upcomingTimeLeft, - style: TextStyle( - fontSize: 12.0, - color: Color(0xff40ACC9))); - }, - ), - ) : Container(), ], ), ), diff --git a/lib/pages/MyAppointments/widgets/PrescriptionReport.dart b/lib/pages/MyAppointments/widgets/PrescriptionReport.dart index 213e28e1..932211ba 100644 --- a/lib/pages/MyAppointments/widgets/PrescriptionReport.dart +++ b/lib/pages/MyAppointments/widgets/PrescriptionReport.dart @@ -4,7 +4,7 @@ import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResu import 'package:diplomaticquarterapp/pages/medical/prescriptions/prescription_details_page.dart'; import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; -import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; +import 'package:smart_progress_bar/smart_progress_bar.dart'; import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; @@ -16,10 +16,7 @@ class PrescriptionReportPage extends StatefulWidget { dynamic listPres; AppoitmentAllHistoryResultList appo; - PrescriptionReportPage( - {@required this.prescriptionReportEnhList, - @required this.listPres, - @required this.appo}); + PrescriptionReportPage({@required this.prescriptionReportEnhList, @required this.listPres, @required this.appo}); @override _PrescriptionReportState createState() => _PrescriptionReportState(); @@ -116,18 +113,12 @@ class _PrescriptionReportState extends State { sendPrescriptionReportEmail() { DoctorsListService service = new DoctorsListService(); - GifLoaderDialogUtils.showMyDialog(context); - service - .sendPrescriptionEmail(widget.appo.appointmentDate, widget.appo.setupID, - widget.listPres, context) - .then((res) { - GifLoaderDialogUtils.hideDialog(context); + service.sendPrescriptionEmail(widget.appo.appointmentDate, widget.appo.setupID, widget.listPres, context).then((res) { AppToast.showSuccessToast(message: 'A copy has been sent to the e-mail'); }).catchError((err) { - GifLoaderDialogUtils.hideDialog(context); print(err); AppToast.showErrorToast(message: err); - }); + }).showProgressBar(text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); } navigateToPrescriptionDetails(PrescriptionReportEnh prescriptionReportEnh) { diff --git a/lib/pages/ToDoList/ToDo.dart b/lib/pages/ToDoList/ToDo.dart index fb8990b2..b0315d28 100644 --- a/lib/pages/ToDoList/ToDo.dart +++ b/lib/pages/ToDoList/ToDo.dart @@ -1,5 +1,4 @@ import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; -import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart'; import 'package:diplomaticquarterapp/core/service/AuthenticatedUserObject.dart'; import 'package:diplomaticquarterapp/locator.dart'; import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart'; @@ -19,8 +18,6 @@ import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:diplomaticquarterapp/widgets/in_app_browser/InAppBrowser.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/material.dart'; -import 'package:flutter_countdown_timer/current_remaining_time.dart'; -import 'package:flutter_countdown_timer/flutter_countdown_timer.dart'; import 'package:flutter_svg/flutter_svg.dart'; import 'package:rating_bar/rating_bar.dart'; @@ -41,29 +38,19 @@ class _ToDoState extends State { AuthenticatedUserObject authenticatedUserObject = locator(); - List imagesInfo = List(); - @override void initState() { widget.patientShareResponse = new PatientShareResponse(); WidgetsBinding.instance.addPostFrameCallback((_) { - if (authenticatedUserObject.isLogin) getPatientData(); + if (authenticatedUserObject.isLogin) getPatientAppointmentHistory(); }); super.initState(); - imagesInfo.add(ImagesInfo( - imageEn: - 'https://hmgwebservices.com/Images/MobileApp/images-info-home/todo/en/0.png', - imageAr: - 'https://hmgwebservices.com/Images/MobileApp/images-info-home/todo/ar/0.png')); } @override Widget build(BuildContext context) { return AppScaffold( appBarTitle: TranslationBase.of(context).todoList, - imagesInfo: imagesInfo, - isShowAppBar: true, - description: TranslationBase.of(context).infoTodo, body: SingleChildScrollView( child: Column( children: [ @@ -210,22 +197,6 @@ class _ToDoState extends State { ), ], ), - Container( - child: CountdownTimer( - endTime: DateTime.now().millisecondsSinceEpoch + - (widget.appoList[index] - .remaniningHoursTocanPay * - 1000) * - 60, - widgetBuilder: (_, CurrentRemainingTime time) { - return Text( - '${time.days}:${time.hours}:${time.min}:${time.sec} ' + TranslationBase.of(context).upcomingTimeLeft, - style: TextStyle( - fontSize: 12.0, - color: Color(0xff40ACC9))); - }, - ), - ), ], ), ), @@ -455,8 +426,7 @@ class _ToDoState extends State { } getLanguageID() async { - var languageID = - await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); setState(() { widget.languageID = languageID; }); @@ -521,7 +491,6 @@ class _ToDoState extends State { widget.appoList.forEach((element) { print(element.isLiveCareAppointment); print(element.nextAction); - print(element.remaniningHoursTocanPay); }); } else { AppToast.showErrorToast(message: res['ErrorEndUserMessage']); @@ -637,9 +606,6 @@ class _ToDoState extends State { appo.projectID.toString(), authenticatedUser.emailAddress, paymentMethod, - authenticatedUser.patientType, - authenticatedUser.firstName, - authenticatedUser.patientID, authenticatedUser, widget.browser); } @@ -697,8 +663,8 @@ class _ToDoState extends State { DoctorsListService service = new DoctorsListService(); String paymentReference = res['Fort_id'].toString(); service - .createAdvancePayment(appo, appo.projectID.toString(), res['Amount'], - res['Fort_id'], res['PaymentMethod'], context) + .createAdvancePayment( + appo, appo.projectID.toString(), res['Amount'], res['Fort_id'], res['PaymentMethod'], context) .then((res) { GifLoaderDialogUtils.hideDialog(context); print(res['OnlineCheckInAppointments'][0]['AdvanceNumber']); @@ -730,19 +696,6 @@ class _ToDoState extends State { }); } - getPatientData() async { - AppSharedPreferences sharedPref = AppSharedPreferences(); - if (await sharedPref.getObject(USER_PROFILE) != null) { - var data = - AuthenticatedUser.fromJson(await sharedPref.getObject(USER_PROFILE)); - setState(() { - print(data); - authUser = data; - }); - getPatientAppointmentHistory(); - } - } - Future navigateToPaymentMethod( context, PatientShareResponse patientShareResponse, diff --git a/lib/pages/ToDoList/payment_method_select.dart b/lib/pages/ToDoList/payment_method_select.dart index fe2a217b..a189128a 100644 --- a/lib/pages/ToDoList/payment_method_select.dart +++ b/lib/pages/ToDoList/payment_method_select.dart @@ -163,45 +163,45 @@ class _PaymentMethodState extends State { ], ), ), - // Container( - // margin: EdgeInsets.only(top: 25.0), - // child: Flex( - // direction: Axis.horizontal, - // children: [ - // Expanded( - // child: Container( - // child: InkWell( - // onTap: () { - // updateSelectedPaymentMethod("ApplePay"); - // }, - // child: Card( - // elevation: 3.0, - // margin: EdgeInsets.fromLTRB(8.0, 16.0, 8.0, 8.0), - // color: Colors.white, - // shape: RoundedRectangleBorder( - // borderRadius: BorderRadius.circular(10), - // side: selectedPaymentMethod == "ApplePay" - // ? BorderSide( - // color: Colors.green, width: 5.0) - // : BorderSide( - // color: Colors.transparent, width: 0.0), - // ), - // child: Container( - // height: 120.0, - // padding: EdgeInsets.all(20.0), - // child: SvgPicture.asset( - // "assets/images/new-design/applepay.svg"), - // ), - // ), - // ), - // ), - // ), - // Expanded( - // child: Container(), - // ), - // ], - // ), - // ), + Container( + margin: EdgeInsets.only(top: 25.0), + child: Flex( + direction: Axis.horizontal, + children: [ + Expanded( + child: Container( + child: InkWell( + onTap: () { + updateSelectedPaymentMethod("ApplePay"); + }, + child: Card( + elevation: 3.0, + margin: EdgeInsets.fromLTRB(8.0, 16.0, 8.0, 8.0), + color: Colors.white, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(10), + side: selectedPaymentMethod == "ApplePay" + ? BorderSide( + color: Colors.green, width: 5.0) + : BorderSide( + color: Colors.transparent, width: 0.0), + ), + child: Container( + height: 120.0, + padding: EdgeInsets.all(20.0), + child: SvgPicture.asset( + "assets/images/new-design/applepay.svg"), + ), + ), + ), + ), + ), + Expanded( + child: Container(), + ), + ], + ), + ), SizedBox( height: 150.0, ), diff --git a/lib/pages/appUpdatePage/app_update_page.dart b/lib/pages/appUpdatePage/app_update_page.dart deleted file mode 100644 index 7bcf2388..00000000 --- a/lib/pages/appUpdatePage/app_update_page.dart +++ /dev/null @@ -1,109 +0,0 @@ -import 'dart:io'; - -import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; -import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter_svg/flutter_svg.dart'; -import 'package:url_launcher/url_launcher.dart'; - -class AppUpdatePage extends StatefulWidget { - String appUpdateText; - - AppUpdatePage({@required this.appUpdateText}); - - @override - _AppUpdatePageState createState() => _AppUpdatePageState(); -} - -class _AppUpdatePageState extends State { - @override - Widget build(BuildContext context) { - return AppScaffold( - appBarTitle: "App Update", - backgroundColor: Colors.white, - isShowAppBar: false, - isShowDecPage: false, - body: SingleChildScrollView( - child: Container( - child: Column( - children: [ - Stack( - children: [ - Column( - crossAxisAlignment: CrossAxisAlignment.stretch, - children: [ - SvgPicture.asset( - "assets/images/new-design/update_rocket_image.svg", - fit: BoxFit.fill), - ]), - Container( - margin: EdgeInsets.only(top: 40.0), - width: MediaQuery.of(context).size.width, - child: Text(TranslationBase.of(context).appUpdate, - textAlign: TextAlign.center, - style: TextStyle( - color: Color(0xff2d6c90).withOpacity(1.0), - fontSize: 22.0, - fontWeight: FontWeight.bold))), - ], - ), - Container( - margin: EdgeInsets.only(top: 5.0, bottom: 5.0), - child: SvgPicture.asset("assets/images/new-design/HMG_logo.svg", - fit: BoxFit.fill), - ), - Container( - margin: EdgeInsets.only(top: 10.0, left: 10.0, right: 10.0), - width: MediaQuery.of(context).size.width, - child: Text(widget.appUpdateText, - textAlign: TextAlign.center, - style: TextStyle( - color: Colors.grey[600], - fontSize: 16.0, - height: 1.5, - fontWeight: FontWeight.bold))), - Container( - margin: EdgeInsets.only(left: 20.0, right: 20.0, top: 20.0), - child: ButtonTheme( - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(10.0), - ), - minWidth: MediaQuery.of(context).size.width, - height: 45.0, - child: RaisedButton( - color: Colors.red[800], - textColor: Colors.white, - disabledTextColor: Colors.white, - disabledColor: new Color(0xFFbcc2c4), - onPressed: () { - openAppUpdateLink(); - }, - child: Text(TranslationBase.of(context).appUpdate, - style: TextStyle(fontSize: 18.0)), - ), - ), - ), - ], - ), - ), - ), - ); - } - - openAppUpdateLink() { - if (Platform.isAndroid) { - _launchURL("https://play.google.com/store/apps/details?id=com.ejada.hmg"); - } - if (Platform.isIOS) { - _launchURL("https://itunes.apple.com/app/id733503978"); - } - } - - _launchURL(String url) async { - if (await canLaunch(url)) { - await launch(url); - } else { - throw 'Could not launch $url'; - } - } -} diff --git a/lib/pages/base/base_view.dart b/lib/pages/base/base_view.dart index 38b70e23..5977e97e 100644 --- a/lib/pages/base/base_view.dart +++ b/lib/pages/base/base_view.dart @@ -63,4 +63,4 @@ class _BaseViewState extends State> { super.dispose(); } -} \ No newline at end of file +} diff --git a/lib/pages/feedback/feedback_home_page.dart b/lib/pages/feedback/feedback_home_page.dart index 3d761bd3..309b5713 100644 --- a/lib/pages/feedback/feedback_home_page.dart +++ b/lib/pages/feedback/feedback_home_page.dart @@ -74,7 +74,7 @@ class _FeedbackHomePageState extends State controller: _tabController, indicatorWeight: 5.0, indicatorSize: TabBarIndicatorSize.label, - indicatorColor: Theme.of(context).primaryColor, + indicatorColor: Colors.red[800], labelColor: Theme.of(context).primaryColor, labelPadding: EdgeInsets.only(top: 4.0, left: 18.0, right: 18.0), diff --git a/lib/pages/feedback/send_feedback_page.dart b/lib/pages/feedback/send_feedback_page.dart index 14463825..27d2f353 100644 --- a/lib/pages/feedback/send_feedback_page.dart +++ b/lib/pages/feedback/send_feedback_page.dart @@ -514,7 +514,7 @@ class FeedbackTypeDialogState extends State { leading: Radio( value: MessageType.ComplaintOnAnAppointment, groupValue: model.messageTypeDialog, - activeColor: Theme.of(context).primaryColor, + activeColor: Colors.red[800], onChanged: (MessageType value) => model.setMessageDialogType(value), ), @@ -538,7 +538,7 @@ class FeedbackTypeDialogState extends State { leading: Radio( value: MessageType.ComplaintWithoutAppointment, groupValue: model.messageTypeDialog, - activeColor: Theme.of(context).primaryColor, + activeColor: Colors.red[800], onChanged: (MessageType value) => model.setMessageDialogType(value), ), @@ -562,7 +562,7 @@ class FeedbackTypeDialogState extends State { leading: Radio( value: MessageType.Question, groupValue: model.messageTypeDialog, - activeColor: Theme.of(context).primaryColor, + activeColor: Colors.red[800], onChanged: (MessageType value) => model.setMessageDialogType(value), ), @@ -586,7 +586,7 @@ class FeedbackTypeDialogState extends State { leading: Radio( value: MessageType.Compliment, groupValue: model.messageTypeDialog, - activeColor: Theme.of(context).primaryColor, + activeColor: Colors.red[800], onChanged: (MessageType value) => model.setMessageDialogType(value), ), @@ -610,7 +610,7 @@ class FeedbackTypeDialogState extends State { leading: Radio( value: MessageType.Suggestion, groupValue: model.messageTypeDialog, - activeColor: Theme.of(context).primaryColor, + activeColor: Colors.red[800], onChanged: (MessageType value) => model.setMessageDialogType(value), ), @@ -644,7 +644,7 @@ class FeedbackTypeDialogState extends State { child: Center( child: Texts( TranslationBase.of(context).cancel, - color: Theme.of(context).primaryColor, + color: Colors.red, ), ), ), diff --git a/lib/pages/insurance/insurance_approval_screen.dart b/lib/pages/insurance/insurance_approval_screen.dart index d21e06a5..3b19e670 100644 --- a/lib/pages/insurance/insurance_approval_screen.dart +++ b/lib/pages/insurance/insurance_approval_screen.dart @@ -1,8 +1,6 @@ import 'package:diplomaticquarterapp/config/size_config.dart'; -import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart'; import 'package:diplomaticquarterapp/core/viewModels/insurance_card_View_model.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; -import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/rounded_container.dart'; import 'package:flutter/cupertino.dart'; @@ -20,20 +18,8 @@ class InsuranceApproval extends StatefulWidget { } class _InsuranceApprovalState extends State { - List imagesInfo = List(); - @override Widget build(BuildContext context) { - imagesInfo.add(ImagesInfo( - imageEn: - 'https://hmgwebservices.com/Images/MobileApp/imges-info/apporvals/en/0.png', - imageAr: - 'https://hmgwebservices.com/Images/MobileApp/imges-info/apporvals/ar/0.png')); - imagesInfo.add(ImagesInfo( - imageEn: - 'https://hmgwebservices.com/Images/MobileApp/imges-info/apporvals/en/1.png', - imageAr: - 'https://hmgwebservices.com/Images/MobileApp/imges-info/apporvals/ar/1.png')); return BaseView( onModelReady: widget.appointmentNo != null ? (model) => @@ -46,7 +32,6 @@ class _InsuranceApprovalState extends State { appBarTitle: TranslationBase.of(context).approvals, description: TranslationBase.of(context).infoApprovals, infoList: TranslationBase.of(context).infoApprovalPoints, - imagesInfo: imagesInfo, body: SingleChildScrollView( child: Container( margin: EdgeInsets.only( @@ -73,10 +58,10 @@ class _InsuranceApprovalState extends State { ), if (model.insuranceApproval.length > 0) Container( - width: 60, - height: 35, + width: SizeConfig.widthMultiplier * 18.0, + height: SizeConfig.heightMultiplier * 2.8, decoration: BoxDecoration( - color: Theme.of(context).primaryColor, + color: Color(0xffC5272D), borderRadius: BorderRadius.circular(19.0)), child: Center( child: Text( @@ -102,21 +87,29 @@ class _InsuranceApprovalState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ - model.insuranceApproval[index].patientDescription == "In Patient" + model.insuranceApproval[index] + .patientDescription == + "In Patient" ? Container( decoration: BoxDecoration( - color: Theme.of(context).primaryColor, + color: Color(0xffB8372C), borderRadius: BorderRadius.circular( 16.0)), - width: 115.0, + width: 95.0, padding: EdgeInsets.only(left: 11.5), - child: Center( - child: Texts( - TranslationBase.of(context).inPatient, - color: Colors.white, - ), + child: Text( + model.insuranceApproval[index] + .patientDescription == + null + ? '' + : model + .insuranceApproval[ + index] + .patientDescription, + style: TextStyle( + color: Colors.white), ), ) : Container( @@ -125,14 +118,20 @@ class _InsuranceApprovalState extends State { borderRadius: BorderRadius.circular( 16.0)), - width: 115.0, + width: 95.0, padding: EdgeInsets.only(left: 11.5), - child: Center( - child: Texts( - TranslationBase.of(context).outpatient, - color: Colors.white, - ), + child: Text( + model.insuranceApproval[index] + .patientDescription == + null + ? '' + : model + .insuranceApproval[ + index] + .patientDescription, + style: TextStyle( + color: Colors.white), ), ), Padding( diff --git a/lib/pages/insurance/insurance_card_screen.dart b/lib/pages/insurance/insurance_card_screen.dart index 5f8c6777..d5fac63f 100644 --- a/lib/pages/insurance/insurance_card_screen.dart +++ b/lib/pages/insurance/insurance_card_screen.dart @@ -1,5 +1,4 @@ import 'package:diplomaticquarterapp/config/size_config.dart'; -import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart'; import 'package:diplomaticquarterapp/core/service/insurance_service.dart'; import 'package:diplomaticquarterapp/core/viewModels/insurance_card_View_model.dart'; import 'package:diplomaticquarterapp/locator.dart'; @@ -20,19 +19,16 @@ import '../base/base_view.dart'; class InsuranceCard extends StatefulWidget { int appointmentNo; - InsuranceCard({this.appointmentNo}); @override _InsuranceCardState createState() => _InsuranceCardState(); } +//TODO fix it class _InsuranceCardState extends State { InsuranceCardService _insuranceCardService = locator(); - List imagesInfo = List(); @override Widget build(BuildContext context) { - imagesInfo.add(ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/insurance-card/en/0.png',imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/insurance-card/ar/0.png')); - return BaseView( onModelReady: (model) => model.getInsurance(), builder: (BuildContext context, InsuranceViewModel model, Widget child) => @@ -43,7 +39,6 @@ class _InsuranceCardState extends State { appBarTitle: TranslationBase.of(context).insuranceCards, description: TranslationBase.of(context).infoInsuranceCards, infoList: TranslationBase.of(context).infoInsuranceCardsPoints, - imagesInfo: imagesInfo, body: Container( margin: EdgeInsets.only( left: SizeConfig.screenWidth * 0.004, diff --git a/lib/pages/landing/home_page.dart b/lib/pages/landing/home_page.dart index 5e857011..b5a5c5d9 100644 --- a/lib/pages/landing/home_page.dart +++ b/lib/pages/landing/home_page.dart @@ -1,8 +1,12 @@ import 'package:diplomaticquarterapp/config/size_config.dart'; +import 'package:diplomaticquarterapp/core/model/geofencing/requests/GeoZonesRequestModel.dart'; +import 'package:diplomaticquarterapp/core/model/geofencing/requests/LogGeoZoneRequestModel.dart'; +import 'package:diplomaticquarterapp/core/service/geofencing/GeofencingServices.dart'; import 'package:diplomaticquarterapp/core/viewModels/dashboard_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; -import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_page.dart'; -import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/HomeHealthCare/home_health_care_page.dart'; +import 'package:diplomaticquarterapp/locator.dart'; +import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_index_page.dart'; +import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/HomeHealthCare/home_health_care_index_page.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/all_habib_medical_service_page.dart'; import 'package:diplomaticquarterapp/pages/ContactUs/contact_us_page.dart'; import 'package:diplomaticquarterapp/pages/Covid-DriveThru/covid-drivethru-location.dart'; @@ -11,9 +15,12 @@ import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/livecare/livecare_home.dart'; import 'package:diplomaticquarterapp/pages/paymentService/payment_service.dart'; import 'package:diplomaticquarterapp/pages/pharmacies/screens/pharmacy_module_page.dart'; +import 'package:diplomaticquarterapp/uitl/HMG_Geofence.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/offers_packages/offers_packages.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/cupertino.dart'; @@ -35,6 +42,7 @@ class _HomePageState extends State { @override Widget build(BuildContext context) { ProjectViewModel projectViewModel = Provider.of(context); + return BaseView( onModelReady: (model) => model.getPatientRadOrders(), builder: (_, model, wi) => AppScaffold( @@ -53,10 +61,7 @@ class _HomePageState extends State { width: double.infinity, height: 210, decoration: BoxDecoration( - image: DecorationImage( - image: ExactAssetImage( - 'assets/images/dashboard_top_bg.png'), - fit: BoxFit.cover), + image: DecorationImage(image: ExactAssetImage('assets/images/dashboard_top_bg.png'), fit: BoxFit.cover), ), child: Stack( children: [ @@ -65,8 +70,7 @@ class _HomePageState extends State { left: 5, right: 5, child: Container( - width: - MediaQuery.of(context).size.width * 0.8, + width: MediaQuery.of(context).size.width * 0.8, child: Row( children: [ Expanded( @@ -76,81 +80,42 @@ class _HomePageState extends State { margin: EdgeInsets.all(5), decoration: BoxDecoration( image: DecorationImage( - image: AssetImage( - "assets/images/new-design/covid_bg_transparent.png"), + image: AssetImage("assets/images/new-design/covid_bg_transparent.png"), fit: BoxFit.fill, ), - color: - Colors.white.withOpacity(0.3), - borderRadius: BorderRadius.all( - Radius.circular(5))), + color: Colors.white.withOpacity(0.3), + borderRadius: BorderRadius.all(Radius.circular(5))), child: Container( margin: EdgeInsets.only(top: 10.0), child: Column( children: [ - Text("COVID-19 TEST", - style: TextStyle( - color: Colors.white, - fontWeight: - FontWeight.bold, - fontSize: 18.0)), + Text("COVID-19 TEST", style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold, fontSize: 18.0)), Row( children: [ Container( - margin: EdgeInsets.only( - top: 15.0, left: 3.5, right: 3.5), - child: SvgPicture.asset( - 'assets/images/new-design/covid-19-car.svg', - width: 45.0, - height: 45.0), + margin: EdgeInsets.only(top: 15.0, left: 3.5, right: 3.5), + child: SvgPicture.asset('assets/images/new-design/covid-19-car.svg', width: 45.0, height: 45.0), ), Container( - margin: EdgeInsets.only( - left: 10.0, - top: 10.0), + margin: EdgeInsets.only(left: 10.0, top: 10.0), child: Column( children: [ - Text("Drive-Thru", - style: TextStyle( - color: Colors - .white, - fontWeight: - FontWeight - .bold, - fontSize: - 16.0)), + Text("Drive-Thru", style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold, fontSize: 16.0)), ButtonTheme( - shape: - RoundedRectangleBorder( - borderRadius: - BorderRadius - .circular( - 5.0), + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(5.0), ), - minWidth: MediaQuery.of( - context) - .size - .width * - 0.15, + minWidth: MediaQuery.of(context).size.width * 0.15, height: 25.0, child: RaisedButton( - color: Colors - .red[800], - textColor: - Colors.white, - disabledTextColor: - Colors.white, - disabledColor: - new Color( - 0xFFbcc2c4), + color: Colors.red[800], + textColor: Colors.white, + disabledTextColor: Colors.white, + disabledColor: new Color(0xFFbcc2c4), onPressed: () { navigateToCovidDriveThru(); }, - child: Text( - "BOOK NOW", - style: TextStyle( - fontSize: - 12.0)), + child: Text("BOOK NOW", style: TextStyle(fontSize: 12.0)), ), ), ], @@ -165,21 +130,14 @@ class _HomePageState extends State { ), Expanded( child: InkWell( - onTap: () => Navigator.push(context, - FadePage(page: LiveCareHome())), + onTap: () => Navigator.push(context, FadePage(page: LiveCareHome())), child: Container( height: 120, padding: EdgeInsets.all(15), margin: EdgeInsets.all(5), - decoration: BoxDecoration( - color: Colors.white - .withOpacity(0.3), - borderRadius: BorderRadius.all( - Radius.circular(5))), + decoration: BoxDecoration(color: Colors.white.withOpacity(0.3), borderRadius: BorderRadius.all(Radius.circular(5))), child: SvgPicture.asset( - projectViewModel.isArabic - ? 'assets/images/new-design/livecare_arabic_logo.svg' - : 'assets/images/new-design/liveCare_white_logo.svg', + projectViewModel.isArabic ? 'assets/images/new-design/livecare_arabic_logo.svg' : 'assets/images/new-design/liveCare_white_logo.svg', ), ), ), @@ -196,258 +154,227 @@ class _HomePageState extends State { ), Positioned( top: 155, - left: MediaQuery.of(context).size.width * - (MediaQuery.of(context).orientation == - Orientation.landscape - ? 0.02 - : 0.03), - right: MediaQuery.of(context).size.width * - (MediaQuery.of(context).orientation == - Orientation.landscape - ? 0.02 - : 0.03), + left: MediaQuery.of(context).size.width * (MediaQuery.of(context).orientation == Orientation.landscape ? 0.02 : 0.03), + right: MediaQuery.of(context).size.width * (MediaQuery.of(context).orientation == Orientation.landscape ? 0.02 : 0.03), child: (!model.isLogin && projectViewModel.user == null) ? Container( - width: double.infinity, - height: 125, - decoration: BoxDecoration( - color: HexColor('#A59E9E'), - shape: BoxShape.rectangle, - border: Border.all( - color: Colors.transparent, width: 0.5), - borderRadius: - BorderRadius.all(Radius.circular(9)), - image: DecorationImage( - image: ExactAssetImage( - 'assets/images/bg_graphic.png'), - fit: BoxFit.cover)), - child: Container( - margin: EdgeInsets.all(5), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - SizedBox( - height: 8, - ), - Texts( - TranslationBase.of(context).myMedicalFile, - color: Colors.black87, - bold: true, - fontSize: 23, - ), - SizedBox( - height: 5, - ), - Texts( - TranslationBase.of(context) - .myMedicalFileSubTitle, - color: Colors.black, - fontSize: 16, - ), - Align( - alignment: projectViewModel.isArabic - ? Alignment.bottomRight - : Alignment.bottomLeft, - child: InkWell( - onTap: () { - widget.goToMyProfile(); - }, - child: Container( - margin: EdgeInsets.all(2), - width: 90, - height: 30, - decoration: BoxDecoration( - color: HexColor('#D81A2E'), - shape: BoxShape.rectangle, - border: Border.all( - color: Colors.transparent, - width: 0.5), - borderRadius: BorderRadius.all( - Radius.circular(9)), + width: double.infinity, + height: 125, + decoration: BoxDecoration( + color: HexColor('#A59E9E'), + shape: BoxShape.rectangle, + border: Border.all(color: Colors.transparent, width: 0.5), + borderRadius: BorderRadius.all(Radius.circular(9)), + image: DecorationImage(image: ExactAssetImage('assets/images/bg_graphic.png'), fit: BoxFit.cover)), + child: Container( + margin: EdgeInsets.all(5), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 8, ), - child: Center( - child: Texts( - TranslationBase.of(context) - .viewMore, - color: Colors.white, - fontSize: 12, - ), + Texts( + TranslationBase.of(context).myMedicalFile, + color: Colors.black87, + bold: true, + fontSize: 23, ), - ), - ), - ) - ], - ), - ), - ) - : Container( - width: double.infinity, - height: 130, - decoration: BoxDecoration( - color: HexColor('#A59E9E'), - shape: BoxShape.rectangle, - border: Border.all( - color: Colors.transparent, width: 0.5), - borderRadius: - BorderRadius.all(Radius.circular(9)), - image: DecorationImage( - image: ExactAssetImage( - 'assets/images/bg_graphic.png'), - fit: BoxFit.cover), - ), - child: Container( - margin: EdgeInsets.all(5), - child: Column( - children: [ - Row( - children: [ - if (model.user != null) - Expanded( - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - SizedBox( - height: 8, - ), - Texts( - model.user.firstName + - " " + - model.user.lastName, - color: Colors.grey[100], - bold: true, - fontSize: 15, - ), - Texts( - '${model.user.patientID}', - color: Colors.white, - fontSize: 14, - ), - SizedBox( - height: 5, + SizedBox( + height: 5, + ), + Texts( + TranslationBase.of(context).myMedicalFileSubTitle, + color: Colors.black, + fontSize: 16, + ), + Align( + alignment: projectViewModel.isArabic ? Alignment.bottomRight : Alignment.bottomLeft, + child: InkWell( + onTap: () { + widget.goToMyProfile(); + }, + child: Container( + margin: EdgeInsets.all(2), + width: 90, + height: 30, + decoration: BoxDecoration( + color: HexColor('#D81A2E'), + shape: BoxShape.rectangle, + border: Border.all(color: Colors.transparent, width: 0.5), + borderRadius: BorderRadius.all(Radius.circular(9)), ), - Texts( - '${DateUtil.getMonthDayYearDateFormatted(model.user.dateofBirthDataTime)} ,${model.user.genderDescription} ${model.user.ageDesc}', - color: Colors.grey[100], - fontWeight: FontWeight.normal, - fontSize: 14, + child: Center( + child: Texts( + TranslationBase.of(context).viewMore, + color: Colors.white, + fontSize: 12, + ), ), - ], - ), - ), - InkWell( - onTap: () { - widget.goToMyProfile(); - }, - child: Container( - margin: EdgeInsets.all(2), - width: 90, - height: 30, - decoration: BoxDecoration( - color: HexColor('#D81A2E'), - shape: BoxShape.rectangle, - border: Border.all( - color: Colors.transparent, - width: 0.5), - borderRadius: BorderRadius.all( - Radius.circular(5), ), ), - child: Center( - child: Texts( - TranslationBase.of(context) - .viewMore, - color: Colors.white, - fontSize: 12, - ), - ), - ), - ) - ], + ) + ], + ), ), - Row( - //crossAxisAlignment: CrossAxisAlignment.center, - //mainAxisAlignment: MainAxisAlignment.spaceAround, - children: [ - Expanded( - child: Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, + ) + : Container( + width: double.infinity, + height: 130, + decoration: BoxDecoration( + color: HexColor('#A59E9E'), + shape: BoxShape.rectangle, + border: Border.all(color: Colors.transparent, width: 0.5), + borderRadius: BorderRadius.all(Radius.circular(9)), + image: DecorationImage(image: ExactAssetImage('assets/images/bg_graphic.png'), fit: BoxFit.cover), + ), + child: Container( + margin: EdgeInsets.all(5), + child: Column( + children: [ + Row( children: [ - Image.asset( - 'assets/images/height_icon.png', - width: 35, - height: 40, - ), - Texts( - "${model.heightCm}", - color: Colors.white, + if (model.user != null) + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 8, + ), + Texts( + model.user.firstName + " " + model.user.lastName, + color: Colors.grey[100], + bold: true, + fontSize: 15, + ), + Texts( + '${model.user.patientID}', + color: Colors.white, + fontSize: 14, + ), + SizedBox( + height: 5, + ), + Texts( + '${DateUtil.getMonthDayYearDateFormatted(model.user.dateofBirthDataTime)} ,${model.user.genderDescription} ${model.user.ageDesc}', + color: Colors.grey[100], + fontWeight: FontWeight.normal, + fontSize: 14, + ), + ], + ), + ), + InkWell( + onTap: () { + widget.goToMyProfile(); + }, + child: Container( + margin: EdgeInsets.all(2), + width: 90, + height: 30, + decoration: BoxDecoration( + color: HexColor('#D81A2E'), + shape: BoxShape.rectangle, + border: Border.all(color: Colors.transparent, width: 0.5), + borderRadius: BorderRadius.all( + Radius.circular(5), + ), + ), + child: Center( + child: Texts( + TranslationBase.of(context).viewMore, + color: Colors.white, + fontSize: 12, + ), + ), + ), ) ], ), - ), - SizedBox( - width: 3, - ), - Expanded( - child: Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, + Row( + //crossAxisAlignment: CrossAxisAlignment.center, + //mainAxisAlignment: MainAxisAlignment.spaceAround, children: [ - Image.asset( - 'assets/images/weight_icon.png', - width: 25, - height: 40, + Expanded( + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Image.asset( + 'assets/images/height_icon.png', + width: 35, + height: 40, + ), + Texts( + "${model.heightCm}", + color: Colors.white, + ) + ], + ), ), - Texts( - '${model.weightKg}', - color: Colors.white, - ) - ], - ), - ), - SizedBox( - width: 3, - ), - Expanded( - child: Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - children: [ - Image.asset( - 'assets/images/blood_icon.png', - width: 35, - height: 40, + SizedBox( + width: 3, + ), + Expanded( + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Image.asset( + 'assets/images/weight_icon.png', + width: 25, + height: 40, + ), + Texts( + '${model.weightKg}', + color: Colors.white, + ) + ], + ), + ), + SizedBox( + width: 3, + ), + Expanded( + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Image.asset( + 'assets/images/blood_icon.png', + width: 35, + height: 40, + ), + Texts( + '${model.bloadType}', + color: Colors.white, + ) + ], + ), ), - Texts( - '${model.bloadType}', - color: Colors.white, - ) ], - ), - ), - ], - ) - ], - ), - ), - ), + ) + ], + ), + ), + ), ), ], ), - if(projectViewModel.havePrivilege(64)||projectViewModel.havePrivilege(65)||projectViewModel.havePrivilege(67)) + + /* Zohiab Kambrani | Commented below because its in progress + OffersAndPackagesWidget(OfferPackagesItemModel.dummy()), + */ + Container( margin: EdgeInsets.only(left: 15, right: 15), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - if(projectViewModel.havePrivilege(64)) DashboardItem( onTap: () { Navigator.push( context, FadePage( - page: HomeHealthCarePage(), + page: HomeHealthCareIndexPage(), ), ); }, @@ -465,8 +392,7 @@ class _HomePageState extends State { height: 3, ), Texts( - TranslationBase.of(context) - .homeHealthCareService, + TranslationBase.of(context).homeHealthCareService, textAlign: TextAlign.center, color: Colors.white, bold: true, @@ -480,10 +406,8 @@ class _HomePageState extends State { imageName: 'home_healthcare_service_bg.png', opacity: 0.5, ), - if(projectViewModel.havePrivilege(65)) DashboardItem( - //onTap: () => Navigator.push(context, FadePage(page: PharmacyPage())), - + onTap: () => Navigator.push(context, FadePage(page: PharmacyPage())), child: Center( child: Padding( padding: const EdgeInsets.all(15.0), @@ -511,13 +435,12 @@ class _HomePageState extends State { height: MediaQuery.of(context).size.width * 0.4, imageName: 'al-habib_onlne_pharmacy_bg.png', ), - if(projectViewModel.havePrivilege(67)) DashboardItem( - onTap: (){ + onTap: () { Navigator.push( context, FadePage( - page: CMCPage(), + page: CMCIndexPage(), ), ); }, @@ -556,8 +479,7 @@ class _HomePageState extends State { height: 8, ), InkWell( - onTap: () => - Navigator.push(context, FadePage(page: PaymentService())), + onTap: () => Navigator.push(context, FadePage(page: PaymentService())), child: Container( margin: EdgeInsets.only(left: 15, right: 15), child: Row( @@ -578,8 +500,7 @@ class _HomePageState extends State { height: 5, ), Texts( - TranslationBase.of(context) - .onlinePaymentService, + TranslationBase.of(context).onlinePaymentService, textAlign: TextAlign.center, color: Colors.black87, bold: false, @@ -610,8 +531,7 @@ class _HomePageState extends State { height: 10, ), Texts( - TranslationBase.of(context) - .offersAndPackages, + TranslationBase.of(context).offersAndPackages, textAlign: TextAlign.center, color: Colors.black87, bold: false, @@ -627,7 +547,6 @@ class _HomePageState extends State { borderRadius: BorderRadius.circular(6.0), color: Colors.white, )), - if(projectViewModel.havePrivilege(60)) Container( width: MediaQuery.of(context).size.width * 0.29, child: InkWell( @@ -635,8 +554,8 @@ class _HomePageState extends State { context, FadePage( page: ErOptions( - isAppbar: true, - ))), + isAppbar: true, + ))), child: Center( child: Padding( padding: const EdgeInsets.all(15.0), @@ -651,8 +570,7 @@ class _HomePageState extends State { height: 10, ), Texts( - TranslationBase.of(context) - .emergencyServices, + TranslationBase.of(context).emergencyServices, textAlign: TextAlign.center, color: Colors.black87, bold: false, @@ -694,8 +612,7 @@ class _HomePageState extends State { fontWeight: FontWeight.normal, ), Texts( - TranslationBase.of(context) - .viewAllHabibMedicalService, + TranslationBase.of(context).viewAllHabibMedicalService, color: Colors.white, fontWeight: FontWeight.normal, fontSize: 10, @@ -716,15 +633,13 @@ class _HomePageState extends State { opacity: 0.5, color: Colors.grey[700], width: MediaQuery.of(context).size.width * 0.45, - onTap: () => Navigator.push( - context, FadePage(page: AllHabibMedicalService())), + onTap: () => Navigator.push(context, FadePage(page: AllHabibMedicalService())), ), DashboardItem( onTap: () { // Navigator.push( // context, FadePage(page: FeedbackHomePage())); - Navigator.push( - context, FadePage(page: ContactUsPage())); + Navigator.push(context, FadePage(page: ContactUsPage())); }, child: Container( width: double.infinity, @@ -754,7 +669,7 @@ class _HomePageState extends State { ], ), ), - height: 106, + height: 100, imageName: 'contact_us_bg.png', opacity: 0.5, color: Colors.grey[700], @@ -775,23 +690,12 @@ class _HomePageState extends State { } navigateToCovidDriveThru() { - Navigator.push(context, - MaterialPageRoute(builder: (context) => CovidDrivethruLocation())); + Navigator.push(context, MaterialPageRoute(builder: (context) => CovidDrivethruLocation())); } } class DashboardItem extends StatelessWidget { - const DashboardItem( - {this.hasBorder = false, - this.imageName, - @required this.child, - this.onTap, - Key key, - this.width, - this.height, - this.color, - this.opacity = 0.4, - this.hasColorFilter = true}) + const DashboardItem({this.hasBorder = false, this.imageName, @required this.child, this.onTap, Key key, this.width, this.height, this.color, this.opacity = 0.4, this.hasColorFilter = true}) : super(key: key); final bool hasBorder; final String imageName; @@ -812,25 +716,22 @@ class DashboardItem extends StatelessWidget { height: height != null ? height : MediaQuery.of(context).orientation == Orientation.portrait - ? MediaQuery.of(context).size.height * 0.19 - : MediaQuery.of(context).size.height * 0.35, + ? MediaQuery.of(context).size.height * 0.19 + : MediaQuery.of(context).size.height * 0.35, decoration: BoxDecoration( color: !hasBorder ? color != null - ? color - : HexColor('#050705').withOpacity(opacity) + ? color + : HexColor('#050705').withOpacity(opacity) : Colors.white, borderRadius: BorderRadius.circular(6.0), - border: hasBorder - ? Border.all(width: 1.0, color: const Color(0xffcccccc)) - : Border.all(width: 0.0, color: Colors.transparent), + border: hasBorder ? Border.all(width: 1.0, color: const Color(0xffcccccc)) : Border.all(width: 0.0, color: Colors.transparent), image: imageName != null ? DecorationImage( - image: ExactAssetImage('assets/images/$imageName'), - fit: BoxFit.cover, - colorFilter: hasColorFilter ? new ColorFilter.mode( - Colors.black.withOpacity(0.2), BlendMode.dstIn) : null, - ) + image: ExactAssetImage('assets/images/$imageName'), + fit: BoxFit.cover, + colorFilter: hasColorFilter ? new ColorFilter.mode(Colors.black.withOpacity(0.2), BlendMode.dstIn) : null, + ) : null, ), child: Center( diff --git a/lib/pages/landing/landing_page.dart b/lib/pages/landing/landing_page.dart index b4014fbc..799ca86e 100644 --- a/lib/pages/landing/landing_page.dart +++ b/lib/pages/landing/landing_page.dart @@ -3,7 +3,9 @@ import 'dart:typed_data'; import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; +import 'package:diplomaticquarterapp/core/model/geofencing/requests/GeoZonesRequestModel.dart'; import 'package:diplomaticquarterapp/core/service/AuthenticatedUserObject.dart'; +import 'package:diplomaticquarterapp/core/service/geofencing/GeofencingServices.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; import 'package:diplomaticquarterapp/models/Authentication/select_device_imei_res.dart'; @@ -15,11 +17,12 @@ import 'package:diplomaticquarterapp/pages/livecare/incoming_call.dart'; import 'package:diplomaticquarterapp/pages/medical/medical_profile_page.dart'; import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart'; import 'package:diplomaticquarterapp/services/robo_search/event_provider.dart'; -import 'package:diplomaticquarterapp/theme/theme_notifier.dart'; -import 'package:diplomaticquarterapp/theme/theme_value.dart'; import 'package:diplomaticquarterapp/uitl/CalendarUtils.dart'; +import 'package:diplomaticquarterapp/uitl/HMGNetworkConnectivity.dart'; +import 'package:diplomaticquarterapp/uitl/HMG_Geofence.dart'; import 'package:diplomaticquarterapp/uitl/LocalNotification.dart'; -import 'package:diplomaticquarterapp/uitl/location_util.dart'; +import 'package:diplomaticquarterapp/uitl/PlatformBridge.dart'; +import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/bottom_navigation/bottom_nav_bar.dart'; import 'package:diplomaticquarterapp/widgets/buttons/floatingActionButton.dart'; @@ -51,20 +54,16 @@ class _LandingPageState extends State with WidgetsBindingObserver { PageController pageController; ProjectViewModel projectViewModel; var notificationCount = ''; - var themeNotifier; + ///inject the user data - AuthenticatedUserObject authenticatedUserObject = - locator(); + AuthenticatedUserObject authenticatedUserObject = locator(); final FirebaseMessaging _firebaseMessaging = FirebaseMessaging(); final authService = new AuthProvider(); var event = RobotProvider(); void _requestIOSPermissions() { - flutterLocalNotificationsPlugin - .resolvePlatformSpecificImplementation< - IOSFlutterLocalNotificationsPlugin>() - ?.requestPermissions( + flutterLocalNotificationsPlugin.resolvePlatformSpecificImplementation()?.requestPermissions( alert: true, badge: true, sound: true, @@ -72,7 +71,7 @@ class _LandingPageState extends State with WidgetsBindingObserver { } bool isPageNavigated = false; - LocationUtils locationUtils; + _changeCurrentTab(int tab) { setState(() { currentTab = tab; @@ -94,18 +93,12 @@ class _LandingPageState extends State with WidgetsBindingObserver { print("didChangeAppLifecycleState"); print('state = $state'); AppGlobal.context = context; - if (state == AppLifecycleState.resumed) { print(LandingPage.isOpenCallPage); if (LandingPage.isOpenCallPage) { if (!isPageNavigated) { isPageNavigated = true; - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => IncomingCall( - incomingCallData: LandingPage.incomingCallData))) - .then((value) { + Navigator.push(context, MaterialPageRoute(builder: (context) => IncomingCall(incomingCallData: LandingPage.incomingCallData))).then((value) { isPageNavigated = false; }); } @@ -131,6 +124,7 @@ class _LandingPageState extends State with WidgetsBindingObserver { @override void initState() { super.initState(); + WidgetsBinding.instance.addObserver(this); //setState(() { AppGlobal.context = context; @@ -139,30 +133,45 @@ class _LandingPageState extends State with WidgetsBindingObserver { pageController = PageController(keepPage: true); _firebaseMessaging.setAutoInitEnabled(true); - locationUtils = - new LocationUtils(isShowConfirmDialog: true, context: context); - WidgetsBinding.instance - .addPostFrameCallback((_) => locationUtils.getCurrentLocation()); - + // HMG (Guest/Internet) Wifi Access [Zohaib Kambrani] + HMGNetworkConnectivity(context, () { + GifLoaderDialogUtils.showMyDialog(context); + PlatformBridge().connectHMGGuestWifi().then((value) => {GifLoaderDialogUtils.hideDialog(context)}); + }).checkAndConnectIfNoInternet(); if (Platform.isIOS) { _firebaseMessaging.requestNotificationPermissions(); } - _firebaseMessaging.getToken().then((String token) async { - sharedPref.setString(PUSH_TOKEN, token); - if (token != null && await sharedPref.getObject(USER_PROFILE) ==null) { - DEVICE_TOKEN = token; - checkUserStatus(token); + // Flip Permission Checks [Zohaib Kambrani] + requestPermissions().then((results) { + if (results[Permission.locationAlways].isGranted || results[Permission.location].isGranted) { + debugPrint("Fetching GEO ZONES from HMG service..."); + locator().getAllGeoZones(GeoZonesRequestModel()).then((geoZones) { + debugPrint("GEO ZONES saved to AppPreferences with key '$HMG_GEOFENCES'"); + debugPrint("Finished Fetching GEO ZONES from HMG service..."); + projectViewModel.platformBridge().registerHmgGeofences(); + }); } - requestPermissions(); - }).catchError((err) { - print(err); + + if (results[Permission.notification].isGranted) + _firebaseMessaging.getToken().then((String token) { + sharedPref.setString(PUSH_TOKEN, token); + if (token != null && DEVICE_TOKEN == "") { + DEVICE_TOKEN = token; + checkUserStatus(token); + } + }); + + if (results[Permission.storage].isGranted) ; + if (results[Permission.camera].isGranted) ; + if (results[Permission.photos].isGranted) ; + if (results[Permission.accessMediaLocation].isGranted) ; + if (results[Permission.calendar].isGranted) ; }); + // // //_firebase Background message handler - Future.delayed(Duration.zero, () => setTheme()); - //_firebase Background message handler // _firebaseMessaging.configure( // // onMessage: (Map message) async { // // showDialog("onMessage: $message"); @@ -281,18 +290,14 @@ class _LandingPageState extends State with WidgetsBindingObserver { showDialogs(String message) { ConfirmDialog dialog = new ConfirmDialog( - context: context, - confirmMessage: message, - okText: TranslationBase.of(context).confirm, - cancelText: TranslationBase.of(context).cancel_nocaps, - okFunction: () => {}, - cancelFunction: () => {}); + context: context, confirmMessage: message, okText: TranslationBase.of(context).confirm, cancelText: TranslationBase.of(context).cancel_nocaps, okFunction: () => {}, cancelFunction: () => {}); dialog.showAlertDialog(context); } - void requestPermissions() async { - await [ + Future> requestPermissions() async { + var permissionResults = [ Permission.location, + Permission.locationAlways, Permission.storage, Permission.camera, Permission.photos, @@ -304,64 +309,24 @@ class _LandingPageState extends State with WidgetsBindingObserver { var permissionsGranted = await deviceCalendarPlugin.hasPermissions(); if (permissionsGranted.isSuccess && !permissionsGranted.data) { permissionsGranted = await deviceCalendarPlugin.requestPermissions(); - if (!permissionsGranted.isSuccess || !permissionsGranted.data) { - return; - } + if (!permissionsGranted.isSuccess || !permissionsGranted.data) {} } - } - - Future _scheduleNotification() async { - var scheduledNotificationDateTime = - DateTime.now().add(Duration(seconds: 5)); - var vibrationPattern = Int64List(4); - vibrationPattern[0] = 0; - vibrationPattern[1] = 1000; - vibrationPattern[2] = 5000; - vibrationPattern[3] = 2000; - - var androidPlatformChannelSpecifics = AndroidNotificationDetails( - 'your other channel id', - 'your other channel name', - 'your other channel description', - // icon: 'secondary_icon', - sound: RawResourceAndroidNotificationSound('slow_spring_board'), - largeIcon: DrawableResourceAndroidBitmap('sample_large_icon'), - vibrationPattern: vibrationPattern, - enableLights: true, - color: const Color.fromARGB(255, 255, 0, 0), - ledColor: const Color.fromARGB(255, 255, 0, 0), - ledOnMs: 1000, - ledOffMs: 500); - var iOSPlatformChannelSpecifics = - IOSNotificationDetails(sound: 'slow_spring_board.aiff'); - // var platformChannelSpecifics = NotificationDetails( - // androidPlatformChannelSpecifics, iOSPlatformChannelSpecifics); - // await flutterLocalNotificationsPlugin.schedule( - // 0, - // 'scheduled title', - // 'scheduled body', - // scheduledNotificationDateTime, - // platformChannelSpecifics); + return permissionResults; } @override Widget build(BuildContext context) { - projectViewModel = Provider.of(context); - themeNotifier = Provider.of(context); - //setTheme(); + projectViewModel = Provider.of(context); + return Scaffold( appBar: AppBar( elevation: 0, textTheme: TextTheme( - headline6: - TextStyle(color: Colors.white, fontWeight: FontWeight.bold), + headline6: TextStyle(color: Colors.white, fontWeight: FontWeight.bold), ), title: Text( getText(currentTab).toUpperCase(), - style: TextStyle( - fontWeight: FontWeight.bold, - color: Colors.white, - fontFamily: projectViewModel.isArabic ? 'Cairo' : 'WorkSans'), + style: TextStyle(fontWeight: FontWeight.bold, color: Colors.white, fontFamily: projectViewModel.isArabic ? 'Cairo' : 'WorkSans'), // bold: true, // color: Colors.white, ), @@ -392,7 +357,7 @@ class _LandingPageState extends State with WidgetsBindingObserver { notificationCount, style: new TextStyle( color: Colors.white, - fontSize: projectViewModel.isArabic ? 8 : 9, + fontSize: projectViewModel.isArabic ? 8 : 9, ), textAlign: TextAlign.center, ), @@ -416,7 +381,9 @@ class _LandingPageState extends State with WidgetsBindingObserver { SETTINGS, ); else - login(); + Navigator.of(context).pushNamed( + WELCOME_LOGIN, + ); }, //do something, ) ], @@ -444,7 +411,7 @@ class _LandingPageState extends State with WidgetsBindingObserver { index: currentTab, ), floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked, - floatingActionButton: (projectViewModel.havePrivilege(34) && currentTab == 0) + floatingActionButton: currentTab == 0 ? FloatingButton( elevation: true, onTap: () { @@ -464,76 +431,30 @@ class _LandingPageState extends State with WidgetsBindingObserver { case 1: return TranslationBase.of(context).medicalProfile; case 2: - return TranslationBase.of(context).bookAppo; + return TranslationBase.of(context).mySchedule; case 3: return TranslationBase.of(context).services; case 4: return TranslationBase.of(context).bookAppo; } } - setTheme() async{ - // - // defaultTheme = - // ThemeData( - // fontFamily:projectViewModel.isArabic ? 'Cairo' : 'WorkSans', - // primarySwatch: Colors.blue, - // visualDensity: VisualDensity.adaptivePlatformDensity, - // brightness: Brightness.light, - // pageTransitionsTheme: const PageTransitionsTheme( - // builders: { - // TargetPlatform.android: ZoomPageTransitionsBuilder(), - // TargetPlatform.iOS: CupertinoPageTransitionsBuilder(), - // }, - // ), - // hintColor: Colors.grey[400], - // disabledColor: Colors.grey[300], - // errorColor: Color.fromRGBO(235, 80, 60, 1.0), - // scaffoldBackgroundColor: Color(0xffEEEEEE), - // textSelectionColor: Color.fromRGBO(80, 100, 253, 0.5), - // textSelectionHandleColor: Colors.grey, - // canvasColor: Colors.white, - // backgroundColor: Colors.white, - // highlightColor: Colors.grey[100].withOpacity(0.4), - // splashColor: Colors.transparent, - // primaryColor: Color(0xff40ACC9), - // bottomSheetTheme: BottomSheetThemeData(backgroundColor: Color(0xffE0E0E0)), - // cursorColor: Colors.grey, - // cardColor: Colors.white, - // iconTheme: IconThemeData(), - // appBarTheme: AppBarTheme( - // color: Color(0xff40ACC9), - // brightness: Brightness.dark, - // elevation: 10.0, - // actionsIconTheme: IconThemeData( - // color: Color(0xff40ACC9), - // ), - // ), - // ); - // themeNotifier.setTheme(defaultTheme); - } + void checkUserStatus(token) async { - authService - .selectDeviceImei(token) - .then((SelectDeviceIMEIRES value) => setUserValues(value)); + authService.selectDeviceImei(token).then((SelectDeviceIMEIRES value) => setUserValues(value)); if (await sharedPref.getObject(USER_PROFILE) != null) { - var data = - AuthenticatedUser.fromJson(await sharedPref.getObject(USER_PROFILE)); + var data = AuthenticatedUser.fromJson(await sharedPref.getObject(USER_PROFILE)); if (data != null) { - authService - .registeredAuthenticatedUser(data, token, 0, 0) - .then((res) => {print(res)}); + authService.registeredAuthenticatedUser(data, token, 0, 0).then((res) => {print(res)}); authService.getDashboard().then((value) => { setState(() { - notificationCount = value['List_PatientDashboard'] - [0]['UnreadPatientNotificationCount'].toString(); + notificationCount = value['List_PatientDashboard'][0]['UnreadPatientNotificationCount'].toString(); }) }); } } } - static Future myBackgroundMessageHandler( - Map message) async { + static Future myBackgroundMessageHandler(Map message) async { Map myMap = new Map.from(message['data']); if (message.containsKey('data')) { print("myBackgroundMessageHandler Inside"); @@ -557,15 +478,4 @@ class _LandingPageState extends State with WidgetsBindingObserver { _changeCurrentTab(2); } } - login() async { - var data = await sharedPref.getObject(IMEI_USER_DATA); - sharedPref.remove(REGISTER_DATA_FOR_LOGIIN); - if (data != null) { - Navigator.of(context).pushNamed(CONFIRM_LOGIN); - } else { - Navigator.of(context).pushNamed( - WELCOME_LOGIN, - ); - } - } } diff --git a/lib/pages/livecare/livecare_home.dart b/lib/pages/livecare/livecare_home.dart index 3243b269..fc5c4eab 100644 --- a/lib/pages/livecare/livecare_home.dart +++ b/lib/pages/livecare/livecare_home.dart @@ -3,11 +3,12 @@ import 'package:diplomaticquarterapp/pages/livecare/widgets/LiveCarePendingReque import 'package:diplomaticquarterapp/pages/livecare/widgets/clinic_list.dart'; import 'package:diplomaticquarterapp/pages/livecare/widgets/livecare_logs.dart'; import 'package:diplomaticquarterapp/services/livecare_services/livecare_provider.dart'; -import 'package:diplomaticquarterapp/uitl/app_toast.dart'; -import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/material.dart'; +import 'package:smart_progress_bar/smart_progress_bar.dart'; + +import 'livecare_type_select.dart'; class LiveCareHome extends StatefulWidget { static bool showFooterButton = true; @@ -92,37 +93,40 @@ class _LiveCareHomeState extends State hasLiveCareRequest = false; }); LiveCareService service = new LiveCareService(); - GifLoaderDialogUtils.showMyDialog(context); PatientERVirtualHistoryResponse patientERVirtualHistoryResponse = new PatientERVirtualHistoryResponse(); - service.getLivecareHistory(context).then((res) { - GifLoaderDialogUtils.hideDialog(context); - setState(() { - print(res['ErRequestHistoryList'].length); - if (res['ErRequestHistoryList'].length != 0) { - patientERVirtualHistoryResponse = - PatientERVirtualHistoryResponse.fromJson(res); - erRequestHistoryList = - patientERVirtualHistoryResponse.erRequestHistoryList; + service + .getLivecareHistory(context) + .then((res) { + setState(() { + print(res['ErRequestHistoryList'].length); + if (res['ErRequestHistoryList'].length != 0) { + patientERVirtualHistoryResponse = + PatientERVirtualHistoryResponse.fromJson(res); + erRequestHistoryList = + patientERVirtualHistoryResponse.erRequestHistoryList; - if (patientERVirtualHistoryResponse - .erRequestHistoryList[0].callStatus < - 4) { - pendingERRequestHistoryList = - patientERVirtualHistoryResponse.erRequestHistoryList[0]; - hasLiveCareRequest = true; - } else { - hasLiveCareRequest = false; - } - } - }); - setState(() { - isDataLoaded = true; - }); - }).catchError((err) { - GifLoaderDialogUtils.hideDialog(context); - AppToast.showErrorToast(message: err); - print(err); - }); + if (patientERVirtualHistoryResponse + .erRequestHistoryList[0].callStatus < + 4) { + pendingERRequestHistoryList = + patientERVirtualHistoryResponse.erRequestHistoryList[0]; + hasLiveCareRequest = true; + } else { + hasLiveCareRequest = false; + } + } + }); + }) + .catchError((err) { + print(err); + }) + .showProgressBar( + text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)) + .then((value) { + setState(() { + isDataLoaded = true; + }); + }); } } diff --git a/lib/pages/livecare/widgets/LiveCareHistoryCard.dart b/lib/pages/livecare/widgets/LiveCareHistoryCard.dart index e80f79ee..25ec8514 100644 --- a/lib/pages/livecare/widgets/LiveCareHistoryCard.dart +++ b/lib/pages/livecare/widgets/LiveCareHistoryCard.dart @@ -5,11 +5,11 @@ import 'package:diplomaticquarterapp/pages/feedback/feedback_home_page.dart'; import 'package:diplomaticquarterapp/services/livecare_services/livecare_provider.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; -import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/material.dart'; +import 'package:smart_progress_bar/smart_progress_bar.dart'; class LiveCareHistoryCard extends StatefulWidget { ErRequestHistoryList erRequestHistoryList; @@ -177,7 +177,6 @@ class _LiveCareHistoryCardState extends State { sendInvoiceEmail(context) { ConfirmDialog.closeAlertDialog(context); LiveCareService service = new LiveCareService(); - GifLoaderDialogUtils.showMyDialog(context); service .sendLiveCareInvoiceEmail( widget.erRequestHistoryList.appointmentNo.toString(), @@ -185,13 +184,12 @@ class _LiveCareHistoryCardState extends State { authUser.emailAddress, context) .then((res) { - GifLoaderDialogUtils.hideDialog(context); AppToast.showSuccessToast(message: "LiveCare invoice sent successfully"); }).catchError((err) { - GifLoaderDialogUtils.hideDialog(context); AppToast.showErrorToast(message: err); print(err); - }); + }).showProgressBar( + text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); } getAuthenticatedUser() async { diff --git a/lib/pages/livecare/widgets/LiveCarePendingRequest.dart b/lib/pages/livecare/widgets/LiveCarePendingRequest.dart index 7ce39804..bfd42e62 100644 --- a/lib/pages/livecare/widgets/LiveCarePendingRequest.dart +++ b/lib/pages/livecare/widgets/LiveCarePendingRequest.dart @@ -3,9 +3,9 @@ import 'package:diplomaticquarterapp/models/FamilyFiles/PatientERVirtualHistoryR import 'package:diplomaticquarterapp/services/livecare_services/livecare_provider.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; -import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:flutter/material.dart'; +import 'package:smart_progress_bar/smart_progress_bar.dart'; class LiveCarePendingRequest extends StatefulWidget { ErRequestHistoryList pendingERRequestHistoryList; @@ -149,19 +149,19 @@ class _LiveCarePendingRequestState extends State { cancelLiveCareRequest() { LiveCareService service = new LiveCareService(); - GifLoaderDialogUtils.showMyDialog(context); service .cancelLiveCareRequest(widget.pendingERRequestHistoryList.vCID, context) .then((res) { - GifLoaderDialogUtils.hideDialog(context); AppToast.showSuccessToast( message: "LiveCare request cancelled successfully"); - widget.getLiveCareHistory(); }) .catchError((err) { - GifLoaderDialogUtils.hideDialog(context); - AppToast.showErrorToast(message: err); print(err); + }) + .showProgressBar( + text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)) + .then((value) { + widget.getLiveCareHistory(); }); } } diff --git a/lib/pages/livecare/widgets/clinic_card.dart b/lib/pages/livecare/widgets/clinic_card.dart index 410b7170..56613034 100644 --- a/lib/pages/livecare/widgets/clinic_card.dart +++ b/lib/pages/livecare/widgets/clinic_card.dart @@ -2,8 +2,8 @@ import 'package:diplomaticquarterapp/models/LiveCare/ClinicsServiceTimingsRespon import 'package:diplomaticquarterapp/models/LiveCare/LiveCareClinicsListResponse.dart'; import 'package:diplomaticquarterapp/services/livecare_services/livecare_provider.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; -import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:flutter/material.dart'; +import 'package:smart_progress_bar/smart_progress_bar.dart'; import 'ClinicTimingsDialog.dart'; @@ -90,11 +90,9 @@ class _State extends State { getClinicTimings(PatientERGetClinicsList patientERGetClinicsList) { LiveCareService service = new LiveCareService(); - GifLoaderDialogUtils.showMyDialog(context); service .getLivecareClinicTiming(patientERGetClinicsList.serviceID, context) .then((res) { - GifLoaderDialogUtils.hideDialog(context); if (res['MessageStatus'] == 1) { setState(() { clinicsServiceTimingsResponse = @@ -131,9 +129,8 @@ class _State extends State { AppToast.showErrorToast(message: res['ErrorEndUserMessage']); } }).catchError((err) { - GifLoaderDialogUtils.hideDialog(context); - AppToast.showErrorToast(message: err); print(err); - }); + }).showProgressBar( + text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); } } diff --git a/lib/pages/livecare/widgets/clinic_list.dart b/lib/pages/livecare/widgets/clinic_list.dart index fc27d92b..d2e52b72 100644 --- a/lib/pages/livecare/widgets/clinic_list.dart +++ b/lib/pages/livecare/widgets/clinic_list.dart @@ -17,13 +17,13 @@ import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart' import 'package:diplomaticquarterapp/services/livecare_services/livecare_provider.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; -import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart'; import 'package:diplomaticquarterapp/widgets/in_app_browser/InAppBrowser.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import 'package:smart_progress_bar/smart_progress_bar.dart'; class ClinicList extends StatefulWidget { final Function getLiveCareHistory; @@ -79,27 +79,31 @@ class _clinic_listState extends State { void startLiveCare() { bool isError = false; LiveCareService service = new LiveCareService(); - GifLoaderDialogUtils.showMyDialog(context); ERAppointmentFeesResponse erAppointmentFeesResponse = new ERAppointmentFeesResponse(); - service.getERAppointmentFees(selectedClinicID, context).then((res) { - GifLoaderDialogUtils.hideDialog(context); - if (res['HasAppointment'] == true) { - isError = true; - showLiveCareCancelDialog(res['ErrorEndUserMessage'], res); - } else { - erAppointmentFeesResponse = ERAppointmentFeesResponse.fromJson(res); - isError = false; - } - if (!isError) - getERAppointmentTime( - erAppointmentFeesResponse.getERAppointmentFeesList); - }).catchError((err) { - GifLoaderDialogUtils.hideDialog(context); - print(err); - isError = true; - AppToast.showErrorToast(message: err); - }); + service + .getERAppointmentFees(selectedClinicID, context) + .then((res) { + if (res['HasAppointment'] == true) { + isError = true; + showLiveCareCancelDialog(res['ErrorEndUserMessage'], res); + } else { + erAppointmentFeesResponse = ERAppointmentFeesResponse.fromJson(res); + isError = false; + } + }) + .catchError((err) { + print(err); + isError = true; + AppToast.showErrorToast(message: err); + }) + .showProgressBar( + text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)) + .then((value) { + if (!isError) + getERAppointmentTime( + erAppointmentFeesResponse.getERAppointmentFeesList); + }); } showLiveCareCancelDialog(String msg, res) { @@ -108,7 +112,8 @@ class _clinic_listState extends State { confirmMessage: msg, okText: TranslationBase.of(context).confirm, cancelText: TranslationBase.of(context).cancel_nocaps, - okFunction: () => {cancelAppointment(res)}, + okFunction: () => + {cancelAppointment(res)}, cancelFunction: () => {}); dialog.showAlertDialog(context); } @@ -127,37 +132,38 @@ class _clinic_listState extends State { appo.appointmentDate = res['AppointmentDate']; ConfirmDialog.closeAlertDialog(context); - GifLoaderDialogUtils.showMyDialog(context); DoctorsListService service = new DoctorsListService(); - service.cancelAppointment(appo, context).then((res) { - GifLoaderDialogUtils.hideDialog(context); - print(res); - if (res['MessageStatus'] == 1) { - AppToast.showSuccessToast(message: res['ErrorEndUserMessage']); - startLiveCare(); - } else { - AppToast.showErrorToast(message: res['ErrorEndUserMessage']); - } - }).catchError((err) { - GifLoaderDialogUtils.hideDialog(context); - AppToast.showErrorToast(message: err); - print(err); - }); + service + .cancelAppointment(appo, context) + .then((res) { + print(res); + if (res['MessageStatus'] == 1) { + AppToast.showSuccessToast(message: res['ErrorEndUserMessage']); + } else { + AppToast.showErrorToast(message: res['ErrorEndUserMessage']); + } + }) + .catchError((err) { + print(err); + }) + .showProgressBar( + text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)) + .then((value) { + startLiveCare(); + }); } getERAppointmentTime(GetERAppointmentFeesList getERAppointmentFeesList) { LiveCareService service = new LiveCareService(); - GifLoaderDialogUtils.showMyDialog(context); service.getERAppointmentTime(selectedClinicID, context).then((res) { - GifLoaderDialogUtils.hideDialog(context); print(res); showLiveCarePaymentDialog( getERAppointmentFeesList, res['WatingtimeInteger']); }).catchError((err) { - GifLoaderDialogUtils.hideDialog(context); print(err); AppToast.showErrorToast(message: err); - }); + }).showProgressBar( + text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); } showLiveCarePaymentDialog( @@ -279,9 +285,6 @@ class _clinic_listState extends State { "12", authenticatedUser.emailAddress, paymentMethod, - authenticatedUser.patientType, - authenticatedUser.firstName, - authenticatedUser.patientID, authenticatedUser, browser); } @@ -314,14 +317,12 @@ class _clinic_listState extends State { checkPaymentStatus(AppoitmentAllHistoryResultList appo) { DoctorsListService service = new DoctorsListService(); - GifLoaderDialogUtils.showMyDialog(context); service .checkPaymentStatus( Utils.getAppointmentTransID( appo.projectID, appo.clinicID, appo.appointmentNo), context) .then((res) { - GifLoaderDialogUtils.hideDialog(context); print("Printing Payment Status Reponse!!!!"); print(res); String paymentInfo = res['Response_Message']; @@ -332,27 +333,27 @@ class _clinic_listState extends State { AppToast.showErrorToast(message: res['Response_Message']); } }).catchError((err) { - GifLoaderDialogUtils.hideDialog(context); - AppToast.showErrorToast(message: err); print(err); - }); + }).showProgressBar( + text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); } addNewCallForPatientER(String clientRequestID) { LiveCareService service = new LiveCareService(); - GifLoaderDialogUtils.showMyDialog(context); service .addNewCallForPatientER(selectedClinicID, clientRequestID, context) .then((res) { - GifLoaderDialogUtils.hideDialog(context); - AppToast.showSuccessToast( - message: "New Call has been added successfully"); - widget.getLiveCareHistory(); - }).catchError((err) { - GifLoaderDialogUtils.hideDialog(context); - AppToast.showErrorToast(message: err); - print(err); - }); + AppToast.showSuccessToast( + message: "New Call has been added successfully"); + }) + .catchError((err) { + print(err); + }) + .showProgressBar( + text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)) + .then((value) { + widget.getLiveCareHistory(); + }); } getLanguageID() async { @@ -362,9 +363,7 @@ class _clinic_listState extends State { getLiveCareClinicsList() { isDataLoaded = false; LiveCareService service = new LiveCareService(); - GifLoaderDialogUtils.showMyDialog(context); service.getLivecareClinics(context).then((res) { - GifLoaderDialogUtils.hideDialog(context); print(res['PatientER_GetClinicsList'].length); if (res['MessageStatus'] == 1) { setState(() { @@ -382,18 +381,15 @@ class _clinic_listState extends State { AppToast.showErrorToast(message: res['ErrorEndUserMessage']); } }).catchError((err) { - GifLoaderDialogUtils.hideDialog(context); - AppToast.showErrorToast(message: err); print(err); - }); + }).showProgressBar( + text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); } getLiveCareScheduleClinicsList() { isDataLoaded = false; LiveCareService service = new LiveCareService(); - GifLoaderDialogUtils.showMyDialog(context); service.getLiveCareScheduledClinics(context).then((res) { - GifLoaderDialogUtils.hideDialog(context); print(res['ClinicsHaveScheduleList'].length); if (res['MessageStatus'] == 1) { setState(() { @@ -412,10 +408,9 @@ class _clinic_listState extends State { AppToast.showErrorToast(message: res['ErrorEndUserMessage']); } }).catchError((err) { - GifLoaderDialogUtils.hideDialog(context); - AppToast.showErrorToast(message: err); print(err); - }); + }).showProgressBar( + text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); } openLiveCareSelectionDialog() { @@ -607,13 +602,13 @@ class _clinic_listState extends State { void startScheduleLiveCare() { List doctorsList = []; LiveCareService service = new LiveCareService(); - GifLoaderDialogUtils.showMyDialog(context); List _patientDoctorAppointmentListHospital = List(); service .getLiveCareScheduledDoctorList(context, selectedClinicID) .then((res) { - GifLoaderDialogUtils.hideDialog(context); + print(res['DoctorByClinicIDList']); + print(res['DoctorByClinicIDList'].length); if (res['MessageStatus'] == 1) { setState(() { if (res['DoctorByClinicIDList'].length != 0) { @@ -652,10 +647,9 @@ class _clinic_listState extends State { context, doctorsList, _patientDoctorAppointmentListHospital); } else {} }).catchError((err) { - GifLoaderDialogUtils.hideDialog(context); - AppToast.showErrorToast(message: err); print(err); - }); + }).showProgressBar( + text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); } Future navigateToSearchResults( diff --git a/lib/pages/login/confirm-login.dart b/lib/pages/login/confirm-login.dart index 2b02540b..e016776e 100644 --- a/lib/pages/login/confirm-login.dart +++ b/lib/pages/login/confirm-login.dart @@ -26,7 +26,7 @@ import 'package:flutter/services.dart'; import 'package:intl/intl.dart'; import 'package:local_auth/local_auth.dart'; import 'package:provider/provider.dart'; -// import 'package:smart_progress_bar/smart_progress_bar.dart'; +import 'package:smart_progress_bar/smart_progress_bar.dart'; class ConfirmLogin extends StatefulWidget { @override @@ -69,11 +69,12 @@ class _ConfirmLogin extends State { int fingrePrintBefore; AuthenticatedUserObject authenticatedUserObject = - locator(); + locator(); AppointmentRateViewModel appointmentRateViewModel = - locator(); + locator(); ProjectViewModel projectViewModel; + @override void initState() { _getAvailableBiometrics(); @@ -261,7 +262,6 @@ class _ConfirmLogin extends State { } authenticateUser(type, isActive) { - GifLoaderDialogUtils.showMyDialog(context); if (type == 2 || type == 3) { fingrePrintBefore = type; } @@ -308,6 +308,7 @@ class _ConfirmLogin extends State { req.logInTokenID = ""; var request = CheckPatientAuthenticationReq.fromJson(req.toJson()); + GifLoaderDialogUtils.showMyDialog(context); sharedPref.setObject(REGISTER_DATA_FOR_REGISTER, request); authService @@ -366,25 +367,25 @@ class _ConfirmLogin extends State { localizedReason: 'Scan your fingerprint to authenticate', useErrorDialogs: true, stickyAuth: true); - + if (authenticated == true) { - if (user != null && (user.logInType == 2 || user.logInType == 3)) { - this.checkActivationCode(); - } else { - var request = this.getCommonRequest(type: type); - this.getMobileInfo(request); - } + + if(user.logInType==2 || user.logInType ==3){ + this.checkActivationCode(); + }else{ + var request = this.getCommonRequest(type: type); + this.getMobileInfo(request); + } + } } } getMobileInfo(request) { - GifLoaderDialogUtils.showMyDialog(context); this .authService .getLoginInfo(request) .then((result) => { - GifLoaderDialogUtils.hideDialog(context), if (result['SMSLoginRequired'] == false) { this.loginTokenID = result.logInTokenID, @@ -421,9 +422,9 @@ class _ConfirmLogin extends State { } }) .catchError((err) { - GifLoaderDialogUtils.hideDialog(context); print(err); - }); + }).showProgressBar( + text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); } setUser() async {} @@ -459,9 +460,7 @@ class _ConfirmLogin extends State { this.deviceToken = await sharedPref.getString(PUSH_TOKEN); this.lastLogin = await sharedPref.getInt(LAST_LOGIN) != null ? await sharedPref.getInt(LAST_LOGIN) - : user != null - ? user.logInType - : null; + : user.logInType !=null ? user.logInType : null; //this.cs.sharedService.getStorage(AuthenticationService.LAST_LOGIN); } @@ -515,7 +514,7 @@ class _ConfirmLogin extends State { .then((result) => { if (result is Map) { - projectViewModel.setPrivilege(privilegeList: result), + result = CheckActivationCode.fromJson(result), if (this.registerd_data != null && this.registerd_data.isRegister == true) @@ -526,7 +525,6 @@ class _ConfirmLogin extends State { } else { - sharedPref.remove(FAMILY_FILE), result.list.isFamily = false, userData = result.list, sharedPref.setObject(MAIN_USER, result.list), @@ -553,6 +551,7 @@ class _ConfirmLogin extends State { } checkIfUserAgreedBefore(CheckActivationCode result) { + print(result); if (result.isNeedUserAgreement == true) { //move to agreement page. } else { @@ -570,6 +569,7 @@ class _ConfirmLogin extends State { } goToHome() { + authenticatedUserObject.isLogin = true; appointmentRateViewModel.isLogin = true; projectViewModel.isLogin = true; @@ -755,7 +755,7 @@ class _ConfirmLogin extends State { bool checkIfBiometricAvailable(BiometricType biometricType) { bool isAvailable = false; - if (_availableBiometrics != null) { + if(_availableBiometrics != null) { for (var i = 0; i < _availableBiometrics.length; i++) { if (biometricType == _availableBiometrics[i]) isAvailable = true; } diff --git a/lib/pages/login/login.dart b/lib/pages/login/login.dart index cc1a0350..700a0d0c 100644 --- a/lib/pages/login/login.dart +++ b/lib/pages/login/login.dart @@ -20,11 +20,13 @@ import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart'; import 'package:diplomaticquarterapp/widgets/input/text_field.dart'; import 'package:diplomaticquarterapp/widgets/mobile-no/mobile_no.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:diplomaticquarterapp/widgets/progress_indicator/app_circular_progress_Indeicator.dart'; import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; +import 'package:smart_progress_bar/smart_progress_bar.dart'; class Login extends StatefulWidget { @override @@ -91,24 +93,22 @@ class _Login extends State { onNumberChange: (value) => {mobileNo = value, validateForm()}, onCountryChange: (value) => countryCode = value), - Directionality( - textDirection: TextDirection.ltr, - child: Container( - child: TextFields( - fontWeight: FontWeight.normal, - controller: nationalIDorFile, - onChanged: (value) => {validateForm()}, - prefixIcon: Icon( - loginType == 1 - ? Icons.chrome_reader_mode - : Icons.receipt, - color: Color(0xFF40ACC9)), - padding: EdgeInsets.only( - top: 20, bottom: 20, left: 10, right: 10), - hintText: loginType == 1 - ? TranslationBase.of(context).nationalID - : TranslationBase.of(context).fileNo, - ))) + Container( + child: TextFields( + fontWeight: FontWeight.normal, + controller: nationalIDorFile, + onChanged: (value) => {validateForm()}, + prefixIcon: Icon( + loginType == 1 + ? Icons.chrome_reader_mode + : Icons.receipt, + color: Color(0xFF40ACC9)), + padding: EdgeInsets.only( + top: 20, bottom: 20, left: 10, right: 10), + hintText: loginType == 1 + ? TranslationBase.of(context).nationalID + : TranslationBase.of(context).fileNo, + )) ], ), ), @@ -121,9 +121,7 @@ class _Login extends State { color: Colors.grey, height: 2, ), - SizedBox( - height: 10, - ), + SizedBox(height: 10,), Row( children: [ Expanded( @@ -210,13 +208,15 @@ class _Login extends State { okText: TranslationBase.of(context).confirm, cancelText: TranslationBase.of(context).cancel_nocaps, okFunction: () => { - ConfirmDialog.closeAlertDialog(context), + ConfirmDialog.closeAlertDialog(context), Navigator.of(context).pushNamed( REGISTER, ), + }, cancelFunction: () => {ConfirmDialog.closeAlertDialog(context)}); dialog.showAlertDialog(context); + }); // SMSOTP.showLoadingDialog(context, false), } @@ -241,12 +241,10 @@ class _Login extends State { } // request.isRegister = false; this.authService.checkActivationCode(request, code).then((result) => { - sharedPref.remove(FAMILY_FILE), - projectViewModel.setPrivilege(privilegeList: result), result = CheckActivationCode.fromJson(result), - result.list.isFamily = false, - this.sharedPref.setObject(USER_PROFILE, result.list), - this.sharedPref.setObject(MAIN_USER, result.list), + result.list.isFamily =false, + this.sharedPref.setObject(USER_PROFILE, result.list), + this.sharedPref.setObject(MAIN_USER, result.list), this.sharedPref.setObject(LOGIN_TOKEN_ID, result.logInTokenID), this.sharedPref.setString(TOKEN, result.authenticationTokenID), authenticatedUserObject.getUser(), diff --git a/lib/pages/login/register-info.dart b/lib/pages/login/register-info.dart index 4ede2683..467068cc 100644 --- a/lib/pages/login/register-info.dart +++ b/lib/pages/login/register-info.dart @@ -1,9 +1,5 @@ import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/config/size_config.dart'; -import 'package:diplomaticquarterapp/core/service/AuthenticatedUserObject.dart'; -import 'package:diplomaticquarterapp/core/viewModels/appointment_rate_view_model.dart'; -import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; -import 'package:diplomaticquarterapp/locator.dart'; import 'package:diplomaticquarterapp/models/Authentication/check_paitent_authentication_req.dart'; import 'package:diplomaticquarterapp/models/Authentication/register_info_response.dart'; import 'package:diplomaticquarterapp/models/Authentication/register_user_requet.dart'; @@ -11,7 +7,6 @@ import 'package:diplomaticquarterapp/pages/login/login-type.dart'; import 'package:diplomaticquarterapp/routes.dart'; import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; -import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; @@ -25,7 +20,6 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:hijri/hijri_calendar.dart'; import 'package:intl/intl.dart'; -import 'package:provider/provider.dart'; class RegisterInfo extends StatefulWidget { @override @@ -51,11 +45,6 @@ class _RegisterInfo extends State { String email = ''; String location = '1'; - AuthenticatedUserObject authenticatedUserObject = - locator(); - AppointmentRateViewModel appointmentRateViewModel = - locator(); - ProjectViewModel projectViewModel; @override void initState() { @@ -67,7 +56,6 @@ class _RegisterInfo extends State { @override Widget build(BuildContext context) { - projectViewModel = Provider.of(context); return AppScaffold( appBarTitle: TranslationBase.of(context).register, isShowAppBar: true, @@ -308,34 +296,27 @@ class _RegisterInfo extends State { }else { - sharedPref.remove(FAMILY_FILE), - result['List'][0]['IsFamily'] = false, - sharedPref.setObject(USER_PROFILE, result['List'][0]), - this.sharedPref.setObject(MAIN_USER, result['List'][0]), - sharedPref.setObject(LOGIN_TOKEN_ID, result["LogInTokenID"]), - sharedPref.setString(TOKEN, result["AuthenticationTokenID"]), - authenticatedUserObject.isLogin = true, - appointmentRateViewModel.isLogin = true, - projectViewModel.isLogin = true, - - Navigator.of(context).pushNamed(HOME), - AppToast.showSuccessToast(message: result["ErrorEndUserMessage"]) + result.list.isFamily = false, + sharedPref.setObject(USER_PROFILE, result.list), + this.sharedPref.setObject(MAIN_USER, result.list), + sharedPref.setObject(LOGIN_TOKEN_ID, result.logInTokenID), + sharedPref.setString(TOKEN, result.authenticationTokenID), + Navigator.of(context).pushNamed(HOME) } - }); - // .catchError((err) { - // GifLoaderDialogUtils.hideDialog(context); - // ConfirmDialog dialog = new ConfirmDialog( - // context: context, - // confirmMessage: err, - // okText: TranslationBase.of(context).confirm, - // cancelText: TranslationBase.of(context).cancel_nocaps, - // okFunction: () => { - // ConfirmDialog.closeAlertDialog(context) - // }, - // cancelFunction: () => {ConfirmDialog.closeAlertDialog(context)}); - // dialog.showAlertDialog(context); - // - // }); + }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); + ConfirmDialog dialog = new ConfirmDialog( + context: context, + confirmMessage: err, + okText: TranslationBase.of(context).confirm, + cancelText: TranslationBase.of(context).cancel_nocaps, + okFunction: () => { + ConfirmDialog.closeAlertDialog(context) + }, + cancelFunction: () => {ConfirmDialog.closeAlertDialog(context)}); + dialog.showAlertDialog(context); + + }); } getRegisterInfo() async { @@ -368,15 +349,15 @@ class _RegisterInfo extends State { "PatientOutSA": registerd_data.zipCode == '966' ? 0 : 1, "FirstNameN":registerInfo.firstNameAr =='-' ?"": registerInfo.firstNameAr, "FirstName": registerInfo.firstNameEn =='-' ?"":registerInfo.firstNameEn, - "MiddleNameN":registerInfo.secondNameAr, - "MiddleName":registerInfo.secondNameEn, + "MiddleNameN":registerInfo.secondNameAr =='-' ? "" : registerInfo.secondNameAr, + "MiddleName":registerInfo.secondNameEn == '-' ? "": registerInfo.secondNameEn, "LastNameN": registerInfo.lastNameAr =='-'? "" : registerInfo.lastNameAr, "LastName": registerInfo.lastNameEn =='-' ? "": registerInfo.lastNameEn, "StrDateofBirth": registerInfo.dateOfBirth, "DateofBirth": DateUtil.convertISODateToJsonDate( registerInfo.dateOfBirth.replaceAll('/', '-')), "Gender": registerInfo.gender == 'M' ? 1 : 2, - "NationalityID": registerInfo.nationalityCode, + "NationalityID": registerInfo.nationality, "DateofBirthN": date, "EmailAddress": email, "SourceType": location, @@ -393,8 +374,8 @@ class _RegisterInfo extends State { } bool isValid() { - if (location != null && - language != null && + if (location != null || + language != null || Utils.validEmail(email) == true) { return true; } else { diff --git a/lib/pages/login/register.dart b/lib/pages/login/register.dart index 9245d6c3..ea47a4fa 100644 --- a/lib/pages/login/register.dart +++ b/lib/pages/login/register.dart @@ -72,8 +72,7 @@ class _Register extends State { onNumberChange: (value) => {mobileNo = value, validateForm()}, onCountryChange: (value) => countryCode = value), - Directionality( - textDirection:TextDirection.ltr,child:Container( + Container( child: TextFields( controller: nationalIDorFile, onChanged: (value) => validateForm(), @@ -82,7 +81,7 @@ class _Register extends State { padding: EdgeInsets.only( top: 20, bottom: 20, left: 10, right: 10), hintText: TranslationBase.of(context).nationalID, - ))), + )), Row( children: [ Expanded( @@ -299,7 +298,7 @@ class _Register extends State { // DOB: this.dateOption === '1' ? this.dateOfBirth : moment(this.dateOfBirth).format('DD/MM/YYYY'), // IsHijri: Number(this.dateOption) // } - GifLoaderDialogUtils.showMyDialog(context); + showLoader(true); var request = CheckUserStatusRequest(); request.patientIdentificationID = nationalIDorFile.text; request.dOB = isHijri == 1 @@ -308,7 +307,7 @@ class _Register extends State { request.isHijri = isHijri; request.patientOutSA = countryCode == '966' ? 0 : 1; this.authService.checkUserStatus(request).then((result) => { - GifLoaderDialogUtils.hideDialog(context), + showLoader(false), if (result is Map) { result = CheckUserStatusResponse.fromJson(result), diff --git a/lib/pages/medical/allergies_page.dart b/lib/pages/medical/allergies_page.dart index 459ef0f8..7fe30a8a 100644 --- a/lib/pages/medical/allergies_page.dart +++ b/lib/pages/medical/allergies_page.dart @@ -1,4 +1,3 @@ -import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/AllergiesViewModel.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; @@ -8,10 +7,8 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; class AllergiesPage extends StatelessWidget { - List imagesInfo = List(); @override Widget build(BuildContext context) { - imagesInfo.add(ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/alllergies/en/0.png',imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/alllergies/ar/0.png')); return BaseView( onModelReady: (model) => model.getAllergies(), builder: (_, model, w) => AppScaffold( @@ -19,7 +16,6 @@ class AllergiesPage extends StatelessWidget { appBarTitle: TranslationBase.of(context).allergies, baseViewModel: model, description: TranslationBase.of(context).infoAllergies, - imagesInfo: imagesInfo, body: ListView.builder( itemCount: model.allergies.length, itemBuilder: (context, index) => Container( diff --git a/lib/pages/medical/ask_doctor/ask_doctor_page.dart b/lib/pages/medical/ask_doctor/ask_doctor_page.dart index e6172b7a..6beed0dc 100644 --- a/lib/pages/medical/ask_doctor/ask_doctor_page.dart +++ b/lib/pages/medical/ask_doctor/ask_doctor_page.dart @@ -1,5 +1,7 @@ import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/ask_doctor_view_model.dart'; +import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart'; +import 'package:diplomaticquarterapp/pages/BookAppointment/widgets/DoctorView.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/medical/ask_doctor/request_type.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; @@ -10,6 +12,7 @@ import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:rating_bar/rating_bar.dart'; +import 'package:smart_progress_bar/smart_progress_bar.dart'; class AskDoctorPage extends StatelessWidget { @override diff --git a/lib/pages/medical/balance/advance_payment_page.dart b/lib/pages/medical/balance/advance_payment_page.dart index 85a0cc8f..f19b03ed 100644 --- a/lib/pages/medical/balance/advance_payment_page.dart +++ b/lib/pages/medical/balance/advance_payment_page.dart @@ -1,6 +1,5 @@ import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; -import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart'; import 'package:diplomaticquarterapp/core/model/hospitals/hospitals_model.dart'; import 'package:diplomaticquarterapp/core/model/my_balance/patient_info.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/my_balance_view_model.dart'; @@ -11,7 +10,6 @@ import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/medical/balance/dialogs/SelectHospitalDialog.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; -import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; @@ -20,6 +18,7 @@ import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import 'package:smart_progress_bar/smart_progress_bar.dart'; import '../../../core/model/my_balance/AdvanceModel.dart'; import 'confirm_payment_page.dart'; @@ -30,6 +29,7 @@ import 'new_text_Field.dart'; enum BeneficiaryType { MyAccount, MyFamilyFiles, OtherAccount, NON } + class AdvancePaymentPage extends StatefulWidget { @override _AdvancePaymentPageState createState() => _AdvancePaymentPageState(); @@ -50,17 +50,10 @@ class _AdvancePaymentPageState extends State { AppSharedPreferences sharedPref = AppSharedPreferences(); AuthenticatedUser authUser; - List imagesInfo = List(); - @override void initState() { super.initState(); getAuthUser(); - imagesInfo.add(ImagesInfo( - imageEn: - 'https://hmgwebservices.com/Images/MobileApp/images-info-home/advance-payment/en/0.png', - imageAr: - 'https://hmgwebservices.com/Images/MobileApp/images-info-home/advance-payment/ar/0.png')); } @override @@ -69,9 +62,7 @@ class _AdvancePaymentPageState extends State { onModelReady: (model) => model.getHospitals(), builder: (_, model, w) => AppScaffold( isShowAppBar: true, - imagesInfo: imagesInfo, appBarTitle: TranslationBase.of(context).advancePayment, - description: TranslationBase.of(context).infoAdvancePayment, body: SingleChildScrollView( physics: ScrollPhysics(), child: Container( @@ -111,13 +102,13 @@ class _AdvancePaymentPageState extends State { if (beneficiaryType == BeneficiaryType.MyFamilyFiles) InkWell( onTap: () { - GifLoaderDialogUtils.showMyDialog(context); model.getFamilyFiles().then((value) { - GifLoaderDialogUtils.hideDialog(context); confirmSelectFamilyDialog(model .getAllSharedRecordsByStatusResponse .getAllSharedRecordsByStatusList); - }); + }).showProgressBar( + text: "Loading", + backgroundColor: Colors.blue.withOpacity(0.6)); }, child: Container( padding: EdgeInsets.all(12), @@ -149,16 +140,17 @@ class _AdvancePaymentPageState extends State { if (beneficiaryType == BeneficiaryType.OtherAccount) InkWell( onTap: () { - if (_fileTextController.text.isNotEmpty) { - GifLoaderDialogUtils.showMyDialog(context); + if (_fileTextController.text.isNotEmpty) model .getPatientInfoByPatientID( id: _fileTextController.text) .then((value) { - GifLoaderDialogUtils.hideDialog(context); confirmSelectPatientDialog(model.patientInfoList); - }); - } else + }).showProgressBar( + text: "Loading", + backgroundColor: + Colors.blue.withOpacity(0.6)); + else AppToast.showErrorToast( message: 'Please Enter The File Number'); }, @@ -246,36 +238,13 @@ class _AdvancePaymentPageState extends State { _fileTextController.text.isEmpty || _selectedHospital == null, onTap: () { - var mobileNum; - var patientName; - - if (beneficiaryType == BeneficiaryType.MyFamilyFiles) { - mobileNum = selectedPatientFamily.mobileNumber; - patientName = selectedPatientFamily.patientName; - } - - if (beneficiaryType == BeneficiaryType.MyAccount) { - mobileNum = model.user.mobileNumber; - patientName = model.user.firstName; - } - - if (beneficiaryType == BeneficiaryType.OtherAccount) { - mobileNum = _selectedPatientInfo.mobileNumber; - patientName = _selectedPatientInfo.fullName; - } - advanceModel.fileNumber = _fileTextController.text; advanceModel.hospitalsModel = _selectedHospital; advanceModel.note = _notesTextController.text; advanceModel.email = email ?? model.user.emailAddress; advanceModel.amount = amount; - advanceModel.mobileNumber = mobileNum; - advanceModel.patientName = patientName; - GifLoaderDialogUtils.showMyDialog(context); - model - .getPatientInfoByPatientIDAndMobileNumber(advanceModel) - .then((value) { - GifLoaderDialogUtils.hideDialog(context); + + model.getPatientInfoByPatientIDAndMobileNumber().then((value) { if (model.state != ViewState.Error && model.state != ViewState.ErrorLocal) { Utils.hideKeyboard(context); @@ -299,7 +268,9 @@ class _AdvancePaymentPageState extends State { }, ); } - }); + }).showProgressBar( + text: "Loading", + backgroundColor: Colors.blue.withOpacity(0.6)); }, ), )), @@ -360,22 +331,22 @@ class _AdvancePaymentPageState extends State { void confirmSelectFamilyDialog( List getAllSharedRecordsByStatusList) { - if (getAllSharedRecordsByStatusList.isNotEmpty) - showDialog( - context: context, - child: SelectPatientFamilyDialog( - getAllSharedRecordsByStatusList: getAllSharedRecordsByStatusList, - selectedPatientFamily: selectedPatientFamily, - onValueSelected: (value) { - setState(() { - selectedPatientFamily = value; - _fileTextController.text = - selectedPatientFamily.responseID.toString(); - advanceModel.depositorName = value.patientName; - }); - }, - ), - ); + if(getAllSharedRecordsByStatusList.isNotEmpty) + showDialog( + context: context, + child: SelectPatientFamilyDialog( + getAllSharedRecordsByStatusList: getAllSharedRecordsByStatusList, + selectedPatientFamily: selectedPatientFamily, + onValueSelected: (value) { + setState(() { + selectedPatientFamily = value; + _fileTextController.text = + selectedPatientFamily.patientID.toString(); + advanceModel.depositorName = value.patientName; + }); + }, + ), + ); } String getBeneficiaryType() { diff --git a/lib/pages/medical/balance/confirm_payment_page.dart b/lib/pages/medical/balance/confirm_payment_page.dart index 679a16db..dbc2537f 100644 --- a/lib/pages/medical/balance/confirm_payment_page.dart +++ b/lib/pages/medical/balance/confirm_payment_page.dart @@ -19,6 +19,7 @@ import 'package:diplomaticquarterapp/widgets/in_app_browser/InAppBrowser.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import 'package:smart_progress_bar/smart_progress_bar.dart'; import 'dialogs/ConfirmSMSDialog.dart'; import 'new_text_Field.dart'; @@ -136,11 +137,7 @@ class ConfirmPaymentPage extends StatelessWidget { ), NewTextFields( hintText: TranslationBase.of(context).depositorName, - initialValue: model.user.firstName + - " " + - model.user.middleName + - " " + - model.user.lastName, + initialValue: advanceModel.depositorName, isEnabled: false, ), SizedBox( @@ -164,16 +161,16 @@ class ConfirmPaymentPage extends StatelessWidget { label: TranslationBase.of(context).confirm.toUpperCase(), disabled: model.state == ViewState.Busy, onTap: () { - GifLoaderDialogUtils.showMyDialog(context); model .sendActivationCodeForAdvancePayment( patientID: int.parse(advanceModel.fileNumber), projectID: advanceModel.hospitalsModel.iD) .then((value) { - GifLoaderDialogUtils.hideDialog(context); if (model.state != ViewState.ErrorLocal && model.state != ViewState.Error) showSMSDialog(); - }); + }).showProgressBar( + text: "Loading", + backgroundColor: Colors.blue.withOpacity(0.6)); }, ), ), @@ -220,9 +217,6 @@ class ConfirmPaymentPage extends StatelessWidget { advanceModel.hospitalsModel.iD.toString(), advanceModel.email, paymentMethod, - patientInfoAndMobileNumber.patientType, - advanceModel.patientName, - advanceModel.fileNumber, authenticatedUser, browser); } @@ -282,9 +276,6 @@ class ConfirmPaymentPage extends StatelessWidget { res['Amount'], res['Fort_id'], res['PaymentMethod'], - patientInfoAndMobileNumber.patientType, - advanceModel.patientName, - advanceModel.fileNumber, AppGlobal.context) .then((res) { print(res['OnlineCheckInAppointments'][0]['AdvanceNumber']); diff --git a/lib/pages/medical/balance/dialogs/SelectPatientFamilyDialog.dart b/lib/pages/medical/balance/dialogs/SelectPatientFamilyDialog.dart index 7d69f084..bb9afd6c 100644 --- a/lib/pages/medical/balance/dialogs/SelectPatientFamilyDialog.dart +++ b/lib/pages/medical/balance/dialogs/SelectPatientFamilyDialog.dart @@ -35,11 +35,9 @@ class _SelectPatientFamilyDialogState extends State { (index) => Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - if(widget.getAllSharedRecordsByStatusList[index].status==3) SizedBox( height: 2, ), - if(widget.getAllSharedRecordsByStatusList[index].status==3) Row( children: [ Expanded( @@ -67,8 +65,6 @@ class _SelectPatientFamilyDialogState extends State { ) ], ), - if(widget.getAllSharedRecordsByStatusList[index].status==3) - SizedBox( height: 5.0, ), diff --git a/lib/pages/medical/balance/my_balance_page.dart b/lib/pages/medical/balance/my_balance_page.dart index 2fb8c51c..421e2bed 100644 --- a/lib/pages/medical/balance/my_balance_page.dart +++ b/lib/pages/medical/balance/my_balance_page.dart @@ -1,4 +1,3 @@ -import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/my_balance_view_model.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; @@ -13,20 +12,14 @@ import 'package:hexcolor/hexcolor.dart'; import 'advance_payment_page.dart'; class MyBalancePage extends StatelessWidget { - - List imagesInfo = List(); - @override Widget build(BuildContext context) { - imagesInfo.add(ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/images-info-home/my-balance/en/0.png',imageAr: 'https://hmgwebservices.com/Images/MobileApp/images-info-home/my-balance/ar/0.png')); return BaseView( onModelReady: (model) => model.getPatientAdvanceBalanceAmount(), builder: (_, model, w) => AppScaffold( baseViewModel: model, isShowAppBar: true, appBarTitle: TranslationBase.of(context).myBalances, - imagesInfo: imagesInfo, - description: TranslationBase.of(context).infoMyBalance, body: Container( margin: EdgeInsets.all(12), child: Column( @@ -57,7 +50,7 @@ class MyBalancePage extends StatelessWidget { color: Colors.white, ), Texts( - '${model.totalAdvanceBalanceAmount ?? 0} '+ TranslationBase.of(context).sar, + '${model.totalAdvanceBalanceAmount ?? 0} SAR', color: Colors.white, bold: true, ), @@ -81,13 +74,12 @@ class MyBalancePage extends StatelessWidget { child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - + Texts(model.patientAdvanceBalanceAmountList[index] + .projectDescription), Texts( - '${model.patientAdvanceBalanceAmountList[index].patientAdvanceBalanceAmount} '+TranslationBase.of(context).sar, + '${model.patientAdvanceBalanceAmountList[index].patientAdvanceBalanceAmount} SAR', bold: true, ), - Texts(model.patientAdvanceBalanceAmountList[index] - .projectDescription), ], ), ), diff --git a/lib/pages/medical/doctor/doctor_home_page.dart b/lib/pages/medical/doctor/doctor_home_page.dart index 6a03b58b..9687b931 100644 --- a/lib/pages/medical/doctor/doctor_home_page.dart +++ b/lib/pages/medical/doctor/doctor_home_page.dart @@ -1,5 +1,4 @@ import 'package:diplomaticquarterapp/core/enum/filter_type.dart'; -import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/my_doctor_view_model.dart'; import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/widgets/DoctorView.dart'; @@ -16,11 +15,8 @@ import 'package:flutter/material.dart'; import 'doctor_profile_page.dart'; class DoctorHomePage extends StatelessWidget { - List imagesInfo = List(); @override Widget build(BuildContext context) { - imagesInfo.add(ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/my-doctor/en/0.png',imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/my-doctor/ar/0.png')); - imagesInfo.add(ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/my-doctor/en/1.png',imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/my-doctor/ar/1.png')); return BaseView( onModelReady: (model) => model.getMyDoctor(), builder: (context, MyDoctorViewModel model, widget) => AppScaffold( @@ -29,7 +25,6 @@ class DoctorHomePage extends StatelessWidget { appBarTitle: TranslationBase.of(context).myDoctor, description: TranslationBase.of(context).infoMyDoctor, infoList: TranslationBase.of(context).infoMyDoctorPoints, - imagesInfo: imagesInfo, body: SingleChildScrollView( physics: BouncingScrollPhysics(), child: FractionallySizedBox( diff --git a/lib/pages/medical/eye/ContactLensPage.dart b/lib/pages/medical/eye/ContactLensPage.dart index 373c3c79..26503c89 100644 --- a/lib/pages/medical/eye/ContactLensPage.dart +++ b/lib/pages/medical/eye/ContactLensPage.dart @@ -1,12 +1,10 @@ import 'package:diplomaticquarterapp/core/model/eye/AppoimentAllHistoryResult.dart'; -import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -import 'package:provider/provider.dart'; class ContactLensPage extends StatelessWidget { final ListHISGetContactLensPerscription listHISGetContactLensPerscription; @@ -16,7 +14,6 @@ class ContactLensPage extends StatelessWidget { @override Widget build(BuildContext context) { - ProjectViewModel projectViewModel = Provider.of(context); return AppScaffold( body: SingleChildScrollView( child: Container( @@ -85,7 +82,6 @@ class ContactLensPage extends StatelessWidget { SizedBox( height: 17, ), - if(projectViewModel.havePrivilege(15)) Container( width: double.infinity, child: SecondaryButton( diff --git a/lib/pages/medical/labs/laboratory_result_page.dart b/lib/pages/medical/labs/laboratory_result_page.dart index 9b1f5a26..01cb6725 100644 --- a/lib/pages/medical/labs/laboratory_result_page.dart +++ b/lib/pages/medical/labs/laboratory_result_page.dart @@ -1,7 +1,6 @@ import 'package:diplomaticquarterapp/core/model/labs/patient_lab_orders.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/labs_view_model.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; -import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/data_display/medical/laboratory_result_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/cupertino.dart'; @@ -22,7 +21,7 @@ class LaboratoryResultPage extends StatelessWidget { orderNo: patientLabOrders.orderNo), builder: (_, model, widget) => AppScaffold( isShowAppBar: true, - appBarTitle: TranslationBase.of(context).labResults, + appBarTitle: 'Laboratory result', baseViewModel: model, body: Scaffold( body: ListView.builder( diff --git a/lib/pages/medical/labs/labs_home_page.dart b/lib/pages/medical/labs/labs_home_page.dart index 4b412f5b..68dc180e 100644 --- a/lib/pages/medical/labs/labs_home_page.dart +++ b/lib/pages/medical/labs/labs_home_page.dart @@ -1,5 +1,4 @@ import 'package:diplomaticquarterapp/core/enum/filter_type.dart'; -import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/labs_view_model.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; @@ -14,11 +13,8 @@ import 'package:flutter/material.dart'; import 'laboratory_result_page.dart'; class LabsHomePage extends StatelessWidget { - List imagesInfo =List(); - @override Widget build(BuildContext context) { - imagesInfo.add(ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/my-lab/en/0.png',imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/my-lab/ar/0.png')); return BaseView( onModelReady: (model) => model.getLabs(), builder: (context, LabsViewModel model, widget) => AppScaffold( @@ -26,7 +22,6 @@ class LabsHomePage extends StatelessWidget { isShowAppBar: true, description: TranslationBase.of(context).infoLab, appBarTitle: TranslationBase.of(context).labOrders, - imagesInfo: imagesInfo, body: SingleChildScrollView( physics: BouncingScrollPhysics(), child: FractionallySizedBox( @@ -45,7 +40,7 @@ class LabsHomePage extends StatelessWidget { leading: Radio( value: FilterType.Clinic, groupValue: model.filterType, - activeColor: Theme.of(context).primaryColor, + activeColor: Colors.red[800], onChanged: (FilterType value) { model.setFilterType(value); }, @@ -62,7 +57,7 @@ class LabsHomePage extends StatelessWidget { leading: Radio( value: FilterType.Hospital, groupValue: model.filterType, - activeColor: Theme.of(context).primaryColor, + activeColor: Colors.red[800], onChanged: (FilterType value) => model.setFilterType(value), ), diff --git a/lib/pages/medical/medical_profile_page.dart b/lib/pages/medical/medical_profile_page.dart index d7c479d6..6dabf9d3 100644 --- a/lib/pages/medical/medical_profile_page.dart +++ b/lib/pages/medical/medical_profile_page.dart @@ -17,10 +17,11 @@ import 'package:diplomaticquarterapp/pages/medical/vital_sign/vital_sign_details import 'package:diplomaticquarterapp/pages/medical/reports/report_home_page.dart'; import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; -import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:diplomaticquarterapp/widgets/data_display/medical/medical_profile_item.dart'; import 'package:diplomaticquarterapp/widgets/data_display/medical/time_line_widget.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/dialogs/alert_dialog.dart'; +import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/sliver_app_bar_delegate.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; @@ -29,6 +30,7 @@ import 'package:flutter/material.dart'; import 'package:diplomaticquarterapp/pages/insurance/insurance_card_screen.dart'; import 'package:provider/provider.dart'; import '../../locator.dart'; +import '../../uitl/gif_loader_dialog_utils.dart'; import 'active_medications/ActiveMedicationsPage.dart'; import 'allergies_page.dart'; import 'ask_doctor/ask_doctor_home_page.dart'; @@ -48,15 +50,12 @@ class MedicalProfilePage extends StatefulWidget { class _MedicalProfilePageState extends State { var authProvider = new AuthProvider(); - List medical=List(); - ProjectViewModel projectViewModel; + @override Widget build(BuildContext context) { - projectViewModel = Provider.of(context); + ProjectViewModel projectViewModel = Provider.of(context); var appoCountProvider = Provider.of(context); - - List myMedicalList = Utils.myMedicalList(projectViewModel: projectViewModel,context: context,count: appoCountProvider.count,isLogin: projectViewModel.isLogin); - return BaseView( + return BaseView( onModelReady: (model) => model.getAppointmentHistory(), builder: (_, model, widget) => AppScaffold( isShowDecPage: false, @@ -82,44 +81,403 @@ class _MedicalProfilePageState extends State { ), if (model.isLogin) ListView.builder( - itemBuilder: (context, index) => - TimeLineWidget( + itemBuilder: (context, index) => TimeLineWidget( isUp: index % 2 == 1, - appoitmentAllHistoryResul: model - .appoitmentAllHistoryResultList[index], + appoitmentAllHistoryResul: model.appoitmentAllHistoryResultList[index], ), - itemCount: model - .appoitmentAllHistoryResultList.length, + itemCount: model.appoitmentAllHistoryResultList.length, scrollDirection: Axis.horizontal, reverse: !projectViewModel.isArabic, ), ], ), ), - SizedBox(height: 50,), Padding( padding: EdgeInsets.symmetric(vertical: 5.0), - child: GridView.builder( - shrinkWrap: true, - primary: false, - physics: NeverScrollableScrollPhysics(), - gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( - crossAxisCount: 3, - childAspectRatio: MediaQuery.of(context).size.width / (MediaQuery.of(context).size.height / 2.40), - ), - itemCount: myMedicalList.length, - itemBuilder: (BuildContext context, int index) { - - return myMedicalList[index]; - }, + child: Column( + children: [ + if (model.isLogin) + Container( + width: double.infinity, + height: 55, + ), + Row( + children: [ + Expanded( + flex: 1, + child: InkWell( + onTap: () { + Navigator.push( + context, + FadePage( + page: MyAppointments(), + ), + ); + }, + child: authProvider.isLogin + ? Stack(children: [ + MedicalProfileItem( + title: TranslationBase.of(context).myAppointments, + imagePath: 'my_appointment_icon.png', + subTitle: TranslationBase.of(context).myAppointmentsList, + hasBadge: true, + ), + Positioned( + right: 0.0, + child: Badge( + toAnimate: false, + position: BadgePosition.topEnd(), + shape: BadgeShape.circle, + badgeColor: Color(0xFF40ACC9).withOpacity(1.0), + borderRadius: BorderRadius.circular(8), + badgeContent: Container( + padding: EdgeInsets.all(2.0), + child: Text(appoCountProvider.count.toString(), style: TextStyle(color: Colors.white, fontSize: 16.0)), + ), + ), + ), + ]) + : MedicalProfileItem( + title: TranslationBase.of(context).myAppointments, + imagePath: 'my_appointment_icon.png', + subTitle: TranslationBase.of(context).myAppointmentsList, + hasBadge: true, + ), + ), + ), + Expanded( + flex: 1, + child: InkWell( + onTap: () => Navigator.push(context, FadePage(page: LabsHomePage())), + child: MedicalProfileItem( + title: TranslationBase.of(context).lab, + imagePath: 'lab_result_icon.png', + subTitle: TranslationBase.of(context).labSubtitle, + ), + ), + ), + Expanded( + flex: 1, + child: InkWell( + onTap: () => Navigator.push(context, FadePage(page: RadiologyHomePage())), + child: MedicalProfileItem( + title: TranslationBase.of(context).radiology, + imagePath: 'radiology_icon.png', + subTitle: TranslationBase.of(context).radiologySubtitle, + ), + ), + ), + ], + ), + Row( + children: [ + Expanded( + flex: 1, + child: InkWell( + onTap: () { + Navigator.push( + context, + FadePage( + page: HomePrescriptionsPage(), + ), + ); + }, + child: MedicalProfileItem( + title: TranslationBase.of(context).medicines, + imagePath: 'prescription_icon.png', + subTitle: TranslationBase.of(context).medicinesSubtitle, + ), + ), + ), + Expanded( + flex: 1, + child: InkWell( + onTap: () => Navigator.push( + context, + FadePage( + page: VitalSignDetailsScreen(), + ), + ), + child: MedicalProfileItem( + title: TranslationBase.of(context).vitalSigns, + imagePath: 'vital_signs.png', + subTitle: TranslationBase.of(context).vitalSignsSubtitle, + ), + ), + ), + Expanded( + flex: 1, + child: InkWell( + onTap: () => Navigator.push(context, FadePage(page: ActiveMedicationsPage())), + child: MedicalProfileItem( + title: TranslationBase.of(context).myMedical, + imagePath: 'active_medications.png', + subTitle: TranslationBase.of(context).myMedicalSubtitle, + ), + ), + ), + ], + ), + Row( + children: [ + Expanded( + flex: 1, + child: InkWell( + onTap: () { + Navigator.push( + context, + FadePage( + page: DoctorHomePage(), + ), + ); + }, + child: MedicalProfileItem( + title: TranslationBase.of(context).myDoctor, + imagePath: 'doctor_icon.png', + subTitle: TranslationBase.of(context).myDoctorSubtitle, + ), + ), + ), + Expanded( + flex: 1, + child: InkWell( + onTap: () { + Navigator.push(context, FadePage(page: EyeMeasurementsPage())); + }, + child: MedicalProfileItem( + title: TranslationBase.of(context).eye, + imagePath: 'eye_measurement_icon.png', + subTitle: TranslationBase.of(context).eyeSubtitle, + ), + ), + ), + Expanded( + flex: 1, + child: InkWell( + onTap: () { + Navigator.push(context, FadePage(page: InsuranceCard())); + }, + child: MedicalProfileItem( + title: TranslationBase.of(context).insurance, + imagePath: 'insurance_card_icon.png', + subTitle: TranslationBase.of(context).insuranceSubtitle, + ), + ), + ), + ], + ), + Row(children: [ + Expanded( + flex: 1, + child: InkWell( + onTap: () { + Navigator.push(context, FadePage(page: InsuranceUpdate())); + }, + child: MedicalProfileItem( + title: TranslationBase.of(context).updateInsurance, + imagePath: 'insurance_update_icon_.png', + subTitle: TranslationBase.of(context).updateInsuranceSubtitle, + ), + ), + ), + Expanded( + flex: 1, + child: InkWell( + onTap: () { + Navigator.push(context, FadePage(page: InsuranceApproval())); + }, + child: MedicalProfileItem( + title: TranslationBase.of(context).insuranceApproval, + imagePath: 'insurance_approvals_icon.png', + subTitle: TranslationBase.of(context).insuranceApprovalSubtitle, + ), + ), + ), + Expanded( + flex: 1, + child: InkWell( + onTap: () => Navigator.push(context, FadePage(page: AllergiesPage())), + child: MedicalProfileItem( + title: TranslationBase.of(context).allergies, + imagePath: 'my_allergies_icon.png', + subTitle: TranslationBase.of(context).allergiesSubtitle, + ), + ), + ), + ]), + Row(children: [ + Expanded( + flex: 1, + child: InkWell( + onTap: () { + Navigator.push(context, FadePage(page: MyVaccines())); + }, + child: MedicalProfileItem( + title: TranslationBase.of(context).myVaccines, + imagePath: 'my_vaccines_icon.png', + subTitle: TranslationBase.of(context).myVaccinesSubtitle, + ), + ), + ), + Expanded( + flex: 1, + child: InkWell( + onTap: () { + Navigator.push(context, FadePage(page: HomeReportPage())); + }, + child: MedicalProfileItem( + title: TranslationBase.of(context).medical, + imagePath: 'medical_reports_icon.png', + subTitle: TranslationBase.of(context).medicalSubtitle, + ), + ), + ), + Expanded( + flex: 1, + child: InkWell( + onTap: () { + Navigator.push(context, FadePage(page: MonthlyReportsPage())); + }, + child: MedicalProfileItem( + title: TranslationBase.of(context).monthly, + imagePath: 'monthly_reports_icon.png', + subTitle: TranslationBase.of(context).monthlySubtitle, + ), + ), + ), + ]), + Row(children: [ + Expanded( + flex: 1, + child: InkWell( + onTap: () { + Navigator.push(context, FadePage(page: PatientSickLeavePage())); + }, + child: MedicalProfileItem( + title: TranslationBase.of(context).sick, + imagePath: 'sick_leaves_icons.png', + subTitle: TranslationBase.of(context).sickSubtitle, + ), + ), + ), + Expanded( + flex: 1, + child: InkWell( + onTap: () { + Navigator.push(context, FadePage(page: MyBalancePage())); + }, + child: MedicalProfileItem( + title: TranslationBase.of(context).myBalance, + imagePath: 'check-in.png', + subTitle: TranslationBase.of(context).myBalanceSubtitle, + ), + ), + ), + Expanded( + flex: 1, + child: MedicalProfileItem( + title: TranslationBase.of(context).patientCall, + imagePath: 'medical_history_icon.png', + subTitle: TranslationBase.of(context).patientCallSubtitle, + ), + ), + ]), + Row(children: [ + Expanded( + flex: 1, + child: InkWell( + //TODO + onTap: () { + Navigator.push(context, FadePage(page: SmartWatchInstructions())); + }, + child: MedicalProfileItem( + title: TranslationBase.of(context).smartWatches, + imagePath: 'smartwatch_icon.png', + subTitle: TranslationBase.of(context).smartWatchesSubtitle, + ), + ), + ), + Expanded( + flex: 1, + child: InkWell( + onTap: () { + Navigator.push(context, FadePage(page: MyTrackers())); + }, + child: MedicalProfileItem( + title: TranslationBase.of(context).myTrackers, + imagePath: 'my_tracker_icon.png', + subTitle: TranslationBase.of(context).myTrackersSubtitle, + ), + ), + ), + Expanded( + flex: 1, + child: InkWell( + onTap: () { + Navigator.push(context, FadePage(page: AskDoctorHomPage())); + }, + child: MedicalProfileItem( + title: TranslationBase.of(context).askYour, + imagePath: 'ask_doctor_icon.png', + subTitle: TranslationBase.of(context).askYourSubtitle, + ), + ), + ), + ]), + Row(children: [ + Expanded( + flex: 1, + child: InkWell( + //TODO + onTap: () { + if (authProvider.isLogin) { + String patientID = authProvider.getAuthenticatedUser().patientID.toString(); + GifLoaderDialogUtils.showMyDialog(context); + projectViewModel.platformBridge().connectHMGInternetWifi(patientID).then((value) => {GifLoaderDialogUtils.hideDialog(context)}); + } else { + AlertDialogBox( + context: context, + confirmMessage: "Please login with your account first to use this feature", + okText: "OK", + okFunction: () { + AlertDialogBox.closeAlertDialog(context); + }).showAlertDialog(context); + } + }, + child: MedicalProfileItem( + title: TranslationBase.of(context).internet, + imagePath: 'insurance_card_icon.png', + subTitle: TranslationBase.of(context).internetSubtitle, + ), + ), + ), + Expanded( + flex: 1, + child: InkWell( +// onTap: () { +// Navigator.push( +// context, FadePage(page: InsuranceApproval())); +// }, + child: MedicalProfileItem( + title: TranslationBase.of(context).chatbot, + imagePath: 'insurance_approvals_icon.png', + subTitle: TranslationBase.of(context).chatbotSubtitle, + ), + ), + ), + Expanded( + flex: 1, + child: Container(), + ), + ]), + SizedBox( + height: MediaQuery.of(context).size.height * 0.12, + ) + ], ), ) ], ), - SizedBox( - height: - MediaQuery.of(context).size.height * 0.12, - ), if (model.user != null && model.isLogin) Positioned( top: 185, @@ -131,14 +489,9 @@ class _MedicalProfilePageState extends State { decoration: BoxDecoration( color: Theme.of(context).primaryColor, shape: BoxShape.rectangle, - border: Border.all( - color: Colors.transparent, width: 0.5), - borderRadius: - BorderRadius.all(Radius.circular(9)), - image: DecorationImage( - image: ExactAssetImage( - 'assets/images/bg_graphic.png'), - fit: BoxFit.cover)), + border: Border.all(color: Colors.transparent, width: 0.5), + borderRadius: BorderRadius.all(Radius.circular(9)), + image: DecorationImage(image: ExactAssetImage('assets/images/bg_graphic.png'), fit: BoxFit.cover)), child: Column( crossAxisAlignment: CrossAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.spaceAround, @@ -147,9 +500,7 @@ class _MedicalProfilePageState extends State { height: 8, ), Texts( - model.user.firstName + - " " + - model.user.lastName, + model.user.firstName + " " + model.user.lastName, color: Colors.white, bold: true, ), @@ -181,20 +532,4 @@ class _MedicalProfilePageState extends State { ), ); } - - fullMedicalData(){ - if(projectViewModel.havePrivilege(5)) - {} - } -} - -class Medical{ - - final String title; - final String imagePath; - final String subTitle; - final Widget page; - - Medical({this.title, this.imagePath, this.subTitle, this.page}); - } diff --git a/lib/pages/medical/patient_sick_leave_page.dart b/lib/pages/medical/patient_sick_leave_page.dart index 4d561d60..dcb6eea3 100644 --- a/lib/pages/medical/patient_sick_leave_page.dart +++ b/lib/pages/medical/patient_sick_leave_page.dart @@ -1,4 +1,3 @@ -import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/patient_sick_leave_view_model.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; @@ -13,10 +12,8 @@ class PatientSickLeavePage extends StatefulWidget { } class _PatientSickLeavePageState extends State { - List imagesInfo = List(); @override Widget build(BuildContext context) { - imagesInfo.add(ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/sick-leaves/en/0.png',imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/sick-leaves/ar/0.png')); return BaseView( onModelReady: (model) => model.getSickLeave(), builder: (_, model, w) => AppScaffold( @@ -24,7 +21,6 @@ class _PatientSickLeavePageState extends State { appBarTitle: TranslationBase.of(context).sickLeaves, description: TranslationBase.of(context).infoSickLeaves, infoList: TranslationBase.of(context).infoSickLeavePoints, - imagesInfo: imagesInfo, baseViewModel: model, body: Container( margin: EdgeInsets.all(12), @@ -39,7 +35,6 @@ class _PatientSickLeavePageState extends State { subName: model.sickLeaveList[index].projectName, isInOutPatient: model.sickLeaveList[index].isInOutPatient, - onEmailTap: () { model.sendSickLeaveEmail( message: TranslationBase.of(context).emailSentSuccessfully, diff --git a/lib/pages/medical/prescriptions/prescription_details_page.dart b/lib/pages/medical/prescriptions/prescription_details_page.dart index 024de17c..4416b9fa 100644 --- a/lib/pages/medical/prescriptions/prescription_details_page.dart +++ b/lib/pages/medical/prescriptions/prescription_details_page.dart @@ -136,7 +136,7 @@ class PrescriptionDetailsPage extends StatelessWidget { height: 50, width: double.infinity, child: Center( - child: Text(prescriptionReport.frequencyN?? ''))), + child: Text(prescriptionReport.frequencyN))), Container( color: Colors.white, height: 50, diff --git a/lib/pages/medical/prescriptions/prescription_items_page.dart b/lib/pages/medical/prescriptions/prescription_items_page.dart index f70810dd..d2fdae0b 100644 --- a/lib/pages/medical/prescriptions/prescription_items_page.dart +++ b/lib/pages/medical/prescriptions/prescription_items_page.dart @@ -1,8 +1,6 @@ import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; import 'package:diplomaticquarterapp/core/model/prescriptions/Prescriptions.dart'; -import 'package:diplomaticquarterapp/core/model/prescriptions/prescription_report.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/prescriptions_view_model.dart'; -import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/medical/prescriptions/prescription_details_page.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; @@ -12,7 +10,6 @@ import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -import 'package:provider/provider.dart'; class PrescriptionItemsPage extends StatelessWidget { final Prescriptions prescriptions; @@ -21,127 +18,65 @@ class PrescriptionItemsPage extends StatelessWidget { @override Widget build(BuildContext context) { - ProjectViewModel projectViewModel = Provider.of(context); return BaseView( onModelReady: (model) => - model.getPrescriptionReport(prescriptions: prescriptions), + model.getPrescriptionReport(dischargeNo: prescriptions.dischargeNo,setupID:prescriptions.setupID,clinicID: prescriptions.clinicID,projectId: prescriptions.projectID,episodeID: prescriptions.episodeID), builder: (_, model, widget) => AppScaffold( isShowAppBar: true, appBarTitle: TranslationBase.of(context).prescriptions, baseViewModel: model, body: Container( height: MediaQuery.of(context).size.height * 0.8, - child: Column( - children: [ - - if(!prescriptions.isInOutPatient) - ...List.generate(model.prescriptionReportList.length, (index) => InkWell( - onTap: () => Navigator.push( - context, - FadePage( - page: PrescriptionDetailsPage( - prescriptionReport: model.prescriptionReportList[index], - ), - ), - ), - child: Container( - width: double.infinity, - margin: EdgeInsets.only(top: 10, left: 10, right: 10), - padding: EdgeInsets.all(8.0), - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.all( - Radius.circular(10.0), - ), - border: Border.all(color: Colors.grey[200], width: 0.5), - ), - child: Row( - children: [ - ClipRRect( - borderRadius: BorderRadius.all(Radius.circular(5)), - child: Image.network( - model.prescriptionReportList[index].imageSRCUrl, - fit: BoxFit.cover, - width: 60, - height: 70, - ), - ), - Expanded( - child: Padding( - padding: const EdgeInsets.all(8.0), - child: Center( - child: Texts(model.prescriptionReportList[index].itemDescription.isNotEmpty? - model.prescriptionReportList[index].itemDescription :model - .prescriptionReportList[index].itemDescriptionN)), - )), - Icon( - Icons.arrow_forward_ios, - size: 18, - color: Colors.grey[500], - ) - ], - ), + child: ListView.builder( + itemBuilder: (context, index) => InkWell( + onTap: () => Navigator.push( + context, + FadePage( + page: PrescriptionDetailsPage( + prescriptionReport: model.prescriptionReportList[index], ), - )) - - else - ...List.generate( - model.prescriptionReportEnhList.length, - (index) => InkWell( - onTap: (){ - PrescriptionReport prescriptionReport = PrescriptionReport( - imageSRCUrl: model.prescriptionReportEnhList[index].imageSRCUrl, - itemDescription: model.prescriptionReportEnhList[index].itemDescription, - itemDescriptionN: model.prescriptionReportEnhList[index].itemDescription, - routeN: model.prescriptionReportEnhList[index].route, - frequency: model.prescriptionReportEnhList[index].frequency, - frequencyN: model.prescriptionReportEnhList[index].frequency, - doseDailyQuantity: model.prescriptionReportEnhList[index].doseDailyQuantity, - days: model.prescriptionReportEnhList[index].days, - itemID: model.prescriptionReportEnhList[index].itemID, - remarks: model.prescriptionReportEnhList[index].remarks - ); - Navigator.push( - context, - FadePage( - page: PrescriptionDetailsPage( - prescriptionReport:prescriptionReport, - ), - ), - ); - }, - child: Container( - margin: EdgeInsets.all(8.0), + ), + ), + child: Container( + width: double.infinity, + margin: EdgeInsets.only(top: 10, left: 10, right: 10), + padding: EdgeInsets.all(8.0), + decoration: BoxDecoration( color: Colors.white, - child: Row( - children: [ - ClipRRect( - borderRadius: BorderRadius.all(Radius.circular(5)), - child: Image.network( - model.prescriptionReportEnhList[index].imageSRCUrl, - fit: BoxFit.cover, - width: 60, - height: 70, - ), - ), - Expanded( - child: Padding( - padding: const EdgeInsets.all(8.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Texts(model.prescriptionReportEnhList[index] - .itemDescription), - ], - ), - ), - ), - ], + borderRadius: BorderRadius.all( + Radius.circular(10.0), ), + border: Border.all(color: Colors.grey[200], width: 0.5), ), + child: Row( + children: [ + ClipRRect( + borderRadius: BorderRadius.all(Radius.circular(5)), + child: Image.network( + model.prescriptionReportList[index].imageSRCUrl, + fit: BoxFit.cover, + width: 60, + height: 70, + ), ), - ) - ], + Expanded( + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Center( + child: Texts(model.prescriptionReportList[index].itemDescription.isNotEmpty? + model.prescriptionReportList[index].itemDescription :model + .prescriptionReportList[index].itemDescriptionN)), + )), + Icon( + Icons.arrow_forward_ios, + size: 18, + color: Colors.grey[500], + ) + ], + ), + ), + ), + itemCount: model.prescriptionReportList.length, ), ), bottomSheet: Container( @@ -151,7 +86,6 @@ class PrescriptionItemsPage extends StatelessWidget { child: Column( children: [ Divider(), - if(projectViewModel.havePrivilege(13)) Container( width: MediaQuery.of(context).size.width * 0.8, child: Button( diff --git a/lib/pages/medical/prescriptions/prescriptions_home_page.dart b/lib/pages/medical/prescriptions/prescriptions_home_page.dart index 94484340..dad6fd17 100644 --- a/lib/pages/medical/prescriptions/prescriptions_home_page.dart +++ b/lib/pages/medical/prescriptions/prescriptions_home_page.dart @@ -1,6 +1,5 @@ import 'dart:ui'; -import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/prescriptions_view_model.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/medical/prescriptions/prescriptions_history_page.dart'; @@ -19,14 +18,11 @@ class HomePrescriptionsPage extends StatefulWidget { class _HomePrescriptionsPageState extends State with SingleTickerProviderStateMixin { TabController _tabController; - List imagesInfo = List(); @override void initState() { super.initState(); _tabController = TabController(length: 2, vsync: this); - imagesInfo.add(ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/my-prescriptions/en/0.png',imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/my-prescriptions/ar/0.png')); - imagesInfo.add(ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/my-prescriptions/en/1.png',imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/my-prescriptions/ar/1.png')); } @override @@ -44,7 +40,6 @@ class _HomePrescriptionsPageState extends State appBarTitle: TranslationBase.of(context).prescriptions, description: TranslationBase.of(context).infoPrescriptions, infoList: TranslationBase.of(context).infoPrescriptionsPoints, - imagesInfo: imagesInfo, body: Scaffold( extendBodyBehindAppBar: true, appBar: PreferredSize( diff --git a/lib/pages/medical/radiology/radiology_details_page.dart b/lib/pages/medical/radiology/radiology_details_page.dart index f7648aad..cb98fb81 100644 --- a/lib/pages/medical/radiology/radiology_details_page.dart +++ b/lib/pages/medical/radiology/radiology_details_page.dart @@ -1,14 +1,11 @@ import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; import 'package:diplomaticquarterapp/core/model/radiology/final_radiology.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/radiology_view_model.dart'; -import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; -import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -import 'package:provider/provider.dart'; import 'package:url_launcher/url_launcher.dart'; class RadiologyDetailsPage extends StatelessWidget { @@ -18,62 +15,53 @@ class RadiologyDetailsPage extends StatelessWidget { @override Widget build(BuildContext context) { - ProjectViewModel projectViewModel = Provider.of(context); return BaseView( onModelReady: (model) => model.getRadImageURL( projectId: finalRadiology.projectID, lineItem: finalRadiology.invoiceLineItemNo, invoiceNo: finalRadiology.invoiceNo), builder: (_, model, widget) => AppScaffold( - appBarTitle: TranslationBase.of(context).report, + appBarTitle: 'Radiology Report', isShowAppBar: true, baseViewModel: model, body: SingleChildScrollView( child: Column( crossAxisAlignment: CrossAxisAlignment.center, children: [ - Text( - '${finalRadiology.reportData}', - textAlign: TextAlign.center, - ), + Text('${finalRadiology.reportData}',textAlign: TextAlign.center,), ], ), ), - bottomSheet: (projectViewModel.havePrivilege(9) || - projectViewModel.havePrivilege(8)) - ? Container( - width: double.infinity, - height: MediaQuery.of(context).size.height * 0.2, - color: Colors.grey[100], - child: Column( - children: [ - Divider(), - if (projectViewModel.havePrivilege(9)) - Container( - width: MediaQuery.of(context).size.width * 0.8, - child: Button( - onTap: () { - launch(model.radImageURL); - }, - label: TranslationBase.of(context).openRad, - backgroundColor: Colors.grey[800], - ), - ), - if (projectViewModel.havePrivilege(8)) - Container( - width: MediaQuery.of(context).size.width * 0.8, - child: Button( - onTap: () => model.sendRadReportEmail( - finalRadiology: finalRadiology), - label: TranslationBase.of(context).sendCopyRad, - loading: model.state == ViewState.BusyLocal, - backgroundColor: Theme.of(context).primaryColor, - ), - ) - ], + bottomSheet: Container( + width: double.infinity, + height: MediaQuery.of(context).size.height * 0.2, + color: Colors.grey[100], + child: Column( + children: [ + Divider(), + Container( + width: MediaQuery.of(context).size.width * 0.8, + child: Button( + onTap: () { + launch(model.radImageURL); + }, + label: 'Open Radio Image', + backgroundColor: Colors.grey[800], + ), + ), + Container( + width: MediaQuery.of(context).size.width * 0.8, + child: Button( + onTap: () => model.sendRadReportEmail( + finalRadiology: finalRadiology), + label: 'Send Copy', + loading: model.state == ViewState.BusyLocal, + backgroundColor: Colors.red[800], ), ) - : Container()), + ], + ), + )), ); } } diff --git a/lib/pages/medical/radiology/radiology_home_page.dart b/lib/pages/medical/radiology/radiology_home_page.dart index ebc3527d..995ac485 100644 --- a/lib/pages/medical/radiology/radiology_home_page.dart +++ b/lib/pages/medical/radiology/radiology_home_page.dart @@ -1,5 +1,4 @@ import 'package:diplomaticquarterapp/core/enum/filter_type.dart'; -import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/radiology_view_model.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/medical/radiology/radiology_details_page.dart'; @@ -13,11 +12,8 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; class RadiologyHomePage extends StatelessWidget { - List imagesInfo = List(); @override Widget build(BuildContext context) { - imagesInfo.add(ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/my-radiology/en/0.png',imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/my-radiology/ar/0.png')); - imagesInfo.add(ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/my-radiology/en/1.png',imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/my-radiology/ar/1.png')); return BaseView( onModelReady: (model) => model.getPatientRadOrders(), builder: (_, model, widget) => AppScaffold( @@ -25,7 +21,6 @@ class RadiologyHomePage extends StatelessWidget { appBarTitle: TranslationBase.of(context).radiology, baseViewModel: model, description: TranslationBase.of(context).infoRadiology, - imagesInfo: imagesInfo, body: FractionallySizedBox( widthFactor: 1.0, child: ListView( @@ -43,7 +38,7 @@ class RadiologyHomePage extends StatelessWidget { leading: Radio( value: FilterType.Clinic, groupValue: model.filterType, - activeColor: Theme.of(context).primaryColor, + activeColor: Colors.red[800], onChanged: (FilterType value) { model.setFilterType(value); }, @@ -61,7 +56,7 @@ class RadiologyHomePage extends StatelessWidget { leading: Radio( value: FilterType.Hospital, groupValue: model.filterType, - activeColor: Theme.of(context).primaryColor, + activeColor: Colors.red[800], onChanged: (FilterType value) { model.setFilterType(value); }, @@ -90,7 +85,6 @@ class RadiologyHomePage extends StatelessWidget { ), ), child: DoctorCard( - isInOutPatient: radiology.isInOutPatient, name: radiology.doctorName, profileUrl: radiology.doctorImageURL, subName: '${radiology.projectName} \n${TranslationBase.of(context).billNo} ${radiology.invoiceNo}', diff --git a/lib/pages/medical/reports/report_home_page.dart b/lib/pages/medical/reports/report_home_page.dart index 42f207da..5c6812e2 100644 --- a/lib/pages/medical/reports/report_home_page.dart +++ b/lib/pages/medical/reports/report_home_page.dart @@ -1,8 +1,6 @@ import 'dart:ui'; -import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/reports_view_model.dart'; -import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/medical/reports/report_list_widget.dart'; import 'package:diplomaticquarterapp/pages/medical/reports/reports_page.dart'; @@ -13,7 +11,6 @@ import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -import 'package:provider/provider.dart'; class HomeReportPage extends StatefulWidget { @override @@ -23,7 +20,6 @@ class HomeReportPage extends StatefulWidget { class _HomeReportPageState extends State with SingleTickerProviderStateMixin { TabController _tabController; - List imagesInfo = List(); @override void initState() { @@ -39,10 +35,6 @@ class _HomeReportPageState extends State @override Widget build(BuildContext context) { - ProjectViewModel projectViewModel = Provider.of(context); - imagesInfo.add(ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/medical-reorts/en/0.png',imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/medical-reorts/ar/0.png')); - imagesInfo.add(ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/medical-reorts/en/1.png',imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/medical-reorts/ar/1.png')); - imagesInfo.add(ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/medical-reorts/en/2.png',imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/medical-reorts/ar/2.png')); return BaseView( onModelReady: (model) => model.getReports(), //model.getPrescriptions(), builder: (_, model, widget) => AppScaffold( @@ -50,7 +42,8 @@ class _HomeReportPageState extends State appBarTitle: TranslationBase.of(context).monthReport, description: TranslationBase.of(context).infoMonthReport, baseViewModel: model, - imagesInfo: imagesInfo, + //bottomSheet: Container(), + body: Scaffold( extendBodyBehindAppBar: true, appBar: PreferredSize( @@ -89,32 +82,32 @@ class _HomeReportPageState extends State controller: _tabController, indicatorWeight: 5.0, indicatorSize: TabBarIndicatorSize.label, - indicatorColor: Theme.of(context).primaryColor, + indicatorColor: Colors.red[800], labelColor: Theme.of(context).primaryColor, unselectedLabelColor: Colors.grey[800], tabs: [ Container( width: MediaQuery.of(context).size.width * 0.22, child: Center( - child: Texts(TranslationBase.of(context).requested), + child: Texts('Requested'), ), ), Container( width: MediaQuery.of(context).size.width * 0.22, child: Center( - child: Texts(TranslationBase.of(context).ready), + child: Texts('Ready'), ), ), Container( width: MediaQuery.of(context).size.width * 0.22, child: Center( - child: Texts(TranslationBase.of(context).completed), + child: Texts('Completed'), ), ), Container( width: MediaQuery.of(context).size.width * 0.22, child: Center( - child: Texts(TranslationBase.of(context).cancelled), + child: Texts('Cancelled'), ), ), ], @@ -150,12 +143,12 @@ class _HomeReportPageState extends State SizedBox(height: 110,) ], ), - bottomSheet: projectViewModel.havePrivilege(21) ?Container( + bottomSheet: Container( width: double.infinity, height: 90, margin: EdgeInsets.all(8.0), child: Button( - label: TranslationBase.of(context).requestMedicalReport, + label: 'Resend order & deliver', backgroundColor: Colors.grey[800], onTap: () => Navigator.push( context, @@ -164,7 +157,7 @@ class _HomeReportPageState extends State ), ), ), - ):null, + ), ), ), ); diff --git a/lib/pages/medical/reports/reports_page.dart b/lib/pages/medical/reports/reports_page.dart index 5b64bc4e..be4195d9 100644 --- a/lib/pages/medical/reports/reports_page.dart +++ b/lib/pages/medical/reports/reports_page.dart @@ -12,8 +12,7 @@ import 'package:flutter/material.dart'; class MedicalReports extends StatelessWidget { @override Widget build(BuildContext context) { - void confirmBox( - AppointmentHistory model, ReportsViewModel reportsViewModel) { + void confirmBox(AppointmentHistory model, ReportsViewModel reportsViewModel) { showDialog( context: context, child: ConfirmDialog( @@ -69,13 +68,8 @@ class MedicalReports extends StatelessWidget { ), Texts(model.appointHistoryList[index].projectName), Texts(model.appointHistoryList[index].clinicName), - Texts(DateUtil.getMonthDayYearDateFormatted( - model.appointHistoryList[index].appointmentDate)), - StarRating( - totalAverage: model - .appointHistoryList[index].actualDoctorRate - .toDouble(), - forceStars: true), + Texts(DateUtil.getMonthDayYearDateFormatted(model.appointHistoryList[index].appointmentDate)), + StarRating(totalAverage: model.appointHistoryList[index].actualDoctorRate.toDouble(), forceStars: true), SizedBox( height: 12, ), @@ -86,15 +80,13 @@ class MedicalReports extends StatelessWidget { Expanded( flex: 1, child: InkWell( - onTap: () => - confirmBox(model.appointHistoryList[index], model), + onTap: () => confirmBox(model.appointHistoryList[index], model), child: Container( width: 80, height: 50, decoration: BoxDecoration( color: Colors.black54, - border: - Border.all(color: Colors.transparent, width: 2), + border: Border.all(color: Colors.transparent, width: 2), shape: BoxShape.rectangle, borderRadius: BorderRadius.all( Radius.circular(8.0), diff --git a/lib/pages/medical/smart_watch_health_data/health_data_list.dart b/lib/pages/medical/smart_watch_health_data/health_data_list.dart index 763948c0..2f9a3e60 100644 --- a/lib/pages/medical/smart_watch_health_data/health_data_list.dart +++ b/lib/pages/medical/smart_watch_health_data/health_data_list.dart @@ -1,6 +1,5 @@ import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; -import 'package:fit_kit/fit_kit.dart'; import 'package:flutter/material.dart'; class HealthDataList extends StatefulWidget { @@ -9,19 +8,6 @@ class HealthDataList extends StatefulWidget { } class _HealthDataListState extends State { - List dataTypes = List(); - - @override - void initState() { - dataTypes.add(DataType.DISTANCE); - dataTypes.add(DataType.STEP_COUNT); - dataTypes.add(DataType.HEART_RATE); - dataTypes.add(DataType.SLEEP); - dataTypes.add(DataType.ENERGY); - - super.initState(); - } - @override Widget build(BuildContext context) { return AppScaffold( @@ -146,7 +132,7 @@ class _HealthDataListState extends State { width: MediaQuery.of(context).size.width * 0.8, child: Button( onTap: () { - readAll(); +// launch(model.radImageURL); }, label: 'Sync Health Data', backgroundColor: Colors.grey[800], @@ -156,26 +142,4 @@ class _HealthDataListState extends State { ), )); } - - void readLast() async { - final result = await FitKit.readLast(DataType.DISTANCE); - print(result); - print(result); - } - - void readAll() async { - if (await FitKit.requestPermissions(dataTypes)) { - for (DataType type in dataTypes) { - final results = await FitKit.read( - type, - dateFrom: DateTime.now().subtract(Duration(days: 15)), - dateTo: DateTime.now(), - limit: 100, - ); - print(results); - print(results.length); - } - readLast(); - } - } } diff --git a/lib/pages/medical/smart_watch_health_data/smart_watch_instructions.dart b/lib/pages/medical/smart_watch_health_data/smart_watch_instructions.dart index 1a5270f8..eb0c1675 100644 --- a/lib/pages/medical/smart_watch_health_data/smart_watch_instructions.dart +++ b/lib/pages/medical/smart_watch_health_data/smart_watch_instructions.dart @@ -3,9 +3,9 @@ import 'dart:io'; import 'package:carousel_slider/carousel_slider.dart'; import 'package:diplomaticquarterapp/pages/medical/smart_watch_health_data/health_data_list.dart'; import 'package:diplomaticquarterapp/services/smartwatch_integration/SmartWatchIntegrationService.dart'; -import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/material.dart'; +import 'package:smart_progress_bar/smart_progress_bar.dart'; import 'package:url_launcher/url_launcher.dart'; class SmartWatchInstructions extends StatefulWidget { @@ -31,7 +31,6 @@ class _SmartWatchInstructionsState extends State { return AppScaffold( appBarTitle: "Sync Health Data", isShowAppBar: true, - isShowDecPage: false, body: Container( child: Platform.isIOS ? _getAppleWatchInstructions() @@ -89,8 +88,6 @@ class _SmartWatchInstructionsState extends State { width: 70.0, height: 70.0), Container( - margin: EdgeInsets.only(left: 5.0), - width: 105.0, child: Text( "Apple Watch Series 1", style: TextStyle( @@ -111,12 +108,8 @@ class _SmartWatchInstructionsState extends State { width: 70.0, height: 70.0), Container( - margin: EdgeInsets.only(left: 5.0), - width: 105.0, child: Text( "Apple Watch Series 2", - overflow: TextOverflow.clip, - softWrap: true, style: TextStyle( fontSize: 12.0)), ) @@ -142,8 +135,6 @@ class _SmartWatchInstructionsState extends State { width: 70.0, height: 70.0), Container( - margin: EdgeInsets.only(left: 5.0), - width: 105.0, child: Text( "Apple Watch Series 3", style: TextStyle( @@ -164,8 +155,6 @@ class _SmartWatchInstructionsState extends State { width: 70.0, height: 70.0), Container( - margin: EdgeInsets.only(left: 5.0), - width: 105.0, child: Text( "Apple Watch Series 4", style: TextStyle( @@ -193,8 +182,6 @@ class _SmartWatchInstructionsState extends State { width: 70.0, height: 70.0), Container( - margin: EdgeInsets.only(left: 5.0), - width: 105.0, child: Text( "Apple Watch Series 5", style: TextStyle( @@ -215,8 +202,6 @@ class _SmartWatchInstructionsState extends State { width: 70.0, height: 70.0), Container( - margin: EdgeInsets.only(left: 5.0), - width: 105.0, child: Text( "Apple Watch Series 6", style: TextStyle( @@ -442,7 +427,7 @@ class _SmartWatchInstructionsState extends State { width: MediaQuery.of(context).size.width, margin: EdgeInsets.symmetric(horizontal: 5.0), child: Card( - margin: EdgeInsets.fromLTRB(8.0, 16.0, 8.0, 0.0), + margin: EdgeInsets.fromLTRB(8.0, 16.0, 8.0, 8.0), color: Colors.white.withOpacity(1.0), shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(10), @@ -672,7 +657,7 @@ class _SmartWatchInstructionsState extends State { style: TextStyle(fontSize: 17.0)), ), Container( - margin: EdgeInsets.all(12.0), + margin: EdgeInsets.all(15.0), child: ButtonTheme( shape: RoundedRectangleBorder( borderRadius: @@ -811,9 +796,7 @@ class _SmartWatchInstructionsState extends State { getLastPatientRecord(BuildContext context) { SmartWatchIntegrationService service = new SmartWatchIntegrationService(); - GifLoaderDialogUtils.showMyDialog(context); service.getLastPatientRecord(context).then((res) { - GifLoaderDialogUtils.hideDialog(context); if (res['MessageStatus'] == 1) { print(res['Med_GetPatientLastRecordList']); setState(() { @@ -824,9 +807,9 @@ class _SmartWatchInstructionsState extends State { }); } else {} }).catchError((err) { - GifLoaderDialogUtils.hideDialog(context); print(err); - }); + }).showProgressBar( + text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); } _openHealthDataList() { diff --git a/lib/pages/medical/vital_sign/vital_sign_details_screen.dart b/lib/pages/medical/vital_sign/vital_sign_details_screen.dart index c4273a09..667620a2 100644 --- a/lib/pages/medical/vital_sign/vital_sign_details_screen.dart +++ b/lib/pages/medical/vital_sign/vital_sign_details_screen.dart @@ -1,5 +1,4 @@ import 'package:diplomaticquarterapp/core/enum/patient_lookup.dart'; -import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/vital_sign_view_model.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/medical/vital_sign/vital_sign_item.dart'; @@ -18,13 +17,9 @@ class VitalSignDetailsScreen extends StatelessWidget { int appointmentNo; int projectID; VitalSignDetailsScreen({this.appointmentNo, this.projectID}); - List imagesInfo = List(); - @override Widget build(BuildContext context) { - imagesInfo.add(ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/my-vital-signs/en/0.png',imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/my-vital-signs/ar/0.png')); - imagesInfo.add(ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/my-vital-signs/en/1.png',imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/my-vital-signs/ar/1.png')); return BaseView( onModelReady: appointmentNo != null && projectID != null ? (model) => model.getPatientRadOrders( @@ -34,8 +29,6 @@ class VitalSignDetailsScreen extends StatelessWidget { isShowAppBar: true, appBarTitle: TranslationBase.of(context).vitalSigns, baseViewModel: mode, - description: TranslationBase.of(context).infoSigns, - imagesInfo: imagesInfo, body: mode.vitalSignResModelList.length > 0 ? Container( child: ListView( diff --git a/lib/pages/medical/vital_sign/vital_sign_item.dart b/lib/pages/medical/vital_sign/vital_sign_item.dart index 5304bb9b..fb44772d 100644 --- a/lib/pages/medical/vital_sign/vital_sign_item.dart +++ b/lib/pages/medical/vital_sign/vital_sign_item.dart @@ -46,7 +46,7 @@ class VitalSignItem extends StatelessWidget { des, style: TextStyle( fontSize: 1.7 * SizeConfig.textMultiplier, - color: Theme.of(context).textTheme.headline1.color, + color: HexColor('#B8382C'), fontWeight: FontWeight.bold, ), ), @@ -76,9 +76,9 @@ class VitalSignItem extends StatelessWidget { text: TextSpan( style: TextStyle(color: Colors.black), children: [ - TextSpan(text: lastVal + " "), + TextSpan(text: lastVal), TextSpan( - text: " " + unit, + text: unit, style: TextStyle( color: HexColor('#B8382C'), ), diff --git a/lib/pages/paymentService/payment_service.dart b/lib/pages/paymentService/payment_service.dart index fb356dca..c31981f7 100644 --- a/lib/pages/paymentService/payment_service.dart +++ b/lib/pages/paymentService/payment_service.dart @@ -26,7 +26,6 @@ class PaymentService extends StatelessWidget { children: [ Row( children: [ - if(projectViewModel.havePrivilege(33)) Expanded( child: InkWell( onTap: () => Navigator.push( @@ -62,45 +61,6 @@ class PaymentService extends StatelessWidget { ), ), ), - if(!projectViewModel.havePrivilege(33)) - Expanded( - child: InkWell( - onTap: () => Navigator.push( - context, FadePage(page: MyBalancePage())), - child: Container( - margin: EdgeInsets.all(5.0), - padding: EdgeInsets.all(9), - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.circular(8.0), - shape: BoxShape.rectangle), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Texts( - 'My Balances', - color: HexColor('#B61422'), - bold: true, - ), - Texts( - TranslationBase.of(context).payment, - fontSize: 14, - fontWeight: FontWeight.normal, - ), - Align( - alignment: projectViewModel.isArabic - ? Alignment.centerRight - : Alignment.centerLeft, - child: Image.asset( - 'assets/images/al-habib_online_payment_service_icon.png', - height: 55, - ), - ), - ], - ), - ), - ), - ), Expanded( child: Container( margin: EdgeInsets.all(5.0), @@ -137,7 +97,6 @@ class PaymentService extends StatelessWidget { ) ], ), - if(!projectViewModel.havePrivilege(33)) Row( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -156,12 +115,12 @@ class PaymentService extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ Texts( - TranslationBase.of(context).hmg, + 'My Balances', color: HexColor('#B61422'), bold: true, ), Texts( - TranslationBase.of(context).wallet, + TranslationBase.of(context).payment, fontSize: 14, fontWeight: FontWeight.normal, ), diff --git a/lib/pages/pharmacies/medicine_search_screen.dart b/lib/pages/pharmacies/medicine_search_screen.dart index 62cacb7f..a41fde16 100644 --- a/lib/pages/pharmacies/medicine_search_screen.dart +++ b/lib/pages/pharmacies/medicine_search_screen.dart @@ -1,23 +1,23 @@ import 'package:diplomaticquarterapp/config/size_config.dart'; import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; -import 'package:diplomaticquarterapp/core/viewModels/pharmacies_view_model.dart'; -import 'package:diplomaticquarterapp/pages/pharmacies/pharmacies_list_screen.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:diplomaticquarterapp/core/model/pharmacies/pharmacies_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/pharmacies_view_model.dart'; +import '../base/base_view.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; -import 'package:diplomaticquarterapp/widgets/input/text_field.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:diplomaticquarterapp/widgets/input/text_field.dart'; import 'package:diplomaticquarterapp/widgets/pharmacy/drug_item.dart'; -import 'package:flutter/cupertino.dart'; -import 'package:flutter/material.dart'; - -import '../base/base_view.dart'; +import 'package:diplomaticquarterapp/core/service/pharmacies_service.dart'; +import 'package:diplomaticquarterapp/pages/pharmacies/pharmacies_list_screen.dart'; class MedicineSearch extends StatelessWidget { final textController = TextEditingController(); final _formKey = GlobalKey(); - @override Widget build(BuildContext context) { return BaseView( @@ -51,13 +51,11 @@ class MedicineSearch extends StatelessWidget { controller: textController, validator: (value) { if (value.isEmpty) { - return TranslationBase.of(context) - .pleaseEnterMedicineName; - } else if (value.length < 4) { - return TranslationBase.of(context) - .searchItemError; - } else - return null; + return TranslationBase.of(context).pleaseEnterMedicineName; + }else if( value.length <4){ + return TranslationBase.of(context).searchItemError; + }else + return null; }, ), ), @@ -83,24 +81,21 @@ class MedicineSearch extends StatelessWidget { ], ), ), - if (model.pharmacy.isNotEmpty) - Container( - margin: EdgeInsets.only( - left: SizeConfig.heightMultiplier * 2), - child: Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Container( - margin: EdgeInsets.fromLTRB(20.0, 10.0, 20.0, 10.0), - child: Texts( - TranslationBase.of(context).youCanFind + - '${model.pharmacy == null ? '0' : model.pharmacy.length.toString()}' + - TranslationBase.of(context).itemInSearch, - ), - ), - ], - ), + if(model.pharmacy.isNotEmpty) + Container( + margin: EdgeInsets.only( + left: SizeConfig.heightMultiplier * 2), + child: Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts( + TranslationBase.of(context).youCanFind+ + '${model.pharmacy == null ? '0' : model.pharmacy.length.toString()}'+ + TranslationBase.of(context).itemInSearch, + ), + ], ), + ), if (model.state == ViewState.ErrorLocal) Container( child: Texts(model.error), diff --git a/lib/pages/pharmacies/pharmacies_list_screen.dart b/lib/pages/pharmacies/pharmacies_list_screen.dart index dc69a3e2..040e5bee 100644 --- a/lib/pages/pharmacies/pharmacies_list_screen.dart +++ b/lib/pages/pharmacies/pharmacies_list_screen.dart @@ -1,18 +1,19 @@ -import 'dart:convert'; -import 'dart:typed_data'; - -import 'package:diplomaticquarterapp/config/size_config.dart'; -import 'package:diplomaticquarterapp/core/viewModels/pharmacies_view_model.dart'; -import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/core/model/pharmacies/pharmacies_model.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; -import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; -import 'package:diplomaticquarterapp/widgets/others/rounded_container.dart'; -import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import 'package:diplomaticquarterapp/config/size_config.dart'; +import 'package:flutter/cupertino.dart'; import 'package:maps_launcher/maps_launcher.dart'; -import 'package:url_launcher/url_launcher.dart'; - import '../base/base_view.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:diplomaticquarterapp/widgets/progress_indicator/app_circular_progress_Indeicator.dart'; +import 'package:diplomaticquarterapp/widgets/others/rounded_container.dart'; +import 'dart:typed_data'; +import 'dart:convert'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/core/viewModels/pharmacies_view_model.dart'; +import 'package:map_launcher/map_launcher.dart'; +import 'package:url_launcher/url_launcher.dart'; class PharmaciesList extends StatelessWidget { final int medicineID; @@ -29,7 +30,6 @@ class PharmaciesList extends StatelessWidget { AppScaffold( appBarTitle: TranslationBase.of(context).pharmaciesList, baseViewModel: model, - isShowAppBar: true, body: Container( height: SizeConfig.screenHeight, child: ListView( diff --git a/lib/pages/rateAppointment/rate_appointment_doctor.dart b/lib/pages/rateAppointment/rate_appointment_doctor.dart index b79911ef..7a128b10 100644 --- a/lib/pages/rateAppointment/rate_appointment_doctor.dart +++ b/lib/pages/rateAppointment/rate_appointment_doctor.dart @@ -4,7 +4,6 @@ import 'package:diplomaticquarterapp/core/viewModels/appointment_rate_view_model import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/landing/landing_page.dart'; import 'package:diplomaticquarterapp/pages/rateAppointment/rate_appointment_clinic.dart'; -import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/avatar/large_avatar.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; @@ -205,7 +204,7 @@ class _RateAppointmentDoctorState extends State { ); } }, - label: TranslationBase.of(context).next, + label: "Next", disabled: model.state == ViewState.BusyLocal, loading: model.state == ViewState.BusyLocal, textColor: Theme.of(context).backgroundColor), diff --git a/lib/pages/settings/general_setting.dart b/lib/pages/settings/general_setting.dart index 86167b7d..7085150a 100644 --- a/lib/pages/settings/general_setting.dart +++ b/lib/pages/settings/general_setting.dart @@ -19,14 +19,14 @@ class GeneralSettings extends StatefulWidget { class _GeneralSettings extends State with TickerProviderStateMixin { var themeNotifier; - var mediaQueryData; int blindValue = 0; - bool vibration =false; - bool accsibility =false; - bool camera =false; - bool location =false; + bool vibration =false; + bool accsibility =false; + bool camera =false; + bool location =false; var sharedPref = new AppSharedPreferences(); var permission = new PermissionService(); + var mediaQueryData; @override void initState() { getValues(); @@ -81,104 +81,104 @@ class _GeneralSettings extends State setState(() { accsibility = value; }); - permission.openSettings(); + //setAccisibility(value); }, activeTrackColor: Colors.lightGreenAccent, activeColor: Colors.green, ) ], )), - // Container( - // padding: EdgeInsets.all(10), - // child: AppText( - // TranslationBase.of(context).blindMode, - // color: Colors.black, - // fontWeight: FontWeight.bold, - // ), - // ), - // new Container( - // color: Colors.white, - // padding: EdgeInsets.all(8.0), - // child: new Column( - // mainAxisAlignment: MainAxisAlignment.center, - // children: [ - // new Column( - // mainAxisAlignment: MainAxisAlignment.center, - // children: [ - // Row( - // mainAxisAlignment: MainAxisAlignment.spaceBetween, - // children: [ - // new Text( - // TranslationBase.of(context).offTheme, - // style: new TextStyle(fontSize: 16.0), - // ), - // Radio( - // value: 0, - // groupValue: blindValue, - // onChanged: (value) { - // setState(() => {this.blindValue = value}); - // setTheme(value); - // }, - // ), - // ], - // ), - // Row( - // mainAxisAlignment: MainAxisAlignment.spaceBetween, - // children: [ - // new Text( - // TranslationBase.of(context).invertTheme, - // style: new TextStyle( - // fontSize: 16.0, - // ), - // ), - // new Radio( - // value: 1, - // groupValue: blindValue, - // onChanged: (value) { - // setState(() => {this.blindValue = value}); - // setTheme(value); - // }, - // ) - // ], - // ), - // Row( - // mainAxisAlignment: MainAxisAlignment.spaceBetween, - // children: [ - // new Text( - // TranslationBase.of(context).dimTheme, - // style: new TextStyle(fontSize: 16.0), - // ), - // new Radio( - // value: 2, - // groupValue: blindValue, - // onChanged: (value) { - // setState(() => {this.blindValue = value}); - // setTheme(value); - // }, - // ), - // ], - // ), - // Row( - // mainAxisAlignment: MainAxisAlignment.spaceBetween, - // children: [ - // new Text( - // TranslationBase.of(context).bwTheme, - // style: new TextStyle(fontSize: 16.0), - // ), - // new Radio( - // value: 3, - // groupValue: blindValue, - // onChanged: (value) { - // setState(() => {this.blindValue = value}); - // - // setTheme(value); - // }, - // ), - // ], - // ), - // ], - // ) - // ])), + Container( + padding: EdgeInsets.all(10), + child: AppText( + TranslationBase.of(context).blindMode, + color: Colors.black, + fontWeight: FontWeight.bold, + ), + ), + new Container( + color: Colors.white, + padding: EdgeInsets.all(8.0), + child: new Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + new Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + new Text( + TranslationBase.of(context).offTheme, + style: new TextStyle(fontSize: 16.0), + ), + Radio( + value: 0, + groupValue: blindValue, + onChanged: (value) { + setState(() => {this.blindValue = value}); + setTheme(value); + }, + ), + ], + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + new Text( + TranslationBase.of(context).invertTheme, + style: new TextStyle( + fontSize: 16.0, + ), + ), + new Radio( + value: 1, + groupValue: blindValue, + onChanged: (value) { + setState(() => {this.blindValue = value}); + setTheme(value); + }, + ) + ], + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + new Text( + TranslationBase.of(context).dimTheme, + style: new TextStyle(fontSize: 16.0), + ), + new Radio( + value: 2, + groupValue: blindValue, + onChanged: (value) { + setState(() => {this.blindValue = value}); + setTheme(value); + }, + ), + ], + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + new Text( + TranslationBase.of(context).bwTheme, + style: new TextStyle(fontSize: 16.0), + ), + new Radio( + value: 3, + groupValue: blindValue, + onChanged: (value) { + setState(() => {this.blindValue = value}); + + setTheme(value); + }, + ), + ], + ), + ], + ) + ])), Container( padding: EdgeInsets.all(10), child: AppText( @@ -200,7 +200,6 @@ class _GeneralSettings extends State setState(() { camera = value; }); - permission.setCameraLocationPermission(context); }, activeTrackColor: Colors.lightGreenAccent, activeColor: Colors.green, @@ -220,7 +219,6 @@ class _GeneralSettings extends State setState(() { location = value; }); - permission.setCameraLocationPermission(context); }, activeTrackColor: Colors.lightGreenAccent, activeColor: Colors.green, @@ -240,7 +238,43 @@ class _GeneralSettings extends State break; case 1: { - themeNotifier.setTheme(await getTheme(value)); + themeNotifier.setTheme(ThemeData( + fontFamily: await sharedPref.getString(APP_LANGUAGE) == 'ar' ? 'Cairo' : 'WorkSans', + primarySwatch: Colors.grey, + visualDensity: VisualDensity.adaptivePlatformDensity, + brightness: Brightness.light, + pageTransitionsTheme: const PageTransitionsTheme( + builders: { + TargetPlatform.android: ZoomPageTransitionsBuilder(), + TargetPlatform.iOS: CupertinoPageTransitionsBuilder(), + }, + ), + hintColor: Colors.grey[400], + cardColor: Colors.black, + buttonColor: Colors.grey[400], + disabledColor: Colors.grey[300], + errorColor: Color.fromRGBO(235, 80, 60, 1.0), + scaffoldBackgroundColor: Colors.grey, + textSelectionColor: Color.fromRGBO(80, 100, 253, 0.5), + textSelectionHandleColor: Colors.grey, + canvasColor: Colors.white, + backgroundColor: Colors.grey, + highlightColor: Colors.grey[100].withOpacity(0.4), + splashColor: Colors.transparent, + primaryColor: Colors.grey, + bottomSheetTheme: BottomSheetThemeData(backgroundColor: Color(0xffE0E0E0)), + cursorColor: Colors.grey, + + iconTheme: IconThemeData(), + appBarTheme: AppBarTheme( + color: Colors.grey, + brightness: Brightness.dark, + elevation: 10.0, + actionsIconTheme: IconThemeData( + color: Colors.grey, + ), + ), + )); Screen.setBrightness(1.0); } break; @@ -261,31 +295,28 @@ class _GeneralSettings extends State } break; } - permission.setTheme(value); + //permission.setTheme(value); } setVibration(value){ permission.setVibrationPermission(value); } + setAccisibility(){ + if(!accsibility){ + + } + // permission.setVibrationPermission(value); + } getValues() async{ - blindValue= permission.isThemeEnabled() == null ? 0 : permission.isThemeEnabled(); - vibration = permission.isVibrationEnabled() ==null ? false : permission.isVibrationEnabled(); - camera = await permission.isCameraEnabled(); - location = await permission.isLocationEnabled(); - setState(() { - location =location; - camera = camera; - vibration = vibration; - blindValue =blindValue; - accsibility = mediaQueryData.accessibleNavigation; - }); + blindValue= permission.isThemeEnabled() == null ? 0 : permission.isThemeEnabled(); + vibration = permission.isVibrationEnabled() ==null ? false : permission.isVibrationEnabled(); + accsibility =mediaQueryData.accessibleNavigation; } getTheme(value) async{ - if(value ==1){ return ThemeData( - fontFamily: await sharedPref.getString(APP_LANGUAGE) == 'en' ? 'WorkSans' : 'Cairo', + fontFamily: await sharedPref.getString(APP_LANGUAGE) == 'ar' ? 'Cairo' : 'WorkSans', primarySwatch: Colors.grey, visualDensity: VisualDensity.adaptivePlatformDensity, brightness: Brightness.light, @@ -324,7 +355,7 @@ class _GeneralSettings extends State }else if(value ==3){ return ThemeData( - fontFamily: await sharedPref.getString(APP_LANGUAGE) == 'en' ? 'WorkSans' : 'Cairo', + fontFamily: await sharedPref.getString(APP_LANGUAGE) == 'ar' ? 'Cairo' : 'WorkSans', primarySwatch: Colors.grey, visualDensity: VisualDensity.adaptivePlatformDensity, brightness: Brightness.light, @@ -363,7 +394,7 @@ class _GeneralSettings extends State }else { return ThemeData( - fontFamily: await sharedPref.getString(APP_LANGUAGE) == 'en' ? 'WorkSans' : 'Cairo', + fontFamily: await sharedPref.getString(APP_LANGUAGE) == 'ar' ? 'Cairo' : 'WorkSans', primarySwatch: Colors.blue, visualDensity: VisualDensity.adaptivePlatformDensity, brightness: Brightness.light, diff --git a/lib/pages/settings/profile_setting.dart b/lib/pages/settings/profile_setting.dart index c9089351..0658e2e6 100644 --- a/lib/pages/settings/profile_setting.dart +++ b/lib/pages/settings/profile_setting.dart @@ -1,8 +1,5 @@ -import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/core/viewModels/dashboard_view_model.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; -import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart'; -import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; @@ -11,31 +8,17 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; class ProfileSettings extends StatefulWidget { - @override _ProfileSettings createState() => _ProfileSettings(); } class _ProfileSettings extends State with TickerProviderStateMixin { - bool smsAlert = true; - bool emailAlert = true; - int language = 1; - final authService = new AuthProvider(); - TextEditingController emergencyContact = new TextEditingController(); - TextEditingController emailController = new TextEditingController(); - TextEditingController emergencyContactName = new TextEditingController(); - @override - void initState() { - Future.delayed(new Duration(seconds: 0), () { - getSettings(context); - }); - super.initState(); - } Widget build(BuildContext context) { - + bool isVibration = true; + var language = 1; return BaseView( - onModelReady: (model) =>{}, + onModelReady: (model) => model.getPatientRadOrders(), builder: (_, model, wi) => Container( child: ListView(scrollDirection: Axis.vertical, children: [ @@ -79,10 +62,7 @@ class _ProfileSettings extends State value: 2, groupValue: language, onChanged: (value) { - setState(() { - language = value; - }); - + language = value; }, ) ], @@ -99,10 +79,7 @@ class _ProfileSettings extends State value: 1, groupValue: language, onChanged: (value) { - setState(() { - language = value; - }); - + language = value; }, ) ], @@ -120,10 +97,10 @@ class _ProfileSettings extends State children: [ AppText(TranslationBase.of(context).emailAlert), Switch( - value: emailAlert, + value: isVibration, onChanged: (value) { setState(() { - emailAlert = value; + isVibration = value; }); }, activeTrackColor: Colors.lightGreenAccent, @@ -140,10 +117,10 @@ class _ProfileSettings extends State children: [ AppText(TranslationBase.of(context).smsAlert), Switch( - value: smsAlert, + value: isVibration, onChanged: (value) { setState(() { - smsAlert = value; + isVibration = value; }); }, activeTrackColor: Colors.lightGreenAccent, @@ -164,7 +141,7 @@ class _ProfileSettings extends State children: [ AppText(TranslationBase.of(context).email), TextField( - controller: emailController, + style: TextStyle(color: Colors.red), decoration: InputDecoration( suffixIcon: Icon(Icons.edit), )) @@ -179,7 +156,7 @@ class _ProfileSettings extends State children: [ AppText(TranslationBase.of(context).emergencyName), TextField( - controller: emergencyContactName, + style: TextStyle(color: Colors.red), decoration: InputDecoration( suffixIcon: Icon(Icons.edit), )) @@ -194,7 +171,7 @@ class _ProfileSettings extends State children: [ AppText(TranslationBase.of(context).emergencyContact), TextField( - controller: emergencyContact, + style: TextStyle(color: Colors.red), decoration: InputDecoration( suffixIcon: Icon(Icons.edit), ), @@ -209,44 +186,11 @@ class _ProfileSettings extends State child: DefaultButton( TranslationBase.of(context).submit, () { - saveSettings(); +// print(mobileNo.text); }, )), ], )) ]))); } - - getSettings(context){ - GifLoaderDialogUtils.showMyDialog(context); - authService.getSettings().then((result)=>{ - GifLoaderDialogUtils.hideDialog(context), - setValue(result["PateintInfoForUpdateList"][0]) - }); - } - setValue(value){ - setState(() { - this.language = int.parse(value["PreferredLanguage"]); - this.emailAlert = value["IsEmailAlertRequired"]; - this.smsAlert = value["IsSMSAlertRequired"]; - this.emailController.text = value["EmailAddress"]; - this.emergencyContact.text = value["EmergencyContactNo"]; - this.emergencyContactName.text = value["EmergencyContactName"]; - }); - - } - saveSettings(){ - GifLoaderDialogUtils.showMyDialog(context); - Map request = {}; - request["EmailAddress"] =this.emailController.text; - request["EmergencyContactName"] = this.emergencyContactName.text; - request["EmergencyContactNo"] = this.emergencyContact.text; - request["IsEmailAlertRequired"] = this.emailAlert; - request["IsSMSAlertRequired"] = this.smsAlert; - request["PreferredLanguage"] = this.language.toString(); - authService.saveSettings(request).then((result)=>{ - print(result), - GifLoaderDialogUtils.hideDialog(context) - }); - } } diff --git a/lib/pages/vaccine/my_vaccines_screen.dart b/lib/pages/vaccine/my_vaccines_screen.dart index 3e81c41c..02d67cac 100644 --- a/lib/pages/vaccine/my_vaccines_screen.dart +++ b/lib/pages/vaccine/my_vaccines_screen.dart @@ -1,5 +1,4 @@ import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; -import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; @@ -7,7 +6,6 @@ import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/material.dart'; import 'package:diplomaticquarterapp/config/size_config.dart'; import 'package:flutter/cupertino.dart'; -import 'package:provider/provider.dart'; import '../base/base_view.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/core/viewModels/vaccine_view_model.dart'; @@ -24,7 +22,6 @@ class MyVaccines extends StatefulWidget { class _MyVaccinesState extends State { @override Widget build(BuildContext context) { - ProjectViewModel projectViewModel = Provider.of(context); return BaseView( onModelReady: (model) => model.getVaccine(), builder: (BuildContext context, VaccineViewModel model, Widget child) => @@ -174,7 +171,6 @@ class _MyVaccinesState extends State { Navigator.push(context, FadePage(page: MyVaccinesItemPage())), ), ), - if(projectViewModel.havePrivilege(27)) Container( width: double.infinity, // height: 80.0, diff --git a/lib/routes.dart b/lib/routes.dart index 78b79c0f..b11025c2 100644 --- a/lib/routes.dart +++ b/lib/routes.dart @@ -1,8 +1,6 @@ -import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health-weather/health-weather-indicator.dart'; import 'package:diplomaticquarterapp/pages/DrawerPages/family/add-family-member.dart'; import 'package:diplomaticquarterapp/pages/DrawerPages/family/add-family_type.dart'; import 'package:diplomaticquarterapp/pages/DrawerPages/family/my-family.dart'; -import 'package:diplomaticquarterapp/pages/appUpdatePage/app_update_page.dart'; import 'package:diplomaticquarterapp/pages/landing/landing_page.dart'; import 'package:diplomaticquarterapp/pages/livecare/livecare_home.dart'; import 'package:diplomaticquarterapp/pages/login/confirm-login.dart'; @@ -37,8 +35,6 @@ const String SYMPTOM_CHECKER = 'symptom-checker'; const String SYMPTOM_CHECKER_INFO = 'symptom-checker-info'; const String SELECT_GENDER = 'select-gender'; const String SETTINGS = 'settings'; -const String HEALTH_WEATHER = 'health-weather'; -const String APP_UPDATE = 'app_update'; var routes = { SPLASH: (_) => SplashScreen(), HOME: (_) => LandingPage(), @@ -56,8 +52,5 @@ var routes = { SYMPTOM_CHECKER: (_) => SymptomChecker(), SYMPTOM_CHECKER_INFO: (_) => SymptomInfo(), SELECT_GENDER: (_) => SelectGender(), - SETTINGS: (_) => Settings(), - APP_UPDATE: (_) => AppUpdatePage(), - SETTINGS: (_) => Settings(), - HEALTH_WEATHER: (_)=> HealthWeatherIndicator() + SETTINGS: (_) => Settings() }; diff --git a/lib/services/appointment_services/GetDoctorsList.dart b/lib/services/appointment_services/GetDoctorsList.dart index a320cf6b..eb1ab98f 100644 --- a/lib/services/appointment_services/GetDoctorsList.dart +++ b/lib/services/appointment_services/GetDoctorsList.dart @@ -177,72 +177,6 @@ class DoctorsListService extends BaseService { return Future.value(localRes); } - Future getDoctorsRating( - int docID, context) async { - Map request; - var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); - Request req = appGlobal.getPublicRequest(); - request = { - "LanguageID": languageID == 'ar' ? 1 : 2, - "IPAdress": "10.20.10.20", - "VersionID": req.VersionID, - "Channel": req.Channel, - "generalid": 'Cs2020@2016\$2958', - "PatientOutSA": authUser.outSA, - "TokenID": "", - "DeviceTypeID": req.DeviceTypeID, - "SessionID": null, - "doctorID": docID, - "PatientID": 0, - "License": true, - "IsRegistered": true, - "isDentalAllowedBackend": false - }; - - dynamic localRes; - - await baseAppClient.post(GET_DOCTOR_RATING_NOTES, - onSuccess: (response, statusCode) async { - localRes = response; - }, onFailure: (String error, int statusCode) { - throw error; - }, body: request); - return Future.value(localRes); - } - - Future getDoctorsRatingDetails( - int docID, context) async { - Map request; - var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); - Request req = appGlobal.getPublicRequest(); - request = { - "LanguageID": languageID == 'ar' ? 1 : 2, - "IPAdress": "10.20.10.20", - "VersionID": req.VersionID, - "Channel": req.Channel, - "generalid": 'Cs2020@2016\$2958', - "PatientOutSA": authUser.outSA, - "TokenID": "", - "DeviceTypeID": req.DeviceTypeID, - "SessionID": null, - "DoctorID": docID, - "PatientID": 0, - "License": true, - "IsRegistered": true, - "isDentalAllowedBackend": false - }; - - dynamic localRes; - - await baseAppClient.post(GET_DOCTOR_RATING_DETAILS, - onSuccess: (response, statusCode) async { - localRes = response; - }, onFailure: (String error, int statusCode) { - throw error; - }, body: request); - return Future.value(localRes); - } - Future getDoctorFreeSlots( int docID, int clinicID, int projectID, BuildContext context) async { Map request; @@ -1234,9 +1168,6 @@ class DoctorsListService extends BaseService { double payedAmount, String paymentReference, String paymentMethodName, - dynamic patientType, - String patientName, - dynamic patientID, BuildContext context) async { Map request; if (await this.sharedPref.getObject(USER_PROFILE) != null) { @@ -1248,12 +1179,12 @@ class DoctorsListService extends BaseService { Request req = appGlobal.getPublicRequest(); request = { - "CustName": patientName, - "CustID": patientID, + "CustName": authUser.firstName + " " + authUser.lastName, + "CustID": authUser.patientID, "SetupID": "010266", "ProjectID": projectID, - "PatientID": patientID, - "AccountID": patientID, + "PatientID": authUser.patientID, + "AccountID": authUser.patientID, "PaymentAmount": payedAmount, "NationalityID": null, "DepositorName": authUser.firstName + " " + authUser.lastName, @@ -1270,8 +1201,8 @@ class DoctorsListService extends BaseService { "SessionID": "YckwoXhUmWBsnHKEKig", "isDentalAllowedBackend": false, "TokenID": "@dm!n", - "PatientTypeID": patientType, - "PatientType": patientType + "PatientTypeID": authUser.patientType, + "PatientType": authUser.patientType }; dynamic localRes; await baseAppClient.post(HIS_CREATE_ADVANCE_PAYMENT, diff --git a/lib/services/authentication/auth_provider.dart b/lib/services/authentication/auth_provider.dart index 59f51bfc..8bdfa09b 100644 --- a/lib/services/authentication/auth_provider.dart +++ b/lib/services/authentication/auth_provider.dart @@ -24,39 +24,27 @@ enum APP_STATUS { LOADING, UNAUTHENTICATED, AUTHENTICATED } AppSharedPreferences sharedPref = new AppSharedPreferences(); AppGlobal appGlobal = new AppGlobal(); -const String INSERT_DEVICE_IMEI = - 'Services/Patients.svc/REST/Patient_INSERTDeviceIMEI'; -const String SELECT_DEVICE_IMEI = - 'Services/Patients.svc/REST/Patient_SELECTDeviceIMEIbyIMEI'; -const String CHECK_PATIENT_AUTH = - 'Services/Authentication.svc/REST/CheckPatientAuthentication'; +const String INSERT_DEVICE_IMEI = 'Services/Patients.svc/REST/Patient_INSERTDeviceIMEI'; +const String SELECT_DEVICE_IMEI = 'Services/Patients.svc/REST/Patient_SELECTDeviceIMEIbyIMEI'; +const String CHECK_PATIENT_AUTH = 'Services/Authentication.svc/REST/CheckPatientAuthentication'; const GET_MOBILE_INFO = 'Services/Authentication.svc/REST/GetMobileLoginInfo'; -const SEND_ACTIVATION_CODE = - 'Services/Authentication.svc/REST/SendActivationCodebyOTPNotificationType'; -const CHECK_ACTIVATION_CODE = - 'Services/Authentication.svc/REST/CheckActivationCode'; -const FORGOT_PASSWORD = - 'Services/Authentication.svc/REST/CheckActivationCodeForSendFileNo'; -const CHECK_PATIENT_FOR_REGISTRATION = - "Services/Authentication.svc/REST/CheckPatientForRegisteration"; +const SEND_ACTIVATION_CODE = 'Services/Authentication.svc/REST/SendActivationCodebyOTPNotificationType'; +const CHECK_ACTIVATION_CODE = 'Services/Authentication.svc/REST/CheckActivationCode'; +const FORGOT_PASSWORD = 'Services/Authentication.svc/REST/CheckActivationCodeForSendFileNo'; +const CHECK_PATIENT_FOR_REGISTRATION = "Services/Authentication.svc/REST/CheckPatientForRegisteration"; const CHECK_USER_STATUS = "Services/NHIC.svc/REST/GetPatientInfo"; const REGISTER_USER = 'Services/Authentication.svc/REST/PatientRegistration'; -const LOGGED_IN_USER_URL = - 'Services/MobileNotifications.svc/REST/Insert_PatientMobileDeviceInfo'; +const LOGGED_IN_USER_URL = 'Services/MobileNotifications.svc/REST/Insert_PatientMobileDeviceInfo'; -const FORGOT_PATIENT_ID = - 'Services/Authentication.svc/REST/SendPatientIDSMSByMobileNumber'; +const FORGOT_PATIENT_ID = 'Services/Authentication.svc/REST/SendPatientIDSMSByMobileNumber'; const DASHBOARD = 'Services/Patients.svc/REST/PatientDashboard'; -const PROFILE_SETTING = 'Services/Patients.svc/REST/GetPateintInfoForUpdate'; -const SAVE_SETTING = 'Services/Patients.svc/REST/UpdatePateintInfo'; class AuthProvider with ChangeNotifier { bool isLogin = false; bool isLoading = true; dynamic authenticatedUser; - AuthenticatedUserObject authenticatedUserObject = - locator(); + AuthenticatedUserObject authenticatedUserObject = locator(); AuthProvider() { getUserAuthentication(); @@ -110,8 +98,7 @@ class AuthProvider with ChangeNotifier { var lastLogin = lstLogin; //await sharedPref.getInt( // LAST_LOGIN); //this.cs.sharedService.getStorage(AuthenticationService.LAST_LOGIN); //this.cs.sharedService.getSharedData(AuthenticationService.LAST_LOGIN, false); - var request = - AuthenticatedUser.fromJson(await sharedPref.getObject(USER_PROFILE)); + var request = AuthenticatedUser.fromJson(await sharedPref.getObject(USER_PROFILE)); var newRequest = INSERTDeviceIMEIRequest(); var imei = await sharedPref.getString(PUSH_TOKEN); @@ -133,8 +120,7 @@ class AuthProvider with ChangeNotifier { newRequest.tokenID = await sharedPref.getString(TOKEN); // } - await new BaseAppClient().post(INSERT_DEVICE_IMEI, - onSuccess: (dynamic response, int statusCode) { + await new BaseAppClient().post(INSERT_DEVICE_IMEI, onSuccess: (dynamic response, int statusCode) { localRes = response; }, onFailure: (String error, int statusCode) { throw error; @@ -151,10 +137,8 @@ class AuthProvider with ChangeNotifier { dynamic localRes; Map request = {}; request['IMEI'] = imei; - await new BaseAppClient().post(SELECT_DEVICE_IMEI, - onSuccess: (dynamic response, int statusCode) { - localRes = SelectDeviceIMEIRES.fromJson( - response['Patient_SELECTDeviceIMEIbyIMEIList'][0]); + await new BaseAppClient().post(SELECT_DEVICE_IMEI, onSuccess: (dynamic response, int statusCode) { + localRes = SelectDeviceIMEIRES.fromJson(response['Patient_SELECTDeviceIMEIbyIMEIList'][0]); }, onFailure: (String error, int statusCode) { throw error; }, body: request); @@ -165,8 +149,7 @@ class AuthProvider with ChangeNotifier { } } - Future checkPatientAuthentication( - CheckPatientAuthenticationReq request) async { + Future checkPatientAuthentication(CheckPatientAuthenticationReq request) async { request.versionID = VERSION_ID; request.channel = CHANNEL; request.iPAdress = IP_ADDRESS; @@ -175,8 +158,7 @@ class AuthProvider with ChangeNotifier { request.patientOutSA = request.zipCode == '966' ? 0 : 1; dynamic localRes; - await new BaseAppClient().post(CHECK_PATIENT_AUTH, - onSuccess: (dynamic response, int statusCode) { + await new BaseAppClient().post(CHECK_PATIENT_AUTH, onSuccess: (dynamic response, int statusCode) { localRes = response; }, onFailure: (String error, int statusCode) { throw error; @@ -195,8 +177,7 @@ class AuthProvider with ChangeNotifier { request.isDentalAllowedBackend = false; dynamic localRes; - await new BaseAppClient().post(GET_MOBILE_INFO, - onSuccess: (dynamic response, int statusCode) { + await new BaseAppClient().post(GET_MOBILE_INFO, onSuccess: (dynamic response, int statusCode) { localRes = response; }, onFailure: (String error, int statusCode) { throw error; @@ -215,8 +196,7 @@ class AuthProvider with ChangeNotifier { request.isDentalAllowedBackend = false; dynamic localRes; - await new BaseAppClient().post(SEND_ACTIVATION_CODE, - onSuccess: (dynamic response, int statusCode) { + await new BaseAppClient().post(SEND_ACTIVATION_CODE, onSuccess: (dynamic response, int statusCode) { localRes = response; authenticatedUser = CheckActivationCode.fromJson(localRes); }, onFailure: (String error, int statusCode) { @@ -233,19 +213,17 @@ class AuthProvider with ChangeNotifier { neRequest.channel = CHANNEL; neRequest.iPAdress = IP_ADDRESS; neRequest.generalid = GENERAL_ID; - // neRequest.languageID = LANGUAGE_ID; + neRequest.languageID = LANGUAGE_ID; neRequest.deviceTypeID = DeviceTypeID; neRequest.patientOutSA = neRequest.zipCode == '966' ? 0 : 1; neRequest.projectOutSA = neRequest.zipCode == '966' ? false : true; neRequest.isDentalAllowedBackend = false; neRequest.deviceToken = null; - neRequest.forRegisteration = - neRequest.isRegister != null ? neRequest.isRegister : false; + neRequest.forRegisteration = neRequest.isRegister != null ? neRequest.isRegister : false; neRequest.isRegister = false; dynamic localRes; try { - await new BaseAppClient().post(CHECK_ACTIVATION_CODE, - onSuccess: (dynamic response, int statusCode) { + await new BaseAppClient().post(CHECK_ACTIVATION_CODE, onSuccess: (dynamic response, int statusCode) { localRes = response; //CheckActivationCode.fromJson(); }, onFailure: (String error, int statusCode) { localRes = error; @@ -261,11 +239,11 @@ class AuthProvider with ChangeNotifier { AuthenticatedUser getAuthenticatedUser() { this.isLogin = true; + authenticatedUser = authenticatedUserObject.user; return authenticatedUser; } - Future checkPatientForRegisteration( - CheckPatientForRegistration request) async { + Future checkPatientForRegisteration(CheckPatientForRegistration request) async { request.versionID = VERSION_ID; request.channel = CHANNEL; request.iPAdress = IP_ADDRESS; @@ -276,8 +254,7 @@ class AuthProvider with ChangeNotifier { // request.tokenID = ''; dynamic localRes; try { - await new BaseAppClient().post(CHECK_PATIENT_FOR_REGISTRATION, - onSuccess: (dynamic response, int statusCode) { + await new BaseAppClient().post(CHECK_PATIENT_FOR_REGISTRATION, onSuccess: (dynamic response, int statusCode) { localRes = response; }, onFailure: (String error, int statusCode) { localRes = error; @@ -300,8 +277,7 @@ class AuthProvider with ChangeNotifier { // request.tokenID = ''; dynamic localRes; try { - await new BaseAppClient().post(CHECK_USER_STATUS, - onSuccess: (dynamic response, int statusCode) { + await new BaseAppClient().post(CHECK_USER_STATUS, onSuccess: (dynamic response, int statusCode) { localRes = response; }, onFailure: (String error, int statusCode) { localRes = error; @@ -324,8 +300,7 @@ class AuthProvider with ChangeNotifier { // request.tokenID = ''; dynamic localRes; try { - await new BaseAppClient().post(REGISTER_USER, - onSuccess: (dynamic response, int statusCode) { + await new BaseAppClient().post(REGISTER_USER, onSuccess: (dynamic response, int statusCode) { localRes = response; }, onFailure: (String error, int statusCode) { localRes = error; @@ -337,21 +312,17 @@ class AuthProvider with ChangeNotifier { } } - Future registeredAuthenticatedUser( - AuthenticatedUser user, deviceToken, lat, long) async { + Future registeredAuthenticatedUser(AuthenticatedUser user, deviceToken, lat, long) async { var request = new RegisteredAuthenticatedUserRequest(); request.deviceToken = deviceToken; - request.voipToken = - ""; //this.cs.sharedService.getSharedData(AuthenticationService.APNS_TOKEN, false); + request.voipToken = ""; //this.cs.sharedService.getSharedData(AuthenticationService.APNS_TOKEN, false); request.deviceType = DeviceTypeID.toString(); request.patientMobileNumber = '0' + user.mobileNumber; request.nationalID = user.patientIdentificationNo; request.gender = user.gender; request.patientID = user.patientID; request.patientOutSA = user.outSA; - request.loginType = await sharedPref.getInt(LAST_LOGIN) != null - ? await sharedPref.getInt(LAST_LOGIN) - : 1; + request.loginType = await sharedPref.getInt(LAST_LOGIN) != null ? await sharedPref.getInt(LAST_LOGIN) : 1; request.mACAddress = '00:00:00:00:00:00'; request.latitude = lat; request.longitude = long; @@ -359,8 +330,7 @@ class AuthProvider with ChangeNotifier { request.patientTypeID = 2; dynamic localRes; try { - await new BaseAppClient().post(LOGGED_IN_USER_URL, - onSuccess: (dynamic response, int statusCode) { + await new BaseAppClient().post(LOGGED_IN_USER_URL, onSuccess: (dynamic response, int statusCode) { localRes = response; }, onFailure: (String error, int statusCode) { localRes = error; @@ -374,8 +344,7 @@ class AuthProvider with ChangeNotifier { Future sendPatientIDSMS(mobileNo, context) async { Map request; - var languageID = - await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); Request req = appGlobal.getPublicRequest(); request = { "LanguageID": languageID == 'ar' ? 1 : 2, @@ -396,8 +365,7 @@ class AuthProvider with ChangeNotifier { dynamic localRes; - await new BaseAppClient().post(FORGOT_PATIENT_ID, - onSuccess: (response, statusCode) async { + await new BaseAppClient().post(FORGOT_PATIENT_ID, onSuccess: (response, statusCode) async { localRes = response; }, onFailure: (String error, int statusCode) { throw error; @@ -418,8 +386,7 @@ class AuthProvider with ChangeNotifier { dynamic localRes; try { - await new BaseAppClient().post(FORGOT_PASSWORD, - onSuccess: (dynamic response, int statusCode) { + await new BaseAppClient().post(FORGOT_PASSWORD, onSuccess: (dynamic response, int statusCode) { localRes = response; //CheckActivationCode.fromJson(); }, onFailure: (String error, int statusCode) { localRes = error; @@ -445,44 +412,7 @@ class AuthProvider with ChangeNotifier { request["PatientType"] = 1; dynamic localRes; try { - await new BaseAppClient().post(DASHBOARD, - onSuccess: (dynamic response, int statusCode) { - localRes = response; //CheckActivationCode.fromJson(); - }, onFailure: (String error, int statusCode) { - localRes = error; - return Future.value(error); - // throw error; - }, body: request); - return Future.value(localRes); - } catch (error) { - throw error; - //return Future.value(error); - } - } - - getSettings() async { - dynamic localRes; - try { - await new BaseAppClient().post(PROFILE_SETTING, - onSuccess: (dynamic response, int statusCode) { - localRes = response; //CheckActivationCode.fromJson(); - }, onFailure: (String error, int statusCode) { - localRes = error; - return Future.value(error); - // throw error; - }, body: {}); - return Future.value(localRes); - } catch (error) { - throw error; - //return Future.value(error); - } - } - - Future saveSettings(request) async { - dynamic localRes; - try { - await new BaseAppClient().post(SAVE_SETTING, - onSuccess: (dynamic response, int statusCode) { + await new BaseAppClient().post(DASHBOARD, onSuccess: (dynamic response, int statusCode) { localRes = response; //CheckActivationCode.fromJson(); }, onFailure: (String error, int statusCode) { localRes = error; diff --git a/lib/services/family_files/family_files_provider.dart b/lib/services/family_files/family_files_provider.dart index 0b0c1ef5..79ea67d0 100644 --- a/lib/services/family_files/family_files_provider.dart +++ b/lib/services/family_files/family_files_provider.dart @@ -37,10 +37,6 @@ const String SENT_REQUEST_URL = 'Services/Authentication.svc/REST/GetAllSharedRecordsByStatus'; const String RECEVIED_REQUEST_URL = 'Services/Authentication.svc/REST/GetAllPendingRecordsByResponseId'; -const ACCEPT_REJECT_FAMILY = - 'Services/Authentication.svc/REST/Update_FileStatus'; -const DEACTIVATE_FAMILY = - 'Services/Authentication.svc/REST/DeactivateRequestByRensponse'; class FamilyFilesProvider with ChangeNotifier { bool isLogin = false; @@ -51,9 +47,7 @@ class FamilyFilesProvider with ChangeNotifier { try { dynamic localRes; var request = GetAllSharedRecordsByStatusReq(); - var result = await sharedPref.getObject(MAIN_USER); request.status = 0; - request.patientID = result["PatientID"]; await new BaseAppClient().post(GET_SHARED_RECORD_BY_STATUS, onSuccess: (dynamic response, int statusCode) { localRes = response; @@ -61,7 +55,7 @@ class FamilyFilesProvider with ChangeNotifier { AppToast.showErrorToast(message: error); throw error; }, body: request.toJson()); - + sharedPref.setObject(FAMILY_FILE, localRes); return Future.value( GetAllSharedRecordsByStatusResponse.fromJson(localRes)); @@ -84,7 +78,7 @@ class FamilyFilesProvider with ChangeNotifier { return Future.error(error); }, body: request); if (localRes != null) { - // sharedPref.setObject(FAMILY_FILE, localRes); + sharedPref.setObject(FAMILY_FILE, localRes); allSharedRecordsByStatusResponse = GetAllSharedRecordsByStatusResponse.fromJson(localRes); return Future.value(allSharedRecordsByStatusResponse); @@ -109,7 +103,7 @@ class FamilyFilesProvider with ChangeNotifier { //AppToast.showErrorToast(message: error); //throw error; }, body: request); - //sharedPref.setObject(FAMILY_FILE, localRes); + sharedPref.setObject(FAMILY_FILE, localRes); return Future.value( GetAllSharedRecordsByStatusResponse.fromJson(localRes)); } catch (error) { @@ -255,9 +249,9 @@ class FamilyFilesProvider with ChangeNotifier { Future silentLoggin(GetAllSharedRecordsByStatusList switchUser, {onSuccess, mainUser}) async { Map request = {}; - if (mainUser == true) { + if(mainUser ==true){ var currentUser = - AuthenticatedUser.fromJson(await sharedPref.getObject(MAIN_USER)); + AuthenticatedUser.fromJson(await sharedPref.getObject(MAIN_USER)); //const request = new SwitchUserRequest(); request['LogInTokenID'] = ''; request['PatientOutSA'] = currentUser.outSA; //? 1 : 0; @@ -271,9 +265,9 @@ class FamilyFilesProvider with ChangeNotifier { request['ZipCode'] = currentUser.outSA == 1 ? "971" : "966"; request['activationCode'] = '0000'; request['isRegister'] = false; - } else { + }else { var currentUser = - AuthenticatedUser.fromJson(await sharedPref.getObject(USER_PROFILE)); + AuthenticatedUser.fromJson(await sharedPref.getObject(USER_PROFILE)); //const request = new SwitchUserRequest(); request['LogInTokenID'] = ''; @@ -306,42 +300,4 @@ class FamilyFilesProvider with ChangeNotifier { throw error; } } - - Future acceptRejectFamily(request) async { - try { - dynamic localRes; - - await new BaseAppClient().post(ACCEPT_REJECT_FAMILY, - onSuccess: (dynamic response, int statusCode) { - localRes = response; - }, onFailure: (String error, int statusCode) { - AppToast.showErrorToast(message: error); - throw error; - }, body: request); - - return Future.value(localRes); - } catch (error) { - print(error); - throw error; - } - } - - Future deactivateFamily(request) async { - try { - dynamic localRes; - - await new BaseAppClient().post(DEACTIVATE_FAMILY, - onSuccess: (dynamic response, int statusCode) { - localRes = response; - }, onFailure: (String error, int statusCode) { - AppToast.showErrorToast(message: error); - throw error; - }, body: request); - - return Future.value(localRes); - } catch (error) { - print(error); - throw error; - } - } } diff --git a/lib/services/permission/permission_service.dart b/lib/services/permission/permission_service.dart index 2d618f34..6f01f3c8 100644 --- a/lib/services/permission/permission_service.dart +++ b/lib/services/permission/permission_service.dart @@ -1,4 +1,3 @@ -import 'package:android_intent/android_intent.dart'; import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/core/service/base_service.dart'; @@ -9,8 +8,7 @@ import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:localstorage/localstorage.dart'; -import 'package:permission_handler/permission_handler.dart'; -import 'package:vibration/vibration.dart'; + class PermissionService extends BaseService { final LocalStorage storage = new LocalStorage("permission"); @@ -21,21 +19,12 @@ class PermissionService extends BaseService { } isVibrationEnabled() { - return (storage.getItem('isVibration') ==null) || (storage.getItem('isVibration')) ==false ? false :true; + return storage.getItem('isVibration') ==null ? false :true; } - vibrate(callback, context) async{ - - if (callback == null) - return null; + vibrate(){ if(isVibrationEnabled() ==true){ - if (await Vibration.hasVibrator()) { - Vibration.vibrate(duration: 100); - callback(); - } - }else{ - callback(); + HapticFeedback.vibrate(); } - } @@ -46,23 +35,5 @@ class PermissionService extends BaseService { isThemeEnabled() { return storage.getItem('isTheme'); } - cameraPermission() async{ - Map statuses = await [ - Permission.camera, - ].request(); - } - isCameraEnabled() async{ - print(await Permission.camera.status); - return await Permission.camera.status == PermissionStatus.granted ? true : false; - } - setCameraLocationPermission(context) async{ - Navigator.pop(context); - openAppSettings(); - } - isLocationEnabled() async{ - return await Permission.location.status == PermissionStatus.granted ? true : false; - } - openSettings() async{ - openAppSettings(); - } + } diff --git a/lib/splashPage.dart b/lib/splashPage.dart index aaffcbbd..d367d3ec 100644 --- a/lib/splashPage.dart +++ b/lib/splashPage.dart @@ -1,5 +1,4 @@ import 'dart:async'; -import 'package:diplomaticquarterapp/core/service/privilege_service.dart'; import 'package:diplomaticquarterapp/pages/landing/landing_page.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:flutter/material.dart'; @@ -21,8 +20,6 @@ class SplashScreen extends StatefulWidget { } class _SplashScreenState extends State { - PrivilegeService _privilegeService = locator(); - //Provider.of(context, listen: false).isLogin @override void initState() { @@ -30,7 +27,7 @@ class _SplashScreenState extends State { Timer( Duration(seconds: 1, milliseconds: 500), () { - loadPrivilege().then((value) { + getUserData().then((value) { Navigator.of(context).pushReplacement( MaterialPageRoute( builder: (BuildContext context) => LandingPage(), @@ -41,11 +38,14 @@ class _SplashScreenState extends State { ); } - - /// load the Privilege from service - Future loadPrivilege() async { - await _privilegeService.getPrivilege(); - Provider.of(context, listen: false).setPrivilegeModelList(privilege: _privilegeService.privilegeModelList); + Future getUserData() async { + var data = await sharedPref.getObject(USER_PROFILE); + if (data != null) { + AuthenticatedUser userData = AuthenticatedUser.fromJson(data); + Provider.of(context, listen: false).isLogin = true; + authenticatedUserObject.isLogin = true; + authenticatedUserObject.user = userData; + } } @override diff --git a/lib/theme/theme_value.dart b/lib/theme/theme_value.dart index aedd0fbf..d19e13b2 100644 --- a/lib/theme/theme_value.dart +++ b/lib/theme/theme_value.dart @@ -53,7 +53,7 @@ final blueBackground = Color(0xFFFFFFFF); ), ); - var defaultTheme = ThemeData( + final defaultTheme = ThemeData( //fontFamily: ProjectViewModel().isArabic? 'Cairo' : 'WorkSans', primarySwatch: Colors.blue, visualDensity: VisualDensity.adaptivePlatformDensity, @@ -65,7 +65,6 @@ final blueBackground = Color(0xFFFFFFFF); }, ), hintColor: Colors.grey[400], - accentColor: Color(0xffB8382C), disabledColor: Colors.grey[300], errorColor: Color.fromRGBO(235, 80, 60, 1.0), scaffoldBackgroundColor: Color(0xffEEEEEE), diff --git a/lib/uitl/HMGNetworkConnectivity.dart b/lib/uitl/HMGNetworkConnectivity.dart new file mode 100644 index 00000000..228edf93 --- /dev/null +++ b/lib/uitl/HMGNetworkConnectivity.dart @@ -0,0 +1,120 @@ +import 'dart:developer'; +import 'dart:io'; + +import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/core/service/client/base_app_client.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; +import 'package:diplomaticquarterapp/uitl/PlatformBridge.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/uitl/utils.dart'; +import 'package:diplomaticquarterapp/widgets/dialogs/alert_dialog.dart'; +import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; +import 'package:wifi/wifi.dart'; + +import 'gif_loader_dialog_utils.dart'; + +class HMGNetworkConnectivity { + final BuildContext context; + final Function callBack; + + final String SSID = "HMG-MobileApp"; + + HMGNetworkConnectivity(this.context, this.callBack); + + void checkAndConnectIfNoInternet() async { + String pingUrl = "$BASE_URL$PING_SERVICE"; + // pingUrl = "https://captive.apple.com"; + + String ssid = await Wifi.ssid.catchError((error) { + log(error.toString()); + }); + + bool alreadyConnected = ssid == SSID; + + BaseAppClient().simpleGet(pingUrl, onSuccess: (dynamic response, int statusCode) { + log("Having internet with status code: $statusCode"); + }, onFailure: (String error, int statusCode) { + if (alreadyConnected) + showFailDailog(TranslationBase.of(context).failedToAccessHmgServices); + else { + confirmFromUser(); + } + }); + } + + void confirmFromUser() { + TranslationBase translator = TranslationBase.of(context); + ConfirmDialog( + context: context, + confirmMessage: translator.wantToConnectWithHmgNetwork, + okText: translator.yes, + okFunction: () { + ConfirmDialog.closeAlertDialog(context); + callBack(); + }, + cancelText: translator.no, + cancelFunction: () { + ConfirmDialog.closeAlertDialog(context); + }).showAlertDialog(context); + } + + void showFailDailog(String message) { + TranslationBase translator = TranslationBase.of(context); + AlertDialogBox( + context: context, + okText: translator.ok, + confirmMessage: message, + okFunction: () { + AlertDialogBox.closeAlertDialog(context); + }).showAlertDialog(context); + } + + // void next() { + // if (Platform.isIOS) { + // confirmFromUser_iOS(); + // } else if (Platform.isAndroid) { + // confirmFromUser(); + // } + // } + + // void confirmFromUser_iOS() { + // String message = "You don't have internet access, Do you want to connect with HMG Network to use App.\n\nMake sure you are in HMG Network range"; + // ConfirmDialog( + // context: context, + // confirmMessage: message, + // okText: "Yes", + // okFunction: () { + // ConfirmDialog.closeAlertDialog(context); + // callBack(); + // }, + // cancelText: "No", + // cancelFunction: () { + // ConfirmDialog.closeAlertDialog(context); + // }).showAlertDialog(context); + // } + + // void connect_Android() { + // // enable the Wifi if its off + // PlatformBridge() + // .enableWifiIfNot() + // .then((value) => { + // if (value == true) + // { + // callBack() + // // Wifi.list(SSID) + // // .then((value1) => { + // // if (value1.length > 0) {callBack()} else {log("No HMG network in range")} + // // }) + // // .catchError((e) { + // // log(e); + // // }) + // } + // }) + // .catchError((error) { + // showFailDailog(error); + // }); + // } +} diff --git a/lib/uitl/HMG_Geofence.dart b/lib/uitl/HMG_Geofence.dart new file mode 100644 index 00000000..54c789ba --- /dev/null +++ b/lib/uitl/HMG_Geofence.dart @@ -0,0 +1,189 @@ +// import 'dart:convert'; +// import 'dart:core'; +// import 'dart:io'; +// import 'dart:isolate'; +// import 'dart:math'; +// import 'dart:ui'; +// +// import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; +// import 'package:diplomaticquarterapp/core/model/geofencing/requests/GeoZonesRequestModel.dart'; +// import 'package:diplomaticquarterapp/core/model/geofencing/requests/LogGeoZoneRequestModel.dart'; +// import 'package:diplomaticquarterapp/core/model/geofencing/responses/GeoZonesResponseModel.dart'; +// import 'package:diplomaticquarterapp/core/service/geofencing/GeofencingServices.dart'; +// import 'package:diplomaticquarterapp/locator.dart'; +// import 'package:diplomaticquarterapp/uitl/LocalNotification.dart'; +// import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; +// import 'package:flutter/cupertino.dart'; +// import 'package:flutter/foundation.dart'; +// import 'package:geofencing/geofencing.dart'; +// +// class HMG_Geofencing { +// var _testTrigger = false; +// static var _isolatePortName = "hmg_geofencing_send_port"; +// +// List _zones; +// List registeredGeofences = []; +// +// final AndroidGeofencingSettings androidSettings = AndroidGeofencingSettings(initialTrigger: [GeofenceEvent.enter, GeofenceEvent.exit, GeofenceEvent.dwell], loiteringDelay: 1000 * 60); +// +// final BuildContext context; +// final List triggers = List(); +// +// HMG_Geofencing(this.context) { +// triggers.add(GeofenceEvent.enter); +// triggers.add(GeofenceEvent.exit); +// // triggers.add(GeofenceEvent.dwell); +// } +// +// Future loadZones() async{ +// _zones = await locator().getAllGeoZones(GeoZonesRequestModel()); +// return this; +// } +// +// void init() async { +// // debug check (Testing Geo Zones) +// if (kDebugMode) { +// addTestingGeofences(); +// } +// _saveZones(); +// await GeofencingManager.initialize(); +// await Future.delayed(Duration(seconds: 2)); +// _registerIsolatePort(); +// _registerGeofences().then((value) { +// debugPrint(value.toString()); +// if(_testTrigger) { +// var events = [GeofenceEvent.enter,GeofenceEvent.exit]; +// events.shuffle(); +// transitionTrigger(value, null, events.first); +// } +// }); +// +// } +// +// void _saveZones() { +// var list = List(); +// _zones.forEach((element) { +// list.add(element.toJson()); +// }); +// +// var jsonString = jsonEncode(list); +// AppSharedPreferences pref = AppSharedPreferences(); +// pref.setString(HMG_GEOFENCES, jsonString); +// } +// +// Future> _registerGeofences() async { +// registeredGeofences = await GeofencingManager.getRegisteredGeofenceIds(); +// +// var maxLimit = Platform.isIOS ? 20 : 100; +// +// if (registeredGeofences.length < maxLimit) { +// var notRegistered = _zones.where((element) => !(registeredGeofences.contains(element.geofenceId()))).toList(); +// for (int i = 0; i < notRegistered.length; i++) { +// var zone = notRegistered.elementAt(i); +// var lat = double.tryParse(zone.latitude); +// var lon = double.tryParse(zone.longitude); +// var rad = double.tryParse(zone.radius.toString()); +// +// if (lat != null || lon != null || rad != null) { +// await GeofencingManager.registerGeofence(GeofenceRegion(zone.geofenceId(), lat, lon, rad, triggers), transitionTrigger); +// registeredGeofences.add(zone.geofenceId()); +// if (registeredGeofences.length >= maxLimit) { +// break; +// } +// await Future.delayed(Duration(milliseconds: 100)); +// debugPrint("Geofence: ${zone.description} registered"); +// } else { +// debugPrint("Geofence: ${zone.description} registered"); +// } +// } +// } +// return registeredGeofences; +// } +// +// void addTestingGeofences() { +// _zones.add(GeoZonesResponseModel.get("24.777577,46.652675", 150, "msH")); +// _zones.add(GeoZonesResponseModel.get("24.691136,46.650116", 150, "zkH")); +// _zones.add(GeoZonesResponseModel.get("24.7087913,46.6656461", 150, "csO")); +// } +// +// static void transitionTrigger(List id, Location location, GeofenceEvent event) { +// var dataToSend = id.map((element) => {"event": event, "geofence_id": element}).toList() ?? []; +// final SendPort send = IsolateNameServer.lookupPortByName(_isolatePortName); +// send?.send(dataToSend); +// } +// +// ReceivePort _port = ReceivePort(); +// void _registerIsolatePort() async{ +// IsolateNameServer.registerPortWithName(_port.sendPort, _isolatePortName); +// _port.listen((dynamic data) { +// +// Future result = AppSharedPreferences().getStringWithDefaultValue(HMG_GEOFENCES,"[]"); +// result.then((jsonString){ +// +// List jsonList = json.decode(jsonString) ?? []; +// List geoList = jsonList.map((e) => GeoZonesResponseModel().fromJson(e)).toList() ?? []; +// +// (data as List).forEach((element) async { +// GeofenceEvent geofenceEvent = element["event"]; +// String geofence_id = element["geofence_id"]; +// +// GeoZonesResponseModel geoZone = _findByGeofenceFrom(geoList, by: geofence_id); +// if(geoZone != null) { +// LocalNotification.getInstance().showNow( +// title: "GeofenceEvent: ${_nameOf(geofenceEvent)}", +// subtitle: geoZone.description, +// payload: json.encode(geoZone.toJson())); +// +// _logGeoZoneToServer(zoneId: geoZone.geofId, transition: _idOf(geofenceEvent)); +// } +// +// await Future.delayed(Duration(milliseconds: 700)); +// +// }); +// +// }); +// }); +// } +// +// _logGeoZoneToServer({int zoneId, int transition}){ +// locator() +// .logGeoZone(LogGeoZoneRequestModel(GeoType: transition, PointsID: zoneId ?? 1)) +// .then((response){ +// +// }).catchError((error){ +// +// }); +// +// } +// +// GeoZonesResponseModel _findByGeofenceFrom(List list, { String by}) { +// var have = list.where((element) => element.geofenceId() == by).toList().first; +// return have; +// } +// +// String _nameOf(GeofenceEvent event) { +// switch (event) { +// case GeofenceEvent.enter: +// return "Enter"; +// case GeofenceEvent.exit: +// return "Exit"; +// case GeofenceEvent.dwell: +// return "dWell"; +// default: +// return event.toString(); +// } +// } +// +// int _idOf(GeofenceEvent event){ +// switch (event) { +// case GeofenceEvent.enter: +// return 1; +// case GeofenceEvent.exit: +// return 2; +// case GeofenceEvent.dwell: +// return 3; +// default: +// return -1; +// } +// } +// } diff --git a/lib/uitl/LocalNotification.dart b/lib/uitl/LocalNotification.dart index 5b826f00..0b148f49 100644 --- a/lib/uitl/LocalNotification.dart +++ b/lib/uitl/LocalNotification.dart @@ -1,17 +1,62 @@ +import 'dart:math'; import 'dart:typed_data'; import 'dart:ui'; import 'package:flutter/cupertino.dart'; import 'package:flutter_local_notifications/flutter_local_notifications.dart'; -final FlutterLocalNotificationsPlugin flutterLocalNotificationsPlugin = - FlutterLocalNotificationsPlugin(); +final FlutterLocalNotificationsPlugin flutterLocalNotificationsPlugin = FlutterLocalNotificationsPlugin(); class LocalNotification { - static Future scheduleNotification( - {@required DateTime scheduledNotificationDateTime, - @required String title, - @required String description}) async { + Function(String payload) _onNotificationClick; + static LocalNotification _instance; + static LocalNotification getInstance(){ + return _instance; + } + static init({Function(String payload) onNotificationClick}){ + if(_instance == null){ + _instance = LocalNotification(); + _instance._onNotificationClick = onNotificationClick; + _instance._initialize(); + }else{ + assert(false,(){ + "LocalNotification Already Initialized"; + }); + } + } + + _initialize(){ + var initializationSettingsAndroid = new AndroidInitializationSettings('app_icon'); + var initializationSettingsIOS = IOSInitializationSettings(onDidReceiveLocalNotification: null); + var initializationSettings = InitializationSettings(initializationSettingsAndroid, initializationSettingsIOS); + flutterLocalNotificationsPlugin.initialize(initializationSettings, onSelectNotification: _onNotificationClick); + } + + var _random = new Random(); + _randomNumber({int from = 100000}){ + return _random.nextInt(from); + } + + _vibrationPattern(){ + var vibrationPattern = Int64List(4); + vibrationPattern[0] = 0; + vibrationPattern[1] = 1000; + vibrationPattern[2] = 5000; + vibrationPattern[3] = 2000; + + return vibrationPattern; + } + + Future showNow({@required String title, @required String subtitle, String payload}) { + Future.delayed(Duration(seconds: 1)).then((result) async { + var androidPlatformChannelSpecifics = AndroidNotificationDetails('com.hmg.local_notification', 'HMG', 'HMG', importance: Importance.Max, priority: Priority.High, ticker: 'ticker', vibrationPattern: _vibrationPattern()); + var iOSPlatformChannelSpecifics = IOSNotificationDetails(); + var platformChannelSpecifics = NotificationDetails(androidPlatformChannelSpecifics, iOSPlatformChannelSpecifics); + await flutterLocalNotificationsPlugin.show(_randomNumber(), title, subtitle, platformChannelSpecifics, payload: payload); + }); + } + + Future scheduleNotification({@required DateTime scheduledNotificationDateTime, @required String title, @required String description}) async { ///vibrationPattern var vibrationPattern = Int64List(4); vibrationPattern[0] = 0; @@ -19,10 +64,7 @@ class LocalNotification { vibrationPattern[2] = 5000; vibrationPattern[3] = 2000; - var androidPlatformChannelSpecifics = AndroidNotificationDetails( - 'active-prescriptions', - 'ActivePrescriptions', - 'ActivePrescriptionsDescription', + var androidPlatformChannelSpecifics = AndroidNotificationDetails('active-prescriptions', 'ActivePrescriptions', 'ActivePrescriptionsDescription', // icon: 'secondary_icon', sound: RawResourceAndroidNotificationSound('slow_spring_board'), @@ -34,8 +76,7 @@ class LocalNotification { ledColor: const Color.fromARGB(255, 255, 0, 0), ledOnMs: 1000, ledOffMs: 500); - var iOSPlatformChannelSpecifics = - IOSNotificationDetails(sound: 'slow_spring_board.aiff'); + var iOSPlatformChannelSpecifics = IOSNotificationDetails(sound: 'slow_spring_board.aiff'); ///change it to be as ionic // var platformChannelSpecifics = NotificationDetails( @@ -45,12 +86,9 @@ class LocalNotification { } ///Repeat notification every day at approximately 10:00:00 am - static Future showDailyAtTime() async { + Future showDailyAtTime() async { var time = Time(10, 0, 0); - var androidPlatformChannelSpecifics = AndroidNotificationDetails( - 'repeatDailyAtTime channel id', - 'repeatDailyAtTime channel name', - 'repeatDailyAtTime description'); + var androidPlatformChannelSpecifics = AndroidNotificationDetails('repeatDailyAtTime channel id', 'repeatDailyAtTime channel name', 'repeatDailyAtTime description'); var iOSPlatformChannelSpecifics = IOSNotificationDetails(); // var platformChannelSpecifics = NotificationDetails( // androidPlatformChannelSpecifics, iOSPlatformChannelSpecifics); @@ -63,12 +101,9 @@ class LocalNotification { } ///Repeat notification weekly on Monday at approximately 10:00:00 am - static Future showWeeklyAtDayAndTime() async { + Future showWeeklyAtDayAndTime() async { var time = Time(10, 0, 0); - var androidPlatformChannelSpecifics = AndroidNotificationDetails( - 'show weekly channel id', - 'show weekly channel name', - 'show weekly description'); + var androidPlatformChannelSpecifics = AndroidNotificationDetails('show weekly channel id', 'show weekly channel name', 'show weekly description'); var iOSPlatformChannelSpecifics = IOSNotificationDetails(); // var platformChannelSpecifics = NotificationDetails( // androidPlatformChannelSpecifics, iOSPlatformChannelSpecifics); @@ -81,15 +116,15 @@ class LocalNotification { // platformChannelSpecifics); } - static String _toTwoDigitString(int value) { + String _toTwoDigitString(int value) { return value.toString().padLeft(2, '0'); } - static Future cancelNotification() async { + Future cancelNotification() async { await flutterLocalNotificationsPlugin.cancel(0); } - static Future cancelAllNotifications() async { + Future cancelAllNotifications() async { await flutterLocalNotificationsPlugin.cancelAll(); } } diff --git a/lib/uitl/PlatformBridge.dart b/lib/uitl/PlatformBridge.dart new file mode 100644 index 00000000..ca410435 --- /dev/null +++ b/lib/uitl/PlatformBridge.dart @@ -0,0 +1,147 @@ +import 'dart:developer'; + +import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/config/localized_values.dart'; +import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; +import 'package:diplomaticquarterapp/core/service/client/base_app_client.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/services.dart'; + +class PlatformBridge { + static const platform = const MethodChannel("HMG-Platform-Bridge"); + static PlatformBridge _shared; + static BuildContext _context; + + // // Singleton + // static final PlatformBridge _singleton = PlatformBridge._internal(); + // factory PlatformBridge() { + // return _singleton; + // } + // PlatformBridge._internal(); + + static PlatformBridge shared() { + if (_shared == null) { + assert(true, "PlatformBridge is not initialized, (Initialized it by calling 'PlatformBridge.init(BuildContext))'."); + } + return _shared; + } + + static void init(BuildContext context) { + _context = context; + _shared = PlatformBridge(); + + Future incoming(MethodCall methodCall) async { + switch (methodCall.method) { + case 'localizedValue': + String key = methodCall.arguments.toString(); + return localizedValue(key); + + case 'getGeoZones': + return getGeoZones(); + + case 'getLogGeofenceFullUrl': + return getLogGeofenceFullUrl(); + + case 'getDefaultHttpParameters': + return getDefaultHttpParameters(); + + default: + throw MissingPluginException('notImplemented'); + } + } + + platform.setMethodCallHandler(incoming); + } + + //--------------------------------- + // Incoming below + //--------------------------------- + static Future localizedValue(String forKey) async { + String currentLanguage = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + Object localized = platformLocalizedValues[forKey][currentLanguage]; + return (localized != null || (localized is String)) ? localized : forKey; + } + + static Future getGeoZones() async { + var res = await sharedPref.getStringWithDefaultValue(HMG_GEOFENCES, "[]"); + return res; + } + + static Future getLogGeofenceFullUrl() async { + var res = BASE_URL + LOG_GEO_ZONES; + return res; + } + + static Future getDefaultHttpParameters() async { + return BaseAppClient.defaultHttpParameters(); + } + + //--//--//--//--//--//--//--//--//--//--//--//--//--//--//--//--//--//--//--//--//--//--//--// + //--//--//--//--//--//--//--//--//--//--//--//--//--//--//--//--//--//--//--//--//--//--//--// + + //--------------------------------- + // Outgoing below + //--------------------------------- + // Method Names + static const hmg_internet_wifi_connect_method = "connectHMGInternetWifi"; + static const hmg_guest_wifi_connect_method = "connectHMGGuestWifi"; + static const is_hmg_network_available_method = "isHMGNetworkAvailable"; + static const enable_wifi_if_not = "enableWifiIfNot"; + static const show_loading_method = "loading"; + static const register_Hmg_Geofences = "registerHmgGeofences"; + + Future connectHMGInternetWifi(String patientId) { + print("Invoking platform method: $hmg_internet_wifi_connect_method"); + try { + return platform.invokeMethod(hmg_internet_wifi_connect_method, [patientId]); + } on PlatformException catch (e) { + print(e); + return Future.error(e); + } + } + + Future connectHMGGuestWifi() { + print("Invoking platform method: $hmg_guest_wifi_connect_method"); + try { + return platform.invokeMethod(hmg_guest_wifi_connect_method); + } on PlatformException catch (e) { + print(e); + return Future.error(e); + } + } + + Future isHMGNetworkAvailable(String ssid) { + print("Invoking platform method: $is_hmg_network_available_method"); + try { + return platform.invokeMethod(is_hmg_network_available_method, ssid); + } on PlatformException catch (e) { + print(e); + return Future.error(e); + } + } + + Future enableWifiIfNot() async { + print("Invoking platform method: $enable_wifi_if_not"); + try { + return platform.invokeMethod(enable_wifi_if_not); + } on PlatformException catch (e) { + print(e); + return Future.error(e); + } + } + + void showLoading(String message, bool show) async { + print("Invoking platform method: $show_loading_method"); + try { + final int result = await platform.invokeMethod(show_loading_method, [message, show]); + } on PlatformException catch (e) { + print(e); + } + } + + // GEO Fences + void registerHmgGeofences() async { + final int result = await platform.invokeMethod(register_Hmg_Geofences); + } +} diff --git a/lib/uitl/date_uitl.dart b/lib/uitl/date_uitl.dart index 0b2b45d9..1068dc74 100644 --- a/lib/uitl/date_uitl.dart +++ b/lib/uitl/date_uitl.dart @@ -19,24 +19,9 @@ class DateUtil { return DateTime.now(); } - static DateTime convertStringToDateNoTimeZone(String date) { - if (date != null) { - const start = "/Date("; - const end = ")/"; - final startIndex = date.indexOf(start); - final endIndex = date.indexOf(end, startIndex + start.length); - return DateTime.fromMillisecondsSinceEpoch( - int.parse( - date.substring(startIndex + start.length, endIndex), - ), - ); - } else - return DateTime.now(); - } - static String convertDateToString(DateTime date) { const start = "/Date("; - const end = "+0300)/"; + const end = "+0300)"; int milliseconds = date.millisecondsSinceEpoch; return start + "$milliseconds" + end; diff --git a/lib/uitl/location_util.dart b/lib/uitl/location_util.dart index 5c2d3a3c..e3012734 100644 --- a/lib/uitl/location_util.dart +++ b/lib/uitl/location_util.dart @@ -15,12 +15,12 @@ class LocationUtils { void getCurrentLocation() async { print("current location"); - Geolocator.isLocationServiceEnabled().then((value) { + isLocationServiceEnabled().then((value) { if (value) { - Geolocator.checkPermission().then((permission) { + checkPermission().then((permission) { if (permission == LocationPermission.always || permission == LocationPermission.whileInUse) { - Geolocator.getLastKnownPosition().then((value) => setLocation(value)); + getLastKnownPosition().then((value) => setLocation(value)); } if (permission == LocationPermission.denied || @@ -48,9 +48,9 @@ class LocationUtils { okFunction: () => { ConfirmDialog.closeAlertDialog(context), if (isPermissionError) - Geolocator.openAppSettings() + openAppSettings() else - Geolocator.openLocationSettings() + openLocationSettings() }, cancelFunction: () => {}); return dialog.showAlertDialog(context); @@ -58,8 +58,8 @@ class LocationUtils { void setLocation(Position position) { print(position); - this.sharedPref.setDouble(USER_LAT, position.latitude ?? 0.0); - this.sharedPref.setDouble(USER_LONG, position.longitude ?? 0.0); + this.sharedPref.setDouble(USER_LAT, position.latitude); + this.sharedPref.setDouble(USER_LONG, position.longitude); } void setZeroLocation() { diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index d76c6e7d..6a81a4b5 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -1,6 +1,7 @@ import 'dart:async'; import 'package:diplomaticquarterapp/config/localized_values.dart'; +import 'package:diplomaticquarterapp/pages/symptom-checker/select-gender.dart'; import 'package:flutter/foundation.dart' show SynchronousFuture; import 'package:flutter/material.dart'; @@ -13,8 +14,11 @@ class TranslationBase { return Localizations.of(context, TranslationBase); } - String get dashboardScreenToolbarTitle => - localizedValues['dashboardScreenToolbarTitle'][locale.languageCode]; + String by(String key) { + return localizedValues[key][locale.languageCode]; + } + + String get dashboardScreenToolbarTitle => localizedValues['dashboardScreenToolbarTitle'][locale.languageCode]; String get settings => localizedValues['settings'][locale.languageCode]; @@ -54,11 +58,9 @@ class TranslationBase { String get nearestAppo => localizedValues['nearestAppo'][locale.languageCode]; - String get searchByDocText => - localizedValues['searchByDocText'][locale.languageCode]; + String get searchByDocText => localizedValues['searchByDocText'][locale.languageCode]; - String get enterDocName => - localizedValues['enterDocName'][locale.languageCode]; + String get enterDocName => localizedValues['enterDocName'][locale.languageCode]; String get search => localizedValues['search'][locale.languageCode]; @@ -68,41 +70,33 @@ class TranslationBase { String get appoInfo => localizedValues['appoInfo'][locale.languageCode]; - String get availableAppo => - localizedValues['availableAppo'][locale.languageCode]; + String get availableAppo => localizedValues['availableAppo'][locale.languageCode]; String get gender => localizedValues['gender'][locale.languageCode]; String get nationality => localizedValues['nationality'][locale.languageCode]; - String get docQualifications => - localizedValues['docQualifications'][locale.languageCode]; + String get docQualifications => localizedValues['docQualifications'][locale.languageCode]; - String get confirmAppoHeading => - localizedValues['confirmAppoHeading'][locale.languageCode]; + String get confirmAppoHeading => localizedValues['confirmAppoHeading'][locale.languageCode]; String get patientInfo => localizedValues['patientInfo'][locale.languageCode]; String get bookSuccess => localizedValues['bookSuccess'][locale.languageCode]; - String get patientShare => - localizedValues['patientShare'][locale.languageCode]; + String get patientShare => localizedValues['patientShare'][locale.languageCode]; - String get patientShareWithTax => - localizedValues['patientShareWithTax'][locale.languageCode]; + String get patientShareWithTax => localizedValues['patientShareWithTax'][locale.languageCode]; String get confirmAppo => localizedValues['confirmAppo'][locale.languageCode]; String get confirm => localizedValues['confirm'][locale.languageCode]; - String get confirmLiveCare => - localizedValues['confirmLiveCare'][locale.languageCode]; + String get confirmLiveCare => localizedValues['confirmLiveCare'][locale.languageCode]; - String get waitingForDoctor => - localizedValues['waitingForDoctor'][locale.languageCode]; + String get waitingForDoctor => localizedValues['waitingForDoctor'][locale.languageCode]; - String get confirmLater => - localizedValues['confirmLater'][locale.languageCode]; + String get confirmLater => localizedValues['confirmLater'][locale.languageCode]; String get todoList => localizedValues['todoList'][locale.languageCode]; @@ -118,27 +112,22 @@ class TranslationBase { String get login => localizedValues['login'][locale.languageCode]; - String get loginregister => - localizedValues['loginregister'][locale.languageCode]; + String get loginregister => localizedValues['loginregister'][locale.languageCode]; String get poweredBy => localizedValues['poweredBy'][locale.languageCode]; String get welcome => localizedValues['welcome'][locale.languageCode]; - String get welcomeText => - localizedValues['welcome_text'][locale.languageCode]; + String get welcomeText => localizedValues['welcome_text'][locale.languageCode]; - String get welcomeText2 => - localizedValues['welcome_text2'][locale.languageCode]; + String get welcomeText2 => localizedValues['welcome_text2'][locale.languageCode]; String get yes => localizedValues['yes'][locale.languageCode]; String get no => localizedValues['no'][locale.languageCode]; - String get logintypeRadio => - localizedValues['logintyperadio'][locale.languageCode]; - String get registerInfoFamily => - localizedValues['register-info-family'][locale.languageCode]; + String get logintypeRadio => localizedValues['logintyperadio'][locale.languageCode]; + String get registerInfoFamily => localizedValues['register-info-family'][locale.languageCode]; String get registerNow => localizedValues['registernow'][locale.languageCode]; @@ -147,18 +136,14 @@ class TranslationBase { String get idNo => localizedValues['national-id'][locale.languageCode]; String get fileNo => localizedValues['fileNo'][locale.languageCode]; -String get fileno => localizedValues['fileno'][locale.languageCode]; - String get forgotPassword => - localizedValues['forgotFileNo'][locale.languageCode]; + String get fileno => localizedValues['fileno'][locale.languageCode]; + String get forgotPassword => localizedValues['forgotFileNo'][locale.languageCode]; - String get forgotFileNoTitle => - localizedValues['forgotFileNoTitle'][locale.languageCode]; + String get forgotFileNoTitle => localizedValues['forgotFileNoTitle'][locale.languageCode]; - String get enterNationalId => - localizedValues['enter-national-id'][locale.languageCode]; + String get enterNationalId => localizedValues['enter-national-id'][locale.languageCode]; - String get profileInfo => - localizedValues['profile-info'][locale.languageCode]; + String get profileInfo => localizedValues['profile-info'][locale.languageCode]; String get submit => localizedValues['submit'][locale.languageCode]; @@ -168,42 +153,31 @@ String get fileno => localizedValues['fileno'][locale.languageCode]; String get hijriDate => localizedValues['hijri-date'][locale.languageCode]; - String get gregorianDate => - localizedValues['gregorian-date'][locale.languageCode]; + String get gregorianDate => localizedValues['gregorian-date'][locale.languageCode]; - String get verifyLoginWith => - localizedValues['verify-login-with'][locale.languageCode]; + String get verifyLoginWith => localizedValues['verify-login-with'][locale.languageCode]; String get register => localizedValues['register-user'][locale.languageCode]; - String get verifyFingerprint => - localizedValues['verify-with-fingerprint'][locale.languageCode]; + String get verifyFingerprint => localizedValues['verify-with-fingerprint'][locale.languageCode]; - String get verifyFaceID => - localizedValues['verify-with-faceid'][locale.languageCode]; + String get verifyFaceID => localizedValues['verify-with-faceid'][locale.languageCode]; - String get verifySMS => - localizedValues['verify-with-sms'][locale.languageCode]; + String get verifySMS => localizedValues['verify-with-sms'][locale.languageCode]; - String get verifyWhatsApp => - localizedValues['verify-with-whatsapp'][locale.languageCode]; + String get verifyWhatsApp => localizedValues['verify-with-whatsapp'][locale.languageCode]; String get lastLoginAt => localizedValues['last-login'][locale.languageCode]; - String get lastLoginWith => - localizedValues['last-login-with'][locale.languageCode]; + String get lastLoginWith => localizedValues['last-login-with'][locale.languageCode]; - String get verifyFingerprint2 => - localizedValues['verify-fingerprint'][locale.languageCode]; + String get verifyFingerprint2 => localizedValues['verify-fingerprint'][locale.languageCode]; - String get searchMedicine => - localizedValues['searchMedicine'][locale.languageCode]; + String get searchMedicine => localizedValues['searchMedicine'][locale.languageCode]; - String get searchMedicineHere => - localizedValues['searchMedicineHere'][locale.languageCode]; + String get searchMedicineHere => localizedValues['searchMedicineHere'][locale.languageCode]; - String get pendingPayment => - localizedValues['pendingPayment'][locale.languageCode]; + String get pendingPayment => localizedValues['pendingPayment'][locale.languageCode]; String get payNow => localizedValues['payNow'][locale.languageCode]; @@ -213,31 +187,23 @@ String get fileno => localizedValues['fileno'][locale.languageCode]; String get livecare => localizedValues['livecare'][locale.languageCode]; - String get upcomingNoAction => - localizedValues['upcoming-noAction'][locale.languageCode]; + String get upcomingNoAction => localizedValues['upcoming-noAction'][locale.languageCode]; - String get upcomingConfirm => - localizedValues['upcoming-confirm'][locale.languageCode]; + String get upcomingConfirm => localizedValues['upcoming-confirm'][locale.languageCode]; - String get upcomingPaymentPending => - localizedValues['upcoming-payment-pending'][locale.languageCode]; + String get upcomingPaymentPending => localizedValues['upcoming-payment-pending'][locale.languageCode]; - String get upcomingPaymentNow => - localizedValues['upcoming-payment-now'][locale.languageCode]; + String get upcomingPaymentNow => localizedValues['upcoming-payment-now'][locale.languageCode]; String get upcomingQR => localizedValues['upcoming-QR'][locale.languageCode]; - String get upcomingVirtual => - localizedValues['upcoming-virtual'][locale.languageCode]; + String get upcomingVirtual => localizedValues['upcoming-virtual'][locale.languageCode]; - String get upcomingLivecare => - localizedValues['upcoming-livecare'][locale.languageCode]; + String get upcomingLivecare => localizedValues['upcoming-livecare'][locale.languageCode]; - String get liveCareAppo => - localizedValues['livecareAppo'][locale.languageCode]; + String get liveCareAppo => localizedValues['livecareAppo'][locale.languageCode]; - String get upcomingDetails => - localizedValues['upcoming-details'][locale.languageCode]; + String get upcomingDetails => localizedValues['upcoming-details'][locale.languageCode]; String get reschedule => localizedValues['reschedule'][locale.languageCode]; @@ -255,96 +221,67 @@ String get fileno => localizedValues['fileno'][locale.languageCode]; String get payment => localizedValues['payment'][locale.languageCode]; - String get cancel_nocaps => - localizedValues['cancel-nocaps'][locale.languageCode]; + String get cancel_nocaps => localizedValues['cancel-nocaps'][locale.languageCode]; - String get cancelAppoMsg => - localizedValues['cancelAppoMsg'][locale.languageCode]; + String get cancelAppoMsg => localizedValues['cancelAppoMsg'][locale.languageCode]; - String get pharmaciesList => - localizedValues['pharmaciesList'][locale.languageCode]; + String get pharmaciesList => localizedValues['pharmaciesList'][locale.languageCode]; String get description => localizedValues['description'][locale.languageCode]; String get price => localizedValues['price'][locale.languageCode]; - String get youCanFindItIn => - localizedValues['youCanFindItIn'][locale.languageCode]; + String get youCanFindItIn => localizedValues['youCanFindItIn'][locale.languageCode]; - String get pleaseEnterMedicineName => - localizedValues['pleaseEnterMedicineName'][locale.languageCode]; + String get pleaseEnterMedicineName => localizedValues['pleaseEnterMedicineName'][locale.languageCode]; - String get verificationMessage => - localizedValues['verification_message'][locale.languageCode]; + String get verificationMessage => localizedValues['verification_message'][locale.languageCode]; - String get validationMessage => - localizedValues['validation_message'][locale.languageCode]; + String get validationMessage => localizedValues['validation_message'][locale.languageCode]; - String get arabicChange => - localizedValues['arabic-change'][locale.languageCode]; + String get arabicChange => localizedValues['arabic-change'][locale.languageCode]; - String get notification => - localizedValues['notification'][locale.languageCode]; + String get notification => localizedValues['notification'][locale.languageCode]; String get appsetting => localizedValues['app-settings'][locale.languageCode]; String get rateApp => localizedValues['rate-app'][locale.languageCode]; - String get setReminder => - localizedValues['set-reminder'][locale.languageCode]; + String get setReminder => localizedValues['set-reminder'][locale.languageCode]; String get before => localizedValues['before'][locale.languageCode]; String get minute => localizedValues['minute'][locale.languageCode]; String get hour => localizedValues['hour'][locale.languageCode]; - String get reminderSuccess => - localizedValues['reminderSuccess'][locale.languageCode]; - String get patientShareToDo => - localizedValues['patientShareToDo'][locale.languageCode]; - String get patientTaxToDo => - localizedValues['patientTaxToDo'][locale.languageCode]; - String get patientShareTotalToDo => - localizedValues['patientShareTotalToDo'][locale.languageCode]; - String get paymentMethod => - localizedValues['paymentMethod'][locale.languageCode]; + String get reminderSuccess => localizedValues['reminderSuccess'][locale.languageCode]; + String get patientShareToDo => localizedValues['patientShareToDo'][locale.languageCode]; + String get patientTaxToDo => localizedValues['patientTaxToDo'][locale.languageCode]; + String get patientShareTotalToDo => localizedValues['patientShareTotalToDo'][locale.languageCode]; + String get paymentMethod => localizedValues['paymentMethod'][locale.languageCode]; - String get moreVerification => - localizedValues['more-verify'][locale.languageCode]; + String get moreVerification => localizedValues['more-verify'][locale.languageCode]; - String get welcomeBack => - localizedValues['welcome-back'][locale.languageCode]; + String get welcomeBack => localizedValues['welcome-back'][locale.languageCode]; - String get accountInfo => - localizedValues['account-info'][locale.languageCode]; + String get accountInfo => localizedValues['account-info'][locale.languageCode]; - String get useAnotherAccount => - localizedValues['another-acc'][locale.languageCode]; + String get useAnotherAccount => localizedValues['another-acc'][locale.languageCode]; String get next => localizedValues['next'][locale.languageCode]; - String get noNeedToWaitInLine => - localizedValues['noNeedToWaitInLine'][locale.languageCode]; - String get useQRAppoAttend => - localizedValues['useQRAppoAttend'][locale.languageCode]; - String get passQRAppoAttend => - localizedValues['passQRAppoAttend'][locale.languageCode]; - String get sitWaitingQR => - localizedValues['sitWaitingQR'][locale.languageCode]; - String get attendRegisterCode => - localizedValues['attendRegisterCode'][locale.languageCode]; - String get scanQRHospital => - localizedValues['scanQRHospital'][locale.languageCode]; + String get noNeedToWaitInLine => localizedValues['noNeedToWaitInLine'][locale.languageCode]; + String get useQRAppoAttend => localizedValues['useQRAppoAttend'][locale.languageCode]; + String get passQRAppoAttend => localizedValues['passQRAppoAttend'][locale.languageCode]; + String get sitWaitingQR => localizedValues['sitWaitingQR'][locale.languageCode]; + String get attendRegisterCode => localizedValues['attendRegisterCode'][locale.languageCode]; + String get scanQRHospital => localizedValues['scanQRHospital'][locale.languageCode]; String get sendEmail => localizedValues['sendEmail'][locale.languageCode]; String get close => localizedValues['close'][locale.languageCode]; String get booked => localizedValues['booked'][locale.languageCode]; String get confirmed => localizedValues['confirmed'][locale.languageCode]; String get arrived => localizedValues['arrived'][locale.languageCode]; - String get payNowBookSuccess => - localizedValues['payNowBookSuccess'][locale.languageCode]; - String get payNowBookSuccesstext1 => - localizedValues['payNowBookSuccesstext1'][locale.languageCode]; - String get payNowBookSuccesstext2 => - localizedValues['payNowBookSuccesstext2'][locale.languageCode]; + String get payNowBookSuccess => localizedValues['payNowBookSuccess'][locale.languageCode]; + String get payNowBookSuccesstext1 => localizedValues['payNowBookSuccesstext1'][locale.languageCode]; + String get payNowBookSuccesstext2 => localizedValues['payNowBookSuccesstext2'][locale.languageCode]; String get payLater => localizedValues['payLater'][locale.languageCode]; - String get askDocNotAllowed => - localizedValues['askDocNotAllowed'][locale.languageCode]; + String get askDocNotAllowed => localizedValues['askDocNotAllowed'][locale.languageCode]; String get firstName => localizedValues['first-name'][locale.languageCode]; String get middleName => localizedValues['middle-name'][locale.languageCode]; @@ -355,15 +292,13 @@ String get fileno => localizedValues['fileno'][locale.languageCode]; String get female => localizedValues['female'][locale.languageCode]; - String get prefferedLanguage => - localizedValues['preferred-language'][locale.languageCode]; + String get prefferedLanguage => localizedValues['preferred-language'][locale.languageCode]; String get english => localizedValues['english'][locale.languageCode]; String get arabic => localizedValues['arabic'][locale.languageCode]; - String get registrLocation => - localizedValues['locations-register'][locale.languageCode]; + String get registrLocation => localizedValues['locations-register'][locale.languageCode]; String get ksa => localizedValues['ksa'][locale.languageCode]; @@ -373,16 +308,13 @@ String get fileno => localizedValues['fileno'][locale.languageCode]; String get family => localizedValues['family'][locale.languageCode]; - String get myFamilyFiles => - localizedValues['family-title'][locale.languageCode]; + String get myFamilyFiles => localizedValues['family-title'][locale.languageCode]; String get myFamily => localizedValues['myFamily'][locale.languageCode]; String get oxygenation => localizedValues['oxygenation'][locale.languageCode]; - String get respirationRate => - localizedValues['respirationRate'][locale.languageCode]; + String get respirationRate => localizedValues['respirationRate'][locale.languageCode]; - String get bodyMeasurements => - localizedValues['bodyMeasurements'][locale.languageCode]; + String get bodyMeasurements => localizedValues['bodyMeasurements'][locale.languageCode]; String get height => localizedValues['height'][locale.languageCode]; String get temperature => localizedValues['temperature'][locale.languageCode]; @@ -391,8 +323,7 @@ String get fileno => localizedValues['fileno'][locale.languageCode]; String get respiration => localizedValues['respiration'][locale.languageCode]; - String get bloodPressure => - localizedValues['bloodPressure'][locale.languageCode]; + String get bloodPressure => localizedValues['bloodPressure'][locale.languageCode]; String get painScale => localizedValues['painScale'][locale.languageCode]; String get heart => localizedValues['heart'][locale.languageCode]; @@ -401,8 +332,7 @@ String get fileno => localizedValues['fileno'][locale.languageCode]; String get request => localizedValues['request'][locale.languageCode]; String get memberName => localizedValues['member-name'][locale.languageCode]; String get switchUser => localizedValues['switch-login'][locale.languageCode]; - String get removeMember => - localizedValues['remove-membe'][locale.languageCode]; + String get removeMember => localizedValues['remove-membe'][locale.languageCode]; String get allowView => localizedValues['allow-view'][locale.languageCode]; String get rejectView => localizedValues['reject-view'][locale.languageCode]; String get deleteView => localizedValues['delete-view'][locale.languageCode]; @@ -411,60 +341,40 @@ String get fileno => localizedValues['fileno'][locale.languageCode]; String get companyName => localizedValues['companyName'][locale.languageCode]; String get receiptOn => localizedValues['receiptOn'][locale.languageCode]; String get expiryDate => localizedValues['expiryDate'][locale.languageCode]; - String get procedureName => - localizedValues['procedureName'][locale.languageCode]; - String get procedureStatus => - localizedValues['procedureStatus'][locale.languageCode]; + String get procedureName => localizedValues['procedureName'][locale.languageCode]; + String get procedureStatus => localizedValues['procedureStatus'][locale.languageCode]; String get usageStatus => localizedValues['usageStatus'][locale.languageCode]; String get unusedCount => localizedValues['unusedCount'][locale.languageCode]; - String get totalApproval => - localizedValues['totalApproval'][locale.languageCode]; + String get totalApproval => localizedValues['totalApproval'][locale.languageCode]; String get category => localizedValues['category'][locale.languageCode]; - String get expirationDate => - localizedValues['expirationDate'][locale.languageCode]; + String get expirationDate => localizedValues['expirationDate'][locale.languageCode]; String get patientCard => localizedValues['patientCard'][locale.languageCode]; - String get policyNumber => - localizedValues['policyNumber'][locale.languageCode]; + String get policyNumber => localizedValues['policyNumber'][locale.languageCode]; String get seeDetails => localizedValues['seeDetails'][locale.languageCode]; - String get insuranceCards => - localizedValues['insuranceCards'][locale.languageCode]; + String get insuranceCards => localizedValues['insuranceCards'][locale.languageCode]; String get requestType => localizedValues['requestType'][locale.languageCode]; - String get addFamilyMember => - localizedValues['add-new-member'][locale.languageCode]; - String get removeFamilyMember => - localizedValues['remove-family-member'][locale.languageCode]; - - String get myMedicalFile => - localizedValues['MyMedicalFile'][locale.languageCode]; - String get myMedicalFileSubTitle => - localizedValues['myMedicalFileSubTitle'][locale.languageCode]; + String get addFamilyMember => localizedValues['add-new-member'][locale.languageCode]; + String get removeFamilyMember => localizedValues['remove-family-member'][locale.languageCode]; + + String get myMedicalFile => localizedValues['MyMedicalFile'][locale.languageCode]; + String get myMedicalFileSubTitle => localizedValues['myMedicalFileSubTitle'][locale.languageCode]; String get viewMore => localizedValues['viewMore'][locale.languageCode]; - String get homeHealthCareService => - localizedValues['homeHealthCareService'][locale.languageCode]; - String get onlinePharmacy => - localizedValues['OnlinePharmacy'][locale.languageCode]; - String get emergencyService => - localizedValues['EmergencyService'][locale.languageCode]; - String get onlinePaymentService => - localizedValues['OnlinePaymentService'][locale.languageCode]; - String get offersAndPackages => - localizedValues['OffersAndPackages'][locale.languageCode]; - String get comprehensiveMedicalCheckup => - localizedValues['ComprehensiveMedicalCheckup'][locale.languageCode]; + String get homeHealthCareService => localizedValues['homeHealthCareService'][locale.languageCode]; + String get onlinePharmacy => localizedValues['OnlinePharmacy'][locale.languageCode]; + String get emergencyService => localizedValues['EmergencyService'][locale.languageCode]; + String get onlinePaymentService => localizedValues['OnlinePaymentService'][locale.languageCode]; + String get offersAndPackages => localizedValues['OffersAndPackages'][locale.languageCode]; + String get comprehensiveMedicalCheckup => localizedValues['ComprehensiveMedicalCheckup'][locale.languageCode]; String get hMGService => localizedValues['HMGService'][locale.languageCode]; - String get viewAllHabibMedicalService => - localizedValues['ViewAllHabibMedicalService'][locale.languageCode]; + String get viewAllHabibMedicalService => localizedValues['ViewAllHabibMedicalService'][locale.languageCode]; String get viewAll => localizedValues['viewAll'][locale.languageCode]; + String get view => localizedValues['view'][locale.languageCode]; String get contactUs => localizedValues['ContactUs'][locale.languageCode]; - String get viewAllWaysReachUs => - localizedValues['ViewAllWaysReachUs'][locale.languageCode]; - String get medicalProfile => - localizedValues['medicalProfile'][locale.languageCode]; + String get viewAllWaysReachUs => localizedValues['ViewAllWaysReachUs'][locale.languageCode]; + String get medicalProfile => localizedValues['medicalProfile'][locale.languageCode]; String get parking => localizedValues['parking'][locale.languageCode]; - String get alhabiServices => - localizedValues['alhabiServices'][locale.languageCode]; - String get parkingTitle => - localizedValues['parkingTitle'][locale.languageCode]; + String get alhabiServices => localizedValues['alhabiServices'][locale.languageCode]; + String get parkingTitle => localizedValues['parkingTitle'][locale.languageCode]; String get readBarcode => localizedValues['readBarcode'][locale.languageCode]; String get showMyPark => localizedValues['showMyPark'][locale.languageCode]; String get clearMyData => localizedValues['clearMyData'][locale.languageCode]; @@ -472,186 +382,117 @@ String get fileno => localizedValues['fileno'][locale.languageCode]; String get gate => localizedValues['gate'][locale.languageCode]; String get building => localizedValues['building'][locale.languageCode]; String get branch => localizedValues['branch'][locale.languageCode]; - String get emergencyServices => - localizedValues['emergencyServices'][locale.languageCode]; + String get emergencyServices => localizedValues['emergencyServices'][locale.languageCode]; String get nearester => localizedValues['nearester'][locale.languageCode]; String get locationa => localizedValues['locationa'][locale.languageCode]; - String get ambulancerequest => - localizedValues['ambulancerequest'][locale.languageCode]; + String get ambulancerequest => localizedValues['ambulancerequest'][locale.languageCode]; String get requestA => localizedValues['requestA'][locale.languageCode]; - String get consultation => - localizedValues['consultation'][locale.languageCode]; + String get consultation => localizedValues['consultation'][locale.languageCode]; String get logs => localizedValues['logs'][locale.languageCode]; - String get textToSpeech => - localizedValues['textToSpeech'][locale.languageCode]; - - String get myAppointments => - localizedValues['MyAppointments'][locale.languageCode]; - String get noBookedAppointments => - localizedValues['NoBookedAppointments'][locale.languageCode]; - String get noConfirmedAppointments => - localizedValues['NoConfirmedAppointments'][locale.languageCode]; - String get noArrivedAppointments => - localizedValues['noArrivedAppointments'][locale.languageCode]; - String get myAppointmentsList => - localizedValues['MyAppointmentsList'][locale.languageCode]; + String get textToSpeech => localizedValues['textToSpeech'][locale.languageCode]; + + String get myAppointments => localizedValues['MyAppointments'][locale.languageCode]; + String get noBookedAppointments => localizedValues['NoBookedAppointments'][locale.languageCode]; + String get noConfirmedAppointments => localizedValues['NoConfirmedAppointments'][locale.languageCode]; + String get noArrivedAppointments => localizedValues['noArrivedAppointments'][locale.languageCode]; + String get myAppointmentsList => localizedValues['MyAppointmentsList'][locale.languageCode]; String get radiology => localizedValues['Radiology'][locale.languageCode]; - String get radiologySubtitle => - localizedValues['RadiologySubtitle'][locale.languageCode]; + String get radiologySubtitle => localizedValues['RadiologySubtitle'][locale.languageCode]; String get lab => localizedValues['Lab'][locale.languageCode]; String get labSubtitle => localizedValues['LabSubtitle'][locale.languageCode]; String get medicines => localizedValues['Medicines'][locale.languageCode]; - String get medicinesSubtitle => - localizedValues['MedicinesSubtitle'][locale.languageCode]; + String get medicinesSubtitle => localizedValues['MedicinesSubtitle'][locale.languageCode]; String get vitalSigns => localizedValues['VitalSigns'][locale.languageCode]; - String get vitalSignsSubtitle => - localizedValues['VitalSignsSubTitle'][locale.languageCode]; + String get vitalSignsSubtitle => localizedValues['VitalSignsSubTitle'][locale.languageCode]; String get myMedical => localizedValues['MyMedical'][locale.languageCode]; - String get myMedicalSubtitle => - localizedValues['MyMedicalSubtitle'][locale.languageCode]; + String get myMedicalSubtitle => localizedValues['MyMedicalSubtitle'][locale.languageCode]; String get myDoctor => localizedValues['MyDoctor'][locale.languageCode]; - String get myDoctorSubtitle => - localizedValues['MyDoctorSubtitle'][locale.languageCode]; + String get myDoctorSubtitle => localizedValues['MyDoctorSubtitle'][locale.languageCode]; String get eye => localizedValues['Eye'][locale.languageCode]; String get eyeSubtitle => localizedValues['EyeSubtitle'][locale.languageCode]; String get insurance => localizedValues['Insurance'][locale.languageCode]; - String get insuranceSubtitle => - localizedValues['InsuranceSubtitle'][locale.languageCode]; - String get updateInsurance => - localizedValues['UpdateInsurance'][locale.languageCode]; - String get updateInsuranceSubtitle => - localizedValues['UpdateInsuranceSubtitle'][locale.languageCode]; - String get insuranceApproval => - localizedValues['InsuranceApproval'][locale.languageCode]; - String get insuranceApprovalSubtitle => - localizedValues['InsuranceApprovalSubtitle'][locale.languageCode]; + String get insuranceSubtitle => localizedValues['InsuranceSubtitle'][locale.languageCode]; + String get updateInsurance => localizedValues['UpdateInsurance'][locale.languageCode]; + String get updateInsuranceSubtitle => localizedValues['UpdateInsuranceSubtitle'][locale.languageCode]; + String get insuranceApproval => localizedValues['InsuranceApproval'][locale.languageCode]; + String get insuranceApprovalSubtitle => localizedValues['InsuranceApprovalSubtitle'][locale.languageCode]; String get allergies => localizedValues['Allergies'][locale.languageCode]; - String get allergiesSubtitle => - localizedValues['AllergiesSubtitle'][locale.languageCode]; + String get allergiesSubtitle => localizedValues['AllergiesSubtitle'][locale.languageCode]; String get myVaccines => localizedValues['MyVaccines'][locale.languageCode]; - String get myVaccinesSubtitle => - localizedValues['MyVaccinesSubtitle'][locale.languageCode]; + String get myVaccinesSubtitle => localizedValues['MyVaccinesSubtitle'][locale.languageCode]; String get medical => localizedValues['Medical'][locale.languageCode]; - String get medicalSubtitle => - localizedValues['MedicalSubtitle'][locale.languageCode]; + String get medicalSubtitle => localizedValues['MedicalSubtitle'][locale.languageCode]; String get monthly => localizedValues['Monthly'][locale.languageCode]; - String get monthlySubtitle => - localizedValues['MonthlySubtitle'][locale.languageCode]; + String get monthlySubtitle => localizedValues['MonthlySubtitle'][locale.languageCode]; String get sick => localizedValues['Sick'][locale.languageCode]; - String get sickSubtitle => - localizedValues['SickSubtitle'][locale.languageCode]; + String get sickSubtitle => localizedValues['SickSubtitle'][locale.languageCode]; String get myBalance => localizedValues['MyBalance'][locale.languageCode]; - String get myBalanceSubtitle => - localizedValues['MyBalanceSubtitle'][locale.languageCode]; + String get myBalanceSubtitle => localizedValues['MyBalanceSubtitle'][locale.languageCode]; String get patientCall => localizedValues['PatientCall'][locale.languageCode]; - String get patientCallSubtitle => - localizedValues['PatientCallSubtitle'][locale.languageCode]; - String get smartWatches => - localizedValues['SmartWatches'][locale.languageCode]; - String get smartWatchesSubtitle => - localizedValues['SmartWatchesSubtitle'][locale.languageCode]; + String get patientCallSubtitle => localizedValues['PatientCallSubtitle'][locale.languageCode]; + String get smartWatches => localizedValues['SmartWatches'][locale.languageCode]; + String get smartWatchesSubtitle => localizedValues['SmartWatchesSubtitle'][locale.languageCode]; String get myTrackers => localizedValues['MyTrackers'][locale.languageCode]; - String get myTrackersSubtitle => - localizedValues['MyTrackersSubtitle'][locale.languageCode]; + String get myTrackersSubtitle => localizedValues['MyTrackersSubtitle'][locale.languageCode]; String get askYour => localizedValues['AskYour'][locale.languageCode]; - String get askYourSubtitle => - localizedValues['AskYourSubtitle'][locale.languageCode]; + String get askYourSubtitle => localizedValues['AskYourSubtitle'][locale.languageCode]; String get internet => localizedValues['Internet'][locale.languageCode]; - String get internetSubtitle => - localizedValues['InternetSubtitle'][locale.languageCode]; + String get internetSubtitle => localizedValues['InternetSubtitle'][locale.languageCode]; String get chatbot => localizedValues['Chatbot'][locale.languageCode]; - String get chatbotSubtitle => - localizedValues['ChatbotSubtitle'][locale.languageCode]; + String get chatbotSubtitle => localizedValues['ChatbotSubtitle'][locale.languageCode]; String get timeLine => localizedValues['TimeLine'][locale.languageCode]; String get labOrders => localizedValues['LabOrders'][locale.languageCode]; String get billNo => localizedValues['BillNo'][locale.languageCode]; - String get prescriptions => - localizedValues['Prescriptions'][locale.languageCode]; + String get prescriptions => localizedValues['Prescriptions'][locale.languageCode]; String get history => localizedValues['History'][locale.languageCode]; String get orderNo => localizedValues['OrderNo'][locale.languageCode]; - String get orderDetails => - localizedValues['OrderDetails'][locale.languageCode]; + String get orderDetails => localizedValues['OrderDetails'][locale.languageCode]; String get vitalSign => localizedValues['VitalSign'][locale.languageCode]; - String get monthlyReports => - localizedValues['MonthlyReports'][locale.languageCode]; + String get monthlyReports => localizedValues['MonthlyReports'][locale.languageCode]; - String get locationDialogMessage => - localizedValues['locationDialogMessage'][locale.languageCode]; - String get userViewRequest => - localizedValues['user-view-requester'][locale.languageCode]; + String get locationDialogMessage => localizedValues['locationDialogMessage'][locale.languageCode]; + String get userViewRequest => localizedValues['user-view-requester'][locale.languageCode]; String get userView => localizedValues['user-view'][locale.languageCode]; - String get sentRequest => - localizedValues['sent-requests'][locale.languageCode]; + String get sentRequest => localizedValues['sent-requests'][locale.languageCode]; String get km => localizedValues['km'][locale.languageCode]; - String get patientHealthSummaryReport => - localizedValues['PatientHealthSummaryReport'][locale.languageCode]; - String get toViewTheTermsAndConditions => - localizedValues['ToViewTheTermsAndConditions'][locale.languageCode]; + String get patientHealthSummaryReport => localizedValues['PatientHealthSummaryReport'][locale.languageCode]; + String get toViewTheTermsAndConditions => localizedValues['ToViewTheTermsAndConditions'][locale.languageCode]; String get clickHere => localizedValues['ClickHere'][locale.languageCode]; - String get iAgreeToTheTermsAndConditions => - localizedValues['IAgreeToTheTermsAndConditions'][locale.languageCode]; - String get iAgreeToTheTermsAndConditionsSubtitle => - localizedValues['IAgreeToTheTermsAndConditionsSubtitle'] - [locale.languageCode]; + String get iAgreeToTheTermsAndConditions => localizedValues['IAgreeToTheTermsAndConditions'][locale.languageCode]; + String get iAgreeToTheTermsAndConditionsSubtitle => localizedValues['IAgreeToTheTermsAndConditionsSubtitle'][locale.languageCode]; String get save => localizedValues['Save'][locale.languageCode]; - String get userAgreement => - localizedValues['UserAgreement'][locale.languageCode]; - String get updateSuccessfully => - localizedValues['UpdateSuccessfully'][locale.languageCode]; - String get emailSentSuccessfully => - localizedValues['EmailSentSuccessfully'][locale.languageCode]; - String get checkVaccineAvailability => - localizedValues['CHECK_VACCINE_AVAILABILITY'][locale.languageCode]; - String get myVaccinesAvailability => - localizedValues['MyVaccinesAvailability'][locale.languageCode]; - String get paymentService => - localizedValues['PaymentService'][locale.languageCode]; - String get paymentOnline => - localizedValues['PaymentOnline'][locale.languageCode]; - String get onlineCheckIn => - localizedValues['OnlineCheckIn'][locale.languageCode]; + String get userAgreement => localizedValues['UserAgreement'][locale.languageCode]; + String get updateSuccessfully => localizedValues['UpdateSuccessfully'][locale.languageCode]; + String get emailSentSuccessfully => localizedValues['EmailSentSuccessfully'][locale.languageCode]; + String get checkVaccineAvailability => localizedValues['CHECK_VACCINE_AVAILABILITY'][locale.languageCode]; + String get myVaccinesAvailability => localizedValues['MyVaccinesAvailability'][locale.languageCode]; + String get paymentService => localizedValues['PaymentService'][locale.languageCode]; + String get paymentOnline => localizedValues['PaymentOnline'][locale.languageCode]; + String get onlineCheckIn => localizedValues['OnlineCheckIn'][locale.languageCode]; String get myBalances => localizedValues['MyBalances'][locale.languageCode]; - String get balanceAmount => - localizedValues['BalanceAmount'][locale.languageCode]; - String get totalBalance => - localizedValues['TotalBalance'][locale.languageCode]; - String get createAdvancedPayment => - localizedValues['CreateAdvancedPayment'][locale.languageCode]; - String get advancePayment => - localizedValues['AdvancePayment'][locale.languageCode]; - String get advancePaymentLabel => - localizedValues['AdvancePaymentLabel'][locale.languageCode]; + String get balanceAmount => localizedValues['BalanceAmount'][locale.languageCode]; + String get totalBalance => localizedValues['TotalBalance'][locale.languageCode]; + String get createAdvancedPayment => localizedValues['CreateAdvancedPayment'][locale.languageCode]; + String get advancePayment => localizedValues['AdvancePayment'][locale.languageCode]; + String get advancePaymentLabel => localizedValues['AdvancePaymentLabel'][locale.languageCode]; String get fileNumber => localizedValues['FileNumber'][locale.languageCode]; String get amount => localizedValues['Amount'][locale.languageCode]; - String get depositorEmail => - localizedValues['DepositorEmail'][locale.languageCode]; + String get depositorEmail => localizedValues['DepositorEmail'][locale.languageCode]; String get notes => localizedValues['Notes'][locale.languageCode]; - String get selectPatientName => - localizedValues['SelectPatientName'][locale.languageCode]; - String get selectFamilyPatientName => - localizedValues['SelectFamilyPatientName'][locale.languageCode]; - String get selectHospital => - localizedValues['SelectHospital'][locale.languageCode]; + String get selectPatientName => localizedValues['SelectPatientName'][locale.languageCode]; + String get selectFamilyPatientName => localizedValues['SelectFamilyPatientName'][locale.languageCode]; + String get selectHospital => localizedValues['SelectHospital'][locale.languageCode]; String get myAccount => localizedValues['MyAccount'][locale.languageCode]; - String get otherAccount => - localizedValues['OtherAccount'][locale.languageCode]; - String get selectBeneficiary => - localizedValues['SelectBeneficiary'][locale.languageCode]; - String get confirmThePayment => - localizedValues['ConfirmThePayment'][locale.languageCode]; - String get depositorName => - localizedValues['DepositorName'][locale.languageCode]; - String get mobileNumber => - localizedValues['MobileNumber'][locale.languageCode]; + String get otherAccount => localizedValues['OtherAccount'][locale.languageCode]; + String get selectBeneficiary => localizedValues['SelectBeneficiary'][locale.languageCode]; + String get confirmThePayment => localizedValues['ConfirmThePayment'][locale.languageCode]; + String get depositorName => localizedValues['DepositorName'][locale.languageCode]; + String get mobileNumber => localizedValues['MobileNumber'][locale.languageCode]; String get ok => localizedValues['Ok'][locale.languageCode]; - String get theVerificationCodeExpiresIn => - localizedValues['TheVerificationCodeExpiresIn'][locale.languageCode]; - String get pleaseEnterTheVerificationCode => - localizedValues['PleaseEnterTheVerificationCode'][locale.languageCode]; - String get eyeMeasurements => - localizedValues['EyeMeasurements'][locale.languageCode]; - String get measurements => - localizedValues['Measurements'][locale.languageCode]; + String get theVerificationCodeExpiresIn => localizedValues['TheVerificationCodeExpiresIn'][locale.languageCode]; + String get pleaseEnterTheVerificationCode => localizedValues['PleaseEnterTheVerificationCode'][locale.languageCode]; + String get eyeMeasurements => localizedValues['EyeMeasurements'][locale.languageCode]; + String get measurements => localizedValues['Measurements'][locale.languageCode]; String get classes => localizedValues['Classes'][locale.languageCode]; String get contactLens => localizedValues['ContactLens'][locale.languageCode]; String get rightEye => localizedValues['RightEye'][locale.languageCode]; @@ -665,43 +506,29 @@ String get fileno => localizedValues['fileno'][locale.languageCode]; String get power => localizedValues['Power'][locale.languageCode]; String get diameter => localizedValues['Diameter'][locale.languageCode]; String get remarks => localizedValues['Remarks'][locale.languageCode]; - String get activeMedications => - localizedValues['ActiveMedications'][locale.languageCode]; + String get activeMedications => localizedValues['ActiveMedications'][locale.languageCode]; String get expDate => localizedValues['ExpDate'][locale.languageCode]; String get route => localizedValues['Route'][locale.languageCode]; String get frequency => localizedValues['Frequency'][locale.languageCode]; - String get dailyQuantity => - localizedValues['DailyQuantity'][locale.languageCode]; + String get dailyQuantity => localizedValues['DailyQuantity'][locale.languageCode]; String get addReminder => localizedValues['AddReminder'][locale.languageCode]; String get reminderDes => localizedValues['reminderDes'][locale.languageCode]; String get startDay => localizedValues['StartDay'][locale.languageCode]; String get endDay => localizedValues['EndDay'][locale.languageCode]; String get days => localizedValues['Days'][locale.languageCode]; - String get scheduleTime => - localizedValues['ScheduleTime'][locale.languageCode]; + String get scheduleTime => localizedValues['ScheduleTime'][locale.languageCode]; String get askDoctor => localizedValues['AskDoctor'][locale.languageCode]; - String get doctorResponses => - localizedValues['DoctorResponses'][locale.languageCode]; + String get doctorResponses => localizedValues['DoctorResponses'][locale.languageCode]; String get newDes => localizedValues['New'][locale.languageCode]; String get all => localizedValues['All'][locale.languageCode]; - String get questionHere => - localizedValues['QuestionHere'][locale.languageCode]; - String get viewDoctorResponses => - localizedValues['ViewDoctorResponses'][locale.languageCode]; - String get serviceInformationButton => - localizedValues['ServiceInformationButton'][locale.languageCode]; - String get serviceInformationTitle => - localizedValues['ServiceInformationTitle'][locale.languageCode]; - String get serviceInformation => - localizedValues['ServiceInformation'][locale.languageCode]; - String get homeHealthCare => - localizedValues['HomeHealthCare'][locale.languageCode]; - String get HHCNotAuthMsg => - localizedValues['HHCNotAuthMsg'][locale.languageCode]; - String get homeHealthCareText => - localizedValues['HomeHealthCareText'][locale.languageCode]; - String get loginRegister => - localizedValues['LoginRegister'][locale.languageCode]; + String get questionHere => localizedValues['QuestionHere'][locale.languageCode]; + String get viewDoctorResponses => localizedValues['ViewDoctorResponses'][locale.languageCode]; + String get serviceInformationButton => localizedValues['ServiceInformationButton'][locale.languageCode]; + String get serviceInformationTitle => localizedValues['ServiceInformationTitle'][locale.languageCode]; + String get serviceInformation => localizedValues['ServiceInformation'][locale.languageCode]; + String get homeHealthCare => localizedValues['HomeHealthCare'][locale.languageCode]; + String get homeHealthCareText => localizedValues['HomeHealthCareText'][locale.languageCode]; + String get loginRegister => localizedValues['LoginRegister'][locale.languageCode]; String get orderLog => localizedValues['OrderLog'][locale.languageCode]; String get infoLab => localizedValues['info-lab'][locale.languageCode]; String get infoRadiology => localizedValues['info-radiology'][locale.languageCode]; @@ -716,88 +543,59 @@ String get fileno => localizedValues['fileno'][locale.languageCode]; String get bestSellers => localizedValues['bestSellers'][locale.languageCode]; String get deleteAllItems => localizedValues['deleteAllItems'][locale.languageCode]; - String get termsService => - localizedValues['TermsService'][locale.languageCode]; + String get termsService => localizedValues['TermsService'][locale.languageCode]; String get beforeUsing => localizedValues['Beforeusing'][locale.languageCode]; String get accept => localizedValues['accept'][locale.languageCode]; - String get dataSafeInfo => - localizedValues['data-safe-info'][locale.languageCode]; + String get dataSafeInfo => localizedValues['data-safe-info'][locale.languageCode]; String get dataSafe => localizedValues['data-safe'][locale.languageCode]; - String get informational => - localizedValues['informational'][locale.languageCode]; - String get checkDiagnosis => - localizedValues['check-diagnosis'][locale.languageCode]; + String get informational => localizedValues['informational'][locale.languageCode]; + String get checkDiagnosis => localizedValues['check-diagnosis'][locale.languageCode]; String get remeberthat => localizedValues['remeberthat'][locale.languageCode]; - String get notUseInEmbergency => - localizedValues['not-use-in-emerbency'][locale.languageCode]; - String get notUseInEmbergencyDetails => - localizedValues['not-use-in-emerbency-details'][locale.languageCode]; - String get notUseInEmbergencyCall => - localizedValues['not-use-in-emerbency-details-call'][locale.languageCode]; - String get selectGender => - localizedValues['select-gender'][locale.languageCode]; + String get notUseInEmbergency => localizedValues['not-use-in-emerbency'][locale.languageCode]; + String get notUseInEmbergencyDetails => localizedValues['not-use-in-emerbency-details'][locale.languageCode]; + String get notUseInEmbergencyCall => localizedValues['not-use-in-emerbency-details-call'][locale.languageCode]; + String get selectGender => localizedValues['select-gender'][locale.languageCode]; String get iAma => localizedValues['i-am-a'][locale.languageCode]; String get selectAge => localizedValues['select-age'][locale.languageCode]; String get iAm => localizedValues['i-am'][locale.languageCode]; String get yearOld => localizedValues['years-old'][locale.languageCode]; String get email => localizedValues['email'][locale.languageCode]; String get book => localizedValues['Book'][locale.languageCode]; - String get appointmentLabel => - localizedValues['AppointmentLabel'][locale.languageCode]; + String get appointmentLabel => localizedValues['AppointmentLabel'][locale.languageCode]; String get bloodType => localizedValues['BloodType'][locale.languageCode]; - String get loginToUseService => - localizedValues['loginToUseService'][locale.languageCode]; - String get maritalStatus => - localizedValues['marital-status'][locale.languageCode]; + String get loginToUseService => localizedValues['loginToUseService'][locale.languageCode]; + String get maritalStatus => localizedValues['marital-status'][locale.languageCode]; String get general => localizedValues['general'][locale.languageCode]; String get profile => localizedValues['profile'][locale.languageCode]; - String get notifications => - localizedValues['notifications'][locale.languageCode]; - String get notificationDetails => - localizedValues['notificationDetails'][locale.languageCode]; - List get infoMyDoctorPoints => - localizedValues['info-my-doctor-points'][locale.languageCode]; - String get infoMyDoctor => - localizedValues['info-my-doctor'][locale.languageCode]; - String get infoPrescriptions => - localizedValues['info-prescriptions'][locale.languageCode]; - List get infoPrescriptionsPoints => - localizedValues['info-my-prescription-points'][locale.languageCode]; - - String get infoInsuranceCards => - localizedValues['info-insurance-cards'][locale.languageCode]; - List get infoInsuranceCardsPoints => - localizedValues['info-insurance-cards-points'][locale.languageCode]; - - String get infoAllergies => - localizedValues['info-allergies'][locale.languageCode]; + String get notifications => localizedValues['notifications'][locale.languageCode]; + String get notificationDetails => localizedValues['notificationDetails'][locale.languageCode]; + List get infoMyDoctorPoints => localizedValues['info-my-doctor-points'][locale.languageCode]; + String get infoMyDoctor => localizedValues['info-my-doctor'][locale.languageCode]; + String get infoPrescriptions => localizedValues['info-prescriptions'][locale.languageCode]; + List get infoPrescriptionsPoints => localizedValues['info-my-prescription-points'][locale.languageCode]; + + String get infoInsuranceCards => localizedValues['info-insurance-cards'][locale.languageCode]; + List get infoInsuranceCardsPoints => localizedValues['info-insurance-cards-points'][locale.languageCode]; + + String get infoAllergies => localizedValues['info-allergies'][locale.languageCode]; String get sickLeaves => localizedValues['sick-leaves'][locale.languageCode]; - String get infoSickLeaves => - localizedValues['info-sick-leaves'][locale.languageCode]; - List get infoSickLeavePoints => - localizedValues['info-sick-leave-points'][locale.languageCode]; - - String get infoApprovals => - localizedValues['info-approvals'][locale.languageCode]; - List get infoApprovalPoints => - localizedValues['info-approval-points'][locale.languageCode]; - - String get monthReport => - localizedValues['month-report'][locale.languageCode]; - String get infoMonthReport => - localizedValues['info-month-report'][locale.languageCode]; - String get languageSetting => - localizedValues['language-setting'][locale.languageCode]; + String get infoSickLeaves => localizedValues['info-sick-leaves'][locale.languageCode]; + List get infoSickLeavePoints => localizedValues['info-sick-leave-points'][locale.languageCode]; + + String get infoApprovals => localizedValues['info-approvals'][locale.languageCode]; + List get infoApprovalPoints => localizedValues['info-approval-points'][locale.languageCode]; + + String get monthReport => localizedValues['month-report'][locale.languageCode]; + String get infoMonthReport => localizedValues['info-month-report'][locale.languageCode]; + String get languageSetting => localizedValues['language-setting'][locale.languageCode]; String get alert => localizedValues['alert'][locale.languageCode]; String get emailAlert => localizedValues['email-alert'][locale.languageCode]; String get smsAlert => localizedValues['sms-alert'][locale.languageCode]; - String get contactInfo => - localizedValues['contact-info'][locale.languageCode]; + String get contactInfo => localizedValues['contact-info'][locale.languageCode]; String get emergencyName => localizedValues['emrg-name'][locale.languageCode]; - String get emergencyContact => - localizedValues['emrg-no'][locale.languageCode]; + String get emergencyContact => localizedValues['emrg-no'][locale.languageCode]; String get modes => localizedValues['modes'][locale.languageCode]; String get vibration => localizedValues['vibration'][locale.languageCode]; String get blindMode => localizedValues['blind-modes'][locale.languageCode]; @@ -807,16 +605,11 @@ String get fileno => localizedValues['fileno'][locale.languageCode]; String get bwTheme => localizedValues['bw-theme'][locale.languageCode]; String get permissions => localizedValues['permissions'][locale.languageCode]; - String get cameraPermission => - localizedValues['camera-permission'][locale.languageCode]; - String get locationPermission => - localizedValues['location-permission'][locale.languageCode]; - String get accessibility => - localizedValues['accessibility'][locale.languageCode]; - String get selectClinic => - localizedValues['selectClinic'][locale.languageCode]; - String get reviews => - localizedValues['reviews'][locale.languageCode]; + String get cameraPermission => localizedValues['camera-permission'][locale.languageCode]; + String get locationPermission => localizedValues['location-permission'][locale.languageCode]; + String get accessibility => localizedValues['accessibility'][locale.languageCode]; + String get selectClinic => localizedValues['selectClinic'][locale.languageCode]; + String get reviews => localizedValues['reviews'][locale.languageCode]; String get orderStatus => localizedValues['orderStatus'][locale.languageCode]; String get cancelOrder => localizedValues['CancelOrder'][locale.languageCode]; @@ -865,135 +658,10 @@ String get fileno => localizedValues['fileno'][locale.languageCode]; String get searchItemError => localizedValues['searchItemError'][locale.languageCode]; String get youCanFind => localizedValues['YouCanFind'][locale.languageCode]; String get itemInSearch => localizedValues['ItemInSearch'][locale.languageCode]; - String get invoiceNo => localizedValues['InvoiceNo'][locale.languageCode]; - String get specialResult => localizedValues['SpecialResult'][locale.languageCode]; - String get generalResult => localizedValues['GeneralResult'][locale.languageCode]; - String get showMoreBtn => localizedValues['show-more-btn'][locale.languageCode]; - String get value => localizedValues['value'][locale.languageCode]; - String get range => localizedValues['range'][locale.languageCode]; - String get outpatient => localizedValues['out-patient'][locale.languageCode]; - String get inPatient => localizedValues['in-patient'][locale.languageCode]; - String get report => localizedValues['report'][locale.languageCode]; - String get openRad => localizedValues['open-rad'][locale.languageCode]; - String get sendCopyRad => localizedValues['send-copy'][locale.languageCode]; - String get vaccination => localizedValues['vaccination'][locale.languageCode]; - String get welcomeBackV => localizedValues['welcomeBack'][locale.languageCode]; - String get instructions => localizedValues['instructions'][locale.languageCode]; - String get updateEmail => localizedValues['update-email'][locale.languageCode]; - String get updatedEmail => localizedValues['updated-email'][locale.languageCode]; - String get viewListChildren => localizedValues['view-list-children'][locale.languageCode]; - String get addChild => localizedValues['add-child'][locale.languageCode]; - String get childName => localizedValues['child-name'][locale.languageCode]; - String get childDob => localizedValues['childDob'][locale.languageCode]; - String get delete => localizedValues['delete'][locale.languageCode]; - String get deletedChildMes => localizedValues['deleted-child-mes'][locale.languageCode]; - String get visit => localizedValues['visit'][locale.languageCode]; - String get descriptionVaccination => localizedValues['description-vaccination'][locale.languageCode]; - String get dueDate => localizedValues['due-date'][locale.languageCode]; - String get validEmail => localizedValues['valid-email'][locale.languageCode]; - String get confirmSend => localizedValues['confirm-send'][locale.languageCode]; - String get emailSuccess => localizedValues['email-success'][locale.languageCode]; - String get deletedChild => localizedValues['deleted-child'][locale.languageCode]; - String get addInstructions => localizedValues['add-instructions'][locale.languageCode]; - String get addedChild => localizedValues['added-child'][locale.languageCode]; - String get appUpdate => localizedValues['appUpdate'][locale.languageCode]; - String get ereferralSaveSuccess => localizedValues['ereferralSaveSuccess'][locale.languageCode]; - String get appoSurvey => localizedValues['appoSurvey'][locale.languageCode]; - String get labResults => localizedValues['labResults'][locale.languageCode]; - String get doctorRating => localizedValues['doctorRating'][locale.languageCode]; - String get good => localizedValues['good'][locale.languageCode]; - String get v_good => localizedValues['v-good'][locale.languageCode]; - String get excellent => localizedValues['excellent'][locale.languageCode]; - String get below_average => localizedValues['below-average'][locale.languageCode]; - String get infoSigns => localizedValues['info-signs'][locale.languageCode]; - String get infoAdvancePayment => localizedValues['info-advance-payment'][locale.languageCode]; - String get infoMyBalance => localizedValues['info-my-balance'][locale.languageCode]; - String get erContant => localizedValues['er-contant'][locale.languageCode]; - String get er => localizedValues['er'][locale.languageCode]; - String get transportationService => localizedValues['transportation-Service'][locale.languageCode]; - String get infoAmbulance => localizedValues['info-ambulance'][locale.languageCode]; - String get transportHeading => localizedValues['RRT-transport-heading'][locale.languageCode]; - String get sar => localizedValues['sar'][locale.languageCode]; - String get directionHeading => localizedValues['RRT-direction-heading'][locale.languageCode]; - String get toHospital => localizedValues['to-hospital'][locale.languageCode]; - String get fromHospital => localizedValues['from-hospital'][locale.languageCode]; - String get oneDirec => localizedValues['one-direc'][locale.languageCode]; - String get twoDirec => localizedValues['two-direc'][locale.languageCode]; - String get pickupLocation => localizedValues['pickup-location'][locale.languageCode]; - String get pickupSpot => localizedValues['pickup-spot'][locale.languageCode]; - String get insideHome => localizedValues['inside-home'][locale.languageCode]; - String get haveAppo => localizedValues['have-appo'][locale.languageCode]; - String get dropoffLocation => localizedValues['dropoff-location'][locale.languageCode]; - String get selectAll => localizedValues['select-all'][locale.languageCode]; - String get selectMap => localizedValues['select-map'][locale.languageCode]; - String get noAppointment => localizedValues['no-appointment'][locale.languageCode]; - String get patientShareB => localizedValues['patient-share'][locale.languageCode]; - String get patientShareTax => localizedValues['patient-share-tax'][locale.languageCode]; - String get patientShareTotal => localizedValues['patient-share-total'][locale.languageCode]; - String get selectAmbulate => localizedValues['select-ambulate'][locale.languageCode]; - String get wheelchair => localizedValues['wheelchair'][locale.languageCode]; - String get walker => localizedValues['walker"'][locale.languageCode]; - String get stretcher => localizedValues['stretcher'][locale.languageCode]; - String get none => localizedValues['none'][locale.languageCode]; - String get RRTSummary => localizedValues['RRT-Summary'][locale.languageCode]; - String get billAmount => localizedValues['bill-amount'][locale.languageCode]; - String get transportMethod => localizedValues['transport-method'][locale.languageCode]; - String get directions => localizedValues['directions'][locale.languageCode]; - - String get infoMyAppointments => localizedValues['info-my-appointments'][locale.languageCode]; - String get infoTodo => localizedValues['info-todo'][locale.languageCode]; - String get familyInfo => localizedValues['family-info'][locale.languageCode]; - String get dentalComplaints => localizedValues['dental-complains'][locale.languageCode]; - String get emptyResult => localizedValues['empty-result'][locale.languageCode]; - - String get noBookedAppo => localizedValues['no-booked-appointment'][locale.languageCode]; - String get noConfirmedAppo => localizedValues['no-confirmed-appointment'][locale.languageCode]; - String get noArrivedAppo => localizedValues['no-arrived-appointment'][locale.languageCode]; - String get upcomingEmpty => localizedValues['upcoming-empty'][locale.languageCode]; - String get upcomingTimeLeft => localizedValues['upcoming-timeLeft'][locale.languageCode]; - - String get covidTestAllServices => localizedValues['covid-test-all-services'][locale.languageCode]; - String get pharmacy => localizedValues['pharmacy'][locale.languageCode]; - String get ereferral => localizedValues['ereferral'][locale.languageCode]; - String get childVaccine => localizedValues['child-vaccine'][locale.languageCode]; - String get calculators => localizedValues['calculators'][locale.languageCode]; - String get converters => localizedValues['converters'][locale.languageCode]; - String get h2o => localizedValues['h2o'][locale.languageCode]; - String get vTour => localizedValues['v-tour'][locale.languageCode]; - String get hmgNews => localizedValues['hmg-news'][locale.languageCode]; - String get bloodD => localizedValues['blood-d'][locale.languageCode]; - String get symptomCheckerTitle => localizedValues['symptomCheckerTitle'][locale.languageCode]; - String get latestNews => localizedValues['latest-news'][locale.languageCode]; - String get ourLocation => localizedValues['our-location'][locale.languageCode]; - String get pharmacies => localizedValues['pharmacies'][locale.languageCode]; - String get hospitals => localizedValues['hospitals'][locale.languageCode]; - String get wallet => localizedValues['wallet'][locale.languageCode]; - String get hmg => localizedValues['hmg'][locale.languageCode]; - String get requested => localizedValues['requested'][locale.languageCode]; - String get ready => localizedValues['ready'][locale.languageCode]; - String get completed => localizedValues['completed'][locale.languageCode]; - String get cancelled => localizedValues['cancelled'][locale.languageCode]; - String get requestMedicalReport => localizedValues['request-medical-report'][locale.languageCode]; - - String get referralStatus => localizedValues['referralStatus'][locale.languageCode]; - String get referralDate => localizedValues['referralDate'][locale.languageCode]; - String get patientName => localizedValues['patientName'][locale.languageCode]; - String get referralNumber => localizedValues['referralNumber'][locale.languageCode]; - - - String get requestID => localizedValues['requestID'][locale.languageCode]; - String get OrderStatus => localizedValues['OrderStatus'][locale.languageCode]; - String get pickupDate => localizedValues['pickupDate'][locale.languageCode]; - String get serviceName => localizedValues['serviceName'][locale.languageCode]; - String get orderLocation => localizedValues['orderLocation'][locale.languageCode]; - String get selectService => localizedValues['selectService'][locale.languageCode]; - String get coveredService => localizedValues['coveredService'][locale.languageCode]; - String get selectAddress => localizedValues['selectAddress'][locale.languageCode]; - String get addNewAddress => localizedValues['addNewAddress'][locale.languageCode]; - String get selectedService => localizedValues['selectedService'][locale.languageCode]; - String get cancelOrderMsg => localizedValues['cancelOrderMsg'][locale.languageCode]; - String get processDoneSuccessfully => localizedValues['processDoneSuccessfully'][locale.languageCode]; - String get selectHomeHealthCareServices => localizedValues['selectHomeHealthCareServices'][locale.languageCode]; + String get wantToConnectWithHmgNetwork => localizedValues['wantConnectHmgNetwork'][locale.languageCode]; + String get failedToAccessHmgServices => localizedValues['failedToAccessHmgServices'][locale.languageCode]; + String get enablingWifi => localizedValues['enablingWifi'][locale.languageCode]; + String get offerAndPackages => localizedValues['offerAndPackages'][locale.languageCode]; } class TranslationBaseDelegate extends LocalizationsDelegate { diff --git a/lib/uitl/utils.dart b/lib/uitl/utils.dart index 34c0e58d..3e1e4892 100644 --- a/lib/uitl/utils.dart +++ b/lib/uitl/utils.dart @@ -2,33 +2,7 @@ import 'dart:convert'; import 'dart:core'; import 'dart:typed_data'; -import 'package:badges/badges.dart'; import 'package:connectivity/connectivity.dart'; -import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; -import 'package:diplomaticquarterapp/pages/Blood/my_balance_page.dart'; -import 'package:diplomaticquarterapp/pages/MyAppointments/MyAppointments.dart'; -import 'package:diplomaticquarterapp/pages/insurance/insurance_approval_screen.dart'; -import 'package:diplomaticquarterapp/pages/insurance/insurance_card_screen.dart'; -import 'package:diplomaticquarterapp/pages/insurance/insurance_update_screen.dart'; -import 'package:diplomaticquarterapp/pages/medical/active_medications/ActiveMedicationsPage.dart'; -import 'package:diplomaticquarterapp/pages/medical/allergies_page.dart'; -import 'package:diplomaticquarterapp/pages/medical/ask_doctor/ask_doctor_home_page.dart'; -import 'package:diplomaticquarterapp/pages/medical/doctor/doctor_home_page.dart'; -import 'package:diplomaticquarterapp/pages/medical/eye/EyeMeasurementsPage.dart'; -import 'package:diplomaticquarterapp/pages/medical/labs/labs_home_page.dart'; -import 'package:diplomaticquarterapp/pages/medical/medical_profile_page.dart'; -import 'package:diplomaticquarterapp/pages/medical/my_trackers/my_trackers.dart'; -import 'package:diplomaticquarterapp/pages/medical/patient_sick_leave_page.dart'; -import 'package:diplomaticquarterapp/pages/medical/prescriptions/prescriptions_home_page.dart'; -import 'package:diplomaticquarterapp/pages/medical/radiology/radiology_home_page.dart'; -import 'package:diplomaticquarterapp/pages/medical/reports/monthly_reports.dart'; -import 'package:diplomaticquarterapp/pages/medical/reports/report_home_page.dart'; -import 'package:diplomaticquarterapp/pages/medical/smart_watch_health_data/smart_watch_instructions.dart'; -import 'package:diplomaticquarterapp/pages/medical/vital_sign/vital_sign_details_screen.dart'; -import 'package:diplomaticquarterapp/pages/vaccine/my_vaccines_screen.dart'; -import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; -import 'package:diplomaticquarterapp/widgets/data_display/medical/medical_profile_item.dart'; -import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; @@ -186,340 +160,7 @@ class Utils { .hasMatch(email); } - static List myMedicalList({ProjectViewModel projectViewModel, BuildContext context, bool isLogin, count}) { - List medical = List(); - if (projectViewModel.havePrivilege(5)) { - medical.add(InkWell( - onTap: () { - Navigator.push( - context, - FadePage( - page: MyAppointments(), - ), - ); - }, - child: isLogin - ? Container( - height: 120, - child: Stack(children: [ - MedicalProfileItem( - title: TranslationBase.of(context).myAppointments, - imagePath: 'my_appointment_icon.png', - subTitle: TranslationBase.of(context).myAppointmentsList, - hasBadge: true, - ), - Positioned( - right: 0.0, - child: Badge( - toAnimate: false, - position: BadgePosition.topEnd(), - shape: BadgeShape.circle, - badgeColor: Color(0xFF40ACC9).withOpacity(1.0), - borderRadius: BorderRadius.circular(8), - badgeContent: Container( - padding: EdgeInsets.all(2.0), - child: Text(count.toString(), - style: - TextStyle(color: Colors.white, fontSize: 16.0)), - ), - ), - ), - ]), - ) - : MedicalProfileItem( - title: TranslationBase.of(context).myAppointments, - imagePath: 'my_appointment_icon.png', - subTitle: TranslationBase.of(context).myAppointmentsList, - hasBadge: true, - ), - )); - } - if (projectViewModel.havePrivilege(10)) { - medical.add(InkWell( - onTap: () => Navigator.push(context, FadePage(page: LabsHomePage())), - child: MedicalProfileItem( - title: TranslationBase.of(context).lab, - imagePath: 'lab_result_icon.png', - subTitle: TranslationBase.of(context).labSubtitle, - ), - )); - } - - if (projectViewModel.havePrivilege(7)) { - medical.add(InkWell( - onTap: () => - Navigator.push(context, FadePage(page: RadiologyHomePage())), - child: MedicalProfileItem( - title: TranslationBase.of(context).radiology, - imagePath: 'radiology_icon.png', - subTitle: TranslationBase.of(context).radiologySubtitle, - ), - )); - } - - if (projectViewModel.havePrivilege(12)) { - medical.add(InkWell( - onTap: () { - Navigator.push( - context, - FadePage( - page: HomePrescriptionsPage(), - ), - ); - }, - child: MedicalProfileItem( - title: TranslationBase.of(context).medicines, - imagePath: 'prescription_icon.png', - subTitle: TranslationBase.of(context).medicinesSubtitle, - ), - )); - } - - if (projectViewModel.havePrivilege(25)) { - medical.add(InkWell( - onTap: () => Navigator.push( - context, - FadePage( - page: VitalSignDetailsScreen(), - ), - ), - child: MedicalProfileItem( - title: TranslationBase.of(context).vitalSigns, - imagePath: 'vital_signs.png', - subTitle: TranslationBase.of(context).vitalSignsSubtitle, - ), - )); - } - - if (projectViewModel.havePrivilege(48)) { - medical.add(InkWell( - onTap: () => - Navigator.push(context, FadePage(page: ActiveMedicationsPage())), - child: MedicalProfileItem( - title: TranslationBase.of(context).myMedical, - imagePath: 'active_medications.png', - subTitle: TranslationBase.of(context).myMedicalSubtitle, - ), - )); - } - - if (projectViewModel.havePrivilege(6)) { - medical.add(InkWell( - onTap: () { - Navigator.push( - context, - FadePage( - page: DoctorHomePage(), - ), - ); - }, - child: MedicalProfileItem( - title: TranslationBase.of(context).myDoctor, - imagePath: 'doctor_icon.png', - subTitle: TranslationBase.of(context).myDoctorSubtitle, - ), - )); - } - - if (projectViewModel.havePrivilege(14)) { - medical.add(InkWell( - onTap: () { - Navigator.push(context, FadePage(page: EyeMeasurementsPage())); - }, - child: MedicalProfileItem( - title: TranslationBase.of(context).eye, - imagePath: 'eye_measurement_icon.png', - subTitle: TranslationBase.of(context).eyeSubtitle, - ), - )); - } - if (projectViewModel.havePrivilege(22)) { - medical.add(InkWell( - onTap: () { - Navigator.push(context, FadePage(page: InsuranceCard())); - }, - child: MedicalProfileItem( - title: TranslationBase.of(context).insurance, - imagePath: 'insurance_card_icon.png', - subTitle: TranslationBase.of(context).insuranceSubtitle, - ), - )); - } - medical.add(InkWell( - onTap: () { - Navigator.push(context, FadePage(page: InsuranceUpdate())); - }, - child: MedicalProfileItem( - title: TranslationBase.of(context).updateInsurance, - imagePath: 'insurance_update_icon_.png', - subTitle: TranslationBase.of(context).updateInsuranceSubtitle, - ), - )); - - if (projectViewModel.havePrivilege(18)) { - medical.add(InkWell( - onTap: () { - Navigator.push(context, FadePage(page: InsuranceApproval())); - }, - child: MedicalProfileItem( - title: TranslationBase.of(context).insuranceApproval, - imagePath: 'insurance_approvals_icon.png', - subTitle: TranslationBase.of(context).insuranceApprovalSubtitle, - ), - )); - } - - if (projectViewModel.havePrivilege(23)) { - medical.add(InkWell( - onTap: () => Navigator.push(context, FadePage(page: AllergiesPage())), - child: MedicalProfileItem( - title: TranslationBase.of(context).allergies, - imagePath: 'my_allergies_icon.png', - subTitle: TranslationBase.of(context).allergiesSubtitle, - ), - )); - } - - if (projectViewModel.havePrivilege(26)) { - medical.add(InkWell( - onTap: () { - Navigator.push(context, FadePage(page: MyVaccines())); - }, - child: MedicalProfileItem( - title: TranslationBase.of(context).myVaccines, - imagePath: 'my_vaccines_icon.png', - subTitle: TranslationBase.of(context).myVaccinesSubtitle, - ), - )); - } - if (projectViewModel.havePrivilege(20)) - medical.add(InkWell( - onTap: () { - Navigator.push(context, FadePage(page: HomeReportPage())); - }, - child: MedicalProfileItem( - title: TranslationBase.of(context).medical, - imagePath: 'medical_reports_icon.png', - subTitle: TranslationBase.of(context).medicalSubtitle, - ), - )); - - if (projectViewModel.havePrivilege(19)) { - medical.add(InkWell( - onTap: () { - Navigator.push(context, FadePage(page: MonthlyReportsPage())); - }, - child: MedicalProfileItem( - title: TranslationBase.of(context).monthly, - imagePath: 'monthly_reports_icon.png', - subTitle: TranslationBase.of(context).monthlySubtitle, - ), - )); - } - - if (projectViewModel.havePrivilege(16)) { - medical.add(InkWell( - onTap: () { - Navigator.push(context, FadePage(page: PatientSickLeavePage())); - }, - child: MedicalProfileItem( - title: TranslationBase.of(context).sick, - imagePath: 'sick_leaves_icons.png', - subTitle: TranslationBase.of(context).sickSubtitle, - ), - )); - } - - if (projectViewModel.havePrivilege(47)) { - medical.add(InkWell( - onTap: () { - Navigator.push(context, FadePage(page: MyBalancePage())); - }, - child: MedicalProfileItem( - title: TranslationBase.of(context).myBalance, - imagePath: 'check-in.png', - subTitle: TranslationBase.of(context).myBalanceSubtitle, - ), - )); - } - - if (projectViewModel.havePrivilege(61)) { - medical.add(MedicalProfileItem( - title: TranslationBase.of(context).patientCall, - imagePath: 'medical_history_icon.png', - subTitle: TranslationBase.of(context).patientCallSubtitle, - )); - } - - if (projectViewModel.havePrivilege(24)) { - medical.add(InkWell( - onTap: () { - Navigator.push(context, FadePage(page: MyTrackers())); - }, - child: MedicalProfileItem( - title: TranslationBase.of(context).myTrackers, - imagePath: 'my_tracker_icon.png', - subTitle: TranslationBase.of(context).myTrackersSubtitle, - ), - )); - } - if (projectViewModel.havePrivilege(30)) - medical.add(InkWell( - onTap: () { - Navigator.push(context, FadePage(page: SmartWatchInstructions())); - }, - child: MedicalProfileItem( - title: TranslationBase.of(context).smartWatches, - imagePath: 'smartwatch_icon.png', - subTitle: TranslationBase.of(context).smartWatchesSubtitle, - ), - )); - - if (projectViewModel.havePrivilege(28)) { - medical.add(InkWell( - onTap: () { - Navigator.push(context, FadePage(page: AskDoctorHomPage())); - }, - child: MedicalProfileItem( - title: TranslationBase.of(context).askYour, - imagePath: 'ask_doctor_icon.png', - subTitle: TranslationBase.of(context).askYourSubtitle, - ), - )); - } - if (projectViewModel.havePrivilege(32)) { - medical.add(InkWell( - //TODO -// onTap: () { -// Navigator.push( -// context, FadePage(page: DoctorHomePage())); -// }, - child: MedicalProfileItem( - title: TranslationBase.of(context).internet, - imagePath: 'insurance_card_icon.png', - subTitle: TranslationBase.of(context).internetSubtitle, - ), - )); - } - - if (projectViewModel.havePrivilege(40)) { - medical.add(InkWell( -// onTap: () { -// Navigator.push( -// context, FadePage(page: InsuranceApproval())); -// }, - child: MedicalProfileItem( - title: TranslationBase.of(context).chatbot, - imagePath: 'insurance_approvals_icon.png', - subTitle: TranslationBase.of(context).chatbotSubtitle, - ), - )); - } - - return medical; - } } - // extension function that use in iterations(list.. etc) to iterate items and get index and item it self extension IndexedIterable on Iterable { Iterable mapIndexed(T Function(E e, int i) f) { diff --git a/lib/widgets/bottom_navigation/bottom_nav_bar.dart b/lib/widgets/bottom_navigation/bottom_nav_bar.dart index 7cbe7615..21cbebba 100644 --- a/lib/widgets/bottom_navigation/bottom_nav_bar.dart +++ b/lib/widgets/bottom_navigation/bottom_nav_bar.dart @@ -1,12 +1,9 @@ -import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; -import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/BookingOptions.dart'; import 'package:diplomaticquarterapp/pages/ToDoList/ToDo.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:eva_icons_flutter/eva_icons_flutter.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -import 'package:provider/provider.dart'; import '../../d_q_icons_icons.dart'; import 'bottom_navigation_item.dart'; @@ -29,7 +26,6 @@ class _BottomNavBarState extends State { @override Widget build(BuildContext context) { - ProjectViewModel projectViewModel = Provider.of(context); return BottomAppBar( elevation: 4, shape: CircularNotchedRectangle(), @@ -56,28 +52,29 @@ class _BottomNavBarState extends State { currentIndex: 1, name: TranslationBase.of(context).medicalProfile, ), - if (widget.index == 0 && projectViewModel.havePrivilege(34)) - Expanded( - child: SizedBox( - height: 50, - child: Column( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - SizedBox(height: 22), - ], - ), - ), - ), - if (widget.index != 0 && projectViewModel.havePrivilege(34)) - BottomNavigationItem( - icon: EvaIcons.calendar, - activeIcon: EvaIcons.calendar, - changeIndex: _changeIndex, - index: _index, - currentIndex: 2, - name: TranslationBase.of(context).bookAppo, - ), + if(widget.index == 0) + Expanded( + child: SizedBox( + height: 50, + child: Column( + mainAxisSize: MainAxisSize.min, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + SizedBox(height: 22), + ], + ), + ), + ), + if(widget.index != 0) + BottomNavigationItem( + icon: EvaIcons.calendar, + activeIcon: EvaIcons.calendar, + changeIndex: _changeIndex, + index: _index, + currentIndex: 2, + name: TranslationBase.of(context).bookAppo, + ), + BottomNavigationItem( icon: DQIcons.family, activeIcon: DQIcons.family, @@ -86,7 +83,6 @@ class _BottomNavBarState extends State { currentIndex: 3, name: TranslationBase.of(context).myFamily, ), - if(projectViewModel.havePrivilege(51)) BottomNavigationItem( icon: EvaIcons.calendar, activeIcon: EvaIcons.calendar, diff --git a/lib/widgets/bottom_navigation/bottom_navigation_item.dart b/lib/widgets/bottom_navigation/bottom_navigation_item.dart index 31ed59dc..ba35f3c6 100644 --- a/lib/widgets/bottom_navigation/bottom_navigation_item.dart +++ b/lib/widgets/bottom_navigation/bottom_navigation_item.dart @@ -80,8 +80,7 @@ class BottomNavigationItem extends StatelessWidget { toAnimate: false, position: BadgePosition.topEnd(), shape: BadgeShape.circle, - badgeColor: Colors - .red[800].withOpacity(1.0), + badgeColor: Color(0xFF40ACC9).withOpacity(1.0), borderRadius: BorderRadius.circular(8), badgeContent: Container( padding: EdgeInsets.all(2.0), diff --git a/lib/widgets/bottom_options/BottomSheet.dart b/lib/widgets/bottom_options/BottomSheet.dart index f8a99c17..66ee36c4 100644 --- a/lib/widgets/bottom_options/BottomSheet.dart +++ b/lib/widgets/bottom_options/BottomSheet.dart @@ -15,7 +15,7 @@ class ImageOptions { return _BottomSheet( children: [ _BottomSheetItem( - title: "Select file source", + title: "Select file souse", ), _BottomSheetItem( title: "Gallery", diff --git a/lib/widgets/buttons/button.dart b/lib/widgets/buttons/button.dart index 457a1d42..597106c9 100644 --- a/lib/widgets/buttons/button.dart +++ b/lib/widgets/buttons/button.dart @@ -90,7 +90,7 @@ class _ButtonState extends State