Merge branch 'development' into enad_pharmacy2

enad_pharmacy2
enadhilal 4 years ago
commit 57e9599f78

@ -10,6 +10,7 @@
<uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="android.permission.ACTIVITY_RECOGNITION" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.CAMERA" />
@ -76,13 +77,21 @@
<receiver android:name="com.dexterous.flutterlocalnotifications.ScheduledNotificationReceiver" />
<!-- Geofencing -->
<service android:name=".geofence.GeofenceTransitionsJobIntentService" android:exported="true" android:permission="android.permission.BIND_JOB_SERVICE" />
<receiver android:name=".geofence.GeofenceBroadcastReceiver" android:enabled="true" android:exported="true" />
<receiver android:name=".geofence.GeofencingRebootBroadcastReceiver" android:enabled="true">
<service android:name=".geofence.intent_receivers.GeofenceTransitionsJobIntentService" android:exported="true" android:permission="android.permission.BIND_JOB_SERVICE" />
<receiver android:name=".geofence.intent_receivers.GeofenceBroadcastReceiver" android:enabled="true" android:exported="true" />
<receiver android:name=".geofence.intent_receivers.GeofencingRebootBroadcastReceiver" android:enabled="true">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED"/>
<action android:name="android.intent.action.MY_PACKAGE_REPLACED"/>
</intent-filter>
</receiver>
<receiver android:name=".geofence.intent_receivers.LocationProviderChangeReceiver">
<intent-filter>
<action android:name="android.location.PROVIDERS_CHANGED"/>
</intent-filter>
</receiver>
<service android:name=".geofence.intent_receivers.ReregisterGeofenceJobService" android:permission="android.permission.BIND_JOB_SERVICE" />
<!-- Geofencing -->
<meta-data android:name="com.google.android.geo.API_KEY"
android:value="AIzaSyCmevVlr2Bh-c8W1VUzo8gt8JRY7n5PANw"/>

@ -2,8 +2,7 @@ package com.cloud.diplomaticquarterapp
import android.os.Bundle
import android.util.Log
import androidx.annotation.NonNull;
import com.cloud.diplomaticquarterapp.utils.FlutterText
import com.cloud.diplomaticquarterapp.utils.PlatformBridge
import com.cloud.diplomaticquarterapp.utils.*
import io.flutter.embedding.android.FlutterFragmentActivity
import io.flutter.embedding.engine.FlutterEngine
import io.flutter.plugin.common.MethodChannel
@ -15,6 +14,16 @@ class MainActivity: FlutterFragmentActivity() {
// Create Flutter Platform Bridge
PlatformBridge(flutterEngine.dartExecutor.binaryMessenger, this).create()
val time = timeToMillis("04:00:00", "HH:mm:ss")
print(time)
// val d1 = Logs.list(this)
// val d2 = Logs.raw(this)
// val d3 = Logs.RegisterGeofence.list(this)
// val d4 = Logs.RegisterGeofence.raw(this)
// val d5 = Logs.GeofenceEvent.list(this)
// val d6 = Logs.GeofenceEvent.raw(this)
print("")
}
override fun onResume() {

@ -37,6 +37,7 @@ class GeoZoneModel {
val rad = Radius.toFloat()
if(lat != null && long != null){
val loiteringDelayMinutes:Int = 2 // in Minutes
return Geofence.Builder()
.setRequestId(identifier())
.setCircularRegion(
@ -45,7 +46,8 @@ class GeoZoneModel {
rad
)
.setTransitionTypes(GeofenceTransition.ENTER_EXIT.value)
// .setNotificationResponsiveness(0)
.setNotificationResponsiveness(0)
.setLoiteringDelay(loiteringDelayMinutes * 60 * 1000)
.setExpirationDuration(Geofence.NEVER_EXPIRE)
.build()
}

@ -1,13 +0,0 @@
package com.cloud.diplomaticquarterapp.geofence
import android.content.BroadcastReceiver
import android.content.Context
import android.content.Intent
class GeofenceBroadcastReceiver : BroadcastReceiver() {
override fun onReceive(context: Context, intent: Intent) {
GeofenceTransitionsJobIntentService.enqueueWork(context, intent)
}
}

@ -6,7 +6,11 @@ import android.content.Context
import android.content.Intent
import android.content.SharedPreferences
import android.content.pm.PackageManager
import android.location.Location
import androidx.core.content.ContextCompat
import com.cloud.diplomaticquarterapp.geofence.intent_receivers.GeofenceBroadcastReceiver
import com.cloud.diplomaticquarterapp.geofence.intent_receivers.ReregisterGeofenceJobService
import com.cloud.diplomaticquarterapp.utils.*
import com.google.android.gms.location.Geofence
import com.google.android.gms.location.GeofencingClient
import com.google.android.gms.location.GeofencingRequest
@ -17,8 +21,10 @@ import com.google.gson.reflect.TypeToken
enum class GeofenceTransition(val value: Int) {
ENTER(1),
EXIT(2),
DWELL(4),
ENTER_EXIT((ENTER.value or EXIT.value)),
DWELL(4);
DWELL_EXIT((DWELL.value or EXIT.value));
companion object {
fun fromInt(value: Int) = GeofenceTransition.values().first { it.value == value }
@ -27,17 +33,13 @@ enum class GeofenceTransition(val value: Int) {
fun named():String{
if (value == 1)return "Enter"
if (value == 2)return "Exit"
if (value == (ENTER.value or EXIT.value))return "Enter or Exit"
if (value == 4)return "dWell"
if (value == (ENTER.value or EXIT.value))return "Enter or Exit"
if (value == (DWELL.value or EXIT.value))return "DWell or Exit"
return "unknown"
}
}
const val PREFS_STORAGE = "FlutterSharedPreferences"
const val PREF_KEY_SUCCESS = "HMG_GEOFENCE_SUCCESS"
const val PREF_KEY_FAILED = "HMG_GEOFENCE_FAILED"
const val PREF_KEY_HMG_ZONES = "flutter.hmg-geo-fences"
class HMG_Geofence {
// https://developer.android.com/training/location/geofencing#java
@ -69,13 +71,53 @@ class HMG_Geofence {
}
}
fun register(geoZones: List<GeoZoneModel>){
fun limitize(zones: List<GeoZoneModel>):List<GeoZoneModel>{
var geoZones_ = zones
if(zones.size > 100)
geoZones_ = zones.subList(0, 99)
return geoZones_
}
fun register(completion:((Boolean, java.lang.Exception?)->Unit)){
unRegisterAll { status, exception ->
val geoZones = getGeoZonesFromPreference(context)
doRegister(geoZones){ status_, error ->
completion.let { it(status_, error) }
}
}
}
fun unRegisterAll(completion: (status: Boolean, exception: Exception?) -> Unit){
getActiveGeofences({ success ->
removeActiveGeofences()
if(success.isNotEmpty())
geofencingClient
.removeGeofences(success)
.addOnSuccessListener {
completion(true, null)
}
.addOnFailureListener {
completion(false, it)
saveLog(context, "error:REMOVE_GEOFENCES", it.localizedMessage)
}
else
completion(true, null)
}, { failed ->
// Nothing to do with failed geofences.
})
}
private fun doRegister(geoZones: List<GeoZoneModel>, completion:((Boolean, java.lang.Exception?)->Unit)? = null){
if (geoZones.isEmpty())
return
val geoZones_ = limitize(geoZones)
fun buildGeofencingRequest(geofences: List<Geofence>): GeofencingRequest {
return GeofencingRequest.Builder()
.setInitialTrigger(0)
.setInitialTrigger(GeofencingRequest.INITIAL_TRIGGER_DWELL)
.addGeofences(geofences)
.build()
}
@ -83,9 +125,9 @@ class HMG_Geofence {
getActiveGeofences({ active ->
val geofences = mutableListOf<Geofence>()
geoZones.forEach {
it.toGeofence()?.let { geof ->
if(!active.contains(geof.requestId)){ // if not already registered then register
geoZones_.forEach {
it.toGeofence()?.let { geof ->
if (!active.contains(geof.requestId)) { // if not already registered then register
geofences.add(geof)
}
}
@ -95,31 +137,29 @@ class HMG_Geofence {
geofencingClient
.addGeofences(buildGeofencingRequest(geofences), geofencePendingIntent)
.addOnSuccessListener {
Logs.RegisterGeofence.save(context,"SUCCESS", "Successfuly registered the geofences", Logs.STATUS.SUCCESS)
saveActiveGeofence(geofences.map { it.requestId }, listOf())
completion?.let { it(true,null) }
}
.addOnFailureListener {
print(it.localizedMessage)
.addOnFailureListener { exc ->
Logs.RegisterGeofence.save(context,"FAILED_TO_REGISTER", "Failed to register geofence",Logs.STATUS.ERROR)
completion?.let { it(false,exc) }
}
// Schedule the job to register after specified duration (due to: events not calling after long period.. days or days [Needs to register fences again])
HMGUtils.scheduleJob(context, ReregisterGeofenceJobService::class.java,ReregisterGeofenceJobService.JobID, ReregisterGeofenceJobService.TriggerIntervalDuration)
}
},null)
}, null)
}
fun unRegisterAll(completion: (status: Boolean, exception:Exception?) -> Unit){
getActiveGeofences({ success ->
val mList = success.toMutableList()
mList.add("12345")
geofencingClient
.removeGeofences(success)
.addOnSuccessListener {
completion(true, null)
}
.addOnFailureListener {
completion(false, it)
}
removeActiveGeofences()
}, { failed ->
// Nothing to do with failed geofences.
})
fun getGeoZonesFromPreference(context: Context):List<GeoZoneModel>{
val pref = context.getSharedPreferences(PREFS_STORAGE, Context.MODE_PRIVATE)
val json = pref.getString(PREF_KEY_HMG_ZONES, "[]")
val geoZones = GeoZoneModel().listFrom(json!!)
return geoZones
}
fun saveActiveGeofence(success: List<String>, failed: List<String>){
@ -130,8 +170,8 @@ class HMG_Geofence {
}
fun removeActiveGeofences(){
preferences.edit().putString(PREF_KEY_SUCCESS,"[]").apply()
preferences.edit().putString(PREF_KEY_FAILED,"[]").apply()
preferences.edit().putString(PREF_KEY_SUCCESS, "[]").apply()
preferences.edit().putString(PREF_KEY_FAILED, "[]").apply()
}
fun getActiveGeofences(success: (success: List<String>) -> Unit, failure: ((failed: List<String>) -> Unit)?){
@ -154,12 +194,48 @@ class HMG_Geofence {
}
fun getPatientID():Int?{
val profileJson = preferences.getString("flutter.imei-user-data", "{}")
var profileJson = preferences.getString("flutter.imei-user-data", null)
if (profileJson == null)
profileJson = preferences.getString("flutter.user-profile", null)
val type = object : TypeToken<Map<String?, Any?>?>() {}.type
return gson.fromJson<Map<String?, Any?>?>(profileJson,type)
return gson.fromJson<Map<String?, Any?>?>(profileJson, type)
?.get("PatientID")
.toString()
.toDoubleOrNull()
?.toInt()
}
fun handleEvent(triggerGeofences: List<Geofence>, location: Location, transition: GeofenceTransition) {
getPatientID()?.let { patientId ->
getActiveGeofences({ activeGeofences ->
triggerGeofences.forEach { geofence ->
// Extract PointID from 'geofence.requestId' and find from active geofences
val pointID = activeGeofences.firstOrNull { it == geofence.requestId }?.split('_')?.first()
if (!pointID.isNullOrEmpty() && pointID.toIntOrNull() != null) {
val body = mutableMapOf<String, Any?>(
"PointsID" to pointID.toIntOrNull(),
"GeoType" to transition.value,
"PatientID" to patientId
)
body.putAll(HMGUtils.defaultHTTPParams(context))
httpPost<Map<String, Any>>(API.LOG_GEOFENCE, body, { response ->
saveLog(context, "HMG_GEOFENCE_NOTIFY", "Success: Notified to server\uD83D\uDE0E.")
sendNotification(context, transition.named(), geofence.requestId, "Notified to server.😎")
}, { exception ->
val errorMessage = "${transition.named()}, ${geofence.requestId}"
saveLog(context, "HMG_GEOFENCE_NOTIFY", "failed: $errorMessage | error: ${exception.localizedMessage}")
sendNotification(context, transition.named(), geofence.requestId, "Failed to notify server😔 -> ${exception.localizedMessage}")
})
}
}
}, null)
}
}
}

@ -0,0 +1,49 @@
package com.cloud.diplomaticquarterapp.geofence.intent_receivers
import android.content.BroadcastReceiver
import android.content.Context
import android.content.Intent
import android.util.Log
import com.cloud.diplomaticquarterapp.geofence.GeofenceTransition
import com.cloud.diplomaticquarterapp.geofence.HMG_Geofence
import com.cloud.diplomaticquarterapp.utils.Logs
import com.google.android.gms.location.GeofenceStatusCodes
import com.google.android.gms.location.GeofencingEvent
class GeofenceBroadcastReceiver : BroadcastReceiver() {
private val LOG_TAG = "GeofenceBroadcastReceiver"
override fun onReceive(context: Context, intent: Intent) {
val geofencingEvent = GeofencingEvent.fromIntent(intent)
if (geofencingEvent.hasError()) {
val errorMessage = GeofenceErrorMessages.getErrorString(context, geofencingEvent.errorCode)
Log.e(LOG_TAG, errorMessage)
Logs.GeofenceEvent.save(context,LOG_TAG,"Error while triggering geofence event",Logs.STATUS.ERROR)
doReRegisterIfRequired(context,geofencingEvent.errorCode)
return
}
Logs.GeofenceEvent.save(context,LOG_TAG,"Geofence event triggered: ${GeofenceTransition.fromInt(geofencingEvent.geofenceTransition).value} for ${geofencingEvent.triggeringGeofences.map {it.requestId}}",Logs.STATUS.SUCCESS)
HMG_Geofence.shared(context).handleEvent(geofencingEvent.triggeringGeofences,geofencingEvent.triggeringLocation, GeofenceTransition.fromInt(geofencingEvent.geofenceTransition));
}
fun doReRegisterIfRequired(context: Context, errorCode: Int){
val errorRequiredReregister = listOf(
GeofenceStatusCodes.GEOFENCE_NOT_AVAILABLE,
GeofenceStatusCodes.GEOFENCE_TOO_MANY_GEOFENCES,
GeofenceStatusCodes.GEOFENCE_TOO_MANY_PENDING_INTENTS,
GeofenceStatusCodes.GEOFENCE_REQUEST_TOO_FREQUENT
)
if(errorRequiredReregister.contains(errorCode))
HMG_Geofence.shared(context).register(){ status, error ->
}
}
}

@ -0,0 +1,16 @@
package com.cloud.diplomaticquarterapp.geofence.intent_receivers
import android.content.BroadcastReceiver
import android.content.Context
import android.content.Intent
import com.cloud.diplomaticquarterapp.geofence.HMG_Geofence
import com.google.android.gms.location.GeofenceStatusCodes
class GeofenceBroadcastReceiverWithJobService : BroadcastReceiver() {
override fun onReceive(context: Context, intent: Intent) {
GeofenceTransitionsJobIntentService.enqueueWork(context, intent)
}
}

@ -1,9 +1,10 @@
package com.cloud.diplomaticquarterapp.geofence
package com.cloud.diplomaticquarterapp.geofence.intent_receivers
import android.content.Context
import com.cloud.diplomaticquarterapp.R
import com.cloud.diplomaticquarterapp.geofence.HMG_Geofence
import com.google.android.gms.common.api.ApiException
import com.google.android.gms.location.GeofenceStatusCodes
@ -18,7 +19,7 @@ object GeofenceErrorMessages {
fun getErrorString(context: Context, errorCode: Int): String {
val resources = context.resources
return when (errorCode) {
val errorMessage = when (errorCode) {
GeofenceStatusCodes.GEOFENCE_NOT_AVAILABLE ->
resources.getString(R.string.geofence_not_available)
@ -28,7 +29,15 @@ object GeofenceErrorMessages {
GeofenceStatusCodes.GEOFENCE_TOO_MANY_PENDING_INTENTS ->
resources.getString(R.string.geofence_too_many_pending_intents)
GeofenceStatusCodes.GEOFENCE_INSUFFICIENT_LOCATION_PERMISSION ->
resources.getString(R.string.GEOFENCE_INSUFFICIENT_LOCATION_PERMISSION)
GeofenceStatusCodes.GEOFENCE_REQUEST_TOO_FREQUENT ->
resources.getString(R.string.GEOFENCE_REQUEST_TOO_FREQUENT)
else -> resources.getString(R.string.geofence_unknown_error)
}
return errorMessage
}
}

@ -29,31 +29,27 @@
*/
package com.cloud.diplomaticquarterapp.geofence
package com.cloud.diplomaticquarterapp.geofence.intent_receivers
import android.content.Context
import android.content.Intent
import android.location.Location
import android.util.Log
import androidx.core.app.JobIntentService
import com.cloud.diplomaticquarterapp.utils.API
import com.cloud.diplomaticquarterapp.utils.httpPost
import com.cloud.diplomaticquarterapp.utils.sendNotification
import com.github.kittinunf.fuel.core.extensions.jsonBody
import com.github.kittinunf.fuel.core.isSuccessful
import com.github.kittinunf.fuel.httpPost
import com.google.android.gms.location.Geofence
import com.cloud.diplomaticquarterapp.geofence.GeofenceTransition
import com.cloud.diplomaticquarterapp.geofence.HMG_Geofence
import com.cloud.diplomaticquarterapp.utils.saveLog
import com.google.android.gms.location.GeofenceStatusCodes
import com.google.android.gms.location.GeofencingEvent
import com.google.gson.Gson
class GeofenceTransitionsJobIntentService : JobIntentService() {
companion object {
private const val LOG_TAG = "GeoTrIntentService"
private const val JOB_ID = 573
private const val JOB_ID = 95902
var context_: Context? = null
fun enqueueWork(context: Context, intent: Intent) {
context_ = context
enqueueWork(
context,
GeofenceTransitionsJobIntentService::class.java, JOB_ID,
@ -64,43 +60,31 @@ class GeofenceTransitionsJobIntentService : JobIntentService() {
override fun onHandleWork(intent: Intent) {
val geofencingEvent = GeofencingEvent.fromIntent(intent)
if (geofencingEvent.hasError()) {
val errorMessage = GeofenceErrorMessages.getErrorString(this, geofencingEvent.errorCode)
val errorMessage = GeofenceErrorMessages.getErrorString(context_!!, geofencingEvent.errorCode)
Log.e(LOG_TAG, errorMessage)
return
}
if (geofencingEvent.geofenceTransition == Geofence.GEOFENCE_TRANSITION_ENTER || geofencingEvent.geofenceTransition == Geofence.GEOFENCE_TRANSITION_EXIT) {
handleEvent(geofencingEvent.triggeringGeofences,geofencingEvent.triggeringLocation, GeofenceTransition.fromInt(geofencingEvent.geofenceTransition));
}
}
private fun handleEvent(triggerGeofences: List<Geofence>, location:Location, transition:GeofenceTransition) {
val hmg = HMG_Geofence.shared(this)
hmg.getPatientID()?.let { patientId ->
saveLog(context_!!,LOG_TAG,errorMessage)
doReRegisterIfRequired(context_!!, geofencingEvent.errorCode)
hmg.getActiveGeofences({ activeGeofences ->
return
}
triggerGeofences.forEach { geofence ->
// Extract PointID from 'geofence.requestId' and find from active geofences
val pointID = activeGeofences.firstOrNull {it == geofence.requestId}?.split('_')?.first()
if(!pointID.isNullOrEmpty() && pointID.toIntOrNull() != null){
HMG_Geofence.shared(context_!!).handleEvent(geofencingEvent.triggeringGeofences,geofencingEvent.triggeringLocation, GeofenceTransition.fromInt(geofencingEvent.geofenceTransition));
val body = mapOf(
"PointsID" to pointID.toIntOrNull(),
"GeoType" to transition.value,
"PatientID" to patientId
)
}
httpPost<Map<String,Any>>(API.LOG_GEOFENCE, body, { response ->
sendNotification(this, transition.named(), geofence.requestId, "Notified to server.😎")
},{ exception ->
sendNotification(this, transition.named(), geofence.requestId, "Failed to notify server.😔")
})
}
}
fun doReRegisterIfRequired(context: Context, errorCode: Int){
val errorRequiredReregister = listOf(
GeofenceStatusCodes.GEOFENCE_NOT_AVAILABLE,
GeofenceStatusCodes.GEOFENCE_TOO_MANY_GEOFENCES,
GeofenceStatusCodes.GEOFENCE_TOO_MANY_PENDING_INTENTS,
GeofenceStatusCodes.GEOFENCE_REQUEST_TOO_FREQUENT
)
if(errorRequiredReregister.contains(errorCode))
HMG_Geofence.shared(context).register(){ status, exc -> }
},null)
}
}
}

@ -1,26 +1,22 @@
package com.cloud.diplomaticquarterapp.geofence
package com.cloud.diplomaticquarterapp.geofence.intent_receivers
import android.content.BroadcastReceiver
import android.content.Context
import android.content.Intent
import android.os.Handler
import android.os.Message
import com.cloud.diplomaticquarterapp.geofence.HMG_Geofence
import com.cloud.diplomaticquarterapp.utils.HMGUtils
import com.cloud.diplomaticquarterapp.utils.PREFS_STORAGE
class GeofencingRebootBroadcastReceiver : BroadcastReceiver(){
override fun onReceive(context: Context, intent: Intent) {
if (Intent.ACTION_BOOT_COMPLETED.equals(intent.action)) {
// if (intent.action.equals("android.intent.action.BOOT_COMPLETE")) {
val pref = context.getSharedPreferences(PREFS_STORAGE, Context.MODE_PRIVATE)
pref.edit().putString("REBOOT_DETECTED","YES").apply()
HMG_Geofence.shared(context).unRegisterAll { status, exception ->
val geoZones = HMGUtils.getGeoZonesFromPreference(context)
HMG_Geofence.shared(context).register(geoZones)
}
HMG_Geofence.shared(context).register(){ status, error -> }
}
}

@ -0,0 +1,25 @@
package com.cloud.diplomaticquarterapp.geofence.intent_receivers
import android.content.BroadcastReceiver
import android.content.Context
import android.content.Intent
import android.location.LocationManager
import com.cloud.diplomaticquarterapp.geofence.HMG_Geofence
import com.cloud.diplomaticquarterapp.utils.HMGUtils
import com.cloud.diplomaticquarterapp.utils.PREFS_STORAGE
class LocationProviderChangeReceiver : BroadcastReceiver() {
private val LOG_TAG = "LocationProviderChangeReceiver"
override fun onReceive(context: Context, intent: Intent) {
if (LocationManager.PROVIDERS_CHANGED_ACTION.equals(intent.action)) {
val pref = context.getSharedPreferences(PREFS_STORAGE, Context.MODE_PRIVATE)
pref.edit().putString("LOCATION_PROVIDER_CHANGE","YES").apply()
HMG_Geofence.shared(context).register(){ s, e -> }
}
}
}

@ -0,0 +1,24 @@
package com.cloud.diplomaticquarterapp.geofence.intent_receivers
import android.app.job.JobParameters
import android.app.job.JobService
import com.cloud.diplomaticquarterapp.geofence.HMG_Geofence
import com.cloud.diplomaticquarterapp.utils.Logs
class ReregisterGeofenceJobService : JobService(){
companion object{
val TriggerIntervalDuration:String = "06:00:00"
val JobID = 918273
}
override fun onStartJob(params: JobParameters?): Boolean {
Logs.save(applicationContext,"ReregisterGeofenceJobService.onStartJob", "triggered to re-register the geofences after $TriggerIntervalDuration >> [HH:mm:ss]")
HMG_Geofence.shared(applicationContext).register(){ status, error ->
jobFinished(params, true)
}
return true
}
override fun onStopJob(params: JobParameters?): Boolean {
return true
}
}

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

@ -0,0 +1,8 @@
package com.cloud.diplomaticquarterapp.utils
const val PREFS_STORAGE = "FlutterSharedPreferences"
const val PREF_KEY_SUCCESS = "HMG_GEOFENCE_SUCCESS"
const val PREF_KEY_FAILED = "HMG_GEOFENCE_FAILED"
const val PREF_KEY_HMG_ZONES = "flutter.hmg-geo-fences"
const val PREF_KEY_LANGUAGE = "flutter.language"

@ -3,6 +3,9 @@ package com.cloud.diplomaticquarterapp.utils
import android.app.NotificationChannel
import android.app.NotificationManager
import android.app.PendingIntent
import android.app.job.JobInfo
import android.app.job.JobScheduler
import android.content.ComponentName
import android.content.Context
import android.content.Intent
import android.os.Build
@ -14,17 +17,16 @@ import com.cloud.diplomaticquarterapp.BuildConfig
import com.cloud.diplomaticquarterapp.MainActivity
import com.cloud.diplomaticquarterapp.R
import com.cloud.diplomaticquarterapp.geofence.GeoZoneModel
import com.cloud.diplomaticquarterapp.geofence.PREFS_STORAGE
import com.cloud.diplomaticquarterapp.geofence.PREF_KEY_HMG_ZONES
import com.github.kittinunf.fuel.core.extensions.jsonBody
import com.github.kittinunf.fuel.httpPost
import com.google.android.gms.location.Geofence
import com.google.gson.Gson
import com.google.gson.reflect.TypeToken
import io.flutter.plugin.common.MethodChannel
import org.jetbrains.anko.doAsyncResult
import org.json.JSONArray
import org.json.JSONException
import org.json.JSONObject
import java.text.SimpleDateFormat
import java.util.*
import kotlin.concurrent.timerTask
@ -68,24 +70,65 @@ class HMGUtils {
}
}
fun getGeoZonesFromPreference(context: Context): List<GeoZoneModel> {
fun getLanguageCode(context: Context) : Int {
val pref = context.getSharedPreferences(PREFS_STORAGE, Context.MODE_PRIVATE)
val json = pref.getString(PREF_KEY_HMG_ZONES,"[]")
val lang = pref.getString(PREF_KEY_LANGUAGE, "ar")
return if (lang == "ar") 2 else 1
}
val geoZones = json?.let { GeoZoneModel().listFrom(it) }
return geoZones!!
fun defaultHTTPParams(context: Context) : Map<String, Any?>{
return mapOf(
"ZipCode" to "966",
"VersionID" to 5.8,
"Channel" to 3,
"LanguageID" to getLanguageCode(context),
"IPAdress" to "10.20.10.20",
"generalid" to "Cs2020@2016$2958",
"PatientOutSA" to 0,
"SessionID" to null,
"isDentalAllowedBackend" to false,
"DeviceTypeID" to 2)
}
fun <T>scheduleJob(context: Context, pendingIntentClassType:Class<T>, jobId:Int, intervalDuration:String, deadlineMillis:Long = (30 * 1000)) { // default deadline: 30 Seconds
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.M) {
val jobScheduler: JobScheduler = context.getSystemService(JobScheduler::class.java)
val serviceComponent = ComponentName(context, pendingIntentClassType)
val builder = JobInfo.Builder(jobId, serviceComponent)
builder.setPersisted(true)
builder.setBackoffCriteria(30000, JobInfo.BACKOFF_POLICY_LINEAR)
val intervalMillis = timeToMillis(intervalDuration,"HH:mm:ss")
builder.setMinimumLatency(intervalMillis) // wait at least
builder.setOverrideDeadline((intervalMillis + deadlineMillis)) // maximum delay
if (jobScheduler.schedule(builder.build()) == JobScheduler.RESULT_SUCCESS){
Logs.save(context,"ScheduleJob", "${pendingIntentClassType.simpleName}: Job scheduled to trigger after duration $intervalDuration >> HH:mm:ss --('MinimumLatency:$intervalMillis Deadline:${(intervalMillis + deadlineMillis)}')--",Logs.STATUS.SUCCESS)
}else{
Logs.save(context,"ScheduleJob", "${pendingIntentClassType.simpleName}: Failed to scheduled Job",Logs.STATUS.ERROR)
}
} else {
Logs.save(context,"ScheduleJob", "${pendingIntentClassType.simpleName}: Failed to scheduled Job on VERSION.SDK_INT < ${android.os.Build.VERSION_CODES.M}",Logs.STATUS.ERROR)
}
}
}
}
private fun Timer.schedule(timerTask: TimerTask) {
}
private const val NOTIFICATION_CHANNEL_ID = BuildConfig.APPLICATION_ID + ".channel"
fun sendNotification(context: Context, title:String, @Nullable subtitle:String?, message:String?) {
fun timeToMillis(time:String, format:String):Long{
val sdf = SimpleDateFormat(format, Locale.US)
val millis = sdf.parse(time).time + TimeZone.getDefault().rawOffset
return millis
}
fun sendNotification(context: Context, title: String, @Nullable subtitle: String?, message: String?) {
val notificationManager = context.getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O
@ -117,8 +160,18 @@ fun sendNotification(context: Context, title:String, @Nullable subtitle:String?,
notificationManager.notify(getUniqueId(), notification.build())
}
//-------------------------
// Open Helper Methods
//-------------------------
fun getUniqueId() = ((System.currentTimeMillis() % 10000).toInt())
private fun getUniqueId() = ((System.currentTimeMillis() % 10000).toInt())
object DateUtils {
@JvmStatic
fun dateTimeNow() : String {
val format = SimpleDateFormat("dd-MMM-yyy hh:mm:ss")
return format.format(Date())
}
}
fun isJSONValid(jsonString: String?): Boolean {
try { JSONObject(jsonString) } catch (ex: JSONException) {
@ -129,31 +182,43 @@ fun isJSONValid(jsonString: String?): Boolean {
return true
}
fun saveLog(context: Context, tag: String, message: String){
val pref = context.getSharedPreferences(PREFS_STORAGE, Context.MODE_PRIVATE)
var logs = pref.getString("LOGS", "")
logs += "$tag -> $message \n"
pref.edit().putString("LOGS", logs).apply();
}
fun getLogs(context: Context) : String?{
val pref = context.getSharedPreferences(PREFS_STORAGE, Context.MODE_PRIVATE)
return pref.getString("LOGS", "")
}
class HTTPResponse<T>(data: T){
final var data:T = data
}
fun <T>httpPost(url: String, body: Map<String, Any?>, onSuccess: (response: HTTPResponse<T>) -> Unit, onError: (error: Exception) -> Unit){
fun <T>httpPost(url: String, body: Map<String, Any?>, onSuccess: (response: HTTPResponse<T>) -> Unit, onError: (error: Exception) -> Unit){
val gson = Gson()
val type = object : TypeToken<T>() {}.type
val jsonBody = gson.toJson(body)
url.httpPost()
.jsonBody(jsonBody, Charsets.UTF_8)
.timeout(10000)
.header("Content-Type","application/json")
.header("Allow","*/*")
.header("Content-Type", "application/json")
.header("Allow", "*/*")
.response { request, response, result ->
result.doAsyncResult { }
result.fold({ data ->
val dataString = String(data)
if(isJSONValid(dataString)){
val responseData = gson.fromJson<T>(dataString,type)
if (isJSONValid(dataString)) {
val responseData = gson.fromJson<T>(dataString, type)
onSuccess(HTTPResponse(responseData))
}else{
} else {
onError(Exception("Invalid response from server (Not a valid JSON)"))
}
}, {
onError(it)
it.localizedMessage
})
}

@ -0,0 +1,145 @@
package com.cloud.diplomaticquarterapp.utils
import android.content.Context
import android.content.SharedPreferences
import android.os.Build
import com.cloud.diplomaticquarterapp.BuildConfig
import com.google.gson.Gson
class Logs {
enum class STATUS{
SUCCESS,
ERROR;
}
class GeofenceEvent{
companion object{
fun save(context: Context, tag:String, message:String, status:Logs.STATUS = STATUS.SUCCESS){
Logs.Common.save(context,"GeofenceEvent", tag, message, status)
}
fun list(context: Context, tag:String? = null, status:Logs.STATUS? = null):List<LogModel>{
return Logs.Common.list(context,"GeofenceEvent", tag, status)
}
fun raw(context: Context):String{
return Logs.Common.raw(context,"GeofenceEvent")
}
}
}
class RegisterGeofence{
companion object{
fun save(context: Context, tag:String, message:String, status:Logs.STATUS = STATUS.SUCCESS){
Logs.Common.save(context,"RegisterGeofence", tag, message, status)
}
fun list(context: Context, tag:String? = null, status:Logs.STATUS? = null):List<LogModel>{
return Logs.Common.list(context,"RegisterGeofence", tag, status)
}
fun raw(context: Context):String{
return Logs.Common.raw(context,"RegisterGeofence");
}
}
}
companion object{
private var pref:SharedPreferences? = null
fun save(context: Context, tag:String, message:String, status:Logs.STATUS = STATUS.SUCCESS){
Logs.Common.save(context,"Logs", tag, message, status)
}
fun list(context: Context, tag:String? = null, status:Logs.STATUS? = null):List<LogModel>{
return Logs.Common.list(context,"Logs", tag, status)
}
fun raw(context: Context):String{
return Logs.Common.raw(context,"Logs");
}
private fun storage(context: Context):SharedPreferences{
if(pref == null) {
pref = context.getSharedPreferences(PREFS_STORAGE, Context.MODE_PRIVATE)
}
return pref!!
}
}
private class Common{
companion object{
private val gson = Gson()
fun save(context: Context, key:String, tag:String, message:String, status:Logs.STATUS = STATUS.SUCCESS){
if(!BuildConfig.DEBUG)
return
val pref = Logs.storage(context)
val string = pref.getString(key,"{}")
val json = gson.fromJson<LogsContainerModel>(string,LogsContainerModel::class.java)
json.add(
LogModel().apply {
this.TAG = tag
this.MESSAGE = message
this.STATUS = status.name
this.DATE = DateUtils.dateTimeNow()
}
)
pref.edit().putString(key,gson.toJson(json)).apply()
}
fun list(context: Context, key:String, tag:String? = null, status:Logs.STATUS? = null):List<LogModel>{
val pref = Logs.storage(context)
val string = pref.getString(key,"{}")
val json = gson.fromJson<LogsContainerModel>(string,LogsContainerModel::class.java)
if(tag == null && status == null) {
return json.LOGS
}else if(tag != null && status != null){
return json.LOGS.filter { (it.TAG == tag && it.STATUS == status.name) }
}else if(tag != null){
return json.LOGS.filter { (it.TAG == tag) }
}else if(status != null){
return json.LOGS.filter { (it.STATUS == status.name) }
}
return listOf()
}
fun raw(context: Context, key:String):String{
val pref = Logs.storage(context)
val string = pref.getString(key,"{}")
return string!!
}
}
}
class LogModel{
lateinit var TAG:String
lateinit var MESSAGE:String
lateinit var STATUS:String
lateinit var DATE:String
companion object{
fun with(tag:String, message:String, status:String):LogModel{
return LogModel().apply {
this.TAG = tag
this.MESSAGE = message
this.STATUS = status
this.DATE = DateUtils.dateTimeNow()
}
}
}
}
class LogsContainerModel{
var LOGS = mutableListOf<LogModel>()
fun add(log:LogModel){
LOGS.add(log)
}
}
}

@ -105,7 +105,7 @@ class PlatformBridge(binaryMessenger: BinaryMessenger, flutterMainActivity: Main
override fun success(result: Any?) {
if(result is String) {
val geoZones = GeoZoneModel().listFrom(result)
HMG_Geofence.shared(mainActivity).register(geoZones)
HMG_Geofence.shared(mainActivity).register(){ s, e -> }
}
}

@ -13,4 +13,10 @@
<string name="geofence_too_many_pending_intents">
You have provided too many PendingIntents to the addGeofences() call.
</string>
<string name="GEOFENCE_INSUFFICIENT_LOCATION_PERMISSION">
App do not have permission to access location service.
</string>
<string name="GEOFENCE_REQUEST_TOO_FREQUENT">
Geofence requests happened too frequently.
</string>
</resources>

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

@ -0,0 +1,26 @@
<svg xmlns="http://www.w3.org/2000/svg" width="103.843" height="79.732" viewBox="0 0 103.843 79.732">
<g id="Group_776" data-name="Group 776" transform="translate(-67.806 -333.834)">
<g id="Group_772" data-name="Group 772" transform="translate(72.721 385.261)">
<path id="Rectangle_494" data-name="Rectangle 494" d="M3.513,0h5.5a3.512,3.512,0,0,1,3.512,3.512V24.794a3.512,3.512,0,0,1-3.512,3.512h-5.5A3.512,3.512,0,0,1,0,24.793V3.513A3.513,3.513,0,0,1,3.513,0Z" transform="translate(81.49)" fill="#404040"/>
<path id="Rectangle_495" data-name="Rectangle 495" d="M3.513,0h5.5a3.512,3.512,0,0,1,3.512,3.512V24.794a3.512,3.512,0,0,1-3.512,3.512h-5.5A3.512,3.512,0,0,1,0,24.793V3.513A3.513,3.513,0,0,1,3.513,0Z" transform="translate(0)" fill="#404040"/>
</g>
<g id="Group_774" data-name="Group 774" transform="translate(67.806 333.834)">
<g id="Group_773" data-name="Group 773" transform="translate(0 20.106)">
<path id="Path_964" data-name="Path 964" d="M202.791,368.713a2.117,2.117,0,0,1-1.4,1.881l.87,1.595a2.144,2.144,0,0,1,2.578-.721h.784v-2.755Z" transform="translate(-108.451 -364.552)" fill="#b2361d"/>
<path id="Path_965" data-name="Path 965" d="M212.887,366.617c.07,1.4-1.91,2.76-3.882,3.26-2.9.735-5.653-.648-5.653-3.515,0-2.783,1.939-4.222,4.769-3.4C210.072,363.532,212.818,365.233,212.887,366.617Z" transform="translate(-109.046 -362.733)" fill="#d84c2f"/>
<path id="Path_966" data-name="Path 966" d="M80.223,368.713a2.116,2.116,0,0,0,1.4,1.881l-.87,1.595a2.144,2.144,0,0,0-2.578-.721h-.785v-2.755Z" transform="translate(-70.722 -364.552)" fill="#b2361d"/>
<path id="Path_967" data-name="Path 967" d="M67.808,366.617c-.07,1.4,1.909,2.76,3.882,3.26,2.9.735,5.654-.648,5.654-3.515,0-2.783-1.939-4.222-4.769-3.4C70.623,363.532,67.877,365.233,67.808,366.617Z" transform="translate(-67.806 -362.733)" fill="#d84c2f"/>
</g>
<path id="Path_968" data-name="Path 968" d="M168.258,369.52c-.522-3.479-3.218-7.392-4.7-10.349s-6.929-16.872-8.262-19.307a10.983,10.983,0,0,0-7.653-5.435c-3.479-.522-18.843-.594-25.511-.594s-22.032.072-25.51.594a10.981,10.981,0,0,0-7.653,5.435c-1.334,2.435-6.784,16.35-8.262,19.307s-4.174,6.871-4.7,10.349-.348,24.09.522,27.482a7.356,7.356,0,0,0,6.61,5.479h77.982a7.356,7.356,0,0,0,6.61-5.479C168.606,393.61,168.78,373,168.258,369.52Z" transform="translate(-70.214 -333.834)" fill="#d84c2f"/>
<path id="Path_969" data-name="Path 969" d="M75.773,405.294c.09,5.924.349,11.778.779,13.45a7.356,7.356,0,0,0,6.61,5.479h77.982a7.356,7.356,0,0,0,6.61-5.479c.429-1.671.687-7.525.779-13.45Z" transform="translate(-70.23 -355.576)" fill="#d63828"/>
<path id="Path_970" data-name="Path 970" d="M160.494,364.834s4.871,7.37,5.508,9.221.725,3.533-1.1,4.374-15.567,4.261-18.7,4.261H101.385c-3.131,0-16.872-3.42-18.7-4.261s-1.739-2.522-1.1-4.374,5.508-9.221,5.508-9.221" transform="translate(-71.873 -343.266)" fill="none" stroke="#b2361d" stroke-miterlimit="10" stroke-width="0.5"/>
</g>
<path id="Path_971" data-name="Path 971" d="M165.792,420.908a1.465,1.465,0,0,1-1.364,2.224H83.859a1.465,1.465,0,0,1-1.364-2.224l1.75-4.285a3.366,3.366,0,0,1,2.887-1.956h74.025a3.364,3.364,0,0,1,2.887,1.956Z" transform="translate(-4.416 -24.593)" fill="#404040"/>
<path id="Path_972" data-name="Path 972" d="M152.824,394.283c-.522-1.565-2.783-2.783-5.044-2.783h-26.96c-2.261,0-4.522,1.218-5.044,2.783s1.826,8.009,2.7,9.179,1.826,1.46,4.609,1.46h22.438c2.783,0,3.74-.29,4.609-1.46S153.346,395.848,152.824,394.283Z" transform="translate(-14.572 -17.545)" fill="#404040"/>
<path id="Path_973" data-name="Path 973" d="M163.631,358.436c-.435-1.508-4.609-12.147-5.827-14.669s-2.87-3.392-4.088-3.392H98c-1.218,0-2.87.87-4.088,3.392s-5.392,13.161-5.827,14.669.261,2.2,1.391,2.2h72.764C163.37,360.639,164.066,359.943,163.631,358.436Z" transform="translate(-6.13 -1.99)" fill="#404040"/>
<g id="Group_775" data-name="Group 775" transform="translate(76.803 368.998)">
<path id="Path_974" data-name="Path 974" d="M175.9,389.332s3.827,4.783,5.74,4.783h11.045a2.421,2.421,0,0,0,2.522-2,23,23,0,0,0,0-7.74A90.156,90.156,0,0,1,175.9,389.332Z" transform="translate(-109.692 -384.375)" fill="#fff"/>
<path id="Path_975" data-name="Path 975" d="M100.374,389.332s-3.827,4.783-5.74,4.783H83.589a2.421,2.421,0,0,1-2.522-2,23,23,0,0,1,0-7.74A90.156,90.156,0,0,0,100.374,389.332Z" transform="translate(-80.738 -384.375)" fill="#fff"/>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

@ -41,5 +41,8 @@
</array>
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>
< key >NSCameraUsageDescription< /key >
< string >Camera permission is required for barcode scanning.< /string >
</dict>
</plist>

@ -3,21 +3,23 @@
<plist version="1.0">
<dict>
<key>CLIENT_ID</key>
<string>864393916058-ekeb4s8tgfo58dutv0l54399t7ivr06r.apps.googleusercontent.com</string>
<string>815750722565-da8p56le8bd6apsbm9eft0jjl1rtpgkt.apps.googleusercontent.com</string>
<key>REVERSED_CLIENT_ID</key>
<string>com.googleusercontent.apps.864393916058-ekeb4s8tgfo58dutv0l54399t7ivr06r</string>
<string>com.googleusercontent.apps.815750722565-da8p56le8bd6apsbm9eft0jjl1rtpgkt</string>
<key>ANDROID_CLIENT_ID</key>
<string>815750722565-m14h8mkosm7cnq6uh6rhqr54dn02d705.apps.googleusercontent.com</string>
<key>API_KEY</key>
<string>AIzaSyA_6ayGCk4fly7o7eTVBrj9kuHBYHMAOfs</string>
<string>AIzaSyDiXnCO00li4V7Ioa2YZ_M4ECxRsu_P9tA</string>
<key>GCM_SENDER_ID</key>
<string>864393916058</string>
<string>815750722565</string>
<key>PLIST_VERSION</key>
<string>1</string>
<key>BUNDLE_ID</key>
<string>com.cloud.diplomaticquarterapp</string>
<string>com.HMG.HMG-Smartphone</string>
<key>PROJECT_ID</key>
<string>diplomaticquarter-d2385</string>
<string>api-project-815750722565</string>
<key>STORAGE_BUCKET</key>
<string>diplomaticquarter-d2385.appspot.com</string>
<string>api-project-815750722565.appspot.com</string>
<key>IS_ADS_ENABLED</key>
<false></false>
<key>IS_ANALYTICS_ENABLED</key>
@ -29,8 +31,8 @@
<key>IS_SIGNIN_ENABLED</key>
<true></true>
<key>GOOGLE_APP_ID</key>
<string>1:864393916058:ios:13f787bbfe6051f8b97923</string>
<string>1:815750722565:ios:328ec247a81a2ca23c186c</string>
<key>DATABASE_URL</key>
<string>https://diplomaticquarter-d2385.firebaseio.com</string>
<string>https://api-project-815750722565.firebaseio.com</string>
</dict>
</plist>

@ -1,455 +1,25 @@
PODS:
- android_intent (0.0.1):
- Flutter
- barcode_scan_fix (0.0.1):
- Flutter
- MTBBarcodeScanner
- connectivity (0.0.1):
- Flutter
- Reachability
- connectivity_for_web (0.1.0):
- Flutter
- connectivity_macos (0.0.1):
- Flutter
- device_calendar (0.0.1):
- Flutter
- device_info (0.0.1):
- Flutter
- Firebase/CoreOnly (6.33.0):
- FirebaseCore (= 6.10.3)
- Firebase/Messaging (6.33.0):
- Firebase/CoreOnly
- FirebaseMessaging (~> 4.7.0)
- firebase_core (0.5.3):
- Firebase/CoreOnly (~> 6.33.0)
- Flutter
- firebase_core_web (0.1.0):
- Flutter
- firebase_messaging (7.0.3):
- Firebase/CoreOnly (~> 6.33.0)
- Firebase/Messaging (~> 6.33.0)
- firebase_core
- Flutter
- FirebaseCore (6.10.3):
- FirebaseCoreDiagnostics (~> 1.6)
- GoogleUtilities/Environment (~> 6.7)
- GoogleUtilities/Logger (~> 6.7)
- FirebaseCoreDiagnostics (1.7.0):
- GoogleDataTransport (~> 7.4)
- GoogleUtilities/Environment (~> 6.7)
- GoogleUtilities/Logger (~> 6.7)
- nanopb (~> 1.30906.0)
- FirebaseInstallations (1.7.0):
- FirebaseCore (~> 6.10)
- GoogleUtilities/Environment (~> 6.7)
- GoogleUtilities/UserDefaults (~> 6.7)
- PromisesObjC (~> 1.2)
- FirebaseInstanceID (4.8.0):
- FirebaseCore (~> 6.10)
- FirebaseInstallations (~> 1.6)
- GoogleUtilities/Environment (~> 6.7)
- GoogleUtilities/UserDefaults (~> 6.7)
- FirebaseMessaging (4.7.1):
- FirebaseCore (~> 6.10)
- FirebaseInstanceID (~> 4.7)
- GoogleUtilities/AppDelegateSwizzler (~> 6.7)
- GoogleUtilities/Environment (~> 6.7)
- GoogleUtilities/Reachability (~> 6.7)
- GoogleUtilities/UserDefaults (~> 6.7)
- Protobuf (>= 3.9.2, ~> 3.9)
- Flutter (1.0.0)
- flutter_email_sender (0.0.1):
- Flutter
- flutter_flexible_toast (0.0.1):
- Flutter
- flutter_inappwebview (0.0.1):
- Flutter
- flutter_local_notifications (0.0.1):
- Flutter
- flutter_plugin_android_lifecycle (0.0.1):
- Flutter
- flutter_tts (0.0.1):
- Flutter
- geolocator (6.1.9):
- Flutter
- google_maps_flutter (0.0.1):
- Flutter
- GoogleMaps (< 3.10)
- GoogleDataTransport (7.5.1):
- nanopb (~> 1.30906.0)
- GoogleMaps (3.9.0):
- GoogleMaps/Maps (= 3.9.0)
- GoogleMaps/Base (3.9.0)
- GoogleMaps/Maps (3.9.0):
- GoogleMaps/Base
- GoogleUtilities/AppDelegateSwizzler (6.7.2):
- GoogleUtilities/Environment
- GoogleUtilities/Logger
- GoogleUtilities/Network
- GoogleUtilities/Environment (6.7.2):
- PromisesObjC (~> 1.2)
- GoogleUtilities/Logger (6.7.2):
- GoogleUtilities/Environment
- GoogleUtilities/Network (6.7.2):
- GoogleUtilities/Logger
- "GoogleUtilities/NSData+zlib"
- GoogleUtilities/Reachability
- "GoogleUtilities/NSData+zlib (6.7.2)"
- GoogleUtilities/Reachability (6.7.2):
- GoogleUtilities/Logger
- GoogleUtilities/UserDefaults (6.7.2):
- GoogleUtilities/Logger
- hexcolor (0.0.1):
- Flutter
- image_cropper (0.0.3):
- Flutter
- TOCropViewController (~> 2.5.4)
- image_picker (0.0.1):
- Flutter
- just_audio (0.0.1):
- Flutter
- local_auth (0.0.1):
- Flutter
- manage_calendar_events (0.0.1):
- Flutter
- map_launcher (0.0.1):
- Flutter
- maps_launcher (0.0.1):
- Flutter
- MTBBarcodeScanner (5.0.11)
- nanopb (1.30906.0):
- nanopb/decode (= 1.30906.0)
- nanopb/encode (= 1.30906.0)
- nanopb/decode (1.30906.0)
- nanopb/encode (1.30906.0)
- native_device_orientation (0.0.1):
- Flutter
- native_progress_hud (0.0.1):
- Flutter
- NVActivityIndicatorView (5.1.1):
- NVActivityIndicatorView/Base (= 5.1.1)
- NVActivityIndicatorView/Base (5.1.1)
- path_provider (0.0.1):
- Flutter
- path_provider_linux (0.0.1):
- Flutter
- path_provider_macos (0.0.1):
- Flutter
- path_provider_windows (0.0.1):
- Flutter
- "permission_handler (5.0.1+1)":
- Flutter
- PromisesObjC (1.2.11)
- Protobuf (3.13.0)
- Reachability (3.2)
- screen (0.0.1):
- Flutter
- shared_preferences (0.0.1):
- Flutter
- shared_preferences_linux (0.0.1):
- Flutter
- shared_preferences_macos (0.0.1):
- Flutter
- shared_preferences_web (0.0.1):
- Flutter
- shared_preferences_windows (0.0.1):
- Flutter
- speech_to_text (0.0.1):
- Flutter
- Try
- TOCropViewController (2.5.5)
- Try (2.1.1)
- "twilio_programmable_video (0.5.0+4)":
- Flutter
- TwilioVideo (~> 3.4)
- TwilioVideo (3.7.2)
- url_launcher (0.0.1):
- Flutter
- url_launcher_linux (0.0.1):
- Flutter
- url_launcher_macos (0.0.1):
- Flutter
- url_launcher_web (0.0.1):
- Flutter
- url_launcher_windows (0.0.1):
- Flutter
- vibration (1.7.3):
- Flutter
- vibration_web (1.6.2):
- Flutter
- video_player (0.0.1):
- Flutter
- video_player_web (0.0.1):
- Flutter
- wakelock (0.0.1):
- Flutter
- webview_flutter (0.0.1):
- Flutter
- wifi (0.0.1):
- Flutter
DEPENDENCIES:
- android_intent (from `.symlinks/plugins/android_intent/ios`)
- barcode_scan_fix (from `.symlinks/plugins/barcode_scan_fix/ios`)
- connectivity (from `.symlinks/plugins/connectivity/ios`)
- connectivity_for_web (from `.symlinks/plugins/connectivity_for_web/ios`)
- connectivity_macos (from `.symlinks/plugins/connectivity_macos/ios`)
- device_calendar (from `.symlinks/plugins/device_calendar/ios`)
- device_info (from `.symlinks/plugins/device_info/ios`)
- firebase_core (from `.symlinks/plugins/firebase_core/ios`)
- firebase_core_web (from `.symlinks/plugins/firebase_core_web/ios`)
- firebase_messaging (from `.symlinks/plugins/firebase_messaging/ios`)
- Flutter (from `Flutter`)
- flutter_email_sender (from `.symlinks/plugins/flutter_email_sender/ios`)
- flutter_flexible_toast (from `.symlinks/plugins/flutter_flexible_toast/ios`)
- flutter_inappwebview (from `.symlinks/plugins/flutter_inappwebview/ios`)
- flutter_local_notifications (from `.symlinks/plugins/flutter_local_notifications/ios`)
- flutter_plugin_android_lifecycle (from `.symlinks/plugins/flutter_plugin_android_lifecycle/ios`)
- flutter_tts (from `.symlinks/plugins/flutter_tts/ios`)
- geolocator (from `.symlinks/plugins/geolocator/ios`)
- google_maps_flutter (from `.symlinks/plugins/google_maps_flutter/ios`)
- hexcolor (from `.symlinks/plugins/hexcolor/ios`)
- image_cropper (from `.symlinks/plugins/image_cropper/ios`)
- image_picker (from `.symlinks/plugins/image_picker/ios`)
- just_audio (from `.symlinks/plugins/just_audio/ios`)
- local_auth (from `.symlinks/plugins/local_auth/ios`)
- manage_calendar_events (from `.symlinks/plugins/manage_calendar_events/ios`)
- map_launcher (from `.symlinks/plugins/map_launcher/ios`)
- maps_launcher (from `.symlinks/plugins/maps_launcher/ios`)
- native_device_orientation (from `.symlinks/plugins/native_device_orientation/ios`)
- native_progress_hud (from `.symlinks/plugins/native_progress_hud/ios`)
- NVActivityIndicatorView
- path_provider (from `.symlinks/plugins/path_provider/ios`)
- path_provider_linux (from `.symlinks/plugins/path_provider_linux/ios`)
- path_provider_macos (from `.symlinks/plugins/path_provider_macos/ios`)
- path_provider_windows (from `.symlinks/plugins/path_provider_windows/ios`)
- permission_handler (from `.symlinks/plugins/permission_handler/ios`)
- screen (from `.symlinks/plugins/screen/ios`)
- shared_preferences (from `.symlinks/plugins/shared_preferences/ios`)
- shared_preferences_linux (from `.symlinks/plugins/shared_preferences_linux/ios`)
- shared_preferences_macos (from `.symlinks/plugins/shared_preferences_macos/ios`)
- shared_preferences_web (from `.symlinks/plugins/shared_preferences_web/ios`)
- shared_preferences_windows (from `.symlinks/plugins/shared_preferences_windows/ios`)
- speech_to_text (from `.symlinks/plugins/speech_to_text/ios`)
- twilio_programmable_video (from `.symlinks/plugins/twilio_programmable_video/ios`)
- url_launcher (from `.symlinks/plugins/url_launcher/ios`)
- url_launcher_linux (from `.symlinks/plugins/url_launcher_linux/ios`)
- url_launcher_macos (from `.symlinks/plugins/url_launcher_macos/ios`)
- url_launcher_web (from `.symlinks/plugins/url_launcher_web/ios`)
- url_launcher_windows (from `.symlinks/plugins/url_launcher_windows/ios`)
- vibration (from `.symlinks/plugins/vibration/ios`)
- vibration_web (from `.symlinks/plugins/vibration_web/ios`)
- video_player (from `.symlinks/plugins/video_player/ios`)
- video_player_web (from `.symlinks/plugins/video_player_web/ios`)
- wakelock (from `.symlinks/plugins/wakelock/ios`)
- webview_flutter (from `.symlinks/plugins/webview_flutter/ios`)
- wifi (from `.symlinks/plugins/wifi/ios`)
SPEC REPOS:
trunk:
- Firebase
- FirebaseCore
- FirebaseCoreDiagnostics
- FirebaseInstallations
- FirebaseInstanceID
- FirebaseMessaging
- GoogleDataTransport
- GoogleMaps
- GoogleUtilities
- MTBBarcodeScanner
- nanopb
- NVActivityIndicatorView
- PromisesObjC
- Protobuf
- Reachability
- TOCropViewController
- Try
- TwilioVideo
EXTERNAL SOURCES:
android_intent:
:path: ".symlinks/plugins/android_intent/ios"
barcode_scan_fix:
:path: ".symlinks/plugins/barcode_scan_fix/ios"
connectivity:
:path: ".symlinks/plugins/connectivity/ios"
connectivity_for_web:
:path: ".symlinks/plugins/connectivity_for_web/ios"
connectivity_macos:
:path: ".symlinks/plugins/connectivity_macos/ios"
device_calendar:
:path: ".symlinks/plugins/device_calendar/ios"
device_info:
:path: ".symlinks/plugins/device_info/ios"
firebase_core:
:path: ".symlinks/plugins/firebase_core/ios"
firebase_core_web:
:path: ".symlinks/plugins/firebase_core_web/ios"
firebase_messaging:
:path: ".symlinks/plugins/firebase_messaging/ios"
Flutter:
:path: Flutter
flutter_email_sender:
:path: ".symlinks/plugins/flutter_email_sender/ios"
flutter_flexible_toast:
:path: ".symlinks/plugins/flutter_flexible_toast/ios"
flutter_inappwebview:
:path: ".symlinks/plugins/flutter_inappwebview/ios"
flutter_local_notifications:
:path: ".symlinks/plugins/flutter_local_notifications/ios"
flutter_plugin_android_lifecycle:
:path: ".symlinks/plugins/flutter_plugin_android_lifecycle/ios"
flutter_tts:
:path: ".symlinks/plugins/flutter_tts/ios"
geolocator:
:path: ".symlinks/plugins/geolocator/ios"
google_maps_flutter:
:path: ".symlinks/plugins/google_maps_flutter/ios"
hexcolor:
:path: ".symlinks/plugins/hexcolor/ios"
image_cropper:
:path: ".symlinks/plugins/image_cropper/ios"
image_picker:
:path: ".symlinks/plugins/image_picker/ios"
just_audio:
:path: ".symlinks/plugins/just_audio/ios"
local_auth:
:path: ".symlinks/plugins/local_auth/ios"
manage_calendar_events:
:path: ".symlinks/plugins/manage_calendar_events/ios"
map_launcher:
:path: ".symlinks/plugins/map_launcher/ios"
maps_launcher:
:path: ".symlinks/plugins/maps_launcher/ios"
native_device_orientation:
:path: ".symlinks/plugins/native_device_orientation/ios"
native_progress_hud:
:path: ".symlinks/plugins/native_progress_hud/ios"
path_provider:
:path: ".symlinks/plugins/path_provider/ios"
path_provider_linux:
:path: ".symlinks/plugins/path_provider_linux/ios"
path_provider_macos:
:path: ".symlinks/plugins/path_provider_macos/ios"
path_provider_windows:
:path: ".symlinks/plugins/path_provider_windows/ios"
permission_handler:
:path: ".symlinks/plugins/permission_handler/ios"
screen:
:path: ".symlinks/plugins/screen/ios"
shared_preferences:
:path: ".symlinks/plugins/shared_preferences/ios"
shared_preferences_linux:
:path: ".symlinks/plugins/shared_preferences_linux/ios"
shared_preferences_macos:
:path: ".symlinks/plugins/shared_preferences_macos/ios"
shared_preferences_web:
:path: ".symlinks/plugins/shared_preferences_web/ios"
shared_preferences_windows:
:path: ".symlinks/plugins/shared_preferences_windows/ios"
speech_to_text:
:path: ".symlinks/plugins/speech_to_text/ios"
twilio_programmable_video:
:path: ".symlinks/plugins/twilio_programmable_video/ios"
url_launcher:
:path: ".symlinks/plugins/url_launcher/ios"
url_launcher_linux:
:path: ".symlinks/plugins/url_launcher_linux/ios"
url_launcher_macos:
:path: ".symlinks/plugins/url_launcher_macos/ios"
url_launcher_web:
:path: ".symlinks/plugins/url_launcher_web/ios"
url_launcher_windows:
:path: ".symlinks/plugins/url_launcher_windows/ios"
vibration:
:path: ".symlinks/plugins/vibration/ios"
vibration_web:
:path: ".symlinks/plugins/vibration_web/ios"
video_player:
:path: ".symlinks/plugins/video_player/ios"
video_player_web:
:path: ".symlinks/plugins/video_player_web/ios"
wakelock:
:path: ".symlinks/plugins/wakelock/ios"
webview_flutter:
:path: ".symlinks/plugins/webview_flutter/ios"
wifi:
:path: ".symlinks/plugins/wifi/ios"
SPEC CHECKSUMS:
android_intent: 367df2f1277a74e4a90e14a8ab3df3112d087052
barcode_scan_fix: 80dd65de55f27eec6591dd077c8b85f2b79e31f1
connectivity: c4130b2985d4ef6fd26f9702e886bd5260681467
connectivity_for_web: 2b8584556930d4bd490d82b836bcf45067ce345b
connectivity_macos: e2e9731b6b22dda39eb1b128f6969d574460e191
device_calendar: 23b28a5f1ab3bf77e34542fb1167e1b8b29a98f5
device_info: d7d233b645a32c40dfdc212de5cf646ca482f175
Firebase: 8db6f2d1b2c5e2984efba4949a145875a8f65fe5
firebase_core: 5d6a02f3d85acd5f8321c2d6d62877626a670659
firebase_core_web: d501d8b946b60c8af265428ce483b0fff5ad52d1
firebase_messaging: 0aea2cd5885b65e19ede58ee3507f485c992cc75
FirebaseCore: d889d9e12535b7f36ac8bfbf1713a0836a3012cd
FirebaseCoreDiagnostics: 770ac5958e1372ce67959ae4b4f31d8e127c3ac1
FirebaseInstallations: 466c7b4d1f58fe16707693091da253726a731ed2
FirebaseInstanceID: bd3ffc24367f901a43c063b36c640b345a4a5dd1
FirebaseMessaging: 5eca4ef173de76253352511aafef774caa1cba2a
Flutter: 0e3d915762c693b495b44d77113d4970485de6ec
flutter_email_sender: f787522d0e82f50e5766c1213dbffff22fdcf009
flutter_flexible_toast: 0547e740cae0c33bb7c51bcd931233f4584e1143
flutter_inappwebview: 69dfbac46157b336ffbec19ca6dfd4638c7bf189
flutter_local_notifications: 9e4738ce2471c5af910d961a6b7eadcf57c50186
flutter_plugin_android_lifecycle: dc0b544e129eebb77a6bfb1239d4d1c673a60a35
flutter_tts: 0f492aab6accf87059b72354fcb4ba934304771d
geolocator: 057a0c63a43e9c5296d8ad845a3ac8e6df23d899
google_maps_flutter: c7f9c73576de1fbe152a227bfd6e6c4ae8088619
GoogleDataTransport: f56af7caa4ed338dc8e138a5d7c5973e66440833
GoogleMaps: 4b5346bddfe6911bb89155d43c903020170523ac
GoogleUtilities: 7f2f5a07f888cdb145101d6042bc4422f57e70b3
hexcolor: fdfb9c4258ad96e949c2dbcdf790a62194b8aa89
image_cropper: c8f9b4157933c7bb965a66d1c5e6c8fd408c6eb4
image_picker: 9c3312491f862b28d21ecd8fdf0ee14e601b3f09
just_audio: baa7252489dbcf47a4c7cc9ca663e9661c99aafa
local_auth: 25938960984c3a7f6e3253e3f8d962fdd16852bd
manage_calendar_events: 0338d505ea26cdfd20cd883279bc28afa11eca34
map_launcher: e325db1261d029ff33e08e03baccffe09593ffea
maps_launcher: eae38ee13a9c3f210fa04e04bb4c073fa4c6ed92
MTBBarcodeScanner: f453b33c4b7dfe545d8c6484ed744d55671788cb
nanopb: 59317e09cf1f1a0af72f12af412d54edf52603fc
native_device_orientation: e24d00be281de72996640885d80e706142707660
native_progress_hud: f95f5529742b36a3c7fdecfa88dc018319e39bf9
NVActivityIndicatorView: 1f6c5687f1171810aa27a3296814dc2d7dec3667
path_provider: abfe2b5c733d04e238b0d8691db0cfd63a27a93c
path_provider_linux: 4d630dc393e1f20364f3e3b4a2ff41d9674a84e4
path_provider_macos: f760a3c5b04357c380e2fddb6f9db6f3015897e0
path_provider_windows: a2b81600c677ac1959367280991971cb9a1edb3b
permission_handler: eac8e15b4a1a3fba55b761d19f3f4e6b005d15b6
PromisesObjC: 8c196f5a328c2cba3e74624585467a557dcb482f
Protobuf: 3dac39b34a08151c6d949560efe3f86134a3f748
Reachability: 33e18b67625424e47b6cde6d202dce689ad7af96
screen: abd91ca7bf3426e1cc3646d27e9b2358d6bf07b0
shared_preferences: af6bfa751691cdc24be3045c43ec037377ada40d
shared_preferences_linux: afefbfe8d921e207f01ede8b60373d9e3b566b78
shared_preferences_macos: f3f29b71ccbb56bf40c9dd6396c9acf15e214087
shared_preferences_web: 141cce0c3ed1a1c5bf2a0e44f52d31eeb66e5ea9
shared_preferences_windows: 36b76d6f54e76ead957e60b49e2f124b4cd3e6ae
speech_to_text: b43a7d99aef037bd758ed8e45d79bbac035d2dfe
TOCropViewController: da59f531f8ac8a94ef6d6c0fc34009350f9e8bfe
Try: 5ef669ae832617b3cee58cb2c6f99fb767a4ff96
twilio_programmable_video: 6a41593640f3d86af60b22541fd457b22deaae7f
TwilioVideo: 5257640fab00d1b9f44db060815b03516a9eb0e8
url_launcher: 6fef411d543ceb26efce54b05a0a40bfd74cbbef
url_launcher_linux: ac237cb7a8058736e4aae38bdbcc748a4b394cc0
url_launcher_macos: fd7894421cd39320dce5f292fc99ea9270b2a313
url_launcher_web: e5527357f037c87560776e36436bf2b0288b965c
url_launcher_windows: 683d7c283894db8d1914d3ab2223b20cc1ad95d5
vibration: b5a33e764c3f609a975b9dca73dce20fdde627dc
vibration_web: 0ba303d92469ba34d71c612a228b315908d7fcd9
video_player: 9cc823b1d9da7e8427ee591e8438bfbcde500e6e
video_player_web: da8cadb8274ed4f8dbee8d7171b420dedd437ce7
wakelock: 0d4a70faf8950410735e3f61fb15d517c8a6efc4
webview_flutter: d2b4d6c66968ad042ad94cbb791f5b72b4678a96
wifi: d7d77c94109e36c4175d845f0a5964eadba71060
PODFILE CHECKSUM: 5a17be3f8af73a757fa4439c77cf6ab2db29a6e7
PODFILE CHECKSUM: d94bd40f28772938199c67fcced06ffe96096c14
COCOAPODS: 1.10.0
COCOAPODS: 1.10.1

@ -28,8 +28,10 @@
E923EFD62587443800E3E751 /* HMGPlatformBridge.swift in Sources */ = {isa = PBXBuildFile; fileRef = E923EFD52587443800E3E751 /* HMGPlatformBridge.swift */; };
E923EFD82588D17700E3E751 /* gpx.gpx in Resources */ = {isa = PBXBuildFile; fileRef = E923EFD72588D17700E3E751 /* gpx.gpx */; };
E9620805255C2ED100D3A35D /* NetworkExtension.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E9620804255C2ED100D3A35D /* NetworkExtension.framework */; };
E9A35329258B8E8F00CBA688 /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = E9A35328258B8E8F00CBA688 /* GoogleService-Info.plist */; };
E9C8C136256BACDA00EFFB62 /* HMG_Guest.swift in Sources */ = {isa = PBXBuildFile; fileRef = E9C8C135256BACDA00EFFB62 /* HMG_Guest.swift */; };
E9E27168256E3A4000F49B69 /* LocalizedFromFlutter.swift in Sources */ = {isa = PBXBuildFile; fileRef = E9E27167256E3A4000F49B69 /* LocalizedFromFlutter.swift */; };
E9F7623B25922BCE00FB5CCF /* FlutterConstants.swift in Sources */ = {isa = PBXBuildFile; fileRef = E9F7623A25922BCE00FB5CCF /* FlutterConstants.swift */; };
/* End PBXBuildFile section */
/* Begin PBXCopyFilesBuildPhase section */
@ -78,8 +80,10 @@
E923EFD72588D17700E3E751 /* gpx.gpx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = gpx.gpx; sourceTree = "<group>"; };
E9620803255C2ED100D3A35D /* Runner.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = Runner.entitlements; sourceTree = "<group>"; };
E9620804255C2ED100D3A35D /* NetworkExtension.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = NetworkExtension.framework; path = System/Library/Frameworks/NetworkExtension.framework; sourceTree = SDKROOT; };
E9A35328258B8E8F00CBA688 /* GoogleService-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "GoogleService-Info.plist"; sourceTree = "<group>"; };
E9C8C135256BACDA00EFFB62 /* HMG_Guest.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HMG_Guest.swift; sourceTree = "<group>"; };
E9E27167256E3A4000F49B69 /* LocalizedFromFlutter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LocalizedFromFlutter.swift; sourceTree = "<group>"; };
E9F7623A25922BCE00FB5CCF /* FlutterConstants.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FlutterConstants.swift; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
@ -128,6 +132,7 @@
97C146E51CF9000F007C117D = {
isa = PBXGroup;
children = (
E9A35328258B8E8F00CBA688 /* GoogleService-Info.plist */,
E923EFD72588D17700E3E751 /* gpx.gpx */,
9740EEB11CF90186004384FC /* Flutter */,
97C146F01CF9000F007C117D /* Runner */,
@ -177,6 +182,7 @@
E923EFD125863FDF00E3E751 /* GeoZoneModel.swift */,
E923EFD3258645C100E3E751 /* HMG_Geofence.swift */,
E923EFD52587443800E3E751 /* HMGPlatformBridge.swift */,
E9F7623A25922BCE00FB5CCF /* FlutterConstants.swift */,
);
path = Helper;
sourceTree = "<group>";
@ -213,8 +219,7 @@
97C146EC1CF9000F007C117D /* Resources */,
9705A1C41CF9048500538489 /* Embed Frameworks */,
3B06AD1E1E4923F5004D2608 /* Thin Binary */,
125A739F71A29FBAE7B4D5AC /* [CP] Embed Pods Frameworks */,
940F4A376A48B060117A1E5D /* [CP] Copy Pods Resources */,
EFDAD5E1235DCA1DB6187148 /* [CP] Embed Pods Frameworks */,
);
buildRules = (
);
@ -265,6 +270,7 @@
files = (
E91B53A0256AAC1400E96549 /* GuestPOC_Certificate.cer in Resources */,
97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */,
E9A35329258B8E8F00CBA688 /* GoogleService-Info.plist in Resources */,
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */,
E923EFD82588D17700E3E751 /* gpx.gpx in Resources */,
E91B539F256AAC1400E96549 /* GuestPOC_Certificate.p12 in Resources */,
@ -277,23 +283,6 @@
/* End PBXResourcesBuildPhase section */
/* Begin PBXShellScriptBuildPhase section */
125A739F71A29FBAE7B4D5AC /* [CP] Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist",
);
name = "[CP] Embed Pods Frameworks";
outputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
299B8FE131E5BAE7FA7E2FC9 /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
@ -330,36 +319,36 @@
shellPath = /bin/sh;
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin";
};
940F4A376A48B060117A1E5D /* [CP] Copy Pods Resources */ = {
9740EEB61CF901F6004384FC /* Run Script */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources-${CONFIGURATION}-input-files.xcfilelist",
inputPaths = (
);
name = "[CP] Copy Pods Resources";
outputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources-${CONFIGURATION}-output-files.xcfilelist",
name = "Run Script";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources.sh\"\n";
showEnvVarsInLog = 0;
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build";
};
9740EEB61CF901F6004384FC /* Run Script */ = {
EFDAD5E1235DCA1DB6187148 /* [CP] Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
inputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist",
);
name = "Run Script";
outputPaths = (
name = "[CP] Embed Pods Frameworks";
outputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build";
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
/* End PBXShellScriptBuildPhase section */
@ -374,6 +363,7 @@
E91B5396256AAA6500E96549 /* GlobalHelper.swift in Sources */,
E923EFD4258645C100E3E751 /* HMG_Geofence.swift in Sources */,
E923EFD62587443800E3E751 /* HMGPlatformBridge.swift in Sources */,
E9F7623B25922BCE00FB5CCF /* FlutterConstants.swift in Sources */,
74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */,
E9E27168256E3A4000F49B69 /* LocalizedFromFlutter.swift in Sources */,
1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */,
@ -472,7 +462,7 @@
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
DEVELOPMENT_TEAM = "";
DEVELOPMENT_TEAM = 3A359E86ZF;
ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
@ -488,7 +478,7 @@
"$(inherited)",
"$(PROJECT_DIR)/Flutter",
);
PRODUCT_BUNDLE_IDENTIFIER = "com.HMG.HMG-Smartphone";
PRODUCT_BUNDLE_IDENTIFIER = com.hmg.smartphone;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
SWIFT_VERSION = 5.0;
@ -611,7 +601,7 @@
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
DEVELOPMENT_TEAM = "";
DEVELOPMENT_TEAM = 3A359E86ZF;
ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
@ -627,7 +617,7 @@
"$(inherited)",
"$(PROJECT_DIR)/Flutter",
);
PRODUCT_BUNDLE_IDENTIFIER = "com.HMG.HMG-Smartphone";
PRODUCT_BUNDLE_IDENTIFIER = com.hmg.smartphone;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
@ -644,7 +634,7 @@
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
DEVELOPMENT_TEAM = "";
DEVELOPMENT_TEAM = 3A359E86ZF;
ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
@ -660,7 +650,7 @@
"$(inherited)",
"$(PROJECT_DIR)/Flutter",
);
PRODUCT_BUNDLE_IDENTIFIER = "com.HMG.HMG-Smartphone";
PRODUCT_BUNDLE_IDENTIFIER = com.hmg.smartphone;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
SWIFT_VERSION = 5.0;

@ -2,46 +2,67 @@ import UIKit
import Flutter
import GoogleMaps
var userNotificationCenterDelegate:UNUserNotificationCenterDelegate? = nil
@UIApplicationMain
@objc class AppDelegate: FlutterAppDelegate {
let locationManager = CLLocationManager()
var flutterViewController:MainFlutterVC!
override func application( _ application: UIApplication,didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
// initLocationManager()
GMSServices.provideAPIKey("AIzaSyCiiJiHkocPbcziHt9O8rGWavDrxHRQys8")
GeneratedPluginRegistrant.register(with: self)
if let mainViewController = window.rootViewController as? MainFlutterVC{
HMGPlatformBridge.initialize(flutterViewController: mainViewController)
}
initializePlatformChannel()
if let _ = launchOptions?[.location] {
HMG_Geofence.initGeofencing()
}
UNUserNotificationCenter.current().delegate = self
return super.application(application, didFinishLaunchingWithOptions: launchOptions)
}
}
extension AppDelegate: CLLocationManagerDelegate {
func initLocationManager(){
locationManager.allowsBackgroundLocationUpdates = true
locationManager.desiredAccuracy = kCLLocationAccuracyNearestTenMeters
locationManager.activityType = .other
locationManager.delegate = self
locationManager.requestAlwaysAuthorization()
func initializePlatformChannel(){
if let mainViewController = window.rootViewController as? MainFlutterVC{ // platform initialization suppose to be in foreground
flutterViewController = mainViewController
HMGPlatformBridge.initialize(flutterViewController: flutterViewController)
}else if let mainViewController = initialViewController(){ // platform initialization suppose to be in background
flutterViewController = mainViewController
HMGPlatformBridge.initialize(flutterViewController: flutterViewController)
}
}
func locationManager(_ manager: CLLocationManager, didEnterRegion region: CLRegion) {
if region is CLCircularRegion {
func initialViewController() -> MainFlutterVC?{
return nil //UIStoryboard(name: "Main", bundle: .main).instantiateInitialViewController() as? MainFlutterVC
}
}
}
func locationManager(_ manager: CLLocationManager, didExitRegion region: CLRegion) {
if region is CLCircularRegion {
extension AppDelegate{
override func userNotificationCenter(_ center: UNUserNotificationCenter, willPresent notification: UNNotification, withCompletionHandler completionHandler: @escaping (UNNotificationPresentationOptions) -> Void) {
if (notification.request.content.categoryIdentifier == HmgLocalNotificationCategoryIdentifier){
completionHandler([.alert,.sound])
}else{
super.userNotificationCenter(center, willPresent: notification, withCompletionHandler: completionHandler)
}
}
}
}
/*
let dart = FlutterDartProject(precompiledDartBundle: .main)
let engine = FlutterEngine(name: "com.hmg.cs", project: dart, allowHeadlessExecution: true)
if engine.run(){
flutterMethodChannel = FlutterMethodChannel(name: "HMG-Platform-Bridge", binaryMessenger: engine.binaryMessenger)
Timer.scheduledTimer(withTimeInterval: 0.5, repeats: false) { (timer) in
FlutterText.with(key: "alreadyConnectedHmgNetwork"){ localized in
print(localized)
}
}
}
*/

@ -13,5 +13,10 @@ fileprivate let BASE_URL = "\(DOMAIN)/\(SERVICE)"
struct API {
static let WIFI_CREDENTIALS = "\(BASE_URL)/Hmg_SMS_Get_By_ProjectID_And_PatientID"
}
//struct API {
// static let WIFI_CREDENTIALS = FlutterConstants.WIFI_CREDENTIALS_URL
// static let LOG_GEOFENCE = FlutterConstants.LOG_GEOFENCE_URL
//}

@ -18,6 +18,24 @@ extension String{
}
}
extension Date{
func toString(format:String) -> String{
let df = DateFormatter()
df.dateFormat = format
return df.string(from: self)
}
}
extension Dictionary{
func merge(dict:[String:Any?]) -> [String:Any?]{
var self_ = self as! [String:Any?]
dict.forEach { (kv) in
self_.updateValue(kv.value, forKey: kv.key)
}
return self_
}
}
extension Bundle {
func certificate(named name: String) -> SecCertificate {

@ -0,0 +1,36 @@
//
// FlutterConstants.swift
// Runner
//
// Created by ZiKambrani on 22/12/2020.
//
import UIKit
class FlutterConstants{
static var LOG_GEOFENCE_URL:String?
static var WIFI_CREDENTIALS_URL:String?
static var DEFAULT_HTTP_PARAMS:[String:Any?]?
class func set(){
// (FiX) Take a start with FlutterMethodChannel (kikstart)
/* First call to flutter method is not returning the correct value (Always returning 'NSObject') then after it wroking fine and returning correct value*/
FlutterText.with(key: "test") { (test) in
flutterMethodChannel?.invokeMethod("getDefaultHttpParameters", arguments: nil){ (response) in
if let defaultHTTPParams = response as? [String:Any?]{
DEFAULT_HTTP_PARAMS = defaultHTTPParams
}
}
flutterMethodChannel?.invokeMethod("getLogGeofenceFullUrl", arguments:nil){ (response) in
if let url = response as? String{
LOG_GEOFENCE_URL = url
}
}
}
}
}

@ -31,27 +31,59 @@ func dictionary(from:String) -> [String:Any]?{
}
func showNotification(identifier:String? = nil, title:String?, subtitle:String?, message:String?, sound:UNNotificationSound = UNNotificationSound.default){
let notificationContent = UNMutableNotificationContent()
if identifier != nil { notificationContent.categoryIdentifier = identifier! }
if title != nil { notificationContent.title = title! }
if subtitle != nil { notificationContent.body = message! }
if message != nil { notificationContent.subtitle = subtitle! }
notificationContent.sound = UNNotificationSound.default
let trigger = UNTimeIntervalNotificationTrigger(timeInterval: 1, repeats: false)
let request = UNNotificationRequest(identifier: "\(Date().timeIntervalSinceNow)", content: notificationContent, trigger: trigger)
UNUserNotificationCenter.current().add(request) { error in
if let error = error {
print("Error: \(error)")
let HmgLocalNotificationCategoryIdentifier = "hmg.local.notification"
func showNotification(identifier:String? = nil, title:String?, subtitle:String?, message:String?, sound:UNNotificationSound = UNNotificationSound.default, categoryIdentifier:String = HmgLocalNotificationCategoryIdentifier){
DispatchQueue.main.async {
let notificationContent = UNMutableNotificationContent()
notificationContent.categoryIdentifier = categoryIdentifier
if identifier != nil { notificationContent.categoryIdentifier = identifier! }
if title != nil { notificationContent.title = title! }
if subtitle != nil { notificationContent.body = message! }
if message != nil { notificationContent.subtitle = subtitle! }
notificationContent.sound = UNNotificationSound.default
let trigger = UNTimeIntervalNotificationTrigger(timeInterval: 1, repeats: false)
let request = UNNotificationRequest(identifier: "\(Date().timeIntervalSinceNow)", content: notificationContent, trigger: trigger)
UNUserNotificationCenter.current().add(request) { error in
if let error = error {
print("Error: \(error)")
}
}
}
}
func appLanguageCode() -> Int{
let lang = UserDefaults.standard.string(forKey: "language") ?? "ar"
return lang == "ar" ? 2 : 1
}
func userProfile() -> [String:Any?]?{
var userProf = UserDefaults.standard.string(forKey: "flutter.imei-user-data")
if(userProf == nil){
userProf = UserDefaults.standard.string(forKey: "flutter.user-profile")
}
return dictionary(from: userProf ?? "{}")
}
func httpPostRequest(urlString:String, jsonBody:[String:Any], completion:((Bool,[String:Any]?)->Void)?){
let json: [String: Any] = jsonBody
fileprivate let defaultHTTPParams:[String : Any?] = [
"ZipCode" : "966",
"VersionID" : 5.8,
"Channel" : 3,
"LanguageID" : appLanguageCode(),
"IPAdress" : "10.20.10.20",
"generalid" : "Cs2020@2016$2958",
"PatientOutSA" : 0,
"SessionID" : nil,
"isDentalAllowedBackend" : false,
"DeviceTypeID" : 2
]
func httpPostRequest(urlString:String, jsonBody:[String:Any?], completion:((Bool,[String:Any]?)->Void)?){
var json: [String: Any?] = jsonBody
json = json.merge(dict: defaultHTTPParams)
let jsonData = try? JSONSerialization.data(withJSONObject: json)
// create post request
@ -77,6 +109,8 @@ func httpPostRequest(urlString:String, jsonBody:[String:Any], completion:((Bool,
completion?(false,responseJSON)
}
}else{
completion?(false,nil)
}
}

@ -49,6 +49,9 @@ class HMGPlatformBridge{
print("")
}
Timer.scheduledTimer(withTimeInterval: 0.1, repeats: false) { (timer) in
FlutterConstants.set()
}
}

@ -129,8 +129,10 @@ extension HMG_Geofence : CLLocationManagerDelegate{
extension HMG_Geofence{
func handleEvent(for region: CLRegion!, transition:Transition, location:CLLocation?) {
notifyUser(forRegion: region, transition: transition, location: locationManager.location)
notifyServer(forRegion: region, transition: transition, location: locationManager.location)
if let userProfile = userProfile(){
notifyUser(forRegion: region, transition: transition, location: locationManager.location, userProfile: userProfile)
notifyServer(forRegion: region, transition: transition, location: locationManager.location, userProfile: userProfile)
}
}
func geoZone(by id: String) -> GeoZoneModel? {
@ -144,20 +146,14 @@ extension HMG_Geofence{
}
func notifyUser(forRegion:CLRegion, transition:Transition, location:CLLocation?){
if let zone = geoZone(by: forRegion.identifier){
if UIApplication.shared.applicationState == .active {
mainViewController.showAlert(withTitle: transition.name(), message: zone.message())
}else{
func notifyUser(forRegion:CLRegion, transition:Transition, location:CLLocation?, userProfile:[String:Any?]){
if let patientId = userProfile["PatientID"] as? Int{
}
}
}
func notifyServer(forRegion:CLRegion, transition:Transition, location:CLLocation?){
df.dateFormat = "MMM/dd/yyyy hh:mm:ss"
if let userProfileJson = UserDefaults.standard.string(forKey: "flutter.user-profile"),
let userProfile = dictionary(from: userProfileJson), let patientId = userProfile["PatientID"] as? Int{
func notifyServer(forRegion:CLRegion, transition:Transition, location:CLLocation?, userProfile:[String:Any?]){
if let patientId = userProfile["PatientID"] as? Int{
if let idString = forRegion.identifier.split(separator: "_").first, let idInt = Int(idString){
let body:[String:Any] = [
@ -166,21 +162,19 @@ extension HMG_Geofence{
"PatientID":patientId
]
var logs = UserDefaults.init(suiteName: "GeoFenceLog")?.dictionary(forKey: "GEOFENCE_LOGS") ?? [:]
var geo = (logs[forRegion.identifier] as? [String]) ?? []
let url = "https://hmgwebservices.com/Services/Patients.svc/REST/GeoF_InsertPatientFileInfo"
httpPostRequest(urlString: url, jsonBody: body){ (status,json) in
let status_ = status ? "Notified" : "Not notified"
let status_ = status ? "Notified successfully:" : "Failed to notify:"
showNotification(title: transition.name(), subtitle: forRegion.identifier, message: status_)
var logs = UserDefaults.init(suiteName: "GeoFenceLog")?.dictionary(forKey: "LOGS") ?? [:]
if var geo = logs[forRegion.identifier] as? [String]{
geo.append("\(status_) at \(df.string(from: Date()))")
}else{
logs.updateValue(["\(status_) at \(df.string(from: Date()))"], forKey: forRegion.identifier)
}
UserDefaults.init(suiteName: "GeoFenceLog")?.set(logs, forKey: "LOGS")
geo.append("\(status_) \(transition.name()) at \(Date().toString(format: "dd/MMM/yyy hh:mm:ss"))")
logs.updateValue( geo, forKey: forRegion.identifier)
UserDefaults.init(suiteName: "GeoFenceLog")?.set(logs, forKey: "GEOFENCE_LOGS")
}
}
}

File diff suppressed because one or more lines are too long

@ -32,41 +32,33 @@ const WEATHER_INDICATOR = 'Services/Weather.svc/REST/GetCityInfo';
const GET_PRIVILEGE = 'Services/Patients.svc/REST/Service_Privilege';
// Wifi Credentials
const WIFI_CREDENTIALS = "Services/Patients.svc/Hmg_SMS_Get_By_ProjectID_And_PatientID";
///Doctor
const GET_MY_DOCTOR =
'Services/Doctors.svc/REST/GetPatientDoctorAppointmentResult';
const GET_MY_DOCTOR = 'Services/Doctors.svc/REST/GetPatientDoctorAppointmentResult';
const GET_DOCTOR_PROFILE = 'Services/Doctors.svc/REST/GetDocProfiles';
const GET_DOCTOR_RATING_NOTES =
'Services/Doctors.svc/REST/dr_GetNotesDoctorRating';
const GET_DOCTOR_RATING_DETAILS =
'Services/Doctors.svc/REST/dr_GetDoctorRatingDetails';
const GET_DOCTOR_RATING_NOTES = 'Services/Doctors.svc/REST/dr_GetNotesDoctorRating';
const GET_DOCTOR_RATING_DETAILS = 'Services/Doctors.svc/REST/dr_GetDoctorRatingDetails';
const GET_DOCTOR_RATING = 'Services/Doctors.svc/REST/dr_GetAvgDoctorRating';
///Prescriptions
const PRESCRIPTIONS = 'Services/Patients.svc/REST/GetPrescriptionApptList';
const GET_PRESCRIPTIONS_ALL_ORDERS =
'Services/Patients.svc/REST/PatientER_GetPatientAllPresOrders';
const GET_PRESCRIPTION_REPORT =
'Services/Patients.svc/REST/INP_GetPrescriptionReport';
const SEND_PRESCRIPTION_EMAIL =
'Services/Notifications.svc/REST/SendPrescriptionEmail';
const GET_PRESCRIPTION_REPORT_ENH =
'Services/Patients.svc/REST/GetPrescriptionReport_enh';
const GET_PRESCRIPTIONS_ALL_ORDERS = 'Services/Patients.svc/REST/PatientER_GetPatientAllPresOrders';
const GET_PRESCRIPTION_REPORT = 'Services/Patients.svc/REST/INP_GetPrescriptionReport';
const SEND_PRESCRIPTION_EMAIL = 'Services/Notifications.svc/REST/SendPrescriptionEmail';
const GET_PRESCRIPTION_REPORT_ENH = 'Services/Patients.svc/REST/GetPrescriptionReport_enh';
///Lab Order
const GET_Patient_LAB_ORDERS = 'Services/Patients.svc/REST/GetPatientLabOrders';
const GET_Patient_LAB_SPECIAL_RESULT = 'Services/Patients.svc/REST/GetPatientLabSpecialResults';
const SEND_LAB_RESULT_EMAIL =
'Services/Notifications.svc/REST/SendLabReportEmail';
const GET_Patient_LAB_RESULT =
'Services/Patients.svc/REST/GetPatientLabResults';
const GET_Patient_LAB_ORDERS_RESULT =
'Services/Patients.svc/REST/GetPatientLabOrdersResults';
const SEND_LAB_RESULT_EMAIL = 'Services/Notifications.svc/REST/SendLabReportEmail';
const GET_Patient_LAB_RESULT = 'Services/Patients.svc/REST/GetPatientLabResults';
const GET_Patient_LAB_ORDERS_RESULT = 'Services/Patients.svc/REST/GetPatientLabOrdersResults';
///
const GET_PATIENT_ORDERS = 'Services/Patients.svc/REST/GetPatientRadOrders';
const GET_PATIENT_LAB_ORDERS_BY_APPOINTMENT =
'Services/Patients.svc/REST/GetPatientLabResultsByAppointmentNo';
const GET_PATIENT_LAB_ORDERS_BY_APPOINTMENT = 'Services/Patients.svc/REST/GetPatientLabResultsByAppointmentNo';
const GET_PATIENT_ORDERS_DETAILS = 'Services/Patients.svc/REST/Rad_UpdatePatientRadOrdersToRead';
const GET_RAD_IMAGE_URL = 'Services/Patients.svc/Rest/GetRadImageURL';
@ -131,8 +123,7 @@ const GET_BLOOD_REQUEST = 'services/PatientVarification.svc/REST/BloodDonation_G
///Reports
const REPORTS = 'Services/Doctors.svc/REST/GetPatientMedicalReportStatusInfo';
const INSERT_REQUEST_FOR_MEDICAL_REPORT = 'Services/Doctors.svc/REST/InsertRequestForMedicalReport';
const SEND_MEDICAL_REPORT_EMAIL =
'Services/Notifications.svc/REST/SendMedicalReportEmail';
const SEND_MEDICAL_REPORT_EMAIL = 'Services/Notifications.svc/REST/SendMedicalReportEmail';
///Rate
const IS_LAST_APPOITMENT_RATED = 'Services/Doctors.svc/REST/IsLastAppoitmentRated';
@ -225,8 +216,10 @@ const GET_LIVECARE_HISTORY = 'Services/ER_VirtualCall.svc/REST/GetPatientErVirtu
const CANCEL_LIVECARE_REQUEST = 'Services/ER_VirtualCall.svc/REST/DeleteErRequest';
const SEND_LIVECARE_INVOICE_EMAIL = 'Services/Notifications.svc/REST/SendInvoiceForLiveCare';
const GET_USER_TERMS = '/Services/Patients.svc/REST/GetUserTermsAndConditions';
const UPDATE_HEALTH_TERMS = '/services/Patients.svc/REST/UpdatePateintHealthSummaryReport';
const GET_USER_TERMS = 'Services/Patients.svc/REST/GetUserTermsAndConditions';
const UPDATE_HEALTH_TERMS = 'services/Patients.svc/REST/UpdatePateintHealthSummaryReport';
const GET_PATIENT_HEALTH_STATS = 'Services/Patients.svc/REST/Med_GetTransactionsSts';
//URL to get medicine and pharmacies list
const CHANNEL = 3;
@ -249,10 +242,8 @@ const GET_PAtIENTS_INSURANCE = "Services/Patients.svc/REST/Get_PatientInsuranceD
const GET_PAtIENTS_INSURANCE_UPDATED = "Services/Patients.svc/REST/PatientER_GetPatientInsuranceCardUpdateHistory";
const INSURANCE_DETAILS = "Services/Patients.svc/REST/Get_InsuranceCheckList";
const GET_PATIENT_INSURANCE_DETAILS =
"Services/Patients.svc/REST/PatientER_GetPatientInsuranceDetails";
const UPLOAD_INSURANCE_CARD =
'Services/Patients.svc/REST/PatientER_PatientInfoForInsuranceCardUpdate';
const GET_PATIENT_INSURANCE_DETAILS = "Services/Patients.svc/REST/PatientER_GetPatientInsuranceDetails";
const UPLOAD_INSURANCE_CARD = 'Services/Patients.svc/REST/PatientER_PatientInfoForInsuranceCardUpdate';
const GET_VACCINES = "Services/Patients.svc/REST/GetDoneVaccinesByPatientID";
const GET_VACCINES_EMAIL = "Services/Notifications.svc/REST/SendVaccinesEmail";
@ -285,15 +276,25 @@ const GET_PATIENT_LAST_RECORD = 'Services/Patients.svc/REST/Med_GetPatientLastRe
const GET_DIABETIC_RESULT_AVERAGE = 'Services/Patients.svc/REST/Patient_GetDiabeticResultAverage';
const GET_DIABTEC_RESULT = 'Services/Patients.svc/REST/Patient_GetDiabtecResults';
const ADD_DIABTEC_RESULT = 'Services/Patients.svc/REST/Patient_AddDiabtecResult';
const SEND_AVERAGE_BLOOD_SUGAR_REPORT = 'Services/Notifications.svc/REST/SendAverageBloodSugarReport';
const DEACTIVATE_DIABETIC_STATUS = 'services/Patients.svc/REST/Patient_DeactivateDiabeticStatus';
const DEACTIVATE_BLOOD_PRESSURES_STATUS = 'services/Patients.svc/REST/Patient_DeactivateBloodPressureStatus';
const GET_BLOOD_PRESSURE_RESULT_AVERAGE = 'Services/Patients.svc/REST/Patient_GetBloodPressureResultAverage';
const GET_BLOOD_PRESSURE_RESULT = 'Services/Patients.svc/REST/Patient_GetBloodPressureResult';
const ADD_BLOOD_PRESSURE_RESULT = 'Services/Patients.svc/REST/Patient_AddBloodPressureResult';
const UPDATE_BLOOD_PRESSURE_RESULT = 'Services/Patients.svc/REST/Patient_UpdateBloodPressureResult';
const SEND_AVERAGE_BLOOD_WEIGHT_REPORT = 'Services/Notifications.svc/REST/SendAverageBodyWeightReport';
const SEND_AVERAGE_BLOOD_PRESSURE_REPORT = 'Services/Notifications.svc/REST/SendAverageBloodPressureReport';
const UPDATE_DIABETIC_RESULT = 'Services/Patients.svc/REST/Patient_UpdateDiabeticResult';
const GET_WEIGHT_PRESSURE_RESULT_AVERAGE = 'Services/Patients.svc/REST/Patient_GetWeightMeasurementResultAverage';
const GET_WEIGHT_PRESSURE_RESULT = 'Services/Patients.svc/REST/Patient_GetWeightMeasurementResult';
const ADD_WEIGHT_PRESSURE_RESULT = 'Services/Patients.svc/REST/Patient_AddWeightMeasurementResult';
const UPDATE_WEIGHT_PRESSURE_RESULT = 'Services/Patients.svc/REST/Patient_UpdateWeightMeasurementResult';
const DEACTIVATE_WEIGHT_PRESSURE_RESULT = 'services/Patients.svc/REST/Patient_DeactivateWeightMeasurementStatus';
const ADD_ACTIVE_PRESCRIPTIONS_REPORT_BY_PATIENT_ID = 'Services/Patients.svc/Rest/GetActivePrescriptionReportByPatientID';
const GET_CALL_INFO_HOURS_RESULT = 'Services/Doctors.svc/REST/GetCallInfoHoursResult';
@ -305,8 +306,11 @@ const INSERT_CALL_INFO = 'Services/Doctors.svc/REST/InsertCallInfo';
const GET_PATIENT_ALLERGIES = 'Services/Patients.svc/REST/GetPatientAllergies';
// H2O
const H2O_GET_USER_DETAIL = "Services/H2ORemainder.svc/REST/H2O_GetUserDetails_New";
const H2O_UPDATE_USER_DETAIL = "Services/H2ORemainder.svc/REST/H2O_UpdateUserDetails_New";
const H2O_GET_USER_PROGRESS = "Services/H2ORemainder.svc/REST/H2O_GetUserProgress";
const H2O_INSERT_USER_ACTIVITY = "Services/H2ORemainder.svc/REST/H2O_InsertUserActivity";
const H2O_UNDO_USER_ACTIVITY = "Services/H2ORemainder.svc/REST/H2o_UndoUserActivity";
//E_Referral Services
const GET_ALL_RELATIONSHIP_TYPES = "Services/Patients.svc/REST/GetAllRelationshipTypes";
@ -320,42 +324,38 @@ const GET_E_REFERRALS = "Services/Patients.svc/REST/GetEReferrals";
// const GET_WISHLIST = "http://swd-pharapp-01:7200/api/shopping_cart_items/";
// pharmacy
const PHARMACY_VERIFY_CUSTOMER = "epharmacy/api/VerifyCustomer";
const PHARMACY_GET_COUNTRY = "epharmacy/api/countries";
const PHARMACY_AUTORZIE_CUSTOMER = "epharmacy/api/AutorizeCustomer";
const PHARMACY_VERIFY_CUSTOMER = "VerifyCustomer";
const PHARMACY_GET_COUNTRY = "countries";
const PHARMACY_CREATE_CUSTOMER = "epharmacy/api/CreateCustomer";
const GET_PHARMACY_BANNER = "epharmacy/api/promotionbanners";
const GET_PHARMACY_TOP_MANUFACTURER = "epharmacy/api/topmanufacturer";
const GET_PHARMACY_BEST_SELLER_PRODUCT = "epharmacy/api/bestsellerproducts";
const GET_PHARMACY_PRODUCTs_BY_IDS = "epharmacy/api/productsbyids/";
const GET_CUSTOMERS_ADDRESSES = "epharmacy/api/Customers/";
const GET_PHARMACY_BANNER = "promotionbanners";
const GET_PHARMACY_TOP_MANUFACTURER = "topmanufacturer";
const GET_PHARMACY_BEST_SELLER_PRODUCT = "bestsellerproducts";
const GET_PHARMACY_PRODUCTs_BY_IDS = "productsbyids/";
const GET_PHARMACY_PRODUCTs_BY_SKU = "productbysku/";
const GET_CUSTOMERS_ADDRESSES = "Customers/";
const SUBSCRIBE_PRODUCT = "subscribe?";
const GET_ORDER = "orders?";
const GET_ORDER_DETAILS = "epharmacy/api/orders/";
const GET_ORDER_DETAILS = "orders/";
const ADD_CUSTOMER_ADDRESS = "epharmacy/api/addcustomeraddress";
const EDIT_CUSTOMER_ADDRESS = "epharmacy/api/editcustomeraddress";
const DELETE_CUSTOMER_ADDRESS = "epharmacy/api/deletecustomeraddress";
const GET_ADDRESS = "Customers/";
const GET_Cancel_ORDER = "cancelorder/";
const WRITE_REVIEW = "Content-Type" + "text/plain; charset=utf-8";
const GET_SHOPPING_CART = "epharmacy/api/shopping_cart_items/";
const GET_SHIPPING_OPTIONS = "epharmacy/api/get_shipping_option/";
const GET_SHOPPING_CART = "shopping_cart_items/";
const GET_SHIPPING_OPTIONS = "get_shipping_option/";
const DELETE_SHOPPING_CART = "epharmacy/api/delete_shopping_cart_items/";
const DELETE_SHOPPING_CART_ALL =
"epharmacy/api/delete_shopping_cart_item_by_customer/";
const DELETE_SHOPPING_CART_ALL = "delete_shopping_cart_item_by_customer/";
const ORDER_SHOPPING_CART = "epharmacy/api/orders";
const GET_LACUM_ACCOUNT_INFORMATION =
"Services/Patients.svc/REST/GetLakumAccountInformation";
const GET_LACUM_GROUP_INFORMATION =
"Services/Patients.svc/REST/GetlakumInQueryInfoGrouping";
const LACUM_ACCOUNT_ACTIVATE =
"Services/Patients.svc/REST/LakumAccountActivation";
const LACUM_ACCOUNT_DEACTIVATE =
"Services/Patients.svc/REST/LakumAccountDeactivation";
const CREATE_LAKUM_ACCOUNT =
"Services/Patients.svc/REST/PHR_CreateLakumAccount";
const TRANSFER_YAHALA_LOYALITY_POINTS =
"Services/Patients.svc/REST/TransferYaHalaLoyaltyPoints";
const LAKUM_GET_USER_TERMS_AND_CONDITIONS =
"Services/ERP.svc/REST/GetUserTermsAndConditionsForEPharmcy";
const GET_LACUM_ACCOUNT_INFORMATION = "Services/Patients.svc/REST/GetLakumAccountInformation";
const GET_LACUM_GROUP_INFORMATION = "Services/Patients.svc/REST/GetlakumInQueryInfoGrouping";
const LACUM_ACCOUNT_ACTIVATE = "Services/Patients.svc/REST/LakumAccountActivation";
const LACUM_ACCOUNT_DEACTIVATE = "Services/Patients.svc/REST/LakumAccountDeactivation";
const CREATE_LAKUM_ACCOUNT = "Services/Patients.svc/REST/PHR_CreateLakumAccount";
const TRANSFER_YAHALA_LOYALITY_POINTS = "Services/Patients.svc/REST/TransferYaHalaLoyaltyPoints";
const LAKUM_GET_USER_TERMS_AND_CONDITIONS = "Services/ERP.svc/REST/GetUserTermsAndConditionsForEPharmcy";
const PRESCRIPTION = 'Services/Patients.svc/REST/GetPrescriptionApptList';
// Home Health Care
const HHC_GET_ALL_SERVICES = "Services/Patients.svc/REST/PatientER_HHC_GetAllServices";
@ -364,15 +364,13 @@ const PATIENT_ER_UPDATE_PRES_ORDER = "Services/Patients.svc/REST/PatientER_Updat
const GET_ORDER_DETAIL_BY_ID = "Services/Patients.svc/REST/PatientER_HHC_GetTransactionsForOrder";
const GET_CMC_ORDER_DETAIL_BY_ID = "Services/Patients.svc/REST/PatientER_CMC_GetTransactionsForOrder";
const GET_CHECK_UP_ITEMS = "Services/Patients.svc/REST/GetCheckUpItems";
const PUSH_NOTIFICATION_GET_ALL_NOTIFICATIONS =
'Services/MobileNotifications.svc/REST/PushNotification_GetAllNotifications';
const PUSH_NOTIFICATION_SET_MESSAGES_FROM_POOL_AS_READ =
'Services/MobileNotifications.svc/REST/PushNotification_SetMessagesFromPoolAsRead';
const GET_PATIENT_ALL_PRES_ORD =
'Services/Patients.svc/REST/PatientER_GetPatientAllPresOrders';
const PATIENT_ER_INSERT_PRES_ORDER =
'Services/Patients.svc/REST/PatientER_InsertPresOrder';
const PUSH_NOTIFICATION_GET_ALL_NOTIFICATIONS = 'Services/MobileNotifications.svc/REST/PushNotification_GetAllNotifications';
const PUSH_NOTIFICATION_SET_MESSAGES_FROM_POOL_AS_READ = 'Services/MobileNotifications.svc/REST/PushNotification_SetMessagesFromPoolAsRead';
const GET_PATIENT_ALL_PRES_ORD = 'Services/Patients.svc/REST/PatientER_GetPatientAllPresOrders';
const PATIENT_ER_INSERT_PRES_ORDER = 'Services/Patients.svc/REST/PatientER_InsertPresOrder';
const PHARMACY_MAKE_REVIEW = 'epharmacy/api/insertreviews';
const BLOOD_DONATION_REGISTER_BLOOD_TYPE = 'Services/PatientVarification.svc/REST/BloodDonation_RegisterBloodType';
const ADD_USER_AGREEMENT_FOR_BLOOD_DONATION = 'Services/PatientVarification.svc/REST/AddUserAgreementForBloodDonation';
//Pharmacy wishlist
const GET_WISHLIST = "shopping_cart_items/";
@ -386,39 +384,32 @@ const GET_SPECIFICATION = "productspecification/";
const GET_BRAND_ITEMS = "products?ManufacturerId=";
// External API
const ADD_ADDRESS_INFO =
"https://mdlaboratories.com/exacartapi/api/addcustomeraddress";
const GET_CUSTOMER_ADDRESSES =
"https://mdlaboratories.com/exacartapi/api/Customers/";
const GET_CUSTOMER_INFO =
"https://mdlaboratories.com/exacartapi/api/VerifyCustomer";
const ADD_ADDRESS_INFO = "https://mdlaboratories.com/exacartapi/api/addcustomeraddress";
const GET_CUSTOMER_ADDRESSES = "https://mdlaboratories.com/exacartapi/api/Customers/";
const GET_CUSTOMER_INFO = "https://mdlaboratories.com/exacartapi/api/VerifyCustomer";
//Pharmacy
const GET_PHARMACY_CATEGORISE =
'epharmacy/api/categories?fields=id,name,namen,description,image,localized_names,display_order,parent_category_id,is_leaf&parent_id=0';
const GET_OFFERS_CATEGORISE = 'epharmacy/api/discountcategories';
const GET_OFFERS_PRODUCTS = 'epharmacy/api/offerproducts/';
const GET_CATEGORISE_PARENT =
'epharmacy/api/categories?fields=id,name,namen,description,image,localized_names,display_order,parent_category_id,is_leaf&parent_id=';
const GET_PARENT_PRODUCTS = 'epharmacy/api/products?categoryid=';
const GET_SUB_CATEGORISE =
'epharmacy/api/categories?fields=id,name,namen,description,image,localized_names,display_order,parent_category_id,is_leaf&parent_id=';
const GET_SUB_PRODUCTS = 'epharmacy/api/products?categoryid=';
const GET_PHARMACY_CATEGORISE = 'categories?fields=id,name,namen,description,image,localized_names,display_order,parent_category_id,is_leaf&parent_id=0';
const GET_OFFERS_CATEGORISE = 'discountcategories';
const GET_OFFERS_PRODUCTS = 'offerproducts/';
const GET_CATEGORISE_PARENT = 'categories?fields=id,name,namen,description,image,localized_names,display_order,parent_category_id,is_leaf&parent_id=';
const GET_PARENT_PRODUCTS = 'products?categoryid=';
const GET_SUB_CATEGORISE = 'categories?fields=id,name,namen,description,image,localized_names,display_order,parent_category_id,is_leaf&parent_id=';
const GET_SUB_PRODUCTS = 'products?categoryid=';
const GET_FINAL_PRODUCTS =
'epharmacy/api/products?fields=id,reviews,discount_ids,name,namen,localized_names,display_order,short_description,full_description,full_descriptionn,sku,order_minimum_quantity,order_maximum_quantity,price,old_price,images,is_rx,rx_message,rx_messagen,discount_name,discount_namen,approved_rating_sum,approved_total_reviews,allow_back_in_stock_subscriptions,stock_quantity,stock_availability,stock_availabilityn,discount_percentage&CategoryId=';
'products?fields=id,reviews,discount_ids,name,namen,localized_names,display_order,short_description,full_description,full_descriptionn,sku,order_minimum_quantity,order_maximum_quantity,price,old_price,images,is_rx,rx_message,rx_messagen,discount_name,discount_namen,approved_rating_sum,approved_total_reviews,allow_back_in_stock_subscriptions,stock_quantity,stock_availability,stock_availabilityn,discount_percentage&CategoryId=';
const TIMER_MIN = 10;
const GOOGLE_API_KEY = "AIzaSyCmevVlr2Bh-c8W1VUzo8gt8JRY7n5PANw";
const GET_BRANDS_LIST = 'epharmacy/api/categoryManufacturer?categoryids=';
const GET_BRANDS_LIST = 'categoryManufacturer?categoryids=';
const GET_SEARCH_PRODUCTS =
'epharmacy/api/searchproducts?fields=id,discount_ids,reviews,name,namen,localized_names,display_order,short_description,full_description,full_descriptionn,sku,order_minimum_quantity,order_maximum_quantity,price,old_price,images,is_rx,rx_message,rx_messagen,discount_name,discount_namen,approved_rating_sum,approved_total_reviews,allow_back_in_stock_subscriptions,stock_quantity,stock_availability,stock_availabilityn,discount_percentage&search_key=';
'searchproducts?fields=id,discount_ids,reviews,name,namen,localized_names,display_order,short_description,full_description,full_descriptionn,sku,order_minimum_quantity,order_maximum_quantity,price,old_price,images,is_rx,rx_message,rx_messagen,discount_name,discount_namen,approved_rating_sum,approved_total_reviews,allow_back_in_stock_subscriptions,stock_quantity,stock_availability,stock_availabilityn,discount_percentage&search_key=';
const SCAN_QR_CODE = 'epharmacy/api/productbysku/';
const SCAN_QR_CODE = 'productbysku/';
class AppGlobal {
static var context;
@ -427,7 +418,6 @@ class AppGlobal {
Request getPublicRequest() {
Request request = new Request();
request.VersionID = 5.6; //3.6;
request.Channel = 3;
request.IPAdress = "10.20.10.20";
request.generalid = 'Cs2020@2016\$2958';

File diff suppressed because it is too large Load Diff

@ -26,3 +26,4 @@ const WEATHER = 'weather';
const BLOOD_TYPE = 'blood-type';
const NOTIFICATION_COUNT = 'notification-count';
const PHARMACY_SELECTED_ADDRESS = 'selected-address';
const PHARMACY_AUTORZIE_TOKEN = 'PHARMACY_AUTORZIE_TOKEN';

@ -1,3 +1,4 @@
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:flutter/cupertino.dart';
enum Ambulate { Wheelchair, Walker, Stretcher, None }
@ -6,19 +7,19 @@ extension SelectedAmbulate on Ambulate {
String getAmbulateTitle(BuildContext context) {
switch (this) {
case Ambulate.Wheelchair:
return 'Wheelchair';
return TranslationBase.of(context).wheelchair;
break;
case Ambulate.Walker:
return 'Walker';
return TranslationBase.of(context).walker;
break;
case Ambulate.Stretcher:
return 'Stretcher';
return TranslationBase.of(context).stretcher;
break;
case Ambulate.None:
return 'None';
return TranslationBase.of(context).none;
break;
}
return 'None';
return TranslationBase.of(context).none;
}
int selectAmbulateNumber() {

@ -0,0 +1,104 @@
class UserDetailModel {
int userID;
int patientID;
int patientType;
bool patientOutSA;
String firstName;
String middleName;
String lastName;
String firstNameN;
String middleNameN;
String lastNameN;
String identificationNo;
String mobile;
String emailID;
String zipCode;
String dOB;
String gender;
int activityID;
String createdDate;
double height;
double weight;
bool isHeightInCM;
bool isWeightInKG;
bool isNotificationON;
UserDetailModel(
{this.userID,
this.patientID,
this.patientType,
this.patientOutSA,
this.firstName,
this.middleName,
this.lastName,
this.firstNameN,
this.middleNameN,
this.lastNameN,
this.identificationNo,
this.mobile,
this.emailID,
this.zipCode,
this.dOB,
this.gender,
this.activityID,
this.createdDate,
this.height,
this.weight,
this.isHeightInCM,
this.isWeightInKG,
this.isNotificationON});
UserDetailModel.fromJson(Map<String, dynamic> json) {
userID = json['UserID'];
patientID = json['PatientID'];
patientType = json['PatientType'];
patientOutSA = json['PatientOutSA'];
firstName = json['FirstName'];
middleName = json['MiddleName'];
lastName = json['LastName'];
firstNameN = json['FirstNameN'];
middleNameN = json['MiddleNameN'];
lastNameN = json['LastNameN'];
identificationNo = json['IdentificationNo'];
mobile = json['Mobile'];
emailID = json['EmailID'];
zipCode = json['ZipCode'];
dOB = json['DOB'];
gender = json['Gender'];
activityID = json['ActivityID'];
createdDate = json['CreatedDate'];
height = json['Height'];
weight = json['Weight'];
isHeightInCM = json['IsHeightInCM'];
isWeightInKG = json['IsWeightInKG'];
isNotificationON = json['IsNotificationON'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['UserID'] = this.userID;
data['PatientID'] = this.patientID;
data['PatientType'] = this.patientType;
data['PatientOutSA'] = this.patientOutSA;
data['FirstName'] = this.firstName;
data['MiddleName'] = this.middleName;
data['LastName'] = this.lastName;
data['FirstNameN'] = this.firstNameN;
data['MiddleNameN'] = this.middleNameN;
data['LastNameN'] = this.lastNameN;
data['IdentificationNo'] = this.identificationNo;
data['Mobile'] = this.mobile;
data['EmailID'] = this.emailID;
data['ZipCode'] = this.zipCode;
data['DOB'] = this.dOB;
data['Gender'] = this.gender;
data['ActivityID'] = this.activityID;
data['CreatedDate'] = this.createdDate;
data['Height'] = this.height;
data['Weight'] = this.weight;
data['IsHeightInCM'] = this.isHeightInCM;
data['IsWeightInKG'] = this.isWeightInKG;
data['IsNotificationON'] = this.isNotificationON;
return data;
}
}

@ -0,0 +1,124 @@
class UserDetailRequestModel {
String activityID;
int channel;
int deviceTypeID;
String dOB;
String email;
String firstName;
String gender;
String generalid;
double height;
String identificationNo;
String iPAdress;
bool isDentalAllowedBackend;
bool isHeightInCM;
bool isNotificationOn;
bool isWeightInKG;
int languageID;
String lastName;
String middleName;
String mobileNumber;
int patientID;
int patientOutSA;
int patientType;
int patientTypeID;
String sessionID;
String tokenID;
double versionID;
double weight;
String zipCode;
UserDetailRequestModel(
{this.activityID,
this.channel,
this.deviceTypeID,
this.dOB,
this.email,
this.firstName,
this.gender,
this.generalid,
this.height,
this.identificationNo,
this.iPAdress,
this.isDentalAllowedBackend,
this.isHeightInCM,
this.isNotificationOn,
this.isWeightInKG,
this.languageID,
this.lastName,
this.middleName,
this.mobileNumber,
this.patientID,
this.patientOutSA,
this.patientType,
this.patientTypeID,
this.sessionID,
this.tokenID,
this.versionID,
this.weight,
this.zipCode});
UserDetailRequestModel.fromJson(Map<String, dynamic> json) {
activityID = json['ActivityID'];
channel = json['Channel'];
deviceTypeID = json['DeviceTypeID'];
dOB = json['DOB'];
email = json['Email'];
firstName = json['FirstName'];
gender = json['Gender'];
generalid = json['generalid'];
height = json['Height'];
identificationNo = json['IdentificationNo'];
iPAdress = json['IPAdress'];
isDentalAllowedBackend = json['isDentalAllowedBackend'];
isHeightInCM = json['IsHeightInCM'];
isNotificationOn = json['isNotificationOn'];
isWeightInKG = json['IsWeightInKG'];
languageID = json['LanguageID'];
lastName = json['LastName'];
middleName = json['MiddleName'];
mobileNumber = json['MobileNumber'];
patientID = json['PatientID'];
patientOutSA = json['PatientOutSA'];
patientType = json['PatientType'];
patientTypeID = json['PatientTypeID'];
sessionID = json['SessionID'];
tokenID = json['TokenID'];
versionID = json['VersionID'];
weight = json['Weight'];
zipCode = json['ZipCode'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['ActivityID'] = this.activityID;
data['Channel'] = this.channel;
data['DeviceTypeID'] = this.deviceTypeID;
data['DOB'] = this.dOB;
data['Email'] = this.email;
data['FirstName'] = this.firstName;
data['Gender'] = this.gender;
data['generalid'] = this.generalid;
data['Height'] = this.height;
data['IdentificationNo'] = this.identificationNo;
data['IPAdress'] = this.iPAdress;
data['isDentalAllowedBackend'] = this.isDentalAllowedBackend;
data['IsHeightInCM'] = this.isHeightInCM;
data['isNotificationOn'] = this.isNotificationOn;
data['IsWeightInKG'] = this.isWeightInKG;
data['LanguageID'] = this.languageID;
data['LastName'] = this.lastName;
data['MiddleName'] = this.middleName;
data['MobileNumber'] = this.mobileNumber;
data['PatientID'] = this.patientID;
data['PatientOutSA'] = this.patientOutSA;
data['PatientType'] = this.patientType;
data['PatientTypeID'] = this.patientTypeID;
data['SessionID'] = this.sessionID;
data['TokenID'] = this.tokenID;
data['VersionID'] = this.versionID;
data['Weight'] = this.weight;
data['ZipCode'] = this.zipCode;
return data;
}
}

@ -1,6 +1,7 @@
class ImagesInfo {
final String imageAr;
final String imageEn;
final bool isAsset;
ImagesInfo({this.imageAr, this.imageEn});
ImagesInfo({this.imageAr, this.imageEn, this.isAsset = false});
}

@ -18,8 +18,8 @@ class PickUpRequestPresOrder {
int pickupSpot;
dynamic dropoffLocationId;
int transportationMethodId;
double cost;
double vAT;
dynamic cost;
dynamic vAT;
double totalPrice;
int amountCollected;
int selectedAmbulate;

@ -17,7 +17,7 @@ class DiabtecPatientResult {
int patientID;
var remark;
var resultDesc;
int resultValue;
dynamic resultValue;
String unit;
var weekAverageResult;
String weekDesc;

@ -1,7 +1,7 @@
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
class WeekDiabtectResultAverage {
int dailyAverageResult;
dynamic dailyAverageResult;
DateTime dateChart;
WeekDiabtectResultAverage({this.dailyAverageResult, this.dateChart});

@ -0,0 +1,157 @@
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
class Prescriptions {
String setupID;
int projectID;
int patientID;
int appointmentNo;
String appointmentDate;
String doctorName;
String clinicDescription;
String name;
int episodeID;
int actualDoctorRate;
int admission;
int clinicID;
String companyName;
String despensedStatus;
DateTime dischargeDate;
int dischargeNo;
int doctorID;
String doctorImageURL;
int doctorRate;
String doctorTitle;
int gender;
String genderDescription;
bool isActiveDoctorProfile;
bool isDoctorAllowVedioCall;
bool isExecludeDoctor;
bool isInOutPatient;
String isInOutPatientDescription;
String isInOutPatientDescriptionN;
bool isInsurancePatient;
String nationalityFlagURL;
int noOfPatientsRate;
String qR;
List<String> speciality;
Prescriptions(
{this.setupID,
this.projectID,
this.patientID,
this.appointmentNo,
this.appointmentDate,
this.doctorName,
this.clinicDescription,
this.name,
this.episodeID,
this.actualDoctorRate,
this.admission,
this.clinicID,
this.companyName,
this.despensedStatus,
this.dischargeDate,
this.dischargeNo,
this.doctorID,
this.doctorImageURL,
this.doctorRate,
this.doctorTitle,
this.gender,
this.genderDescription,
this.isActiveDoctorProfile,
this.isDoctorAllowVedioCall,
this.isExecludeDoctor,
this.isInOutPatient,
this.isInOutPatientDescription,
this.isInOutPatientDescriptionN,
this.isInsurancePatient,
this.nationalityFlagURL,
this.noOfPatientsRate,
this.qR,
this.speciality});
Prescriptions.fromJson(Map<String, dynamic> json) {
setupID = json['SetupID'];
projectID = json['ProjectID'];
patientID = json['PatientID'];
appointmentNo = json['AppointmentNo'];
appointmentDate = json['AppointmentDate'];
doctorName = json['DoctorName'];
clinicDescription = json['ClinicDescription'];
name = json['Name'];
episodeID = json['EpisodeID'];
actualDoctorRate = json['ActualDoctorRate'];
admission = json['Admission'];
clinicID = json['ClinicID'];
companyName = json['CompanyName'];
despensedStatus = json['Despensed_Status'];
dischargeDate = DateUtil.convertStringToDate(json['DischargeDate']);
dischargeNo = json['DischargeNo'];
doctorID = json['DoctorID'];
doctorImageURL = json['DoctorImageURL'];
doctorRate = json['DoctorRate'];
doctorTitle = json['DoctorTitle'];
gender = json['Gender'];
genderDescription = json['GenderDescription'];
isActiveDoctorProfile = json['IsActiveDoctorProfile'];
isDoctorAllowVedioCall = json['IsDoctorAllowVedioCall'];
isExecludeDoctor = json['IsExecludeDoctor'];
isInOutPatient = json['IsInOutPatient'];
isInOutPatientDescription = json['IsInOutPatientDescription'];
isInOutPatientDescriptionN = json['IsInOutPatientDescriptionN'];
isInsurancePatient = json['IsInsurancePatient'];
nationalityFlagURL = json['NationalityFlagURL'];
noOfPatientsRate = json['NoOfPatientsRate'];
qR = json['QR'];
// speciality = json['Speciality'].cast<String>();
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['SetupID'] = this.setupID;
data['ProjectID'] = this.projectID;
data['PatientID'] = this.patientID;
data['AppointmentNo'] = this.appointmentNo;
data['AppointmentDate'] = this.appointmentDate;
data['DoctorName'] = this.doctorName;
data['ClinicDescription'] = this.clinicDescription;
data['Name'] = this.name;
data['EpisodeID'] = this.episodeID;
data['ActualDoctorRate'] = this.actualDoctorRate;
data['Admission'] = this.admission;
data['ClinicID'] = this.clinicID;
data['CompanyName'] = this.companyName;
data['Despensed_Status'] = this.despensedStatus;
data['DischargeDate'] = this.dischargeDate;
data['DischargeNo'] = this.dischargeNo;
data['DoctorID'] = this.doctorID;
data['DoctorImageURL'] = this.doctorImageURL;
data['DoctorRate'] = this.doctorRate;
data['DoctorTitle'] = this.doctorTitle;
data['Gender'] = this.gender;
data['GenderDescription'] = this.genderDescription;
data['IsActiveDoctorProfile'] = this.isActiveDoctorProfile;
data['IsDoctorAllowVedioCall'] = this.isDoctorAllowVedioCall;
data['IsExecludeDoctor'] = this.isExecludeDoctor;
data['IsInOutPatient'] = this.isInOutPatient;
data['IsInOutPatientDescription'] = this.isInOutPatientDescription;
data['IsInOutPatientDescriptionN'] = this.isInOutPatientDescriptionN;
data['IsInsurancePatient'] = this.isInsurancePatient;
data['NationalityFlagURL'] = this.nationalityFlagURL;
data['NoOfPatientsRate'] = this.noOfPatientsRate;
data['QR'] = this.qR;
data['Speciality'] = this.speciality;
return data;
}
}
//class PrescriptionsList {
// String filterName = "";
// List<Prescriptions> prescriptionsList = List();
//
// PrescriptionsList({this.filterName, Prescriptions prescriptions}) {
// prescriptionsList.add(prescriptions);
// }
//}

@ -2,6 +2,7 @@
import 'dart:convert';
import 'package:diplomaticquarterapp/core/model/pharmacies/PharmacyImageObject.dart';
import 'package:google_maps_flutter/google_maps_flutter.dart';
List<OrderModel> orderModelFromJson(String str) => List<OrderModel>.from(json.decode(str).map((x) => OrderModel.fromJson(x)));
@ -31,6 +32,7 @@ class OrderModel {
this.taxRates,
this.orderTax,
this.orderDiscount,
this.productCount,
this.orderTotal,
this.refundedAmount,
this.rewardPointsWereAdded,
@ -95,6 +97,7 @@ class OrderModel {
String taxRates;
double orderTax;
dynamic orderDiscount;
dynamic productCount;
double orderTotal;
dynamic refundedAmount;
dynamic rewardPointsWereAdded;
@ -159,6 +162,7 @@ class OrderModel {
taxRates: json["tax_rates"],
orderTax: json["order_tax"].toDouble(),
orderDiscount: json["order_discount"],
productCount: json["product_count"],
orderTotal: json["order_total"].toDouble(),
refundedAmount: json["refunded_amount"],
rewardPointsWereAdded: json["reward_points_were_added"],
@ -306,7 +310,22 @@ class IngAddress {
String customerAttributes;
DateTime createdOnUtc;
dynamic province;
LatLong latLong;
String latLong;
LatLng getLocation(){
if(latLong.contains(',')){
var parts = latLong.trim().split(',');
if(parts.length == 2){
var lat = double.tryParse(parts.first);
var lng = double.tryParse(parts.last);
if(lat != null || lng != null) {
var location = LatLng(lat, lng);
return location;
}
}
}
return null;
}
factory IngAddress.fromJson(Map<String, dynamic> json) => IngAddress(
id: json["id"],
@ -326,7 +345,7 @@ class IngAddress {
customerAttributes: json["customer_attributes"],
createdOnUtc: DateTime.parse(json["created_on_utc"]),
province: json["province"],
latLong: latLongValues.map[json["lat_long"]],
latLong: json["lat_long"],
);
Map<String, dynamic> toJson() => {
@ -347,7 +366,7 @@ class IngAddress {
"customer_attributes": customerAttributes,
"created_on_utc": createdOnUtc.toIso8601String(),
"province": province,
"lat_long": latLongValues.reverse[latLong],
"lat_long": latLong,
};
}
@ -491,9 +510,9 @@ class OrderModelCustomer {
isSystemAccount: json["is_system_account"],
systemName: json["system_name"],
lastIpAddress: lastIpAddressValues.map[json["last_ip_address"]],
createdOnUtc: DateTime.parse(json["created_on_utc"]),
lastLoginDateUtc: DateTime.parse(json["last_login_date_utc"]),
lastActivityDateUtc: DateTime.parse(json["last_activity_date_utc"]),
createdOnUtc: (json["created_on_utc"] != null) ? DateTime.parse(json["created_on_utc"]) : null,
lastLoginDateUtc: (json["created_on_utc"] != null) ? DateTime.parse(json["last_login_date_utc"]) : null,
lastActivityDateUtc: (json["created_on_utc"] != null) ? DateTime.parse(json["last_activity_date_utc"]) : null,
registeredInStoreId: json["registered_in_store_id"],
roleIds: List<int>.from(json["role_ids"].map((x) => x)),
);

@ -0,0 +1,77 @@
class OrdersModel {
List<Orders> orders;
OrdersModel({this.orders});
OrdersModel.fromJson(Map<String, dynamic> json) {
if (json['orders'] != null) {
orders = new List<Orders>();
json['orders'].forEach((v) {
orders.add(new Orders.fromJson(v));
});
}
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
if (this.orders != null) {
data['orders'] = this.orders.map((v) => v.toJson()).toList();
}
return data;
}
}
class Orders {
String id;
int productCount;
double orderTotal;
String createdOnUtc;
int orderStatusId;
String orderStatus;
String orderStatusn;
bool canCancel;
bool canRefund;
dynamic customerId;
Orders(
{this.id,
this.productCount,
this.orderTotal,
this.createdOnUtc,
this.orderStatusId,
this.orderStatus,
this.orderStatusn,
this.canCancel,
this.canRefund,
this.customerId,});
Orders.fromJson(Map<String, dynamic> json) {
try {
id = json['id'];
productCount = json['product_count'];
orderTotal = json['order_total'];
createdOnUtc = json['created_on_utc'];
orderStatusId = json['order_status_id'];
orderStatus = json['order_status'];
orderStatusn = json['order_statusn'];
canCancel = json['can_cancel'];
canRefund = json['can_refund'];
customerId = json['customer_id'];
}catch(e){
print(e);
}
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['id'] = this.id;
data['product_count'] = this.productCount;
data['order_total'] = this.orderTotal;
data['created_on_utc'] = this.createdOnUtc;
data['order_status_id'] = this.orderStatusId;
data['order_status'] = this.orderStatus;
data['order_statusn'] = this.orderStatusn;
return data;
}
}

@ -11,24 +11,24 @@ class Reports {
String setupId;
int patientID;
int doctorID;
Null clinicID;
dynamic clinicID;
DateTime requestDate;
bool isRead;
DateTime isReadOn;
int actualDoctorRate;
String clinicDescription;
Null clinicDescriptionN;
dynamic clinicDescriptionN;
String docName;
Null docNameN;
String doctorImageURL;
Null doctorName;
Null doctorNameN;
dynamic doctorName;
dynamic doctorNameN;
int doctorRate;
bool isDoctorAllowVedioCall;
bool isExecludeDoctor;
int noOfPatientsRate;
String projectName;
Null projectNameN;
dynamic projectNameN;
Reports(
{this.status,
@ -61,37 +61,41 @@ class Reports {
this.projectNameN});
Reports.fromJson(Map<String, dynamic> json) {
status = json['Status'];
encounterDate = DateUtil.convertStringToDate(
json['EncounterDate']); //json['EncounterDate'];
projectID = json['ProjectID'];
invoiceNo = json['InvoiceNo'];
encounterNo = json['EncounterNo'];
procedureId = json['ProcedureId'];
requestType = json['RequestType'];
setupId = json['SetupId'];
patientID = json['PatientID'];
doctorID = json['DoctorID'];
clinicID = json['ClinicID'];
requestDate = DateUtil.convertStringToDate(
json['RequestDate']); //json['RequestDate'];
isRead = json['IsRead'];
isReadOn =
DateUtil.convertStringToDate(json['IsReadOn']); //json['IsReadOn'];
actualDoctorRate = json['ActualDoctorRate'];
clinicDescription = json['ClinicDescription'];
clinicDescriptionN = json['ClinicDescriptionN'];
docName = json['DocName'];
docNameN = json['DocNameN'];
doctorImageURL = json['DoctorImageURL'];
doctorName = json['DoctorName'];
doctorNameN = json['DoctorNameN'];
doctorRate = json['DoctorRate'];
isDoctorAllowVedioCall = json['IsDoctorAllowVedioCall'];
isExecludeDoctor = json['IsExecludeDoctor'];
noOfPatientsRate = json['NoOfPatientsRate'];
projectName = json['ProjectName'];
projectNameN = json['ProjectNameN'];
try {
status = json['Status'];
encounterDate = DateUtil.convertStringToDate(
json['EncounterDate']); //json['EncounterDate'];
projectID = json['ProjectID'];
invoiceNo = json['InvoiceNo'];
encounterNo = json['EncounterNo'];
procedureId = json['ProcedureId'];
requestType = json['RequestType'];
setupId = json['SetupId'];
patientID = json['PatientID'];
doctorID = json['DoctorID'];
clinicID = json['ClinicID'];
requestDate = DateUtil.convertStringToDate(
json['RequestDate']); //json['RequestDate'];
isRead = json['IsRead'];
isReadOn =
DateUtil.convertStringToDate(json['IsReadOn']); //json['IsReadOn'];
actualDoctorRate = json['ActualDoctorRate'];
clinicDescription = json['ClinicDescription'];
clinicDescriptionN = json['ClinicDescriptionN'];
docName = json['DocName'];
docNameN = json['DocNameN'];
doctorImageURL = json['DoctorImageURL'];
doctorName = json['DoctorName'];
doctorNameN = json['DoctorNameN'];
doctorRate = json['DoctorRate'];
isDoctorAllowVedioCall = json['IsDoctorAllowVedioCall'];
isExecludeDoctor = json['IsExecludeDoctor'];
noOfPatientsRate = json['NoOfPatientsRate'];
projectName = json['ProjectName'];
projectNameN = json['ProjectNameN'];
}catch(e){
print(e);
}
}
Map<String, dynamic> toJson() {

@ -1,5 +1,7 @@
import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/H2O/insert_user_activity_request_model.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/H2O/user_detail_model.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/H2O/user_detail_request_model.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/H2O/user_progress_for_month_data_model.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/H2O/user_progress_for_today_data_model.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/H2O/user_progress_for_week_data_model.dart';
@ -10,8 +12,66 @@ class H2OService extends BaseService {
List<UserProgressForTodayDataModel> userProgressForTodayDataList = List();
List<UserProgressForWeekDataModel> userProgressForWeekDataList = List();
List<UserProgressForMonthDataModel> userProgressForMonthDataList = List();
UserProgressRequestModel userProgressRequestModel =
UserProgressRequestModel();
UserProgressRequestModel userProgressRequestModel = UserProgressRequestModel();
UserDetailModel userDetailModel = UserDetailModel();
Future getUserDetail() async {
userProgressRequestModel.progress = 1;
userProgressRequestModel.mobileNumber = user.mobileNumber.substring(1);
userProgressRequestModel.identificationNo = user.patientIdentificationNo;
hasError = false;
await baseAppClient.post(H2O_GET_USER_DETAIL, onSuccess: (dynamic response, int statusCode) {
userDetailModel = UserDetailModel.fromJson(response["UserDetailData_New"]);
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: userProgressRequestModel.toJson());
}
Future updateUserDetail(UserDetailModel userDetail) async {
userProgressRequestModel.progress = 1;
userProgressRequestModel.mobileNumber = user.mobileNumber.substring(1);
userProgressRequestModel.identificationNo = user.patientIdentificationNo;
UserDetailRequestModel _requestModel = UserDetailRequestModel();
_requestModel.activityID = userDetail.activityID.toString();
_requestModel.channel = userProgressRequestModel.channel;
_requestModel.dOB = userDetail.dOB;
_requestModel.deviceTypeID = userProgressRequestModel.deviceTypeID;
_requestModel.email = userDetail.emailID;
_requestModel.firstName = userDetail.firstName;
_requestModel.gender = userDetail.gender;
_requestModel.height = userDetail.height;
_requestModel.iPAdress = userProgressRequestModel.iPAdress;
_requestModel.identificationNo = userProgressRequestModel.identificationNo;
_requestModel.isHeightInCM = userDetail.isHeightInCM;
_requestModel.isWeightInKG = userDetail.isWeightInKG;
_requestModel.languageID = userProgressRequestModel.languageID;
_requestModel.mobileNumber = userProgressRequestModel.mobileNumber;
_requestModel.patientID = userProgressRequestModel.patientID;
_requestModel.patientOutSA = userProgressRequestModel.patientOutSA;
_requestModel.patientType = userProgressRequestModel.patientType;
_requestModel.patientTypeID = userProgressRequestModel.patientOutSA;
_requestModel.sessionID = userProgressRequestModel.sessionID;
_requestModel.tokenID = userProgressRequestModel.tokenID;
_requestModel.versionID = userProgressRequestModel.versionID;
_requestModel.zipCode = userDetail.zipCode;
_requestModel.weight = userDetail.weight;
_requestModel.generalid = userProgressRequestModel.generalid;
_requestModel.isDentalAllowedBackend = userProgressRequestModel.isDentalAllowedBackend;
_requestModel.isNotificationOn = userDetail.isNotificationON;
hasError = false;
await baseAppClient.post(H2O_UPDATE_USER_DETAIL, onSuccess: (dynamic response, int statusCode) {
userDetailModel = userDetail;
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: _requestModel.toJson());
}
Future getUserProgressForTodayData() async {
userProgressRequestModel.progress = 1;
@ -19,12 +79,10 @@ class H2OService extends BaseService {
userProgressRequestModel.identificationNo = user.patientIdentificationNo;
hasError = false;
await baseAppClient.post(H2O_GET_USER_PROGRESS,
onSuccess: (dynamic response, int statusCode) {
await baseAppClient.post(H2O_GET_USER_PROGRESS, onSuccess: (dynamic response, int statusCode) {
userProgressForTodayDataList.clear();
response['UserProgressForTodayData'].forEach((progressData) {
userProgressForTodayDataList
.add(UserProgressForTodayDataModel.fromJson(progressData));
userProgressForTodayDataList.add(UserProgressForTodayDataModel.fromJson(progressData));
});
}, onFailure: (String error, int statusCode) {
hasError = true;
@ -38,16 +96,15 @@ class H2OService extends BaseService {
userProgressRequestModel.identificationNo = super.user.patientIdentificationNo;
hasError = false;
await baseAppClient.post(H2O_GET_USER_PROGRESS,
onSuccess: (dynamic response, int statusCode) {
userProgressForTodayDataList.clear();
response['UserProgressForWeekData'].forEach((hospital) {
userProgressForWeekDataList.add(UserProgressForWeekDataModel.fromJson(hospital));
});
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: userProgressRequestModel.toJson());
await baseAppClient.post(H2O_GET_USER_PROGRESS, onSuccess: (dynamic response, int statusCode) {
userProgressForWeekDataList.clear();
response['UserProgressForWeekData'].forEach((hospital) {
userProgressForWeekDataList.add(UserProgressForWeekDataModel.fromJson(hospital));
});
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: userProgressRequestModel.toJson());
}
Future getUserProgressForMonthData() async {
@ -56,8 +113,7 @@ class H2OService extends BaseService {
userProgressRequestModel.identificationNo = super.user.patientIdentificationNo;
hasError = false;
await baseAppClient.post(H2O_GET_USER_PROGRESS,
onSuccess: (dynamic response, int statusCode) {
await baseAppClient.post(H2O_GET_USER_PROGRESS, onSuccess: (dynamic response, int statusCode) {
userProgressForMonthDataList.clear();
response['UserProgressForMonthData'].forEach((hospital) {
userProgressForMonthDataList.add(UserProgressForMonthDataModel.fromJson(hospital));
@ -68,22 +124,33 @@ class H2OService extends BaseService {
}, body: userProgressRequestModel.toJson());
}
Future insertUserActivity(InsertUserActivityRequestModel insertUserActivityRequestModel) async {
hasError = false;
await baseAppClient.post(H2O_INSERT_USER_ACTIVITY, onSuccess: (dynamic response, int statusCode) {
userProgressForTodayDataList.clear();
response['UserProgressForTodayData'].forEach((progressData) {
userProgressForTodayDataList.add(UserProgressForTodayDataModel.fromJson(progressData));
});
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: insertUserActivityRequestModel.toJson());
}
Future undoUserActivity() async {
userProgressRequestModel.progress = 1;
userProgressRequestModel.mobileNumber = user.mobileNumber.substring(1);
userProgressRequestModel.identificationNo = user.patientIdentificationNo;
hasError = false;
await baseAppClient.post(H2O_INSERT_USER_ACTIVITY,
onSuccess: (dynamic response, int statusCode) {
userProgressForTodayDataList.clear();
response['UserProgressForTodayData'].forEach((progressData) {
userProgressForTodayDataList
.add(UserProgressForTodayDataModel.fromJson(progressData));
});
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: insertUserActivityRequestModel.toJson());
await baseAppClient.post(H2O_UNDO_USER_ACTIVITY, onSuccess: (dynamic response, int statusCode) {
userProgressForTodayDataList.clear();
response['UserProgressForTodayData'].forEach((progressData) {
userProgressForTodayDataList.add(UserProgressForTodayDataModel.fromJson(progressData));
});
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: userProgressRequestModel.toJson());
}
}

@ -1,4 +1,5 @@
import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/core/enum/OrderService.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_get_items_request_model.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_get_items_response_model.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_insert_pres_order_request_model.dart';
@ -47,8 +48,9 @@ class CMCService extends BaseService {
await baseAppClient.post(GET_PATIENT_ALL_PRES_ORDERS,
onSuccess: (dynamic response, int statusCode) {
cmcAllPresOrdersList.clear();
cmcAllOrderDetail.clear();
response['PatientER_GetPatientAllPresOrdersList'].forEach((data) {
if (data['ServiceID'] == 3)
if (data['ServiceID'] == OrderService.Comprehensive_Medical_Checkup.getIdOrderService())
cmcAllPresOrdersList
.add(GetHHCAllPresOrdersResponseModel.fromJson(data));
});
@ -104,7 +106,7 @@ class CMCService extends BaseService {
Future insertPresPresOrder({CMCInsertPresOrderRequestModel order}) async {
hasError = false;
await baseAppClient.post(PATIENT_ER_UPDATE_PRES_ORDER,
await baseAppClient.post(PATIENT_ER_INSERT_PRES_ORDER,
onSuccess: (dynamic response, int statusCode) {
isOrderUpdated = true;
}, onFailure: (String error, int statusCode) {

@ -43,7 +43,7 @@ class CustomerAddressesService extends BaseService {
'fields':'addresses'
};
hasError = false;
await baseAppClient.get("$GET_CUSTOMER_ADDRESSES${customerInfo.customerId}",
await baseAppClient.getPharmacy("$GET_CUSTOMER_ADDRESSES${customerInfo.customerId}",
onSuccess: (dynamic response, int statusCode) {
addressesList.clear();
response["customers"][0]["addresses"].forEach((data) {
@ -63,7 +63,7 @@ class CustomerAddressesService extends BaseService {
};
hasError = false;
await baseAppClient.get(GET_CUSTOMER_INFO,
await baseAppClient.getPharmacy(GET_CUSTOMER_INFO,
onSuccess: (dynamic response, int statusCode) {
customerInfo= CustomerInfo.fromJson(response);
}, onFailure: (String error, int statusCode) {

@ -1,4 +1,5 @@
import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/core/enum/OrderService.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/HHC_get_all_services_request_modle.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/HHC_get_all_services_response_model.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/get_hHC_all_pres_orders_request_model.dart';
@ -7,6 +8,8 @@ import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealth
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/get_order_detail_by_order_iD_response_model.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/patient_er_insert_pres_order_request_model.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/update_pres_oreder_request_model.dart';
import 'package:diplomaticquarterapp/core/service/AlHabibMedicalService/customer_addresses_service.dart';
import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/add_new_address_Request_Model.dart';
import '../base_service.dart';
@ -15,9 +18,10 @@ class HomeHealthCareService extends BaseService {
List<GetHHCAllPresOrdersResponseModel> hhcAllPresOrdersList = List();
List<GetOrderDetailByOrderIDResponseModel> hhcAllOrderDetail = List();
List<AddressInfo> addressesList = List();
bool isOrderUpdated;
CustomerInfo customerInfo;
Future getHHCAllServices(
HHCGetAllServicesRequestModel hHCGetAllServicesRequestModel) async {
hasError = false;
@ -37,11 +41,11 @@ class HomeHealthCareService extends BaseService {
GetHHCAllPresOrdersRequestModel getHHCAllPresOrdersRequestModel =
GetHHCAllPresOrdersRequestModel();
hasError = false;
await baseAppClient.post(GET_PATIENT_ALL_PRES_ORDERS,
await baseAppClient.post(GET_PATIENT_ALL_PRES_ORD,
onSuccess: (dynamic response, int statusCode) {
hhcAllPresOrdersList.clear();
response['PatientER_GetPatientAllPresOrdersList'].forEach((data) {
if (data['ServiceID'] == 2)
if (data['ServiceID'] == OrderService.HOME_HEALTH_CARE.getIdOrderService())
hhcAllPresOrdersList
.add(GetHHCAllPresOrdersResponseModel.fromJson(data));
});
@ -91,3 +95,5 @@ class HomeHealthCareService extends BaseService {
}, body: order.toJson());
}
}

@ -1,7 +1,9 @@
import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/core/model/childvaccines/List_BabyInformationModel.dart';
import 'package:diplomaticquarterapp/core/model/childvaccines/add_newchild_model.dart';
import 'package:diplomaticquarterapp/core/model/childvaccines/create_vaccination_table.dart';
import 'package:diplomaticquarterapp/core/model/childvaccines/user_information_model.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import '../base_service.dart';
class VaccinationTableService extends BaseService {
@ -10,19 +12,18 @@ class VaccinationTableService extends BaseService {
Future getCreateVaccinationTableOrders() async {
Future getCreateVaccinationTableOrders(List_BabyInformationModel babyInfo, bool sendEmail) async {
String babyBDFormatted = "${DateUtil.convertDateToString(babyInfo.dOB)}/";
hasError = false;
await getUser();
body['BabyName']="fffffffffff eeeeeeeeeeeeee";
body['DOB'] = "/Date(1585774800000+0300)/";
body['BabyName']= babyInfo.babyName;
body['DOB'] = babyBDFormatted;
body['EmailAddress'] = user.emailAddress;
body['isDentalAllowedBackend'] = false;
body['SendEmail'] = false;
body['SendEmail'] = sendEmail;
body['IsLogin'] =true;
await baseAppClient.post(GET_TABLE_REQUEST,
onSuccess: (dynamic response, int statusCode) {
createVaccinationTableModelList.clear();

@ -46,7 +46,7 @@ class BaseAppClient {
//Map profile = await sharedPref.getObj(DOCTOR_PROFILE);
if (!isExternal) {
String token = await sharedPref.getString(TOKEN);
var languageID = await sharedPref.getString(APP_LANGUAGE);
var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE,'ar');
var user = await sharedPref.getObject(USER_PROFILE);
if (body.containsKey('SetupID')) {
body['SetupID'] = body.containsKey('SetupID')
@ -58,15 +58,7 @@ class BaseAppClient {
body['VersionID'] = VERSION_ID;
body['Channel'] = CHANNEL;
body['LanguageID'] = body.containsKey('LanguageID')
? body['LanguageID'] != null
? body['LanguageID']
: languageID == 'ar'
? 1
: 2
: languageID == 'en'
? 2
: 1;
body['LanguageID'] = languageID == 'ar' ? 1 : 2;
body['IPAdress'] = IP_ADDRESS;
body['generalid'] = GENERAL_ID;
@ -203,7 +195,7 @@ class BaseAppClient {
get(String endPoint,
{Function(dynamic response, int statusCode) onSuccess,
Function(String error, int statusCode) onFailure,
Map<String, String> queryParams,
Map<String, dynamic> queryParams,
bool isExternal = false}) async {
String url;
if (isExternal) {
@ -244,19 +236,41 @@ class BaseAppClient {
{Function(dynamic response, int statusCode) onSuccess,
Function(String error, int statusCode) onFailure,
bool isAllowAny = false,
Map<String, String> queryParams}) async {
String url = PHARMACY_BASE_URL + endPoint;
bool isExternal = false,
Map<String, dynamic> queryParams}) async {
String url;
if (isExternal) {
url = endPoint;
} else {
url = PHARMACY_BASE_URL + endPoint;
}
if (queryParams != null) {
String queryString = Uri(queryParameters: queryParams).query;
url += '?' + queryString;
}
print("URL : $url");
var token = await sharedPref.getString(PHARMACY_AUTORZIE_TOKEN);
var user = await sharedPref.getObject(USER_PROFILE);
Map test = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': token,
'Mobilenumber': user['MobileNumber'].toString(),
'Statictoken': 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9',
'Username': user['PatientID'].toString(),
};
if (await Utils.checkConnection()) {
final response = await http.get(url.trim(), headers: {
'Content-Type': 'application/json',
'Accept': 'application/json'
'Accept': 'application/json',
'Authorization': token,
'Mobilenumber': user['MobileNumber'].toString(),
'Statictoken': 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9',
'Username': user['PatientID'].toString(),
});
final int statusCode = response.statusCode;
print("statusCode :$statusCode");

@ -68,6 +68,19 @@ class BloodPressureService extends BaseService {
super.error = error;
}, body: Map());
}
Future sendReportByEmail() async {
hasError = false;
super.error = "";
Map<String, dynamic> body = Map();
body['isDentalAllowedBackend'] = false;
body['to'] = user.emailAddress;
await baseAppClient.post(SEND_AVERAGE_BLOOD_PRESSURE_REPORT,
onSuccess: (response, statusCode) async {},
onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: body);
}
addDiabtecResult(
{String bloodPressureDate,
@ -93,4 +106,43 @@ class BloodPressureService extends BaseService {
super.error = error;
}, body: body);
}
updateDiabtecResult(
{String bloodPressureDate,
String diastolicPressure,
String systolicePressure,
int measuredArm}) async {
hasError = false;
super.error = "";
Map<String, dynamic> body = Map();
body['BloodPressureDate'] = bloodPressureDate;
body['DiastolicPressure'] = diastolicPressure;
body['SystolicePressure'] = systolicePressure;
body['MeasuredArm'] ='$measuredArm';
body['isDentalAllowedBackend'] = false;
await baseAppClient.post(UPDATE_BLOOD_PRESSURE_RESULT,
onSuccess: (response, statusCode) async {
},
onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: body);
}
Future deactivateDiabeticStatus({int lineItemNo }) async {
hasError = false;
super.error = "";
Map<String, dynamic> body = Map();
body['isDentalAllowedBackend'] = false;
body['LineItemNo'] =lineItemNo;
await baseAppClient.post(DEACTIVATE_BLOOD_PRESSURES_STATUS,
onSuccess: (response, statusCode) async {},
onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: body);
}
}

@ -24,6 +24,11 @@ class BloodSugarService extends BaseService {
monthDiabtectResultAverageList.clear();
weekDiabtectResultAverageList.clear();
yearDiabtecResultAverageList.clear();
monthDiabtecPatientResult.clear();
weekDiabtecPatientResult.clear();
yearDiabtecPatientResult.clear();
response['List_MonthDiabtectResultAverage'].forEach((item) {
monthDiabtectResultAverageList
.add(MonthDiabtectResultAverage.fromJson(item));
@ -69,28 +74,66 @@ class BloodSugarService extends BaseService {
}, body: Map());
}
addDiabtecResult(
{String bloodSugerDateChart,
String bloodSugerResult,
String diabtecUnit,
int measuredTime}) async {
addDiabtecResult({String bloodSugerDateChart, String bloodSugerResult, String diabtecUnit, int measuredTime}) async {
hasError = false;
super.error = "";
Map<String, dynamic> body = Map();
body['BloodSugerDateChart'] = bloodSugerDateChart;
body['BloodSugerResult'] = bloodSugerResult;
body['DiabtecUnit'] = diabtecUnit;
body['MeasuredTime'] =2;// measuredTime;
body['MeasuredTime'] = measuredTime+1;
body['isDentalAllowedBackend'] = false;
await baseAppClient.post(ADD_DIABTEC_RESULT,
onSuccess: (response, statusCode) async {},
onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: body);
}
await baseAppClient.post(ADD_BLOOD_PRESSURE_RESULT,
onSuccess: (response, statusCode) async {
var asd ="";
},
updateDiabtecResult({DateTime month,DateTime hour,String bloodSugerResult,String diabtecUnit, int measuredTime,int lineItemNo}) async {
hasError = false;
super.error = "";
Map<String, dynamic> body = Map();
body['BloodSugerResult'] = bloodSugerResult;
body['DiabtecUnit'] = diabtecUnit;
body['BloodSugerDateChart'] = '${month.year}-${month.month}-${month.day} ${hour.hour}:${hour.minute}:00';
body['isDentalAllowedBackend'] = false;
body['MeasuredTime'] = measuredTime+1;
body['LineItemNo'] = lineItemNo;
await baseAppClient.post(UPDATE_DIABETIC_RESULT,
onSuccess: (response, statusCode) async {},
onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: body);
}
Future sendReportByEmail() async {
hasError = false;
super.error = "";
Map<String, dynamic> body = Map();
body['isDentalAllowedBackend'] = false;
body['to'] = user.emailAddress;
await baseAppClient.post(SEND_AVERAGE_BLOOD_SUGAR_REPORT,
onSuccess: (response, statusCode) async {},
onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: body);
}
Future deactivateDiabeticStatus({int lineItemNo }) async {
hasError = false;
super.error = "";
Map<String, dynamic> body = Map();
body['isDentalAllowedBackend'] = false;
body['LineItemNo'] =lineItemNo;
await baseAppClient.post(DEACTIVATE_DIABETIC_STATUS,
onSuccess: (response, statusCode) async {},
onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: body);
}
}

@ -6,11 +6,13 @@ import 'package:diplomaticquarterapp/core/model/my_trakers/weight/YearWeightMeas
import 'package:diplomaticquarterapp/core/service/base_service.dart';
class WeightService extends BaseService {
///Average
List<MonthWeightMeasurementResultAverage> monthWeightMeasurementResultAverage = List();
List<WeekWeightMeasurementResultAverage> weekWeightMeasurementResultAverage = List();
List<YearWeightMeasurementResultAverage> yearWeightMeasurementResultAverage = List();
List<MonthWeightMeasurementResultAverage>
monthWeightMeasurementResultAverage = List();
List<WeekWeightMeasurementResultAverage> weekWeightMeasurementResultAverage =
List();
List<YearWeightMeasurementResultAverage> yearWeightMeasurementResultAverage =
List();
///Result
List<WeightMeasurementResult> monthWeightMeasurementResult = List();
@ -59,7 +61,8 @@ class WeightService extends BaseService {
});
response['List_MonthWeightMeasurementResult'].forEach((item) {
monthWeightMeasurementResult.add(WeightMeasurementResult.fromJson(item));
monthWeightMeasurementResult
.add(WeightMeasurementResult.fromJson(item));
});
response['List_YearWeightMeasurementResult'].forEach((item) {
@ -72,9 +75,7 @@ class WeightService extends BaseService {
}
addWeightResult(
{String weightDate,
String weightMeasured,
int weightUnit}) async {
{String weightDate, String weightMeasured, int weightUnit}) async {
hasError = false;
super.error = "";
@ -85,9 +86,53 @@ class WeightService extends BaseService {
body['isDentalAllowedBackend'] = false;
await baseAppClient.post(ADD_WEIGHT_PRESSURE_RESULT,
onSuccess: (response, statusCode) async {
onSuccess: (response, statusCode) async {},
onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: body);
}
updateWeightResult({int lineItemNo, int weightUnit,String weightMeasured,String weightDate}) async {
hasError = false;
super.error = "";
Map<String, dynamic> body = Map();
body['LineItemNo'] = lineItemNo;
body['weightUnit'] = '$weightUnit';
body['WeightMeasured'] = weightMeasured;
body['WeightDate'] = weightDate;
body['isDentalAllowedBackend'] = false;
await baseAppClient.post(UPDATE_WEIGHT_PRESSURE_RESULT,
onSuccess: (response, statusCode) async {},
onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: body);
}
Future sendReportByEmail() async {
hasError = false;
super.error = "";
Map<String, dynamic> body = Map();
body['isDentalAllowedBackend'] = false;
body['to'] = user.emailAddress;
await baseAppClient.post(SEND_AVERAGE_BLOOD_WEIGHT_REPORT,
onSuccess: (response, statusCode) async {},
onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: body);
}
deleteWeightResult({int lineItemNo, }) async {
hasError = false;
super.error = "";
Map<String, dynamic> body = Map();
body['LineItemNo'] = lineItemNo;
body['isDentalAllowedBackend'] = false;
},
await baseAppClient.post(DEACTIVATE_WEIGHT_PRESSURE_RESULT,
onSuccess: (response, statusCode) async {},
onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;

@ -2,6 +2,7 @@ import 'dart:convert';
import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/model/blooddonation/blood_groub_details.dart';
import 'package:diplomaticquarterapp/core/model/my_balance/AdvanceModel.dart';
import 'package:diplomaticquarterapp/core/model/my_balance/patient_advance_balance_amount.dart';
import 'package:diplomaticquarterapp/core/model/my_balance/patient_info.dart';
@ -23,11 +24,11 @@ class MyBalanceService extends BaseService {
PatientInfoAndMobileNumber patientInfoAndMobileNumber;
String logInTokenID;
String verificationCode;
String updatedRegisterBloodMessage = "";
AuthenticatedUserObject authenticatedUserObject =
locator<AuthenticatedUserObject>();
MyBalanceService(){
MyBalanceService() {
getFamilyFiles();
}
@ -156,4 +157,49 @@ class MyBalanceService extends BaseService {
return await getSharedRecordByStatus();
}
}
Future updateBloodGroup(List_BloodGroupDetailsModel detailsModel) async {
hasError = false;
await getUser();
var languageID =
await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
Map<String, dynamic> body = Map();
body['City'] = detailsModel.city;
body['cityCode'] = detailsModel.cityCode;
body['Gender'] = detailsModel.gender;
body['BloodGroup'] = detailsModel.bloodGroup;
body['CellNumber'] = user.mobileNumber;
body['LanguageID'] = languageID;
body['NationalID'] = user.nationalityID;
body['ZipCode'] = user.zipCode ?? "+966";
body['isDentalAllowedBackend'] = false;
await baseAppClient.post(BLOOD_DONATION_REGISTER_BLOOD_TYPE,
onSuccess: (dynamic response, int statusCode) {
updatedRegisterBloodMessage = response['ErrorEndUserMessage'];
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
if(error == null){
super.error = "Something went wrong";
}
}, body: body);
}
Future addUserAgreementForBloodDonation() async {
hasError = false;
var languageID =
await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
Map<String, dynamic> body = Map();
body['IsAgreed'] = true;
body['LanguageID'] = languageID;
body['isDentalAllowedBackend'] = false;
await baseAppClient.post(ADD_USER_AGREEMENT_FOR_BLOOD_DONATION,
onSuccess: (dynamic response, int statusCode) {
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: body);
}
}

@ -68,6 +68,19 @@ class ReportsService extends BaseService {
}, body: body);
}
Future updateEmail({String email}) async {
Map<String, dynamic> body = Map<String, dynamic>();
body['EmailAddress'] = email;
body['isDentalAllowedBackend'] = false;
hasError = false;
await baseAppClient.post(UPDATE_PATENT_EMAIL,
onSuccess: (dynamic response, int statusCode) {},
onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: body);
}
Future insertRequestForMedicalReport(
AppointmentHistory appointmentHistory) async {
Map<String, dynamic> body = new Map<String, dynamic>();

@ -21,7 +21,7 @@ class OffersCategoriseService extends BaseService {
Future getOffersCategorise() async {
hasError = false;
_offersList.clear();
await baseAppClient.get(
await baseAppClient.getPharmacy(
GET_OFFERS_CATEGORISE,
onSuccess: (dynamic response, int statusCode) {
response['categories'].forEach((item) {
@ -40,7 +40,7 @@ class OffersCategoriseService extends BaseService {
_offerProducts.clear();
String endPoint =
id != null ? GET_OFFERS_PRODUCTS + "$id" : GET_OFFERS_PRODUCTS + "1";
await baseAppClient.get(
await baseAppClient.getPharmacy(
endPoint,
onSuccess: (dynamic response, int statusCode) {
response['products'].forEach((item) {

@ -21,7 +21,7 @@ class OrderPreviewService extends BaseService {
Map<String, String> queryParams = {'fields': 'addresses'};
hasError = false;
try {
await baseAppClient.get("$GET_CUSTOMERS_ADDRESSES$customerId",
await baseAppClient.getPharmacy("$GET_CUSTOMERS_ADDRESSES$customerId",
onSuccess: (dynamic response, int statusCode) {
addresses.clear();
response['customers'][0]['addresses'].forEach((item) {
@ -42,7 +42,7 @@ class OrderPreviewService extends BaseService {
dynamic localRes;
hasError = false;
try {
await baseAppClient.get("$GET_SHIPPING_OPTIONS$customerId/${selectedAddress.id}",
await baseAppClient.getPharmacy("$GET_SHIPPING_OPTIONS$customerId/${selectedAddress.id}",
onSuccess: (dynamic response, int statusCode) {
localRes = response['shipping_option'][0];
}, onFailure: (String error, int statusCode) {
@ -61,7 +61,7 @@ class OrderPreviewService extends BaseService {
dynamic localRes;
hasError = false;
try {
await baseAppClient.get("$GET_SHOPPING_CART$customerId",
await baseAppClient.getPharmacy("$GET_SHOPPING_CART$customerId",
onSuccess: (dynamic response, int statusCode) {
localRes = response;
}, onFailure: (String error, int statusCode) {
@ -125,7 +125,7 @@ class OrderPreviewService extends BaseService {
super.error = "";
dynamic localRes;
await baseAppClient.get("$DELETE_SHOPPING_CART_ALL$customerId/ShoppingCart",
await baseAppClient.getPharmacy("$DELETE_SHOPPING_CART_ALL$customerId/ShoppingCart",
onSuccess: (response, statusCode) async {
localRes = response;
}, onFailure: (String error, int statusCode) {

@ -11,6 +11,7 @@ class PharmacyModuleService extends BaseService {
bool isFinished = true;
bool hasError = false;
String errorMsg = '';
String url = "";
List<PharmacyImageObject> bannerItems = List();
List<Manufacturer> manufacturerList = List();
@ -21,8 +22,7 @@ class PharmacyModuleService extends BaseService {
Map<String, String> queryParams = {'FileNumber': data['PatientID'].toString()};
hasError = false;
try {
await baseAppClient.get(PHARMACY_VERIFY_CUSTOMER,
onSuccess: (dynamic response, int statusCode) {
await baseAppClient.getPharmacy(PHARMACY_VERIFY_CUSTOMER, onSuccess: (dynamic response, int statusCode) {
if (response['UserName'] != null) {
sharedPref.setString(PHARMACY_CUSTOMER_ID, response['CustomerId'].toString());
print(response);
@ -54,9 +54,29 @@ class PharmacyModuleService extends BaseService {
};
hasError = false;
try {
await baseAppClient.get(PHARMACY_CREATE_CUSTOMER,
onSuccess: (dynamic response, int statusCode) {
await baseAppClient.get(PHARMACY_CREATE_CUSTOMER, onSuccess: (dynamic response, int statusCode) async{
if (!response['IsRegistered']) {}
await generatePharmacyToken();
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, queryParams: queryParams);
} catch (error) {
throw error;
}
}
Future generatePharmacyToken() async {
Map<String, String> queryParams = {
'Filenumber':user.patientID.toString(),
'MobileNumber':user.mobileNumber,
};
hasError = false;
try {
await baseAppClient.get(PHARMACY_AUTORZIE_CUSTOMER, onSuccess: (dynamic response, int statusCode) async{
if (response['Status'] == 200) {
await sharedPref.setString(PHARMACY_AUTORZIE_TOKEN, response['token'].toString());
}
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
@ -69,8 +89,7 @@ class PharmacyModuleService extends BaseService {
Future getBannerListList() async {
hasError = false;
try {
await baseAppClient.get(GET_PHARMACY_BANNER,
onSuccess: (dynamic response, int statusCode) {
await baseAppClient.getPharmacy(GET_PHARMACY_BANNER, onSuccess: (dynamic response, int statusCode) {
bannerItems.clear();
response['images'].forEach((item) {
bannerItems.add(PharmacyImageObject.fromJson(item));
@ -87,12 +106,11 @@ class PharmacyModuleService extends BaseService {
Future getTopManufacturerList() async {
Map<String, String> queryParams = {'page': '1', 'limit': '8'};
try {
await baseAppClient.get(GET_PHARMACY_TOP_MANUFACTURER,
onSuccess: (dynamic response, int statusCode) {
await baseAppClient.getPharmacy(GET_PHARMACY_TOP_MANUFACTURER, onSuccess: (dynamic response, int statusCode) {
manufacturerList.clear();
response['manufacturer'].forEach((item) {
Manufacturer manufacturer = Manufacturer.fromJson(item);
if(manufacturer.image != null){
if (manufacturer.image != null) {
manufacturerList.add(Manufacturer.fromJson(item));
}
});
@ -111,8 +129,7 @@ class PharmacyModuleService extends BaseService {
'id,discount_ids,name,namen,localized_names,display_order,short_description,full_description,full_descriptionn,sku,order_minimum_quantity,order_maximum_quantity,price,old_price,images,is_rx,rx_message,rx_messagen,discount_name,discount_namen,approved_rating_sum,approved_total_reviews,allow_back_in_stock_subscriptions,stock_quantity,stock_availability,stock_availabilityn,discount_percentage,reviews',
};
try {
await baseAppClient.get(GET_PHARMACY_BEST_SELLER_PRODUCT,
onSuccess: (dynamic response, int statusCode) {
await baseAppClient.getPharmacy(GET_PHARMACY_BEST_SELLER_PRODUCT, onSuccess: (dynamic response, int statusCode) {
bestSellerProducts.clear();
response['products'].forEach((item) {
bestSellerProducts.add(PharmacyProduct.fromJson(item));
@ -128,13 +145,10 @@ class PharmacyModuleService extends BaseService {
Future getLastVisitedProducts() async {
String lastVisited = "";
if (await this.sharedPref.getString(PHARMACY_LAST_VISITED_PRODUCTS) !=
null) {
lastVisited =
await this.sharedPref.getString(PHARMACY_LAST_VISITED_PRODUCTS);
if (await this.sharedPref.getString(PHARMACY_LAST_VISITED_PRODUCTS) != null) {
lastVisited = await this.sharedPref.getString(PHARMACY_LAST_VISITED_PRODUCTS);
try {
await baseAppClient.get("$GET_PHARMACY_PRODUCTs_BY_IDS$lastVisited",
onSuccess: (dynamic response, int statusCode) {
await baseAppClient.getPharmacy("$GET_PHARMACY_PRODUCTs_BY_IDS$lastVisited", onSuccess: (dynamic response, int statusCode) {
lastVisitedProducts.clear();
response['products'].forEach((item) {
lastVisitedProducts.add(PharmacyProduct.fromJson(item));

@ -0,0 +1,53 @@
import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/service/base_service.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/Prescriptions.dart';
class PrescriptionService extends BaseService {
final AppSharedPreferences sharedPref = AppSharedPreferences();
bool isFinished = true;
bool hasError = false;
String errorMsg = '';
String url = "";
List<Prescriptions> _prescriptionsList = List();
List<Prescriptions> get prescriptionsList => _prescriptionsList;
Future getPrescription() async {
hasError = false;
url = PRESCRIPTION;
print("Print PRESCRIPTION url" + url);
await baseAppClient.post(url,
onSuccess: (dynamic response, int statusCode) {
_prescriptionsList.clear();
response['PatientPrescriptionList'].forEach((item) {
_prescriptionsList.add(Prescriptions.fromJson(item));
});
print(_prescriptionsList.length);
print(response);
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
});
}
// Future getPrescription() async {
// hasError = false;
// Map<String, dynamic> body = Map();
// body['isDentalAllowedBackend'] = false;
// await baseAppClient.post(PRESCRIPTION,
// onSuccess: (dynamic response, int statusCode) {
// prescriptionsList.clear();
// response['PatientPrescriptionList'].forEach((prescriptions) {
// prescriptionsList.add(Prescriptions.fromJson(prescriptions));
// });
// }, onFailure: (String error, int statusCode) {
// hasError = true;
// super.error = error;
// }, body: body);
// }
}

@ -56,7 +56,7 @@ class PharmacyCategoriseService extends BaseService {
Future getCategorise() async {
hasError = false;
_categoriseList.clear();
await baseAppClient.get(
await baseAppClient.getPharmacy(
GET_PHARMACY_CATEGORISE,
onSuccess: (dynamic response, int statusCode) {
response['categories'].forEach((item) {
@ -74,7 +74,7 @@ class PharmacyCategoriseService extends BaseService {
hasError = false;
_scanList.clear();
String endPoint = id != null ? SCAN_QR_CODE + "$id" : SCAN_QR_CODE + "";
await baseAppClient.get(
await baseAppClient.getPharmacy(
endPoint,
onSuccess: (dynamic response, int statusCode) {
response['products'].forEach((item) {
@ -94,7 +94,7 @@ class PharmacyCategoriseService extends BaseService {
String endPoint = productName != null
? GET_SEARCH_PRODUCTS + "$productName" + '&language_id=1'
: GET_SEARCH_PRODUCTS + "";
await baseAppClient.get(
await baseAppClient.getPharmacy(
endPoint,
onSuccess: (dynamic response, int statusCode) {
response['products'].forEach((item) {
@ -111,7 +111,7 @@ class PharmacyCategoriseService extends BaseService {
Future getBrands() async {
hasError = false;
_brandsList.clear();
await baseAppClient.get(
await baseAppClient.getPharmacy(
GET_BRANDS_LIST,
onSuccess: (dynamic response, int statusCode) {
response['manufacturer'].forEach((item) {
@ -130,7 +130,7 @@ class PharmacyCategoriseService extends BaseService {
_parentCategoriseList.clear();
String endPoint =
id != null ? GET_CATEGORISE_PARENT + "$id" : GET_CATEGORISE_PARENT + "";
await baseAppClient.get(
await baseAppClient.getPharmacy(
endPoint,
onSuccess: (dynamic response, int statusCode) {
response['categories'].forEach((item) {
@ -150,7 +150,7 @@ class PharmacyCategoriseService extends BaseService {
String endPoint = id != null
? GET_PARENT_PRODUCTS + "$id" + '&page=1&limit=50'
: GET_PARENT_PRODUCTS + "";
await baseAppClient.get(
await baseAppClient.getPharmacy(
endPoint,
onSuccess: (dynamic response, int statusCode) {
response['products'].forEach((item) {
@ -170,7 +170,7 @@ class PharmacyCategoriseService extends BaseService {
String endPoint =
id != null ? GET_SUB_CATEGORISE + "$id" : GET_SUB_CATEGORISE + "";
await baseAppClient.get(
await baseAppClient.getPharmacy(
endPoint,
onSuccess: (dynamic response, int statusCode) {
response['categories'].forEach((item) {
@ -190,7 +190,7 @@ class PharmacyCategoriseService extends BaseService {
String endPoint = id != null
? GET_SUB_PRODUCTS + "$id" + '&page=1&limit=50'
: GET_SUB_PRODUCTS + "";
await baseAppClient.get(
await baseAppClient.getPharmacy(
endPoint,
onSuccess: (dynamic response, int statusCode) {
response['products'].forEach((item) {
@ -209,7 +209,7 @@ class PharmacyCategoriseService extends BaseService {
_finalProducts.clear();
String endPoint =
id != null ? GET_FINAL_PRODUCTS + "$id" : GET_FINAL_PRODUCTS + "";
await baseAppClient.get(
await baseAppClient.getPharmacy(
endPoint,
onSuccess: (dynamic response, int statusCode) {
response['products'].forEach((item) {

@ -0,0 +1,18 @@
import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/core/service/base_service.dart';
class TermsConditionsService extends BaseService {
String userAgreementContent = "";
Future getUserTermsAndConditions() async {
hasError = false;
await baseAppClient.post(GET_USER_TERMS,
onSuccess: (dynamic response, int statusCode) {
userAgreementContent = response['UserAgreementContent'];
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: Map<String, dynamic>());
}
}

@ -1,26 +1,54 @@
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/H2O/insert_user_activity_request_model.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/H2O/user_detail_model.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/H2O/user_progress_for_month_data_model.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/H2O/user_progress_for_today_data_model.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/H2O/user_progress_for_week_data_model.dart';
import 'package:diplomaticquarterapp/core/service/AlHabibMedicalService/H2O_service.dart';
import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart';
import 'package:charts_flutter/flutter.dart' as charts;
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import '../../../locator.dart';
class H2OViewModel extends BaseViewModel {
H2OService _h2OService = locator<H2OService>();
List<charts.Series> userProgressForWeekDataSeries;
List<charts.Series> userProgressForMonthDataSeries;
UserDetailModel get userDetail => _h2OService.userDetailModel;
UserProgressForTodayDataModel get userProgressData {
if (_h2OService.userProgressForTodayDataList.length != 0)
return _h2OService.userProgressForTodayDataList[0];
return null;
if (_h2OService.userProgressForTodayDataList.length != 0) return _h2OService.userProgressForTodayDataList[0];
return null;
}
Future getUserDetail() async {
// if(_h2OService.userProgressForTodayDataList.length==0){
setState(ViewState.Busy);
await _h2OService.getUserDetail();
if (_h2OService.hasError) {
error = _h2OService.error;
setState(ViewState.Error);
} else {
setState(ViewState.Idle);
}
}
Future updateUserDetail(UserDetailModel userDetailModel, Function(bool) onResponse) async {
setState(ViewState.Busy);
await _h2OService.updateUserDetail(userDetailModel);
if (_h2OService.hasError) {
error = _h2OService.error;
setState(ViewState.Error);
onResponse(false);
} else {
_h2OService.userDetailModel = userDetailModel;
setState(ViewState.Idle);
onResponse(true);
}
}
Future getUserProgressForTodayData() async {
// if(_h2OService.userProgressForTodayDataList.length==0){
@ -58,13 +86,9 @@ class H2OViewModel extends BaseViewModel {
}
}
List<charts.Series<ChartSeries,
String>> createUserProgressForWeekDataSeries() {
List<ChartSeries> globalData = [
];
_h2OService.userProgressForWeekDataList.forEach((
UserProgressForWeekDataModel data) {
List<charts.Series<ChartSeries, String>> createUserProgressForWeekDataSeries() {
List<ChartSeries> globalData = [];
_h2OService.userProgressForWeekDataList.forEach((UserProgressForWeekDataModel data) {
globalData.add(new ChartSeries(data.dayName, data.percentageConsumed));
});
return [
@ -77,12 +101,9 @@ class H2OViewModel extends BaseViewModel {
];
}
List<charts.Series<ChartSeries,
String>> createUserProgressForMonthDataSeries() {
List<ChartSeries> globalData = [
];
_h2OService.userProgressForMonthDataList.forEach((
UserProgressForMonthDataModel data) {
List<charts.Series<ChartSeries, String>> createUserProgressForMonthDataSeries() {
List<ChartSeries> globalData = [];
_h2OService.userProgressForMonthDataList.forEach((UserProgressForMonthDataModel data) {
globalData.add(new ChartSeries(data.monthName, data.percentageConsumed));
});
return [
@ -95,14 +116,10 @@ class H2OViewModel extends BaseViewModel {
];
}
Future insertUserActivity(
InsertUserActivityRequestModel insertUserActivityRequestModel) async {
Future insertUserActivity(InsertUserActivityRequestModel insertUserActivityRequestModel) async {
setState(ViewState.BusyLocal);
insertUserActivityRequestModel.mobileNumber =
user.mobileNumber.substring(1);
insertUserActivityRequestModel.identificationNo =
user.patientIdentificationNo;
insertUserActivityRequestModel.mobileNumber = user.mobileNumber.substring(1);
insertUserActivityRequestModel.identificationNo = user.patientIdentificationNo;
await _h2OService.insertUserActivity(insertUserActivityRequestModel);
if (_h2OService.hasError) {
@ -113,9 +130,18 @@ class H2OViewModel extends BaseViewModel {
}
}
Future undoUserActivity() async {
setState(ViewState.BusyLocal);
await _h2OService.undoUserActivity();
if (_h2OService.hasError) {
error = _h2OService.error;
setState(ViewState.ErrorLocal);
} else {
setState(ViewState.Idle);
}
}
}
/// Sample ordinal data type.
class ChartSeries {
final String y;

@ -0,0 +1,29 @@
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/service/termsConditionsService.dart';
import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart';
import '../../locator.dart';
class TermsConditionsViewModel extends BaseViewModel{
TermsConditionsService _service = locator<TermsConditionsService>();
String get userAgreementContent => _service.userAgreementContent;
getUserTermsAndConditions() async {
setState(ViewState.Busy);
await _service.getUserTermsAndConditions();
if (_service.hasError) {
error = _service.error;
setState(ViewState.Error);
} else {
setState(ViewState.Idle);
}
}
@override
void dispose() {
super.dispose();
}
}

@ -40,7 +40,7 @@ class AppointmentRateViewModel extends BaseViewModel {
Future sendAppointmentRate(int rate, int appointmentNo, int projectID,
int doctorID, int clinicID, String note) async {
setState(ViewState.BusyLocal);
setState(ViewState.Busy);
await _appointmentRateService.sendAppointmentRate(
rate, appointmentNo, projectID, doctorID, clinicID, note);
if (_appointmentRateService.hasError) {

@ -1,4 +1,5 @@
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/model/childvaccines/List_BabyInformationModel.dart';
import 'package:diplomaticquarterapp/core/model/childvaccines/add_newchild_model.dart';
import 'package:diplomaticquarterapp/core/model/childvaccines/create_vaccination_table.dart';
import 'package:diplomaticquarterapp/core/service/childvaccines/add_new_child_service.dart';
@ -11,14 +12,12 @@ import '../base_view_model.dart';
class VaccinationTableViewModel extends BaseViewModel{
VaccinationTableService _creteVaccinationTableService = locator<VaccinationTableService>();
List<CreateVaccinationTable> get creteVaccinationTableModelList=> _creteVaccinationTableService.createVaccinationTableModelList;
// String get creteVaccinationTableContent => _creteVaccinationTableService.userAgreementContent;
//String get userAgreementContent => _creteNewBabyService.v//_reportsService.userAgreementContent;
List<CreateVaccinationTable> get creteVaccinationTableModelList=> _creteVaccinationTableService.createVaccinationTableModelList;//.createNewBabyModelList;
getCreateVaccinationTable() async {
getCreateVaccinationTable(List_BabyInformationModel babyInfo, bool sendEmail) async {
setState(ViewState.Busy);
await _creteVaccinationTableService.getCreateVaccinationTableOrders();//getCreateNewBabyOrders();
await _creteVaccinationTableService.getCreateVaccinationTableOrders(babyInfo, sendEmail);//getCreateNewBabyOrders();
if ( _creteVaccinationTableService.hasError) {
error = _creteVaccinationTableService.error;

@ -1,33 +1,31 @@
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/model/my_trakers/blood_pressur/BloodPressureResult.dart';
import 'package:diplomaticquarterapp/core/model/my_trakers/blood_sugar/DiabtecPatientResult.dart';
import 'package:diplomaticquarterapp/core/model/my_trakers/chartData/WeekChartDate.dart';
import 'package:diplomaticquarterapp/core/model/my_trakers/chartData/YearMonthlyChartDate.dart';
import 'package:diplomaticquarterapp/core/service/medical/BloodPressureService.dart';
import 'package:diplomaticquarterapp/core/service/medical/BloodSugarService.dart';
import 'package:diplomaticquarterapp/locator.dart';
import 'package:charts_flutter/flutter.dart' as charts;
import 'package:diplomaticquarterapp/widgets/charts/app_time_series_chart.dart';
import '../../../core/viewModels/base_view_model.dart';
class BloodPressureViewMode extends BaseViewModel {
BloodPressureService bloodPressureService = locator<BloodPressureService>();
///BLOOD
List<WeekChartDate> _bloodDiastolicPressureWeeklyTimeSeriesSalesList = List();
List<WeekChartDate> _bloodSystolicePressureWeeklyTimeSeriesSalesList = List();
List<BloodPressureResult> get monthDiabtecPatientResult =>
bloodPressureService.monthDiabtecPatientResult;
List<YearMonthlyChartDate> _bloodDiastolicMonthlyTimeSeriesSalesList = List();
List<YearMonthlyChartDate> _bloodSystolicMonthlyTimeSeriesSalesList = List();
List<BloodPressureResult> get weekDiabtecPatientResult =>
bloodPressureService.weekDiabtecPatientResult;
List<WeekChartDate> _bloodSystoliceYearTimeSeriesSalesList = List();
List<WeekChartDate> _bloodDiastolicYearTimeSeriesSalesList = List();
List<BloodPressureResult> get yearDiabtecPatientResult =>
bloodPressureService.yearDiabtecPatientResult;
List<BloodPressureResult> get monthDiabtecPatientResult => bloodPressureService.monthDiabtecPatientResult;
List<TimeSeriesSales2> weightWeekTimeSeriesDataTop = [];
List<TimeSeriesSales2> weightWeekTimeSeriesDataLow = [];
List<BloodPressureResult> get weekDiabtecPatientResult => bloodPressureService.weekDiabtecPatientResult;
List<TimeSeriesSales3> weighMonthTimeSeriesDataTop = [];
List<TimeSeriesSales3> weighMonthTimeSeriesDataLow = [];
List<BloodPressureResult> get yearDiabtecPatientResult => bloodPressureService.yearDiabtecPatientResult;
List<TimeSeriesSales2> weightYearTimeSeriesDataTop = [];
List<TimeSeriesSales2> weightYearTimeSeriesDataLow = [];
Future getBloodPressure() async {
setState(ViewState.Busy);
@ -35,114 +33,94 @@ class BloodPressureViewMode extends BaseViewModel {
await bloodPressureService.getDiabtecResults();
if (bloodPressureService.hasError) {
error = bloodPressureService.error;
setState(ViewState.Error);
setState(ViewState.ErrorLocal);
} else {
clearDate();
bloodPressureService.weekDiabtectResultAverageList.forEach((element) {
_bloodDiastolicPressureWeeklyTimeSeriesSalesList.add(WeekChartDate(
x: element.bloodPressureDate,
y: element.dailyDiastolicPressureAverageResult));
_bloodSystolicePressureWeeklyTimeSeriesSalesList.add(WeekChartDate(
x: element.bloodPressureDate,
y: element.dailySystolicePressureAverageResult));
});
weightWeekTimeSeriesDataTop.add(TimeSeriesSales2(
element.bloodPressureDate,
element.dailyDiastolicPressureAverageResult.toDouble()));
weightWeekTimeSeriesDataLow.add(TimeSeriesSales2(
element.bloodPressureDate,
element.dailySystolicePressureAverageResult.toDouble()));
for (int index = 0;
index < bloodPressureService.monthDiabtectResultAverageList.length;
index++) {
_bloodDiastolicMonthlyTimeSeriesSalesList.add(YearMonthlyChartDate(
x: index,
y: bloodPressureService.monthDiabtectResultAverageList[index]
.weekDiastolicPressureAverageResult));
_bloodSystolicMonthlyTimeSeriesSalesList.add(YearMonthlyChartDate(
x: index,
y: bloodPressureService.monthDiabtectResultAverageList[index]
.weekSystolicePressureAverageResult));
}
bloodPressureService.yearDiabtecResultAverageList.forEach((element) {
_bloodSystoliceYearTimeSeriesSalesList
.add(WeekChartDate(x: element.date, y: element.monthSystolicePressureAverageResult));
_bloodDiastolicYearTimeSeriesSalesList
.add(WeekChartDate(x: element.date, y: element.monthDiastolicPressureAverageResult));
});
for (int index = 0; index < bloodPressureService.monthDiabtectResultAverageList.length; index++) {
weighMonthTimeSeriesDataTop.add(TimeSeriesSales3(index, bloodPressureService.monthDiabtectResultAverageList[index].weekDiastolicPressureAverageResult.toDouble()));
weighMonthTimeSeriesDataLow.add(TimeSeriesSales3(index, bloodPressureService.monthDiabtectResultAverageList[index].weekSystolicePressureAverageResult.toDouble()));
}
bloodPressureService.yearDiabtecResultAverageList.forEach((element) {
weightYearTimeSeriesDataTop.add(TimeSeriesSales2(element.date,
element.monthSystolicePressureAverageResult.toDouble()));
weightYearTimeSeriesDataLow.add(TimeSeriesSales2(element.date,
element.monthDiastolicPressureAverageResult.toDouble()));
});
});
setState(ViewState.Idle);
}
}
List<charts.Series<WeekChartDate, DateTime>> getBloodWeeklySeries() {
return [
charts.Series<WeekChartDate, DateTime>(
id: 'Diastolic',
colorFn: (_, __) => charts.MaterialPalette.red.shadeDefault,
domainFn: (WeekChartDate sales, _) => sales.x,
measureFn: (WeekChartDate sales, _) => sales.y,
data: _bloodDiastolicPressureWeeklyTimeSeriesSalesList,
),
charts.Series<WeekChartDate, DateTime>(
id: 'Systolice',
colorFn: (_, __) => charts.MaterialPalette.blue.shadeDefault,
domainFn: (WeekChartDate sales, _) => sales.x,
measureFn: (WeekChartDate sales, _) => sales.y,
data: _bloodSystolicePressureWeeklyTimeSeriesSalesList,
)
];
}
List<charts.Series<YearMonthlyChartDate, int>>
getBloodMonthlyTimeSeriesSales() {
return [
charts.Series<YearMonthlyChartDate, int>(
id: 'Sales',
colorFn: (_, __) => charts.MaterialPalette.red.shadeDefault,
domainFn: (YearMonthlyChartDate sales, _) => sales.x,
measureFn: (YearMonthlyChartDate sales, _) => sales.y,
data: _bloodDiastolicMonthlyTimeSeriesSalesList,
),
charts.Series<YearMonthlyChartDate, int>(
id: 'Sales',
colorFn: (_, __) => charts.MaterialPalette.blue.shadeDefault,
domainFn: (YearMonthlyChartDate sales, _) => sales.x,
measureFn: (YearMonthlyChartDate sales, _) => sales.y,
data: _bloodSystolicMonthlyTimeSeriesSalesList,
),
];
void clearDate(){
weightWeekTimeSeriesDataTop.clear();
weightWeekTimeSeriesDataLow.clear();
weighMonthTimeSeriesDataTop.clear();
weighMonthTimeSeriesDataLow.clear();
weightYearTimeSeriesDataTop.clear();
weightYearTimeSeriesDataLow.clear();
}
List<charts.Series<WeekChartDate, DateTime>> getBloodYearTimeSeriesSales() {
return [
charts.Series<WeekChartDate, DateTime>(
id: 'Sales',
colorFn: (_, __) => charts.MaterialPalette.red.shadeDefault,
domainFn: (WeekChartDate sales, _) => sales.x,
measureFn: (WeekChartDate sales, _) => sales.y,
data: _bloodSystoliceYearTimeSeriesSalesList,
),
charts.Series<WeekChartDate, DateTime>(
id: 'Sales',
colorFn: (_, __) => charts.MaterialPalette.blue.shadeDefault,
domainFn: (WeekChartDate sales, _) => sales.x,
measureFn: (WeekChartDate sales, _) => sales.y,
data: _bloodDiastolicYearTimeSeriesSalesList,
)
];
Future sendReportByEmail() async {
setState(ViewState.BusyLocal);
await bloodPressureService.sendReportByEmail();
if (bloodPressureService.hasError) {
error = bloodPressureService.error;
setState(ViewState.ErrorLocal);
} else {
setState(ViewState.Idle);
}
}
addDiabtecResult(
Future addORUpdateDiabtecResult(
{String bloodPressureDate,
String diastolicPressure,
String systolicePressure,
int measuredArm}) async {
String diastolicPressure,
String systolicePressure,
int measuredArm,bool isUpdate = false}) async {
setState(ViewState.BusyLocal);
if(!isUpdate)
await bloodPressureService.addDiabtecResult(
bloodPressureDate: bloodPressureDate,
diastolicPressure: diastolicPressure,
systolicePressure: systolicePressure,
measuredArm: measuredArm);
else
await bloodPressureService.updateDiabtecResult(
bloodPressureDate: bloodPressureDate,
diastolicPressure: diastolicPressure,
systolicePressure: systolicePressure,
measuredArm: measuredArm);
if (bloodPressureService.hasError) {
error = bloodPressureService.error;
setState(ViewState.ErrorLocal);
} else {
await getBloodPressure();
setState(ViewState.Idle);
}
}
Future deactivateDiabeticStatus({int lineItemNo}) async {
setState(ViewState.BusyLocal);
await bloodPressureService.deactivateDiabeticStatus(lineItemNo: lineItemNo);
if (bloodPressureService.hasError) {
error = bloodPressureService.error;
setState(ViewState.Error);
setState(ViewState.ErrorLocal);
} else {
await getBloodPressure();
setState(ViewState.Idle);

@ -5,17 +5,13 @@ import 'package:diplomaticquarterapp/core/model/my_trakers/chartData/YearMonthly
import 'package:diplomaticquarterapp/core/service/medical/BloodSugarService.dart';
import 'package:diplomaticquarterapp/locator.dart';
import 'package:charts_flutter/flutter.dart' as charts;
import 'package:diplomaticquarterapp/widgets/charts/app_time_series_chart.dart';
import '../../../core/viewModels/base_view_model.dart';
class BloodSugarViewMode extends BaseViewModel {
BloodSugarService bloodSugarService = locator<BloodSugarService>();
///BLOOD
List<WeekChartDate> _bloodWeeklyTimeSeriesSalesList = List();
List<YearMonthlyChartDate> _bloodMonthlyTimeSeriesSalesList = List();
List<WeekChartDate> _bloodYearTimeSeriesSalesList = List();
List<DiabtecPatientResult> get monthDiabtecPatientResult =>
bloodSugarService.monthDiabtecPatientResult;
@ -25,6 +21,10 @@ class BloodSugarViewMode extends BaseViewModel {
List<DiabtecPatientResult> get yearDiabtecPatientResult =>
bloodSugarService.yearDiabtecPatientResult;
List<TimeSeriesSales2> bloodWeekTimeSeriesData = [];
List<TimeSeriesSales2> yearTimeSeriesData = [];
List<TimeSeriesSales3> monthTimeSeriesData = [];
Future getBloodSugar() async {
setState(ViewState.Busy);
await bloodSugarService.getBloodSugar();
@ -34,67 +34,35 @@ class BloodSugarViewMode extends BaseViewModel {
setState(ViewState.Error);
} else {
bloodSugarService.weekDiabtectResultAverageList.forEach((element) {
_bloodWeeklyTimeSeriesSalesList.add(
WeekChartDate(x: element.dateChart, y: element.dailyAverageResult));
bloodWeekTimeSeriesData.add(TimeSeriesSales2(
element.dateChart,
element.dailyAverageResult.toDouble(),
));
});
for (int index = 0;
index < bloodSugarService.monthDiabtectResultAverageList.length;
index++) {
_bloodMonthlyTimeSeriesSalesList.add(YearMonthlyChartDate(
x: index,
y: bloodSugarService
.monthDiabtectResultAverageList[index].weekAverageResult));
var asd="";
monthTimeSeriesData.add(TimeSeriesSales3(
index,
bloodSugarService
.monthDiabtectResultAverageList[index].weekAverageResult
.toDouble(),
));
}
bloodSugarService.yearDiabtecResultAverageList.forEach((element) {
_bloodYearTimeSeriesSalesList
.add(WeekChartDate(x: element.date, y: element.monthAverageResult));
yearTimeSeriesData.add(TimeSeriesSales2(
element.date,
element.monthAverageResult.toDouble(),
));
});
setState(ViewState.Idle);
}
}
List<charts.Series<WeekChartDate, DateTime>> getBloodWeeklySeries() {
return [
new charts.Series<WeekChartDate, DateTime>(
id: 'Sales',
colorFn: (_, __) => charts.MaterialPalette.red.shadeDefault,
domainFn: (WeekChartDate sales, _) => sales.x,
measureFn: (WeekChartDate sales, _) => sales.y,
data: _bloodWeeklyTimeSeriesSalesList,
)
];
}
List<charts.Series<YearMonthlyChartDate, int>>
getBloodMonthlyTimeSeriesSales() {
return [
new charts.Series<YearMonthlyChartDate, int>(
id: 'Sales',
colorFn: (_, __) => charts.MaterialPalette.red.shadeDefault,
domainFn: (YearMonthlyChartDate sales, _) => sales.x,
measureFn: (YearMonthlyChartDate sales, _) => sales.y,
data: _bloodMonthlyTimeSeriesSalesList,
)
];
}
List<charts.Series<WeekChartDate, DateTime>> getBloodYearTimeSeriesSales() {
return [
new charts.Series<WeekChartDate, DateTime>(
id: 'Sales',
colorFn: (_, __) => charts.MaterialPalette.red.shadeDefault,
domainFn: (WeekChartDate sales, _) => sales.x,
measureFn: (WeekChartDate sales, _) => sales.y,
data: _bloodYearTimeSeriesSalesList,
)
];
}
addDiabtecResult(
Future addDiabtecResult(
{String bloodSugerDateChart,
String bloodSugerResult,
String diabtecUnit,
@ -102,7 +70,7 @@ class BloodSugarViewMode extends BaseViewModel {
setState(ViewState.BusyLocal);
await bloodSugarService.addDiabtecResult(
bloodSugerDateChart: bloodSugerDateChart,
bloodSugerResult: bloodSugerResult ,
bloodSugerResult: bloodSugerResult,
diabtecUnit: diabtecUnit,
measuredTime: measuredTime);
if (bloodSugarService.hasError) {
@ -114,6 +82,53 @@ class BloodSugarViewMode extends BaseViewModel {
}
}
Future updateDiabtecResult(
{DateTime month,
DateTime hour,
String bloodSugerResult,
String diabtecUnit,
int measuredTime,
int lineItemNo}) async {
setState(ViewState.BusyLocal);
await bloodSugarService.updateDiabtecResult(
bloodSugerResult: bloodSugerResult,
diabtecUnit: diabtecUnit,
hour: hour,
measuredTime: measuredTime,
lineItemNo: lineItemNo,
month: month);
if (bloodSugarService.hasError) {
error = bloodSugarService.error;
setState(ViewState.ErrorLocal);
} else {
await getBloodSugar();
setState(ViewState.Idle);
}
}
Future sendReportByEmail() async {
setState(ViewState.BusyLocal);
await bloodSugarService.sendReportByEmail();
if (bloodSugarService.hasError) {
error = bloodSugarService.error;
setState(ViewState.ErrorLocal);
} else {
setState(ViewState.Idle);
}
}
Future deactivateDiabeticStatus({int lineItemNo}) async {
setState(ViewState.BusyLocal);
await bloodSugarService.deactivateDiabeticStatus(lineItemNo: lineItemNo);
if (bloodSugarService.hasError) {
error = bloodSugarService.error;
setState(ViewState.ErrorLocal);
} else {
await getBloodSugar();
setState(ViewState.Idle);
}
}
}

@ -41,6 +41,9 @@ class MyBalanceViewModel extends BaseViewModel {
double get totalAdvanceBalanceAmount =>
_myBalanceService.totalAdvanceBalanceAmount;
String get updatedRegisterBloodMessage =>
_myBalanceService.updatedRegisterBloodMessage;
GetAllSharedRecordsByStatusResponse get getAllSharedRecordsByStatusResponse =>
_myBalanceService.getAllSharedRecordsByStatusResponse;
@ -74,7 +77,6 @@ class MyBalanceViewModel extends BaseViewModel {
setState(ViewState.Idle);
}
Future getCities() async {
setState(ViewState.Busy);
await _bloodDonationService.getAllCitiesOrders();
@ -159,4 +161,17 @@ class MyBalanceViewModel extends BaseViewModel {
setState(ViewState.Idle);
}
}
Future updateBloodGroup(List_BloodGroupDetailsModel detailsModel) async {
setState(ViewState.Busy);
await _myBalanceService.updateBloodGroup(detailsModel);
if (_myBalanceService.hasError) {
error = _myBalanceService.error;
setState(ViewState.ErrorLocal);
} else {
await _myBalanceService.addUserAgreementForBloodDonation();
setState(ViewState.Idle);
}
}
}

@ -13,11 +13,9 @@ class ReportsMonthlyViewModel extends BaseViewModel {
ReportsService _reportsService = locator<ReportsService>();
String get userAgreementContent => _reportsService.userAgreementContent;
getUserTermsAndConditions() async{
getUserTermsAndConditions() async {
setState(ViewState.Busy);
await _reportsService.getUserTermsAndConditions();
if (_reportsService.hasError) {
@ -28,19 +26,33 @@ class ReportsMonthlyViewModel extends BaseViewModel {
}
}
updatePatientHealthSummaryReport({String message, bool isSummary})async{
updatePatientHealthSummaryReport(
{String message,
bool isSummary,
bool isUpdateEmail = false,
String email}) async {
setState(ViewState.BusyLocal);
await _reportsService.updatePatientHealthSummaryReport(isSummary: isSummary);
await _reportsService.updatePatientHealthSummaryReport(
isSummary: isSummary);
if (_reportsService.hasError) {
error = _reportsService.error;
AppToast.showErrorToast(message: error);
setState(ViewState.ErrorLocal);
} else {
AppToast.showSuccessToast(message: message);
setState(ViewState.Idle);
if (isUpdateEmail) {
await _reportsService.updateEmail(email: email);
if (_reportsService.hasError) {
error = _reportsService.error;
AppToast.showErrorToast(message: error);
setState(ViewState.ErrorLocal);
} else {
AppToast.showSuccessToast(message: message);
setState(ViewState.Idle);
}
} else {
AppToast.showSuccessToast(message: message);
setState(ViewState.Idle);
}
}
}
}

@ -9,16 +9,13 @@ import 'package:diplomaticquarterapp/core/service/medical/BloodSugarService.dart
import 'package:diplomaticquarterapp/core/service/medical/WeightPressureService.dart';
import 'package:diplomaticquarterapp/locator.dart';
import 'package:charts_flutter/flutter.dart' as charts;
import 'package:diplomaticquarterapp/widgets/charts/app_time_series_chart.dart';
import '../../../core/viewModels/base_view_model.dart';
class WeightPressureViewMode extends BaseViewModel {
class WeightPressureViewModel extends BaseViewModel {
WeightService weightService = locator<WeightService>();
List<WeekChartDate> _weightWeeklyTimeSeriesSalesList = List();
List<YearMonthlyChartDate> _weightMonthlyTimeSeriesSalesList = List();
List<WeekChartDate> _weightYearTimeSeriesSalesList = List();
List<WeightMeasurementResult> get monthWeightMeasurementResult =>
weightService.monthWeightMeasurementResult;
@ -28,6 +25,10 @@ class WeightPressureViewMode extends BaseViewModel {
List<WeightMeasurementResult> get yearWeightMeasurementResult =>
weightService.yearWeightMeasurementResult;
List<TimeSeriesSales2> weightWeekTimeSeriesData = [];
List<TimeSeriesSales3> weighMonthTimeSeriesData = [];
List<TimeSeriesSales2> weightYearTimeSeriesData = [];
Future getWeight() async {
setState(ViewState.Busy);
await weightService.getWeightAverage();
@ -37,71 +38,84 @@ class WeightPressureViewMode extends BaseViewModel {
setState(ViewState.Error);
} else {
weightService.weekWeightMeasurementResultAverage.forEach((element) {
_weightWeeklyTimeSeriesSalesList.add(WeekChartDate(
x: element.weightDate, y: element.dailyAverageResult));
weightWeekTimeSeriesData.add(TimeSeriesSales2(
element.weightDate,
element.dailyAverageResult.toDouble(),
));
});
for (int index = 0;
index < weightService.monthWeightMeasurementResultAverage.length;
index++) {
_weightMonthlyTimeSeriesSalesList.add(YearMonthlyChartDate(
x: index,
y: weightService.monthWeightMeasurementResultAverage[index].weekAverageResult));
weighMonthTimeSeriesData.add(TimeSeriesSales3(
index,
weightService
.monthWeightMeasurementResultAverage[index].weekAverageResult
.toDouble(),
));
}
weightService.yearWeightMeasurementResultAverage.forEach((element) {
_weightYearTimeSeriesSalesList
.add(WeekChartDate(x: element.date, y: element.monthAverageResult));
weightYearTimeSeriesData.add(TimeSeriesSales2(
element.date,
element.monthAverageResult.toDouble(),
));
});
setState(ViewState.Idle);
}
}
List<charts.Series<WeekChartDate, DateTime>> getWeightWeeklySeries() {
return [
charts.Series<WeekChartDate, DateTime>(
id: 'Diastolic',
colorFn: (_, __) => charts.MaterialPalette.red.shadeDefault,
domainFn: (WeekChartDate sales, _) => sales.x,
measureFn: (WeekChartDate sales, _) => sales.y,
data: _weightWeeklyTimeSeriesSalesList,
),
];
addWeightResult(
{String weightDate, String weightMeasured, int weightUnit}) async {
setState(ViewState.BusyLocal);
await weightService.addWeightResult(
weightDate: weightDate,
weightMeasured: weightMeasured,
weightUnit: weightUnit,
);
if (weightService.hasError) {
error = weightService.error;
setState(ViewState.Error);
} else {
await getWeight();
setState(ViewState.Idle);
}
}
Future sendReportByEmail() async {
setState(ViewState.BusyLocal);
List<charts.Series<YearMonthlyChartDate, int>>
getWeightMonthlyTimeSeriesSales() {
return [
charts.Series<YearMonthlyChartDate, int>(
id: 'Sales',
colorFn: (_, __) => charts.MaterialPalette.red.shadeDefault,
domainFn: (YearMonthlyChartDate sales, _) => sales.x,
measureFn: (YearMonthlyChartDate sales, _) => sales.y,
data: _weightMonthlyTimeSeriesSalesList,
),
];
await weightService.sendReportByEmail();
if (weightService.hasError) {
error = weightService.error;
setState(ViewState.ErrorLocal);
} else {
setState(ViewState.Idle);
}
}
List<charts.Series<WeekChartDate, DateTime>> getWeightYearTimeSeriesSales() {
return [
charts.Series<WeekChartDate, DateTime>(
id: 'Sales',
colorFn: (_, __) => charts.MaterialPalette.red.shadeDefault,
domainFn: (WeekChartDate sales, _) => sales.x,
measureFn: (WeekChartDate sales, _) => sales.y,
data: _weightYearTimeSeriesSalesList,
),
];
updateWeightResult({int lineItemNo, int weightUnit, String weightMeasured,String weightDate}) async {
setState(ViewState.BusyLocal);
await weightService.updateWeightResult(
lineItemNo: lineItemNo,
weightMeasured: weightMeasured,
weightUnit: weightUnit,
weightDate: weightDate
);
if (weightService.hasError) {
error = weightService.error;
setState(ViewState.Error);
} else {
await getWeight();
setState(ViewState.Idle);
}
}
addWeightResult(
{String weightDate, String weightMeasured, int weightUnit}) async {
deleteWeightResult({int lineItemNo, }) async {
setState(ViewState.BusyLocal);
await weightService.addWeightResult(
weightDate: weightDate,
weightMeasured: weightMeasured,
weightUnit: weightUnit,);
await weightService.deleteWeightResult(
lineItemNo: lineItemNo,
);
if (weightService.hasError) {
error = weightService.error;
setState(ViewState.Error);

@ -10,6 +10,7 @@ import 'package:diplomaticquarterapp/services/pharmacy_services/cancelOrder_serv
import 'package:diplomaticquarterapp/services/pharmacy_services/orderDetails_service.dart';
import 'package:diplomaticquarterapp/services/pharmacy_services/order_service.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/order_model.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/orders_model.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:flutter/material.dart';
import '../../../locator.dart';
@ -17,15 +18,12 @@ import '../base_view_model.dart';
class OrderModelViewModel extends BaseViewModel {
OrderService _orderService = locator<OrderService>();
List<OrderModel> get order => _orderService.orderList;
List<Orders> get orders => _orderService.orderList;
OrderDetailsService _orderDetailsService = locator<OrderDetailsService>();
List<OrderModel> get orderDetails => _orderDetailsService.orderDetails;
List<OrderModel> get orderListModel => _orderDetailsService.orderList;
CancelOrderService _cancelOrderService = locator<CancelOrderService>();
List<OrderModel> get cancelOrder => _cancelOrderService.cancelOrderList;
@ -52,9 +50,9 @@ class OrderModelViewModel extends BaseViewModel {
}
}
Future getOrderDetails(orderId) async {
Future getOrderDetails(OrderId) async {
setState(ViewState.Busy);
await _orderDetailsService.getOrderDetails(orderId);
await _orderDetailsService.getOrderDetails(OrderId);
if (_orderDetailsService.hasError) {
error = _orderDetailsService.error;
setState(ViewState.Error);

@ -3,7 +3,11 @@ import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/Manufacturer.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/PharmacyImageObject.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/PharmacyProduct.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/Prescriptions.dart';
//import 'package:diplomaticquarterapp/core/model/prescriptions/perscription_pharmacy.dart';
//import 'package:diplomaticquarterapp/core/service/medical/prescriptions_service.dart';
import 'package:diplomaticquarterapp/core/service/parmacyModule/parmacy_module_service.dart';
import 'package:diplomaticquarterapp/core/service/parmacyModule/prescription_service.dart';
import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart';
import '../../../locator.dart';
@ -11,6 +15,8 @@ import '../../../locator.dart';
class PharmacyModuleViewModel extends BaseViewModel {
PharmacyModuleService _pharmacyService = locator<PharmacyModuleService>();
PrescriptionService _prescriptionService = locator<PrescriptionService>();
List<PharmacyImageObject> get bannerList => _pharmacyService.bannerItems;
List<Manufacturer> get manufacturerList => _pharmacyService.manufacturerList;
@ -21,6 +27,11 @@ class PharmacyModuleViewModel extends BaseViewModel {
List<PharmacyProduct> get lastVisitedProducts =>
_pharmacyService.lastVisitedProducts;
List<Prescriptions> get prescriptionsList =>
_prescriptionService.prescriptionsList;
// List<PharmacyProduct> get pharmacyPrescriptionsList => PharmacyProduct.pharmacyPrescriptionsList ;
Future getPharmacyHomeData() async {
setState(ViewState.Busy);
var data = await sharedPref.getObject(USER_PROFILE);
@ -40,6 +51,27 @@ class PharmacyModuleViewModel extends BaseViewModel {
}
}
Future createUser() async {
setState(ViewState.Busy);
await _pharmacyService.createUser();
if (_pharmacyService.hasError) {
error = _pharmacyService.error;
setState(ViewState.ErrorLocal);
} else {
setState(ViewState.Idle);
}
}
Future generatePharmacyToken() async {
setState(ViewState.Busy);
await _pharmacyService.generatePharmacyToken();
if (_pharmacyService.hasError) {
error = _pharmacyService.error;
setState(ViewState.ErrorLocal);
} else {
setState(ViewState.Idle);
}
}
Future getBannerList() async {
setState(ViewState.Busy);
await _pharmacyService.getBannerListList();
@ -92,6 +124,17 @@ class PharmacyModuleViewModel extends BaseViewModel {
}
}
/////////////RecommendedProducts
// _getRecommendedProducts() async {
// await _pharmacyService.getRecommendedProducts();
// if (_pharmacyService.hasError) {
// error = _pharmacyService.error;
// setState(ViewState.Error);
// } else {
// setState(ViewState.Idle);
// }
// }
Future<bool> checkUserIsActivated() async {
if (authenticatedUserObject.isLogin) {
var customerId = await sharedPref.getString(PHARMACY_CUSTOMER_ID);
@ -105,4 +148,17 @@ class PharmacyModuleViewModel extends BaseViewModel {
return false;
}
}
getPrescription() async {
print("Print PRESCRIPTION url");
setState(ViewState.Busy);
await _prescriptionService.getPrescription();
if (_prescriptionService.hasError) {
error = _prescriptionService.error;
setState(ViewState.Error);
} else {
setState(ViewState.Idle);
}
}
}

@ -50,6 +50,17 @@ class ProductDetailViewModel extends BaseViewModel{
setState(ViewState.Idle);
}
Future notifyMe(customerId, itemID) async {
hasError = false;
setState(ViewState.Busy);
await _productLocationService.notifyMe(customerId, itemID);
if (_productLocationService.hasError) {
error = _productLocationService.error;
setState(ViewState.ErrorLocal);
} else
setState(ViewState.Idle);
}
Future addToCartData(quantity, itemID) async {
hasError = false;
setState(ViewState.Busy);

@ -16,30 +16,22 @@ import 'base_view_model.dart';
class PharmacyCategoriseViewModel extends BaseViewModel {
bool hasError = false;
PharmacyCategoriseService _pharmacyCategoriseService =
locator<PharmacyCategoriseService>();
PharmacyCategoriseService _pharmacyCategoriseService = locator<PharmacyCategoriseService>();
List<PharmacyCategorise> get categorise =>
_pharmacyCategoriseService.categoriseList;
List<PharmacyCategorise> get categorise => _pharmacyCategoriseService.categoriseList;
List<CategoriseParentModel> get categoriseParent =>
_pharmacyCategoriseService.parentCategoriseList;
List<CategoriseParentModel> get categoriseParent => _pharmacyCategoriseService.parentCategoriseList;
List<ParentProductsModel> get parentProducts =>
_pharmacyCategoriseService.parentProductsList;
List<ParentProductsModel> get parentProducts => _pharmacyCategoriseService.parentProductsList;
List<SubCategoriesModel> get subCategorise =>
_pharmacyCategoriseService.subCategoriseList;
List<SubCategoriesModel> get subCategorise => _pharmacyCategoriseService.subCategoriseList;
List<SubProductsModel> get subProducts =>
_pharmacyCategoriseService.subProductsList;
List<SubProductsModel> get subProducts => _pharmacyCategoriseService.subProductsList;
List<FinalProductsModel> get finalProducts =>
_pharmacyCategoriseService.finalProducts;
List<FinalProductsModel> get finalProducts => _pharmacyCategoriseService.finalProducts;
List<BrandsModel> get brandsList => _pharmacyCategoriseService.brandsList;
List<SearchProductsModel> get searchList =>
_pharmacyCategoriseService.searchList;
List<SearchProductsModel> get searchList => _pharmacyCategoriseService.searchList;
List<ScanQrModel> get scanList => _pharmacyCategoriseService.scanList;

@ -32,7 +32,7 @@ class ProjectViewModel extends BaseViewModel {
Locale get appLocal => _appLocale;
LocaleType get localeType => isArabic ? LocaleType.en : LocaleType.ar;
LocaleType get localeType => isArabic ? LocaleType.ar : LocaleType.en;
bool get isArabic => _isArabic;

@ -1,4 +1,5 @@
import 'package:diplomaticquarterapp/core/service/AlHabibMedicalService/H2O_service.dart';
import 'package:diplomaticquarterapp/core/service/parmacyModule/prescription_service.dart';
import 'package:diplomaticquarterapp/core/service/qr_service.dart';
import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/H2O_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/child_vaccines/user_information_view_model.dart';
@ -59,12 +60,14 @@ import 'core/service/parmacyModule/order-preview-service.dart';
import 'core/service/notifications_service.dart';
import 'core/service/parmacyModule/terms-condition-service.dart';
import 'core/service/privilege_service.dart';
import 'core/service/termsConditionsService.dart';
import 'core/service/weather_service.dart';
import 'core/viewModels/AlHabibMedicalService/cmc_view_model.dart';
import 'core/service/parmacyModule/parmacy_module_service.dart';
import 'core/service/offers_service.dart';
import 'core/service/pharmacy_categorise_service.dart';
import 'core/viewModels/TermsConditionsViewModel.dart';
import 'core/viewModels/all_habib_medical_services/e_referral_view_model.dart';
import 'core/viewModels/appointment_rate_view_model.dart';
import 'core/viewModels/blooddonation/blood_details_view_model.dart';
@ -202,8 +205,11 @@ void setupLocator() {
locator.registerLazySingleton(() => CustomerAddressesService());
locator.registerLazySingleton(() => TermsConditionService());
locator.registerLazySingleton(() => CancelOrderService());
locator.registerLazySingleton(() => PrescriptionService());
locator.registerLazySingleton(() => PrivilegeService());
locator.registerLazySingleton(() => WeatherService());
locator.registerLazySingleton(() => TermsConditionsService());
/// View Model
locator.registerFactory(() => HospitalViewModel());
@ -242,7 +248,7 @@ void setupLocator() {
locator.registerFactory(() => H2OViewModel());
locator.registerFactory(() => BloodSugarViewMode());
locator.registerFactory(() => BloodPressureViewMode());
locator.registerFactory(() => WeightPressureViewMode());
locator.registerFactory(() => WeightPressureViewModel());
locator.registerFactory(() => EyeViewModel());
locator.registerFactory(() => ActiveMedicationsViewModel());
locator.registerFactory(() => AskDoctorViewModel());
@ -259,7 +265,6 @@ void setupLocator() {
locator.registerFactory(() => ProductDetailViewModel());
locator.registerFactory(() => WeatherViewModel());
locator.registerFactory(() => OrderPreviewViewModel());
locator.registerFactory(() => LacumViewModel());
locator.registerFactory(() => LacumTranferViewModel());
@ -271,11 +276,16 @@ void setupLocator() {
// Offer And Packages
//----------------------
locator.registerLazySingleton(() => OffersAndPackagesServices()); // offerPackagesServices Service
locator.registerFactory(() => OfferCategoriesViewModel()); // Categories View Model
locator.registerFactory(() => OfferProductsViewModel()); // Products View Model
locator.registerLazySingleton(
() => OffersAndPackagesServices()); // offerPackagesServices Service
locator.registerFactory(
() => OfferCategoriesViewModel()); // Categories View Model
locator
.registerFactory(() => OfferProductsViewModel()); // Products View Model
// Geofencing
// ---------------------
locator.registerLazySingleton(() => GeofencingServices()); // Geofencing Services
locator.registerLazySingleton(
() => GeofencingServices()); // Geofencing Services
locator.registerFactory(() => TermsConditionsViewModel());
}

@ -100,14 +100,14 @@ class MyApp extends StatelessWidget {
backgroundColor: Color.fromRGBO(255, 255, 255, 1),
highlightColor: Colors.grey[100].withOpacity(0.4),
splashColor: Colors.transparent,
primaryColor: Colors.grey,
primaryColor: Color(0xff515A5D),
toggleableActiveColor: secondaryColor,
indicatorColor: secondaryColor,
bottomSheetTheme: BottomSheetThemeData(backgroundColor: HexColor('#E0E0E0')),
cursorColor: Colors.grey,
iconTheme: IconThemeData(),
appBarTheme: AppBarTheme(
color: Colors.grey[700],
color: Color(0xff515A5D),
brightness: Brightness.light,
elevation: 0.0,
actionsIconTheme: IconThemeData(

@ -0,0 +1,8 @@
class healthData {
int MedCategoryID;
int MedSubCategoryID;
String Value;
String Notes;
String MachineDate;
int TransactionsListID;
}

@ -0,0 +1,36 @@
class YearlyStepsResModel {
double valueSum;
int medCategoryID;
int month;
String monthName;
int patientID;
int year;
YearlyStepsResModel(
{this.valueSum,
this.medCategoryID,
this.month,
this.monthName,
this.patientID,
this.year});
YearlyStepsResModel.fromJson(Map<String, dynamic> json) {
valueSum = json['ValueSum'];
medCategoryID = json['MedCategoryID'];
month = json['Month'];
monthName = json['MonthName'];
patientID = json['PatientID'];
year = json['Year'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['ValueSum'] = this.valueSum;
data['MedCategoryID'] = this.medCategoryID;
data['Month'] = this.month;
data['MonthName'] = this.monthName;
data['PatientID'] = this.patientID;
data['Year'] = this.year;
return data;
}
}

@ -30,7 +30,7 @@ class _ConfirmCancelOrderDialogState extends State<ConfirmCancelOrderDialog> {
contentPadding: EdgeInsets.fromLTRB(28.0, 24.0, 28.0, 0.0),
title: Center(
child: Texts(
"Confirm",
TranslationBase.of(context).confirm,
color: Colors.black,
),
),
@ -40,7 +40,7 @@ class _ConfirmCancelOrderDialogState extends State<ConfirmCancelOrderDialog> {
Divider(),
Center(
child: Texts(
"Are you sure!! want to cancel this order",
TranslationBase.of(context).cancelOrderMsg ,
color: Colors.grey,
),
),

@ -0,0 +1,148 @@
import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/add_new_address_Request_Model.dart';
import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/cmc_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/home_health_care_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:google_maps_flutter/google_maps_flutter.dart';
import 'package:google_maps_place_picker/google_maps_place_picker.dart';
import 'package:provider/provider.dart';
class CMCLocationPage extends StatefulWidget {
final Function(PickResult) onPick;
final double latitude;
final double longitude;
final dynamic model;
const CMCLocationPage({Key key, this.onPick, this.latitude, this.longitude, this.model})
: super(key: key);
@override
_CMCLocationPageState createState() =>
_CMCLocationPageState();
}
class _CMCLocationPageState
extends State<CMCLocationPage> {
double latitude = 0;
double longitude = 0;
@override
void initState() {
latitude = widget.latitude;
longitude = widget.longitude;
super.initState();
}
@override
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
return BaseView<CMCViewModel>(
onModelReady: (model) {},
builder: (_, model, widget) => AppScaffold(
isShowDecPage: false,
isShowAppBar: true,
baseViewModel: model,
body: PlacePicker(
apiKey: GOOGLE_API_KEY,
enableMyLocationButton: true,
automaticallyImplyAppBarLeading: false,
autocompleteOnTrailingWhitespace: true,
selectInitialPosition: true,
autocompleteLanguage: projectViewModel.currentLanguage,
enableMapTypeButton: true,
searchForInitialValue: false,
onPlacePicked: (PickResult result) {
print(result.adrAddress);
},
selectedPlaceWidgetBuilder:
(_, selectedPlace, state, isSearchBarFocused) {
print("state: $state, isSearchBarFocused: $isSearchBarFocused");
return isSearchBarFocused
? Container()
: FloatingCard(
bottomPosition: 0.0,
leftPosition: 0.0,
rightPosition: 0.0,
width: 500,
borderRadius: BorderRadius.circular(12.0),
child: state == SearchingState.Searching
? Center(child: CircularProgressIndicator())
: Container(
margin: EdgeInsets.all(12),
child: Column(
children: [
SecondaryButton(
color: Colors.grey[800],
textColor: Colors.white,
onTap: () async {
print(selectedPlace);
AddNewAddressRequestModel
addNewAddressRequestModel =
new AddNewAddressRequestModel(
customer: Customer(addresses: [
Addresses(
address1:
selectedPlace.formattedAddress,
address2: selectedPlace
.formattedAddress,
customerAttributes: "",
city: "",
createdOnUtc: "",
id: 0,
latLong: "$latitude,$longitude",
email: "")
]),
);
selectedPlace.addressComponents.forEach((e) {
if (e.types.contains("country")) {
addNewAddressRequestModel.customer
.addresses[0].country = e.longName;
}
if (e.types.contains("postal_code")) {
addNewAddressRequestModel.customer
.addresses[0].zipPostalCode =
e.longName;
}
if (e.types.contains("locality")) {
addNewAddressRequestModel.customer
.addresses[0].city =
e.longName;
}
});
await model.addAddressInfo(
addNewAddressRequestModel: addNewAddressRequestModel);
if (model.state == ViewState.ErrorLocal) {
Utils.showErrorToast(model.error);
} else {
AppToast.showSuccessToast(
message: "Address Added Successfully");
}
Navigator.of(context).pop();
},
label: TranslationBase.of(context).addNewAddress,
),
],
),
),
);
},
initialPosition: LatLng(latitude, longitude),
useCurrentLocation: false,
),
));
}
}

@ -3,15 +3,18 @@ import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/Comprehens
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/get_order_detail_by_order_iD_response_model.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/update_pres_oreder_request_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/cmc_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/Dialog/confirm_cancel_order_dialog.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/HomeHealthCare/StepsWidget.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:flutter/material.dart';
import 'package:geolocator/geolocator.dart';
import 'package:provider/provider.dart';
import 'new_cmc_step_one_page.dart';
import 'new_cmc_step_three_page.dart';
@ -46,7 +49,7 @@ class _NewCMCPageState extends State<NewCMCPage>
price: widget.model.cmcAllServicesList[0].price,
serviceID: widget.model.cmcAllServicesList[0].serviceID.toString(),
selectedServiceName: widget.model.cmcAllServicesList[0].description,
selectedServiceNameAR: widget.model.cmcAllServicesList[0].description,
selectedServiceNameAR: widget.model.cmcAllServicesList[0].descriptionN,
recordID: 1,
totalPrice: widget.model.cmcAllServicesList[0].totalPrice,
vAT: widget.model.cmcAllServicesList[0].vAT);
@ -85,6 +88,8 @@ class _NewCMCPageState extends State<NewCMCPage>
@override
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
void showConfirmMessage(
CMCViewModel model, GetOrderDetailByOrderIDResponseModel order) {
showDialog(
@ -101,7 +106,7 @@ class _NewCMCPageState extends State<NewCMCPage>
if (model.state == ViewState.ErrorLocal) {
Utils.showErrorToast(model.error);
} else {
AppToast.showSuccessToast(message: "Done Successfully");
AppToast.showSuccessToast(message:TranslationBase.of(context).processDoneSuccessfully );
await model.getCmcAllPresOrders();
}
},
@ -114,13 +119,16 @@ class _NewCMCPageState extends State<NewCMCPage>
height: MediaQuery.of(context).size.height * 0.8,
child: Column(
children: [
Container(
margin: EdgeInsets.only(left: MediaQuery.of(context).size.width*0.05, right: MediaQuery.of(context).size.width*0.05),
child: StepsWidget(
index: _currentIndex,
changeCurrentTab: changePageViewIndex,
if (widget.model.cmcAllOrderDetail.length == 0)
Container(
margin: EdgeInsets.only(
left: MediaQuery.of(context).size.width * 0.05,
right: MediaQuery.of(context).size.width * 0.05),
child: StepsWidget(
index: _currentIndex,
changeCurrentTab: changePageViewIndex,
),
),
),
Expanded(
child: PageView(
physics: NeverScrollableScrollPhysics(),
@ -134,183 +142,192 @@ class _NewCMCPageState extends State<NewCMCPage>
children: <Widget>[
widget.model.cmcAllOrderDetail.length != 0
? FractionallySizedBox(
heightFactor: 0.8,
widthFactor: 0.9,
child: Container(
width: double.infinity,
margin: EdgeInsets.only(top: 15),
decoration: BoxDecoration(
border:
Border.all(color: Colors.grey, width: 1),
borderRadius: BorderRadius.circular(12),
color: Colors.white),
child: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(
height: 12,
),
Container(
width: double.infinity,
padding: EdgeInsets.only(
left: 15, bottom: 15, top: 15),
margin: EdgeInsets.only(top: 15),
decoration: BoxDecoration(
border: Border(
bottom: BorderSide(
color: Colors.grey,
width: 1.0,
),
),
// borderRadius: BorderRadius.circular(12),
border:
Border.all(color: Colors.grey, width: 1),
borderRadius: BorderRadius.circular(12),
color: Colors.white),
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Texts(
"Request ID",
bold: false,
fontSize: 13,
),
SizedBox(
height: 4,
),
Texts(
widget.model.cmcAllOrderDetail[0].iD.toString(),
fontSize: 22,
height: 12,
),
],
),
),
Container(
width: double.infinity,
padding: EdgeInsets.only(
left: 15, bottom: 15, top: 15),
decoration: BoxDecoration(
border: Border(
bottom: BorderSide(
color: Colors.grey,
width: 1.0,
Container(
width: double.infinity,
padding: EdgeInsets.only(
left: 15, bottom: 15, top: 15,right: 15),
decoration: BoxDecoration(
border: Border(
bottom: BorderSide(
color: Colors.grey,
width: 1.0,
),
),
// borderRadius: BorderRadius.circular(12),
color: Colors.white),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Texts(
TranslationBase
.of(context)
.requestID,
bold: false,
fontSize: 13,
),
SizedBox(
height: 4,
),
Texts(
widget.model.cmcAllOrderDetail[0].iD.toString(),
fontSize: 22,
),
],
),
),
// borderRadius: BorderRadius.circular(12),
color: Colors.white),
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Texts(
"Status",
bold: false,
fontSize: 13,
),
SizedBox(
height: 4,
),
Texts(
"Pending",
fontSize: 22,
Container(
width: double.infinity,
padding: EdgeInsets.only(
left: 15, bottom: 15, top: 15,right: 15),
decoration: BoxDecoration(
border: Border(
bottom: BorderSide(
color: Colors.grey,
width: 1.0,
),
),
// borderRadius: BorderRadius.circular(12),
color: Colors.white),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Texts(
TranslationBase
.of(context)
.OrderStatus,
bold: false,
fontSize: 13,
),
SizedBox(
height: 4,
),
Texts(
projectViewModel.isArabic ? widget.model.cmcAllOrderDetail[0]
.descriptionN : widget.model.cmcAllOrderDetail[0].description,
fontSize: 22,
),
],
),
),
],
),
),
Container(
width: double.infinity,
padding: EdgeInsets.only(
left: 15, bottom: 15, top: 15),
decoration: BoxDecoration(
border: Border(
bottom: BorderSide(
color: Colors.grey,
width: 1.0,
Container(
width: double.infinity,
padding: EdgeInsets.only(
left: 15, bottom: 15, top: 15,right: 15),
decoration: BoxDecoration(
border: Border(
bottom: BorderSide(
color: Colors.grey,
width: 1.0,
),
),
// borderRadius: BorderRadius.circular(12),
color: Colors.white),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Texts(
TranslationBase.of(context).pickupDate,
bold: false,
fontSize: 13,
),
SizedBox(
height: 4,
),
Texts(
DateUtil.getDayMonthYearDateFormatted(
DateUtil.convertStringToDate(widget.model.cmcAllOrderDetail[0].createdOn)),
fontSize: 22,
),
],
),
),
// borderRadius: BorderRadius.circular(12),
color: Colors.white),
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Texts(
"Pickup Date",
bold: false,
fontSize: 13,
Container(
width: double.infinity,
padding: EdgeInsets.only(
left: 15, bottom: 15, top: 15),
decoration: BoxDecoration(
border: Border(
bottom: BorderSide(
color: Colors.grey,
width: 1.0,
),
),
// borderRadius: BorderRadius.circular(12),
color: Colors.white),
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Texts(
TranslationBase.of(context).serviceName,
bold: false,
fontSize: 13,
),
SizedBox(
height: 4,
),
Texts(
!projectViewModel.isArabic?widget.model.cmcAllOrderDetail[0].description
.toString() :
widget.model.cmcAllOrderDetail[0]
.descriptionN
.toString(),
fontSize: 22,
),
],
),
),
SizedBox(
height: 4,
),
Texts(
DateUtil.getDayMonthYearDateFormatted(
DateUtil.convertStringToDate(
widget.model.cmcAllOrderDetail[0]
.createdOn)),
fontSize: 22,
height: 12,
),
],
),
),
Container(
width: double.infinity,
padding: EdgeInsets.only(
left: 15, bottom: 15, top: 15),
decoration: BoxDecoration(
border: Border(
bottom: BorderSide(
color: Colors.grey,
width: 1.0,
Center(
child: Container(
width: MediaQuery
.of(context)
.size
.width *
0.85,
child: SecondaryButton(
label: TranslationBase.of(context).cancel.toUpperCase(),
onTap: () {
showConfirmMessage(widget.model,
widget.model.cmcAllOrderDetail[0]);
}
,
color: Colors.red[800],
disabled: false,
textColor: Theme
.of(context)
.backgroundColor),
),
),
// borderRadius: BorderRadius.circular(12),
color: Colors.white),
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Texts(
"Service Name",
bold: false,
fontSize: 13,
),
SizedBox(
height: 4,
),
Texts(
widget.model.cmcAllOrderDetail[0].description
.toString() ??
widget.model.cmcAllOrderDetail[0]
.descriptionN
.toString(),
fontSize: 22,
height: 22,
),
],
),
),
SizedBox(
height: 12,
),
Center(
child: Container(
width: MediaQuery
.of(context)
.size
.width *
0.85,
child: SecondaryButton(
label: "Cancel".toUpperCase(),
onTap: () {
showConfirmMessage(widget.model,
widget.model.cmcAllOrderDetail[0]);
}
,
color: Colors.red[800],
disabled: false,
textColor: Theme
.of(context)
.backgroundColor),
),
),
SizedBox(
height: 12,
height: 22,
),
],
),

@ -1,11 +1,16 @@
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_get_items_request_model.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_insert_pres_order_request_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/cmc_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
class NewCMCStepOnePage extends StatefulWidget {
final CMCInsertPresOrderRequestModel cMCInsertPresOrderRequestModel;
@ -31,6 +36,8 @@ class _NewCMCStepOnePageState extends State<NewCMCStepOnePage> {
@override
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
return AppScaffold(
isShowAppBar: false,
baseViewModel: widget.model,
@ -50,17 +57,17 @@ class _NewCMCStepOnePageState extends State<NewCMCStepOnePage> {
height: 20,
),
Texts(
"Select Home Health Care Services",
TranslationBase.of(context).selectService,
textAlign: TextAlign.center,
),
Column(
children:
widget.model.cmcAllServicesList.map((service) {
widget.model.cmcAllServicesList.map((service) {
return Container(
margin: EdgeInsets.only(top: 15),
decoration: BoxDecoration(
border:
Border.all(color: Colors.grey, width: 1),
Border.all(color: Colors.grey, width: 1),
borderRadius: BorderRadius.circular(12),
color: Colors.white),
child: Column(
@ -72,50 +79,53 @@ class _NewCMCStepOnePageState extends State<NewCMCStepOnePage> {
activeColor: Colors.red[800],
onChanged: (newValue) async {
PatientERCMCInsertServicesList
patientERCMCInsertServicesList =
new PatientERCMCInsertServicesList(
price: service.price,
serviceID: service.serviceID
.toString(),
selectedServiceName:
service.description,
selectedServiceNameAR:
service.description,
recordID: 1,
totalPrice:
service.totalPrice,
vAT: service.vAT);
patientERCMCInsertServicesList =
new PatientERCMCInsertServicesList(
price: service.price,
serviceID: service.serviceID
.toString(),
selectedServiceName:
service.description,
selectedServiceNameAR:
service.descriptionN,
recordID: 1,
totalPrice:
service.totalPrice,
vAT: service.vAT);
setState(() {
widget
.cMCInsertPresOrderRequestModel
.patientERCMCInsertServicesList = [
.patientERCMCInsertServicesList =
[
patientERCMCInsertServicesList
];
});
CMCGetItemsRequestModel
cMCGetItemsRequestModel =
new CMCGetItemsRequestModel(
checkupType: newValue);
cMCGetItemsRequestModel =
new CMCGetItemsRequestModel(
checkupType: newValue);
await widget.model.getCheckupItems(
cMCGetItemsRequestModel:
cMCGetItemsRequestModel);
cMCGetItemsRequestModel);
},
groupValue: widget
.cMCInsertPresOrderRequestModel
.patientERCMCInsertServicesList
.length >
0
.cMCInsertPresOrderRequestModel
.patientERCMCInsertServicesList
.length >
0
? int.parse(widget
.cMCInsertPresOrderRequestModel
.patientERCMCInsertServicesList[
0]
.serviceID)
.cMCInsertPresOrderRequestModel
.patientERCMCInsertServicesList[
0]
.serviceID)
: 1),
Expanded(
child: Padding(
padding: const EdgeInsets.all(20.0),
child: Texts(
service.description,
projectViewModel.isArabic ? service
.descriptionN : service
.description,
fontSize: 15,
),
),
@ -137,52 +147,67 @@ class _NewCMCStepOnePageState extends State<NewCMCStepOnePage> {
color: Colors.white,
width: double.infinity,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: widget.model.checkupItems.map((item) {
return Center(
child: FractionallySizedBox(
widthFactor: 1,
child: Container(
margin: EdgeInsets.only(top: 15),
decoration: BoxDecoration(color: Colors.white),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(
height: 12,
),
Container(
width: double.infinity,
padding: EdgeInsets.only(
left: 15, bottom: 5, top: 5),
decoration: BoxDecoration(
border: BorderDirectional(
bottom: BorderSide(
style: BorderStyle.solid,
width: 0.5,
color: Colors.grey)),
//borderRadius: ,
color: Colors.white),
child: Column(
crossAxisAlignment:
children: [
Row(
children: [
Container(margin: EdgeInsets.only(
right: 10, left: 10), child: Texts(TranslationBase.of(context).coveredService, fontWeight: FontWeight.bold,))
],
),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: widget.model.checkupItems.map((item) {
return Center(
child: FractionallySizedBox(
widthFactor: 1,
child: Container(
margin: EdgeInsets.only(top: 15),
decoration: BoxDecoration(
color: Colors.white),
child: Column(
crossAxisAlignment: CrossAxisAlignment
.start,
children: [
SizedBox(
height: 12,
),
Container(
width: double.infinity,
padding: EdgeInsets.only(
left: 15, bottom: 5, top: 5),
decoration: BoxDecoration(
border: BorderDirectional(
bottom: BorderSide(
style: BorderStyle.solid,
width: 0.5,
color: Colors.grey)),
//borderRadius: ,
color: Colors.white),
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Texts(
item.itemName,
fontSize: 15,
children: [
Container(margin: EdgeInsets.only(
right: 10, left: 10),
child: Texts(
item.itemName,
fontSize: 15, fontWeight: FontWeight.bold
),
),
],
),
],
),
),
SizedBox(
height: 12,
),
SizedBox(
height: 12,
),
],
),
],
),
),
),
),
);
}).toList()),
);
}).toList()),
],
),
)
],
),
@ -197,28 +222,48 @@ class _NewCMCStepOnePageState extends State<NewCMCStepOnePage> {
Container(
width: MediaQuery.of(context).size.width * 0.9,
child: SecondaryButton(
label: "Next",
textColor: Theme.of(context).backgroundColor,
onTap: () {
if (widget.cMCInsertPresOrderRequestModel.patientERCMCInsertServicesList.length = null) {
label: TranslationBase
.of(context)
.next,
textColor: Theme
.of(context)
.backgroundColor,
color: Colors.grey[800],
onTap: () async {
if (widget.cMCInsertPresOrderRequestModel
.patientERCMCInsertServicesList.length !=
0 ||
widget.cMCInsertPresOrderRequestModel
.patientERCMCInsertServicesList ==
null) {
int index = widget.model.cmcAllServicesList.length;
PatientERCMCInsertServicesList
patientERCMCInsertServicesList =
new PatientERCMCInsertServicesList(
price: widget.model.cmcAllServicesList[index-1].price,
serviceID: widget.model.cmcAllServicesList[index-1].serviceID.toString(),
selectedServiceName: widget.model.cmcAllServicesList[index-1].description,
selectedServiceNameAR: widget.model.cmcAllServicesList[index-1].description,
recordID: 1,
totalPrice: widget.model.cmcAllServicesList[index-1].totalPrice,
vAT: widget.model.cmcAllServicesList[index-1].vAT);
patientERCMCInsertServicesList =
new PatientERCMCInsertServicesList(
price: widget
.model.cmcAllServicesList[index - 1].price,
serviceID: widget
.model.cmcAllServicesList[index - 1].serviceID
.toString(),
selectedServiceName: widget.model
.cmcAllServicesList[index - 1].description,
selectedServiceNameAR: widget.model
.cmcAllServicesList[index - 1].descriptionN,
recordID: 1,
totalPrice: widget
.model.cmcAllServicesList[index - 1].totalPrice,
vAT: widget.model.cmcAllServicesList[index - 1].vAT);
widget.cMCInsertPresOrderRequestModel
.patientERCMCInsertServicesList = [
patientERCMCInsertServicesList
];
widget.changePageViewIndex(1);
await widget.model.getCustomerInfo();
if (widget.model.state == ViewState.ErrorLocal) {
Utils.showErrorToast();
} else {
widget.changePageViewIndex(1);
}
}
},
),

@ -2,15 +2,16 @@ import 'dart:async';
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_insert_pres_order_request_model.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/patient_er_insert_pres_order_request_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/cmc_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/home_health_care_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:google_maps_flutter/google_maps_flutter.dart';
import 'package:provider/provider.dart';
class NewCMCStepThreePage extends StatefulWidget {
final CMCInsertPresOrderRequestModel cmcInsertPresOrderRequestModel;
@ -63,19 +64,23 @@ class _NewCMCStepThreePageState
@override
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
return AppScaffold(
isShowDecPage: false,
baseViewModel: widget.model,
body: SingleChildScrollView(
physics: BouncingScrollPhysics(),
child: Container(
height: 400,
height: 500,
width: double.maxFinite,
margin: EdgeInsets.only(left: 12, right: 12),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Texts('Order Details'),
Texts(
TranslationBase.of(context).orderDetails,
fontWeight: FontWeight.bold,
),
SizedBox(
height: 12,
),
@ -87,7 +92,9 @@ class _NewCMCStepThreePageState
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Texts('Location :'),
Texts(TranslationBase
.of(context)
.orderLocation + " : ", fontWeight: FontWeight.bold,),
SizedBox(
height: 12,
),
@ -108,30 +115,40 @@ class _NewCMCStepThreePageState
SizedBox(
height: 12,
),
Texts('Selected Service :'),
Texts(TranslationBase
.of(context)
.selectedService),
...List.generate(
widget.cmcInsertPresOrderRequestModel.patientERCMCInsertServicesList.length,
(index) => Container(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Texts(
'Service Name :',
fontSize: 12,
),
SizedBox(
height: 5,
),
Texts(
widget
.cmcInsertPresOrderRequestModel.patientERCMCInsertServicesList[index]
.selectedServiceName,
fontSize: 15,
bold: true,
widget.cmcInsertPresOrderRequestModel
.patientERCMCInsertServicesList.length,
(index) =>
Container(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Texts(
TranslationBase
.of(context)
.serviceName,
fontSize: 12, fontWeight: FontWeight.bold,
),
SizedBox(
height: 5,
),
Texts(
projectViewModel.isArabic ? widget
.cmcInsertPresOrderRequestModel
.patientERCMCInsertServicesList[index]
.selectedServiceNameAR : widget
.cmcInsertPresOrderRequestModel
.patientERCMCInsertServicesList[index]
.selectedServiceName,
fontSize: 15,
bold: true,
),
],
),
],
),
),
),
)
],
),
@ -148,14 +165,20 @@ class _NewCMCStepThreePageState
Container(
width: MediaQuery.of(context).size.width * 0.9,
child: SecondaryButton(
label: "Confirm",
label: TranslationBase
.of(context)
.confirm,
color: Colors.grey[800],
onTap: () async {
await widget.model.insertPresPresOrder(order: widget.cmcInsertPresOrderRequestModel);
await widget.model.insertPresPresOrder(
order: widget.cmcInsertPresOrderRequestModel);
if (widget.model.state != ViewState.ErrorLocal) {
widget.changePageViewIndex(0);
}
},
textColor: Theme.of(context).backgroundColor),
textColor: Theme
.of(context)
.backgroundColor),
),
],
),

@ -1,19 +1,22 @@
import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_insert_pres_order_request_model.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/patient_er_insert_pres_order_request_model.dart';
import 'package:diplomaticquarterapp/core/service/AlHabibMedicalService/customer_addresses_service.dart';
import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/cmc_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/home_health_care_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/select_location_dialog.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/location_page.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/others/close_back.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:google_maps_place_picker/google_maps_place_picker.dart';
import 'package:google_maps_flutter/google_maps_flutter.dart';
import 'package:google_maps_place_picker/google_maps_place_picker.dart';
import 'package:provider/provider.dart';
import 'cmc_location_page.dart';
class NewCMCStepTowPage extends StatefulWidget {
final Function(PickResult) onPick;
final double latitude;
@ -41,12 +44,13 @@ class _NewCMCStepTowPageState
extends State<NewCMCStepTowPage> {
double latitude = 0;
double longitude = 0;
AddressInfo _selectedAddress;
@override
void initState() {
if (widget.cmcInsertPresOrderRequestModel.latitude == null) {
latitude = widget.latitude;
longitude = widget.longitude;
setLatitudeAndLongitude();
} else {
latitude = widget.cmcInsertPresOrderRequestModel.latitude;
longitude = widget.cmcInsertPresOrderRequestModel.longitude;
@ -54,60 +58,152 @@ class _NewCMCStepTowPageState
super.initState();
}
setLatitudeAndLongitude({bool isSetState = false, String latLong}) {
if (latLong == null)
latLong = widget.model.addressesList[widget.model.addressesList
.length - 1].latLong;
List latLongArr = latLong.split(',');
latitude = double.parse(latLongArr[0]);
longitude = double.parse(latLongArr[1]);
}
@override
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
return AppScaffold(
return AppScaffold(
isShowDecPage: false,
body: PlacePicker(
apiKey: GOOGLE_API_KEY,
enableMyLocationButton: true,
automaticallyImplyAppBarLeading: false,
autocompleteOnTrailingWhitespace: true,
selectInitialPosition: true,
autocompleteLanguage: projectViewModel.currentLanguage,
enableMapTypeButton: true,
onPlacePicked: (PickResult result) {
print(result.adrAddress);
widget.changePageViewIndex(3);
},
selectedPlaceWidgetBuilder:
(_, selectedPlace, state, isSearchBarFocused) {
print("state: $state, isSearchBarFocused: $isSearchBarFocused");
return isSearchBarFocused
? Container()
: FloatingCard(
bottomPosition: 0.0,
leftPosition: 0.0,
rightPosition: 0.0,
width: 500,
borderRadius: BorderRadius.circular(12.0),
child: state == SearchingState.Searching
? Center(child: CircularProgressIndicator())
: Container(
margin: EdgeInsets.all(12),
child: SecondaryButton(
color: Colors.grey[800],
textColor: Colors.white,
onTap: () {
setState(() {
widget.cmcInsertPresOrderRequestModel
.latitude =
selectedPlace.geometry.location.lat;
widget.cmcInsertPresOrderRequestModel
.longitude =
selectedPlace.geometry.location.lng;
});
widget.changePageViewIndex(3);
},
label: TranslationBase.of(context).next,
),
body: Stack(
children: [
PlacePicker(
apiKey: GOOGLE_API_KEY,
enableMyLocationButton: true,
automaticallyImplyAppBarLeading: false,
autocompleteOnTrailingWhitespace: true,
selectInitialPosition: true,
autocompleteLanguage: projectViewModel.currentLanguage,
enableMapTypeButton: true,
searchForInitialValue: false,
onPlacePicked: (PickResult result) {
print(result.adrAddress);
widget.changePageViewIndex(3);
},
selectedPlaceWidgetBuilder:
(_, selectedPlace, state, isSearchBarFocused) {
print("state: $state, isSearchBarFocused: $isSearchBarFocused");
return isSearchBarFocused
? Container()
: FloatingCard(
bottomPosition: 0.0,
leftPosition: 0.0,
rightPosition: 0.0,
width: 500,
borderRadius: BorderRadius.circular(12.0),
child: state == SearchingState.Searching
? Center(child: CircularProgressIndicator())
: Container(
margin: EdgeInsets.all(12),
child: Column(
children: [
SecondaryButton(
color: Colors.grey[800],
textColor: Colors.white,
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (BuildContext context) =>
CMCLocationPage(
latitude: latitude,
longitude: longitude,
),
),
);
},
label: TranslationBase.of(context).addNewAddress,
),
SizedBox(height: 10,),
SecondaryButton(
color: Colors.red
[800],
textColor: Colors.white,
onTap: () {
setState(() {
widget.cmcInsertPresOrderRequestModel
.latitude =
selectedPlace.geometry.location.lat;
widget.cmcInsertPresOrderRequestModel
.longitude =
selectedPlace.geometry.location.lng;
});
widget.changePageViewIndex(3);
},
label: TranslationBase.of(context).confirm,
),
);
],
)
),
);
},
initialPosition: LatLng(latitude, longitude),
useCurrentLocation: false,
),
Container(
child: InkWell(
onTap: () =>
confirmSelectLocationDialog(widget.model.addressesList),
child: Container(
padding: EdgeInsets.all(10),
width: double.infinity,
// height: 65,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(10),
color: Colors.white),
child: Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [
Expanded(child: Texts(getAddressName(), fontSize: 14,),),
Icon(Icons.arrow_drop_down)
],
),
),
),
height: 56, width: double.infinity, color: Theme
.of(context)
.scaffoldBackgroundColor,
)
],
),
);
}
void confirmSelectLocationDialog(List<AddressInfo> addresses) {
showDialog(
context: context,
child: SelectLocationDialog(
addresses: addresses,
selectedAddress: _selectedAddress
,
onValueSelected: (value) {
setLatitudeAndLongitude(latLong: value.latLong);
setState(() {
_selectedAddress = value;
});
},
initialPosition: LatLng(latitude, longitude),
useCurrentLocation: true,
),
);
}
String getAddressName() {
if (_selectedAddress != null)
return _selectedAddress.address1;
else
return TranslationBase.of(context).selectAddress;
}
}

@ -1,68 +0,0 @@
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart';
import 'cmc_page.dart';
class CMCIndexPage extends StatelessWidget {
@override
Widget build(BuildContext context) {
return AppScaffold(
isShowAppBar: true,
appBarTitle: TranslationBase.of(context).serviceInformation,
body: SingleChildScrollView(
padding: EdgeInsets.all(12),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Texts(
"CMC",
fontWeight: FontWeight.normal,
fontSize: 25,
color: Color(0xff60686b),
),
SizedBox(
height: 12,
),
Texts(
"This service is designed to help you to set drinking water goals and track the volume of water you are drinking on a daily basis. This service allows for schedule reminders and offers a basic statistical analysis of the amount of what you have consumed over the course of a day, week or month.",
fontWeight: FontWeight.normal,
fontSize: 17,
),
SizedBox(
height: 22,
),
Center(
child: Image.asset(
'assets/images/AlHabibMedicalService/Wifi-AR.png')),
SizedBox(
height: 77,
),
],
)),
bottomSheet: Container(
height: MediaQuery.of(context).size.height * 0.10,
width: double.infinity,
child: Column(
children: <Widget>[
Container(
width: MediaQuery.of(context).size.width * 0.9,
child: SecondaryButton(
onTap: () => Navigator.push(
context,
FadePage(
page: CMCPage(),
),
),
label: "CMC",
textColor: Theme.of(context).backgroundColor),
),
],
),
));
}
}

@ -1,5 +1,6 @@
import 'dart:ui';
import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart';
import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/cmc_view_model.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
@ -35,12 +36,15 @@ class _CMCPageState extends State<CMCPage>
@override
Widget build(BuildContext context) {
return BaseView<CMCViewModel>(
onModelReady: (model){
model.getCmcAllPresOrders();
onModelReady: (model) async{
await model.getCmcAllPresOrders();
},
builder: (_, model, widget) => AppScaffold(
isShowAppBar: true,
appBarTitle: TranslationBase.of(context).homeHealthCare,
description:TranslationBase.of(context).infoCMC,
imagesInfo: [ImagesInfo(imageAr: 'assets/images/AlHabibMedicalService/Wifi-AR.png',imageEn: 'assets/images/AlHabibMedicalService/Wifi-EN.png', isAsset: true)],
appBarTitle: TranslationBase.of(context).comprehensiveMedicalCheckup,
body: Scaffold(
extendBodyBehindAppBar: true,
appBar: PreferredSize(
@ -78,7 +82,7 @@ class _CMCPageState extends State<CMCPage>
isScrollable: true,
controller: _tabController,
indicatorWeight: 5.0,
indicatorSize: TabBarIndicatorSize.label,
indicatorSize: TabBarIndicatorSize.tab,
indicatorColor: Colors.red[800],
labelColor: Theme.of(context).primaryColor,
labelPadding:
@ -88,7 +92,8 @@ class _CMCPageState extends State<CMCPage>
Container(
width: MediaQuery.of(context).size.width * 0.37,
child: Center(
child: Texts("CMC Service"),
child: Texts(TranslationBase.of(context)
.comprehensiveMedicalCheckup),
),
),
Container(

@ -2,13 +2,16 @@ import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/get_hhc_all_pres_orders_response_model.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/update_pres_oreder_request_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/cmc_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'Dialog/confirm_cancel_order_dialog.dart';
@ -19,6 +22,9 @@ class OrdersLogDetailsPage extends StatelessWidget {
@override
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
void showConfirmMessage(
CMCViewModel model, GetHHCAllPresOrdersResponseModel order) {
showDialog(
@ -35,7 +41,7 @@ class OrdersLogDetailsPage extends StatelessWidget {
if(model.state == ViewState.ErrorLocal) {
Utils.showErrorToast(model.error);
} else {
AppToast.showSuccessToast(message: "Done Successfully");
AppToast.showSuccessToast(message:TranslationBase.of(context).processDoneSuccessfully );
await model.getCmcAllPresOrders();
}
},
@ -78,7 +84,7 @@ class OrdersLogDetailsPage extends StatelessWidget {
Container(
width: double.infinity,
padding: EdgeInsets.only(
left: 15, bottom: 15, top: 15),
left: 15, bottom: 15, top: 15,right: 15),
decoration: BoxDecoration(
border: Border(
bottom: BorderSide(
@ -89,11 +95,12 @@ class OrdersLogDetailsPage extends StatelessWidget {
// borderRadius: BorderRadius.circular(12),
color: Colors.white),
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Texts(
"Request ID",
TranslationBase
.of(context)
.requestID,
bold: false,
fontSize: 13,
),
@ -110,7 +117,7 @@ class OrdersLogDetailsPage extends StatelessWidget {
Container(
width: double.infinity,
padding: EdgeInsets.only(
left: 15, bottom: 15, top: 15),
left: 15, bottom: 15, top: 15,right: 15),
decoration: BoxDecoration(
border: Border(
bottom: BorderSide(
@ -121,11 +128,12 @@ class OrdersLogDetailsPage extends StatelessWidget {
// borderRadius: BorderRadius.circular(12),
color: Colors.white),
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Texts(
"Status",
TranslationBase
.of(context)
.OrderStatus,
bold: false,
fontSize: 13,
),
@ -133,7 +141,9 @@ class OrdersLogDetailsPage extends StatelessWidget {
height: 4,
),
Texts(
order.description,
projectViewModel.isArabic ? order
.descriptionN : order.description,
fontSize: 22,
),
],
@ -142,7 +152,7 @@ class OrdersLogDetailsPage extends StatelessWidget {
Container(
width: double.infinity,
padding: EdgeInsets.only(
left: 15, bottom: 15, top: 15),
left: 15, bottom: 15, top: 15,right: 15),
decoration: BoxDecoration(
border: Border(
bottom: BorderSide(
@ -153,11 +163,10 @@ class OrdersLogDetailsPage extends StatelessWidget {
// borderRadius: BorderRadius.circular(12),
color: Colors.white),
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Texts(
"Pickup Date",
TranslationBase.of(context).pickupDate,
bold: false,
fontSize: 13,
),
@ -166,8 +175,7 @@ class OrdersLogDetailsPage extends StatelessWidget {
),
Texts(
DateUtil.getDayMonthYearDateFormatted(
DateUtil.convertStringToDate(
order.createdOn)),
DateUtil.convertStringToDate(order.createdOn)),
fontSize: 22,
),
],
@ -176,7 +184,7 @@ class OrdersLogDetailsPage extends StatelessWidget {
Container(
width: double.infinity,
padding: EdgeInsets.only(
left: 15, bottom: 15, top: 15),
left: 15, bottom: 15, top: 15,right: 15),
decoration: BoxDecoration(
border: Border(
bottom: BorderSide(
@ -191,7 +199,7 @@ class OrdersLogDetailsPage extends StatelessWidget {
CrossAxisAlignment.start,
children: [
Texts(
"Location",
TranslationBase.of(context).orderLocation,
bold: false,
fontSize: 13,
),
@ -199,10 +207,11 @@ class OrdersLogDetailsPage extends StatelessWidget {
height: 4,
),
Texts(
order.nearestProjectDescription
.toString() ??
order.nearestProjectDescriptionN
.toString(),
!projectViewModel.isArabic?order.
projectDescription.toString() :
order
.projectDescriptionN
.toString(),
fontSize: 22,
),
],
@ -212,32 +221,33 @@ class OrdersLogDetailsPage extends StatelessWidget {
height: 12,
),
if (order.status == 1 ||order.status == 2 )
Center(
child: Container(
width: MediaQuery
.of(context)
.size
.width *
0.85,
child: SecondaryButton(
label: "Cancel".toUpperCase(),
onTap: () {
showConfirmMessage(model, order);
}
,
color: Colors.red[800],
disabled: false,
textColor: Theme
.of(context)
.backgroundColor),
),
Center(
child: Container(
width: MediaQuery
.of(context)
.size
.width *
0.85,
child: SecondaryButton(
label: TranslationBase.of(context).cancel.toUpperCase(),
onTap: () {
showConfirmMessage(model,
order);
}
,
color: Colors.red[800],
disabled: false,
textColor: Theme
.of(context)
.backgroundColor),
),
),
SizedBox(
height: 12,
),
],
),
);
height: 22,
),
],
),
);
}).toList())
],
),

@ -78,7 +78,7 @@ class _EReferralPageState extends State<EReferralPage>
isScrollable: true,
controller: _tabController,
indicatorWeight: 5.0,
indicatorSize: TabBarIndicatorSize.label,
indicatorSize: TabBarIndicatorSize.tab,
indicatorColor: Colors.red[800],
labelColor: Theme.of(context).primaryColor,
labelPadding:

@ -29,7 +29,7 @@ class _ConfirmCancelOrderDialogState extends State<ConfirmCancelOrderDialog> {
contentPadding: EdgeInsets.fromLTRB(28.0, 24.0, 28.0, 0.0),
title: Center(
child: Texts(
"Confirm",
TranslationBase.of(context).confirm,
color: Colors.black,
),
),
@ -39,7 +39,7 @@ class _ConfirmCancelOrderDialogState extends State<ConfirmCancelOrderDialog> {
Divider(),
Center(
child: Texts(
"Are you sure!! want to cancel this order",
TranslationBase.of(context).cancelOrderMsg ,
color: Colors.grey,
),
),

@ -0,0 +1,146 @@
import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/add_new_address_Request_Model.dart';
import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/home_health_care_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:google_maps_flutter/google_maps_flutter.dart';
import 'package:google_maps_place_picker/google_maps_place_picker.dart';
import 'package:provider/provider.dart';
class LocationPage extends StatefulWidget {
final Function(PickResult) onPick;
final double latitude;
final double longitude;
final dynamic model;
const LocationPage({Key key, this.onPick, this.latitude, this.longitude, this.model})
: super(key: key);
@override
_LocationPageState createState() =>
_LocationPageState();
}
class _LocationPageState
extends State<LocationPage> {
double latitude = 0;
double longitude = 0;
@override
void initState() {
latitude = widget.latitude;
longitude = widget.longitude;
super.initState();
}
@override
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
return BaseView<HomeHealthCareViewModel>(
onModelReady: (model) {},
builder: (_, model, widget) => AppScaffold(
isShowDecPage: false,
isShowAppBar: true,
baseViewModel: model,
body: PlacePicker(
apiKey: GOOGLE_API_KEY,
enableMyLocationButton: true,
automaticallyImplyAppBarLeading: false,
autocompleteOnTrailingWhitespace: true,
selectInitialPosition: true,
autocompleteLanguage: projectViewModel.currentLanguage,
enableMapTypeButton: true,
searchForInitialValue: false,
onPlacePicked: (PickResult result) {
print(result.adrAddress);
},
selectedPlaceWidgetBuilder:
(_, selectedPlace, state, isSearchBarFocused) {
print("state: $state, isSearchBarFocused: $isSearchBarFocused");
return isSearchBarFocused
? Container()
: FloatingCard(
bottomPosition: 0.0,
leftPosition: 0.0,
rightPosition: 0.0,
width: 500,
borderRadius: BorderRadius.circular(12.0),
child: state == SearchingState.Searching
? Center(child: CircularProgressIndicator())
: Container(
margin: EdgeInsets.all(12),
child: Column(
children: [
SecondaryButton(
color: Colors.grey[800],
textColor: Colors.white,
onTap: () async {
AddNewAddressRequestModel
addNewAddressRequestModel =
new AddNewAddressRequestModel(
customer: Customer(addresses: [
Addresses(
address1:
selectedPlace.formattedAddress,
address2: selectedPlace
.formattedAddress,
customerAttributes: "",
city: "",
createdOnUtc: "",
id: 0,
latLong: "$latitude,$longitude",
email: "")
]),
);
selectedPlace.addressComponents.forEach((e) {
if (e.types.contains("country")) {
addNewAddressRequestModel.customer
.addresses[0].country = e.longName;
}
if (e.types.contains("postal_code")) {
addNewAddressRequestModel.customer
.addresses[0].zipPostalCode =
e.longName;
}
if (e.types.contains("locality")) {
addNewAddressRequestModel.customer
.addresses[0].city =
e.longName;
}
});
await model.addAddressInfo(
addNewAddressRequestModel: addNewAddressRequestModel);
if (model.state == ViewState.ErrorLocal) {
Utils.showErrorToast(model.error);
} else {
AppToast.showSuccessToast(
message: "Address Added Successfully");
}
Navigator.of(context).pop();
},
label: TranslationBase.of(context).addNewAddress,
),
],
),
),
);
},
initialPosition: LatLng(latitude, longitude),
useCurrentLocation: false,
),
));
}
}

@ -2,15 +2,16 @@ import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/PatientERHHCInsertServicesList.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/patient_er_insert_pres_order_request_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/home_health_care_view_model.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/pickupLocation/PickupLocationFromMap.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:geolocator/geolocator.dart';
import 'package:google_maps_place_picker/google_maps_place_picker.dart';
import 'package:provider/provider.dart';
class NewHomeHealthCareStepOnePage extends StatefulWidget {
final PatientERInsertPresOrderRequestModel
@ -45,6 +46,8 @@ class _NewHomeHealthCareStepOnePageState extends State<NewHomeHealthCareStepOneP
@override
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
return AppScaffold(
isShowAppBar: false,
baseViewModel: widget.model,
@ -64,7 +67,9 @@ class _NewHomeHealthCareStepOnePageState extends State<NewHomeHealthCareStepOneP
height: 12,
),
Texts(
"Select Home Health Care Services",
TranslationBase
.of(context)
.selectHomeHealthCareServices,
textAlign: TextAlign.center,
),
Column(
@ -90,13 +95,13 @@ class _NewHomeHealthCareStepOnePageState extends State<NewHomeHealthCareStepOneP
.patientERInsertPresOrderRequestModel
.patientERHHCInsertServicesList
.add(PatientERHHCInsertServicesList(
recordID: widget
.patientERInsertPresOrderRequestModel
.patientERHHCInsertServicesList
.length,
serviceID: service.serviceID,
serviceName:
service.description));
recordID: widget
.patientERInsertPresOrderRequestModel
.patientERHHCInsertServicesList
.length,
serviceID: service.serviceID,
serviceName:
service.description));
else
removeSelected(service.serviceID);
// widget.patientERInsertPresOrderRequestModel
@ -107,7 +112,8 @@ class _NewHomeHealthCareStepOnePageState extends State<NewHomeHealthCareStepOneP
child: Padding(
padding: const EdgeInsets.all(20.0),
child: Texts(
service.description,
projectViewModel.isArabic ? service
.descriptionN : service.description,
fontSize: 15,
),
),
@ -133,14 +139,23 @@ class _NewHomeHealthCareStepOnePageState extends State<NewHomeHealthCareStepOneP
Container(
width: MediaQuery.of(context).size.width * 0.9,
child: SecondaryButton(
label: "Next",
label: TranslationBase
.of(context)
.next,
disabled: this
.widget
.patientERInsertPresOrderRequestModel
.patientERHHCInsertServicesList
.length == 0,
onTap: (){
widget.changePageViewIndex(1);
.widget
.patientERInsertPresOrderRequestModel
.patientERHHCInsertServicesList
.length == 0 || widget.model.state == ViewState.BusyLocal,
color: Colors.grey[800],
loading: widget.model.state == ViewState.BusyLocal,
onTap: () async {
await widget.model.getCustomerInfo();
if (widget.model.state == ViewState.ErrorLocal) {
Utils.showErrorToast();
} else {
widget.changePageViewIndex(1);
}
},
textColor: Theme.of(context).backgroundColor),
),

@ -3,12 +3,15 @@ import 'dart:async';
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/patient_er_insert_pres_order_request_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/home_health_care_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:google_maps_flutter/google_maps_flutter.dart';
import 'package:provider/provider.dart';
class NewHomeHealthCareStepThreePage extends StatefulWidget {
final PatientERInsertPresOrderRequestModel
@ -62,6 +65,8 @@ class _NewHomeHealthCareStepThreePageState
@override
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
return AppScaffold(
isShowDecPage: false,
baseViewModel: widget.model,
@ -73,7 +78,7 @@ class _NewHomeHealthCareStepThreePageState
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Texts('Order Details'),
Texts(TranslationBase.of(context).orderDetails, fontWeight: FontWeight.bold,),
SizedBox(
height: 12,
),
@ -85,7 +90,7 @@ class _NewHomeHealthCareStepThreePageState
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Texts('Location :'),
Texts(TranslationBase.of(context).orderLocation, fontWeight: FontWeight.bold),
SizedBox(
height: 12,
),
@ -106,7 +111,7 @@ class _NewHomeHealthCareStepThreePageState
SizedBox(
height: 12,
),
Texts('Selected Service :'),
Texts(TranslationBase.of(context).selectedService + " : ", fontWeight: FontWeight.bold),
...List.generate(
widget.patientERInsertPresOrderRequestModel
.patientERHHCInsertServicesList.length,
@ -115,7 +120,7 @@ class _NewHomeHealthCareStepThreePageState
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Texts(
'Service Name :',
TranslationBase.of(context).serviceName,
fontSize: 12,
),
SizedBox(
@ -151,10 +156,11 @@ class _NewHomeHealthCareStepThreePageState
Container(
width: MediaQuery.of(context).size.width * 0.9,
child: SecondaryButton(
label: "Confirm",
label: TranslationBase.of(context).confirm,
disabled: widget.patientERInsertPresOrderRequestModel
.patientERHHCInsertServicesList.length ==
0,
color: Colors.grey[800],
onTap: () async {
await widget.model.insertPresPresOrder(
order: widget.patientERInsertPresOrderRequestModel);

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

Loading…
Cancel
Save