Merge branch 'development' into ZohaibIqbalKambrani

* development: (32 commits)
  changes
  package name changed
  Jira Fixes
  Jira fixes
  PAP-664
  PAP-664
  PAP-664
  langauge issue
  bug fix
  PAP-777
  PAP-729
  fix button
  fix translate issues
  CONFIG
  PAP-715 : Y –axis and X –axis values should be display in the yearly graph details.
  bug fixes
  fix bugs
  fixing dashboard issue
  fixing dashboard issue
  jira bugs
  ...

# Conflicts:
#	lib/config/config.dart
#	lib/config/localized_values.dart
#	lib/core/service/client/base_app_client.dart
#	lib/uitl/translations_delegate_base.dart
#	lib/uitl/utils.dart
merge-requests/347/head
Zohaib Iqbal Kambrani 3 years ago
commit 429fcb1e60

@ -34,13 +34,15 @@ android {
} }
lintOptions { lintOptions {
disable 'InvalidPackage' disable 'MissingTranslation'
checkReleaseBuilds false
} }
defaultConfig { defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
// applicationId "com.cloud.diplomaticquarterapp" applicationId "com.ejada.hmg"
applicationId "com.ejada.hmg.uat"
minSdkVersion 21 minSdkVersion 21
targetSdkVersion 30 targetSdkVersion 30
versionCode flutterVersionCode.toInteger() versionCode flutterVersionCode.toInteger()

@ -10,7 +10,7 @@
"client_info": { "client_info": {
"mobilesdk_app_id": "1:815750722565:android:62281cd3e5df4063", "mobilesdk_app_id": "1:815750722565:android:62281cd3e5df4063",
"android_client_info": { "android_client_info": {
"package_name": "com.ejada.hmg.uat" "package_name": "com.ejada.hmg"
} }
}, },
"oauth_client": [ "oauth_client": [

@ -1,5 +1,5 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android" <manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.cloud.diplomaticquarterapp"> package="com.ejada.hmg">
<!-- Flutter needs it to communicate with the running application <!-- Flutter needs it to communicate with the running application
to allow setting breakpoints, to provide hot reload, etc. to allow setting breakpoints, to provide hot reload, etc.
--> -->

@ -1,5 +1,5 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android" <manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.cloud.diplomaticquarterapp"> package="com.ejada.hmg">
<!-- io.flutter.app.FlutterApplication is an android.app.Application that <!-- io.flutter.app.FlutterApplication is an android.app.Application that
calls FlutterMain.startInitialization(this); in its onCreate method. calls FlutterMain.startInitialization(this); in its onCreate method.
In most cases you can leave this as-is, but you if you want to provide In most cases you can leave this as-is, but you if you want to provide

@ -1,8 +1,8 @@
package com.cloud.diplomaticquarterapp package com.ejada.hmg
import android.os.Bundle import android.os.Bundle
import android.util.Log import android.util.Log
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import com.cloud.diplomaticquarterapp.utils.* import com.ejada.hmg.utils.*
import io.flutter.embedding.android.FlutterFragmentActivity import io.flutter.embedding.android.FlutterFragmentActivity
import io.flutter.embedding.engine.FlutterEngine import io.flutter.embedding.engine.FlutterEngine
import io.flutter.plugin.common.MethodChannel import io.flutter.plugin.common.MethodChannel

@ -1,4 +1,4 @@
package com.cloud.diplomaticquarterapp.geofence package com.ejada.hmg.geofence
import com.google.android.gms.location.Geofence import com.google.android.gms.location.Geofence
import com.google.gson.Gson import com.google.gson.Gson

@ -1,4 +1,4 @@
package com.cloud.diplomaticquarterapp.geofence package com.ejada.hmg.geofence
import android.Manifest import android.Manifest
import android.app.PendingIntent import android.app.PendingIntent
@ -8,9 +8,9 @@ import android.content.SharedPreferences
import android.content.pm.PackageManager import android.content.pm.PackageManager
import android.location.Location import android.location.Location
import androidx.core.content.ContextCompat import androidx.core.content.ContextCompat
import com.cloud.diplomaticquarterapp.geofence.intent_receivers.GeofenceBroadcastReceiver import com.ejada.hmg.geofence.intent_receivers.GeofenceBroadcastReceiver
import com.cloud.diplomaticquarterapp.geofence.intent_receivers.ReregisterGeofenceJobService import com.ejada.hmg.geofence.intent_receivers.ReregisterGeofenceJobService
import com.cloud.diplomaticquarterapp.utils.* import com.ejada.hmg.utils.*
import com.google.android.gms.location.Geofence import com.google.android.gms.location.Geofence
import com.google.android.gms.location.GeofencingClient import com.google.android.gms.location.GeofencingClient
import com.google.android.gms.location.GeofencingRequest import com.google.android.gms.location.GeofencingRequest

@ -1,14 +1,14 @@
package com.cloud.diplomaticquarterapp.geofence.intent_receivers package com.ejada.hmg.geofence.intent_receivers
import android.content.BroadcastReceiver import android.content.BroadcastReceiver
import android.content.Context import android.content.Context
import android.content.Intent import android.content.Intent
import android.util.Log import android.util.Log
import com.cloud.diplomaticquarterapp.geofence.GeofenceTransition import com.ejada.hmg.geofence.GeofenceTransition
import com.cloud.diplomaticquarterapp.geofence.HMG_Geofence import com.ejada.hmg.geofence.HMG_Geofence
import com.cloud.diplomaticquarterapp.utils.Logs import com.ejada.hmg.utils.Logs
import com.google.android.gms.location.GeofenceStatusCodes import com.google.android.gms.location.GeofenceStatusCodes
import com.google.android.gms.location.GeofencingEvent import com.google.android.gms.location.GeofencingEvent

@ -1,11 +1,11 @@
package com.cloud.diplomaticquarterapp.geofence.intent_receivers package com.ejada.hmg.geofence.intent_receivers
import android.content.BroadcastReceiver import android.content.BroadcastReceiver
import android.content.Context import android.content.Context
import android.content.Intent import android.content.Intent
import com.cloud.diplomaticquarterapp.geofence.HMG_Geofence import com.ejada.hmg.geofence.HMG_Geofence
import com.google.android.gms.location.GeofenceStatusCodes import com.google.android.gms.location.GeofenceStatusCodes
class GeofenceBroadcastReceiverWithJobService : BroadcastReceiver() { class GeofenceBroadcastReceiverWithJobService : BroadcastReceiver() {

@ -1,10 +1,10 @@
package com.cloud.diplomaticquarterapp.geofence.intent_receivers package com.ejada.hmg.geofence.intent_receivers
import android.content.Context import android.content.Context
import com.cloud.diplomaticquarterapp.R import com.ejada.hmg.R
import com.cloud.diplomaticquarterapp.geofence.HMG_Geofence import com.ejada.hmg.geofence.HMG_Geofence
import com.google.android.gms.common.api.ApiException import com.google.android.gms.common.api.ApiException
import com.google.android.gms.location.GeofenceStatusCodes import com.google.android.gms.location.GeofenceStatusCodes

@ -29,15 +29,15 @@
*/ */
package com.cloud.diplomaticquarterapp.geofence.intent_receivers package com.ejada.hmg.geofence.intent_receivers
import android.content.Context import android.content.Context
import android.content.Intent import android.content.Intent
import android.util.Log import android.util.Log
import androidx.core.app.JobIntentService import androidx.core.app.JobIntentService
import com.cloud.diplomaticquarterapp.geofence.GeofenceTransition import com.ejada.hmg.geofence.GeofenceTransition
import com.cloud.diplomaticquarterapp.geofence.HMG_Geofence import com.ejada.hmg.geofence.HMG_Geofence
import com.cloud.diplomaticquarterapp.utils.saveLog import com.ejada.hmg.utils.saveLog
import com.google.android.gms.location.GeofenceStatusCodes import com.google.android.gms.location.GeofenceStatusCodes
import com.google.android.gms.location.GeofencingEvent import com.google.android.gms.location.GeofencingEvent

@ -1,12 +1,12 @@
package com.cloud.diplomaticquarterapp.geofence.intent_receivers package com.ejada.hmg.geofence.intent_receivers
import android.content.BroadcastReceiver import android.content.BroadcastReceiver
import android.content.Context import android.content.Context
import android.content.Intent import android.content.Intent
import com.cloud.diplomaticquarterapp.geofence.HMG_Geofence import com.ejada.hmg.geofence.HMG_Geofence
import com.cloud.diplomaticquarterapp.utils.PREFS_STORAGE import com.ejada.hmg.utils.PREFS_STORAGE
class GeofencingRebootBroadcastReceiver : BroadcastReceiver(){ class GeofencingRebootBroadcastReceiver : BroadcastReceiver(){
override fun onReceive(context: Context, intent: Intent) { override fun onReceive(context: Context, intent: Intent) {

@ -1,14 +1,14 @@
package com.cloud.diplomaticquarterapp.geofence.intent_receivers package com.ejada.hmg.geofence.intent_receivers
import android.content.BroadcastReceiver import android.content.BroadcastReceiver
import android.content.Context import android.content.Context
import android.content.Intent import android.content.Intent
import android.location.LocationManager import android.location.LocationManager
import com.cloud.diplomaticquarterapp.geofence.HMG_Geofence import com.ejada.hmg.geofence.HMG_Geofence
import com.cloud.diplomaticquarterapp.utils.HMGUtils import com.ejada.hmg.utils.HMGUtils
import com.cloud.diplomaticquarterapp.utils.PREFS_STORAGE import com.ejada.hmg.utils.PREFS_STORAGE
class LocationProviderChangeReceiver : BroadcastReceiver() { class LocationProviderChangeReceiver : BroadcastReceiver() {
private val LOG_TAG = "LocationProviderChangeReceiver" private val LOG_TAG = "LocationProviderChangeReceiver"

@ -1,9 +1,9 @@
package com.cloud.diplomaticquarterapp.geofence.intent_receivers package com.ejada.hmg.geofence.intent_receivers
import android.app.job.JobParameters import android.app.job.JobParameters
import android.app.job.JobService import android.app.job.JobService
import com.cloud.diplomaticquarterapp.geofence.HMG_Geofence import com.ejada.hmg.geofence.HMG_Geofence
import com.cloud.diplomaticquarterapp.utils.Logs import com.ejada.hmg.utils.Logs
class ReregisterGeofenceJobService : JobService(){ class ReregisterGeofenceJobService : JobService(){
companion object{ companion object{

@ -1,4 +1,4 @@
package com.cloud.diplomaticquarterapp.hmgwifi package com.ejada.hmg.hmgwifi
import android.content.Context import android.content.Context
import android.net.ConnectivityManager import android.net.ConnectivityManager
@ -8,9 +8,9 @@ import android.net.wifi.WifiManager
import android.os.Build import android.os.Build
import android.util.Log import android.util.Log
import android.widget.Toast import android.widget.Toast
import com.cloud.diplomaticquarterapp.MainActivity import com.ejada.hmg.MainActivity
import com.cloud.diplomaticquarterapp.utils.FlutterText import com.ejada.hmg.utils.FlutterText
import com.cloud.diplomaticquarterapp.utils.HMGUtils import com.ejada.hmg.utils.HMGUtils
class HMG_Guest(context: MainActivity) { class HMG_Guest(context: MainActivity) {

@ -1,9 +1,9 @@
package com.cloud.diplomaticquarterapp.hmgwifi package com.ejada.hmg.hmgwifi
import android.annotation.SuppressLint import android.annotation.SuppressLint
import com.cloud.diplomaticquarterapp.utils.API import com.ejada.hmg.utils.API
import com.cloud.diplomaticquarterapp.MainActivity import com.ejada.hmg.MainActivity
import com.cloud.diplomaticquarterapp.utils.FlutterText import com.ejada.hmg.utils.FlutterText
import com.github.kittinunf.fuel.core.extensions.jsonBody import com.github.kittinunf.fuel.core.extensions.jsonBody
import com.github.kittinunf.fuel.httpGet import com.github.kittinunf.fuel.httpGet
import com.github.kittinunf.fuel.httpPost import com.github.kittinunf.fuel.httpPost

@ -1,4 +1,4 @@
package com.cloud.diplomaticquarterapp.hmgwifi package com.ejada.hmg.hmgwifi
import android.annotation.SuppressLint import android.annotation.SuppressLint
import android.content.Context import android.content.Context
@ -7,8 +7,8 @@ import android.net.wifi.*
import android.net.wifi.SupplicantState.ASSOCIATED import android.net.wifi.SupplicantState.ASSOCIATED
import android.net.wifi.SupplicantState.COMPLETED import android.net.wifi.SupplicantState.COMPLETED
import android.util.Log import android.util.Log
import com.cloud.diplomaticquarterapp.MainActivity import com.ejada.hmg.MainActivity
import com.cloud.diplomaticquarterapp.utils.HMGUtils import com.ejada.hmg.utils.HMGUtils
class WPA(mainActivity: MainActivity, SSID:String) { class WPA(mainActivity: MainActivity, SSID:String) {
private var TAG = "WPA" private var TAG = "WPA"

@ -1,4 +1,4 @@
package com.cloud.diplomaticquarterapp.utils package com.ejada.hmg.utils
class API { class API {
companion object{ companion object{

@ -1,4 +1,4 @@
package com.cloud.diplomaticquarterapp.utils package com.ejada.hmg.utils
const val PREFS_STORAGE = "FlutterSharedPreferences" const val PREFS_STORAGE = "FlutterSharedPreferences"

@ -1,4 +1,4 @@
package com.cloud.diplomaticquarterapp.utils package com.ejada.hmg.utils
import io.flutter.plugin.common.MethodChannel import io.flutter.plugin.common.MethodChannel
import io.flutter.plugin.common.MethodChannel.Result import io.flutter.plugin.common.MethodChannel.Result

@ -1,4 +1,4 @@
package com.cloud.diplomaticquarterapp.utils package com.ejada.hmg.utils
import android.app.NotificationChannel import android.app.NotificationChannel
import android.app.NotificationManager import android.app.NotificationManager
@ -13,10 +13,10 @@ import android.widget.Toast
import androidx.annotation.Nullable import androidx.annotation.Nullable
import androidx.core.app.NotificationCompat import androidx.core.app.NotificationCompat
import androidx.core.app.TaskStackBuilder import androidx.core.app.TaskStackBuilder
import com.cloud.diplomaticquarterapp.BuildConfig import com.ejada.hmg.BuildConfig
import com.cloud.diplomaticquarterapp.MainActivity import com.ejada.hmg.MainActivity
import com.cloud.diplomaticquarterapp.R import com.ejada.hmg.R
import com.cloud.diplomaticquarterapp.geofence.GeoZoneModel import com.ejada.hmg.geofence.GeoZoneModel
import com.github.kittinunf.fuel.core.extensions.jsonBody import com.github.kittinunf.fuel.core.extensions.jsonBody
import com.github.kittinunf.fuel.httpPost import com.github.kittinunf.fuel.httpPost
import com.google.gson.Gson import com.google.gson.Gson

@ -1,4 +1,4 @@
//package com.cloud.diplomaticquarterapp.utils //package com.ejada.hmg.utils
// //
//import android.annotation.SuppressLint //import android.annotation.SuppressLint
//import android.content.Context //import android.content.Context
@ -10,8 +10,8 @@
//import android.net.wifi.WifiConfiguration //import android.net.wifi.WifiConfiguration
//import android.net.wifi.WifiManager //import android.net.wifi.WifiManager
//import android.util.Log //import android.util.Log
//import com.cloud.diplomaticquarterapp.utils.API //import com.ejada.hmg.utils.API
//import com.cloud.diplomaticquarterapp.FlutterMainActivity //import com.ejada.hmg.FlutterMainActivity
//import com.github.kittinunf.fuel.core.extensions.jsonBody //import com.github.kittinunf.fuel.core.extensions.jsonBody
//import com.github.kittinunf.fuel.httpGet //import com.github.kittinunf.fuel.httpGet
//import com.github.kittinunf.fuel.httpPost //import com.github.kittinunf.fuel.httpPost

@ -1,9 +1,9 @@
package com.cloud.diplomaticquarterapp.utils package com.ejada.hmg.utils
import android.content.Context import android.content.Context
import android.content.SharedPreferences import android.content.SharedPreferences
import android.os.Build import android.os.Build
import com.cloud.diplomaticquarterapp.BuildConfig import com.ejada.hmg.BuildConfig
import com.google.gson.Gson import com.google.gson.Gson
class Logs { class Logs {

@ -1,13 +1,13 @@
package com.cloud.diplomaticquarterapp.utils package com.ejada.hmg.utils
import android.content.Context import android.content.Context
import android.net.wifi.WifiManager import android.net.wifi.WifiManager
import android.util.Log import android.util.Log
import com.cloud.diplomaticquarterapp.MainActivity import com.ejada.hmg.MainActivity
import com.cloud.diplomaticquarterapp.hmgwifi.HMG_Guest import com.ejada.hmg.hmgwifi.HMG_Guest
import com.cloud.diplomaticquarterapp.hmgwifi.HMG_Internet import com.ejada.hmg.hmgwifi.HMG_Internet
import com.cloud.diplomaticquarterapp.geofence.GeoZoneModel import com.ejada.hmg.geofence.GeoZoneModel
import com.cloud.diplomaticquarterapp.geofence.HMG_Geofence import com.ejada.hmg.geofence.HMG_Geofence
import io.flutter.plugin.common.BinaryMessenger import io.flutter.plugin.common.BinaryMessenger
import io.flutter.plugin.common.MethodCall import io.flutter.plugin.common.MethodCall
import io.flutter.plugin.common.MethodChannel import io.flutter.plugin.common.MethodChannel

@ -1,5 +1,5 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android" <manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.cloud.diplomaticquarterapp"> package="com.ejada.hmg">
<!-- Flutter needs it to communicate with the running application <!-- Flutter needs it to communicate with the running application
to allow setting breakpoints, to provide hot reload, etc. to allow setting breakpoints, to provide hot reload, etc.
--> -->

@ -0,0 +1,6 @@
<svg xmlns="http://www.w3.org/2000/svg" width="56.51" height="31.024" viewBox="0 0 56.51 31.024">
<g id="liveCare_logo_icon_white" transform="translate(-30.848 -483.404)">
<path id="Subtraction_64" data-name="Subtraction 64" d="M811.541,968.522h-4.912a6.163,6.163,0,0,1-2.422-.493,6.3,6.3,0,0,1-3.326-3.322,6.123,6.123,0,0,1-.492-2.414V943.726a6.134,6.134,0,0,1,.492-2.42,6.294,6.294,0,0,1,3.321-3.318,6.138,6.138,0,0,1,2.415-.49h23.025a6.137,6.137,0,0,1,2.42.492,6.291,6.291,0,0,1,3.318,3.322,6.146,6.146,0,0,1,.491,2.415v4.578a5.135,5.135,0,0,0,0,9.609v4.366a6.161,6.161,0,0,1-.484,2.423,6.279,6.279,0,0,1-3.314,3.326,6.138,6.138,0,0,1-2.419.492h-5.383a16.214,16.214,0,0,0,1.754-1.74,1.622,1.622,0,0,0,.358-1.281,23.673,23.673,0,0,0,3.34-6.283,22.887,22.887,0,0,0,.909-3.31,16.559,16.559,0,0,0,.317-3.107,10.971,10.971,0,0,0-.49-3.594,4.693,4.693,0,0,0-1.415-2.113,6.726,6.726,0,0,0-2.252-1.177c-.887-.3-1.911-.533-3-.781h0l-.007-.011a1.676,1.676,0,0,0-1.5-.951,1.7,1.7,0,1,0,0,3.4,1.636,1.636,0,0,0,1-.375l.04.015.011,0,.027.006c1.083.25,1.938.446,2.648.677a4.637,4.637,0,0,1,1.688.861,2.889,2.889,0,0,1,.875,1.486,9.923,9.923,0,0,1,.251,2.558,14.326,14.326,0,0,1-.292,2.753,20.686,20.686,0,0,1-.83,2.96,23.036,23.036,0,0,1-1.294,2.939,20.4,20.4,0,0,1-1.688,2.689,1.624,1.624,0,0,0-1.12.542,11.511,11.511,0,0,1-2.422,2.162,5.57,5.57,0,0,1-6.528.009,11.419,11.419,0,0,1-2.42-2.151,1.625,1.625,0,0,0-1.118-.542,20.374,20.374,0,0,1-1.692-2.7,23.179,23.179,0,0,1-1.3-2.945,20.645,20.645,0,0,1-.832-2.964A14.367,14.367,0,0,1,807,952.8a10.047,10.047,0,0,1,.248-2.559,2.876,2.876,0,0,1,.872-1.486,4.6,4.6,0,0,1,1.689-.861c.718-.232,1.622-.439,2.668-.678l.024-.005.006,0,.016-.014a1.68,1.68,0,0,0,1.022.377,1.7,1.7,0,1,0,0-3.4,1.651,1.651,0,0,0-.9.269,1.848,1.848,0,0,0-.617.681l0,0-.022.005c-4.457,1.028-7.146,1.649-7.146,7.674a16.585,16.585,0,0,0,.318,3.11,22.827,22.827,0,0,0,.914,3.316,23.494,23.494,0,0,0,3.365,6.294,1.612,1.612,0,0,0,.359,1.28,16.389,16.389,0,0,0,1.734,1.72h0Zm2.975-17.665a.923.923,0,0,0-.928.88V959a.918.918,0,0,0,.927.877h7.157A.923.923,0,0,0,822.6,959v-7.251a.887.887,0,0,0-.282-.625.975.975,0,0,0-.654-.265Zm41.339,14.421h-2.52a2.17,2.17,0,0,1-1.127-.327l-10.483-6.616a1.036,1.036,0,0,1-.485-.873V956.8a5.128,5.128,0,0,0,0-7.39v-1.163a1.037,1.037,0,0,1,.485-.873l10.483-6.616a2.075,2.075,0,0,1,1.127-.327h2.521a1.038,1.038,0,0,1,1.042,1.03V964.25a1.019,1.019,0,0,1-.3.728,1.042,1.042,0,0,1-.739.3Zm-38.73-6.877-1.683-.007-.532,0h-.005l0-1.741c0-.3.147-.536.35-.55l.917,0c.2-.013.35-.245.35-.552l0-.4c0-.3-.152-.545-.354-.558l-.916,0c-.2-.014-.35-.247-.35-.553l0-1.734h2.235c.2,0,.362.218.371.516l0,1.41c.009.3.166.518.373.518l.466,0c.2,0,.359-.221.369-.526V952.84c.009-.3.171-.528.377-.528h1.54a.932.932,0,0,0,.7-.439l0,2.171c0,.31-.144.545-.344.558l-.916,0c-.2,0-.362.219-.371.521l0,.47c.009.3.163.521.369.521l.911,0c.2.013.352.242.352.544l0,1.739-2.267-.005c-.2,0-.342-.2-.351-.511l0-1.414c0-.305-.148-.536-.352-.549l-.516,0c-.2.013-.343.238-.343.548l0,1.407C817.495,958.177,817.332,958.4,817.125,958.4Z" transform="translate(-769.54 -454.094)" fill="#fff"/>
<path id="Path_663" data-name="Path 663" d="M971.268,998.3a2.982,2.982,0,1,1-2.982,2.982h0A2.982,2.982,0,0,1,971.268,998.3Z" transform="translate(-903.129 -502.474)" fill="#fff"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 3.2 KiB

@ -1,69 +1,72 @@
import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart';
class _Event{ class _Event {
String name; String name;
String description; String description;
bool active; bool active;
_Event(dynamic map){ _Event(dynamic map) {
name = map['name']; if (map != null) {
description = map['description']; name = map['name'];
active = map['active']; description = map['description'];
active = map['active'];
}
} }
flutterName() => 'f: $name'; flutterName() => 'f: $name';
} }
class AnalyticEvents{ class AnalyticEvents {
static _Event get(String key) { static _Event get(String key) {
var e = _Event(mapping[key]); var e = _Event(mapping[key]);
if(e == null){ if (e == null) {
var label = labelFrom(className: key); // Convert Class Name in to Label (HomeCare -> Home Care) var label = labelFrom(
e = _Event({"name": label, "active":true, "description":key}); className:
key); // Convert Class Name in to Label (HomeCare -> Home Care)
e = _Event({"name": label, "active": true, "description": key});
} }
return e; return e;
} }
static var mapping = const { static var mapping = const {
"HomeHealthCarePage" : { "HomeHealthCarePage": {
"active" : true, "active": true,
"name" : "Home Health Care Page", "name": "Home Health Care Page",
"description" : "", "description": "",
}, },
"SplashScreen" : { "SplashScreen": {
"active" : true, "active": true,
"name" : "Splash Screen", "name": "Splash Screen",
"description" : "", "description": "",
}, },
"LandingPage" : { "LandingPage": {
"active" : true, "active": true,
"name" : "Landing Page", "name": "Landing Page",
"description" : "", "description": "",
}, },
"WelcomeLogin" : { "WelcomeLogin": {
"active" : true, "active": true,
"name" : "Welcome Login", "name": "Welcome Login",
"description" : "", "description": "",
}, },
"LoginType" : { "LoginType": {
"active" : true, "active": true,
"name" : "Login Type", "name": "Login Type",
"description" : "", "description": "",
}, },
"Login" : { "Login": {
"active" : true, "active": true,
"name" : "Login", "name": "Login",
"description" : "", "description": "",
}, },
"ForgotPassword" : { "ForgotPassword": {
"active" : true, "active": true,
"name" : "Forgot Password", "name": "Forgot Password",
"description" : "", "description": "",
}, },
"" : { "": {
"active" : true, "active": true,
"name" : "", "name": "",
"description" : "", "description": "",
}, },
}; };
} }

@ -9,28 +9,32 @@ import 'package:flutter/services.dart';
class Singleton { class Singleton {
const Singleton(); //Constant constructor const Singleton(); //Constant constructor
void hello() { print('Hello world'); } void hello() {
print('Hello world');
}
} }
var analytics = FirebaseAnalytics(); var analytics = FirebaseAnalytics();
class GAnalytics{ class GAnalytics {
const GAnalytics(); const GAnalytics();
static GAnalytics shared = const GAnalytics(); static GAnalytics shared = const GAnalytics();
NavObserver navObserver() => NavObserver(); NavObserver navObserver() => NavObserver();
} }
// adb shell setprop debug.firebase.analytics.app com.ejada.hmg -> Android
class NavObserver extends RouteObserver<PageRoute<dynamic>>{
_sendScreenView(PageRoute route) async{
// adb shell setprop debug.firebase.analytics.app com.ejada.hmg -> Android
log(String className){ class NavObserver extends RouteObserver<PageRoute<dynamic>> {
_sendScreenView(PageRoute route) async {
log(String className) {
var event = AnalyticEvents.get(className); var event = AnalyticEvents.get(className);
if(event.active){ if (event.active != null) {
analytics.setCurrentScreen(screenName: event.flutterName(), screenClassOverride: className).catchError( (Object error) { analytics
debugPrint('$FirebaseAnalyticsObserver: $error'); .setCurrentScreen(
}, screenName: event.flutterName(), screenClassOverride: className)
.catchError(
(Object error) {
debugPrint('$FirebaseAnalyticsObserver: $error');
},
test: (Object error) { test: (Object error) {
return error is PlatformException; return error is PlatformException;
}, },
@ -38,25 +42,20 @@ class NavObserver extends RouteObserver<PageRoute<dynamic>>{
} }
} }
if(route.settings.name != null && route.settings.name.isNotEmpty && route.settings.name != "null"){ if (route.settings.name != null &&
route.settings.name.isNotEmpty &&
route.settings.name != "null") {
var class_ = routes[route.settings.name](0); var class_ = routes[route.settings.name](0);
if(class_ != null) if (class_ != null) log(class_.toStringShort());
log(class_.toStringShort()); } else if (route is FadePage) {
}else if(route is FadePage){
var class_ = route.page; var class_ = route.page;
if(class_ != null) if (class_ != null) log(class_.toStringShort());
log(class_.toStringShort()); } else if (route is MaterialPageRoute) {
}else if(route is MaterialPageRoute){
var class_ = route.builder(null); var class_ = route.builder(null);
if (class_ != null) if (class_ != null) log(class_.toStringShort());
log(class_.toStringShort()); } else {
}else{
print(""); print("");
} }
} }
@override @override
@ -82,4 +81,4 @@ class NavObserver extends RouteObserver<PageRoute<dynamic>>{
// _sendScreenView(previousRoute); // _sendScreenView(previousRoute);
// } // }
} }
} }

@ -14,15 +14,15 @@ const PACKAGES_SHOPPING_CART = '/api/shopping_cart_items';
const PACKAGES_ORDERS = '/api/orders'; const PACKAGES_ORDERS = '/api/orders';
const BASE_URL = 'https://uat.hmgwebservices.com/'; const BASE_URL = 'https://uat.hmgwebservices.com/';
// const BASE_URL = 'https://hmgwebservices.com/'; //const BASE_URL = 'https://hmgwebservices.com/';
// Pharmacy UAT URLs // Pharmacy UAT URLs
const BASE_PHARMACY_URL = 'https://uat.hmgwebservices.com/epharmacy/api/'; //const BASE_PHARMACY_URL = 'https://uat.hmgwebservices.com/epharmacy/api/';
const PHARMACY_BASE_URL = 'https://uat.hmgwebservices.com/epharmacy/api/'; //const PHARMACY_BASE_URL = 'https://uat.hmgwebservices.com/epharmacy/api/';
// Pharmacy Production URLs // Pharmacy Production URLs
//const BASE_PHARMACY_URL = 'https://mdlaboratories.com/exacartapi/api/'; const BASE_PHARMACY_URL = 'https://mdlaboratories.com/exacartapi/api/';
//const PHARMACY_BASE_URL = 'https://mdlaboratories.com/exacartapi/api/'; const PHARMACY_BASE_URL = 'https://mdlaboratories.com/exacartapi/api/';
const PING_SERVICE = 'Services/Weather.svc/REST/CheckConnectivity'; const PING_SERVICE = 'Services/Weather.svc/REST/CheckConnectivity';
@ -334,7 +334,7 @@ const IS_DENTAL_ALLOWED_BACKEND = false;
const PATIENT_TYPE = 1; const PATIENT_TYPE = 1;
const PATIENT_TYPE_ID = 1; const PATIENT_TYPE_ID = 1;
var DEVICE_TOKEN = ""; var DEVICE_TOKEN = "";
var IS_VOICE_COMMAND_CLOSED = false; var IS_VOICE_COMMAND_CLOSED = true;
var IS_TEXT_COMPLETED = false; var IS_TEXT_COMPLETED = false;
var DeviceTypeID = Platform.isIOS ? 1 : 2; var DeviceTypeID = Platform.isIOS ? 1 : 2;
const LANGUAGE_ID = 2; const LANGUAGE_ID = 2;
@ -354,7 +354,7 @@ const UPLOAD_INSURANCE_CARD =
const GET_VACCINES = "Services/Patients.svc/REST/GetDoneVaccinesByPatientID"; const GET_VACCINES = "Services/Patients.svc/REST/GetDoneVaccinesByPatientID";
const GET_VACCINES_EMAIL = "Services/Notifications.svc/REST/SendVaccinesEmail"; const GET_VACCINES_EMAIL = "Services/Notifications.svc/REST/SendVaccinesEmail";
const GET_PAtIENTS_INSURANCE_APPROVALS = const GET_PAtIENTS_INSURANCE_APPROVALS =
"Services/Patients.svc/REST/GetApprovalStatus"; "Services/Patients.svc/REST/GetApprovalStatus_DWH";
const SEARCH_BOT = 'HabibiChatBotApi/BotInterface/GetVoiceCommandResponse'; const SEARCH_BOT = 'HabibiChatBotApi/BotInterface/GetVoiceCommandResponse';
const GET_VACCINATIONS_ITEMS = "/Services/ERP.svc/REST/GET_VACCINATIONS_ITEMS"; const GET_VACCINATIONS_ITEMS = "/Services/ERP.svc/REST/GET_VACCINATIONS_ITEMS";
@ -384,6 +384,9 @@ const GET_COVID_DRIVETHRU_PAYMENT_INFO =
const GET_COVID_DRIVETHRU_FREE_SLOTS = const GET_COVID_DRIVETHRU_FREE_SLOTS =
'Services/Doctors.svc/REST/COVID19_GetFreeSlots'; 'Services/Doctors.svc/REST/COVID19_GetFreeSlots';
const GET_COVID_DRIVETHRU_PROCEDURES_LIST =
'Services/Doctors.svc/REST/COVID19_GetTestProcedures';
///Smartwatch Integration Services ///Smartwatch Integration Services
const GET_PATIENT_LAST_RECORD = const GET_PATIENT_LAST_RECORD =
'Services/Patients.svc/REST/Med_GetPatientLastRecord'; 'Services/Patients.svc/REST/Med_GetPatientLastRecord';

@ -467,11 +467,10 @@ const Map localizedValues = {
" خدمة المواقف، تتيح هذه الخدمة للمستخدم معلومات عن موقف السيارة ليسهل عليه العودة لها لاحقاً ، 1- بالضغط على زر(قراءة الكود) تستطيع حفظ البيانات الخاصة بالموقف. 2-بالضغط على زر(عرض موقف سيارتي) يعرض لك موقع السيارة في خرائط قوقل. 3- لإعادة قراءة موقف آخرعن طريق الضغط على زر(مسح بيانات الموقف). " " خدمة المواقف، تتيح هذه الخدمة للمستخدم معلومات عن موقف السيارة ليسهل عليه العودة لها لاحقاً ، 1- بالضغط على زر(قراءة الكود) تستطيع حفظ البيانات الخاصة بالموقف. 2-بالضغط على زر(عرض موقف سيارتي) يعرض لك موقع السيارة في خرائط قوقل. 3- لإعادة قراءة موقف آخرعن طريق الضغط على زر(مسح بيانات الموقف). "
}, },
"parkingDescription": { "parkingDescription": {
"en":
"en": "Parking service is for you to scan the car location so you can find it easy on you way out. click on (scan parking) button to save the parking location, then (show my park) button will appear to show you the way for the parking. if you want to rescan parking QR just click on (Clear My Data).", "Parking service is for you to scan the car location so you can find it easy on you way out. click on (scan parking) button to save the parking location, then (show my park) button will appear to show you the way for the parking. if you want to rescan parking QR just click on (Clear My Data).",
"ar":
"ar": "خدمة المواقف، تتيح هذه الخدمة للمستخدم معلومات عن موقف السيارة ليسهل عليه العودة لها لاحقاً ، 1- بالضغط على زر(قراءة الكود) تستطيع حفظ البيانات الخاصة بالموقف. 2-بالضغط على زر(عرض موقف سيارتي) يعرض لك موقع السيارة في خرائط قوقل. 3- لإعادة قراءة موقف آخرعن طريق الضغط على زر(مسح بيانات الموقف)." "خدمة المواقف، تتيح هذه الخدمة للمستخدم معلومات عن موقف السيارة ليسهل عليه العودة لها لاحقاً ، 1- بالضغط على زر(قراءة الكود) تستطيع حفظ البيانات الخاصة بالموقف. 2-بالضغط على زر(عرض موقف سيارتي) يعرض لك موقع السيارة في خرائط قوقل. 3- لإعادة قراءة موقف آخرعن طريق الضغط على زر(مسح بيانات الموقف)."
}, },
"checkinOption": {"en": "Check-In Options", "ar": "تحقق في الخيارات"}, "checkinOption": {"en": "Check-In Options", "ar": "تحقق في الخيارات"},
"readBarcode": {"en": "Read Barcode", "ar": "قراءة الكود"}, "readBarcode": {"en": "Read Barcode", "ar": "قراءة الكود"},
@ -481,11 +480,11 @@ const Map localizedValues = {
"gate": {"en": "Gate:", "ar": "بوابة"}, "gate": {"en": "Gate:", "ar": "بوابة"},
"building": {"en": "Building:", "ar": "المبنى"}, "building": {"en": "Building:", "ar": "المبنى"},
"branch": {"en": "Branch:", "ar": "الفرع"}, "branch": {"en": "Branch:", "ar": "الفرع"},
"emergencyServices": {"en": "Emergency Services:", "ar": "خدمات الطوارئ"}, "emergencyServices": {"en": "Emergency Services", "ar": "خدمات الطوارئ"},
"nearester": {"en": "Nearest ER:", "ar": "أقرب طوارى"}, "nearester": {"en": "Nearest ER", "ar": "أقرب طوارى"},
"locationa": {"en": "location:", "ar": "الموقع"}, "locationa": {"en": "location", "ar": "الموقع"},
"ambulancerequest": {"en": "Ambulance :", "ar": "طلب نقل "}, "ambulancerequest": {"en": "Ambulance ", "ar": "طلب نقل "},
"requestA": {"en": "Request:", "ar": "اسعاف"}, "requestA": {"en": "Request", "ar": "اسعاف"},
"MyAppointments": {"en": "Appointments", "ar": "مواعيدي"}, "MyAppointments": {"en": "Appointments", "ar": "مواعيدي"},
"NoBookedAppointments": { "NoBookedAppointments": {
"en": "No Booked Appointments", "en": "No Booked Appointments",
@ -1089,8 +1088,7 @@ const Map localizedValues = {
}, },
"MoreDetails": {"en": "More details", "ar": " المزيد من التفاصيل "}, "MoreDetails": {"en": "More details", "ar": " المزيد من التفاصيل "},
"SendCopy": {"en": "Send Copy", "ar": "ارسال نسخة"}, "SendCopy": {"en": "Send Copy", "ar": "ارسال نسخة"},
"ResendOrder": {"en": "Refill Order & Delivery", "ar": "إعادة طلب و توصيل"},
"ResendOrder": {"en": "Resend order & deliver", "ar": "إعادة طلب و توصيل"},
"Ports": {"en": "Ports", "ar": "المنافذ"}, "Ports": {"en": "Ports", "ar": "المنافذ"},
"Way": {"en": "Way", "ar": "الطزيقة"}, "Way": {"en": "Way", "ar": "الطزيقة"},
"Average": {"en": "Average", "ar": "المعدل"}, "Average": {"en": "Average", "ar": "المعدل"},
@ -1132,6 +1130,7 @@ const Map localizedValues = {
}, },
"question": {"en": "Question", "ar": "سؤال"}, "question": {"en": "Question", "ar": "سؤال"},
"message-type": {"en": "Message Type", "ar": "نوع الرسالة"}, "message-type": {"en": "Message Type", "ar": "نوع الرسالة"},
"feedback-type": {"en": "Feedback Type", "ar": "نوع الرسالة"},
"compliment": {"en": "compliment", "ar": "ثناء"}, "compliment": {"en": "compliment", "ar": "ثناء"},
"suggestion": {"en": "Suggestion", "ar": "إقتراح"}, "suggestion": {"en": "Suggestion", "ar": "إقتراح"},
"your-feedback": { "your-feedback": {
@ -1234,6 +1233,7 @@ const Map localizedValues = {
"ar": "حدد طريقة النقل" "ar": "حدد طريقة النقل"
}, },
"RRT-direction-heading": {"en": "Select Direction", "ar": "حدد الاتجاه"}, "RRT-direction-heading": {"en": "Select Direction", "ar": "حدد الاتجاه"},
"RRT-way-heading": {"en": "Select Way", "ar": "حدد الطريق"},
"to-hospital": {"en": "To Hospital", "ar": "الى المستشفى"}, "to-hospital": {"en": "To Hospital", "ar": "الى المستشفى"},
"from-hospital": {"en": "From Hospital", "ar": "من المستشفى"}, "from-hospital": {"en": "From Hospital", "ar": "من المستشفى"},
"one-direc": {"en": "One Way", "ar": "ذهاب"}, "one-direc": {"en": "One Way", "ar": "ذهاب"},
@ -1264,16 +1264,36 @@ const Map localizedValues = {
"stretcher": {"en": "Stretcher", "ar": "نقالة"}, "stretcher": {"en": "Stretcher", "ar": "نقالة"},
"none": {"en": "None", "ar": "لا شيء"}, "none": {"en": "None", "ar": "لا شيء"},
"RRT-Summary": {"en": "Summary", "ar": "ملخص الطلب"}, "RRT-Summary": {"en": "Summary", "ar": "ملخص الطلب"},
"Rapid-Response-Team": {
"en": "Rapid Response Team",
"ar": "فريق الاستجابة السريع"
},
"AmountBeforeTax": {"en": "Amount Before Tax:", "ar": "Amount Before Tax:"}, "AmountBeforeTax": {"en": "Amount Before Tax:", "ar": "Amount Before Tax:"},
"ApproximateServiceFee": {"en": "Approximate Service Fee", "ar": "Approximate Service Fee"}, "ApproximateServiceFee": {
"en": "Approximate Service Fee",
"ar": "Approximate Service Fee"
},
"TaxAmount": {"en": "Tax Amount:", "ar": "Tax Amount:"}, "TaxAmount": {"en": "Tax Amount:", "ar": "Tax Amount:"},
"TotalAmountPayable": {"en": "Total Amount Payable:", "ar": "Total Amount Payable:"},
"iAcceptTermsConditions": {"en": "I Accept the Terms And Conditions", "ar": "You can pay by the following options:"},
"somethingWentWrongTryLater": {"en": "Sorry something went wrong please try again later", "ar": "نعتذر لخدمتكم يرجى المحاولة لاحقا"}, "somethingWentWrongTryLater": {"en": "Sorry something went wrong please try again later", "ar": "نعتذر لخدمتكم يرجى المحاولة لاحقا"},
"YouCanPayByTheFollowingOptions": {"en": "You can pay by the following options:", "ar": "I Accept the Terms And Conditions"}, "TotalAmountPayable": {
"RRTDDetails": {"en": "The RRT service provides medical services urgent and stable cases, not life-threatening situation or extremities and the service includes providing medical care from a copmplete medical team at home", "ar": "The RRT service provides medical services urgent and stable cases, not life-threatening situation or extremities and the service includes providing medical care from a copmplete medical team at home"}, "en": "Total Amount Payable:",
"Rapid-Response-Team": {"en": "Rapid Response Team", "ar": "فريق الاستجابة السريع"}, "ar": "Total Amount Payable:"
"rrtService": {"en": "RRT Service", "ar": "خدمة RRT"}, },
"iAcceptTermsConditions": {
"en": "I Accept the Terms And Conditions",
"ar": "You can pay by the following options:"
},
"YouCanPayByTheFollowingOptions": {
"en": "You can pay by the following options:",
"ar": "I Accept the Terms And Conditions"
},
"RRTDDetails": {
"en":
"The RRT service provides medical services urgent and stable cases, not life-threatening situation or extremities and the service includes providing medical care from a copmplete medical team at home",
"ar":
"The RRT service provides medical services urgent and stable cases, not life-threatening situation or extremities and the service includes providing medical care from a copmplete medical team at home"
},
"rrtService": {"en": "RRT Service", "ar": "خدمة RRT"},
"rrtUserAgreementTitle":{ "rrtUserAgreementTitle":{
"en":"Communication via email, text messages and phone calls", "en":"Communication via email, text messages and phone calls",
"ar":"الاتصال عبر البريد الإلكتروني، والرسائل النصية، والمكالمات الهاتفية" "ar":"الاتصال عبر البريد الإلكتروني، والرسائل النصية، والمكالمات الهاتفية"
@ -1513,7 +1533,7 @@ const Map localizedValues = {
"خدمة بطاقات التامين: هذه الخدمة تمكنك من الاطلاع على جميع بطاقات التامين والتي تم تسجيلها اثناء زياراتك لمجموعة الحبيب الطبية بالاضافة الى:" "خدمة بطاقات التامين: هذه الخدمة تمكنك من الاطلاع على جميع بطاقات التامين والتي تم تسجيلها اثناء زياراتك لمجموعة الحبيب الطبية بالاضافة الى:"
}, },
"scan-now": { "scan-now": {
"en": "If you have a card / Document Scan now", "en": "If you have a card/Document Scan now",
"ar": "إذا كانت لديك بطاقة / مستند ارفقها الان" "ar": "إذا كانت لديك بطاقة / مستند ارفقها الان"
}, },
"liveCare": {"en": "Live Care", "ar": "لايف كير"}, "liveCare": {"en": "Live Care", "ar": "لايف كير"},
@ -2060,7 +2080,10 @@ const Map localizedValues = {
"en": "Search For Referrals", "en": "Search For Referrals",
"ar": "ابحث عن الإحالات" "ar": "ابحث عن الإحالات"
}, },
"covid-select-procedure": {
"en": "Please select the procedure:",
"ar": "الرجاء تحديد الإجراء:"
},
"online-consultation": {"en": "Online Consultation", "ar": "استشارة مباشرة"}, "online-consultation": {"en": "Online Consultation", "ar": "استشارة مباشرة"},
"expected-weiting": { "expected-weiting": {
"en": "Waiting time to start LiveCare consultation ", "en": "Waiting time to start LiveCare consultation ",
@ -2085,4 +2108,17 @@ const Map localizedValues = {
"en": "Please accept terms & conditions to continue", "en": "Please accept terms & conditions to continue",
"ar": "يرجى قبول الشروط والأحكام للمتابعة" "ar": "يرجى قبول الشروط والأحكام للمتابعة"
}, },
"type": {"en": "Type", "ar": "اكتب"},
"info-ereferral": {
"en":
"This service allows you to submit a Referral request from any health care providers either inside or outside the kingdom of Saudi Arabia to any of HMG Hospitals, By filling some of the patient's data and attaching the medical reports, moreover you can track the request status (Under process, Accepted or Rejected)",
"ar":
"تتيح لك هذه الخدمة إرسال طلب إحالة من أي من مقدمي الرعاية الصحية سواء داخل المملكة العربية السعودية أو خارجها إلى أي من مستشفيات HMG ، عن طريق ملء بعض بيانات المريض وإرفاق التقارير الطبية ، علاوة على ذلك يمكنك تتبع حالة الطلب ( قيد المعالجة ، مقبول أو مرفوض)"
},
"er-consultation": {
"en":
"This service allows you to make an online virtual consultation via video call directly with the doctor from anywhere at any time.",
"ar":
"تتيح لك هذه الخدمة إجراء استشارة عبر مكالمة فيديو مباشرة مع الطبيب من أي مكان وفي أي وقت"
},
}; };

@ -29,8 +29,7 @@ AppSharedPreferences sharedPref = new AppSharedPreferences();
/// onFailure: (String error, int statusCode) {}, /// onFailure: (String error, int statusCode) {},
/// body: Map(); /// body: Map();
/// ///
AuthenticatedUserObject authenticatedUserObject = AuthenticatedUserObject authenticatedUserObject = locator<AuthenticatedUserObject>();
locator<AuthenticatedUserObject>();
VitalSignService _vitalSignService = locator<VitalSignService>(); VitalSignService _vitalSignService = locator<VitalSignService>();
class BaseAppClient { class BaseAppClient {
@ -50,14 +49,10 @@ class BaseAppClient {
//Map profile = await sharedPref.getObj(DOCTOR_PROFILE); //Map profile = await sharedPref.getObj(DOCTOR_PROFILE);
var pharmacyToken = await sharedPref.getString(PHARMACY_AUTORZIE_TOKEN); var pharmacyToken = await sharedPref.getString(PHARMACY_AUTORZIE_TOKEN);
var user = await sharedPref.getObject(USER_PROFILE); var user = await sharedPref.getObject(USER_PROFILE);
Map<String, String> headers = { Map<String, String> headers = {'Content-Type': 'application/json', 'Accept': 'application/json'};
'Content-Type': 'application/json',
'Accept': 'application/json'
};
if (!isExternal) { if (!isExternal) {
String token = await sharedPref.getString(TOKEN); String token = await sharedPref.getString(TOKEN);
var languageID = var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
if (body.containsKey('SetupID')) { if (body.containsKey('SetupID')) {
body['SetupID'] = body.containsKey('SetupID') body['SetupID'] = body.containsKey('SetupID')
? body['SetupID'] != null ? body['SetupID'] != null
@ -72,19 +67,13 @@ class BaseAppClient {
body['IPAdress'] = IP_ADDRESS; body['IPAdress'] = IP_ADDRESS;
body['generalid'] = GENERAL_ID; body['generalid'] = GENERAL_ID;
body['PatientOutSA'] = body.containsKey('PatientOutSA')
? body['PatientOutSA'] != null
? body['PatientOutSA']
: PATIENT_OUT_SA
: PATIENT_OUT_SA;
if (body.containsKey('isDentalAllowedBackend')) { if (body.containsKey('isDentalAllowedBackend')) {
body['isDentalAllowedBackend'] = body['isDentalAllowedBackend'] = body.containsKey('isDentalAllowedBackend')
body.containsKey('isDentalAllowedBackend') ? body['isDentalAllowedBackend'] != null
? body['isDentalAllowedBackend'] != null ? body['isDentalAllowedBackend']
? body['isDentalAllowedBackend'] : IS_DENTAL_ALLOWED_BACKEND
: IS_DENTAL_ALLOWED_BACKEND : IS_DENTAL_ALLOWED_BACKEND;
: IS_DENTAL_ALLOWED_BACKEND;
} }
body['DeviceTypeID'] = Platform.isAndroid ? 1 : 2; body['DeviceTypeID'] = Platform.isAndroid ? 1 : 2;
@ -107,19 +96,20 @@ class BaseAppClient {
: PATIENT_TYPE_ID; : PATIENT_TYPE_ID;
if (user != null) { if (user != null) {
body['TokenID'] = token; body['TokenID'] = token;
body['PatientID'] = body['PatientID'] != null body['PatientID'] = body['PatientID'] != null ? body['PatientID'] : user['PatientID'];
? body['PatientID']
: user['PatientID'];
body['PatientOutSA'] = user['OutSA']; body['PatientOutSA'] = user['OutSA'];
body['PatientOutSA'] = body.containsKey('PatientOutSA')
? body['PatientOutSA'] != null
? body['PatientOutSA']
: PATIENT_OUT_SA
: PATIENT_OUT_SA;
body['SessionID'] = SESSION_ID; //getSe body['SessionID'] = SESSION_ID; //getSe
headers = { headers = {
'Content-Type': 'application/json', 'Content-Type': 'application/json',
'Accept': 'application/json', 'Accept': 'application/json',
'Authorization': pharmacyToken, 'Authorization': pharmacyToken,
'Mobilenumber': user != null 'Mobilenumber': user != null ? Utils.getPhoneNumberWithoutZero(user['MobileNumber'].toString()) : "",
? Utils.getPhoneNumberWithoutZero(
user['MobileNumber'].toString())
: "",
'Statictoken': 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9', 'Statictoken': 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9',
'Username': user['PatientID'].toString(), 'Username': user['PatientID'].toString(),
}; };
@ -131,8 +121,7 @@ class BaseAppClient {
print("Body : ${json.encode(body)}"); print("Body : ${json.encode(body)}");
if (await Utils.checkConnection()) { if (await Utils.checkConnection()) {
final response = await http.post(url.trim(), final response = await http.post(url.trim(), body: json.encode(body), headers: headers);
body: json.encode(body), headers: headers);
final int statusCode = response.statusCode; final int statusCode = response.statusCode;
print("statusCode :$statusCode"); print("statusCode :$statusCode");
if (statusCode < 200 || statusCode >= 400 || json == null) { if (statusCode < 200 || statusCode >= 400 || json == null) {
@ -144,8 +133,7 @@ class BaseAppClient {
onSuccess(parsed, statusCode); onSuccess(parsed, statusCode);
} else { } else {
if (parsed['ErrorType'] == 4) { if (parsed['ErrorType'] == 4) {
navigateToAppUpdate( navigateToAppUpdate(AppGlobal.context, parsed['ErrorEndUserMessage']);
AppGlobal.context, parsed['ErrorEndUserMessage']);
} }
if (isAllowAny) { if (isAllowAny) {
onSuccess(parsed, statusCode); onSuccess(parsed, statusCode);
@ -160,35 +148,24 @@ class BaseAppClient {
if (parsed != null) { if (parsed != null) {
onSuccess(parsed, statusCode); onSuccess(parsed, statusCode);
} else { } else {
onFailure( onFailure(parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], statusCode);
parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'],
statusCode);
logout(); logout();
} }
} }
} else if (parsed['MessageStatus'] == 1 || } else if (parsed['MessageStatus'] == 1 || parsed['SMSLoginRequired'] == true) {
parsed['SMSLoginRequired'] == true) {
onSuccess(parsed, statusCode); onSuccess(parsed, statusCode);
debugPrint(parsed.toString()); } else if (parsed['MessageStatus'] == 2 && parsed['IsAuthenticated']) {
} else if (parsed['MessageStatus'] == 2 &&
parsed['IsAuthenticated']) {
if (parsed['SameClinicApptList'] != null) { if (parsed['SameClinicApptList'] != null) {
onSuccess(parsed, statusCode); onSuccess(parsed, statusCode);
} else { } else {
if (parsed['message'] == null && if (parsed['message'] == null && parsed['ErrorEndUserMessage'] == null) {
parsed['ErrorEndUserMessage'] == null) {
if (parsed['ErrorSearchMsg'] == null) { if (parsed['ErrorSearchMsg'] == null) {
onFailure("Server Error found with no available message", onFailure("Server Error found with no available message", statusCode);
statusCode);
} else { } else {
onFailure(parsed['ErrorSearchMsg'], statusCode); onFailure(parsed['ErrorSearchMsg'], statusCode);
} }
} else { } else {
onFailure( onFailure(parsed['message'] ?? parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], statusCode);
parsed['message'] ??
parsed['ErrorEndUserMessage'] ??
parsed['ErrorMessage'],
statusCode);
} }
} }
} else if (!parsed['IsAuthenticated']) { } else if (!parsed['IsAuthenticated']) {
@ -202,9 +179,7 @@ class BaseAppClient {
if (parsed['message'] != null) { if (parsed['message'] != null) {
onFailure(parsed['message'] ?? parsed['message'], statusCode); onFailure(parsed['message'] ?? parsed['message'], statusCode);
} else { } else {
onFailure( onFailure(parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], statusCode);
parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'],
statusCode);
} }
} }
} }
@ -241,16 +216,13 @@ class BaseAppClient {
'Content-Type': 'application/json', 'Content-Type': 'application/json',
'Accept': 'application/json', 'Accept': 'application/json',
'Authorization': token ?? '', 'Authorization': token ?? '',
'Mobilenumber': user != null 'Mobilenumber': user != null ? Utils.getPhoneNumberWithoutZero(user['MobileNumber'].toString()) : "",
? Utils.getPhoneNumberWithoutZero(user['MobileNumber'].toString())
: "",
'Statictoken': 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9', 'Statictoken': 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9',
'Username': user != null ? user['PatientID'].toString() : "", 'Username': user != null ? user['PatientID'].toString() : "",
}; };
if (!isExternal) { if (!isExternal) {
String token = await sharedPref.getString(TOKEN); String token = await sharedPref.getString(TOKEN);
var languageID = var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
if (body.containsKey('SetupID')) { if (body.containsKey('SetupID')) {
body['SetupID'] = body.containsKey('SetupID') body['SetupID'] = body.containsKey('SetupID')
? body['SetupID'] != null ? body['SetupID'] != null
@ -272,12 +244,11 @@ class BaseAppClient {
: PATIENT_OUT_SA; : PATIENT_OUT_SA;
if (body.containsKey('isDentalAllowedBackend')) { if (body.containsKey('isDentalAllowedBackend')) {
body['isDentalAllowedBackend'] = body['isDentalAllowedBackend'] = body.containsKey('isDentalAllowedBackend')
body.containsKey('isDentalAllowedBackend') ? body['isDentalAllowedBackend'] != null
? body['isDentalAllowedBackend'] != null ? body['isDentalAllowedBackend']
? body['isDentalAllowedBackend'] : IS_DENTAL_ALLOWED_BACKEND
: IS_DENTAL_ALLOWED_BACKEND : IS_DENTAL_ALLOWED_BACKEND;
: IS_DENTAL_ALLOWED_BACKEND;
} }
body['DeviceTypeID'] = Platform.isAndroid ? 1 : 2; body['DeviceTypeID'] = Platform.isAndroid ? 1 : 2;
@ -300,9 +271,7 @@ class BaseAppClient {
: PATIENT_TYPE_ID; : PATIENT_TYPE_ID;
if (user != null) { if (user != null) {
body['TokenID'] = token; body['TokenID'] = token;
body['PatientID'] = body['PatientID'] != null body['PatientID'] = body['PatientID'] != null ? body['PatientID'] : user['PatientID'];
? body['PatientID']
: user['PatientID'];
body['PatientOutSA'] = user['OutSA']; body['PatientOutSA'] = user['OutSA'];
body['SessionID'] = SESSION_ID; //getSe body['SessionID'] = SESSION_ID; //getSe
headers = { headers = {
@ -321,8 +290,7 @@ class BaseAppClient {
print("Body : ${json.encode(body)}"); print("Body : ${json.encode(body)}");
if (await Utils.checkConnection()) { if (await Utils.checkConnection()) {
final response = await http.post(url.trim(), final response = await http.post(url.trim(), body: json.encode(body), headers: headers);
body: json.encode(body), headers: headers);
final int statusCode = response.statusCode; final int statusCode = response.statusCode;
print("statusCode :$statusCode"); print("statusCode :$statusCode");
if (statusCode < 200 || statusCode >= 400 || json == null) { if (statusCode < 200 || statusCode >= 400 || json == null) {
@ -334,8 +302,7 @@ class BaseAppClient {
onSuccess(parsed, statusCode); onSuccess(parsed, statusCode);
} else { } else {
if (parsed['ErrorType'] == 4) { if (parsed['ErrorType'] == 4) {
navigateToAppUpdate( navigateToAppUpdate(AppGlobal.context, parsed['ErrorEndUserMessage']);
AppGlobal.context, parsed['ErrorEndUserMessage']);
} }
if (isAllowAny) { if (isAllowAny) {
onSuccess(parsed, statusCode); onSuccess(parsed, statusCode);
@ -350,34 +317,24 @@ class BaseAppClient {
if (parsed != null) { if (parsed != null) {
onSuccess(parsed, statusCode); onSuccess(parsed, statusCode);
} else { } else {
onFailure( onFailure(parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], statusCode);
parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'],
statusCode);
logout(); logout();
} }
} }
} else if (parsed['MessageStatus'] == 1 || } else if (parsed['MessageStatus'] == 1 || parsed['SMSLoginRequired'] == true) {
parsed['SMSLoginRequired'] == true) {
onSuccess(parsed, statusCode); onSuccess(parsed, statusCode);
} else if (parsed['MessageStatus'] == 2 && } else if (parsed['MessageStatus'] == 2 && parsed['IsAuthenticated']) {
parsed['IsAuthenticated']) {
if (parsed['SameClinicApptList'] != null) { if (parsed['SameClinicApptList'] != null) {
onSuccess(parsed, statusCode); onSuccess(parsed, statusCode);
} else { } else {
if (parsed['message'] == null && if (parsed['message'] == null && parsed['ErrorEndUserMessage'] == null) {
parsed['ErrorEndUserMessage'] == null) {
if (parsed['ErrorSearchMsg'] == null) { if (parsed['ErrorSearchMsg'] == null) {
onFailure("Server Error found with no available message", onFailure("Server Error found with no available message", statusCode);
statusCode);
} else { } else {
onFailure(parsed['ErrorSearchMsg'], statusCode); onFailure(parsed['ErrorSearchMsg'], statusCode);
} }
} else { } else {
onFailure( onFailure(parsed['message'] ?? parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], statusCode);
parsed['message'] ??
parsed['ErrorEndUserMessage'] ??
parsed['ErrorMessage'],
statusCode);
} }
} }
} else if (!parsed['IsAuthenticated']) { } else if (!parsed['IsAuthenticated']) {
@ -391,9 +348,7 @@ class BaseAppClient {
if (parsed['message'] != null) { if (parsed['message'] != null) {
onFailure(parsed['message'] ?? parsed['message'], statusCode); onFailure(parsed['message'] ?? parsed['message'], statusCode);
} else { } else {
onFailure( onFailure(parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], statusCode);
parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'],
statusCode);
} }
} }
} }
@ -409,8 +364,7 @@ class BaseAppClient {
} }
Future navigateToAppUpdate(context, String text) async { Future navigateToAppUpdate(context, String text) async {
Navigator.pushReplacement( Navigator.pushReplacement(context, FadePage(page: AppUpdatePage(appUpdateText: text)));
context, FadePage(page: AppUpdatePage(appUpdateText: text)));
} }
get(String endPoint, get(String endPoint,
@ -434,10 +388,7 @@ class BaseAppClient {
if (await Utils.checkConnection()) { if (await Utils.checkConnection()) {
final response = await http.get( final response = await http.get(
url.trim(), url.trim(),
headers: { headers: {'Content-Type': 'application/json', 'Accept': 'application/json'},
'Content-Type': 'application/json',
'Accept': 'application/json'
},
); );
final int statusCode = response.statusCode; final int statusCode = response.statusCode;
print("statusCode :$statusCode"); print("statusCode :$statusCode");
@ -481,9 +432,7 @@ class BaseAppClient {
'Content-Type': 'text/html; charset=utf-8', 'Content-Type': 'text/html; charset=utf-8',
'Accept': 'application/json', 'Accept': 'application/json',
'Authorization': token ?? '', 'Authorization': token ?? '',
'Mobilenumber': user != null 'Mobilenumber': user != null ? Utils.getPhoneNumberWithoutZero(user['MobileNumber'].toString()) : "",
? Utils.getPhoneNumberWithoutZero(user['MobileNumber'].toString())
: "",
'Statictoken': 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9', 'Statictoken': 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9',
'Username': user != null ? user['PatientID'].toString() : "", 'Username': user != null ? user['PatientID'].toString() : "",
}); });
@ -492,8 +441,7 @@ class BaseAppClient {
if (statusCode < 200 || statusCode >= 400 || json == null) { if (statusCode < 200 || statusCode >= 400 || json == null) {
if (statusCode == 401) { if (statusCode == 401) {
AppToast.showErrorToast( AppToast.showErrorToast(message: TranslationBase.of(AppGlobal.context).pharmacyRelogin);
message: TranslationBase.of(AppGlobal.context).pharmacyRelogin);
Navigator.of(AppGlobal.context).pushNamed(HOME); Navigator.of(AppGlobal.context).pushNamed(HOME);
} else { } else {
onFailure('Error While Fetching data', statusCode); onFailure('Error While Fetching data', statusCode);
@ -521,10 +469,7 @@ class BaseAppClient {
final response = await http.post( final response = await http.post(
url.trim(), url.trim(),
body: json.encode(body), body: json.encode(body),
headers: { headers: {'Content-Type': 'application/json', 'Accept': 'application/json'},
'Content-Type': 'application/json',
'Accept': 'application/json'
},
); );
final int statusCode = response.statusCode; final int statusCode = response.statusCode;
@ -557,10 +502,7 @@ class BaseAppClient {
if (await Utils.checkConnection()) { if (await Utils.checkConnection()) {
final response = await http.get( final response = await http.get(
url.trim(), url.trim(),
headers: { headers: {'Content-Type': 'application/json', 'Accept': 'application/json'},
'Content-Type': 'application/json',
'Accept': 'application/json'
},
); );
final int statusCode = response.statusCode; final int statusCode = response.statusCode;
@ -587,10 +529,7 @@ class BaseAppClient {
final response = await http.put( final response = await http.put(
url.trim(), url.trim(),
body: json.encode(body), body: json.encode(body),
headers: { headers: {'Content-Type': 'application/json', 'Accept': 'application/json'},
'Content-Type': 'application/json',
'Accept': 'application/json'
},
); );
final int statusCode = response.statusCode; final int statusCode = response.statusCode;
@ -623,10 +562,7 @@ class BaseAppClient {
if (await Utils.checkConnection()) { if (await Utils.checkConnection()) {
final response = await http.delete( final response = await http.delete(
url.trim(), url.trim(),
headers: { headers: {'Content-Type': 'application/json', 'Accept': 'application/json'},
'Content-Type': 'application/json',
'Accept': 'application/json'
},
); );
final int statusCode = response.statusCode; final int statusCode = response.statusCode;
@ -646,10 +582,8 @@ class BaseAppClient {
await sharedPref.remove(LOGIN_TOKEN_ID); await sharedPref.remove(LOGIN_TOKEN_ID);
await sharedPref.remove(PHARMACY_CUSTOMER_ID); await sharedPref.remove(PHARMACY_CUSTOMER_ID);
await authenticatedUserObject.getUser(); await authenticatedUserObject.getUser();
Provider.of<ProjectViewModel>(AppGlobal.context, listen: false).isLogin = Provider.of<ProjectViewModel>(AppGlobal.context, listen: false).isLogin = false;
false; var model = Provider.of<ToDoCountProviderModel>(AppGlobal.context, listen: false);
var model =
Provider.of<ToDoCountProviderModel>(AppGlobal.context, listen: false);
_vitalSignService.weightKg = ""; _vitalSignService.weightKg = "";
_vitalSignService.heightCm = ""; _vitalSignService.heightCm = "";
model.setState(0, false); model.setState(0, false);
@ -663,8 +597,7 @@ class BaseAppClient {
static defaultHttpParameters() async { static defaultHttpParameters() async {
String token = await sharedPref.getString(TOKEN); String token = await sharedPref.getString(TOKEN);
var languageID = var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
var user = await sharedPref.getObject(USER_PROFILE); var user = await sharedPref.getObject(USER_PROFILE);
var params = {}; var params = {};
if (user != null) { if (user != null) {
@ -700,8 +633,7 @@ class BaseAppClient {
try { try {
if (isExternal) { if (isExternal) {
String token = await sharedPref.getString(TOKEN); String token = await sharedPref.getString(TOKEN);
var languageID = var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
var user = await sharedPref.getObject(USER_PROFILE); var user = await sharedPref.getObject(USER_PROFILE);
if (body.containsKey('SetupID')) { if (body.containsKey('SetupID')) {
body['SetupID'] = body.containsKey('SetupID') body['SetupID'] = body.containsKey('SetupID')
@ -724,12 +656,11 @@ class BaseAppClient {
: PATIENT_OUT_SA; : PATIENT_OUT_SA;
if (body.containsKey('isDentalAllowedBackend')) { if (body.containsKey('isDentalAllowedBackend')) {
body['isDentalAllowedBackend'] = body['isDentalAllowedBackend'] = body.containsKey('isDentalAllowedBackend')
body.containsKey('isDentalAllowedBackend') ? body['isDentalAllowedBackend'] != null
? body['isDentalAllowedBackend'] != null ? body['isDentalAllowedBackend']
? body['isDentalAllowedBackend'] : IS_DENTAL_ALLOWED_BACKEND
: IS_DENTAL_ALLOWED_BACKEND : IS_DENTAL_ALLOWED_BACKEND;
: IS_DENTAL_ALLOWED_BACKEND;
} }
body['DeviceTypeID'] = Platform.isAndroid ? 1 : 2; body['DeviceTypeID'] = Platform.isAndroid ? 1 : 2;
@ -752,9 +683,7 @@ class BaseAppClient {
: PATIENT_TYPE_ID; : PATIENT_TYPE_ID;
if (user != null) { if (user != null) {
body['TokenID'] = token; body['TokenID'] = token;
body['PatientID'] = body['PatientID'] != null body['PatientID'] = body['PatientID'] != null ? body['PatientID'] : user['PatientID'];
? body['PatientID']
: user['PatientID'];
body['PatientOutSA'] = user['OutSA']; body['PatientOutSA'] = user['OutSA'];
body['SessionID'] = SESSION_ID; //getSessionId(token); body['SessionID'] = SESSION_ID; //getSessionId(token);
} }
@ -766,17 +695,14 @@ class BaseAppClient {
var ss = json.encode(body); var ss = json.encode(body);
if (await Utils.checkConnection()) { if (await Utils.checkConnection()) {
final response = final response = await http.post(url.trim(), body: json.encode(body), headers: {
await http.post(url.trim(), body: json.encode(body), headers: {
// 'Content-Type': 'application/json', // 'Content-Type': 'application/json',
// 'Accept': 'application/json', // 'Accept': 'application/json',
// 'Statictoken': 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9', // 'Statictoken': 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9',
'Content-Type': 'application/json', 'Content-Type': 'application/json',
'Accept': 'application/json', 'Accept': 'application/json',
'Authorization': token ?? '', 'Authorization': token ?? '',
'Mobilenumber': user != null 'Mobilenumber': user != null ? Utils.getPhoneNumberWithoutZero(user['MobileNumber'].toString()) : "",
? Utils.getPhoneNumberWithoutZero(user['MobileNumber'].toString())
: "",
'Statictoken': 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9', 'Statictoken': 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9',
'Username': user != null ? user['PatientID'].toString() : "", 'Username': user != null ? user['PatientID'].toString() : "",
}); });
@ -791,8 +717,7 @@ class BaseAppClient {
onSuccess(parsed, statusCode); onSuccess(parsed, statusCode);
} else { } else {
if (parsed['ErrorType'] == 4) { if (parsed['ErrorType'] == 4) {
navigateToAppUpdate( navigateToAppUpdate(AppGlobal.context, parsed['ErrorEndUserMessage']);
AppGlobal.context, parsed['ErrorEndUserMessage']);
} }
if (isAllowAny) { if (isAllowAny) {
onSuccess(parsed, statusCode); onSuccess(parsed, statusCode);
@ -807,31 +732,21 @@ class BaseAppClient {
if (parsed != null) { if (parsed != null) {
onSuccess(parsed, statusCode); onSuccess(parsed, statusCode);
} else { } else {
onFailure( onFailure(parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], statusCode);
parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'],
statusCode);
logout(); logout();
} }
} }
} else if (parsed['MessageStatus'] == 1 || } else if (parsed['MessageStatus'] == 1 || parsed['SMSLoginRequired'] == true) {
parsed['SMSLoginRequired'] == true) {
onSuccess(parsed, statusCode); onSuccess(parsed, statusCode);
} else if (parsed['MessageStatus'] == 2 && } else if (parsed['MessageStatus'] == 2 && parsed['IsAuthenticated']) {
parsed['IsAuthenticated']) { if (parsed['message'] == null && parsed['ErrorEndUserMessage'] == null) {
if (parsed['message'] == null &&
parsed['ErrorEndUserMessage'] == null) {
if (parsed['ErrorSearchMsg'] == null) { if (parsed['ErrorSearchMsg'] == null) {
onFailure("Server Error found with no available message", onFailure("Server Error found with no available message", statusCode);
statusCode);
} else { } else {
onFailure(parsed['ErrorSearchMsg'], statusCode); onFailure(parsed['ErrorSearchMsg'], statusCode);
} }
} else { } else {
onFailure( onFailure(parsed['message'] ?? parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], statusCode);
parsed['message'] ??
parsed['ErrorEndUserMessage'] ??
parsed['ErrorMessage'],
statusCode);
} }
} else if (!parsed['IsAuthenticated']) { } else if (!parsed['IsAuthenticated']) {
await logout(); await logout();
@ -844,9 +759,7 @@ class BaseAppClient {
if (parsed['message'] != null) { if (parsed['message'] != null) {
onFailure(parsed['message'] ?? parsed['message'], statusCode); onFailure(parsed['message'] ?? parsed['message'], statusCode);
} else { } else {
onFailure( onFailure(parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], statusCode);
parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'],
statusCode);
} }
} }
} }

@ -6,6 +6,7 @@ import 'package:diplomaticquarterapp/core/model/feedback/request_insert_coc_item
import 'package:diplomaticquarterapp/core/service/base_service.dart'; import 'package:diplomaticquarterapp/core/service/base_service.dart';
import 'package:diplomaticquarterapp/pages/feedback/appointment_history.dart'; import 'package:diplomaticquarterapp/pages/feedback/appointment_history.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart';
class FeedbackService extends BaseService { class FeedbackService extends BaseService {
List<COCItem> cOCItemList = List(); List<COCItem> cOCItemList = List();
@ -26,7 +27,7 @@ class FeedbackService extends BaseService {
_requestInsertCOCItem.details = details; _requestInsertCOCItem.details = details;
_requestInsertCOCItem.cOCTypeName = cOCTypeName; _requestInsertCOCItem.cOCTypeName = cOCTypeName;
_requestInsertCOCItem.formTypeID = cOCTypeName; _requestInsertCOCItem.formTypeID = cOCTypeName;
_requestInsertCOCItem.mobileNo = user.mobileNumber; _requestInsertCOCItem.mobileNo = "966" + Utils.getPhoneNumberWithoutZero(user.mobileNumber);
_requestInsertCOCItem.isUserLoggedIn = true; _requestInsertCOCItem.isUserLoggedIn = true;
_requestInsertCOCItem.projectID = user.projectID; _requestInsertCOCItem.projectID = user.projectID;
_requestInsertCOCItem.patientName = user.firstName + " " + user.lastName; _requestInsertCOCItem.patientName = user.firstName + " " + user.lastName;
@ -64,7 +65,7 @@ class FeedbackService extends BaseService {
hasError = false; hasError = false;
Map<String, dynamic> body = new Map<String, dynamic>(); Map<String, dynamic> body = new Map<String, dynamic>();
body['IdentificationNo'] = user.patientIdentificationNo; body['IdentificationNo'] = user.patientIdentificationNo;
body['MobileNo'] = user.mobileNumber; body['MobileNo'] = "966" + Utils.getPhoneNumberWithoutZero(user.mobileNumber);
body['Searching_type'] = '1'; body['Searching_type'] = '1';
await baseAppClient.post(GET_STATUS_FOR_COCO, await baseAppClient.post(GET_STATUS_FOR_COCO,

@ -11,11 +11,10 @@ class RadiologyService extends BaseService {
hasError = false; hasError = false;
final Map<String, dynamic> body = new Map<String, dynamic>(); final Map<String, dynamic> body = new Map<String, dynamic>();
body['InvoiceNo'] = invoiceNo; body['InvoiceNo'] = invoiceNo;
body['LineIt emNo'] = lineItem; body['LineItemNo'] = lineItem;
body['ProjectID'] = projectId; body['ProjectID'] = projectId;
await baseAppClient.post(GET_RAD_IMAGE_URL, await baseAppClient.post(GET_RAD_IMAGE_URL, isAllowAny: true,
isAllowAny: true,
onSuccess: (dynamic response, int statusCode) { onSuccess: (dynamic response, int statusCode) {
url = response['Data']; url = response['Data'];
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
@ -61,11 +60,15 @@ class RadiologyService extends BaseService {
_requestSendRadReportEmail.invoiceNo = finalRadiology.invoiceNo; _requestSendRadReportEmail.invoiceNo = finalRadiology.invoiceNo;
_requestSendRadReportEmail.setupID = finalRadiology.setupID; _requestSendRadReportEmail.setupID = finalRadiology.setupID;
_requestSendRadReportEmail.doctorName = finalRadiology.doctorName; _requestSendRadReportEmail.doctorName = finalRadiology.doctorName;
_requestSendRadReportEmail.orderDate = '${finalRadiology.orderDate.year}-${finalRadiology.orderDate.month}-${finalRadiology.orderDate.day}'; _requestSendRadReportEmail.orderDate =
_requestSendRadReportEmail.patientIditificationNum = user.patientIdentificationNo; '${finalRadiology.orderDate.year}-${finalRadiology.orderDate.month}-${finalRadiology.orderDate.day}';
_requestSendRadReportEmail.patientIditificationNum =
user.patientIdentificationNo;
_requestSendRadReportEmail.patientMobileNumber = user.mobileNumber; _requestSendRadReportEmail.patientMobileNumber = user.mobileNumber;
_requestSendRadReportEmail.patientName = user.firstName + " " + user.lastName; _requestSendRadReportEmail.patientName =
_requestSendRadReportEmail.patientIditificationNum = user.patientIdentificationNo; user.firstName + " " + user.lastName;
_requestSendRadReportEmail.patientIditificationNum =
user.patientIdentificationNo;
_requestSendRadReportEmail.projectName = finalRadiology.projectName; _requestSendRadReportEmail.projectName = finalRadiology.projectName;
_requestSendRadReportEmail.radResult = finalRadiology.reportData; _requestSendRadReportEmail.radResult = finalRadiology.reportData;
_requestSendRadReportEmail.to = user.emailAddress; _requestSendRadReportEmail.to = user.emailAddress;

@ -2,8 +2,7 @@ import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/service/medical/vital_sign_service.dart'; import 'package:diplomaticquarterapp/core/service/medical/vital_sign_service.dart';
import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart';
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import '../../locator.dart'; import '../../locator.dart';
class DashboardViewModel extends BaseViewModel { class DashboardViewModel extends BaseViewModel {
@ -13,7 +12,9 @@ class DashboardViewModel extends BaseViewModel {
String get heightCm => _vitalSignService.heightCm; String get heightCm => _vitalSignService.heightCm;
String booldType = "-"; String booldType = "-";
DashboardViewModel() {
this.getPatientRadOrders();
}
// ToDoCountProviderModel toDoProvider = // ToDoCountProviderModel toDoProvider =
// Provider.of<ToDoCountProviderModel>(AppGlobal.context); // Provider.of<ToDoCountProviderModel>(AppGlobal.context);

@ -83,6 +83,7 @@ class Patientobject {
String dateofBirth; String dateofBirth;
int gender; int gender;
String nationalityID; String nationalityID;
String eHealthIDField;
String dateofBirthN; String dateofBirthN;
String emailAddress; String emailAddress;
String sourceType; String sourceType;
@ -96,15 +97,16 @@ class Patientobject {
this.mobileNumber, this.mobileNumber,
this.patientOutSA, this.patientOutSA,
this.firstName, this.firstName,
this.middleName, this.middleName,
this.lastName, this.lastName,
this.firstNameN, this.firstNameN,
this.middleNameN, this.middleNameN,
this.lastNameN, this.lastNameN,
this.strDateofBirth, this.strDateofBirth,
this.dateofBirth, this.dateofBirth,
this.gender, this.gender,
this.nationalityID, this.nationalityID,
this.eHealthIDField,
this.dateofBirthN, this.dateofBirthN,
this.emailAddress, this.emailAddress,
this.sourceType, this.sourceType,
@ -127,6 +129,7 @@ class Patientobject {
dateofBirth = json['DateofBirth']; dateofBirth = json['DateofBirth'];
gender = json['Gender']; gender = json['Gender'];
nationalityID = json['NationalityID']; nationalityID = json['NationalityID'];
eHealthIDField = json['eHealthIDField'];
dateofBirthN = json['DateofBirthN']; dateofBirthN = json['DateofBirthN'];
emailAddress = json['EmailAddress']; emailAddress = json['EmailAddress'];
sourceType = json['SourceType']; sourceType = json['SourceType'];
@ -152,10 +155,10 @@ class Patientobject {
data['DateofBirth'] = this.dateofBirth; data['DateofBirth'] = this.dateofBirth;
data['Gender'] = this.gender; data['Gender'] = this.gender;
data['NationalityID'] = this.nationalityID; data['NationalityID'] = this.nationalityID;
data['eHealthIDField'] = this.eHealthIDField;
data['DateofBirthN'] = this.dateofBirthN; data['DateofBirthN'] = this.dateofBirthN;
data['EmailAddress'] = this.emailAddress; data['EmailAddress'] = this.emailAddress;
data['SourceType'] = this.sourceType; data['SourceType'] = this.sourceType;
data['PreferredLanguage'] = this.preferredLanguage; data['PreferredLanguage'] = this.preferredLanguage;
data['Marital'] = this.marital; data['Marital'] = this.marital;
return data; return data;

@ -0,0 +1,32 @@
class CovidTestProceduresResponse {
String procedureID;
String procedureName;
String procedureNameN;
int projectID;
String setupID;
CovidTestProceduresResponse(
{this.procedureID,
this.procedureName,
this.procedureNameN,
this.projectID,
this.setupID});
CovidTestProceduresResponse.fromJson(Map<String, dynamic> json) {
procedureID = json['ProcedureID'];
procedureName = json['ProcedureName'];
procedureNameN = json['ProcedureNameN'];
projectID = json['ProjectID'];
setupID = json['SetupID'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['ProcedureID'] = this.procedureID;
data['ProcedureName'] = this.procedureName;
data['ProcedureNameN'] = this.procedureNameN;
data['ProjectID'] = this.projectID;
data['SetupID'] = this.setupID;
return data;
}
}

@ -35,10 +35,10 @@ class PatientERGetClinicsList {
String createdOn; String createdOn;
String createdBy; String createdBy;
int isOnline; int isOnline;
Null endTime; dynamic endTime;
bool projectOutSA; bool projectOutSA;
List<ShiftTimings> shiftTimings; List<ShiftTimings> shiftTimings;
Null startTime; dynamic startTime;
PatientERGetClinicsList( PatientERGetClinicsList(
{this.iD, {this.iD,

@ -2,13 +2,10 @@ import 'dart:ui';
import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart'; import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart';
import 'package:diplomaticquarterapp/core/viewModels/all_habib_medical_services/e_referral_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/all_habib_medical_services/e_referral_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/medical/prescriptions_view_model.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_index_page.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_index_page.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_step_one_page.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_step_one_page.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/E-Referral/search_for_referrals_page.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/E-Referral/search_for_referrals_page.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/pages/medical/prescriptions/prescriptions_history_page.dart';
import 'package:diplomaticquarterapp/pages/medical/prescriptions/prescriptions_page.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
@ -39,27 +36,28 @@ class _EReferralPageState extends State<EReferralPage>
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return BaseView<EReferralViewModel>( return BaseView<EReferralViewModel>(
builder: (_, model, widget) => builder: (_, model, widget) => AppScaffold(
AppScaffold( isShowAppBar: true,
isShowAppBar: true, appBarTitle: TranslationBase.of(context).ereferral,
appBarTitle: "E-Referral", description: TranslationBase.of(context).eReferralInfo,
description: "This service allows you to submit a Referral request from any health care providers either inside or outside the kingdom of Saudi Arabia to any of HMG Hospitals, By filling some of the patient's data and attaching the medical reports, moreover you can track the request status (Under process, Accepted or Rejected)", imagesInfo: [
imagesInfo: [ ImagesInfo(
ImagesInfo( imageAr:
imageAr: 'assets/images/Wifi-AR.png', 'https://hmgwebservices.com/Images/MobileApp/images-info-home/referal/ar/1.png',
imageEn: 'assets/images/wifi-EN.png', imageEn:
isAsset: true) 'https://hmgwebservices.com/Images/MobileApp/images-info-home/referal/en/1.png',
], )
body: Scaffold( ],
extendBodyBehindAppBar: true, body: Scaffold(
appBar: PreferredSize( extendBodyBehindAppBar: true,
preferredSize: Size.fromHeight(65.0), appBar: PreferredSize(
child: Stack( preferredSize: Size.fromHeight(65.0),
children: <Widget>[ child: Stack(
Positioned( children: <Widget>[
bottom: 1, Positioned(
left: 0, bottom: 1,
right: 0, left: 0,
right: 0,
child: BackdropFilter( child: BackdropFilter(
filter: ImageFilter.blur(sigmaX: 10, sigmaY: 10), filter: ImageFilter.blur(sigmaX: 10, sigmaY: 10),
child: Container( child: Container(
@ -97,13 +95,19 @@ class _EReferralPageState extends State<EReferralPage>
Container( Container(
width: MediaQuery.of(context).size.width * 0.37, width: MediaQuery.of(context).size.width * 0.37,
child: Center( child: Center(
child: Texts(TranslationBase.of(context).newReferral, textAlign: TextAlign.center,), child: Texts(
TranslationBase.of(context).newReferral,
textAlign: TextAlign.center,
),
), ),
), ),
Container( Container(
width: MediaQuery.of(context).size.width * 0.37, width: MediaQuery.of(context).size.width * 0.37,
child: Center( child: Center(
child: Texts(TranslationBase.of(context).searchForReferrals , textAlign: TextAlign.center,), child: Texts(
TranslationBase.of(context).searchForReferrals,
textAlign: TextAlign.center,
),
), ),
), ),
], ],
@ -121,10 +125,8 @@ class _EReferralPageState extends State<EReferralPage>
physics: BouncingScrollPhysics(), physics: BouncingScrollPhysics(),
controller: _tabController, controller: _tabController,
children: <Widget>[ children: <Widget>[
StartIndexForNewEReferral( StartIndexForNewEReferral(),
), SearchForReferralsPage()
SearchForReferralsPage(
)
], ],
), ),
) )

@ -1,6 +1,8 @@
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/service/weather_service.dart'; import 'package:diplomaticquarterapp/core/service/weather_service.dart';
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/pharmacy_module_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/locator.dart';
import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.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/%E2%80%8B%20health_calculators.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/E-Referral/e_referral_page.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/E-Referral/e_referral_page.dart';
@ -15,13 +17,16 @@ import 'package:diplomaticquarterapp/pages/ChildVaccines/child_vaccines_page.dar
import 'package:diplomaticquarterapp/pages/ContactUs/findus/findus_page.dart'; import 'package:diplomaticquarterapp/pages/ContactUs/findus/findus_page.dart';
import 'package:diplomaticquarterapp/pages/DrawerPages/family/my-family.dart'; import 'package:diplomaticquarterapp/pages/DrawerPages/family/my-family.dart';
import 'package:diplomaticquarterapp/pages/ErService/ErOptions.dart'; import 'package:diplomaticquarterapp/pages/ErService/ErOptions.dart';
import 'package:diplomaticquarterapp/pages/ToDoList/ToDo.dart';
import 'package:diplomaticquarterapp/pages/insurance/insurance_update_screen.dart'; import 'package:diplomaticquarterapp/pages/insurance/insurance_update_screen.dart';
import 'package:diplomaticquarterapp/pages/landing/landing_page.dart'; import 'package:diplomaticquarterapp/pages/landing/landing_page.dart';
import 'package:diplomaticquarterapp/pages/landing/landing_page_pharmcy.dart';
import 'package:diplomaticquarterapp/pages/livecare/livecare_home.dart'; import 'package:diplomaticquarterapp/pages/livecare/livecare_home.dart';
import 'package:diplomaticquarterapp/pages/medical/medical_profile_page.dart';
import 'package:diplomaticquarterapp/pages/paymentService/payment_service.dart'; import 'package:diplomaticquarterapp/pages/paymentService/payment_service.dart';
import 'package:diplomaticquarterapp/pages/symptom-checker/info.dart'; import 'package:diplomaticquarterapp/pages/symptom-checker/info.dart';
import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/location_util.dart'; import 'package:diplomaticquarterapp/uitl/location_util.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/data_display/services)contaniner.dart'; import 'package:diplomaticquarterapp/widgets/data_display/services)contaniner.dart';
@ -50,9 +55,13 @@ class AllHabibMedicalService extends StatefulWidget {
class _AllHabibMedicalServiceState extends State<AllHabibMedicalService> { class _AllHabibMedicalServiceState extends State<AllHabibMedicalService> {
AppSharedPreferences sharedPref = AppSharedPreferences(); AppSharedPreferences sharedPref = AppSharedPreferences();
AuthenticatedUser authUser = new AuthenticatedUser(); AuthenticatedUser authUser = new AuthenticatedUser();
AuthProvider authProvider = new AuthProvider();
PharmacyModuleViewModel pharmacyModuleViewModel =
locator<PharmacyModuleViewModel>();
LocationUtils locationUtils; LocationUtils locationUtils;
var weather = '--'; var weather = '--';
WeatherService _weatherService = WeatherService(); WeatherService _weatherService = WeatherService();
@override @override
void initState() { void initState() {
WidgetsBinding.instance.addPostFrameCallback((timeStamp) { WidgetsBinding.instance.addPostFrameCallback((timeStamp) {
@ -157,7 +166,12 @@ class _AllHabibMedicalServiceState extends State<AllHabibMedicalService> {
ServicesContainer( ServicesContainer(
onTap: () { onTap: () {
Navigator.pop(context); Navigator.pop(context);
widget.goToMyProfile(); Navigator.push(
context,
FadePage(
page: MedicalProfilePage(),
),
);
}, },
imageLocation: imageLocation:
'assets/images/new-design/my_file_bottom_bar.png', 'assets/images/new-design/my_file_bottom_bar.png',
@ -232,12 +246,13 @@ class _AllHabibMedicalServiceState extends State<AllHabibMedicalService> {
title: TranslationBase.of(context).emergencyService, title: TranslationBase.of(context).emergencyService,
), ),
ServicesContainer( ServicesContainer(
onTap: () => Navigator.push( onTap: () => getPharmacyToken(),
context, // Navigator.push(
FadePage( // context,
page: ParkingPage(), // FadePage(
), // page: ParkingPage(),
), // ),
// ),
imageLocation: 'assets/images/pharmacy_logo.png', imageLocation: 'assets/images/pharmacy_logo.png',
title: TranslationBase.of(context).pharmacy), title: TranslationBase.of(context).pharmacy),
ServicesContainer( ServicesContainer(
@ -254,8 +269,7 @@ class _AllHabibMedicalServiceState extends State<AllHabibMedicalService> {
ServicesContainer( ServicesContainer(
onTap: () => Navigator.push( onTap: () => Navigator.push(
context, context,
FadePage( FadePage(page: EReferralPage()),
page: EReferralPage()),
), ),
imageLocation: 'assets/images/ereferral_service_icon.png', imageLocation: 'assets/images/ereferral_service_icon.png',
title: TranslationBase.of(context).ereferral, title: TranslationBase.of(context).ereferral,
@ -282,7 +296,7 @@ class _AllHabibMedicalServiceState extends State<AllHabibMedicalService> {
title: TranslationBase.of(context).childVaccine, title: TranslationBase.of(context).childVaccine,
), ),
ServicesContainer( ServicesContainer(
onTap: (){ onTap: () {
Navigator.pop(context); Navigator.pop(context);
LandingPage.shared.switchToDoFromHMGServices(); LandingPage.shared.switchToDoFromHMGServices();
}, },
@ -401,6 +415,25 @@ class _AllHabibMedicalServiceState extends State<AllHabibMedicalService> {
); );
} }
getPharmacyToken() async {
if (!authProvider.isLogin) {
Navigator.push(context, FadePage(page: LandingPagePharmacy()));
} else {
GifLoaderDialogUtils.showMyDialog(context);
await pharmacyModuleViewModel.generatePharmacyToken().then((value) async {
if (pharmacyModuleViewModel.error.isNotEmpty) {
await pharmacyModuleViewModel.createUser().then((value) {
GifLoaderDialogUtils.hideDialog(context);
Navigator.push(context, FadePage(page: LandingPagePharmacy()));
});
} else {
GifLoaderDialogUtils.hideDialog(context);
Navigator.push(context, FadePage(page: LandingPagePharmacy()));
}
});
}
}
getAuthUser() async { getAuthUser() async {
if (await this.sharedPref.getObject(USER_PROFILE) != null) { if (await this.sharedPref.getObject(USER_PROFILE) != null) {
var data = AuthenticatedUser.fromJson( var data = AuthenticatedUser.fromJson(

@ -45,6 +45,10 @@ class _BodyFatState extends State<BodyFat> {
String dropdownValue; String dropdownValue;
double calories = 0; double calories = 0;
String textResult = ''; String textResult = '';
TextEditingController heightController = TextEditingController();
TextEditingController neckController = TextEditingController();
TextEditingController waistController = TextEditingController();
TextEditingController hipController = TextEditingController();
void updateColorHeight(int type) { void updateColorHeight(int type) {
//MG/DLT card //MG/DLT card
@ -310,7 +314,18 @@ class _BodyFatState extends State<BodyFat> {
children: <Widget>[ children: <Widget>[
Expanded( Expanded(
child: Center( child: Center(
child: Text(heightCm.toString()), child: Padding(
padding: const EdgeInsets.only(left: 10.0),
child: TextFormField(
keyboardType: TextInputType.number,
controller: heightController,
decoration: InputDecoration(
labelText: heightCm.toString(),
labelStyle: TextStyle(
color: Colors.black,
)),
),
),
), ),
), ),
Container( Container(
@ -476,7 +491,18 @@ class _BodyFatState extends State<BodyFat> {
children: <Widget>[ children: <Widget>[
Expanded( Expanded(
child: Center( child: Center(
child: Text(neck.toString()), child: Padding(
padding: const EdgeInsets.only(left: 10.0),
child: TextFormField(
keyboardType: TextInputType.number,
controller: neckController,
decoration: InputDecoration(
labelText: neck.toString(),
labelStyle: TextStyle(
color: Colors.black,
)),
),
),
), ),
), ),
Container( Container(
@ -642,7 +668,18 @@ class _BodyFatState extends State<BodyFat> {
children: <Widget>[ children: <Widget>[
Expanded( Expanded(
child: Center( child: Center(
child: Text(waist.toString()), child: Padding(
padding: const EdgeInsets.only(left: 10.0),
child: TextFormField(
keyboardType: TextInputType.number,
controller: waistController,
decoration: InputDecoration(
labelText: waist.toString(),
labelStyle: TextStyle(
color: Colors.black,
)),
),
),
), ),
), ),
Container( Container(
@ -808,7 +845,18 @@ class _BodyFatState extends State<BodyFat> {
children: <Widget>[ children: <Widget>[
Expanded( Expanded(
child: Center( child: Center(
child: Text(hip.toString()), child: Padding(
padding: const EdgeInsets.only(left: 10.0),
child: TextFormField(
keyboardType: TextInputType.number,
controller: hipController,
decoration: InputDecoration(
labelText: hip.toString(),
labelStyle: TextStyle(
color: Colors.black,
)),
),
),
), ),
), ),
Container( Container(

@ -42,6 +42,7 @@ class _BloodSugarState extends State<BloodSugar> {
} }
void calculateBloodSugar() { void calculateBloodSugar() {
if (textController.text.isEmpty) return;
if (cardMGColor == activeCardColor) { if (cardMGColor == activeCardColor) {
inputValue = double.parse(textController.text); inputValue = double.parse(textController.text);
inputValue = inputValue / 15; inputValue = inputValue / 15;
@ -60,10 +61,18 @@ class _BloodSugarState extends State<BloodSugar> {
double inputValue = 0; double inputValue = 0;
String unit; String unit;
@override
void initState() {
updateColor(1);
unit = 'mmol/l';
super.initState();
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return AppScaffold( return AppScaffold(
isShowAppBar: true, isShowAppBar: true,
isShowDecPage: false,
appBarTitle: TranslationBase.of(context).bloodSugarConversion, appBarTitle: TranslationBase.of(context).bloodSugarConversion,
body: Padding( body: Padding(
padding: const EdgeInsets.all(16.0), padding: const EdgeInsets.all(16.0),
@ -112,8 +121,11 @@ class _BloodSugarState extends State<BloodSugar> {
onTap: () { onTap: () {
setState(() { setState(() {
updateColor(1); updateColor(1);
inputValue = double.parse(textController.text); if (textController.text.isNotEmpty) {
inputValue = inputValue / 15; inputValue =
double.parse(textController.text);
inputValue = inputValue / 15;
}
unit = 'mmol/l'; unit = 'mmol/l';
}); });
}, },
@ -126,14 +138,16 @@ class _BloodSugarState extends State<BloodSugar> {
color: Colors.grey.withOpacity(0.5), color: Colors.grey.withOpacity(0.5),
spreadRadius: 3, spreadRadius: 3,
blurRadius: 7, blurRadius: 7,
offset: Offset(0, 3), // changes position of shadow offset: Offset(
0, 3), // changes position of shadow
), ),
], ],
color: cardMGColor, color: cardMGColor,
borderRadius: BorderRadius.circular(3.0), borderRadius: BorderRadius.circular(3.0),
), ),
child: Padding( child: Padding(
padding: const EdgeInsets.symmetric(vertical: 0.0, horizontal: 18.0), padding: const EdgeInsets.symmetric(
vertical: 0.0, horizontal: 18.0),
child: Texts('MG/DLt TO \nMMOL/L'), child: Texts('MG/DLt TO \nMMOL/L'),
), ),
), ),
@ -142,8 +156,11 @@ class _BloodSugarState extends State<BloodSugar> {
onTap: () { onTap: () {
setState(() { setState(() {
updateColor(2); updateColor(2);
inputValue = double.parse(textController.text); if (textController.text.isNotEmpty) {
inputValue = inputValue * 18; inputValue =
double.parse(textController.text);
inputValue = inputValue / 18;
}
unit = 'mg/dlt'; unit = 'mg/dlt';
}); });
}, },
@ -158,12 +175,14 @@ class _BloodSugarState extends State<BloodSugar> {
color: Colors.grey.withOpacity(0.5), color: Colors.grey.withOpacity(0.5),
spreadRadius: 3, spreadRadius: 3,
blurRadius: 7, blurRadius: 7,
offset: Offset(0, 3), // changes position of shadow offset: Offset(
0, 3), // changes position of shadow
), ),
], ],
), ),
child: Padding( child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 16.0), padding: const EdgeInsets.symmetric(
horizontal: 16.0),
child: Texts('\nMMOL/L TO MG/DLt '), child: Texts('\nMMOL/L TO MG/DLt '),
), ),
), ),
@ -191,7 +210,8 @@ class _BloodSugarState extends State<BloodSugar> {
keyboardType: TextInputType.number, keyboardType: TextInputType.number,
decoration: InputDecoration( decoration: InputDecoration(
labelText: TranslationBase.of(context).enterReadingValue, labelText: TranslationBase.of(context).enterReadingValue,
border: OutlineInputBorder(borderSide: BorderSide(color: Colors.black45)), border: OutlineInputBorder(
borderSide: BorderSide(color: Colors.black45)),
labelStyle: TextStyle( labelStyle: TextStyle(
color: Colors.black87, color: Colors.black87,
), ),
@ -253,7 +273,9 @@ class _BloodSugarState extends State<BloodSugar> {
label: TranslationBase.of(context).calculate, label: TranslationBase.of(context).calculate,
onTap: () { onTap: () {
setState(() { setState(() {
_visible == false ? _visible = !_visible : _visible = _visible; _visible == false
? _visible = !_visible
: _visible = _visible;
calculateBloodSugar(); calculateBloodSugar();
}); });
}, },

@ -121,6 +121,15 @@ class _DoctorProfileState extends State<DoctorProfile>
color: Colors.grey[900], color: Colors.grey[900],
letterSpacing: 1.0)), letterSpacing: 1.0)),
), ),
Container(
margin: EdgeInsets.only(top: 10.0),
alignment: Alignment.center,
child: Text(widget.doctor.projectName,
style: TextStyle(
fontSize: 15.0,
color: Colors.grey[900],
letterSpacing: 1.0)),
),
Container( Container(
margin: EdgeInsets.only(top: 10.0), margin: EdgeInsets.only(top: 10.0),
alignment: Alignment.center, alignment: Alignment.center,

@ -19,6 +19,7 @@ class _SearchByDoctorState extends State<SearchByDoctor> {
@override @override
void initState() { void initState() {
super.initState();
_isButtonDisabled = true; _isButtonDisabled = true;
} }
@ -93,6 +94,7 @@ class _SearchByDoctorState extends State<SearchByDoctor> {
service service
.getDoctorsListByName(doctorNameController.text, context) .getDoctorsListByName(doctorNameController.text, context)
.then((res) { .then((res) {
GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
setState(() { setState(() {
if (res['DoctorList'].length != 0) { if (res['DoctorList'].length != 0) {
@ -119,19 +121,26 @@ class _SearchByDoctorState extends State<SearchByDoctor> {
_patientDoctorAppointmentListHospital.add( _patientDoctorAppointmentListHospital.add(
PatientDoctorAppointmentList( PatientDoctorAppointmentList(
filterName: element.projectName, filterName: element.projectName,
distanceInKMs: element.projectDistanceInKiloMeters.toString(), distanceInKMs:
element.projectDistanceInKiloMeters.toString(),
patientDoctorAppointment: element)); patientDoctorAppointment: element));
} }
}); });
} else {} } else {
GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: res['ErrorSearchMsg']);
}
}); });
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
navigateToSearchResults( navigateToSearchResults(
context, doctorsList, _patientDoctorAppointmentListHospital); context, doctorsList, _patientDoctorAppointmentListHospital);
} else { } else {
GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: res['ErrorEndUserMessage']); AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
} }
}).catchError((err) { }).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: err);
print(err); print(err);
}); });
} }
@ -163,7 +172,7 @@ class _SearchByDoctorState extends State<SearchByDoctor> {
context, context,
FadePage( FadePage(
page: SearchResults( page: SearchResults(
isLiveCareAppointment: false, isLiveCareAppointment: false,
doctorsList: docList, doctorsList: docList,
patientDoctorAppointmentListHospital: patientDoctorAppointmentListHospital:
patientDoctorAppointmentListHospital))); patientDoctorAppointmentListHospital)));

@ -4,6 +4,7 @@ import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart
import 'package:diplomaticquarterapp/models/Appointments/FreeSlot.dart'; import 'package:diplomaticquarterapp/models/Appointments/FreeSlot.dart';
import 'package:diplomaticquarterapp/models/Appointments/PatientShareResposne.dart'; import 'package:diplomaticquarterapp/models/Appointments/PatientShareResposne.dart';
import 'package:diplomaticquarterapp/models/Appointments/timeSlot.dart'; import 'package:diplomaticquarterapp/models/Appointments/timeSlot.dart';
import 'package:diplomaticquarterapp/models/CovidDriveThru/CovidTestProceduresResponse.dart';
import 'package:diplomaticquarterapp/pages/Covid-DriveThru/covid-payment-alert.dart'; import 'package:diplomaticquarterapp/pages/Covid-DriveThru/covid-payment-alert.dart';
import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart'; import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart';
import 'package:diplomaticquarterapp/services/covid-drivethru/covid-drivethru.dart'; import 'package:diplomaticquarterapp/services/covid-drivethru/covid-drivethru.dart';
@ -27,6 +28,7 @@ class CovidTimeSlots extends StatefulWidget {
static DateTime selectedAppoDateTime; static DateTime selectedAppoDateTime;
static String selectedDate; static String selectedDate;
static String selectedTime; static String selectedTime;
CovidTestProceduresResponse selectedProcedure;
int selectedClinicID; int selectedClinicID;
int selectedDoctorID; int selectedDoctorID;
@ -35,7 +37,7 @@ class CovidTimeSlots extends StatefulWidget {
PatientShareResponse patientShareResponse; PatientShareResponse patientShareResponse;
CovidTimeSlots({@required this.projectID}); CovidTimeSlots({@required this.projectID, @required this.selectedProcedure});
@override @override
_CovidTimeSlotsState createState() => _CovidTimeSlotsState(); _CovidTimeSlotsState createState() => _CovidTimeSlotsState();
@ -94,10 +96,12 @@ class _CovidTimeSlotsState extends State<CovidTimeSlots>
super.dispose(); super.dispose();
} }
void _onDaySelected(DateTime day, List events, ProjectViewModel projectViewModel) { void _onDaySelected(
DateTime day, List events, ProjectViewModel projectViewModel) {
final DateFormat formatter = DateFormat('yyyy-MM-dd'); final DateFormat formatter = DateFormat('yyyy-MM-dd');
setState(() { setState(() {
this.selectedDate = DateUtil.getWeekDayMonthDayYearDateFormatted(day, projectViewModel.isArabic ? "ar" : "en"); this.selectedDate = DateUtil.getWeekDayMonthDayYearDateFormatted(
day, projectViewModel.isArabic ? "ar" : "en");
openTimeSlotsPickerForDate(day, docFreeSlots); openTimeSlotsPickerForDate(day, docFreeSlots);
CovidTimeSlots.selectedDate = formatter.format(day); CovidTimeSlots.selectedDate = formatter.format(day);
print(CovidTimeSlots.selectedDate); print(CovidTimeSlots.selectedDate);
@ -260,7 +264,8 @@ class _CovidTimeSlotsState extends State<CovidTimeSlots>
onPressed: () { onPressed: () {
bookCovidTestAppointment(); bookCovidTestAppointment();
}, },
child: Text(TranslationBase.of(context).bookNow, style: TextStyle(fontSize: 18.0)), child: Text(TranslationBase.of(context).bookNow,
style: TextStyle(fontSize: 18.0)),
), ),
), ),
), ),
@ -355,11 +360,7 @@ class _CovidTimeSlotsState extends State<CovidTimeSlots>
}, },
), ),
onDaySelected: (date, event, _) { onDaySelected: (date, event, _) {
_onDaySelected( _onDaySelected(date, event, projectViewModel);
date,
event,
projectViewModel
);
_animationController.forward(from: 0.0); _animationController.forward(from: 0.0);
}, },
onVisibleDaysChanged: _onVisibleDaysChanged, onVisibleDaysChanged: _onVisibleDaysChanged,
@ -494,7 +495,8 @@ class _CovidTimeSlotsState extends State<CovidTimeSlots>
docObject.projectID, docObject.projectID,
CovidTimeSlots.selectedTime, CovidTimeSlots.selectedTime,
CovidTimeSlots.selectedDate, CovidTimeSlots.selectedDate,
context) context,
widget.selectedProcedure.procedureID)
.then((res) { .then((res) {
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
AppToast.showSuccessToast(message: "Appointment Booked Successfully"); AppToast.showSuccessToast(message: "Appointment Booked Successfully");

@ -1,5 +1,7 @@
import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/models/CovidDriveThru/CovidPaymentInfoResponse.dart'; import 'package:diplomaticquarterapp/models/CovidDriveThru/CovidPaymentInfoResponse.dart';
import 'package:diplomaticquarterapp/models/CovidDriveThru/CovidTestProceduresResponse.dart';
import 'package:diplomaticquarterapp/models/CovidDriveThru/DriveThroughTestingCenterModel.dart'; import 'package:diplomaticquarterapp/models/CovidDriveThru/DriveThroughTestingCenterModel.dart';
import 'package:diplomaticquarterapp/pages/Covid-DriveThru/covid-payment-details.dart'; import 'package:diplomaticquarterapp/pages/Covid-DriveThru/covid-payment-details.dart';
import 'package:diplomaticquarterapp/routes.dart'; import 'package:diplomaticquarterapp/routes.dart';
@ -12,6 +14,7 @@ import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:maps_launcher/maps_launcher.dart'; import 'package:maps_launcher/maps_launcher.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart';
class CovidDrivethruLocation extends StatefulWidget { class CovidDrivethruLocation extends StatefulWidget {
@override @override
@ -21,11 +24,13 @@ class CovidDrivethruLocation extends StatefulWidget {
class _CovidDrivethruLocationState extends State<CovidDrivethruLocation> { class _CovidDrivethruLocationState extends State<CovidDrivethruLocation> {
String projectDropdownValue; String projectDropdownValue;
List<DriveThroughTestingCenterModel> projectsList = []; List<DriveThroughTestingCenterModel> projectsList = [];
List<CovidTestProceduresResponse> proceduresList = [];
bool isLocationSelected = false; bool isLocationSelected = false;
String projectLat = ""; String projectLat = "";
String projectLong = ""; String projectLong = "";
String projectName = ""; String projectName = "";
String projectID = ""; String projectID = "";
List<ImagesInfo> imagesInfo = List();
ProjectViewModel projectViewModel; ProjectViewModel projectViewModel;
@ -33,19 +38,39 @@ class _CovidDrivethruLocationState extends State<CovidDrivethruLocation> {
void initState() { void initState() {
WidgetsBinding.instance WidgetsBinding.instance
.addPostFrameCallback((_) => getProjectsList(context)); .addPostFrameCallback((_) => getProjectsList(context));
imagesInfo.add(
ImagesInfo(
imageEn: 'https://hmgwebservices.com/Images/MobileApp/covid/en/0.png',
imageAr:
'https://hmgwebservices.com/Images/MobileApp/covid/ar/0.png'),
);
WidgetsBinding.instance.addPostFrameCallback((_) {
if (projectViewModel.isLogin) {
getProjectsList(context);
getTestProcedures(context);
}
});
super.initState(); super.initState();
} }
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
projectViewModel = Provider.of(context); projectViewModel = Provider.of(context);
imagesInfo.add(ImagesInfo(
imageEn: 'https://hmgwebservices.com/Images/MobileApp/covid/en/0.png',
imageAr: 'https://hmgwebservices.com/Images/MobileApp/covid/ar/0.png'));
return AppScaffold( return AppScaffold(
appBarTitle: TranslationBase.of(context).covidTest, appBarTitle: TranslationBase.of(context).covidTest,
isShowAppBar: true, isShowAppBar: true,
imagesInfo: imagesInfo,
description: TranslationBase.of(context).covidInfo,
isShowDecPage: true,
body: SingleChildScrollView( body: SingleChildScrollView(
child: Container( child: Container(
margin: EdgeInsets.fromLTRB(15.0, 15.0, 15.0, 0.0), margin: EdgeInsets.fromLTRB(15.0, 15.0, 15.0, 0.0),
child: Column( child: Column(
mainAxisSize: MainAxisSize.max,
children: <Widget>[ children: <Widget>[
Container( Container(
alignment: projectViewModel.isArabic alignment: projectViewModel.isArabic
@ -136,94 +161,98 @@ class _CovidDrivethruLocationState extends State<CovidDrivethruLocation> {
this.projectLong + this.projectLong +
"&key=AIzaSyCyDbWUM9d_sBUGIE8PcuShzPaqO08NSC8"), "&key=AIzaSyCyDbWUM9d_sBUGIE8PcuShzPaqO08NSC8"),
) )
: Container(), : SizedBox(
], height: MediaQuery.of(context).size.height * 0.35,
), ),
), Container(
), height: MediaQuery.of(context).size.height * 0.15,
bottomSheet: Container( width: double.infinity,
height: MediaQuery.of(context).size.height * 0.15, child: Column(
width: double.infinity, children: <Widget>[
child: Column( Container(
children: <Widget>[ margin: EdgeInsets.only(top: 10.0),
Container(
margin: EdgeInsets.only(top: 10.0),
child: ButtonTheme(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10.0),
),
minWidth: MediaQuery.of(context).size.width * 0.91,
height: 45.0,
child: RaisedButton(
color: new Color(0xFFc5272d),
textColor: Colors.white,
disabledTextColor: Colors.white,
disabledColor: Colors.red[300],
onPressed: () {
getDirections();
},
child: Text(TranslationBase.of(context).getDirections,
style: TextStyle(fontSize: 18.0)),
),
),
),
Container(
margin: EdgeInsets.fromLTRB(10.0, 5.0, 10.0, 5.0),
child: Flex(
direction: Axis.horizontal,
children: <Widget>[
Expanded(
flex: 1,
child: Container(
margin: EdgeInsets.fromLTRB(10.0, 0.0, 5.0, 0.0),
child: ButtonTheme( child: ButtonTheme(
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10.0), borderRadius: BorderRadius.circular(10.0),
), ),
minWidth: MediaQuery.of(context).size.width * 0.7, minWidth: MediaQuery.of(context).size.width * 0.91,
height: 45.0, height: 45.0,
child: RaisedButton( child: RaisedButton(
color: new Color(0xFF60686b), color: new Color(0xFFc5272d),
textColor: Colors.white, textColor: Colors.white,
disabledTextColor: Colors.white, disabledTextColor: Colors.white,
disabledColor: Colors.grey[500], disabledColor: Colors.red[300],
onPressed: () { onPressed: () {
back(); getDirections();
}, },
child: Text(TranslationBase.of(context).back, child: Text(TranslationBase.of(context).getDirections,
style: TextStyle(fontSize: 18.0)), style: TextStyle(fontSize: 18.0)),
), ),
), ),
), ),
), Container(
Expanded( margin: EdgeInsets.fromLTRB(10.0, 5.0, 10.0, 5.0),
flex: 1, child: Flex(
child: Container( direction: Axis.horizontal,
margin: EdgeInsets.fromLTRB(10.0, 0.0, 5.0, 0.0), children: <Widget>[
child: ButtonTheme( Expanded(
shape: RoundedRectangleBorder( flex: 1,
borderRadius: BorderRadius.circular(10.0), child: Container(
), margin: EdgeInsets.fromLTRB(10.0, 0.0, 5.0, 0.0),
minWidth: MediaQuery.of(context).size.width * 0.7, child: ButtonTheme(
height: 45.0, shape: RoundedRectangleBorder(
child: RaisedButton( borderRadius: BorderRadius.circular(10.0),
color: new Color(0xFF60686b), ),
textColor: Colors.white, minWidth:
disabledTextColor: Colors.white, MediaQuery.of(context).size.width * 0.7,
disabledColor: Colors.grey[500], height: 45.0,
onPressed: () { child: RaisedButton(
next(); color: new Color(0xFF60686b),
}, textColor: Colors.white,
child: Text(TranslationBase.of(context).next, disabledTextColor: Colors.white,
style: TextStyle(fontSize: 18.0)), disabledColor: Colors.grey[500],
), onPressed: () {
back();
},
child: Text(TranslationBase.of(context).back,
style: TextStyle(fontSize: 18.0)),
),
),
),
),
Expanded(
flex: 1,
child: Container(
margin: EdgeInsets.fromLTRB(10.0, 0.0, 5.0, 0.0),
child: ButtonTheme(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10.0),
),
minWidth:
MediaQuery.of(context).size.width * 0.7,
height: 45.0,
child: RaisedButton(
color: new Color(0xFF60686b),
textColor: Colors.white,
disabledTextColor: Colors.white,
disabledColor: Colors.grey[500],
onPressed: () {
next();
},
child: Text(TranslationBase.of(context).next,
style: TextStyle(fontSize: 18.0)),
),
),
),
),
],
), ),
), ),
), ],
], ),
), ),
), ],
], ),
), ),
), ),
); );
@ -268,43 +297,63 @@ class _CovidDrivethruLocationState extends State<CovidDrivethruLocation> {
getPaymentInfo(BuildContext context, String projectID) { getPaymentInfo(BuildContext context, String projectID) {
CovidDriveThruService service = new CovidDriveThruService(); CovidDriveThruService service = new CovidDriveThruService();
CovidPaymentInfoResponse covidPaymentInfoResponse = CovidPaymentInfoResponse covidPaymentInfoResponse =
new CovidPaymentInfoResponse(); new CovidPaymentInfoResponse();
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
service service
.getCovidPaymentInformation(context, int.parse(projectID)) .getCovidPaymentInformation(
context, int.parse(projectID), proceduresList[0].procedureID)
.then((res) { .then((res) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
setState(() { setState(() {
covidPaymentInfoResponse = CovidPaymentInfoResponse.fromJson( covidPaymentInfoResponse =
res['COVID19_PatientShare']); CovidPaymentInfoResponse.fromJson(res['COVID19_PatientShare']);
print(covidPaymentInfoResponse.procedureNameField);
});
Navigator.push(
context,
FadePage(
page: CovidPaymentDetails(
covidPaymentInfoResponse: covidPaymentInfoResponse,
projectID: int.parse(projectID),
)));
} else {}
})
.catchError((err) {
print(err);
}); });
Navigator.push(
context,
FadePage(
page: CovidPaymentDetails(
covidPaymentInfoResponse: covidPaymentInfoResponse,
projectID: int.parse(projectID),
proceduresList: proceduresList,
)));
} else {}
}).catchError((err) {
print(err);
});
}
getTestProcedures(BuildContext context) {
CovidDriveThruService service = new CovidDriveThruService();
GifLoaderDialogUtils.showMyDialog(context);
CovidTestProceduresResponse covidTestProceduresResponse =
new CovidTestProceduresResponse();
service.getCovidTestProceduresList(context).then((res) {
if (res['MessageStatus'] == 1) {
print(res);
setState(() {
res['COVID19_TestProceduresList'].forEach((v) {
proceduresList.add(new CovidTestProceduresResponse.fromJson(v));
});
});
print(proceduresList.length);
print(proceduresList[0].procedureName);
GifLoaderDialogUtils.hideDialog(context);
} else {}
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
print(err);
});
} }
getProjectsList(BuildContext context) { getProjectsList(BuildContext context) {
CovidDriveThruService service = new CovidDriveThruService(); CovidDriveThruService service = new CovidDriveThruService();
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
service.getCovidProjectsList(context).then((res) { service.getCovidProjectsList(context).then((res) {
print(res);
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
print(res);
setState(() { setState(() {
res['List_COVID19_ProjectDriveThroughTestingCenter'].forEach((v) { res['List_COVID19_ProjectDriveThroughTestingCenter'].forEach((v) {
projectsList.add(new DriveThroughTestingCenterModel.fromJson(v)); projectsList.add(new DriveThroughTestingCenterModel.fromJson(v));

@ -1,5 +1,8 @@
import 'package:diplomaticquarterapp/models/CovidDriveThru/CovidPaymentInfoResponse.dart'; import 'package:diplomaticquarterapp/models/CovidDriveThru/CovidPaymentInfoResponse.dart';
import 'package:diplomaticquarterapp/models/CovidDriveThru/CovidTestProceduresResponse.dart';
import 'package:diplomaticquarterapp/pages/Covid-DriveThru/Covid-TimeSlots.dart'; import 'package:diplomaticquarterapp/pages/Covid-DriveThru/Covid-TimeSlots.dart';
import 'package:diplomaticquarterapp/services/covid-drivethru/covid-drivethru.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
@ -10,9 +13,13 @@ import 'package:flutter_svg/flutter_svg.dart';
class CovidPaymentDetails extends StatefulWidget { class CovidPaymentDetails extends StatefulWidget {
CovidPaymentInfoResponse covidPaymentInfoResponse; CovidPaymentInfoResponse covidPaymentInfoResponse;
int projectID; int projectID;
List<CovidTestProceduresResponse> proceduresList;
CovidTestProceduresResponse selectedProcedure;
CovidPaymentDetails( CovidPaymentDetails(
{@required this.covidPaymentInfoResponse, @required this.projectID}); {@required this.covidPaymentInfoResponse,
@required this.projectID,
@required this.proceduresList});
@override @override
_CovidPaymentDetailsState createState() => _CovidPaymentDetailsState(); _CovidPaymentDetailsState createState() => _CovidPaymentDetailsState();
@ -21,6 +28,13 @@ class CovidPaymentDetails extends StatefulWidget {
class _CovidPaymentDetailsState extends State<CovidPaymentDetails> { class _CovidPaymentDetailsState extends State<CovidPaymentDetails> {
bool isAgree = false; bool isAgree = false;
@override
void initState() {
print(widget.proceduresList[0].procedureName);
widget.selectedProcedure = widget.proceduresList[0];
super.initState();
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return AppScaffold( return AppScaffold(
@ -28,7 +42,7 @@ class _CovidPaymentDetailsState extends State<CovidPaymentDetails> {
isShowAppBar: true, isShowAppBar: true,
body: SingleChildScrollView( body: SingleChildScrollView(
child: Container( child: Container(
margin: EdgeInsets.fromLTRB(15.0, 15.0, 15.0, 0.0), margin: EdgeInsets.fromLTRB(15.0, 15.0, 15.0, 100.0),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
@ -82,13 +96,75 @@ class _CovidPaymentDetailsState extends State<CovidPaymentDetails> {
borderRadius: BorderRadius.circular(10.0), borderRadius: BorderRadius.circular(10.0),
color: Colors.white), color: Colors.white),
margin: EdgeInsets.fromLTRB(0.0, 30.0, 0.0, 5.0), margin: EdgeInsets.fromLTRB(0.0, 30.0, 0.0, 5.0),
padding: EdgeInsets.fromLTRB(20.0, 0.0, 20.0, 20.0), padding: EdgeInsets.fromLTRB(10.0, 0.0, 10.0, 20.0),
child: Column( child: Column(
children: <Widget>[ children: <Widget>[
Container( Container(
alignment: Alignment.center, alignment: Alignment.center,
margin: margin:
EdgeInsets.only(left: 0.0, right: 20.0, top: 30.0), EdgeInsets.only(left: 0.0, right: 20.0, top: 10.0),
child: Text(
TranslationBase.of(context).covidSelectProcedure,
style: TextStyle(
color: Colors.black,
fontSize: 20.0,
fontWeight: FontWeight.bold)),
),
...List.generate(
widget.proceduresList.length,
(index) => Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(
height: 1,
),
Row(
children: <Widget>[
Expanded(
flex: 1,
child: InkWell(
onTap: () {
setState(() {
widget.selectedProcedure =
widget.proceduresList[index];
});
},
child: ListTile(
title: Text(
widget.proceduresList[index]
.procedureName,
style: TextStyle(fontSize: 14.0)),
leading: Radio(
value: widget.proceduresList[index],
groupValue: widget.selectedProcedure,
activeColor: Colors.red[800],
toggleable: true,
onChanged: (value) {
setState(() {
widget.selectedProcedure = value;
print(widget
.selectedProcedure.procedureName);
getPaymentInfo(
context,
widget.projectID.toString(),
widget.selectedProcedure
.procedureID);
});
},
),
),
),
)
],
),
],
),
),
Divider(),
Container(
alignment: Alignment.center,
margin:
EdgeInsets.only(left: 0.0, right: 20.0, top: 10.0),
child: Text(TranslationBase.of(context).testFee, child: Text(TranslationBase.of(context).testFee,
style: TextStyle( style: TextStyle(
color: Colors.black, color: Colors.black,
@ -144,7 +220,7 @@ class _CovidPaymentDetailsState extends State<CovidPaymentDetails> {
isAgree = !isAgree; isAgree = !isAgree;
}); });
}, },
activeColor: Colors.blue, activeColor: Color(0xffB8382C),
), ),
Texts(TranslationBase.of(context) Texts(TranslationBase.of(context)
.iAgreeToTheTermsAndConditions), .iAgreeToTheTermsAndConditions),
@ -238,6 +314,7 @@ class _CovidPaymentDetailsState extends State<CovidPaymentDetails> {
FadePage( FadePage(
page: CovidTimeSlots( page: CovidTimeSlots(
projectID: widget.projectID, projectID: widget.projectID,
selectedProcedure: widget.selectedProcedure,
))); )));
} }
@ -245,6 +322,34 @@ class _CovidPaymentDetailsState extends State<CovidPaymentDetails> {
Navigator.pop(context); Navigator.pop(context);
} }
getPaymentInfo(
BuildContext context, String projectID, String selectedProcedureID) {
CovidDriveThruService service = new CovidDriveThruService();
GifLoaderDialogUtils.showMyDialog(context);
service
.getCovidPaymentInformation(
context, int.parse(projectID), selectedProcedureID)
.then((res) {
GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) {
setState(() {
widget.covidPaymentInfoResponse =
CovidPaymentInfoResponse.fromJson(res['COVID19_PatientShare']);
});
// Navigator.push(
// context,
// FadePage(
// page: CovidPaymentDetails(
// covidPaymentInfoResponse: covidPaymentInfoResponse,
// projectID: int.parse(projectID),
// proceduresList: proceduresList,
// )));
} else {}
}).catchError((err) {
print(err);
});
}
_getNormalText(text) { _getNormalText(text) {
return Container( return Container(
margin: EdgeInsets.only(top: 20.0, right: 10.0), margin: EdgeInsets.only(top: 20.0, right: 10.0),

@ -737,7 +737,6 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
} }
this.sharedPref.setString(APP_LANGUAGE, currentLang); this.sharedPref.setString(APP_LANGUAGE, currentLang);
this.sharedPref.setObject(MAIN_USER, mainUser); this.sharedPref.setObject(MAIN_USER, mainUser);
this.sharedPref.setString(APP_LANGUAGE, currentLang);
this.sharedPref.setObject(USER_PROFILE, result.list); this.sharedPref.setObject(USER_PROFILE, result.list);
this.sharedPref.setObject(FAMILY_FILE, familyFile); this.sharedPref.setObject(FAMILY_FILE, familyFile);
this.sharedPref.setObject(LOGIN_TOKEN_ID, result.logInTokenID); this.sharedPref.setObject(LOGIN_TOKEN_ID, result.logInTokenID);

@ -206,7 +206,7 @@ class _SelectTransportationMethodState
SizedBox( SizedBox(
height: 8, height: 8,
), ),
Texts(TranslationBase.of(context).directionHeading), Texts(TranslationBase.of(context).wayHeading),
SizedBox( SizedBox(
height: 5, height: 5,
), ),

@ -47,6 +47,7 @@ class _ErOptionsState extends State<ErOptions> {
return AppScaffold( return AppScaffold(
isShowAppBar: widget.isAppbar, isShowAppBar: widget.isAppbar,
appBarTitle: TranslationBase.of(context).bookAppo, appBarTitle: TranslationBase.of(context).bookAppo,
isShowDecPage: false,
body: Container( body: Container(
margin: EdgeInsets.fromLTRB(10.0, 20.0, 10.0, 10.0), margin: EdgeInsets.fromLTRB(10.0, 20.0, 10.0, 10.0),
child: Column( child: Column(

@ -31,6 +31,7 @@ class NearestEr extends StatelessWidget {
: (model) => model.getProjectAvgERWaitingTimeOrders(), : (model) => model.getProjectAvgERWaitingTimeOrders(),
builder: (_, mode, widget) => AppScaffold( builder: (_, mode, widget) => AppScaffold(
isShowAppBar: true, isShowAppBar: true,
isShowDecPage: false,
appBarTitle: TranslationBase.of(context).NearestEr, appBarTitle: TranslationBase.of(context).NearestEr,
baseViewModel: mode, baseViewModel: mode,
body: mode.ProjectAvgERWaitingTimeModeList.length > 0 body: mode.ProjectAvgERWaitingTimeModeList.length > 0

@ -2,10 +2,12 @@ import 'package:diplomaticquarterapp/core/model/pharmacies/Addresses.dart';
import 'package:diplomaticquarterapp/core/viewModels/er/rrt-view-model.dart'; import 'package:diplomaticquarterapp/core/viewModels/er/rrt-view-model.dart';
import 'package:diplomaticquarterapp/models/rrt/service_price.dart'; import 'package:diplomaticquarterapp/models/rrt/service_price.dart';
import 'package:diplomaticquarterapp/pages/ErService/ErOptions.dart'; import 'package:diplomaticquarterapp/pages/ErService/ErOptions.dart';
import 'package:diplomaticquarterapp/pages/ErService/rapid-response-team/rrt-main-screen.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.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/alert_dialog.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
@ -172,8 +174,8 @@ class RRTPlaceOrderPage extends StatelessWidget{
if(requestId != null){ if(requestId != null){
AlertDialogBox( AlertDialogBox(
context: _context, context: _context,
title: '', title: '',
message: localize.rrtOrderSuccessMessage, confirmMessage: localize.rrtOrderSuccessMessage,
okText: localize.ok, okText: localize.ok,
okFunction: (){ okFunction: (){
AlertDialogBox.closeAlertDialog(_context); AlertDialogBox.closeAlertDialog(_context);
@ -188,8 +190,6 @@ class RRTPlaceOrderPage extends StatelessWidget{
} }
gotoRRTRoot(){ gotoRRTRoot(){
Navigator.pushAndRemoveUntil( Navigator.popUntil(_context, (route) => Utils.route(route, equalsTo: ErOptions));
_context,
MaterialPageRoute(builder: (context) => ErOptions(isAppbar: true)), (Route<dynamic> r) => false);
} }
} }

@ -39,10 +39,10 @@ class _AppointmentDetailsState extends State<AppointmentDetails>
void initState() { void initState() {
_tabController = new TabController(length: 2, vsync: this); _tabController = new TabController(length: 2, vsync: this);
AppointmentDetails.showFooterButton = false; AppointmentDetails.showFooterButton = false;
print(widget.appo.clinicID);
super.initState(); super.initState();
} }
@override @override
void dispose() { void dispose() {
super.dispose(); super.dispose();
@ -116,7 +116,8 @@ class _AppointmentDetailsState extends State<AppointmentDetails>
Container( Container(
margin: EdgeInsets.only(top: 10.0), margin: EdgeInsets.only(top: 10.0),
alignment: Alignment.center, alignment: Alignment.center,
child: Text(getDoctorSpeciality(widget.appo.doctorSpeciality), child: Text(
getDoctorSpeciality(widget.appo.doctorSpeciality),
style: TextStyle( style: TextStyle(
fontSize: 12.0, fontSize: 12.0,
color: Colors.grey[900], color: Colors.grey[900],
@ -177,20 +178,36 @@ class _AppointmentDetailsState extends State<AppointmentDetails>
TabBar( TabBar(
onTap: (index) { onTap: (index) {
setState(() { setState(() {
index == 1 if (index == 1) {
? AppointmentDetails.showFooterButton = true if (widget.appo.clinicID == 17 ||
: AppointmentDetails.showFooterButton = false; widget.appo.clinicID == 23 ||
print(AppointmentDetails.showFooterButton); widget.appo.isExecludeDoctor) {
_tabController.index =
_tabController.previousIndex;
AppointmentDetails.showFooterButton = false;
} else {
AppointmentDetails.showFooterButton = true;
}
}
}); });
}, },
tabs: [ tabs: [
Tab( Tab(
child: Text(TranslationBase.of(context).appoActions, child: Text(TranslationBase.of(context).appoActions,
style: TextStyle(color: Colors.black))), style: TextStyle(color: Colors.black))),
Tab( widget.appo.clinicID == 17 ||
child: Text(TranslationBase.of(context).availableAppo, widget.appo.clinicID == 23 ||
style: TextStyle(color: Colors.black)), widget.appo.isExecludeDoctor
) ? Tab(
child: Text(
TranslationBase.of(context).availableAppo,
style: TextStyle(color: Colors.grey)),
)
: Tab(
child: Text(
TranslationBase.of(context).availableAppo,
style: TextStyle(color: Colors.black)),
)
], ],
controller: _tabController, controller: _tabController,
), ),

@ -30,7 +30,7 @@ class ArrivedButtons {
{ {
"title": TranslationBase.of(AppGlobal.context).raise, "title": TranslationBase.of(AppGlobal.context).raise,
"subtitle": TranslationBase.of(AppGlobal.context).complaint, "subtitle": TranslationBase.of(AppGlobal.context).complaint,
"icon": "assets/images/new-design/Complaint_icon.png", "icon": "assets/images/new-design/feedback_icon.png",
"caller": "insertComplaint" "caller": "insertComplaint"
}, },
{ {

@ -195,7 +195,7 @@ class _ApointmentCardState extends State<AppointmentCard> {
widgetBuilder: (_, CurrentRemainingTime time) { widgetBuilder: (_, CurrentRemainingTime time) {
return time != null return time != null
? Text( ? Text(
'${time.days}:${time.hours}:${time.min}:${time.sec} ' + '${time.days != null ? time.days : "0"}:${time.hours != null ? time.hours : "0"}:${time.min}:${time.sec} ' +
TranslationBase.of(context) TranslationBase.of(context)
.upcomingTimeLeft, .upcomingTimeLeft,
style: TextStyle( style: TextStyle(

@ -0,0 +1,62 @@
import 'package:diplomaticquarterapp/core/model/feedback/COC_items.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:diplomaticquarterapp/uitl/translations_delegate_base.dart';
class FeedbackDetails extends StatelessWidget {
final COCItem items;
FeedbackDetails({
@required this.items,
});
@override
Widget build(BuildContext context) {
return AppScaffold(
isShowAppBar: true,
appBarTitle: TranslationBase.of(context).feedbackTitle,
body: Container(
margin: EdgeInsets.all(5),
padding: EdgeInsets.all(5),
color: Colors.white,
child: Table(
border: TableBorder.all(),
columnWidths: const <int, TableColumnWidth>{
0: IntrinsicColumnWidth(),
1: FlexColumnWidth(),
2: FixedColumnWidth(64),
},
defaultVerticalAlignment: TableCellVerticalAlignment.middle,
children: <TableRow>[
TableRow(
children: [
getColumnText(TranslationBase.of(context).feedbackTitle),
getColumnText(items.cOCTitle)
],
),
TableRow(
children: [
getColumnText(TranslationBase.of(context).complaint),
getColumnText(items.cOCID)
],
),
TableRow(
children: [
getColumnText(TranslationBase.of(context).date),
getColumnText(items.date)
],
),
TableRow(
children: [
getColumnText(TranslationBase.of(context).type),
getColumnText(items.formType)
],
)
])));
}
Widget getColumnText(value) {
return Container(child: Texts(value), padding: EdgeInsets.all(5));
}
}

@ -1,11 +1,13 @@
import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/viewModels/feedback/feedback_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/feedback/feedback_view_model.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/pages/feedback/feedback-detail.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; import 'package:diplomaticquarterapp/widgets/buttons/button.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.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/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -24,11 +26,16 @@ class _StatusFeedbackPageState extends State<StatusFeedbackPage> {
isShowDecPage: false, isShowDecPage: false,
body: model.cOCItemList.isNotEmpty body: model.cOCItemList.isNotEmpty
? Container( ? Container(
margin: EdgeInsets.only(top: 8.0, left: 8.0, right: 8.0), margin: EdgeInsets.only(
top: 8.0, left: 8.0, right: 8.0, bottom: 80),
padding: EdgeInsets.all(15.0), padding: EdgeInsets.all(15.0),
child: ListView.builder( child: ListView.builder(
itemCount: model.cOCItemList.length, itemCount: model.cOCItemList.length,
itemBuilder: (context, index) => Container( itemBuilder: (context, index) => InkWell(
onTap: () {
gotodetails(model.cOCItemList[index]);
},
child: Container(
decoration: BoxDecoration( decoration: BoxDecoration(
shape: BoxShape.rectangle, shape: BoxShape.rectangle,
border: Border.all(color: Colors.white, width: 0.5), border: Border.all(color: Colors.white, width: 0.5),
@ -87,7 +94,7 @@ class _StatusFeedbackPageState extends State<StatusFeedbackPage> {
], ],
), ),
), ),
)), ))),
) )
: Container( : Container(
child: Center( child: Center(
@ -128,4 +135,9 @@ class _StatusFeedbackPageState extends State<StatusFeedbackPage> {
), ),
); );
} }
gotodetails(item) {
Navigator.pushReplacement(
context, FadePage(page: FeedbackDetails(items: item)));
}
} }

@ -264,6 +264,7 @@ class InsuranceCardUpdateDetails extends StatelessWidget {
textColor: Colors.white, textColor: Colors.white,
label: TranslationBase.of(context).scanNow.toUpperCase(), label: TranslationBase.of(context).scanNow.toUpperCase(),
color: Theme.of(context).primaryColor, color: Theme.of(context).primaryColor,
small: true,
onTap: () async { onTap: () async {
confirmAttachInsuranceCardImageDialogDialog( confirmAttachInsuranceCardImageDialogDialog(
context: context, context: context,

@ -1,3 +1,5 @@
import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/config/size_config.dart'; import 'package:diplomaticquarterapp/config/size_config.dart';
import 'package:diplomaticquarterapp/core/viewModels/dashboard_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/dashboard_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/pharmacy_module_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/pharmacy_module_view_model.dart';
@ -19,6 +21,7 @@ import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:feather_icons_flutter/feather_icons_flutter.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart'; import 'package:flutter_svg/flutter_svg.dart';
@ -44,9 +47,7 @@ class _HomePageState extends State<HomePage> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context); ProjectViewModel projectViewModel = Provider.of(context);
return BaseView<DashboardViewModel>( return BaseView<DashboardViewModel>(
onModelReady: (model) => () { onModelReady: (model) => () async {},
model.getPatientRadOrders();
},
builder: (_, model, wi) => AppScaffold( builder: (_, model, wi) => AppScaffold(
isShowDecPage: false, isShowDecPage: false,
isHelp: true, isHelp: true,
@ -558,39 +559,52 @@ class _HomePageState extends State<HomePage> {
children: <Widget>[ children: <Widget>[
if (projectViewModel.havePrivilege(64)) if (projectViewModel.havePrivilege(64))
DashboardItem( DashboardItem(
onTap: () { onTap: (model.user != null && model.user.outSA == 1)
Navigator.push( ? () {}
context, : () {
FadePage( Navigator.push(
page: HomeHealthCarePage(), context,
), FadePage(
); page: HomeHealthCarePage(),
}, ),
);
},
child: Center( child: Center(
child: Padding( child: Padding(
padding: const EdgeInsets.all(15.0), padding: const EdgeInsets.all(15.0),
child: Column( child: (model.user != null &&
children: <Widget>[ model.user.outSA == 1)
Image.asset( ? Container(
'assets/images/home_health_care_icon.png', width: double.infinity,
width: 50, height: double.infinity,
height: 50, color: Colors.grey.withOpacity(0.7),
), child: Icon(
SizedBox( Icons.lock_outline,
height: 10, size: 40,
), ),
Texts( )
TranslationBase.of(context) : Column(
.homeHealthCare, children: <Widget>[
textAlign: TextAlign.center, Image.asset(
color: Colors.white, 'assets/images/home_health_care_icon.png',
fontWeight: FontWeight.w700, width: 50,
fontSize: height: 50,
SizeConfig.textMultiplier * 1.55, ),
) SizedBox(
], height: 10,
), ),
), Texts(
TranslationBase.of(context)
.homeHealthCare,
textAlign: TextAlign.center,
color: Colors.white,
fontWeight: FontWeight.w700,
fontSize:
SizeConfig.textMultiplier *
1.55,
)
],
)),
), ),
height: MediaQuery.of(context).size.width * 0.4, height: MediaQuery.of(context).size.width * 0.4,
imageName: 'home_healthcare_service_bg.png', imageName: 'home_healthcare_service_bg.png',
@ -598,31 +612,52 @@ class _HomePageState extends State<HomePage> {
), ),
if (projectViewModel.havePrivilege(65)) if (projectViewModel.havePrivilege(65))
DashboardItem( DashboardItem(
onTap: () => getPharmacyToken(model), onTap: () =>
(model.user != null && model.user.outSA == 1)
? () {}
: getPharmacyToken(model),
child: Center( child: Center(
child: Padding( child: Padding(
padding: const EdgeInsets.all(15.0), padding: const EdgeInsets.all(15.0),
child: Column( child: (model.user != null &&
children: <Widget>[ model.user.outSA == 1)
Image.asset( ? Container(
'assets/images/pharmacy_logo.png', width: double.infinity,
width: 40, height: double.infinity,
height: 40, color: Colors.grey.withOpacity(0.7),
), child: Icon(
SizedBox( Icons.lock_outline,
height: 20, size: 40,
), ),
Texts( )
TranslationBase.of(context) : Column(
.onlinePharmacy, children: <Widget>[
textAlign: TextAlign.center, // if (projectViewModel.user != null && model.isLogin && model.user.outSA == 1)
color: Colors.white, // Image.asset(
fontWeight: FontWeight.w700, // 'assets/images/lock_icon.png',
fontSize: // width: 50,
SizeConfig.textMultiplier * 1.55, // height: 50,
) // ),
], Image.asset(
), 'assets/images/pharmacy_logo.png',
width: 40,
height: 40,
),
SizedBox(
height: 20,
),
Texts(
TranslationBase.of(context)
.onlinePharmacy,
textAlign: TextAlign.center,
color: Colors.white,
fontWeight: FontWeight.w700,
fontSize:
SizeConfig.textMultiplier *
1.55,
)
],
),
), ),
), ),
height: MediaQuery.of(context).size.width * 0.4, height: MediaQuery.of(context).size.width * 0.4,
@ -630,38 +665,52 @@ class _HomePageState extends State<HomePage> {
), ),
if (projectViewModel.havePrivilege(67)) if (projectViewModel.havePrivilege(67))
DashboardItem( DashboardItem(
onTap: () { onTap: (model.user != null && model.user.outSA == 1)
Navigator.push( ? () {}
context, : () {
FadePage( Navigator.push(
page: CMCPage(), context,
), FadePage(
); page: CMCPage(),
}, ),
);
},
child: Center( child: Center(
child: Padding( child: Padding(
padding: const EdgeInsets.all(15.0), padding: const EdgeInsets.all(15.0),
child: Column( child: (model.user != null &&
children: <Widget>[ model.user.outSA == 1)
Image.asset( ? Container(
'assets/images/comprehensive_medical_checkup_logo.png', width: double.infinity,
width: 50, height: double.infinity,
height: 50, color: Colors.grey.withOpacity(0.7),
), child: Icon(
SizedBox( Icons.lock_outline,
height: 10, size: 40,
), ),
Texts( )
TranslationBase.of(context).cmcHeading, : Column(
textAlign: TextAlign.center, children: <Widget>[
color: Colors.white, Image.asset(
fontWeight: FontWeight.w700, 'assets/images/comprehensive_medical_checkup_logo.png',
fontSize: width: 50,
SizeConfig.textMultiplier * 1.55, height: 50,
) ),
], SizedBox(
), height: 10,
), ),
Texts(
TranslationBase.of(context)
.cmcHeading,
textAlign: TextAlign.center,
color: Colors.white,
fontWeight: FontWeight.w700,
fontSize:
SizeConfig.textMultiplier *
1.55,
)
],
)),
), ),
height: MediaQuery.of(context).size.width * 0.4, height: MediaQuery.of(context).size.width * 0.4,
color: HexColor("#747C80"), color: HexColor("#747C80"),
@ -852,7 +901,7 @@ class _HomePageState extends State<HomePage> {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Texts( Texts(
TranslationBase.of(context).contactUs, TranslationBase.of(context).reachUs,
color: Colors.white, color: Colors.white,
fontWeight: FontWeight.normal, fontWeight: FontWeight.normal,
), ),

@ -59,7 +59,7 @@ class LandingPage extends StatefulWidget {
@override @override
_LandingPageState createState() => state = _LandingPageState(); _LandingPageState createState() => state = _LandingPageState();
switchToDoFromHMGServices(){ switchToDoFromHMGServices() {
state.changeCurrentTab(4); state.changeCurrentTab(4);
} }
} }
@ -99,7 +99,7 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
changeCurrentTab(int tab) { changeCurrentTab(int tab) {
setState(() { setState(() {
if(currentTab > 0 && tab == 2) if (currentTab > 0 && tab == 2)
pageController.jumpToPage(0); pageController.jumpToPage(0);
else if (tab != 0) else if (tab != 0)
pageController.jumpToPage(tab); pageController.jumpToPage(tab);
@ -111,8 +111,6 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
}); });
} }
@override @override
void didChangeAppLifecycleState(AppLifecycleState state) { void didChangeAppLifecycleState(AppLifecycleState state) {
super.didChangeAppLifecycleState(state); super.didChangeAppLifecycleState(state);
@ -164,9 +162,9 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
void initState() { void initState() {
super.initState(); super.initState();
WidgetsBinding.instance.addObserver(this); WidgetsBinding.instance.addObserver(this);
//setState(() {
AppGlobal.context = context; AppGlobal.context = context;
// });
_requestIOSPermissions(); _requestIOSPermissions();
pageController = PageController(keepPage: true); pageController = PageController(keepPage: true);
_firebaseMessaging.setAutoInitEnabled(true); _firebaseMessaging.setAutoInitEnabled(true);
@ -196,6 +194,8 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
if (token != null && DEVICE_TOKEN == "") { if (token != null && DEVICE_TOKEN == "") {
DEVICE_TOKEN = token; DEVICE_TOKEN = token;
checkUserStatus(token); checkUserStatus(token);
if (projectViewModel.isLogin)
this.getNotificationCount(DEVICE_TOKEN);
} }
}); });
if (results[Permission.location].isGranted) ; if (results[Permission.location].isGranted) ;
@ -420,7 +420,6 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
authService authService
.selectDeviceImei(DEVICE_TOKEN) .selectDeviceImei(DEVICE_TOKEN)
.then((SelectDeviceIMEIRES value) { .then((SelectDeviceIMEIRES value) {
this.getNotificationCount(DEVICE_TOKEN);
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
if (value != null) { if (value != null) {
setUserValues(value); setUserValues(value);
@ -444,23 +443,27 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
var data = var data =
AuthenticatedUser.fromJson(await sharedPref.getObject(USER_PROFILE)); AuthenticatedUser.fromJson(await sharedPref.getObject(USER_PROFILE));
if (data != null) { if (data != null) {
authService // authService
.registeredAuthenticatedUser(data, token, 0, 0) // .registeredAuthenticatedUser(data, token, 0, 0)
.then((res) => {print(res)}); // .then((res) => {print(res)});
authService.getDashboard().then((value) => { authService.getDashboard().then((value) => {
setState(() { if (value != null)
notificationCount = value['List_PatientDashboard'][0] {
['UnreadPatientNotificationCount'] > setState(() {
99 notificationCount = value['List_PatientDashboard'][0]
? '99+' ['UnreadPatientNotificationCount'] >
: value['List_PatientDashboard'][0] 99
['UnreadPatientNotificationCount'] ? '99+'
.toString(); : value['List_PatientDashboard'][0]
['UnreadPatientNotificationCount']
sharedPref.setString(NOTIFICATION_COUNT, notificationCount); .toString();
})
sharedPref.setString(NOTIFICATION_COUNT, notificationCount);
})
}
}); });
familyFileProvider.getSharedRecordByStatus();
// familyFileProvider.getSharedRecordByStatus();
} }
} }
} }
@ -576,7 +579,7 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
changeIndex: changeCurrentTab, changeIndex: changeCurrentTab,
index: currentTab, index: currentTab,
), ),
floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked , floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked,
floatingActionButton: floatingActionButton:
(projectViewModel.havePrivilege(34) && currentTab == 0) (projectViewModel.havePrivilege(34) && currentTab == 0)
? FloatingButton( ? FloatingButton(

@ -7,6 +7,7 @@ import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart';
class LiveCareHome extends StatefulWidget { class LiveCareHome extends StatefulWidget {
static bool showFooterButton = true; static bool showFooterButton = true;
@ -21,6 +22,7 @@ class _LiveCareHomeState extends State<LiveCareHome>
bool isDataLoaded = false; bool isDataLoaded = false;
bool hasLiveCareRequest = false; bool hasLiveCareRequest = false;
List<ImagesInfo> imagesInfo = List();
List<ErRequestHistoryList> erRequestHistoryList; List<ErRequestHistoryList> erRequestHistoryList;
@ -32,7 +34,11 @@ class _LiveCareHomeState extends State<LiveCareHome>
erRequestHistoryList = List(); erRequestHistoryList = List();
pendingERRequestHistoryList = new ErRequestHistoryList(); pendingERRequestHistoryList = new ErRequestHistoryList();
imagesInfo.add(ImagesInfo(
imageEn:
'https://hmgwebservices.com/Images/MobileApp/imges-info/er-consultation_en/en/0.png',
imageAr:
'https://hmgwebservices.com/Images/MobileApp/imges-info/er-consultation_en/ar/0.png'));
WidgetsBinding.instance.addPostFrameCallback((_) { WidgetsBinding.instance.addPostFrameCallback((_) {
if (!isDataLoaded) getLiveCareHistory(); if (!isDataLoaded) getLiveCareHistory();
}); });
@ -45,6 +51,8 @@ class _LiveCareHomeState extends State<LiveCareHome>
return AppScaffold( return AppScaffold(
appBarTitle: "LiveCare", appBarTitle: "LiveCare",
isShowAppBar: true, isShowAppBar: true,
imagesInfo: imagesInfo,
description: TranslationBase.of(context).erConsultation,
body: Container( body: Container(
child: Column(children: [ child: Column(children: [
/// this is will not colored with theme data /// this is will not colored with theme data

@ -12,10 +12,12 @@ class ClinicCard extends StatefulWidget {
bool isSelected; bool isSelected;
final PatientERGetClinicsList patientERGetClinicsList; final PatientERGetClinicsList patientERGetClinicsList;
var languageID; var languageID;
int isOnline;
ClinicCard( ClinicCard(
{this.isSelected, {this.isSelected,
this.languageID, this.languageID,
this.isOnline,
@required this.patientERGetClinicsList}); @required this.patientERGetClinicsList});
@override @override
@ -37,7 +39,7 @@ class _State extends State<ClinicCard> {
children: <Widget>[ children: <Widget>[
Card( Card(
margin: EdgeInsets.fromLTRB(15.0, 10.0, 8.0, 8.0), margin: EdgeInsets.fromLTRB(15.0, 10.0, 8.0, 8.0),
color: widget.isSelected ? Colors.blue : Colors.white, color: widget.isSelected ? Colors.blue : widget.isOnline == 1 ? Colors.white : Colors.grey,
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10), borderRadius: BorderRadius.circular(10),
), ),

@ -385,7 +385,7 @@ class _clinic_listState extends State<ClinicList> {
} }
}).catchError((err) { }).catchError((err) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: err); // AppToast.showErrorToast(message: err);
print(err); print(err);
}); });
} }
@ -555,8 +555,13 @@ class _clinic_listState extends State<ClinicList> {
itemBuilder: (context, index) { itemBuilder: (context, index) {
return InkWell( return InkWell(
onTap: () { onTap: () {
updateSelectedIndex(liveCareClinicsListResponse if(liveCareClinicsListResponse
.patientERGetClinicsList[index]); .patientERGetClinicsList[index].isOnline == 1) {
updateSelectedIndex(liveCareClinicsListResponse
.patientERGetClinicsList[index]);
} else {
AppToast.showErrorToast(message: "Clinic is offline");
}
}, },
child: ClinicCard( child: ClinicCard(
isSelected: selectedClinicID == isSelected: selectedClinicID ==

@ -269,6 +269,7 @@ class _ConfirmLogin extends State<ConfirmLogin> {
try { try {
availableBiometrics = await auth.getAvailableBiometrics(); availableBiometrics = await auth.getAvailableBiometrics();
} on PlatformException catch (e) { } on PlatformException catch (e) {
AppToast.showErrorToast(message: e.message);
print(e); print(e);
} }
if (!mounted) return; if (!mounted) return;
@ -397,7 +398,8 @@ class _ConfirmLogin extends State<ConfirmLogin> {
stickyAuth: true, stickyAuth: true,
iOSAuthStrings: iosStrings); iOSAuthStrings: iosStrings);
} on PlatformException catch (e) { } on PlatformException catch (e) {
AppToast.showErrorToast(message: e.toString()); GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: 'Please enable your Touch or Face ID');
} }
if (authenticated == true) { if (authenticated == true) {

@ -23,6 +23,7 @@ class _ForgotPassword extends State<ForgotPassword> {
final TextEditingController nationalIDorFile = null; final TextEditingController nationalIDorFile = null;
String mobileNo = ""; String mobileNo = "";
var con; var con;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
con = context; con = context;
@ -76,7 +77,9 @@ class _ForgotPassword extends State<ForgotPassword> {
child: DefaultButton( child: DefaultButton(
TranslationBase.of(context).submit, TranslationBase.of(context).submit,
() { () {
sendPatientIDBySMS(); // if (mobileNo.length >= 9 == true)
// sendPatientIDBySMS();
if (mobileNo.length >= 9) sendPatientIDBySMS();
// print(mobileNo.text); // print(mobileNo.text);
}, },
color: mobileNo.length >= 9 == true color: mobileNo.length >= 9 == true
@ -144,7 +147,7 @@ class _ForgotPassword extends State<ForgotPassword> {
Navigator.of(context).pop(); Navigator.of(context).pop();
AlertDialogBox( AlertDialogBox(
context: con, context: con,
message: res['ReturnMessage'], confirmMessage: res['ReturnMessage'],
okText: TranslationBase.of(con).ok, okText: TranslationBase.of(con).ok,
okFunction: () { okFunction: () {
AlertDialogBox.closeAlertDialog(con); AlertDialogBox.closeAlertDialog(con);

@ -64,11 +64,6 @@ class _Login extends State<Login> {
void initState() { void initState() {
// getDeviceToken(); // getDeviceToken();
super.initState(); super.initState();
if(BASE_URL.contains("uat.")){
nationalIDorFile.text = "1231755";
mobileNumberController.text = mobileNo = "537503378";
}
} }
getDeviceToken() async { getDeviceToken() async {

@ -256,7 +256,7 @@ class _Register extends State<Register> {
// AppToast.showErrorToast(message: response['ErrorEndUserMessage']); // AppToast.showErrorToast(message: response['ErrorEndUserMessage']);
AlertDialogBox( AlertDialogBox(
context: context, context: context,
message: response['ErrorEndUserMessage'], confirmMessage: response['ErrorEndUserMessage'],
okText: TranslationBase.of(context).ok, okText: TranslationBase.of(context).ok,
okFunction: () { okFunction: () {
AlertDialogBox.closeAlertDialog(context); AlertDialogBox.closeAlertDialog(context);
@ -276,7 +276,7 @@ class _Register extends State<Register> {
//AppToast.showErrorToast(message: response); //AppToast.showErrorToast(message: response);
AlertDialogBox( AlertDialogBox(
context: context, context: context,
message: response, confirmMessage: response,
okText: TranslationBase.of(context).ok, okText: TranslationBase.of(context).ok,
okFunction: () { okFunction: () {
AlertDialogBox.closeAlertDialog(context); AlertDialogBox.closeAlertDialog(context);

@ -104,7 +104,8 @@ class _RequestTypePageState extends State<RequestTypePage> {
), ),
bottomSheet: Container( bottomSheet: Container(
width: double.maxFinite, width: double.maxFinite,
height: MediaQuery.of(context).size.height * 0.1, // height: MediaQuery.of(context).size.height * 0.1,
height: 80.0,
child: Padding( child: Padding(
padding: const EdgeInsets.all(12.0), padding: const EdgeInsets.all(12.0),
child: SecondaryButton( child: SecondaryButton(

@ -8,7 +8,6 @@ import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart';
import 'advance_payment_page.dart'; import 'advance_payment_page.dart';
@ -105,12 +104,12 @@ class MyBalancePage extends StatelessWidget {
), ),
), ),
bottomSheet: Container( bottomSheet: Container(
height: MediaQuery.of(context).size.height * 0.12, // height: MediaQuery.of(context).size.height * 0.12,
height: 70.0,
color: Colors.white, color: Colors.white,
width: double.infinity, width: double.infinity,
padding: EdgeInsets.all(12), padding: EdgeInsets.all(12),
child: SecondaryButton( child: SecondaryButton(
// color: Colors.grey[900],
textColor: Colors.white, textColor: Colors.white,
label: TranslationBase.of(context).createAdvancedPayment, label: TranslationBase.of(context).createAdvancedPayment,
onTap: () { onTap: () {

@ -32,7 +32,16 @@ class WeightMonthlyPage extends StatelessWidget {
body: model.weighMonthTimeSeriesData.isEmpty body: model.weighMonthTimeSeriesData.isEmpty
? Container( ? Container(
child: Center( child: Center(
child: Texts(TranslationBase.of(context).noDataAvailable), child: Container(
child: Center(
child: MonthLineChartCurved(
horizontalInterval: 1.0,
title: TranslationBase.of(context).weight,
timeSeries: model.weighMonthTimeSeriesData,
indexes: model.weighMonthTimeSeriesData.length ~/ 5.5 ?? 0,
),
),
),
), ),
) )
: ListView( : ListView(

@ -30,7 +30,12 @@ class WeightWeeklyPage extends StatelessWidget {
child: Center( child: Center(
child: Container( child: Container(
child: Center( child: Center(
child: Texts(TranslationBase.of(context).noDataAvailable), child: LineChartCurved(
horizontalInterval: 1.0,
title: TranslationBase.of(context).weight,
timeSeries: model.weightWeekTimeSeriesData,
indexes: model.weightWeekTimeSeriesData.length ~/ 5.5 ?? 0,
),
), ),
), ),
), ),

@ -31,7 +31,16 @@ class WeightYearPage extends StatelessWidget {
body: model.weightYearTimeSeriesData.isEmpty body: model.weightYearTimeSeriesData.isEmpty
? Container( ? Container(
child: Center( child: Center(
child: Texts(TranslationBase.of(context).noDataAvailable), child: Container(
child: Center(
child: LineChartCurved(
horizontalInterval: 1.0,
title: TranslationBase.of(context).weight,
timeSeries: model.weightYearTimeSeriesData,
indexes: model.weightWeekTimeSeriesData.length ~/ 5.5 ?? 0,
),
),
),
), ),
) )
: ListView( : ListView(

@ -27,13 +27,13 @@ class AddBloodPressurePage extends StatefulWidget {
const AddBloodPressurePage( const AddBloodPressurePage(
{Key key, {Key key,
this.bloodSugarDate, this.bloodSugarDate,
this.measureTimeSelectedType, this.measureTimeSelectedType,
this.isUpdate = false, this.isUpdate = false,
this.lineItemNo, this.lineItemNo,
this.model, this.model,
this.bloodSystolicValue, this.bloodSystolicValue,
this.bloodDiastolicValue}) this.bloodDiastolicValue})
: super(key: key); : super(key: key);
@override @override
@ -42,15 +42,14 @@ class AddBloodPressurePage extends StatefulWidget {
class _AddBloodPressurePageState extends State<AddBloodPressurePage> { class _AddBloodPressurePageState extends State<AddBloodPressurePage> {
TextEditingController _bloodSystolicValueController = TextEditingController(); TextEditingController _bloodSystolicValueController = TextEditingController();
TextEditingController _bloodDiastolicValueController = TextEditingController _bloodDiastolicValueController = TextEditingController();
TextEditingController();
DateTime bloodSugarDate = DateTime.now(); DateTime bloodSugarDate = DateTime.now();
DateTime timeSugarDate = DateTime.now(); DateTime timeSugarDate = DateTime.now();
int measuredArm = 1; int measuredArm = 1;
bool isButtonDisabled = false; bool isButtonDisabled = false;
final List<String> measureTimeEnList = [ final List<String> measureTimeEnList = [
'Left', 'Left Arm ',
'Right', 'Right Arm',
]; ];
final List<String> measureTimeArList = [ final List<String> measureTimeArList = [
'الذراع الأيسر', 'الذراع الأيسر',
@ -81,44 +80,38 @@ class _AddBloodPressurePageState extends State<AddBloodPressurePage> {
return AppScaffold( return AppScaffold(
isShowAppBar: true, isShowAppBar: true,
appBarTitle: widget.isUpdate appBarTitle: widget.isUpdate ? TranslationBase.of(context).update : TranslationBase.of(context).add,
? TranslationBase.of(context).update
: TranslationBase.of(context).add,
appBarIcons: widget.isUpdate appBarIcons: widget.isUpdate
? [ ? [
IconButton( IconButton(
icon: Icon(Icons.delete), icon: Icon(Icons.delete),
color: Colors.white, color: Colors.white,
onPressed: () { onPressed: () {
ConfirmDialog dialog = new ConfirmDialog( ConfirmDialog dialog = new ConfirmDialog(
context: context, context: context,
confirmMessage: 'Remove this measure', confirmMessage: 'Remove this measure',
okText: TranslationBase.of(context).ok, okText: TranslationBase.of(context).ok,
cancelText: TranslationBase.of(context).cancel, cancelText: TranslationBase.of(context).cancel,
okFunction: () async { okFunction: () async {
ConfirmDialog.closeAlertDialog(context); ConfirmDialog.closeAlertDialog(context);
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
widget.model widget.model.deactivateDiabeticStatus(lineItemNo: widget.lineItemNo).then((value) {
.deactivateDiabeticStatus( GifLoaderDialogUtils.hideDialog(context);
lineItemNo: widget.lineItemNo) if (widget.model.state == ViewState.ErrorLocal)
.then((value) { AppToast.showErrorToast(message: widget.model.error);
GifLoaderDialogUtils.hideDialog(context); else
if (widget.model.state == ViewState.ErrorLocal) Navigator.pop(context);
AppToast.showErrorToast( }).catchError((e) {
message: widget.model.error); GifLoaderDialogUtils.hideDialog(context);
else AppToast.showErrorToast(message: widget.model.error);
Navigator.pop(context); });
}).catchError((e) { },
GifLoaderDialogUtils.hideDialog(context); cancelFunction: () => {});
AppToast.showErrorToast(message: widget.model.error); dialog.showAlertDialog(context);
}); },
}, )
cancelFunction: () => {}); ]
dialog.showAlertDialog(context);
},
)
]
: null, : null,
body: SingleChildScrollView( body: SingleChildScrollView(
physics: BouncingScrollPhysics(), physics: BouncingScrollPhysics(),
@ -151,17 +144,13 @@ class _AddBloodPressurePageState extends State<AddBloodPressurePage> {
), ),
InkWell( InkWell(
onTap: () { onTap: () {
confirmSelectMeasureTimeDialog(!projectViewModel.isArabic confirmSelectMeasureTimeDialog(projectViewModel.isArabic ? measureTimeEnList : measureTimeArList);
? measureTimeEnList
: measureTimeArList);
}, },
child: Container( child: Container(
padding: EdgeInsets.all(12), padding: EdgeInsets.all(12),
width: double.infinity, width: double.infinity,
height: 65, height: 65,
decoration: BoxDecoration( decoration: BoxDecoration(borderRadius: BorderRadius.circular(12), color: Colors.white),
borderRadius: BorderRadius.circular(12),
color: Colors.white),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
@ -183,22 +172,18 @@ class _AddBloodPressurePageState extends State<AddBloodPressurePage> {
showTitleActions: true, showTitleActions: true,
minTime: DateTime(DateTime.now().year - 1, 1, 1), minTime: DateTime(DateTime.now().year - 1, 1, 1),
maxTime: DateTime.now(), onConfirm: (date) { maxTime: DateTime.now(), onConfirm: (date) {
setState( setState(
() { () {
bloodSugarDate = date; bloodSugarDate = date;
},
);
}, },
currentTime: bloodSugarDate, );
locale: projectViewModel.localeType); }, currentTime: bloodSugarDate, locale: projectViewModel.localeType);
}, },
child: Container( child: Container(
padding: EdgeInsets.all(12), padding: EdgeInsets.all(12),
width: double.infinity, width: double.infinity,
height: 65, height: 65,
decoration: BoxDecoration( decoration: BoxDecoration(borderRadius: BorderRadius.circular(12), color: Colors.white),
borderRadius: BorderRadius.circular(12),
color: Colors.white),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
@ -213,30 +198,22 @@ class _AddBloodPressurePageState extends State<AddBloodPressurePage> {
), ),
InkWell( InkWell(
onTap: () { onTap: () {
DatePicker.showTimePicker(context, showTitleActions: true, DatePicker.showTimePicker(context, showTitleActions: true, onConfirm: (date) {
onConfirm: (date) { setState(
setState( () {
() { timeSugarDate = date;
timeSugarDate = date;
},
);
}, },
currentTime: timeSugarDate, );
locale: projectViewModel.localeType); }, currentTime: timeSugarDate, locale: projectViewModel.localeType);
}, },
child: Container( child: Container(
padding: EdgeInsets.all(12), padding: EdgeInsets.all(12),
width: double.infinity, width: double.infinity,
height: 65, height: 65,
decoration: BoxDecoration( decoration: BoxDecoration(borderRadius: BorderRadius.circular(12), color: Colors.white),
borderRadius: BorderRadius.circular(12),
color: Colors.white),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [Texts(TranslationBase.of(context).time), Texts(getTime())],
Texts(TranslationBase.of(context).time),
Texts(getTime())
],
), ),
), ),
), ),
@ -247,45 +224,45 @@ class _AddBloodPressurePageState extends State<AddBloodPressurePage> {
bottomSheet: Container( bottomSheet: Container(
color: Colors.transparent, color: Colors.transparent,
width: double.infinity, width: double.infinity,
height: MediaQuery.of(context).size.width * 0.2, height: MediaQuery.of(context).size.height * 0.10,
child: Padding( child: FractionallySizedBox(
padding: const EdgeInsets.all(15.0), widthFactor: 0.9,
child: SecondaryButton( child: Column(
loading: widget.model.state == ViewState.BusyLocal, children: [
label: TranslationBase.of(context).save.toUpperCase(), SecondaryButton(
textColor: Colors.white, loading: widget.model.state == ViewState.BusyLocal,
color: isButtonDisabled label: TranslationBase.of(context).save.toUpperCase(),
? Colors.grey[900] textColor: Colors.white,
: Colors.grey, color: isButtonDisabled ? Colors.grey[900] : Colors.grey,
onTap: () async { onTap: () async {
if (_bloodSystolicValueController.text.isNotEmpty && if (_bloodSystolicValueController.text.isNotEmpty &&
_bloodDiastolicValueController.text.isNotEmpty) { _bloodDiastolicValueController.text.isNotEmpty) {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
widget.model widget.model
.addORUpdateDiabtecResult( .addORUpdateDiabtecResult(
isUpdate: widget.isUpdate, isUpdate: widget.isUpdate,
bloodPressureDate: bloodPressureDate:
'${bloodSugarDate.year}-${bloodSugarDate.month}-${bloodSugarDate.day} ${timeSugarDate.hour}:${timeSugarDate.minute}:00', '${bloodSugarDate.year}-${bloodSugarDate.month}-${bloodSugarDate.day} ${timeSugarDate.hour}:${timeSugarDate.minute}:00',
diastolicPressure: diastolicPressure: _bloodDiastolicValueController.text.toString(),
_bloodDiastolicValueController.text.toString(), systolicePressure: _bloodSystolicValueController.text.toString(),
systolicePressure: measuredArm: measuredArm,
_bloodSystolicValueController.text.toString(), )
measuredArm: measuredArm, .then((value) {
) GifLoaderDialogUtils.hideDialog(context);
.then((value) { if (widget.model.state == ViewState.BusyLocal)
GifLoaderDialogUtils.hideDialog(context); AppToast.showErrorToast(message: widget.model.error);
if (widget.model.state == ViewState.BusyLocal) else
AppToast.showErrorToast(message: widget.model.error); Navigator.pop(context);
else ;
Navigator.pop(context); }).catchError((e) {
; GifLoaderDialogUtils.hideDialog(context);
}).catchError((e) { AppToast.showErrorToast(message: widget.model.error);
GifLoaderDialogUtils.hideDialog(context); });
AppToast.showErrorToast(message: widget.model.error); }
}); }),
} ],
}), ),
), ),
), ),
); );
@ -318,7 +295,7 @@ class _AddBloodPressurePageState extends State<AddBloodPressurePage> {
} }
void validateForm() { void validateForm() {
print("_bloodSystolicValueController "+_bloodSystolicValueController.text.length.toString()); print("_bloodSystolicValueController " + _bloodSystolicValueController.text.length.toString());
if (measureTimeSelectedType != 'Left Arm' && if (measureTimeSelectedType != 'Left Arm' &&
_bloodSystolicValueController.text.length > 0 && _bloodSystolicValueController.text.length > 0 &&
_bloodDiastolicValueController.text.length > 0) { _bloodDiastolicValueController.text.length > 0) {
@ -348,5 +325,4 @@ class _AddBloodPressurePageState extends State<AddBloodPressurePage> {
// }); // });
// } // }
} }
} }

@ -275,58 +275,62 @@ class _AddBloodSugarPageState extends State<AddBloodSugarPage> {
bottomSheet: Container( bottomSheet: Container(
color: Colors.transparent, color: Colors.transparent,
width: double.infinity, width: double.infinity,
height: MediaQuery.of(context).size.width * 0.2, height: MediaQuery.of(context).size.height * 0.10,
child: Padding( child: Column(
padding: const EdgeInsets.all(15.0), children: [
child: SecondaryButton( FractionallySizedBox(
label: TranslationBase.of(context).save.toUpperCase(), widthFactor: 0.9,
textColor: Colors.white, child: SecondaryButton(
color: isButtonDisabled ? Colors.grey[900] : Colors.grey, label: TranslationBase.of(context).save.toUpperCase(),
onTap: () async { textColor: Colors.white,
if (_bloodSugarValueController.text.isNotEmpty) { color: isButtonDisabled ? Colors.grey[900] : Colors.grey,
if (widget.isUpdate) { onTap: () async {
GifLoaderDialogUtils.showMyDialog(context); if (_bloodSugarValueController.text.isNotEmpty) {
await widget.bloodSugarViewMode if (widget.isUpdate) {
.updateDiabtecResult( GifLoaderDialogUtils.showMyDialog(context);
month: bloodSugarDate, await widget.bloodSugarViewMode
hour: timeSugarDate, .updateDiabtecResult(
diabtecUnit: measureUnitSelectedType, month: bloodSugarDate,
measuredTime: measuredTime, hour: timeSugarDate,
lineItemNo: widget.lineItemNo, diabtecUnit: measureUnitSelectedType,
bloodSugerResult: measuredTime: measuredTime,
_bloodSugarValueController.text.toString()); lineItemNo: widget.lineItemNo,
bloodSugerResult:
_bloodSugarValueController.text.toString());
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
if (widget.bloodSugarViewMode.state == if (widget.bloodSugarViewMode.state ==
ViewState.ErrorLocal) ViewState.ErrorLocal)
AppToast.showErrorToast( AppToast.showErrorToast(
message: widget.bloodSugarViewMode.error); message: widget.bloodSugarViewMode.error);
else else
Navigator.pop(context); Navigator.pop(context);
} else { } else {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
await widget.bloodSugarViewMode await widget.bloodSugarViewMode
.addDiabtecResult( .addDiabtecResult(
diabtecUnit: measureUnitSelectedType, diabtecUnit: measureUnitSelectedType,
measuredTime: measuredTime, measuredTime: measuredTime,
bloodSugerResult: bloodSugerResult:
_bloodSugarValueController.text.toString(), _bloodSugarValueController.text.toString(),
bloodSugerDateChart: bloodSugerDateChart:
'${bloodSugarDate.year}-${bloodSugarDate.month}-${bloodSugarDate.day} ${timeSugarDate.hour}:${timeSugarDate.minute}:00', '${bloodSugarDate.year}-${bloodSugarDate.month}-${bloodSugarDate.day} ${timeSugarDate.hour}:${timeSugarDate.minute}:00',
); );
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
if (widget.bloodSugarViewMode.state == ViewState.Error) if (widget.bloodSugarViewMode.state == ViewState.Error)
AppToast.showErrorToast( AppToast.showErrorToast(
message: widget.bloodSugarViewMode.error); message: widget.bloodSugarViewMode.error);
else else
Navigator.pop(context); Navigator.pop(context);
} }
} }
}), }),
),
],
), ),
), ),
); );

@ -158,19 +158,13 @@ class CurvedChartBloodPressure extends StatelessWidget {
), ),
leftTitles: SideTitles( leftTitles: SideTitles(
showTitles: true, showTitles: true,
interval:getMaxY() - getMinY() <=500?50:getMaxY() - getMinY() <=1000?100:200,
getTextStyles: (value) => const TextStyle( getTextStyles: (value) => const TextStyle(
color: Colors.black, color: Colors.black,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize: 10, fontSize: 10,
), ),
getTitles: (value) {
if (value.toInt() == 0)
return '${value.toInt()}';
else if (value.toInt() % horizontalInterval == 0)
return '${value.toInt()}';
else
return '';
},
margin: 12, margin: 12,
), ),
), ),

@ -10,11 +10,7 @@ class LineChartCurved extends StatelessWidget {
final int indexes; final int indexes;
final double horizontalInterval; final double horizontalInterval;
LineChartCurved( LineChartCurved({this.title, this.timeSeries, this.indexes, this.horizontalInterval = 20.0});
{this.title,
this.timeSeries,
this.indexes,
this.horizontalInterval = 20.0});
List<int> xAxixs = List(); List<int> xAxixs = List();
List<double> yAxixs = List(); List<double> yAxixs = List();
@ -40,8 +36,7 @@ class LineChartCurved extends StatelessWidget {
), ),
Text( Text(
title, title,
style: TextStyle( style: TextStyle(color: Colors.black, fontSize: 15, letterSpacing: 2),
color: Colors.black, fontSize: 15, letterSpacing: 2),
textAlign: TextAlign.center, textAlign: TextAlign.center,
), ),
SizedBox( SizedBox(
@ -49,8 +44,7 @@ class LineChartCurved extends StatelessWidget {
), ),
Expanded( Expanded(
child: Padding( child: Padding(
padding: const EdgeInsets.only( padding: const EdgeInsets.only(right: 18.0, left: 16.0, top: 15, bottom: 15),
right: 18.0, left: 16.0, top: 15, bottom: 15),
child: LineChart( child: LineChart(
sampleData1(context), sampleData1(context),
swapAnimationDuration: const Duration(milliseconds: 250), swapAnimationDuration: const Duration(milliseconds: 250),
@ -86,7 +80,6 @@ class LineChartCurved extends StatelessWidget {
} }
} }
} }
LineChartData sampleData1(context) { LineChartData sampleData1(context) {
return LineChartData( return LineChartData(
lineTouchData: LineTouchData( lineTouchData: LineTouchData(
@ -97,10 +90,7 @@ class LineChartCurved extends StatelessWidget {
handleBuiltInTouches: true, handleBuiltInTouches: true,
), ),
gridData: FlGridData( gridData: FlGridData(
horizontalInterval: horizontalInterval, horizontalInterval: horizontalInterval, show: true, drawVerticalLine: true, drawHorizontalLine: true),
show: true,
drawVerticalLine: true,
drawHorizontalLine: true),
titlesData: FlTitlesData( titlesData: FlTitlesData(
bottomTitles: SideTitles( bottomTitles: SideTitles(
showTitles: true, showTitles: true,
@ -131,26 +121,13 @@ class LineChartCurved extends StatelessWidget {
), ),
leftTitles: SideTitles( leftTitles: SideTitles(
showTitles: true, showTitles: true,
interval:getMaxY() - getMinY() <=500?50:getMaxY() - getMinY() <=1000?100:200,
getTextStyles: (value) => const TextStyle( getTextStyles: (value) => const TextStyle(
color: Colors.black, color: Colors.black,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize: 10, fontSize: 10,
), ),
getTitles: (value) {
// if (value.toInt() == 0)
// return '${value.toInt()}';
// else if (value.toInt() % horizontalInterval == 0)
// return '${value.toInt()}';
// else
// return '';
// if (value.toInt() == 0)
// return '${value.toInt()}';
// else if (value.toInt() % horizontalInterval == 0)
// return '${value.toInt()}';
// else
return '${value.toInt()}';//'${(value.toInt() +(horizontalInterval - value.toInt() % horizontalInterval) )}';
},
margin: 12, margin: 12,
), ),
), ),
@ -175,7 +152,7 @@ class LineChartCurved extends StatelessWidget {
minX: 0, minX: 0,
maxX: (timeSeries.length - 1).toDouble(), maxX: (timeSeries.length - 1).toDouble(),
maxY: getMaxY() + 0.3, maxY: getMaxY() + 0.3,
minY: getMinY(), minY: 0,//getMinY(),
lineBarsData: getData(context), lineBarsData: getData(context),
); );
} }
@ -203,6 +180,9 @@ class LineChartCurved extends StatelessWidget {
List<LineChartBarData> getData(context) { List<LineChartBarData> getData(context) {
List<FlSpot> spots = List(); List<FlSpot> spots = List();
if (timeSeries.length == 0) {
spots.add(FlSpot(0, 0));
}
for (int index = 0; index < timeSeries.length; index++) { for (int index = 0; index < timeSeries.length; index++) {
spots.add(FlSpot(index.toDouble(), timeSeries[index].sales)); spots.add(FlSpot(index.toDouble(), timeSeries[index].sales));
} }

@ -137,19 +137,21 @@ class MonthCurvedChartBloodPressure extends StatelessWidget {
), ),
leftTitles: SideTitles( leftTitles: SideTitles(
showTitles: true, showTitles: true,
interval:getMaxY() - getMinY() <=500?50:getMaxY() - getMinY() <=1000?100:200,
getTextStyles: (value) => const TextStyle( getTextStyles: (value) => const TextStyle(
color: Colors.black, color: Colors.black,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize: 10, fontSize: 10,
), ),
getTitles: (value) { // getTitles: (value) {
// if (value.toInt() == 0) // // if (value.toInt() == 0)
// return '${value.toInt()}'; // // return '${value.toInt()}';
// else if (value.toInt() % horizontalInterval == 0) // // else if (value.toInt() % horizontalInterval == 0)
// return '${value.toInt()}'; // // return '${value.toInt()}';
// else // // else
return '${value.toInt()}'; // return '${value.toInt()}';
}, // },
margin: 12, margin: 12,
), ),
), ),

@ -10,11 +10,7 @@ class MonthLineChartCurved extends StatelessWidget {
final int indexes; final int indexes;
final double horizontalInterval; final double horizontalInterval;
MonthLineChartCurved( MonthLineChartCurved({this.title, this.timeSeries, this.indexes, this.horizontalInterval = 15.0});
{this.title,
this.timeSeries,
this.indexes,
this.horizontalInterval = 15.0});
List<int> xAxixs = List(); List<int> xAxixs = List();
List<double> yAxixs = List(); List<double> yAxixs = List();
@ -40,8 +36,7 @@ class MonthLineChartCurved extends StatelessWidget {
), ),
Text( Text(
title, title,
style: TextStyle( style: TextStyle(color: Colors.black, fontSize: 15, letterSpacing: 2),
color: Colors.black, fontSize: 15, letterSpacing: 2),
textAlign: TextAlign.center, textAlign: TextAlign.center,
), ),
SizedBox( SizedBox(
@ -49,8 +44,7 @@ class MonthLineChartCurved extends StatelessWidget {
), ),
Expanded( Expanded(
child: Padding( child: Padding(
padding: const EdgeInsets.only( padding: const EdgeInsets.only(right: 18.0, left: 16.0, top: 15, bottom: 15),
right: 18.0, left: 16.0, top: 15, bottom: 15),
child: LineChart( child: LineChart(
sampleData1(context), sampleData1(context),
swapAnimationDuration: const Duration(milliseconds: 250), swapAnimationDuration: const Duration(milliseconds: 250),
@ -97,10 +91,7 @@ class MonthLineChartCurved extends StatelessWidget {
handleBuiltInTouches: true, handleBuiltInTouches: true,
), ),
gridData: FlGridData( gridData: FlGridData(
horizontalInterval: horizontalInterval, horizontalInterval: horizontalInterval, show: true, drawVerticalLine: true, drawHorizontalLine: true),
show: true,
drawVerticalLine: true,
drawHorizontalLine: true),
titlesData: FlTitlesData( titlesData: FlTitlesData(
bottomTitles: SideTitles( bottomTitles: SideTitles(
showTitles: true, showTitles: true,
@ -120,14 +111,16 @@ class MonthLineChartCurved extends StatelessWidget {
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize: 10, fontSize: 10,
), ),
getTitles: (value) { interval:getMaxY() - getMinY() <=500?50:getMaxY() - getMinY() <=1000?100:200,
if (value.toInt() == 0)
return '${value.toInt()}'; // getTitles: (value) {
else if (value.toInt() % horizontalInterval == 0) // if (value.toInt() == 0)
return '${value.toInt()}'; // return '${value.toInt()}';
else // else if (value.toInt() % horizontalInterval == 0)
return ''; // return '${value.toInt()}';
}, // else
// return '';
// },
margin: 12, margin: 12,
), ),
), ),
@ -180,6 +173,9 @@ class MonthLineChartCurved extends StatelessWidget {
List<LineChartBarData> getData(context) { List<LineChartBarData> getData(context) {
List<FlSpot> spots = List(); List<FlSpot> spots = List();
if (timeSeries.length == 0) {
spots.add(FlSpot(0, 0));
}
for (int index = 0; index < timeSeries.length; index++) { for (int index = 0; index < timeSeries.length; index++) {
spots.add(FlSpot(index.toDouble(), timeSeries[index].sales)); spots.add(FlSpot(index.toDouble(), timeSeries[index].sales));
} }

@ -55,44 +55,46 @@ class RadiologyDetailsPage extends StatelessWidget {
), ),
), ),
bottomSheet: (projectViewModel.havePrivilege(9) || bottomSheet: (projectViewModel.havePrivilege(9) ||
projectViewModel.havePrivilege(8)) projectViewModel.havePrivilege(8))
? Container( ? Container(
width: double.infinity, width: double.infinity,
height: finalRadiology.dIAPACSURL != "" height: finalRadiology.dIAPACSURL != ""
? MediaQuery.of(context).size.height * 0.25 ? MediaQuery.of(context).size.height * 0.25
: MediaQuery.of(context).size.height * 0.14, : MediaQuery.of(context).size.height * 0.14,
color: Colors.grey[100], color: Colors.grey[100],
child: Column( child: Column(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: <Widget>[ children: <Widget>[
Divider(), Divider(),
if (finalRadiology.dIAPACSURL != "" && projectViewModel.havePrivilege(9)) if (finalRadiology.dIAPACSURL != "" &&
Container( projectViewModel.havePrivilege(9))
width: MediaQuery.of(context).size.width * 0.8, Container(
child: Button( width: MediaQuery.of(context).size.width * 0.8,
onTap: () { child: Button(
launch(model.radImageURL); onTap: () {
}, launch(model.radImageURL);
label: TranslationBase.of(context).openRad, },
backgroundColor: Colors.grey[800], label: TranslationBase.of(context).openRad,
), backgroundColor: Colors.grey[800],
), ),
if (projectViewModel.havePrivilege(8)) ),
Container( if (projectViewModel.havePrivilege(8))
width: MediaQuery.of(context).size.width * 0.8, Container(
child: Button( width: MediaQuery.of(context).size.width * 0.8,
onTap: () { child: Button(
showConfirmMessage( onTap: () {
finalRadiology: finalRadiology, model: model); showConfirmMessage(
}, finalRadiology: finalRadiology, model: model);
label: TranslationBase.of(context).sendCopyRad, },
loading: model.state == ViewState.BusyLocal, label: TranslationBase.of(context).sendCopyRad,
backgroundColor: Theme.of(context).primaryColor, loading: model.state == ViewState.BusyLocal,
backgroundColor: Theme.of(context).primaryColor,
),
)
],
), ),
) )
], : Container()),
),
):Container()),
); );
} }

@ -60,23 +60,29 @@ class ReportListWidget extends StatelessWidget {
height: 12, height: 12,
), ),
Texts(reportList[index].projectName), Texts(reportList[index].projectName),
Texts(reportList[index].clinicDescription), Container(
//height: MediaQuery.of(context).size.height * 0.07,
width: MediaQuery.of(context).size.width * 0.35,
child: Texts(reportList[index].clinicDescription),
),
Texts(TranslationBase.of(context).invoiceNo + ': ${reportList[index].invoiceNo}'), Texts(TranslationBase.of(context).invoiceNo + ': ${reportList[index].invoiceNo}'),
SizedBox(height: 12), SizedBox(height: 12),
], ],
), ),
reportList[index].status == 2 reportList[index].status == 2
? Container( ? Expanded(
margin: EdgeInsets.only(left: 15.0, right: 15.0), child: Container(
child: InkWell( margin: EdgeInsets.only(left: 15.0, right: 15.0),
onTap: () { child: InkWell(
showConfirmMessage(reportList[index]); onTap: () {
// sendReportEmail(reportList[index]); showConfirmMessage(reportList[index]);
}, // sendReportEmail(reportList[index]);
child: Icon( },
Icons.email, child: Icon(
color: Theme.of(context).primaryColor, Icons.email,
size: 30.0, color: Theme.of(context).primaryColor,
size: 30.0,
),
), ),
), ),
) )

@ -134,21 +134,8 @@ class LineChartCurved extends StatelessWidget {
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize: 10, fontSize: 10,
), ),
getTitles: (value) { interval:getMaxY() - getMinY() <=500?getMaxY() - getMinY() <=50?10:50:getMaxY() - getMinY() <=1000?100:getMaxY() - getMinY()>=10000?5000:200,
if (timeSeries.length < 15) {
return '${value.toInt()}';
} else {
if (value == minY)
return '${value.toInt()}';
if (value == getMaxY())
return '${value.toInt()}';
//if (yAxixs.contains(value)) {
return '${value.toInt()}';
return '';
}
return '${value.toInt()}';
},
margin: 12, margin: 12,
), ),
), ),

@ -151,9 +151,8 @@ class LineChartCurvedBloodPressure extends StatelessWidget {
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize: 10, fontSize: 10,
), ),
getTitles: (value) { interval:getMaxY() - getMinY() <=500?50:getMaxY() - getMinY() <=1000?100:200,
return '${value.toInt()}';
},
margin: 12, margin: 12,
), ),
), ),

@ -163,7 +163,7 @@ class VitalSignDetailsScreen extends StatelessWidget {
des: TranslationBase.of(context).respirationRate, des: TranslationBase.of(context).respirationRate,
icon: DQIcons.outline, icon: DQIcons.outline,
lastVal: mode.respirationBeatPerMinute, lastVal: mode.respirationBeatPerMinute,
unit: TranslationBase.of(context).respirationSigns, unit: TranslationBase.of(context).bpm,
), ),
), ),
], ],

@ -78,7 +78,7 @@ class VitalSignItem extends StatelessWidget {
children: [ children: [
TextSpan(text: lastVal), TextSpan(text: lastVal),
TextSpan( TextSpan(
text: unit, text: " " + unit,
style: TextStyle( style: TextStyle(
color: HexColor('#B8382C'), color: HexColor('#B8382C'),
), ),

@ -1,23 +1,20 @@
import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/model/rate/appointment_details.dart'; import 'package:diplomaticquarterapp/core/model/rate/appointment_details.dart';
import 'package:diplomaticquarterapp/core/model/rate/appoitment_rated.dart';
import 'package:diplomaticquarterapp/core/viewModels/appointment_rate_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/appointment_rate_view_model.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/pages/landing/landing_page.dart'; import 'package:diplomaticquarterapp/pages/landing/landing_page.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/avatar/large_avatar.dart'; import 'package:diplomaticquarterapp/widgets/avatar/large_avatar.dart';
import 'package:diplomaticquarterapp/widgets/buttons/button.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/drawer/app_drawer_widget.dart'; import 'package:diplomaticquarterapp/widgets/drawer/app_drawer_widget.dart';
import 'package:diplomaticquarterapp/widgets/input/text_field.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:eva_icons_flutter/eva_icons_flutter.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart'; import 'package:hexcolor/hexcolor.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
class RateAppointmentClinic extends StatefulWidget { class RateAppointmentClinic extends StatefulWidget {
final AppointmentDetails appointmentDetails; final AppointmentDetails appointmentDetails;
@ -108,15 +105,21 @@ class _RateAppointmentClinicState extends State<RateAppointmentClinic> {
), ),
Texts( Texts(
model.appointmentDetails.projectName, model.appointmentDetails.projectName,
bold: true, fontSize: 22,
fontWeight: FontWeight.bold,
), ),
SizedBox( SizedBox(
height: 4, height: 4,
), ),
Texts( Texts(
model.appointmentDetails.clinicName, DateUtil.getMonthDayYearDateFormatted(
bold: true, DateUtil.convertStringToDate(
model.appointmentDetails.appointmentDate)),
), ),
SizedBox(
height: 8,
),
Texts(model.appointmentDetails.startTime),
SizedBox( SizedBox(
height: 8, height: 8,
) )

@ -116,7 +116,7 @@ class DoctorsListService extends BaseService {
"VersionID": req.VersionID, "VersionID": req.VersionID,
"Channel": req.Channel, "Channel": req.Channel,
"generalid": 'Cs2020@2016\$2958', "generalid": 'Cs2020@2016\$2958',
"PatientOutSA": authUser.outSA, "PatientOutSA": authProvider.isLogin ? authUser.outSA : false,
"TokenID": "", "TokenID": "",
"DeviceTypeID": req.DeviceTypeID, "DeviceTypeID": req.DeviceTypeID,
"SessionID": null, "SessionID": null,
@ -321,7 +321,7 @@ class DoctorsListService extends BaseService {
} }
Future<Map> insertAppointment(int docID, int clinicID, int projectID, Future<Map> insertAppointment(int docID, int clinicID, int projectID,
String selectedTime, String selectedDate, BuildContext context) async { String selectedTime, String selectedDate, BuildContext context, [String procedureID]) async {
Map<String, dynamic> request; Map<String, dynamic> request;
if (await this.sharedPref.getObject(USER_PROFILE) != null) { if (await this.sharedPref.getObject(USER_PROFILE) != null) {
@ -341,6 +341,7 @@ class DoctorsListService extends BaseService {
"StartTime": selectedTime, "StartTime": selectedTime,
"SelectedTime": selectedTime, "SelectedTime": selectedTime,
"EndTime": selectedTime, "EndTime": selectedTime,
"ProcedureID": procedureID,
"InitialSlotDuration": 0, "InitialSlotDuration": 0,
"StrAppointmentDate": selectedDate, "StrAppointmentDate": selectedDate,
"IsVirtual": false, "IsVirtual": false,

@ -117,8 +117,10 @@ class AuthProvider with ChangeNotifier {
var imei = await sharedPref.getString(PUSH_TOKEN); var imei = await sharedPref.getString(PUSH_TOKEN);
// if (!request.) { // if (!request.) {
newRequest.iMEI = imei; //imei!=null ? imei : ''; newRequest.iMEI = imei; //imei!=null ? imei : '';
newRequest.firstName = request.firstName??"" + " " + request.lastName??""; newRequest.firstName =
newRequest.firstNameN = request.firstNameN??"" + " " + request.lastNameN??""; request.firstName ?? "" + " " + request.lastName ?? "";
newRequest.firstNameN =
request.firstNameN ?? "" + " " + request.lastNameN ?? "";
newRequest.lastNameN = request.lastNameN ?? ""; newRequest.lastNameN = request.lastNameN ?? "";
newRequest.outSA = request.outSA == 1 ? true : false; newRequest.outSA = request.outSA == 1 ? true : false;
newRequest.biometricEnabled = false; newRequest.biometricEnabled = false;
@ -325,6 +327,7 @@ class AuthProvider with ChangeNotifier {
request['DeviceTypeID'] = DeviceTypeID; request['DeviceTypeID'] = DeviceTypeID;
request['LanguageID'] = LANGUAGE_ID; request['LanguageID'] = LANGUAGE_ID;
var requestN = RegisterUserRequest.fromJson(request); var requestN = RegisterUserRequest.fromJson(request);
requestN.patientOutSA = requestN.patientobject.patientOutSA;
// request.tokenID = ''; // request.tokenID = '';
dynamic localRes; dynamic localRes;
try { try {

@ -35,8 +35,7 @@ class ClinicListService extends BaseService {
dynamic localRes; dynamic localRes;
await baseAppClient.post(GET_CLINICS_LIST_URL, await baseAppClient.post(GET_CLINICS_LIST_URL, onSuccess: (response, statusCode) async {
onSuccess: (response, statusCode) async {
localRes = response; localRes = response;
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
throw error; throw error;
@ -54,7 +53,7 @@ class ClinicListService extends BaseService {
"VersionID": req.VersionID, "VersionID": req.VersionID,
"Channel": req.Channel, "Channel": req.Channel,
"generalid": 'Cs2020@2016\$2958', "generalid": 'Cs2020@2016\$2958',
"PatientOutSA": 0, "PatientOutSA": user.outSA,
"TokenID": "", "TokenID": "",
"IsActiveAppointment": true, "IsActiveAppointment": true,
"DeviceTypeID": req.DeviceTypeID, "DeviceTypeID": req.DeviceTypeID,
@ -65,12 +64,11 @@ class ClinicListService extends BaseService {
dynamic localRes; dynamic localRes;
await baseAppClient.post(GET_ACTIVE_APPOINTMENTS_LIST_URL, await baseAppClient.post(GET_ACTIVE_APPOINTMENTS_LIST_URL, onSuccess: (response, statusCode) async {
onSuccess: (response, statusCode) async { localRes = response;
localRes = response; }, onFailure: (String error, int statusCode) {
}, onFailure: (String error, int statusCode) { throw error;
throw error; }, body: request);
}, body: request);
return Future.value(localRes); return Future.value(localRes);
} }
@ -92,8 +90,7 @@ class ClinicListService extends BaseService {
dynamic localRes; dynamic localRes;
await baseAppClient.post(GET_PROJECTS_LIST, await baseAppClient.post(GET_PROJECTS_LIST, onSuccess: (response, statusCode) async {
onSuccess: (response, statusCode) async {
localRes = response; localRes = response;
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
throw error; throw error;
@ -101,15 +98,12 @@ class ClinicListService extends BaseService {
return Future.value(localRes); return Future.value(localRes);
} }
Future<Map> getChiefComplaintsList( Future<Map> getChiefComplaintsList(int clinicID, int projectID, BuildContext context, {doctorId}) async {
int clinicID, int projectID, BuildContext context,
{doctorId}) async {
//Utils.showProgressDialog(context); //Utils.showProgressDialog(context);
Map<String, dynamic> request; Map<String, dynamic> request;
if (await this.sharedPref.getObject(USER_PROFILE) != null) { if (await this.sharedPref.getObject(USER_PROFILE) != null) {
var data = AuthenticatedUser.fromJson( var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE));
await this.sharedPref.getObject(USER_PROFILE));
authUser = data; authUser = data;
} }
@ -137,8 +131,7 @@ class ClinicListService extends BaseService {
dynamic localRes; dynamic localRes;
await baseAppClient.post(GET_DOCTORS_LIST_URL, await baseAppClient.post(GET_DOCTORS_LIST_URL, onSuccess: (response, statusCode) async {
onSuccess: (response, statusCode) async {
localRes = response; localRes = response;
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
throw error; throw error;
@ -146,19 +139,15 @@ class ClinicListService extends BaseService {
return Future.value(localRes); return Future.value(localRes);
} }
Future<Map> getChiefComplaintDoctorList( Future<Map> getChiefComplaintDoctorList(int chiefComplaintID, int projectID, BuildContext context, {doctorId}) async {
int chiefComplaintID, int projectID, BuildContext context,
{doctorId}) async {
Map<String, dynamic> request; Map<String, dynamic> request;
if (await this.sharedPref.getObject(USER_PROFILE) != null) { if (await this.sharedPref.getObject(USER_PROFILE) != null) {
var data = AuthenticatedUser.fromJson( var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE));
await this.sharedPref.getObject(USER_PROFILE));
authUser = data; authUser = data;
} }
if (await this.sharedPref.getDouble(USER_LAT) != null && if (await this.sharedPref.getDouble(USER_LAT) != null && await this.sharedPref.getDouble(USER_LONG) != null) {
await this.sharedPref.getDouble(USER_LONG) != null) {
lat = await this.sharedPref.getDouble(USER_LAT); lat = await this.sharedPref.getDouble(USER_LAT);
long = await this.sharedPref.getDouble(USER_LONG); long = await this.sharedPref.getDouble(USER_LONG);
} }
@ -179,13 +168,12 @@ class ClinicListService extends BaseService {
"Latitude": lat.toString(), "Latitude": lat.toString(),
"Longitude": long.toString(), "Longitude": long.toString(),
"DeviceTypeID": req.DeviceTypeID, "DeviceTypeID": req.DeviceTypeID,
"IsPublicRequest" : true "IsPublicRequest": true
}; };
dynamic localRes; dynamic localRes;
await baseAppClient.post(GET_DENTAL_DOCTORS_LIST_URL, await baseAppClient.post(GET_DENTAL_DOCTORS_LIST_URL, onSuccess: (response, statusCode) async {
onSuccess: (response, statusCode) async {
localRes = response; localRes = response;
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
throw error; throw error;

@ -50,7 +50,43 @@ class CovidDriveThruService extends BaseService {
return Future.value(localRes); return Future.value(localRes);
} }
Future<Map> getCovidPaymentInformation(BuildContext context, int projectID) async { Future<Map> getCovidTestProceduresList(BuildContext context) async {
Map<String, dynamic> request;
if (await this.sharedPref.getObject(USER_PROFILE) != null) {
var data = AuthenticatedUser.fromJson(
await this.sharedPref.getObject(USER_PROFILE));
authUser = data;
}
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": "YckwoXhUmWBsnHKEKig",
"PatientID": authUser.patientID != null ? authUser.patientID : 0,
"License": true
};
dynamic localRes;
await baseAppClient.post(GET_COVID_DRIVETHRU_PROCEDURES_LIST,
onSuccess: (response, statusCode) async {
localRes = response;
}, onFailure: (String error, int statusCode) {
throw error;
}, body: request);
return Future.value(localRes);
}
Future<Map> getCovidPaymentInformation(BuildContext context, int projectID, String procedureID) async {
Map<String, dynamic> request; Map<String, dynamic> request;
if (await this.sharedPref.getObject(USER_PROFILE) != null) { if (await this.sharedPref.getObject(USER_PROFILE) != null) {
@ -65,6 +101,7 @@ class CovidDriveThruService extends BaseService {
"LanguageID": languageID == 'ar' ? 1 : 2, "LanguageID": languageID == 'ar' ? 1 : 2,
"IPAdress": "10.20.10.20", "IPAdress": "10.20.10.20",
"ProjectID": projectID, "ProjectID": projectID,
"ProcedureId": procedureID,
"VersionID": req.VersionID, "VersionID": req.VersionID,
"Channel": req.Channel, "Channel": req.Channel,
"generalid": 'Cs2020@2016\$2958', "generalid": 'Cs2020@2016\$2958',

@ -99,7 +99,7 @@ class PharmacyAddressService extends BaseService {
Map<String, dynamic> body = Map(); Map<String, dynamic> body = Map();
body["customer"] = customerObject; body["customer"] = customerObject;
await baseAppClient.post("$url", onSuccess: (response, statusCode) async { await baseAppClient.postPharmacy("$url", onSuccess: (response, statusCode) async {
addresses.clear(); addresses.clear();
response['customers'][0]['addresses'].forEach((item) { response['customers'][0]['addresses'].forEach((item) {
addresses.add(Addresses.fromJson(item)); addresses.add(Addresses.fromJson(item));

@ -76,7 +76,7 @@ class HMGNetworkConnectivity {
AlertDialogBox( AlertDialogBox(
context: context, context: context,
okText: translator.ok, okText: translator.ok,
message: message, confirmMessage: message,
okFunction: () { okFunction: () {
AlertDialogBox.closeAlertDialog(context); AlertDialogBox.closeAlertDialog(context);
}).showAlertDialog(context); }).showAlertDialog(context);

@ -4,7 +4,8 @@ import 'package:intl/intl.dart';
class DateUtil { class DateUtil {
/// convert String To Date function /// convert String To Date function
/// [date] String we want to convert /// [date] String we want to convert
static DateTime convertStringToDate(String date) { // /Date(1585774800000+0300)/ static DateTime convertStringToDate(String date) {
// /Date(1585774800000+0300)/
if (date != null) { if (date != null) {
const start = "/Date("; const start = "/Date(";
const end = "+0300)"; const end = "+0300)";
@ -241,6 +242,25 @@ class DateUtil {
} }
} }
static getWeekDayEnglish(int weekDay) {
switch (weekDay) {
case 1:
return "Monday";
case 2:
return "Tuesday";
case 3:
return "Wednesday";
case 4:
return "Thursday";
case 5:
return "Friday";
case 6:
return "Saturday ";
case 7:
return "Sunday";
}
}
/// get data formatted like Apr 26,2020 /// get data formatted like Apr 26,2020
/// [dateTime] convert DateTime to data formatted /// [dateTime] convert DateTime to data formatted
static String getMonthDayYearDateFormatted(DateTime dateTime) { static String getMonthDayYearDateFormatted(DateTime dateTime) {
@ -253,6 +273,7 @@ class DateUtil {
else else
return ""; return "";
} }
/// get data formatted like Apr 26,2020 /// get data formatted like Apr 26,2020
/// [dateTime] convert DateTime to data formatted Arabic /// [dateTime] convert DateTime to data formatted Arabic
static String getMonthDayYearDateFormattedAr(DateTime dateTime) { static String getMonthDayYearDateFormattedAr(DateTime dateTime) {
@ -270,9 +291,12 @@ class DateUtil {
/// [dateTime] convert DateTime to date formatted /// [dateTime] convert DateTime to date formatted
static String getWeekDayMonthDayYearDateFormatted( static String getWeekDayMonthDayYearDateFormatted(
DateTime dateTime, String lang) { DateTime dateTime, String lang) {
// print(dateTime);
// print(dateTime.weekday);
// print(dateTime.weekday.getDayOfWeekEnumValue.value);
if (dateTime != null) if (dateTime != null)
return lang == 'en' return lang == 'en'
? getDay(dateTime.weekday.getDayOfWeekEnumValue) + ? getWeekDayEnglish(dateTime.weekday) +
", " + ", " +
getMonth(dateTime.month) + getMonth(dateTime.month) +
" " + " " +
@ -357,9 +381,8 @@ class DateUtil {
return ""; return "";
} }
static String getFormattedDate(DateTime dateTime, String formattedString){ static String getFormattedDate(DateTime dateTime, String formattedString) {
return DateFormat(formattedString) return DateFormat(formattedString).format(dateTime);
.format(dateTime);
} }
static convertISODateToJsonDate(String isoDate) { static convertISODateToJsonDate(String isoDate) {

@ -471,8 +471,10 @@ class TranslationBase {
String get medicalProfile => String get medicalProfile =>
localizedValues['medicalProfile'][locale.languageCode]; localizedValues['medicalProfile'][locale.languageCode];
String get parking => localizedValues['parking'][locale.languageCode]; String get parking => localizedValues['parking'][locale.languageCode];
String get parkingDescription => localizedValues['parkingDescription'][locale.languageCode]; String get parkingDescription =>
String get checkinOptions => localizedValues['checkinOption'][locale.languageCode]; localizedValues['parkingDescription'][locale.languageCode];
String get checkinOptions =>
localizedValues['checkinOption'][locale.languageCode];
String get alhabiServices => String get alhabiServices =>
localizedValues['alhabiServices'][locale.languageCode]; localizedValues['alhabiServices'][locale.languageCode];
String get parkingTitle => String get parkingTitle =>
@ -1130,6 +1132,8 @@ class TranslationBase {
localizedValues['RRT-transport-heading'][locale.languageCode]; localizedValues['RRT-transport-heading'][locale.languageCode];
String get directionHeading => String get directionHeading =>
localizedValues['RRT-direction-heading'][locale.languageCode]; localizedValues['RRT-direction-heading'][locale.languageCode];
String get wayHeading =>
localizedValues['RRT-way-heading'][locale.languageCode];
String get toHospital => localizedValues['to-hospital'][locale.languageCode]; String get toHospital => localizedValues['to-hospital'][locale.languageCode];
String get fromHospital => String get fromHospital =>
localizedValues['from-hospital'][locale.languageCode]; localizedValues['from-hospital'][locale.languageCode];
@ -1634,6 +1638,9 @@ class TranslationBase {
String get insuranceID => String get insuranceID =>
localizedValues["insurance-id"][locale.languageCode]; localizedValues["insurance-id"][locale.languageCode];
String get enterFile => localizedValues["enter-file"][locale.languageCode]; String get enterFile => localizedValues["enter-file"][locale.languageCode];
String get feedbackType =>
localizedValues["feedback-type"][locale.languageCode];
String get allow => localizedValues["allow"][locale.languageCode]; String get allow => localizedValues["allow"][locale.languageCode];
String get reject => localizedValues["reject"][locale.languageCode]; String get reject => localizedValues["reject"][locale.languageCode];
String get enterReferralRequesterName => String get enterReferralRequesterName =>
@ -1645,6 +1652,8 @@ class TranslationBase {
String get newReferral => localizedValues["newReferral"][locale.languageCode]; String get newReferral => localizedValues["newReferral"][locale.languageCode];
String get searchForReferrals => String get searchForReferrals =>
localizedValues["searchForReferrals"][locale.languageCode]; localizedValues["searchForReferrals"][locale.languageCode];
String get covidSelectProcedure =>
localizedValues["covid-select-procedure"][locale.languageCode];
String get onlineConsultation => String get onlineConsultation =>
localizedValues["online-consultation"][locale.languageCode]; localizedValues["online-consultation"][locale.languageCode];
String get expectedWaiting => String get expectedWaiting =>
@ -1659,7 +1668,11 @@ class TranslationBase {
localizedValues["upcoming-pay-options"][locale.languageCode]; localizedValues["upcoming-pay-options"][locale.languageCode];
String get pleaseAcceptTerms => String get pleaseAcceptTerms =>
localizedValues["please-accept-terms"][locale.languageCode]; localizedValues["please-accept-terms"][locale.languageCode];
String get type => localizedValues["type"][locale.languageCode];
String get eReferralInfo =>
localizedValues["info-ereferral"][locale.languageCode];
String get erConsultation =>
localizedValues["er-consultation"][locale.languageCode];
} }
class TranslationBaseDelegate extends LocalizationsDelegate<TranslationBase> { class TranslationBaseDelegate extends LocalizationsDelegate<TranslationBase> {

@ -61,10 +61,8 @@ class Utils {
/// Check The Internet Connection /// Check The Internet Connection
static Future<bool> checkConnection() async { static Future<bool> checkConnection() async {
ConnectivityResult connectivityResult = ConnectivityResult connectivityResult = await (Connectivity().checkConnectivity());
await (Connectivity().checkConnectivity()); if ((connectivityResult == ConnectivityResult.mobile) || (connectivityResult == ConnectivityResult.wifi)) {
if ((connectivityResult == ConnectivityResult.mobile) ||
(connectivityResult == ConnectivityResult.wifi)) {
return true; return true;
} else { } else {
return false; return false;
@ -128,19 +126,11 @@ class Utils {
} }
static String getAppointmentTransID(int projectID, int clinicID, int appoNo) { static String getAppointmentTransID(int projectID, int clinicID, int appoNo) {
return projectID.toString() + return projectID.toString() + '-' + clinicID.toString() + '-' + appoNo.toString();
'-' +
clinicID.toString() +
'-' +
appoNo.toString();
} }
static String getAdvancePaymentTransID(int projectID, int fileNumber) { static String getAdvancePaymentTransID(int projectID, int fileNumber) {
return projectID.toString() + return projectID.toString() + '-' + fileNumber.toString() + '-' + DateTime.now().millisecondsSinceEpoch.toString();
'-' +
fileNumber.toString() +
'-' +
DateTime.now().millisecondsSinceEpoch.toString();
} }
bool validateIDBox(String value, type) { bool validateIDBox(String value, type) {
@ -151,7 +141,7 @@ class Utils {
} }
String loginIDPattern(loginType) { String loginIDPattern(loginType) {
var length = loginType == 1 ? 10 : 7; var length = loginType == 1 ? 10 : 6;
return "([0-9]{" + length.toString() + "})"; return "([0-9]{" + length.toString() + "})";
} }
@ -198,22 +188,14 @@ class Utils {
} }
static validEmail(email) { static validEmail(email) {
return RegExp( return RegExp(r"^[a-zA-Z0-9.a-zA-Z0-9.!#$%&'*+-/=?^_`{|}~]+@[a-zA-Z0-9]+\.[a-zA-Z]+").hasMatch(email);
r"^[a-zA-Z0-9.a-zA-Z0-9.!#$%&'*+-/=?^_`{|}~]+@[a-zA-Z0-9]+\.[a-zA-Z]+")
.hasMatch(email);
} }
static List<Widget> myMedicalList( static List<Widget> myMedicalList({ProjectViewModel projectViewModel, BuildContext context, bool isLogin, count}) {
{ProjectViewModel projectViewModel,
BuildContext context,
bool isLogin,
count}) {
List<Widget> medical = List(); List<Widget> medical = List();
medical.add(InkWell( medical.add(InkWell(
onTap: () => projectViewModel.havePrivilege(5) onTap: () => projectViewModel.havePrivilege(5) ? Navigator.push(context, FadePage(page: MyAppointments())) : null,
? Navigator.push(context, FadePage(page: MyAppointments()))
: null,
child: isLogin child: isLogin
? Stack(children: [ ? Stack(children: [
MedicalProfileItem( MedicalProfileItem(
@ -232,8 +214,7 @@ class Utils {
borderRadius: BorderRadius.circular(8), borderRadius: BorderRadius.circular(8),
badgeContent: Container( badgeContent: Container(
padding: EdgeInsets.all(2.0), padding: EdgeInsets.all(2.0),
child: Text(count.toString(), child: Text(count.toString(), style: TextStyle(color: Colors.white, fontSize: 16.0)),
style: TextStyle(color: Colors.white, fontSize: 16.0)),
), ),
), ),
), ),
@ -246,7 +227,6 @@ class Utils {
isEnable: projectViewModel.havePrivilege(5), isEnable: projectViewModel.havePrivilege(5),
), ),
)); ));
if (projectViewModel.havePrivilege(10)) { if (projectViewModel.havePrivilege(10)) {
medical.add(InkWell( medical.add(InkWell(
onTap: () => Navigator.push(context, FadePage(page: LabsHomePage())), onTap: () => Navigator.push(context, FadePage(page: LabsHomePage())),
@ -259,9 +239,8 @@ class Utils {
} }
medical.add(InkWell( medical.add(InkWell(
onTap: () => projectViewModel.havePrivilege(7) onTap: () =>
? Navigator.push(context, FadePage(page: RadiologyHomePage())) projectViewModel.havePrivilege(7) ? Navigator.push(context, FadePage(page: RadiologyHomePage())) : null,
: null,
child: MedicalProfileItem( child: MedicalProfileItem(
title: TranslationBase.of(context).radiology, title: TranslationBase.of(context).radiology,
imagePath: 'radiology_icon.png', imagePath: 'radiology_icon.png',
@ -271,9 +250,8 @@ class Utils {
)); ));
medical.add(InkWell( medical.add(InkWell(
onTap: () => projectViewModel.havePrivilege(12) onTap: () =>
? Navigator.push(context, FadePage(page: HomePrescriptionsPage())) projectViewModel.havePrivilege(12) ? Navigator.push(context, FadePage(page: HomePrescriptionsPage())) : null,
: null,
child: MedicalProfileItem( child: MedicalProfileItem(
title: TranslationBase.of(context).medicines, title: TranslationBase.of(context).medicines,
imagePath: 'prescription_icon.png', imagePath: 'prescription_icon.png',
@ -298,9 +276,8 @@ class Utils {
)); ));
medical.add(InkWell( medical.add(InkWell(
onTap: () => projectViewModel.havePrivilege(48) onTap: () =>
? Navigator.push(context, FadePage(page: ActiveMedicationsPage())) projectViewModel.havePrivilege(48) ? Navigator.push(context, FadePage(page: ActiveMedicationsPage())) : null,
: null,
child: MedicalProfileItem( child: MedicalProfileItem(
title: TranslationBase.of(context).myMedical, title: TranslationBase.of(context).myMedical,
imagePath: 'active_medications.png', imagePath: 'active_medications.png',
@ -326,9 +303,8 @@ class Utils {
)); ));
medical.add(InkWell( medical.add(InkWell(
onTap: () => projectViewModel.havePrivilege(14) onTap: () =>
? Navigator.push(context, FadePage(page: EyeMeasurementsPage())) projectViewModel.havePrivilege(14) ? Navigator.push(context, FadePage(page: EyeMeasurementsPage())) : null,
: null,
child: MedicalProfileItem( child: MedicalProfileItem(
title: TranslationBase.of(context).eye, title: TranslationBase.of(context).eye,
imagePath: 'eye_measurement_icon.png', imagePath: 'eye_measurement_icon.png',
@ -338,9 +314,7 @@ class Utils {
)); ));
medical.add(InkWell( medical.add(InkWell(
onTap: () => projectViewModel.havePrivilege(22) onTap: () => projectViewModel.havePrivilege(22) ? Navigator.push(context, FadePage(page: InsuranceCard())) : null,
? Navigator.push(context, FadePage(page: InsuranceCard()))
: null,
child: MedicalProfileItem( child: MedicalProfileItem(
title: TranslationBase.of(context).insurance, title: TranslationBase.of(context).insurance,
imagePath: 'insurance_card_icon.png', imagePath: 'insurance_card_icon.png',
@ -361,9 +335,8 @@ class Utils {
)); ));
medical.add(InkWell( medical.add(InkWell(
onTap: () => projectViewModel.havePrivilege(18) onTap: () =>
? Navigator.push(context, FadePage(page: InsuranceApproval())) projectViewModel.havePrivilege(18) ? Navigator.push(context, FadePage(page: InsuranceApproval())) : null,
: null,
child: MedicalProfileItem( child: MedicalProfileItem(
title: TranslationBase.of(context).insuranceApproval, title: TranslationBase.of(context).insuranceApproval,
imagePath: 'insurance_approvals_icon.png', imagePath: 'insurance_approvals_icon.png',
@ -373,9 +346,7 @@ class Utils {
)); ));
medical.add(InkWell( medical.add(InkWell(
onTap: () => projectViewModel.havePrivilege(23) onTap: () => projectViewModel.havePrivilege(23) ? Navigator.push(context, FadePage(page: AllergiesPage())) : null,
? Navigator.push(context, FadePage(page: AllergiesPage()))
: null,
child: MedicalProfileItem( child: MedicalProfileItem(
title: TranslationBase.of(context).allergies, title: TranslationBase.of(context).allergies,
imagePath: 'my_allergies_icon.png', imagePath: 'my_allergies_icon.png',
@ -385,9 +356,7 @@ class Utils {
)); ));
medical.add(InkWell( medical.add(InkWell(
onTap: () => projectViewModel.havePrivilege(26) onTap: () => projectViewModel.havePrivilege(26) ? Navigator.push(context, FadePage(page: MyVaccines())) : null,
? Navigator.push(context, FadePage(page: MyVaccines()))
: null,
child: MedicalProfileItem( child: MedicalProfileItem(
title: TranslationBase.of(context).myVaccines, title: TranslationBase.of(context).myVaccines,
imagePath: 'my_vaccines_icon.png', imagePath: 'my_vaccines_icon.png',
@ -397,9 +366,8 @@ class Utils {
)); ));
medical.add(InkWell( medical.add(InkWell(
onTap: () => projectViewModel.havePrivilege(20) onTap: () =>
? Navigator.push(context, FadePage(page: HomeReportPage())) projectViewModel.havePrivilege(20) ? Navigator.push(context, FadePage(page: HomeReportPage())) : null,
: null,
child: MedicalProfileItem( child: MedicalProfileItem(
title: TranslationBase.of(context).medical, title: TranslationBase.of(context).medical,
imagePath: 'medical_reports_icon.png', imagePath: 'medical_reports_icon.png',
@ -409,9 +377,8 @@ class Utils {
)); ));
medical.add(InkWell( medical.add(InkWell(
onTap: () => projectViewModel.havePrivilege(19) onTap: () =>
? Navigator.push(context, FadePage(page: MonthlyReportsPage())) projectViewModel.havePrivilege(19) ? Navigator.push(context, FadePage(page: MonthlyReportsPage())) : null,
: null,
child: MedicalProfileItem( child: MedicalProfileItem(
title: TranslationBase.of(context).monthly, title: TranslationBase.of(context).monthly,
imagePath: 'monthly_reports_icon.png', imagePath: 'monthly_reports_icon.png',
@ -421,9 +388,8 @@ class Utils {
)); ));
medical.add(InkWell( medical.add(InkWell(
onTap: () => projectViewModel.havePrivilege(16) onTap: () =>
? Navigator.push(context, FadePage(page: PatientSickLeavePage())) projectViewModel.havePrivilege(16) ? Navigator.push(context, FadePage(page: PatientSickLeavePage())) : null,
: null,
child: MedicalProfileItem( child: MedicalProfileItem(
title: TranslationBase.of(context).sick, title: TranslationBase.of(context).sick,
imagePath: 'sick_leaves_icons.png', imagePath: 'sick_leaves_icons.png',
@ -433,9 +399,7 @@ class Utils {
)); ));
medical.add(InkWell( medical.add(InkWell(
onTap: () => projectViewModel.havePrivilege(47) onTap: () => projectViewModel.havePrivilege(47) ? Navigator.push(context, FadePage(page: MyBalancePage())) : null,
? Navigator.push(context, FadePage(page: MyBalancePage()))
: null,
child: MedicalProfileItem( child: MedicalProfileItem(
title: TranslationBase.of(context).myBalance, title: TranslationBase.of(context).myBalance,
imagePath: 'check-in.png', imagePath: 'check-in.png',
@ -453,9 +417,7 @@ class Utils {
)); ));
medical.add(InkWell( medical.add(InkWell(
onTap: () => projectViewModel.havePrivilege(24) onTap: () => projectViewModel.havePrivilege(24) ? Navigator.push(context, FadePage(page: MyTrackers())) : null,
? Navigator.push(context, FadePage(page: MyTrackers()))
: null,
child: MedicalProfileItem( child: MedicalProfileItem(
title: TranslationBase.of(context).myTrackers, title: TranslationBase.of(context).myTrackers,
imagePath: 'my_tracker_icon.png', imagePath: 'my_tracker_icon.png',
@ -465,9 +427,8 @@ class Utils {
)); ));
medical.add(InkWell( medical.add(InkWell(
onTap: () => projectViewModel.havePrivilege(30) onTap: () =>
? Navigator.push(context, FadePage(page: SmartWatchInstructions())) projectViewModel.havePrivilege(30) ? Navigator.push(context, FadePage(page: SmartWatchInstructions())) : null,
: null,
child: MedicalProfileItem( child: MedicalProfileItem(
title: TranslationBase.of(context).smartWatches, title: TranslationBase.of(context).smartWatches,
imagePath: 'smartwatch_icon.png', imagePath: 'smartwatch_icon.png',
@ -477,9 +438,8 @@ class Utils {
)); ));
medical.add(InkWell( medical.add(InkWell(
onTap: () => projectViewModel.havePrivilege(28) onTap: () =>
? Navigator.push(context, FadePage(page: AskDoctorHomPage())) projectViewModel.havePrivilege(28) ? Navigator.push(context, FadePage(page: AskDoctorHomPage())) : null,
: null,
child: MedicalProfileItem( child: MedicalProfileItem(
title: TranslationBase.of(context).askYour, title: TranslationBase.of(context).askYour,
imagePath: 'ask_doctor_icon.png', imagePath: 'ask_doctor_icon.png',
@ -501,8 +461,7 @@ class Utils {
} else { } else {
AlertDialogBox( AlertDialogBox(
context: context, context: context,
message: confirmMessage: "Please login with your account first to use this feature",
"Please login with your account first to use this feature",
okText: "OK", okText: "OK",
okFunction: () { okFunction: () {
AlertDialogBox.closeAlertDialog(context); AlertDialogBox.closeAlertDialog(context);
@ -519,9 +478,7 @@ class Utils {
} }
medical.add(InkWell( medical.add(InkWell(
onTap: () => projectViewModel.havePrivilege(40) onTap: () => projectViewModel.havePrivilege(40) ? launch('whatsapp://send?phone=18885521858&text=') : null,
? launch('whatsapp://send?phone=18885521858&text=')
: null,
child: MedicalProfileItem( child: MedicalProfileItem(
title: TranslationBase.of(context).chatbot, title: TranslationBase.of(context).chatbot,
imagePath: 'insurance_approvals_icon.png', imagePath: 'insurance_approvals_icon.png',
@ -533,14 +490,12 @@ class Utils {
return medical; return medical;
} }
static Widget loadNetworkImage( static Widget loadNetworkImage({@required String url, BoxFit fitting = BoxFit.cover}) {
{@required String url, BoxFit fitting = BoxFit.cover}) {
return CachedNetworkImage( return CachedNetworkImage(
placeholderFadeInDuration: Duration(milliseconds: 250), placeholderFadeInDuration: Duration(milliseconds: 250),
fit: fitting, fit: fitting,
imageUrl: url, imageUrl: url,
placeholder: (context, url) => placeholder: (context, url) => Container(child: Center(child: CircularProgressIndicator())),
Container(child: Center(child: CircularProgressIndicator())),
errorWidget: (context, url, error) { errorWidget: (context, url, error) {
return Icon( return Icon(
Icons.error, Icons.error,
@ -549,6 +504,13 @@ class Utils {
); );
}); });
} }
static bool route(Route route, {@required Type equalsTo}){
if((route is FadePage)){
return route.page.runtimeType == equalsTo;
}
return route.runtimeType == equalsTo;
}
} }
Widget applyShadow( Widget applyShadow(
@ -574,8 +536,7 @@ Widget applyShadow(
} }
Future<AuthenticatedUser> userData() async { Future<AuthenticatedUser> userData() async {
var userData = AuthenticatedUser.fromJson( var userData = AuthenticatedUser.fromJson(await AppSharedPreferences().getObject(MAIN_USER));
await AppSharedPreferences().getObject(MAIN_USER));
return userData; return userData;
} }
@ -589,12 +550,9 @@ extension IndexedIterable<E> on Iterable<E> {
openAppStore({String androidPackageName, String iOSAppID}) async { openAppStore({String androidPackageName, String iOSAppID}) async {
if (Platform.isAndroid) { if (Platform.isAndroid) {
assert(!(androidPackageName == null), assert(!(androidPackageName == null), "Should have valid value in androidPackageName parameter");
"Should have valid value in androidPackageName parameter"); if ((await FlutterHmsGmsAvailability.isGmsAvailable)) launch("market://details?id=com.ejada.hmg");
if ((await FlutterHmsGmsAvailability.isGmsAvailable)) if ((await FlutterHmsGmsAvailability.isHmsAvailable)) launch("appmarket://details?id=com.ejada.hmg");
launch("market://details?id=com.ejada.hmg");
if ((await FlutterHmsGmsAvailability.isHmsAvailable))
launch("appmarket://details?id=com.ejada.hmg");
} else if (Platform.isIOS) { } else if (Platform.isIOS) {
assert((iOSAppID == null), "Should have valid value in iOSAppID parameter"); assert((iOSAppID == null), "Should have valid value in iOSAppID parameter");
launch("https://itunes.apple.com/kr/app/apple-store/$iOSAppID)"); launch("https://itunes.apple.com/kr/app/apple-store/$iOSAppID)");

@ -22,7 +22,9 @@ class BottomNavBar extends StatefulWidget {
final ValueChanged<int> changeIndex; final ValueChanged<int> changeIndex;
final int index; final int index;
final bool showHomeIcon; final bool showHomeIcon;
BottomNavBar({Key key, this.changeIndex, this.index, this.showHomeIcon = false}) : super(key: key); BottomNavBar(
{Key key, this.changeIndex, this.index, this.showHomeIcon = false})
: super(key: key);
@override @override
_BottomNavBarState createState() => _BottomNavBarState(); _BottomNavBarState createState() => _BottomNavBarState();
@ -75,7 +77,7 @@ class _BottomNavBarState extends State<BottomNavBar> {
Expanded( Expanded(
child: (widget.showHomeIcon) child: (widget.showHomeIcon)
? SizedBox( ? SizedBox(
child: BottomNavigationItem( child: BottomNavigationItem(
icon: Icons.home_outlined, icon: Icons.home_outlined,
activeIcon: Icons.home_outlined, activeIcon: Icons.home_outlined,
changeIndex: _changeIndex, changeIndex: _changeIndex,
@ -83,7 +85,7 @@ class _BottomNavBarState extends State<BottomNavBar> {
currentIndex: 2, currentIndex: 2,
name: TranslationBase.of(context).home, name: TranslationBase.of(context).home,
), ),
) )
: SizedBox( : SizedBox(
height: 50, height: 50,
child: Column( child: Column(
@ -104,15 +106,16 @@ class _BottomNavBarState extends State<BottomNavBar> {
currentIndex: 0, currentIndex: 0,
name: TranslationBase.of(context).home, name: TranslationBase.of(context).home,
), ),
// BottomNavigationItem( // BottomNavigationItem(
// icon: EvaIcons.calendar, // icon: EvaIcons.calendar,
// activeIcon: EvaIcons.calendar, // activeIcon: EvaIcons.calendar,
// changeIndex: _changeIndex, // changeIndex: _changeIndex,
// index: _index, // index: _index,
// currentIndex: 2, // currentIndex: 2,
// name: TranslationBase.of(context).bookAppo, // name: TranslationBase.of(context).bookAppo,
// ), // ),
if (/*widget.index == 0 && */projectViewModel.havePrivilege(34)) if (/*widget.index == 0 && */ projectViewModel
.havePrivilege(34))
BottomNavigationItem( BottomNavigationItem(
icon: EvaIcons.calendar, icon: EvaIcons.calendar,
activeIcon: EvaIcons.calendar, activeIcon: EvaIcons.calendar,

@ -241,7 +241,7 @@ class _SecondaryButtonState extends State<SecondaryButton>
widget.label, widget.label,
style: TextStyle( style: TextStyle(
color: widget.textColor, color: widget.textColor,
fontSize: widget.small ? 12.0 : 15.0, fontSize: widget.small ? 12.0 : 14.0,
// fontWeight: FontWeight.w800, // fontWeight: FontWeight.w800,
fontFamily: projectViewModel.isArabic fontFamily: projectViewModel.isArabic
? 'Cairo' ? 'Cairo'

@ -6,14 +6,14 @@ class AlertDialogBox {
final BuildContext context; final BuildContext context;
final title; final title;
final message; final confirmMessage;
final okText; final okText;
final Function okFunction; final Function okFunction;
AlertDialogBox( AlertDialogBox(
{@required this.context, {@required this.context,
this.title, this.title,
@required this.message, @required this.confirmMessage,
@required this.okText, @required this.okText,
@required this.okFunction}); @required this.okFunction});
@ -26,7 +26,7 @@ class AlertDialogBox {
// set up the AlertDialog // set up the AlertDialog
AlertDialog alert = AlertDialog( AlertDialog alert = AlertDialog(
title: Text(title ?? TranslationBase.of(context).confirm), title: Text(title ?? TranslationBase.of(context).confirm),
content: Text(this.message), content: Text(this.confirmMessage),
actions: [ actions: [
continueButton, continueButton,
], ],

@ -504,7 +504,9 @@ class _AppDrawerState extends State<AppDrawer> {
await authenticatedUserObject.getUser(); await authenticatedUserObject.getUser();
_vitalSignService.heightCm = ""; _vitalSignService.heightCm = "";
_vitalSignService.weightKg = ""; _vitalSignService.weightKg = "";
var appLanguage = await sharedPref.getString(APP_LANGUAGE);
await sharedPref.clear(); await sharedPref.clear();
await sharedPref.setString(APP_LANGUAGE, appLanguage);
this.user = null; this.user = null;
Navigator.of(context).pushNamed(HOME); Navigator.of(context).pushNamed(HOME);
// projectProvider.platformBridge().unRegisterHmgGeofences(); // projectProvider.platformBridge().unRegisterHmgGeofences();

@ -12,26 +12,28 @@ import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart'; import 'package:flutter/widgets.dart';
import 'package:flutter_inappwebview/flutter_inappwebview.dart'; import 'package:flutter_inappwebview/flutter_inappwebview.dart';
enum _PAYMENT_TYPE{PACKAGES, PHARMACY, PATIENT} enum _PAYMENT_TYPE { PACKAGES, PHARMACY, PATIENT }
var _InAppBrowserOptions = InAppBrowserClassOptions( var _InAppBrowserOptions = InAppBrowserClassOptions(
inAppWebViewGroupOptions: InAppWebViewGroupOptions(crossPlatform: InAppWebViewOptions(useShouldOverrideUrlLoading: true)), inAppWebViewGroupOptions: InAppWebViewGroupOptions(
crossPlatform: InAppWebViewOptions(useShouldOverrideUrlLoading: true)),
crossPlatform: InAppBrowserOptions(hideUrlBar: true), crossPlatform: InAppBrowserOptions(hideUrlBar: true),
ios: IOSInAppBrowserOptions(toolbarBottom: false,) ios: IOSInAppBrowserOptions(
); toolbarBottom: false,
));
class MyInAppBrowser extends InAppBrowser { class MyInAppBrowser extends InAppBrowser {
_PAYMENT_TYPE paymentType; _PAYMENT_TYPE paymentType;
static String SERVICE_URL =
'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort Payment Gateway URL UAT
// static String SERVICE_URL = // static String SERVICE_URL =
// 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL LIVE // 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort Payment Gateway URL UAT
static String PREAUTH_SERVICE_URL = static String SERVICE_URL =
'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort PreAuth Payment Gateway URL UAT 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL LIVE
// static String PREAUTH_SERVICE_URL = // static String PREAUTH_SERVICE_URL =
// 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort PreAuth Payment Gateway URL Live Store // 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort PreAuth Payment Gateway URL UAT
static String PREAUTH_SERVICE_URL =
'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort PreAuth Payment Gateway URL Live Store
// static String PRESCRIPTION_PAYMENT_WITH_ORDERID = // static String PRESCRIPTION_PAYMENT_WITH_ORDERID =
// 'https://uat.hmgwebservices.com/epharmacy/checkout/OpcCompleteRedirectionPaymentClientbyOrder?orderID='; // 'https://uat.hmgwebservices.com/epharmacy/checkout/OpcCompleteRedirectionPaymentClientbyOrder?orderID=';
@ -40,9 +42,12 @@ class MyInAppBrowser extends InAppBrowser {
'https://mdlaboratories.com/exacartapi/checkout/OpcCompleteRedirectionPaymentClientbyOrder?orderID='; //Live 'https://mdlaboratories.com/exacartapi/checkout/OpcCompleteRedirectionPaymentClientbyOrder?orderID='; //Live
// Packages // Packages
static String PACKAGES_REQUEST_PAYMENT_URL = '$EXA_CART_API_BASE_URL/checkout/OpcCompleteRedirectionPayment1'; static String PACKAGES_REQUEST_PAYMENT_URL =
static String PACKAGES_PAYMENT_SUCCESS_URL = '$EXA_CART_API_BASE_URL/Checkout/MobilePaymentSuccess'; '$EXA_CART_API_BASE_URL/checkout/OpcCompleteRedirectionPayment1';
static String PACKAGES_PAYMENT_FAIL_URL = '$EXA_CART_API_BASE_URL/Checkout/MobilePaymentFailed'; static String PACKAGES_PAYMENT_SUCCESS_URL =
'$EXA_CART_API_BASE_URL/Checkout/MobilePaymentSuccess';
static String PACKAGES_PAYMENT_FAIL_URL =
'$EXA_CART_API_BASE_URL/Checkout/MobilePaymentFailed';
static List<String> successURLS = [ static List<String> successURLS = [
'success', 'success',
@ -71,7 +76,8 @@ class MyInAppBrowser extends InAppBrowser {
static bool isPaymentDone = false; static bool isPaymentDone = false;
MyInAppBrowser({this.onExitCallback, this.appo, this.onLoadStartCallback, this.context}); MyInAppBrowser(
{this.onExitCallback, this.appo, this.onLoadStartCallback, this.context});
Future onBrowserCreated() async { Future onBrowserCreated() async {
print("\n\nBrowser Created!\n\n"); print("\n\nBrowser Created!\n\n");
@ -79,8 +85,7 @@ class MyInAppBrowser extends InAppBrowser {
@override @override
Future onLoadStart(String url) async { Future onLoadStart(String url) async {
if(onLoadStartCallback != null) if (onLoadStartCallback != null) onLoadStartCallback(url);
onLoadStartCallback(url);
} }
@override @override
@ -101,16 +106,18 @@ class MyInAppBrowser extends InAppBrowser {
@override @override
void onExit() { void onExit() {
print("\n\nBrowser closed!\n\n"); print("\n\nBrowser closed!\n\n");
if(onExitCallback != null) if (onExitCallback != null) onExitCallback(appo, isPaymentDone);
onExitCallback(appo, isPaymentDone);
} }
@override @override
Future<ShouldOverrideUrlLoadingAction> shouldOverrideUrlLoading(ShouldOverrideUrlLoadingRequest shouldOverrideUrlLoadingRequest) async { Future<ShouldOverrideUrlLoadingAction> shouldOverrideUrlLoading(
ShouldOverrideUrlLoadingRequest shouldOverrideUrlLoadingRequest) async {
var url = shouldOverrideUrlLoadingRequest.url; var url = shouldOverrideUrlLoadingRequest.url;
debugPrint("redirecting/overriding to: $url"); debugPrint("redirecting/overriding to: $url");
if(paymentType == _PAYMENT_TYPE.PACKAGES && [PACKAGES_PAYMENT_SUCCESS_URL,PACKAGES_PAYMENT_FAIL_URL].contains(url)){ if (paymentType == _PAYMENT_TYPE.PACKAGES &&
[PACKAGES_PAYMENT_SUCCESS_URL, PACKAGES_PAYMENT_FAIL_URL]
.contains(url)) {
isPaymentDone = (url == PACKAGES_PAYMENT_SUCCESS_URL); isPaymentDone = (url == PACKAGES_PAYMENT_SUCCESS_URL);
close(); close();
} }
@ -140,9 +147,11 @@ class MyInAppBrowser extends InAppBrowser {
} }
} }
openPackagesPaymentBrowser({@required int customer_id, @required int order_id}){ openPackagesPaymentBrowser(
{@required int customer_id, @required int order_id}) {
paymentType = _PAYMENT_TYPE.PACKAGES; paymentType = _PAYMENT_TYPE.PACKAGES;
var full_url = '$PACKAGES_REQUEST_PAYMENT_URL?customer_id=$customer_id&order_id=$order_id'; var full_url =
'$PACKAGES_REQUEST_PAYMENT_URL?customer_id=$customer_id&order_id=$order_id';
this.openUrl(url: full_url, options: _InAppBrowserOptions); this.openUrl(url: full_url, options: _InAppBrowserOptions);
} }
@ -182,7 +191,6 @@ class MyInAppBrowser extends InAppBrowser {
clinicID, clinicID,
doctorID) doctorID)
.then((value) { .then((value) {
paymentType = _PAYMENT_TYPE.PATIENT; paymentType = _PAYMENT_TYPE.PATIENT;
this.browser.openUrl(url: value, options: _InAppBrowserOptions); this.browser.openUrl(url: value, options: _InAppBrowserOptions);
}); });
@ -391,4 +399,4 @@ class MyChromeSafariBrowser extends ChromeSafariBrowser {
void onClosed() { void onClosed() {
print("ChromeSafari browser closed"); print("ChromeSafari browser closed");
} }
} }

Loading…
Cancel
Save