Merge branch 'development' into pharmacy-Fatima

# Conflicts:
#	lib/pages/pharmacy/order/Order.dart
#	lib/pages/pharmacy/order/OrderDetails.dart
merge-requests/249/head
Fatimah Alshammari 5 years ago
commit 7a516cae51

@ -76,13 +76,21 @@
<receiver android:name="com.dexterous.flutterlocalnotifications.ScheduledNotificationReceiver" /> <receiver android:name="com.dexterous.flutterlocalnotifications.ScheduledNotificationReceiver" />
<!-- Geofencing --> <!-- Geofencing -->
<service android:name=".geofence.GeofenceTransitionsJobIntentService" android:exported="true" android:permission="android.permission.BIND_JOB_SERVICE" /> <service android:name=".geofence.intent_receivers.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.intent_receivers.GeofenceBroadcastReceiver" android:enabled="true" android:exported="true" />
<receiver android:name=".geofence.GeofencingRebootBroadcastReceiver" android:enabled="true"> <receiver android:name=".geofence.intent_receivers.GeofencingRebootBroadcastReceiver" android:enabled="true">
<intent-filter> <intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED"/> <action android:name="android.intent.action.BOOT_COMPLETED"/>
<action android:name="android.intent.action.MY_PACKAGE_REPLACED"/>
</intent-filter> </intent-filter>
</receiver> </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" <meta-data android:name="com.google.android.geo.API_KEY"
android:value="AIzaSyCmevVlr2Bh-c8W1VUzo8gt8JRY7n5PANw"/> android:value="AIzaSyCmevVlr2Bh-c8W1VUzo8gt8JRY7n5PANw"/>

@ -2,8 +2,7 @@ package com.cloud.diplomaticquarterapp
import android.os.Bundle import android.os.Bundle
import android.util.Log import android.util.Log
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import com.cloud.diplomaticquarterapp.utils.FlutterText import com.cloud.diplomaticquarterapp.utils.*
import com.cloud.diplomaticquarterapp.utils.PlatformBridge
import io.flutter.embedding.android.FlutterFragmentActivity import io.flutter.embedding.android.FlutterFragmentActivity
import io.flutter.embedding.engine.FlutterEngine import io.flutter.embedding.engine.FlutterEngine
import io.flutter.plugin.common.MethodChannel import io.flutter.plugin.common.MethodChannel
@ -15,6 +14,16 @@ class MainActivity: FlutterFragmentActivity() {
// Create Flutter Platform Bridge // Create Flutter Platform Bridge
PlatformBridge(flutterEngine.dartExecutor.binaryMessenger, this).create() 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() { override fun onResume() {

@ -37,6 +37,7 @@ class GeoZoneModel {
val rad = Radius.toFloat() val rad = Radius.toFloat()
if(lat != null && long != null){ if(lat != null && long != null){
val loiteringDelayMinutes:Int = 2 // in Minutes
return Geofence.Builder() return Geofence.Builder()
.setRequestId(identifier()) .setRequestId(identifier())
.setCircularRegion( .setCircularRegion(
@ -45,7 +46,8 @@ class GeoZoneModel {
rad rad
) )
.setTransitionTypes(GeofenceTransition.ENTER_EXIT.value) .setTransitionTypes(GeofenceTransition.ENTER_EXIT.value)
// .setNotificationResponsiveness(0) .setNotificationResponsiveness(0)
.setLoiteringDelay(loiteringDelayMinutes * 60 * 1000)
.setExpirationDuration(Geofence.NEVER_EXPIRE) .setExpirationDuration(Geofence.NEVER_EXPIRE)
.build() .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.Intent
import android.content.SharedPreferences import android.content.SharedPreferences
import android.content.pm.PackageManager import android.content.pm.PackageManager
import android.location.Location
import androidx.core.content.ContextCompat 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.Geofence
import com.google.android.gms.location.GeofencingClient import com.google.android.gms.location.GeofencingClient
import com.google.android.gms.location.GeofencingRequest import com.google.android.gms.location.GeofencingRequest
@ -17,8 +21,10 @@ import com.google.gson.reflect.TypeToken
enum class GeofenceTransition(val value: Int) { enum class GeofenceTransition(val value: Int) {
ENTER(1), ENTER(1),
EXIT(2), EXIT(2),
DWELL(4),
ENTER_EXIT((ENTER.value or EXIT.value)), ENTER_EXIT((ENTER.value or EXIT.value)),
DWELL(4); DWELL_EXIT((DWELL.value or EXIT.value));
companion object { companion object {
fun fromInt(value: Int) = GeofenceTransition.values().first { it.value == value } fun fromInt(value: Int) = GeofenceTransition.values().first { it.value == value }
@ -27,17 +33,13 @@ enum class GeofenceTransition(val value: Int) {
fun named():String{ fun named():String{
if (value == 1)return "Enter" if (value == 1)return "Enter"
if (value == 2)return "Exit" if (value == 2)return "Exit"
if (value == (ENTER.value or EXIT.value))return "Enter or Exit"
if (value == 4)return "dWell" 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" 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 { class HMG_Geofence {
// https://developer.android.com/training/location/geofencing#java // 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()) if (geoZones.isEmpty())
return return
val geoZones_ = limitize(geoZones)
fun buildGeofencingRequest(geofences: List<Geofence>): GeofencingRequest { fun buildGeofencingRequest(geofences: List<Geofence>): GeofencingRequest {
return GeofencingRequest.Builder() return GeofencingRequest.Builder()
.setInitialTrigger(0) .setInitialTrigger(GeofencingRequest.INITIAL_TRIGGER_DWELL)
.addGeofences(geofences) .addGeofences(geofences)
.build() .build()
} }
@ -83,9 +125,9 @@ class HMG_Geofence {
getActiveGeofences({ active -> getActiveGeofences({ active ->
val geofences = mutableListOf<Geofence>() val geofences = mutableListOf<Geofence>()
geoZones.forEach { geoZones_.forEach {
it.toGeofence()?.let { geof -> it.toGeofence()?.let { geof ->
if(!active.contains(geof.requestId)){ // if not already registered then register if (!active.contains(geof.requestId)) { // if not already registered then register
geofences.add(geof) geofences.add(geof)
} }
} }
@ -95,31 +137,29 @@ class HMG_Geofence {
geofencingClient geofencingClient
.addGeofences(buildGeofencingRequest(geofences), geofencePendingIntent) .addGeofences(buildGeofencingRequest(geofences), geofencePendingIntent)
.addOnSuccessListener { .addOnSuccessListener {
Logs.RegisterGeofence.save(context,"SUCCESS", "Successfuly registered the geofences", Logs.STATUS.SUCCESS)
saveActiveGeofence(geofences.map { it.requestId }, listOf()) saveActiveGeofence(geofences.map { it.requestId }, listOf())
completion?.let { it(true,null) }
} }
.addOnFailureListener { .addOnFailureListener { exc ->
print(it.localizedMessage) 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){ fun getGeoZonesFromPreference(context: Context):List<GeoZoneModel>{
getActiveGeofences({ success -> val pref = context.getSharedPreferences(PREFS_STORAGE, Context.MODE_PRIVATE)
val mList = success.toMutableList() val json = pref.getString(PREF_KEY_HMG_ZONES, "[]")
mList.add("12345")
geofencingClient val geoZones = GeoZoneModel().listFrom(json!!)
.removeGeofences(success) return geoZones
.addOnSuccessListener {
completion(true, null)
}
.addOnFailureListener {
completion(false, it)
}
removeActiveGeofences()
}, { failed ->
// Nothing to do with failed geofences.
})
} }
fun saveActiveGeofence(success: List<String>, failed: List<String>){ fun saveActiveGeofence(success: List<String>, failed: List<String>){
@ -130,8 +170,8 @@ class HMG_Geofence {
} }
fun removeActiveGeofences(){ fun removeActiveGeofences(){
preferences.edit().putString(PREF_KEY_SUCCESS,"[]").apply() preferences.edit().putString(PREF_KEY_SUCCESS, "[]").apply()
preferences.edit().putString(PREF_KEY_FAILED,"[]").apply() preferences.edit().putString(PREF_KEY_FAILED, "[]").apply()
} }
fun getActiveGeofences(success: (success: List<String>) -> Unit, failure: ((failed: List<String>) -> Unit)?){ fun getActiveGeofences(success: (success: List<String>) -> Unit, failure: ((failed: List<String>) -> Unit)?){
@ -154,12 +194,48 @@ class HMG_Geofence {
} }
fun getPatientID():Int?{ 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 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") ?.get("PatientID")
.toString() .toString()
.toDoubleOrNull() .toDoubleOrNull()
?.toInt() ?.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 android.content.Context
import com.cloud.diplomaticquarterapp.R 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.common.api.ApiException
import com.google.android.gms.location.GeofenceStatusCodes import com.google.android.gms.location.GeofenceStatusCodes
@ -18,7 +19,7 @@ object GeofenceErrorMessages {
fun getErrorString(context: Context, errorCode: Int): String { fun getErrorString(context: Context, errorCode: Int): String {
val resources = context.resources val resources = context.resources
return when (errorCode) { val errorMessage = when (errorCode) {
GeofenceStatusCodes.GEOFENCE_NOT_AVAILABLE -> GeofenceStatusCodes.GEOFENCE_NOT_AVAILABLE ->
resources.getString(R.string.geofence_not_available) resources.getString(R.string.geofence_not_available)
@ -28,7 +29,15 @@ object GeofenceErrorMessages {
GeofenceStatusCodes.GEOFENCE_TOO_MANY_PENDING_INTENTS -> GeofenceStatusCodes.GEOFENCE_TOO_MANY_PENDING_INTENTS ->
resources.getString(R.string.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) 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.Context
import android.content.Intent import android.content.Intent
import android.location.Location
import android.util.Log import android.util.Log
import androidx.core.app.JobIntentService import androidx.core.app.JobIntentService
import com.cloud.diplomaticquarterapp.utils.API import com.cloud.diplomaticquarterapp.geofence.GeofenceTransition
import com.cloud.diplomaticquarterapp.utils.httpPost import com.cloud.diplomaticquarterapp.geofence.HMG_Geofence
import com.cloud.diplomaticquarterapp.utils.sendNotification import com.cloud.diplomaticquarterapp.utils.saveLog
import com.github.kittinunf.fuel.core.extensions.jsonBody import com.google.android.gms.location.GeofenceStatusCodes
import com.github.kittinunf.fuel.core.isSuccessful
import com.github.kittinunf.fuel.httpPost
import com.google.android.gms.location.Geofence
import com.google.android.gms.location.GeofencingEvent import com.google.android.gms.location.GeofencingEvent
import com.google.gson.Gson
class GeofenceTransitionsJobIntentService : JobIntentService() { class GeofenceTransitionsJobIntentService : JobIntentService() {
companion object { companion object {
private const val LOG_TAG = "GeoTrIntentService" 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) { fun enqueueWork(context: Context, intent: Intent) {
context_ = context
enqueueWork( enqueueWork(
context, context,
GeofenceTransitionsJobIntentService::class.java, JOB_ID, GeofenceTransitionsJobIntentService::class.java, JOB_ID,
@ -64,43 +60,31 @@ class GeofenceTransitionsJobIntentService : JobIntentService() {
override fun onHandleWork(intent: Intent) { override fun onHandleWork(intent: Intent) {
val geofencingEvent = GeofencingEvent.fromIntent(intent) val geofencingEvent = GeofencingEvent.fromIntent(intent)
if (geofencingEvent.hasError()) { if (geofencingEvent.hasError()) {
val errorMessage = GeofenceErrorMessages.getErrorString(this, geofencingEvent.errorCode) val errorMessage = GeofenceErrorMessages.getErrorString(context_!!, geofencingEvent.errorCode)
Log.e(LOG_TAG, errorMessage) 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) { saveLog(context_!!,LOG_TAG,errorMessage)
val hmg = HMG_Geofence.shared(this) doReRegisterIfRequired(context_!!, geofencingEvent.errorCode)
hmg.getPatientID()?.let { patientId ->
hmg.getActiveGeofences({ activeGeofences -> return
}
triggerGeofences.forEach { geofence -> HMG_Geofence.shared(context_!!).handleEvent(geofencingEvent.triggeringGeofences,geofencingEvent.triggeringLocation, GeofenceTransition.fromInt(geofencingEvent.geofenceTransition));
// 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 = 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.BroadcastReceiver
import android.content.Context import android.content.Context
import android.content.Intent import android.content.Intent
import android.os.Handler
import android.os.Message
import com.cloud.diplomaticquarterapp.geofence.HMG_Geofence import com.cloud.diplomaticquarterapp.geofence.HMG_Geofence
import com.cloud.diplomaticquarterapp.utils.HMGUtils import com.cloud.diplomaticquarterapp.utils.PREFS_STORAGE
class GeofencingRebootBroadcastReceiver : BroadcastReceiver(){ class GeofencingRebootBroadcastReceiver : BroadcastReceiver(){
override fun onReceive(context: Context, intent: Intent) { override fun onReceive(context: Context, intent: Intent) {
if (Intent.ACTION_BOOT_COMPLETED.equals(intent.action)) { 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) val pref = context.getSharedPreferences(PREFS_STORAGE, Context.MODE_PRIVATE)
pref.edit().putString("REBOOT_DETECTED","YES").apply() pref.edit().putString("REBOOT_DETECTED","YES").apply()
HMG_Geofence.shared(context).unRegisterAll { status, exception -> HMG_Geofence.shared(context).register(){ status, error -> }
val geoZones = HMGUtils.getGeoZonesFromPreference(context)
HMG_Geofence.shared(context).register(geoZones)
}
} }
} }

@ -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 { class API {
companion object{ companion object{
private val BASE = "https://uat.hmgwebservices.com" private val BASE = "https://hmgwebservices.com"
private val SERVICE = "Services/Patients.svc/REST" private val SERVICE = "Services/Patients.svc/REST"
val WIFI_CREDENTIALS = "$BASE/$SERVICE/Hmg_SMS_Get_By_ProjectID_And_PatientID" 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.NotificationChannel
import android.app.NotificationManager import android.app.NotificationManager
import android.app.PendingIntent 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.Context
import android.content.Intent import android.content.Intent
import android.os.Build import android.os.Build
@ -14,17 +17,16 @@ import com.cloud.diplomaticquarterapp.BuildConfig
import com.cloud.diplomaticquarterapp.MainActivity import com.cloud.diplomaticquarterapp.MainActivity
import com.cloud.diplomaticquarterapp.R import com.cloud.diplomaticquarterapp.R
import com.cloud.diplomaticquarterapp.geofence.GeoZoneModel 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.core.extensions.jsonBody
import com.github.kittinunf.fuel.httpPost import com.github.kittinunf.fuel.httpPost
import com.google.android.gms.location.Geofence
import com.google.gson.Gson import com.google.gson.Gson
import com.google.gson.reflect.TypeToken import com.google.gson.reflect.TypeToken
import io.flutter.plugin.common.MethodChannel import io.flutter.plugin.common.MethodChannel
import org.jetbrains.anko.doAsyncResult
import org.json.JSONArray import org.json.JSONArray
import org.json.JSONException import org.json.JSONException
import org.json.JSONObject import org.json.JSONObject
import java.text.SimpleDateFormat
import java.util.* import java.util.*
import kotlin.concurrent.timerTask 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 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) } fun defaultHTTPParams(context: Context) : Map<String, Any?>{
return geoZones!! 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" 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 val notificationManager = context.getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O 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()) 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 { fun isJSONValid(jsonString: String?): Boolean {
try { JSONObject(jsonString) } catch (ex: JSONException) { try { JSONObject(jsonString) } catch (ex: JSONException) {
@ -129,31 +182,43 @@ fun isJSONValid(jsonString: String?): Boolean {
return true 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){ class HTTPResponse<T>(data: T){
final var data:T = data 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 gson = Gson()
val type = object : TypeToken<T>() {}.type val type = object : TypeToken<T>() {}.type
val jsonBody = gson.toJson(body) val jsonBody = gson.toJson(body)
url.httpPost() url.httpPost()
.jsonBody(jsonBody, Charsets.UTF_8) .jsonBody(jsonBody, Charsets.UTF_8)
.timeout(10000) .timeout(10000)
.header("Content-Type","application/json") .header("Content-Type", "application/json")
.header("Allow","*/*") .header("Allow", "*/*")
.response { request, response, result -> .response { request, response, result ->
result.doAsyncResult { }
result.fold({ data -> result.fold({ data ->
val dataString = String(data) val dataString = String(data)
if(isJSONValid(dataString)){ if (isJSONValid(dataString)) {
val responseData = gson.fromJson<T>(dataString,type) val responseData = gson.fromJson<T>(dataString, type)
onSuccess(HTTPResponse(responseData)) onSuccess(HTTPResponse(responseData))
}else{ } else {
onError(Exception("Invalid response from server (Not a valid JSON)")) onError(Exception("Invalid response from server (Not a valid JSON)"))
} }
}, { }, {
onError(it) 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?) { override fun success(result: Any?) {
if(result is String) { if(result is String) {
val geoZones = GeoZoneModel().listFrom(result) 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"> <string name="geofence_too_many_pending_intents">
You have provided too many PendingIntents to the addGeofences() call. You have provided too many PendingIntents to the addGeofences() call.
</string> </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> </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

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

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

@ -20,7 +20,7 @@ PODS:
- Firebase/Messaging (6.33.0): - Firebase/Messaging (6.33.0):
- Firebase/CoreOnly - Firebase/CoreOnly
- FirebaseMessaging (~> 4.7.0) - FirebaseMessaging (~> 4.7.0)
- firebase_core (0.5.3): - firebase_core (0.5.2):
- Firebase/CoreOnly (~> 6.33.0) - Firebase/CoreOnly (~> 6.33.0)
- Flutter - Flutter
- firebase_core_web (0.1.0): - firebase_core_web (0.1.0):
@ -70,7 +70,7 @@ PODS:
- Flutter - Flutter
- flutter_tts (0.0.1): - flutter_tts (0.0.1):
- Flutter - Flutter
- geolocator (6.1.9): - "geolocator (6.0.0+4)":
- Flutter - Flutter
- google_maps_flutter (0.0.1): - google_maps_flutter (0.0.1):
- Flutter - Flutter
@ -162,7 +162,7 @@ PODS:
- "twilio_programmable_video (0.5.0+4)": - "twilio_programmable_video (0.5.0+4)":
- Flutter - Flutter
- TwilioVideo (~> 3.4) - TwilioVideo (~> 3.4)
- TwilioVideo (3.7.2) - TwilioVideo (3.8.0)
- url_launcher (0.0.1): - url_launcher (0.0.1):
- Flutter - Flutter
- url_launcher_linux (0.0.1): - url_launcher_linux (0.0.1):
@ -385,7 +385,7 @@ SPEC CHECKSUMS:
device_calendar: 23b28a5f1ab3bf77e34542fb1167e1b8b29a98f5 device_calendar: 23b28a5f1ab3bf77e34542fb1167e1b8b29a98f5
device_info: d7d233b645a32c40dfdc212de5cf646ca482f175 device_info: d7d233b645a32c40dfdc212de5cf646ca482f175
Firebase: 8db6f2d1b2c5e2984efba4949a145875a8f65fe5 Firebase: 8db6f2d1b2c5e2984efba4949a145875a8f65fe5
firebase_core: 5d6a02f3d85acd5f8321c2d6d62877626a670659 firebase_core: 350ba329d1641211bc6183a3236893cafdacfea7
firebase_core_web: d501d8b946b60c8af265428ce483b0fff5ad52d1 firebase_core_web: d501d8b946b60c8af265428ce483b0fff5ad52d1
firebase_messaging: 0aea2cd5885b65e19ede58ee3507f485c992cc75 firebase_messaging: 0aea2cd5885b65e19ede58ee3507f485c992cc75
FirebaseCore: d889d9e12535b7f36ac8bfbf1713a0836a3012cd FirebaseCore: d889d9e12535b7f36ac8bfbf1713a0836a3012cd
@ -400,7 +400,7 @@ SPEC CHECKSUMS:
flutter_local_notifications: 9e4738ce2471c5af910d961a6b7eadcf57c50186 flutter_local_notifications: 9e4738ce2471c5af910d961a6b7eadcf57c50186
flutter_plugin_android_lifecycle: dc0b544e129eebb77a6bfb1239d4d1c673a60a35 flutter_plugin_android_lifecycle: dc0b544e129eebb77a6bfb1239d4d1c673a60a35
flutter_tts: 0f492aab6accf87059b72354fcb4ba934304771d flutter_tts: 0f492aab6accf87059b72354fcb4ba934304771d
geolocator: 057a0c63a43e9c5296d8ad845a3ac8e6df23d899 geolocator: 1ae40084cc6c1586ce5ad12cfc3fd38c64d05f2f
google_maps_flutter: c7f9c73576de1fbe152a227bfd6e6c4ae8088619 google_maps_flutter: c7f9c73576de1fbe152a227bfd6e6c4ae8088619
GoogleDataTransport: f56af7caa4ed338dc8e138a5d7c5973e66440833 GoogleDataTransport: f56af7caa4ed338dc8e138a5d7c5973e66440833
GoogleMaps: 4b5346bddfe6911bb89155d43c903020170523ac GoogleMaps: 4b5346bddfe6911bb89155d43c903020170523ac
@ -436,7 +436,7 @@ SPEC CHECKSUMS:
TOCropViewController: da59f531f8ac8a94ef6d6c0fc34009350f9e8bfe TOCropViewController: da59f531f8ac8a94ef6d6c0fc34009350f9e8bfe
Try: 5ef669ae832617b3cee58cb2c6f99fb767a4ff96 Try: 5ef669ae832617b3cee58cb2c6f99fb767a4ff96
twilio_programmable_video: 6a41593640f3d86af60b22541fd457b22deaae7f twilio_programmable_video: 6a41593640f3d86af60b22541fd457b22deaae7f
TwilioVideo: 5257640fab00d1b9f44db060815b03516a9eb0e8 TwilioVideo: c13a51ceca375e91620eb7578d2573c90cf53b46
url_launcher: 6fef411d543ceb26efce54b05a0a40bfd74cbbef url_launcher: 6fef411d543ceb26efce54b05a0a40bfd74cbbef
url_launcher_linux: ac237cb7a8058736e4aae38bdbcc748a4b394cc0 url_launcher_linux: ac237cb7a8058736e4aae38bdbcc748a4b394cc0
url_launcher_macos: fd7894421cd39320dce5f292fc99ea9270b2a313 url_launcher_macos: fd7894421cd39320dce5f292fc99ea9270b2a313

@ -28,8 +28,10 @@
E923EFD62587443800E3E751 /* HMGPlatformBridge.swift in Sources */ = {isa = PBXBuildFile; fileRef = E923EFD52587443800E3E751 /* HMGPlatformBridge.swift */; }; E923EFD62587443800E3E751 /* HMGPlatformBridge.swift in Sources */ = {isa = PBXBuildFile; fileRef = E923EFD52587443800E3E751 /* HMGPlatformBridge.swift */; };
E923EFD82588D17700E3E751 /* gpx.gpx in Resources */ = {isa = PBXBuildFile; fileRef = E923EFD72588D17700E3E751 /* gpx.gpx */; }; E923EFD82588D17700E3E751 /* gpx.gpx in Resources */ = {isa = PBXBuildFile; fileRef = E923EFD72588D17700E3E751 /* gpx.gpx */; };
E9620805255C2ED100D3A35D /* NetworkExtension.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E9620804255C2ED100D3A35D /* NetworkExtension.framework */; }; 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 */; }; E9C8C136256BACDA00EFFB62 /* HMG_Guest.swift in Sources */ = {isa = PBXBuildFile; fileRef = E9C8C135256BACDA00EFFB62 /* HMG_Guest.swift */; };
E9E27168256E3A4000F49B69 /* LocalizedFromFlutter.swift in Sources */ = {isa = PBXBuildFile; fileRef = E9E27167256E3A4000F49B69 /* LocalizedFromFlutter.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 */ /* End PBXBuildFile section */
/* Begin PBXCopyFilesBuildPhase section */ /* Begin PBXCopyFilesBuildPhase section */
@ -78,8 +80,10 @@
E923EFD72588D17700E3E751 /* gpx.gpx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = gpx.gpx; sourceTree = "<group>"; }; 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>"; }; 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; }; 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>"; }; 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>"; }; 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 */ /* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */ /* Begin PBXFrameworksBuildPhase section */
@ -128,6 +132,7 @@
97C146E51CF9000F007C117D = { 97C146E51CF9000F007C117D = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
E9A35328258B8E8F00CBA688 /* GoogleService-Info.plist */,
E923EFD72588D17700E3E751 /* gpx.gpx */, E923EFD72588D17700E3E751 /* gpx.gpx */,
9740EEB11CF90186004384FC /* Flutter */, 9740EEB11CF90186004384FC /* Flutter */,
97C146F01CF9000F007C117D /* Runner */, 97C146F01CF9000F007C117D /* Runner */,
@ -177,6 +182,7 @@
E923EFD125863FDF00E3E751 /* GeoZoneModel.swift */, E923EFD125863FDF00E3E751 /* GeoZoneModel.swift */,
E923EFD3258645C100E3E751 /* HMG_Geofence.swift */, E923EFD3258645C100E3E751 /* HMG_Geofence.swift */,
E923EFD52587443800E3E751 /* HMGPlatformBridge.swift */, E923EFD52587443800E3E751 /* HMGPlatformBridge.swift */,
E9F7623A25922BCE00FB5CCF /* FlutterConstants.swift */,
); );
path = Helper; path = Helper;
sourceTree = "<group>"; sourceTree = "<group>";
@ -214,7 +220,7 @@
9705A1C41CF9048500538489 /* Embed Frameworks */, 9705A1C41CF9048500538489 /* Embed Frameworks */,
3B06AD1E1E4923F5004D2608 /* Thin Binary */, 3B06AD1E1E4923F5004D2608 /* Thin Binary */,
125A739F71A29FBAE7B4D5AC /* [CP] Embed Pods Frameworks */, 125A739F71A29FBAE7B4D5AC /* [CP] Embed Pods Frameworks */,
940F4A376A48B060117A1E5D /* [CP] Copy Pods Resources */, CBB18A5CEEEB971DCFC36E00 /* [CP] Copy Pods Resources */,
); );
buildRules = ( buildRules = (
); );
@ -265,6 +271,7 @@
files = ( files = (
E91B53A0256AAC1400E96549 /* GuestPOC_Certificate.cer in Resources */, E91B53A0256AAC1400E96549 /* GuestPOC_Certificate.cer in Resources */,
97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */,
E9A35329258B8E8F00CBA688 /* GoogleService-Info.plist in Resources */,
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */,
E923EFD82588D17700E3E751 /* gpx.gpx in Resources */, E923EFD82588D17700E3E751 /* gpx.gpx in Resources */,
E91B539F256AAC1400E96549 /* GuestPOC_Certificate.p12 in Resources */, E91B539F256AAC1400E96549 /* GuestPOC_Certificate.p12 in Resources */,
@ -330,36 +337,36 @@
shellPath = /bin/sh; shellPath = /bin/sh;
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin"; 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; isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
); );
inputFileListPaths = ( inputPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources-${CONFIGURATION}-input-files.xcfilelist",
); );
name = "[CP] Copy Pods Resources"; name = "Run Script";
outputFileListPaths = ( outputPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources-${CONFIGURATION}-output-files.xcfilelist",
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh; shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources.sh\"\n"; shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build";
showEnvVarsInLog = 0;
}; };
9740EEB61CF901F6004384FC /* Run Script */ = { CBB18A5CEEEB971DCFC36E00 /* [CP] Copy Pods Resources */ = {
isa = PBXShellScriptBuildPhase; isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
); );
inputPaths = ( inputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources-${CONFIGURATION}-input-files.xcfilelist",
); );
name = "Run Script"; name = "[CP] Copy Pods Resources";
outputPaths = ( outputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources-${CONFIGURATION}-output-files.xcfilelist",
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh; 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-resources.sh\"\n";
showEnvVarsInLog = 0;
}; };
/* End PBXShellScriptBuildPhase section */ /* End PBXShellScriptBuildPhase section */
@ -374,6 +381,7 @@
E91B5396256AAA6500E96549 /* GlobalHelper.swift in Sources */, E91B5396256AAA6500E96549 /* GlobalHelper.swift in Sources */,
E923EFD4258645C100E3E751 /* HMG_Geofence.swift in Sources */, E923EFD4258645C100E3E751 /* HMG_Geofence.swift in Sources */,
E923EFD62587443800E3E751 /* HMGPlatformBridge.swift in Sources */, E923EFD62587443800E3E751 /* HMGPlatformBridge.swift in Sources */,
E9F7623B25922BCE00FB5CCF /* FlutterConstants.swift in Sources */,
74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */, 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */,
E9E27168256E3A4000F49B69 /* LocalizedFromFlutter.swift in Sources */, E9E27168256E3A4000F49B69 /* LocalizedFromFlutter.swift in Sources */,
1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */,
@ -472,7 +480,7 @@
CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
DEVELOPMENT_TEAM = ""; DEVELOPMENT_TEAM = 3A359E86ZF;
ENABLE_BITCODE = NO; ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = ( FRAMEWORK_SEARCH_PATHS = (
"$(inherited)", "$(inherited)",
@ -611,7 +619,7 @@
CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
DEVELOPMENT_TEAM = ""; DEVELOPMENT_TEAM = 3A359E86ZF;
ENABLE_BITCODE = NO; ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = ( FRAMEWORK_SEARCH_PATHS = (
"$(inherited)", "$(inherited)",
@ -644,7 +652,7 @@
CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
DEVELOPMENT_TEAM = ""; DEVELOPMENT_TEAM = 3A359E86ZF;
ENABLE_BITCODE = NO; ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = ( FRAMEWORK_SEARCH_PATHS = (
"$(inherited)", "$(inherited)",

@ -2,46 +2,67 @@ import UIKit
import Flutter import Flutter
import GoogleMaps import GoogleMaps
var userNotificationCenterDelegate:UNUserNotificationCenterDelegate? = nil
@UIApplicationMain @UIApplicationMain
@objc class AppDelegate: FlutterAppDelegate { @objc class AppDelegate: FlutterAppDelegate {
let locationManager = CLLocationManager() let locationManager = CLLocationManager()
var flutterViewController:MainFlutterVC!
override func application( _ application: UIApplication,didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { override func application( _ application: UIApplication,didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
// initLocationManager()
GMSServices.provideAPIKey("AIzaSyCiiJiHkocPbcziHt9O8rGWavDrxHRQys8") GMSServices.provideAPIKey("AIzaSyCiiJiHkocPbcziHt9O8rGWavDrxHRQys8")
GeneratedPluginRegistrant.register(with: self) GeneratedPluginRegistrant.register(with: self)
if let mainViewController = window.rootViewController as? MainFlutterVC{ initializePlatformChannel()
HMGPlatformBridge.initialize(flutterViewController: mainViewController)
}
if let _ = launchOptions?[.location] { if let _ = launchOptions?[.location] {
HMG_Geofence.initGeofencing() HMG_Geofence.initGeofencing()
} }
UNUserNotificationCenter.current().delegate = self
return super.application(application, didFinishLaunchingWithOptions: launchOptions) return super.application(application, didFinishLaunchingWithOptions: launchOptions)
} }
}
extension AppDelegate: CLLocationManagerDelegate {
func initLocationManager(){
locationManager.allowsBackgroundLocationUpdates = true func initializePlatformChannel(){
locationManager.desiredAccuracy = kCLLocationAccuracyNearestTenMeters if let mainViewController = window.rootViewController as? MainFlutterVC{ // platform initialization suppose to be in foreground
locationManager.activityType = .other flutterViewController = mainViewController
locationManager.delegate = self HMGPlatformBridge.initialize(flutterViewController: flutterViewController)
locationManager.requestAlwaysAuthorization()
}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) { extension AppDelegate{
if region is CLCircularRegion { 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 { struct API {
static let WIFI_CREDENTIALS = "\(BASE_URL)/Hmg_SMS_Get_By_ProjectID_And_PatientID" 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 { extension Bundle {
func certificate(named name: String) -> SecCertificate { 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 HmgLocalNotificationCategoryIdentifier = "hmg.local.notification"
let notificationContent = UNMutableNotificationContent() func showNotification(identifier:String? = nil, title:String?, subtitle:String?, message:String?, sound:UNNotificationSound = UNNotificationSound.default, categoryIdentifier:String = HmgLocalNotificationCategoryIdentifier){
DispatchQueue.main.async {
if identifier != nil { notificationContent.categoryIdentifier = identifier! } let notificationContent = UNMutableNotificationContent()
if title != nil { notificationContent.title = title! } notificationContent.categoryIdentifier = categoryIdentifier
if subtitle != nil { notificationContent.body = message! }
if message != nil { notificationContent.subtitle = subtitle! } if identifier != nil { notificationContent.categoryIdentifier = identifier! }
if title != nil { notificationContent.title = title! }
notificationContent.sound = UNNotificationSound.default if subtitle != nil { notificationContent.body = message! }
let trigger = UNTimeIntervalNotificationTrigger(timeInterval: 1, repeats: false) if message != nil { notificationContent.subtitle = subtitle! }
let request = UNNotificationRequest(identifier: "\(Date().timeIntervalSinceNow)", content: notificationContent, trigger: trigger)
UNUserNotificationCenter.current().add(request) { error in notificationContent.sound = UNNotificationSound.default
if let error = error { let trigger = UNTimeIntervalNotificationTrigger(timeInterval: 1, repeats: false)
print("Error: \(error)") 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 ?? "{}")
}
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)?){ func httpPostRequest(urlString:String, jsonBody:[String:Any?], completion:((Bool,[String:Any]?)->Void)?){
let json: [String: Any] = jsonBody var json: [String: Any?] = jsonBody
json = json.merge(dict: defaultHTTPParams)
let jsonData = try? JSONSerialization.data(withJSONObject: json) let jsonData = try? JSONSerialization.data(withJSONObject: json)
// create post request // create post request
@ -77,6 +109,8 @@ func httpPostRequest(urlString:String, jsonBody:[String:Any], completion:((Bool,
completion?(false,responseJSON) completion?(false,responseJSON)
} }
}else{
completion?(false,nil)
} }
} }

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

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

File diff suppressed because one or more lines are too long

@ -32,6 +32,9 @@ const WEATHER_INDICATOR = 'Services/Weather.svc/REST/GetCityInfo';
const GET_PRIVILEGE = 'Services/Patients.svc/REST/Service_Privilege'; 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 ///Doctor
const GET_MY_DOCTOR = const GET_MY_DOCTOR =
'Services/Doctors.svc/REST/GetPatientDoctorAppointmentResult'; 'Services/Doctors.svc/REST/GetPatientDoctorAppointmentResult';
@ -225,8 +228,8 @@ const GET_LIVECARE_HISTORY = 'Services/ER_VirtualCall.svc/REST/GetPatientErVirtu
const CANCEL_LIVECARE_REQUEST = 'Services/ER_VirtualCall.svc/REST/DeleteErRequest'; const CANCEL_LIVECARE_REQUEST = 'Services/ER_VirtualCall.svc/REST/DeleteErRequest';
const SEND_LIVECARE_INVOICE_EMAIL = 'Services/Notifications.svc/REST/SendInvoiceForLiveCare'; const SEND_LIVECARE_INVOICE_EMAIL = 'Services/Notifications.svc/REST/SendInvoiceForLiveCare';
const GET_USER_TERMS = '/Services/Patients.svc/REST/GetUserTermsAndConditions'; const GET_USER_TERMS = 'Services/Patients.svc/REST/GetUserTermsAndConditions';
const UPDATE_HEALTH_TERMS = '/services/Patients.svc/REST/UpdatePateintHealthSummaryReport'; const UPDATE_HEALTH_TERMS = 'services/Patients.svc/REST/UpdatePateintHealthSummaryReport';
//URL to get medicine and pharmacies list //URL to get medicine and pharmacies list
const CHANNEL = 3; const CHANNEL = 3;
@ -428,7 +431,6 @@ class AppGlobal {
Request getPublicRequest() { Request getPublicRequest() {
Request request = new Request(); Request request = new Request();
request.VersionID = 5.6; //3.6;
request.Channel = 3; request.Channel = 3;
request.IPAdress = "10.20.10.20"; request.IPAdress = "10.20.10.20";
request.generalid = 'Cs2020@2016\$2958'; request.generalid = 'Cs2020@2016\$2958';

@ -243,6 +243,10 @@ const Map localizedValues = {
"en": "Email Sent Successfully", "en": "Email Sent Successfully",
"ar": "تم إرسال البريد الإلكتروني بنجاح" "ar": "تم إرسال البريد الإلكتروني بنجاح"
}, },
"EmailSentError": {
"en": "Error Sending Email",
"ar": "خطأ في إرسال البريد الإلكتروني"
},
"close": {"en": "Close", "ar": "مغلق"}, "close": {"en": "Close", "ar": "مغلق"},
"booked": {"en": "Booked", "ar": "محجوز"}, "booked": {"en": "Booked", "ar": "محجوز"},
"confirmed": {"en": "Confirmed", "ar": "مؤكد"}, "confirmed": {"en": "Confirmed", "ar": "مؤكد"},
@ -289,7 +293,7 @@ const Map localizedValues = {
}, },
"ksa": {"en": "KSA", "ar": "السعودية"}, "ksa": {"en": "KSA", "ar": "السعودية"},
"dubai": {"en": "Dubai", "ar": "دبي"}, "dubai": {"en": "Dubai", "ar": "دبي"},
"enter-email": {"en": "Enter Email", "ar": "ادخل البريد الالكتروني"}, "enter-email": {"en": "Please Enter Email", "ar": "ادخل البريد الالكتروني"},
"family": {"en": "My Family", "ar": "عائلتي"}, "family": {"en": "My Family", "ar": "عائلتي"},
"family-title": {"en": "My Family Files", "ar": "ملفات العائلة"}, "family-title": {"en": "My Family Files", "ar": "ملفات العائلة"},
"myFamily": {"en": "My Family", "ar": "ملفات العائلة"}, "myFamily": {"en": "My Family", "ar": "ملفات العائلة"},
@ -1067,7 +1071,7 @@ const Map localizedValues = {
"pickup-location": {"en": "Pickup Location", "ar": "نقطة الانطلاق"}, "pickup-location": {"en": "Pickup Location", "ar": "نقطة الانطلاق"},
"pickup-spot": {"en": "Pickup Spot", "ar": "نقطة اللقاء"}, "pickup-spot": {"en": "Pickup Spot", "ar": "نقطة اللقاء"},
"inside-home": {"en": "Inside Home", "ar": "داخل المنزل"}, "inside-home": {"en": "Inside Home", "ar": "داخل المنزل"},
"have-appo": {"en": "Do you have an appointment?", "ar": "هل لديك موعد؟"}, "have-appo": {"en": "Do you have an appointment ?", "ar": "هل لديك موعد ؟"},
"dropoff-location": {"en": "Dropoff Location", "ar": "نقطة الوصول"}, "dropoff-location": {"en": "Dropoff Location", "ar": "نقطة الوصول"},
"select-all": { "select-all": {
"en": "Please select all fields", "en": "Please select all fields",
@ -1220,6 +1224,10 @@ const Map localizedValues = {
"en": "Send a copy of this report to the email", "en": "Send a copy of this report to the email",
"ar": "أرسل نسخة من هذا التقرير إلى البريد الإلكتروني" "ar": "أرسل نسخة من هذا التقرير إلى البريد الإلكتروني"
}, },
"update-email-msg": {
"en": "Email updated",
"ar": "تم تحديث البريد الالكتروني"
},
"update-email": {"en": "Update Email", "ar": "تحديث البريد الالكتروني"}, "update-email": {"en": "Update Email", "ar": "تحديث البريد الالكتروني"},
"booked-success": { "booked-success": {
"en": "The appointment has been successfully booked.", "en": "The appointment has been successfully booked.",
@ -1451,4 +1459,62 @@ const Map localizedValues = {
"en": "View List of Children", "en": "View List of Children",
"ar": "عرض قائمة الأطفال" "ar": "عرض قائمة الأطفال"
}, },
"trackDeliveryDriver": {
"en": "Track Delivery Driver",
"ar": "trackDeliveryDriver"
},
"covidTest": {
"en": "COVID-19 TEST",
"ar": "فحص كورونا"
},
"driveThru": {
"en": "Drive-Thru",
"ar": "من السيارة"
},
"NearestErDesc": {
"en": "\nThis service Displays nearest branch\n among all the branches of All Habib \n medical Group based on your current Location",
"ar": "\nتعرض هذه الخدمة أقرب فرع\n من بين جميع فروع مجموعة \nالحبيب الطبية بناءً على موقعك الحالي."
},
"NearestEr": {
"en": "Nearest ER",
"ar": "أقرب ER"
},
"infoCMC": {
"en": "Through this service, you can request a set of tests that help you and your doctor to understand the current health condition and then identify potential risks.",
"ar": "من خلال هذه الخدمة يمكنك طلب مجموعة من الفحوصات التي تساعدك وتساعد طبيبك في فهم حالتك الصحية الحالية ومن ثم تحديد المخاطر المحتملة"
},
"instructionAgree": {
"en": "This monthly Health Summary Report reflects the health indicators and analysis results of the latest visits. Please note that this will be sent automatically from the system and it's not considered as an official report so no medical decisions should be taken based on it.",
"ar": "هذا ملخص التقرير الصحي الشهري و الذي يسرد المؤشرات الصحية و نتائج التحاليل لأخر الزيارات. يرجى ملاحظة أن هذا التقرير هو تقرير يتم ارساله بشكل آلي من النظام و لا يعتبر رسمي و لا تؤخذ عليه أي قرارات طبية"
},
"reqId": {
"en": "Request ID:",
"ar": " رقم الطلب"
},
"covid19_driveThrueTest": {
"en": "'Covid-19- Drive-Thru Test'",
"ar": "Covid-19- الفحص من خلال القيادة"
},
"E-Referral": {
"en": "'E-Referral'",
"ar": "الإحالة الإلكترونية"
},
"childName": {
"en": "'CHILD NAME'",
"ar": "إسم الطفل"
},
"recordDeleted": {
"en": "'Record Deleted'",
"ar": "تم حذف السجل"
},
"msg_email_address_up_to_date": {
"en": "Please ensure that the email address is up-to-date and process to view the schedule",
"ar": "يرجى التأكد من أن عنوان البريد الإلكتروني محدث وأن العملية لعرض الجدول الزمني"
},
"add-new-child": {"en" : "ADD NEW CHILD", "ar": "إضافة طفل جديد"},
"visit": {"en" : "Visit", "ar": "الزيارة"},
"send-child-email-msg": {"en" : "Send the child's schedule to the email", "ar": "أرسل جدول الطفل إلى البريد الإلكتروني"},
"vaccination-add-child-msg": {"en" : "Add the child's information below to receive the schedule of vaccinations.", "ar": "أضف معلومات الطفل أدناه للحصول على جدول التطعيمات."},
"child_added_successfully": {"en" : "Child added successfully", "ar": "تمت إضافة الطفل بنجاح"},
}; };

@ -1,6 +1,7 @@
class ImagesInfo { class ImagesInfo {
final String imageAr; final String imageAr;
final String imageEn; 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; int pickupSpot;
dynamic dropoffLocationId; dynamic dropoffLocationId;
int transportationMethodId; int transportationMethodId;
double cost; dynamic cost;
double vAT; dynamic vAT;
double totalPrice; double totalPrice;
int amountCollected; int amountCollected;
int selectedAmbulate; int selectedAmbulate;

@ -2,6 +2,7 @@
import 'dart:convert'; import 'dart:convert';
import 'package:diplomaticquarterapp/core/model/pharmacies/PharmacyImageObject.dart'; 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))); List<OrderModel> orderModelFromJson(String str) => List<OrderModel>.from(json.decode(str).map((x) => OrderModel.fromJson(x)));
@ -309,7 +310,22 @@ class IngAddress {
String customerAttributes; String customerAttributes;
DateTime createdOnUtc; DateTime createdOnUtc;
dynamic province; 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( factory IngAddress.fromJson(Map<String, dynamic> json) => IngAddress(
id: json["id"], id: json["id"],
@ -329,7 +345,7 @@ class IngAddress {
customerAttributes: json["customer_attributes"], customerAttributes: json["customer_attributes"],
createdOnUtc: DateTime.parse(json["created_on_utc"]), createdOnUtc: DateTime.parse(json["created_on_utc"]),
province: json["province"], province: json["province"],
latLong: latLongValues.map[json["lat_long"]], latLong: json["lat_long"],
); );
Map<String, dynamic> toJson() => { Map<String, dynamic> toJson() => {
@ -350,7 +366,7 @@ class IngAddress {
"customer_attributes": customerAttributes, "customer_attributes": customerAttributes,
"created_on_utc": createdOnUtc.toIso8601String(), "created_on_utc": createdOnUtc.toIso8601String(),
"province": province, "province": province,
"lat_long": latLongValues.reverse[latLong], "lat_long": latLong,
}; };
} }
@ -494,9 +510,9 @@ class OrderModelCustomer {
isSystemAccount: json["is_system_account"], isSystemAccount: json["is_system_account"],
systemName: json["system_name"], systemName: json["system_name"],
lastIpAddress: lastIpAddressValues.map[json["last_ip_address"]], lastIpAddress: lastIpAddressValues.map[json["last_ip_address"]],
createdOnUtc: DateTime.parse(json["created_on_utc"]), createdOnUtc: (json["created_on_utc"] != null) ? DateTime.parse(json["created_on_utc"]) : null,
lastLoginDateUtc: DateTime.parse(json["last_login_date_utc"]), lastLoginDateUtc: (json["created_on_utc"] != null) ? DateTime.parse(json["last_login_date_utc"]) : null,
lastActivityDateUtc: DateTime.parse(json["last_activity_date_utc"]), lastActivityDateUtc: (json["created_on_utc"] != null) ? DateTime.parse(json["last_activity_date_utc"]) : null,
registeredInStoreId: json["registered_in_store_id"], registeredInStoreId: json["registered_in_store_id"],
roleIds: List<int>.from(json["role_ids"].map((x) => x)), roleIds: List<int>.from(json["role_ids"].map((x) => x)),
); );

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

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

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

@ -1,7 +1,9 @@
import 'package:diplomaticquarterapp/config/config.dart'; 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/add_newchild_model.dart';
import 'package:diplomaticquarterapp/core/model/childvaccines/create_vaccination_table.dart'; import 'package:diplomaticquarterapp/core/model/childvaccines/create_vaccination_table.dart';
import 'package:diplomaticquarterapp/core/model/childvaccines/user_information_model.dart'; import 'package:diplomaticquarterapp/core/model/childvaccines/user_information_model.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import '../base_service.dart'; import '../base_service.dart';
class VaccinationTableService extends BaseService { 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; hasError = false;
await getUser(); await getUser();
body['BabyName']="fffffffffff eeeeeeeeeeeeee"; body['BabyName']= babyInfo.babyName;
body['DOB'] = "/Date(1585774800000+0300)/"; body['DOB'] = babyBDFormatted;
body['EmailAddress'] = user.emailAddress; body['EmailAddress'] = user.emailAddress;
body['isDentalAllowedBackend'] = false; body['isDentalAllowedBackend'] = false;
body['SendEmail'] = false; body['SendEmail'] = sendEmail;
body['IsLogin'] =true; body['IsLogin'] =true;
await baseAppClient.post(GET_TABLE_REQUEST, await baseAppClient.post(GET_TABLE_REQUEST,
onSuccess: (dynamic response, int statusCode) { onSuccess: (dynamic response, int statusCode) {
createVaccinationTableModelList.clear(); createVaccinationTableModelList.clear();

@ -46,7 +46,7 @@ class BaseAppClient {
//Map profile = await sharedPref.getObj(DOCTOR_PROFILE); //Map profile = await sharedPref.getObj(DOCTOR_PROFILE);
if (!isExternal) { if (!isExternal) {
String token = await sharedPref.getString(TOKEN); 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); var user = await sharedPref.getObject(USER_PROFILE);
if (body.containsKey('SetupID')) { if (body.containsKey('SetupID')) {
body['SetupID'] = body.containsKey('SetupID') body['SetupID'] = body.containsKey('SetupID')
@ -58,15 +58,7 @@ class BaseAppClient {
body['VersionID'] = VERSION_ID; body['VersionID'] = VERSION_ID;
body['Channel'] = CHANNEL; body['Channel'] = CHANNEL;
body['LanguageID'] = body.containsKey('LanguageID') body['LanguageID'] = languageID == 'ar' ? 1 : 2;
? body['LanguageID'] != null
? body['LanguageID']
: languageID == 'ar'
? 1
: 2
: languageID == 'en'
? 2
: 1;
body['IPAdress'] = IP_ADDRESS; body['IPAdress'] = IP_ADDRESS;
body['generalid'] = GENERAL_ID; body['generalid'] = GENERAL_ID;

@ -68,6 +68,19 @@ class ReportsService extends BaseService {
}, body: body); }, 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( Future insertRequestForMedicalReport(
AppointmentHistory appointmentHistory) async { AppointmentHistory appointmentHistory) async {
Map<String, dynamic> body = new Map<String, dynamic>(); Map<String, dynamic> body = new Map<String, dynamic>();

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

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

@ -13,11 +13,9 @@ class ReportsMonthlyViewModel extends BaseViewModel {
ReportsService _reportsService = locator<ReportsService>(); ReportsService _reportsService = locator<ReportsService>();
String get userAgreementContent => _reportsService.userAgreementContent; String get userAgreementContent => _reportsService.userAgreementContent;
getUserTermsAndConditions() async{ getUserTermsAndConditions() async {
setState(ViewState.Busy); setState(ViewState.Busy);
await _reportsService.getUserTermsAndConditions(); await _reportsService.getUserTermsAndConditions();
if (_reportsService.hasError) { 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); setState(ViewState.BusyLocal);
await _reportsService.updatePatientHealthSummaryReport(isSummary: isSummary); await _reportsService.updatePatientHealthSummaryReport(
isSummary: isSummary);
if (_reportsService.hasError) { if (_reportsService.hasError) {
error = _reportsService.error; error = _reportsService.error;
AppToast.showErrorToast(message: error); AppToast.showErrorToast(message: error);
setState(ViewState.ErrorLocal); setState(ViewState.ErrorLocal);
} else { } else {
AppToast.showSuccessToast(message: message); if (isUpdateEmail) {
setState(ViewState.Idle); 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);
}
} }
} }
} }

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

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

@ -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_get_items_request_model.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_insert_pres_order_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/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/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
class NewCMCStepOnePage extends StatefulWidget { class NewCMCStepOnePage extends StatefulWidget {
final CMCInsertPresOrderRequestModel cMCInsertPresOrderRequestModel; final CMCInsertPresOrderRequestModel cMCInsertPresOrderRequestModel;
@ -31,6 +36,8 @@ class _NewCMCStepOnePageState extends State<NewCMCStepOnePage> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
return AppScaffold( return AppScaffold(
isShowAppBar: false, isShowAppBar: false,
baseViewModel: widget.model, baseViewModel: widget.model,
@ -50,17 +57,17 @@ class _NewCMCStepOnePageState extends State<NewCMCStepOnePage> {
height: 20, height: 20,
), ),
Texts( Texts(
"Select Home Health Care Services", TranslationBase.of(context).selectService,
textAlign: TextAlign.center, textAlign: TextAlign.center,
), ),
Column( Column(
children: children:
widget.model.cmcAllServicesList.map((service) { widget.model.cmcAllServicesList.map((service) {
return Container( return Container(
margin: EdgeInsets.only(top: 15), margin: EdgeInsets.only(top: 15),
decoration: BoxDecoration( decoration: BoxDecoration(
border: border:
Border.all(color: Colors.grey, width: 1), Border.all(color: Colors.grey, width: 1),
borderRadius: BorderRadius.circular(12), borderRadius: BorderRadius.circular(12),
color: Colors.white), color: Colors.white),
child: Column( child: Column(
@ -72,50 +79,53 @@ class _NewCMCStepOnePageState extends State<NewCMCStepOnePage> {
activeColor: Colors.red[800], activeColor: Colors.red[800],
onChanged: (newValue) async { onChanged: (newValue) async {
PatientERCMCInsertServicesList PatientERCMCInsertServicesList
patientERCMCInsertServicesList = patientERCMCInsertServicesList =
new PatientERCMCInsertServicesList( new PatientERCMCInsertServicesList(
price: service.price, price: service.price,
serviceID: service.serviceID serviceID: service.serviceID
.toString(), .toString(),
selectedServiceName: selectedServiceName:
service.description, service.description,
selectedServiceNameAR: selectedServiceNameAR:
service.description, service.descriptionN,
recordID: 1, recordID: 1,
totalPrice: totalPrice:
service.totalPrice, service.totalPrice,
vAT: service.vAT); vAT: service.vAT);
setState(() { setState(() {
widget widget
.cMCInsertPresOrderRequestModel .cMCInsertPresOrderRequestModel
.patientERCMCInsertServicesList = [ .patientERCMCInsertServicesList =
[
patientERCMCInsertServicesList patientERCMCInsertServicesList
]; ];
}); });
CMCGetItemsRequestModel CMCGetItemsRequestModel
cMCGetItemsRequestModel = cMCGetItemsRequestModel =
new CMCGetItemsRequestModel( new CMCGetItemsRequestModel(
checkupType: newValue); checkupType: newValue);
await widget.model.getCheckupItems( await widget.model.getCheckupItems(
cMCGetItemsRequestModel: cMCGetItemsRequestModel:
cMCGetItemsRequestModel); cMCGetItemsRequestModel);
}, },
groupValue: widget groupValue: widget
.cMCInsertPresOrderRequestModel .cMCInsertPresOrderRequestModel
.patientERCMCInsertServicesList .patientERCMCInsertServicesList
.length > .length >
0 0
? int.parse(widget ? int.parse(widget
.cMCInsertPresOrderRequestModel .cMCInsertPresOrderRequestModel
.patientERCMCInsertServicesList[ .patientERCMCInsertServicesList[
0] 0]
.serviceID) .serviceID)
: 1), : 1),
Expanded( Expanded(
child: Padding( child: Padding(
padding: const EdgeInsets.all(20.0), padding: const EdgeInsets.all(20.0),
child: Texts( child: Texts(
service.description, projectViewModel.isArabic ? service
.descriptionN : service
.description,
fontSize: 15, fontSize: 15,
), ),
), ),
@ -137,52 +147,67 @@ class _NewCMCStepOnePageState extends State<NewCMCStepOnePage> {
color: Colors.white, color: Colors.white,
width: double.infinity, width: double.infinity,
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, children: [
children: widget.model.checkupItems.map((item) { Row(
return Center( children: [
child: FractionallySizedBox( Container(margin: EdgeInsets.only(
widthFactor: 1, right: 10, left: 10), child: Texts(TranslationBase.of(context).coveredService, fontWeight: FontWeight.bold,))
child: Container( ],
margin: EdgeInsets.only(top: 15), ),
decoration: BoxDecoration(color: Colors.white), Column(
child: Column( crossAxisAlignment: CrossAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, children: widget.model.checkupItems.map((item) {
children: [ return Center(
SizedBox( child: FractionallySizedBox(
height: 12, widthFactor: 1,
), child: Container(
Container( margin: EdgeInsets.only(top: 15),
width: double.infinity, decoration: BoxDecoration(
padding: EdgeInsets.only( color: Colors.white),
left: 15, bottom: 5, top: 5), child: Column(
decoration: BoxDecoration( crossAxisAlignment: CrossAxisAlignment
border: BorderDirectional( .start,
bottom: BorderSide( children: [
style: BorderStyle.solid, SizedBox(
width: 0.5, height: 12,
color: Colors.grey)), ),
//borderRadius: , Container(
color: Colors.white), width: double.infinity,
child: Column( padding: EdgeInsets.only(
crossAxisAlignment: 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, CrossAxisAlignment.start,
children: [ children: [
Texts( Container(margin: EdgeInsets.only(
item.itemName, right: 10, left: 10),
fontSize: 15, 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( Container(
width: MediaQuery.of(context).size.width * 0.9, width: MediaQuery.of(context).size.width * 0.9,
child: SecondaryButton( child: SecondaryButton(
label: "Next", label: TranslationBase
textColor: Theme.of(context).backgroundColor, .of(context)
onTap: () { .next,
if (widget.cMCInsertPresOrderRequestModel.patientERCMCInsertServicesList.length = null) { 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; int index = widget.model.cmcAllServicesList.length;
PatientERCMCInsertServicesList PatientERCMCInsertServicesList
patientERCMCInsertServicesList = patientERCMCInsertServicesList =
new PatientERCMCInsertServicesList( new PatientERCMCInsertServicesList(
price: widget.model.cmcAllServicesList[index-1].price, price: widget
serviceID: widget.model.cmcAllServicesList[index-1].serviceID.toString(), .model.cmcAllServicesList[index - 1].price,
selectedServiceName: widget.model.cmcAllServicesList[index-1].description, serviceID: widget
selectedServiceNameAR: widget.model.cmcAllServicesList[index-1].description, .model.cmcAllServicesList[index - 1].serviceID
recordID: 1, .toString(),
totalPrice: widget.model.cmcAllServicesList[index-1].totalPrice, selectedServiceName: widget.model
vAT: widget.model.cmcAllServicesList[index-1].vAT); .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 widget.cMCInsertPresOrderRequestModel
.patientERCMCInsertServicesList = [ .patientERCMCInsertServicesList = [
patientERCMCInsertServicesList patientERCMCInsertServicesList
]; ];
await widget.model.getCustomerInfo();
widget.changePageViewIndex(1); 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/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_insert_pres_order_request_model.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/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/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:google_maps_flutter/google_maps_flutter.dart'; import 'package:google_maps_flutter/google_maps_flutter.dart';
import 'package:provider/provider.dart';
class NewCMCStepThreePage extends StatefulWidget { class NewCMCStepThreePage extends StatefulWidget {
final CMCInsertPresOrderRequestModel cmcInsertPresOrderRequestModel; final CMCInsertPresOrderRequestModel cmcInsertPresOrderRequestModel;
@ -63,19 +64,23 @@ class _NewCMCStepThreePageState
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
return AppScaffold( return AppScaffold(
isShowDecPage: false, isShowDecPage: false,
baseViewModel: widget.model, baseViewModel: widget.model,
body: SingleChildScrollView( body: SingleChildScrollView(
physics: BouncingScrollPhysics(), physics: BouncingScrollPhysics(),
child: Container( child: Container(
height: 400, height: 500,
width: double.maxFinite, width: double.maxFinite,
margin: EdgeInsets.only(left: 12, right: 12), margin: EdgeInsets.only(left: 12, right: 12),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Texts('Order Details'), Texts(
TranslationBase.of(context).orderDetails,
fontWeight: FontWeight.bold,
),
SizedBox( SizedBox(
height: 12, height: 12,
), ),
@ -87,7 +92,9 @@ class _NewCMCStepThreePageState
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Texts('Location :'), Texts(TranslationBase
.of(context)
.orderLocation + " : ", fontWeight: FontWeight.bold,),
SizedBox( SizedBox(
height: 12, height: 12,
), ),
@ -108,30 +115,40 @@ class _NewCMCStepThreePageState
SizedBox( SizedBox(
height: 12, height: 12,
), ),
Texts('Selected Service :'), Texts(TranslationBase
.of(context)
.selectedService),
...List.generate( ...List.generate(
widget.cmcInsertPresOrderRequestModel.patientERCMCInsertServicesList.length, widget.cmcInsertPresOrderRequestModel
(index) => Container( .patientERCMCInsertServicesList.length,
child: Column( (index) =>
crossAxisAlignment: CrossAxisAlignment.start, Container(
children: [ child: Column(
Texts( crossAxisAlignment: CrossAxisAlignment.start,
'Service Name :', children: [
fontSize: 12, Texts(
), TranslationBase
SizedBox( .of(context)
height: 5, .serviceName,
), fontSize: 12, fontWeight: FontWeight.bold,
Texts( ),
widget SizedBox(
.cmcInsertPresOrderRequestModel.patientERCMCInsertServicesList[index] height: 5,
.selectedServiceName, ),
fontSize: 15, Texts(
bold: true, projectViewModel.isArabic ? widget
.cmcInsertPresOrderRequestModel
.patientERCMCInsertServicesList[index]
.selectedServiceNameAR : widget
.cmcInsertPresOrderRequestModel
.patientERCMCInsertServicesList[index]
.selectedServiceName,
fontSize: 15,
bold: true,
),
],
), ),
], ),
),
),
) )
], ],
), ),
@ -148,14 +165,20 @@ class _NewCMCStepThreePageState
Container( Container(
width: MediaQuery.of(context).size.width * 0.9, width: MediaQuery.of(context).size.width * 0.9,
child: SecondaryButton( child: SecondaryButton(
label: "Confirm", label: TranslationBase
.of(context)
.confirm,
color: Colors.grey[800],
onTap: () async { onTap: () async {
await widget.model.insertPresPresOrder(order: widget.cmcInsertPresOrderRequestModel); await widget.model.insertPresPresOrder(
order: widget.cmcInsertPresOrderRequestModel);
if (widget.model.state != ViewState.ErrorLocal) { if (widget.model.state != ViewState.ErrorLocal) {
widget.changePageViewIndex(0); 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/config/config.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_insert_pres_order_request_model.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/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/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/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.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/cupertino.dart';
import 'package:flutter/material.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_flutter/google_maps_flutter.dart';
import 'package:google_maps_place_picker/google_maps_place_picker.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'cmc_location_page.dart';
class NewCMCStepTowPage extends StatefulWidget { class NewCMCStepTowPage extends StatefulWidget {
final Function(PickResult) onPick; final Function(PickResult) onPick;
final double latitude; final double latitude;
@ -41,12 +44,13 @@ class _NewCMCStepTowPageState
extends State<NewCMCStepTowPage> { extends State<NewCMCStepTowPage> {
double latitude = 0; double latitude = 0;
double longitude = 0; double longitude = 0;
AddressInfo _selectedAddress;
@override @override
void initState() { void initState() {
if (widget.cmcInsertPresOrderRequestModel.latitude == null) { if (widget.cmcInsertPresOrderRequestModel.latitude == null) {
latitude = widget.latitude; setLatitudeAndLongitude();
longitude = widget.longitude;
} else { } else {
latitude = widget.cmcInsertPresOrderRequestModel.latitude; latitude = widget.cmcInsertPresOrderRequestModel.latitude;
longitude = widget.cmcInsertPresOrderRequestModel.longitude; longitude = widget.cmcInsertPresOrderRequestModel.longitude;
@ -54,60 +58,152 @@ class _NewCMCStepTowPageState
super.initState(); 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 @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context); ProjectViewModel projectViewModel = Provider.of(context);
return AppScaffold( return AppScaffold(
isShowDecPage: false, isShowDecPage: false,
body: PlacePicker( body: Stack(
apiKey: GOOGLE_API_KEY, children: [
enableMyLocationButton: true, PlacePicker(
automaticallyImplyAppBarLeading: false, apiKey: GOOGLE_API_KEY,
autocompleteOnTrailingWhitespace: true, enableMyLocationButton: true,
selectInitialPosition: true, automaticallyImplyAppBarLeading: false,
autocompleteLanguage: projectViewModel.currentLanguage, autocompleteOnTrailingWhitespace: true,
enableMapTypeButton: true, selectInitialPosition: true,
onPlacePicked: (PickResult result) { autocompleteLanguage: projectViewModel.currentLanguage,
print(result.adrAddress); enableMapTypeButton: true,
widget.changePageViewIndex(3); searchForInitialValue: false,
},
selectedPlaceWidgetBuilder: onPlacePicked: (PickResult result) {
(_, selectedPlace, state, isSearchBarFocused) { print(result.adrAddress);
print("state: $state, isSearchBarFocused: $isSearchBarFocused"); widget.changePageViewIndex(3);
return isSearchBarFocused },
? Container() selectedPlaceWidgetBuilder:
: FloatingCard( (_, selectedPlace, state, isSearchBarFocused) {
bottomPosition: 0.0, print("state: $state, isSearchBarFocused: $isSearchBarFocused");
leftPosition: 0.0, return isSearchBarFocused
rightPosition: 0.0, ? Container()
width: 500, : FloatingCard(
borderRadius: BorderRadius.circular(12.0), bottomPosition: 0.0,
child: state == SearchingState.Searching leftPosition: 0.0,
? Center(child: CircularProgressIndicator()) rightPosition: 0.0,
: Container( width: 500,
margin: EdgeInsets.all(12), borderRadius: BorderRadius.circular(12.0),
child: SecondaryButton( child: state == SearchingState.Searching
color: Colors.grey[800], ? Center(child: CircularProgressIndicator())
textColor: Colors.white, : Container(
onTap: () { margin: EdgeInsets.all(12),
setState(() { child: Column(
widget.cmcInsertPresOrderRequestModel children: [
.latitude = SecondaryButton(
selectedPlace.geometry.location.lat; color: Colors.grey[800],
widget.cmcInsertPresOrderRequestModel textColor: Colors.white,
.longitude = onTap: () {
selectedPlace.geometry.location.lng; Navigator.push(
}); context,
widget.changePageViewIndex(3); MaterialPageRoute(
}, builder: (BuildContext context) =>
label: TranslationBase.of(context).next, 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 'dart:ui';
import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart';
import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/cmc_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/cmc_view_model.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
@ -35,12 +36,15 @@ class _CMCPageState extends State<CMCPage>
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return BaseView<CMCViewModel>( return BaseView<CMCViewModel>(
onModelReady: (model){ onModelReady: (model) async{
model.getCmcAllPresOrders(); await model.getCmcAllPresOrders();
}, },
builder: (_, model, widget) => AppScaffold( builder: (_, model, widget) => AppScaffold(
isShowAppBar: true, 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( body: Scaffold(
extendBodyBehindAppBar: true, extendBodyBehindAppBar: true,
appBar: PreferredSize( appBar: PreferredSize(
@ -78,7 +82,7 @@ class _CMCPageState extends State<CMCPage>
isScrollable: true, isScrollable: true,
controller: _tabController, controller: _tabController,
indicatorWeight: 5.0, indicatorWeight: 5.0,
indicatorSize: TabBarIndicatorSize.label, indicatorSize: TabBarIndicatorSize.tab,
indicatorColor: Colors.red[800], indicatorColor: Colors.red[800],
labelColor: Theme.of(context).primaryColor, labelColor: Theme.of(context).primaryColor,
labelPadding: labelPadding:
@ -88,7 +92,8 @@ class _CMCPageState extends State<CMCPage>
Container( Container(
width: MediaQuery.of(context).size.width * 0.37, width: MediaQuery.of(context).size.width * 0.37,
child: Center( child: Center(
child: Texts("CMC Service"), child: Texts(TranslationBase.of(context)
.comprehensiveMedicalCheckup),
), ),
), ),
Container( 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/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/model/AlHabibMedicalService/HomeHealthCare/update_pres_oreder_request_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/cmc_view_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/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.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/uitl/utils.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'Dialog/confirm_cancel_order_dialog.dart'; import 'Dialog/confirm_cancel_order_dialog.dart';
@ -19,6 +22,9 @@ class OrdersLogDetailsPage extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
void showConfirmMessage( void showConfirmMessage(
CMCViewModel model, GetHHCAllPresOrdersResponseModel order) { CMCViewModel model, GetHHCAllPresOrdersResponseModel order) {
showDialog( showDialog(
@ -35,7 +41,7 @@ class OrdersLogDetailsPage extends StatelessWidget {
if(model.state == ViewState.ErrorLocal) { if(model.state == ViewState.ErrorLocal) {
Utils.showErrorToast(model.error); Utils.showErrorToast(model.error);
} else { } else {
AppToast.showSuccessToast(message: "Done Successfully"); AppToast.showSuccessToast(message:TranslationBase.of(context).processDoneSuccessfully );
await model.getCmcAllPresOrders(); await model.getCmcAllPresOrders();
} }
}, },
@ -78,7 +84,7 @@ class OrdersLogDetailsPage extends StatelessWidget {
Container( Container(
width: double.infinity, width: double.infinity,
padding: EdgeInsets.only( padding: EdgeInsets.only(
left: 15, bottom: 15, top: 15), left: 15, bottom: 15, top: 15,right: 15),
decoration: BoxDecoration( decoration: BoxDecoration(
border: Border( border: Border(
bottom: BorderSide( bottom: BorderSide(
@ -89,11 +95,12 @@ class OrdersLogDetailsPage extends StatelessWidget {
// borderRadius: BorderRadius.circular(12), // borderRadius: BorderRadius.circular(12),
color: Colors.white), color: Colors.white),
child: Column( child: Column(
crossAxisAlignment: crossAxisAlignment: CrossAxisAlignment.start,
CrossAxisAlignment.start,
children: [ children: [
Texts( Texts(
"Request ID", TranslationBase
.of(context)
.requestID,
bold: false, bold: false,
fontSize: 13, fontSize: 13,
), ),
@ -110,7 +117,7 @@ class OrdersLogDetailsPage extends StatelessWidget {
Container( Container(
width: double.infinity, width: double.infinity,
padding: EdgeInsets.only( padding: EdgeInsets.only(
left: 15, bottom: 15, top: 15), left: 15, bottom: 15, top: 15,right: 15),
decoration: BoxDecoration( decoration: BoxDecoration(
border: Border( border: Border(
bottom: BorderSide( bottom: BorderSide(
@ -121,11 +128,12 @@ class OrdersLogDetailsPage extends StatelessWidget {
// borderRadius: BorderRadius.circular(12), // borderRadius: BorderRadius.circular(12),
color: Colors.white), color: Colors.white),
child: Column( child: Column(
crossAxisAlignment: crossAxisAlignment: CrossAxisAlignment.start,
CrossAxisAlignment.start,
children: [ children: [
Texts( Texts(
"Status", TranslationBase
.of(context)
.OrderStatus,
bold: false, bold: false,
fontSize: 13, fontSize: 13,
), ),
@ -133,7 +141,9 @@ class OrdersLogDetailsPage extends StatelessWidget {
height: 4, height: 4,
), ),
Texts( Texts(
order.description,
projectViewModel.isArabic ? order
.descriptionN : order.description,
fontSize: 22, fontSize: 22,
), ),
], ],
@ -142,7 +152,7 @@ class OrdersLogDetailsPage extends StatelessWidget {
Container( Container(
width: double.infinity, width: double.infinity,
padding: EdgeInsets.only( padding: EdgeInsets.only(
left: 15, bottom: 15, top: 15), left: 15, bottom: 15, top: 15,right: 15),
decoration: BoxDecoration( decoration: BoxDecoration(
border: Border( border: Border(
bottom: BorderSide( bottom: BorderSide(
@ -153,11 +163,10 @@ class OrdersLogDetailsPage extends StatelessWidget {
// borderRadius: BorderRadius.circular(12), // borderRadius: BorderRadius.circular(12),
color: Colors.white), color: Colors.white),
child: Column( child: Column(
crossAxisAlignment: crossAxisAlignment: CrossAxisAlignment.start,
CrossAxisAlignment.start,
children: [ children: [
Texts( Texts(
"Pickup Date", TranslationBase.of(context).pickupDate,
bold: false, bold: false,
fontSize: 13, fontSize: 13,
), ),
@ -166,8 +175,7 @@ class OrdersLogDetailsPage extends StatelessWidget {
), ),
Texts( Texts(
DateUtil.getDayMonthYearDateFormatted( DateUtil.getDayMonthYearDateFormatted(
DateUtil.convertStringToDate( DateUtil.convertStringToDate(order.createdOn)),
order.createdOn)),
fontSize: 22, fontSize: 22,
), ),
], ],
@ -176,7 +184,7 @@ class OrdersLogDetailsPage extends StatelessWidget {
Container( Container(
width: double.infinity, width: double.infinity,
padding: EdgeInsets.only( padding: EdgeInsets.only(
left: 15, bottom: 15, top: 15), left: 15, bottom: 15, top: 15,right: 15),
decoration: BoxDecoration( decoration: BoxDecoration(
border: Border( border: Border(
bottom: BorderSide( bottom: BorderSide(
@ -191,7 +199,7 @@ class OrdersLogDetailsPage extends StatelessWidget {
CrossAxisAlignment.start, CrossAxisAlignment.start,
children: [ children: [
Texts( Texts(
"Location", TranslationBase.of(context).orderLocation,
bold: false, bold: false,
fontSize: 13, fontSize: 13,
), ),
@ -199,10 +207,11 @@ class OrdersLogDetailsPage extends StatelessWidget {
height: 4, height: 4,
), ),
Texts( Texts(
order.nearestProjectDescription !projectViewModel.isArabic?order.
.toString() ?? projectDescription.toString() :
order.nearestProjectDescriptionN order
.toString(), .projectDescriptionN
.toString(),
fontSize: 22, fontSize: 22,
), ),
], ],
@ -212,32 +221,33 @@ class OrdersLogDetailsPage extends StatelessWidget {
height: 12, height: 12,
), ),
if (order.status == 1 ||order.status == 2 ) if (order.status == 1 ||order.status == 2 )
Center( Center(
child: Container( child: Container(
width: MediaQuery width: MediaQuery
.of(context) .of(context)
.size .size
.width * .width *
0.85, 0.85,
child: SecondaryButton( child: SecondaryButton(
label: "Cancel".toUpperCase(), label: TranslationBase.of(context).cancel.toUpperCase(),
onTap: () { onTap: () {
showConfirmMessage(model, order); showConfirmMessage(model,
} order);
, }
color: Colors.red[800], ,
disabled: false, color: Colors.red[800],
textColor: Theme disabled: false,
.of(context) textColor: Theme
.backgroundColor), .of(context)
), .backgroundColor),
), ),
),
SizedBox( SizedBox(
height: 12, height: 22,
), ),
], ],
), ),
); );
}).toList()) }).toList())
], ],
), ),

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

@ -29,7 +29,7 @@ class _ConfirmCancelOrderDialogState extends State<ConfirmCancelOrderDialog> {
contentPadding: EdgeInsets.fromLTRB(28.0, 24.0, 28.0, 0.0), contentPadding: EdgeInsets.fromLTRB(28.0, 24.0, 28.0, 0.0),
title: Center( title: Center(
child: Texts( child: Texts(
"Confirm", TranslationBase.of(context).confirm,
color: Colors.black, color: Colors.black,
), ),
), ),
@ -39,7 +39,7 @@ class _ConfirmCancelOrderDialogState extends State<ConfirmCancelOrderDialog> {
Divider(), Divider(),
Center( Center(
child: Texts( child: Texts(
"Are you sure!! want to cancel this order", TranslationBase.of(context).cancelOrderMsg ,
color: Colors.grey, 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/PatientERHHCInsertServicesList.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/patient_er_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/home_health_care_view_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/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/pickupLocation/PickupLocationFromMap.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:geolocator/geolocator.dart';
import 'package:google_maps_place_picker/google_maps_place_picker.dart'; import 'package:google_maps_place_picker/google_maps_place_picker.dart';
import 'package:provider/provider.dart';
class NewHomeHealthCareStepOnePage extends StatefulWidget { class NewHomeHealthCareStepOnePage extends StatefulWidget {
final PatientERInsertPresOrderRequestModel final PatientERInsertPresOrderRequestModel
@ -45,6 +46,8 @@ class _NewHomeHealthCareStepOnePageState extends State<NewHomeHealthCareStepOneP
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
return AppScaffold( return AppScaffold(
isShowAppBar: false, isShowAppBar: false,
baseViewModel: widget.model, baseViewModel: widget.model,
@ -64,7 +67,9 @@ class _NewHomeHealthCareStepOnePageState extends State<NewHomeHealthCareStepOneP
height: 12, height: 12,
), ),
Texts( Texts(
"Select Home Health Care Services", TranslationBase
.of(context)
.selectHomeHealthCareServices,
textAlign: TextAlign.center, textAlign: TextAlign.center,
), ),
Column( Column(
@ -90,13 +95,13 @@ class _NewHomeHealthCareStepOnePageState extends State<NewHomeHealthCareStepOneP
.patientERInsertPresOrderRequestModel .patientERInsertPresOrderRequestModel
.patientERHHCInsertServicesList .patientERHHCInsertServicesList
.add(PatientERHHCInsertServicesList( .add(PatientERHHCInsertServicesList(
recordID: widget recordID: widget
.patientERInsertPresOrderRequestModel .patientERInsertPresOrderRequestModel
.patientERHHCInsertServicesList .patientERHHCInsertServicesList
.length, .length,
serviceID: service.serviceID, serviceID: service.serviceID,
serviceName: serviceName:
service.description)); service.description));
else else
removeSelected(service.serviceID); removeSelected(service.serviceID);
// widget.patientERInsertPresOrderRequestModel // widget.patientERInsertPresOrderRequestModel
@ -107,7 +112,8 @@ class _NewHomeHealthCareStepOnePageState extends State<NewHomeHealthCareStepOneP
child: Padding( child: Padding(
padding: const EdgeInsets.all(20.0), padding: const EdgeInsets.all(20.0),
child: Texts( child: Texts(
service.description, projectViewModel.isArabic ? service
.descriptionN : service.description,
fontSize: 15, fontSize: 15,
), ),
), ),
@ -133,14 +139,23 @@ class _NewHomeHealthCareStepOnePageState extends State<NewHomeHealthCareStepOneP
Container( Container(
width: MediaQuery.of(context).size.width * 0.9, width: MediaQuery.of(context).size.width * 0.9,
child: SecondaryButton( child: SecondaryButton(
label: "Next", label: TranslationBase
.of(context)
.next,
disabled: this disabled: this
.widget .widget
.patientERInsertPresOrderRequestModel .patientERInsertPresOrderRequestModel
.patientERHHCInsertServicesList .patientERHHCInsertServicesList
.length == 0, .length == 0 || widget.model.state == ViewState.BusyLocal,
onTap: (){ color: Colors.grey[800],
widget.changePageViewIndex(1); 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), textColor: Theme.of(context).backgroundColor),
), ),

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

@ -1,17 +1,21 @@
import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/patient_er_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/home_health_care_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/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/select_location_dialog.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.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/cupertino.dart';
import 'package:flutter/material.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_flutter/google_maps_flutter.dart';
import 'package:google_maps_place_picker/google_maps_place_picker.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'location_page.dart';
class NewHomeHealthCareStepTowPage extends StatefulWidget { class NewHomeHealthCareStepTowPage extends StatefulWidget {
final Function(PickResult) onPick; final Function(PickResult) onPick;
final double latitude; final double latitude;
@ -40,73 +44,163 @@ class _NewHomeHealthCareStepTowPageState
extends State<NewHomeHealthCareStepTowPage> { extends State<NewHomeHealthCareStepTowPage> {
double latitude = 0; double latitude = 0;
double longitude = 0; double longitude = 0;
AddressInfo _selectedAddress;
@override @override
void initState() { void initState() {
if (widget.patientERInsertPresOrderRequestModel.latitude == null) { if (widget.patientERInsertPresOrderRequestModel.latitude == null) {
latitude = widget.latitude; setLatitudeAndLongitude();
longitude = widget.longitude;
} else { } else {
latitude = widget.patientERInsertPresOrderRequestModel.latitude; latitude = widget.patientERInsertPresOrderRequestModel.latitude;
longitude = widget.patientERInsertPresOrderRequestModel.longitude; longitude = widget.patientERInsertPresOrderRequestModel.longitude;
} }
super.initState(); 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 @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context); ProjectViewModel projectViewModel = Provider.of(context);
return AppScaffold( return AppScaffold(
isShowDecPage: false, isShowDecPage: false,
body: PlacePicker( body: Stack(
apiKey: GOOGLE_API_KEY, children: [
enableMyLocationButton: true, PlacePicker(
automaticallyImplyAppBarLeading: false, apiKey: GOOGLE_API_KEY,
autocompleteOnTrailingWhitespace: true, enableMyLocationButton: true,
selectInitialPosition: true, automaticallyImplyAppBarLeading: false,
autocompleteLanguage: projectViewModel.currentLanguage, autocompleteOnTrailingWhitespace: true,
enableMapTypeButton: true, selectInitialPosition: true,
onPlacePicked: (PickResult result) { autocompleteLanguage: projectViewModel.currentLanguage,
print(result.adrAddress); enableMapTypeButton: true,
widget.changePageViewIndex(3); searchForInitialValue: false,
},
selectedPlaceWidgetBuilder: onPlacePicked: (PickResult result) {
(_, selectedPlace, state, isSearchBarFocused) { print(result.adrAddress);
print("state: $state, isSearchBarFocused: $isSearchBarFocused"); widget.changePageViewIndex(3);
return isSearchBarFocused },
? Container() selectedPlaceWidgetBuilder:
: FloatingCard( (_, selectedPlace, state, isSearchBarFocused) {
bottomPosition: 0.0, print("state: $state, isSearchBarFocused: $isSearchBarFocused");
leftPosition: 0.0, return isSearchBarFocused
rightPosition: 0.0, ? Container()
width: 500, : FloatingCard(
borderRadius: BorderRadius.circular(12.0), bottomPosition: 0.0,
child: state == SearchingState.Searching leftPosition: 0.0,
? Center(child: CircularProgressIndicator()) rightPosition: 0.0,
: Container( width: 500,
margin: EdgeInsets.all(12), borderRadius: BorderRadius.circular(12.0),
child: SecondaryButton( child: state == SearchingState.Searching
color: Colors.grey[800], ? Center(child: CircularProgressIndicator())
textColor: Colors.white, : Container(
onTap: () { margin: EdgeInsets.all(12),
setState(() { child: Column(
widget.patientERInsertPresOrderRequestModel children: [
.latitude = SecondaryButton(
selectedPlace.geometry.location.lat; color: Colors.grey[800],
widget.patientERInsertPresOrderRequestModel textColor: Colors.white,
.longitude = onTap: () {
selectedPlace.geometry.location.lng; Navigator.push(
}); context,
widget.changePageViewIndex(3); MaterialPageRoute(
}, builder: (BuildContext context) =>
label: TranslationBase.of(context).next, LocationPage(
), latitude: latitude,
), longitude: longitude,
); ),
),
);
},
label: TranslationBase.of(context).addNewAddress,
),
SizedBox(height: 10,),
SecondaryButton(
color: Colors.red[800],
textColor: Colors.white,
onTap: () {
setState(() {
widget.patientERInsertPresOrderRequestModel
.latitude =
selectedPlace.geometry.location.lat;
widget.patientERInsertPresOrderRequestModel
.longitude =
selectedPlace.geometry.location.lng;
});
widget.changePageViewIndex(3);
},
label: TranslationBase.of(context).confirm,
),
],
),
),
);
},
initialPosition: LatLng(latitude, longitude),
useCurrentLocation: false,
),
Container(
child: InkWell(
onTap: () =>
confirmSelectLocationDialog(widget.model.addressesList),
child: Container(
padding: EdgeInsets.all(10),
width: double.infinity,
// height: 65,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(10),
color: Colors.white),
child: Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [
Expanded(child: Texts(getAddressName(), fontSize: 14,),),
Icon(Icons.arrow_drop_down)
],
),
),
),
height: 56, width: double.infinity, color: Theme
.of(context)
.scaffoldBackgroundColor,
)
],
),
);
}
void confirmSelectLocationDialog(List<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;
}
} }

@ -3,16 +3,19 @@ import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealth
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/patient_er_insert_pres_order_request_model.dart'; import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/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/model/AlHabibMedicalService/HomeHealthCare/update_pres_oreder_request_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/home_health_care_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/home_health_care_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/HomeHealthCare/Dialog/confirm_cancel_order_dialog.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/HomeHealthCare/Dialog/confirm_cancel_order_dialog.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_Home_health_care_step_three_page.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_Home_health_care_step_three_page.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_Home_health_care_step_tow_page.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_Home_health_care_step_tow_page.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.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/uitl/utils.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:geolocator/geolocator.dart'; import 'package:geolocator/geolocator.dart';
import 'package:provider/provider.dart';
import '../StepsWidget.dart'; import '../StepsWidget.dart';
import 'new_Home_health_care_step_one_page.dart'; import 'new_Home_health_care_step_one_page.dart';
@ -84,7 +87,7 @@ class _NewHomeHealthCarePageState extends State<NewHomeHealthCarePage>
if (model.state == ViewState.ErrorLocal) { if (model.state == ViewState.ErrorLocal) {
Utils.showErrorToast(model.error); Utils.showErrorToast(model.error);
} else { } else {
AppToast.showSuccessToast(message: "Done Successfully"); AppToast.showSuccessToast(message:TranslationBase.of(context).processDoneSuccessfully );
await model.getHHCAllPresOrders(); await model.getHHCAllPresOrders();
// await model.getHHCAllServices(); // await model.getHHCAllServices();
} }
@ -92,6 +95,8 @@ class _NewHomeHealthCarePageState extends State<NewHomeHealthCarePage>
)); ));
} }
ProjectViewModel projectViewModel = Provider.of(context);
return Scaffold( return Scaffold(
body: SafeArea( body: SafeArea(
child: SingleChildScrollView( child: SingleChildScrollView(
@ -99,7 +104,6 @@ class _NewHomeHealthCarePageState extends State<NewHomeHealthCarePage>
height: MediaQuery.of(context).size.height * 0.8, height: MediaQuery.of(context).size.height * 0.8,
child: Column( child: Column(
children: [ children: [
Container( Container(
margin: EdgeInsets.only(left: MediaQuery.of(context).size.width*0.05, right: MediaQuery.of(context).size.width*0.05), margin: EdgeInsets.only(left: MediaQuery.of(context).size.width*0.05, right: MediaQuery.of(context).size.width*0.05),
child: StepsWidget( child: StepsWidget(
@ -138,7 +142,7 @@ class _NewHomeHealthCarePageState extends State<NewHomeHealthCarePage>
Container( Container(
width: double.infinity, width: double.infinity,
padding: EdgeInsets.only( padding: EdgeInsets.only(
left: 15, bottom: 15, top: 15), left: 15, bottom: 15, top: 15,right: 15),
decoration: BoxDecoration( decoration: BoxDecoration(
border: Border( border: Border(
bottom: BorderSide( bottom: BorderSide(
@ -152,7 +156,9 @@ class _NewHomeHealthCarePageState extends State<NewHomeHealthCarePage>
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Texts( Texts(
"Request ID", TranslationBase
.of(context)
.requestID,
bold: false, bold: false,
fontSize: 13, fontSize: 13,
), ),
@ -169,7 +175,7 @@ class _NewHomeHealthCarePageState extends State<NewHomeHealthCarePage>
Container( Container(
width: double.infinity, width: double.infinity,
padding: EdgeInsets.only( padding: EdgeInsets.only(
left: 15, bottom: 15, top: 15), left: 15, bottom: 15, top: 15,right: 15),
decoration: BoxDecoration( decoration: BoxDecoration(
border: Border( border: Border(
bottom: BorderSide( bottom: BorderSide(
@ -183,7 +189,9 @@ class _NewHomeHealthCarePageState extends State<NewHomeHealthCarePage>
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Texts( Texts(
"Status", TranslationBase
.of(context)
.OrderStatus,
bold: false, bold: false,
fontSize: 13, fontSize: 13,
), ),
@ -191,7 +199,11 @@ class _NewHomeHealthCarePageState extends State<NewHomeHealthCarePage>
height: 4, height: 4,
), ),
Texts( Texts(
widget.model.pendingOrder.description,
projectViewModel.isArabic ? widget
.model.pendingOrder
.descriptionN : widget.model
.pendingOrder.description,
fontSize: 22, fontSize: 22,
), ),
], ],
@ -200,7 +212,7 @@ class _NewHomeHealthCarePageState extends State<NewHomeHealthCarePage>
Container( Container(
width: double.infinity, width: double.infinity,
padding: EdgeInsets.only( padding: EdgeInsets.only(
left: 15, bottom: 15, top: 15), left: 15, bottom: 15, top: 15,right: 15),
decoration: BoxDecoration( decoration: BoxDecoration(
border: Border( border: Border(
bottom: BorderSide( bottom: BorderSide(
@ -214,7 +226,7 @@ class _NewHomeHealthCarePageState extends State<NewHomeHealthCarePage>
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Texts( Texts(
"Pickup Date", TranslationBase.of(context).pickupDate,
bold: false, bold: false,
fontSize: 13, fontSize: 13,
), ),
@ -235,7 +247,7 @@ class _NewHomeHealthCarePageState extends State<NewHomeHealthCarePage>
(index) => Container( (index) => Container(
width: double.infinity, width: double.infinity,
padding: EdgeInsets.only( padding: EdgeInsets.only(
left: 15, bottom: 15, top: 15), left: 15, bottom: 15, top: 15,right: 15),
decoration: BoxDecoration( decoration: BoxDecoration(
border: Border( border: Border(
bottom: BorderSide( bottom: BorderSide(
@ -250,7 +262,9 @@ class _NewHomeHealthCarePageState extends State<NewHomeHealthCarePage>
CrossAxisAlignment.start, CrossAxisAlignment.start,
children: [ children: [
Texts( Texts(
"Service Name", TranslationBase
.of(context)
.serviceName,
bold: false, bold: false,
fontSize: 13, fontSize: 13,
), ),
@ -258,7 +272,12 @@ class _NewHomeHealthCarePageState extends State<NewHomeHealthCarePage>
height: 4, height: 4,
), ),
Texts( Texts(
widget.model.hhcAllOrderDetail[index] projectViewModel.isArabic
? widget.model
.hhcAllOrderDetail[index]
.descriptionN
: widget.model
.hhcAllOrderDetail[index]
.description, .description,
fontSize: 22, fontSize: 22,
bold: true, bold: true,
@ -275,7 +294,7 @@ class _NewHomeHealthCarePageState extends State<NewHomeHealthCarePage>
width: width:
MediaQuery.of(context).size.width * 0.85, MediaQuery.of(context).size.width * 0.85,
child: SecondaryButton( child: SecondaryButton(
label: "Cancel".toUpperCase(), label: TranslationBase.of(context).cancel.toUpperCase(),
onTap: () { onTap: () {
showConfirmMessage(widget.model, showConfirmMessage(widget.model,
widget.model.hhcAllOrderDetail[0]); widget.model.hhcAllOrderDetail[0]);

@ -42,6 +42,7 @@ class _HomeHealthCarePageState extends State<HomeHealthCarePage>
}, },
builder: (_, model, widget) => AppScaffold( builder: (_, model, widget) => AppScaffold(
isShowAppBar: true, isShowAppBar: true,
description: TranslationBase.of(context).HHCNotAuthMsg,
appBarTitle: TranslationBase.of(context).homeHealthCare, appBarTitle: TranslationBase.of(context).homeHealthCare,
body: Scaffold( body: Scaffold(
extendBodyBehindAppBar: true, extendBodyBehindAppBar: true,
@ -80,7 +81,7 @@ class _HomeHealthCarePageState extends State<HomeHealthCarePage>
isScrollable: true, isScrollable: true,
controller: _tabController, controller: _tabController,
indicatorWeight: 5.0, indicatorWeight: 5.0,
indicatorSize: TabBarIndicatorSize.label, indicatorSize: TabBarIndicatorSize.tab,
indicatorColor: Colors.red[800], indicatorColor: Colors.red[800],
labelColor: Theme.of(context).primaryColor, labelColor: Theme.of(context).primaryColor,
labelPadding: labelPadding:

@ -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/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/model/AlHabibMedicalService/HomeHealthCare/update_pres_oreder_request_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/home_health_care_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/home_health_care_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.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/uitl/utils.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'Dialog/confirm_cancel_order_dialog.dart'; import 'Dialog/confirm_cancel_order_dialog.dart';
@ -19,6 +22,8 @@ class OrdersLogDetailsPage extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
void showConfirmMessage( void showConfirmMessage(
HomeHealthCareViewModel model, GetHHCAllPresOrdersResponseModel order) { HomeHealthCareViewModel model, GetHHCAllPresOrdersResponseModel order) {
showDialog( showDialog(
@ -29,212 +34,219 @@ class OrdersLogDetailsPage extends StatelessWidget {
UpdatePresOrderRequestModel updatePresOrderRequestModel = UpdatePresOrderRequestModel updatePresOrderRequestModel =
UpdatePresOrderRequestModel( UpdatePresOrderRequestModel(
presOrderID: order.iD, presOrderID: order.iD,
rejectionReason: "", rejectionReason: "",
presOrderStatus: 4, editedBy: 3); presOrderStatus: 4, editedBy: 3);
await model.updateHHCPresOrder(updatePresOrderRequestModel); await model.updateHHCPresOrder(updatePresOrderRequestModel);
if(model.state == ViewState.ErrorLocal) { if(model.state == ViewState.ErrorLocal) {
Utils.showErrorToast(model.error); Utils.showErrorToast(model.error);
} else { } else {
AppToast.showSuccessToast(message: "Done Successfully"); AppToast.showSuccessToast(message:TranslationBase.of(context).processDoneSuccessfully );
await model.getHHCAllPresOrders(); await model.getHHCAllPresOrders();
// await model.getHHCAllServices(); // await model.getHHCAllServices();
} }
}, },
)); ));
} }
return AppScaffold( return AppScaffold(
isShowAppBar: false, isShowAppBar: false,
baseViewModel: model, baseViewModel: model,
body: SingleChildScrollView( body: SingleChildScrollView(
physics: ScrollPhysics(), physics: ScrollPhysics(),
child: Container( child: Container(
margin: EdgeInsets.all(12), margin: EdgeInsets.all(12),
child: Center( child: Center(
child: FractionallySizedBox( child: FractionallySizedBox(
widthFactor: 0.94, widthFactor: 0.94,
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
SizedBox( SizedBox(
height: 50, height: 50,
), ),
Column( Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: model.hhcAllPresOrders.map((order) { children: model.hhcAllPresOrders.map((order) {
return Container( return Container(
width: double.infinity, width: double.infinity,
margin: EdgeInsets.only(top: 15), margin: EdgeInsets.only(top: 15),
decoration: BoxDecoration( decoration: BoxDecoration(
border: border:
Border.all(color: Colors.grey, width: 1), Border.all(color: Colors.grey, width: 1),
borderRadius: BorderRadius.circular(12), borderRadius: BorderRadius.circular(12),
color: Colors.white), color: Colors.white),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
SizedBox( SizedBox(
height: 12, height: 12,
), ),
Container( Container(
width: double.infinity, width: double.infinity,
padding: EdgeInsets.only( padding: EdgeInsets.only(
left: 15, bottom: 15, top: 15), left: 15, bottom: 15, top: 15, right: 15),
decoration: BoxDecoration( decoration: BoxDecoration(
border: Border( border: Border(
bottom: BorderSide( bottom: BorderSide(
color: Colors.grey, color: Colors.grey,
width: 1.0, width: 1.0,
),
),
// borderRadius: BorderRadius.circular(12),
color: Colors.white),
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Texts(
"Request ID",
bold: false,
fontSize: 13,
),
SizedBox(
height: 4,
),
Texts(
order.iD.toString(),
fontSize: 22,
), ),
], ),
), // borderRadius: BorderRadius.circular(12),
color: Colors.white),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Texts(
TranslationBase
.of(context)
.requestID,
bold: false,
fontSize: 13,
),
SizedBox(
height: 4,
),
Texts(
order.iD.toString(),
fontSize: 22,
),
],
), ),
Container( ),
width: double.infinity, Container(
padding: EdgeInsets.only( width: double.infinity,
left: 15, bottom: 15, top: 15), padding: EdgeInsets.only(
decoration: BoxDecoration( left: 15, bottom: 15, top: 15, right: 15),
border: Border( decoration: BoxDecoration(
bottom: BorderSide( border: Border(
color: Colors.grey, bottom: BorderSide(
width: 1.0, color: Colors.grey,
), width: 1.0,
),
// borderRadius: BorderRadius.circular(12),
color: Colors.white),
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Texts(
"Status",
bold: false,
fontSize: 13,
),
SizedBox(
height: 4,
),
Texts(
order.description,
fontSize: 22,
), ),
], ),
), // borderRadius: BorderRadius.circular(12),
color: Colors.white),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Texts(
TranslationBase
.of(context)
.OrderStatus,
bold: false,
fontSize: 13,
),
SizedBox(
height: 4,
),
Texts(
projectViewModel.isArabic ? order.descriptionN : order.description,
fontSize: 22,
),
],
), ),
Container( ),
width: double.infinity, Container(
padding: EdgeInsets.only( width: double.infinity,
left: 15, bottom: 15, top: 15), padding: EdgeInsets.only(
decoration: BoxDecoration( left: 15, bottom: 15, top: 15, right: 15),
border: Border( decoration: BoxDecoration(
bottom: BorderSide( border: Border(
color: Colors.grey, bottom: BorderSide(
width: 1.0, color: Colors.grey,
), width: 1.0,
),
// borderRadius: BorderRadius.circular(12),
color: Colors.white),
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Texts(
"Pickup Date",
bold: false,
fontSize: 13,
),
SizedBox(
height: 4,
),
Texts(
DateUtil.getDayMonthYearDateFormatted(
DateUtil.convertStringToDate(
order.createdOn)),
fontSize: 22,
), ),
], ),
), // borderRadius: BorderRadius.circular(12),
color: Colors.white),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Texts(
TranslationBase
.of(context)
.pickupDate,
bold: false,
fontSize: 13,
),
SizedBox(
height: 4,
),
Texts(
DateUtil.getDayMonthYearDateFormatted(
DateUtil.convertStringToDate(order.createdOn)),
fontSize: 22,
),
],
), ),
Container( ),
width: double.infinity,
padding: EdgeInsets.only( SizedBox(
left: 15, bottom: 15, top: 15), height: 12,
decoration: BoxDecoration( ),
border: Border( Container(
bottom: BorderSide( width: double.infinity,
color: Colors.grey, padding: EdgeInsets.only(
width: 1.0, left: 15, bottom: 15, top: 15, right: 15),
), decoration: BoxDecoration(
), border: Border(
// borderRadius: BorderRadius.circular(12), bottom: BorderSide(
color: Colors.white), color: Colors.grey,
child: Column( width: 1.0,
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Texts(
"Location",
bold: false,
fontSize: 13,
),
SizedBox(
height: 4,
),
Texts(
order.nearestProjectDescription
.toString() ??
order.nearestProjectDescriptionN
.toString(),
fontSize: 22,
), ),
],
),
),
SizedBox(
height: 12,
),
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),
), ),
// borderRadius: BorderRadius.circular(12),
color: Colors.white),
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Texts(
TranslationBase.of(context).orderLocation,
bold: false,
fontSize: 13,
),
SizedBox(
height: 4,
),
Texts(
!projectViewModel.isArabic ?order.nearestProjectDescription
.toString() :
order.nearestProjectDescriptionN
.toString(),
fontSize: 22,
),
],
),
),
SizedBox(
height: 12,
),
if (order.status == 1 ||order.status == 2 )
Center(
child: Container(
width: MediaQuery
.of(context)
.size
.width *
0.85,
child: SecondaryButton(
label: "Cancel".toUpperCase(),
onTap: () {
showConfirmMessage(model, order);
}
,
color: Colors.red[800],
disabled: false,
textColor: Theme
.of(context)
.backgroundColor),
), ),
SizedBox( ),
height: 12, SizedBox(
height: 12,
), ),
], ],
), ),

@ -203,7 +203,7 @@ class _AllHabibMedicalServiceState extends State<AllHabibMedicalService> {
), ),
imageLocation: imageLocation:
'assets/images/al-habib_online_payment_service_icon.png', 'assets/images/al-habib_online_payment_service_icon.png',
title: 'Covid-19- Drive-Thru Test', title: TranslationBase.of(context).covid19_driveThrueTest,
), ),
ServicesContainer( ServicesContainer(
onTap: () { onTap: () {
@ -227,7 +227,7 @@ class _AllHabibMedicalServiceState extends State<AllHabibMedicalService> {
), ),
), ),
imageLocation: 'assets/images/pharmacy_logo.png', imageLocation: 'assets/images/pharmacy_logo.png',
title: 'Pharmacy'), title: TranslationBase.of(context).pharmacy),
ServicesContainer( ServicesContainer(
onTap: () => Navigator.push( onTap: () => Navigator.push(
context, context,
@ -248,7 +248,7 @@ class _AllHabibMedicalServiceState extends State<AllHabibMedicalService> {
: EReferralPage()), : EReferralPage()),
), ),
imageLocation: 'assets/images/ereferral_service_icon.png', imageLocation: 'assets/images/ereferral_service_icon.png',
title: 'E-Referral', title: TranslationBase.of(context).ereferral,
), ),
ServicesContainer( ServicesContainer(
onTap: () => Navigator.push( onTap: () => Navigator.push(
@ -259,7 +259,7 @@ class _AllHabibMedicalServiceState extends State<AllHabibMedicalService> {
), ),
imageLocation: imageLocation:
'assets/images/new-design/family_menu_icon_red.png', 'assets/images/new-design/family_menu_icon_red.png',
title: 'My Family', title: TranslationBase.of(context).myFamily,
), ),
if(projectViewModel.havePrivilege(35)) if(projectViewModel.havePrivilege(35))
ServicesContainer( ServicesContainer(
@ -269,7 +269,7 @@ class _AllHabibMedicalServiceState extends State<AllHabibMedicalService> {
), ),
imageLocation: imageLocation:
'assets/images/new-design/children_vaccines_icon.png', 'assets/images/new-design/children_vaccines_icon.png',
title: 'Child Vaccines', title: TranslationBase.of(context).childVaccine,
), ),
ServicesContainer( ServicesContainer(
onTap: () => Navigator.push( onTap: () => Navigator.push(
@ -289,7 +289,7 @@ class _AllHabibMedicalServiceState extends State<AllHabibMedicalService> {
FadePage(page: SymptomInfo()), FadePage(page: SymptomInfo()),
), ),
imageLocation: 'assets/images/new-design/body_icon.png', imageLocation: 'assets/images/new-design/body_icon.png',
title: 'Symptom Checker'), title: TranslationBase.of(context).symptomCheckerTitle),
if(projectViewModel.havePrivilege(36)) if(projectViewModel.havePrivilege(36))
ServicesContainer( ServicesContainer(
onTap: () => Navigator.push( onTap: () => Navigator.push(
@ -297,7 +297,7 @@ class _AllHabibMedicalServiceState extends State<AllHabibMedicalService> {
FadePage(page: BloodDonationPage()), FadePage(page: BloodDonationPage()),
), ),
imageLocation: 'assets/images/new-design/blood_icon.png', imageLocation: 'assets/images/new-design/blood_icon.png',
title: 'Blood Donation', title: TranslationBase.of(context).bloodD,
), ),
ServicesContainer( ServicesContainer(
onTap: () => Navigator.push( onTap: () => Navigator.push(
@ -308,7 +308,7 @@ class _AllHabibMedicalServiceState extends State<AllHabibMedicalService> {
), ),
imageLocation: imageLocation:
'assets/images/new-design/health_calculator_icon.png', 'assets/images/new-design/health_calculator_icon.png',
title: 'Health Calculators', title: TranslationBase.of(context).calculators,
), ),
ServicesContainer( ServicesContainer(
onTap: () => Navigator.push( onTap: () => Navigator.push(
@ -319,7 +319,7 @@ class _AllHabibMedicalServiceState extends State<AllHabibMedicalService> {
), ),
imageLocation: imageLocation:
'assets/images/new-design/health_convertor_icon.png', 'assets/images/new-design/health_convertor_icon.png',
title: 'Health Converter', title: TranslationBase.of(context).converters,
), ),
if(projectViewModel.havePrivilege(38)) if(projectViewModel.havePrivilege(38))
ServicesContainer( ServicesContainer(
@ -370,7 +370,7 @@ class _AllHabibMedicalServiceState extends State<AllHabibMedicalService> {
}, },
imageLocation: imageLocation:
'assets/images/new-design/twitter_dashboard_icon.png', 'assets/images/new-design/twitter_dashboard_icon.png',
title: 'Latest News', title: TranslationBase.of(context).latestNews,
), ),
ServicesContainer( ServicesContainer(
onTap: () => Navigator.push( onTap: () => Navigator.push(

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

@ -11,6 +11,7 @@ import 'package:diplomaticquarterapp/pages/ChildVaccines/child_page.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/pages/medical/active_medications/DayCheckBoxDialog.dart'; import 'package:diplomaticquarterapp/pages/medical/active_medications/DayCheckBoxDialog.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
@ -84,10 +85,12 @@ class _AddNewChildPageState extends State<AddNewChildPage> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
var size = MediaQuery.of(context).size;
return BaseView<AddNewChildViewModel>( return BaseView<AddNewChildViewModel>(
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
isShowAppBar: true, isShowAppBar: true,
appBarTitle: "Vaccintion", appBarTitle: TranslationBase.of(context).vaccination,
body: SingleChildScrollView( body: SingleChildScrollView(
physics: ScrollPhysics(), physics: ScrollPhysics(),
child: Container( child: Container(
@ -96,10 +99,10 @@ class _AddNewChildPageState extends State<AddNewChildPage> {
// crossAxisAlignment: CrossAxisAlignment.center, // crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
SizedBox( SizedBox(
height: 50, height: 20,
), ),
Texts( Texts(
"Add the child's information below to recieve the schedule of vaccinations.", TranslationBase.of(context).vaccinationAddChildMsg,
//+model.user.firstName, //+model.user.firstName,
textAlign: TextAlign.center, textAlign: TextAlign.center,
), ),
@ -107,14 +110,14 @@ class _AddNewChildPageState extends State<AddNewChildPage> {
height: 12, height: 12,
), ),
NewTextFields( NewTextFields(
hintText: "First Name", hintText: TranslationBase.of(context).firstName,
controller: _firstTextController, controller: _firstTextController,
), ),
SizedBox( SizedBox(
height: 12, height: 12,
), ),
NewTextFields( NewTextFields(
hintText: "Second Name", hintText: TranslationBase.of(context).middleName,
controller: _secondTextController, controller: _secondTextController,
), ),
SizedBox( SizedBox(
@ -124,62 +127,57 @@ class _AddNewChildPageState extends State<AddNewChildPage> {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Text( Text(
"Gender:", TranslationBase.of(context).gender,
textAlign: TextAlign.end, textAlign: TextAlign.end,
), ),
], ],
), ),
Container( Container(
height: MediaQuery.of(context).size.height * 0.12,
width: double.infinity, width: double.infinity,
height: size.height * 0.12,
padding: EdgeInsets.all(12), padding: EdgeInsets.all(12),
child: Row( child: Row(
crossAxisAlignment: CrossAxisAlignment.stretch, crossAxisAlignment: CrossAxisAlignment.stretch,
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
Container( Expanded(
height: MediaQuery.of(context).size.height * 0.12, child: Container(
width: 175, color: Colors.white,
color: Colors.white, child: SecondaryButton(
child: SecondaryButton( textColor:
textColor: checkedValue == 1 ? Colors.white : Colors.black,
checkedValue == 1 ? Colors.white : Colors.black, color: checkedValue == 1 ? Colors.red : Colors.white,
color: checkedValue == 1 ? Colors.red : Colors.white, label: TranslationBase.of(context).male,
onTap: () {
label: "Male", setState(() {
// checkedValue = 1;
onTap: () { print("checkedValue=" + checkedValue.toString());
});
setState(() { // bloodDetails.
checkedValue = 1; },
print("checkedValue=" + checkedValue.toString()); ),
});
// bloodDetails.
},
), ),
), ),
Container( Expanded(
height: MediaQuery.of(context).size.height * 0.12, child: Container(
width: 175, color: Colors.white,
color: Colors.white, child: SecondaryButton(
child: SecondaryButton( textColor:
textColor: checkedValue == 2 ? Colors.white : Colors.black,
checkedValue == 2 ? Colors.white : Colors.black, color: checkedValue == 2 ? Colors.red : Colors.white,
color: checkedValue == 2 ? Colors.red : Colors.white, label: TranslationBase.of(context).female,
label: "Female", //
// onTap: () {
onTap: () { setState(() {
setState(() { checkedValue = 2;
checkedValue = 2; print("checkedValue=" + checkedValue.toString());
print("checkedValue=" + checkedValue.toString()); });
}); // bloodDetails.city=_selectedHospital.toString();
// bloodDetails.city=_selectedHospital.toString();
// bloodDetails. // bloodDetails.
}, },
),
), ),
) )
], ],
@ -193,7 +191,7 @@ class _AddNewChildPageState extends State<AddNewChildPage> {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Text( Text(
"Date Of Birth::", TranslationBase.of(context).dob,
textAlign: TextAlign.end, textAlign: TextAlign.end,
), ),
], ],
@ -249,29 +247,29 @@ class _AddNewChildPageState extends State<AddNewChildPage> {
color: checkedValue == false color: checkedValue == false
? Colors.white24 ? Colors.white24
: Color.fromRGBO( : Color.fromRGBO(
63, 63,
72, 72,
74, 74,
1, 1,
), ),
label: "Add", label: TranslationBase.of(context).add,
// //
onTap: () async{ onTap: () async {
newChild.babyName = _firstTextController.text + " " + _secondTextController.text; newChild.babyName = _firstTextController.text +
" " +
_secondTextController.text;
newChild.gender = checkedValue.toString(); newChild.gender = checkedValue.toString();
newChild.strDOB = getStartDay(); newChild.strDOB = getStartDay();
newChild.tempValue = true; newChild.tempValue = true;
newChild.isLogin = true; newChild.isLogin = true;
await model.createNewBabyOrders(newChild: newChild); await model.createNewBabyOrders(newChild: newChild);
if(model.isAdded){ if (model.isAdded) {
AppToast.showSuccessToast(message: "Record Added"); AppToast.showSuccessToast(message: TranslationBase.of(context).childAddedSuccessfully);
Navigator.pop(context,model.isAdded); Navigator.pop(context, model.isAdded);
}else{ } else {
//TODO handling error //TODO handling error
} }
}, },
), ),
), ),
@ -280,7 +278,7 @@ class _AddNewChildPageState extends State<AddNewChildPage> {
), ),
), ),
), ),
// bottomSheet: // bottomSheet:
), ),
); );
} }

@ -5,6 +5,7 @@ import 'package:diplomaticquarterapp/pages/ChildVaccines/add_newchild_page.dart'
import 'package:diplomaticquarterapp/pages/ChildVaccines/vaccinationtable_page.dart'; import 'package:diplomaticquarterapp/pages/ChildVaccines/vaccinationtable_page.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
@ -22,30 +23,51 @@ class ChildPage extends StatefulWidget {
class _ChildPageState extends State<ChildPage> class _ChildPageState extends State<ChildPage>
with SingleTickerProviderStateMixin { with SingleTickerProviderStateMixin {
DeleteBaby deleteBaby = DeleteBaby(); DeleteBaby deleteBaby = DeleteBaby();
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
var size = MediaQuery.of(context).size;
final double height = (size.height - kToolbarHeight - 60);
final double itemWidth = size.width / 2;
final double itemHeight = height / 2 + 40;
var checkedValue = true; var checkedValue = true;
return BaseView<ChildVaccinesViewModel>( return BaseView<ChildVaccinesViewModel>(
onModelReady: (model) => model.getNewUserOrders(), onModelReady: (model) => model.getNewUserOrders(),
builder: (_, model, widget) => AppScaffold( builder: (_, model, widget) => AppScaffold(
isShowAppBar: true, isShowAppBar: true,
appBarTitle: " Vaccination", appBarTitle: TranslationBase.of(context).vaccination,
baseViewModel: model, baseViewModel: model,
body: SingleChildScrollView( body: Container(
child: Container( height: height * 0.85,
margin: EdgeInsets.only(left: 15, right: 15, top: 70), child: SingleChildScrollView(
child: Column( child: Container(
children: [ margin: EdgeInsets.only(left: 8, right: 8, top: 16),
...List.generate( child: GridView.count(
crossAxisCount: 2,
childAspectRatio: (itemWidth / (itemHeight + 0)),
crossAxisSpacing: 10,
mainAxisSpacing: 10,
controller: ScrollController(keepScrollOffset: true),
shrinkWrap: true,
padding: const EdgeInsets.all(4.0),
children: [
...List.generate(
model.babyInformationModelList.length, model.babyInformationModelList.length,
(index) => Container( (index) => InkWell(
margin: EdgeInsets.only( onTap: () {
left: 0, right: 0, bottom: 20), Navigator.push(
context,
decoration: BoxDecoration( FadePage(
page: VaccinationTablePage(model.babyInformationModelList[index]),
),
);
},
child: Container(
margin: EdgeInsets.only(
left: 0, right: 0, bottom: 20),
decoration: BoxDecoration(
shape: BoxShape.rectangle, shape: BoxShape.rectangle,
border: Border.all( border: Border.all(
color: Colors.white, width: 0.5), color: Colors.white, width: 0.5),
@ -54,11 +76,12 @@ class _ChildPageState extends State<ChildPage>
color: Colors.white, color: Colors.white,
), ),
padding: EdgeInsets.all(12), padding: EdgeInsets.all(12),
width: 200,//double.infinity, //double.infinity,
child: Column( child: Column(
children: [ children: [
Row(children: [ Row(children: [
Texts("CHILD NAME"), Texts(TranslationBase.of(context)
.childName),
]), ]),
Row(children: [ Row(children: [
Texts(model Texts(model
@ -96,19 +119,14 @@ class _ChildPageState extends State<ChildPage>
Navigator.push( Navigator.push(
context, context,
FadePage( FadePage(
page: VaccinationTablePage(model.babyInformationModelList[index]),
page: VaccinationTablePage(),
), ),
); );
}, },
) )
]), ]),
Row(children: [ Row(children: [
Texts("Birthday"), Texts(TranslationBase.of(context).dob),
]), ]),
Row(children: [ Row(children: [
IconButton( IconButton(
@ -116,9 +134,7 @@ class _ChildPageState extends State<ChildPage>
'assets/images/new-design/calender-secondary.png'), 'assets/images/new-design/calender-secondary.png'),
tooltip: '', tooltip: '',
onPressed: () { onPressed: () {
setState(() { setState(() {});
});
}, },
), ),
Texts(DateUtil.yearMonthDay(model Texts(DateUtil.yearMonthDay(model
@ -130,73 +146,71 @@ class _ChildPageState extends State<ChildPage>
icon: new Image.asset( icon: new Image.asset(
'assets/images/new-design/garbage.png'), 'assets/images/new-design/garbage.png'),
tooltip: '', tooltip: '',
onPressed: ()async { onPressed: () async {
//===================== //=====================
await model.deleteBabyOrders(newChild:deleteBaby ); await model.deleteBabyOrders(
newChild: deleteBaby);
deleteBaby.babyID=model.babyInformationModelList[index] deleteBaby.babyID = model
.babyInformationModelList[index]
.babyID; .babyID;
await model.deleteBabyOrders(newChild:deleteBaby ); await model.deleteBabyOrders(
if(model.isDeleted){ newChild: deleteBaby);
AppToast.showSuccessToast(message: "Record Deleted"); if (model.isDeleted) {
Navigator.pop(context,model.isDeleted); AppToast.showSuccessToast(
}else{ message:
TranslationBase.of(context)
//TODO handling error .recordDeleted);
} Navigator.pop(
context, model.isDeleted);
} else {
//TODO handling error
}
}, },
), ),
Texts("Delete"), Texts(TranslationBase.of(context)
.deleteView),
]), ]),
SizedBox( SizedBox(
height: 12, height: 12,
), ),
], ],
), ),
),
), ),
)
],
) ))),
],
))
), ),
bottomSheet: Container( bottomSheet: Container(
height: MediaQuery.of(context).size.height * 0.12, height: height * 0.15,
width: double.infinity, width: double.infinity,
padding: EdgeInsets.all(15), padding: EdgeInsets.all(16),
child: SecondaryButton( child: SecondaryButton(
textColor: Colors.white, textColor: Colors.white,
color: checkedValue == false color: checkedValue == false
? Colors.white24 ? Colors.white24
: Color.fromRGBO( : Color.fromRGBO(
63, 63,
72, 72,
74, 74,
1, 1,
),
label: "ADD NEW CHILD ",
//
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => AddNewChildPage(),
),
).then((value) {
if (value) model.getNewUserOrders();
});
},
),
), ),
label: TranslationBase.of(context).addNewChild,
//
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => AddNewChildPage(),
),
).then((value) {
if (value) model.getNewUserOrders();
});
},
),
),
)); ));
} }
} }

@ -1,10 +1,10 @@
import 'package:diplomaticquarterapp/core/viewModels/child_vaccines/child_vaccines_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/child_vaccines/child_vaccines_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/child_vaccines/user_information_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/child_vaccines/user_information_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/medical/my_balance_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/my_balance_view_model.dart';
import 'package:diplomaticquarterapp/pages/ChildVaccines/child_page.dart'; import 'package:diplomaticquarterapp/pages/ChildVaccines/child_page.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/input/text_field.dart'; import 'package:diplomaticquarterapp/widgets/input/text_field.dart';
@ -13,214 +13,218 @@ import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
class ChildVaccinesPage extends StatefulWidget { class ChildVaccinesPage extends StatefulWidget {
@override @override
_ChildVaccinesPageState createState() => _ChildVaccinesPageState(); _ChildVaccinesPageState createState() => _ChildVaccinesPageState();
} }
class _ChildVaccinesPageState extends State<ChildVaccinesPage> class _ChildVaccinesPageState extends State<ChildVaccinesPage>
with SingleTickerProviderStateMixin{ with SingleTickerProviderStateMixin {
TextEditingController titleController = TextEditingController(); TextEditingController titleController = TextEditingController();
var checkedValue=false; var checkedValue = false;
String addEmail=""; String addEmail = "";
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return BaseView<UserInformationViewModel>( return BaseView<UserInformationViewModel>(
onModelReady: (model) => model.getUserInformationRequestOrders(), onModelReady: (model) => model.getUserInformationRequestOrders(),
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
isShowAppBar: true, isShowAppBar: true,
baseViewModel: model, baseViewModel: model,
appBarTitle: " Vaccination",//TranslationBase.of(context).advancePayment, appBarTitle: TranslationBase.of(context).vaccination,
body: SingleChildScrollView( //TranslationBase.of(context).advancePayment,
physics: ScrollPhysics(), body: SingleChildScrollView(
child: Column( physics: ScrollPhysics(),
crossAxisAlignment: CrossAxisAlignment.start, child: Column(
mainAxisAlignment: MainAxisAlignment.spaceAround, crossAxisAlignment: CrossAxisAlignment.start,
children: [ mainAxisAlignment: MainAxisAlignment.spaceAround,
SizedBox( children: [
height: 20, SizedBox(
), height: 20,
),
Padding( Padding(
padding: const EdgeInsets.all(10.0), padding: const EdgeInsets.all(10.0),
child:Container( child: Container(
child: Texts("Welcome back",fontSize: 20,), child: Texts(
) , TranslationBase.of(context).welcomeBack,
), fontSize: 20,
Divider(color:Colors.black , indent: 10,
endIndent: 10,),
SizedBox(
height: 20,
),
Padding(
padding: const EdgeInsets.all(10.0),
child:Container(
child: Texts("Please ensure that the email address is up-to-date and process to view the schedule",fontSize: 20,),
) ,
), ),
),
Divider(color:Colors.black , indent: 10, ),
endIndent: 10,), Divider(
Padding( color: Colors.black,
padding: const EdgeInsets.all(10.0), indent: 10,
child:Container( endIndent: 10,
),
margin: EdgeInsets.only(left: 10, right: 10, top: 15), SizedBox(
child: TextFields( height: 20,
fillColor: Colors.red, ),
Padding(
hintText: model.user.emailAddress, padding: const EdgeInsets.all(10.0),
controller: titleController, child: Container(
fontSize: 20, child: Texts(
hintColor: Colors.black, TranslationBase.of(context).msg_email_address_up_to_date,
fontWeight: FontWeight.w600, fontSize: 20,
onChanged: (text) {
addEmail=text;
model.user.emailAddress==addEmail?checkedValue=false:checkedValue=true;
},
validator: (value) {
if (value == null)
{
return model.user.emailAddress;
}
else
{
return model.user.emailAddress;}
},
),
),
), ),
Container( ),
height: MediaQuery.of(context).size.height * 0.12, ),
width: double.infinity,
padding: EdgeInsets.all(15),
child: SecondaryButton(
textColor: Colors.white,
color: checkedValue== false ?Colors.white24:Color.fromRGBO(63, 72, 74, 1,),
label: "UPDATE EMAIL",
//
onTap: (){
model.user.emailAddress=addEmail.toString();
AppToast.showSuccessToast(
message: "Email updated");
// bloodDetails.city=_selectedHospital.toString();
// bloodDetails.
},
), Divider(
color: Colors.black,
indent: 10,
endIndent: 10,
),
Padding(
padding: const EdgeInsets.all(10.0),
child: Container(
margin: EdgeInsets.only(left: 10, right: 10, top: 15),
child: TextFields(
fillColor: Colors.red,
hintText: model.user.emailAddress,
controller: titleController,
fontSize: 20,
hintColor: Colors.black,
fontWeight: FontWeight.w600,
onChanged: (text) {
addEmail = text;
model.user.emailAddress == addEmail
? checkedValue = false
: checkedValue = true;
},
validator: (value) {
if (value == null) {
return model.user.emailAddress;
} else {
return model.user.emailAddress;
}
},
), ),
Container( ),
height: MediaQuery.of(context).size.height * 0.12, ),
width: double.infinity, Container(
height: MediaQuery.of(context).size.height * 0.12,
padding: EdgeInsets.all(15), width: double.infinity,
child: SecondaryButton( padding: EdgeInsets.all(15),
textColor: Colors.white, child: SecondaryButton(
color: Color.fromRGBO(63, 72, 74, 1,), textColor: Colors.white,
label: " VIEW LIST OF CHILDREN", color: checkedValue == false
// ? Colors.white24
onTap: () => Navigator.push( : Color.fromRGBO(
context, 63,
FadePage( 72,
page: ChildPage(), 74,
1,
),
), ),
label: TranslationBase.of(context).updateEmail,
//
), onTap: () {
), model.user.emailAddress = addEmail.toString();
AppToast.showSuccessToast(
// Texts( message: TranslationBase.of(context).updateEmailMsg);
// // TranslationBase.of(context).advancePaymentLabel, // bloodDetails.city=_selectedHospital.toString();
// model.user.emailAddress,
// textAlign: TextAlign.center, // bloodDetails.
// ), },
SizedBox( ),
height: 12, ),
), Container(
SizedBox( height: MediaQuery.of(context).size.height * 0.12,
height: 12, width: double.infinity,
), padding: EdgeInsets.all(15),
SizedBox( child: SecondaryButton(
height: 12, textColor: Colors.white,
color: Color.fromRGBO(
63,
72,
74,
1,
), ),
label: TranslationBase.of(context).viewListChildren,
SizedBox( //
height: 12, onTap: () => Navigator.push(
context,
FadePage(
page: ChildPage(),
),
), ),
),
),
SizedBox( // Texts(
height: 12, // // TranslationBase.of(context).advancePaymentLabel,
), // model.user.emailAddress,
// textAlign: TextAlign.center,
// ),
SizedBox(
height: 12,
),
SizedBox(
height: 12,
),
SizedBox(
height: 12,
),
SizedBox( SizedBox(
height: 10, height: 12,
), ),
// Row(
// mainAxisAlignment: MainAxisAlignment.center,
// crossAxisAlignment: CrossAxisAlignment.center,
// children: [
// Center(
// child: Container(
// color: Colors.white,
// width: 350,
// child: InkWell(
// onTap: () {
// showDialog(
// context: context,
// builder: (_) =>
// AssetGiffyDialog(
// title: Text(
// "",
// style: TextStyle(
// fontSize: 22.0,
// fontWeight:
// FontWeight
// .w600),
// ),
// image: Image.asset(
// 'assets/images/BloodChrt_EN.png'),
// buttonCancelText:
// Text('cancel'),
// buttonCancelColor:
// Colors.grey,
// onlyCancelButton: true,
// ));
// },
// child: Container(
// width: 250,
// height: 200,
// child:Image.asset(
// 'assets/images/BloodChrt_EN.png')),
// ),
// ),
// ),
// ],
// ),
SizedBox( SizedBox(
height: MediaQuery.of(context).size.height * 0.15, height: 12,
)
],
), ),
SizedBox(
height: 10,
),
// Row(
// mainAxisAlignment: MainAxisAlignment.center,
// crossAxisAlignment: CrossAxisAlignment.center,
// children: [
// Center(
// child: Container(
// color: Colors.white,
// width: 350,
// child: InkWell(
// onTap: () {
// showDialog(
// context: context,
// builder: (_) =>
// AssetGiffyDialog(
// title: Text(
// "",
// style: TextStyle(
// fontSize: 22.0,
// fontWeight:
// FontWeight
// .w600),
// ),
// image: Image.asset(
// 'assets/images/BloodChrt_EN.png'),
// buttonCancelText:
// Text('cancel'),
// buttonCancelColor:
// Colors.grey,
// onlyCancelButton: true,
// ));
// },
// child: Container(
// width: 250,
// height: 200,
// child:Image.asset(
// 'assets/images/BloodChrt_EN.png')),
// ),
// ),
// ),
// ],
// ),
SizedBox(
height: MediaQuery.of(context).size.height * 0.15,
)
],
), ),
), ),
),
); );
} }
} }

@ -7,8 +7,11 @@ import 'package:flutter/material.dart';
class SelectGenderDialog extends StatefulWidget { class SelectGenderDialog extends StatefulWidget {
final Email; final Email;
final Function okFunction;
const SelectGenderDialog({Key key, this.Email, this.okFunction})
: super(key: key);
const SelectGenderDialog({Key key, this.Email}) : super(key: key);
@override @override
_SelectGenderDialogState createState() => _SelectGenderDialogState(); _SelectGenderDialogState createState() => _SelectGenderDialogState();
} }
@ -33,9 +36,8 @@ class _SelectGenderDialogState extends State<SelectGenderDialog> {
}); });
}, },
child: ListTile( child: ListTile(
title: Text("Send the child's schedule to the email\n Tamer.dasdasdas@gmail.com "), title: Text(
"${TranslationBase.of(context).sendChildEmailMsg}\n Tamer.dasdasdas@gmail.com "),
), ),
), ),
) )
@ -44,7 +46,6 @@ class _SelectGenderDialogState extends State<SelectGenderDialog> {
SizedBox( SizedBox(
height: 5.0, height: 5.0,
), ),
SizedBox( SizedBox(
height: 5.0, height: 5.0,
), ),
@ -82,7 +83,7 @@ class _SelectGenderDialogState extends State<SelectGenderDialog> {
flex: 1, flex: 1,
child: InkWell( child: InkWell(
onTap: () { onTap: () {
AppToast.showSuccessToast(message: "Email Sended"); widget.okFunction();
// widget.onValueSelected(beneficiaryType); // widget.onValueSelected(beneficiaryType);
Navigator.pop(context); Navigator.pop(context);
}, },
@ -105,7 +106,4 @@ class _SelectGenderDialogState extends State<SelectGenderDialog> {
], ],
); );
} }
} }

@ -1,8 +1,13 @@
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/model/childvaccines/List_BabyInformationModel.dart';
import 'package:diplomaticquarterapp/core/viewModels/child_vaccines/vaccination_table_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/child_vaccines/vaccination_table_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/medical/reports_monthly_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/reports_monthly_view_model.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -12,91 +17,161 @@ import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'dialogs/SelectGenderDialog.dart'; import 'dialogs/SelectGenderDialog.dart';
class VaccinationTablePage extends StatelessWidget { class VaccinationTablePage extends StatelessWidget {
final List_BabyInformationModel babyInfo;
VaccinationTablePage(this.babyInfo);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
var size = MediaQuery.of(context).size;
final double height = (size.height - kToolbarHeight - 60);
var checkedValue; var checkedValue;
return BaseView<VaccinationTableViewModel>( return BaseView<VaccinationTableViewModel>(
onModelReady: (model) => model.getCreateVaccinationTable(),//getUserTermsAndConditions(), onModelReady: (model) => model.getCreateVaccinationTable(babyInfo, false),
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
isShowAppBar: true, isShowAppBar: true,
baseViewModel: model, baseViewModel: model,
appBarTitle: "Vaccination", appBarTitle: TranslationBase.of(context).vaccination,
body: SingleChildScrollView( body: Container(
child:Container( height: height * 0.85,
margin: EdgeInsets.only(left: 15,right: 15,top: 70), child: SingleChildScrollView(
child: Column( child: Container(
children: [//babyInformationModelList.length margin: EdgeInsets.only(left: 16, right: 16, top: 16),
...List.generate(model.creteVaccinationTableModelList.length, (index) => child: Column(
Container( children: [
decoration: BoxDecoration( Row(
shape: BoxShape.rectangle, children: [
border: Border.all(color: Colors.white, width: 0.5), Expanded(
borderRadius: BorderRadius.all(Radius.circular(5)), child: Texts(TranslationBase.of(context).childName),
color: Colors.white, ),
Expanded(
), child: Texts(TranslationBase.of(context).dob),
padding: EdgeInsets.all(12), ),
width: double.infinity, ],
child: Column( ),
SizedBox(
children: [ height: 10,
Row(children: [ ),
Text(model.creteVaccinationTableModelList[index].visit), Row(
SizedBox(width: 10,), children: [
Expanded(
Expanded( child: Texts(babyInfo.babyName),
child: Column( ),
mainAxisAlignment: MainAxisAlignment.start, Expanded(
crossAxisAlignment: CrossAxisAlignment.start, child: Texts(DateUtil.getFormattedDate(
children: [ babyInfo.dOB, "MMM dd,yyyy")),
Html( ),
// data:"<html><head><style type='text/css'>.Test {list-style-image:url('http://10.50.100.198:4444/Images/Bullet_List_Small.png');}</style></head><body><table><tr align='left'><td align='left'>BCG</td></tr><tr align='left'><td align='left'>HEPATITIS B</td></tr></table></body></html>"//model.creteVaccinationTableModelList[index].vaccinesDescription ],
data:model.creteVaccinationTableModelList[index].vaccinesDescription, ),
SizedBox(
), height: 10,
],), ),
), Divider(
Text(model.creteVaccinationTableModelList[index].givenAt), color: Colors.black,
),
Row(
],), children: [
Divider(color:Colors.black ,), Text(TranslationBase.of(context).visit),
SizedBox(
], width: 25,
) ),
Expanded(
child: Text(TranslationBase.of(context).description)),
) Text(TranslationBase.of(context).dueDate),
],
) ),
], ...List.generate(
model.creteVaccinationTableModelList.length,
(index) => Container(
decoration: BoxDecoration(
shape: BoxShape.rectangle,
// border: Border.all(color: Colors.white, width: 0.5),
borderRadius: BorderRadius.all(Radius.circular(5)),
// color: Colors.white,
),
padding: EdgeInsets.all(12),
width: double.infinity,
child: Column(
children: [
Row(
children: [
Text(model
.creteVaccinationTableModelList[index]
.visit),
SizedBox(
width: 10,
),
Expanded(
child: Column(
mainAxisAlignment:
MainAxisAlignment.start,
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Html(
// data:"<html><head><style type='text/css'>.Test {list-style-image:url('http://10.50.100.198:4444/Images/Bullet_List_Small.png');}</style></head><body><table><tr align='left'><td align='left'>BCG</td></tr><tr align='left'><td align='left'>HEPATITIS B</td></tr></table></body></html>"//model.creteVaccinationTableModelList[index].vaccinesDescription
data: model
.creteVaccinationTableModelList[
index]
.vaccinesDescription,
),
],
),
),
Text(model
.creteVaccinationTableModelList[index]
.givenAt),
],
),
Divider(
color: Colors.black,
),
],
)))
],
),
), ),
),
), ),
),
bottomSheet: Container( bottomSheet: Container(
height: MediaQuery.of(context).size.height * 0.12, height: height * 0.15,
width: double.infinity, width: double.infinity,
padding: EdgeInsets.all(12), padding: EdgeInsets.all(12),
child: SecondaryButton( child: SecondaryButton(
textColor: Colors.white, textColor: Colors.white,
color: checkedValue== false ?Colors.white24:Color.fromRGBO(63, 72, 74, 1,), color: checkedValue == false
label: "Send Email ", ? Colors.white24
// : Color.fromRGBO(
onTap: () { 63,
//SelectGenderDialog(); 72,
74,
1,
),
label: TranslationBase.of(context).sendEmail,
//
onTap: () {
//SelectGenderDialog();
//=============== //===============
showDialog( showDialog(
context: context, context: context,
child: SelectGenderDialog( child: SelectGenderDialog(
), okFunction: () async {
); await model.getCreateVaccinationTable(babyInfo, true);
//========= if (model.state == ViewState.Idle) {
} AppToast.showSuccessToast(
message: TranslationBase.of(context)
.emailSentSuccessfully);
), } else {
AppToast.showErrorToast(
message: TranslationBase.of(context)
.EmailSentError);
}
},
),
);
//=========
}),
), ),
), ),
); );

@ -78,10 +78,7 @@ class _FindUsPageState extends State<FindUsPage>
isScrollable: true, isScrollable: true,
controller: _tabController, controller: _tabController,
indicatorWeight: 5.0, indicatorWeight: 5.0,
//indicatorSize: TabBarIndicatorSize.label,
indicatorSize: TabBarIndicatorSize.tab, indicatorSize: TabBarIndicatorSize.tab,
indicatorColor: Theme.of(context).primaryColor,
labelColor: Theme.of(context).primaryColor, labelColor: Theme.of(context).primaryColor,
labelPadding: labelPadding:
EdgeInsets.only(top: 4.0, left: 35.0, right: 35.0), EdgeInsets.only(top: 4.0, left: 35.0, right: 35.0),

@ -7,6 +7,8 @@ import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import '../../../Constants.dart';
class CardCommonContact extends StatelessWidget { class CardCommonContact extends StatelessWidget {
final image; final image;
final text; final text;
@ -37,7 +39,7 @@ class CardCommonContact extends StatelessWidget {
margin: EdgeInsets.fromLTRB(10.0, 10.0, 10.0, 0.0), margin: EdgeInsets.fromLTRB(10.0, 10.0, 10.0, 0.0),
child: Texts(this.text, child: Texts(this.text,
// overflow: TextOverflow.clip, // overflow: TextOverflow.clip,
color:Theme.of(context).primaryColor, color:secondaryColor,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
fontSize: 20.0), fontSize: 20.0),
), ),

@ -79,7 +79,7 @@ class _AmbulanceReqState extends State<AmbulanceReq>
child: Container( child: Container(
height: 60.0, height: 60.0,
margin: EdgeInsets.only(top: 10.0), margin: EdgeInsets.only(top: 10.0),
width: MediaQuery.of(context).size.width * 0.93, width: MediaQuery.of(context).size.width * 0.90,
decoration: BoxDecoration( decoration: BoxDecoration(
border: Border( border: Border(
bottom: BorderSide( bottom: BorderSide(
@ -93,7 +93,6 @@ class _AmbulanceReqState extends State<AmbulanceReq>
controller: _tabController, controller: _tabController,
indicatorWeight: 5.0, indicatorWeight: 5.0,
indicatorSize: TabBarIndicatorSize.label, indicatorSize: TabBarIndicatorSize.label,
indicatorColor: Colors.red[800],
labelColor: Theme.of(context).primaryColor, labelColor: Theme.of(context).primaryColor,
labelPadding: labelPadding:
EdgeInsets.only(top: 4.0, left: 18.0, right: 18.0), EdgeInsets.only(top: 4.0, left: 18.0, right: 18.0),

@ -46,7 +46,7 @@ class _AmbulanceRequestIndexPageState extends State<AmbulanceRequestIndexPage> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return AppScaffold( return AppScaffold(
body: widget.amRequestViewModel.pickUpRequestPresOrder != null body: false
? Column( ? Column(
children: [ children: [
SizedBox( SizedBox(
@ -62,18 +62,18 @@ class _AmbulanceRequestIndexPageState extends State<AmbulanceRequestIndexPage> {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
OrderLogItem( OrderLogItem(
title: 'Request ID', title: TranslationBase.of(context).reqId,
value: widget.amRequestViewModel.pickUpRequestPresOrder value: widget.amRequestViewModel.pickUpRequestPresOrder
.presOrderID .presOrderID
.toString(), .toString(),
), ),
OrderLogItem( OrderLogItem(
title: 'Status', title: TranslationBase.of(context).status,
value: widget.amRequestViewModel.pickUpRequestPresOrder value: widget.amRequestViewModel.pickUpRequestPresOrder
.ambulateDescription, .ambulateDescription,
), ),
OrderLogItem( OrderLogItem(
title: 'Last edit time', title: TranslationBase.of(context).pickupDate,
value: DateUtil.getDayMonthYearDateFormatted( value: DateUtil.getDayMonthYearDateFormatted(
DateUtil.convertStringToDate(widget DateUtil.convertStringToDate(widget
.amRequestViewModel .amRequestViewModel
@ -81,17 +81,17 @@ class _AmbulanceRequestIndexPageState extends State<AmbulanceRequestIndexPage> {
.lastEditDate)), .lastEditDate)),
), ),
OrderLogItem( OrderLogItem(
title: 'Pickup Location', title: TranslationBase.of(context).pickupLocation,
value: widget.amRequestViewModel.pickUpRequestPresOrder value: widget.amRequestViewModel.pickUpRequestPresOrder
.pickupLocationName, .pickupLocationName,
), ),
OrderLogItem( OrderLogItem(
title: 'Drop off Location', title: TranslationBase.of(context).dropoffLocation,
value: widget.amRequestViewModel.pickUpRequestPresOrder value: widget.amRequestViewModel.pickUpRequestPresOrder
.dropoffLocationName, .dropoffLocationName,
), ),
OrderLogItem( OrderLogItem(
title: 'Trasfaer way', title: TranslationBase.of(context).transportMethod,
value: widget value: widget
.amRequestViewModel.pickUpRequestPresOrder.title, .amRequestViewModel.pickUpRequestPresOrder.title,
), ),

@ -2,6 +2,7 @@ import 'package:diplomaticquarterapp/core/enum/Ambulate.dart';
import 'package:diplomaticquarterapp/core/model/er/PatientER.dart'; import 'package:diplomaticquarterapp/core/model/er/PatientER.dart';
import 'package:diplomaticquarterapp/core/viewModels/er/am_request_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/er/am_request_view_model.dart';
import 'package:diplomaticquarterapp/pages/Blood/new_text_Field.dart'; import 'package:diplomaticquarterapp/pages/Blood/new_text_Field.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
@ -51,7 +52,7 @@ class _BillAmountState extends State<BillAmount> {
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Texts('Bill Amount '), Texts(TranslationBase.of(context).billAmount),
SizedBox( SizedBox(
height: 10, height: 10,
), ),
@ -73,7 +74,7 @@ class _BillAmountState extends State<BillAmount> {
child: Padding( child: Padding(
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0),
child: Texts( child: Texts(
'Amount before tax: ', TranslationBase.of(context).patientShareB,
textAlign: TextAlign.start, textAlign: TextAlign.start,
color: Colors.black, color: Colors.black,
fontSize: 15, fontSize: 15,
@ -91,7 +92,7 @@ class _BillAmountState extends State<BillAmount> {
child: Padding( child: Padding(
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0),
child: Texts( child: Texts(
'SR ${widget.patientER.patientERTransportationMethod.price}', TranslationBase.of(context).sar+' ${widget.patientER.patientERTransportationMethod.price}',
color: Colors.black, color: Colors.black,
textAlign: TextAlign.start, textAlign: TextAlign.start,
fontSize: 15, fontSize: 15,
@ -108,7 +109,7 @@ class _BillAmountState extends State<BillAmount> {
child: Padding( child: Padding(
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0),
child: Texts( child: Texts(
'Tax amount :', TranslationBase.of(context).patientShareTax,
color: Colors.black, color: Colors.black,
fontSize: 15, fontSize: 15,
textAlign: TextAlign.start, textAlign: TextAlign.start,
@ -121,7 +122,7 @@ class _BillAmountState extends State<BillAmount> {
child: Padding( child: Padding(
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0),
child: Texts( child: Texts(
'SR ${widget.patientER.patientERTransportationMethod.vAT}', TranslationBase.of(context).sar+' ${widget.patientER.patientERTransportationMethod.vAT}',
color: Colors.black, color: Colors.black,
fontSize: 15, fontSize: 15,
textAlign: TextAlign.start, textAlign: TextAlign.start,
@ -143,7 +144,7 @@ class _BillAmountState extends State<BillAmount> {
child: Padding( child: Padding(
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0),
child: Texts( child: Texts(
'Total amount payable', TranslationBase.of(context).patientShareTotal,
color: Colors.black, color: Colors.black,
fontSize: 15, fontSize: 15,
textAlign: TextAlign.start, textAlign: TextAlign.start,
@ -162,7 +163,7 @@ class _BillAmountState extends State<BillAmount> {
child: Padding( child: Padding(
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0),
child: Texts( child: Texts(
'SR ${widget.patientER.patientERTransportationMethod.totalPrice}', TranslationBase.of(context).sar+' ${widget.patientER.patientERTransportationMethod.totalPrice}',
color: Colors.black, color: Colors.black,
fontSize: 15, fontSize: 15,
textAlign: TextAlign.start, textAlign: TextAlign.start,
@ -176,7 +177,7 @@ class _BillAmountState extends State<BillAmount> {
SizedBox( SizedBox(
height: 10, height: 10,
), ),
Texts('Select Ambulate',bold: true,), Texts(TranslationBase.of(context).selectAmbulate,bold: true,),
SizedBox(height: 5,), SizedBox(height: 5,),
Row( Row(
children: [ children: [
@ -196,7 +197,7 @@ class _BillAmountState extends State<BillAmount> {
color: Colors.white, color: Colors.white,
), ),
child: ListTile( child: ListTile(
title: Text('Wheelchair'), title: Text(TranslationBase.of(context).wheelchair),
leading: Radio( leading: Radio(
value: Ambulate.Wheelchair, value: Ambulate.Wheelchair,
groupValue: _ambulate, groupValue: _ambulate,
@ -227,7 +228,7 @@ class _BillAmountState extends State<BillAmount> {
color: Colors.white, color: Colors.white,
), ),
child: ListTile( child: ListTile(
title: Text('Walker'), title: Text(TranslationBase.of(context).walker),
leading: Radio( leading: Radio(
value: Ambulate.Walker, value: Ambulate.Walker,
groupValue: _ambulate, groupValue: _ambulate,
@ -263,7 +264,7 @@ class _BillAmountState extends State<BillAmount> {
color: Colors.white, color: Colors.white,
), ),
child: ListTile( child: ListTile(
title: Text('Stretcher'), title: Text(TranslationBase.of(context).stretcher),
leading: Radio( leading: Radio(
value: Ambulate.Stretcher, value: Ambulate.Stretcher,
groupValue: _ambulate, groupValue: _ambulate,
@ -294,7 +295,7 @@ class _BillAmountState extends State<BillAmount> {
color: Colors.white, color: Colors.white,
), ),
child: ListTile( child: ListTile(
title: Text('None'), title: Text(TranslationBase.of(context).none),
leading: Radio( leading: Radio(
value: Ambulate.None, value: Ambulate.None,
groupValue: _ambulate, groupValue: _ambulate,
@ -313,7 +314,7 @@ class _BillAmountState extends State<BillAmount> {
), ),
SizedBox(height: 12,), SizedBox(height: 12,),
NewTextFields( NewTextFields(
hintText: 'Note', hintText: TranslationBase.of(context).notes,
initialValue: note, initialValue: note,
onChanged: (value){ onChanged: (value){
setState(() { setState(() {
@ -340,7 +341,7 @@ class _BillAmountState extends State<BillAmount> {
widget.changeCurrentTab(3); widget.changeCurrentTab(3);
}); });
}, },
label: 'Next', label: TranslationBase.of(context).next,
), ),
) )
], ],

@ -9,6 +9,7 @@ import 'package:diplomaticquarterapp/pages/landing/home_page.dart';
import 'package:diplomaticquarterapp/uitl/ProgressDialog.dart'; import 'package:diplomaticquarterapp/uitl/ProgressDialog.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/pickupLocation/PickupLocationFromMap.dart'; import 'package:diplomaticquarterapp/widgets/pickupLocation/PickupLocationFromMap.dart';
@ -78,7 +79,7 @@ class _PickupLocationState extends State<PickupLocation> {
Column( Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Texts('Pickup Location'), Texts(TranslationBase.of(context).pickupLocation),
SizedBox( SizedBox(
height: 15, height: 15,
), ),
@ -110,7 +111,7 @@ class _PickupLocationState extends State<PickupLocation> {
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
Texts(getSelectFromMapName()), Texts(getSelectFromMapName(context)),
Icon( Icon(
FontAwesomeIcons.mapMarkerAlt, FontAwesomeIcons.mapMarkerAlt,
size: 24, size: 24,
@ -123,7 +124,7 @@ class _PickupLocationState extends State<PickupLocation> {
SizedBox( SizedBox(
height: 12, height: 12,
), ),
Texts('Pickup Spot'), Texts(TranslationBase.of(context).pickupSpot),
SizedBox( SizedBox(
height: 5, height: 5,
), ),
@ -141,7 +142,7 @@ class _PickupLocationState extends State<PickupLocation> {
color: Colors.white, color: Colors.white,
), ),
child: ListTile( child: ListTile(
title: Texts('Inside Home'), title: Texts(TranslationBase.of(context).insideHome),
leading: Checkbox( leading: Checkbox(
activeColor: Colors.red[800], activeColor: Colors.red[800],
value: _isInsideHome, value: _isInsideHome,
@ -157,7 +158,7 @@ class _PickupLocationState extends State<PickupLocation> {
SizedBox( SizedBox(
height: 12, height: 12,
), ),
Texts('Do you have an appointment ?'), Texts(TranslationBase.of(context).haveAppo),
SizedBox( SizedBox(
height: 5, height: 5,
), ),
@ -182,7 +183,7 @@ class _PickupLocationState extends State<PickupLocation> {
color: Colors.white, color: Colors.white,
), ),
child: ListTile( child: ListTile(
title: Text('Yes'), title: Texts(TranslationBase.of(context).yes),
leading: Radio( leading: Radio(
value: HaveAppointment.YES, value: HaveAppointment.YES,
groupValue: _haveAppointment, groupValue: _haveAppointment,
@ -217,7 +218,7 @@ class _PickupLocationState extends State<PickupLocation> {
color: Colors.white, color: Colors.white,
), ),
child: ListTile( child: ListTile(
title: Text('No'), title: Texts(TranslationBase.of(context).no),
leading: Radio( leading: Radio(
value: HaveAppointment.NO, value: HaveAppointment.NO,
groupValue: _haveAppointment, groupValue: _haveAppointment,
@ -250,7 +251,7 @@ class _PickupLocationState extends State<PickupLocation> {
SizedBox( SizedBox(
height: 12, height: 12,
), ),
Texts('Drop off Location'), Texts(TranslationBase.of(context).dropoffLocation),
SizedBox( SizedBox(
height: 8, height: 8,
), ),
@ -270,7 +271,7 @@ class _PickupLocationState extends State<PickupLocation> {
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
Texts(getHospitalName('Pickup Location')), Texts(getHospitalName(TranslationBase.of(context).pickupLocation)),
Icon( Icon(
Icons.arrow_drop_down, Icons.arrow_drop_down,
size: 24, size: 24,
@ -286,7 +287,7 @@ class _PickupLocationState extends State<PickupLocation> {
Column( Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Texts('Pickup Location'), Texts(TranslationBase.of(context).pickupLocation),
SizedBox( SizedBox(
height: 15, height: 15,
), ),
@ -306,7 +307,7 @@ class _PickupLocationState extends State<PickupLocation> {
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
Texts(getHospitalName('Pickup Location')), Texts(getHospitalName(TranslationBase.of(context).pickupLocation)),
Icon( Icon(
Icons.arrow_drop_down, Icons.arrow_drop_down,
size: 24, size: 24,
@ -319,7 +320,7 @@ class _PickupLocationState extends State<PickupLocation> {
SizedBox( SizedBox(
height: 12, height: 12,
), ),
Texts('Drop off Location'), Texts(TranslationBase.of(context).dropoffLocation),
SizedBox( SizedBox(
height: 8, height: 8,
), ),
@ -351,7 +352,7 @@ class _PickupLocationState extends State<PickupLocation> {
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
Texts(getSelectFromMapName()), Texts(getSelectFromMapName(context)),
Icon( Icon(
FontAwesomeIcons.mapMarkerAlt, FontAwesomeIcons.mapMarkerAlt,
size: 24, size: 24,
@ -377,7 +378,7 @@ class _PickupLocationState extends State<PickupLocation> {
onTap: () { onTap: () {
if (_result == null || _selectedHospital == null) if (_result == null || _selectedHospital == null)
AppToast.showErrorToast( AppToast.showErrorToast(
message: 'please select all fields'); message: TranslationBase.of(context).selectAll);
else else
setState(() { setState(() {
widget.patientER.pickupSpot = _isInsideHome ? 1 : 0; widget.patientER.pickupSpot = _isInsideHome ? 1 : 0;
@ -427,7 +428,7 @@ class _PickupLocationState extends State<PickupLocation> {
widget.changeCurrentTab(2); widget.changeCurrentTab(2);
}); });
}, },
label: 'Next', label: TranslationBase.of(context).next,
), ),
) )
], ],
@ -455,8 +456,8 @@ class _PickupLocationState extends State<PickupLocation> {
return _selectedHospital == null ? title : _selectedHospital.name; return _selectedHospital == null ? title : _selectedHospital.name;
} }
String getSelectFromMapName() { String getSelectFromMapName(context) {
return _result != null ? _result.formattedAddress : 'Select From Map'; return _result != null ? _result.formattedAddress : TranslationBase.of(context).selectMap;
} }
getAppointment() { getAppointment() {
@ -494,7 +495,7 @@ class _PickupLocationState extends State<PickupLocation> {
setState(() { setState(() {
_haveAppointment = HaveAppointment.NO; _haveAppointment = HaveAppointment.NO;
}); });
AppToast.showErrorToast(message: 'You don\'t have any appointment'); AppToast.showErrorToast(message: TranslationBase.of(context).noAppointment);
} }
}).catchError((e) { }).catchError((e) {
ProgressDialogUtil.hideProgressDialog(context); ProgressDialogUtil.hideProgressDialog(context);

@ -5,6 +5,7 @@ import 'package:diplomaticquarterapp/core/enum/OrderService.dart';
import 'package:diplomaticquarterapp/core/model/er/PatientER.dart'; import 'package:diplomaticquarterapp/core/model/er/PatientER.dart';
import 'package:diplomaticquarterapp/core/model/er/get_all_transportation_method_list_model.dart'; import 'package:diplomaticquarterapp/core/model/er/get_all_transportation_method_list_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/er/am_request_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/er/am_request_view_model.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
@ -67,7 +68,7 @@ class _SelectTransportationMethodState
SizedBox( SizedBox(
height: 12, height: 12,
), ),
Texts('Select Transportation Method'), Texts(TranslationBase.of(context).transportHeading),
...List.generate( ...List.generate(
widget.amRequestViewModel.amRequestModeList.length, widget.amRequestViewModel.amRequestModeList.length,
(index) => InkWell( (index) => InkWell(
@ -108,7 +109,7 @@ class _SelectTransportationMethodState
Expanded( Expanded(
flex: 1, flex: 1,
child: Texts( child: Texts(
'SR ${widget.amRequestViewModel.amRequestModeList[index].price}'), TranslationBase.of(context).sar+' ${widget.amRequestViewModel.amRequestModeList[index].price}'),
) )
], ],
), ),
@ -118,7 +119,7 @@ class _SelectTransportationMethodState
SizedBox( SizedBox(
height: 12, height: 12,
), ),
Texts('Select Direction'), Texts(TranslationBase.of(context).directionHeading),
SizedBox( SizedBox(
height: 5, height: 5,
), ),
@ -144,7 +145,7 @@ class _SelectTransportationMethodState
color: Colors.white, color: Colors.white,
), ),
child: ListTile( child: ListTile(
title: Text('To Hospital'), title: Text(TranslationBase.of(context).toHospital),
leading: Radio( leading: Radio(
value: Direction.ToHospital, value: Direction.ToHospital,
groupValue: _direction, groupValue: _direction,
@ -175,7 +176,7 @@ class _SelectTransportationMethodState
color: Colors.white, color: Colors.white,
), ),
child: ListTile( child: ListTile(
title: Text('Form Hospital'), title: Text(TranslationBase.of(context).fromHospital),
leading: Radio( leading: Radio(
value: Direction.FromHospital, value: Direction.FromHospital,
groupValue: _direction, groupValue: _direction,
@ -200,7 +201,7 @@ class _SelectTransportationMethodState
SizedBox( SizedBox(
height: 8, height: 8,
), ),
Texts('Select Direction'), Texts(TranslationBase.of(context).directionHeading),
SizedBox( SizedBox(
height: 5, height: 5,
), ),
@ -222,7 +223,7 @@ class _SelectTransportationMethodState
color: Colors.white, color: Colors.white,
), ),
child: ListTile( child: ListTile(
title: Text('One Way'), title: Text(TranslationBase.of(context).oneDirec),
leading: Radio( leading: Radio(
value: Way.OneWay, value: Way.OneWay,
groupValue: _way, groupValue: _way,
@ -253,7 +254,7 @@ class _SelectTransportationMethodState
color: Colors.white, color: Colors.white,
), ),
child: ListTile( child: ListTile(
title: Text('Two Ways'), title: Text(TranslationBase.of(context).twoDirec),
leading: Radio( leading: Radio(
value: Way.TwoWays, value: Way.TwoWays,
groupValue: _way, groupValue: _way,
@ -298,7 +299,7 @@ class _SelectTransportationMethodState
widget.changeCurrentTab(1); widget.changeCurrentTab(1);
}); });
}, },
label: 'Next', label: TranslationBase.of(context).next,
), ),
) )
], ],

@ -1,5 +1,6 @@
import 'package:diplomaticquarterapp/core/model/er/PatientER.dart'; import 'package:diplomaticquarterapp/core/model/er/PatientER.dart';
import 'package:diplomaticquarterapp/core/viewModels/er/am_request_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/er/am_request_view_model.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
@ -27,7 +28,7 @@ class _SummaryState extends State<Summary> {
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Texts('Summary'), Texts(TranslationBase.of(context).RRTSummary),
SizedBox(height: 5,), SizedBox(height: 5,),
Container( Container(
width: double.infinity, width: double.infinity,
@ -39,11 +40,11 @@ class _SummaryState extends State<Summary> {
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Texts('Transportation Method',color: Colors.grey,), Texts(TranslationBase.of(context).transportMethod,color: Colors.grey,),
Texts('${widget.patientER.patientERTransportationMethod.title}',bold: true,), Texts('${widget.patientER.patientERTransportationMethod.title}',bold: true,),
SizedBox(height: 8,), SizedBox(height: 8,),
Texts('Direction',color: Colors.grey,), Texts(TranslationBase.of(context).directions,color: Colors.grey,),
Texts('From Hospital',bold: true,), Texts('From Hospital',bold: true,),
SizedBox(height: 8,), SizedBox(height: 8,),
@ -92,7 +93,7 @@ class _SummaryState extends State<Summary> {
child:SecondaryButton( child:SecondaryButton(
color: Colors.grey[800], color: Colors.grey[800],
textColor: Colors.white, textColor: Colors.white,
label: 'Send', label: TranslationBase.of(context).send,
onTap: () async { onTap: () async {
await widget.amRequestViewModel.insertERPressOrder(patientER: widget.patientER); await widget.amRequestViewModel.insertERPressOrder(patientER: widget.patientER);

@ -20,6 +20,10 @@ class NearestEr extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
var size = MediaQuery.of(context).size;
final double itemHeight = (size.height - kToolbarHeight - 24) / 2;
final double itemWidth = size.width / 2;
return BaseView<NearHospitalViewModel>( return BaseView<NearHospitalViewModel>(
onModelReady: appointmentNo != null && projectID != null onModelReady: appointmentNo != null && projectID != null
? (model) => model.getProjectAvgERWaitingTimeOrders( ? (model) => model.getProjectAvgERWaitingTimeOrders(
@ -27,14 +31,14 @@ class NearestEr extends StatelessWidget {
: (model) => model.getProjectAvgERWaitingTimeOrders(), : (model) => model.getProjectAvgERWaitingTimeOrders(),
builder: (_, mode, widget) => AppScaffold( builder: (_, mode, widget) => AppScaffold(
isShowAppBar: true, isShowAppBar: true,
appBarTitle: 'Nearest ER', appBarTitle: TranslationBase.of(context).NearestEr,
baseViewModel: mode, baseViewModel: mode,
body: mode.ProjectAvgERWaitingTimeModeList.length > 0 body: mode.ProjectAvgERWaitingTimeModeList.length > 0
? Container( ? Container(
child: ListView( child: ListView(
children: <Widget>[ children: <Widget>[
Text( Text(
"\nThis service Displays nearest branch\n among all the branches of All Habib \n medical Group based on your current Location", "${TranslationBase.of(context).NearestErDesc}",
textAlign: TextAlign.center, textAlign: TextAlign.center,
style: TextStyle( style: TextStyle(
fontSize: 18.0, fontSize: 18.0,
@ -42,301 +46,55 @@ class NearestEr extends StatelessWidget {
fontWeight: FontWeight.w900, fontWeight: FontWeight.w900,
color: new Color(0xFF60686b))), color: new Color(0xFF60686b))),
Container( Container(
margin: EdgeInsets.fromLTRB(0.0, 10.0, 0.0, 10.0), margin: EdgeInsets.fromLTRB(2.0, 10.0, 0.0, 10.0),
child: Column( child: GridView.count(
mainAxisAlignment: MainAxisAlignment.center, crossAxisCount: 2,
children: <Widget>[ childAspectRatio: (itemWidth / itemWidth),
Row( crossAxisSpacing: 10,
mainAxisSize: MainAxisSize.min, mainAxisSpacing: 10,
mainAxisAlignment: MainAxisAlignment.center, controller:
children: <Widget>[ new ScrollController(keepScrollOffset: false),
Expanded( shrinkWrap: true,
child: Container( padding: const EdgeInsets.all(4.0),
child: CardPosition( children: List.generate(7, (index) {
text: mode return Container(
.ProjectAvgERWaitingTimeModeList[0] child: CardPosition(
.projectName text: mode
.toString(), .ProjectAvgERWaitingTimeModeList[index]
image: .projectName
'assets/images/new-design/find_us_icon.png', .toString(),
subText: mode image:
.ProjectAvgERWaitingTimeModeList[0] 'assets/images/new-design/find_us_icon.png',
.distanceInKilometers subText: mode
.toString(), .ProjectAvgERWaitingTimeModeList[index]
type: mode .distanceInKilometers
.ProjectAvgERWaitingTimeModeList[0].iD .toString(),
.toString(), type: mode
telephone: mode .ProjectAvgERWaitingTimeModeList[index].iD
.ProjectAvgERWaitingTimeModeList[0] .toString(),
.phoneNumber telephone: mode
.toString(), .ProjectAvgERWaitingTimeModeList[index]
networkImage: mode .phoneNumber
.ProjectAvgERWaitingTimeModeList[0] .toString(),
.projectImageURL networkImage: mode
.toString(), .ProjectAvgERWaitingTimeModeList[index]
latitude: mode .projectImageURL
.ProjectAvgERWaitingTimeModeList[0] .toString(),
.latitude, latitude: mode
longitude: mode .ProjectAvgERWaitingTimeModeList[index]
.ProjectAvgERWaitingTimeModeList[0] .latitude,
.longitude, longitude: mode
projectname: mode .ProjectAvgERWaitingTimeModeList[index]
.ProjectAvgERWaitingTimeModeList[0] .longitude,
.projectName, projectname: mode
), .ProjectAvgERWaitingTimeModeList[index]
), .projectName,
cardSize: itemWidth,
),
Expanded(
child: Container(
child: CardPosition(
text: mode
.ProjectAvgERWaitingTimeModeList[1]
.projectName
.toString(),
image:
'assets/images/new-design/find_us_icon.png',
subText: mode
.ProjectAvgERWaitingTimeModeList[1]
.distanceInKilometers
.toString(),
type: mode
.ProjectAvgERWaitingTimeModeList[1].iD
.toString(),
telephone: mode
.ProjectAvgERWaitingTimeModeList[1]
.phoneNumber
.toString(),
networkImage: mode
.ProjectAvgERWaitingTimeModeList[1]
.projectImageURL
.toString(),
latitude: mode
.ProjectAvgERWaitingTimeModeList[1]
.latitude,
longitude: mode
.ProjectAvgERWaitingTimeModeList[1]
.longitude,
projectname: mode
.ProjectAvgERWaitingTimeModeList[1]
.projectName,
),
),
)
],
),
Row(
mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Expanded(
child: Container(
child: CardPosition(
text: mode
.ProjectAvgERWaitingTimeModeList[2]
.projectName
.toString(),
image:
'assets/images/new-design/find_us_icon.png',
subText: mode
.ProjectAvgERWaitingTimeModeList[2]
.distanceInKilometers
.toString(),
type: mode
.ProjectAvgERWaitingTimeModeList[2].iD
.toString(),
telephone: mode
.ProjectAvgERWaitingTimeModeList[2]
.phoneNumber
.toString(),
networkImage: mode
.ProjectAvgERWaitingTimeModeList[2]
.projectImageURL
.toString(),
latitude: mode
.ProjectAvgERWaitingTimeModeList[2]
.latitude,
longitude: mode
.ProjectAvgERWaitingTimeModeList[2]
.longitude,
projectname: mode
.ProjectAvgERWaitingTimeModeList[2]
.projectName,
),
),
),
Expanded(
child: Container(
child: CardPosition(
text: mode
.ProjectAvgERWaitingTimeModeList[3]
.projectName
.toString(),
image:
'assets/images/new-design/find_us_icon.png',
subText: mode
.ProjectAvgERWaitingTimeModeList[3]
.distanceInKilometers
.toString(),
type: mode
.ProjectAvgERWaitingTimeModeList[3].iD
.toString(),
telephone: mode
.ProjectAvgERWaitingTimeModeList[3]
.phoneNumber
.toString(),
networkImage: mode
.ProjectAvgERWaitingTimeModeList[3]
.projectImageURL
.toString(),
latitude: mode
.ProjectAvgERWaitingTimeModeList[3]
.latitude,
longitude: mode
.ProjectAvgERWaitingTimeModeList[3]
.longitude,
projectname: mode
.ProjectAvgERWaitingTimeModeList[3]
.projectName,
),
),
flex: 0,
)
],
),
Row(
mainAxisSize: MainAxisSize.max,
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Expanded(
child: Container(
child: CardPosition(
text: mode
.ProjectAvgERWaitingTimeModeList[4]
.projectName
.toString(),
image:
'assets/images/new-design/find_us_icon.png',
subText: mode
.ProjectAvgERWaitingTimeModeList[4]
.distanceInKilometers
.toString(),
type: mode
.ProjectAvgERWaitingTimeModeList[4].iD
.toString(),
telephone: mode
.ProjectAvgERWaitingTimeModeList[4]
.phoneNumber
.toString(),
networkImage: mode
.ProjectAvgERWaitingTimeModeList[4]
.projectImageURL
.toString(),
latitude: mode
.ProjectAvgERWaitingTimeModeList[4]
.latitude,
longitude: mode
.ProjectAvgERWaitingTimeModeList[4]
.longitude,
projectname: mode
.ProjectAvgERWaitingTimeModeList[4]
.projectName,
),
),
),
Expanded(
child: Container(
child: CardPosition(
text: mode
.ProjectAvgERWaitingTimeModeList[5]
.projectName
.toString(),
image:
'assets/images/new-design/find_us_icon.png',
subText: mode
.ProjectAvgERWaitingTimeModeList[5]
.distanceInKilometers
.toString(),
type: mode
.ProjectAvgERWaitingTimeModeList[5].iD
.toString(),
telephone: mode
.ProjectAvgERWaitingTimeModeList[5]
.phoneNumber
.toString(),
networkImage: mode
.ProjectAvgERWaitingTimeModeList[5]
.projectImageURL
.toString(),
latitude: mode
.ProjectAvgERWaitingTimeModeList[5]
.latitude,
longitude: mode
.ProjectAvgERWaitingTimeModeList[5]
.longitude,
projectname: mode
.ProjectAvgERWaitingTimeModeList[5]
.projectName,
),
),
)
],
), ),
Row( );
mainAxisSize: MainAxisSize.max, }),
mainAxisAlignment: MainAxisAlignment.center, ),
children: <Widget>[ ),
Expanded(
child: Container(
child: CardPosition(
text: mode
.ProjectAvgERWaitingTimeModeList[6]
.projectName
.toString(),
image:
'assets/images/new-design/find_us_icon.png',
subText: mode
.ProjectAvgERWaitingTimeModeList[6]
.distanceInKilometers
.toString(),
type: mode
.ProjectAvgERWaitingTimeModeList[6].iD
.toString(),
telephone: mode
.ProjectAvgERWaitingTimeModeList[6]
.phoneNumber
.toString(),
networkImage: mode
.ProjectAvgERWaitingTimeModeList[6]
.projectImageURL
.toString(),
latitude: mode
.ProjectAvgERWaitingTimeModeList[6]
.latitude,
longitude: mode
.ProjectAvgERWaitingTimeModeList[6]
.longitude,
projectname: mode
.ProjectAvgERWaitingTimeModeList[6]
.projectName,
),
),
flex: 0,
),
],
),
],
)),
], ],
), ),
) )
@ -347,4 +105,3 @@ class NearestEr extends StatelessWidget {
); );
} }
} }

@ -19,6 +19,8 @@ class CardPosition extends StatelessWidget {
final latitude; final latitude;
final longitude; final longitude;
final projectname; final projectname;
final cardSize;
const CardPosition( const CardPosition(
{ {
@required this.image, @required this.image,
@ -30,6 +32,7 @@ class CardPosition extends StatelessWidget {
@required this.latitude, @required this.latitude,
@required this.longitude, @required this.longitude,
@required this.projectname , @required this.projectname ,
@required this.cardSize ,
}); });
@override @override
@ -40,17 +43,17 @@ class CardPosition extends StatelessWidget {
}, },
child: Container( child: Container(
width:MediaQuery.of(context).size.width * 0.47,//165, // width:MediaQuery.of(context).size.width * 0.47,//165,
margin: EdgeInsets.fromLTRB(7.0, 7.0, 7.0, 7.0), margin: EdgeInsets.fromLTRB(8.0, 8.0, 8.0, 8.0),
decoration: BoxDecoration(boxShadow: [ decoration: BoxDecoration(boxShadow: [
BoxShadow(color: Colors.grey[400], blurRadius: 2.0, spreadRadius: 0.0) BoxShadow(color: Colors.grey[400], blurRadius: 2.0, spreadRadius: 0.0)
], borderRadius: BorderRadius.circular(10), color: Colors.white), ], borderRadius: BorderRadius.circular(10), color: Colors.white),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[ children: <Widget>[
Container( Container(
margin: EdgeInsets.fromLTRB(10.0, 10.0, 10.0, 0.0), height: cardSize * 0.2 - 8,
margin: EdgeInsets.fromLTRB(8.0, 8.0, 8.0, 0.0),
child: Text(this.text, child: Text(this.text,
overflow: TextOverflow.clip, overflow: TextOverflow.clip,
style: TextStyle( style: TextStyle(
@ -59,12 +62,14 @@ class CardPosition extends StatelessWidget {
fontSize: 2 * SizeConfig.textMultiplier)), fontSize: 2 * SizeConfig.textMultiplier)),
), ),
Container( Container(
height: cardSize * 0.5 - 8,
alignment: Alignment.center, alignment: Alignment.center,
margin: EdgeInsets.fromLTRB(0.0, 0.0, 10.0, 8.0), margin: EdgeInsets.fromLTRB(0.0, 0.0, 8.0, 8.0),
child: Image.asset(this.image, width: 60.0, height: 60.0), child: Image.asset(this.image, width: 60.0, height: cardSize * 0.4),
), ),
Container( Container(
margin: EdgeInsets.fromLTRB(10.0, 0.0, 10.0, 0.0), margin: EdgeInsets.fromLTRB(8.0, 0.0, 8.0, 0.0),
height: cardSize * 0.2 - 8,
child: Text(this.subText, child: Text(this.subText,
overflow: TextOverflow.clip, overflow: TextOverflow.clip,
style: TextStyle( style: TextStyle(

@ -73,8 +73,7 @@ class _FeedbackHomePageState extends State<FeedbackHomePage>
isScrollable: true, isScrollable: true,
controller: _tabController, controller: _tabController,
indicatorWeight: 5.0, indicatorWeight: 5.0,
indicatorSize: TabBarIndicatorSize.label, indicatorSize: TabBarIndicatorSize.tab,
indicatorColor: Colors.red[800],
labelColor: Theme.of(context).primaryColor, labelColor: Theme.of(context).primaryColor,
labelPadding: labelPadding:
EdgeInsets.only(top: 4.0, left: 18.0, right: 18.0), EdgeInsets.only(top: 4.0, left: 18.0, right: 18.0),

@ -8,6 +8,7 @@ import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/avatar/large_avatar.dart'; import 'package:diplomaticquarterapp/widgets/avatar/large_avatar.dart';
import 'package:diplomaticquarterapp/widgets/bottom_options/BottomSheet.dart'; import 'package:diplomaticquarterapp/widgets/bottom_options/BottomSheet.dart';
import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; import 'package:diplomaticquarterapp/widgets/buttons/button.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/input/text_field.dart'; import 'package:diplomaticquarterapp/widgets/input/text_field.dart';
import 'package:diplomaticquarterapp/widgets/others/StarRating.dart'; import 'package:diplomaticquarterapp/widgets/others/StarRating.dart';
@ -417,27 +418,26 @@ class _SendFeedbackPageState extends State<SendFeedbackPage> {
), ),
), ),
bottomSheet: Container( bottomSheet: Container(
height: MediaQuery.of(context).size.height * 0.13, height: MediaQuery.of(context).size.height * 0.09,
width: double.infinity, width: double.infinity,
padding: EdgeInsets.all(8.0), padding: EdgeInsets.all(15.0),
child: Center( child: Center(
child: Container( child: Container(
height: MediaQuery.of(context).size.height * 0.1, height: MediaQuery.of(context).size.height * 0.8,
width: MediaQuery.of(context).size.width * 0.8, child: SecondaryButton(
child: Button(
label: TranslationBase.of(context).send, label: TranslationBase.of(context).send,
loading: model.state == ViewState.BusyLocal, disabled: (titleController.text.toString().isEmpty || messageController.text.toString().isEmpty|| messageType == MessageType.NON),
onTap: () { onTap: () {
final form = formKey.currentState; final form = formKey.currentState;
if (form.validate()) if (messageType != MessageType.NON) if (form.validate())
model if (messageType != MessageType.NON){
.sendCOCItem( GifLoaderDialogUtils.showMyDialog(context);
model.sendCOCItem(
title: titleController.text, title: titleController.text,
attachment: images.length > 0 ? images[0] : "", attachment: images.length > 0 ? images[0] : "",
details: messageController.text, details: messageController.text,
cOCTypeName: getCOCName(), cOCTypeName: getCOCName(),
appointHistory:messageType == appointHistory:messageType == MessageType.ComplaintOnAnAppointment
MessageType.ComplaintOnAnAppointment
? appointHistory ? appointHistory
: null) : null)
.then((value) { .then((value) {
@ -448,12 +448,14 @@ class _SendFeedbackPageState extends State<SendFeedbackPage> {
images = []; images = [];
}); });
setMessageType(MessageType.NON); setMessageType(MessageType.NON);
GifLoaderDialogUtils.hideDialog(context);
AppToast.showSuccessToast( AppToast.showSuccessToast(
message: TranslationBase.of(context).yourFeedback); message: TranslationBase.of(context).yourFeedback);
} else { } else {
AppToast.showErrorToast(message: model.error); AppToast.showErrorToast(message: model.error);
GifLoaderDialogUtils.hideDialog(context);
} }
}); });}
else { else {
AppToast.showErrorToast(message: TranslationBase.of(context).selectPart); AppToast.showErrorToast(message: TranslationBase.of(context).selectPart);
} }

@ -1,7 +1,7 @@
import 'package:diplomaticquarterapp/config/size_config.dart'; import 'package:diplomaticquarterapp/config/size_config.dart';
import 'package:diplomaticquarterapp/core/viewModels/dashboard_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/dashboard_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_index_page.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_page.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/HomeHealthCare/home_health_care_index_page.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/HomeHealthCare/home_health_care_index_page.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/all_habib_medical_service_page.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/all_habib_medical_service_page.dart';
import 'package:diplomaticquarterapp/pages/ContactUs/contact_us_page.dart'; import 'package:diplomaticquarterapp/pages/ContactUs/contact_us_page.dart';
@ -73,7 +73,7 @@ class _HomePageState extends State<HomePage> {
children: <Widget>[ children: <Widget>[
Expanded( Expanded(
child: Container( child: Container(
height: 120, height: 125,
padding: EdgeInsets.all(5), padding: EdgeInsets.all(5),
margin: EdgeInsets.all(5), margin: EdgeInsets.all(5),
decoration: BoxDecoration( decoration: BoxDecoration(
@ -87,72 +87,50 @@ class _HomePageState extends State<HomePage> {
borderRadius: BorderRadius.all( borderRadius: BorderRadius.all(
Radius.circular(5))), Radius.circular(5))),
child: Container( child: Container(
margin: EdgeInsets.only(top: 10.0),
child: Column( child: Column(
children: <Widget>[ children: <Widget>[
Text("COVID-19 TEST", Texts(TranslationBase.of(context).covidTest,
style: TextStyle( color: Colors.white,
color: Colors.white, fontWeight: FontWeight.w700,
fontWeight: ),
FontWeight.bold,
fontSize: 18.0)),
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: <Widget>[ children: <Widget>[
Container( Container(
margin: EdgeInsets.only( margin: EdgeInsets.only(
top: 15.0, left: 3.5, right: 3.5), top: 15.0,),
child: SvgPicture.asset( child: SvgPicture.asset(
'assets/images/new-design/covid-19-car.svg', 'assets/images/new-design/covid-19-car.svg',
width: 45.0, width: 45.0,
height: 45.0), height: 45.0),
), ),
Container( Container(
margin: EdgeInsets.only( margin: EdgeInsets.only(top: 5.0),
left: 10.0,
top: 10.0),
child: Column( child: Column(
children: <Widget>[ children: <Widget>[
Text("Drive-Thru", Texts(TranslationBase.of(context).driveThru,
style: TextStyle( fontWeight: FontWeight.w700,
color: Colors color: Colors.white,),
.white,
fontWeight:
FontWeight
.bold,
fontSize:
16.0)),
ButtonTheme( ButtonTheme(
shape: shape: RoundedRectangleBorder(
RoundedRectangleBorder(
borderRadius: borderRadius:
BorderRadius BorderRadius.circular(5.0),),
.circular( minWidth: MediaQuery.of(context).size.width * 0.15,
5.0),
),
minWidth: MediaQuery.of(
context)
.size
.width *
0.15,
height: 25.0, height: 25.0,
child: RaisedButton( child: RaisedButton(
color: Colors color: Colors.red[800],
.red[800], textColor: Colors.white,
textColor: disabledTextColor: Colors.white,
Colors.white, disabledColor: new Color(0xFFbcc2c4),
disabledTextColor:
Colors.white,
disabledColor:
new Color(
0xFFbcc2c4),
onPressed: () { onPressed: () {
navigateToCovidDriveThru(); navigateToCovidDriveThru();
}, },
child: Text( child: Texts(
"BOOK NOW", TranslationBase.of(context).bookNow,
style: TextStyle( fontWeight: FontWeight.w700,
fontSize: color: Colors.white,
12.0)), ),
), ),
), ),
], ],
@ -170,7 +148,7 @@ class _HomePageState extends State<HomePage> {
onTap: () => Navigator.push(context, onTap: () => Navigator.push(context,
FadePage(page: LiveCareHome())), FadePage(page: LiveCareHome())),
child: Container( child: Container(
height: 120, height: 125,
padding: EdgeInsets.all(15), padding: EdgeInsets.all(15),
margin: EdgeInsets.all(5), margin: EdgeInsets.all(5),
decoration: BoxDecoration( decoration: BoxDecoration(
@ -193,7 +171,7 @@ class _HomePageState extends State<HomePage> {
], ],
), ),
), ),
Container(width: double.infinity, height: 80) Container(width: double.infinity, height:projectViewModel.isArabic ?110: 80)
], ],
), ),
Positioned( Positioned(
@ -208,7 +186,7 @@ class _HomePageState extends State<HomePage> {
Orientation.landscape Orientation.landscape
? 0.02 ? 0.02
: 0.03), : 0.03),
child: (!model.isLogin && projectViewModel.user == null) child: (!model.isLogin)
? Container( ? Container(
width: double.infinity, width: double.infinity,
height: 125, height: 125,
@ -229,17 +207,15 @@ class _HomePageState extends State<HomePage> {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
SizedBox( SizedBox(
height: 8, height: 2,
), ),
Texts( Texts(
TranslationBase.of(context).myMedicalFile, TranslationBase.of(context).myMedicalFile,
color: Colors.black87, color: Colors.black87,
bold: true, fontWeight: FontWeight.w700,
fontSize: 23, fontSize: 23,
), ),
SizedBox(
height: 5,
),
Texts( Texts(
TranslationBase.of(context) TranslationBase.of(context)
.myMedicalFileSubTitle, .myMedicalFileSubTitle,
@ -248,14 +224,14 @@ class _HomePageState extends State<HomePage> {
), ),
Align( Align(
alignment: projectViewModel.isArabic alignment: projectViewModel.isArabic
? Alignment.bottomRight ? Alignment.bottomLeft
: Alignment.bottomLeft, : Alignment.bottomRight,
child: InkWell( child: InkWell(
onTap: () { onTap: () {
widget.goToMyProfile(); widget.goToMyProfile();
}, },
child: Container( child: Container(
margin: EdgeInsets.all(2), margin: EdgeInsets.only(left: 15,right: 15),
width: 90, width: 90,
height: 30, height: 30,
decoration: BoxDecoration( decoration: BoxDecoration(
@ -265,13 +241,13 @@ class _HomePageState extends State<HomePage> {
color: Colors.transparent, color: Colors.transparent,
width: 0.5), width: 0.5),
borderRadius: BorderRadius.all( borderRadius: BorderRadius.all(
Radius.circular(9)), Radius.circular(0)),
), ),
child: Center( child: Center(
child: Texts( child: Texts(
TranslationBase.of(context) TranslationBase.of(context).viewMore,
.viewMore,
color: Colors.white, color: Colors.white,
fontWeight: FontWeight.w700,
fontSize: 12, fontSize: 12,
), ),
), ),
@ -284,7 +260,7 @@ class _HomePageState extends State<HomePage> {
) )
: Container( : Container(
width: double.infinity, width: double.infinity,
height: 130, height: projectViewModel.isArabic ? 160:130,
decoration: BoxDecoration( decoration: BoxDecoration(
color: HexColor('#A59E9E'), color: HexColor('#A59E9E'),
shape: BoxShape.rectangle, shape: BoxShape.rectangle,
@ -303,7 +279,7 @@ class _HomePageState extends State<HomePage> {
children: <Widget>[ children: <Widget>[
Row( Row(
children: <Widget>[ children: <Widget>[
if (model.user != null) if (projectViewModel.user != null && model.isLogin)
Expanded( Expanded(
child: Column( child: Column(
crossAxisAlignment: crossAxisAlignment:
@ -368,13 +344,9 @@ class _HomePageState extends State<HomePage> {
], ],
), ),
Row( Row(
//crossAxisAlignment: CrossAxisAlignment.center,
//mainAxisAlignment: MainAxisAlignment.spaceAround,
children: <Widget>[ children: <Widget>[
Expanded( Expanded(
child: Row( child: Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: <Widget>[ children: <Widget>[
Image.asset( Image.asset(
'assets/images/height_icon.png', 'assets/images/height_icon.png',
@ -384,6 +356,7 @@ class _HomePageState extends State<HomePage> {
Texts( Texts(
"${model.heightCm}", "${model.heightCm}",
color: Colors.white, color: Colors.white,
fontSize: 17,
) )
], ],
), ),
@ -393,8 +366,6 @@ class _HomePageState extends State<HomePage> {
), ),
Expanded( Expanded(
child: Row( child: Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: <Widget>[ children: <Widget>[
Image.asset( Image.asset(
'assets/images/weight_icon.png', 'assets/images/weight_icon.png',
@ -404,6 +375,7 @@ class _HomePageState extends State<HomePage> {
Texts( Texts(
'${model.weightKg}', '${model.weightKg}',
color: Colors.white, color: Colors.white,
fontSize: 17
) )
], ],
), ),
@ -467,12 +439,11 @@ class _HomePageState extends State<HomePage> {
height: 3, height: 3,
), ),
Texts( Texts(
TranslationBase.of(context) TranslationBase.of(context).homeHealthCareService,
.homeHealthCareService,
textAlign: TextAlign.center, textAlign: TextAlign.center,
color: Colors.white, color: Colors.white,
bold: true, fontWeight: FontWeight.w700,
fontSize: SizeConfig.textMultiplier * 1.7, fontSize: SizeConfig.textMultiplier * 1.55,
) )
], ],
), ),
@ -503,8 +474,8 @@ class _HomePageState extends State<HomePage> {
TranslationBase.of(context).onlinePharmacy, TranslationBase.of(context).onlinePharmacy,
textAlign: TextAlign.center, textAlign: TextAlign.center,
color: Colors.white, color: Colors.white,
bold: true, fontWeight: FontWeight.w700,
fontSize: SizeConfig.textMultiplier * 1.7, fontSize: SizeConfig.textMultiplier * 1.55,
) )
], ],
), ),
@ -519,7 +490,7 @@ class _HomePageState extends State<HomePage> {
Navigator.push( Navigator.push(
context, context,
FadePage( FadePage(
page: CMCIndexPage(), page: CMCPage(),
), ),
); );
}, },
@ -540,8 +511,8 @@ class _HomePageState extends State<HomePage> {
TranslationBase.of(context).emergencyService, TranslationBase.of(context).emergencyService,
textAlign: TextAlign.center, textAlign: TextAlign.center,
color: Colors.white, color: Colors.white,
bold: true, fontWeight: FontWeight.w700,
fontSize: SizeConfig.textMultiplier * 1.7, fontSize: SizeConfig.textMultiplier * 1.55,
) )
], ],
), ),
@ -811,10 +782,8 @@ class DashboardItem extends StatelessWidget {
onTap: onTap, onTap: onTap,
child: Container( child: Container(
width: width != null ? width : MediaQuery.of(context).size.width * 0.29, width: width != null ? width : MediaQuery.of(context).size.width * 0.29,
height: height != null height: height != null ? height : MediaQuery.of(context).orientation == Orientation.portrait
? height ? MediaQuery.of(context).size.height * 0.17
: MediaQuery.of(context).orientation == Orientation.portrait
? MediaQuery.of(context).size.height * 0.19
: MediaQuery.of(context).size.height * 0.35, : MediaQuery.of(context).size.height * 0.35,
decoration: BoxDecoration( decoration: BoxDecoration(
color: !hasBorder color: !hasBorder

@ -158,12 +158,14 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
}); });
}).checkAndConnectIfNoInternet(); }).checkAndConnectIfNoInternet();
if (Platform.isIOS) { if (Platform.isIOS) {
_firebaseMessaging.requestNotificationPermissions(); _firebaseMessaging.requestNotificationPermissions();
} }
// Flip Permission Checks [Zohaib Kambrani]
requestPermissions().then((results) { requestPermissions().then((results) {
registerGeofences();
if (results[Permission.notification].isGranted) if (results[Permission.notification].isGranted)
_firebaseMessaging.getToken().then((String token) { _firebaseMessaging.getToken().then((String token) {
sharedPref.setString(PUSH_TOKEN, token); sharedPref.setString(PUSH_TOKEN, token);
@ -172,7 +174,6 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
checkUserStatus(token); checkUserStatus(token);
} }
}); });
if (results[Permission.location].isGranted); if (results[Permission.location].isGranted);
if (results[Permission.storage].isGranted); if (results[Permission.storage].isGranted);
if (results[Permission.camera].isGranted); if (results[Permission.camera].isGranted);
@ -376,17 +377,6 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
// themeNotifier.setTheme(defaultTheme); // themeNotifier.setTheme(defaultTheme);
} }
void checkUserStatus(token, {isLoader = true}) async {
if (isLoader)
//GifLoaderDialogUtils.showMyDialog(context);
authService
.selectDeviceImei(token)
.then((SelectDeviceIMEIRES value) => setUserValues(value))
.catchError((err) {
//GifLoaderDialogUtils.hideDialog(context);
});
}
static Future<dynamic> myBackgroundMessageHandler( static Future<dynamic> myBackgroundMessageHandler(
Map<String, dynamic> message) async { Map<String, dynamic> message) async {
Map<String, dynamic> myMap = new Map<String, dynamic>.from(message['data']); Map<String, dynamic> myMap = new Map<String, dynamic>.from(message['data']);
@ -438,7 +428,6 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
}); });
} }
requestPermissions().then((results) {});
} }
login() async { login() async {
@ -620,11 +609,31 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
case 3: case 3:
return TranslationBase.of(context).services; return TranslationBase.of(context).services;
case 4: case 4:
return TranslationBase return TranslationBase.of(context).bookAppo;
.of(context)
.bookAppo;
} }
} }
}
void checkUserStatus(token, {isLoader = true}) async {
if (isLoader)
//GifLoaderDialogUtils.showMyDialog(context);
authService
.selectDeviceImei(token)
.then((SelectDeviceIMEIRES value) => setUserValues(value))
.catchError((err) {
//GifLoaderDialogUtils.hideDialog(context);
});
// if (await sharedPref.getObject(USER_PROFILE) != null) {
// var data = AuthenticatedUser.fromJson(await sharedPref.getObject(USER_PROFILE));
// if (data != null) {
// authService.registeredAuthenticatedUser(data, token, 0, 0).then((res) => {print(res)});
// authService.getDashboard().then((value) => {
// setState(() {
// notificationCount = value['List_PatientDashboard'][0]['UnreadPatientNotificationCount'].toString();
// })
// });
// }
// }
}
}

@ -238,15 +238,13 @@ class _AdvancePaymentPageState extends State<AdvancePaymentPage> {
), ),
), ),
bottomSheet: Container( bottomSheet: Container(
height: MediaQuery.of(context).size.height * 0.13, height: MediaQuery.of(context).size.height * 0.10,
width: double.infinity, width: double.infinity,
padding: EdgeInsets.all(12), padding: EdgeInsets.all(18),
child: SecondaryButton( child: SecondaryButton(
textColor: Colors.white, textColor: Colors.white,
label: TranslationBase.of(context).submit, label: TranslationBase.of(context).submit,
disabled: amount.isEmpty || disabled: amount.isEmpty || _fileTextController.text.isEmpty || _selectedHospital == null,
_fileTextController.text.isEmpty ||
_selectedHospital == null,
onTap: () { onTap: () {
var mobileNum; var mobileNum;
var patientName; var patientName;

@ -3,6 +3,7 @@ import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import '../../../../Constants.dart';
import '../advance_payment_page.dart'; import '../advance_payment_page.dart';
class SelectBeneficiaryDialog extends StatefulWidget { class SelectBeneficiaryDialog extends StatefulWidget {
@ -45,7 +46,7 @@ class _SelectBeneficiaryDialogState extends State<SelectBeneficiaryDialog> {
leading: Radio( leading: Radio(
value: BeneficiaryType.MyAccount, value: BeneficiaryType.MyAccount,
groupValue: beneficiaryType, groupValue: beneficiaryType,
activeColor: Color(0xFF40ACC9), activeColor: secondaryColor,
onChanged: (BeneficiaryType value) { onChanged: (BeneficiaryType value) {
setState(() { setState(() {
beneficiaryType = value; beneficiaryType = value;

@ -4,6 +4,8 @@ import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import '../../../../Constants.dart';
class SelectHospitalDialog extends StatefulWidget { class SelectHospitalDialog extends StatefulWidget {
final List<HospitalsModel> hospitals; final List<HospitalsModel> hospitals;
final Function(HospitalsModel) onValueSelected; final Function(HospitalsModel) onValueSelected;
@ -54,7 +56,7 @@ class _SelectHospitalDialogState extends State<SelectHospitalDialog> {
leading: Radio( leading: Radio(
value: widget.hospitals[index], value: widget.hospitals[index],
groupValue: widget.selectedHospital, groupValue: widget.selectedHospital,
activeColor: Color(0xFF40ACC9), activeColor: secondaryColor,
onChanged: (value) { onChanged: (value) {
setState(() { setState(() {
widget.selectedHospital = value; widget.selectedHospital = value;

@ -4,6 +4,8 @@ import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import '../../../../Constants.dart';
class SelectPatientFamilyDialog extends StatefulWidget { class SelectPatientFamilyDialog extends StatefulWidget {
final List<GetAllSharedRecordsByStatusList> getAllSharedRecordsByStatusList; final List<GetAllSharedRecordsByStatusList> getAllSharedRecordsByStatusList;
final Function(GetAllSharedRecordsByStatusList) onValueSelected; final Function(GetAllSharedRecordsByStatusList) onValueSelected;
@ -53,7 +55,7 @@ class _SelectPatientFamilyDialogState extends State<SelectPatientFamilyDialog> {
leading: Radio( leading: Radio(
value: widget.getAllSharedRecordsByStatusList[index], value: widget.getAllSharedRecordsByStatusList[index],
groupValue: widget.selectedPatientFamily, groupValue: widget.selectedPatientFamily,
activeColor: Colors.red[800], activeColor: secondaryColor,
onChanged: (value) { onChanged: (value) {
setState(() { setState(() {
widget.selectedPatientFamily = value; widget.selectedPatientFamily = value;

@ -6,6 +6,8 @@ import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import '../../../../Constants.dart';
class SelectPatientInfoDialog extends StatefulWidget { class SelectPatientInfoDialog extends StatefulWidget {
final List<PatientInfo> patientInfoList ; final List<PatientInfo> patientInfoList ;
final Function(PatientInfo) onValueSelected; final Function(PatientInfo) onValueSelected;
@ -55,7 +57,7 @@ class _SelectPatientInfoDialogState extends State<SelectPatientInfoDialog> {
leading: Radio( leading: Radio(
value: widget.patientInfoList[index], value: widget.patientInfoList[index],
groupValue: widget.selectedPatientInfo, groupValue: widget.selectedPatientInfo,
activeColor: Colors.red[800], activeColor: secondaryColor,
onChanged: (value) { onChanged: (value) {
setState(() { setState(() {
widget.selectedPatientInfo = value; widget.selectedPatientInfo = value;

@ -74,7 +74,7 @@ class _EyeHomePageState extends State<EyeHomePage>
isScrollable: true, isScrollable: true,
controller: _tabController, controller: _tabController,
indicatorWeight: 5.0, indicatorWeight: 5.0,
indicatorSize: TabBarIndicatorSize.label, indicatorSize: TabBarIndicatorSize.tab,
labelColor: Theme.of(context).primaryColor, labelColor: Theme.of(context).primaryColor,
labelPadding: labelPadding:
EdgeInsets.only(top: 4.0, left: 5.0, right: 5.0), EdgeInsets.only(top: 4.0, left: 5.0, right: 5.0),

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

@ -73,7 +73,7 @@ class _BloodPressureHomePageState extends State<BloodPressureHomePage>
isScrollable: true, isScrollable: true,
controller: _tabController, controller: _tabController,
indicatorWeight: 5.0, indicatorWeight: 5.0,
indicatorSize: TabBarIndicatorSize.label, indicatorSize: TabBarIndicatorSize.tab,
labelColor: Theme.of(context).primaryColor, labelColor: Theme.of(context).primaryColor,
labelPadding: labelPadding:
EdgeInsets.only(top: 4.0, left: 5.0, right: 5.0), EdgeInsets.only(top: 4.0, left: 5.0, right: 5.0),

@ -74,7 +74,7 @@ class _BloodSugarHomePageState extends State<BloodSugarHomePage>
isScrollable: true, isScrollable: true,
controller: _tabController, controller: _tabController,
indicatorWeight: 5.0, indicatorWeight: 5.0,
indicatorSize: TabBarIndicatorSize.label, indicatorSize: TabBarIndicatorSize.tab,
labelColor: Theme.of(context).primaryColor, labelColor: Theme.of(context).primaryColor,
labelPadding: labelPadding:
EdgeInsets.only(top: 4.0, left: 5.0, right: 5.0), EdgeInsets.only(top: 4.0, left: 5.0, right: 5.0),

@ -71,12 +71,12 @@ class _HomePrescriptionsPageState extends State<HomePrescriptionsPage>
child: Container( child: Container(
height: 60.0, height: 60.0,
margin: EdgeInsets.only(top: 10.0), margin: EdgeInsets.only(top: 10.0),
width: MediaQuery.of(context).size.width * 0.9, width: MediaQuery.of(context).size.width * 0.92,
decoration: BoxDecoration( decoration: BoxDecoration(
border: Border( border: Border(
bottom: BorderSide( bottom: BorderSide(
color: Theme.of(context).dividerColor, color: Theme.of(context).dividerColor,
width: 0.7), width: 0.9), //width: 0.7
), ),
color: Colors.white), color: Colors.white),
child: Center( child: Center(
@ -84,10 +84,10 @@ class _HomePrescriptionsPageState extends State<HomePrescriptionsPage>
isScrollable: true, isScrollable: true,
controller: _tabController, controller: _tabController,
indicatorWeight: 5.0, indicatorWeight: 5.0,
indicatorSize: TabBarIndicatorSize.label, indicatorSize: TabBarIndicatorSize.tab,
labelColor: Theme.of(context).primaryColor, labelColor: Theme.of(context).primaryColor,
labelPadding: labelPadding:
EdgeInsets.only(top: 4.0, left: 18.0, right: 18.0), EdgeInsets.only(top: 4.0, left: 35.0, right: 35.0),
unselectedLabelColor: Colors.grey[800], unselectedLabelColor: Colors.grey[800],
tabs: [ tabs: [
Container( Container(

@ -2,10 +2,12 @@ import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/viewModels/medical/reports_monthly_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/reports_monthly_view_model.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/pages/medical/reports/user_agreement_page.dart'; import 'package:diplomaticquarterapp/pages/medical/reports/user_agreement_page.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/input/custom_switch.dart'; import 'package:diplomaticquarterapp/widgets/input/custom_switch.dart';
import 'package:diplomaticquarterapp/widgets/input/text_field.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
@ -19,6 +21,8 @@ class MonthlyReportsPage extends StatefulWidget {
class _MonthlyReportsPageState extends State<MonthlyReportsPage> { class _MonthlyReportsPageState extends State<MonthlyReportsPage> {
bool isAgree = false; bool isAgree = false;
bool isSummary = false; bool isSummary = false;
String email = "";
final formKey = GlobalKey<FormState>();
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -29,135 +33,161 @@ class _MonthlyReportsPageState extends State<MonthlyReportsPage> {
body: SingleChildScrollView( body: SingleChildScrollView(
child: Container( child: Container(
padding: EdgeInsets.all(12), padding: EdgeInsets.all(12),
child: Column( child: Form(
crossAxisAlignment: CrossAxisAlignment.start, key: formKey,
children: [ child: Column(
Container( crossAxisAlignment: CrossAxisAlignment.start,
padding: EdgeInsets.all(9), children: [
height: 55, Container(
decoration: BoxDecoration( padding: EdgeInsets.all(9),
color: Colors.white, height: 55,
borderRadius: BorderRadius.all(Radius.circular(8)), decoration: BoxDecoration(
shape: BoxShape.rectangle, color: Colors.white,
border: Border.all(color: Colors.grey)), borderRadius: BorderRadius.all(Radius.circular(8)),
child: Row( shape: BoxShape.rectangle,
mainAxisAlignment: MainAxisAlignment.spaceBetween, border: Border.all(color: Colors.grey)),
children: [ child: Row(
Texts( mainAxisAlignment: MainAxisAlignment.spaceBetween,
TranslationBase.of(context).patientHealthSummaryReport, children: [
bold: true,
), Texts(
CustomSwitch( TranslationBase.of(context).patientHealthSummaryReport,
value: isSummary, bold: true,
activeColor: Colors.red, ),
inactiveColor: Colors.grey, CustomSwitch(
onChanged: () async { value: isSummary,
setState(() { activeColor: Colors.red,
isSummary = !isSummary; inactiveColor: Colors.grey,
}); onChanged: () async {
}, setState(() {
) isSummary = !isSummary;
], });
if(!isSummary) {
GifLoaderDialogUtils.showMyDialog(context);
await model.updatePatientHealthSummaryReport(
message: TranslationBase
.of(context)
.updateSuccessfully, isSummary: isSummary);
GifLoaderDialogUtils.hideDialog(context);
}
},
)
],
),
), ),
), SizedBox(
SizedBox( height: 15,
height: 15,
),
Container(
margin: EdgeInsets.all(8),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Texts(
model.user.emailAddress,
bold: true,
),
],
), ),
), Container(
Divider( margin: EdgeInsets.all(8),
height: 10.4, child: TextFields(
thickness: 1.0, fillColor: Colors.red,
), hintText: 'email@email.com',
SizedBox( fontSize: 20,
height: 15, initialValue: model.user.emailAddress,
), fontWeight: FontWeight.w600,
Container( onChanged: (text) {
margin: EdgeInsets.all(8), email = text;
child: Row( },
mainAxisAlignment: MainAxisAlignment.spaceBetween, validator: (value) {
if (value.isEmpty)
return TranslationBase.of(context).enterEmail;
else
return null;
},
),
),
Divider(
height: 10.4,
thickness: 1.0,
),
SizedBox(
height: 15,
),
Container(
margin: EdgeInsets.all(8),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Expanded(
child: Texts(TranslationBase.of(context)
.toViewTheTermsAndConditions),
),
InkWell(
onTap: () {
Navigator.push(
context,
FadePage(
page: UserAgreementContent(),
),
);
},
child: Texts(
TranslationBase.of(context).clickHere,
color: Colors.blue,
),
)
],
),
),
SizedBox(
height: 5,
),
Row(
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.start,
children: [ children: [
Expanded( Checkbox(
child: Texts(TranslationBase.of(context) value: isAgree,
.toViewTheTermsAndConditions), onChanged: (value) {
), setState(() {
InkWell( isAgree = !isAgree;
onTap: () { });
Navigator.push(
context,
FadePage(
page: UserAgreementContent(),
),
);
}, },
child: Texts( activeColor: Colors.red,
TranslationBase.of(context).clickHere, ),
color: Colors.blue, Texts(TranslationBase.of(context).iAgreeToTheTermsAndConditions),
),
)
], ],
), ),
), Container(
SizedBox( margin: EdgeInsets.all(8),
height: 5, width: double.infinity,
), child: SecondaryButton(
Row( textColor: Colors.white,
crossAxisAlignment: CrossAxisAlignment.center, label: TranslationBase.of(context).save,
mainAxisAlignment: MainAxisAlignment.start, disabled: (!isAgree || !isSummary ),
children: [ onTap: () async {
Checkbox( final form = formKey.currentState;
value: isAgree, if (form.validate()) {
onChanged: (value) { GifLoaderDialogUtils.showMyDialog(context);
setState(() { await model.updatePatientHealthSummaryReport(
isAgree = !isAgree; message: TranslationBase
}); .of(context)
.updateSuccessfully,
isSummary: isSummary,
isUpdateEmail: true,
email: email.isNotEmpty ? email : model.user
.emailAddress);
GifLoaderDialogUtils.hideDialog(context);
}
}, },
activeColor: Colors.red,
), ),
Texts(TranslationBase.of(context)
.iAgreeToTheTermsAndConditions),
],
),
Container(
margin: EdgeInsets.all(8),
width: double.infinity,
child: SecondaryButton(
textColor: Colors.white,
label: TranslationBase.of(context).save,
disabled: !isAgree,
loading: model.state == ViewState.BusyLocal,
onTap: () {
model.updatePatientHealthSummaryReport(
message: TranslationBase.of(context)
.updateSuccessfully,
isSummary: isSummary);
},
), ),
), Padding(
Padding( padding: const EdgeInsets.all(5.0),
padding: const EdgeInsets.all(5.0), child: Texts(
child: Texts( TranslationBase.of(context)
TranslationBase.of(context) .instructionAgree,
.iAgreeToTheTermsAndConditionsSubtitle, fontWeight: FontWeight.normal,
fontWeight: FontWeight.normal, ),
),
SizedBox(
height: 12,
), ),
), Center(child: Image.asset('assets/images/report.jpg'))
SizedBox( ],
height: 12, ),
),
Center(child: Image.asset('assets/images/report.jpg'))
],
), ),
), ),
), ),

@ -101,7 +101,7 @@ class _HomeReportPageState extends State<HomeReportPage>
isScrollable: true, isScrollable: true,
controller: _tabController, controller: _tabController,
indicatorWeight: 5.0, indicatorWeight: 5.0,
indicatorSize: TabBarIndicatorSize.label, indicatorSize: TabBarIndicatorSize.tab,
labelColor: Theme.of(context).primaryColor, labelColor: Theme.of(context).primaryColor,
unselectedLabelColor: Colors.grey[800], unselectedLabelColor: Colors.grey[800],
tabs: [ tabs: [

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

Loading…
Cancel
Save