Merge branch 'development_v2.5' into 'zik_new_design_flutter_v2.5'

# Conflicts:
#   lib/pages/landing/fragments/home_page_fragment2.dart
#   lib/uitl/app_shared_preferences.dart
#   lib/widgets/in_app_browser/InAppBrowser.dart
merge-requests/582/head
Zohaib Iqbal 4 years ago
commit 259e27d4a7

@ -120,7 +120,7 @@ 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'

@ -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")

@ -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'
}
}

@ -1,5 +1,5 @@
# Uncomment this line to define a global platform for your project # Uncomment this line to define a global platform for your project
# platform :ios, '9.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'

@ -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>

@ -33,7 +33,7 @@ class NavObserver extends RouteObserver<PageRoute<dynamic>> {
screenName: event.flutterName(), screenClassOverride: className) screenName: event.flutterName(), screenClassOverride: className)
.catchError( .catchError(
(Object error) { (Object error) {
debugPrint('$FirebaseAnalyticsObserver: $error'); print('$FirebaseAnalyticsObserver: $error');
}, },
test: (Object error) { test: (Object error) {
return error is PlatformException; return error is PlatformException;

@ -16,8 +16,8 @@ const PACKAGES_SHOPPING_CART = '/api/shopping_cart_items';
const PACKAGES_ORDERS = '/api/orders'; const PACKAGES_ORDERS = '/api/orders';
const PACKAGES_ORDER_HISTORY = '/api/orders/items'; const PACKAGES_ORDER_HISTORY = '/api/orders/items';
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
// const BASE_PHARMACY_URL = 'https://uat.hmgwebservices.com/epharmacy/api/'; // const BASE_PHARMACY_URL = 'https://uat.hmgwebservices.com/epharmacy/api/';
@ -32,7 +32,7 @@ const PHARMACY_BASE_URL = 'https://mdlaboratories.com/exacartapi/api/';
// const PHARMACY_BASE_URL = 'https://mdlaboratories.com/exacartapitest/api/'; // const PHARMACY_BASE_URL = 'https://mdlaboratories.com/exacartapitest/api/';
// RC API URL // RC API URL
const RC_BASE_URL = 'https://livecare.hmg.com/'; const RC_BASE_URL = 'https://rc.hmg.com/';
const PING_SERVICE = 'Services/Weather.svc/REST/CheckConnectivity'; const PING_SERVICE = 'Services/Weather.svc/REST/CheckConnectivity';
@ -147,18 +147,18 @@ const INSERT_ER_INERT_PRES_ORDER =
'Services/Patients.svc/REST/PatientER_InsertPresOrder'; 'Services/Patients.svc/REST/PatientER_InsertPresOrder';
/// ER RRT /// ER RRT
const GET_ALL_RC_TRANSPORTATION = 'rc/api/Transportation/getalltransportation'; const GET_ALL_RC_TRANSPORTATION = 'api/Transportation/getalltransportation';
const GET_ALL_TRANSPORTATIONS_RC = 'rc/api/Transportation/getalltransportation'; const GET_ALL_TRANSPORTATIONS_RC = 'api/Transportation/getalltransportation';
const GET_ALL_RRT_QUESTIONS = const GET_ALL_RRT_QUESTIONS =
'Services/Patients.svc/REST/PatientER_RRT_GetAllQuestions'; 'Services/Patients.svc/REST/PatientER_RRT_GetAllQuestions';
const GET_RRT_SERVICE_PRICE = const GET_RRT_SERVICE_PRICE =
'Services/Patients.svc/REST/PatientE_RealRRT_GetServicePrice'; 'Services/Patients.svc/REST/PatientE_RealRRT_GetServicePrice';
const GET_ALL_TRANSPORTATIONS_ORDERS = 'rc/api/Transportation/get'; const GET_ALL_TRANSPORTATIONS_ORDERS = 'api/Transportation/get';
const CANCEL_AMBULANCE_REQUEST = "rc/api/Transportation/update"; const CANCEL_AMBULANCE_REQUEST = "api/Transportation/update";
const INSERT_TRANSPORTATION_ORDER_RC = "rc/api/Transportation/add"; const INSERT_TRANSPORTATION_ORDER_RC = "api/Transportation/add";
///FindUs ///FindUs
const GET_FINDUS_REQUEST = 'Services/Lists.svc/REST/Get_HMG_Locations'; const GET_FINDUS_REQUEST = 'Services/Lists.svc/REST/Get_HMG_Locations';
@ -305,6 +305,9 @@ const HIS_CREATE_ADVANCE_PAYMENT =
const ADD_ADVANCE_NUMBER_REQUEST = const ADD_ADVANCE_NUMBER_REQUEST =
'Services/PayFort_Serv.svc/REST/AddAdvancedNumberRequest'; 'Services/PayFort_Serv.svc/REST/AddAdvancedNumberRequest';
const GENERATE_ANCILLARY_ORDERS_INVOICE =
'Services/Doctors.svc/REST/AutoGenerateAncillaryOrderInvoice';
const IS_ALLOW_ASK_DOCTOR = const IS_ALLOW_ASK_DOCTOR =
'Services/Doctors.svc/REST/GetPatientDoctorAppointmentResult'; 'Services/Doctors.svc/REST/GetPatientDoctorAppointmentResult';
const GET_CALL_REQUEST_TYPE = const GET_CALL_REQUEST_TYPE =
@ -601,34 +604,33 @@ const GET_PATIENT_ALL_PRES_ORD =
'Services/Patients.svc/REST/PatientER_GetPatientAllPresOrders'; 'Services/Patients.svc/REST/PatientER_GetPatientAllPresOrders';
const PATIENT_ER_INSERT_PRES_ORDER = const PATIENT_ER_INSERT_PRES_ORDER =
'Services/Patients.svc/REST/PatientER_InsertPresOrder'; 'Services/Patients.svc/REST/PatientER_InsertPresOrder';
const PHARMACY_MAKE_REVIEW = 'epharmacy/api/insertreviews';
const BLOOD_DONATION_REGISTER_BLOOD_TYPE = const BLOOD_DONATION_REGISTER_BLOOD_TYPE =
'Services/PatientVarification.svc/REST/BloodDonation_RegisterBloodType'; 'Services/PatientVarification.svc/REST/BloodDonation_RegisterBloodType';
const ADD_USER_AGREEMENT_FOR_BLOOD_DONATION = const ADD_USER_AGREEMENT_FOR_BLOOD_DONATION =
'Services/PatientVarification.svc/REST/AddUserAgreementForBloodDonation'; 'Services/PatientVarification.svc/REST/AddUserAgreementForBloodDonation';
// HHC RC SERVICES // HHC RC SERVICES
const HHC_GET_ALL_SERVICES_RC = "rc/api/HHC/getallhhc"; const HHC_GET_ALL_SERVICES_RC = "api/HHC/getallhhc";
const ADD_HHC_ORDER_RC = "rc/api/HHC/add"; const ADD_HHC_ORDER_RC = "api/HHC/add";
const GET_ALL_HHC_ORDERS_RC = 'rc/api/hhc/list'; const GET_ALL_HHC_ORDERS_RC = 'api/hhc/list';
const UPDATE_HHC_ORDER_RC = 'rc/api/hhc/update'; const UPDATE_HHC_ORDER_RC = 'api/hhc/update';
// CMC RC SERVICES // CMC RC SERVICES
const GET_ALL_CMC_SERVICES_RC = 'rc/api/cmc/getallcmc'; const GET_ALL_CMC_SERVICES_RC = 'api/cmc/getallcmc';
const ADD_CMC_ORDER_RC = 'rc/api/cmc/add'; const ADD_CMC_ORDER_RC = 'api/cmc/add';
const GET_ALL_CMC_ORDERS_RC = 'rc/api/cmc/list'; const GET_ALL_CMC_ORDERS_RC = 'api/cmc/list';
const UPDATE_CMC_ORDER_RC = 'rc/api/cmc/update'; const UPDATE_CMC_ORDER_RC = 'api/cmc/update';
// RRT RC SERVICES // RRT RC SERVICES
const ADD_RRT_ORDER_RC = "rc/api/rrt/add"; const ADD_RRT_ORDER_RC = "api/rrt/add";
const GET_ALL_RRT_ORDERS_RC = "rc/api/rrt/list"; const GET_ALL_RRT_ORDERS_RC = "api/rrt/list";
const UPDATE_RRT_ORDER_RC = 'rc/api/rrt/update'; const UPDATE_RRT_ORDER_RC = 'api/rrt/update';
// PRESCRIPTION RC SERVICES // PRESCRIPTION RC SERVICES
const ADD_PRESCRIPTION_ORDER_RC = "rc/api/prescription/add"; const ADD_PRESCRIPTION_ORDER_RC = "api/prescription/add";
const GET_ALL_PRESCRIPTION_ORDERS_RC = "rc/api/prescription/list"; const GET_ALL_PRESCRIPTION_ORDERS_RC = "api/prescription/list";
const GET_ALL_PRESCRIPTION_INFO_RC = "rc/api/Prescription/info"; const GET_ALL_PRESCRIPTION_INFO_RC = "api/Prescription/info";
const UPDATE_PRESCRIPTION_ORDER_RC = 'rc/api/prescription/update'; const UPDATE_PRESCRIPTION_ORDER_RC = 'api/prescription/update';
//Pharmacy wishlist //Pharmacy wishlist
const GET_WISHLIST = "shopping_cart_items/"; const GET_WISHLIST = "shopping_cart_items/";
@ -640,6 +642,7 @@ const GET_PRODUCT_DETAIL = "products/";
const GET_LOCATION = "Services/Patients.svc/REST/GetPharmcyListBySKU"; const GET_LOCATION = "Services/Patients.svc/REST/GetPharmcyListBySKU";
const GET_SPECIFICATION = "productspecification/"; const GET_SPECIFICATION = "productspecification/";
const GET_BRAND_ITEMS = "products"; const GET_BRAND_ITEMS = "products";
const PHARMACY_MAKE_REVIEW = 'insertreviews';
// External API // External API
const ADD_ADDRESS_INFO = "addcustomeraddress"; const ADD_ADDRESS_INFO = "addcustomeraddress";

@ -511,7 +511,7 @@ const Map localizedValues = {
"ourLocations": {"en": "Our Locations", "ar": "مواقعنا"}, "ourLocations": {"en": "Our Locations", "ar": "مواقعنا"},
"edit": {"en": "Edit", "ar": "تعديل"}, "edit": {"en": "Edit", "ar": "تعديل"},
"whatsApp": {"en": "Whats App", "ar": " واتس اب"}, "whatsApp": {"en": "Whats App", "ar": " واتس اب"},
"phone": {"en": "Phone", "ar": " موبايل"}, "phone": {"en": "Phone", "ar": " هاتف"},
"delete": {"en": "Delete", "ar": " حذف"}, "delete": {"en": "Delete", "ar": " حذف"},
"deleteAddress": {"en": "Are you sure want to delete", "ar": " هل انت متأكد تريد حذف هذا العنوان"}, "deleteAddress": {"en": "Are you sure want to delete", "ar": " هل انت متأكد تريد حذف هذا العنوان"},
"deletedAddres": {"en": "Address has been deleted", "ar": " تم حذف العنوان"}, "deletedAddres": {"en": "Address has been deleted", "ar": " تم حذف العنوان"},
@ -642,6 +642,7 @@ const Map localizedValues = {
"years-old": {"en": "years old", "ar": "سنة"}, "years-old": {"en": "years old", "ar": "سنة"},
"drag-point": {"en": "Drag point to change your age", "ar": "اسحب لتغيير عمرك"}, "drag-point": {"en": "Drag point to change your age", "ar": "اسحب لتغيير عمرك"},
"refine": {"en": "Refine", "ar": "تصفية"}, "refine": {"en": "Refine", "ar": "تصفية"},
"subGroup": {"en": "Subgroup", "ar": "مجموعة فرعيه"},
"max": {"en": "Max", "ar": "اعلى"}, "max": {"en": "Max", "ar": "اعلى"},
"compeleteOrderMsg": {"en": "Order has been placed successfully!!", "ar": "تم اتمام الطلب بنجاح"}, "compeleteOrderMsg": {"en": "Order has been placed successfully!!", "ar": "تم اتمام الطلب بنجاح"},
"addToCompareMsg": {"en": "You have added a product to the Compare list", "ar": "تمت الاضافه لقائمة المقارنه"}, "addToCompareMsg": {"en": "You have added a product to the Compare list", "ar": "تمت الاضافه لقائمة المقارنه"},
@ -656,6 +657,7 @@ const Map localizedValues = {
"reset": {"en": "Reset", "ar": "اعادة تعيين"}, "reset": {"en": "Reset", "ar": "اعادة تعيين"},
"apply": {"en": "Apply", "ar": "تطبيق"}, "apply": {"en": "Apply", "ar": "تطبيق"},
"viewCategorise": {"en": "View All Categories", "ar": "عرض جميع الفئات"}, "viewCategorise": {"en": "View All Categories", "ar": "عرض جميع الفئات"},
"viewSubCategorise": {"en": "View All Sub Categories", "ar": "عرض جميع الفئات الفرعيه"},
"categorise": {"en": "Categories", "ar": "الفئات"}, "categorise": {"en": "Categories", "ar": "الفئات"},
"wishList": {"en": "WishList", "ar": "المفضلة"}, "wishList": {"en": "WishList", "ar": "المفضلة"},
"myAccount": {"en": "My Account", "ar": "حسابي"}, "myAccount": {"en": "My Account", "ar": "حسابي"},
@ -809,7 +811,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": "Re-Order & Delivery", "ar": "إعادة طلب و توصيل"}, "ResendOrder": {"en": "Refill & 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": "متوسط"},
@ -1570,7 +1572,7 @@ const Map localizedValues = {
"modesBelow": {"en": "Please select the modes below:", "ar": ":الرجاء تحديد الأوضاع أدناه"}, "modesBelow": {"en": "Please select the modes below:", "ar": ":الرجاء تحديد الأوضاع أدناه"},
"prefferedMode": {"en": "Please select the preferred mode below:", "ar": ":الرجاء تحديد الوضع المفضل أدناه"}, "prefferedMode": {"en": "Please select the preferred mode below:", "ar": ":الرجاء تحديد الوضع المفضل أدناه"},
"permissionsBellow": {"en": "Please allow the permissions below:", "ar": ":الرجاء السماح الأذونات أدناه"}, "permissionsBellow": {"en": "Please allow the permissions below:", "ar": ":الرجاء السماح الأذونات أدناه"},
"appointmentReminder": {"en": "Would you like to set a reminder for this appointment in your calendar?", "ar": "هل ترغب في اضافة تذكير لهذا الموعد في التقويم؟"}, "appointmentReminder": {"en": "Would you like to set a reminder for this in your calendar?", "ar": "هل ترغب في اضافة تذكير لهذا في التقويم؟"},
"cancelAppointment": {"en": "Cancel Appt.", "ar": "الغاء الموعد"}, "cancelAppointment": {"en": "Cancel Appt.", "ar": "الغاء الموعد"},
"updateInsurCards": {"en": "Update Insurance Cards", "ar": "تحديث بطاقات التأمين"}, "updateInsurCards": {"en": "Update Insurance Cards", "ar": "تحديث بطاقات التأمين"},
"patientAge": {"en": "y", "ar": "سنة"}, "patientAge": {"en": "y", "ar": "سنة"},
@ -1743,7 +1745,8 @@ const Map localizedValues = {
"ordersDashboard": {"en": "My Orders", "ar": "طلباتي"}, "ordersDashboard": {"en": "My Orders", "ar": "طلباتي"},
"productOutOfStock": {"en": "Out Of Stock", "ar": "إنتهى من المخزن"}, "productOutOfStock": {"en": "Out Of Stock", "ar": "إنتهى من المخزن"},
"productQuantity": {"en": "Quantity", "ar": "كمية"}, "productQuantity": {"en": "Quantity", "ar": "كمية"},
"yourTurn": {"en": "your turn is after", "ar": "دورك بعد"}, "yourTurn": {"en": "your turn is after", "ar": "دورك بعد"},
"patients": {"en": "patients", "ar": "مرضي"}, "patients": {"en": "patients", "ar": "مرضي"},
"group": {"en": "Group", "ar": "مجموعة"},
"ancillaryOrdersPaymentConfirm": {"en": "Are you sure you want to make payment for selected orders?", "ar": "هل أنت متأكد أنك تريد سداد قيمة الطلبات المختارة؟"},
}; };

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

@ -1,10 +1,10 @@
import 'PointsDetails.dart'; import 'PointsDetails.dart';
class PointsAmountPerday { class PointsAmountPerday {
double amountPerDay; num amountPerDay;
String day; String day;
List<PointsDetails> pointsDetails; List<PointsDetails> pointsDetails;
double pointsPerDay; num pointsPerDay;
String transationDate; String transationDate;
PointsAmountPerday( PointsAmountPerday(

@ -1,11 +1,11 @@
class PointsDetails { class PointsDetails {
int accNumber; int accNumber;
String accountStatus; String accountStatus;
double amount; num amount;
int lineItemNo; int lineItemNo;
String operationType; String operationType;
double points; num points;
double purchasePoints; num purchasePoints;
int subTransactionType; int subTransactionType;
String subTransactionTypeDescription; String subTransactionTypeDescription;
String transactionDate; String transactionDate;

@ -1,10 +1,10 @@
class Specifications { class Specifications {
int id; dynamic id;
int displayOrder; dynamic displayOrder;
String defaultValue; dynamic defaultValue;
String defaultValuen; dynamic defaultValuen;
String name; dynamic name;
String nameN; dynamic nameN;
Specifications( Specifications(
{this.id, {this.id,

@ -20,7 +20,7 @@ class PrescriptionDeliveryService extends BaseService {
}, body: body); }, body: body);
} }
Future insertDeliveryOrderRC({double latitude, double longitude, int appointmentNo, int createdBy, int dischargeID}) async { Future insertDeliveryOrderRC({double latitude, double longitude, int appointmentNo, int createdBy, int dischargeID, int projectID}) async {
hasError = false; hasError = false;
Map<String, dynamic> body = Map(); Map<String, dynamic> body = Map();
body['latitude'] = latitude; body['latitude'] = latitude;
@ -28,8 +28,8 @@ class PrescriptionDeliveryService extends BaseService {
body['AppointmentNo'] = appointmentNo.toString(); body['AppointmentNo'] = appointmentNo.toString();
// body['CreatedBy'] = createdBy; // body['CreatedBy'] = createdBy;
body['DischargeID'] = dischargeID.toString(); body['DischargeID'] = dischargeID.toString();
body['ProjectID'] = projectID;
await baseAppClient.post(ADD_PRESCRIPTION_ORDER_RC, isRCService: true, onSuccess: (dynamic response, int statusCode) { await baseAppClient.post(ADD_PRESCRIPTION_ORDER_RC, isRCService: true, onSuccess: (dynamic response, int statusCode) {
var asd = "";
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
print(error); print(error);

@ -20,8 +20,6 @@ class AncillaryOrdersService extends BaseService {
_ancillaryLists = []; _ancillaryLists = [];
response['AncillaryOrderList'].forEach((item) { response['AncillaryOrderList'].forEach((item) {
ancillaryLists.add(AncillaryOrdersListModel.fromJson(item)); ancillaryLists.add(AncillaryOrdersListModel.fromJson(item));
print("response of ancillary Lists__________");
print(response);
}); });
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
@ -34,7 +32,6 @@ class AncillaryOrdersService extends BaseService {
body['AppointmentNo_Vida'] = appointmentNo; body['AppointmentNo_Vida'] = appointmentNo;
body['OrderNo'] = orderNo; body['OrderNo'] = orderNo;
body['ProjectID'] = projectID; body['ProjectID'] = projectID;
// "OrderNo=$orderNo&AppointmentNo_Vida=$appointmentNo&ProjectID=$projectID"
hasError = false; hasError = false;
await baseAppClient.post(GET_ANCILLARY_ORDERS_DETAILS, await baseAppClient.post(GET_ANCILLARY_ORDERS_DETAILS,
onSuccess: (dynamic response, int statusCode) { onSuccess: (dynamic response, int statusCode) {
@ -42,12 +39,7 @@ class AncillaryOrdersService extends BaseService {
response['AncillaryOrderProcList'].forEach((item) { response['AncillaryOrderProcList'].forEach((item) {
ancillaryProcLists.add(AncillaryOrdersListProcListModel.fromJson(item)); ancillaryProcLists.add(AncillaryOrdersListProcListModel.fromJson(item));
// ancillaryProcLists.add(AncillaryOrdersListProcListModel.fromJson(response['AncillaryOrderProcList']));
print("----------------------------------");
print("Test data");
print(response);
}); });
//Future.value(_ancillaryProcLists);
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
super.error = error; super.error = error;

@ -122,11 +122,15 @@ class BaseAppClient {
} }
} }
// body['IdentificationNo'] = 1009199553; // body['IdentificationNo'] = 2076117163;
// body['MobileNo'] = "966545156035"; // body['MobileNo'] = "966503109207";
// body['PatientID'] = 1018977; //3844083 // body['PatientID'] = 2478442; //3844083
// body['TokenID'] = "@dm!n"; // body['TokenID'] = "@dm!n";
// Patient ID: 2478442
// Mobile no.: 0503109207
// ID: 2076117163
body.removeWhere((key, value) => key == null || value == null); body.removeWhere((key, value) => key == null || value == null);
print("URL : $url"); print("URL : $url");

@ -88,10 +88,6 @@ class AmService extends BaseService {
pendingAmbulanceRequestOrder = AmbulanceRequestOrdersModel.fromJson(item); pendingAmbulanceRequestOrder = AmbulanceRequestOrdersModel.fromJson(item);
} }
}); });
print(patientAmbulanceRequestOrdersList.length);
print(hasPendingOrder);
print(pendingOrderID);
print(pendingOrderStatus);
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
super.error = error; super.error = error;
@ -142,10 +138,7 @@ class AmService extends BaseService {
Future insertERPressOrder({@required PatientER_RC patientER}) async { Future insertERPressOrder({@required PatientER_RC patientER}) async {
hasError = false; hasError = false;
var body = patientER.toJson(); var body = patientER.toJson();
print(body);
await baseAppClient.post(INSERT_TRANSPORTATION_ORDER_RC, isRCService: true, onSuccess: (dynamic response, int statusCode) {}, onFailure: (String error, int statusCode) { await baseAppClient.post(INSERT_TRANSPORTATION_ORDER_RC, isRCService: true, onSuccess: (dynamic response, int statusCode) {}, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
super.error = error; super.error = error;

@ -8,7 +8,6 @@ import 'package:diplomaticquarterapp/core/model/geofencing/responses/GeoZonesRes
import 'package:diplomaticquarterapp/core/model/geofencing/responses/LogGeoZoneResponseModel.dart'; import 'package:diplomaticquarterapp/core/model/geofencing/responses/LogGeoZoneResponseModel.dart';
import 'package:diplomaticquarterapp/core/service/base_service.dart'; import 'package:diplomaticquarterapp/core/service/base_service.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/foundation.dart'; import 'package:flutter/foundation.dart';
class GeofencingServices extends BaseService { class GeofencingServices extends BaseService {
@ -25,8 +24,6 @@ class GeofencingServices extends BaseService {
geoZones.add(GeoZonesResponseModel().fromJson(json)); geoZones.add(GeoZonesResponseModel().fromJson(json));
}); });
if (kDebugMode || testZones) addTestingGeoZones(zones);
_zonesJsonString = json.encode(zones); _zonesJsonString = json.encode(zones);
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
@ -35,13 +32,11 @@ class GeofencingServices extends BaseService {
AppSharedPreferences pref = AppSharedPreferences(); AppSharedPreferences pref = AppSharedPreferences();
await pref.setString(HMG_GEOFENCES, _zonesJsonString); await pref.setString(HMG_GEOFENCES, _zonesJsonString);
debugPrint("Finished Fetching GEO ZONES from HMG service...");
debugPrint("GEO ZONES saved to AppPreferences with key '$HMG_GEOFENCES'");
return geoZones; return geoZones;
} }
LogGeoZoneResponseModel logResponse; LogGeoZoneResponseModel logResponse;
Future<LogGeoZoneResponseModel> logGeoZone(LogGeoZoneRequestModel request) async { Future<LogGeoZoneResponseModel> logGeoZone(LogGeoZoneRequestModel request) async {
hasError = false; hasError = false;
await baseAppClient.post(LOG_GEO_ZONES, onSuccess: (dynamic response, int statusCode) { await baseAppClient.post(LOG_GEO_ZONES, onSuccess: (dynamic response, int statusCode) {
@ -52,12 +47,4 @@ class GeofencingServices extends BaseService {
}, body: request.toFlatMap()); }, body: request.toFlatMap());
return logResponse; return logResponse;
} }
addTestingGeoZones(List zones) {
// zones.add({"GEOF_ID": 12, "Description": "ZiK Home", "Latitude": "24.691136", "Longitude": "46.650116", "Radius": 100, "Type": 1});
// zones.add({"GEOF_ID": 13, "Description": "CS Office", "Latitude": "24.7087913", "Longitude": "46.6656461", "Radius": 100, "Type": 1});
// zones.add({"GEOF_ID": 14, "Description": "Mahmoud Shrouf Home", "Latitude": "24.777577", "Longitude": "46.652675", "Radius": 100, "Type": 1});
// zones.add({"GEOF_ID": 14, "Description": "Panorama Mall", "Latitude": "24.692453", "Longitude": "46.669168", "Radius": 450, "Type": 1});
// zones.add({"GEOF_ID": 16, "Description": "Saudi Architects Crossing", "Latitude": "24.698375", "Longitude": "46.668567", "Radius": 140, "Type": 1});
}
} }

@ -99,7 +99,6 @@ class MyBalanceService extends BaseService {
onSuccess: (response, statusCode) async { onSuccess: (response, statusCode) async {
logInTokenID = response['LogInTokenID']; logInTokenID = response['LogInTokenID'];
verificationCode = response['VerificationCode']; verificationCode = response['VerificationCode'];
print(verificationCode);
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
super.error = error; super.error = error;

@ -23,8 +23,6 @@ class LacumService extends BaseService{
await baseAppClient.post(GET_LACUM_ACCOUNT_INFORMATION, await baseAppClient.post(GET_LACUM_ACCOUNT_INFORMATION,
onSuccess: (response, statusCode) async { onSuccess: (response, statusCode) async {
lacumInformation = LacumAccountInformation.fromJson(response); lacumInformation = LacumAccountInformation.fromJson(response);
print("Test Lacum Account Information");
print(response);
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
super.error = error; super.error = error;
@ -47,8 +45,6 @@ class LacumService extends BaseService{
await baseAppClient.post(GET_LACUM_GROUP_INFORMATION, await baseAppClient.post(GET_LACUM_GROUP_INFORMATION,
onSuccess: (response, statusCode) async { onSuccess: (response, statusCode) async {
lacumGroupInformation = LacumAccountInformation.fromJson(response); lacumGroupInformation = LacumAccountInformation.fromJson(response);
print("Test Lacum Group Information");
print(response);
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
super.error = error; super.error = error;

@ -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) {

@ -28,7 +28,6 @@ class PharmacyModuleService extends BaseService {
await baseAppClient.getPharmacy(PHARMACY_VERIFY_CUSTOMER, onSuccess: (dynamic response, int statusCode) async { await baseAppClient.getPharmacy(PHARMACY_VERIFY_CUSTOMER, onSuccess: (dynamic response, int statusCode) async {
if (response['UserName'] != null) { if (response['UserName'] != null) {
sharedPref.setString(PHARMACY_CUSTOMER_ID, response['CustomerId'].toString()); sharedPref.setString(PHARMACY_CUSTOMER_ID, response['CustomerId'].toString());
print(response);
} else { } else {
await createUser(); await createUser();
} }
@ -57,8 +56,6 @@ class PharmacyModuleService extends BaseService {
if (!response['IsRegistered']) { if (!response['IsRegistered']) {
} else { } else {
customerInfo = CustomerInfo.fromJson(response); customerInfo = CustomerInfo.fromJson(response);
print(response['customerDto']);
print(response['customerDto']['customerGuid']);
await sharedPref.setObject(PHARMACY_CUSTOMER_ID, customerInfo.customerId); await sharedPref.setObject(PHARMACY_CUSTOMER_ID, customerInfo.customerId);
await sharedPref.setObject(PHARMACY_CUSTOMER_GUID, response['customerDto']['customerGuid']); await sharedPref.setObject(PHARMACY_CUSTOMER_GUID, response['customerDto']['customerGuid']);
} }
@ -137,7 +134,7 @@ class PharmacyModuleService extends BaseService {
Map<String, String> queryParams = { Map<String, String> queryParams = {
'fields': 'fields':
'id,discount_ids,name,namen,localized_names,display_order,short_description,full_description,full_descriptionn,sku,order_minimum_quantity,order_maximum_quantity,price,old_price,images,is_rx,rx_message,rx_messagen,discount_name,discount_namen,approved_rating_sum,approved_total_reviews,allow_back_in_stock_subscriptions,stock_quantity,stock_availability,stock_availabilityn,discount_percentage,reviews', 'id,discount_ids,name,namen,localized_names,display_order,short_description,full_description,full_descriptionn,sku,order_minimum_quantity,order_maximum_quantity,price,old_price,images,is_rx,rx_message,rx_messagen,discount_name,discount_namen,approved_rating_sum,approved_total_reviews,allow_back_in_stock_subscriptions,stock_quantity,stock_availability,stock_availabilityn,discount_percentage,reviews,specifications',
}; };
try { try {
await baseAppClient.getPharmacy(GET_PHARMACY_BEST_SELLER_PRODUCT, onSuccess: (dynamic response, int statusCode) { await baseAppClient.getPharmacy(GET_PHARMACY_BEST_SELLER_PRODUCT, onSuccess: (dynamic response, int statusCode) {
@ -181,7 +178,7 @@ class PharmacyModuleService extends BaseService {
hasError = false; hasError = false;
Map<String, String> queryParams = { Map<String, String> queryParams = {
'fields': 'fields':
'id,discount_ids,name,reviews,namen,localized_names,display_order,short_description,full_description,full_descriptionn,sku,order_minimum_quantity,order_maximum_quantity,price,old_price,images,is_rx,rx_message,rx_messagen,discount_name,discount_namen,approved_rating_sum,approved_total_reviews,allow_back_in_stock_subscriptions,stock_quantity,stock_availability,stock_availabilityn,discount_percentage', 'id,discount_ids,name,reviews,namen,localized_names,display_order,short_description,full_description,full_descriptionn,sku,order_minimum_quantity,order_maximum_quantity,price,old_price,images,is_rx,rx_message,rx_messagen,discount_name,discount_namen,approved_rating_sum,approved_total_reviews,allow_back_in_stock_subscriptions,stock_quantity,stock_availability,stock_availabilityn,discount_percentage,specifications',
}; };
try { try {
await baseAppClient.getPharmacy(GET_MOST_VIEWED_PRODUCTS, onSuccess: (dynamic response, int statusCode) { await baseAppClient.getPharmacy(GET_MOST_VIEWED_PRODUCTS, onSuccess: (dynamic response, int statusCode) {
@ -189,8 +186,6 @@ class PharmacyModuleService extends BaseService {
response['products'].forEach((item) { response['products'].forEach((item) {
mostViewedProducts.add(PharmacyProduct.fromJson(item)); mostViewedProducts.add(PharmacyProduct.fromJson(item));
}); });
// print("most viewed products ---------");
// print(response);
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
super.error = error; super.error = error;

@ -281,7 +281,7 @@ class PharmacyCategoriseService extends BaseService {
Future getBestSellerProducts() async { Future getBestSellerProducts() async {
Map<String, String> queryParams = { Map<String, String> queryParams = {
'fields': 'fields':
'id,discount_ids,name,namen,localized_names,display_order,short_description,full_description,full_descriptionn,sku,order_minimum_quantity,order_maximum_quantity,price,old_price,images,is_rx,rx_message,rx_messagen,discount_name,discount_namen,approved_rating_sum,approved_total_reviews,allow_back_in_stock_subscriptions,stock_quantity,stock_availability,stock_availabilityn,discount_percentage,reviews', 'id,discount_ids,name,namen,localized_names,display_order,short_description,full_description,full_descriptionn,sku,order_minimum_quantity,order_maximum_quantity,price,old_price,images,is_rx,rx_message,rx_messagen,discount_name,discount_namen,approved_rating_sum,approved_total_reviews,allow_back_in_stock_subscriptions,stock_quantity,stock_availability,stock_availabilityn,discount_percentage,reviews,specifications',
}; };
try { try {
await baseAppClient.getPharmacy(GET_PHARMACY_BEST_SELLER_PRODUCT, await baseAppClient.getPharmacy(GET_PHARMACY_BEST_SELLER_PRODUCT,
@ -353,7 +353,7 @@ class PharmacyCategoriseService extends BaseService {
hasError = false; hasError = false;
Map<String, String> queryParams = { Map<String, String> queryParams = {
'fields': 'fields':
'mostview?fields=id,discount_ids,name,reviews,namen,localized_names,display_order,short_description,full_description,full_descriptionn,sku,order_minimum_quantity,order_maximum_quantity,price,old_price,images,is_rx,rx_message,rx_messagen,discount_name,discount_namen,approved_rating_sum,approved_total_reviews,allow_back_in_stock_subscriptions,stock_quantity,stock_availability,stock_availabilityn,discount_percentage', 'mostview?fields=id,discount_ids,name,reviews,namen,localized_names,display_order,short_description,full_description,full_descriptionn,sku,order_minimum_quantity,order_maximum_quantity,price,old_price,images,is_rx,rx_message,rx_messagen,discount_name,discount_namen,approved_rating_sum,approved_total_reviews,allow_back_in_stock_subscriptions,stock_quantity,stock_availability,stock_availabilityn,discount_percentage,specifications',
}; };
try { try {
await baseAppClient.getPharmacy(GET_MOST_VIEWED_PRODUCTS, await baseAppClient.getPharmacy(GET_MOST_VIEWED_PRODUCTS,

@ -27,12 +27,12 @@ class PrescriptionDeliveryViewModel extends BaseViewModel {
await getCustomerAddresses(); await getCustomerAddresses();
} }
Future insertDeliveryOrder({int lineItemNo, double latitude, double longitude, int appointmentNo, int createdBy, int dischargeID}) async { Future insertDeliveryOrder({int lineItemNo, double latitude, double longitude, int appointmentNo, int createdBy, int dischargeID, int projectID}) async {
setState(ViewState.BusyLocal); setState(ViewState.BusyLocal);
// await _prescriptionDeliveryService.insertDeliveryOrder( // await _prescriptionDeliveryService.insertDeliveryOrder(
// lineItemNo: lineItemNo, latitude: latitude, longitude: longitude, appointmentNo: appointmentNo, createdBy: createdBy, dischargeID: dischargeID); // lineItemNo: lineItemNo, latitude: latitude, longitude: longitude, appointmentNo: appointmentNo, createdBy: createdBy, dischargeID: dischargeID);
await _prescriptionDeliveryService.insertDeliveryOrderRC( await _prescriptionDeliveryService.insertDeliveryOrderRC(
latitude: latitude, longitude: longitude, appointmentNo: appointmentNo, createdBy: createdBy, dischargeID: dischargeID); latitude: latitude, longitude: longitude, appointmentNo: appointmentNo, createdBy: createdBy, dischargeID: dischargeID, projectID: projectID);
if (_prescriptionDeliveryService.hasError) { if (_prescriptionDeliveryService.hasError) {
error = _prescriptionDeliveryService.error; error = _prescriptionDeliveryService.error;
setState(ViewState.ErrorLocal); setState(ViewState.ErrorLocal);

@ -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);

@ -77,14 +77,17 @@ class PharmacyAddressesViewModel extends BaseViewModel {
await _pharmacyAddressService.addCustomerAddress(sendingAddress); await _pharmacyAddressService.addCustomerAddress(sendingAddress);
} else { } else {
await _pharmacyAddressService.editCustomerAddress(sendingAddress).then((value) async { await _pharmacyAddressService.editCustomerAddress(sendingAddress).then((value) async {
// await _pharmacyAddressService.getAddresses();
}); });
} }
if (_pharmacyAddressService.hasError) { if (_pharmacyAddressService.hasError) {
setState(ViewState.Idle); setState(ViewState.Idle);
await Future.delayed(Duration(milliseconds: 800));
getAddressesList();
} else { } else {
setState(ViewState.Idle); setState(ViewState.Idle);
await Future.delayed(Duration(milliseconds: 800));
getAddressesList();
} }
} }
@ -96,6 +99,8 @@ class PharmacyAddressesViewModel extends BaseViewModel {
setState(ViewState.Error); setState(ViewState.Error);
} else { } else {
setState(ViewState.Idle); setState(ViewState.Idle);
await Future.delayed(Duration(milliseconds: 800));
getAddressesList();
} }
} }

@ -1,3 +1,4 @@
import 'package:diplomaticquarterapp/config/config.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/Addresses.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/LacumAccountInformation.dart'; import 'package:diplomaticquarterapp/core/model/pharmacies/LacumAccountInformation.dart';
@ -97,7 +98,7 @@ class OrderModelViewModel extends BaseViewModel {
return res; return res;
} }
Future makeReview(PharmacyProduct product, double rating, String reviewText, context) async { Future makeReview(PharmacyProduct product, double rating, String reviewText) async {
setState(ViewState.Busy); setState(ViewState.Busy);
await _orderDetailsService.makeReview(product, rating, reviewText); await _orderDetailsService.makeReview(product, rating, reviewText);
if (_orderDetailsService.hasError) { if (_orderDetailsService.hasError) {
@ -106,7 +107,7 @@ class OrderModelViewModel extends BaseViewModel {
AppToast.showErrorToast(message: error); AppToast.showErrorToast(message: error);
} else { } else {
setState(ViewState.Idle); setState(ViewState.Idle);
AppToast.showSuccessToast(message: TranslationBase.of(context).submitReview); AppToast.showSuccessToast(message: TranslationBase.of(AppGlobal.context).submitReview);
// AppToast.showSuccessToast( // AppToast.showSuccessToast(
// message: "Your review has been Submitted successfully"); // message: "Your review has been Submitted successfully");
} }

@ -64,7 +64,6 @@ class _LocationPageState extends State<LocationPage> {
enableMapTypeButton: true, enableMapTypeButton: true,
searchForInitialValue: false, searchForInitialValue: false,
onPlacePicked: (PickResult result) { onPlacePicked: (PickResult result) {
print("onPlacePickedonPlacePickedonPlacePickedonPlacePicked");
print(result.adrAddress); print(result.adrAddress);
}, },
selectedPlaceWidgetBuilder: (_, selectedPlace, state, isSearchBarFocused) { selectedPlaceWidgetBuilder: (_, selectedPlace, state, isSearchBarFocused) {
@ -79,8 +78,6 @@ class _LocationPageState extends State<LocationPage> {
child: state == SearchingState.Searching child: state == SearchingState.Searching
? SizedBox(height: 43,child: Center(child: CircularProgressIndicator())).insideContainer ? SizedBox(height: 43,child: Center(child: CircularProgressIndicator())).insideContainer
: DefaultButton(TranslationBase.of(context).addNewAddress, () async { : DefaultButton(TranslationBase.of(context).addNewAddress, () async {
// print();
AddNewAddressRequestModel addNewAddressRequestModel = new AddNewAddressRequestModel( AddNewAddressRequestModel addNewAddressRequestModel = new AddNewAddressRequestModel(
customer: Customer(addresses: [ customer: Customer(addresses: [
Addresses( Addresses(

@ -1,21 +1,26 @@
import 'package:diplomaticquarterapp/core/viewModels/ancillary_orders_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/ancillary_orders_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrdersDetails.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrdersDetails.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/data_display/medical/doctor_card.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
class AnicllaryOrders extends StatefulWidget { class AnicllaryOrders extends StatefulWidget {
@override @override
_AnicllaryOrdersState createState() => _AnicllaryOrdersState(); _AnicllaryOrdersState createState() => _AnicllaryOrdersState();
} }
class _AnicllaryOrdersState extends State<AnicllaryOrders> class _AnicllaryOrdersState extends State<AnicllaryOrders> with SingleTickerProviderStateMixin {
with SingleTickerProviderStateMixin {
TabController _tabController; TabController _tabController;
ProjectViewModel projectViewModel;
void initState() { void initState() {
super.initState(); super.initState();
_tabController = TabController(length: 2, vsync: this); _tabController = TabController(length: 2, vsync: this);
@ -28,58 +33,103 @@ class _AnicllaryOrdersState extends State<AnicllaryOrders>
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
projectViewModel = Provider.of(context);
return BaseView<AnciallryOrdersViewModel>( return BaseView<AnciallryOrdersViewModel>(
onModelReady: (model) => model.getOrders(), onModelReady: (model) => model.getOrders(),
builder: (_, model, widget) => AppScaffold( builder: (_, model, widget) => AppScaffold(
isShowAppBar: true, isShowAppBar: true,
showNewAppBar: true,
showNewAppBarTitle: true,
baseViewModel: model, baseViewModel: model,
appBarTitle: TranslationBase.of(context).anicllaryOrders, appBarTitle: TranslationBase.of(context).anicllaryOrders,
body: SingleChildScrollView( body: SingleChildScrollView(
padding: EdgeInsets.all(12), padding: EdgeInsets.all(12), child: model.ancillaryLists.length > 0 ? Column(children: [getPatientInfo(model), getAncillaryOrdersList(model)]) : getNoDataWidget(context))));
child: model.ancillaryLists.length > 0
? Column(children: [
getPatientInfo(model),
getAncillaryOrdersList(model)
])
: SizedBox())));
} }
Widget getPatientInfo(AnciallryOrdersViewModel model) { Widget getPatientInfo(AnciallryOrdersViewModel model) {
print(model.ancillaryLists);
return Padding( return Padding(
child: Column( child: Column(
children: [ children: [
Row( Container(
children: [ width: double.infinity,
Texts( child: Container(
TranslationBase.of(context).mrn, decoration: cardRadius(12),
fontWeight: FontWeight.bold, margin: EdgeInsets.zero,
fontSize: 22, child: Padding(
), padding: const EdgeInsets.all(12.0),
Texts( child: Column(
" : ", crossAxisAlignment: CrossAxisAlignment.start,
fontSize: 20, children: [
), Row(
Texts( children: [
model.ancillaryLists[0].patientID.toString(), Text(
) TranslationBase.of(context).patientName + ":",
], style: TextStyle(
), fontWeight: FontWeight.w600,
Row( fontSize: 10,
children: [ letterSpacing: -0.6,
Texts( color: CustomColors.grey,
TranslationBase.of(context).patientName, ),
fontWeight: FontWeight.bold, ),
fontSize: 20, mWidth(3),
), Text(
Texts( projectViewModel.user.firstName + " " + projectViewModel.user.lastName,
" : ", style: TextStyle(
fontSize: 20, fontWeight: FontWeight.w600,
fontSize: 12,
letterSpacing: -0.48,
),
),
],
),
Row(
children: [
Text(
TranslationBase.of(context).mrn + ":",
style: TextStyle(
fontWeight: FontWeight.w600,
fontSize: 10,
letterSpacing: -0.6,
color: CustomColors.grey,
),
),
mWidth(3),
Text(
projectViewModel.user.patientID.toString(),
style: TextStyle(
fontWeight: FontWeight.w600,
fontSize: 12,
letterSpacing: -0.48,
),
),
],
),
Row(
children: [
Text(
TranslationBase.of(context).nationalIdNumber + ":",
style: TextStyle(
fontWeight: FontWeight.w600,
fontSize: 10,
letterSpacing: -0.6,
color: CustomColors.grey,
),
),
mWidth(3),
Text(
projectViewModel.user.patientIdentificationNo,
style: TextStyle(
fontWeight: FontWeight.w600,
fontSize: 12,
letterSpacing: -0.48,
),
),
],
),
],
),
), ),
Texts( ),
model.ancillaryLists[0].patientName,
)
],
), ),
Divider() Divider()
], ],
@ -89,87 +139,34 @@ class _AnicllaryOrdersState extends State<AnicllaryOrders>
} }
Widget getAncillaryOrdersList(AnciallryOrdersViewModel model) { Widget getAncillaryOrdersList(AnciallryOrdersViewModel model) {
return Column( return Column(children: [
children: model.ancillaryLists[0].ancillaryOrderList ListView.separated(
.map( shrinkWrap: true,
(item) => InkWell( physics: NeverScrollableScrollPhysics(),
onTap: () { itemBuilder: (context, index) {
ancillaryOrdersDetails(item, model.ancillaryLists[0].projectID); return DoctorCard(
}, onTap: () => ancillaryOrdersDetails(model.ancillaryLists[0].ancillaryOrderList[index], model.ancillaryLists[0].projectID),
child: Container( isInOutPatient: true,
decoration: BoxDecoration( name: TranslationBase.of(context).dr.toString() + " " + (model.ancillaryLists[0].ancillaryOrderList[index].doctorName),
border: Border( billNo: model.ancillaryLists[0].ancillaryOrderList[index].orderNo.toString(),
bottom: BorderSide( profileUrl: "https://hmgwebservices.com/Images/MobileImages/DUBAI/unkown.png",
width: 0.5, subName: model.ancillaryLists[0].projectName,
))), isLiveCareAppointment: false,
padding: EdgeInsets.all(15), date: DateUtil.convertStringToDate(model.ancillaryLists[0].ancillaryOrderList[index].orderDate),
child: Row( isSortByClinic: true,
mainAxisAlignment: MainAxisAlignment.spaceBetween, );
children: [ },
Column( itemCount: model.ancillaryLists[0].ancillaryOrderList.length,
crossAxisAlignment: CrossAxisAlignment.start, separatorBuilder: (context, index) => SizedBox(height: 14),
children: [ ),
Padding( ]);
padding: EdgeInsets.all(3),
child: Row(
mainAxisAlignment:
MainAxisAlignment.start,
children: [
Texts(
TranslationBase.of(context)
.appointmentNo +
' : ',
fontWeight: FontWeight.bold,
),
Texts(item.appointmentNo.toString())
],
)),
Padding(
padding: EdgeInsets.all(3),
child: Row(
children: [
Texts(
TranslationBase.of(context)
.appointmentDate +
' : ',
fontWeight: FontWeight.bold),
Texts(DateUtil.getFormattedDate(
DateUtil.convertStringToDate(
item.appointmentDate),
"MMM dd,yyyy"))
],
)),
Padding(
padding: EdgeInsets.all(3),
child: Row(
children: [
Texts(
TranslationBase.of(context)
.doctorName +
' : ',
fontWeight: FontWeight.bold),
Texts(item.doctorName.toString())
],
)),
Divider(
color: Colors.black12,
height: 1,
)
]),
Icon(
Icons.arrow_right,
size: 25,
)
]))),
)
.toList());
} }
ancillaryOrdersDetails(item, projectId) { ancillaryOrdersDetails(item, projectId) {
Navigator.push( Navigator.push(
context, context,
FadePage( FadePage(
page: AnicllaryOrdersDetails(item.appointmentNo, item.orderNo,projectId ), page: AnicllaryOrdersDetails(item.appointmentNo, item.orderNo, projectId),
), ),
); );
} }

@ -1,15 +1,25 @@
import "package:collection/collection.dart"; import "package:collection/collection.dart";
import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/core/viewModels/ancillary_orders_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/ancillary_orders_view_model.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/ancillary-orders/ordersPayment.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart';
import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart';
import 'package:diplomaticquarterapp/models/anicllary-orders/ancillary_order_proc_model.dart';
import 'package:diplomaticquarterapp/pages/ToDoList/payment_method_select.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart';
import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
import 'package:diplomaticquarterapp/widgets/dragable_sheet.dart';
import 'package:diplomaticquarterapp/widgets/in_app_browser/InAppBrowser.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/transitions/fade_page.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
class AnicllaryOrdersDetails extends StatefulWidget { class AnicllaryOrdersDetails extends StatefulWidget {
final dynamic appoNo; final dynamic appoNo;
@ -17,11 +27,20 @@ class AnicllaryOrdersDetails extends StatefulWidget {
final dynamic projectID; final dynamic projectID;
AnicllaryOrdersDetails(this.appoNo, this.orderNo, this.projectID); AnicllaryOrdersDetails(this.appoNo, this.orderNo, this.projectID);
@override @override
_AnicllaryOrdersState createState() => _AnicllaryOrdersState(); _AnicllaryOrdersState createState() => _AnicllaryOrdersState();
} }
class _AnicllaryOrdersState extends State<AnicllaryOrdersDetails> with SingleTickerProviderStateMixin { class _AnicllaryOrdersState extends State<AnicllaryOrdersDetails> with SingleTickerProviderStateMixin {
ProjectViewModel projectViewModel;
bool _agreeTerms = false;
String selectedPaymentMethod;
MyInAppBrowser browser;
String transID = "";
List<AncillaryOrderProcDetailsList> selectedProcList = [];
void initState() { void initState() {
super.initState(); super.initState();
} }
@ -32,249 +51,283 @@ class _AnicllaryOrdersState extends State<AnicllaryOrdersDetails> with SingleTic
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
projectViewModel = Provider.of(context);
return BaseView<AnciallryOrdersViewModel>( return BaseView<AnciallryOrdersViewModel>(
onModelReady: (model) => model.getOrdersDetails(widget.appoNo, widget.orderNo, widget.projectID), onModelReady: (model) => model.getOrdersDetails(widget.appoNo, widget.orderNo, widget.projectID),
builder: (_, model, widget) => AppScaffold( builder: (_, model, widget) => AppScaffold(
isShowAppBar: true, isShowAppBar: true,
baseViewModel: model, showNewAppBar: true,
appBarTitle: TranslationBase.of(context).anicllaryOrders, showNewAppBarTitle: true,
body: SingleChildScrollView( baseViewModel: model,
padding: EdgeInsets.all(12), appBarTitle: TranslationBase.of(context).anicllaryOrders,
child: model.ancillaryListsDetails.length > 0 body: SingleChildScrollView(
? Column(children: [ padding: EdgeInsets.all(12),
getPatientInfo(model), child: model.ancillaryListsDetails.length > 0
getInvoiceDetails(model), ? Column(children: [
getInsuranceDetails(model), getPatientInfo(model),
getAncillaryDetails(model), getAncillaryDetails(model),
Row( ])
mainAxisAlignment: MainAxisAlignment.spaceAround, : getNoDataWidget(context),
children: [ ),
Texts( bottomSheet: model.ancillaryListsDetails.length > 0
TranslationBase.of(context).total, ? Container(
fontSize: 20, decoration: BoxDecoration(
fontWeight: FontWeight.bold, color: Colors.white,
), borderRadius: BorderRadius.only(topLeft: Radius.circular(10), topRight: Radius.circular(10), bottomLeft: Radius.circular(10), bottomRight: Radius.circular(10)),
Texts( boxShadow: [
getTotalValue(model), BoxShadow(
fontSize: 20, color: Colors.grey.withOpacity(0.5),
fontWeight: FontWeight.bold, spreadRadius: 5,
) blurRadius: 7,
], offset: Offset(0, 3), // changes position of shadow
), ),
Row( ],
mainAxisAlignment: MainAxisAlignment.end, ),
children: [ padding: EdgeInsets.only(left: 21, right: 21, top: 15, bottom: 15),
Button( width: double.infinity,
label: TranslationBase.of(context).payNow, // color: Colors.white,
backgroundColor: Colors.red[800], child: Column(
onTap: () { crossAxisAlignment: CrossAxisAlignment.start,
Navigator.push( mainAxisSize: MainAxisSize.min,
context, children: [
FadePage( SizedBox(height: 12),
page: OrdersPayment(), Text(
), TranslationBase.of(context).YouCanPayByTheFollowingOptions,
); style: TextStyle(
}, fontSize: 16.0,
) fontWeight: FontWeight.w600,
], color: Color(0xff2B353E),
) letterSpacing: -0.64,
]) ),
: SizedBox()))); ),
SizedBox(
width: MediaQuery.of(context).size.width * 0.75,
child: getPaymentMethods(),
),
_amountView(TranslationBase.of(context).patientShareTotalToDo, getTotalValue() + " " + TranslationBase.of(context).sar, isBold: true, isTotal: true),
SizedBox(height: 12),
DefaultButton(
TranslationBase.of(context).payNow.toUpperCase(),
selectedProcList.length > 0 && getTotalValue() != "0.00"
? () {
makePayment();
}
: null,
color: CustomColors.green,
disabledColor: CustomColors.grey2,
),
],
),
)
: Container(),
),
);
} }
Widget getPatientInfo(AnciallryOrdersViewModel model) { _getNormalText(text, {bool isBold = false, bool isTotal = false}) {
print(model.ancillaryListsDetails); return Text(
return Padding( text,
child: Column( style: TextStyle(
children: [ fontSize: isBold
Row( ? isTotal
children: [ ? 16
Texts( : 12
TranslationBase.of(context).mrn, : 11,
fontWeight: FontWeight.bold, letterSpacing: -0.5,
fontSize: 22, color: isBold ? Color(0xff2E303A) : Color(0xff575757),
), fontWeight: isTotal ? FontWeight.bold : FontWeight.w600,
Texts(
" : ",
fontSize: 20,
),
Texts(
model.ancillaryLists[0].patientID.toString(),
)
],
),
Row(
children: [
Texts(
TranslationBase.of(context).patientName,
fontWeight: FontWeight.bold,
fontSize: 20,
),
Texts(
" : ",
fontSize: 20,
),
Texts(
model.ancillaryLists[0].patientName,
)
],
),
Divider(
color: Colors.black26,
)
],
), ),
padding: EdgeInsets.only(top: 5.0, bottom: 5.0),
); );
} }
Widget getInvoiceDetails(model) { _amountView(String title, String value, {bool isBold = false, bool isTotal = false}) {
return Column( return Padding(
crossAxisAlignment: CrossAxisAlignment.start, padding: const EdgeInsets.only(top: 10, bottom: 10),
children: [ child: Row(children: [
Row( Expanded(
children: [ child: _getNormalText(title),
Texts(
TranslationBase.of(context).invoiceNo,
// fontWeight: FontWeight.bold,
color: Colors.red[500],
),
Texts(" : "),
Texts(
model.ancillaryListsDetails[0].appointmentNo.toString(),
)
],
),
Row(
children: [
// Texts(
// TranslationBase.of(context).invoiceDate,
// // fontWeight: FontWeight.bold,
// color: Colors.red[500],
// ),
Texts(" : "),
Texts(
DateUtil.getDayMonthYearDateFormatted(
DateUtil.convertStringToDate(model.ancillaryListsDetails[0].appointmentDate),
),
)
],
),
Row(
children: [
Texts(
TranslationBase.of(context).doctorName,
// fontWeight: FontWeight.bold,
color: Colors.red[500],
),
Texts(" : "),
Texts(
model.ancillaryListsDetails[0].doctorName,
),
],
), ),
SizedBox( Expanded(
height: 10, child: _getNormalText(value, isBold: isBold, isTotal: isTotal),
), ),
Divider( ]),
color: Colors.black26,
)
],
); );
} }
Widget getInsuranceDetails(model) { Widget getPatientInfo(AnciallryOrdersViewModel model) {
return Padding( return Padding(
padding: EdgeInsets.only(top: 10, bottom: 10), child: Column(
child: Column( children: [
children: [ Container(
Row( width: double.infinity,
mainAxisAlignment: MainAxisAlignment.spaceAround, child: Container(
children: [ decoration: cardRadius(12),
Texts( margin: EdgeInsets.zero,
TranslationBase.of(context).insurance, child: Padding(
fontWeight: FontWeight.bold, padding: const EdgeInsets.all(12.0),
), child: Column(
Texts( crossAxisAlignment: CrossAxisAlignment.start,
TranslationBase.of(context).insuranceID, children: [
fontWeight: FontWeight.bold, Row(
) children: [
], Text(
), TranslationBase.of(context).patientName + ":",
Row( style: TextStyle(
mainAxisAlignment: MainAxisAlignment.spaceAround, fontWeight: FontWeight.w600,
children: [ fontSize: 10,
Texts( letterSpacing: -0.6,
model.ancillaryListsDetails[0].policyName, color: CustomColors.grey,
), ),
Texts( ),
model.ancillaryListsDetails[0].insurancePolicyNo, mWidth(3),
) Text(
], projectViewModel.user.firstName + " " + projectViewModel.user.lastName,
), style: TextStyle(
SizedBox( fontWeight: FontWeight.w600,
height: 15, fontSize: 12,
), letterSpacing: -0.48,
Divider( ),
color: Colors.red[800], ),
thickness: 3, ],
), ),
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: [
children: [ Text(
Row( TranslationBase.of(context).mrn + ":",
children: [], style: TextStyle(
fontWeight: FontWeight.w600,
fontSize: 10,
letterSpacing: -0.6,
color: CustomColors.grey,
),
),
mWidth(3),
Text(
projectViewModel.user.patientID.toString(),
style: TextStyle(
fontWeight: FontWeight.w600,
fontSize: 12,
letterSpacing: -0.48,
),
),
],
),
Row(
children: [
Text(
TranslationBase.of(context).nationalIdNumber + ":",
style: TextStyle(
fontWeight: FontWeight.w600,
fontSize: 10,
letterSpacing: -0.6,
color: CustomColors.grey,
),
),
mWidth(3),
Text(
projectViewModel.user.patientIdentificationNo,
style: TextStyle(
fontWeight: FontWeight.w600,
fontSize: 12,
letterSpacing: -0.48,
),
),
],
),
Row(
children: [
Text(
TranslationBase.of(context).appointmentNo + ":",
style: TextStyle(
fontWeight: FontWeight.w600,
fontSize: 10,
letterSpacing: -0.6,
color: CustomColors.grey,
),
),
mWidth(3),
Text(
model.ancillaryListsDetails[0].appointmentNo.toString(),
style: TextStyle(
fontWeight: FontWeight.w600,
fontSize: 12,
letterSpacing: -0.48,
),
),
],
),
mWidth(3),
Row(
children: [
Text(
TranslationBase.of(context).orderNo + ":",
style: TextStyle(
fontWeight: FontWeight.w600,
fontSize: 10,
letterSpacing: -0.6,
color: CustomColors.grey,
),
),
mWidth(3),
Text(
model.ancillaryListsDetails[0].ancillaryOrderProcDetailsList[0].orderNo.toString(),
style: TextStyle(
fontWeight: FontWeight.w600,
fontSize: 12,
letterSpacing: -0.48,
),
),
],
),
],
), ),
Row(mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: [ ),
Texts(
TranslationBase.of(context).price,
color: Colors.grey[500],
fontSize: 14,
),
SizedBox(width: 15),
Texts(
TranslationBase.of(context).vat,
color: Colors.grey[500],
fontSize: 14,
),
SizedBox(width: 15),
Texts(
TranslationBase.of(context).total,
color: Colors.grey[500],
fontSize: 14,
),
]),
],
),
Divider(
color: Colors.black26,
), ),
], ),
)); Divider()
],
),
padding: EdgeInsets.only(top: 5.0, bottom: 10.0),
);
} }
Widget getAncillaryDetails(model) { Widget getAncillaryDetails(model) {
Map newMap = groupBy(model.ancillaryListsDetails[0].ancillaryOrderProcDetailsList, (obj) => obj.procedureCategoryName); Map newMap = groupBy(model.ancillaryListsDetails[0].ancillaryOrderProcDetailsList, (obj) => obj.procedureCategoryName);
return Padding(padding: EdgeInsets.only(top: 0, bottom: 200), child: getHeaderDetails(newMap));
return Padding(padding: EdgeInsets.only(top: 10, bottom: 10), child: getHeaderDetails(newMap));
} }
Widget getHeaderDetails(newMap) { Widget getHeaderDetails(newMap) {
List<Widget> list = new List<Widget>(); List<Widget> list = [];
newMap.forEach((key, value) { newMap.forEach((key, value) {
list.add( list.add(
Texts( Container(
key, child: Text(key, style: TextStyle(color: Colors.black, letterSpacing: -0.64, fontSize: 18.0, fontWeight: FontWeight.bold)),
fontWeight: FontWeight.bold, ),
);
list.add(
Container(
decoration: cardRadius(12),
margin: EdgeInsets.only(left: 0, top: 8, right: 0, bottom: 16),
child: Padding(
padding: const EdgeInsets.all(12.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Table(
columnWidths: {
0: FlexColumnWidth(1.0),
1: FlexColumnWidth(2.5),
2: FlexColumnWidth(1.5),
3: FlexColumnWidth(1.5),
4: FlexColumnWidth(1.5),
},
children: fullData(context, value),
),
],
),
),
), ),
); );
list.add(Row(
mainAxisAlignment: MainAxisAlignment.start,
children: [
getLabDetails(value),
],
));
}); });
return Column( return Column(
@ -283,32 +336,196 @@ class _AnicllaryOrdersState extends State<AnicllaryOrdersDetails> with SingleTic
); );
} }
String getTotalValue(value) { String getTotalValue() {
double total = 0.0; double total = 0.0;
value.ancillaryListsDetails[0].ancillaryOrderProcDetailsList.forEach((result) => {total += result.companyShareWithTax}); selectedProcList.forEach((result) => {total += result.patientShareWithTax});
return total.toStringAsFixed(2); return total.toStringAsFixed(2);
} }
getLabDetails(value) { List<TableRow> fullData(context, value) {
return Column( List<TableRow> tableRow = [];
crossAxisAlignment: CrossAxisAlignment.start,
children: value.map<Widget>((result) { tableRow.add(
return Container( TableRow(
width: MediaQuery.of(context).size.width * .9, children: [
padding: EdgeInsets.all(10), Utils.tableColumnTitle(""),
child: Row( Utils.tableColumnTitle(TranslationBase.of(context).procedure),
mainAxisAlignment: MainAxisAlignment.spaceAround, Utils.tableColumnTitle(TranslationBase.of(context).price),
children: [ Utils.tableColumnTitle(TranslationBase.of(context).vat),
Expanded(flex: 3, child: Text(result.procedureName.toString(), overflow: TextOverflow.ellipsis)), Utils.tableColumnTitle(TranslationBase.of(context).total),
Expanded(child: AppText(result.companyShare.toString())), ],
Expanded(child: AppText(result.companyTaxAmount.toString())), ),
Expanded(
child: AppText(
result.companyShareWithTax.toString(),
))
],
));
}).toList(),
); );
for (int i = 0; i < value.length; i++) {
tableRow.add(
TableRow(children: [
Checkbox(
value: checkIfProcedureSelected(value[i]),
onChanged: (v) {
setState(() {
addSelectedProcedure(value[i]);
});
}),
Utils.tableColumnValue('${value[i].procedureName.toString()}', isLast: true),
Utils.tableColumnValue('${value[i].patientShare.toString() + " " + TranslationBase.of(context).sar.toUpperCase()}', isLast: true),
Utils.tableColumnValue('${value[i].patientTaxAmount.toString() + " " + TranslationBase.of(context).sar.toUpperCase()}', isLast: true),
Utils.tableColumnValue('${value[i].patientShareWithTax.toString() + " " + TranslationBase.of(context).sar.toUpperCase()}', isLast: true),
]),
);
}
return tableRow;
}
makePayment() {
showDraggableDialog(context, PaymentMethod(
onSelectedMethod: (String method) {
selectedPaymentMethod = method;
print(selectedPaymentMethod);
openPayment(selectedPaymentMethod, projectViewModel.authenticatedUserObject.user, double.parse(getTotalValue()), null);
},
));
}
openPayment(String paymentMethod, AuthenticatedUser authenticatedUser, double amount, AppoitmentAllHistoryResultList appo) {
browser = new MyInAppBrowser(onExitCallback: onBrowserExit, appo: appo, onLoadStartCallback: onBrowserLoadStart);
transID = Utils.getAdvancePaymentTransID(widget.projectID, projectViewModel.authenticatedUserObject.user.patientID);
browser.openPaymentBrowser(
amount,
"Ancillary Orders Payment",
transID,
widget.projectID.toString(),
projectViewModel.authenticatedUserObject.user.emailAddress,
paymentMethod,
projectViewModel.authenticatedUserObject.user.patientType,
projectViewModel.authenticatedUserObject.user.firstName + " " + projectViewModel.authenticatedUserObject.user.lastName,
projectViewModel.authenticatedUserObject.user.patientID,
authenticatedUser,
browser,
false,
"3",
"");
}
onBrowserLoadStart(String url) {
print("onBrowserLoadStart");
print(url);
MyInAppBrowser.successURLS.forEach((element) {
if (url.contains(element)) {
if (browser.isOpened()) browser.close();
MyInAppBrowser.isPaymentDone = true;
return;
}
});
MyInAppBrowser.errorURLS.forEach((element) {
if (url.contains(element)) {
if (browser.isOpened()) browser.close();
MyInAppBrowser.isPaymentDone = false;
return;
}
});
}
onBrowserExit(AppoitmentAllHistoryResultList appo, bool isPaymentMade) {
print("onBrowserExit Called!!!!");
if (isPaymentMade) checkPaymentStatus(appo);
}
checkPaymentStatus(AppoitmentAllHistoryResultList appo) {
GifLoaderDialogUtils.showMyDialog(AppGlobal.context);
DoctorsListService service = new DoctorsListService();
service.checkPaymentStatus(transID, AppGlobal.context).then((res) {
String paymentInfo = res['Response_Message'];
if (paymentInfo == 'Success') {
createAdvancePayment(res, appo);
} else {
GifLoaderDialogUtils.hideDialog(AppGlobal.context);
AppToast.showErrorToast(message: res['Response_Message']);
}
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(AppGlobal.context);
AppToast.showErrorToast(message: err);
print(err);
});
}
createAdvancePayment(res, AppoitmentAllHistoryResultList appo) {
DoctorsListService service = new DoctorsListService();
String paymentReference = res['Fort_id'].toString();
service.HIS_createAdvancePayment(
appo,
widget.projectID.toString(),
res['Amount'],
res['Fort_id'],
res['PaymentMethod'],
projectViewModel.authenticatedUserObject.user.patientType,
projectViewModel.authenticatedUserObject.user.firstName + " " + projectViewModel.authenticatedUserObject.user.lastName,
projectViewModel.authenticatedUserObject.user.patientID,
AppGlobal.context)
.then((res) {
addAdvancedNumberRequest(res['OnlineCheckInAppointments'][0]['AdvanceNumber'].toString(), paymentReference, 0, appo);
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(AppGlobal.context);
AppToast.showErrorToast(message: err);
print(err);
});
}
addAdvancedNumberRequest(String advanceNumber, String paymentReference, dynamic appointmentID, AppoitmentAllHistoryResultList appo) {
DoctorsListService service = new DoctorsListService();
service.addAdvancedNumberRequest(advanceNumber, paymentReference, appointmentID, AppGlobal.context).then((res) {
print(res);
autoGenerateInvoice();
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(AppGlobal.context);
AppToast.showErrorToast(message: err);
print(err);
});
}
autoGenerateInvoice() {
List<dynamic> selectedProcListAPI = [];
selectedProcList.forEach((element) {
selectedProcListAPI.add({
"ApprovalLineItemNo": element.approvalLineItemNo,
"OrderLineItemNo": element.orderLineItemNo,
"ProcedureID": element.procedureID,
});
});
DoctorsListService service = new DoctorsListService();
service.autoGenerateAncillaryOrdersInvoice(widget.orderNo, widget.projectID, widget.appoNo, selectedProcListAPI, AppGlobal.context).then((res) {
print(res);
GifLoaderDialogUtils.hideDialog(AppGlobal.context);
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(AppGlobal.context);
AppToast.showErrorToast(message: err);
print(err);
});
}
bool checkIfProcedureSelected(AncillaryOrderProcDetailsList ancillaryOrderProcDetailsList) {
if (selectedProcList.length > 0) {
if (selectedProcList.contains(ancillaryOrderProcDetailsList)) {
return true;
} else {
return false;
}
} else {
return false;
}
}
addSelectedProcedure(AncillaryOrderProcDetailsList ancillaryOrderProcDetailsList) {
if (!checkIfProcedureSelected(ancillaryOrderProcDetailsList)) {
selectedProcList.add(ancillaryOrderProcDetailsList);
} else {
selectedProcList.remove(ancillaryOrderProcDetailsList);
}
} }
} }

@ -122,7 +122,6 @@ class FatResult extends StatelessWidget {
service.getCalculationDoctors(calculationID: 5).then((res) { service.getCalculationDoctors(calculationID: 5).then((res) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
print(res['List_CalculationTable'].length);
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
if (res['List_CalculationTable'].length != 0) { if (res['List_CalculationTable'].length != 0) {
res['List_CalculationTable'].forEach((item) { res['List_CalculationTable'].forEach((item) {

@ -142,7 +142,6 @@ class CarbsResult extends StatelessWidget {
service.getCalculationDoctors(calculationID: 11).then((res) { service.getCalculationDoctors(calculationID: 11).then((res) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
print(res['List_CalculationTable'].length);
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
if (res['List_CalculationTable'].length != 0) { if (res['List_CalculationTable'].length != 0) {
res['List_CalculationTable'].forEach((item) { res['List_CalculationTable'].forEach((item) {

@ -250,16 +250,7 @@ class _IdealBodyState extends State<IdealBody> {
color: CustomColors.accentColor, color: CustomColors.accentColor,
onTap: () { onTap: () {
setState(() { setState(() {
// calculateBmr();
// calculateCalories();
calculateIdealWeight(); calculateIdealWeight();
print(idealWeight);
print(minRange);
print(maxRange);
print(overWeightBy);
print(textResult);
//print(overWeightBy);
{ {
Navigator.push( Navigator.push(
context, context,

@ -270,7 +270,6 @@ class _BookConfirmState extends State<BookConfirm> {
widget.service.insertAppointment(docObject.doctorID, docObject.clinicID, docObject.projectID, widget.selectedTime, widget.selectedDate, context).then((res) { widget.service.insertAppointment(docObject.doctorID, docObject.clinicID, docObject.projectID, widget.selectedTime, widget.selectedDate, context).then((res) {
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
AppToast.showSuccessToast(message: TranslationBase.of(context).bookedSuccess); AppToast.showSuccessToast(message: TranslationBase.of(context).bookedSuccess);
print(res['AppointmentNo']);
Future.delayed(new Duration(milliseconds: 500), () { Future.delayed(new Duration(milliseconds: 500), () {
getPatientShare(context, res['AppointmentNo'], docObject.clinicID, docObject.projectID, docObject); getPatientShare(context, res['AppointmentNo'], docObject.clinicID, docObject.projectID, docObject);

@ -200,7 +200,6 @@ class _DentalComplaintsState extends State<DentalComplaints> {
service.getDoctorsList(int.parse("17"), widget.searchInfo.ProjectID, false, context, isContinueDentalPlan: true).then((res) { service.getDoctorsList(int.parse("17"), widget.searchInfo.ProjectID, false, context, isContinueDentalPlan: true).then((res) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
print(res['List_IsPatientHasOnGoingEstimation']);
dentalProceduresModel = DentalProceduresModel.fromJson(res); dentalProceduresModel = DentalProceduresModel.fromJson(res);
dentalProceduresModel.listIsPatientHasOnGoingEstimation.forEach((procedure) { dentalProceduresModel.listIsPatientHasOnGoingEstimation.forEach((procedure) {
appoTime += procedure.neededTime; appoTime += procedure.neededTime;
@ -251,7 +250,6 @@ class _DentalComplaintsState extends State<DentalComplaints> {
res['List_DentalChiefComplain'].forEach((v) { res['List_DentalChiefComplain'].forEach((v) {
complaintsList.add(new ListDentalChiefComplain.fromJson(v)); complaintsList.add(new ListDentalChiefComplain.fromJson(v));
}); });
print(complaintsList.length);
}); });
} else {} } else {}
}).catchError((err) { }).catchError((err) {

@ -148,13 +148,12 @@ class _DoctorProfileState extends State<DoctorProfile> with TickerProviderStateM
onTap: (index) { onTap: (index) {
setState(() { setState(() {
if (index == 1) { if (index == 1) {
if (widget.doctor.clinicID == 17 || widget.doctor.clinicID == 23 || widget.doctor.clinicID == 47 || widget.isLiveCareAppointment) { // if (widget.doctor.clinicID == 17 || widget.doctor.clinicID == 23 || widget.doctor.clinicID == 47 || widget.isLiveCareAppointment) {
_tabController.index = _tabController.previousIndex; // _tabController.index = _tabController.previousIndex;
showFooterButton = false; showFooterButton = false;
} else { } else {
showFooterButton = true; showFooterButton = true;
} }
}
print(showFooterButton); print(showFooterButton);
}); });
}, },

@ -43,8 +43,12 @@ class _QRCodeState extends State<QRCode> {
_bytes = base64.decode(widget.appoQR.split(',').last); _bytes = base64.decode(widget.appoQR.split(',').last);
widget.authUser = new AuthenticatedUser(); widget.authUser = new AuthenticatedUser();
FlutterNfcKit.nfcAvailability.then((value) { WidgetsBinding.instance.addPostFrameCallback((timeStamp) {
_supportsNFC = (value == NFCAvailability.available); FlutterNfcKit.nfcAvailability.then((value) {
setState(() {
_supportsNFC = (value == NFCAvailability.available);
});
});
}); });
super.initState(); super.initState();
@ -69,36 +73,37 @@ class _QRCodeState extends State<QRCode> {
height: MediaQuery.of(context).size.width / 3, height: MediaQuery.of(context).size.width / 3,
child: Row( child: Row(
children: [ children: [
_supportsNFC // _supportsNFC
? Expanded( // ?
flex: 1, Expanded(
child: Row( flex: 1,
crossAxisAlignment: CrossAxisAlignment.center, child: Row(
mainAxisAlignment: MainAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ mainAxisAlignment: MainAxisAlignment.center,
InkWell( children: [
child: Container( InkWell(
margin: EdgeInsets.only(top: 30.0), child: Container(
alignment: Alignment.center, margin: EdgeInsets.only(top: 30.0),
padding: EdgeInsets.all(8), alignment: Alignment.center,
decoration: BoxDecoration( padding: EdgeInsets.all(8),
border: Border.all(color: Colors.black), decoration: BoxDecoration(
borderRadius: BorderRadius.circular(10), border: Border.all(color: Colors.black),
), borderRadius: BorderRadius.circular(10),
child: Image.asset("assets/images/nfc/ic_nfc.png"), ),
), child: Image.asset("assets/images/nfc/ic_nfc.png"),
onTap: () {
showNfcReader(context, onNcfScan: (String nfcId) {
Future.delayed(const Duration(milliseconds: 100), () {
sendNfcCheckInRequest(nfcId);
});
});
},
),
],
), ),
) onTap: () {
: Container(), showNfcReader(context, onNcfScan: (String nfcId) {
Future.delayed(const Duration(milliseconds: 100), () {
sendNfcCheckInRequest(nfcId);
});
});
},
),
],
),
),
// : Container(),
Expanded( Expanded(
flex: 1, flex: 1,
child: Container( child: Container(

@ -52,7 +52,7 @@ class _SearchResultsState extends State<SearchResults> {
//widget.patientDoctorAppointmentListHospital[index].patientDoctorAppointmentList[_index].speciality = null; //widget.patientDoctorAppointmentListHospital[index].patientDoctorAppointmentList[_index].speciality = null;
return DoctorView( return DoctorView(
doctor: widget.patientDoctorAppointmentListHospital[index].patientDoctorAppointmentList[_index], doctor: widget.patientDoctorAppointmentListHospital[index].patientDoctorAppointmentList[_index],
isLiveCareAppointment: widget.isLiveCareAppointment, isLiveCareAppointment: widget.isLiveCareAppointment ?? widget.patientDoctorAppointmentListHospital[index].patientDoctorAppointmentList[_index].isLiveCare,
); );
}, },
separatorBuilder: (context, index) => SizedBox(height: 14), separatorBuilder: (context, index) => SizedBox(height: 14),

@ -238,6 +238,7 @@ class _DocAvailableAppointmentsState extends State<DocAvailableAppointments> wit
}); });
openTimeSlotsPickerForDate(DateUtil.convertStringToDate(selectedDateJSON), docFreeSlots); openTimeSlotsPickerForDate(DateUtil.convertStringToDate(selectedDateJSON), docFreeSlots);
_calendarController.selectedDate = DateUtil.convertStringToDate(selectedDateJSON); _calendarController.selectedDate = DateUtil.convertStringToDate(selectedDateJSON);
_calendarController.displayDate = _calendarController.selectedDate;
return _eventsParsed; return _eventsParsed;
} }

@ -196,7 +196,6 @@ class _SearchByClinicState extends State<SearchByClinic> {
onChanged: (bool value) { onChanged: (bool value) {
setState(() { setState(() {
nearestAppo = value; nearestAppo = value;
print(nearestAppo);
if (nearestAppo) if (nearestAppo)
getProjectsList(); getProjectsList();
else else
@ -231,7 +230,6 @@ class _SearchByClinicState extends State<SearchByClinic> {
showClickListDialog(context, clinicsList, onSelection: (ListClinicCentralized clincs) { showClickListDialog(context, clinicsList, onSelection: (ListClinicCentralized clincs) {
Navigator.pop(context); Navigator.pop(context);
setState(() { setState(() {
print(clincs.clinicID.toString() + "-" + clincs.isLiveCareClinicAndOnline.toString() + "-" + clincs.liveCareClinicID.toString() + "-" + clincs.liveCareServiceID.toString());
dropdownTitle = clincs.clinicDescription; dropdownTitle = clincs.clinicDescription;
dropdownValue = dropdownValue =
clincs.clinicID.toString() + "-" + clincs.isLiveCareClinicAndOnline.toString() + "-" + clincs.liveCareClinicID.toString() + "-" + clincs.liveCareServiceID.toString(); clincs.clinicID.toString() + "-" + clincs.isLiveCareClinicAndOnline.toString() + "-" + clincs.liveCareClinicID.toString() + "-" + clincs.liveCareServiceID.toString();
@ -241,7 +239,6 @@ class _SearchByClinicState extends State<SearchByClinic> {
projectDropdownValue = ""; projectDropdownValue = "";
getDoctorsList(context); getDoctorsList(context);
} else { } else {
print("Dental");
} }
}); });
}); });
@ -534,7 +531,6 @@ class _SearchByClinicState extends State<SearchByClinic> {
), ),
).then((value) { ).then((value) {
setState(() { setState(() {
print(value);
if (value == "false") dropdownValue = null; if (value == "false") dropdownValue = null;
}); });
if (value == "livecare") { if (value == "livecare") {

@ -27,7 +27,7 @@ class TestPageState extends State<TestPage>{
void location(){ void location(){
LocationUtils().getCurrentLocation(callBack: (latLng){ LocationUtils().getCurrentLocation(callBack: (latLng){
debugPrint(latLng.toString()); print(latLng.toString());
}); });
} }

@ -243,205 +243,6 @@ class _ToDoState extends State<ToDo> {
], ],
), ),
); );
// return Container(
// margin: EdgeInsets.all(10.0),
// child: Column(
// crossAxisAlignment: CrossAxisAlignment.start,
// children: [
// Container(
// child: Card(
// margin: EdgeInsets.fromLTRB(8.0, 0.0, 8.0, 8.0),
// color: Colors.white,
// shape: RoundedRectangleBorder(
// borderRadius: BorderRadius.circular(10),
// ),
// child: Container(
// width: MediaQuery.of(context).size.width,
// padding: EdgeInsets.all(10.0),
// child: Column(
// crossAxisAlignment: CrossAxisAlignment.start,
// mainAxisSize: MainAxisSize.max,
// children: <Widget>[
// Row(
// children: <Widget>[
// Image.asset("assets/images/new-design/time_icon.png", width: 20.0, height: 20.0),
// Container(
// width: MediaQuery.of(context).size.width * 0.4,
// margin: EdgeInsets.only(left: 10.0, right: 10.0),
// child: Text(
// DateUtil.getWeekDayMonthDayYearDateFormatted(
// DateUtil.convertStringToDate(widget.appoList[index].appointmentDate), projectViewModel.isArabic ? "ar" : "en") +
// " " +
// widget.appoList[index].startTime.substring(0, 5),
// overflow: TextOverflow.clip,
// style: TextStyle(fontSize: 10.0)),
// ),
// !widget.appoList[index].isLiveCareAppointment ? Image.asset("assets/images/new-design/hospital_address_icon.png", width: 20.0, height: 20.0) : Container(),
// Container(
// margin: EdgeInsets.only(left: 5.0, right: 5.0),
// child: widget.appoList[index].isLiveCareAppointment
// ? Container()
// : Text(widget.appoList[index].projectName != null ? widget.appoList[index].projectName : "-",
// overflow: TextOverflow.clip, maxLines: 2, style: TextStyle(fontSize: 10.0)),
// ),
// ],
// ),
// Container(
// margin: EdgeInsets.only(top: 5.0),
// child: Divider(
// color: Colors.grey[500],
// ),
// ),
// Flex(
// direction: Axis.horizontal,
// children: <Widget>[
// Expanded(
// flex: 1,
// child: Container(
// height: MediaQuery.of(context).size.height * 0.1,
// margin: EdgeInsets.only(top: 5.0),
// child: ClipRRect(
// borderRadius: BorderRadius.circular(100.0),
// child: Image.network(widget.appoList[index].doctorImageURL, fit: BoxFit.fill),
// ),
// ),
// ),
// Expanded(
// flex: 3,
// child: Container(
// margin: EdgeInsets.only(top: 10.0, left: 20.0, right: 20.0),
// child: Column(
// crossAxisAlignment: CrossAxisAlignment.start,
// children: <Widget>[
// Text(widget.appoList[index].doctorTitle + " " + widget.appoList[index].doctorNameObj,
// style: TextStyle(fontSize: 14.0, color: Colors.black, fontWeight: FontWeight.bold, letterSpacing: -0.64)),
// if (getDoctorSpeciality(widget.appoList[index].doctorSpeciality) != "null\n")
// Container(
// margin: EdgeInsets.only(top: 3.0, bottom: 3.0),
// child: Text(getDoctorSpeciality(widget.appoList[index].doctorSpeciality).trim(),
// style: TextStyle(fontSize: 12.0, color: Colors.grey[600], letterSpacing: -0.64)),
// ),
// Row(
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
// mainAxisSize: MainAxisSize.max,
// children: <Widget>[
// RatingBar.readOnly(
// initialRating: widget.appoList[index].actualDoctorRate.toDouble(),
// size: 20.0,
// filledColor: Colors.yellow[700],
// emptyColor: Colors.grey[500],
// isHalfAllowed: true,
// halfFilledIcon: Icons.star_half,
// filledIcon: Icons.star,
// emptyIcon: Icons.star,
// ),
// ],
// ),
// Container(
// child: CountdownTimer(
// controller:
// new CountdownTimerController(endTime: DateTime.now().millisecondsSinceEpoch + (widget.appoList[index].remaniningHoursTocanPay * 1000) * 60),
// widgetBuilder: (_, CurrentRemainingTime time) {
// return time != null
// ? Text(
// '${time.days != null ? time.days : "0"}:${time.hours != null ? time.hours.toString().length == 1 ? "0" + time.hours.toString() : time.hours : "00"}:${time.min}:${time.sec} ' +
// TranslationBase.of(context).upcomingTimeLeft,
// style: TextStyle(fontSize: 12.0, color: Color(0xffC5272D)))
// : Container();
// },
// ),
// ),
// ],
// ),
// ),
// ),
// Expanded(
// flex: 1,
// child: InkWell(
// onTap: () => performNextAction(widget.appoList[index]),
// child: Container(
// margin: EdgeInsets.only(top: 20.0),
// child: Column(
// children: <Widget>[
// Image.asset(getNextActionImage(widget.appoList[index].nextAction), width: 50.0, height: 50.0),
// Container(
// margin: EdgeInsets.only(top: 5.0),
// child: Text(getNextActionText(widget.appoList[index].nextAction), textAlign: TextAlign.center, style: TextStyle(fontSize: 12.0)),
// )
// ],
// ),
// ),
// ),
// )
// ],
// ),
// Divider(
// color: Colors.grey[500],
// ),
// Flex(
// direction: Axis.horizontal,
// children: <Widget>[
// Expanded(
// flex: 2,
// child: Container(
// child: Text(getNextActionDescription(widget.appoList[index].nextAction), style: TextStyle(fontSize: 11.0, color: Colors.grey[700])),
// ),
// ),
// Expanded(
// flex: 1,
// child: GestureDetector(
// onTap: () {
// navigateToAppointmentDetails(context, widget.appoList[index]);
// },
// child: Container(
// child: Text(TranslationBase.of(context).upcomingDetails,
// textAlign: TextAlign.end, style: TextStyle(fontSize: 11.0, color: new Color(0xffC5272D), decoration: TextDecoration.underline)),
// ),
// ),
// )
// ],
// ),
// ],
// ),
// ),
// ),
// ),
// Container(
// decoration: BoxDecoration(
// borderRadius: BorderRadius.only(bottomLeft: Radius.circular(10.0), bottomRight: Radius.circular(10.0)),
// color: Color(0xff20bc44),
// ),
// height: 30.0,
// padding: EdgeInsets.only(right: 10, left: 10),
// margin: EdgeInsets.symmetric(horizontal: 20),
// transform: Matrix4.translationValues(0.0, -8.0, 0.0),
// child: Row(
// mainAxisSize: MainAxisSize.min,
// mainAxisAlignment: MainAxisAlignment.start,
// children: [
// widget.appoList[index].clinicID == 265
// ? Container(
// margin: EdgeInsets.only(left: 5.0, right: 5.0),
// child: SvgPicture.asset(
// "assets/images/new/car_icon.svg",
// height: 15,
// width: 15,
// ),
// )
// : widget.appoList[index].isLiveCareAppointment
// ? Image.asset("assets/images/new-design/video.png")
// : Image.asset("assets/images/new-design/walkin.png"),
// widget.appoList[index].clinicID == 265
// ? Text(TranslationBase.of(context).drivethruAppo, style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold, fontSize: 11.0))
// : widget.appoList[index].isLiveCareAppointment
// ? Text(TranslationBase.of(context).videoAppo, style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold, fontSize: 11.0))
// : Text(TranslationBase.of(context).walkinAppo, style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold, fontSize: 11.0))
// ],
// ),
// ),
// ],
// ),
// );
}, },
), ),
), ),
@ -736,7 +537,6 @@ class _ToDoState extends State<ToDo> {
getLiveCareAppointmentPatientShare(context, DoctorsListService service, AppoitmentAllHistoryResultList appo) { getLiveCareAppointmentPatientShare(context, DoctorsListService service, AppoitmentAllHistoryResultList appo) {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
service.getLiveCareAppointmentPatientShare(appo.appointmentNo.toString(), appo.clinicID, appo.projectID, context).then((res) { service.getLiveCareAppointmentPatientShare(appo.appointmentNo.toString(), appo.clinicID, appo.projectID, context).then((res) {
print(res);
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
widget.patientShareResponse = new PatientShareResponse.fromJson(res); widget.patientShareResponse = new PatientShareResponse.fromJson(res);
openPaymentDialog(appo, widget.patientShareResponse); openPaymentDialog(appo, widget.patientShareResponse);
@ -801,7 +601,6 @@ class _ToDoState extends State<ToDo> {
context: context, context: context,
pageBuilder: (context, animation1, animation2) {}) pageBuilder: (context, animation1, animation2) {})
.then((value) { .then((value) {
print(value);
if (value != null) { if (value != null) {
navigateToPaymentMethod(context, value, appo); navigateToPaymentMethod(context, value, appo);
@ -882,7 +681,6 @@ class _ToDoState extends State<ToDo> {
String paymentReference = res['Fort_id'].toString(); String paymentReference = res['Fort_id'].toString();
service.createAdvancePayment(appo, appo.projectID.toString(), res['Amount'], res['Fort_id'], res['PaymentMethod'], context).then((res) { service.createAdvancePayment(appo, appo.projectID.toString(), res['Amount'], res['Fort_id'], res['PaymentMethod'], context).then((res) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
print(res['OnlineCheckInAppointments'][0]);
addAdvancedNumberRequest(res['OnlineCheckInAppointments'][0]['AdvanceNumber'].toString(), paymentReference, appo.appointmentNo.toString(), appo, res['OnlineCheckInAppointments'][0]); addAdvancedNumberRequest(res['OnlineCheckInAppointments'][0]['AdvanceNumber'].toString(), paymentReference, appo.appointmentNo.toString(), appo, res['OnlineCheckInAppointments'][0]);
}).catchError((err) { }).catchError((err) {
print(err); print(err);
@ -917,26 +715,7 @@ class _ToDoState extends State<ToDo> {
}); });
} }
// getPatientData() async {
// AppSharedPreferences sharedPref = AppSharedPreferences();
// if (await sharedPref.getObject(USER_PROFILE) != null) {
// var data = AuthenticatedUser.fromJson(await sharedPref.getObject(USER_PROFILE));
// setState(() {
// print(data);
// authUser = data;
// });
// getPatientAppointmentHistory();
// }
// }
Future navigateToPaymentMethod(context, PatientShareResponse patientShareResponse, AppoitmentAllHistoryResultList appo) async { Future navigateToPaymentMethod(context, PatientShareResponse patientShareResponse, AppoitmentAllHistoryResultList appo) async {
// if (await this.sharedPref.getObject(USER_PROFILE) != null) {
// var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE));
// setState(() {
// authUser = data;
// });
// }
Navigator.push(context, FadePage(page: PaymentMethod(onSelectedMethod: (String metohd) { Navigator.push(context, FadePage(page: PaymentMethod(onSelectedMethod: (String metohd) {
setState(() {}); setState(() {});
}))).then((value) { }))).then((value) {

@ -421,7 +421,7 @@ class _FinalProductsPageState extends State<FinalProductsPage> {
Column( Column(
children: [ children: [
Container( Container(
width: model.finalProducts[index].rxMessage != null ? MediaQuery.of(context).size.width / 4.3 : 0, width: model.finalProducts[index].rxMessage != null ? MediaQuery.of(context).size.width / 3.70 : 0,
padding: EdgeInsets.all(4), padding: EdgeInsets.all(4),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Color(0xffb23838), color: Color(0xffb23838),
@ -462,7 +462,7 @@ class _FinalProductsPageState extends State<FinalProductsPage> {
height: 4.0, height: 4.0,
), ),
Container( Container(
width: MediaQuery.of(context).size.width * 0.64, width: MediaQuery.of(context).size.width * 0.55,
child: Texts(projectViewModel.isArabic ? model.finalProducts[index].namen : model.finalProducts[index].name, child: Texts(projectViewModel.isArabic ? model.finalProducts[index].namen : model.finalProducts[index].name,
// model.finalProducts[index].name, // model.finalProducts[index].name,
regular: true, regular: true,

@ -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,25 +10,20 @@ 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/pages/packages_offers/packages_offers_tab_pager.dart'; import 'package:diplomaticquarterapp/pages/packages_offers/packages_offers_tab_pager.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;
@ -287,148 +283,164 @@ class _HomePageFragment2State extends State<HomePageFragment2> {
AuthenticatedUser user = projectViewModel.user; AuthenticatedUser user = projectViewModel.user;
Navigator.of(context).push(MaterialPageRoute(builder: (context) => PackagesOfferTabPage(user))); Navigator.of(context).push(MaterialPageRoute(builder: (context) => PackagesOfferTabPage(user)));
}, },
child: Container( child: Stack(
width: double.infinity, children: [
height: double.infinity, Container(
clipBehavior: Clip.antiAlias, width: double.infinity,
decoration: containerRadiusWithGradientServices(20, lightColor: CustomColors.lightGreyColor, darkColor: CustomColors.lightGreyColor), height: double.infinity,
child: Stack( clipBehavior: Clip.antiAlias,
children: [ decoration: containerRadiusWithGradientServices(20, lightColor: CustomColors.lightGreyColor, darkColor: CustomColors.lightGreyColor),
Container( child: Stack(
width: double.infinity, children: [
height: double.infinity, Container(
// color: Color(0xFF2B353E), width: double.infinity,
decoration: containerRadius(Color(0xFF2B353E), 20), height: double.infinity,
), // color: Color(0xFF2B353E),
Container( decoration: containerRadius(Color(0xFF2B353E), 20),
width: double.infinity, ),
height: double.infinity, Container(
clipBehavior: Clip.antiAlias, width: double.infinity,
decoration: projectViewModel.isArabic height: double.infinity,
? containerBottomRightRadiusWithGradientForAr(60, lightColor: CustomColors.lightGreyColor, darkColor: CustomColors.lightGreyColor) clipBehavior: Clip.antiAlias,
: containerBottomRightRadiusWithGradient(60, lightColor: CustomColors.lightGreyColor, darkColor: CustomColors.lightGreyColor), decoration: projectViewModel.isArabic
child: Stack( ? containerBottomRightRadiusWithGradientForAr(60, lightColor: CustomColors.lightGreyColor, darkColor: CustomColors.lightGreyColor)
children: [ : containerBottomRightRadiusWithGradient(60, lightColor: CustomColors.lightGreyColor, darkColor: CustomColors.lightGreyColor),
SvgPicture.asset( child: Stack(
"assets/images/new/strips.svg", children: [
width: double.infinity, SvgPicture.asset(
height: double.infinity, "assets/images/new/strips.svg",
fit: BoxFit.cover, width: double.infinity,
), height: double.infinity,
], fit: BoxFit.cover,
),
),
projectViewModel.isArabic
? Positioned(
left: 20,
top: 12,
child: Opacity(
opacity: 0.04,
child: SvgPicture.asset(
"assets/images/new/logo.svg",
height: MediaQuery.of(context).size.width * 0.14,
),
),
)
: Positioned(
right: 20,
top: 12,
child: Opacity(
opacity: 0.04,
child: SvgPicture.asset(
"assets/images/new/logo.svg",
height: MediaQuery.of(context).size.width * 0.14,
), ),
), ],
), ),
projectViewModel.isArabic ),
? Positioned( projectViewModel.isArabic
right: -16, ? Positioned(
top: 2, left: 20,
child: Transform.rotate( top: 12,
angle: math.pi / 4, child: Opacity(
child: Container( opacity: 0.04,
padding: EdgeInsets.only(left: 18, right: 18, top: 6, bottom: 3), child: SvgPicture.asset(
color: CustomColors.accentColor, "assets/images/new/logo.svg",
child: Text( height: MediaQuery.of(context).size.width * 0.14,
TranslationBase.of(context).newDes, ),
style: TextStyle( ),
color: Colors.white, )
fontSize: 9, : Positioned(
height: 0.8, right: 20,
letterSpacing: -0.27, top: 12,
child: Opacity(
opacity: 0.04,
child: SvgPicture.asset(
"assets/images/new/logo.svg",
height: MediaQuery.of(context).size.width * 0.14,
), ),
), ),
), ),
), projectViewModel.isArabic
) ? Positioned(
: Positioned( right: -16,
left: -16, top: 2,
top: 2, child: Transform.rotate(
child: Transform.rotate( angle: math.pi / 4,
angle: -math.pi / 4, child: Container(
child: Container( padding: EdgeInsets.only(left: 18, right: 18, top: 6, bottom: 3),
padding: EdgeInsets.only(left: 18, right: 18, top: 6, bottom: 3), color: CustomColors.accentColor,
color: CustomColors.accentColor, child: Text(
child: Text( TranslationBase.of(context).newDes,
TranslationBase.of(context).newDes, style: TextStyle(
style: TextStyle( color: Colors.white,
color: Colors.white, fontSize: 9,
fontSize: 9, height: 0.8,
letterSpacing: -0.27, letterSpacing: -0.27,
height: 1.2, ),
),
),
),
)
: Positioned(
left: -16,
top: 2,
child: Transform.rotate(
angle: -math.pi / 4,
child: Container(
padding: EdgeInsets.only(left: 18, right: 18, top: 6, bottom: 3),
color: CustomColors.accentColor,
child: Text(
TranslationBase.of(context).newDes,
style: TextStyle(
color: Colors.white,
fontSize: 9,
letterSpacing: -0.27,
height: 1.2,
),
),
), ),
), ),
), ),
), Container(
), width: double.infinity,
Container( height: double.infinity,
width: double.infinity, padding: EdgeInsets.only(left: projectViewModel.isArabic ? 20 : 25, right: projectViewModel.isArabic ? 25 : 20),
height: double.infinity, child: Column(
padding: EdgeInsets.only(left: projectViewModel.isArabic ? 20 : 25, right: projectViewModel.isArabic ? 25 : 20), crossAxisAlignment: CrossAxisAlignment.start,
child: Column( mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.center,
children: [
mFlex(3),
AutoSizeText(
TranslationBase.of(context).offersdiscount,
maxLines: 1,
style: TextStyle(
color: Colors.black,
fontSize: 14,
fontWeight: FontWeight.bold,
letterSpacing: -0.75,
height: 1,
),
),
projectViewModel.isArabic ? mHeight(4) : Container(),
Text(
TranslationBase.of(context).explore,
style: TextStyle(
color: Colors.black,
fontSize: 9,
fontWeight: FontWeight.w600,
letterSpacing: -0.27,
height: projectViewModel.isArabic ? 0.8 : 1,
),
),
mFlex(1),
Row(
children: [ children: [
showFloating("assets/images/new/ear.svg"), mFlex(3),
mWidth(4), AutoSizeText(
showFloating("assets/images/new/head.svg"), TranslationBase.of(context).offersdiscount,
mWidth(4), maxLines: 1,
showFloating("assets/images/new/tooth.svg"), style: TextStyle(
color: Colors.black,
fontSize: 14,
fontWeight: FontWeight.bold,
letterSpacing: -0.75,
height: 1,
),
),
projectViewModel.isArabic ? mHeight(4) : Container(),
Text(
TranslationBase.of(context).explore,
style: TextStyle(
color: Colors.black,
fontSize: 9,
fontWeight: FontWeight.w600,
letterSpacing: -0.27,
height: projectViewModel.isArabic ? 0.8 : 1,
),
),
mFlex(1),
Row(
children: [
showFloating("assets/images/new/ear.svg"),
mWidth(4),
showFloating("assets/images/new/head.svg"),
mWidth(4),
showFloating("assets/images/new/tooth.svg"),
],
),
mFlex(2)
], ],
), ),
mFlex(2) ),
], ],
),
), ),
], ),
), // 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,
// ),
// )
],
), ),
), ),
); );

@ -76,7 +76,7 @@ class _LandingPagePharmacyState extends State<LandingPagePharmacy> {
children: [ children: [
PharmacyPage(), PharmacyPage(),
PharmacyCategorisePage(), PharmacyCategorisePage(),
PharmacyProfilePage(moveToOrder: false), PharmacyProfilePage(moveToOrder: false, changeTab: changeCurrentTab),
CartOrderPage(changeTab: changeCurrentTab), CartOrderPage(changeTab: changeCurrentTab),
], ],
), ),

@ -139,7 +139,6 @@ class _LiveCareHomeState extends State<LiveCareHome> with SingleTickerProviderSt
service.getLivecareHistory(context).then((res) { service.getLivecareHistory(context).then((res) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
setState(() { setState(() {
print(res['ErRequestHistoryList'].length);
if (res['ErRequestHistoryList'].length != 0) { if (res['ErRequestHistoryList'].length != 0) {
patientERVirtualHistoryResponse = PatientERVirtualHistoryResponse.fromJson(res); patientERVirtualHistoryResponse = PatientERVirtualHistoryResponse.fromJson(res);
erRequestHistoryList = patientERVirtualHistoryResponse.erRequestHistoryList; erRequestHistoryList = patientERVirtualHistoryResponse.erRequestHistoryList;

@ -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';
@ -259,7 +257,6 @@ class _Login extends State<Login> {
authService authService
.checkPatientAuthentication(request) .checkPatientAuthentication(request)
.then((value) => { .then((value) => {
//showLoader(false),
if (value['isSMSSent']) if (value['isSMSSent'])
{ {
sharedPref.setString(LOGIN_TOKEN_ID, value['LogInTokenID']), sharedPref.setString(LOGIN_TOKEN_ID, value['LogInTokenID']),
@ -286,17 +283,11 @@ class _Login extends State<Login> {
cancelFunction: () => {}); cancelFunction: () => {});
dialog.showAlertDialog(context); dialog.showAlertDialog(context);
}); });
// SMSOTP.showLoadingDialog(context, false),
} }
checkActivationCode({code}) async { checkActivationCode({code}) async {
Map<String, dynamic> request = {}; Map<String, dynamic> request = {};
// request.logInTokenID = await sharedPref.getString(LOGIN_TOKEN_ID); if (code == null) request['PatientMobileNumber'] = int.parse(mobileNo);
// request.activationCode = code ?? "0000";
// request.isSilentLogin = code != null ? false : true;
if (code == null)
//showLoader(true);
request['PatientMobileNumber'] = int.parse(mobileNo);
request['ZipCode'] = countryCode; request['ZipCode'] = countryCode;
request['SearchType'] = loginType; request['SearchType'] = loginType;
request['LoginType'] = loginType; request['LoginType'] = loginType;
@ -307,15 +298,13 @@ class _Login extends State<Login> {
request['PatientIdentificationID'] = ''; request['PatientIdentificationID'] = '';
request['PatientID'] = int.parse(nationalIDorFile.text); request['PatientID'] = int.parse(nationalIDorFile.text);
} }
// request.isRegister = false;
this.authService.checkActivationCode(request, code).then((result) async { this.authService.checkActivationCode(request, code).then((result) async {
sharedPref.remove(FAMILY_FILE); sharedPref.remove(FAMILY_FILE);
// Register GeoZones after login
registerGeoZones(); registerGeoZones();
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);
@ -325,15 +314,8 @@ class _Login extends State<Login> {
appointmentRateViewModel.isLogin = true; appointmentRateViewModel.isLogin = true;
projectViewModel.isLogin = true; projectViewModel.isLogin = true;
authenticatedUserObject.user = result.list; authenticatedUserObject.user = result.list;
// authenticatedUserObject.user.cRSVerificationStatus =
// result['CRSVerificationStatus'];
projectViewModel.user = authenticatedUserObject.user; projectViewModel.user = authenticatedUserObject.user;
//await familyFileProvider.getSharedRecordByStatus();
// await pharmacyModuleViewModel.generatePharmacyToken().then((value) async {
// if (pharmacyModuleViewModel.error.isNotEmpty) await pharmacyModuleViewModel.createUser();
// });
appointmentRateViewModel appointmentRateViewModel
.getIsLastAppointmentRatedList() .getIsLastAppointmentRatedList()
.then((value) => { .then((value) => {

@ -297,8 +297,6 @@ class _ConfirmPaymentPageState extends State<ConfirmPaymentPage> {
GifLoaderDialogUtils.showMyDialog(AppGlobal.context); GifLoaderDialogUtils.showMyDialog(AppGlobal.context);
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
service.checkPaymentStatus(transID, AppGlobal.context).then((res) { service.checkPaymentStatus(transID, AppGlobal.context).then((res) {
print("Printing Payment Status Reponse!!!!");
print(res);
String paymentInfo = res['Response_Message']; String paymentInfo = res['Response_Message'];
if (paymentInfo == 'Success') { if (paymentInfo == 'Success') {
createAdvancePayment(res, appo); createAdvancePayment(res, appo);
@ -327,7 +325,6 @@ class _ConfirmPaymentPageState extends State<ConfirmPaymentPage> {
widget.advanceModel.fileNumber, widget.advanceModel.fileNumber,
AppGlobal.context) AppGlobal.context)
.then((res) { .then((res) {
print(res['OnlineCheckInAppointments'][0]['AdvanceNumber']);
addAdvancedNumberRequest( addAdvancedNumberRequest(
res['OnlineCheckInAppointments'][0]['AdvanceNumber'].toString(), res['OnlineCheckInAppointments'][0]['AdvanceNumber'].toString(),
paymentReference, paymentReference,

@ -283,7 +283,6 @@ class _PassportUpdatePageState extends State<PassportUpdatePage> {
service.getCovidPassportNumber().then((res) { service.getCovidPassportNumber().then((res) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
print(res['Covid19_Certificate_GetPassportList'][0]['PassportNo']);
passportNumber.text = res['Covid19_Certificate_GetPassportList'][0]['PassportNo']; passportNumber.text = res['Covid19_Certificate_GetPassportList'][0]['PassportNo'];
if (res['Covid19_Certificate_GetPassportList'][0]['PassportNo'] != "") { if (res['Covid19_Certificate_GetPassportList'][0]['PassportNo'] != "") {
_isButtonDisabled = false; _isButtonDisabled = false;

@ -30,7 +30,6 @@ class _MedicalProfilePageState extends State<MedicalProfilePageNew> {
projectViewModel = Provider.of(context); projectViewModel = Provider.of(context);
var appoCountProvider = Provider.of<ToDoCountProviderModel>(context); var appoCountProvider = Provider.of<ToDoCountProviderModel>(context);
List<Widget> myMedicalList = Utils.myMedicalList(projectViewModel: projectViewModel, context: context, count: appoCountProvider.count, isLogin: projectViewModel.isLogin); List<Widget> myMedicalList = Utils.myMedicalList(projectViewModel: projectViewModel, context: context, count: appoCountProvider.count, isLogin: projectViewModel.isLogin);
print(myMedicalList);
return BaseView<MedicalViewModel>( return BaseView<MedicalViewModel>(
onModelReady: (model) => model.getAppointmentHistory(), onModelReady: (model) => model.getAppointmentHistory(),
builder: (_, model, widget1) => AppScaffold( builder: (_, model, widget1) => AppScaffold(
@ -47,25 +46,6 @@ class _MedicalProfilePageState extends State<MedicalProfilePageNew> {
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
// Container(
// width: double.infinity,
// height: 210,
// decoration: containerBottomRightRadiusWithGradientBorder(0, darkColor: Color(0xFFF2B353E), lightColor: Color(0xFFF2B353E)),
// child: Stack(
// children: <Widget>[
// if (model.isLogin)
// ListView.builder(
// itemBuilder: (context, index) => TimeLineWidget(
// isUp: index % 2 == 1,
// appoitmentAllHistoryResul: model.appoitmentAllHistoryResultList[index],
// ),
// itemCount: model.appoitmentAllHistoryResultList.length,
// scrollDirection: Axis.horizontal,
// reverse: projectViewModel.isArabic,
// ),
// ],
// ),
// ),
TimeLineView(model.isLogin, projectViewModel.isArabic, model.appoitmentAllHistoryResultList), TimeLineView(model.isLogin, projectViewModel.isArabic, model.appoitmentAllHistoryResultList),
SizedBox( SizedBox(
height: 20, height: 20,
@ -101,14 +81,6 @@ class _MedicalProfilePageState extends State<MedicalProfilePageNew> {
shrinkWrap: true, shrinkWrap: true,
primary: false, primary: false,
physics: NeverScrollableScrollPhysics(), physics: NeverScrollableScrollPhysics(),
// gridDelegate:
// SliverGridDelegateWithFixedCrossAxisCount(
// crossAxisCount: 3,
// childAspectRatio: MediaQuery.of(context)
// .size
// .width /
// (MediaQuery.of(context).size.height / 2.20),
// ),
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 3, childAspectRatio: 2 / 2, crossAxisSpacing: 12, mainAxisSpacing: 12), gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 3, childAspectRatio: 2 / 2, crossAxisSpacing: 12, mainAxisSpacing: 12),
padding: EdgeInsets.zero, padding: EdgeInsets.zero,
itemCount: myMedicalList.length, itemCount: myMedicalList.length,

@ -76,7 +76,6 @@ class _InvoiceDetailState extends State<InvoiceDetail> {
), ),
Container( Container(
child: Container( child: Container(
decoration: cardRadius(12), decoration: cardRadius(12),
margin: EdgeInsets.only(left: 16, top: 8, right: 16, bottom: 16), margin: EdgeInsets.only(left: 16, top: 8, right: 16, bottom: 16),
child: Padding( child: Padding(

@ -196,6 +196,7 @@ class PrescriptionOrderOverview extends StatelessWidget {
latitude: latitude, latitude: latitude,
appointmentNo: prescriptions.appointmentNo, appointmentNo: prescriptions.appointmentNo,
dischargeID: prescriptions.dischargeNo, dischargeID: prescriptions.dischargeNo,
projectID: prescriptions.projectID,
createdBy: model.user.patientID) createdBy: model.user.patientID)
.then((value) { .then((value) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);

@ -124,7 +124,6 @@ class _syncHealthDataButtonState extends State<syncHealthDataButton> {
counter++; counter++;
totalHeartRate += element['Value']; totalHeartRate += element['Value'];
} else if (element['MedCategoryID'] == 4) { } else if (element['MedCategoryID'] == 4) {
print("sleeeeep");
sleepDataList.add(new healthData( sleepDataList.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++));

@ -37,7 +37,6 @@ class _ClinicPackagesPageState extends State<ClinicPackagesPage> with AfterLayou
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);
}).catchError((error) { }).catchError((error) {
utils.Utils.showErrorToast(error); utils.Utils.showErrorToast(error);
}); });

@ -284,7 +284,7 @@ class _PackagesCartPageState extends State<PackagesCartPage> with AfterLayoutMix
var subTitle = "Order# ${value.data.customOrderNumber}"; var subTitle = "Order# ${value.data.customOrderNumber}";
Navigator.of(context).pushReplacement(MaterialPageRoute(builder: (context) => PackageOrderCompletedPage(heading: heading, title: title, subTitle: subTitle))); Navigator.of(context).pushReplacement(MaterialPageRoute(builder: (context) => PackageOrderCompletedPage(heading: heading, title: title, subTitle: subTitle)));
}).catchError((error) { }).catchError((error) {
debugPrint(error); print(error);
}); });
} }

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 < 3 && _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'
@ -26,7 +26,7 @@ class CompareList with ChangeNotifier {
AppToast.showErrorToast(message:TranslationBase.of(context).itInListMsg AppToast.showErrorToast(message:TranslationBase.of(context).itInListMsg
// 'the item is already in the list' // 'the item is already in the list'
); );
} else if(_product.length == 4){ } else if(_product.length == 3){
AppToast.showErrorToast(message: TranslationBase.of(context).compareListFull AppToast.showErrorToast(message: TranslationBase.of(context).compareListFull
// 'your compare list is full' // 'your compare list is full'
); );

@ -1,18 +1,17 @@
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/PharmacyProduct.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.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:diplomaticquarterapp/pages/pharmacies/compare-list.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:carousel_slider/carousel_slider.dart'; import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/compare-list.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/PharmacyProduct.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
int counter = 0; int counter = 0;
dynamic languageID; dynamic languageID;
class ComparePage extends StatefulWidget { class ComparePage extends StatefulWidget {
@override @override
_ComparePageState createState() => _ComparePageState(); _ComparePageState createState() => _ComparePageState();
@ -23,6 +22,7 @@ class _ComparePageState extends State<ComparePage> {
getLanguageID() async { getLanguageID() async {
languageID = await sharedPref.getString(APP_LANGUAGE); languageID = await sharedPref.getString(APP_LANGUAGE);
} }
void initState() { void initState() {
getLanguageID(); getLanguageID();
super.initState(); super.initState();
@ -68,8 +68,8 @@ class compareList extends StatelessWidget {
), ),
Padding( Padding(
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0),
child: Text(TranslationBase.of(context).noData, child: Text(
// 'There is no data', TranslationBase.of(context).noData,
style: TextStyle(fontSize: 30), style: TextStyle(fontSize: 30),
), ),
) )
@ -77,27 +77,11 @@ class compareList extends StatelessWidget {
), ),
), ),
) )
: CarouselSlider( : Container(
options: CarouselOptions( margin: EdgeInsets.only(top: 12.0),
height: 800.0, width: double.infinity,
viewportFraction: 0.87, height: MediaQuery.of(context).size.height,
enableInfiniteScroll: false), child: slideDetail(productItem),
items: productItem.map((i) {
return Builder(
builder: (BuildContext context) {
return Padding(
padding: const EdgeInsets.only(top: 8),
child: Container(
width: MediaQuery.of(context).size.width,
margin: EdgeInsets.symmetric(horizontal: 10.0),
child: productItem.length != 0
? slideDetail(productItem)
: Container(),
),
);
},
);
}).toList(),
); );
} }
} }
@ -147,8 +131,7 @@ class _slideDetailState extends State<slideDetail> {
icon: Icon(FontAwesomeIcons.trashAlt, size: 15), icon: Icon(FontAwesomeIcons.trashAlt, size: 15),
onPressed: () { onPressed: () {
setState(() { setState(() {
Provider.of<CompareList>(context, listen: false) Provider.of<CompareList>(context, listen: false).deleteItem(widget.data[index].id);
.deleteItem(widget.data[index].id);
}); });
}, },
), ),
@ -173,53 +156,42 @@ 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: projectViewModel.isArabic ? TextSpan( text: projectViewModel.isArabic
text: widget.data[index].namen, ? TextSpan(
style: TextStyle( text: widget.data[index].namen,
fontWeight: FontWeight.bold, style: TextStyle(fontWeight: FontWeight.bold, color: Colors.black, fontSize: 13),
color: Colors.black, )
fontSize: 13), : TextSpan(
) text: widget.data[index].name,
: TextSpan( style: TextStyle(fontWeight: FontWeight.bold, color: Colors.black, fontSize: 13),
text: widget.data[index].name, ),
style: TextStyle(
fontWeight: FontWeight.bold,
color: Colors.black,
fontSize: 13),
),
), ),
), ),
), ),
Container( Container(
margin: EdgeInsets.all(5), margin: EdgeInsets.all(5),
child: projectViewModel.isArabic ? child: projectViewModel.isArabic
Align( ? Align(
alignment: Alignment.topRight, alignment: Alignment.topRight,
child: RichText( child: RichText(
text: TextSpan( text: TextSpan(
text: "SAR ${widget.data[index].price.toString()}", text: "SAR ${widget.data[index].price.toString()}",
style: TextStyle( style: TextStyle(color: Colors.black54, fontSize: 15, fontWeight: FontWeight.bold),
color: Colors.black54, ),
fontSize: 15, ),
fontWeight: FontWeight.bold), )
), : Align(
), alignment: Alignment.topLeft,
): child: RichText(
Align( text: TextSpan(
alignment: Alignment.topLeft, text: "SAR ${widget.data[index].price.toString()}",
child: RichText( style: TextStyle(color: Colors.black54, fontSize: 15, fontWeight: FontWeight.bold),
text: TextSpan( ),
text: "SAR ${widget.data[index].price.toString()}", ),
style: TextStyle( ),
color: Colors.black54,
fontSize: 15,
fontWeight: FontWeight.bold),
),
),
),
), ),
Padding( Padding(
padding: EdgeInsets.only(top: 8.0), padding: EdgeInsets.only(top: 8.0),
@ -230,63 +202,43 @@ class _slideDetailState extends State<slideDetail> {
), ),
), ),
Container( Container(
margin: EdgeInsets.all(5), margin: EdgeInsets.all(5),
child: projectViewModel.isArabic ? child: projectViewModel.isArabic
Align( ? Align(
alignment: Alignment.topRight, alignment: Alignment.topRight,
child: RichText( child: RichText(
text: 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 :"", style: TextStyle(fontWeight: FontWeight.bold, color: Colors.black, fontSize: 13),
style: TextStyle( )),
fontWeight: FontWeight.bold, )
color: Colors.black, : Align(
fontSize: 13), alignment: Alignment.topLeft,
) child: RichText(
), text: TextSpan(
): Align( text: widget.data[index].specifications != null ? widget.data[index].specifications[0].name : "",
alignment: Alignment.topLeft, style: TextStyle(fontWeight: FontWeight.bold, color: Colors.black, fontSize: 13),
child: RichText( )),
text: TextSpan( )),
text: widget.data[index].specifications != null ?
widget.data[index].specifications[0].name :"",
style: TextStyle(
fontWeight: FontWeight.bold,
color: Colors.black,
fontSize: 13),
)
),
)
),
Container( Container(
margin: EdgeInsets.all(5), margin: EdgeInsets.all(5),
child: projectViewModel.isArabic ? child: projectViewModel.isArabic
Align( ? Align(
alignment: Alignment.topRight, alignment: Alignment.topRight,
child: RichText( child: RichText(
text: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:"", style: TextStyle(color: Colors.black54, fontSize: 15, fontWeight: FontWeight.bold),
style: TextStyle( )),
color: Colors.black54, )
fontSize: 15, : Align(
fontWeight: FontWeight.bold), alignment: Alignment.topLeft,
) child: RichText(
), text: TextSpan(
):Align( text: widget.data[index].specifications != null ? widget.data[index].specifications[0].defaultValue : "",
alignment: Alignment.topLeft, style: TextStyle(color: Colors.black54, fontSize: 15, fontWeight: FontWeight.bold),
child: RichText( )),
text:TextSpan( )),
text: widget.data[index].specifications != null ?
widget.data[index].specifications[0].defaultValue:"",
style: TextStyle(
color: Colors.black54,
fontSize: 15,
fontWeight: FontWeight.bold),
)
),
)
),
Padding( Padding(
padding: EdgeInsets.only(top: 8.0), padding: EdgeInsets.only(top: 8.0),
child: Container( child: Container(
@ -297,62 +249,42 @@ class _slideDetailState extends State<slideDetail> {
), ),
Container( Container(
margin: EdgeInsets.all(5), margin: EdgeInsets.all(5),
child: projectViewModel.isArabic ? child: projectViewModel.isArabic
Align( ? Align(
alignment: Alignment.topRight, alignment: Alignment.topRight,
child: RichText( child: RichText(
text: 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 :"", style: TextStyle(fontWeight: FontWeight.bold, color: Colors.black, fontSize: 13),
style: TextStyle( )),
fontWeight: FontWeight.bold,
color: Colors.black,
fontSize: 13),
)
),
): Align(
alignment: Alignment.topLeft,
child: RichText(
text: TextSpan(
text: widget.data[index].specifications != null ?
widget.data[index].specifications[1].name :"",
style: TextStyle(
fontWeight: FontWeight.bold,
color: Colors.black,
fontSize: 13),
) )
), : Align(
) alignment: Alignment.topLeft,
), child: RichText(
text: TextSpan(
text: widget.data[index].specifications != null ? widget.data[index].specifications[1].name : "",
style: TextStyle(fontWeight: FontWeight.bold, color: Colors.black, fontSize: 13),
)),
)),
Container( Container(
margin: EdgeInsets.all(5), margin: EdgeInsets.all(5),
child: projectViewModel.isArabic ? child: projectViewModel.isArabic
Align( ? Align(
alignment: Alignment.topRight, alignment: Alignment.topRight,
child: RichText( child: RichText(
text: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:"", style: TextStyle(color: Colors.black54, fontSize: 15, fontWeight: FontWeight.bold),
style: TextStyle( )),
color: Colors.black54,
fontSize: 15,
fontWeight: FontWeight.bold),
)
),
):Align(
alignment: Alignment.topLeft,
child: RichText(
text:TextSpan(
text: widget.data[index].specifications != null ?
widget.data[index].specifications[1].defaultValue:"",
style: TextStyle(
color: Colors.black54,
fontSize: 15,
fontWeight: FontWeight.bold),
) )
), : Align(
) alignment: Alignment.topLeft,
), child: RichText(
text: TextSpan(
text: widget.data[index].specifications != null ? widget.data[index].specifications[1].defaultValue : "",
style: TextStyle(color: Colors.black54, fontSize: 15, fontWeight: FontWeight.bold),
)),
)),
Padding( Padding(
padding: EdgeInsets.only(top: 8.0), padding: EdgeInsets.only(top: 8.0),
child: Container( child: Container(
@ -363,62 +295,42 @@ class _slideDetailState extends State<slideDetail> {
), ),
Container( Container(
margin: EdgeInsets.all(5), margin: EdgeInsets.all(5),
child: projectViewModel.isArabic ? child: projectViewModel.isArabic
Align( ? Align(
alignment: Alignment.topRight, alignment: Alignment.topRight,
child: RichText( child: RichText(
text: 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 :"", style: TextStyle(fontWeight: FontWeight.bold, color: Colors.black, fontSize: 13),
style: TextStyle( )),
fontWeight: FontWeight.bold,
color: Colors.black,
fontSize: 13),
)
),
): Align(
alignment: Alignment.topLeft,
child: RichText(
text: TextSpan(
text: widget.data[index].specifications != null ?
widget.data[index].specifications[2].name :"",
style: TextStyle(
fontWeight: FontWeight.bold,
color: Colors.black,
fontSize: 13),
) )
), : Align(
) alignment: Alignment.topLeft,
), child: RichText(
text: TextSpan(
text: widget.data[index].specifications != null ? widget.data[index].specifications[2].name : "",
style: TextStyle(fontWeight: FontWeight.bold, color: Colors.black, fontSize: 13),
)),
)),
Container( Container(
margin: EdgeInsets.all(5), margin: EdgeInsets.all(5),
child: projectViewModel.isArabic ? child: projectViewModel.isArabic
Align( ? Align(
alignment: Alignment.topRight, alignment: Alignment.topRight,
child: RichText( child: RichText(
text: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:"", style: TextStyle(color: Colors.black54, fontSize: 15, fontWeight: FontWeight.bold),
style: TextStyle( )),
color: Colors.black54,
fontSize: 15,
fontWeight: FontWeight.bold),
)
),
):Align(
alignment: Alignment.topLeft,
child: RichText(
text:TextSpan(
text: widget.data[index].specifications != null ?
widget.data[index].specifications[2].defaultValue:"",
style: TextStyle(
color: Colors.black54,
fontSize: 15,
fontWeight: FontWeight.bold),
) )
), : Align(
) alignment: Alignment.topLeft,
), child: RichText(
text: TextSpan(
text: widget.data[index].specifications != null ? widget.data[index].specifications[2].defaultValue : "",
style: TextStyle(color: Colors.black54, fontSize: 15, fontWeight: FontWeight.bold),
)),
)),
Padding( Padding(
padding: EdgeInsets.only(top: 8.0), padding: EdgeInsets.only(top: 8.0),
child: Container( child: Container(
@ -429,62 +341,42 @@ class _slideDetailState extends State<slideDetail> {
), ),
Container( Container(
margin: EdgeInsets.all(5), margin: EdgeInsets.all(5),
child: projectViewModel.isArabic ? child: projectViewModel.isArabic
Align( ? Align(
alignment: Alignment.topRight, alignment: Alignment.topRight,
child: RichText( child: RichText(
text: 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 :"", style: TextStyle(fontWeight: FontWeight.bold, color: Colors.black, fontSize: 13),
style: TextStyle( )),
fontWeight: FontWeight.bold,
color: Colors.black,
fontSize: 13),
)
),
): Align(
alignment: Alignment.topLeft,
child: RichText(
text: TextSpan(
text: widget.data[index].specifications != null ?
widget.data[index].specifications[3].name :"",
style: TextStyle(
fontWeight: FontWeight.bold,
color: Colors.black,
fontSize: 13),
) )
), : Align(
) alignment: Alignment.topLeft,
), child: RichText(
text: TextSpan(
text: widget.data[index].specifications != null ? widget.data[index].specifications[3].name : "",
style: TextStyle(fontWeight: FontWeight.bold, color: Colors.black, fontSize: 13),
)),
)),
Container( Container(
margin: EdgeInsets.all(5), margin: EdgeInsets.all(5),
child: projectViewModel.isArabic ? child: projectViewModel.isArabic
Align( ? Align(
alignment: Alignment.topRight, alignment: Alignment.topRight,
child: RichText( child: RichText(
text: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:"", style: TextStyle(color: Colors.black54, fontSize: 15, fontWeight: FontWeight.bold),
style: TextStyle( )),
color: Colors.black54,
fontSize: 15,
fontWeight: FontWeight.bold),
)
),
):Align(
alignment: Alignment.topLeft,
child: RichText(
text:TextSpan(
text: widget.data[index].specifications != null ?
widget.data[index].specifications[3].defaultValue:"",
style: TextStyle(
color: Colors.black54,
fontSize: 15,
fontWeight: FontWeight.bold),
) )
), : Align(
) alignment: Alignment.topLeft,
), child: RichText(
text: TextSpan(
text: widget.data[index].specifications != null ? widget.data[index].specifications[3].defaultValue : "",
style: TextStyle(color: Colors.black54, fontSize: 15, fontWeight: FontWeight.bold),
)),
)),
Padding( Padding(
padding: EdgeInsets.only(top: 8.0), padding: EdgeInsets.only(top: 8.0),
child: Container( child: Container(
@ -495,62 +387,42 @@ class _slideDetailState extends State<slideDetail> {
), ),
Container( Container(
margin: EdgeInsets.all(5), margin: EdgeInsets.all(5),
child: projectViewModel.isArabic ? child: projectViewModel.isArabic
Align( ? Align(
alignment: Alignment.topRight, alignment: Alignment.topRight,
child: RichText( child: RichText(
text: 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 :"", style: TextStyle(fontWeight: FontWeight.bold, color: Colors.black, fontSize: 13),
style: TextStyle( )),
fontWeight: FontWeight.bold,
color: Colors.black,
fontSize: 13),
)
),
): Align(
alignment: Alignment.topLeft,
child: RichText(
text: TextSpan(
text: widget.data[index].specifications != null ?
widget.data[index].specifications[4].name :"",
style: TextStyle(
fontWeight: FontWeight.bold,
color: Colors.black,
fontSize: 13),
) )
), : Align(
) alignment: Alignment.topLeft,
), child: RichText(
text: TextSpan(
text: widget.data[index].specifications != null ? widget.data[index].specifications[4].name : "",
style: TextStyle(fontWeight: FontWeight.bold, color: Colors.black, fontSize: 13),
)),
)),
Container( Container(
margin: EdgeInsets.all(5), margin: EdgeInsets.all(5),
child: projectViewModel.isArabic ? child: projectViewModel.isArabic
Align( ? Align(
alignment: Alignment.topRight, alignment: Alignment.topRight,
child: RichText( child: RichText(
text: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:"", style: TextStyle(color: Colors.black54, fontSize: 15, fontWeight: FontWeight.bold),
style: TextStyle( )),
color: Colors.black54,
fontSize: 15,
fontWeight: FontWeight.bold),
)
),
):Align(
alignment: Alignment.topLeft,
child: RichText(
text:TextSpan(
text: widget.data[index].specifications != null ?
widget.data[index].specifications[4].defaultValue:"",
style: TextStyle(
color: Colors.black54,
fontSize: 15,
fontWeight: FontWeight.bold),
) )
), : Align(
) alignment: Alignment.topLeft,
), child: RichText(
text: TextSpan(
text: widget.data[index].specifications != null ? widget.data[index].specifications[4].defaultValue : "",
style: TextStyle(color: Colors.black54, fontSize: 15, fontWeight: FontWeight.bold),
)),
)),
Padding( Padding(
padding: EdgeInsets.only(top: 8.0), padding: EdgeInsets.only(top: 8.0),
child: Container( child: Container(
@ -561,63 +433,42 @@ class _slideDetailState extends State<slideDetail> {
), ),
Container( Container(
margin: EdgeInsets.all(5), margin: EdgeInsets.all(5),
child: projectViewModel.isArabic ? child: projectViewModel.isArabic
Align( ? Align(
alignment: Alignment.topRight, alignment: Alignment.topRight,
child: RichText( child: RichText(
text: 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 :"", style: TextStyle(fontWeight: FontWeight.bold, color: Colors.black, fontSize: 13),
style: TextStyle( )),
fontWeight: FontWeight.bold,
color: Colors.black,
fontSize: 13),
)
),
): Align(
alignment: Alignment.topLeft,
child: RichText(
text: TextSpan(
text: widget.data[index].specifications != null ?
widget.data[index].specifications[5].name :"",
style: TextStyle(
fontWeight: FontWeight.bold,
color: Colors.black,
fontSize: 13),
) )
), : Align(
) alignment: Alignment.topLeft,
), child: RichText(
text: TextSpan(
text: widget.data[index].specifications != null ? widget.data[index].specifications[5].name : "",
style: TextStyle(fontWeight: FontWeight.bold, color: Colors.black, fontSize: 13),
)),
)),
Container( Container(
margin: EdgeInsets.all(5), margin: EdgeInsets.all(5),
child: projectViewModel.isArabic ? child: projectViewModel.isArabic
Align( ? Align(
alignment: Alignment.topRight, alignment: Alignment.topRight,
child: RichText( child: RichText(
text: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:"", style: TextStyle(color: Colors.black54, fontSize: 15, fontWeight: FontWeight.bold),
style: TextStyle( )),
color: Colors.black54,
fontSize: 15,
fontWeight: FontWeight.bold),
)
),
):Align(
alignment: Alignment.topLeft,
child: RichText(
text:TextSpan(
text: widget.data[index].specifications != null ?
widget.data[index].specifications[5].defaultValue:"",
style: TextStyle(
color: Colors.black54,
fontSize: 15,
fontWeight: FontWeight.bold),
) )
), : Align(
) alignment: Alignment.topLeft,
), child: RichText(
text: TextSpan(
text: widget.data[index].specifications != null ? widget.data[index].specifications[5].defaultValue : "",
style: TextStyle(color: Colors.black54, fontSize: 15, fontWeight: FontWeight.bold),
)),
)),
], ],
), ),
), ),
@ -628,15 +479,3 @@ class _slideDetailState extends State<slideDetail> {
); );
} }
} }
String returnString(data) {
for (int i = 0; i < data.length; i++) {
print(data[i]);
// if(data[i] == null){
// if(counter == i){
//
// }
// }
}
return "ENAD HILAL";
}

@ -2,6 +2,7 @@ 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';
@ -14,17 +15,12 @@ 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;
OrderPreviewPage({this.addresses, this.model}); OrderPreviewPage({this.addresses, this.model});
@override @override
_OrderPreviewPageState createState() => _OrderPreviewPageState(); _OrderPreviewPageState createState() => _OrderPreviewPageState();
} }
@ -34,9 +30,6 @@ class _OrderPreviewPageState extends State<OrderPreviewPage> {
bool isLoading = true; bool isLoading = true;
bool isChecked = false; bool isChecked = false;
@override @override
void initState() { void initState() {
super.initState(); super.initState();
@ -50,12 +43,11 @@ class _OrderPreviewPageState extends State<OrderPreviewPage> {
}); });
} }
@override @override
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,
@ -73,108 +65,108 @@ 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
? AbsorbPointer( ? Stack(
absorbing: true,
child: Stack(
children: [ children: [
Container( Container(
child: Column( child: Column(
children: [ children: [
// LakumWidget(widget.model), Container(
Container( color: Colors.white,
color: Colors.white, padding: EdgeInsets.symmetric(vertical: 12, horizontal: 12),
padding: EdgeInsets.symmetric(vertical: 12, horizontal: 12), child: Row(
child: Row( children: [
children: [ Row(
Row( children: [
children: [ SizedBox(
SizedBox( height: 24.0,
height: 24.0, width: 24.0,
width: 24.0, child: Checkbox(
child: Checkbox( activeColor: CustomColors.green,
activeColor: CustomColors.green, value: isChecked,
value: isChecked, onChanged: (bool value) {
onChanged: (bool value) { setState(() {
setState(() { isChecked = value;
isChecked = value; if (value) {
print(isChecked);
if (value){
// isChecked;
PaymentBottomWidget.isChecked = true; PaymentBottomWidget.isChecked = true;
print(value); } else {
}else{
PaymentBottomWidget.isChecked = false; PaymentBottomWidget.isChecked = false;
} }
setState(() { setState(() {});
}); });
}); },
},
),
), ),
Padding( ),
padding: const EdgeInsets.only(left: 8.0, right: 8.0), Padding(
child: Text( padding: const EdgeInsets.only(left: 8.0, right: 8.0),
TranslationBase.of(context).useLakumPoints + child: Text(
" (${widget.model.paymentCheckoutData.lacumInformation.lakumInquiryInformationObjVersion.pointsBalance.toString() + " " + TranslationBase.of(context).points})", TranslationBase.of(context).useLakumPoints +
style: TextStyle(fontSize: 12.0, fontWeight: FontWeight.w600, letterSpacing: -0.56)), " (${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( Expanded(
decoration: BoxDecoration(color: Color(0x99ffffff)), child: Container(
padding: const EdgeInsets.symmetric(horizontal: 8), decoration: BoxDecoration(color: Color(0x99ffffff)),
child: Row( padding: const EdgeInsets.symmetric(horizontal: 8),
mainAxisAlignment: MainAxisAlignment.end, child: Row(
children: [ mainAxisAlignment: MainAxisAlignment.end,
Container( children: [
decoration: BoxDecoration(color: Color(0x99ffffff)), Container(
child: Column( decoration: BoxDecoration(color: Color(0x99ffffff)),
crossAxisAlignment: CrossAxisAlignment.start, child: Column(
children: [ crossAxisAlignment: CrossAxisAlignment.start,
Texts( children: [
"${TranslationBase.of(context).availableBalance}", Texts(
fontSize: 12, "${TranslationBase.of(context).availableBalance}",
fontWeight: FontWeight.bold, fontSize: 12,
), fontWeight: FontWeight.bold,
Text( ),
"${TranslationBase.of(context).sar + " " + widget.model.paymentCheckoutData.lacumInformation.lakumInquiryInformationObjVersion.pointsBalanceAmount.toString()}", Text(
style: TextStyle(fontSize: 12.0, fontWeight: FontWeight.w600, letterSpacing: -0.56) "${TranslationBase.of(context).sar + " " + widget.model.paymentCheckoutData.lacumInformation.lakumInquiryInformationObjVersion.pointsBalanceAmount.toString()}",
), style: TextStyle(fontSize: 12.0, fontWeight: FontWeight.w600, letterSpacing: -0.56)),
], ],
),
), ),
], ),
), ],
), ),
), ),
),
], ],
),
),
SizedBox(
height: 10,
), ),
], ),
), SizedBox(
height: 10,
),
],
), ),
Container( ),
height: MediaQuery.of(context).size.height * .10, projectViewModel.havePrivilege(83)
color: Colors.white.withOpacity(0.6), ? Container()
) : Container(
height: MediaQuery.of(context).size.height * .10,
color: Colors.white.withOpacity(0.6),
)
], ],
), )
)
: Container(), : Container(),
Container( Container(
color: Colors.white, color: Colors.white,
@ -284,65 +276,70 @@ class _OrderPreviewPageState extends State<OrderPreviewPage> {
indent: 0, indent: 0,
endIndent: 0, endIndent: 0,
), ),
isChecked ? isChecked
Row( ? Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
Texts( Texts(
"${TranslationBase.of(context).lakum}", "${TranslationBase.of(context).lakum}",
fontSize: 14, fontSize: 14,
color: Colors.green, color: Colors.green,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
), ),
Texts( Texts(
"- ${TranslationBase.of(context).sar} ${(widget.model.paymentCheckoutData.lacumInformation.lakumInquiryInformationObjVersion.pointsBalanceAmount).toStringAsFixed(2)}", "- ${TranslationBase.of(context).sar} ${(widget.model.paymentCheckoutData.lacumInformation.lakumInquiryInformationObjVersion.pointsBalanceAmount).toStringAsFixed(2)}",
fontSize: 14, fontSize: 14,
color: Colors.green, color: Colors.green,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
), ),
], ],
) : Container(), )
isChecked ? const Divider( : Container(),
color: Color(0xFFD6D6D6), isChecked
height: 20, ? const Divider(
thickness: 1, color: Color(0xFFD6D6D6),
indent: 0, height: 20,
endIndent: 0, thickness: 1,
): Container(), indent: 0,
isChecked ? Row( endIndent: 0,
mainAxisAlignment: MainAxisAlignment.spaceBetween, )
children: [ : Container(),
Texts( isChecked
TranslationBase.of(context).total, ? Row(
fontSize: 14, mainAxisAlignment: MainAxisAlignment.spaceBetween,
color: Colors.black, children: [
fontWeight: FontWeight.bold, Texts(
), TranslationBase.of(context).total,
Texts( fontSize: 14,
" ${TranslationBase.of(context).sar}""${(widget.model.cartResponse.totalAmount - widget.model.paymentCheckoutData.lacumInformation.lakumInquiryInformationObjVersion.pointsBalanceAmount).toStringAsFixed(2)}", color: Colors.black,
fontSize: 14, fontWeight: FontWeight.bold,
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,
: Row( color: Colors.black,
mainAxisAlignment: MainAxisAlignment.spaceBetween, fontWeight: FontWeight.bold,
children: [ ),
Texts( ],
TranslationBase.of(context).total, )
fontSize: 14, : Row(
color: Colors.black, mainAxisAlignment: MainAxisAlignment.spaceBetween,
fontWeight: FontWeight.bold, children: [
), Texts(
Texts( TranslationBase.of(context).total,
" ${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, ),
), Texts(
], " ${TranslationBase.of(context).sar} ${(widget.model.cartResponse.totalAmount).toStringAsFixed(2)}",
), fontSize: 14,
color: Colors.black,
fontWeight: FontWeight.bold,
),
],
),
SizedBox( SizedBox(
height: 10, height: 10,
), ),
@ -364,12 +361,9 @@ class _OrderPreviewPageState extends State<OrderPreviewPage> {
child: PaymentBottomWidget(widget.model), child: PaymentBottomWidget(widget.model),
), ),
); );
} }
changeMainState() { changeMainState() {
setState(() {}); setState(() {});
} }
} }

@ -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';
@ -25,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(
@ -44,7 +45,7 @@ class PaymentBottomWidget extends StatelessWidget {
child: Row( child: Row(
children: [ children: [
isChecked ? Texts( isChecked ? Texts(
"${TranslationBase.of(context).sar} ${(model.cartResponse.totalAmount - model.paymentCheckoutData.lacumInformation.lakumInquiryInformationObjVersion.pointsBalanceAmount).toStringAsFixed(2)}", "${TranslationBase.of(context).sar} ${model.cartResponse.totalAmount}",
fontSize: 14, fontSize: 14,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
color: Color(0xff929295), color: Color(0xff929295),
@ -88,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);

@ -24,6 +24,9 @@ class LakumActivationVidaPage extends StatelessWidget {
isShowAppBar: true, isShowAppBar: true,
isPharmacy: true, isPharmacy: true,
isShowDecPage: false, isShowDecPage: false,
showPharmacyCart: false,
showHomeAppBarIcon: false,
isBottomBar: false,
backgroundColor: Colors.white, backgroundColor: Colors.white,
baseViewModel: model, baseViewModel: model,
body: Container( body: Container(

@ -18,8 +18,7 @@ class LacumTransferPage extends StatefulWidget {
} }
class _LacumTransferPageState extends State<LacumTransferPage> { class _LacumTransferPageState extends State<LacumTransferPage> {
TextEditingController _beneficieryAccountController = TextEditingController _beneficieryAccountController = new TextEditingController();
new TextEditingController();
TextEditingController _transferPointsController = new TextEditingController(); TextEditingController _transferPointsController = new TextEditingController();
@override @override
@ -34,8 +33,7 @@ class _LacumTransferPageState extends State<LacumTransferPage> {
final mediaQuery = MediaQuery.of(context); final mediaQuery = MediaQuery.of(context);
return BaseView<LacumTranferViewModel>( return BaseView<LacumTranferViewModel>(
onModelReady: (model) => model.setLakumData( onModelReady: (model) => model.setLakumData(widget.lacumInformation, widget.lacumGroupInformation),
widget.lacumInformation, widget.lacumGroupInformation),
builder: (_, model, wi) => AppScaffold( builder: (_, model, wi) => AppScaffold(
appBarTitle: "${TranslationBase.of(context).lakumTransfer}", appBarTitle: "${TranslationBase.of(context).lakumTransfer}",
isShowAppBar: true, isShowAppBar: true,
@ -50,8 +48,7 @@ class _LacumTransferPageState extends State<LacumTransferPage> {
width: double.infinity, width: double.infinity,
child: SingleChildScrollView( child: SingleChildScrollView(
child: SizedBox( child: SizedBox(
height: height: mediaQuery.size.height - 58 - mediaQuery.padding.top,
mediaQuery.size.height - 58 - mediaQuery.padding.top,
child: Padding( child: Padding(
padding: const EdgeInsets.all(16.0), padding: const EdgeInsets.all(16.0),
child: Column( child: Column(
@ -65,23 +62,20 @@ class _LacumTransferPageState extends State<LacumTransferPage> {
Container( Container(
height: 100, height: 100,
width: mediaQuery.size.width / 2 - 26, width: mediaQuery.size.width / 2 - 26,
padding: EdgeInsets.only( padding: EdgeInsets.only(top: 12, left: 8, right: 8, bottom: 4),
top: 12, left: 8, right: 8, bottom: 4),
decoration: BoxDecoration( decoration: BoxDecoration(
shape: BoxShape.rectangle, shape: BoxShape.rectangle,
borderRadius: BorderRadius.circular(8), borderRadius: BorderRadius.circular(8),
border: Border.fromBorderSide(BorderSide( border: Border.fromBorderSide(BorderSide(
color: Color(0xffe1e1e1), color: Color(0xffe1e1e1),
width: 0.4, width: 0.4,
)), )),
color: Colors.green color: Colors.green
//(0xff6294ed), //(0xff6294ed),
), ),
child: Row( child: Row(
crossAxisAlignment: crossAxisAlignment: CrossAxisAlignment.start,
CrossAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.spaceBetween,
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [ children: [
Expanded( Expanded(
child: Column( child: Column(
@ -99,13 +93,10 @@ class _LacumTransferPageState extends State<LacumTransferPage> {
), ),
Expanded( Expanded(
child: Container( child: Container(
padding: EdgeInsets.symmetric( padding: EdgeInsets.symmetric(vertical: 8),
vertical: 8),
child: Column( child: Column(
mainAxisAlignment: mainAxisAlignment: MainAxisAlignment.end,
MainAxisAlignment.end, crossAxisAlignment: CrossAxisAlignment.end,
crossAxisAlignment:
CrossAxisAlignment.end,
children: [ children: [
Texts( Texts(
"${model.lacumGroupInformation.lakumInquiryInformationObjVersion.pointsBalance}", "${model.lacumGroupInformation.lakumInquiryInformationObjVersion.pointsBalance}",
@ -126,8 +117,7 @@ class _LacumTransferPageState extends State<LacumTransferPage> {
Container( Container(
height: 100, height: 100,
width: mediaQuery.size.width / 2 - 26, width: mediaQuery.size.width / 2 - 26,
padding: EdgeInsets.only( padding: EdgeInsets.only(top: 12, left: 8, right: 8, bottom: 4),
top: 12, left: 8, right: 8, bottom: 4),
decoration: BoxDecoration( decoration: BoxDecoration(
shape: BoxShape.rectangle, shape: BoxShape.rectangle,
borderRadius: BorderRadius.circular(8), borderRadius: BorderRadius.circular(8),
@ -138,10 +128,8 @@ class _LacumTransferPageState extends State<LacumTransferPage> {
color: Color(0xff339933), color: Color(0xff339933),
), ),
child: Row( child: Row(
crossAxisAlignment: crossAxisAlignment: CrossAxisAlignment.start,
CrossAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.spaceBetween,
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [ children: [
Expanded( Expanded(
child: Column( child: Column(
@ -159,13 +147,10 @@ class _LacumTransferPageState extends State<LacumTransferPage> {
), ),
Expanded( Expanded(
child: Container( child: Container(
padding: EdgeInsets.symmetric( padding: EdgeInsets.symmetric(vertical: 8),
vertical: 8),
child: Column( child: Column(
mainAxisAlignment: mainAxisAlignment: MainAxisAlignment.end,
MainAxisAlignment.end, crossAxisAlignment: CrossAxisAlignment.end,
crossAxisAlignment:
CrossAxisAlignment.end,
children: [ children: [
Texts( Texts(
"${model.lacumGroupInformation.lakumInquiryInformationObjVersion.pointsBalanceAmount}", "${model.lacumGroupInformation.lakumInquiryInformationObjVersion.pointsBalanceAmount}",
@ -199,47 +184,34 @@ class _LacumTransferPageState extends State<LacumTransferPage> {
margin: EdgeInsets.only(top: 4), margin: EdgeInsets.only(top: 4),
child: BorderedButton( child: BorderedButton(
TranslationBase.of(context).checkBeneficiary, TranslationBase.of(context).checkBeneficiary,
backgroundColor: backgroundColor: _beneficieryAccountController.text.isNotEmpty ? Color(0xff60686b) : Color(0xffb0b4b5),
_beneficieryAccountController.text != ""
? Color(0xff60686b)
: Color(0xffb0b4b5),
textColor: Colors.white, textColor: Colors.white,
fontSize: 16, fontSize: 16,
hPadding: 8, hPadding: 8,
vPadding: 12, vPadding: 12,
handler: handler: _beneficieryAccountController.text.isNotEmpty
_beneficieryAccountController.text != "" ? () {
? () { model.getLacumGroupDataBuAccountId(_beneficieryAccountController.text);
model.getLacumGroupDataBuAccountId( }
_beneficieryAccountController : () {},
.text);
}
: (){},
), ),
), ),
(model.lacumReceiverInformation != null && (model.lacumReceiverInformation != null && model.lacumReceiverInformation.lakumInquiryInformationObjVersion != null)
model.lacumReceiverInformation
.lakumInquiryInformationObjVersion !=
null)
? Container( ? Container(
margin: EdgeInsets.only(top: 8), margin: EdgeInsets.only(top: 8),
child: Column( child: Column(
crossAxisAlignment: crossAxisAlignment: CrossAxisAlignment.start,
CrossAxisAlignment.start,
children: [ children: [
Texts( Texts(
TranslationBase.of(context) TranslationBase.of(context).beneficiaryName,
.beneficiaryName,
color: Colors.black, color: Colors.black,
), ),
Padding( Padding(
padding: const EdgeInsets.symmetric( padding: const EdgeInsets.symmetric(horizontal: 8),
horizontal: 8),
child: TextField( child: TextField(
enabled: false, enabled: false,
decoration: new InputDecoration( decoration: new InputDecoration(
hintText: hintText: "${model.lacumReceiverInformation.lakumInquiryInformationObjVersion.memberName}",
"${model.lacumReceiverInformation.lakumInquiryInformationObjVersion.memberName}",
hintStyle: TextStyle( hintStyle: TextStyle(
fontSize: 16, fontSize: 16,
color: Colors.grey.shade600, color: Colors.grey.shade600,
@ -259,11 +231,9 @@ class _LacumTransferPageState extends State<LacumTransferPage> {
color: Colors.black, color: Colors.black,
), ),
Padding( Padding(
padding: const EdgeInsets.symmetric( padding: const EdgeInsets.symmetric(horizontal: 8),
horizontal: 8),
child: TextField( child: TextField(
controller: controller: _transferPointsController,
_transferPointsController,
decoration: new InputDecoration( decoration: new InputDecoration(
focusColor: Colors.green, focusColor: Colors.green,
hintStyle: TextStyle( hintStyle: TextStyle(
@ -282,10 +252,7 @@ class _LacumTransferPageState extends State<LacumTransferPage> {
: Container() : Container()
], ],
), ),
if (model.lacumReceiverInformation != null && if (model.lacumReceiverInformation != null && model.lacumReceiverInformation.lakumInquiryInformationObjVersion != null)
model.lacumReceiverInformation
.lakumInquiryInformationObjVersion !=
null)
Container( Container(
margin: EdgeInsets.all(8), margin: EdgeInsets.all(8),
child: BorderedButton( child: BorderedButton(
@ -298,14 +265,9 @@ class _LacumTransferPageState extends State<LacumTransferPage> {
vPadding: 16, vPadding: 16,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
handler: () { handler: () {
model model.transferYaHalaLoyaltyPoints(_transferPointsController.text).then((status) => {
.transferYaHalaLoyaltyPoints( {Navigator.pop(context)}
_transferPointsController.text) });
.then((status) => {
if (status == 200)
{Navigator.pop(context, "")}
// back to previous page
});
}, },
), ),
) )

@ -28,13 +28,11 @@ class LakumMainPage extends StatelessWidget {
return BaseView<LacumViewModel>( return BaseView<LacumViewModel>(
onModelReady: (model) async { onModelReady: (model) async {
await model.getLacumData(); await model.getLacumData();
if (model.lacumInformation.yahalaAccountNo == 0 || if (model.lacumInformation.yahalaAccountNo == 0 || model.lacumInformation.yahalaAccountNo == null) {
model.lacumInformation.yahalaAccountNo == null) {
navigateToLakumRegister(context); navigateToLakumRegister(context);
} else { } else {
if (model.lacumInformation.status == "Hold") { if (model.lacumInformation.status == "Hold") {
Navigator.pushReplacement( Navigator.pushReplacement(context, FadePage(page: LakumActivationVidaPage()));
context, FadePage(page: LakumActivationVidaPage()));
} }
} }
}, },
@ -53,10 +51,7 @@ class LakumMainPage extends StatelessWidget {
body: Container( body: Container(
width: double.infinity, width: double.infinity,
child: SingleChildScrollView( child: SingleChildScrollView(
child: (model.lacumGroupInformation != null && child: (model.lacumGroupInformation != null && model.lacumGroupInformation.lakumInquiryInformationObjVersion != null)
model.lacumGroupInformation
.lakumInquiryInformationObjVersion !=
null)
? Column( ? Column(
children: [ children: [
Stack( Stack(
@ -70,11 +65,7 @@ class LakumMainPage extends StatelessWidget {
SizedBox( SizedBox(
height: mediaQuery.size.height * 0.02, height: mediaQuery.size.height * 0.02,
), ),
Container( Container(width: mediaQuery.size.width * 1, height: mediaQuery.size.width * .6, child: LakumBannerWidget(model, mediaQuery, true)),
width: mediaQuery.size.width * 1,
height: mediaQuery.size.width * .6,
child: LakumBannerWidget(
model, mediaQuery, true)),
], ],
) )
], ],
@ -88,43 +79,17 @@ class LakumMainPage extends StatelessWidget {
), ),
Container( Container(
height: 110, height: 110,
margin: EdgeInsets.symmetric( margin: EdgeInsets.symmetric(horizontal: 16, vertical: 12.0),
horizontal: 16, vertical: 12.0),
child: ListView( child: ListView(
scrollDirection: Axis.horizontal, scrollDirection: Axis.horizontal,
children: <Widget>[ children: <Widget>[
LacumPointsWidget( LacumPointsWidget(mediaQuery, 1, TranslationBase.of(context).balance, model.lacumGroupInformation.lakumInquiryInformationObjVersion.pointsBalanceAmount,
mediaQuery, model.lacumGroupInformation.lakumInquiryInformationObjVersion.pointsBalance, null),
1,
TranslationBase.of(context).balance,
model
.lacumGroupInformation
.lakumInquiryInformationObjVersion
.pointsBalanceAmount,
model
.lacumGroupInformation
.lakumInquiryInformationObjVersion
.pointsBalance,
null),
SizedBox( SizedBox(
width: 8, width: 8,
), ),
LacumPointsWidget( LacumPointsWidget(mediaQuery, 2, TranslationBase.of(context).gained, model.lacumGroupInformation.lakumInquiryInformationObjVersion.pointsBalanceAmount,
mediaQuery, model.lacumGroupInformation.lakumInquiryInformationObjVersion.gainedPoints, model.lacumGroupInformation.lakumInquiryInformationObjVersion.gainedPointsAmountPerYear),
2,
TranslationBase.of(context).gained,
model
.lacumGroupInformation
.lakumInquiryInformationObjVersion
.pointsBalanceAmount,
model
.lacumGroupInformation
.lakumInquiryInformationObjVersion
.gainedPoints,
model
.lacumGroupInformation
.lakumInquiryInformationObjVersion
.gainedPointsAmountPerYear),
SizedBox( SizedBox(
width: 8, width: 8,
), ),
@ -132,40 +97,16 @@ class LakumMainPage extends StatelessWidget {
mediaQuery, mediaQuery,
3, 3,
TranslationBase.of(context).consumed, TranslationBase.of(context).consumed,
model model.lacumGroupInformation.lakumInquiryInformationObjVersion.consumedPointsAmount != null
.lacumGroupInformation ? num.parse(model.lacumGroupInformation.lakumInquiryInformationObjVersion.consumedPointsAmount)
.lakumInquiryInformationObjVersion
.consumedPointsAmount !=
null
? int.parse(model
.lacumGroupInformation
.lakumInquiryInformationObjVersion
.consumedPointsAmount)
: 0, : 0,
model model.lacumGroupInformation.lakumInquiryInformationObjVersion.consumedPoints,
.lacumGroupInformation model.lacumGroupInformation.lakumInquiryInformationObjVersion.consumedPointsAmountPerYear),
.lakumInquiryInformationObjVersion
.consumedPoints,
model
.lacumGroupInformation
.lakumInquiryInformationObjVersion
.consumedPointsAmountPerYear),
SizedBox( SizedBox(
width: 8, width: 8,
), ),
LacumPointsWidget( LacumPointsWidget(mediaQuery, 4, TranslationBase.of(context).transferred, 0, model.lacumGroupInformation.lakumInquiryInformationObjVersion.transferPoints,
mediaQuery, model.lacumGroupInformation.lakumInquiryInformationObjVersion.transferPointsAmountPerYear),
4,
TranslationBase.of(context).transferred,
0,
model
.lacumGroupInformation
.lakumInquiryInformationObjVersion
.transferPoints,
model
.lacumGroupInformation
.lakumInquiryInformationObjVersion
.transferPointsAmountPerYear),
], ],
), ),
), ),
@ -189,8 +130,7 @@ class LakumMainPage extends StatelessWidget {
), ),
), ),
Container( Container(
margin: margin: EdgeInsets.symmetric(vertical: 16, horizontal: 8),
EdgeInsets.symmetric(vertical: 16, horizontal: 8),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
@ -226,45 +166,39 @@ class LakumMainPage extends StatelessWidget {
// fontSize: 14, // fontSize: 14,
// ), // ),
Container( Container(
margin: margin: EdgeInsets.symmetric(vertical: 16, horizontal: 8),
EdgeInsets.symmetric(vertical: 16, horizontal: 8), child: Row(mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [
child: Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
Row( Image.asset(
children: [ "assets/images/pharmacy_module/lakum/waiting_gained_icon.png",
Image.asset( fit: BoxFit.fill,
"assets/images/pharmacy_module/lakum/waiting_gained_icon.png", width: 20,
fit: BoxFit.fill, height: 25,
width: 20,
height: 25,
),
Padding(
padding:
EdgeInsets.symmetric(horizontal: 8),
child: Texts(
TranslationBase.of(context)
.Waitinggained,
// "Waiting gained",
fontSize: 14,
),
)
],
),
Texts(
"${model.lacumGroupInformation.lakumInquiryInformationObjVersion.waitingPoints} ${TranslationBase.of(context).lakumPoint}",
fontWeight: FontWeight.bold,
fontSize: 14,
), ),
])), Padding(
padding: EdgeInsets.symmetric(horizontal: 8),
child: Texts(
TranslationBase.of(context).Waitinggained,
// "Waiting gained",
fontSize: 14,
),
)
],
),
Texts(
"${model.lacumGroupInformation.lakumInquiryInformationObjVersion.waitingPoints} ${TranslationBase.of(context).lakumPoint}",
fontWeight: FontWeight.bold,
fontSize: 14,
),
])),
// Texts( // Texts(
// "${model.lacumGroupInformation.lakumInquiryInformationObjVersion.waitingPoints} Points", // "${model.lacumGroupInformation.lakumInquiryInformationObjVersion.waitingPoints} Points",
// fontWeight: FontWeight.bold, // fontWeight: FontWeight.bold,
// fontSize: 14, // fontSize: 14,
// ), // ),
Container( Container(
margin: margin: EdgeInsets.symmetric(vertical: 16, horizontal: 8),
EdgeInsets.symmetric(vertical: 16, horizontal: 8),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
@ -317,11 +251,7 @@ class LakumMainPage extends StatelessWidget {
} }
navigateToLakumRegister(BuildContext context) { navigateToLakumRegister(BuildContext context) {
Navigator.pushReplacement( Navigator.pushReplacement(context, FadePage(page: LakumRegistrationPage(projectViewModel.user.patientIdentificationNo)));
context,
FadePage(
page: LakumRegistrationPage(
projectViewModel.user.patientIdentificationNo)));
} }
} }
@ -331,12 +261,7 @@ List<Widget> _buildAppBarICons(BuildContext context, LacumViewModel model) {
icon: Icon(Icons.settings), icon: Icon(Icons.settings),
color: Colors.white, color: Colors.white,
onPressed: () { onPressed: () {
Navigator.push( Navigator.push(context, FadePage(page: LakumSettingPage(model.lacumInformation, model.lacumGroupInformation))).then((result) => {model.getLacumGroupData()});
context,
FadePage(
page: LakumSettingPage(
model.lacumInformation, model.lacumGroupInformation)))
.then((result) => {model.getLacumGroupData()});
}, },
), ),
]; ];
@ -402,13 +327,9 @@ class LakumHomeButtons extends StatelessWidget {
Expanded( Expanded(
child: InkWell( child: InkWell(
onTap: () { onTap: () {
print("Lacum transfer click"); Navigator.push(context, FadePage(page: LacumTransferPage(model.lacumInformation, model.lacumGroupInformation))).then((result) {
Navigator.push( model.getLacumGroupData();
context, });
FadePage(
page: LacumTransferPage(model.lacumInformation,
model.lacumGroupInformation)))
.then((result) => {model.getLacumGroupData()});
}, },
child: Container( child: Container(
padding: EdgeInsets.symmetric(horizontal: 8), padding: EdgeInsets.symmetric(horizontal: 8),
@ -460,8 +381,7 @@ class LacumPointsWidget extends StatelessWidget {
Color titleColor; Color titleColor;
final List<PointsAmountPerYear> pointsAmountPerYear; final List<PointsAmountPerYear> pointsAmountPerYear;
LacumPointsWidget(this.mediaQuery, this.pointType, this.title, this.riyal, LacumPointsWidget(this.mediaQuery, this.pointType, this.title, this.riyal, this.point, this.pointsAmountPerYear) {
this.point, this.pointsAmountPerYear) {
if (pointType == 1) { if (pointType == 1) {
titleColor = Color(0xffefefef); titleColor = Color(0xffefefef);
} else if (pointType == 2) { } else if (pointType == 2) {
@ -480,11 +400,9 @@ class LacumPointsWidget extends StatelessWidget {
onTap: () { onTap: () {
if (pointType != 1) { if (pointType != 1) {
if (pointsAmountPerYear != null && pointsAmountPerYear.length > 0) { if (pointsAmountPerYear != null && pointsAmountPerYear.length > 0) {
Navigator.push(context, Navigator.push(context, FadePage(page: LakumPointsYearPage(pointsAmountPerYear)));
FadePage(page: LakumPointsYearPage(pointsAmountPerYear)));
} else { } else {
AppToast.showErrorToast( AppToast.showErrorToast(message: TranslationBase.of(context).lakumMsg);
message: TranslationBase.of(context).lakumMsg);
// show snackBar No Details Points are there // show snackBar No Details Points are there
} }
} }

@ -2,6 +2,7 @@ import 'package:diplomaticquarterapp/core/model/pharmacies/PointsAmountPerMonth.
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/lacum-viewmodel.dart'; import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/lacum-viewmodel.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/widgets/lakum-point-table-row-widget.dart'; import 'package:diplomaticquarterapp/pages/pharmacies/widgets/lakum-point-table-row-widget.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
@ -26,9 +27,13 @@ class _LakumPointsMonthPageState extends State<LakumPointMonthPage> {
return BaseView<LacumViewModel>( return BaseView<LacumViewModel>(
builder: (_, model, wi) => AppScaffold( builder: (_, model, wi) => AppScaffold(
title: TranslationBase.of(context).LakumPoint, appBarTitle: TranslationBase.of(context).LakumPoint,
isShowAppBar: true, isShowAppBar: true,
isPharmacy: true,
showPharmacyCart: false,
isShowDecPage: false, isShowDecPage: false,
showHomeAppBarIcon: false,
isBottomBar: true,
backgroundColor: Colors.white, backgroundColor: Colors.white,
baseViewModel: model, baseViewModel: model,
body: Container( body: Container(
@ -50,16 +55,14 @@ class _LakumPointsMonthPageState extends State<LakumPointMonthPage> {
children: [ children: [
Container( Container(
height: mediaQuery.size.height * 0.06, height: mediaQuery.size.height * 0.06,
margin: EdgeInsets.symmetric( margin: EdgeInsets.symmetric(vertical: 16, horizontal: 24),
vertical: 16, horizontal: 24),
child: Row( child: Row(
crossAxisAlignment: CrossAxisAlignment.end, crossAxisAlignment: CrossAxisAlignment.end,
children: [ children: [
Expanded( Expanded(
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.end, mainAxisAlignment: MainAxisAlignment.end,
crossAxisAlignment: crossAxisAlignment: CrossAxisAlignment.start,
CrossAxisAlignment.start,
children: [ children: [
Texts( Texts(
TranslationBase.of(context).month, TranslationBase.of(context).month,
@ -78,15 +81,12 @@ class _LakumPointsMonthPageState extends State<LakumPointMonthPage> {
Expanded( Expanded(
child: Row( child: Row(
crossAxisAlignment: CrossAxisAlignment.end, crossAxisAlignment: CrossAxisAlignment.end,
mainAxisAlignment: mainAxisAlignment: MainAxisAlignment.spaceEvenly,
MainAxisAlignment.spaceEvenly,
children: [ children: [
Expanded( Expanded(
child: Column( child: Column(
mainAxisAlignment: mainAxisAlignment: MainAxisAlignment.end,
MainAxisAlignment.end, crossAxisAlignment: CrossAxisAlignment.center,
crossAxisAlignment:
CrossAxisAlignment.center,
children: [ children: [
Texts( Texts(
TranslationBase.of(context).point, TranslationBase.of(context).point,
@ -110,10 +110,8 @@ class _LakumPointsMonthPageState extends State<LakumPointMonthPage> {
), ),
Expanded( Expanded(
child: Column( child: Column(
mainAxisAlignment: mainAxisAlignment: MainAxisAlignment.end,
MainAxisAlignment.end, crossAxisAlignment: CrossAxisAlignment.center,
crossAxisAlignment:
CrossAxisAlignment.center,
children: [ children: [
Texts( Texts(
TranslationBase.of(context).riyal, TranslationBase.of(context).riyal,
@ -143,16 +141,14 @@ class _LakumPointsMonthPageState extends State<LakumPointMonthPage> {
SizedBox( SizedBox(
height: 10, height: 10,
), ),
LakumPointTableRowWidget(true, "DAY", 0, 0, null, 0), LakumPointTableRowWidget(true, "DATE", 0, 0, null, 0),
...List.generate( ...List.generate(
widget.pointsAmountPerMonth.pointsAmountPerday.length, widget.pointsAmountPerMonth.pointsAmountPerday.length,
(index) => LakumPointTableRowWidget( (index) => LakumPointTableRowWidget(
false, false,
widget.pointsAmountPerMonth.pointsAmountPerday[index].day, DateUtil.getWeekDayMonthDayYearDateFormatted(DateUtil.convertStringToDate(widget.pointsAmountPerMonth.pointsAmountPerday[index].transationDate), "en"),
widget.pointsAmountPerMonth.pointsAmountPerday[index] widget.pointsAmountPerMonth.pointsAmountPerday[index].pointsPerDay,
.pointsPerDay, widget.pointsAmountPerMonth.pointsAmountPerday[index].amountPerDay,
widget.pointsAmountPerMonth.pointsAmountPerday[index]
.amountPerDay,
() { () {
setState(() { setState(() {
if (widget.expandedItemIndex == index) { if (widget.expandedItemIndex == index) {
@ -167,22 +163,11 @@ class _LakumPointsMonthPageState extends State<LakumPointMonthPage> {
collapsed: Column( collapsed: Column(
children: [ children: [
...List.generate( ...List.generate(
widget.pointsAmountPerMonth.pointsAmountPerday[index] widget.pointsAmountPerMonth.pointsAmountPerday[index].pointsDetails.length,
.pointsDetails.length,
(index) => DayPointsDetailWidget( (index) => DayPointsDetailWidget(
widget widget.pointsAmountPerMonth.pointsAmountPerday[index].pointsDetails[index].subTransactionTypeDescription,
.pointsAmountPerMonth widget.pointsAmountPerMonth.pointsAmountPerday[index].pointsDetails[index].purchasePoints,
.pointsAmountPerday[index] widget.pointsAmountPerMonth.pointsAmountPerday[index].pointsDetails[index].amount),
.pointsDetails[index]
.subTransactionTypeDescription,
widget
.pointsAmountPerMonth
.pointsAmountPerday[index]
.pointsDetails[index].purchasePoints,
widget
.pointsAmountPerMonth
.pointsAmountPerday[index]
.pointsDetails[index].amount),
), ),
], ],
), ),
@ -199,8 +184,8 @@ class _LakumPointsMonthPageState extends State<LakumPointMonthPage> {
class DayPointsDetailWidget extends StatelessWidget { class DayPointsDetailWidget extends StatelessWidget {
final String rowTitle; final String rowTitle;
final double points; final num points;
final double riyal; final num riyal;
DayPointsDetailWidget(this.rowTitle, this.points, this.riyal); DayPointsDetailWidget(this.rowTitle, this.points, this.riyal);
@ -237,7 +222,6 @@ class DayPointsDetailWidget extends StatelessWidget {
), ),
)), )),
Expanded( Expanded(
child: Container( child: Container(
child: Texts( child: Texts(
"$points", "$points",

@ -27,9 +27,13 @@ class _LakumPointsYearPageState extends State<LakumPointsYearPage> {
return BaseView<LacumViewModel>( return BaseView<LacumViewModel>(
builder: (_, model, wi) => AppScaffold( builder: (_, model, wi) => AppScaffold(
title: TranslationBase.of(context).LakumPoint, appBarTitle: TranslationBase.of(context).LakumPoint,
isShowAppBar: true, isShowAppBar: true,
isPharmacy: true,
showPharmacyCart: false,
isShowDecPage: false, isShowDecPage: false,
showHomeAppBarIcon: false,
isBottomBar: true,
backgroundColor: Colors.white, backgroundColor: Colors.white,
baseViewModel: model, baseViewModel: model,
body: Container( body: Container(
@ -103,6 +107,7 @@ class LacumPointsYearWidget extends StatelessWidget {
child: Container( child: Container(
width: mediaQuery.size.width / 2 - 16, width: mediaQuery.size.width / 2 - 16,
padding: EdgeInsets.only(top: 12, left: 8, right: 8, bottom: 4), padding: EdgeInsets.only(top: 12, left: 8, right: 8, bottom: 4),
margin: EdgeInsets.only(right: 8.0),
decoration: BoxDecoration( decoration: BoxDecoration(
shape: BoxShape.rectangle, shape: BoxShape.rectangle,
borderRadius: BorderRadius.circular(8), borderRadius: BorderRadius.circular(8),
@ -175,7 +180,7 @@ class LacumPointsYearWidget extends StatelessWidget {
children: [ children: [
Texts(TranslationBase.of(context).sar, Texts(TranslationBase.of(context).sar,
// "RIYAL", // "RIYAL",
fontSize: 13, fontSize: 12,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
color: isSelected ? Colors.white : Colors.black, color: isSelected ? Colors.white : Colors.black,
), ),

@ -94,7 +94,7 @@ class ReviewsInfo extends StatelessWidget {
child: Container( child: Container(
child: Text( child: Text(
previousModel previousModel
.productDetailService[0].reviews[index].reviewText, .productDetailService[0].reviews[index].replyText,
style: TextStyle(fontSize: 20), style: TextStyle(fontSize: 20),
), ),
), ),

@ -5,8 +5,8 @@ import 'package:flutter/material.dart';
class LakumPointTableRowWidget extends StatefulWidget { class LakumPointTableRowWidget extends StatefulWidget {
final bool isTableTitle; // true : title , false: row final bool isTableTitle; // true : title , false: row
final String rowTitle; final String rowTitle;
final double points; final num points;
final double riyal; final num riyal;
final Function onTap; final Function onTap;
final int rowIndex; final int rowIndex;
final Widget collapsed; final Widget collapsed;

@ -36,6 +36,7 @@ class _ProductReviewPageState extends State<ProductReviewPage> {
isPharmacy: true, isPharmacy: true,
showPharmacyCart: false, showPharmacyCart: false,
showHomeAppBarIcon: false, showHomeAppBarIcon: false,
isBottomBar: true,
body: Container( body: Container(
color: Colors.white, color: Colors.white,
child: !finishReview ? SingleChildScrollView( child: !finishReview ? SingleChildScrollView(
@ -118,7 +119,7 @@ class _ProductReviewPageState extends State<ProductReviewPage> {
child: RichText( child: RichText(
text: TextSpan( text: TextSpan(
text: text:
'(${widget.product.approvedTotalReviews} reviews)', '(${widget.product.approvedTotalReviews} ${TranslationBase.of(context).reviews})',
style: TextStyle( style: TextStyle(
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
color: Colors.grey, color: Colors.grey,
@ -203,7 +204,7 @@ class _ProductReviewPageState extends State<ProductReviewPage> {
? () { ? () {
model model
.makeReview( .makeReview(
widget.product, ratingValue, reviewText, context) widget.product, ratingValue, reviewText)
.then((value) { .then((value) {
setState(() { setState(() {
finishReview = true; finishReview = true;
@ -326,41 +327,41 @@ class _ProductReviewPageState extends State<ProductReviewPage> {
], ],
), ),
), ),
Container( // Container(
margin: EdgeInsets.only(top: 20.0), // margin: EdgeInsets.only(top: 20.0),
child: InkWell( // child: InkWell(
onTap: () { // onTap: () {
Navigator.push( // Navigator.push(
context, // context,
MaterialPageRoute(builder: (context) { // MaterialPageRoute(builder: (context) {
return PharmacyProfilePage(); // return PharmacyProfilePage(moveToOrder: true);
}), // }),
); // );
}, // },
child: Container( // child: Container(
height: 50.0, // height: 50.0,
color: Colors.transparent, // color: Colors.transparent,
child: Container( // child: Container(
decoration: BoxDecoration( // decoration: BoxDecoration(
border: Border.all( // border: Border.all(
color: Colors.orange, // color: Colors.orange,
style: BorderStyle.solid, // style: BorderStyle.solid,
width: 1.0), // width: 1.0),
color: Colors.transparent, // color: Colors.transparent,
borderRadius: BorderRadius.circular(5.0)), // borderRadius: BorderRadius.circular(5.0)),
child: Center( // child: Center(
child: Text( // child: Text(
TranslationBase.of(context).backMyAccount, // TranslationBase.of(context).backMyAccount,
style: TextStyle( // style: TextStyle(
color: Colors.orange, // color: Colors.orange,
fontWeight: FontWeight.bold, // fontWeight: FontWeight.bold,
), // ),
), // ),
), // ),
), // ),
), // ),
), // ),
), // ),
], ],
); );
} }

@ -34,11 +34,16 @@ class PharmacyAddressesPage extends StatefulWidget {
class _PharmacyAddressesState extends State<PharmacyAddressesPage> { class _PharmacyAddressesState extends State<PharmacyAddressesPage> {
void navigateToAddressPage(BuildContext ctx, PharmacyAddressesViewModel model, AddressInfo address) { void navigateToAddressPage(BuildContext ctx, PharmacyAddressesViewModel model, AddressInfo address) {
Navigator.push( Navigator.push(
ctx, ctx,
FadePage( FadePage(
page: AddAddressPage(address, (pickResult) async { page: AddAddressPage(
await model.addEditAddress(pickResult, address); address,
}))).then((value) async { (pickResult) async {
await model.addEditAddress(pickResult, address);
},
),
),
).then((value) async {
// await model.getAddressesList(); // await model.getAddressesList();
}); });
} }
@ -153,8 +158,6 @@ class _PharmacyAddressesState extends State<PharmacyAddressesPage> {
_navigateToPaymentOption(model) { _navigateToPaymentOption(model) {
if (widget.isUpdate) { if (widget.isUpdate) {
print("sfsf");
widget.orderPreviewViewModel.paymentCheckoutData.address = Addresses.fromJson(model.addresses[model.selectedAddressIndex].toJson()); widget.orderPreviewViewModel.paymentCheckoutData.address = Addresses.fromJson(model.addresses[model.selectedAddressIndex].toJson());
widget.changeMainState(); widget.changeMainState();
Navigator.pop(context); Navigator.pop(context);
@ -314,26 +317,24 @@ class _AddressItemWidgetState extends State<AddressItemWidget> {
textColor: Color(0x99FF0000), textColor: Color(0x99FF0000),
handler: () { handler: () {
ConfirmDialog dialog = new ConfirmDialog( ConfirmDialog dialog = new ConfirmDialog(
// context: context, context: context,
title: TranslationBase.of(context).deleteAddress, title: TranslationBase.of(context).deleteAddress,
//"Are you sure want to delete",
confirmMessage: "${widget.address.address1} ${widget.address.address2}", 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: () => {
widget.model.deleteAddresses(widget.address).then((_) { ConfirmDialog.closeAlertDialog(context),
ConfirmDialog.closeAlertDialog(context); setState(() {
AppToast.showErrorToast( widget.model.deleteAddresses(widget.address).then((_) {
message: TranslationBase.of(context).deletedAddress, AppToast.showSuccessToast(
// "Address has been deleted" message: TranslationBase.of(context).deletedAddress,
); );
}) // widget.model.getAddressesList();
});
}),
}, },
cancelFunction: () => {}); cancelFunction: () => {});
dialog.showAlertDialog(context); dialog.showAlertDialog(context);
setState(() {
widget.model.deleteAddresses(widget.address);
});
}, },
icon: Icon( icon: Icon(
Icons.delete, Icons.delete,

@ -1,10 +1,12 @@
import 'dart:io' show Platform; import 'dart:io' show Platform;
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart'; import 'package:flutter_svg/flutter_svg.dart';
import 'package:maps_launcher/maps_launcher.dart'; import 'package:maps_launcher/maps_launcher.dart';
import 'package:provider/provider.dart';
import 'package:url_launcher/url_launcher.dart'; import 'package:url_launcher/url_launcher.dart';
import 'package:map_launcher/map_launcher.dart'; import 'package:map_launcher/map_launcher.dart';
import 'dart:io' show Platform; import 'dart:io' show Platform;
@ -17,6 +19,7 @@ class pharmacyContactsPage extends StatefulWidget {
class _pharmacyContactsPageState extends State<pharmacyContactsPage> { class _pharmacyContactsPageState extends State<pharmacyContactsPage> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
final latitude = "24.704016"; final latitude = "24.704016";
final longitude = "46.676691"; final longitude = "46.676691";
final phone = "+966112833400"; final phone = "+966112833400";
@ -48,7 +51,7 @@ class _pharmacyContactsPageState extends State<pharmacyContactsPage> {
), ),
child: Container( child: Container(
margin: EdgeInsets.all(10), margin: EdgeInsets.all(10),
padding: EdgeInsets.fromLTRB(5, 15, 5, 15), padding: EdgeInsets.fromLTRB(5, 15, 5, 5),
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.all( borderRadius: BorderRadius.all(
Radius.circular(15), Radius.circular(15),
@ -58,17 +61,82 @@ class _pharmacyContactsPageState extends State<pharmacyContactsPage> {
children: [ children: [
Padding( Padding(
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0),
child: Container( child: projectViewModel.isArabic ?
child: Text(TranslationBase.of(context).contactUsTime, Column(
style: TextStyle( crossAxisAlignment: CrossAxisAlignment.start,
color: Colors.grey[700], children: [
fontSize: 16, Text("أوقات عمل مركز الخدمات الصيدلانية:",
fontWeight: FontWeight.w600, //TranslationBase.of(context).contactUsTime,
letterSpacing: -0.68)), style: TextStyle(
), color: Colors.grey[700],
fontSize: 18,
fontWeight: FontWeight.bold,
letterSpacing: -0.68)),
SizedBox(height: 8),
Text(" السبت - الأربعاء : من 8 صباحاً إلى 10 مساءً ",
//TranslationBase.of(context).contactUsTime,
style: TextStyle(
color: Colors.grey[700],
fontSize: 16,
fontWeight: FontWeight.w600,
letterSpacing: -0.68)),
SizedBox(height: 5),
Text("الــــخـــمــــيـــس : من 8 صباحاً إلى 8 مساءً",
//TranslationBase.of(context).contactUsTime,
style: TextStyle(
color: Colors.grey[700],
fontSize: 16,
fontWeight: FontWeight.w600,
letterSpacing: -0.68)),
SizedBox(height: 5),
Text("الـــجــــمـــــعـــــة : من 2 ظـهـراً إلى 8 مساءً",
//TranslationBase.of(context).contactUsTime,
style: TextStyle(
color: Colors.grey[700],
fontSize: 16,
fontWeight: FontWeight.w600,
letterSpacing: -0.68)),
],
):Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text("Pharmaceutical Service Center working hours: ",
//TranslationBase.of(context).contactUsTime,
style: TextStyle(
color: Colors.grey[700],
fontSize: 16,
fontWeight: FontWeight.bold,
letterSpacing: -0.68)),
SizedBox(height: 8),
Text("Sat Wed: from 8 AM to 10 PM",
//TranslationBase.of(context).contactUsTime,
style: TextStyle(
color: Colors.grey[700],
fontSize: 16,
fontWeight: FontWeight.w600,
letterSpacing: -0.68)),
SizedBox(height: 5),
Text("Thursday: from 8 AM to 8 PM",
//TranslationBase.of(context).contactUsTime,
style: TextStyle(
color: Colors.grey[700],
fontSize: 16,
fontWeight: FontWeight.w600,
letterSpacing: -0.68)),
SizedBox(height: 5),
Text("Friday : from 2 PM to 8 PM",
//TranslationBase.of(context).contactUsTime,
style: TextStyle(
color: Colors.grey[700],
fontSize: 16,
fontWeight: FontWeight.w600,
letterSpacing: -0.68)),
],
),
), ),
SizedBox( SizedBox(
height: 35, height: 20,
), ),
Row( Row(
children: <Widget>[ children: <Widget>[
@ -94,12 +162,15 @@ class _pharmacyContactsPageState extends State<pharmacyContactsPage> {
SizedBox( SizedBox(
width: 30, width: 30,
), ),
Text("+966 " + " -11- 2833400", Directionality(
style: TextStyle( textDirection: TextDirection.ltr,
color: Colors.grey[700], child: Text("+966" +"-11-2833400",
fontSize: 16, style: TextStyle(
fontWeight: FontWeight.w600, color: Colors.grey[700],
letterSpacing: -0.68)), fontSize: 16,
fontWeight: FontWeight.w600,
letterSpacing: -0.68)),
),
], ],
), ),
SizedBox( SizedBox(
@ -130,7 +201,7 @@ class _pharmacyContactsPageState extends State<pharmacyContactsPage> {
SizedBox( SizedBox(
width: 30, width: 30,
), ),
Text("+966 " + " 558434444", Text(projectViewModel.isArabic ? "558434444 " + " 966+" :"+966 " + " 558434444",
style: TextStyle( style: TextStyle(
color: Colors.grey[700], color: Colors.grey[700],
fontSize: 16, fontSize: 16,

@ -30,8 +30,9 @@ dynamic languageID;
class PharmacyProfilePage extends StatefulWidget { class PharmacyProfilePage extends StatefulWidget {
final bool moveToOrder; final bool moveToOrder;
final Function(int) changeTab;
PharmacyProfilePage({@required this.moveToOrder}); PharmacyProfilePage({@required this.moveToOrder, this.changeTab});
@override @override
_ProfilePageState createState() => _ProfilePageState(); _ProfilePageState createState() => _ProfilePageState();
@ -62,8 +63,6 @@ class _ProfilePageState extends State<PharmacyProfilePage> {
customerId = custID; customerId = custID;
customerGUID = custGUID; customerGUID = custGUID;
}); });
print("customer Id is" + customerId);
print("customer GUID is" + customerGUID);
return customerId; return customerId;
} }
@ -73,8 +72,6 @@ class _ProfilePageState extends State<PharmacyProfilePage> {
user = AuthenticatedUser.fromJson(userData); user = AuthenticatedUser.fromJson(userData);
setState(() { setState(() {
firstName = user.firstName.toString(); firstName = user.firstName.toString();
print("this is user" + user.firstName.toString());
print("this is user" + user.firstNameN.toString());
}); });
} else { } else {
if (userData == null) { if (userData == null) {
@ -114,6 +111,9 @@ class _ProfilePageState extends State<PharmacyProfilePage> {
showPharmacyCart: false, showPharmacyCart: false,
showHomeAppBarIcon: false, showHomeAppBarIcon: false,
isMainPharmacyPages: true, isMainPharmacyPages: true,
backButtonTab: () {
widget.changeTab(0);
},
body: user != null body: user != null
? Container( ? Container(
color: Colors.white, color: Colors.white,

@ -202,7 +202,7 @@ class _SearchProductsPageState extends State<SearchProductsPage> {
? MediaQuery.of(context) ? MediaQuery.of(context)
.size .size
.width / .width /
5 3
: 0, : 0,
padding: EdgeInsets.all(4), padding: EdgeInsets.all(4),
decoration: BoxDecoration( decoration: BoxDecoration(

@ -22,6 +22,7 @@ import 'package:flutter/material.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart'; import 'package:pull_to_refresh/pull_to_refresh.dart';
import 'package:rating_bar/rating_bar.dart'; import 'package:rating_bar/rating_bar.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart' as utils ;
import 'base/base_view.dart'; import 'base/base_view.dart';
import 'final_products_page.dart'; import 'final_products_page.dart';
@ -151,7 +152,7 @@ class _SubCategorisePageState extends State<SubCategorisePage> {
padding: EdgeInsets.all(10.0), padding: EdgeInsets.all(10.0),
child: Container( child: Container(
child: Texts(TranslationBase.of(context) child: Texts(TranslationBase.of(context)
.viewCategorise), .viewSubCategorise),
), ),
), ),
Icon(Icons.arrow_forward) Icon(Icons.arrow_forward)
@ -416,7 +417,7 @@ class _SubCategorisePageState extends State<SubCategorisePage> {
title: Texts( title: Texts(
TranslationBase.of( TranslationBase.of(
context) context)
.categorise), .subGroup),
children: [ children: [
ProcedureListWidget( ProcedureListWidget(
model: model, model: model,
@ -837,7 +838,7 @@ class _SubCategorisePageState extends State<SubCategorisePage> {
context) context)
.size .size
.width / .width /
5 3
: 0, : 0,
padding: padding:
EdgeInsets.all(4), EdgeInsets.all(4),
@ -993,273 +994,425 @@ class _SubCategorisePageState extends State<SubCategorisePage> {
itemCount: model.subProducts.length, itemCount: model.subProducts.length,
itemBuilder: itemBuilder:
(BuildContext context, int index) { (BuildContext context, int index) {
return InkWell( return InkWell(
child: Card( child: Card(
child: Row( child: Row(
children: [
Stack(
children: [ children: [
Column( Stack(
children: [ children: [
Container( Column(
decoration: children: [
BoxDecoration(), Container(
child: Padding( decoration: BoxDecoration(),
padding: child: Padding(
EdgeInsets padding: EdgeInsets.only(
.only( left: 9.0,
left: 9.0, top: 8.0,
top: 8.0, right: 10.0,
right: 10.0, ),
),
), ),
), Container(
), margin: EdgeInsets.fromLTRB(0, 0, 0, 8),
Container( alignment: Alignment.center,
margin: EdgeInsets child:(model.subProducts[index].images != null &&
.fromLTRB( model.subProducts[index].images.length > 0)
0, 0, 0, 0), ? Image.network(
alignment: Alignment model.subProducts[index].images[0].src,
.center, fit: BoxFit.cover,
child: model height: 80,
.subProducts[ width: 80,
index]
.images )
.isNotEmpty : Image.asset(
? Image.network( "assets/images/no_image.png",
model fit: BoxFit.cover,
.subProducts[ height: 80,
index] width: 80,
.images[ ),
0] ),
.thumb, ],
fit: BoxFit
.contain,
height: 70,
)
: Text(TranslationBase.of(
context)
.noImage),
), ),
], Column(
), children: [
Column( Container(
children: [ width: model.subProducts[index].rxMessage != null ? MediaQuery.of(context).size.width / 3.70 : 0,
Container( padding: EdgeInsets.all(4),
width: model decoration: BoxDecoration(
.subProducts[ color: Color(0xffb23838),
index] //borderRadius: BorderRadius.only(topLeft: Radius.circular(5)),
.rxMessage != ),
null child:model.subProducts[index].rxMessage != null
? MediaQuery.of( ? Texts(
context) projectProvider.isArabic ? model.subProducts[index].rxMessagen : model.subProducts[index].rxMessage,
.size color: Colors.white,
.width / regular: true,
5.3 fontSize: 8,
: 0, fontWeight: FontWeight.w600,
padding: )
EdgeInsets.all( : Texts(""),
4), ),
decoration: ],
BoxDecoration(
color: Color(
0xffb23838),
borderRadius: BorderRadius.only(
topLeft: Radius
.circular(
6)),
),
child: model
.subProducts[
index]
.rxMessage !=
null
? Texts(
projectProvider
.isArabic
? model
.subProducts[
index]
.rxMessagen
: model
.subProducts[index]
.rxMessage,
color: Colors
.white,
regular:
true,
fontSize:
10,
fontWeight:
FontWeight
.w400,
)
: Texts(""),
// Texts(
// model.subProducts[index].rxMessage != null ? model.subProducts[index].rxMessage : "",
// color: Colors.white,
// regular: true,
// fontSize: 10,
// fontWeight: FontWeight.w400,
// ),
), ),
], ],
), ),
], Container(
), height: 100.0,
Container( margin: EdgeInsets.symmetric(
height: 130.0, horizontal: 6,
margin: vertical: 0,
EdgeInsets.symmetric(
horizontal: 0,
vertical: 0,
),
child: Column(
mainAxisAlignment:
MainAxisAlignment
.spaceAround,
crossAxisAlignment:
CrossAxisAlignment
.start,
children: [
SizedBox(
height: 4.0,
),
Container(
width: MediaQuery.of(
context)
.size
.width *
0.65,
child: Texts(
projectViewModel
.isArabic
? model
.subProducts[
index]
.namen
: model
.subProducts[
index]
.name,
// model.subProducts[index].name,
regular: true,
fontSize: 13.2,
fontWeight:
FontWeight.w500,
maxLines: 5,
),
),
SizedBox(
height: 8.0,
),
Padding(
padding:
const EdgeInsets
.only(
top: 4,
bottom: 4),
child: Texts(
"SAR ${model.subProducts[index].price}",
bold: true,
fontSize: 14,
),
), ),
Row( child: Column(
mainAxisAlignment: MainAxisAlignment.spaceAround,
crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
// StarRating( SizedBox(
// totalAverage: model.subProducts[index].approvedRatingSum > 0 height: 4.0,
// ? (model.subProducts[index].approvedRatingSum.toDouble() / model.subProducts[index].approvedRatingSum.toDouble()).toDouble() ),
// : 0, Container(
// forceStars: true), width: MediaQuery.of(context).size.width * 0.55,
RatingBar.readOnly( child: Texts(projectViewModel.isArabic ? model.subProducts[index].namen : model.subProducts[index].name,
initialRating: model regular: true,
.subProducts[ fontSize: 13.2,
index] fontWeight: FontWeight.w500,
.approvedRatingSum maxLines: 5,
.toDouble(), ),
size: 15.0, ),
filledColor: SizedBox(
Colors.yellow[ height: 8.0,
700], ),
emptyColor: Colors Padding(
.grey[500], padding: const EdgeInsets.only(top: 4, bottom: 4),
isHalfAllowed: child: Texts(
true, "SAR ${model.subProducts[index].price}",
halfFilledIcon: bold: true,
Icons fontSize: 14,
.star_half, ),
filledIcon: ),
Icons.star, Row(
emptyIcon: children: [
Icons.star, RatingBar.readOnly(
initialRating: model.subProducts[index].approvedRatingSum.toDouble(),
size: 15.0,
filledColor: Colors.yellow[700],
emptyColor: Colors.grey[500],
isHalfAllowed: true,
halfFilledIcon: Icons.star_half,
filledIcon: Icons.star,
emptyIcon: Icons.star,
),
Texts(
"(${model.subProducts[index].approvedTotalReviews})",
regular: true,
fontSize: 10,
fontWeight: FontWeight.w400,
)
],
), ),
Texts(
"(${model.subProducts[index].approvedTotalReviews})",
regular: true,
fontSize: 10,
fontWeight:
FontWeight
.w400,
)
], ],
), ),
], ),
), widget.authenticatedUserObject.isLogin
? Container(
child: IconButton(
icon: Icon(
Icons.shopping_cart,
size: 18,
color: CustomColors.green,
),
onPressed: () async {
if (model.subProducts[index].isRx == false) {
GifLoaderDialogUtils.showMyDialog(context);
await addToCartFunction(1, model.subProducts[index].id);
GifLoaderDialogUtils.hideDialog(context);
utils.Utils.navigateToCartPage();
} else {
AppToast.showErrorToast(message: TranslationBase.of(context).needPrescription);
}
//
}),
)
: Container(),
],
), ),
widget.authenticatedUserObject ),
.isLogin onTap: () => {
? Container( Navigator.push(
child: IconButton( context,
icon: Icon( FadePage(
Icons page: ProductDetailPage(model.subProducts[index]),
.shopping_cart, )),
size: 18, },
color: );
CustomColors // return InkWell(
.green, // child: Card(
), // child: Row(
onPressed: // children: [
() async { // Stack(
if (model // children: [
.subProducts[ // Column(
index] // children: [
.isRx == false) { // Container(
GifLoaderDialogUtils // decoration:
.showMyDialog( // BoxDecoration(),
context); // child: Padding(
await addToCartFunction( // padding:
1, // EdgeInsets
model // .only(
.subProducts[ // left: 9.0,
index] // top: 8.0,
.id); // right: 10.0,
GifLoaderDialogUtils // ),
.hideDialog( // ),
context); // ),
Utils // Container(
.navigateToCartPage(); // margin: EdgeInsets
} else { // .fromLTRB(
AppToast.showErrorToast( // 0, 0, 0, 0),
message: TranslationBase.of( // alignment: Alignment
context) // .center,
.needPrescription); // child: model
} // .subProducts[
}), // index]
) // .images
: Container(), // .isNotEmpty
], // ? Image.network(
), // model
), // .subProducts[
onTap: () => { // index]
Navigator.push( // .images[
context, // 0]
FadePage( // .thumb,
page: ProductDetailPage( // fit: BoxFit
model.subProducts[ // .contain,
index]), // height: 70,
)), // )
}, // : Text(TranslationBase.of(
); // context)
// .noImage),
// ),
// ],
// ),
// Column(
// children: [
// Container(
// width: model
// .subProducts[
// index]
// .rxMessage !=
// null
// ? MediaQuery.of(
// context)
// .size
// .width /
// 3.70
// : 0,
// padding:
// EdgeInsets.all(
// 4),
// decoration:
// BoxDecoration(
// color: Color(
// 0xffb23838),
// // borderRadius: BorderRadius.only(
// // topLeft: Radius
// // .circular(
// // 6)),
// ),
// child: model
// .subProducts[
// index]
// .rxMessage !=
// null
// ? Texts(
// projectProvider
// .isArabic
// ? model
// .subProducts[
// index]
// .rxMessagen
// : model
// .subProducts[index]
// .rxMessage,
// color: Colors
// .white,
// regular:
// true,
// fontSize:
// 10,
// fontWeight:
// FontWeight
// .w400,
// )
// : Texts(""),
// // Texts(
// // model.subProducts[index].rxMessage != null ? model.subProducts[index].rxMessage : "",
// // color: Colors.white,
// // regular: true,
// // fontSize: 10,
// // fontWeight: FontWeight.w400,
// // ),
// ),
// ],
// ),
// ],
// ),
// Container(
// height: 130.0,
// margin:
// EdgeInsets.symmetric(
// horizontal: 0,
// vertical: 0,
// ),
// child: Column(
// mainAxisAlignment:
// MainAxisAlignment
// .spaceAround,
// crossAxisAlignment:
// CrossAxisAlignment
// .start,
// children: [
// SizedBox(
// height: 4.0,
// ),
// Container(
// width: MediaQuery.of(
// context)
// .size
// .width *
// 0.65,
// child: Texts(
// projectViewModel
// .isArabic
// ? model
// .subProducts[
// index]
// .namen
// : model
// .subProducts[
// index]
// .name,
// // model.subProducts[index].name,
// regular: true,
// fontSize: 13.2,
// fontWeight:
// FontWeight.w500,
// maxLines: 5,
// ),
// ),
// SizedBox(
// height: 8.0,
// ),
// Padding(
// padding:
// const EdgeInsets
// .only(
// top: 4,
// bottom: 4),
// child: Texts(
// "SAR ${model.subProducts[index].price}",
// bold: true,
// fontSize: 14,
// ),
// ),
// Row(
// children: [
// // StarRating(
// // totalAverage: model.subProducts[index].approvedRatingSum > 0
// // ? (model.subProducts[index].approvedRatingSum.toDouble() / model.subProducts[index].approvedRatingSum.toDouble()).toDouble()
// // : 0,
// // forceStars: true),
// RatingBar.readOnly(
// initialRating: model
// .subProducts[
// index]
// .approvedRatingSum
// .toDouble(),
// size: 15.0,
// filledColor:
// Colors.yellow[
// 700],
// emptyColor: Colors
// .grey[500],
// isHalfAllowed:
// true,
// halfFilledIcon:
// Icons
// .star_half,
// filledIcon:
// Icons.star,
// emptyIcon:
// Icons.star,
// ),
// Texts(
// "(${model.subProducts[index].approvedTotalReviews})",
// regular: true,
// fontSize: 10,
// fontWeight:
// FontWeight
// .w400,
// )
// ],
// ),
// ],
// ),
// ),
// widget.authenticatedUserObject
// .isLogin
// ? Container(
// child: IconButton(
// icon: Icon(
// Icons
// .shopping_cart,
// size: 18,
// color:
// CustomColors
// .green,
// ),
// onPressed:
// () async {
// if (model
// .subProducts[
// index]
// .isRx == false) {
// GifLoaderDialogUtils
// .showMyDialog(
// context);
// await addToCartFunction(
// 1,
// model
// .subProducts[
// index]
// .id);
// GifLoaderDialogUtils
// .hideDialog(
// context);
// Utils
// .navigateToCartPage();
// } else {
// AppToast.showErrorToast(
// message: TranslationBase.of(
// context)
// .needPrescription);
// }
// }),
// )
// : Container(),
// ],
// ),
// ),
// onTap: () => {
// Navigator.push(
// context,
// FadePage(
// page: ProductDetailPage(
// model.subProducts[
// index]),
// )),
// },
// );
}), }),
) )
: Padding( : Padding(

@ -134,20 +134,20 @@ class Signaling {
void registerPeerConnectionListeners() { void registerPeerConnectionListeners() {
peerConnection.onIceCandidate = (RTCIceCandidate candidate){ peerConnection.onIceCandidate = (RTCIceCandidate candidate){
print(json.encode(candidate.toMap())); // print(json.encode(candidate.toMap()));
signalR.addIceCandidate(json.encode(candidate.toMap())); signalR.addIceCandidate(json.encode(candidate.toMap()));
}; };
peerConnection?.onIceGatheringState = (RTCIceGatheringState state) { peerConnection?.onIceGatheringState = (RTCIceGatheringState state) {
print('ICE gathering state changed: $state'); // print('ICE gathering state changed: $state');
}; };
peerConnection?.onConnectionState = (RTCPeerConnectionState state) { peerConnection?.onConnectionState = (RTCPeerConnectionState state) {
print('Connection state change: $state ${state.index}'); // print('Connection state change: $state ${state.index}');
}; };
peerConnection?.onSignalingState = (RTCSignalingState state) { peerConnection?.onSignalingState = (RTCSignalingState state) {
print('Signaling state change: $state'); // print('Signaling state change: $state');
}; };
} }
} }

@ -904,6 +904,28 @@ class DoctorsListService extends BaseService {
return Future.value(localRes); return Future.value(localRes);
} }
Future<Map> autoGenerateAncillaryOrdersInvoice(String orderNo, int projectID, dynamic appointmentID, List<dynamic> selectedProcListAPI, BuildContext context) async {
Map<String, dynamic> request;
if (await this.sharedPref.getObject(USER_PROFILE) != null) {
var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE));
authUser = data;
}
var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
Request req = appGlobal.getPublicRequest();
request = {
"RequestAncillaryOrderInvoice": [
{"MemberID": 102, "ProjectID": projectID, "AppointmentNo": appointmentID, "OrderNo": orderNo, "AncillaryOrderInvoiceProcList": selectedProcListAPI}
]
};
dynamic localRes;
await baseAppClient.post(GENERATE_ANCILLARY_ORDERS_INVOICE, onSuccess: (response, statusCode) async {
localRes = response;
}, onFailure: (String error, int statusCode) {
throw error;
}, body: request);
return Future.value(localRes);
}
Future<Map> isAllowedToAskDoctor(int docID, BuildContext context) async { Future<Map> isAllowedToAskDoctor(int docID, BuildContext context) async {
Map<String, dynamic> request; Map<String, dynamic> request;
if (await this.sharedPref.getObject(USER_PROFILE) != null) { if (await this.sharedPref.getObject(USER_PROFILE) != null) {

@ -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) {

@ -5,6 +5,7 @@ import 'package:diplomaticquarterapp/core/service/base_service.dart';
import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart';
import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart'; import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:flutter/material.dart';
class CancelOrderService extends BaseService{ class CancelOrderService extends BaseService{

@ -58,7 +58,7 @@ class OrderDetailsService extends BaseService{
reviewBody["store_id"] = 2; reviewBody["store_id"] = 2;
reviewBody["title"] = ""; reviewBody["title"] = "";
body['review'] = reviewBody; body['review'] = reviewBody;
await baseAppClient.post("$PHARMACY_MAKE_REVIEW", await baseAppClient.postPharmacy("$PHARMACY_MAKE_REVIEW",
onSuccess: (response, statusCode) async { onSuccess: (response, statusCode) async {
/* /*
"success": { "success": {

@ -74,7 +74,7 @@ class PharmacyAddressService extends BaseService {
Future addCustomerAddress(AddressInfo address) async { Future addCustomerAddress(AddressInfo address) async {
await makeCustomerAddress(address, ADD_CUSTOMER_ADDRESS); await makeCustomerAddress(address, ADD_CUSTOMER_ADDRESS);
// if(!hasError) { // if(!hasError) {
selectedAddressIndex = addresses.length +1; // selectedAddressIndex = addresses.length + 1;
// } // }
} }
@ -100,14 +100,14 @@ class PharmacyAddressService extends BaseService {
body["customer"] = customerObject; body["customer"] = customerObject;
await baseAppClient.postPharmacy("$url", onSuccess: (response, statusCode) async { await baseAppClient.postPharmacy("$url", onSuccess: (response, statusCode) async {
addresses.clear(); // addresses.clear();
response['customers'][0]['addresses'].forEach((item) { // response['customers'][0]['addresses'].forEach((item) {
addresses.add(AddressInfo.fromJson(item)); // addresses.add(AddressInfo.fromJson(item));
}); // });
getAddresses(); // getAddresses();
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
super.error = error; super.error = error;
}, body: body); },isAllowAny: true, body: body);
} }
} }

@ -48,7 +48,11 @@ class ProductDetailService extends BaseService {
Future getProductReviews(productID) async { Future getProductReviews(productID) async {
hasError = false; hasError = false;
await baseAppClient.getPharmacy(GET_PRODUCT_DETAIL + productID + "?fields=reviews,stock_quantity,stock_availability,stock_availabilityn,IsStockAvailable", onSuccess: (dynamic response, int statusCode) { await baseAppClient.getPharmacy(
GET_PRODUCT_DETAIL +
productID +
"?fields=reviews,stock_quantity,stock_availability,stock_availabilityn,IsStockAvailable",
onSuccess: (dynamic response, int statusCode) {
_productDetailList.clear(); _productDetailList.clear();
response['products'].forEach((item) { response['products'].forEach((item) {
_productDetailList.add(ProductDetail.fromJson(item)); _productDetailList.add(ProductDetail.fromJson(item));
@ -82,7 +86,8 @@ class ProductDetailService extends BaseService {
// "generalid": "Cs2020@2016\$2958", // "generalid": "Cs2020@2016\$2958",
// "isDentalAllowedBackend": false // "isDentalAllowedBackend": false
}; };
await baseAppClient.post(GET_LOCATION, onSuccess: (dynamic response, int statusCode) { await baseAppClient.post(GET_LOCATION,
onSuccess: (dynamic response, int statusCode) {
_productLocationList.clear(); _productLocationList.clear();
response['PharmList'].forEach((item) { response['PharmList'].forEach((item) {
_productLocationList.add(LocationModel.fromJson(item)); _productLocationList.add(LocationModel.fromJson(item));
@ -101,23 +106,32 @@ class ProductDetailService extends BaseService {
Map<String, dynamic> request; Map<String, dynamic> request;
request = { request = {
"shopping_cart_item": {"quantity": quantity, "shopping_cart_type": "1", "product_id": itemID, "customer_id": customerId, "language_id": 1} "shopping_cart_item": {
"quantity": quantity,
"shopping_cart_type": "1",
"product_id": itemID,
"customer_id": customerId,
"language_id": 1
}
}; };
dynamic localRes; dynamic localRes;
await baseAppClient.pharmacyPost(GET_SHOPPING_CART, isExternal: false, onSuccess: (dynamic response, int statusCode) { await baseAppClient.pharmacyPost(GET_SHOPPING_CART, isExternal: false,
onSuccess: (dynamic response, int statusCode) {
_addToCartModel.clear(); _addToCartModel.clear();
response['shopping_carts'].forEach((item) { response['shopping_carts'].forEach((item) {
_addToCartModel.add(Wishlist.fromJson(item)); _addToCartModel.add(Wishlist.fromJson(item));
}); });
AppToast.showSuccessToast(message: TranslationBase.of(context).addToCartMsg AppToast.showSuccessToast(
// 'You have added a product to the cart' message: TranslationBase.of(context).addToCartMsg
); // 'You have added a product to the cart'
);
localRes = response; localRes = response;
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
super.error = error; super.error = error;
AppToast.showErrorToast(message: error ?? Utils.generateContactAdminMessage()); AppToast.showErrorToast(
message: error ?? Utils.generateContactAdminMessage());
}, body: request); }, body: request);
return Future.value(localRes); return Future.value(localRes);
@ -125,15 +139,19 @@ class ProductDetailService extends BaseService {
Future notifyMe(customerId, itemID) async { Future notifyMe(customerId, itemID) async {
hasError = false; hasError = false;
await baseAppClient.getPharmacy(SUBSCRIBE_PRODUCT + "SinceId=$customerId&ProductId=$itemID", onSuccess: (dynamic response, int statusCode) { await baseAppClient.getPharmacy(
AppToast.showSuccessToast(message: TranslationBase.of(AppGlobal.context).notifyMeMsg SUBSCRIBE_PRODUCT + "SinceId=$customerId&ProductId=$itemID",
// TranslationBase.of(context).notifyMeMsg onSuccess: (dynamic response, int statusCode) {
//'You will be notified when product available' AppToast.showSuccessToast(
message: TranslationBase.of(AppGlobal.context).notifyMeMsg
// TranslationBase.of(context).notifyMeMsg
//'You will be notified when product available'
); );
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
super.error = error; super.error = error;
AppToast.showErrorToast(message: error ?? Utils.generateContactAdminMessage()); AppToast.showErrorToast(
message: error ?? Utils.generateContactAdminMessage());
}); });
} }
@ -143,27 +161,39 @@ class ProductDetailService extends BaseService {
Map<String, dynamic> request; Map<String, dynamic> request;
request = { request = {
"shopping_cart_item": {"quantity": 1, "shopping_cart_type": "Wishlist", "product_id": itemID, "customer_id": customerId, "language_id": 1} "shopping_cart_item": {
"quantity": 1,
"shopping_cart_type": "Wishlist",
"product_id": itemID,
"customer_id": customerId,
"language_id": 1
}
}; };
await baseAppClient.pharmacyPost(GET_SHOPPING_CART, onSuccess: (dynamic response, int statusCode) { await baseAppClient.pharmacyPost(GET_SHOPPING_CART,
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));
}); });
AppToast.showSuccessToast(message: TranslationBase.of(context).addToWishlistMsg AppToast.showSuccessToast(
// 'You have added a product to the Wishlist' message: TranslationBase.of(context).addToWishlistMsg
); // 'You have added a product to the Wishlist'
);
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
super.error = error; super.error = error;
AppToast.showErrorToast(message: error ?? Utils.generateContactAdminMessage()); AppToast.showErrorToast(
message: error ?? Utils.generateContactAdminMessage());
}, body: request); }, body: request);
} }
Future getWishlistItems() async { Future getWishlistItems() async {
var customerId = await sharedPref.getString(PHARMACY_CUSTOMER_ID); var customerId = await sharedPref.getString(PHARMACY_CUSTOMER_ID);
var custGUID = await sharedPref.getObject(PHARMACY_CUSTOMER_GUID);
hasError = false; hasError = false;
await baseAppClient.getPharmacy(GET_WISHLIST + customerId + "?shopping_cart_type=2", onSuccess: (dynamic response, int statusCode) { await baseAppClient.getPharmacy(
GET_WISHLIST + customerId + "/$custGUID" + "?shopping_cart_type=2",
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));
@ -176,26 +206,37 @@ class ProductDetailService extends BaseService {
Future deleteItemFromWishlist(itemID, context) async { Future deleteItemFromWishlist(itemID, context) async {
var customerId = await sharedPref.getString(PHARMACY_CUSTOMER_ID); var customerId = await sharedPref.getString(PHARMACY_CUSTOMER_ID);
var custGUID = await sharedPref.getObject(PHARMACY_CUSTOMER_GUID);
hasError = false; hasError = false;
await baseAppClient.getPharmacy(DELETE_WISHLIST + customerId + "+&product_id=" + itemID + "&cart_type=Wishlist", onSuccess: (dynamic response, int statusCode) { await baseAppClient.getPharmacy(
DELETE_WISHLIST +
customerId +
"/$custGUID" +
"+&product_id=" +
itemID +
"&cart_type=Wishlist",
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));
}); });
AppToast.showSuccessToast(message: TranslationBase.of(context).removeFromWishlistMsg AppToast.showSuccessToast(
// 'You have removed a product from the Wishlist' message: TranslationBase.of(context).removeFromWishlistMsg
); // 'You have removed a product from the Wishlist'
);
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
super.error = error; super.error = error;
AppToast.showErrorToast(message: error ?? Utils.generateContactAdminMessage()); AppToast.showErrorToast(
message: error ?? Utils.generateContactAdminMessage());
}); });
} }
Future productSpecificationData(itemID) async { Future productSpecificationData(itemID) async {
hasError = false; hasError = false;
await baseAppClient.getPharmacy(GET_SPECIFICATION + itemID, onSuccess: (dynamic response, int statusCode) { await baseAppClient.getPharmacy(GET_SPECIFICATION + itemID,
onSuccess: (dynamic response, int statusCode) {
_productSpecification.clear(); _productSpecification.clear();
response['specification'].forEach((item) { response['specification'].forEach((item) {
_productSpecification.add(SpecificationModel.fromJson(item)); _productSpecification.add(SpecificationModel.fromJson(item));

@ -28,8 +28,6 @@ class ReviewService extends BaseService {
_reviewList.clear(); _reviewList.clear();
response['reviews'].forEach((item) { response['reviews'].forEach((item) {
_reviewList.add(Review.fromJson(item)); _reviewList.add(Review.fromJson(item));
print (response);
print (item['reviewText']);
}); });
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;

@ -50,7 +50,7 @@
// await Future.delayed(Duration(seconds: 2)); // await Future.delayed(Duration(seconds: 2));
// _registerIsolatePort(); // _registerIsolatePort();
// _registerGeofences().then((value) { // _registerGeofences().then((value) {
// debugPrint(value.toString()); // print(value.toString());
// if(_testTrigger) { // if(_testTrigger) {
// var events = [GeofenceEvent.enter,GeofenceEvent.exit]; // var events = [GeofenceEvent.enter,GeofenceEvent.exit];
// events.shuffle(); // events.shuffle();
@ -91,9 +91,9 @@
// break; // break;
// } // }
// await Future.delayed(Duration(milliseconds: 100)); // await Future.delayed(Duration(milliseconds: 100));
// debugPrint("Geofence: ${zone.description} registered"); // print("Geofence: ${zone.description} registered");
// } else { // } else {
// debugPrint("Geofence: ${zone.description} registered"); // print("Geofence: ${zone.description} registered");
// } // }
// } // }
// } // }

@ -6,50 +6,64 @@ class AppSharedPreferences {
Future<SharedPreferences> _prefs = SharedPreferences.getInstance(); Future<SharedPreferences> _prefs = SharedPreferences.getInstance();
/// Save String [key] the key for save value [value] the value we need to save it /// Save String [key] the key for save value [value] the value we need to save it
Future setString(String key, String value) async { setString(String key, String value) async {
final SharedPreferences prefs = await _prefs; if (value != null) {
return prefs.setString(key, value); final SharedPreferences prefs = await _prefs;
return prefs.setString(key, value);
}
} }
/// Save List of String [key] the key for save value [value] the value we need to save it /// Save List of String [key] the key for save value [value] the value we need to save it
setStringList(String key, List<String> value) async { setStringList(String key, List<String> value) async {
final SharedPreferences prefs = await _prefs; if (value != null) {
return prefs.setStringList(key, value); final SharedPreferences prefs = await _prefs;
return prefs.setStringList(key, value);
}
} }
/// Save Double [key] the key for save value [value] the value we need to save it /// Save Double [key] the key for save value [value] the value we need to save it
setDouble(String key, double value) async { setDouble(String key, double value) async {
final SharedPreferences prefs = await _prefs; if (value != null) {
return prefs.setDouble(key, value); final SharedPreferences prefs = await _prefs;
return prefs.setDouble(key, value);
}
} }
/// Save Bool [key] the key for save value [value] the value we need to save it /// Save Bool [key] the key for save value [value] the value we need to save it
setBool(String key, bool value) async { setBool(String key, bool value) async {
final SharedPreferences prefs = await _prefs; if (value != null) {
return prefs.setBool(key, value); final SharedPreferences prefs = await _prefs;
return prefs.setBool(key, value);
}
} }
/// Save int [key] the key for save value [value] the value we need to save it /// Save int [key] the key for save value [value] the value we need to save it
setInt(String key, int value) async { setInt(String key, int value) async {
final SharedPreferences prefs = await _prefs; if (value != null) {
return prefs.setInt(key, value); final SharedPreferences prefs = await _prefs;
return prefs.setInt(key, value);
}
} }
/// save Object [key] the key for save value [value] the value we need to save it /// save Object [key] the key for save value [value] the value we need to save it
setObject(String key, value) async { setObject(String key, value) async {
final SharedPreferences prefs = await _prefs; if (value != null) {
return prefs.setString(key, json.encode(value)); final SharedPreferences prefs = await _prefs;
return await prefs.setString(key, json.encode(value));
}
} }
/// Get String [key] the key was saved /// Get String [key] the key was saved
Future getString(String key) async { Future getString(String key) async {
final SharedPreferences prefs = await _prefs; final SharedPreferences prefs = await _prefs;
await prefs.reload();
return prefs.getString(key); return prefs.getString(key);
} }
/// Get String [key] the key was saved /// Get String [key] the key was saved
getStringWithDefaultValue(String key, String defaultVal) async { getStringWithDefaultValue(String key, String defaultVal) async {
final SharedPreferences prefs = await _prefs; final SharedPreferences prefs = await _prefs;
await prefs.reload();
String value = prefs.getString(key); String value = prefs.getString(key);
return value == null ? defaultVal : value; return value == null ? defaultVal : value;
} }
@ -57,35 +71,45 @@ class AppSharedPreferences {
/// Get List of String [key] the key was saved /// Get List of String [key] the key was saved
getStringList(String key) async { getStringList(String key) async {
final SharedPreferences prefs = await _prefs; final SharedPreferences prefs = await _prefs;
await prefs.reload();
return prefs.getStringList(key); return prefs.getStringList(key);
} }
/// Get Double [key] the key was saved /// Get Double [key] the key was saved
getDouble(String key) async { getDouble(String key) async {
final SharedPreferences prefs = await _prefs; final SharedPreferences prefs = await _prefs;
await prefs.reload();
return prefs.getDouble(key); return prefs.getDouble(key);
} }
/// Get Bool [key] the key was saved /// Get Bool [key] the key was saved
getBool(String key) async { getBool(String key) async {
final SharedPreferences prefs = await _prefs; final SharedPreferences prefs = await _prefs;
await prefs.reload();
return prefs.getBool(key); return prefs.getBool(key);
} }
/// Get Int [key] the key was saved /// Get Int [key] the key was saved
getInt(String key) async { getInt(String key) async {
final SharedPreferences prefs = await _prefs; final SharedPreferences prefs = await _prefs;
await prefs.reload();
return prefs.getInt(key); return prefs.getInt(key);
} }
/// Get Object [key] the key was saved /// Get Object [key] the key was saved
Future getObject(String key) async { Future getObject(String key) async {
final SharedPreferences prefs = await _prefs; try {
var string = prefs.getString(key); final SharedPreferences prefs = await _prefs;
if (string == null) { await prefs.reload();
return null; var string = prefs.getString(key);
if (string == null) {
return null;
}
return json.decode(string);
} catch (ex) {
print(ex);
print(ex.toString());
} }
return json.decode(string);
} }
/// clear all saved values in shared preferences /// clear all saved values in shared preferences

@ -318,9 +318,6 @@ class DateUtil {
/// [dateTime] convert DateTime to date formatted /// [dateTime] convert DateTime to date formatted
static String getWeekDayMonthDayYearDateFormatted( static String getWeekDayMonthDayYearDateFormatted(
DateTime dateTime, String lang) { DateTime dateTime, String lang) {
// print(dateTime);
// print(dateTime.weekday);
// print(dateTime.weekday.getDayOfWeekEnumValue.value);
if (dateTime != null) if (dateTime != null)
return lang == 'en' return lang == 'en'
? getWeekDayEnglish(dateTime.weekday) + ? getWeekDayEnglish(dateTime.weekday) +

@ -83,7 +83,7 @@ class LocationUtils {
callBack(LatLng(location.latitude, location.longitude)); callBack(LatLng(location.latitude, location.longitude));
setLocation(Position(latitude: location.latitude, longitude: location.longitude, altitude: location.altitude)); setLocation(Position(latitude: location.latitude, longitude: location.longitude, altitude: location.altitude));
}, onLocationAvailability: (locationAvailability) { }, onLocationAvailability: (locationAvailability) {
debugPrint("onLocationAvailability: $locationAvailability"); print("onLocationAvailability: $locationAvailability");
})); }));
}).catchError((error) { }).catchError((error) {
if (error.code == "LOCATION_SETTINGS_NOT_AVAILABLE") { if (error.code == "LOCATION_SETTINGS_NOT_AVAILABLE") {

@ -31,9 +31,6 @@ Future<dynamic> backgroundMessageHandler(dynamic message) async{
_incomingCall(message_.data); _incomingCall(message_.data);
return; return;
} }
print("Background message is received, sending local notification.");
h_push.Push.localNotification({ h_push.Push.localNotification({
h_push.HMSLocalNotificationAttr.TITLE: 'Background Message', h_push.HMSLocalNotificationAttr.TITLE: 'Background Message',
h_push.HMSLocalNotificationAttr.MESSAGE: "By: BackgroundMessageHandler" h_push.HMSLocalNotificationAttr.MESSAGE: "By: BackgroundMessageHandler"
@ -155,7 +152,6 @@ class PushNotificationHandler{
newMessage(RemoteMessage remoteMessage){ newMessage(RemoteMessage remoteMessage){
print('RemoteMessage.data:: ${remoteMessage.data}');
if(remoteMessage.data['is_call'] == 'true' || remoteMessage.data['is_call'] == true) if(remoteMessage.data['is_call'] == 'true' || remoteMessage.data['is_call'] == true)
_incomingCall(remoteMessage.data); _incomingCall(remoteMessage.data);

@ -1011,7 +1011,7 @@ class TranslationBase {
String get deleteAddress => localizedValues['deleteAddress'][locale.languageCode]; String get deleteAddress => localizedValues['deleteAddress'][locale.languageCode];
String get deletedAddress => localizedValues['deletedAddress'][locale.languageCode]; String get deletedAddress => localizedValues['deletedAddres'][locale.languageCode];
String get addNewAddress => localizedValues['addNewAddress'][locale.languageCode]; String get addNewAddress => localizedValues['addNewAddress'][locale.languageCode];
@ -1225,6 +1225,8 @@ class TranslationBase {
String get refine => localizedValues['refine'][locale.languageCode]; String get refine => localizedValues['refine'][locale.languageCode];
String get subGroup => localizedValues['subGroup'][locale.languageCode];
String get max => localizedValues['max'][locale.languageCode]; String get max => localizedValues['max'][locale.languageCode];
String get min => localizedValues['min'][locale.languageCode]; String get min => localizedValues['min'][locale.languageCode];
@ -1253,6 +1255,8 @@ class TranslationBase {
String get viewCategorise => localizedValues['viewCategorise'][locale.languageCode]; String get viewCategorise => localizedValues['viewCategorise'][locale.languageCode];
String get viewSubCategorise => localizedValues['viewSubCategorise'][locale.languageCode];
String get cart => localizedValues['cart'][locale.languageCode]; String get cart => localizedValues['cart'][locale.languageCode];
String get wishList => localizedValues['wishList'][locale.languageCode]; String get wishList => localizedValues['wishList'][locale.languageCode];
@ -2819,6 +2823,10 @@ class TranslationBase {
String get requestedDateLiveCare => localizedValues["requestedDateLiveCare"][locale.languageCode]; String get requestedDateLiveCare => localizedValues["requestedDateLiveCare"][locale.languageCode];
String get yourTurn => localizedValues["yourTurn"][locale.languageCode]; String get yourTurn => localizedValues["yourTurn"][locale.languageCode];
String get patients => localizedValues["patients"][locale.languageCode]; String get patients => localizedValues["patients"][locale.languageCode];
String get group => localizedValues["group"][locale.languageCode];
String get ancillaryOrdersPaymentConfirm => localizedValues["ancillaryOrdersPaymentConfirm"][locale.languageCode];
} }
class TranslationBaseDelegate extends LocalizationsDelegate<TranslationBase> { class TranslationBaseDelegate extends LocalizationsDelegate<TranslationBase> {

@ -12,6 +12,7 @@ import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/extensions/string_extensions.dart'; import 'package:diplomaticquarterapp/extensions/string_extensions.dart';
import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrders.dart';
import 'package:diplomaticquarterapp/pages/MyAppointments/MyAppointments.dart'; import 'package:diplomaticquarterapp/pages/MyAppointments/MyAppointments.dart';
import 'package:diplomaticquarterapp/pages/insurance/insurance_approval_screen.dart'; import 'package:diplomaticquarterapp/pages/insurance/insurance_approval_screen.dart';
import 'package:diplomaticquarterapp/pages/insurance/insurance_card_screen.dart'; import 'package:diplomaticquarterapp/pages/insurance/insurance_card_screen.dart';
@ -68,10 +69,8 @@ class Utils {
/// Check The Internet Connection /// Check The Internet Connection
static Future<bool> checkConnection() async { static Future<bool> checkConnection() async {
ConnectivityResult connectivityResult = ConnectivityResult connectivityResult = await (Connectivity().checkConnectivity());
await (Connectivity().checkConnectivity()); if ((connectivityResult == ConnectivityResult.mobile) || (connectivityResult == ConnectivityResult.wifi)) {
if ((connectivityResult == ConnectivityResult.mobile) ||
(connectivityResult == ConnectivityResult.wifi)) {
return true; return true;
} else { } else {
return false; return false;
@ -135,19 +134,11 @@ class Utils {
} }
static String getAppointmentTransID(int projectID, int clinicID, int appoNo) { static String getAppointmentTransID(int projectID, int clinicID, int appoNo) {
return projectID.toString() + return projectID.toString() + '-' + clinicID.toString() + '-' + appoNo.toString();
'-' +
clinicID.toString() +
'-' +
appoNo.toString();
} }
static String getAdvancePaymentTransID(int projectID, int fileNumber) { static String getAdvancePaymentTransID(int projectID, int fileNumber) {
return projectID.toString() + return projectID.toString() + '-' + fileNumber.toString() + '-' + DateTime.now().millisecondsSinceEpoch.toString();
'-' +
fileNumber.toString() +
'-' +
DateTime.now().millisecondsSinceEpoch.toString();
} }
bool validateIDBox(String value, type) { bool validateIDBox(String value, type) {
@ -207,22 +198,14 @@ class Utils {
} }
static validEmail(email) { static validEmail(email) {
return RegExp( return RegExp(r"^[a-zA-Z0-9.a-zA-Z0-9.!#$%&'*+-/=?^_`{|}~]+@[a-zA-Z0-9]+\.[a-zA-Z]+").hasMatch(email);
r"^[a-zA-Z0-9.a-zA-Z0-9.!#$%&'*+-/=?^_`{|}~]+@[a-zA-Z0-9]+\.[a-zA-Z]+")
.hasMatch(email);
} }
static List<Widget> myMedicalList( static List<Widget> myMedicalList({ProjectViewModel projectViewModel, BuildContext context, bool isLogin, count}) {
{ProjectViewModel projectViewModel,
BuildContext context,
bool isLogin,
count}) {
List<Widget> medical = List(); List<Widget> medical = List();
medical.add(InkWell( medical.add(InkWell(
onTap: () => projectViewModel.havePrivilege(5) onTap: () => projectViewModel.havePrivilege(5) ? Navigator.push(context, FadePage(page: MyAppointments())) : null,
? Navigator.push(context, FadePage(page: MyAppointments()))
: null,
child: isLogin child: isLogin
? Stack(children: [ ? Stack(children: [
Container( Container(
@ -249,11 +232,7 @@ class Utils {
borderRadius: BorderRadius.circular(8), borderRadius: BorderRadius.circular(8),
badgeContent: Container( badgeContent: Container(
padding: EdgeInsets.all(2.0), padding: EdgeInsets.all(2.0),
child: Text(count.toString(), child: Text(count.toString(), style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold, fontSize: 12.0)),
style: TextStyle(
color: Colors.white,
fontWeight: FontWeight.bold,
fontSize: 12.0)),
), ),
), ),
) )
@ -271,11 +250,7 @@ class Utils {
borderRadius: BorderRadius.circular(8), borderRadius: BorderRadius.circular(8),
badgeContent: Container( badgeContent: Container(
padding: EdgeInsets.all(2.0), padding: EdgeInsets.all(2.0),
child: Text(count.toString(), child: Text(count.toString(), style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold, fontSize: 12.0)),
style: TextStyle(
color: Colors.white,
fontWeight: FontWeight.bold,
fontSize: 12.0)),
), ),
), ),
) )
@ -302,9 +277,7 @@ class Utils {
} }
medical.add(InkWell( medical.add(InkWell(
onTap: () => projectViewModel.havePrivilege(7) onTap: () => projectViewModel.havePrivilege(7) ? Navigator.push(context, FadePage(page: RadiologyHomePage())) : null,
? Navigator.push(context, FadePage(page: RadiologyHomePage()))
: null,
child: MedicalProfileItem( child: MedicalProfileItem(
title: TranslationBase.of(context).radiology, title: TranslationBase.of(context).radiology,
imagePath: 'radiology.svg', imagePath: 'radiology.svg',
@ -314,9 +287,7 @@ class Utils {
)); ));
medical.add(InkWell( medical.add(InkWell(
onTap: () => projectViewModel.havePrivilege(12) onTap: () => projectViewModel.havePrivilege(12) ? Navigator.push(context, FadePage(page: HomePrescriptionsPage())) : null,
? Navigator.push(context, FadePage(page: HomePrescriptionsPage()))
: null,
child: MedicalProfileItem( child: MedicalProfileItem(
title: TranslationBase.of(context).medicines, title: TranslationBase.of(context).medicines,
imagePath: 'medicine_prescription.svg', imagePath: 'medicine_prescription.svg',
@ -342,8 +313,7 @@ class Utils {
medical.add(InkWell( medical.add(InkWell(
onTap: () { onTap: () {
if (projectViewModel.havePrivilege(48)) if (projectViewModel.havePrivilege(48)) Navigator.push(context, FadePage(page: ActiveMedicationsPage()));
Navigator.push(context, FadePage(page: ActiveMedicationsPage()));
}, },
child: MedicalProfileItem( child: MedicalProfileItem(
title: TranslationBase.of(context).myMedical, title: TranslationBase.of(context).myMedical,
@ -362,17 +332,12 @@ class Utils {
), ),
) )
: null, : null,
child: MedicalProfileItem( child:
title: TranslationBase.of(context).myDoctor, MedicalProfileItem(title: TranslationBase.of(context).myDoctor, imagePath: 'my_doc.svg', subTitle: TranslationBase.of(context).myDoctorSubtitle, isEnable: projectViewModel.havePrivilege(6)),
imagePath: 'my_doc.svg',
subTitle: TranslationBase.of(context).myDoctorSubtitle,
isEnable: projectViewModel.havePrivilege(6)),
)); ));
medical.add(InkWell( medical.add(InkWell(
onTap: () => projectViewModel.havePrivilege(14) onTap: () => projectViewModel.havePrivilege(14) ? Navigator.push(context, FadePage(page: MyInvoices())) : null,
? Navigator.push(context, FadePage(page: MyInvoices()))
: null,
child: MedicalProfileItem( child: MedicalProfileItem(
title: TranslationBase.of(context).invoicesList, title: TranslationBase.of(context).invoicesList,
imagePath: 'invoice_list.svg', imagePath: 'invoice_list.svg',
@ -382,9 +347,18 @@ class Utils {
)); ));
medical.add(InkWell( medical.add(InkWell(
onTap: () => projectViewModel.havePrivilege(14) onTap: () => projectViewModel.havePrivilege(14) ? Navigator.push(context, FadePage(page: AnicllaryOrders())) : null,
? Navigator.push(context, FadePage(page: EyeMeasurementsPage())) child: MedicalProfileItem(
: null, title: TranslationBase.of(context).anicllaryOrders,
imagePath: 'assets/images/al-habib_online_payment_service_icon.png',
isPngImage: true,
subTitle: TranslationBase.of(context).myInvoice,
isEnable: projectViewModel.havePrivilege(14),
),
));
medical.add(InkWell(
onTap: () => projectViewModel.havePrivilege(14) ? Navigator.push(context, FadePage(page: EyeMeasurementsPage())) : null,
child: MedicalProfileItem( child: MedicalProfileItem(
title: TranslationBase.of(context).eye, title: TranslationBase.of(context).eye,
imagePath: 'eye_measurement.svg', imagePath: 'eye_measurement.svg',
@ -394,9 +368,7 @@ class Utils {
)); ));
medical.add(InkWell( medical.add(InkWell(
onTap: () => projectViewModel.havePrivilege(22) onTap: () => projectViewModel.havePrivilege(22) ? Navigator.push(context, FadePage(page: InsuranceCard())) : null,
? Navigator.push(context, FadePage(page: InsuranceCard()))
: null,
child: MedicalProfileItem( child: MedicalProfileItem(
title: TranslationBase.of(context).insurance, title: TranslationBase.of(context).insurance,
imagePath: 'insurance_card.svg', imagePath: 'insurance_card.svg',
@ -417,9 +389,7 @@ class Utils {
)); ));
medical.add(InkWell( medical.add(InkWell(
onTap: () => projectViewModel.havePrivilege(18) onTap: () => projectViewModel.havePrivilege(18) ? Navigator.push(context, FadePage(page: InsuranceApproval())) : null,
? Navigator.push(context, FadePage(page: InsuranceApproval()))
: null,
child: MedicalProfileItem( child: MedicalProfileItem(
title: TranslationBase.of(context).insuranceApproval, title: TranslationBase.of(context).insuranceApproval,
imagePath: 'insurance_approval.svg', imagePath: 'insurance_approval.svg',
@ -429,9 +399,7 @@ class Utils {
)); ));
medical.add(InkWell( medical.add(InkWell(
onTap: () => projectViewModel.havePrivilege(23) onTap: () => projectViewModel.havePrivilege(23) ? Navigator.push(context, FadePage(page: AllergiesPage())) : null,
? Navigator.push(context, FadePage(page: AllergiesPage()))
: null,
child: MedicalProfileItem( child: MedicalProfileItem(
title: TranslationBase.of(context).allergies, title: TranslationBase.of(context).allergies,
imagePath: 'allergies_diagnosed.svg', imagePath: 'allergies_diagnosed.svg',
@ -441,9 +409,7 @@ class Utils {
)); ));
medical.add(InkWell( medical.add(InkWell(
onTap: () => projectViewModel.havePrivilege(26) onTap: () => projectViewModel.havePrivilege(26) ? Navigator.push(context, FadePage(page: MyVaccines())) : null,
? Navigator.push(context, FadePage(page: MyVaccines()))
: null,
child: MedicalProfileItem( child: MedicalProfileItem(
title: TranslationBase.of(context).myVaccines, title: TranslationBase.of(context).myVaccines,
imagePath: 'vaccine_list.svg', imagePath: 'vaccine_list.svg',
@ -453,9 +419,7 @@ class Utils {
)); ));
medical.add(InkWell( medical.add(InkWell(
onTap: () => projectViewModel.havePrivilege(20) onTap: () => projectViewModel.havePrivilege(20) ? Navigator.push(context, FadePage(page: HomeReportPage())) : null,
? Navigator.push(context, FadePage(page: HomeReportPage()))
: null,
child: MedicalProfileItem( child: MedicalProfileItem(
title: TranslationBase.of(context).medical, title: TranslationBase.of(context).medical,
imagePath: 'medical_report.svg', imagePath: 'medical_report.svg',
@ -465,9 +429,7 @@ class Utils {
)); ));
medical.add(InkWell( medical.add(InkWell(
onTap: () => projectViewModel.havePrivilege(19) onTap: () => projectViewModel.havePrivilege(19) ? Navigator.push(context, FadePage(page: MonthlyReportsPage())) : null,
? Navigator.push(context, FadePage(page: MonthlyReportsPage()))
: null,
child: MedicalProfileItem( child: MedicalProfileItem(
title: TranslationBase.of(context).monthly, title: TranslationBase.of(context).monthly,
imagePath: 'monthly_report.svg', imagePath: 'monthly_report.svg',
@ -477,9 +439,7 @@ class Utils {
)); ));
medical.add(InkWell( medical.add(InkWell(
onTap: () => projectViewModel.havePrivilege(16) onTap: () => projectViewModel.havePrivilege(16) ? Navigator.push(context, FadePage(page: PatientSickLeavePage())) : null,
? Navigator.push(context, FadePage(page: PatientSickLeavePage()))
: null,
child: MedicalProfileItem( child: MedicalProfileItem(
title: TranslationBase.of(context).sick, title: TranslationBase.of(context).sick,
imagePath: 'sick_leave.svg', imagePath: 'sick_leave.svg',
@ -489,9 +449,7 @@ class Utils {
)); ));
medical.add(InkWell( medical.add(InkWell(
onTap: () => projectViewModel.havePrivilege(47) onTap: () => projectViewModel.havePrivilege(47) ? Navigator.push(context, FadePage(page: MyBalancePage())) : null,
? Navigator.push(context, FadePage(page: MyBalancePage()))
: null,
child: MedicalProfileItem( child: MedicalProfileItem(
title: TranslationBase.of(context).myBalance, title: TranslationBase.of(context).myBalance,
imagePath: 'balance_credit.svg', imagePath: 'balance_credit.svg',
@ -508,9 +466,7 @@ class Utils {
// )); // ));
medical.add(InkWell( medical.add(InkWell(
onTap: () => projectViewModel.havePrivilege(24) onTap: () => projectViewModel.havePrivilege(24) ? Navigator.push(context, FadePage(page: MyTrackers())) : null,
? Navigator.push(context, FadePage(page: MyTrackers()))
: null,
child: MedicalProfileItem( child: MedicalProfileItem(
title: TranslationBase.of(context).myTrackers, title: TranslationBase.of(context).myTrackers,
imagePath: 'tracker.svg', imagePath: 'tracker.svg',
@ -520,9 +476,7 @@ class Utils {
)); ));
medical.add(InkWell( medical.add(InkWell(
onTap: () => projectViewModel.havePrivilege(30) onTap: () => projectViewModel.havePrivilege(30) ? Navigator.push(context, FadePage(page: SmartWatchInstructions())) : null,
? Navigator.push(context, FadePage(page: SmartWatchInstructions()))
: null,
child: MedicalProfileItem( child: MedicalProfileItem(
title: TranslationBase.of(context).smartWatchesSubtitle, title: TranslationBase.of(context).smartWatchesSubtitle,
imagePath: 'smart_watch.svg', imagePath: 'smart_watch.svg',
@ -532,14 +486,9 @@ class Utils {
)); ));
medical.add(InkWell( medical.add(InkWell(
onTap: () => projectViewModel.havePrivilege(28) onTap: () => projectViewModel.havePrivilege(28) ? Navigator.push(context, FadePage(page: AskDoctorHomPage())) : null,
? Navigator.push(context, FadePage(page: AskDoctorHomPage()))
: null,
child: MedicalProfileItem( child: MedicalProfileItem(
title: TranslationBase.of(context).askYourSubtitle, title: TranslationBase.of(context).askYourSubtitle, imagePath: 'ask_doctor.svg', subTitle: TranslationBase.of(context).askYour, isEnable: projectViewModel.havePrivilege(28)),
imagePath: 'ask_doctor.svg',
subTitle: TranslationBase.of(context).askYour,
isEnable: projectViewModel.havePrivilege(28)),
)); ));
if (projectViewModel.havePrivilege(32) || true) { if (projectViewModel.havePrivilege(32) || true) {
@ -549,18 +498,13 @@ class Utils {
if (projectViewModel.isLogin && userData_ != null || true) { if (projectViewModel.isLogin && userData_ != null || true) {
String patientID = userData_.patientID.toString(); String patientID = userData_.patientID.toString();
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
projectViewModel projectViewModel.platformBridge().connectHMGInternetWifi(patientID).then((value) => {GifLoaderDialogUtils.hideDialog(context)}).catchError((err) {
.platformBridge()
.connectHMGInternetWifi(patientID)
.then((value) => {GifLoaderDialogUtils.hideDialog(context)})
.catchError((err) {
print(err.toString()); print(err.toString());
}); });
} else { } else {
AlertDialogBox( AlertDialogBox(
context: context, context: context,
confirmMessage: confirmMessage: "Please login with your account first to use this feature",
"Please login with your account first to use this feature",
okText: "OK", okText: "OK",
okFunction: () { okFunction: () {
AlertDialogBox.closeAlertDialog(context); AlertDialogBox.closeAlertDialog(context);
@ -577,9 +521,7 @@ class Utils {
} }
medical.add(InkWell( medical.add(InkWell(
onTap: () => projectViewModel.havePrivilege(40) onTap: () => projectViewModel.havePrivilege(40) ? launch('whatsapp://send?phone=18885521858&text=') : null,
? launch('whatsapp://send?phone=18885521858&text=')
: null,
child: MedicalProfileItem( child: MedicalProfileItem(
title: TranslationBase.of(context).chatbot, title: TranslationBase.of(context).chatbot,
imagePath: 'chatbot.svg', imagePath: 'chatbot.svg',
@ -591,17 +533,11 @@ class Utils {
return medical; return medical;
} }
static List<Widget> myMedicalListHomePage( static List<Widget> myMedicalListHomePage({ProjectViewModel projectViewModel, BuildContext context, bool isLogin, count}) {
{ProjectViewModel projectViewModel,
BuildContext context,
bool isLogin,
count}) {
List<Widget> medical = List(); List<Widget> medical = List();
medical.add(InkWell( medical.add(InkWell(
onTap: () => projectViewModel.havePrivilege(5) onTap: () => projectViewModel.havePrivilege(5) ? Navigator.push(context, FadePage(page: MyAppointments())) : null,
? Navigator.push(context, FadePage(page: MyAppointments()))
: null,
child: isLogin child: isLogin
? Stack(children: [ ? Stack(children: [
MedicalProfileItem( MedicalProfileItem(
@ -624,11 +560,7 @@ class Utils {
borderRadius: BorderRadius.circular(8), borderRadius: BorderRadius.circular(8),
badgeContent: Container( badgeContent: Container(
padding: EdgeInsets.all(2.0), padding: EdgeInsets.all(2.0),
child: Text(count.toString(), child: Text(count.toString(), style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold, fontSize: 12.0)),
style: TextStyle(
color: Colors.white,
fontWeight: FontWeight.bold,
fontSize: 12.0)),
), ),
), ),
) )
@ -646,11 +578,7 @@ class Utils {
borderRadius: BorderRadius.circular(8), borderRadius: BorderRadius.circular(8),
badgeContent: Container( badgeContent: Container(
padding: EdgeInsets.all(2.0), padding: EdgeInsets.all(2.0),
child: Text(count.toString(), child: Text(count.toString(), style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold, fontSize: 12.0)),
style: TextStyle(
color: Colors.white,
fontWeight: FontWeight.bold,
fontSize: 12.0)),
), ),
), ),
) )
@ -677,9 +605,7 @@ class Utils {
} }
medical.add(InkWell( medical.add(InkWell(
onTap: () => projectViewModel.havePrivilege(7) onTap: () => projectViewModel.havePrivilege(7) ? Navigator.push(context, FadePage(page: RadiologyHomePage())) : null,
? Navigator.push(context, FadePage(page: RadiologyHomePage()))
: null,
child: MedicalProfileItem( child: MedicalProfileItem(
title: TranslationBase.of(context).radiology, title: TranslationBase.of(context).radiology,
imagePath: 'radiology.svg', imagePath: 'radiology.svg',
@ -689,9 +615,7 @@ class Utils {
)); ));
medical.add(InkWell( medical.add(InkWell(
onTap: () => projectViewModel.havePrivilege(12) onTap: () => projectViewModel.havePrivilege(12) ? Navigator.push(context, FadePage(page: HomePrescriptionsPage())) : null,
? Navigator.push(context, FadePage(page: HomePrescriptionsPage()))
: null,
child: MedicalProfileItem( child: MedicalProfileItem(
title: TranslationBase.of(context).medicines, title: TranslationBase.of(context).medicines,
imagePath: 'medicine_prescription.svg', imagePath: 'medicine_prescription.svg',
@ -709,24 +633,19 @@ class Utils {
), ),
) )
: null, : null,
child: MedicalProfileItem( child:
title: TranslationBase.of(context).myDoctor, MedicalProfileItem(title: TranslationBase.of(context).myDoctor, imagePath: 'my_doc.svg', subTitle: TranslationBase.of(context).myDoctorSubtitle, isEnable: projectViewModel.havePrivilege(6)),
imagePath: 'my_doc.svg',
subTitle: TranslationBase.of(context).myDoctorSubtitle,
isEnable: projectViewModel.havePrivilege(6)),
)); ));
return medical; return medical;
} }
static Widget loadNetworkImage( static Widget loadNetworkImage({@required String url, BoxFit fitting = BoxFit.cover}) {
{@required String url, BoxFit fitting = BoxFit.cover}) {
return CachedNetworkImage( return CachedNetworkImage(
placeholderFadeInDuration: Duration(milliseconds: 250), placeholderFadeInDuration: Duration(milliseconds: 250),
fit: fitting, fit: fitting,
imageUrl: url, imageUrl: url,
placeholder: (context, url) => placeholder: (context, url) => Container(child: Center(child: CircularProgressIndicator())),
Container(child: Center(child: CircularProgressIndicator())),
errorWidget: (context, url, error) { errorWidget: (context, url, error) {
return Icon( return Icon(
Icons.error, Icons.error,
@ -744,11 +663,7 @@ class Utils {
} }
static navigateToCartPage() { static navigateToCartPage() {
Navigator.pushAndRemoveUntil( Navigator.pushAndRemoveUntil(locator<NavigationService>().navigatorKey.currentContext, MaterialPageRoute(builder: (context) => LandingPagePharmacy(currentTab: 3)), (Route<dynamic> r) => false);
locator<NavigationService>().navigatorKey.currentContext,
MaterialPageRoute(
builder: (context) => LandingPagePharmacy(currentTab: 3)),
(Route<dynamic> r) => false);
} }
static Widget tableColumnTitle(String text, {bool showDivider = true}) { static Widget tableColumnTitle(String text, {bool showDivider = true}) {
@ -759,12 +674,7 @@ class Utils {
SizedBox(height: 6), SizedBox(height: 6),
Text( Text(
text, text,
style: TextStyle( style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.48, height: 18 / 12),
fontSize: 12,
fontWeight: FontWeight.w600,
color: Color(0xff2E303A),
letterSpacing: -0.48,
height: 18 / 12),
), ),
SizedBox(height: 5), SizedBox(height: 5),
if (showDivider) if (showDivider)
@ -777,27 +687,16 @@ class Utils {
); );
} }
static Widget tableColumnValue(String text, static Widget tableColumnValue(String text, {bool isLast = false, bool isCapitable = true, ProjectViewModel mProjectViewModel}) {
{bool isLast = false, ProjectViewModel projectViewModel = mProjectViewModel ?? Provider.of(AppGlobal.context);
bool isCapitable = true,
ProjectViewModel mProjectViewModel}) {
ProjectViewModel projectViewModel =
mProjectViewModel ?? Provider.of(AppGlobal.context);
return Column( return Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: [ children: [
SizedBox(height: 12), SizedBox(height: 12),
Text( Text(
isCapitable && !projectViewModel.isArabic isCapitable && !projectViewModel.isArabic ? text.toLowerCase().capitalizeFirstofEach : text,
? text.toLowerCase().capitalizeFirstofEach style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff575757), letterSpacing: -0.4, height: 16 / 10),
: text,
style: TextStyle(
fontSize: 12,
fontWeight: FontWeight.w600,
color: Color(0xff575757),
letterSpacing: -0.4,
height: 16 / 10),
), ),
SizedBox(height: 12), SizedBox(height: 12),
if (!isLast) if (!isLast)
@ -810,8 +709,7 @@ class Utils {
); );
} }
static Widget tableColumnValueWithUnderLine(String text, static Widget tableColumnValueWithUnderLine(String text, {bool isLast = false, bool isCapitable = true}) {
{bool isLast = false, bool isCapitable = true}) {
return Column( return Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
@ -822,13 +720,7 @@ class Utils {
isCapitable ? text.toLowerCase().capitalizeFirstofEach : text, isCapitable ? text.toLowerCase().capitalizeFirstofEach : text,
maxLines: 1, maxLines: 1,
minFontSize: 6, minFontSize: 6,
style: TextStyle( style: TextStyle(decoration: TextDecoration.underline, fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xffD02127), letterSpacing: -0.48, height: 18 / 12),
decoration: TextDecoration.underline,
fontSize: 12,
fontWeight: FontWeight.w600,
color: Color(0xffD02127),
letterSpacing: -0.48,
height: 18 / 12),
), ),
SizedBox(height: 10), SizedBox(height: 10),
if (!isLast) if (!isLast)
@ -842,13 +734,7 @@ class Utils {
} }
} }
Widget applyShadow( Widget applyShadow({Color color = Colors.grey, double shadowOpacity = 0.5, double spreadRadius = 2, double blurRadius = 7, Offset offset = const Offset(2, 2), @required Widget child}) {
{Color color = Colors.grey,
double shadowOpacity = 0.5,
double spreadRadius = 2,
double blurRadius = 7,
Offset offset = const Offset(2, 2),
@required Widget child}) {
return Container( return Container(
decoration: BoxDecoration( decoration: BoxDecoration(
boxShadow: [ boxShadow: [
@ -865,8 +751,7 @@ Widget applyShadow(
} }
Future<AuthenticatedUser> userData() async { Future<AuthenticatedUser> userData() async {
var userData = AuthenticatedUser.fromJson( var userData = AuthenticatedUser.fromJson(await AppSharedPreferences().getObject(MAIN_USER));
await AppSharedPreferences().getObject(MAIN_USER));
return userData; return userData;
} }
@ -880,12 +765,9 @@ extension IndexedIterable<E> on Iterable<E> {
openAppStore({String androidPackageName, String iOSAppID}) async { openAppStore({String androidPackageName, String iOSAppID}) async {
if (Platform.isAndroid) { if (Platform.isAndroid) {
assert(!(androidPackageName == null), assert(!(androidPackageName == null), "Should have valid value in androidPackageName parameter");
"Should have valid value in androidPackageName parameter"); if ((await FlutterHmsGmsAvailability.isGmsAvailable)) launch("market://details?id=com.ejada.hmg");
if ((await FlutterHmsGmsAvailability.isGmsAvailable)) if ((await FlutterHmsGmsAvailability.isHmsAvailable)) launch("appmarket://details?id=com.ejada.hmg");
launch("market://details?id=com.ejada.hmg");
if ((await FlutterHmsGmsAvailability.isHmsAvailable))
launch("appmarket://details?id=com.ejada.hmg");
} else if (Platform.isIOS) { } else if (Platform.isIOS) {
assert((iOSAppID == null), "Should have valid value in iOSAppID parameter"); assert((iOSAppID == null), "Should have valid value in iOSAppID parameter");
launch("https://itunes.apple.com/kr/app/apple-store/$iOSAppID)"); launch("https://itunes.apple.com/kr/app/apple-store/$iOSAppID)");
@ -911,11 +793,7 @@ String labelFrom({@required String className}) {
extension StringExtension on String { extension StringExtension on String {
String capitalize() { String capitalize() {
return this.splitMapJoin(RegExp(r'\w+'), return this.splitMapJoin(RegExp(r'\w+'), onMatch: (m) => '${m.group(0)}'.substring(0, 1).toUpperCase() + '${m.group(0)}'.substring(1).toLowerCase(), onNonMatch: (n) => ' ');
onMatch: (m) =>
'${m.group(0)}'.substring(0, 1).toUpperCase() +
'${m.group(0)}'.substring(1).toLowerCase(),
onNonMatch: (n) => ' ');
} }
} }

@ -144,7 +144,7 @@ class LabResultWidget extends StatelessWidget {
bool checkIfCovidLab(List<LabResult> labResultList) { bool checkIfCovidLab(List<LabResult> labResultList) {
bool isCovidResult = false; bool isCovidResult = false;
labResultList.forEach((order) { labResultList.forEach((order) {
if (order.testCode.toUpperCase().contains("COVID") && order.isCertificateAllowed.toString() == "true") { if ((order.testCode.toUpperCase().contains("COVID") || order.testCode.toUpperCase().contains("COV")) && order.isCertificateAllowed.toString().toLowerCase() == "true") {
isCovidResult = true; isCovidResult = true;
covidLabResult = order; covidLabResult = order;
} }
@ -183,7 +183,7 @@ class LabResultWidget extends StatelessWidget {
children: [ children: [
Padding( Padding(
padding: EdgeInsets.only(left: projectViewModel.isArabic ? 0 : 12, right: projectViewModel.isArabic ? 12 : 0), padding: EdgeInsets.only(left: projectViewModel.isArabic ? 0 : 12, right: projectViewModel.isArabic ? 12 : 0),
child: Utils.tableColumnValue(labResultList[i].description, isLast: true), child: Utils.tableColumnValue(labResultList[i].description ?? "", isLast: true),
), ),
Utils.tableColumnValue(labResultList[i].resultValue + " " + labResultList[i].uOM, isLast: true), Utils.tableColumnValue(labResultList[i].resultValue + " " + labResultList[i].uOM, isLast: true),
Utils.tableColumnValue(labResultList[i].referanceRange, isLast: true, isCapitable: false), Utils.tableColumnValue(labResultList[i].referanceRange, isLast: true, isCapitable: false),

@ -28,12 +28,11 @@ var _InAppBrowserOptions = InAppBrowserClassOptions(
class MyInAppBrowser extends InAppBrowser { class MyInAppBrowser extends InAppBrowser {
_PAYMENT_TYPE paymentType; _PAYMENT_TYPE paymentType;
// static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort Payment Gateway URL UAT
// static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort Payment Gateway URL UAT // static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort Payment Gateway URL UAT
static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL LIVE static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL LIVE
//static String PREAUTH_SERVICE_URL = 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort PreAuth Payment Gateway URL UAT // static String PREAUTH_SERVICE_URL = 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort PreAuth Payment Gateway URL UAT
static String PREAUTH_SERVICE_URL = 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort PreAuth Payment Gateway URL Live Store static String PREAUTH_SERVICE_URL = 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort PreAuth Payment Gateway URL Live Store
@ -77,7 +76,7 @@ class MyInAppBrowser extends InAppBrowser {
@override @override
Future onLoadStart(Uri url) async { Future onLoadStart(Uri url) async {
if (onLoadStartCallback != null) onLoadStartCallback(url); if (onLoadStartCallback != null) onLoadStartCallback(url.toString());
} }
@override @override

@ -70,7 +70,7 @@ class TextFields extends StatefulWidget {
this.onTap, this.onTap,
this.fontSize = 16.0, this.fontSize = 16.0,
this.fontWeight = FontWeight.w700, this.fontWeight = FontWeight.w700,
this.fillColor, this.fillColor,
this.hintColor}) this.hintColor})
: super(key: key); : super(key: key);
@ -209,7 +209,6 @@ class _TextFieldsState extends State<TextFields> {
blurRadius: focus ? 34.0 : 12.0) blurRadius: focus ? 34.0 : 12.0)
]), ]),
child: TextFormField( child: TextFormField(
keyboardAppearance: Theme.of(context).brightness, keyboardAppearance: Theme.of(context).brightness,
scrollPhysics: BouncingScrollPhysics(), scrollPhysics: BouncingScrollPhysics(),
textCapitalization: widget.textCapitalization, textCapitalization: widget.textCapitalization,
@ -239,23 +238,19 @@ class _TextFieldsState extends State<TextFields> {
.textTheme .textTheme
.bodyText1 .bodyText1
.copyWith(fontSize: widget.fontSize, fontWeight: widget.fontWeight), .copyWith(fontSize: widget.fontSize, fontWeight: widget.fontWeight),
inputFormatters: widget.keyboardType == TextInputType.phone inputFormatters: widget.keyboardType == TextInputType.phone
? <TextInputFormatter>[ ? <TextInputFormatter>[
FilteringTextInputFormatter.digitsOnly, FilteringTextInputFormatter.digitsOnly,
_mobileFormatter, _mobileFormatter,
] ]
: widget.inputFormatters, : widget.inputFormatters,
decoration: InputDecoration( decoration: InputDecoration(
counterText: "", counterText: "",
hintText: widget.hintText, hintText: widget.hintText,
hintStyle: TextStyle( hintStyle: TextStyle(
fontSize: widget.fontSize, fontSize: widget.fontSize,
fontWeight: widget.fontWeight, fontWeight: widget.fontWeight,
color: widget.hintColor ?? Theme.of(context).hintColor, color: widget.hintColor ?? Theme.of(context).hintColor,
), ),
contentPadding: widget.padding != null contentPadding: widget.padding != null
? widget.padding ? widget.padding

@ -52,7 +52,7 @@ dependencies:
localstorage: ^4.0.0+1 localstorage: ^4.0.0+1
maps_launcher: ^2.0.1 maps_launcher: ^2.0.1
url_launcher: ^6.0.15 url_launcher: ^6.0.15
shared_preferences: ^2.0.9 shared_preferences: ^2.0.0
# flutter_flexible_toast: ^0.1.4 # flutter_flexible_toast: ^0.1.4
fluttertoast: ^8.0.8 fluttertoast: ^8.0.8
firebase_messaging: ^11.1.0 firebase_messaging: ^11.1.0
@ -198,6 +198,7 @@ dependency_overrides:
provider : ^5.0.0 provider : ^5.0.0
permission_handler : ^6.0.1+1 permission_handler : ^6.0.1+1
dev_dependencies: dev_dependencies:
flutter_test: flutter_test:
sdk: flutter sdk: flutter

Loading…
Cancel
Save