Merge branch 'development_v2.5' of https://gitlab.com/Cloud_Solution/diplomatic-quarter into fatima_v2

# Conflicts:
#	lib/widgets/input/text_field.dart
merge-update-with-lab-changes
Fatimah Alshammari 4 years ago
commit 7634c35e3d

@ -1,6 +1,21 @@
{ {
"agcgw":{
"backurl":"connect-drcn.hispace.hicloud.com",
"url":"connect-drcn.dbankcloud.cn",
"websocketbackurl":"connect-ws-drcn.hispace.dbankcloud.com",
"websocketurl":"connect-ws-drcn.hispace.dbankcloud.cn"
},
"agcgw_all":{
"CN":"connect-drcn.dbankcloud.cn",
"CN_back":"connect-drcn.hispace.hicloud.com",
"DE":"connect-dre.dbankcloud.cn",
"DE_back":"connect-dre.hispace.hicloud.com",
"RU":"connect-drru.dbankcloud.cn",
"RU_back":"connect-drru.hispace.hicloud.com",
"SG":"connect-dra.dbankcloud.cn",
"SG_back":"connect-dra.hispace.hicloud.com"
},
"client":{ "client":{
"appType":"1",
"cp_id":"2640966000002322881", "cp_id":"2640966000002322881",
"product_id":"736430079244816567", "product_id":"736430079244816567",
"client_id":"563735388191982656", "client_id":"563735388191982656",
@ -10,5 +25,50 @@
"api_key":"CgB6e3x9DJzMgRCmnT6dyUEkp6UsIfddb6l3w0ZEXzeiRMHEFi3400Z5fJ5qaHneU0OrAI/JRpk+DMGVs3QpUxlI", "api_key":"CgB6e3x9DJzMgRCmnT6dyUEkp6UsIfddb6l3w0ZEXzeiRMHEFi3400Z5fJ5qaHneU0OrAI/JRpk+DMGVs3QpUxlI",
"package_name":"com.ejada.hmg" "package_name":"com.ejada.hmg"
}, },
"configuration_version":"1.0" "oauth_client":{
"client_id":"102857389",
"client_type":1
},
"app_info":{
"app_id":"102857389",
"package_name":"com.ejada.hmg"
},
"service":{
"analytics":{
"collector_url":"datacollector-drcn.dt.hicloud.com,datacollector-drcn.dt.dbankcloud.cn",
"collector_url_ru":"datacollector-drru.dt.hicloud.com,datacollector-drru.dt.dbankcloud.cn",
"collector_url_sg":"datacollector-dra.dt.hicloud.com,datacollector-dra.dt.dbankcloud.cn",
"collector_url_de":"datacollector-dre.dt.hicloud.com,datacollector-dre.dt.dbankcloud.cn",
"collector_url_cn":"datacollector-drcn.dt.hicloud.com,datacollector-drcn.dt.dbankcloud.cn",
"resource_id":"p1",
"channel_id":""
},
"search":{
"url":"https://search-drcn.cloud.huawei.com"
},
"cloudstorage":{
"storage_url":"https://agc-storage-drcn.platform.dbankcloud.cn"
},
"ml":{
"mlservice_url":"ml-api-drcn.ai.dbankcloud.com,ml-api-drcn.ai.dbankcloud.cn"
}
},
"region":"CN",
"configuration_version":"3.0",
"appInfos":[
{
"package_name":"com.ejada.hmg",
"client":{
"app_id":"102857389"
},
"app_info":{
"package_name":"com.ejada.hmg",
"app_id":"102857389"
},
"oauth_client":{
"client_type":1,
"client_id":"102857389"
}
}
]
} }

@ -67,6 +67,7 @@ android {
} }
release { release {
signingConfig signingConfigs.config signingConfig signingConfigs.config
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
} }
staging { staging {
// Specifies a sorted list of fallback build types that the // Specifies a sorted list of fallback build types that the
@ -77,6 +78,15 @@ android {
matchingFallbacks = ['debug', 'qa', 'release'] matchingFallbacks = ['debug', 'qa', 'release']
} }
} }
packagingOptions {
exclude 'META-INF/proguard/androidx-annotations.pro'
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
} }
flutter { flutter {
@ -110,7 +120,8 @@ dependencies {
implementation 'com.google.android.gms:play-services-basement:17.5.0' implementation 'com.google.android.gms:play-services-basement:17.5.0'
implementation "com.opentok.android:opentok-android-sdk:2.19.1" // implementation "com.opentok.android:opentok-android-sdk:2.19.1"
implementation 'com.facebook.stetho:stetho:1.5.1' implementation 'com.facebook.stetho:stetho:1.5.1'
implementation 'com.facebook.stetho:stetho-urlconnection:1.5.1' implementation 'com.facebook.stetho:stetho-urlconnection:1.5.1'

@ -2,3 +2,26 @@
-keep class com.twilio.video.** { *; } -keep class com.twilio.video.** { *; }
-keep class com.twilio.common.** { *; } -keep class com.twilio.common.** { *; }
-keepattributes InnerClasses -keepattributes InnerClasses
-keep class com.ejada.** { *; }
-keep class org.webrtc.** { *; }
-ignorewarnings
-keepattributes *Annotation*
-keepattributes Exceptions
-keepattributes InnerClasses
-keepattributes Signature
-keep class com.hianalytics.android.**{*;}
-keep class com.huawei.updatesdk.**{*;}
-keep class com.huawei.hms.**{*;}
## Flutter wrapper
-keep class io.flutter.app.** { *; }
-keep class io.flutter.plugin.** { *; }
-keep class io.flutter.util.** { *; }
-keep class io.flutter.view.** { *; }
-keep class io.flutter.** { *; }
-keep class io.flutter.plugins.** { *; }
-dontwarn io.flutter.embedding.**
-keep class com.huawei.hms.flutter.** { *; }
-repackageclasses

@ -13,7 +13,7 @@
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" /> <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="android.permission.ACTIVITY_RECOGNITION" /> <uses-permission android:name="android.permission.ACTIVITY_RECOGNITION" />
<uses-permission android:name="android.permission.VIBRATE" /> <uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.DISABLE_KEYGUARD" /> <uses-permission android:name="android.permission.DISABLE_KEYGUARD"/>
<uses-permission android:name="android.permission.WAKE_LOCK" /> <uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.CAMERA" /> <uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.RECORD_AUDIO" /> <uses-permission android:name="android.permission.RECORD_AUDIO" />
@ -22,24 +22,18 @@
<uses-permission android:name="android.permission.READ_CALENDAR" /> <uses-permission android:name="android.permission.READ_CALENDAR" />
<uses-permission android:name="android.permission.WRITE_CALENDAR" /> <uses-permission android:name="android.permission.WRITE_CALENDAR" />
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" /> <uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
<uses-feature android:name="android.hardware.location.network" android:required="false" />
<uses-feature <uses-feature android:name="android.hardware.location.gps" android:required="false" />
android:name="android.hardware.location.network" <uses-permission android:name="com.huawei.appmarket.service.commondata.permission.GET_COMMON_DATA"/>
android:required="false" />
<uses-feature
android:name="android.hardware.location.gps"
android:required="false" />
<uses-permission android:name="com.huawei.appmarket.service.commondata.permission.GET_COMMON_DATA" />
<!-- Wifi Permissions--> <!-- Wifi Permissions-->
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" /> <uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE" /> <uses-permission android:name="android.permission.CHANGE_WIFI_STATE"/>
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" /> <uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
<!-- Detect Reboot Permission --> <!-- Detect Reboot Permission -->
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" /> <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
<queries> <queries>
<intent> <intent>
<action android:name="android.speech.RecognitionService" /> <action android:name="android.speech.RecognitionService" />
@ -48,10 +42,12 @@
<application <application
android:name=".Application" android:name=".Application"
android:icon="@mipmap/ic_launcher" android:icon="@mipmap/ic_launcher"
android:label="Dr. Alhabib" android:usesCleartextTraffic="true"
android:screenOrientation="sensorPortrait"
android:showOnLockScreen="true" android:showOnLockScreen="true"
android:usesCleartextTraffic="true"> android:screenOrientation="sensorPortrait"
android:label="Dr. Alhabib">
<meta-data android:name="push_kit_auto_init_enabled" android:value="true" />
<activity <activity
android:name=".MainActivity" android:name=".MainActivity"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode" android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
@ -87,44 +83,59 @@
<receiver android:name="com.dexterous.flutterlocalnotifications.ScheduledNotificationBootReceiver"> <receiver android:name="com.dexterous.flutterlocalnotifications.ScheduledNotificationBootReceiver">
<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" /> <action android:name="android.intent.action.MY_PACKAGE_REPLACED"/>
</intent-filter> </intent-filter>
</receiver> </receiver>
<receiver android:name="com.dexterous.flutterlocalnotifications.ScheduledNotificationReceiver" /> <receiver android:name="com.dexterous.flutterlocalnotifications.ScheduledNotificationReceiver" />
<!-- Geofencing --> <!-- Geofencing -->
<service <service android:name=".geofence.intent_receivers.GeofenceTransitionsJobIntentService" android:exported="true" android:permission="android.permission.BIND_JOB_SERVICE" />
android:name=".geofence.intent_receivers.GeofenceTransitionsJobIntentService" <receiver android:name=".geofence.intent_receivers.GeofenceBroadcastReceiver" android:enabled="true" android:exported="true" />
android:exported="true" <receiver android:name=".geofence.intent_receivers.GeofencingRebootBroadcastReceiver" android:enabled="true">
android:permission="android.permission.BIND_JOB_SERVICE" />
<receiver
android:name=".geofence.intent_receivers.GeofenceBroadcastReceiver"
android:enabled="true"
android:exported="true" />
<receiver
android:name=".geofence.intent_receivers.GeofencingRebootBroadcastReceiver"
android:enabled="true">
<intent-filter> <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" /> <action android:name="android.intent.action.MY_PACKAGE_REPLACED"/>
</intent-filter> </intent-filter>
</receiver> </receiver>
<receiver android:name=".geofence.intent_receivers.LocationProviderChangeReceiver"> <receiver android:name=".geofence.intent_receivers.LocationProviderChangeReceiver">
<intent-filter> <intent-filter>
<action android:name="android.location.PROVIDERS_CHANGED" /> <action android:name="android.location.PROVIDERS_CHANGED"/>
</intent-filter> </intent-filter>
</receiver> </receiver>
<service android:name=".geofence.intent_receivers.ReregisterGeofenceJobService" android:permission="android.permission.BIND_JOB_SERVICE" />
<service
android:name=".geofence.intent_receivers.ReregisterGeofenceJobService"
android:permission="android.permission.BIND_JOB_SERVICE" />
<!-- Geofencing --> <!-- Geofencing -->
<!--
Huawei Push Notifications
Set push kit auto enable to true (for obtaining the token on initialize)
-->
<meta-data <meta-data
android:name="com.google.android.geo.API_KEY" android:name="push_kit_auto_init_enabled"
android:value="AIzaSyCyDbWUM9d_sBUGIE8PcuShzPaqO08NSC8" /> android:value="true" />
<!-- These receivers are for sending scheduled local notifications -->
<receiver android:name="com.huawei.hms.flutter.push.receiver.local.HmsLocalNotificationBootEventReceiver">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
</intent-filter>
</receiver>
<receiver
android:name="com.huawei.hms.flutter.push.receiver.local.HmsLocalNotificationScheduledPublisher"
android:enabled="true"
android:exported="true" />
<receiver
android:name="com.huawei.hms.flutter.push.receiver.BackgroundMessageBroadcastReceiver"
android:enabled="true"
android:exported="true">
<intent-filter>
<action android:name="com.huawei.hms.flutter.push.receiver.BACKGROUND_REMOTE_MESSAGE" />
</intent-filter>
</receiver>
<!-- Huawei Push Notifications -->
<meta-data android:name="com.google.android.geo.API_KEY"
android:value="AIzaSyCyDbWUM9d_sBUGIE8PcuShzPaqO08NSC8"/>
<!-- Don't delete the meta-data below. <!-- Don't delete the meta-data below.
@ -134,7 +145,6 @@
android:value="2" /> android:value="2" />
</application> </application>
z
<uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.USE_FINGERPRINT" /> <uses-permission android:name="android.permission.USE_FINGERPRINT" />
@ -142,4 +152,5 @@
<uses-permission android:name="android.permission.WRITE_CALENDAR" /> <uses-permission android:name="android.permission.WRITE_CALENDAR" />
</manifest> </manifest>

@ -18,7 +18,7 @@ class MainActivity: FlutterFragmentActivity() {
WindowManager.LayoutParams.FLAG_TURN_SCREEN_ON or WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD or WindowManager.LayoutParams.FLAG_ALLOW_LOCK_WHILE_SCREEN_ON) WindowManager.LayoutParams.FLAG_TURN_SCREEN_ON or WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD or WindowManager.LayoutParams.FLAG_ALLOW_LOCK_WHILE_SCREEN_ON)
PlatformBridge(flutterEngine, this).create() PlatformBridge(flutterEngine, this).create()
OpenTokPlatformBridge(flutterEngine, this).create() // OpenTokPlatformBridge(flutterEngine, this).create()
val time = timeToMillis("04:00:00", "HH:mm:ss") val time = timeToMillis("04:00:00", "HH:mm:ss")

@ -0,0 +1,56 @@
/*
* ---------------
* Note: Todo
* ---------------
* Need to be place in huawei_push (package com.huawei.hms.flutter.push.hms) and define in huawei_push manifest.xml
* */
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.util.Log;
import com.huawei.hms.flutter.push.hms.FlutterHmsMessageService;
import com.huawei.hms.flutter.push.utils.ApplicationUtils;
import org.json.JSONObject;
//package com.huawei.hms.flutter.push.hms
//
//
//import android.content.Context;
//import android.content.Intent;
//import android.content.SharedPreferences;
//
//import com.huawei.hms.flutter.push.hms.FlutterHmsMessageService;
//import com.huawei.hms.flutter.push.utils.ApplicationUtils;
//import com.huawei.hms.push.RemoteMessage;
//
//import org.json.JSONObject;
//
//public class CustomFlutterHmsMessageService extends FlutterHmsMessageService {
// @Override
// public void onMessageReceived(RemoteMessage remoteMessage) {
// super.onMessageReceived(remoteMessage);
// try {
// String jsonStr = remoteMessage.getData();
// JSONObject json_data = new JSONObject(jsonStr);
// JSONObject json_data_data = new JSONObject(json_data.getString("data"));
// if(json_data_data.getString("is_call").equalsIgnoreCase("true")){
// boolean isApplicationInForeground = ApplicationUtils.isApplicationInForeground(this);
// if(!isApplicationInForeground){
// SharedPreferences preferences = getSharedPreferences("FlutterSharedPreferences", Context.MODE_PRIVATE);
// preferences.edit().putString("flutter.call_data", json_data.getString("data")).apply();
//
// Intent intent = getPackageManager().getLaunchIntentForPackage(getPackageName());
// intent.addFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
// startActivity(intent);
// Log.v("onMessageReceived", "startActivity(intent) called");
// }
// }
//
// } catch (Exception e) {
// e.printStackTrace();
// }
// }
//}

@ -1,58 +1,58 @@
package com.ejada.hmg.opentok //package com.ejada.hmg.opentok
//
import android.content.Context //import android.content.Context
import android.util.AttributeSet //import android.util.AttributeSet
import android.view.LayoutInflater //import android.view.LayoutInflater
import android.view.View //import android.view.View
import android.widget.FrameLayout //import android.widget.FrameLayout
import android.widget.LinearLayout //import android.widget.LinearLayout
import com.ejada.hmg.R //import com.ejada.hmg.R
import io.flutter.plugin.common.StandardMessageCodec //import io.flutter.plugin.common.StandardMessageCodec
import io.flutter.plugin.platform.PlatformView //import io.flutter.plugin.platform.PlatformView
import io.flutter.plugin.platform.PlatformViewFactory //import io.flutter.plugin.platform.PlatformViewFactory
//
class LocalVideoFactory : PlatformViewFactory(StandardMessageCodec.INSTANCE) { //class LocalVideoFactory : PlatformViewFactory(StandardMessageCodec.INSTANCE) {
//
companion object { // companion object {
private lateinit var view: LocalVideoPlatformView // private lateinit var view: LocalVideoPlatformView
//
fun getViewInstance(context: Context): LocalVideoPlatformView { // fun getViewInstance(context: Context): LocalVideoPlatformView {
if(!this::view.isInitialized) { // if(!this::view.isInitialized) {
view = LocalVideoPlatformView(context) // view = LocalVideoPlatformView(context)
} // }
//
return view // return view
} // }
} // }
//
override fun create(context: Context, viewId: Int, args: Any?): PlatformView { // override fun create(context: Context, viewId: Int, args: Any?): PlatformView {
return getViewInstance(context) // return getViewInstance(context)
} // }
} //}
//
class LocalVideoPlatformView(context: Context) : PlatformView { //class LocalVideoPlatformView(context: Context) : PlatformView {
private val videoContainer: LocalVideoContainer = LocalVideoContainer(context) // private val videoContainer: LocalVideoContainer = LocalVideoContainer(context)
//
val container get() = videoContainer.publisherContainer // val container get() = videoContainer.publisherContainer
//
override fun getView(): View { // override fun getView(): View {
return videoContainer // return videoContainer
} // }
//
override fun dispose() {} // override fun dispose() {}
} //}
//
class LocalVideoContainer @JvmOverloads constructor( //class LocalVideoContainer @JvmOverloads constructor(
context: Context, // context: Context,
attrs: AttributeSet? = null, // attrs: AttributeSet? = null,
defStyle: Int = 0, // defStyle: Int = 0,
defStyleRes: Int = 0 // defStyleRes: Int = 0
) : LinearLayout(context, attrs, defStyle, defStyleRes) { //) : LinearLayout(context, attrs, defStyle, defStyleRes) {
//
var publisherContainer: FrameLayout private set // var publisherContainer: FrameLayout private set
//
init { // init {
val view = LayoutInflater.from(context).inflate(R.layout.local_video, this, true) // val view = LayoutInflater.from(context).inflate(R.layout.local_video, this, true)
publisherContainer = view.findViewById(R.id.publisher_container) // publisherContainer = view.findViewById(R.id.publisher_container)
} // }
} //}

@ -1,170 +1,170 @@
package com.ejada.hmg.opentok //package com.ejada.hmg.opentok
//
import android.content.Context //import android.content.Context
import android.os.Handler //import android.os.Handler
import android.os.Looper //import android.os.Looper
import android.util.Log //import android.util.Log
import android.view.ViewGroup //import android.view.ViewGroup
import com.facebook.stetho.urlconnection.StethoURLConnectionManager //import com.facebook.stetho.urlconnection.StethoURLConnectionManager
import com.opentok.android.* //import com.opentok.android.*
import io.flutter.embedding.engine.FlutterEngine //import io.flutter.embedding.engine.FlutterEngine
import io.flutter.embedding.engine.plugins.util.GeneratedPluginRegister //import io.flutter.embedding.engine.plugins.util.GeneratedPluginRegister
import io.flutter.plugin.common.MethodCall //import io.flutter.plugin.common.MethodCall
import io.flutter.plugin.common.MethodChannel //import io.flutter.plugin.common.MethodChannel
//
//
enum class OpenTokSDKState { //enum class OpenTokSDKState {
LOGGED_OUT, // LOGGED_OUT,
LOGGED_IN, // LOGGED_IN,
WAIT, // WAIT,
ERROR // ERROR
} //}
//
class OpenTok(private var context: Context, private var flutterEngine: FlutterEngine){ //class OpenTok(private var context: Context, private var flutterEngine: FlutterEngine){
private lateinit var remoteVideoPlatformView: RemoteVideoPlatformView // private lateinit var remoteVideoPlatformView: RemoteVideoPlatformView
private lateinit var localVideoPlatformView: LocalVideoPlatformView // private lateinit var localVideoPlatformView: LocalVideoPlatformView
//
init { // init {
remoteVideoPlatformView = RemoteVideoFactory.getViewInstance(context) // remoteVideoPlatformView = RemoteVideoFactory.getViewInstance(context)
flutterEngine // flutterEngine
.platformViewsController // .platformViewsController
.registry // .registry
.registerViewFactory("remote-video-container", RemoteVideoFactory()) // .registerViewFactory("remote-video-container", RemoteVideoFactory())
//
localVideoPlatformView = LocalVideoFactory.getViewInstance(context) // localVideoPlatformView = LocalVideoFactory.getViewInstance(context)
flutterEngine // flutterEngine
.platformViewsController // .platformViewsController
.registry // .registry
.registerViewFactory("local-video-container", LocalVideoFactory()) // .registerViewFactory("local-video-container", LocalVideoFactory())
} // }
//
private var session: Session? = null // private var session: Session? = null
private var publisher: Publisher? = null // private var publisher: Publisher? = null
private var subscriber: Subscriber? = null // private var subscriber: Subscriber? = null
//
//
//
private val sessionListener: Session.SessionListener = object: Session.SessionListener { // private val sessionListener: Session.SessionListener = object: Session.SessionListener {
override fun onConnected(session: Session) { // override fun onConnected(session: Session) {
// Connected to session // // Connected to session
Log.d("MainActivity", "Connected to session ${session.sessionId}") // Log.d("MainActivity", "Connected to session ${session.sessionId}")
//
publisher = Publisher.Builder(context).build().apply { // publisher = Publisher.Builder(context).build().apply {
setPublisherListener(publisherListener) // setPublisherListener(publisherListener)
renderer?.setStyle(BaseVideoRenderer.STYLE_VIDEO_SCALE, BaseVideoRenderer.STYLE_VIDEO_FILL) // renderer?.setStyle(BaseVideoRenderer.STYLE_VIDEO_SCALE, BaseVideoRenderer.STYLE_VIDEO_FILL)
//
view.layoutParams = ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT) // view.layoutParams = ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT)
localVideoPlatformView.container.addView(view) // localVideoPlatformView.container.addView(view)
} // }
//
notifyFlutter(OpenTokSDKState.LOGGED_IN) // notifyFlutter(OpenTokSDKState.LOGGED_IN)
session.publish(publisher) // session.publish(publisher)
} // }
//
override fun onDisconnected(session: Session) { // override fun onDisconnected(session: Session) {
notifyFlutter(OpenTokSDKState.LOGGED_OUT) // notifyFlutter(OpenTokSDKState.LOGGED_OUT)
} // }
//
override fun onStreamReceived(session: Session, stream: Stream) { // override fun onStreamReceived(session: Session, stream: Stream) {
Log.d( // Log.d(
"MainActivity", // "MainActivity",
"onStreamReceived: New Stream Received " + stream.streamId + " in session: " + session.sessionId // "onStreamReceived: New Stream Received " + stream.streamId + " in session: " + session.sessionId
) // )
if (subscriber == null) { // if (subscriber == null) {
subscriber = Subscriber.Builder(context, stream).build().apply { // subscriber = Subscriber.Builder(context, stream).build().apply {
renderer?.setStyle(BaseVideoRenderer.STYLE_VIDEO_SCALE, BaseVideoRenderer.STYLE_VIDEO_FILL) // renderer?.setStyle(BaseVideoRenderer.STYLE_VIDEO_SCALE, BaseVideoRenderer.STYLE_VIDEO_FILL)
setSubscriberListener(subscriberListener) // setSubscriberListener(subscriberListener)
session.subscribe(this) // session.subscribe(this)
//
remoteVideoPlatformView.container.addView(view) // remoteVideoPlatformView.container.addView(view)
} // }
} // }
} // }
//
override fun onStreamDropped(session: Session, stream: Stream) { // override fun onStreamDropped(session: Session, stream: Stream) {
Log.d( // Log.d(
"MainActivity", // "MainActivity",
"onStreamDropped: Stream Dropped: " + stream.streamId + " in session: " + session.sessionId // "onStreamDropped: Stream Dropped: " + stream.streamId + " in session: " + session.sessionId
) // )
//
if (subscriber != null) { // if (subscriber != null) {
subscriber = null // subscriber = null
//
remoteVideoPlatformView.container.removeAllViews() // remoteVideoPlatformView.container.removeAllViews()
} // }
} // }
//
override fun onError(session: Session, opentokError: OpentokError) { // override fun onError(session: Session, opentokError: OpentokError) {
Log.d("MainActivity", "Session error: " + opentokError.message) // Log.d("MainActivity", "Session error: " + opentokError.message)
notifyFlutter(OpenTokSDKState.ERROR) // notifyFlutter(OpenTokSDKState.ERROR)
} // }
} // }
//
private val publisherListener: PublisherKit.PublisherListener = object : PublisherKit.PublisherListener { // private val publisherListener: PublisherKit.PublisherListener = object : PublisherKit.PublisherListener {
override fun onStreamCreated(publisherKit: PublisherKit, stream: Stream) { // override fun onStreamCreated(publisherKit: PublisherKit, stream: Stream) {
Log.d("MainActivity", "onStreamCreated: Publisher Stream Created. Own stream " + stream.streamId) // Log.d("MainActivity", "onStreamCreated: Publisher Stream Created. Own stream " + stream.streamId)
} // }
//
override fun onStreamDestroyed(publisherKit: PublisherKit, stream: Stream) { // override fun onStreamDestroyed(publisherKit: PublisherKit, stream: Stream) {
Log.d("MainActivity", "onStreamDestroyed: Publisher Stream Destroyed. Own stream " + stream.streamId) // Log.d("MainActivity", "onStreamDestroyed: Publisher Stream Destroyed. Own stream " + stream.streamId)
} // }
//
override fun onError(publisherKit: PublisherKit, opentokError: OpentokError) { // override fun onError(publisherKit: PublisherKit, opentokError: OpentokError) {
Log.d("MainActivity", "PublisherKit onError: " + opentokError.message) // Log.d("MainActivity", "PublisherKit onError: " + opentokError.message)
notifyFlutter(OpenTokSDKState.ERROR) // notifyFlutter(OpenTokSDKState.ERROR)
} // }
} // }
//
var subscriberListener: SubscriberKit.SubscriberListener = object : SubscriberKit.SubscriberListener { // var subscriberListener: SubscriberKit.SubscriberListener = object : SubscriberKit.SubscriberListener {
override fun onConnected(subscriberKit: SubscriberKit) { // override fun onConnected(subscriberKit: SubscriberKit) {
Log.d("MainActivity", "onConnected: Subscriber connected. Stream: " + subscriberKit.stream.streamId) // Log.d("MainActivity", "onConnected: Subscriber connected. Stream: " + subscriberKit.stream.streamId)
} // }
//
override fun onDisconnected(subscriberKit: SubscriberKit) { // override fun onDisconnected(subscriberKit: SubscriberKit) {
Log.d("MainActivity", "onDisconnected: Subscriber disconnected. Stream: " + subscriberKit.stream.streamId) // Log.d("MainActivity", "onDisconnected: Subscriber disconnected. Stream: " + subscriberKit.stream.streamId)
notifyFlutter(OpenTokSDKState.LOGGED_OUT) // notifyFlutter(OpenTokSDKState.LOGGED_OUT)
} // }
//
override fun onError(subscriberKit: SubscriberKit, opentokError: OpentokError) { // override fun onError(subscriberKit: SubscriberKit, opentokError: OpentokError) {
Log.d("MainActivity", "SubscriberKit onError: " + opentokError.message) // Log.d("MainActivity", "SubscriberKit onError: " + opentokError.message)
notifyFlutter(OpenTokSDKState.ERROR) // notifyFlutter(OpenTokSDKState.ERROR)
} // }
} // }
//
fun initSession(call: MethodCall, result: MethodChannel.Result) { // fun initSession(call: MethodCall, result: MethodChannel.Result) {
//
val apiKey = requireNotNull(call.argument<String>("apiKey")) // val apiKey = requireNotNull(call.argument<String>("apiKey"))
val sessionId = requireNotNull(call.argument<String>("sessionId")) // val sessionId = requireNotNull(call.argument<String>("sessionId"))
val token = requireNotNull(call.argument<String>("token")) // val token = requireNotNull(call.argument<String>("token"))
//
notifyFlutter(OpenTokSDKState.WAIT) // notifyFlutter(OpenTokSDKState.WAIT)
session = Session.Builder(context, apiKey, sessionId).build() // session = Session.Builder(context, apiKey, sessionId).build()
session?.setSessionListener(sessionListener) // session?.setSessionListener(sessionListener)
session?.connect(token) // session?.connect(token)
result.success("") // result.success("")
} // }
//
fun swapCamera(call: MethodCall, result: MethodChannel.Result) { // fun swapCamera(call: MethodCall, result: MethodChannel.Result) {
publisher?.cycleCamera() // publisher?.cycleCamera()
result.success("") // result.success("")
} // }
//
fun toggleAudio(call: MethodCall, result: MethodChannel.Result) { // fun toggleAudio(call: MethodCall, result: MethodChannel.Result) {
val publishAudio = requireNotNull(call.argument<Boolean>("publishAudio")) // val publishAudio = requireNotNull(call.argument<Boolean>("publishAudio"))
publisher?.publishAudio = publishAudio // publisher?.publishAudio = publishAudio
result.success("") // result.success("")
} // }
//
fun toggleVideo(call: MethodCall, result: MethodChannel.Result) { // fun toggleVideo(call: MethodCall, result: MethodChannel.Result) {
val publishVideo = requireNotNull(call.argument<Boolean>("publishVideo")) // val publishVideo = requireNotNull(call.argument<Boolean>("publishVideo"))
publisher?.publishVideo = publishVideo // publisher?.publishVideo = publishVideo
result.success("") // result.success("")
} // }
//
private fun notifyFlutter(state: OpenTokSDKState) { // private fun notifyFlutter(state: OpenTokSDKState) {
Handler(Looper.getMainLooper()).post { // Handler(Looper.getMainLooper()).post {
MethodChannel(flutterEngine.dartExecutor.binaryMessenger, "OpenTok-Platform-Bridge") // MethodChannel(flutterEngine.dartExecutor.binaryMessenger, "OpenTok-Platform-Bridge")
.invokeMethod("updateState", state.toString()) // .invokeMethod("updateState", state.toString())
} // }
} // }
} //}

@ -1,58 +1,58 @@
package com.ejada.hmg.opentok //package com.ejada.hmg.opentok
//
import android.content.Context //import android.content.Context
import android.util.AttributeSet //import android.util.AttributeSet
import android.view.LayoutInflater //import android.view.LayoutInflater
import android.view.View //import android.view.View
import android.widget.FrameLayout //import android.widget.FrameLayout
import android.widget.LinearLayout //import android.widget.LinearLayout
import com.ejada.hmg.R //import com.ejada.hmg.R
import io.flutter.plugin.common.StandardMessageCodec //import io.flutter.plugin.common.StandardMessageCodec
import io.flutter.plugin.platform.PlatformView //import io.flutter.plugin.platform.PlatformView
import io.flutter.plugin.platform.PlatformViewFactory //import io.flutter.plugin.platform.PlatformViewFactory
//
class RemoteVideoFactory : PlatformViewFactory(StandardMessageCodec.INSTANCE) { //class RemoteVideoFactory : PlatformViewFactory(StandardMessageCodec.INSTANCE) {
//
companion object { // companion object {
private lateinit var view: RemoteVideoPlatformView // private lateinit var view: RemoteVideoPlatformView
//
fun getViewInstance(context: Context): RemoteVideoPlatformView { // fun getViewInstance(context: Context): RemoteVideoPlatformView {
if(!this::view.isInitialized) { // if(!this::view.isInitialized) {
view = RemoteVideoPlatformView(context) // view = RemoteVideoPlatformView(context)
} // }
//
return view // return view
} // }
} // }
//
override fun create(context: Context, viewId: Int, args: Any?): PlatformView { // override fun create(context: Context, viewId: Int, args: Any?): PlatformView {
return getViewInstance(context) // return getViewInstance(context)
} // }
} //}
//
class RemoteVideoPlatformView(context: Context) : PlatformView { //class RemoteVideoPlatformView(context: Context) : PlatformView {
private val videoContainer: RemoteVideoContainer = RemoteVideoContainer(context) // private val videoContainer: RemoteVideoContainer = RemoteVideoContainer(context)
//
val container get() = videoContainer.subscriberContainer // val container get() = videoContainer.subscriberContainer
//
override fun getView(): View { // override fun getView(): View {
return videoContainer // return videoContainer
} // }
//
override fun dispose() {} // override fun dispose() {}
} //}
//
class RemoteVideoContainer @JvmOverloads constructor( //class RemoteVideoContainer @JvmOverloads constructor(
context: Context, // context: Context,
attrs: AttributeSet? = null, // attrs: AttributeSet? = null,
defStyle: Int = 0, // defStyle: Int = 0,
defStyleRes: Int = 0 // defStyleRes: Int = 0
) : LinearLayout(context, attrs, defStyle, defStyleRes) { //) : LinearLayout(context, attrs, defStyle, defStyleRes) {
//
var subscriberContainer: FrameLayout private set // var subscriberContainer: FrameLayout private set
//
init { // init {
val view = LayoutInflater.from(context).inflate(R.layout.remote_video, this, true) // val view = LayoutInflater.from(context).inflate(R.layout.remote_video, this, true)
subscriberContainer = view.findViewById(R.id.subscriber_container) // subscriberContainer = view.findViewById(R.id.subscriber_container)
} // }
} //}

@ -1,42 +1,42 @@
package com.ejada.hmg.utils //package com.ejada.hmg.utils
//
import com.ejada.hmg.MainActivity //import com.ejada.hmg.MainActivity
import com.ejada.hmg.opentok.OpenTok //import com.ejada.hmg.opentok.OpenTok
import io.flutter.embedding.engine.FlutterEngine //import io.flutter.embedding.engine.FlutterEngine
import io.flutter.plugin.common.MethodCall //import io.flutter.plugin.common.MethodCall
import io.flutter.plugin.common.MethodChannel //import io.flutter.plugin.common.MethodChannel
//
class OpenTokPlatformBridge(private var flutterEngine: FlutterEngine, private var mainActivity: MainActivity) { //class OpenTokPlatformBridge(private var flutterEngine: FlutterEngine, private var mainActivity: MainActivity) {
//
private lateinit var channel: MethodChannel // private lateinit var channel: MethodChannel
private lateinit var openTok: OpenTok // private lateinit var openTok: OpenTok
//
companion object { // companion object {
private const val CHANNEL = "OpenTok-Platform-Bridge" // private const val CHANNEL = "OpenTok-Platform-Bridge"
} // }
//
fun create(){ // fun create(){
openTok = OpenTok(mainActivity, flutterEngine) // openTok = OpenTok(mainActivity, flutterEngine)
channel = MethodChannel(flutterEngine.dartExecutor.binaryMessenger, CHANNEL) // channel = MethodChannel(flutterEngine.dartExecutor.binaryMessenger, CHANNEL)
channel.setMethodCallHandler { call: MethodCall, result: MethodChannel.Result -> // channel.setMethodCallHandler { call: MethodCall, result: MethodChannel.Result ->
when (call.method) { // when (call.method) {
"initSession" -> { // "initSession" -> {
openTok.initSession(call, result) // openTok.initSession(call, result)
} // }
"swapCamera" -> { // "swapCamera" -> {
openTok.swapCamera(call, result) // openTok.swapCamera(call, result)
} // }
"toggleAudio" -> { // "toggleAudio" -> {
openTok.toggleAudio(call, result) // openTok.toggleAudio(call, result)
} // }
"toggleVideo" -> { // "toggleVideo" -> {
openTok.toggleVideo(call, result) // openTok.toggleVideo(call, result)
} // }
else -> { // else -> {
result.notImplemented() // result.notImplemented()
} // }
} // }
} // }
} // }
//
} //}

@ -44,3 +44,9 @@ subprojects {
task clean(type: Delete) { task clean(type: Delete) {
delete rootProject.buildDir delete rootProject.buildDir
} }
configurations.all {
resolutionStrategy {
force 'androidx.core:core-ktx:1.6.0'
}
}

@ -0,0 +1,7 @@
<svg xmlns="http://www.w3.org/2000/svg" width="48.615" height="48.48" viewBox="0 0 48.615 48.48">
<g id="phone-call_1_" data-name="phone-call (1)" transform="translate(0 -0.584)">
<g id="Group_8539" data-name="Group 8539" transform="translate(0 0.584)">
<path id="Path_4999" data-name="Path 4999" d="M47.642,37.832l-6.627-6.6a3.364,3.364,0,0,0-4.715,0l-4.206,4.31a1.128,1.128,0,0,1-1.483,0A113.953,113.953,0,0,1,21.667,27.6a105.911,105.911,0,0,1-8.006-8.9,1.078,1.078,0,0,1,0-1.483l4.4-4.3a3.435,3.435,0,0,0,0-4.773L11.437,1.522a3.5,3.5,0,0,0-4.773,0L1.218,6.991s-.243.232-.324.324C-2.176,11,2.724,22.689,14.611,34.507c8.654,8.7,18.433,14.528,24.272,14.528a4.276,4.276,0,0,0,2.8-.568c.162-.116.614-.521.614-.521l5.341-5.364A3.385,3.385,0,0,0,47.642,37.832Z" transform="translate(0 -0.584)" fill="#5ab145"/>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 842 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.1 KiB

@ -0,0 +1,3 @@
<svg xmlns="http://www.w3.org/2000/svg" width="35.547" height="48.48" viewBox="0 0 35.547 48.48">
<path id="map" d="M22.773,1A17.773,17.773,0,0,0,5,18.773c0,9.388,15.834,29.245,16.513,30.1a1.616,1.616,0,0,0,2.521,0c.679-.856,16.513-20.714,16.513-30.1A17.773,17.773,0,0,0,22.773,1Zm0,22.621a6.463,6.463,0,1,1,6.463-6.463A6.463,6.463,0,0,1,22.773,23.621Z" transform="translate(-5 -1)" fill="#5ab145"/>
</svg>

After

Width:  |  Height:  |  Size: 409 B

@ -0,0 +1,3 @@
<svg xmlns="http://www.w3.org/2000/svg" width="48.248" height="48.48" viewBox="0 0 48.248 48.48">
<path id="whatsapp" d="M41.468,7.045A24.029,24.029,0,0,0,3.658,36.031L.25,48.48l12.735-3.341a24,24,0,0,0,11.48,2.924h.01A24.033,24.033,0,0,0,41.468,7.045ZM24.475,44.006h-.008A19.942,19.942,0,0,1,14.3,41.223l-.729-.433L6.018,42.772,8.035,35.4l-.475-.755a19.967,19.967,0,1,1,16.915,9.357ZM35.427,29.052c-.6-.3-3.551-1.752-4.1-1.953s-.95-.3-1.35.3-1.55,1.953-1.9,2.353-.7.451-1.3.15a16.4,16.4,0,0,1-4.827-2.979,18.106,18.106,0,0,1-3.339-4.158c-.35-.6,0-.895.263-1.225a16.98,16.98,0,0,0,1.5-2.053,1.1,1.1,0,0,0-.05-1.052c-.15-.3-1.35-3.255-1.85-4.457-.488-1.17-.982-1.012-1.351-1.03-.35-.017-.75-.021-1.15-.021a2.2,2.2,0,0,0-1.6.751,6.732,6.732,0,0,0-2.1,5.007c0,2.955,2.151,5.809,2.451,6.209s4.233,6.464,10.254,9.063A34.358,34.358,0,0,0,28.4,35.224a8.229,8.229,0,0,0,3.781.238c1.153-.173,3.551-1.452,4.052-2.854a5.015,5.015,0,0,0,.35-2.855C36.428,29.5,36.027,29.352,35.427,29.052Zm0,0" transform="translate(-0.25)" fill="#5ab145" fill-rule="evenodd"/>
</svg>

After

Width:  |  Height:  |  Size: 1.0 KiB

@ -1,9 +1,8 @@
# Uncomment this line to define a global platform for your project # Uncomment this line to define a global platform for your project
# platform :ios, '10.0' platform :ios, '13.0'
# CocoaPods analytics sends network stats synchronously affecting flutter build latency. # CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true' ENV['COCOAPODS_DISABLE_STATS'] = 'true'
$FirebaseAnalyticsWithoutAdIdSupport = true
project 'Runner', { project 'Runner', {
'Debug' => :debug, 'Debug' => :debug,
@ -11,86 +10,32 @@ project 'Runner', {
'Release' => :release, 'Release' => :release,
} }
# pod 'FBSDKCoreKit' def flutter_root
# pod 'FBSDKLoginKit' generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__)
unless File.exist?(generated_xcode_build_settings_path)
def parse_KV_file(file, separator='=') raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first"
file_abs_path = File.expand_path(file)
if !File.exists? file_abs_path
return [];
end
generated_key_values = {}
skip_line_start_symbols = ["#", "/"]
File.foreach(file_abs_path) do |line|
next if skip_line_start_symbols.any? { |symbol| line =~ /^\s*#{symbol}/ }
plugin = line.split(pattern=separator)
if plugin.length == 2
podname = plugin[0].strip()
path = plugin[1].strip()
podpath = File.expand_path("#{path}", file_abs_path)
generated_key_values[podname] = podpath
else
puts "Invalid plugin specification: #{line}"
end end
File.foreach(generated_xcode_build_settings_path) do |line|
matches = line.match(/FLUTTER_ROOT\=(.*)/)
return matches[1].strip if matches
end end
generated_key_values raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get"
end end
require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)
flutter_ios_podfile_setup
target 'Runner' do target 'Runner' do
use_frameworks! use_frameworks!
use_modular_headers! use_modular_headers!
# Native Pods flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
pod 'NVActivityIndicatorView'
pod 'OpenTok'
# Flutter Pod
copied_flutter_dir = File.join(__dir__, 'Flutter')
copied_framework_path = File.join(copied_flutter_dir, 'Flutter.framework')
copied_podspec_path = File.join(copied_flutter_dir, 'Flutter.podspec')
unless File.exist?(copied_framework_path) && File.exist?(copied_podspec_path)
# Copy Flutter.framework and Flutter.podspec to Flutter/ to have something to link against if the xcode backend script has not run yet.
# That script will copy the correct debug/profile/release version of the framework based on the currently selected Xcode configuration.
# CocoaPods will not embed the framework on pod install (before any build phases can generate) if the dylib does not exist.
generated_xcode_build_settings_path = File.join(copied_flutter_dir, 'Generated.xcconfig')
unless File.exist?(generated_xcode_build_settings_path)
raise "Generated.xcconfig must exist. If you're running pod install manually, make sure flutter pub get is executed first"
end
generated_xcode_build_settings = parse_KV_file(generated_xcode_build_settings_path)
cached_framework_dir = generated_xcode_build_settings['FLUTTER_FRAMEWORK_DIR'];
unless File.exist?(copied_framework_path)
FileUtils.cp_r(File.join(cached_framework_dir, 'Flutter.framework'), copied_flutter_dir)
end
unless File.exist?(copied_podspec_path)
FileUtils.cp(File.join(cached_framework_dir, 'Flutter.podspec'), copied_flutter_dir)
end
end
# Keep pod path relative so it can be checked into Podfile.lock.
pod 'Flutter', :path => 'Flutter'
# Plugin Pods
# Prepare symlinks folder. We use symlinks to avoid having Podfile.lock
# referring to absolute paths on developers' machines.
system('rm -rf .symlinks')
system('mkdir -p .symlinks/plugins')
plugin_pods = parse_KV_file('../.flutter-plugins')
plugin_pods.each do |name, path|
symlink = File.join('.symlinks', 'plugins', name)
File.symlink(path, symlink)
pod name, :path => File.join(symlink, 'ios')
end
end end
post_install do |installer| post_install do |installer|
installer.pods_project.targets.each do |target| installer.pods_project.targets.each do |target|
target.build_configurations.each do |config| flutter_additional_ios_build_settings(target)
config.build_settings['ENABLE_BITCODE'] = 'NO'
end
end end
end end

File diff suppressed because it is too large Load Diff

@ -2,6 +2,6 @@
<Workspace <Workspace
version = "1.0"> version = "1.0">
<FileRef <FileRef
location = "group:Runner.xcodeproj"> location = "self:">
</FileRef> </FileRef>
</Workspace> </Workspace>

@ -29,12 +29,12 @@ var userNotificationCenterDelegate:UNUserNotificationCenterDelegate? = nil
if let mainViewController = window.rootViewController as? MainFlutterVC{ // platform initialization suppose to be in foreground if let mainViewController = window.rootViewController as? MainFlutterVC{ // platform initialization suppose to be in foreground
flutterViewController = mainViewController flutterViewController = mainViewController
HMGPlatformBridge.initialize(flutterViewController: flutterViewController) HMGPlatformBridge.initialize(flutterViewController: flutterViewController)
OpenTokPlatformBridge.initialize(flutterViewController: flutterViewController, registrar: self.registrar(forPlugin: "open-tok")) // OpenTokPlatformBridge.initialize(flutterViewController: flutterViewController, registrar: self.registrar(forPlugin: "open-tok"))
}else if let mainViewController = initialViewController(){ // platform initialization suppose to be in background }else if let mainViewController = initialViewController(){ // platform initialization suppose to be in background
flutterViewController = mainViewController flutterViewController = mainViewController
HMGPlatformBridge.initialize(flutterViewController: flutterViewController) HMGPlatformBridge.initialize(flutterViewController: flutterViewController)
OpenTokPlatformBridge.initialize(flutterViewController: flutterViewController, registrar: self.registrar(forPlugin: "open-tok")) // OpenTokPlatformBridge.initialize(flutterViewController: flutterViewController, registrar: self.registrar(forPlugin: "open-tok"))
} }
} }

@ -8,52 +8,51 @@
import UIKit import UIKit
import NetworkExtension import NetworkExtension
import SystemConfiguration.CaptiveNetwork import SystemConfiguration.CaptiveNetwork
import OpenTok
fileprivate var openTok:OpenTok? fileprivate var openTok:OpenTok?
class OpenTokPlatformBridge : NSObject{ class OpenTokPlatformBridge : NSObject{
private var methodChannel:FlutterMethodChannel? = nil // private var methodChannel:FlutterMethodChannel? = nil
private var mainViewController:MainFlutterVC! // private var mainViewController:MainFlutterVC!
private static var shared_:OpenTokPlatformBridge? // private static var shared_:OpenTokPlatformBridge?
//
class func initialize(flutterViewController:MainFlutterVC, registrar:FlutterPluginRegistrar?){ // class func initialize(flutterViewController:MainFlutterVC, registrar:FlutterPluginRegistrar?){
shared_ = OpenTokPlatformBridge() // shared_ = OpenTokPlatformBridge()
shared_?.mainViewController = flutterViewController // shared_?.mainViewController = flutterViewController
//
shared_?.openChannel() // shared_?.openChannel()
openTok = OpenTok(mainViewController: flutterViewController, registrar: registrar) // openTok = OpenTok(mainViewController: flutterViewController, registrar: registrar)
} // }
//
func shared() -> OpenTokPlatformBridge{ // func shared() -> OpenTokPlatformBridge{
assert((OpenTokPlatformBridge.shared_ != nil), "OpenTokPlatformBridge is not initialized, call initialize(mainViewController:MainFlutterVC) function first.") // assert((OpenTokPlatformBridge.shared_ != nil), "OpenTokPlatformBridge is not initialized, call initialize(mainViewController:MainFlutterVC) function first.")
return OpenTokPlatformBridge.shared_! // return OpenTokPlatformBridge.shared_!
} // }
//
private func openChannel(){ // private func openChannel(){
methodChannel = FlutterMethodChannel(name: "OpenTok-Platform-Bridge", binaryMessenger: mainViewController.binaryMessenger) // methodChannel = FlutterMethodChannel(name: "OpenTok-Platform-Bridge", binaryMessenger: mainViewController.binaryMessenger)
methodChannel?.setMethodCallHandler { (call, result) in // methodChannel?.setMethodCallHandler { (call, result) in
print("Called function \(call.method)") // print("Called function \(call.method)")
//
switch(call.method) { // switch(call.method) {
case "initSession": // case "initSession":
openTok?.initSession(call: call, result: result) // openTok?.initSession(call: call, result: result)
//
case "swapCamera": // case "swapCamera":
openTok?.swapCamera(call: call, result: result) // openTok?.swapCamera(call: call, result: result)
//
case "toggleAudio": // case "toggleAudio":
openTok?.toggleAudio(call: call, result: result) // openTok?.toggleAudio(call: call, result: result)
//
case "toggleVideo": // case "toggleVideo":
openTok?.toggleVideo(call: call, result: result) // openTok?.toggleVideo(call: call, result: result)
//
default: // default:
result(FlutterMethodNotImplemented) // result(FlutterMethodNotImplemented)
} // }
//
print("") // print("")
} // }
} // }
} }

@ -94,5 +94,13 @@
<false/> <false/>
<key>io.flutter.embedded_views_preview</key> <key>io.flutter.embedded_views_preview</key>
<true/> <true/>
<key>LSApplicationQueriesSchemes</key>
<array>
<string>comgooglemaps</string>
<string>baidumap</string>
<string>iosamap</string>
</array>
</dict> </dict>
</plist> </plist>

@ -6,7 +6,7 @@
// //
import Foundation import Foundation
import OpenTok //import OpenTok
import UIKit import UIKit
enum SdkState: String { enum SdkState: String {
@ -17,163 +17,164 @@ enum SdkState: String {
} }
class OpenTok : NSObject{ class OpenTok : NSObject{
private var mainViewController:MainFlutterVC!
private var registrar:FlutterPluginRegistrar?
var methodChannel: FlutterMethodChannel?
init(mainViewController:MainFlutterVC, registrar:FlutterPluginRegistrar?){ // private var mainViewController:MainFlutterVC!
self.mainViewController = mainViewController // private var registrar:FlutterPluginRegistrar?
self.methodChannel = FlutterMethodChannel(name: "OpenTok-Platform-Bridge", binaryMessenger: mainViewController.binaryMessenger) // var methodChannel: FlutterMethodChannel?
self.registrar = registrar //
// init(mainViewController:MainFlutterVC, registrar:FlutterPluginRegistrar?){
let remoteVDOFactory = OpenTokRemoteVideoFactory(messenger: registrar!.messenger()) // self.mainViewController = mainViewController
registrar?.register(remoteVDOFactory, withId: "remote-video-container") // self.methodChannel = FlutterMethodChannel(name: "OpenTok-Platform-Bridge", binaryMessenger: mainViewController.binaryMessenger)
// self.registrar = registrar
let localVDOFactory = OpenTokLocalVideoFactory(messenger: registrar!.messenger()) //
registrar?.register(localVDOFactory, withId: "local-video-container") // let remoteVDOFactory = OpenTokRemoteVideoFactory(messenger: registrar!.messenger())
} // registrar?.register(remoteVDOFactory, withId: "remote-video-container")
//
var otSession: OTSession? // let localVDOFactory = OpenTokLocalVideoFactory(messenger: registrar!.messenger())
// registrar?.register(localVDOFactory, withId: "local-video-container")
var subscriber: OTSubscriber? // }
lazy var publisher: OTPublisher = { //
let settings = OTPublisherSettings() // var otSession: OTSession?
settings.name = UIDevice.current.name //
return OTPublisher(delegate: self, settings: settings)! // var subscriber: OTSubscriber?
}() // lazy var publisher: OTPublisher = {
// let settings = OTPublisherSettings()
func initSession(call:FlutterMethodCall, result: @escaping FlutterResult){ // settings.name = UIDevice.current.name
if let arguments = call.arguments as? [String: String], // return OTPublisher(delegate: self, settings: settings)!
let apiKey = arguments["apiKey"], // }()
let sessionId = arguments["sessionId"], //
let token = arguments["token"]{ // func initSession(call:FlutterMethodCall, result: @escaping FlutterResult){
// if let arguments = call.arguments as? [String: String],
var error: OTError? // let apiKey = arguments["apiKey"],
defer { // let sessionId = arguments["sessionId"],
// todo // let token = arguments["token"]{
} //
// var error: OTError?
notifyFlutter(state: SdkState.wait) // defer {
otSession = OTSession(apiKey: apiKey, sessionId: sessionId, delegate: self)! // // todo
otSession?.connect(withToken: token, error: &error) // }
//
result("") // notifyFlutter(state: SdkState.wait)
}else{ // otSession = OTSession(apiKey: apiKey, sessionId: sessionId, delegate: self)!
// otSession?.connect(withToken: token, error: &error)
} //
// result("")
} // }else{
//
// }
func swapCamera(call:FlutterMethodCall, result: @escaping FlutterResult) { //
if publisher.cameraPosition == .front { // }
publisher.cameraPosition = .back //
} else { //
publisher.cameraPosition = .front // func swapCamera(call:FlutterMethodCall, result: @escaping FlutterResult) {
} // if publisher.cameraPosition == .front {
result("") // publisher.cameraPosition = .back
} // } else {
// publisher.cameraPosition = .front
func toggleAudio(call:FlutterMethodCall, result: @escaping FlutterResult) { // }
if let arguments = call.arguments as? [String: Bool], // result("")
let publishAudio = arguments["publishAudio"] { // }
publisher.publishAudio = !publisher.publishAudio //
} // func toggleAudio(call:FlutterMethodCall, result: @escaping FlutterResult) {
result("") // if let arguments = call.arguments as? [String: Bool],
} // let publishAudio = arguments["publishAudio"] {
// publisher.publishAudio = !publisher.publishAudio
func toggleVideo(call:FlutterMethodCall, result: @escaping FlutterResult) { // }
if let arguments = call.arguments as? [String: Bool], // result("")
let publishVideo = arguments["publishVideo"] { // }
publisher.publishVideo = !publisher.publishVideo //
} // func toggleVideo(call:FlutterMethodCall, result: @escaping FlutterResult) {
result("") // if let arguments = call.arguments as? [String: Bool],
} // let publishVideo = arguments["publishVideo"] {
// publisher.publishVideo = !publisher.publishVideo
// }
func notifyFlutter(state: SdkState) { // result("")
methodChannel?.invokeMethod("updateState", arguments: state.rawValue) // }
} //
//
} // func notifyFlutter(state: SdkState) {
// methodChannel?.invokeMethod("updateState", arguments: state.rawValue)
extension OpenTok: OTSessionDelegate { // }
func sessionDidConnect(_ sessionDelegate: OTSession) { //
print("The client connected to the session.") //}
notifyFlutter(state: SdkState.loggedIn) //
//extension OpenTok: OTSessionDelegate {
var error: OTError? // func sessionDidConnect(_ sessionDelegate: OTSession) {
defer { // print("The client connected to the session.")
// todo // notifyFlutter(state: SdkState.loggedIn)
} //
// var error: OTError?
self.otSession?.publish(self.publisher, error: &error) // defer {
// // todo
if let pubView = self.publisher.view { // }
pubView.frame = CGRect(x: 0, y: 0, width: 200, height: 300) //
// self.otSession?.publish(self.publisher, error: &error)
if OpenTokLocalVideoFactory.view == nil { //
OpenTokLocalVideoFactory.viewToAddPub = pubView // if let pubView = self.publisher.view {
} else { // pubView.frame = CGRect(x: 0, y: 0, width: 200, height: 300)
OpenTokLocalVideoFactory.view?.addPublisherView(pubView) //
} // if OpenTokLocalVideoFactory.view == nil {
} // OpenTokLocalVideoFactory.viewToAddPub = pubView
} // } else {
// OpenTokLocalVideoFactory.view?.addPublisherView(pubView)
func sessionDidDisconnect(_ session: OTSession) { // }
print("The client disconnected from the session.") // }
notifyFlutter(state: SdkState.loggedOut) // }
} //
// func sessionDidDisconnect(_ session: OTSession) {
func session(_ session: OTSession, didFailWithError error: OTError) { // print("The client disconnected from the session.")
print("The client failed to connect to the session: \(error).") // notifyFlutter(state: SdkState.loggedOut)
} // }
//
func session(_ session: OTSession, streamCreated stream: OTStream) { // func session(_ session: OTSession, didFailWithError error: OTError) {
print("A stream was created in the session.") // print("The client failed to connect to the session: \(error).")
var error: OTError? // }
defer { //
// todo // func session(_ session: OTSession, streamCreated stream: OTStream) {
} // print("A stream was created in the session.")
subscriber = OTSubscriber(stream: stream, delegate: self) // var error: OTError?
// defer {
session.subscribe(subscriber!, error: &error) // // todo
} // }
// subscriber = OTSubscriber(stream: stream, delegate: self)
func session(_ session: OTSession, streamDestroyed stream: OTStream) { //
print("A stream was destroyed in the session.") // session.subscribe(subscriber!, error: &error)
} // }
} //
// func session(_ session: OTSession, streamDestroyed stream: OTStream) {
extension OpenTok: OTPublisherDelegate { // print("A stream was destroyed in the session.")
func publisher(_ publisher: OTPublisherKit, streamCreated stream: OTStream) { // }
} //}
//
func publisher(_ publisher: OTPublisherKit, streamDestroyed stream: OTStream) { //extension OpenTok: OTPublisherDelegate {
} // func publisher(_ publisher: OTPublisherKit, streamCreated stream: OTStream) {
// }
func publisher(_ publisher: OTPublisherKit, didFailWithError error: OTError) { //
print("Publisher failed: \(error.localizedDescription)") // func publisher(_ publisher: OTPublisherKit, streamDestroyed stream: OTStream) {
} // }
} //
// func publisher(_ publisher: OTPublisherKit, didFailWithError error: OTError) {
extension OpenTok: OTSubscriberDelegate { // print("Publisher failed: \(error.localizedDescription)")
func subscriberDidConnect(toStream subscriberKit: OTSubscriberKit) { // }
print("Subscriber connected") //}
//
if let subView = self.subscriber?.view { //extension OpenTok: OTSubscriberDelegate {
subView.frame = CGRect(x: 0, y: 0, width: UIScreen.main.bounds.width, height: UIScreen.main.bounds.height) // func subscriberDidConnect(toStream subscriberKit: OTSubscriberKit) {
// print("Subscriber connected")
if OpenTokRemoteVideoFactory.view == nil { //
OpenTokRemoteVideoFactory.viewToAddSub = subView // if let subView = self.subscriber?.view {
} else { // subView.frame = CGRect(x: 0, y: 0, width: UIScreen.main.bounds.width, height: UIScreen.main.bounds.height)
OpenTokRemoteVideoFactory.view?.addSubscriberView(subView) //
} // if OpenTokRemoteVideoFactory.view == nil {
} // OpenTokRemoteVideoFactory.viewToAddSub = subView
} // } else {
// OpenTokRemoteVideoFactory.view?.addSubscriberView(subView)
func subscriber(_ subscriber: OTSubscriberKit, didFailWithError error: OTError) { // }
print("Subscriber failed: \(error.localizedDescription)") // }
} // }
//
// func subscriber(_ subscriber: OTSubscriberKit, didFailWithError error: OTError) {
// print("Subscriber failed: \(error.localizedDescription)")
// }
} }

@ -2,13 +2,20 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0"> <plist version="1.0">
<dict> <dict>
<!-- <key>com.apple.developer.networking.HotspotHelper</key>-->
<!-- <true/>-->
<key>aps-environment</key> <key>aps-environment</key>
<string>development</string> <string>development</string>
<key>com.apple.developer.healthkit</key>
<true/>
<key>com.apple.developer.healthkit.access</key>
<array/>
<key>com.apple.developer.networking.HotspotConfiguration</key> <key>com.apple.developer.networking.HotspotConfiguration</key>
<true/> <true/>
<key>com.apple.developer.networking.wifi-info</key> <key>com.apple.developer.networking.wifi-info</key>
<true/> <true/>
<key>com.apple.developer.nfc.readersession.formats</key>
<array>
<string>NDEF</string>
<string>TAG</string>
</array>
</dict> </dict>
</plist> </plist>

@ -15,7 +15,7 @@ const PACKAGES_CUSTOMER = '/api/customers';
const PACKAGES_SHOPPING_CART = '/api/shopping_cart_items'; const PACKAGES_SHOPPING_CART = '/api/shopping_cart_items';
const PACKAGES_ORDERS = '/api/orders'; const PACKAGES_ORDERS = '/api/orders';
const PACKAGES_TAMARA_OPT = '/api/orders/paymentoptions/tamara'; const PACKAGES_TAMARA_OPT = '/api/orders/paymentoptions/tamara';
const BASE_URL = 'https://uat.hmgwebservices.com/'; const BASE_URL = 'https://uat.hmgwebservices.com/';
// const BASE_URL = 'https://hmgwebservices.com/'; // const BASE_URL = 'https://hmgwebservices.com/';
// Pharmacy UAT URLs // Pharmacy UAT URLs
@ -68,7 +68,9 @@ const GET_DOCTOR_RATING_DETAILS =
const GET_DOCTOR_RATING = 'Services/Doctors.svc/REST/dr_GetAvgDoctorRating'; const GET_DOCTOR_RATING = 'Services/Doctors.svc/REST/dr_GetAvgDoctorRating';
///Prescriptions ///Prescriptions
const PRESCRIPTIONS = 'Services/Patients.svc/REST/GetPrescriptionApptList'; // const PRESCRIPTIONS = 'Services/Patients.svc/REST/GetPrescriptionApptList';
const PRESCRIPTIONS = 'Services/Patients.svc/REST/GetPrescriptionApptList_Async';
const GET_PRESCRIPTIONS_ALL_ORDERS = const GET_PRESCRIPTIONS_ALL_ORDERS =
'Services/Patients.svc/REST/PatientER_GetPatientAllPresOrders'; 'Services/Patients.svc/REST/PatientER_GetPatientAllPresOrders';
const GET_PRESCRIPTION_REPORT = const GET_PRESCRIPTION_REPORT =
@ -255,7 +257,7 @@ const GET_PATIENT_SHARE =
//URL to get patient appointment history //URL to get patient appointment history
const GET_PATIENT_APPOINTMENT_HISTORY = const GET_PATIENT_APPOINTMENT_HISTORY =
"Services/Doctors.svc/REST/PateintHasAppoimentHistory"; "Services/Doctors.svc/REST/PateintHasAppoimentHistory_Async";
const DOCTOR_SCHEDULE_URL = const DOCTOR_SCHEDULE_URL =
'Services/Doctors.svc/REST/GetDoctorWorkingHoursTable'; 'Services/Doctors.svc/REST/GetDoctorWorkingHoursTable';
@ -570,7 +572,10 @@ const TRANSFER_YAHALA_LOYALITY_POINTS =
"Services/Patients.svc/REST/TransferYaHalaLoyaltyPoints"; "Services/Patients.svc/REST/TransferYaHalaLoyaltyPoints";
const LAKUM_GET_USER_TERMS_AND_CONDITIONS = const LAKUM_GET_USER_TERMS_AND_CONDITIONS =
"Services/ERP.svc/REST/GetUserTermsAndConditionsForEPharmcy"; "Services/ERP.svc/REST/GetUserTermsAndConditionsForEPharmcy";
const PRESCRIPTION = 'Services/Patients.svc/REST/GetPrescriptionApptList';
// const PRESCRIPTION = 'Services/Patients.svc/REST/GetPrescriptionApptList';
const PRESCRIPTION = 'Services/Patients.svc/REST/GetPrescriptionApptList_Async';
const GET_RECOMMENDED_PRODUCT = 'alsoProduct/'; const GET_RECOMMENDED_PRODUCT = 'alsoProduct/';
const GET_MOST_VIEWED_PRODUCTS = "mostview"; const GET_MOST_VIEWED_PRODUCTS = "mostview";
const GET_NEW_PRODUCTS = "newproducts"; const GET_NEW_PRODUCTS = "newproducts";

@ -50,7 +50,8 @@ const Map localizedValues = {
'searchByDocText': {'en': 'Type the name of the doctor to help you find him', 'ar': 'اكتب اسم الطبيب لمساعدتك في العثور عليه'}, 'searchByDocText': {'en': 'Type the name of the doctor to help you find him', 'ar': 'اكتب اسم الطبيب لمساعدتك في العثور عليه'},
'enterDocName': {'en': 'Enter Doctor name', 'ar': 'أدخل إسم الطبيب'}, 'enterDocName': {'en': 'Enter Doctor name', 'ar': 'أدخل إسم الطبيب'},
'search': {'en': 'Search', 'ar': 'بحث'}, 'search': {'en': 'Search', 'ar': 'بحث'},
'noResultFound': {'en': 'No Result Found', 'ar': 'لم يتم العثور على نتائج'}, 'noResultFound': {'en': 'No Result Found', 'ar': 'لم يتم العثور على نتائج '},
'noSearchResultFound': {'en': 'No Result Found', 'ar': 'لم يتم العثور على نتائج الرجاء تغيير لغة البحث'},
'pleaseEnterProductName': {'en': 'Please Enter Product Name', 'ar': 'ادخل اسم المنتج'}, 'pleaseEnterProductName': {'en': 'Please Enter Product Name', 'ar': 'ادخل اسم المنتج'},
'bookNow': {'en': 'BOOK NOW', 'ar': 'احجز الآن'}, 'bookNow': {'en': 'BOOK NOW', 'ar': 'احجز الآن'},
'docInfo': {'en': 'Doctor Information', 'ar': 'معلومات الطبيب'}, 'docInfo': {'en': 'Doctor Information', 'ar': 'معلومات الطبيب'},
@ -277,6 +278,8 @@ const Map localizedValues = {
"viewAll": {"en": "View All", 'ar': 'عرض الكل'}, "viewAll": {"en": "View All", 'ar': 'عرض الكل'},
"view": {"en": "View", 'ar': 'عرض'}, "view": {"en": "View", 'ar': 'عرض'},
"ContactUs": {"en": "Contact Us", 'ar': 'الوصول إلينا'}, "ContactUs": {"en": "Contact Us", 'ar': 'الوصول إلينا'},
"contactUsLocation": {"en": "P.O.Box: 91877 - Riyadh 11643, King Fahad Road - Olaya - Kingdom of Saudi Arabia", 'ar': 'صندوق بريد: 91877 - الرياض 11643 ، طريق الملك فهد - العليا - المملكة العربية السعودية'},
"contactUsTime": {"en": "Saturday - Wednesday 8:00 AM - 10 PM, Thursday 8:00 AM- 8:00 PM, Friday 2:00 PM - 8:00 PM", 'ar': " السبت الأربعاء 08:00 ص 10:00 م , الخميس 08:00 ص 08:00 م, الجمعة 02:00 م - 08:00 م"},
"ViewAllWaysReachUs": {"en": "View All Ways Reach Us", 'ar': 'جميع طرق الاتصال بنا'}, "ViewAllWaysReachUs": {"en": "View All Ways Reach Us", 'ar': 'جميع طرق الاتصال بنا'},
"medicalProfile": {"en": "Medical Profile", 'ar': 'الملف الطبي'}, "medicalProfile": {"en": "Medical Profile", 'ar': 'الملف الطبي'},
"consultation": {"en": "Consultation", "ar": "استشارة"}, "consultation": {"en": "Consultation", "ar": "استشارة"},
@ -507,7 +510,11 @@ const Map localizedValues = {
"reachUs": {"en": "Reach Us", "ar": "الوصول لنا"}, "reachUs": {"en": "Reach Us", "ar": "الوصول لنا"},
"ourLocations": {"en": "Our Locations", "ar": "مواقعنا"}, "ourLocations": {"en": "Our Locations", "ar": "مواقعنا"},
"edit": {"en": "Edit", "ar": "تعديل"}, "edit": {"en": "Edit", "ar": "تعديل"},
"whatsApp": {"en": "Whats App", "ar": " واتس اب"},
"phone": {"en": "Phone", "ar": " موبايل"},
"delete": {"en": "Delete", "ar": " حذف"}, "delete": {"en": "Delete", "ar": " حذف"},
"deleteAddress": {"en": "Are you sure want to delete", "ar": " هل انت متأكد تريد حذف هذا العنوان"},
"deletedAddres": {"en": "Address has been deleted", "ar": " تم حذف العنوان"},
"addAddress": {"en": "ADD A NEW ADDRESS", "ar": " اضافة عنوان جديد"}, "addAddress": {"en": "ADD A NEW ADDRESS", "ar": " اضافة عنوان جديد"},
"addNewAddress": {"en": "Add New Address", "ar": " اضافة عنوان جديد"}, "addNewAddress": {"en": "Add New Address", "ar": " اضافة عنوان جديد"},
"order": {"en": "My Order", "ar": " طلباتي"}, "order": {"en": "My Order", "ar": " طلباتي"},
@ -802,7 +809,7 @@ const Map localizedValues = {
"HealthTipsBasedOnCurrentWeather": {"en": "Health Tips Based On Current Weather", 'ar': ' نصائح صحية بناءاً على الطقس الحالي '}, "HealthTipsBasedOnCurrentWeather": {"en": "Health Tips Based On Current Weather", 'ar': ' نصائح صحية بناءاً على الطقس الحالي '},
"MoreDetails": {"en": "More details", "ar": " المزيد من التفاصيل "}, "MoreDetails": {"en": "More details", "ar": " المزيد من التفاصيل "},
"SendCopy": {"en": "Send Copy", "ar": "ارسال نسخة"}, "SendCopy": {"en": "Send Copy", "ar": "ارسال نسخة"},
"ResendOrder": {"en": "Refill Order & Delivery", "ar": "إعادة طلب و توصيل"}, "ResendOrder": {"en": "Re-Order & Delivery", "ar": "إعادة طلب و توصيل"},
"Ports": {"en": "Ports", "ar": "المنافذ"}, "Ports": {"en": "Ports", "ar": "المنافذ"},
"Way": {"en": "Way", "ar": "الطريقة"}, "Way": {"en": "Way", "ar": "الطريقة"},
"Average": {"en": "Average", "ar": "متوسط"}, "Average": {"en": "Average", "ar": "متوسط"},

@ -3,7 +3,7 @@ class PatientLabSpecialResult {
String moduleID; String moduleID;
String resultData; String resultData;
String resultDataHTML; String resultDataHTML;
Null resultDataTxt; dynamic resultDataTxt;
PatientLabSpecialResult( PatientLabSpecialResult(
{this.invoiceNo, {this.invoiceNo,

@ -1,11 +1,11 @@
import 'PointsAmountPerday.dart'; import 'PointsAmountPerday.dart';
class PointsAmountPerMonth { class PointsAmountPerMonth {
double amountPerMonth; dynamic amountPerMonth;
String month; dynamic month;
int monthNumber; int monthNumber;
List<PointsAmountPerday> pointsAmountPerday; List<PointsAmountPerday> pointsAmountPerday;
double pointsPerMonth; dynamic pointsPerMonth;
PointsAmountPerMonth( PointsAmountPerMonth(
{this.amountPerMonth, {this.amountPerMonth,

@ -31,6 +31,7 @@ class Orders {
String orderStatusn; String orderStatusn;
bool canCancel; bool canCancel;
bool canRefund; bool canRefund;
String orderGuid;
dynamic customerId; dynamic customerId;
dynamic orderSubtotalExclTax; dynamic orderSubtotalExclTax;
dynamic orderShippingExclTax; dynamic orderShippingExclTax;
@ -47,6 +48,7 @@ class Orders {
this.orderStatusn, this.orderStatusn,
this.canCancel, this.canCancel,
this.canRefund, this.canRefund,
this.orderGuid,
this.customerId, this.customerId,
this.orderShippingExclTax, this.orderShippingExclTax,
this.orderSubtotalExclTax, this.orderSubtotalExclTax,
@ -63,6 +65,7 @@ class Orders {
orderStatusn = json['order_statusn']; orderStatusn = json['order_statusn'];
canCancel = json['can_cancel']; canCancel = json['can_cancel'];
canRefund = json['can_refund']; canRefund = json['can_refund'];
orderGuid = json['order_guid'];
customerId = json['customer_id']; customerId = json['customer_id'];
orderSubtotalExclTax= json["order_subtotal_excl_tax"]; orderSubtotalExclTax= json["order_subtotal_excl_tax"];
orderShippingExclTax= json["order_shipping_excl_tax"]; orderShippingExclTax= json["order_shipping_excl_tax"];

@ -232,7 +232,7 @@ class BaseAppClient {
Map<String, String> headers = { Map<String, String> headers = {
'Content-Type': 'application/json', 'Content-Type': 'application/json',
'Accept': 'application/json', 'Accept': 'application/json',
'Authorization': token ?? '', 'Authorization': pharmacyToken ?? '',
'Mobilenumber': user != null ? Utils.getPhoneNumberWithoutZero(user['MobileNumber'].toString()) : "", 'Mobilenumber': user != null ? Utils.getPhoneNumberWithoutZero(user['MobileNumber'].toString()) : "",
'Statictoken': 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9', 'Statictoken': 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9',
'Username': user != null ? user['PatientID'].toString() : "", 'Username': user != null ? user['PatientID'].toString() : "",
@ -291,20 +291,21 @@ class BaseAppClient {
body['PatientID'] = body['PatientID'] != null ? body['PatientID'] : user['PatientID']; body['PatientID'] = body['PatientID'] != null ? body['PatientID'] : user['PatientID'];
body['PatientOutSA'] = user['OutSA']; body['PatientOutSA'] = user['OutSA'];
body['SessionID'] = SESSION_ID; //getSe body['SessionID'] = SESSION_ID; //getSe
headers = { // headers = {
'Content-Type': 'application/json', // 'Content-Type': 'application/json',
'Accept': 'application/json', // 'Accept': 'application/json',
'Authorization': pharmacyToken, // 'Authorization': pharmacyToken,
'Mobilenumber': user['MobileNumber'].toString(), // 'Mobilenumber': user['MobileNumber'].toString(),
'Statictoken': 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9', // 'Statictoken': 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9',
'Username': user['PatientID'].toString(), // 'Username': user['PatientID'].toString(),
}; // };
} }
} }
} }
print("URL : $url"); print("URL : $url");
print("Body : ${json.encode(body)}"); print("Body : ${json.encode(body)}");
print("Headers : ${json.encode(headers)}");
if (await Utils.checkConnection()) { if (await Utils.checkConnection()) {
final response = await http.post(Uri.parse(url.trim()), body: json.encode(body), headers: headers); final response = await http.post(Uri.parse(url.trim()), body: json.encode(body), headers: headers);
@ -490,6 +491,7 @@ class BaseAppClient {
}) async { }) async {
String url = fullUrl; String url = fullUrl;
print("URL Query String: $url"); print("URL Query String: $url");
print("body: $body");
if (await Utils.checkConnection()) { if (await Utils.checkConnection()) {
headers.addAll({'Content-Type': 'application/json', 'Accept': 'application/json'}); headers.addAll({'Content-Type': 'application/json', 'Accept': 'application/json'});
@ -502,6 +504,8 @@ class BaseAppClient {
print("statusCode :$statusCode"); print("statusCode :$statusCode");
if (await handleUnauthorized(statusCode, forUrl: fullUrl)) simplePost(fullUrl, onFailure: onFailure, onSuccess: onSuccess, body: body, headers: headers); if (await handleUnauthorized(statusCode, forUrl: fullUrl)) simplePost(fullUrl, onFailure: onFailure, onSuccess: onSuccess, body: body, headers: headers);
print(response.body.toString());
if (statusCode < 200 || statusCode >= 400 || json == null) { if (statusCode < 200 || statusCode >= 400 || json == null) {
onFailure('Error While Fetching data', statusCode); onFailure('Error While Fetching data', statusCode);
} else { } else {
@ -706,7 +710,6 @@ class BaseAppClient {
body['PatientTypeID'] = body.containsKey('PatientTypeID') body['PatientTypeID'] = body.containsKey('PatientTypeID')
? body['PatientTypeID'] != null ? body['PatientTypeID'] != null
? body['PatientTypeID'] ? body['PatientTypeID']
: user['PatientType'] != null : user['PatientType'] != null
? user['PatientType'] ? user['PatientType']

@ -176,7 +176,7 @@ class OrderPreviewService extends BaseService {
} }
} }
Future makeOrder(PaymentCheckoutData paymentCheckoutData, List<ShoppingCart> shoppingCarts) async { Future makeOrder(PaymentCheckoutData paymentCheckoutData, List<ShoppingCart> shoppingCarts, bool isLakumEnabled) async {
paymentCheckoutData.address.isChecked = true; paymentCheckoutData.address.isChecked = true;
hasError = false; hasError = false;
super.error = ""; super.error = "";
@ -201,7 +201,7 @@ class OrderPreviewService extends BaseService {
orderBody['custom_values_xml'] = "PaymentOption:${getPaymentOptionName(paymentCheckoutData.paymentOption)}"; orderBody['custom_values_xml'] = "PaymentOption:${getPaymentOptionName(paymentCheckoutData.paymentOption)}";
orderBody['shippingOption'] = paymentCheckoutData.shippingOption; orderBody['shippingOption'] = paymentCheckoutData.shippingOption;
orderBody['shipping_address'] = paymentCheckoutData.address; orderBody['shipping_address'] = paymentCheckoutData.address;
orderBody['lakum_amount'] = paymentCheckoutData.usedLakumPoints; orderBody['lakum_amount'] = isLakumEnabled ? paymentCheckoutData.usedLakumPoints : 0;
List<Map<String, dynamic>> itemsList = List(); List<Map<String, dynamic>> itemsList = List();
shoppingCarts.forEach((item) { shoppingCarts.forEach((item) {

@ -91,8 +91,11 @@ class PharmacyCategoriseService extends BaseService {
Future searchProducts({String productName}) async { Future searchProducts({String productName}) async {
hasError = false; hasError = false;
_searchList.clear(); _searchList.clear();
// the language ID in pharmacy is different not same in patient app, en == 1 , ar == 2
var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
var languageId = languageID == 'ar' ? 2 : 1;
String endPoint = productName != null String endPoint = productName != null
? GET_SEARCH_PRODUCTS + "$productName" + '&language_id=1' ? GET_SEARCH_PRODUCTS + "$productName" + '&language_id=' + "$languageId"
: GET_SEARCH_PRODUCTS + ""; : GET_SEARCH_PRODUCTS + "";
await baseAppClient.getPharmacy( await baseAppClient.getPharmacy(
endPoint, endPoint,

@ -209,11 +209,11 @@ class OrderPreviewViewModel extends BaseViewModel {
}); });
} }
Future makeOrder() async { Future makeOrder(bool isLakumEnabled) async {
setState(ViewState.Busy); setState(ViewState.Busy);
await pharmacyModuleViewModel.generatePharmacyToken(); await pharmacyModuleViewModel.generatePharmacyToken();
await _orderService.makeOrder(paymentCheckoutData, cartResponse.shoppingCarts); await _orderService.makeOrder(paymentCheckoutData, cartResponse.shoppingCarts, isLakumEnabled);
if (_orderService.hasError) { if (_orderService.hasError) {
error = _orderService.error; error = _orderService.error;
setState(ViewState.ErrorLocal); setState(ViewState.ErrorLocal);

@ -1,11 +1,9 @@
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/Addresses.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/Country.dart'; import 'package:diplomaticquarterapp/core/model/pharmacies/Country.dart';
import 'package:diplomaticquarterapp/core/service/AlHabibMedicalService/customer_addresses_service.dart'; import 'package:diplomaticquarterapp/core/service/AlHabibMedicalService/customer_addresses_service.dart';
import 'package:diplomaticquarterapp/services/pharmacy_services/pharmacyAddress_service.dart'; import 'package:diplomaticquarterapp/services/pharmacy_services/pharmacyAddress_service.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:flutter_webrtc/flutter_webrtc.dart';
import 'package:google_maps_place_picker/google_maps_place_picker.dart'; import 'package:google_maps_place_picker/google_maps_place_picker.dart';
import '../../../locator.dart'; import '../../../locator.dart';
@ -76,32 +74,23 @@ class PharmacyAddressesViewModel extends BaseViewModel {
sendingAddress.customerAttributes = ""; sendingAddress.customerAttributes = "";
sendingAddress.createdOnUtc = DateTime.now().toString(); sendingAddress.createdOnUtc = DateTime.now().toString();
if (editedAddress == null) { if (editedAddress == null) {
///TODO Fatima*
await _pharmacyAddressService.addCustomerAddress(sendingAddress); await _pharmacyAddressService.addCustomerAddress(sendingAddress);
} else { } else {
await _pharmacyAddressService.editCustomerAddress(sendingAddress); await _pharmacyAddressService.editCustomerAddress(sendingAddress).then((value) async {
// await _pharmacyAddressService.getAddresses();
});
} }
if (_pharmacyAddressService.hasError) { if (_pharmacyAddressService.hasError) {
await _pharmacyAddressService.getAddresses();
setState(ViewState.Idle); setState(ViewState.Idle);
// setState(ViewState.Error);
} else { } else {
setState(ViewState.Idle); setState(ViewState.Idle);
} }
} }
Future deleteAddresses(AddressInfo sendingAddress) async { Future deleteAddresses(AddressInfo address) async {
setState(ViewState.Busy); setState(ViewState.Busy);
await _pharmacyAddressService.deleteCustomerAddress(sendingAddress); await _pharmacyAddressService.deleteCustomerAddress(address);
if (_pharmacyAddressService.hasError) { if (_pharmacyAddressService.hasError) {
error = _pharmacyAddressService.error; error = _pharmacyAddressService.error;
setState(ViewState.Error); setState(ViewState.Error);

@ -49,9 +49,9 @@ class OrderModelViewModel extends BaseViewModel {
} }
} }
Future<OrderDetailModel> getOrderDetails(OrderId) async { Future<OrderDetailModel> getOrderDetails(OrderId, orderGUID) async {
setState(ViewState.Busy); setState(ViewState.Busy);
await _orderDetailsService.getOrderDetails(OrderId); await _orderDetailsService.getOrderDetails(OrderId, orderGUID);
if (_orderDetailsService.hasError) { if (_orderDetailsService.hasError) {
error = _orderDetailsService.error; error = _orderDetailsService.error;
setState(ViewState.Error); setState(ViewState.Error);

@ -9,6 +9,7 @@ import 'package:diplomaticquarterapp/theme/theme_value.dart';
import 'package:diplomaticquarterapp/uitl/LocalNotification.dart'; import 'package:diplomaticquarterapp/uitl/LocalNotification.dart';
import 'package:diplomaticquarterapp/uitl/PlatformBridge.dart'; import 'package:diplomaticquarterapp/uitl/PlatformBridge.dart';
import 'package:diplomaticquarterapp/uitl/navigation_service.dart'; import 'package:diplomaticquarterapp/uitl/navigation_service.dart';
import 'package:diplomaticquarterapp/uitl/push-notification-handler.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:firebase_core/firebase_core.dart'; import 'package:firebase_core/firebase_core.dart';
import 'package:firebase_messaging/firebase_messaging.dart'; import 'package:firebase_messaging/firebase_messaging.dart';
@ -25,14 +26,10 @@ import 'locator.dart';
import 'pages/pharmacies/compare-list.dart'; import 'pages/pharmacies/compare-list.dart';
Future<void> _firebaseMessagingBackgroundHandler(RemoteMessage message) async {
await Firebase.initializeApp();
print("Handling a background message: ${message.messageId}");
}
void main() async { void main() async {
WidgetsFlutterBinding.ensureInitialized(); WidgetsFlutterBinding.ensureInitialized();
// FirebaseMessaging.onBackgroundMessage(_firebaseMessagingBackgroundHandler);
await Firebase.initializeApp(); await Firebase.initializeApp();
setupLocator(); setupLocator();
runApp(MyApp()); runApp(MyApp());
@ -74,6 +71,7 @@ class _MyApp extends State<MyApp> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
PlatformBridge.init(context); PlatformBridge.init(context);
PushNotificationHandler(context).init(); // Asyncronously
LocalNotification.init(onNotificationClick: (payload) { LocalNotification.init(onNotificationClick: (payload) {
LocalNotification.getInstance().showNow(title: "Payload", subtitle: payload, payload: payload); LocalNotification.getInstance().showNow(title: "Payload", subtitle: payload, payload: payload);

@ -9,6 +9,7 @@ class DoctorList {
int actualDoctorRate; int actualDoctorRate;
int clinicRoomNo; int clinicRoomNo;
dynamic date; dynamic date;
dynamic appointmentDate;
dynamic dayName; dynamic dayName;
int doctorID; int doctorID;
String doctorImageURL; String doctorImageURL;
@ -53,6 +54,7 @@ class DoctorList {
this.actualDoctorRate, this.actualDoctorRate,
this.clinicRoomNo, this.clinicRoomNo,
this.date, this.date,
this.appointmentDate,
this.dayName, this.dayName,
this.doctorID, this.doctorID,
this.doctorImageURL, this.doctorImageURL,
@ -97,6 +99,7 @@ class DoctorList {
actualDoctorRate = json['ActualDoctorRate']; actualDoctorRate = json['ActualDoctorRate'];
clinicRoomNo = json['ClinicRoomNo']; clinicRoomNo = json['ClinicRoomNo'];
date = json['Date']; date = json['Date'];
appointmentDate = json['AppointmentDate'];
dayName = json['DayName']; dayName = json['DayName'];
doctorID = json['DoctorID']; doctorID = json['DoctorID'];
doctorImageURL = json['DoctorImageURL']; doctorImageURL = json['DoctorImageURL'];

@ -71,7 +71,6 @@ class NewTextFields extends StatefulWidget {
this.onTap, this.onTap,
this.fontSize = 16.0, this.fontSize = 16.0,
this.fontWeight = FontWeight.w700, this.fontWeight = FontWeight.w700,
this.autoValidate = false,
this.hintColor,this.isEnabled=true}) this.hintColor,this.isEnabled=true})
: super(key: key); : super(key: key);
@ -104,7 +103,6 @@ class NewTextFields extends StatefulWidget {
final bool keepPadding; final bool keepPadding;
final TextCapitalization textCapitalization; final TextCapitalization textCapitalization;
final List<TextInputFormatter> inputFormatters; final List<TextInputFormatter> inputFormatters;
final bool autoValidate;
final EdgeInsets padding; final EdgeInsets padding;
final bool focus; final bool focus;
final bool borderOnlyError; final bool borderOnlyError;

@ -90,7 +90,6 @@ class _BookConfirmState extends State<BookConfirm> {
null, null,
widget.doctor.noOfPatientsRate, widget.doctor.noOfPatientsRate,
"", "",
), ),
isNeedToShowButton: false, isNeedToShowButton: false,
), ),
@ -201,10 +200,10 @@ class _BookConfirmState extends State<BookConfirm> {
disabledTextColor: Colors.white, disabledTextColor: Colors.white,
disabledColor: new Color(0xFFbcc2c4), disabledColor: new Color(0xFFbcc2c4),
onPressed: () async { onPressed: () async {
if (!(await this.sharedPref.getBool(IS_LIVECARE_APPOINTMENT)??false)) { if (await this.sharedPref.getBool(IS_LIVECARE_APPOINTMENT) != null && !await this.sharedPref.getBool(IS_LIVECARE_APPOINTMENT)) {
insertAppointment(context, widget.doctor);
} else {
insertLiveCareScheduledAppointment(context, widget.doctor); insertLiveCareScheduledAppointment(context, widget.doctor);
} else {
insertAppointment(context, widget.doctor);
} }
}, },
child: Text(TranslationBase.of(context).bookAppo, style: TextStyle(fontSize: 16.0, letterSpacing: -0.48)), child: Text(TranslationBase.of(context).bookAppo, style: TextStyle(fontSize: 16.0, letterSpacing: -0.48)),
@ -250,7 +249,7 @@ class _BookConfirmState extends State<BookConfirm> {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
Future.delayed(new Duration(milliseconds: 1500), () async { Future.delayed(new Duration(milliseconds: 1500), () async {
if (!await this.sharedPref.getBool(IS_LIVECARE_APPOINTMENT)) { if (await this.sharedPref.getBool(IS_LIVECARE_APPOINTMENT) != null && !await this.sharedPref.getBool(IS_LIVECARE_APPOINTMENT)) {
insertAppointment(context, widget.doctor); insertAppointment(context, widget.doctor);
} else { } else {
insertLiveCareScheduledAppointment(context, widget.doctor); insertLiveCareScheduledAppointment(context, widget.doctor);
@ -377,7 +376,6 @@ class _BookConfirmState extends State<BookConfirm> {
getLiveCareAppointmentPatientShare(context, String appointmentNo, int clinicID, int projectID, DoctorList docObject) { getLiveCareAppointmentPatientShare(context, String appointmentNo, int clinicID, int projectID, DoctorList docObject) {
widget.service.getLiveCareAppointmentPatientShare(appointmentNo, clinicID, projectID, context).then((res) { widget.service.getLiveCareAppointmentPatientShare(appointmentNo, clinicID, projectID, context).then((res) {
print(res);
widget.patientShareResponse = new PatientShareResponse.fromJson(res); widget.patientShareResponse = new PatientShareResponse.fromJson(res);
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
navigateToBookSuccess(context, docObject, widget.patientShareResponse); navigateToBookSuccess(context, docObject, widget.patientShareResponse);

@ -24,6 +24,8 @@ class _LiveCareBookAppointmentState extends State<LiveCareBookAppointment> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return AppScaffold( return AppScaffold(
showNewAppBarTitle: true,
showNewAppBar: true,
appBarTitle: TranslationBase.of(context).bookAppo, appBarTitle: TranslationBase.of(context).bookAppo,
isShowAppBar: true, isShowAppBar: true,
isShowDecPage: false, isShowDecPage: false,

@ -7,7 +7,6 @@ import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/avatar/large_avatar.dart'; import 'package:diplomaticquarterapp/widgets/avatar/large_avatar.dart';
import 'package:diplomaticquarterapp/widgets/data_display/medical/doctor_card.dart';
import 'package:diplomaticquarterapp/widgets/my_rich_text.dart'; import 'package:diplomaticquarterapp/widgets/my_rich_text.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -54,10 +53,20 @@ class DoctorView extends StatelessWidget {
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Text( Row(
children: [
Expanded(
child: Text(
doctor.name, doctor.name,
style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64, height: 25 / 16), style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64, height: 25 / 16),
), ),
),
Text(
DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(doctor.date)),
style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48, height: 18 / 12),
),
],
),
if (doctor.doctorTitle != null) SizedBox(height: 6), if (doctor.doctorTitle != null) SizedBox(height: 6),
Row( Row(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,

@ -5,6 +5,7 @@ import 'package:diplomaticquarterapp/core/viewModels/feedback/feedback_view_mode
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart'; import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart';
import 'package:diplomaticquarterapp/models/Appointments/appoDetailsButtons.dart'; import 'package:diplomaticquarterapp/models/Appointments/appoDetailsButtons.dart';
import 'package:diplomaticquarterapp/models/Appointments/toDoCountProviderModel.dart';
import 'package:diplomaticquarterapp/pages/BookAppointment/widgets/reminder_dialog.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/widgets/reminder_dialog.dart';
import 'package:diplomaticquarterapp/pages/MyAppointments/models/AppointmentType.dart'; import 'package:diplomaticquarterapp/pages/MyAppointments/models/AppointmentType.dart';
import 'package:diplomaticquarterapp/pages/MyAppointments/models/ArrivedButtons.dart'; import 'package:diplomaticquarterapp/pages/MyAppointments/models/ArrivedButtons.dart';
@ -14,6 +15,7 @@ import 'package:diplomaticquarterapp/pages/MyAppointments/models/BookedButtonsAl
import 'package:diplomaticquarterapp/pages/MyAppointments/models/ConfirmedButtons.dart'; import 'package:diplomaticquarterapp/pages/MyAppointments/models/ConfirmedButtons.dart';
import 'package:diplomaticquarterapp/pages/MyAppointments/models/ConfirmedButtonsAllowCheckIn.dart'; import 'package:diplomaticquarterapp/pages/MyAppointments/models/ConfirmedButtonsAllowCheckIn.dart';
import 'package:diplomaticquarterapp/pages/MyAppointments/widgets/askDocDialog.dart'; import 'package:diplomaticquarterapp/pages/MyAppointments/widgets/askDocDialog.dart';
import 'package:diplomaticquarterapp/pages/ToDoList/ToDo.dart';
import 'package:diplomaticquarterapp/pages/feedback/feedback_home_page.dart'; import 'package:diplomaticquarterapp/pages/feedback/feedback_home_page.dart';
import 'package:diplomaticquarterapp/pages/insurance/insurance_approval_screen.dart'; import 'package:diplomaticquarterapp/pages/insurance/insurance_approval_screen.dart';
import 'package:diplomaticquarterapp/pages/medical/labs/laboratory_result_page.dart'; import 'package:diplomaticquarterapp/pages/medical/labs/laboratory_result_page.dart';
@ -57,6 +59,7 @@ class _AppointmentActionsState extends State<AppointmentActions> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context); ProjectViewModel projectViewModel = Provider.of(context);
ToDoCountProviderModel model = Provider.of<ToDoCountProviderModel>(context);
var size = MediaQuery.of(context).size; var size = MediaQuery.of(context).size;
final double itemHeight = projectViewModel.isArabic ? ((size.height - kToolbarHeight - 24) * 0.5) / 2 : ((size.height - kToolbarHeight - 24) * 0.45) / 2; final double itemHeight = projectViewModel.isArabic ? ((size.height - kToolbarHeight - 24) * 0.5) / 2 : ((size.height - kToolbarHeight - 24) * 0.45) / 2;
final double itemWidth = size.width / 2; final double itemWidth = size.width / 2;
@ -72,7 +75,7 @@ class _AppointmentActionsState extends State<AppointmentActions> {
onTap: shouldEnable onTap: shouldEnable
? null ? null
: () { : () {
_handleButtonClicks(appoButtonsList[index]); _handleButtonClicks(appoButtonsList[index], model);
}, },
child: MedicalProfileItem( child: MedicalProfileItem(
title: appoButtonsList[index].title, title: appoButtonsList[index].title,
@ -88,7 +91,7 @@ class _AppointmentActionsState extends State<AppointmentActions> {
); );
} }
_handleButtonClicks(AppoDetailsButton) { _handleButtonClicks(AppoDetailsButton, ToDoCountProviderModel model) {
switch (AppoDetailsButton.caller) { switch (AppoDetailsButton.caller) {
case "openReschedule": case "openReschedule":
widget.tabController.animateTo((widget.tabController.index + 1) % 2); widget.tabController.animateTo((widget.tabController.index + 1) % 2);
@ -113,7 +116,8 @@ class _AppointmentActionsState extends State<AppointmentActions> {
); );
break; break;
case "goToTodoList": case "goToTodoList":
Navigator.of(context).pop(); // Navigator.of(context).pop();
navigateToToDoPage(context, model);
break; break;
case "askDoc": case "askDoc":
askYourDoc(); askYourDoc();
@ -556,6 +560,18 @@ class _AppointmentActionsState extends State<AppointmentActions> {
))); )));
} }
navigateToToDoPage(BuildContext context, ToDoCountProviderModel model) {
if (widget.projectViewModel.isLogin) {
if (model.count != 0) {
Navigator.push(context, FadePage(page: ToDo(isShowAppBar: true)));
} else {
AppToast.showErrorToast(message: TranslationBase.of(context).upcomingEmpty);
}
} else {
Navigator.push(context, FadePage(page: ToDo(isShowAppBar: true)));
}
}
rateAppointment() { rateAppointment() {
widget.browser = new MyInAppBrowser(); widget.browser = new MyInAppBrowser();
var url = 'http://hmg.com/SitePages/pso.aspx?p=' + widget.appo.projectID.toString() + '.' + widget.appo.appointmentNo.toString() + '&c=1'; var url = 'http://hmg.com/SitePages/pso.aspx?p=' + widget.appo.projectID.toString() + '.' + widget.appo.appointmentNo.toString() + '&c=1';

@ -1,216 +1,61 @@
import 'dart:async'; // import 'dart:async';
//
import 'package:diplomaticquarterapp/pages/conference/web_rtc/widgets/cam_view_widget.dart'; // import 'package:diplomaticquarterapp/pages/conference/web_rtc/widgets/cam_view_widget.dart';
import 'package:diplomaticquarterapp/pages/conference/widgets/noise_box.dart'; // import 'package:diplomaticquarterapp/pages/conference/widgets/noise_box.dart';
import 'package:diplomaticquarterapp/pages/webRTC/call_page.dart'; // import 'package:diplomaticquarterapp/pages/webRTC/signaling.dart';
import 'package:diplomaticquarterapp/pages/webRTC/signaling.dart'; // import 'package:flutter/material.dart';
import 'package:diplomaticquarterapp/uitl/SignalRUtil.dart'; // import 'package:flutter/services.dart';
import 'package:flutter/material.dart'; // // import 'package:flutter_webrtc/flutter_webrtc.dart';
import 'package:flutter/services.dart'; //
import 'package:flutter_webrtc/flutter_webrtc.dart'; // import '../conference_button_bar.dart';
//
import '../conference_button_bar.dart'; // class CallHomePage extends StatefulWidget {
// final String receiverId;
class CallHomePage extends StatefulWidget { // final String callerId;
final String receiverId; //
final String callerId; // const CallHomePage({Key key, this.receiverId, this.callerId}) : super(key: key);
//
const CallHomePage({Key key, this.receiverId, this.callerId}) : super(key: key); // @override
// _CallHomePageState createState() => _CallHomePageState();
@override // }
_CallHomePageState createState() => _CallHomePageState(); //
} // class _CallHomePageState extends State<CallHomePage> {
// bool showNoise = false;
class _CallHomePageState extends State<CallHomePage> { // // RTCVideoRenderer _localRenderer = RTCVideoRenderer();
bool showNoise = false; // // RTCVideoRenderer _remoteRenderer = RTCVideoRenderer();
RTCVideoRenderer _localRenderer = RTCVideoRenderer(); //
RTCVideoRenderer _remoteRenderer = RTCVideoRenderer(); // final StreamController<bool> _audioButton = StreamController<bool>.broadcast();
// final StreamController<bool> _videoButton = StreamController<bool>.broadcast();
final StreamController<bool> _audioButton = StreamController<bool>.broadcast(); // final StreamController<bool> _onButtonBarVisibleStreamController = StreamController<bool>.broadcast();
final StreamController<bool> _videoButton = StreamController<bool>.broadcast(); // final StreamController<double> _onButtonBarHeightStreamController = StreamController<double>.broadcast();
final StreamController<bool> _onButtonBarVisibleStreamController = StreamController<bool>.broadcast(); //
final StreamController<double> _onButtonBarHeightStreamController = StreamController<double>.broadcast(); // //Stream to enable video
// // MediaStream localMediaStream;
//Stream to enable video // // MediaStream remoteMediaStream;
MediaStream localMediaStream; // Signaling signaling = Signaling()..init();
MediaStream remoteMediaStream; //
Signaling signaling = Signaling()..init(); // @override
// void initState() {
@override // // TODO: implement initState
void initState() { // super.initState();
// TODO: implement initState // startCall();
super.initState(); // }
startCall(); //
} // startCall() async{
// // await _localRenderer.initialize();
startCall() async{ // // await _remoteRenderer.initialize();
await _localRenderer.initialize(); // }
await _remoteRenderer.initialize(); //
final connected = await receivedCall(); // Future<void> _disposeStreamsAndSubscriptions() async {
} // if (_onButtonBarVisibleStreamController != null) await _onButtonBarVisibleStreamController.close();
// if (_onButtonBarHeightStreamController != null) await _onButtonBarHeightStreamController.close();
// }
Future<bool> receivedCall() async { //
//Stream local media // @override
localMediaStream = await navigator.mediaDevices.getUserMedia({'video': true, 'audio': true}); // Widget build(BuildContext context) {
_localRenderer.srcObject = localMediaStream; // return Scaffold(
// backgroundColor: Colors.white,
final connected = await signaling.acceptCall(widget.callerId, widget.receiverId, localMediaStream: localMediaStream, onRemoteMediaStream: (remoteMediaStream){ // body: Container() //showNoise ? _buildNoiseBox() : buildLayout(),
this.remoteMediaStream = remoteMediaStream; // );
_remoteRenderer.srcObject = remoteMediaStream; // }
}); // }
if(connected){
signaling.signalR.listen(
onAcceptCall: (arg0){
print(arg0.toString());
},
onCandidate: (candidateJson){
signaling.addCandidate(candidateJson);
},
onDeclineCall: (arg0,arg1){
// _onHangup();
},
onHangupCall: (arg0){
// _onHangup();
},
onOffer: (offerSdp, callerUser) async{
print('${offerSdp.toString()} | ${callerUser.toString()}');
await signaling.answerOffer(offerSdp);
}
);
}
return connected;
}
@override
void dispose() {
// TODO: implement dispose
super.dispose();
_localRenderer?.dispose();
_remoteRenderer?.dispose();
_audioButton?.close();
_videoButton?.close();
localMediaStream?.dispose();
remoteMediaStream?.dispose();
_disposeStreamsAndSubscriptions();
}
Future<void> _disposeStreamsAndSubscriptions() async {
if (_onButtonBarVisibleStreamController != null) await _onButtonBarVisibleStreamController.close();
if (_onButtonBarHeightStreamController != null) await _onButtonBarHeightStreamController.close();
}
@override
Widget build(BuildContext context) {
// return WillPopScope(
// onWillPop: () async => false,
// child: Scaffold(
// backgroundColor: Colors.black,
// // body: ,
// ),
// );
return Scaffold(
backgroundColor: Colors.white,
body: showNoise ? _buildNoiseBox() : buildLayout(),
);
}
LayoutBuilder buildLayout() {
return LayoutBuilder(
builder: (BuildContext context, BoxConstraints constraints) {
return Stack(
children: [
CamViewWidget(
localRenderer: _localRenderer,
remoteRenderer: _remoteRenderer,
constraints: constraints,
onButtonBarVisibleStreamController: _onButtonBarVisibleStreamController,
onButtonBarHeightStreamController: _onButtonBarHeightStreamController,
),
ConferenceButtonBar(
audioEnabled: _audioButton.stream,
videoEnabled: _videoButton.stream,
onAudioEnabled: _onAudioEnable,
onVideoEnabled: _onVideoEnabled,
onSwitchCamera: _onSwitchCamera,
onHangup: _onHangup,
onPersonAdd: () {},
onPersonRemove: () {},
onHeight: _onHeightBar,
onShow: _onShowBar,
onHide: _onHideBar,
),
],
);
},
);
}
NoiseBox _buildNoiseBox() {
return NoiseBox(
density: NoiseBoxDensity.xLow,
backgroundColor: Colors.grey.shade900,
child: Center(
child: Container(
color: Colors.black54,
width: double.infinity,
height: 40,
child: Center(
child: Text(
'Waiting for another participant to connect to the call...',
key: Key('text-wait'),
textAlign: TextAlign.center,
style: TextStyle(color: Colors.white),
),
),
),
),
);
}
Function _onAudioEnable() {
final audioTrack = localMediaStream.getAudioTracks()[0];
final mute = audioTrack.muted;
Helper.setMicrophoneMute(!mute, audioTrack);
_audioButton.add(mute);
}
Function _onVideoEnabled() {
final videoTrack = localMediaStream.getVideoTracks()[0];
bool videoEnabled = videoTrack.enabled;
localMediaStream.getVideoTracks()[0].enabled = !videoEnabled;
_videoButton.add(!videoEnabled);
}
Function _onSwitchCamera() {
Helper.switchCamera(localMediaStream.getVideoTracks()[0]);
}
void _onShowBar() {
setState(() {
});
_onButtonBarVisibleStreamController.add(true);
}
void _onHeightBar(double height) {
_onButtonBarHeightStreamController.add(height);
}
void _onHideBar() {
setState(() {
SystemChrome.setEnabledSystemUIOverlays([SystemUiOverlay.bottom]);
});
_onButtonBarVisibleStreamController.add(false);
}
Future<void> _onHangup() async {
signaling.hangupCall(widget.callerId, widget.receiverId);
print('onHangup');
Navigator.of(context).pop();
}
}

@ -0,0 +1,186 @@
import 'dart:async';
import 'package:diplomaticquarterapp/pages/conference/web_rtc/widgets/cam_view_widget.dart';
import 'package:diplomaticquarterapp/pages/conference/widgets/noise_box.dart';
import 'package:diplomaticquarterapp/pages/webRTC/signaling.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_webrtc/flutter_webrtc.dart';
import '../conference_button_bar.dart';
class CallHomePage extends StatefulWidget {
final String receiverId;
final String callerId;
const CallHomePage({Key key, this.receiverId, this.callerId}) : super(key: key);
@override
_CallHomePageState createState() => _CallHomePageState();
}
class _CallHomePageState extends State<CallHomePage> {
bool showNoise = true;
RTCVideoRenderer _localRenderer = RTCVideoRenderer();
RTCVideoRenderer _remoteRenderer = RTCVideoRenderer();
final StreamController<bool> _audioButton = StreamController<bool>.broadcast();
final StreamController<bool> _videoButton = StreamController<bool>.broadcast();
final StreamController<bool> _onButtonBarVisibleStreamController = StreamController<bool>.broadcast();
final StreamController<double> _onButtonBarHeightStreamController = StreamController<double>.broadcast();
//Stream to enable video
MediaStream localMediaStream;
MediaStream remoteMediaStream;
Signaling signaling = Signaling()..init();
@override
void initState() {
// TODO: implement initState
super.initState();
startCall();
}
startCall() async{
await _localRenderer.initialize();
await _remoteRenderer.initialize();
final connected = await receivedCall();
}
Future<bool> receivedCall() async {
//Stream local media
localMediaStream = await navigator.mediaDevices.getUserMedia({'video': true, 'audio': true});
_localRenderer.srcObject = localMediaStream;
final connected = await signaling.acceptCall(widget.callerId, widget.receiverId, localMediaStream: localMediaStream, onRemoteMediaStream: (remoteMediaStream){
setState(() {
this.remoteMediaStream = remoteMediaStream;
_remoteRenderer.srcObject = remoteMediaStream;
});
});
if(connected){
signaling.signalR.listen(
onAcceptCall: (arg0){
print(arg0.toString());
},
onCandidate: (candidateJson){
signaling.addCandidate(candidateJson);
},
onDeclineCall: (arg0,arg1){
// _onHangup();
},
onHangupCall: (arg0){
// _onHangup();
},
onOffer: (offerSdp, callerUser) async{
print('${offerSdp.toString()} | ${callerUser.toString()}');
await signaling.answerOffer(offerSdp);
}
);
}
return connected;
}
@override
void dispose() {
// TODO: implement dispose
super.dispose();
_localRenderer?.dispose();
_remoteRenderer?.dispose();
_audioButton?.close();
_videoButton?.close();
localMediaStream?.dispose();
remoteMediaStream?.dispose();
_disposeStreamsAndSubscriptions();
}
Future<void> _disposeStreamsAndSubscriptions() async {
if (_onButtonBarVisibleStreamController != null) await _onButtonBarVisibleStreamController.close();
if (_onButtonBarHeightStreamController != null) await _onButtonBarHeightStreamController.close();
}
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Colors.white,
body: buildLayout(),
);
}
LayoutBuilder buildLayout() {
return LayoutBuilder(
builder: (BuildContext context, BoxConstraints constraints) {
return Stack(
children: [
CamViewWidget(
localRenderer: _localRenderer,
remoteRenderer: _remoteRenderer,
constraints: constraints,
onButtonBarVisibleStreamController: _onButtonBarVisibleStreamController,
onButtonBarHeightStreamController: _onButtonBarHeightStreamController,
),
ConferenceButtonBar(
audioEnabled: _audioButton.stream,
videoEnabled: _videoButton.stream,
onAudioEnabled: _onAudioEnable,
onVideoEnabled: _onVideoEnabled,
onSwitchCamera: _onSwitchCamera,
onHangup: _onHangup,
onPersonAdd: () {},
onPersonRemove: () {},
onHeight: _onHeightBar,
onShow: _onShowBar,
onHide: _onHideBar,
),
],
);
},
);
}
Function _onAudioEnable() {
final audioTrack = localMediaStream.getAudioTracks()[0];
final mute = audioTrack.muted;
Helper.setMicrophoneMute(!mute, audioTrack);
_audioButton.add(mute);
}
Function _onVideoEnabled() {
final videoTrack = localMediaStream.getVideoTracks()[0];
bool videoEnabled = videoTrack.enabled;
localMediaStream.getVideoTracks()[0].enabled = !videoEnabled;
_videoButton.add(!videoEnabled);
}
Function _onSwitchCamera() {
Helper.switchCamera(localMediaStream.getVideoTracks()[0]);
}
void _onShowBar() {
setState(() {
});
_onButtonBarVisibleStreamController.add(true);
}
void _onHeightBar(double height) {
_onButtonBarHeightStreamController.add(height);
}
void _onHideBar() {
setState(() {
SystemChrome.setEnabledSystemUIOverlays([SystemUiOverlay.bottom]);
});
_onButtonBarVisibleStreamController.add(false);
}
Future<void> _onHangup() async {
signaling.hangupCall(widget.callerId, widget.receiverId);
print('onHangup');
Navigator.of(context).pop();
}
}

@ -1,6 +1,7 @@
import 'dart:async'; import 'dart:async';
import 'dart:core'; import 'dart:core';
import 'package:diplomaticquarterapp/pages/conference/widgets/noise_box.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_webrtc/flutter_webrtc.dart'; import 'package:flutter_webrtc/flutter_webrtc.dart';
@ -34,23 +35,48 @@ class _CamViewWidgetState extends State<CamViewWidget> {
child: Stack( child: Stack(
children: [ children: [
FractionallySizedBox( FractionallySizedBox(
heightFactor: 1, heightFactor: 1, widthFactor: 1,
widthFactor: 1,
child: Container( child: Container(
color: Colors.black87, color: Colors.black87,
child: RTCVideoView(widget.remoteRenderer, mirror: true), child: RTCVideoView(widget.remoteRenderer, mirror: true,filterQuality: FilterQuality.medium,),
), ),
), ),
if(widget.remoteRenderer.srcObject == null)
Positioned.fill(child: _buildNoiseBox()),
Positioned.fill(
child: RTCVideoView(widget.remoteRenderer)
),
DraggableCam( DraggableCam(
key: Key('publisher'), key: Key('publisher'),
onButtonBarHeight: widget.onButtonBarHeightStreamController.stream, onButtonBarHeight: widget.onButtonBarHeightStreamController.stream,
onButtonBarVisible: widget.onButtonBarVisibleStreamController.stream, onButtonBarVisible: widget.onButtonBarVisibleStreamController.stream,
availableScreenSize: widget.constraints.biggest, availableScreenSize: widget.constraints.biggest,
child: RTCVideoView(widget.localRenderer), child: RTCVideoView(widget.localRenderer)
),
if(widget.remoteRenderer.srcObject == null)
Container(
margin: EdgeInsets.all(MediaQuery.of(context).size.width/8),
child: Text(
'Waiting for another participant to connect to the call...',
key: Key('text-wait'),
textAlign: TextAlign.center,
style: TextStyle(color: Colors.white),
)
), ),
// Expanded(child: RTCVideoView(widget.remoteRenderer)),
], ],
), ),
); );
} }
Widget _buildNoiseBox() {
return NoiseBox(
density: NoiseBoxDensity.xHigh,
backgroundColor: Colors.grey.shade900,
);
}
} }

@ -94,6 +94,13 @@ class _SendFeedbackPageState extends State<SendFeedbackPage> {
this.appointHistory = widget.appointment; this.appointHistory = widget.appointment;
}); });
requestPermissions(); requestPermissions();
event.controller.stream.listen((p) {
if (p['isIOSFeedback'] == 'true') {
if (this.mounted) {
this.titleController.value = p['data'];
}
}
});
super.initState(); super.initState();
} }
@ -538,9 +545,10 @@ class _SendFeedbackPageState extends State<SendFeedbackPage> {
if (result.finalResult == true) { if (result.finalResult == true) {
setState(() { setState(() {
messageController.text += reconizedWord + '\n';
RoboSearch.closeAlertDialog(context); RoboSearch.closeAlertDialog(context);
speech.stop(); speech.stop();
messageController.text = reconizedWord + '\n';
}); });
} }
} }

@ -216,20 +216,37 @@ class _FinalProductsPageState extends State<FinalProductsPage> {
Container( Container(
margin: EdgeInsets.fromLTRB(0, 16, 0, 0), margin: EdgeInsets.fromLTRB(0, 16, 0, 0),
alignment: Alignment.center, alignment: Alignment.center,
child: Image.network( child: (model.finalProducts[index].images != null &&
model.finalProducts[index].images.isNotEmpty model.finalProducts[index].images.length > 0)
? model.finalProducts[index].images[0].thumb ? Image.network(
: 'https://upload.wikimedia.org/wikipedia/commons/thumb/6/6c/No_image_3x4.svg/1200px-No_image_3x4.svg.png', model.finalProducts[index].images[0].src,
fit: BoxFit.cover, fit: BoxFit.cover,
height: 80, height: 80,
), width: 80,
)
: Image.asset(
"assets/images/no_image.png",
fit: BoxFit.cover,
height: 80,
width: 80,
),
// Image.network(
// model.finalProducts[index].images.isNotEmpty
// ? model.finalProducts[index].images[0].thumb
// : 'https://upload.wikimedia.org/wikipedia/commons/thumb/6/6c/No_image_3x4.svg/1200px-No_image_3x4.svg.png',
// fit: BoxFit.cover,
// height: 80,
// ),
), ),
Container( Container(
width: model.finalProducts[index].rxMessage != null ? MediaQuery.of(context).size.width / 2.8 : 0, width: model.finalProducts[index].rxMessage != null ? double.infinity : 0,
//MediaQuery.of(context).size.width / 2.8 : 0,
padding: EdgeInsets.all(4), padding: EdgeInsets.all(4),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Color(0xffb23838), color: Color(0xffb23838),
borderRadius: BorderRadius.only(topLeft: Radius.circular(6)), // borderRadius: BorderRadius.only(topLeft: Radius.circular(6)
// ),
), ),
child: model.finalProducts[index].rxMessage != null child: model.finalProducts[index].rxMessage != null
? Texts( ? Texts(
@ -374,33 +391,48 @@ class _FinalProductsPageState extends State<FinalProductsPage> {
), ),
), ),
Container( Container(
margin: EdgeInsets.fromLTRB(0, 0, 0, 0), margin: EdgeInsets.fromLTRB(0, 0, 0, 8),
alignment: Alignment.center, alignment: Alignment.center,
child: Image.network( child:(model.finalProducts[index].images != null &&
model.finalProducts[index].images.isNotEmpty model.finalProducts[index].images.length > 0)
? model.finalProducts[index].images[0].thumb ? Image.network(
: 'https://upload.wikimedia.org/wikipedia/commons/thumb/6/6c/No_image_3x4.svg/1200px-No_image_3x4.svg.png', model.finalProducts[index].images[0].src,
fit: BoxFit.contain, fit: BoxFit.cover,
height: 80, height: 80,
), width: 80,
)
: Image.asset(
"assets/images/no_image.png",
fit: BoxFit.cover,
height: 80,
width: 80,
),
// Image.network(
// model.finalProducts[index].images.isNotEmpty
// ? model.finalProducts[index].images[0].thumb
// : 'https://upload.wikimedia.org/wikipedia/commons/thumb/6/6c/No_image_3x4.svg/1200px-No_image_3x4.svg.png',
// fit: BoxFit.contain,
// height: 80,
// ),
), ),
], ],
), ),
Column( Column(
children: [ children: [
Container( Container(
width: model.finalProducts[index].rxMessage != null ? MediaQuery.of(context).size.width / 5.3 : 0, width: model.finalProducts[index].rxMessage != null ? MediaQuery.of(context).size.width / 4.3 : 0,
padding: EdgeInsets.all(4), padding: EdgeInsets.all(4),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Color(0xffb23838), color: Color(0xffb23838),
borderRadius: BorderRadius.only(topLeft: Radius.circular(6)), //borderRadius: BorderRadius.only(topLeft: Radius.circular(5)),
), ),
child:model.finalProducts[index].rxMessage != null child:model.finalProducts[index].rxMessage != null
? Texts( ? Texts(
projectProvider.isArabic ? model.finalProducts[index].rxMessagen : model.finalProducts[index].rxMessage, projectProvider.isArabic ? model.finalProducts[index].rxMessagen : model.finalProducts[index].rxMessage,
color: Colors.white, color: Colors.white,
regular: true, regular: true,
fontSize: 10, fontSize: 8,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
) )
: Texts(""), : Texts(""),

@ -77,9 +77,9 @@ class InsuranceApprovalDetail extends StatelessWidget {
MyRichText(TranslationBase.of(context).unusedCount, insuranceApprovalModel?.unUsedCount.toString() ?? "", projectViewModel.isArabic), MyRichText(TranslationBase.of(context).unusedCount, insuranceApprovalModel?.unUsedCount.toString() ?? "", projectViewModel.isArabic),
MyRichText(TranslationBase.of(context).companyName, insuranceApprovalModel?.companyName ?? "", projectViewModel.isArabic), MyRichText(TranslationBase.of(context).companyName, insuranceApprovalModel?.companyName ?? "", projectViewModel.isArabic),
SizedBox(height: 6), SizedBox(height: 6),
MyRichText(TranslationBase.of(context).receiptOn, DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDateTime(insuranceApprovalModel.receiptOn)) ?? "", MyRichText(TranslationBase.of(context).receiptOn, DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(insuranceApprovalModel.receiptOn)) ?? "",
projectViewModel.isArabic), projectViewModel.isArabic),
MyRichText(TranslationBase.of(context).expiryOn, DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDateTime(insuranceApprovalModel.expiryDate)) ?? "", MyRichText(TranslationBase.of(context).expiryOn, DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(insuranceApprovalModel.expiryDate)) ?? "",
projectViewModel.isArabic), projectViewModel.isArabic),
], ],
), ),

@ -140,7 +140,7 @@ class _InsuranceApprovalState extends State<InsuranceApproval> {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
MyRichText(TranslationBase.of(context).clinic + ":", model.insuranceApproval[index]?.clinicName.toLowerCase().capitalizeFirstofEach ?? "", MyRichText(TranslationBase.of(context).clinic + ":", model.insuranceApproval[index]?.clinicName != null ? model.insuranceApproval[index]?.clinicName.toLowerCase().capitalizeFirstofEach : "",
projectViewModel.isArabic), projectViewModel.isArabic),
MyRichText(TranslationBase.of(context).approvalNo, model.insuranceApproval[index]?.approvalNo.toString() ?? "", projectViewModel.isArabic), MyRichText(TranslationBase.of(context).approvalNo, model.insuranceApproval[index]?.approvalNo.toString() ?? "", projectViewModel.isArabic),
], ],

@ -1,6 +1,7 @@
import 'dart:math' as math;
import 'package:auto_size_text/auto_size_text.dart'; import 'package:auto_size_text/auto_size_text.dart';
import 'package:diplomaticquarterapp/config/size_config.dart'; import 'package:diplomaticquarterapp/config/size_config.dart';
import 'package:diplomaticquarterapp/core/service/packages_offers/PackagesOffersServices.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/models/Appointments/AppoimentAllHistoryResultList.dart'; import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart';
@ -9,24 +10,19 @@ import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.da
import 'package:diplomaticquarterapp/models/gradient_color.dart'; import 'package:diplomaticquarterapp/models/gradient_color.dart';
import 'package:diplomaticquarterapp/models/hmg_services.dart'; import 'package:diplomaticquarterapp/models/hmg_services.dart';
import 'package:diplomaticquarterapp/models/slider_data.dart'; import 'package:diplomaticquarterapp/models/slider_data.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/all_habib_medical_service_page.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/all_habib_medical_service_page2.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/all_habib_medical_service_page2.dart';
import 'package:diplomaticquarterapp/pages/landing/widgets/logged_slider_view.dart'; import 'package:diplomaticquarterapp/pages/landing/widgets/logged_slider_view.dart';
import 'package:diplomaticquarterapp/pages/landing/widgets/services_view.dart'; import 'package:diplomaticquarterapp/pages/landing/widgets/services_view.dart';
import 'package:diplomaticquarterapp/pages/landing/widgets/slider_view.dart'; import 'package:diplomaticquarterapp/pages/landing/widgets/slider_view.dart';
import 'package:diplomaticquarterapp/pages/medical/medical_profile_page_new.dart';
import 'package:diplomaticquarterapp/pages/packages_offers/OfferAndPackagesPage.dart'; import 'package:diplomaticquarterapp/pages/packages_offers/OfferAndPackagesPage.dart';
import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart'; import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/buttons/floatingActionButton.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart'; import 'package:flutter_svg/flutter_svg.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:diplomaticquarterapp/pages/conference/web_rtc/call_home_page.dart';
import 'dart:math' as math;
class HomePageFragment2 extends StatefulWidget { class HomePageFragment2 extends StatefulWidget {
DashboardViewModel model; DashboardViewModel model;
@ -284,9 +280,11 @@ class _HomePageFragment2State extends State<HomePageFragment2> {
child: InkWell( child: InkWell(
onTap: () { onTap: () {
AuthenticatedUser user = projectViewModel.user; AuthenticatedUser user = projectViewModel.user;
Navigator.of(context).push(MaterialPageRoute(builder: (context) => PackagesHomePage(user))); if (projectViewModel.havePrivilege(82)) Navigator.of(context).push(MaterialPageRoute(builder: (context) => PackagesHomePage(user)));
}, },
child: Container( child: Stack(
children: [
Container(
width: double.infinity, width: double.infinity,
height: double.infinity, height: double.infinity,
clipBehavior: Clip.antiAlias, clipBehavior: Clip.antiAlias,
@ -429,6 +427,20 @@ class _HomePageFragment2State extends State<HomePageFragment2> {
], ],
), ),
), ),
projectViewModel.havePrivilege(82)
? Container()
: Container(
width: double.infinity,
height: double.infinity,
clipBehavior: Clip.antiAlias,
decoration: containerRadiusWithGradientServices(20, lightColor: CustomColors.lightGreyColor.withOpacity(0.7), darkColor: CustomColors.lightGreyColor.withOpacity(0.7)),
child: Icon(
Icons.lock_outline,
size: 40,
),
)
],
),
), ),
); );
} }

@ -27,6 +27,7 @@ import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/location_util.dart'; import 'package:diplomaticquarterapp/uitl/location_util.dart';
import 'package:diplomaticquarterapp/uitl/navigation_service.dart'; import 'package:diplomaticquarterapp/uitl/navigation_service.dart';
import 'package:diplomaticquarterapp/uitl/push-notification-handler.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/bottom_navigation/bottom_nav_bar.dart'; import 'package:diplomaticquarterapp/widgets/bottom_navigation/bottom_nav_bar.dart';
import 'package:diplomaticquarterapp/widgets/buttons/floatingActionButton.dart'; import 'package:diplomaticquarterapp/widgets/buttons/floatingActionButton.dart';
@ -44,6 +45,7 @@ import 'package:provider/provider.dart';
import '../../locator.dart'; import '../../locator.dart';
import '../../routes.dart'; import '../../routes.dart';
class LandingPage extends StatefulWidget { class LandingPage extends StatefulWidget {
static LandingPage shared; static LandingPage shared;
_LandingPageState state; _LandingPageState state;
@ -197,37 +199,11 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
void didChangeAppLifecycleState(AppLifecycleState state) { void didChangeAppLifecycleState(AppLifecycleState state) {
super.didChangeAppLifecycleState(state); super.didChangeAppLifecycleState(state);
var route = ModalRoute.of(context);
if (route != null) {}
//setState(() {
AppGlobal.context = context; AppGlobal.context = context;
if (state == AppLifecycleState.resumed) { if (state == AppLifecycleState.resumed) {
if (LandingPage.isOpenCallPage) { PushNotificationHandler.getInstance().onResume();
if (Platform.isAndroid) {
return;
}
if (!isPageNavigated) {
isPageNavigated = true;
Navigator.push(context, MaterialPageRoute(builder: (context) => IncomingCall(incomingCallData: LandingPage.incomingCallData))).then((value) {
Future.delayed(Duration(seconds: 5), () {
isPageNavigated = false;
});
});
}
}
sharedPref.remove(APPOINTMENT_HISTORY_MEDICAL); sharedPref.remove(APPOINTMENT_HISTORY_MEDICAL);
} }
if (state == AppLifecycleState.paused) {
isPageNavigated = false;
}
if (state == AppLifecycleState.inactive) {
isPageNavigated = false;
}
//});
} }
@override @override
@ -239,6 +215,7 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
@override @override
void initState() { void initState() {
super.initState(); super.initState();
PushNotificationHandler.getInstance().onResume();
WidgetsBinding.instance.addObserver(this); WidgetsBinding.instance.addObserver(this);
AppGlobal.context = context; AppGlobal.context = context;
@ -247,14 +224,11 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
pageController = PageController(keepPage: true); pageController = PageController(keepPage: true);
_firebaseMessaging.setAutoInitEnabled(true); _firebaseMessaging.setAutoInitEnabled(true);
// signalRUtil = new SignalRUtil(hubName: "https://VCallApi.hmg.com/WebRTCHub?source=mobile&username=2001273", context: context);
locationUtils = new LocationUtils(isShowConfirmDialog: false, context: context); locationUtils = new LocationUtils(isShowConfirmDialog: false, context: context);
WidgetsBinding.instance.addPostFrameCallback((_) { WidgetsBinding.instance.addPostFrameCallback((_) {
if (projectViewModel.isLogin && !projectViewModel.isLoginChild) { if (projectViewModel.isLogin && !projectViewModel.isLoginChild) {
familyFileProvider.getSharedRecordByStatus(); familyFileProvider.getSharedRecordByStatus();
} }
// if (!signalRUtil.getConnectionState()) signalRUtil.startSignalRConnection();
}); });
// HMG (Guest/Internet) Wifi Access [Zohaib Kambrani] // HMG (Guest/Internet) Wifi Access [Zohaib Kambrani]
//for now commented to reduce this call will enable it when needed //for now commented to reduce this call will enable it when needed
@ -263,10 +237,6 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
// PlatformBridge().connectHMGGuestWifi().then((value) => {GifLoaderDialogUtils.hideDialog(context)}); // PlatformBridge().connectHMGGuestWifi().then((value) => {GifLoaderDialogUtils.hideDialog(context)});
// }).checkAndConnectIfNoInternet(); // }).checkAndConnectIfNoInternet();
if (Platform.isIOS) {
_firebaseMessaging.requestPermission();
}
requestPermissions().then((results) { requestPermissions().then((results) {
locationUtils.getCurrentLocation(); locationUtils.getCurrentLocation();
_firebaseMessaging.getToken().then((String token) { _firebaseMessaging.getToken().then((String token) {
@ -277,8 +247,6 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
if (!projectViewModel.isLoginChild) { if (!projectViewModel.isLoginChild) {
checkUserStatus(token); checkUserStatus(token);
} }
// if (projectViewModel.isLogin) this.getNotificationCount(DEVICE_TOKEN);
} }
}); });
if (results[Permission.location].isGranted) {} if (results[Permission.location].isGranted) {}
@ -288,181 +256,7 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
// if (results[Permission.accessMediaLocation].isGranted) ; // if (results[Permission.accessMediaLocation].isGranted) ;
// if (results[Permission.calendar].isGranted) ; // if (results[Permission.calendar].isGranted) ;
}); });
// });
FirebaseMessaging.onMessage.listen((RemoteMessage message) async {
print("onMessage: $message");
print(message);
print(message.data['name']);
print(message.data['appointmentdate']);
if (Platform.isIOS) {
if (message.data['is_call'] == "true") {
var route = ModalRoute.of(context);
if (route != null) {
print(route.settings.name);
}
Map<String, dynamic> myMap = new Map<String, dynamic>.from(message.data);
print(myMap);
LandingPage.isOpenCallPage = true;
LandingPage.incomingCallData = IncomingCallData.fromJson(myMap);
if (!isPageNavigated) {
isPageNavigated = true;
Navigator.push(context, MaterialPageRoute(builder: (context) => IncomingCall(incomingCallData: LandingPage.incomingCallData))).then((value) {
isPageNavigated = false;
});
}
} else {
print("Is Call Not Found iOS");
}
} else {
print("Is Call Not Found iOS");
}
if (Platform.isAndroid) {
print("messagedata:${message}");
print("messagedata:${message.data}");
if (message.data.containsKey("is_call")) {
var route = ModalRoute.of(context);
if (route != null) {
print(route.settings.name);
}
Map<String, dynamic> myMap = new Map<String, dynamic>.from(message.data);
print(myMap);
if (LandingPage.isOpenCallPage) {
return;
}
LandingPage.isOpenCallPage = true;
LandingPage.incomingCallData = IncomingCallData.fromJson(myMap);
if (!isPageNavigated) {
isPageNavigated = true;
Navigator.push(context, MaterialPageRoute(builder: (context) => IncomingCall(incomingCallData: LandingPage.incomingCallData))).then((value) {
Future.delayed(Duration(seconds: 5), () {
isPageNavigated = false;
});
});
}
} else {
print("Is Call Not Found Android");
LocalNotification.getInstance().showNow(title: message.data['notification']['title'], subtitle: message.data['notification']['body']);
}
} else {
print("Is Call Not Found Android");
}
});
FirebaseMessaging.onBackgroundMessage((message) {
return Platform.isIOS ? null : myBackgroundMessageHandler(message.data);
});
// todo verify all functionality
// _firebaseMessaging.configure(
// // onMessage: (Map<String, dynamic> message) async {
// // // showDialog("onMessage: $message");
// // print("onMessage: $message");
// // print(message);
// // print(message['name']);
// // print(message['appointmentdate']);
// //
// // if (Platform.isIOS) {
// // if (message['is_call'] == "true") {
// // var route = ModalRoute.of(context);
// //
// // if (route != null) {
// // print(route.settings.name);
// // }
// //
// // Map<String, dynamic> myMap = new Map<String, dynamic>.from(message);
// // print(myMap);
// // LandingPage.isOpenCallPage = true;
// // LandingPage.incomingCallData = IncomingCallData.fromJson(myMap);
// // if (!isPageNavigated) {
// // isPageNavigated = true;
// // Navigator.push(context, MaterialPageRoute(builder: (context) => IncomingCall(incomingCallData: LandingPage.incomingCallData))).then((value) {
// // isPageNavigated = false;
// // });
// // }
// // } else {
// // print("Is Call Not Found iOS");
// // }
// // } else {
// // print("Is Call Not Found iOS");
// // }
// //
// // if (Platform.isAndroid) {
// // if (message['data'].containsKey("is_call")) {
// // var route = ModalRoute.of(context);
// //
// // if (route != null) {
// // print(route.settings.name);
// // }
// //
// // Map<String, dynamic> myMap = new Map<String, dynamic>.from(message['data']);
// // print(myMap);
// // if (LandingPage.isOpenCallPage) {
// // return;
// // }
// // LandingPage.isOpenCallPage = true;
// // LandingPage.incomingCallData = IncomingCallData.fromJson(myMap);
// // if (!isPageNavigated) {
// // isPageNavigated = true;
// // Navigator.push(context, MaterialPageRoute(builder: (context) => IncomingCall(incomingCallData: LandingPage.incomingCallData))).then((value) {
// // Future.delayed(Duration(seconds: 5), () {
// // isPageNavigated = false;
// // });
// // });
// // }
// // } else {
// // print("Is Call Not Found Android");
// // LocalNotification.getInstance().showNow(title: message['notification']['title'], subtitle: message['notification']['body']);
// // }
// // } else {
// // print("Is Call Not Found Android");
// // }
// // },
// onBackgroundMessage: Platform.isIOS ? null : myBackgroundMessageHandler,
// onLaunch: (Map<String, dynamic> message) async {
// print("onLaunch: $message");
// // showDialog("onLaunch: $message");
// },
// onResume: (Map<String, dynamic> message) async {
// print("onResume: $message");
// print(message);
// print(message['name']);
// print(message['appointmentdate']);
//
// // showDialog("onResume: $message");
//
// if (Platform.isIOS) {
// if (message['is_call'] == "true") {
// var route = ModalRoute.of(context);
//
// if (route != null) {
// print(route.settings.name);
// }
//
// Map<String, dynamic> myMap = new Map<String, dynamic>.from(message);
// print(myMap);
// LandingPage.isOpenCallPage = true;
// LandingPage.incomingCallData = IncomingCallData.fromJson(myMap);
// if (!isPageNavigated) {
// isPageNavigated = true;
// Navigator.push(context, MaterialPageRoute(builder: (context) => IncomingCall(incomingCallData: LandingPage.incomingCallData))).then((value) {
// isPageNavigated = false;
// });
// }
// } else {
// print("Is Call Not Found iOS");
// }
// } else {
// print("Is Call Not Found iOS");
// }
// },
// );
} }
Future<Map<Permission, PermissionStatus>> requestPermissions() async { Future<Map<Permission, PermissionStatus>> requestPermissions() async {
@ -486,29 +280,6 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
return permissionResults; return permissionResults;
} }
static Future<dynamic> myBackgroundMessageHandler(Map<String, dynamic> message) async {
Map<String, dynamic> myMap = new Map<String, dynamic>.from(message['data']);
if (message.containsKey('data')) {
LandingPage.incomingCallData = IncomingCallData.fromJson(myMap);
LandingPage.isOpenCallPage = true;
// Future.delayed(Duration(seconds: 3), () {
// Navigator.push(locator<NavigationService>().navigatorKey.currentContext, MaterialPageRoute(builder: (context) => IncomingCall(incomingCallData: LandingPage.incomingCallData)));
NavigationService.instance.navigateTo(INCOMING_CALL_PAGE);
// });
// if (!isPageNavigated) {
// isPageNavigated = true;
// Navigator.push(locator<NavigationService>().navigatorKey.currentContext, MaterialPageRoute(builder: (context) => IncomingCall(incomingCallData: LandingPage.incomingCallData)));
// .then((value) {
// isPageNavigated = false;
// });
// }
}
if (message.containsKey('notification')) {
final dynamic notification = message['notification'];
}
}
void setUserValues(value) async { void setUserValues(value) async {
if (value != null) sharedPref.setObject(IMEI_USER_DATA, value); if (value != null) sharedPref.setObject(IMEI_USER_DATA, value);
} }

@ -90,7 +90,9 @@ class _LandingPagePharmacyState extends State<LandingPagePharmacy> {
try { try {
String barcode = result?.rawContent; String barcode = result?.rawContent;
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
await BaseAppClient().getPharmacy("$GET_PHARMACY_PRODUCTs_BY_SKU$barcode", onSuccess: (dynamic response, int statusCode) { await BaseAppClient()
.getPharmacy("$GET_PHARMACY_PRODUCTs_BY_SKU$barcode",
onSuccess: (dynamic response, int statusCode) {
print(response); print(response);
var product = PharmacyProduct.fromJson(response["products"][0]); var product = PharmacyProduct.fromJson(response["products"][0]);
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
@ -100,7 +102,8 @@ class _LandingPagePharmacyState extends State<LandingPagePharmacy> {
AppToast.showErrorToast(message: "Product not found"); AppToast.showErrorToast(message: "Product not found");
}); });
} catch (apiEx) { } catch (apiEx) {
AppToast.showErrorToast(message: "Something went wrong, please try again"); AppToast.showErrorToast(
message: "Something went wrong, please try again");
} }
} catch (barcodeEx) {} } catch (barcodeEx) {}
} }

@ -4,6 +4,7 @@ import 'package:camera/camera.dart';
import 'package:diplomaticquarterapp/models/LiveCare/IncomingCallData.dart'; import 'package:diplomaticquarterapp/models/LiveCare/IncomingCallData.dart';
import 'package:diplomaticquarterapp/models/LiveCare/room_model.dart'; import 'package:diplomaticquarterapp/models/LiveCare/room_model.dart';
import 'package:diplomaticquarterapp/pages/conference/web_rtc/call_home_page.dart'; import 'package:diplomaticquarterapp/pages/conference/web_rtc/call_home_page.dart';
import 'package:diplomaticquarterapp/pages/conference/web_rtc/call_home_page_.dart';
import 'package:diplomaticquarterapp/pages/conference/widgets/platform_exception_alert_dialog.dart'; import 'package:diplomaticquarterapp/pages/conference/widgets/platform_exception_alert_dialog.dart';
import 'package:diplomaticquarterapp/pages/landing/landing_page.dart'; import 'package:diplomaticquarterapp/pages/landing/landing_page.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';

@ -1,4 +1,3 @@
import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/service/AuthenticatedUserObject.dart'; import 'package:diplomaticquarterapp/core/service/AuthenticatedUserObject.dart';
import 'package:diplomaticquarterapp/core/viewModels/appointment_rate_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/appointment_rate_view_model.dart';
@ -8,7 +7,6 @@ import 'package:diplomaticquarterapp/locator.dart';
import 'package:diplomaticquarterapp/models/Appointments/toDoCountProviderModel.dart'; import 'package:diplomaticquarterapp/models/Appointments/toDoCountProviderModel.dart';
import 'package:diplomaticquarterapp/models/Authentication/check_activation_code_response.dart'; import 'package:diplomaticquarterapp/models/Authentication/check_activation_code_response.dart';
import 'package:diplomaticquarterapp/models/Authentication/check_paitent_authentication_req.dart'; import 'package:diplomaticquarterapp/models/Authentication/check_paitent_authentication_req.dart';
import 'package:diplomaticquarterapp/models/Authentication/checkpatient_for_registration.dart';
import 'package:diplomaticquarterapp/pages/landing/landing_page.dart'; import 'package:diplomaticquarterapp/pages/landing/landing_page.dart';
import 'package:diplomaticquarterapp/pages/login/confirm-login.dart'; import 'package:diplomaticquarterapp/pages/login/confirm-login.dart';
import 'package:diplomaticquarterapp/pages/login/login-type.dart'; import 'package:diplomaticquarterapp/pages/login/login-type.dart';
@ -315,7 +313,7 @@ class _Login extends State<Login> {
projectViewModel.setPrivilege(privilegeList: result); projectViewModel.setPrivilege(privilegeList: result);
result = CheckActivationCode.fromJson(result); result = CheckActivationCode.fromJson(result);
result.list.isFamily = false; result.list.isFamily = false;
this.sharedPref.setString(BLOOD_TYPE, result.patientBloodType); this.sharedPref.setString(BLOOD_TYPE, result.patientBloodType != null ? result.patientBloodType : "");
this.sharedPref.setObject(USER_PROFILE, result.list); this.sharedPref.setObject(USER_PROFILE, result.list);
this.sharedPref.setObject(MAIN_USER, result.list); this.sharedPref.setObject(MAIN_USER, result.list);
this.sharedPref.setObject(LOGIN_TOKEN_ID, result.logInTokenID); this.sharedPref.setObject(LOGIN_TOKEN_ID, result.logInTokenID);

@ -389,7 +389,9 @@ class _Register extends State<Register> {
Navigator.of(context).push(FadePage(page: ConfirmLogin(changePageViewIndex: widget.changePageViewIndex))), Navigator.of(context).push(FadePage(page: ConfirmLogin(changePageViewIndex: widget.changePageViewIndex))),
} }
else else
{AppToast.showErrorToast(message: result ? result : TranslationBase.of(context).somethingWentWrong)} {
AppToast.showErrorToast(message: result != null ? result : TranslationBase.of(context).somethingWentWrong),
}
}); });
} }
} }

@ -71,7 +71,7 @@ class NewTextFields extends StatefulWidget {
this.onTap, this.onTap,
this.fontSize = 14.0, this.fontSize = 14.0,
this.fontWeight = FontWeight.w600, this.fontWeight = FontWeight.w600,
this.autoValidate = false,
this.hintColor, this.hintColor,
this.isEnabled = true,this.counterText=""}) this.isEnabled = true,this.counterText=""})
: super(key: key); : super(key: key);
@ -105,7 +105,6 @@ class NewTextFields extends StatefulWidget {
final bool keepPadding; final bool keepPadding;
final TextCapitalization textCapitalization; final TextCapitalization textCapitalization;
final List<TextInputFormatter> inputFormatters; final List<TextInputFormatter> inputFormatters;
final bool autoValidate;
final EdgeInsets padding; final EdgeInsets padding;
final bool focus; final bool focus;
final bool borderOnlyError; final bool borderOnlyError;

@ -72,6 +72,7 @@ class DoctorHomePage extends StatelessWidget {
clinicName: _doctorList.clinicName, clinicName: _doctorList.clinicName,
actualDoctorRate: _doctorList.actualDoctorRate, actualDoctorRate: _doctorList.actualDoctorRate,
doctorID: _doctorList.doctorID, doctorID: _doctorList.doctorID,
date: _doctorList.appointmentDate,
doctorRate: _doctorList.doctorRate, doctorRate: _doctorList.doctorRate,
gender: _doctorList.gender, gender: _doctorList.gender,
doctorTitle: _doctorList.doctorTitle, doctorTitle: _doctorList.doctorTitle,

@ -65,12 +65,12 @@ class _HomePrescriptionsPageState extends State<HomePrescriptionsPage> with Sing
unselectedLabelColor: Color(0xff575757), unselectedLabelColor: Color(0xff575757),
labelPadding: EdgeInsets.only(top: 15, bottom: 13, left: 20, right: 20), labelPadding: EdgeInsets.only(top: 15, bottom: 13, left: 20, right: 20),
labelStyle: TextStyle( labelStyle: TextStyle(
fontSize: 16, fontSize: 15,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
letterSpacing: -0.48, letterSpacing: -0.48,
), ),
unselectedLabelStyle: TextStyle( unselectedLabelStyle: TextStyle(
fontSize: 16, fontSize: 15,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
letterSpacing: -0.48, letterSpacing: -0.48,
), ),

@ -137,8 +137,10 @@ class _DistanceTrackerState extends State<DistanceTracker> with SingleTickerProv
}); });
generateWeekData(); generateWeekData();
setState(() { setState(() {
if (avgWeeklyStepsValue != 0) {
weeklyStatsAvgValue = avgWeeklyStepsValue ~/ weeklyDataLength; weeklyStatsAvgValue = avgWeeklyStepsValue ~/ weeklyDataLength;
weeklyStatsAvgValue = weeklyStatsAvgValue / 1000; weeklyStatsAvgValue = weeklyStatsAvgValue / 1000;
}
isWeeklyDataLoaded = true; isWeeklyDataLoaded = true;
}); });
}).catchError((err) { }).catchError((err) {
@ -165,8 +167,10 @@ class _DistanceTrackerState extends State<DistanceTracker> with SingleTickerProv
}); });
generateMonthData(); generateMonthData();
setState(() { setState(() {
if (avgMonthlyStepsValue != 0) {
monthlyStatsAvgValue = avgMonthlyStepsValue ~/ monthlyDataLength; monthlyStatsAvgValue = avgMonthlyStepsValue ~/ monthlyDataLength;
monthlyStatsAvgValue = monthlyStatsAvgValue / 1000; monthlyStatsAvgValue = monthlyStatsAvgValue / 1000;
}
isMonthlyDataLoaded = true; isMonthlyDataLoaded = true;
}); });
}).catchError((err) { }).catchError((err) {
@ -193,8 +197,10 @@ class _DistanceTrackerState extends State<DistanceTracker> with SingleTickerProv
}); });
generateYearData(); generateYearData();
setState(() { setState(() {
if (avgYearlyStepsValue != 0) {
yearlyStatsAvgValue = avgYearlyStepsValue ~/ yearlyDataLength; yearlyStatsAvgValue = avgYearlyStepsValue ~/ yearlyDataLength;
yearlyStatsAvgValue = yearlyStatsAvgValue / 1000; yearlyStatsAvgValue = yearlyStatsAvgValue / 1000;
}
isYearlyDataLoaded = true; isYearlyDataLoaded = true;
}); });
}).catchError((err) { }).catchError((err) {
@ -559,7 +565,8 @@ class _DistanceTrackerState extends State<DistanceTracker> with SingleTickerProv
)} ', )} ',
isCapitable: false, isCapitable: false,
mProjectViewModel: projectViewModel), mProjectViewModel: projectViewModel),
Utils.tableColumnValue(step.valueSum != null ? (step.valueSum / 1000).toString() + " " + TranslationBase.of(context).km_ : "0.0 " + TranslationBase.of(context).km_ , isCapitable: false, mProjectViewModel: projectViewModel), Utils.tableColumnValue(step.valueSum != null ? (step.valueSum / 1000).toString() + " " + TranslationBase.of(context).km_ : "0.0 " + TranslationBase.of(context).km_,
isCapitable: false, mProjectViewModel: projectViewModel),
], ],
), ),
); );
@ -567,5 +574,4 @@ class _DistanceTrackerState extends State<DistanceTracker> with SingleTickerProv
); );
return tableRow; return tableRow;
} }
} }

@ -171,7 +171,9 @@ class _HeartRateTrackerState extends State<HeartRateTracker> with SingleTickerPr
}); });
generateMonthData(); generateMonthData();
setState(() { setState(() {
if (avgMonthlyHearRateValue != 0) {
monthlyStatsAvgValue = avgMonthlyHearRateValue ~/ monthlyDataLength; monthlyStatsAvgValue = avgMonthlyHearRateValue ~/ monthlyDataLength;
}
isMonthlyDataLoaded = true; isMonthlyDataLoaded = true;
}); });
}).catchError((err) { }).catchError((err) {
@ -198,7 +200,9 @@ class _HeartRateTrackerState extends State<HeartRateTracker> with SingleTickerPr
}); });
generateYearData(); generateYearData();
setState(() { setState(() {
if (avgYearlyHearRateValue != 0) {
yearlyStatsAvgValue = avgYearlyHearRateValue ~/ yearlyDataLength; yearlyStatsAvgValue = avgYearlyHearRateValue ~/ yearlyDataLength;
}
isYearlyDataLoaded = true; isYearlyDataLoaded = true;
}); });
}).catchError((err) { }).catchError((err) {

@ -136,7 +136,9 @@ class _StepsTrackerState extends State<StepsTracker> with SingleTickerProviderSt
}); });
generateWeekData(); generateWeekData();
setState(() { setState(() {
if (avgWeeklyStepsValue != 0) {
weeklyStatsAvgValue = avgWeeklyStepsValue ~/ weeklyDataLength; weeklyStatsAvgValue = avgWeeklyStepsValue ~/ weeklyDataLength;
}
isWeeklyDataLoaded = true; isWeeklyDataLoaded = true;
}); });
}).catchError((err) { }).catchError((err) {
@ -163,7 +165,9 @@ class _StepsTrackerState extends State<StepsTracker> with SingleTickerProviderSt
}); });
generateMonthData(); generateMonthData();
setState(() { setState(() {
if (avgMonthlyStepsValue != 0) {
monthlyStatsAvgValue = avgMonthlyStepsValue ~/ monthlyDataLength; monthlyStatsAvgValue = avgMonthlyStepsValue ~/ monthlyDataLength;
}
isMonthlyDataLoaded = true; isMonthlyDataLoaded = true;
}); });
}).catchError((err) { }).catchError((err) {
@ -190,7 +194,9 @@ class _StepsTrackerState extends State<StepsTracker> with SingleTickerProviderSt
}); });
generateYearData(); generateYearData();
setState(() { setState(() {
if (avgYearlyStepsValue != 0) {
yearlyStatsAvgValue = avgYearlyStepsValue ~/ yearlyDataLength; yearlyStatsAvgValue = avgYearlyStepsValue ~/ yearlyDataLength;
}
isYearlyDataLoaded = true; isYearlyDataLoaded = true;
}); });
}).catchError((err) { }).catchError((err) {

@ -1,3 +1,5 @@
import 'dart:io';
import 'package:collection/collection.dart'; import 'package:collection/collection.dart';
import 'package:diplomaticquarterapp/models/SmartWatch/HealthData.dart'; import 'package:diplomaticquarterapp/models/SmartWatch/HealthData.dart';
import 'package:diplomaticquarterapp/services/smartwatch_integration/SmartWatchIntegrationService.dart'; import 'package:diplomaticquarterapp/services/smartwatch_integration/SmartWatchIntegrationService.dart';
@ -6,9 +8,8 @@ import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
import 'package:fit_kit/fit_kit.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:intl/intl.dart'; import 'package:health/health.dart';
class syncHealthDataButton extends StatefulWidget { class syncHealthDataButton extends StatefulWidget {
syncHealthDataButton(); syncHealthDataButton();
@ -18,7 +19,7 @@ class syncHealthDataButton extends StatefulWidget {
} }
class _syncHealthDataButtonState extends State<syncHealthDataButton> { class _syncHealthDataButtonState extends State<syncHealthDataButton> {
List<DataType> dataTypes = List(); List<HealthDataPoint> _healthDataList = [];
List<healthData> Med_InsertTransactionsInputsList = new List(); List<healthData> Med_InsertTransactionsInputsList = new List();
List<healthData> Med_InsertTransactionsInputsList2 = new List(); List<healthData> Med_InsertTransactionsInputsList2 = new List();
@ -33,12 +34,6 @@ class _syncHealthDataButtonState extends State<syncHealthDataButton> {
@override @override
void initState() { void initState() {
dataTypes.add(DataType.DISTANCE);
dataTypes.add(DataType.STEP_COUNT);
dataTypes.add(DataType.HEART_RATE);
// dataTypes.add(DataType.SLEEP);
// dataTypes.add(DataType.ENERGY);
super.initState(); super.initState();
} }
@ -54,98 +49,43 @@ class _syncHealthDataButtonState extends State<syncHealthDataButton> {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
Med_InsertTransactionsInputsList.clear(); Med_InsertTransactionsInputsList.clear();
var date; DateTime startDate = DateTime.now().subtract(new Duration(days: 30));
var differenceInHours;
String strDifferenceInHours;
var differenceInMinutes;
String strDifferenceInMinutes;
var today = DateTime.now();
var yearNum = DateFormat('y').format(today).toString();
var firstDayOfTheYear = DateTime.parse(yearNum + "-" + "01" + "-" + "01");
if (await FitKit.requestPermissions(dataTypes)) {
for (DataType type in dataTypes) {
final results = await FitKit.read(
type,
dateFrom: firstDayOfTheYear,
dateTo: DateTime.now(),
limit: 1000,
);
if (type == DataType.DISTANCE) {
MedCategoryID = 7;
} else if (type == DataType.STEP_COUNT) {
MedCategoryID = 6;
} else if (type == DataType.HEART_RATE) {
MedCategoryID = 3;
}
results.forEach((result) {
// print("in forEach");
date = result.dateTo;
if (result.value.runtimeType.toString() == "int") {
value = double.parse(result.value.toString());
} else {
value = result.value;
}
MedSubCategoryID = 0;
if (MedCategoryID == 4) { HealthFactory health = HealthFactory();
differenceInHours = null; List<HealthDataType> types = [HealthDataType.STEPS, HealthDataType.HEART_RATE, Platform.isAndroid ? HealthDataType.DISTANCE_DELTA : HealthDataType.DISTANCE_WALKING_RUNNING];
var sleepDate = result.dateFrom.toString().substring(0, 10);
DateTime dateFrom = result.dateFrom; await health.requestAuthorization(types);
DateTime dateTo = result.dateTo;
differenceInMinutes = dateTo.difference(dateFrom).inMinutes; try {
differenceInMinutes > 59 ? differenceInHours = differenceInMinutes / 60 : differenceInMinutes = differenceInMinutes; List<HealthDataPoint> healthData = await health.getHealthDataFromTypes(startDate, DateTime.now(), types);
_healthDataList.addAll(healthData);
} catch (e) {
print("Caught exception in getHealthDataFromTypes: $e");
}
if (differenceInHours != null && differenceInHours != 0) { _healthDataList = HealthFactory.removeDuplicates(_healthDataList);
differenceInHours = differenceInHours.toInt();
differenceInMinutes = differenceInMinutes % 60;
differenceInHours < 10 ? strDifferenceInHours = "0" + differenceInHours.toString() : strDifferenceInHours = differenceInHours.toString(); _healthDataList.forEach((x) {
} else { if (x.type == HealthDataType.STEPS) {
strDifferenceInHours = "00"; Med_InsertTransactionsInputsList.add(
differenceInHours = 00; healthData(MedCategoryID: 6, MedSubCategoryID: MedSubCategoryID, MachineDate: DateUtil.convertDateToString(x.dateFrom), Value: x.value, TransactionsListID: TransactionsListID++));
} }
differenceInMinutes < 10 ? strDifferenceInMinutes = "0" + differenceInMinutes.toString() : strDifferenceInMinutes = differenceInMinutes.toString(); if (x.type == HealthDataType.HEART_RATE) {
Med_InsertTransactionsInputsList.add(
sleepDate = DateTime.parse(sleepDate + " " + strDifferenceInHours + ":" + strDifferenceInMinutes + ":" + "00.00").toString(); healthData(MedCategoryID: 3, MedSubCategoryID: MedSubCategoryID, MachineDate: DateUtil.convertDateToString(x.dateFrom), Value: x.value, TransactionsListID: TransactionsListID++));
String hours = sleepDate.substring(11, sleepDate.indexOf(":"));
print(hours);
String minutes = sleepDate.substring(sleepDate.indexOf(":") + 1, sleepDate.indexOf(":") + 3);
print(minutes);
if (value == 0 || value == 109) {
print("in Bed");
MedSubCategoryID = 1;
value = double.parse(hours + "." + minutes);
print("value");
print(value);
} else if (value == 1 || value == 110) {
print("Sleep");
MedSubCategoryID = 2;
value = double.parse(hours + "." + minutes);
print("value");
print(value);
} }
if (x.type == HealthDataType.DISTANCE_DELTA || x.type == HealthDataType.DISTANCE_WALKING_RUNNING) {
Med_InsertTransactionsInputsList.add(
healthData(MedCategoryID: 7, MedSubCategoryID: MedSubCategoryID, MachineDate: DateUtil.convertDateToString(x.dateFrom), Value: x.value, TransactionsListID: TransactionsListID++));
} }
date = DateUtil.convertDateToString(date);
Med_InsertTransactionsInputsList.add(healthData(MedCategoryID: MedCategoryID, MedSubCategoryID: MedSubCategoryID, MachineDate: date, Value: value, TransactionsListID: TransactionsListID++));
}); });
}
}
getAllHealthDataLists(); getAllHealthDataLists();
} }
void getAllHealthDataLists() { void getAllHealthDataLists() {
var totalSteps = 0.0; var totalSteps = 0.0;
var totalDistance = 0.0; var totalDistance = 0.0;
// double totalCalories = 0.0 ;
double totalHeartRate = 0.0; double totalHeartRate = 0.0;
double avgTotalHeartRate = 0.0; double avgTotalHeartRate = 0.0;
var counter = 0; var counter = 0;
@ -175,14 +115,11 @@ class _syncHealthDataButtonState extends State<syncHealthDataButton> {
value.forEach((element) { value.forEach((element) {
if (element['MedCategoryID'] == 6) { if (element['MedCategoryID'] == 6) {
MedCategoryID = 6; MedCategoryID = 6;
totalSteps += element['Value']; totalSteps += element['Value'];
} else if (element['MedCategoryID'] == 7) { } else if (element['MedCategoryID'] == 7) {
MedCategoryID = 7; MedCategoryID = 7;
// to convert from meter to km
totalDistance += (element['Value'] * 0.001); totalDistance += (element['Value'] * 0.001);
} else if (element['MedCategoryID'] == 3) { } else if (element['MedCategoryID'] == 3) {
// print("HeartRate");
MedCategoryID = 3; MedCategoryID = 3;
counter++; counter++;
totalHeartRate += element['Value']; totalHeartRate += element['Value'];
@ -194,10 +131,6 @@ class _syncHealthDataButtonState extends State<syncHealthDataButton> {
Med_InsertTransactionsInputsList2.add(new healthData( Med_InsertTransactionsInputsList2.add(new healthData(
MedCategoryID: 4, MedSubCategoryID: element['MedSubCategoryID'], MachineDate: DateUtil.convertDateToString(date), Value: element['Value'], TransactionsListID: TransactionsListID++)); MedCategoryID: 4, MedSubCategoryID: element['MedSubCategoryID'], MachineDate: DateUtil.convertDateToString(date), Value: element['Value'], TransactionsListID: TransactionsListID++));
} }
// else if(element['MedCategoryID'] == 8){
//
// totalCalories += element['Value'] ;
// }
}); });
if (counter == 0) { if (counter == 0) {

@ -18,28 +18,25 @@ dynamic languageID;
class ClinicPackagesPage extends StatefulWidget { class ClinicPackagesPage extends StatefulWidget {
List<PackagesResponseModel> products; List<PackagesResponseModel> products;
ClinicPackagesPage({@required this.products}); ClinicPackagesPage({@required this.products});
@override @override
_ClinicPackagesPageState createState() => _ClinicPackagesPageState(); _ClinicPackagesPageState createState() => _ClinicPackagesPageState();
} }
class _ClinicPackagesPageState extends State<ClinicPackagesPage> with AfterLayoutMixin<ClinicPackagesPage>{ class _ClinicPackagesPageState extends State<ClinicPackagesPage> with AfterLayoutMixin<ClinicPackagesPage> {
AppScaffold appScaffold; AppScaffold appScaffold;
List<PackagesResponseModel> get _products => widget.products; List<PackagesResponseModel> get _products => widget.products;
PackagesViewModel viewModel; PackagesViewModel viewModel;
onProductCartClick(PackagesResponseModel product) async { onProductCartClick(PackagesResponseModel product) async {
if(viewModel.service.customer == null) if (viewModel.service.customer == null) viewModel.service.customer = await CreateCustomerDialogPage(context: context).show();
viewModel.service.customer = await CreateCustomerDialogPage(context: context).show();
if(viewModel.service.customer != null) { if (viewModel.service.customer != null) {
var request = AddProductToCartRequestModel(product_id: product.id, customer_id: viewModel.service.customer.id); var request = AddProductToCartRequestModel(product_id: product.id, customer_id: viewModel.service.customer.id);
await viewModel.service.addProductToCart(request, context: context).then((response){ await viewModel.service.addProductToCart(request, context: context).then((response) {
// appScaffold.appBar.badgeUpdater(viewModel.service.cartItemCount); // appScaffold.appBar.badgeUpdater(viewModel.service.cartItemCount);
}).catchError((error) { }).catchError((error) {
utils.Utils.showErrorToast(error); utils.Utils.showErrorToast(error);
@ -47,9 +44,8 @@ class _ClinicPackagesPageState extends State<ClinicPackagesPage> with AfterLayo
} }
} }
@override @override
void afterFirstLayout(BuildContext context) async{ void afterFirstLayout(BuildContext context) async {
// appScaffold.appBar.badgeUpdater(viewModel.service.cartItemCount); // appScaffold.appBar.badgeUpdater(viewModel.service.cartItemCount);
} }
@ -58,13 +54,11 @@ class _ClinicPackagesPageState extends State<ClinicPackagesPage> with AfterLayo
super.initState(); super.initState();
} }
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return BaseView<PackagesViewModel>( return BaseView<PackagesViewModel>(
allowAny: true, allowAny: true,
onModelReady: (model){ onModelReady: (model) {
viewModel = model; viewModel = model;
}, },
builder: (_, model, wi) => appScaffold = AppScaffold( builder: (_, model, wi) => appScaffold = AppScaffold(
@ -76,22 +70,25 @@ class _ClinicPackagesPageState extends State<ClinicPackagesPage> with AfterLayo
isOfferPackages: true, isOfferPackages: true,
showOfferPackagesCart: true, showOfferPackagesCart: true,
isShowDecPage: false, isShowDecPage: false,
showNewAppBar: true,
showNewAppBarTitle: true,
body: Padding( body: Padding(
padding: const EdgeInsets.all(5), padding: const EdgeInsets.all(12),
child: StaggeredGridView.countBuilder( child: StaggeredGridView.countBuilder(
crossAxisCount:4, crossAxisCount: 4,
itemCount: _products.length, itemCount: _products.length,
itemBuilder: (BuildContext context, int index) => new Container( itemBuilder: (BuildContext context, int index) => new Container(
color: Colors.transparent, color: Colors.transparent,
child: PackagesItemCard( itemContentPadding: 10,itemModel: _products[index], onCartClick: onProductCartClick,) child: PackagesItemCard(
), itemContentPadding: 10,
itemModel: _products[index],
onCartClick: onProductCartClick,
)),
staggeredTileBuilder: (int index) => StaggeredTile.fit(2), staggeredTileBuilder: (int index) => StaggeredTile.fit(2),
mainAxisSpacing: 20, mainAxisSpacing: 20,
crossAxisSpacing: 10, crossAxisSpacing: 10,
) )),
),
), ),
); );
} }
} }

File diff suppressed because it is too large Load Diff

@ -16,7 +16,7 @@ class CompareList with ChangeNotifier {
); );
} else { } else {
for (int i = 0; i < _product.length; i++) { for (int i = 0; i < _product.length; i++) {
if (_product.length <= 4 && _product[i].id != data.id) { if (_product.length < 4 && _product[i].id != data.id) {
_product.add(data); _product.add(data);
AppToast.showSuccessToast(message:TranslationBase.of(context).addToCompareMsg AppToast.showSuccessToast(message:TranslationBase.of(context).addToCompareMsg
// 'You have added a product to the Compare list' // 'You have added a product to the Compare list'

@ -1,4 +1,5 @@
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
@ -113,6 +114,7 @@ class slideDetail extends StatefulWidget {
class _slideDetailState extends State<slideDetail> { class _slideDetailState extends State<slideDetail> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
return ListView.builder( return ListView.builder(
scrollDirection: Axis.horizontal, scrollDirection: Axis.horizontal,
itemCount: widget.data.length, itemCount: widget.data.length,
@ -122,7 +124,7 @@ class _slideDetailState extends State<slideDetail> {
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
Container( Container(
height: 750, height: 760,
width: 150, width: 150,
margin: EdgeInsets.symmetric(horizontal: 10.0), margin: EdgeInsets.symmetric(horizontal: 10.0),
decoration: BoxDecoration( decoration: BoxDecoration(
@ -171,10 +173,10 @@ class _slideDetailState extends State<slideDetail> {
), ),
Container( Container(
margin: EdgeInsets.all(5), margin: EdgeInsets.all(5),
child: Align( child:Align(
alignment: Alignment.topLeft, alignment: Alignment.topLeft,
child: RichText( child: RichText(
text: languageID == "ar"? TextSpan( text: projectViewModel.isArabic ? TextSpan(
text: widget.data[index].namen, text: widget.data[index].namen,
style: TextStyle( style: TextStyle(
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
@ -193,7 +195,20 @@ class _slideDetailState extends State<slideDetail> {
), ),
Container( Container(
margin: EdgeInsets.all(5), margin: EdgeInsets.all(5),
child: Align( child: projectViewModel.isArabic ?
Align(
alignment: Alignment.topRight,
child: RichText(
text: TextSpan(
text: "SAR ${widget.data[index].price.toString()}",
style: TextStyle(
color: Colors.black54,
fontSize: 15,
fontWeight: FontWeight.bold),
),
),
):
Align(
alignment: Alignment.topLeft, alignment: Alignment.topLeft,
child: RichText( child: RichText(
text: TextSpan( text: TextSpan(
@ -216,58 +231,61 @@ class _slideDetailState extends State<slideDetail> {
), ),
Container( Container(
margin: EdgeInsets.all(5), margin: EdgeInsets.all(5),
child: Align( child: projectViewModel.isArabic ?
alignment: Alignment.topLeft, Align(
alignment: Alignment.topRight,
child: RichText( child: RichText(
text: languageID == "ar"? TextSpan( text: TextSpan(
text: widget.data[index].specifications != null ? text: widget.data[index].specifications != null ?
widget.data[index].specifications[0].nameN : widget.data[index].specifications[0].nameN :"",
// "No data",
TranslationBase.of(context).no_data,
style: TextStyle( style: TextStyle(
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
color: Colors.black, color: Colors.black,
fontSize: 13), fontSize: 13),
) )
:TextSpan( ),
): Align(
alignment: Alignment.topLeft,
child: RichText(
text: TextSpan(
text: widget.data[index].specifications != null ? text: widget.data[index].specifications != null ?
widget.data[index].specifications[0].name : widget.data[index].specifications[0].name :"",
// "No data",
TranslationBase.of(context).no_data,
style: TextStyle( style: TextStyle(
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
color: Colors.black, color: Colors.black,
fontSize: 13), fontSize: 13),
)
), ),
), )
),
), ),
Container( Container(
margin: EdgeInsets.all(5), margin: EdgeInsets.all(5),
child: Align( child: projectViewModel.isArabic ?
alignment: Alignment.topLeft, Align(
alignment: Alignment.topRight,
child: RichText( child: RichText(
text: languageID == "ar"? TextSpan( text:TextSpan(
text: widget.data[index].specifications != null ? text: widget.data[index].specifications != null ?
widget.data[index].specifications[0].defaultValuen : widget.data[index].specifications[0].defaultValuen:"",
// "No data",
TranslationBase.of(context).no_data,
style: TextStyle( style: TextStyle(
color: Colors.black54, color: Colors.black54,
fontSize: 15, fontSize: 15,
fontWeight: FontWeight.bold), fontWeight: FontWeight.bold),
):TextSpan( )
),
):Align(
alignment: Alignment.topLeft,
child: RichText(
text:TextSpan(
text: widget.data[index].specifications != null ? text: widget.data[index].specifications != null ?
widget.data[index].specifications[0].defaultValue : widget.data[index].specifications[0].defaultValue:"",
// "No data",
TranslationBase.of(context).no_data,
style: TextStyle( style: TextStyle(
color: Colors.black54, color: Colors.black54,
fontSize: 15, fontSize: 15,
fontWeight: FontWeight.bold), fontWeight: FontWeight.bold),
)
), ),
), )
),
), ),
Padding( Padding(
padding: EdgeInsets.only(top: 8.0), padding: EdgeInsets.only(top: 8.0),
@ -279,57 +297,61 @@ class _slideDetailState extends State<slideDetail> {
), ),
Container( Container(
margin: EdgeInsets.all(5), margin: EdgeInsets.all(5),
child: Align( child: projectViewModel.isArabic ?
alignment: Alignment.topLeft, Align(
alignment: Alignment.topRight,
child: RichText( child: RichText(
text: languageID == "ar"? TextSpan( text: TextSpan(
text: widget.data[index].specifications != null ? text: widget.data[index].specifications != null ?
widget.data[index].specifications[1].nameN : widget.data[index].specifications[1].nameN :"",
// "No data",
TranslationBase.of(context).no_data,
style: TextStyle( style: TextStyle(
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
color: Colors.black, color: Colors.black,
fontSize: 13), fontSize: 13),
):TextSpan( )
),
): Align(
alignment: Alignment.topLeft,
child: RichText(
text: TextSpan(
text: widget.data[index].specifications != null ? text: widget.data[index].specifications != null ?
widget.data[index].specifications[1].name : widget.data[index].specifications[1].name :"",
// "No data",
TranslationBase.of(context).no_data,
style: TextStyle( style: TextStyle(
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
color: Colors.black, color: Colors.black,
fontSize: 13), fontSize: 13),
)
), ),
), )
),
), ),
Container( Container(
margin: EdgeInsets.all(5), margin: EdgeInsets.all(5),
child: Align( child: projectViewModel.isArabic ?
alignment: Alignment.topLeft, Align(
alignment: Alignment.topRight,
child: RichText( child: RichText(
text: languageID == "ar"? TextSpan( text:TextSpan(
text: widget.data[index].specifications != null ? text: widget.data[index].specifications != null ?
widget.data[index].specifications[1].defaultValuen : widget.data[index].specifications[1].defaultValuen:"",
// "No data",
TranslationBase.of(context).no_data,
style: TextStyle( style: TextStyle(
color: Colors.black54, color: Colors.black54,
fontSize: 15, fontSize: 15,
fontWeight: FontWeight.bold), fontWeight: FontWeight.bold),
):TextSpan( )
),
):Align(
alignment: Alignment.topLeft,
child: RichText(
text:TextSpan(
text: widget.data[index].specifications != null ? text: widget.data[index].specifications != null ?
widget.data[index].specifications[1].defaultValue : widget.data[index].specifications[1].defaultValue:"",
// "No data",
TranslationBase.of(context).no_data,
style: TextStyle( style: TextStyle(
color: Colors.black54, color: Colors.black54,
fontSize: 15, fontSize: 15,
fontWeight: FontWeight.bold), fontWeight: FontWeight.bold),
)
), ),
), )
),
), ),
Padding( Padding(
padding: EdgeInsets.only(top: 8.0), padding: EdgeInsets.only(top: 8.0),
@ -341,57 +363,61 @@ class _slideDetailState extends State<slideDetail> {
), ),
Container( Container(
margin: EdgeInsets.all(5), margin: EdgeInsets.all(5),
child: Align( child: projectViewModel.isArabic ?
alignment: Alignment.topLeft, Align(
alignment: Alignment.topRight,
child: RichText( child: RichText(
text: languageID == "ar"? TextSpan( text: TextSpan(
text: widget.data[index].specifications != null ? text: widget.data[index].specifications != null ?
widget.data[index].specifications[2].nameN : widget.data[index].specifications[2].nameN :"",
// "No data",
TranslationBase.of(context).no_data,
style: TextStyle( style: TextStyle(
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
color: Colors.black, color: Colors.black,
fontSize: 13), fontSize: 13),
):TextSpan( )
),
): Align(
alignment: Alignment.topLeft,
child: RichText(
text: TextSpan(
text: widget.data[index].specifications != null ? text: widget.data[index].specifications != null ?
widget.data[index].specifications[2].name : widget.data[index].specifications[2].name :"",
// "No data",
TranslationBase.of(context).no_data,
style: TextStyle( style: TextStyle(
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
color: Colors.black, color: Colors.black,
fontSize: 13), fontSize: 13),
)
), ),
), )
),
), ),
Container( Container(
margin: EdgeInsets.all(5), margin: EdgeInsets.all(5),
child: Align( child: projectViewModel.isArabic ?
alignment: Alignment.topLeft, Align(
alignment: Alignment.topRight,
child: RichText( child: RichText(
text: languageID == "ar"? TextSpan( text:TextSpan(
text: widget.data[index].specifications != null ? text: widget.data[index].specifications != null ?
widget.data[index].specifications[2].defaultValuen : widget.data[index].specifications[2].defaultValuen:"",
// "No data",
TranslationBase.of(context).no_data,
style: TextStyle( style: TextStyle(
color: Colors.black54, color: Colors.black54,
fontSize: 15, fontSize: 15,
fontWeight: FontWeight.bold), fontWeight: FontWeight.bold),
):TextSpan( )
),
):Align(
alignment: Alignment.topLeft,
child: RichText(
text:TextSpan(
text: widget.data[index].specifications != null ? text: widget.data[index].specifications != null ?
widget.data[index].specifications[2].defaultValue : widget.data[index].specifications[2].defaultValue:"",
// "No data",
TranslationBase.of(context).no_data,
style: TextStyle( style: TextStyle(
color: Colors.black54, color: Colors.black54,
fontSize: 15, fontSize: 15,
fontWeight: FontWeight.bold), fontWeight: FontWeight.bold),
)
), ),
), )
),
), ),
Padding( Padding(
padding: EdgeInsets.only(top: 8.0), padding: EdgeInsets.only(top: 8.0),
@ -403,57 +429,61 @@ class _slideDetailState extends State<slideDetail> {
), ),
Container( Container(
margin: EdgeInsets.all(5), margin: EdgeInsets.all(5),
child: Align( child: projectViewModel.isArabic ?
alignment: Alignment.topLeft, Align(
alignment: Alignment.topRight,
child: RichText( child: RichText(
text: languageID == "ar"? TextSpan( text: TextSpan(
text: widget.data[index].specifications != null ? text: widget.data[index].specifications != null ?
widget.data[index].specifications[3].nameN : widget.data[index].specifications[3].nameN :"",
// "No data",
TranslationBase.of(context).no_data,
style: TextStyle( style: TextStyle(
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
color: Colors.black, color: Colors.black,
fontSize: 13), fontSize: 13),
):TextSpan( )
),
): Align(
alignment: Alignment.topLeft,
child: RichText(
text: TextSpan(
text: widget.data[index].specifications != null ? text: widget.data[index].specifications != null ?
widget.data[index].specifications[3].name : widget.data[index].specifications[3].name :"",
// "No data",
TranslationBase.of(context).no_data,
style: TextStyle( style: TextStyle(
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
color: Colors.black, color: Colors.black,
fontSize: 13), fontSize: 13),
)
), ),
), )
),
), ),
Container( Container(
margin: EdgeInsets.all(5), margin: EdgeInsets.all(5),
child: Align( child: projectViewModel.isArabic ?
alignment: Alignment.topLeft, Align(
alignment: Alignment.topRight,
child: RichText( child: RichText(
text: languageID == "ar"? TextSpan( text:TextSpan(
text: widget.data[index].specifications != null ? text: widget.data[index].specifications != null ?
widget.data[index].specifications[3].defaultValuen : widget.data[index].specifications[3].defaultValuen:"",
// "No data",
TranslationBase.of(context).no_data,
style: TextStyle( style: TextStyle(
color: Colors.black54, color: Colors.black54,
fontSize: 15, fontSize: 15,
fontWeight: FontWeight.bold), fontWeight: FontWeight.bold),
):TextSpan( )
),
):Align(
alignment: Alignment.topLeft,
child: RichText(
text:TextSpan(
text: widget.data[index].specifications != null ? text: widget.data[index].specifications != null ?
widget.data[index].specifications[3].defaultValue : widget.data[index].specifications[3].defaultValue:"",
// "No data",
TranslationBase.of(context).no_data,
style: TextStyle( style: TextStyle(
color: Colors.black54, color: Colors.black54,
fontSize: 15, fontSize: 15,
fontWeight: FontWeight.bold), fontWeight: FontWeight.bold),
)
), ),
), )
),
), ),
Padding( Padding(
padding: EdgeInsets.only(top: 8.0), padding: EdgeInsets.only(top: 8.0),
@ -465,57 +495,61 @@ class _slideDetailState extends State<slideDetail> {
), ),
Container( Container(
margin: EdgeInsets.all(5), margin: EdgeInsets.all(5),
child: Align( child: projectViewModel.isArabic ?
alignment: Alignment.topLeft, Align(
alignment: Alignment.topRight,
child: RichText( child: RichText(
text: languageID == "ar"? TextSpan( text: TextSpan(
text: widget.data[index].specifications != null ? text: widget.data[index].specifications != null ?
widget.data[index].specifications[4].nameN : widget.data[index].specifications[4].nameN :"",
// "No data",
TranslationBase.of(context).no_data,
style: TextStyle( style: TextStyle(
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
color: Colors.black, color: Colors.black,
fontSize: 13), fontSize: 13),
):TextSpan( )
),
): Align(
alignment: Alignment.topLeft,
child: RichText(
text: TextSpan(
text: widget.data[index].specifications != null ? text: widget.data[index].specifications != null ?
widget.data[index].specifications[4].name : widget.data[index].specifications[4].name :"",
// "No data",
TranslationBase.of(context).no_data,
style: TextStyle( style: TextStyle(
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
color: Colors.black, color: Colors.black,
fontSize: 13), fontSize: 13),
)
), ),
), )
),
), ),
Container( Container(
margin: EdgeInsets.all(5), margin: EdgeInsets.all(5),
child: Align( child: projectViewModel.isArabic ?
alignment: Alignment.topLeft, Align(
alignment: Alignment.topRight,
child: RichText( child: RichText(
text: languageID == "ar"? TextSpan( text:TextSpan(
text: widget.data[index].specifications != null ? text: widget.data[index].specifications != null ?
widget.data[index].specifications[4].defaultValuen : widget.data[index].specifications[4].defaultValuen:"",
// "No data",
TranslationBase.of(context).no_data,
style: TextStyle( style: TextStyle(
color: Colors.black54, color: Colors.black54,
fontSize: 15, fontSize: 15,
fontWeight: FontWeight.bold), fontWeight: FontWeight.bold),
):TextSpan( )
),
):Align(
alignment: Alignment.topLeft,
child: RichText(
text:TextSpan(
text: widget.data[index].specifications != null ? text: widget.data[index].specifications != null ?
widget.data[index].specifications[4].defaultValue : widget.data[index].specifications[4].defaultValue:"",
// "No data",
TranslationBase.of(context).no_data,
style: TextStyle( style: TextStyle(
color: Colors.black54, color: Colors.black54,
fontSize: 15, fontSize: 15,
fontWeight: FontWeight.bold), fontWeight: FontWeight.bold),
)
), ),
), )
),
), ),
Padding( Padding(
padding: EdgeInsets.only(top: 8.0), padding: EdgeInsets.only(top: 8.0),
@ -527,66 +561,63 @@ class _slideDetailState extends State<slideDetail> {
), ),
Container( Container(
margin: EdgeInsets.all(5), margin: EdgeInsets.all(5),
child: Align( child: projectViewModel.isArabic ?
alignment: Alignment.topLeft, Align(
alignment: Alignment.topRight,
child: RichText( child: RichText(
text: languageID == "ar"? TextSpan( text: TextSpan(
text: widget.data[index].specifications != null ? text: widget.data[index].specifications != null ?
widget.data[index].specifications[5].nameN : widget.data[index].specifications[5].nameN :"",
// "No data",
TranslationBase.of(context).no_data,
style: TextStyle( style: TextStyle(
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
color: Colors.black, color: Colors.black,
fontSize: 13), fontSize: 13),
):TextSpan( )
),
): Align(
alignment: Alignment.topLeft,
child: RichText(
text: TextSpan(
text: widget.data[index].specifications != null ? text: widget.data[index].specifications != null ?
widget.data[index].specifications[5].name : widget.data[index].specifications[5].name :"",
// "No data",
TranslationBase.of(context).no_data,
style: TextStyle( style: TextStyle(
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
color: Colors.black, color: Colors.black,
fontSize: 13), fontSize: 13),
)
), ),
), )
),
), ),
Container( Container(
margin: EdgeInsets.all(5), margin: EdgeInsets.all(5),
child: Align( child: projectViewModel.isArabic ?
alignment: Alignment.topLeft, Align(
alignment: Alignment.topRight,
child: RichText( child: RichText(
text: languageID == "ar"? TextSpan( text:TextSpan(
text: widget.data[index].specifications != null ? text: widget.data[index].specifications != null ?
widget.data[index].specifications[5].defaultValuen : widget.data[index].specifications[5].defaultValuen:"",
// "No data",
TranslationBase.of(context).no_data,
style: TextStyle( style: TextStyle(
color: Colors.black54, color: Colors.black54,
fontSize: 15, fontSize: 15,
fontWeight: FontWeight.bold), fontWeight: FontWeight.bold),
):TextSpan( )
),
):Align(
alignment: Alignment.topLeft,
child: RichText(
text:TextSpan(
text: widget.data[index].specifications != null ? text: widget.data[index].specifications != null ?
widget.data[index].specifications[5].defaultValue : widget.data[index].specifications[5].defaultValue:"",
// "No data",
TranslationBase.of(context).no_data,
style: TextStyle( style: TextStyle(
color: Colors.black54, color: Colors.black54,
fontSize: 15, fontSize: 15,
fontWeight: FontWeight.bold), fontWeight: FontWeight.bold),
)
), ),
)
), ),
),
),
Padding(
padding: EdgeInsets.only(top: 8.0),
child: Container(
height: 1.0,
width: 300.0,
color: Colors.grey,
),
),
], ],
), ),
), ),

@ -412,7 +412,7 @@ class _OrderBottomWidgetState extends State<OrderBottomWidget> {
if (widget.model.isCartItemsOutOfStock()) if (widget.model.isCartItemsOutOfStock())
{AppToast.showErrorToast(message: TranslationBase.of(context).outOfStockMsg)} {AppToast.showErrorToast(message: TranslationBase.of(context).outOfStockMsg)}
else else
{_navigateToAddressPage(widget.model.user.patientIdentificationNo)} {_navigateToAddressPage(projectProvider.user.patientIdentificationNo)}
} }
: null, : null,
child: new Text( child: new Text(

@ -1,9 +1,13 @@
import 'dart:ui';
import 'package:diplomaticquarterapp/core/model/pharmacies/Addresses.dart'; import 'package:diplomaticquarterapp/core/model/pharmacies/Addresses.dart';
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/OrderPreviewViewModel.dart'; import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/OrderPreviewViewModel.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/screens/cart-page/payment_bottom_widget.dart'; import 'package:diplomaticquarterapp/pages/pharmacies/screens/cart-page/payment_bottom_widget.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/screens/cart-page/select_address_widget.dart'; import 'package:diplomaticquarterapp/pages/pharmacies/screens/cart-page/select_address_widget.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/screens/cart-page/select_payment_option_widget.dart'; import 'package:diplomaticquarterapp/pages/pharmacies/screens/cart-page/select_payment_option_widget.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/widgets/ProductOrderPreviewItem.dart'; import 'package:diplomaticquarterapp/pages/pharmacies/widgets/ProductOrderPreviewItem.dart';
import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/in_app_browser/InAppBrowser.dart'; import 'package:diplomaticquarterapp/widgets/in_app_browser/InAppBrowser.dart';
@ -11,8 +15,6 @@ 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 'package:provider/provider.dart';
import 'lakum_widget.dart';
class OrderPreviewPage extends StatefulWidget { class OrderPreviewPage extends StatefulWidget {
final List<Addresses> addresses; final List<Addresses> addresses;
final OrderPreviewViewModel model; final OrderPreviewViewModel model;
@ -26,6 +28,7 @@ class OrderPreviewPage extends StatefulWidget {
class _OrderPreviewPageState extends State<OrderPreviewPage> { class _OrderPreviewPageState extends State<OrderPreviewPage> {
MyInAppBrowser browser; MyInAppBrowser browser;
bool isLoading = true; bool isLoading = true;
bool isChecked = false;
@override @override
void initState() { void initState() {
@ -44,7 +47,7 @@ class _OrderPreviewPageState extends State<OrderPreviewPage> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
final mediaQuery = MediaQuery.of(context); final mediaQuery = MediaQuery.of(context);
final height = mediaQuery.size.height - 60 - mediaQuery.padding.top; final height = mediaQuery.size.height - 60 - mediaQuery.padding.top;
// OrderPreviewViewModel widget.model = Provider.of(context); ProjectViewModel projectViewModel = Provider.of(context);
return AppScaffold( return AppScaffold(
appBarTitle: "${TranslationBase.of(context).checkOut}", appBarTitle: "${TranslationBase.of(context).checkOut}",
isShowAppBar: true, isShowAppBar: true,
@ -62,24 +65,107 @@ class _OrderPreviewPageState extends State<OrderPreviewPage> {
color: Color(0xFFF1F1F1), color: Color(0xFFF1F1F1),
child: Column( child: Column(
children: [ children: [
SelectAddressWidget(widget.model, widget.addresses, changeMainState, isUpdating: true,), SelectAddressWidget(
widget.model,
widget.addresses,
changeMainState,
isUpdating: true,
),
SizedBox( SizedBox(
height: 10, height: 10,
), ),
SelectPaymentOptionWidget(widget.model, changeMainState,isUpdating: true,), SelectPaymentOptionWidget(
widget.model,
changeMainState,
isUpdating: true,
),
SizedBox( SizedBox(
height: 10, height: 10,
), ),
widget.model.paymentCheckoutData.lacumInformation != null widget.model.paymentCheckoutData.lacumInformation != null
? Container( ? Stack(
children: [
Container(
child: Column(
children: [
Container(
color: Colors.white,
padding: EdgeInsets.symmetric(vertical: 12, horizontal: 12),
child: Row(
children: [
Row(
children: [
SizedBox(
height: 24.0,
width: 24.0,
child: Checkbox(
activeColor: CustomColors.green,
value: isChecked,
onChanged: (bool value) {
setState(() {
isChecked = value;
if (value) {
PaymentBottomWidget.isChecked = true;
} else {
PaymentBottomWidget.isChecked = false;
}
setState(() {});
});
},
),
),
Padding(
padding: const EdgeInsets.only(left: 8.0, right: 8.0),
child: Text(
TranslationBase.of(context).useLakumPoints +
" (${widget.model.paymentCheckoutData.lacumInformation.lakumInquiryInformationObjVersion.pointsBalance.toString() + " " + TranslationBase.of(context).points})",
style: TextStyle(fontSize: 12.0, fontWeight: FontWeight.w600, letterSpacing: -0.56)),
),
],
),
Expanded(
child: Container(
decoration: BoxDecoration(color: Color(0x99ffffff)),
padding: const EdgeInsets.symmetric(horizontal: 8),
child: Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
Container(
decoration: BoxDecoration(color: Color(0x99ffffff)),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
LakumWidget(widget.model), Texts(
"${TranslationBase.of(context).availableBalance}",
fontSize: 12,
fontWeight: FontWeight.bold,
),
Text(
"${TranslationBase.of(context).sar + " " + widget.model.paymentCheckoutData.lacumInformation.lakumInquiryInformationObjVersion.pointsBalanceAmount.toString()}",
style: TextStyle(fontSize: 12.0, fontWeight: FontWeight.w600, letterSpacing: -0.56)),
],
),
),
],
),
),
),
],
),
),
SizedBox( SizedBox(
height: 10, height: 10,
), ),
], ],
), ),
),
projectViewModel.havePrivilege(83)
? Container()
: Container(
height: MediaQuery.of(context).size.height * .10,
color: Colors.white.withOpacity(0.6),
)
],
) )
: Container(), : Container(),
Container( Container(
@ -190,7 +276,54 @@ class _OrderPreviewPageState extends State<OrderPreviewPage> {
indent: 0, indent: 0,
endIndent: 0, endIndent: 0,
), ),
Row( isChecked
? Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Texts(
"${TranslationBase.of(context).lakum}",
fontSize: 14,
color: Colors.green,
fontWeight: FontWeight.w500,
),
Texts(
"- ${TranslationBase.of(context).sar} ${(widget.model.paymentCheckoutData.lacumInformation.lakumInquiryInformationObjVersion.pointsBalanceAmount).toStringAsFixed(2)}",
fontSize: 14,
color: Colors.green,
fontWeight: FontWeight.w500,
),
],
)
: Container(),
isChecked
? const Divider(
color: Color(0xFFD6D6D6),
height: 20,
thickness: 1,
indent: 0,
endIndent: 0,
)
: Container(),
isChecked
? Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Texts(
TranslationBase.of(context).total,
fontSize: 14,
color: Colors.black,
fontWeight: FontWeight.bold,
),
Texts(
" ${TranslationBase.of(context).sar}"
"${(widget.model.cartResponse.totalAmount - widget.model.paymentCheckoutData.lacumInformation.lakumInquiryInformationObjVersion.pointsBalanceAmount).toStringAsFixed(2)}",
fontSize: 14,
color: Colors.black,
fontWeight: FontWeight.bold,
),
],
)
: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
Texts( Texts(
@ -200,7 +333,7 @@ class _OrderPreviewPageState extends State<OrderPreviewPage> {
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
), ),
Texts( Texts(
"${TranslationBase.of(context).sar} ${(widget.model.cartResponse.totalAmount).toStringAsFixed(2)}", " ${TranslationBase.of(context).sar} ${(widget.model.cartResponse.totalAmount).toStringAsFixed(2)}",
fontSize: 14, fontSize: 14,
color: Colors.black, color: Colors.black,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,

@ -1,5 +1,8 @@
import 'dart:ui';
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/OrderPreviewViewModel.dart'; import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/OrderPreviewViewModel.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/screens/cart-page/cart-order-preview.dart';
import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
@ -9,6 +12,7 @@ import 'package:provider/provider.dart';
class LakumWidget extends StatefulWidget { class LakumWidget extends StatefulWidget {
final OrderPreviewViewModel model; final OrderPreviewViewModel model;
LakumWidget(this.model); LakumWidget(this.model);
@override @override
@ -41,6 +45,15 @@ class _LakumWidgetState extends State<LakumWidget> {
setState(() { setState(() {
useLakumWidgets = value; useLakumWidgets = value;
print(useLakumWidgets); print(useLakumWidgets);
// if (value){
// // isChecked;
// OrderPreviewPage.isChecked = true;
// print(value);
// }else{
// OrderPreviewPage.isChecked = false;
// }
setState(() {
});
}); });
}, },
), ),
@ -150,6 +163,25 @@ class _LakumWidgetState extends State<LakumWidget> {
// ), // ),
), ),
), ),
// useLakumWidgets ?
// Row(
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
// children: [
// Texts(
// "${TranslationBase.of(context).lakum}",
// fontSize: 14,
// color: Colors.black,
// fontWeight: FontWeight.w500,
// ),
// Texts(
// "${TranslationBase.of(context).sar} ${(widget.model.paymentCheckoutData.lacumInformation.lakumInquiryInformationObjVersion.pointsBalance).toStringAsFixed(2)}",
// fontSize: 14,
// color: Colors.black,
// fontWeight: FontWeight.w500,
// ),
// ],
// )
// :Container()
], ],
), ),
); );

@ -1,6 +1,7 @@
import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/order_detail.dart'; import 'package:diplomaticquarterapp/core/model/pharmacies/order_detail.dart';
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/OrderPreviewViewModel.dart'; import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/OrderPreviewViewModel.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/locator.dart'; import 'package:diplomaticquarterapp/locator.dart';
import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart'; import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart';
import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart';
@ -16,6 +17,7 @@ import 'package:provider/provider.dart';
class PaymentBottomWidget extends StatelessWidget { class PaymentBottomWidget extends StatelessWidget {
final OrderPreviewViewModel model; final OrderPreviewViewModel model;
static bool isChecked = true;
BuildContext context; BuildContext context;
MyInAppBrowser browser; MyInAppBrowser browser;
@ -24,7 +26,7 @@ class PaymentBottomWidget extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final scaffold = Scaffold.of(context); ProjectViewModel projectViewModel = Provider.of(context);
this.context = context; this.context = context;
OrderPreviewViewModel orderPreviewViewModel = Provider.of(context); OrderPreviewViewModel orderPreviewViewModel = Provider.of(context);
return Container( return Container(
@ -42,6 +44,12 @@ class PaymentBottomWidget extends StatelessWidget {
margin: EdgeInsets.symmetric(horizontal: 0, vertical: 4), margin: EdgeInsets.symmetric(horizontal: 0, vertical: 4),
child: Row( child: Row(
children: [ children: [
isChecked ? Texts(
"${TranslationBase.of(context).sar} ${(model.cartResponse.totalAmount - model.paymentCheckoutData.lacumInformation.lakumInquiryInformationObjVersion.pointsBalanceAmount).toStringAsFixed(2)}",
fontSize: 14,
fontWeight: FontWeight.bold,
color: Color(0xff929295),
):
Texts( Texts(
"${TranslationBase.of(context).sar} ${(model.cartResponse.totalAmount).toStringAsFixed(2)}", "${TranslationBase.of(context).sar} ${(model.cartResponse.totalAmount).toStringAsFixed(2)}",
fontSize: 14, fontSize: 14,
@ -81,7 +89,7 @@ class PaymentBottomWidget extends StatelessWidget {
onPressed: (orderPreviewViewModel.paymentCheckoutData.address != null && orderPreviewViewModel.paymentCheckoutData.paymentOption != null) onPressed: (orderPreviewViewModel.paymentCheckoutData.address != null && orderPreviewViewModel.paymentCheckoutData.paymentOption != null)
? () async { ? () async {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
await model.makeOrder(); await model.makeOrder(projectViewModel.havePrivilege(83));
if (model.state == ViewState.Idle) { if (model.state == ViewState.Idle) {
AppToast.showSuccessToast(message: TranslationBase.of(context).compeleteOrderMsg); AppToast.showSuccessToast(message: TranslationBase.of(context).compeleteOrderMsg);
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);

@ -41,6 +41,9 @@ class _LacumTransferPageState extends State<LacumTransferPage> {
isShowAppBar: true, isShowAppBar: true,
isPharmacy: true, isPharmacy: true,
isShowDecPage: false, isShowDecPage: false,
showHomeAppBarIcon: false,
isBottomBar: true,
showPharmacyCart: false,
backgroundColor: Colors.white, backgroundColor: Colors.white,
baseViewModel: model, baseViewModel: model,
body: Container( body: Container(
@ -105,7 +108,7 @@ class _LacumTransferPageState extends State<LacumTransferPage> {
CrossAxisAlignment.end, CrossAxisAlignment.end,
children: [ children: [
Texts( Texts(
"0", "${model.lacumGroupInformation.lakumInquiryInformationObjVersion.pointsBalance}",
fontSize: 14, fontSize: 14,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
color: Colors.white, color: Colors.white,
@ -165,7 +168,7 @@ class _LacumTransferPageState extends State<LacumTransferPage> {
CrossAxisAlignment.end, CrossAxisAlignment.end,
children: [ children: [
Texts( Texts(
"0", "${model.lacumGroupInformation.lakumInquiryInformationObjVersion.pointsBalanceAmount}",
fontSize: 14, fontSize: 14,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
color: Colors.white, color: Colors.white,

@ -44,6 +44,8 @@ class LakumMainPage extends StatelessWidget {
isPharmacy: true, isPharmacy: true,
showPharmacyCart: false, showPharmacyCart: false,
isShowDecPage: false, isShowDecPage: false,
showHomeAppBarIcon: false,
isBottomBar: true,
backgroundColor: Colors.white, backgroundColor: Colors.white,
baseViewModel: model, baseViewModel: model,
appBarIcons: _buildAppBarICons(context, model), appBarIcons: _buildAppBarICons(context, model),
@ -354,12 +356,12 @@ class LakumHomeButtons extends StatelessWidget {
children: [ children: [
Expanded( Expanded(
child: InkWell( child: InkWell(
onTap: () { // onTap: () {
print("Account activate click"); // print("Account activate click");
Navigator.push( // Navigator.push(
context, FadePage(page: LakumActivationVidaPage())) // context, FadePage(page: LakumActivationVidaPage()))
.then((result) => {model.getLacumGroupData()}); // .then((result) => {model.getLacumGroupData()});
}, // },
child: Container( child: Container(
padding: EdgeInsets.symmetric(horizontal: 8), padding: EdgeInsets.symmetric(horizontal: 8),
decoration: BoxDecoration( decoration: BoxDecoration(

@ -66,7 +66,7 @@ class _LakumPointsYearPageState extends State<LakumPointsYearPage> {
(index) => LakumPointTableRowWidget( (index) => LakumPointTableRowWidget(
false, false,
widget.pointsAmountPerYear[widget.selectedIndexYear] widget.pointsAmountPerYear[widget.selectedIndexYear]
.pointsAmountPerMonth[index].month, .pointsAmountPerMonth[index].month.toString(),
widget.pointsAmountPerYear[widget.selectedIndexYear] widget.pointsAmountPerYear[widget.selectedIndexYear]
.pointsAmountPerMonth[index].pointsPerMonth, .pointsAmountPerMonth[index].pointsPerMonth,
widget.pointsAmountPerYear[widget.selectedIndexYear] widget.pointsAmountPerYear[widget.selectedIndexYear]

@ -48,7 +48,7 @@ class _PharmacyPageState extends State<PharmacyPage> {
isMainPharmacyPages: true, isMainPharmacyPages: true,
isPharmacy: true, isPharmacy: true,
isShowPharmacyAppbar: true, isShowPharmacyAppbar: true,
backgroundColor: Colors.white, backgroundColor: Color(0xffFEFEFE),
body: Container( body: Container(
width: double.infinity, width: double.infinity,
child: SingleChildScrollView( child: SingleChildScrollView(

@ -1,13 +1,16 @@
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/product_detail_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/product_detail_view_model.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:maps_launcher/maps_launcher.dart'; import 'package:flutter_inappwebview/flutter_inappwebview.dart';
import 'package:map_launcher/map_launcher.dart';
import 'package:url_launcher/url_launcher.dart'; import 'package:url_launcher/url_launcher.dart';
class AvailabilityInfo extends StatelessWidget { class AvailabilityInfo extends StatelessWidget {
final ProductDetailViewModel previousModel; final ProductDetailViewModel previousModel;
const AvailabilityInfo({Key key, this.previousModel}) : super(key: key); final InAppBrowser browser = new InAppBrowser();
AvailabilityInfo({Key key, this.previousModel}) : super(key: key);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -53,8 +56,12 @@ class AvailabilityInfo extends StatelessWidget {
child: IconButton( child: IconButton(
icon: Icon(Icons.location_on), icon: Icon(Icons.location_on),
color: Colors.red, color: Colors.red,
onPressed: () { onPressed: () async {
MapsLauncher.launchCoordinates(double.parse(previousModel.productLocationService[index].latitude), double.parse(previousModel.productLocationService[index].longitude), previousModel.productLocationService[index].locationDescription); await MapLauncher.showMarker(
mapType: MapType.google,
coords: Coords(double.parse(previousModel.productLocationService[index].latitude), double.parse(previousModel.productLocationService[index].longitude)),
title: previousModel.productLocationService[index].locationDescription,
);
}, },
), ),
), ),

@ -45,10 +45,21 @@ class FooterWidget extends StatefulWidget {
class _FooterWidgetState extends State<FooterWidget> { class _FooterWidgetState extends State<FooterWidget> {
double quantityUI = 80; double quantityUI = 80;
bool showUI = false; bool showUI = false;
static final GlobalKey<FormState> _key = GlobalKey<FormState>();
AuthenticatedUserObject authenticatedUserObject = AuthenticatedUserObject authenticatedUserObject =
locator<AuthenticatedUserObject>(); locator<AuthenticatedUserObject>();
AppSharedPreferences sharedPref = new AppSharedPreferences(); AppSharedPreferences sharedPref = new AppSharedPreferences();
@override
void initState() {
super.initState();
if (!isBuyNowDisable() || !isAddToCartDisable()) {
quantityUI = 160;
showUI = true;
}
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Container( return Container(
@ -57,14 +68,25 @@ class _FooterWidgetState extends State<FooterWidget> {
borderRadius: BorderRadius.all( borderRadius: BorderRadius.all(
Radius.circular(0.0), Radius.circular(0.0),
), ),
border: Border.all(color: Color(0xFF707070), width: 0), boxShadow: [
BoxShadow(
color: Color(0xFFCCCCCC),
spreadRadius: 0,
blurRadius: 4,
offset: Offset(2, 2), // changes position of shadow
),
],
// border: Border.all(color: Color(0xFF707070), width: 0),
), ),
width: double.infinity, width: double.infinity,
height: quantityUI, height: quantityUI,
child: Column( child: Column(
children: [ children: [
showUI !showUI
? Container( ? Container(
height: 10,
)
: Container(
width: double.infinity, width: double.infinity,
height: 100, height: 100,
color: Colors.white, color: Colors.white,
@ -84,8 +106,7 @@ class _FooterWidgetState extends State<FooterWidget> {
TranslationBase.of(context).productQuantity, TranslationBase.of(context).productQuantity,
fontSize: 15, fontSize: 15,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
color: Color(0xFF575757) color: Color(0xFF575757)),
),
), ),
InkWell( InkWell(
child: Icon(Icons.close, color: Colors.black), child: Icon(Icons.close, color: Colors.black),
@ -119,8 +140,11 @@ class _FooterWidgetState extends State<FooterWidget> {
color: Colors.white, color: Colors.white,
), ),
child: TextField( child: TextField(
decoration: InputDecoration( key: _key,
labelText: ' Quantity # '), keyboardType: TextInputType.number,
textAlign: TextAlign.center,
decoration:
InputDecoration(hintText: ' Quantity # '),
onChanged: (text) { onChanged: (text) {
if (int.tryParse(text) == null) { if (int.tryParse(text) == null) {
text = ''; text = '';
@ -144,9 +168,6 @@ class _FooterWidgetState extends State<FooterWidget> {
], ],
), ),
), ),
)
: Container(
height: 10,
), ),
Container( Container(
height: 58, height: 58,
@ -219,12 +240,11 @@ class _FooterWidgetState extends State<FooterWidget> {
), ),
Container( Container(
width: MediaQuery.of(context).size.width * 0.35, width: MediaQuery.of(context).size.width * 0.35,
margin: EdgeInsets.symmetric(vertical: 4.0),
child: SecondaryButton( child: SecondaryButton(
label: TranslationBase.of(context).addToCart, label: TranslationBase.of(context).addToCart,
disabled: (!widget.isAvailable && widget.quantity > 0) || disabled: isAddToCartDisable(),
widget.quantity > widget.quantityLimit || fontSize: 15,
widget.item.isRx,
fontSize: 16,
onTap: () async { onTap: () async {
if (!authenticatedUserObject.isLogin) { if (!authenticatedUserObject.isLogin) {
login(); login();
@ -235,8 +255,10 @@ class _FooterWidgetState extends State<FooterWidget> {
model: widget.model); model: widget.model);
}, },
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
borderColor: Color(0xFF4CAF50).withOpacity(0.7),
borderRadius: 6, borderRadius: 6,
disableColor: Color(0xFFD6D6D6),
textColor:
isAddToCartDisable() ? Color(0xFFACACAC) : Colors.white,
color: Color(0xFF535353), color: Color(0xFF535353),
), ),
), ),
@ -245,12 +267,11 @@ class _FooterWidgetState extends State<FooterWidget> {
), ),
Container( Container(
width: MediaQuery.of(context).size.width * 0.35, width: MediaQuery.of(context).size.width * 0.35,
margin: EdgeInsets.symmetric(vertical: 4.0),
child: SecondaryButton( child: SecondaryButton(
label: TranslationBase.of(context).buyNow, label: TranslationBase.of(context).buyNow,
fontSize: 16, fontSize: 15,
disabled: (!widget.isAvailable && widget.quantity > 0) || disabled: isBuyNowDisable(),
(widget.quantity > widget.quantityLimit) ||
widget.item.isRx,
onTap: () async { onTap: () async {
if (!authenticatedUserObject.isLogin) { if (!authenticatedUserObject.isLogin) {
login(); login();
@ -261,15 +282,12 @@ class _FooterWidgetState extends State<FooterWidget> {
model: widget.model); model: widget.model);
} }
}, },
textColor:
isBuyNowDisable() ? Color(0xFFACACAC) : Colors.white,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
borderColor: Colors.grey[800].withOpacity(0.7),
borderRadius: 6, borderRadius: 6,
disableColor: Colors.grey[700], disableColor: Color(0xFFD6D6D6),
color: !widget.isAvailable && widget.quantity > 0 || color: Color(0xFF5AB145),
widget.quantity > widget.quantityLimit ||
widget.item.isRx
? Color(0xFF535353).withOpacity(0.7)
: Color(0xFF5AB145),
), ),
), ),
], ],
@ -280,6 +298,18 @@ class _FooterWidgetState extends State<FooterWidget> {
); );
} }
bool isBuyNowDisable() {
return (!widget.isAvailable && widget.quantity > 0) ||
(widget.quantity > widget.quantityLimit) ||
widget.item.isRx;
}
bool isAddToCartDisable() {
return (!widget.isAvailable && widget.quantity > 0) ||
widget.quantity > widget.quantityLimit ||
widget.item.isRx;
}
void setUserValues(value) async { void setUserValues(value) async {
if (value != null) sharedPref.setObject(IMEI_USER_DATA, value); if (value != null) sharedPref.setObject(IMEI_USER_DATA, value);
} }

@ -11,7 +11,6 @@ import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:diplomaticquarterapp/uitl/utils.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/text/app_texts_widget.dart'; import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -133,24 +132,29 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
), ),
), ),
), ),
if(model.isStockAvailable!= null && !model.isStockAvailable) if (model.isStockAvailable != null && !model.isStockAvailable)
Container( Container(
height: MediaQuery.of(context).size.height * .40, height: MediaQuery.of(context).size.height * .40,
color: Colors.white.withOpacity(0.6), color: Colors.white.withOpacity(0.6),
// child: AppText("Out of Stock"), // child: AppText("Out of Stock"),
), ),
if(model.isStockAvailable!= null && !model.isStockAvailable) if (model.isStockAvailable != null && !model.isStockAvailable)
Positioned( Positioned(
// bottom: 10, // bottom: 10,
top: MediaQuery.of(context).size.height *.088, top: MediaQuery.of(context).size.height * .088,
left: MediaQuery.of(context).size.width *.32, left: MediaQuery.of(context).size.width * .32,
child: Center( child: Center(
child: Container( child: Container(
height: MediaQuery.of(context).size.height * .40, height: MediaQuery.of(context).size.height * .40,
// color: Colors.white.withOpacity(0.75), // color: Colors.white.withOpacity(0.75),
child: RotationTransition( child: RotationTransition(
turns: new AlwaysStoppedAnimation(310 / 360), turns: new AlwaysStoppedAnimation(310 / 360),
child: AppText(TranslationBase.of(context).productOutOfStock ,color:Color(0xFF000000).withOpacity(0.19),fontSize: projectViewModel.isArabic?40: 50, fontWeight: FontWeight.bold ,)), child: AppText(
TranslationBase.of(context).productOutOfStock,
color: Color(0xFF000000).withOpacity(0.19),
fontSize: projectViewModel.isArabic ? 40 : 50,
fontWeight: FontWeight.bold,
)),
), ),
), ),
), ),
@ -233,7 +237,7 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
}, },
child: Text( child: Text(
TranslationBase.of(context).details, TranslationBase.of(context).details,
style: TextStyle( fontWeight: FontWeight.w600, fontSize: 14, letterSpacing:-0.84), style: TextStyle(fontWeight: FontWeight.w600, fontSize: 14, letterSpacing: -0.84),
), ),
color: Colors.white, color: Colors.white,
), ),
@ -264,7 +268,7 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
}, },
child: Text( child: Text(
TranslationBase.of(context).reviews, TranslationBase.of(context).reviews,
style: TextStyle( fontWeight: FontWeight.w600, fontSize: 14, letterSpacing:-0.84), style: TextStyle(fontWeight: FontWeight.w600, fontSize: 14, letterSpacing: -0.84),
), ),
color: Colors.white, color: Colors.white,
), ),
@ -279,7 +283,7 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
Column( Column(
children: [ children: [
FlatButton( FlatButton(
onPressed: model.isStockAvailable !=null && model.isStockAvailable onPressed: model.isStockAvailable != null && model.isStockAvailable
? () async { ? () async {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
await model.getProductLocationData(widget.product.sku); await model.getProductLocationData(widget.product.sku);
@ -294,7 +298,7 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
: null, : null,
child: Text( child: Text(
TranslationBase.of(context).availability, TranslationBase.of(context).availability,
style: TextStyle( fontWeight: FontWeight.w600, fontSize: 14, letterSpacing:-0.84), style: TextStyle(fontWeight: FontWeight.w600, fontSize: 14, letterSpacing: -0.84),
), ),
color: Colors.white, color: Colors.white,
), ),

@ -126,7 +126,10 @@ class _ProductNameAndPriceState extends State<ProductNameAndPrice> {
widget.stockAvailability != null && widget.stockAvailability != null &&
!widget.isStockAvailable && !widget.isStockAvailable &&
widget.customerId != null widget.customerId != null
? IconButton( ? Container(
child: Row(
children: [
IconButton(
iconSize: 25, iconSize: 25,
icon: Icon(Icons.notifications_active), icon: Icon(Icons.notifications_active),
color: new Color(0xff2E303A), color: new Color(0xff2E303A),
@ -134,6 +137,33 @@ class _ProductNameAndPriceState extends State<ProductNameAndPrice> {
widget.notifyMeWhenAvailable( widget.notifyMeWhenAvailable(
context, widget.item.id); context, widget.item.id);
}, },
),
IconButton(
icon: Icon(!widget.isInWishList
? Icons.favorite_border
: Icons.favorite),
color: !widget.isInWishList
? Color(0xff2E303A)
: Color(0xffD02127),
onPressed: () async {
{
if (widget.customerId != null) {
if (!widget.isInWishList) {
await widget
.addToWishlistFunction(widget.item.id);
} else {
await widget.deleteFromWishlistFunction(
widget.item.id);
}
} else {
return;
}
setState(() {});
}
},
)
],
),
) )
: IconButton( : IconButton(
icon: Icon(!widget.isInWishList icon: Icon(!widget.isInWishList

@ -1,7 +1,9 @@
import 'package:diplomaticquarterapp/core/model/pharmacies/PharmacyProduct.dart'; import 'package:diplomaticquarterapp/core/model/pharmacies/PharmacyProduct.dart';
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/product_detail_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/product_detail_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:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'package:rating_bar/rating_bar.dart'; import 'package:rating_bar/rating_bar.dart';
class ReviewsInfo extends StatelessWidget { class ReviewsInfo extends StatelessWidget {
@ -13,6 +15,7 @@ class ReviewsInfo extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
return previousModel.productDetailService.length != 0 && return previousModel.productDetailService.length != 0 &&
previousModel.productDetailService[0].reviews.length != 0 previousModel.productDetailService[0].reviews.length != 0
? ListView.builder( ? ListView.builder(
@ -48,7 +51,24 @@ class ReviewsInfo extends StatelessWidget {
), ),
), ),
Container( Container(
margin: EdgeInsets.only(left: 210), // margin: EdgeInsets.only(left: 210),
child: projectViewModel.isArabic?
Align(
alignment: Alignment.topLeft,
child: RatingBar.readOnly(
initialRating: previousModel
.productDetailService[0].reviews[index].rating
.toDouble(),
size: 15.0,
filledColor: Colors.yellow[700],
emptyColor: Colors.grey[500],
isHalfAllowed: true,
halfFilledIcon: Icons.star_half,
filledIcon: Icons.star,
emptyIcon: Icons.star,
),
): Align(
alignment: Alignment.topRight,
child: RatingBar.readOnly( child: RatingBar.readOnly(
initialRating: previousModel initialRating: previousModel
.productDetailService[0].reviews[index].rating .productDetailService[0].reviews[index].rating
@ -62,19 +82,23 @@ class ReviewsInfo extends StatelessWidget {
emptyIcon: Icons.star, emptyIcon: Icons.star,
), ),
), ),
),
], ],
), ),
), ),
SizedBox( SizedBox(
height: 10, height: 10,
), ),
Container( Padding(
padding: const EdgeInsets.all(8.0),
child: Container(
child: Text( child: Text(
previousModel previousModel
.productDetailService[0].reviews[index].reviewText, .productDetailService[0].reviews[index].reviewText,
style: TextStyle(fontSize: 20), style: TextStyle(fontSize: 20),
), ),
), ),
),
SizedBox( SizedBox(
height: 50, height: 50,
), ),

@ -54,26 +54,12 @@ class _SearchBrandsPageState extends State<SearchBrandsPage> {
fontSize: 19.0, fontSize: 19.0,
prefixIcon: Icon(Icons.search), prefixIcon: Icon(Icons.search),
inputAction: TextInputAction.search, inputAction: TextInputAction.search,
inputFormatters: <TextInputFormatter>[
FilteringTextInputFormatter.allow(RegExp(r'([A-Za-z0-9 a space])')
// ("[\u0621-\u064a-\ ]")
)
],
validator: (value) {
RegExp regExp = RegExp(r'([A-Za-z0-9 a space])');
if (value.isEmpty) {
TranslationBase.of(context).pleaseEnterProductName;
}else if (!regExp.hasMatch(value)){
AppToast.showErrorToast(message: TranslationBase.of(context).noArabicLetters);
}
return null;
},
onSaved: (value) { onSaved: (value) {
//searchMedicine(model, context); //searchMedicine(model, context);
}, },
onSubmit: (value) { onSubmit: (value) {
searchMedicine(model, context); searchMedicine(model, context);
msg = TranslationBase.of(context).noResultFound; msg = TranslationBase.of(context).noSearchResultFound;
}, },
controller: textController, controller: textController,
// validator: (value) { // validator: (value) {

@ -79,12 +79,22 @@ class ProductTileItem extends StatelessWidget {
ProjectViewModel projectProvider = Provider.of(context); ProjectViewModel projectProvider = Provider.of(context);
return InkWell( return InkWell(
onTap: () => productOnClick(context), onTap: () => productOnClick(context),
splashColor: Theme.of(context).primaryColor,
child: Container( child: Container(
margin: EdgeInsets.all(7), margin: EdgeInsets.all(7),
decoration: BoxDecoration( decoration: BoxDecoration(
border: Border.all(color: Colors.grey.shade300, width: 0.5), border: Border.all(color: Colors.grey.shade300, width: 0.2),
borderRadius: BorderRadius.circular(8)), borderRadius: BorderRadius.circular(10),
color: Colors.white,
shape: BoxShape.rectangle,
boxShadow: [
BoxShadow(
color: Color(0xffF1F1F1),
spreadRadius: 4,
blurRadius: 5.5,
offset: Offset(0, 3), // changes position of shadow
),
],
),
padding: EdgeInsets.symmetric(horizontal: 4), padding: EdgeInsets.symmetric(horizontal: 4),
width: MediaQuery.of(context).size.width / 2.8, width: MediaQuery.of(context).size.width / 2.8,
child: Column( child: Column(
@ -114,46 +124,61 @@ class ProductTileItem extends StatelessWidget {
width: double.infinity, width: double.infinity,
height: MediaQuery.of(context).size.width * 0.3, height: MediaQuery.of(context).size.width * 0.3,
padding: padding:
EdgeInsets.only(left: 20, right: 20, top: 14, bottom: 14), EdgeInsets.only(left: 10, right: 10, top: 7, bottom: 3.5),
color: Colors.white, color: Colors.white,
child: InkWell(
onTap: () {},
child: Container( child: Container(
width: double.infinity, width: double.infinity,
height: double.infinity, height: double.infinity,
clipBehavior: Clip.antiAlias, clipBehavior: Clip.antiAlias,
decoration: containerRadiusWithGradientServices(33, decoration: containerRadiusWithGradientServices(0.0,
prescriptionRequired: item.rxMessage != null,
isProduct: true,
isEnglish: !projectProvider.isArabic,
lightColor: Colors.transparent, lightColor: Colors.transparent,
darkColor: Colors.transparent), darkColor: Colors.transparent),
child: Stack( child: Stack(
children: [ children: [
Container( Stack(
width: double.infinity,
height: double.infinity,
//clipBehavior: Clip.antiAlias,
// decoration: projectProvider.isArabic
// ? containerBottomRightRadiusWithGradientForAr(0, lightColor: Colors.transparent, darkColor: Colors.transparent)
// : containerBottomRightRadiusWithGradient(0, lightColor: Colors.red, darkColor: CustomColors.green),
child: Stack(
children: [ children: [
Container( Container(
decoration: BoxDecoration(
border: Border.all(
color: Color(0xffF0F0F0), width: 1.0),
borderRadius: BorderRadius.only(
topRight: Radius.circular(
item.rxMessage != null &&
projectProvider.isArabic
? 20
: 8),
bottomLeft: Radius.circular(8),
bottomRight: Radius.circular(8),
topLeft: Radius.circular(item.rxMessage != null &&
!projectProvider.isArabic
? 20
: 8),
),
),
margin: EdgeInsets.fromLTRB(0, 0, 0, 0), margin: EdgeInsets.fromLTRB(0, 0, 0, 0),
alignment: Alignment.center, alignment: Alignment.center,
child: (item.images != null && child: (item.images != null && item.images.length > 0)
item.images.length > 0) ? Padding(
? Image.network( padding: EdgeInsets.all(12.0),
child: Image.network(
item.images[0].src, item.images[0].src,
fit: BoxFit.cover, fit: BoxFit.cover,
height: itemHeight / 2, height: itemHeight / 2,
),
) )
: Image.asset( : Padding(
padding: EdgeInsets.all(8.0),
child: Image.asset(
"assets/images/no_image.png", "assets/images/no_image.png",
fit: BoxFit.cover, fit: BoxFit.cover,
height: itemHeight / 2, height: itemHeight / 2,
), ),
), ),
],
), ),
],
), ),
if (item.rxMessage != null) if (item.rxMessage != null)
projectProvider.isArabic projectProvider.isArabic
@ -163,18 +188,18 @@ class ProductTileItem extends StatelessWidget {
child: Transform.rotate( child: Transform.rotate(
angle: math.pi / 4, angle: math.pi / 4,
child: Container( child: Container(
color: CustomColors.accentColor,
padding: EdgeInsets.only( padding: EdgeInsets.only(
left: 18, right: 18, top: 6, bottom: 3), left: 18, right: 18, top: 6, bottom: 3),
color: CustomColors.accentColor,
child: Padding( child: Padding(
padding: EdgeInsets.all(2.0), padding: EdgeInsets.all(2.0),
child: Text( child: Text(
"الوصفة\n مطلوبة", "الوصفة\n مطلوبة",
style: TextStyle( style: TextStyle(
color: Colors.white, color: Colors.white,
fontSize: 7.5, fontSize: 7.0,
height: 0.8, height: 0.8,
fontWeight: FontWeight.bold, fontWeight: FontWeight.w600,
letterSpacing: -0.27, letterSpacing: -0.27,
), ),
), ),
@ -195,7 +220,7 @@ class ProductTileItem extends StatelessWidget {
"\n E-Prescription \n Is required", "\n E-Prescription \n Is required",
style: TextStyle( style: TextStyle(
color: Colors.white, color: Colors.white,
fontSize: 7.5, fontSize: 7.0,
//letterSpacing: -0.27, //letterSpacing: -0.27,
height: 1.2, height: 1.2,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
@ -208,40 +233,21 @@ class ProductTileItem extends StatelessWidget {
), ),
), ),
), ),
),
// Padding(
// padding: EdgeInsets.fromLTRB(1, 1, 1, 1),
// child: Container(
// width: item.rxMessage != null
// ? MediaQuery.of(context).size.width / 1.0
// : 0,
// padding: EdgeInsets.fromLTRB(8, 2, 8, 2),
// decoration: BoxDecoration(
// color: Color(0xffb23838),
// ),
// child: item.rxMessage != null
// ? Texts(
// projectProvider.isArabic
// ? item.rxMessagen
// : item.rxMessage,
// color: Colors.white,
// regular: true,
// fontSize: 10,
// fontWeight: FontWeight.w400,
// )
// : Texts(""),
// ),
// ),
// SizedBox(height: 4,),
Padding( Padding(
padding: const EdgeInsets.symmetric(horizontal: 4.0), padding: const EdgeInsets.symmetric(horizontal: 10.0),
child: Container(
height: MediaQuery.of(context).size.height * 0.075,
child: Texts( child: Texts(
projectProvider.isArabic ? item.namen : item.name, projectProvider.isArabic ? item.namen : item.name,
regular: true, //regular: true,
fontSize: 12, fontSize: 10,
fontWeight: FontWeight.w400, color: Color(0xff2B353E),
fontWeight: FontWeight.w600,
),
),
), ),
SizedBox(
height: 7.0,
), ),
Expanded( Expanded(
child: Container( child: Container(
@ -251,28 +257,32 @@ class ProductTileItem extends StatelessWidget {
), ),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.end, //mainAxisAlignment: MainAxisAlignment.end,
children: [ children: [
Padding( Padding(
padding: const EdgeInsets.only(top: 2, bottom: 2), padding: const EdgeInsets.symmetric(
horizontal: 10, vertical: 2),
child: Texts( child: Texts(
"SAR ${item.price}", "SAR ${item.price}",
fontWeight: FontWeight.w600, fontWeight: FontWeight.w700,
fontSize: 14, fontSize: 11,
color: Color(0xff2B353E),
), ),
), ),
Row( Padding(
padding: EdgeInsets.symmetric(horizontal: 5),
child: Row(
children: [ children: [
// Expanded( // Expanded(
RatingBar.readOnly( RatingBar.readOnly(
initialRating: item.approvedRatingSum.toDouble(), initialRating: item.approvedRatingSum.toDouble(),
size: 15.0, size: 13.0,
filledColor: Color(0xffD02127), filledColor: Color(0XFFD02127),
emptyColor: Colors.grey[500], emptyColor: Color(0XFFD02127),
isHalfAllowed: true, isHalfAllowed: true,
halfFilledIcon: Icons.star_half, halfFilledIcon: Icons.star_half,
filledIcon: Icons.star, filledIcon: Icons.star,
emptyIcon: Icons.star, emptyIcon: Icons.star_border,
), ),
Texts( Texts(
"(${item.approvedTotalReviews})", "(${item.approvedTotalReviews})",
@ -282,11 +292,12 @@ class ProductTileItem extends StatelessWidget {
), ),
SizedBox( SizedBox(
width: 20.0, width: 9.0,
), ),
Icon( Icon(
Icons.arrow_forward, Icons.arrow_forward,
size: 18, size: 15,
color: Color(0xff2D2F39),
), ),
// StarRating( // StarRating(
@ -299,12 +310,13 @@ class ProductTileItem extends StatelessWidget {
// ), // ),
], ],
), ),
),
], ],
), ),
), ),
), ),
SizedBox( SizedBox(
height: 5, height: 1,
), ),
], ],
), ),

@ -4,6 +4,9 @@ import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/pharmacy_mod
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/pages/landing/home_page.dart'; import 'package:diplomaticquarterapp/pages/landing/home_page.dart';
import 'package:diplomaticquarterapp/pages/offers_categorise_page.dart'; import 'package:diplomaticquarterapp/pages/offers_categorise_page.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/screens/lacum-activitaion-vida-page.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/screens/lacum-registration-page.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/screens/lakum-main-page.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/widgets/home/GridViewCard.dart'; import 'package:diplomaticquarterapp/pages/pharmacies/widgets/home/GridViewCard.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart';
@ -50,7 +53,7 @@ class _BannerPagerState extends State<BannerPager> {
(item, index) { (item, index) {
return InkWell( return InkWell(
onTap: () { onTap: () {
Navigator.push(context, FadePage(page: OffersCategorisePage())); bannerNavigator(index);
}, },
child: Container( child: Container(
margin: EdgeInsets.symmetric(horizontal: 1.0), margin: EdgeInsets.symmetric(horizontal: 1.0),
@ -93,4 +96,28 @@ class _BannerPagerState extends State<BannerPager> {
], ],
)); ));
} }
bannerNavigator(index){
switch(index) {
case 1: {
Navigator.push(context, FadePage(page: OffersCategorisePage()));
}
break;
case 2: {
// Navigator.push(context, FadePage(page: LakumActivationVidaPage()));
Navigator.push(context, FadePage(page: LakumMainPage()));
}
break;
case 5: {
Navigator.push(context, FadePage(page: OffersCategorisePage()));
}
break;
default: {
}
break;
}
}
} }

@ -29,7 +29,7 @@ class BestSellerWidget extends StatelessWidget {
)), )),
if (model.state != ViewState.BusyLocal) if (model.state != ViewState.BusyLocal)
Container( Container(
height: MediaQuery.of(context).size.height / 3 + 20, height: MediaQuery.of(context).size.height / 3 + 1,
child: ListView.builder( child: ListView.builder(
itemBuilder: (ctx, i) => ProductTileItem( itemBuilder: (ctx, i) => ProductTileItem(
model.bestSellerProduct[i], model.bestSellerProduct[i],

@ -31,7 +31,7 @@ class MostViewedWidget extends StatelessWidget {
)), )),
if (model.state != ViewState.BusyLocal) if (model.state != ViewState.BusyLocal)
Container( Container(
height: MediaQuery.of(context).size.height / 3 + 20, height: MediaQuery.of(context).size.height / 3 + 1,
child: ListView.builder( child: ListView.builder(
itemBuilder: (ctx, i) => ProductTileItem( itemBuilder: (ctx, i) => ProductTileItem(
model.mostViewedProducts[i], model.mostViewedProducts[i],

@ -31,7 +31,7 @@ class RecentlyViewedWidget extends StatelessWidget {
if (model.state != ViewState.BusyLocal) if (model.state != ViewState.BusyLocal)
Container( Container(
height: model.lastVisitedProducts.length > 0 height: model.lastVisitedProducts.length > 0
? MediaQuery.of(context).size.height / 3 + 20 ? MediaQuery.of(context).size.height / 3 + 1
: 0, : 0,
child: ListView.builder( child: ListView.builder(
itemBuilder: (ctx, i) => ProductTileItem( itemBuilder: (ctx, i) => ProductTileItem(

@ -18,8 +18,9 @@ class ViewAllHomeWidget extends StatelessWidget {
children: [ children: [
Texts( Texts(
title, title,
bold: true, color: Color(0xff2E303A),
fontSize: 16, fontWeight: FontWeight.w700,
fontSize: 19,
), ),
InkWell( InkWell(
onTap: () { onTap: () {

@ -74,7 +74,7 @@ class _OrderDetailsPageState extends State<OrderDetailsPage> {
this.context = context; this.context = context;
return BaseView<OrderModelViewModel>( return BaseView<OrderModelViewModel>(
onModelReady: (model) { onModelReady: (model) {
model.getOrderDetails(widget.orderModel.id).then((value) { model.getOrderDetails(widget.orderModel.id, widget.orderModel.orderGuid).then((value) {
setState(() { setState(() {
isActiveDelivery = (value.orderStatusId == 995 && (value.driverID != null && value.driverID.isNotEmpty)); isActiveDelivery = (value.orderStatusId == 995 && (value.driverID != null && value.driverID.isNotEmpty));
}); });
@ -533,10 +533,6 @@ class _OrderDetailsPageState extends State<OrderDetailsPage> {
model.orderListModel[0].orderStatusId == 10 model.orderListModel[0].orderStatusId == 10
? InkWell( ? InkWell(
onTap: () { onTap: () {
print(widget.orderModel.toString());
print(model.orderListModel.toString());
print("calc = ${5.9 * 3}");
// TODO MOSA
openPayment(model.orderListModel[0], model.user); openPayment(model.orderListModel[0], model.user);
}, },
child: Container( child: Container(
@ -672,11 +668,6 @@ class _OrderDetailsPageState extends State<OrderDetailsPage> {
} }
} }
/***
*
* Online payment methods
*/
openPayment( openPayment(
OrderDetailModel order, OrderDetailModel order,
AuthenticatedUser authenticatedUser, AuthenticatedUser authenticatedUser,
@ -715,7 +706,7 @@ class _OrderDetailsPageState extends State<OrderDetailsPage> {
Navigator.pop(context); Navigator.pop(context);
Navigator.pop(context); Navigator.pop(context);
} else { } else {
AppToast.showErrorToast(message: "Transaction Failed!\Your transaction is field to some reason please try again or contact to the administration"); AppToast.showErrorToast(message: "Transaction Failed!\Your transaction is field to some reason please try again or contact to the administration\فشلت العملية حاول مره اخرى");
} }
} }
} }

@ -34,6 +34,8 @@ class _ProductReviewPageState extends State<ProductReviewPage> {
appBarTitle: TranslationBase.of(context).writeReview, appBarTitle: TranslationBase.of(context).writeReview,
isShowAppBar: true, isShowAppBar: true,
isPharmacy: true, isPharmacy: true,
showPharmacyCart: false,
showHomeAppBarIcon: false,
body: Container( body: Container(
color: Colors.white, color: Colors.white,
child: !finishReview ? SingleChildScrollView( child: !finishReview ? SingleChildScrollView(

@ -2,6 +2,7 @@ import 'package:diplomaticquarterapp/core/model/pharmacies/Addresses.dart';
import 'package:diplomaticquarterapp/core/service/AlHabibMedicalService/customer_addresses_service.dart'; import 'package:diplomaticquarterapp/core/service/AlHabibMedicalService/customer_addresses_service.dart';
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/OrderPreviewViewModel.dart'; import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/OrderPreviewViewModel.dart';
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/PharmacyAddressesViewModel.dart'; import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/PharmacyAddressesViewModel.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/screens/payment-method-select-page.dart'; import 'package:diplomaticquarterapp/pages/pharmacies/screens/payment-method-select-page.dart';
import 'package:diplomaticquarterapp/pages/pharmacy/pharmacyAddresses/AddAddress.dart'; import 'package:diplomaticquarterapp/pages/pharmacy/pharmacyAddresses/AddAddress.dart';
@ -15,6 +16,7 @@ import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
///TODO Elham* split this to tow files ///TODO Elham* split this to tow files
class PharmacyAddressesPage extends StatefulWidget { class PharmacyAddressesPage extends StatefulWidget {
@ -35,15 +37,16 @@ class _PharmacyAddressesState extends State<PharmacyAddressesPage> {
ctx, ctx,
FadePage( FadePage(
page: AddAddressPage(address, (pickResult) async { page: AddAddressPage(address, (pickResult) async {
model.addEditAddress(pickResult, address); await model.addEditAddress(pickResult, address);
await model.getAddressesList(); }))).then((value) async {
// await model.getAddressesList();
}))); });
} }
Widget build(BuildContext context) { Widget build(BuildContext context) {
final mediaQuery = MediaQuery.of(context); final mediaQuery = MediaQuery.of(context);
final height = mediaQuery.size.height - 60 - mediaQuery.padding.top; final height = mediaQuery.size.height - 60 - mediaQuery.padding.top;
ProjectViewModel projectProvider = Provider.of(context);
return BaseView<PharmacyAddressesViewModel>( return BaseView<PharmacyAddressesViewModel>(
onModelReady: (model) => model.getAddressesList(), onModelReady: (model) => model.getAddressesList(),
@ -127,7 +130,7 @@ class _PharmacyAddressesState extends State<PharmacyAddressesPage> {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
await widget.orderPreviewViewModel.getInformationsByAddress(widget.orderPreviewViewModel.user.patientIdentificationNo); await widget.orderPreviewViewModel.getInformationsByAddress(projectProvider.user.patientIdentificationNo);
if (widget.orderPreviewViewModel.error == "") { if (widget.orderPreviewViewModel.error == "") {
await widget.orderPreviewViewModel.getShoppingCart(); await widget.orderPreviewViewModel.getShoppingCart();
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
@ -175,7 +178,7 @@ class _PharmacyAddressesState extends State<PharmacyAddressesPage> {
} }
} }
class AddressItemWidget extends StatelessWidget { class AddressItemWidget extends StatefulWidget {
final PharmacyAddressesViewModel model; final PharmacyAddressesViewModel model;
final AddressInfo address; final AddressInfo address;
final Function selectAddress; final Function selectAddress;
@ -184,6 +187,11 @@ class AddressItemWidget extends StatelessWidget {
AddressItemWidget(this.model, this.address, this.selectAddress, this.isSelected, this.onTabEditAddress); AddressItemWidget(this.model, this.address, this.selectAddress, this.isSelected, this.onTabEditAddress);
@override
_AddressItemWidgetState createState() => _AddressItemWidgetState();
}
class _AddressItemWidgetState extends State<AddressItemWidget> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Container( return Container(
@ -199,14 +207,14 @@ class AddressItemWidget extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
InkWell( InkWell(
onTap: selectAddress, onTap: widget.selectAddress,
child: Container( child: Container(
margin: EdgeInsets.only(left: 16, right: 16), margin: EdgeInsets.only(left: 16, right: 16),
child: Padding( child: Padding(
padding: const EdgeInsets.all(5.0), padding: const EdgeInsets.all(5.0),
child: Container( child: Container(
decoration: new BoxDecoration( decoration: new BoxDecoration(
color: !isSelected ? Colors.white : Colors.green, color: !widget.isSelected ? Colors.white : Colors.green,
shape: BoxShape.circle, shape: BoxShape.circle,
border: Border.all(color: Colors.grey, style: BorderStyle.solid, width: 1.0), border: Border.all(color: Colors.grey, style: BorderStyle.solid, width: 1.0),
), ),
@ -214,7 +222,7 @@ class AddressItemWidget extends StatelessWidget {
padding: const EdgeInsets.all(0.0), padding: const EdgeInsets.all(0.0),
child: Icon( child: Icon(
Icons.check, Icons.check,
color: isSelected ? Colors.white : Colors.transparent, color: widget.isSelected ? Colors.white : Colors.transparent,
size: 25, size: 25,
), ),
), ),
@ -234,7 +242,7 @@ class AddressItemWidget extends StatelessWidget {
Padding( Padding(
padding: const EdgeInsets.symmetric(vertical: 0), padding: const EdgeInsets.symmetric(vertical: 0),
child: Texts( child: Texts(
"${address.firstName} ${address.lastName}", "${widget.address.firstName} ${widget.address.lastName}",
fontSize: 14, fontSize: 14,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
color: Colors.black, color: Colors.black,
@ -243,7 +251,7 @@ class AddressItemWidget extends StatelessWidget {
Padding( Padding(
padding: const EdgeInsets.symmetric(vertical: 4), padding: const EdgeInsets.symmetric(vertical: 4),
child: Texts( child: Texts(
"${address.address1} ${address.address2} ${address.address2},, ${address.city}, ${address.country} ${address.zipPostalCode}", "${widget.address.address1} ${widget.address.address2} ${widget.address.address2},, ${widget.address.city}, ${widget.address.country} ${widget.address.zipPostalCode}",
fontSize: 12, fontSize: 12,
fontWeight: FontWeight.normal, fontWeight: FontWeight.normal,
color: Colors.grey.shade500, color: Colors.grey.shade500,
@ -260,7 +268,7 @@ class AddressItemWidget extends StatelessWidget {
), ),
), ),
Texts( Texts(
"${address.phoneNumber}", "${widget.address.phoneNumber}",
fontSize: 14, fontSize: 14,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
color: Colors.grey, color: Colors.grey,
@ -281,7 +289,7 @@ class AddressItemWidget extends StatelessWidget {
borderColor: Colors.transparent, borderColor: Colors.transparent,
textColor: Color(0x990000FF), textColor: Color(0x990000FF),
handler: () { handler: () {
onTabEditAddress(address); widget.onTabEditAddress(widget.address);
}, },
icon: Icon( icon: Icon(
Icons.edit, Icons.edit,
@ -306,19 +314,26 @@ class AddressItemWidget extends StatelessWidget {
textColor: Color(0x99FF0000), textColor: Color(0x99FF0000),
handler: () { handler: () {
ConfirmDialog dialog = new ConfirmDialog( ConfirmDialog dialog = new ConfirmDialog(
context: context, // context: context,
title: "Are you sure want to delete", title: TranslationBase.of(context).deleteAddress,
confirmMessage: "${address.address1} ${address.address2}", //"Are you sure want to delete",
confirmMessage: "${widget.address.address1} ${widget.address.address2}",
okText: TranslationBase.of(context).delete, okText: TranslationBase.of(context).delete,
cancelText: TranslationBase.of(context).cancel_nocaps, cancelText: TranslationBase.of(context).cancel_nocaps,
okFunction: () => { okFunction: () => {
model.deleteAddresses(address).then((_) { widget.model.deleteAddresses(widget.address).then((_) {
ConfirmDialog.closeAlertDialog(context); ConfirmDialog.closeAlertDialog(context);
AppToast.showErrorToast(message: "Address has been deleted"); AppToast.showErrorToast(
message: TranslationBase.of(context).deletedAddress,
// "Address has been deleted"
);
}) })
}, },
cancelFunction: () => {}); cancelFunction: () => {});
dialog.showAlertDialog(context); dialog.showAlertDialog(context);
setState(() {
widget.model.deleteAddresses(widget.address);
});
}, },
icon: Icon( icon: Icon(
Icons.delete, Icons.delete,

@ -0,0 +1,258 @@
import 'dart:io' show Platform;
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:maps_launcher/maps_launcher.dart';
import 'package:url_launcher/url_launcher.dart';
import 'package:map_launcher/map_launcher.dart';
import 'dart:io' show Platform;
class pharmacyContactsPage extends StatefulWidget {
@override
_pharmacyContactsPageState createState() => _pharmacyContactsPageState();
}
class _pharmacyContactsPageState extends State<pharmacyContactsPage> {
@override
Widget build(BuildContext context) {
final latitude = "24.704016";
final longitude = "46.676691";
final phone = "+966112833400";
final whatsApp = "+966558434444";
final whatappURL_android = "whatsapp://send?phone=" + whatsApp;
final whatappURL_ios = "https://wa.me/$whatsApp";
final locationDescription = "Main Pharmacy OLAYA";
return AppScaffold(
appBarTitle: TranslationBase.of(context).contactUs,
isShowAppBar: true,
isShowDecPage: false,
isPharmacy: true,
showPharmacyCart: false,
showHomeAppBarIcon: false,
isMainPharmacyPages: true,
isBottomBar: true,
body: Column(
children: [
Card(
elevation: 2,
shape: RoundedRectangleBorder(
side: BorderSide(color: Colors.grey[300], width: 2),
borderRadius: BorderRadius.circular(10),
),
margin: EdgeInsets.symmetric(
horizontal: 8,
vertical: 8,
),
child: Container(
margin: EdgeInsets.all(10),
padding: EdgeInsets.fromLTRB(5, 15, 5, 15),
decoration: BoxDecoration(
borderRadius: BorderRadius.all(
Radius.circular(15),
),
),
child: Column(
children: [
Padding(
padding: const EdgeInsets.all(8.0),
child: Container(
child: Text(TranslationBase.of(context).contactUsTime,
style: TextStyle(
color: Colors.grey[700],
fontSize: 16,
fontWeight: FontWeight.w600,
letterSpacing: -0.68)),
),
),
SizedBox(
height: 35,
),
Row(
children: <Widget>[
InkWell(
onTap: () {
launch("tel://" + phone);
},
child: SvgPicture.asset(
'assets/images/pharmacy/call.svg',
width: 20,
height: 20,
),
),
SizedBox(
width: 20,
),
Text(TranslationBase.of(context).phone,
style: TextStyle(
color: Colors.grey[700],
fontSize: 16,
fontWeight: FontWeight.w600,
letterSpacing: -0.68)),
SizedBox(
width: 30,
),
Text("+966 " + " -11- 2833400",
style: TextStyle(
color: Colors.grey[700],
fontSize: 16,
fontWeight: FontWeight.w600,
letterSpacing: -0.68)),
],
),
SizedBox(
height: 30,
),
Row(
children: <Widget>[
InkWell(
onTap: () {
// launch('whatsapp://send?phone='+whatsApp);
openWhatsApp();
},
child: SvgPicture.asset(
'assets/images/pharmacy/whatsapp.svg',
width: 20,
height: 20,
),
),
SizedBox(
width: 20,
),
Text(TranslationBase.of(context).whatsApp,
style: TextStyle(
color: Colors.grey[700],
fontSize: 16,
fontWeight: FontWeight.w600,
letterSpacing: -0.68)),
SizedBox(
width: 30,
),
Text("+966 " + " 558434444",
style: TextStyle(
color: Colors.grey[700],
fontSize: 16,
fontWeight: FontWeight.w600,
letterSpacing: -0.68)),
],
),
SizedBox(
height: 30,
),
Padding(
padding: const EdgeInsets.all(5.0),
child: Row(
children: <Widget>[
InkWell(
onTap: () {
if (Platform.isIOS) { MapLauncher.showMarker(
mapType: MapType.apple,
coords: Coords(double.parse(latitude),
double.parse(longitude)),
title: locationDescription,);
} else { MapLauncher.showMarker(
mapType: MapType.google,
coords: Coords(double.parse(latitude),
double.parse(longitude)),
title: locationDescription,
// description: location.locationName,
); }
// MapsLauncher.launchCoordinates(double.parse(previousModel.productLocationService[index].latitude), double.parse(previousModel.productLocationService[index].longitude), previousModel.productLocationService[index].locationDescription);
},
// MapsLauncher.launchCoordinates(
// double.parse(latitude),
// double.parse(longitude));
// },
child: SvgPicture.asset(
'assets/images/pharmacy/location.svg',
width: 20,
height: 20,
),
),
SizedBox(
width: 20,
),
Expanded(
child: Text(
TranslationBase.of(context).contactUsLocation,
style: TextStyle(
color: Colors.grey[700],
fontSize: 16,
fontWeight: FontWeight.w600,
letterSpacing: -0.68)),
),
],
),
),
SizedBox(
height: 50,
),
Center(
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: <Widget>[
IconButton(
icon: new Image.asset(
'assets/images/new-design/facebook.png'),
tooltip: 'facebook',
iconSize: 48,
onPressed: () {
setState(() {
launch("https://facebook.com/HMG.pharmacy");
// launch("https://www.facebook.com/DrSulaimanAlHabib?ref=tn_tnmn");
});
},
),
IconButton(
icon: new Image.asset(
'assets/images/new-design/twitter.png'),
tooltip: 'Twitter',
iconSize: 48,
onPressed: () {
setState(() {
launch("https://twitter.com/HMG_pharmacy");
});
},
),
IconButton(
icon: new Image.asset(
'assets/images/pharmacy/instagram.png'),
tooltip: 'Instagram',
iconSize: 48,
onPressed: () {
setState(() {
launch("https://instagram.com/HMG_pharmacy");
});
},
),
]),
)
],
),
),
),
],
),
);
}
openWhatsApp() async {
// bool Platform.isIOS = Theme.of(context).platform == TargetPlatform.iOS;
var whatsapp = "+966558434444";
var whatsappURL_android = "whatsapp://send?phone=" + whatsapp;
var whatappURL_ios = "https://wa.me/$whatsapp";
if (Platform.isIOS) {
// for iOS phone only
// if (await canLaunch(whatappURL_ios)) {
await launch(whatappURL_ios, forceSafariVC: false);
// } else {}
} else {
// android
// if (await canLaunch(whatsappURL_android)) {
await launch(whatsappURL_android);
// } else {}
}
}
}

@ -16,6 +16,7 @@ import 'package:diplomaticquarterapp/pages/pharmacies/screens/pharmacy-terms-con
import 'package:diplomaticquarterapp/pages/pharmacies/wishlist.dart'; import 'package:diplomaticquarterapp/pages/pharmacies/wishlist.dart';
import 'package:diplomaticquarterapp/pages/pharmacy/order/Order.dart'; import 'package:diplomaticquarterapp/pages/pharmacy/order/Order.dart';
import 'package:diplomaticquarterapp/pages/pharmacy/pharmacyAddresses/PharmacyAddresses.dart'; import 'package:diplomaticquarterapp/pages/pharmacy/pharmacyAddresses/PharmacyAddresses.dart';
import 'package:diplomaticquarterapp/pages/pharmacy/pharmacyContacts.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
@ -473,8 +474,8 @@ class _ProfilePageState extends State<PharmacyProfilePage> {
SizedBox( SizedBox(
width: 10, width: 10,
), ),
Text( Text( TranslationBase.of(context).termOfService,
TranslationBase.of(context).conditionsHMG, // TranslationBase.of(context).conditionsHMG,
style: TextStyle( style: TextStyle(
fontSize: 13.0, fontSize: 13.0,
), ),
@ -548,7 +549,7 @@ class _ProfilePageState extends State<PharmacyProfilePage> {
), ),
InkWell( InkWell(
onTap: () { onTap: () {
Navigator.push(context, FadePage(page: LiveChatPage())); Navigator.push(context, FadePage(page: pharmacyContactsPage()));
}, },
child: Row( child: Row(
children: <Widget>[ children: <Widget>[

@ -11,12 +11,14 @@ import 'package:diplomaticquarterapp/widgets/input/text_field.dart';
import 'package:diplomaticquarterapp/widgets/others/StarRating.dart'; import 'package:diplomaticquarterapp/widgets/others/StarRating.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_pharmacy_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_pharmacy_widget.dart';
import 'package:diplomaticquarterapp/widgets/others/network_base_view.dart'; import 'package:diplomaticquarterapp/widgets/others/network_base_view.dart';
import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'base/base_view.dart'; import 'base/base_view.dart';
import 'package:intl/intl.dart' as international;
class SearchProductsPage extends StatefulWidget { class SearchProductsPage extends StatefulWidget {
@override @override
@ -27,6 +29,8 @@ class _SearchProductsPageState extends State<SearchProductsPage> {
final textController = TextEditingController(); final textController = TextEditingController();
final _formKey = GlobalKey<FormState>(); final _formKey = GlobalKey<FormState>();
String msg = ''; String msg = '';
String validText = "";
bool isTextValid = true;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -61,41 +65,27 @@ class _SearchProductsPageState extends State<SearchProductsPage> {
fontSize: 14.5, fontSize: 14.5,
prefixIcon: Icon(Icons.search), prefixIcon: Icon(Icons.search),
inputAction: TextInputAction.search, inputAction: TextInputAction.search,
inputFormatters: <TextInputFormatter>[
FilteringTextInputFormatter.allow(
RegExp(r'([A-Za-z0-9 a space])'))
],
validator: (value) {
RegExp regExp = RegExp(r'([A-Za-z0-9 a space])');
if (value.isEmpty) {
TranslationBase.of(context)
.pleaseEnterProductName;
} else if (!regExp.hasMatch(value)) {
AppToast.showErrorToast(
message: TranslationBase.of(context)
.noArabicLetters);
}
return null;
},
onSaved: (value) { onSaved: (value) {
//searchMedicine(model, context); //searchMedicine(model, context);
}, },
onSubmit: (value) { onSubmit: (value) {
searchMedicine(model, context); searchMedicine(model, context);
// msg = 'No Result Found'; // msg = 'No Result Found';
msg = TranslationBase.of(context).noResultFound; msg = TranslationBase.of(context).noSearchResultFound;
}, },
controller: textController, controller: textController,
// validator: (value) {
// if (value.isEmpty) {
//// return 'please Enter Product Name';
// return TranslationBase.of(context).pleaseEnterProductName;
// }
// return null;
// },
), ),
// SizedBox(
// width: 10.0,
// ),
// if(!isTextValid)
// AppText( TranslationBase.of(context)
// .noArabicLetters, color: Colors.red,),
// ],
// ),
), ),
), ),
SizedBox( SizedBox(
width: 10.0, width: 10.0,
), ),
@ -223,16 +213,27 @@ class _SearchProductsPageState extends State<SearchProductsPage> {
Radius.circular( Radius.circular(
6)), 6)),
), ),
child: model.searchList[index].rxMessage != null child: model.searchList[index]
.rxMessage !=
null
? Texts( ? Texts(
projectProvider.isArabic projectProvider
? model.searchList[index].rxMessagen .isArabic
: model.searchList[index].rxMessage, ? model
.searchList[
index]
.rxMessagen
: model
.searchList[
index]
.rxMessage,
color: Colors.white, color: Colors.white,
regular: true, regular: true,
fontSize: 10, fontSize: 10,
fontWeight: FontWeight.w400, fontWeight:
): Texts(""), FontWeight.w400,
)
: Texts(""),
// Texts( // Texts(
// model.searchList[index] // model.searchList[index]
// .rxMessage != // .rxMessage !=
@ -258,9 +259,14 @@ class _SearchProductsPageState extends State<SearchProductsPage> {
crossAxisAlignment: crossAxisAlignment:
CrossAxisAlignment.start, CrossAxisAlignment.start,
children: [ children: [
Texts(projectProvider.isArabic Texts(
? model.searchList[index].namen projectProvider.isArabic
:model.searchList[index].name, ? model
.searchList[index]
.namen
: model
.searchList[index]
.name,
// model.searchList[index].name, // model.searchList[index].name,
regular: true, regular: true,
@ -338,6 +344,10 @@ class _SearchProductsPageState extends State<SearchProductsPage> {
); );
} }
bool isRTL(String text) {
return international.Bidi.detectRtlDirectionality(text);
}
searchMedicine(PharmacyCategoriseViewModel model, BuildContext context) { searchMedicine(PharmacyCategoriseViewModel model, BuildContext context) {
Utils.hideKeyboard(context); Utils.hideKeyboard(context);
if (_formKey.currentState.validate()) if (_formKey.currentState.validate())

@ -280,7 +280,7 @@ class _ProfileSettings extends State<ProfileSettings> with TickerProviderStateMi
TextField( TextField(
enabled: isEnable, enabled: isEnable,
scrollPadding: EdgeInsets.zero, scrollPadding: EdgeInsets.zero,
keyboardType: TextInputType.number, keyboardType: TextInputType.emailAddress,
controller: _controller, controller: _controller,
// onChanged: (value) => {validateForm()}, // onChanged: (value) => {validateForm()},
style: TextStyle( style: TextStyle(

@ -76,21 +76,6 @@ class _MyVaccinesState extends State<MyVaccines> {
bottomSheet: Container( bottomSheet: Container(
color: Colors.white, color: Colors.white,
padding: EdgeInsets.only(top: 16, bottom: 16, right: 21, left: 21), padding: EdgeInsets.only(top: 16, bottom: 16, right: 21, left: 21),
child: Row(
mainAxisSize: MainAxisSize.min,
children: [
Expanded(
child: DefaultButton(
TranslationBase.of(context).availability,
() {
// Navigator.push(context, FadePage(page: MyVaccinesItemPage()));
},
color: Color(0xffEAEAEA),
textColor: Color(0xff000000),
),
),
SizedBox(width: 8),
Expanded(
child: DefaultButton( child: DefaultButton(
TranslationBase.of(context).sendEmail, TranslationBase.of(context).sendEmail,
() { () {
@ -104,10 +89,7 @@ class _MyVaccinesState extends State<MyVaccines> {
), ),
); );
}, },
), )
),
],
),
), ),
), ),
); );

@ -468,12 +468,12 @@ class AuthProvider with ChangeNotifier {
Future<dynamic> getDashboard() async { Future<dynamic> getDashboard() async {
Map<String, dynamic> request = {}; Map<String, dynamic> request = {};
request['VersionID'] = VERSION_ID; // request['VersionID'] = VERSION_ID;
request['Channel'] = CHANNEL; // request['Channel'] = CHANNEL;
request['IPAdress'] = IP_ADDRESS; // request['IPAdress'] = IP_ADDRESS;
request['generalid'] = GENERAL_ID; // request['generalid'] = GENERAL_ID;
request['LanguageID'] = LANGUAGE_ID; // request['LanguageID'] = LANGUAGE_ID;
request['DeviceTypeID'] = DeviceTypeID; // request['DeviceTypeID'] = DeviceTypeID;
dynamic localRes; dynamic localRes;
try { try {

@ -40,11 +40,9 @@ class FamilyFilesProvider with ChangeNotifier {
dynamic localRes; dynamic localRes;
try { try {
var request = GetAllSharedRecordsByStatusReq(); var request = GetAllSharedRecordsByStatusReq();
var result = await sharedPref.getObject(MAIN_USER); // var result = await sharedPref.getObject(MAIN_USER);
request.status = 0; // request.status = 0;
// request.patientID = result["PatientID"];
request.patientID = result["PatientID"];
await new BaseAppClient().post(GET_SHARED_RECORD_BY_STATUS, onSuccess: (dynamic response, int statusCode) { await new BaseAppClient().post(GET_SHARED_RECORD_BY_STATUS, onSuccess: (dynamic response, int statusCode) {
localRes = response; localRes = response;
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {

@ -20,10 +20,10 @@ class OrderDetailsService extends BaseService{
List<OrderDetailModel> get orderList => _orderList; List<OrderDetailModel> get orderList => _orderList;
Future getOrderDetails(OrderId) async { Future getOrderDetails(OrderId, orderGUID) async {
var customerGUID = await sharedPref.getObject(PHARMACY_CUSTOMER_GUID); var customerGUID = await sharedPref.getObject(PHARMACY_CUSTOMER_GUID);
hasError = false; hasError = false;
await baseAppClient.getPharmacy(GET_ORDER_DETAILS+OrderId + "/$customerGUID", await baseAppClient.getPharmacy(GET_ORDER_DETAILS+OrderId + "/$orderGUID",
onSuccess: (dynamic response, int statusCode) { onSuccess: (dynamic response, int statusCode) {
_orderList.clear(); _orderList.clear();
response['orders'].forEach((item) { response['orders'].forEach((item) {

@ -20,7 +20,7 @@ class OrderService extends BaseService {
hasError = false; hasError = false;
// url =GET_ORDER+"customer=1,fields=id,order_total,order_status,order_statusn,order_status_id,created_on_utc&page=1&limit=200&customer_id=1367368"; // url =GET_ORDER+"customer=1,fields=id,order_total,order_status,order_statusn,order_status_id,created_on_utc&page=1&limit=200&customer_id=1367368";
// url =GET_ORDER+"customer=1,fields=id,order_total,order_status,order_statusn,order_status_id,created_on_utc&page=$pageId&limit=200&customer_id=$customerId"; // url =GET_ORDER+"customer=1,fields=id,order_total,order_status,order_statusn,order_status_id,created_on_utc&page=$pageId&limit=200&customer_id=$customerId";
url = GET_ORDER + "customer=1&fields=id,order_total,order_status,order_statusn,order_status_id,created_on_utc,product_count,can_cancel,can_refund&page=$pageId&limit=200&customer_id=$customerId&CustomerguId=$customerGUID"; url = GET_ORDER + "customer=1&fields=id,order_total,order_status,order_statusn,order_status_id,created_on_utc,product_count,can_cancel,can_refund,order_guid&page=$pageId&limit=200&customer_id=$customerId&CustomerguId=$customerGUID";
print(url); print(url);
await baseAppClient.getPharmacy(url, onSuccess: (dynamic response, int statusCode) { await baseAppClient.getPharmacy(url, onSuccess: (dynamic response, int statusCode) {

@ -104,6 +104,7 @@ class PharmacyAddressService extends BaseService {
response['customers'][0]['addresses'].forEach((item) { response['customers'][0]['addresses'].forEach((item) {
addresses.add(AddressInfo.fromJson(item)); addresses.add(AddressInfo.fromJson(item));
}); });
getAddresses();
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
super.error = error; super.error = error;

@ -4,11 +4,11 @@ import 'package:diplomaticquarterapp/core/service/base_service.dart';
import 'package:diplomaticquarterapp/models/pharmacy/Wishlist.dart'; import 'package:diplomaticquarterapp/models/pharmacy/Wishlist.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
class WishListService extends BaseService { class WishListService extends BaseService {
AppSharedPreferences sharedPref = AppSharedPreferences(); AppSharedPreferences sharedPref = AppSharedPreferences();
bool isLogin = false; bool isLogin = false;
List<Wishlist> _wishListProducts = List(); List<Wishlist> _wishListProducts = List();
List<Wishlist> get wishListProducts => _wishListProducts; List<Wishlist> get wishListProducts => _wishListProducts;
// Future<Map> getWishlist() async { // Future<Map> getWishlist() async {
@ -52,10 +52,10 @@ class WishListService extends BaseService {
Future getWishlist() async { Future getWishlist() async {
//TODO we need to check why the customer id comes null //TODO we need to check why the customer id comes null
String customerId = await sharedPref.getString(PHARMACY_CUSTOMER_ID)?? "0"; String customerId = await sharedPref.getString(PHARMACY_CUSTOMER_ID) ?? "0";
var customerGUID = await sharedPref.getObject(PHARMACY_CUSTOMER_GUID);
hasError = false; hasError = false;
await baseAppClient.getPharmacy(GET_WISHLIST+customerId +"?shopping_cart_type=2", await baseAppClient.getPharmacy(GET_WISHLIST + customerId + "/$customerGUID/" + "?shopping_cart_type=2", onSuccess: (dynamic response, int statusCode) {
onSuccess: (dynamic response, int statusCode) {
_wishListProducts.clear(); _wishListProducts.clear();
response['shopping_carts'].forEach((item) { response['shopping_carts'].forEach((item) {
_wishListProducts.add(Wishlist.fromJson(item)); _wishListProducts.add(Wishlist.fromJson(item));
@ -65,5 +65,4 @@ class WishListService extends BaseService {
super.error = error; super.error = error;
}); });
} }
} }

@ -0,0 +1,37 @@
import 'dart:io';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart';
import 'package:flutter/cupertino.dart';
import 'package:permission_handler/permission_handler.dart';
import 'PlatformBridge.dart';
class AppPermission{
static Future<bool> askVideoCallPermission(BuildContext context) async {
if (!(await Permission.camera.request().isGranted) || !(await Permission.microphone.request().isGranted)) {
return false;
}
if (Platform.isAndroid && !(await PlatformBridge.shared().isDrawOverAppsPermissionAllowed())) {
await _drawOverAppsMessageDialog(context);
return false;
}
return true;
}
static Future _drawOverAppsMessageDialog(BuildContext context) async {
ConfirmDialog dialog = new ConfirmDialog(
context: context,
confirmMessage: "Please select 'Dr. Alh'abib' from the list and allow draw over app permission to use live care.",
okText: TranslationBase.of(context).confirm,
cancelText: TranslationBase.of(context).cancel_nocaps,
okFunction: () async {
await PlatformBridge.shared().askDrawOverAppsPermission();
Navigator.pop(context);
},
cancelFunction: () => {});
dialog.showAlertDialog(context);
}
}

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

Loading…
Cancel
Save