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.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-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)
PlatformBridge(flutterEngine, this).create()
OpenTokPlatformBridge(flutterEngine, this).create()
// OpenTokPlatformBridge(flutterEngine, this).create()
val time = timeToMillis("04:00:00", "HH:mm:ss")

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

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

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

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

@ -44,3 +44,9 @@ subprojects {
task clean(type: Delete) {
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
# platform :ios, '9.0'
platform :ios, '13.0'
# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
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">
<plist version="1.0">
<dict>
<!-- <key>com.apple.developer.networking.HotspotHelper</key>-->
<!-- <true/>-->
<key>aps-environment</key>
<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>
<true/>
<key>com.apple.developer.networking.wifi-info</key>
<true/>
<key>com.apple.developer.nfc.readersession.formats</key>
<array>
<string>NDEF</string>
<string>TAG</string>
</array>
</dict>
</plist>

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

@ -16,8 +16,8 @@ const PACKAGES_SHOPPING_CART = '/api/shopping_cart_items';
const PACKAGES_ORDERS = '/api/orders';
const PACKAGES_ORDER_HISTORY = '/api/orders/items';
const PACKAGES_TAMARA_OPT = '/api/orders/paymentoptions/tamara';
const BASE_URL = 'https://uat.hmgwebservices.com/';
// const BASE_URL = 'https://hmgwebservices.com/';
// const BASE_URL = 'https://uat.hmgwebservices.com/';
const BASE_URL = 'https://hmgwebservices.com/';
// Pharmacy UAT URLs
// 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/';
// 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';
@ -147,18 +147,18 @@ const INSERT_ER_INERT_PRES_ORDER =
'Services/Patients.svc/REST/PatientER_InsertPresOrder';
/// ER RRT
const GET_ALL_RC_TRANSPORTATION = 'rc/api/Transportation/getalltransportation';
const GET_ALL_TRANSPORTATIONS_RC = 'rc/api/Transportation/getalltransportation';
const GET_ALL_RC_TRANSPORTATION = 'api/Transportation/getalltransportation';
const GET_ALL_TRANSPORTATIONS_RC = 'api/Transportation/getalltransportation';
const GET_ALL_RRT_QUESTIONS =
'Services/Patients.svc/REST/PatientER_RRT_GetAllQuestions';
const GET_RRT_SERVICE_PRICE =
'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
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 =
'Services/PayFort_Serv.svc/REST/AddAdvancedNumberRequest';
const GENERATE_ANCILLARY_ORDERS_INVOICE =
'Services/Doctors.svc/REST/AutoGenerateAncillaryOrderInvoice';
const IS_ALLOW_ASK_DOCTOR =
'Services/Doctors.svc/REST/GetPatientDoctorAppointmentResult';
const GET_CALL_REQUEST_TYPE =
@ -601,34 +604,33 @@ const GET_PATIENT_ALL_PRES_ORD =
'Services/Patients.svc/REST/PatientER_GetPatientAllPresOrders';
const PATIENT_ER_INSERT_PRES_ORDER =
'Services/Patients.svc/REST/PatientER_InsertPresOrder';
const PHARMACY_MAKE_REVIEW = 'epharmacy/api/insertreviews';
const BLOOD_DONATION_REGISTER_BLOOD_TYPE =
'Services/PatientVarification.svc/REST/BloodDonation_RegisterBloodType';
const ADD_USER_AGREEMENT_FOR_BLOOD_DONATION =
'Services/PatientVarification.svc/REST/AddUserAgreementForBloodDonation';
// HHC RC SERVICES
const HHC_GET_ALL_SERVICES_RC = "rc/api/HHC/getallhhc";
const ADD_HHC_ORDER_RC = "rc/api/HHC/add";
const GET_ALL_HHC_ORDERS_RC = 'rc/api/hhc/list';
const UPDATE_HHC_ORDER_RC = 'rc/api/hhc/update';
const HHC_GET_ALL_SERVICES_RC = "api/HHC/getallhhc";
const ADD_HHC_ORDER_RC = "api/HHC/add";
const GET_ALL_HHC_ORDERS_RC = 'api/hhc/list';
const UPDATE_HHC_ORDER_RC = 'api/hhc/update';
// CMC RC SERVICES
const GET_ALL_CMC_SERVICES_RC = 'rc/api/cmc/getallcmc';
const ADD_CMC_ORDER_RC = 'rc/api/cmc/add';
const GET_ALL_CMC_ORDERS_RC = 'rc/api/cmc/list';
const UPDATE_CMC_ORDER_RC = 'rc/api/cmc/update';
const GET_ALL_CMC_SERVICES_RC = 'api/cmc/getallcmc';
const ADD_CMC_ORDER_RC = 'api/cmc/add';
const GET_ALL_CMC_ORDERS_RC = 'api/cmc/list';
const UPDATE_CMC_ORDER_RC = 'api/cmc/update';
// RRT RC SERVICES
const ADD_RRT_ORDER_RC = "rc/api/rrt/add";
const GET_ALL_RRT_ORDERS_RC = "rc/api/rrt/list";
const UPDATE_RRT_ORDER_RC = 'rc/api/rrt/update';
const ADD_RRT_ORDER_RC = "api/rrt/add";
const GET_ALL_RRT_ORDERS_RC = "api/rrt/list";
const UPDATE_RRT_ORDER_RC = 'api/rrt/update';
// PRESCRIPTION RC SERVICES
const ADD_PRESCRIPTION_ORDER_RC = "rc/api/prescription/add";
const GET_ALL_PRESCRIPTION_ORDERS_RC = "rc/api/prescription/list";
const GET_ALL_PRESCRIPTION_INFO_RC = "rc/api/Prescription/info";
const UPDATE_PRESCRIPTION_ORDER_RC = 'rc/api/prescription/update';
const ADD_PRESCRIPTION_ORDER_RC = "api/prescription/add";
const GET_ALL_PRESCRIPTION_ORDERS_RC = "api/prescription/list";
const GET_ALL_PRESCRIPTION_INFO_RC = "api/Prescription/info";
const UPDATE_PRESCRIPTION_ORDER_RC = 'api/prescription/update';
//Pharmacy wishlist
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_SPECIFICATION = "productspecification/";
const GET_BRAND_ITEMS = "products";
const PHARMACY_MAKE_REVIEW = 'insertreviews';
// External API
const ADD_ADDRESS_INFO = "addcustomeraddress";

@ -511,7 +511,7 @@ const Map localizedValues = {
"ourLocations": {"en": "Our Locations", "ar": "مواقعنا"},
"edit": {"en": "Edit", "ar": "تعديل"},
"whatsApp": {"en": "Whats App", "ar": " واتس اب"},
"phone": {"en": "Phone", "ar": " موبايل"},
"phone": {"en": "Phone", "ar": " هاتف"},
"delete": {"en": "Delete", "ar": " حذف"},
"deleteAddress": {"en": "Are you sure want to delete", "ar": " هل انت متأكد تريد حذف هذا العنوان"},
"deletedAddres": {"en": "Address has been deleted", "ar": " تم حذف العنوان"},
@ -642,6 +642,7 @@ const Map localizedValues = {
"years-old": {"en": "years old", "ar": "سنة"},
"drag-point": {"en": "Drag point to change your age", "ar": "اسحب لتغيير عمرك"},
"refine": {"en": "Refine", "ar": "تصفية"},
"subGroup": {"en": "Subgroup", "ar": "مجموعة فرعيه"},
"max": {"en": "Max", "ar": "اعلى"},
"compeleteOrderMsg": {"en": "Order has been placed successfully!!", "ar": "تم اتمام الطلب بنجاح"},
"addToCompareMsg": {"en": "You have added a product to the Compare list", "ar": "تمت الاضافه لقائمة المقارنه"},
@ -656,6 +657,7 @@ const Map localizedValues = {
"reset": {"en": "Reset", "ar": "اعادة تعيين"},
"apply": {"en": "Apply", "ar": "تطبيق"},
"viewCategorise": {"en": "View All Categories", "ar": "عرض جميع الفئات"},
"viewSubCategorise": {"en": "View All Sub Categories", "ar": "عرض جميع الفئات الفرعيه"},
"categorise": {"en": "Categories", "ar": "الفئات"},
"wishList": {"en": "WishList", "ar": "المفضلة"},
"myAccount": {"en": "My Account", "ar": "حسابي"},
@ -809,7 +811,7 @@ const Map localizedValues = {
"HealthTipsBasedOnCurrentWeather": {"en": "Health Tips Based On Current Weather", 'ar': ' نصائح صحية بناءاً على الطقس الحالي '},
"MoreDetails": {"en": "More details", "ar": " المزيد من التفاصيل "},
"SendCopy": {"en": "Send Copy", "ar": "ارسال نسخة"},
"ResendOrder": {"en": "Re-Order & Delivery", "ar": "إعادة طلب و توصيل"},
"ResendOrder": {"en": "Refill & Delivery", "ar": "إعادة صرف وتوصيل"},
"Ports": {"en": "Ports", "ar": "المنافذ"},
"Way": {"en": "Way", "ar": "الطريقة"},
"Average": {"en": "Average", "ar": "متوسط"},
@ -1570,7 +1572,7 @@ const Map localizedValues = {
"modesBelow": {"en": "Please select the modes below:", "ar": ":الرجاء تحديد الأوضاع أدناه"},
"prefferedMode": {"en": "Please select the preferred mode 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": "الغاء الموعد"},
"updateInsurCards": {"en": "Update Insurance Cards", "ar": "تحديث بطاقات التأمين"},
"patientAge": {"en": "y", "ar": "سنة"},
@ -1743,7 +1745,8 @@ const Map localizedValues = {
"ordersDashboard": {"en": "My Orders", "ar": "طلباتي"},
"productOutOfStock": {"en": "Out Of Stock", "ar": "إنتهى من المخزن"},
"productQuantity": {"en": "Quantity", "ar": "كمية"},
"yourTurn": {"en": "your turn is after", "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';
class PointsAmountPerMonth {
dynamic amountPerMonth;
dynamic month;
int monthNumber;
num amountPerMonth;
String month;
num monthNumber;
List<PointsAmountPerday> pointsAmountPerday;
dynamic pointsPerMonth;
num pointsPerMonth;
PointsAmountPerMonth(
{this.amountPerMonth,

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

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

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

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

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

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

@ -88,10 +88,6 @@ class AmService extends BaseService {
pendingAmbulanceRequestOrder = AmbulanceRequestOrdersModel.fromJson(item);
}
});
print(patientAmbulanceRequestOrdersList.length);
print(hasPendingOrder);
print(pendingOrderID);
print(pendingOrderStatus);
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
@ -142,10 +138,7 @@ class AmService extends BaseService {
Future insertERPressOrder({@required PatientER_RC patientER}) async {
hasError = false;
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) {
hasError = true;
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/service/base_service.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/foundation.dart';
class GeofencingServices extends BaseService {
@ -25,8 +24,6 @@ class GeofencingServices extends BaseService {
geoZones.add(GeoZonesResponseModel().fromJson(json));
});
if (kDebugMode || testZones) addTestingGeoZones(zones);
_zonesJsonString = json.encode(zones);
}, onFailure: (String error, int statusCode) {
hasError = true;
@ -35,13 +32,11 @@ class GeofencingServices extends BaseService {
AppSharedPreferences pref = AppSharedPreferences();
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;
}
LogGeoZoneResponseModel logResponse;
Future<LogGeoZoneResponseModel> logGeoZone(LogGeoZoneRequestModel request) async {
hasError = false;
await baseAppClient.post(LOG_GEO_ZONES, onSuccess: (dynamic response, int statusCode) {
@ -52,12 +47,4 @@ class GeofencingServices extends BaseService {
}, body: request.toFlatMap());
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 {
logInTokenID = response['LogInTokenID'];
verificationCode = response['VerificationCode'];
print(verificationCode);
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;

@ -23,8 +23,6 @@ class LacumService extends BaseService{
await baseAppClient.post(GET_LACUM_ACCOUNT_INFORMATION,
onSuccess: (response, statusCode) async {
lacumInformation = LacumAccountInformation.fromJson(response);
print("Test Lacum Account Information");
print(response);
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
@ -47,8 +45,6 @@ class LacumService extends BaseService{
await baseAppClient.post(GET_LACUM_GROUP_INFORMATION,
onSuccess: (response, statusCode) async {
lacumGroupInformation = LacumAccountInformation.fromJson(response);
print("Test Lacum Group Information");
print(response);
}, onFailure: (String error, int statusCode) {
hasError = true;
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;
hasError = false;
super.error = "";
@ -201,7 +201,7 @@ class OrderPreviewService extends BaseService {
orderBody['custom_values_xml'] = "PaymentOption:${getPaymentOptionName(paymentCheckoutData.paymentOption)}";
orderBody['shippingOption'] = paymentCheckoutData.shippingOption;
orderBody['shipping_address'] = paymentCheckoutData.address;
// orderBody['lakum_amount'] = paymentCheckoutData.usedLakumPoints;
orderBody['lakum_amount'] = isLakumEnabled ? paymentCheckoutData.usedLakumPoints : 0;
List<Map<String, dynamic>> itemsList = List();
shoppingCarts.forEach((item) {

@ -28,7 +28,6 @@ class PharmacyModuleService extends BaseService {
await baseAppClient.getPharmacy(PHARMACY_VERIFY_CUSTOMER, onSuccess: (dynamic response, int statusCode) async {
if (response['UserName'] != null) {
sharedPref.setString(PHARMACY_CUSTOMER_ID, response['CustomerId'].toString());
print(response);
} else {
await createUser();
}
@ -57,8 +56,6 @@ class PharmacyModuleService extends BaseService {
if (!response['IsRegistered']) {
} else {
customerInfo = CustomerInfo.fromJson(response);
print(response['customerDto']);
print(response['customerDto']['customerGuid']);
await sharedPref.setObject(PHARMACY_CUSTOMER_ID, customerInfo.customerId);
await sharedPref.setObject(PHARMACY_CUSTOMER_GUID, response['customerDto']['customerGuid']);
}
@ -137,7 +134,7 @@ class PharmacyModuleService extends BaseService {
Map<String, String> queryParams = {
'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 {
await baseAppClient.getPharmacy(GET_PHARMACY_BEST_SELLER_PRODUCT, onSuccess: (dynamic response, int statusCode) {
@ -181,7 +178,7 @@ class PharmacyModuleService extends BaseService {
hasError = false;
Map<String, String> queryParams = {
'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 {
await baseAppClient.getPharmacy(GET_MOST_VIEWED_PRODUCTS, onSuccess: (dynamic response, int statusCode) {
@ -189,8 +186,6 @@ class PharmacyModuleService extends BaseService {
response['products'].forEach((item) {
mostViewedProducts.add(PharmacyProduct.fromJson(item));
});
// print("most viewed products ---------");
// print(response);
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;

@ -281,7 +281,7 @@ class PharmacyCategoriseService extends BaseService {
Future getBestSellerProducts() async {
Map<String, String> queryParams = {
'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 {
await baseAppClient.getPharmacy(GET_PHARMACY_BEST_SELLER_PRODUCT,
@ -353,7 +353,7 @@ class PharmacyCategoriseService extends BaseService {
hasError = false;
Map<String, String> queryParams = {
'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 {
await baseAppClient.getPharmacy(GET_MOST_VIEWED_PRODUCTS,

@ -27,12 +27,12 @@ class PrescriptionDeliveryViewModel extends BaseViewModel {
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);
// await _prescriptionDeliveryService.insertDeliveryOrder(
// lineItemNo: lineItemNo, latitude: latitude, longitude: longitude, appointmentNo: appointmentNo, createdBy: createdBy, dischargeID: dischargeID);
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) {
error = _prescriptionDeliveryService.error;
setState(ViewState.ErrorLocal);

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

@ -77,14 +77,17 @@ class PharmacyAddressesViewModel extends BaseViewModel {
await _pharmacyAddressService.addCustomerAddress(sendingAddress);
} else {
await _pharmacyAddressService.editCustomerAddress(sendingAddress).then((value) async {
// await _pharmacyAddressService.getAddresses();
});
}
if (_pharmacyAddressService.hasError) {
setState(ViewState.Idle);
await Future.delayed(Duration(milliseconds: 800));
getAddressesList();
} else {
setState(ViewState.Idle);
await Future.delayed(Duration(milliseconds: 800));
getAddressesList();
}
}
@ -96,6 +99,8 @@ class PharmacyAddressesViewModel extends BaseViewModel {
setState(ViewState.Error);
} else {
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/model/pharmacies/Addresses.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/LacumAccountInformation.dart';
@ -97,7 +98,7 @@ class OrderModelViewModel extends BaseViewModel {
return res;
}
Future makeReview(PharmacyProduct product, double rating, String reviewText, context) async {
Future makeReview(PharmacyProduct product, double rating, String reviewText) async {
setState(ViewState.Busy);
await _orderDetailsService.makeReview(product, rating, reviewText);
if (_orderDetailsService.hasError) {
@ -106,7 +107,7 @@ class OrderModelViewModel extends BaseViewModel {
AppToast.showErrorToast(message: error);
} else {
setState(ViewState.Idle);
AppToast.showSuccessToast(message: TranslationBase.of(context).submitReview);
AppToast.showSuccessToast(message: TranslationBase.of(AppGlobal.context).submitReview);
// AppToast.showSuccessToast(
// message: "Your review has been Submitted successfully");
}

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

@ -1,21 +1,26 @@
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/base/base_view.dart';
import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.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/transitions/fade_page.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
class AnicllaryOrders extends StatefulWidget {
@override
_AnicllaryOrdersState createState() => _AnicllaryOrdersState();
}
class _AnicllaryOrdersState extends State<AnicllaryOrders>
with SingleTickerProviderStateMixin {
class _AnicllaryOrdersState extends State<AnicllaryOrders> with SingleTickerProviderStateMixin {
TabController _tabController;
ProjectViewModel projectViewModel;
void initState() {
super.initState();
_tabController = TabController(length: 2, vsync: this);
@ -28,58 +33,103 @@ class _AnicllaryOrdersState extends State<AnicllaryOrders>
@override
Widget build(BuildContext context) {
projectViewModel = Provider.of(context);
return BaseView<AnciallryOrdersViewModel>(
onModelReady: (model) => model.getOrders(),
builder: (_, model, widget) => AppScaffold(
isShowAppBar: true,
showNewAppBar: true,
showNewAppBarTitle: true,
baseViewModel: model,
appBarTitle: TranslationBase.of(context).anicllaryOrders,
body: SingleChildScrollView(
padding: EdgeInsets.all(12),
child: model.ancillaryLists.length > 0
? Column(children: [
getPatientInfo(model),
getAncillaryOrdersList(model)
])
: SizedBox())));
padding: EdgeInsets.all(12), child: model.ancillaryLists.length > 0 ? Column(children: [getPatientInfo(model), getAncillaryOrdersList(model)]) : getNoDataWidget(context))));
}
Widget getPatientInfo(AnciallryOrdersViewModel model) {
print(model.ancillaryLists);
return Padding(
child: Column(
children: [
Row(
children: [
Texts(
TranslationBase.of(context).mrn,
fontWeight: FontWeight.bold,
fontSize: 22,
),
Texts(
" : ",
fontSize: 20,
),
Texts(
model.ancillaryLists[0].patientID.toString(),
)
],
),
Row(
children: [
Texts(
TranslationBase.of(context).patientName,
fontWeight: FontWeight.bold,
fontSize: 20,
),
Texts(
" : ",
fontSize: 20,
Container(
width: double.infinity,
child: Container(
decoration: cardRadius(12),
margin: EdgeInsets.zero,
child: Padding(
padding: const EdgeInsets.all(12.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
Text(
TranslationBase.of(context).patientName + ":",
style: TextStyle(
fontWeight: FontWeight.w600,
fontSize: 10,
letterSpacing: -0.6,
color: CustomColors.grey,
),
),
mWidth(3),
Text(
projectViewModel.user.firstName + " " + projectViewModel.user.lastName,
style: TextStyle(
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()
],
@ -89,87 +139,34 @@ class _AnicllaryOrdersState extends State<AnicllaryOrders>
}
Widget getAncillaryOrdersList(AnciallryOrdersViewModel model) {
return Column(
children: model.ancillaryLists[0].ancillaryOrderList
.map(
(item) => InkWell(
onTap: () {
ancillaryOrdersDetails(item, model.ancillaryLists[0].projectID);
},
child: Container(
decoration: BoxDecoration(
border: Border(
bottom: BorderSide(
width: 0.5,
))),
padding: EdgeInsets.all(15),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Column(
crossAxisAlignment: CrossAxisAlignment.start,
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());
return Column(children: [
ListView.separated(
shrinkWrap: true,
physics: NeverScrollableScrollPhysics(),
itemBuilder: (context, index) {
return DoctorCard(
onTap: () => ancillaryOrdersDetails(model.ancillaryLists[0].ancillaryOrderList[index], model.ancillaryLists[0].projectID),
isInOutPatient: true,
name: TranslationBase.of(context).dr.toString() + " " + (model.ancillaryLists[0].ancillaryOrderList[index].doctorName),
billNo: model.ancillaryLists[0].ancillaryOrderList[index].orderNo.toString(),
profileUrl: "https://hmgwebservices.com/Images/MobileImages/DUBAI/unkown.png",
subName: model.ancillaryLists[0].projectName,
isLiveCareAppointment: false,
date: DateUtil.convertStringToDate(model.ancillaryLists[0].ancillaryOrderList[index].orderDate),
isSortByClinic: true,
);
},
itemCount: model.ancillaryLists[0].ancillaryOrderList.length,
separatorBuilder: (context, index) => SizedBox(height: 14),
),
]);
}
ancillaryOrdersDetails(item, projectId) {
Navigator.push(
context,
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:diplomaticquarterapp/config/config.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/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/widgets/buttons/button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/uitl/utils.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/text/app_texts_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
class AnicllaryOrdersDetails extends StatefulWidget {
final dynamic appoNo;
@ -17,11 +27,20 @@ class AnicllaryOrdersDetails extends StatefulWidget {
final dynamic projectID;
AnicllaryOrdersDetails(this.appoNo, this.orderNo, this.projectID);
@override
_AnicllaryOrdersState createState() => _AnicllaryOrdersState();
}
class _AnicllaryOrdersState extends State<AnicllaryOrdersDetails> with SingleTickerProviderStateMixin {
ProjectViewModel projectViewModel;
bool _agreeTerms = false;
String selectedPaymentMethod;
MyInAppBrowser browser;
String transID = "";
List<AncillaryOrderProcDetailsList> selectedProcList = [];
void initState() {
super.initState();
}
@ -32,249 +51,283 @@ class _AnicllaryOrdersState extends State<AnicllaryOrdersDetails> with SingleTic
@override
Widget build(BuildContext context) {
projectViewModel = Provider.of(context);
return BaseView<AnciallryOrdersViewModel>(
onModelReady: (model) => model.getOrdersDetails(widget.appoNo, widget.orderNo, widget.projectID),
builder: (_, model, widget) => AppScaffold(
isShowAppBar: true,
baseViewModel: model,
appBarTitle: TranslationBase.of(context).anicllaryOrders,
body: SingleChildScrollView(
padding: EdgeInsets.all(12),
child: model.ancillaryListsDetails.length > 0
? Column(children: [
getPatientInfo(model),
getInvoiceDetails(model),
getInsuranceDetails(model),
getAncillaryDetails(model),
Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
Texts(
TranslationBase.of(context).total,
fontSize: 20,
fontWeight: FontWeight.bold,
),
Texts(
getTotalValue(model),
fontSize: 20,
fontWeight: FontWeight.bold,
)
],
),
Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
Button(
label: TranslationBase.of(context).payNow,
backgroundColor: Colors.red[800],
onTap: () {
Navigator.push(
context,
FadePage(
page: OrdersPayment(),
),
);
},
)
],
)
])
: SizedBox())));
onModelReady: (model) => model.getOrdersDetails(widget.appoNo, widget.orderNo, widget.projectID),
builder: (_, model, widget) => AppScaffold(
isShowAppBar: true,
showNewAppBar: true,
showNewAppBarTitle: true,
baseViewModel: model,
appBarTitle: TranslationBase.of(context).anicllaryOrders,
body: SingleChildScrollView(
padding: EdgeInsets.all(12),
child: model.ancillaryListsDetails.length > 0
? Column(children: [
getPatientInfo(model),
getAncillaryDetails(model),
])
: getNoDataWidget(context),
),
bottomSheet: model.ancillaryListsDetails.length > 0
? Container(
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.only(topLeft: Radius.circular(10), topRight: Radius.circular(10), bottomLeft: Radius.circular(10), bottomRight: Radius.circular(10)),
boxShadow: [
BoxShadow(
color: Colors.grey.withOpacity(0.5),
spreadRadius: 5,
blurRadius: 7,
offset: Offset(0, 3), // changes position of shadow
),
],
),
padding: EdgeInsets.only(left: 21, right: 21, top: 15, bottom: 15),
width: double.infinity,
// color: Colors.white,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
SizedBox(height: 12),
Text(
TranslationBase.of(context).YouCanPayByTheFollowingOptions,
style: TextStyle(
fontSize: 16.0,
fontWeight: FontWeight.w600,
color: Color(0xff2B353E),
letterSpacing: -0.64,
),
),
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) {
print(model.ancillaryListsDetails);
return Padding(
child: Column(
children: [
Row(
children: [
Texts(
TranslationBase.of(context).mrn,
fontWeight: FontWeight.bold,
fontSize: 22,
),
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,
)
],
_getNormalText(text, {bool isBold = false, bool isTotal = false}) {
return Text(
text,
style: TextStyle(
fontSize: isBold
? isTotal
? 16
: 12
: 11,
letterSpacing: -0.5,
color: isBold ? Color(0xff2E303A) : Color(0xff575757),
fontWeight: isTotal ? FontWeight.bold : FontWeight.w600,
),
padding: EdgeInsets.only(top: 5.0, bottom: 5.0),
);
}
Widget getInvoiceDetails(model) {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
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,
),
],
_amountView(String title, String value, {bool isBold = false, bool isTotal = false}) {
return Padding(
padding: const EdgeInsets.only(top: 10, bottom: 10),
child: Row(children: [
Expanded(
child: _getNormalText(title),
),
SizedBox(
height: 10,
Expanded(
child: _getNormalText(value, isBold: isBold, isTotal: isTotal),
),
Divider(
color: Colors.black26,
)
],
]),
);
}
Widget getInsuranceDetails(model) {
Widget getPatientInfo(AnciallryOrdersViewModel model) {
return Padding(
padding: EdgeInsets.only(top: 10, bottom: 10),
child: Column(
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
Texts(
TranslationBase.of(context).insurance,
fontWeight: FontWeight.bold,
),
Texts(
TranslationBase.of(context).insuranceID,
fontWeight: FontWeight.bold,
)
],
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
Texts(
model.ancillaryListsDetails[0].policyName,
),
Texts(
model.ancillaryListsDetails[0].insurancePolicyNo,
)
],
),
SizedBox(
height: 15,
),
Divider(
color: Colors.red[800],
thickness: 3,
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
Row(
children: [],
child: Column(
children: [
Container(
width: double.infinity,
child: Container(
decoration: cardRadius(12),
margin: EdgeInsets.zero,
child: Padding(
padding: const EdgeInsets.all(12.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
Text(
TranslationBase.of(context).patientName + ":",
style: TextStyle(
fontWeight: FontWeight.w600,
fontSize: 10,
letterSpacing: -0.6,
color: CustomColors.grey,
),
),
mWidth(3),
Text(
projectViewModel.user.firstName + " " + projectViewModel.user.lastName,
style: TextStyle(
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,
),
),
],
),
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) {
Map newMap = groupBy(model.ancillaryListsDetails[0].ancillaryOrderProcDetailsList, (obj) => obj.procedureCategoryName);
return Padding(padding: EdgeInsets.only(top: 10, bottom: 10), child: getHeaderDetails(newMap));
return Padding(padding: EdgeInsets.only(top: 0, bottom: 200), child: getHeaderDetails(newMap));
}
Widget getHeaderDetails(newMap) {
List<Widget> list = new List<Widget>();
List<Widget> list = [];
newMap.forEach((key, value) {
list.add(
Texts(
key,
fontWeight: FontWeight.bold,
Container(
child: Text(key, style: TextStyle(color: Colors.black, letterSpacing: -0.64, fontSize: 18.0, 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(
@ -283,32 +336,196 @@ class _AnicllaryOrdersState extends State<AnicllaryOrdersDetails> with SingleTic
);
}
String getTotalValue(value) {
String getTotalValue() {
double total = 0.0;
value.ancillaryListsDetails[0].ancillaryOrderProcDetailsList.forEach((result) => {total += result.companyShareWithTax});
selectedProcList.forEach((result) => {total += result.patientShareWithTax});
return total.toStringAsFixed(2);
}
getLabDetails(value) {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: value.map<Widget>((result) {
return Container(
width: MediaQuery.of(context).size.width * .9,
padding: EdgeInsets.all(10),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
Expanded(flex: 3, child: Text(result.procedureName.toString(), overflow: TextOverflow.ellipsis)),
Expanded(child: AppText(result.companyShare.toString())),
Expanded(child: AppText(result.companyTaxAmount.toString())),
Expanded(
child: AppText(
result.companyShareWithTax.toString(),
))
],
));
}).toList(),
List<TableRow> fullData(context, value) {
List<TableRow> tableRow = [];
tableRow.add(
TableRow(
children: [
Utils.tableColumnTitle(""),
Utils.tableColumnTitle(TranslationBase.of(context).procedure),
Utils.tableColumnTitle(TranslationBase.of(context).price),
Utils.tableColumnTitle(TranslationBase.of(context).vat),
Utils.tableColumnTitle(TranslationBase.of(context).total),
],
),
);
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) {
GifLoaderDialogUtils.hideDialog(context);
print(res['List_CalculationTable'].length);
if (res['MessageStatus'] == 1) {
if (res['List_CalculationTable'].length != 0) {
res['List_CalculationTable'].forEach((item) {

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

@ -250,16 +250,7 @@ class _IdealBodyState extends State<IdealBody> {
color: CustomColors.accentColor,
onTap: () {
setState(() {
// calculateBmr();
// calculateCalories();
calculateIdealWeight();
print(idealWeight);
print(minRange);
print(maxRange);
print(overWeightBy);
print(textResult);
//print(overWeightBy);
{
Navigator.push(
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) {
if (res['MessageStatus'] == 1) {
AppToast.showSuccessToast(message: TranslationBase.of(context).bookedSuccess);
print(res['AppointmentNo']);
Future.delayed(new Duration(milliseconds: 500), () {
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) {
GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) {
print(res['List_IsPatientHasOnGoingEstimation']);
dentalProceduresModel = DentalProceduresModel.fromJson(res);
dentalProceduresModel.listIsPatientHasOnGoingEstimation.forEach((procedure) {
appoTime += procedure.neededTime;
@ -251,7 +250,6 @@ class _DentalComplaintsState extends State<DentalComplaints> {
res['List_DentalChiefComplain'].forEach((v) {
complaintsList.add(new ListDentalChiefComplain.fromJson(v));
});
print(complaintsList.length);
});
} else {}
}).catchError((err) {

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

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

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

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

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

@ -27,7 +27,7 @@ class TestPageState extends State<TestPage>{
void location(){
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) {
GifLoaderDialogUtils.showMyDialog(context);
service.getLiveCareAppointmentPatientShare(appo.appointmentNo.toString(), appo.clinicID, appo.projectID, context).then((res) {
print(res);
GifLoaderDialogUtils.hideDialog(context);
widget.patientShareResponse = new PatientShareResponse.fromJson(res);
openPaymentDialog(appo, widget.patientShareResponse);
@ -801,7 +601,6 @@ class _ToDoState extends State<ToDo> {
context: context,
pageBuilder: (context, animation1, animation2) {})
.then((value) {
print(value);
if (value != null) {
navigateToPaymentMethod(context, value, appo);
@ -882,7 +681,6 @@ class _ToDoState extends State<ToDo> {
String paymentReference = res['Fort_id'].toString();
service.createAdvancePayment(appo, appo.projectID.toString(), res['Amount'], res['Fort_id'], res['PaymentMethod'], context).then((res) {
GifLoaderDialogUtils.hideDialog(context);
print(res['OnlineCheckInAppointments'][0]);
addAdvancedNumberRequest(res['OnlineCheckInAppointments'][0]['AdvanceNumber'].toString(), paymentReference, appo.appointmentNo.toString(), appo, res['OnlineCheckInAppointments'][0]);
}).catchError((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 {
// 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) {
setState(() {});
}))).then((value) {

@ -421,7 +421,7 @@ class _FinalProductsPageState extends State<FinalProductsPage> {
Column(
children: [
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),
decoration: BoxDecoration(
color: Color(0xffb23838),
@ -462,7 +462,7 @@ class _FinalProductsPageState extends State<FinalProductsPage> {
height: 4.0,
),
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,
// model.finalProducts[index].name,
regular: true,

@ -1,6 +1,7 @@
import 'dart:math' as math;
import 'package:auto_size_text/auto_size_text.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/project_view_model.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/hmg_services.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/landing/widgets/logged_slider_view.dart';
import 'package:diplomaticquarterapp/pages/landing/widgets/services_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/packages_offers_tab_pager.dart';
import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils.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:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.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 {
DashboardViewModel model;
@ -287,148 +283,164 @@ class _HomePageFragment2State extends State<HomePageFragment2> {
AuthenticatedUser user = projectViewModel.user;
Navigator.of(context).push(MaterialPageRoute(builder: (context) => PackagesOfferTabPage(user)));
},
child: Container(
width: double.infinity,
height: double.infinity,
clipBehavior: Clip.antiAlias,
decoration: containerRadiusWithGradientServices(20, lightColor: CustomColors.lightGreyColor, darkColor: CustomColors.lightGreyColor),
child: Stack(
children: [
Container(
width: double.infinity,
height: double.infinity,
// color: Color(0xFF2B353E),
decoration: containerRadius(Color(0xFF2B353E), 20),
),
Container(
width: double.infinity,
height: double.infinity,
clipBehavior: Clip.antiAlias,
decoration: projectViewModel.isArabic
? containerBottomRightRadiusWithGradientForAr(60, lightColor: CustomColors.lightGreyColor, darkColor: CustomColors.lightGreyColor)
: containerBottomRightRadiusWithGradient(60, lightColor: CustomColors.lightGreyColor, darkColor: CustomColors.lightGreyColor),
child: Stack(
children: [
SvgPicture.asset(
"assets/images/new/strips.svg",
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,
child: Stack(
children: [
Container(
width: double.infinity,
height: double.infinity,
clipBehavior: Clip.antiAlias,
decoration: containerRadiusWithGradientServices(20, lightColor: CustomColors.lightGreyColor, darkColor: CustomColors.lightGreyColor),
child: Stack(
children: [
Container(
width: double.infinity,
height: double.infinity,
// color: Color(0xFF2B353E),
decoration: containerRadius(Color(0xFF2B353E), 20),
),
Container(
width: double.infinity,
height: double.infinity,
clipBehavior: Clip.antiAlias,
decoration: projectViewModel.isArabic
? containerBottomRightRadiusWithGradientForAr(60, lightColor: CustomColors.lightGreyColor, darkColor: CustomColors.lightGreyColor)
: containerBottomRightRadiusWithGradient(60, lightColor: CustomColors.lightGreyColor, darkColor: CustomColors.lightGreyColor),
child: Stack(
children: [
SvgPicture.asset(
"assets/images/new/strips.svg",
width: double.infinity,
height: double.infinity,
fit: BoxFit.cover,
),
),
],
),
projectViewModel.isArabic
? Positioned(
right: -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,
height: 0.8,
letterSpacing: -0.27,
),
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,
),
),
),
),
)
: 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,
projectViewModel.isArabic
? Positioned(
right: -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,
height: 0.8,
letterSpacing: -0.27,
),
),
),
),
)
: 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,
height: double.infinity,
padding: EdgeInsets.only(left: projectViewModel.isArabic ? 20 : 25, right: projectViewModel.isArabic ? 25 : 20),
child: Column(
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(
Container(
width: double.infinity,
height: double.infinity,
padding: EdgeInsets.only(left: projectViewModel.isArabic ? 20 : 25, right: projectViewModel.isArabic ? 25 : 20),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.center,
children: [
showFloating("assets/images/new/ear.svg"),
mWidth(4),
showFloating("assets/images/new/head.svg"),
mWidth(4),
showFloating("assets/images/new/tooth.svg"),
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: [
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: [
PharmacyPage(),
PharmacyCategorisePage(),
PharmacyProfilePage(moveToOrder: false),
PharmacyProfilePage(moveToOrder: false, changeTab: changeCurrentTab),
CartOrderPage(changeTab: changeCurrentTab),
],
),

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

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

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

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

@ -30,7 +30,6 @@ class _MedicalProfilePageState extends State<MedicalProfilePageNew> {
projectViewModel = Provider.of(context);
var appoCountProvider = Provider.of<ToDoCountProviderModel>(context);
List<Widget> myMedicalList = Utils.myMedicalList(projectViewModel: projectViewModel, context: context, count: appoCountProvider.count, isLogin: projectViewModel.isLogin);
print(myMedicalList);
return BaseView<MedicalViewModel>(
onModelReady: (model) => model.getAppointmentHistory(),
builder: (_, model, widget1) => AppScaffold(
@ -47,25 +46,6 @@ class _MedicalProfilePageState extends State<MedicalProfilePageNew> {
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
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),
SizedBox(
height: 20,
@ -101,14 +81,6 @@ class _MedicalProfilePageState extends State<MedicalProfilePageNew> {
shrinkWrap: true,
primary: false,
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),
padding: EdgeInsets.zero,
itemCount: myMedicalList.length,

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

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

@ -124,7 +124,6 @@ class _syncHealthDataButtonState extends State<syncHealthDataButton> {
counter++;
totalHeartRate += element['Value'];
} else if (element['MedCategoryID'] == 4) {
print("sleeeeep");
sleepDataList.add(new healthData(
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) {
var request = AddProductToCartRequestModel(product_id: product.id, customer_id: viewModel.service.customer.id);
await viewModel.service.addProductToCart(request, context: context).then((response) {
// appScaffold.appBar.badgeUpdater(viewModel.service.cartItemCount);
}).catchError((error) {
utils.Utils.showErrorToast(error);
});

@ -284,7 +284,7 @@ class _PackagesCartPageState extends State<PackagesCartPage> with AfterLayoutMix
var subTitle = "Order# ${value.data.customOrderNumber}";
Navigator.of(context).pushReplacement(MaterialPageRoute(builder: (context) => PackageOrderCompletedPage(heading: heading, title: title, subTitle: subTitle)));
}).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 {
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);
AppToast.showSuccessToast(message:TranslationBase.of(context).addToCompareMsg
// 'You have added a product to the Compare list'
@ -26,7 +26,7 @@ class CompareList with ChangeNotifier {
AppToast.showErrorToast(message:TranslationBase.of(context).itInListMsg
// 'the item is already in the list'
);
} else if(_product.length == 4){
} else if(_product.length == 3){
AppToast.showErrorToast(message: TranslationBase.of(context).compareListFull
// 'your compare list is full'
);

@ -1,18 +1,17 @@
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/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:carousel_slider/carousel_slider.dart';
import 'package:flutter/material.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:diplomaticquarterapp/uitl/translations_delegate_base.dart';
int counter = 0;
dynamic languageID;
class ComparePage extends StatefulWidget {
@override
_ComparePageState createState() => _ComparePageState();
@ -23,6 +22,7 @@ class _ComparePageState extends State<ComparePage> {
getLanguageID() async {
languageID = await sharedPref.getString(APP_LANGUAGE);
}
void initState() {
getLanguageID();
super.initState();
@ -68,8 +68,8 @@ class compareList extends StatelessWidget {
),
Padding(
padding: const EdgeInsets.all(8.0),
child: Text(TranslationBase.of(context).noData,
// 'There is no data',
child: Text(
TranslationBase.of(context).noData,
style: TextStyle(fontSize: 30),
),
)
@ -77,27 +77,11 @@ class compareList extends StatelessWidget {
),
),
)
: CarouselSlider(
options: CarouselOptions(
height: 800.0,
viewportFraction: 0.87,
enableInfiniteScroll: false),
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(),
: Container(
margin: EdgeInsets.only(top: 12.0),
width: double.infinity,
height: MediaQuery.of(context).size.height,
child: slideDetail(productItem),
);
}
}
@ -147,8 +131,7 @@ class _slideDetailState extends State<slideDetail> {
icon: Icon(FontAwesomeIcons.trashAlt, size: 15),
onPressed: () {
setState(() {
Provider.of<CompareList>(context, listen: false)
.deleteItem(widget.data[index].id);
Provider.of<CompareList>(context, listen: false).deleteItem(widget.data[index].id);
});
},
),
@ -173,53 +156,42 @@ class _slideDetailState extends State<slideDetail> {
),
Container(
margin: EdgeInsets.all(5),
child:Align(
child: Align(
alignment: Alignment.topLeft,
child: RichText(
text: projectViewModel.isArabic ? TextSpan(
text: widget.data[index].namen,
style: TextStyle(
fontWeight: FontWeight.bold,
color: Colors.black,
fontSize: 13),
)
: TextSpan(
text: widget.data[index].name,
style: TextStyle(
fontWeight: FontWeight.bold,
color: Colors.black,
fontSize: 13),
),
text: projectViewModel.isArabic
? TextSpan(
text: widget.data[index].namen,
style: TextStyle(fontWeight: FontWeight.bold, color: Colors.black, fontSize: 13),
)
: TextSpan(
text: widget.data[index].name,
style: TextStyle(fontWeight: FontWeight.bold, color: Colors.black, fontSize: 13),
),
),
),
),
Container(
margin: EdgeInsets.all(5),
child: projectViewModel.isArabic ?
Align(
alignment: Alignment.topRight,
child: RichText(
text: TextSpan(
text: "SAR ${widget.data[index].price.toString()}",
style: TextStyle(
color: Colors.black54,
fontSize: 15,
fontWeight: FontWeight.bold),
),
),
):
Align(
alignment: Alignment.topLeft,
child: RichText(
text: TextSpan(
text: "SAR ${widget.data[index].price.toString()}",
style: TextStyle(
color: Colors.black54,
fontSize: 15,
fontWeight: FontWeight.bold),
),
),
),
child: projectViewModel.isArabic
? Align(
alignment: Alignment.topRight,
child: RichText(
text: TextSpan(
text: "SAR ${widget.data[index].price.toString()}",
style: TextStyle(color: Colors.black54, fontSize: 15, fontWeight: FontWeight.bold),
),
),
)
: Align(
alignment: Alignment.topLeft,
child: RichText(
text: TextSpan(
text: "SAR ${widget.data[index].price.toString()}",
style: TextStyle(color: Colors.black54, fontSize: 15, fontWeight: FontWeight.bold),
),
),
),
),
Padding(
padding: EdgeInsets.only(top: 8.0),
@ -230,63 +202,43 @@ class _slideDetailState extends State<slideDetail> {
),
),
Container(
margin: EdgeInsets.all(5),
child: projectViewModel.isArabic ?
Align(
alignment: Alignment.topRight,
child: RichText(
text: TextSpan(
text: widget.data[index].specifications != null ?
widget.data[index].specifications[0].nameN :"",
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[0].name :"",
style: TextStyle(
fontWeight: FontWeight.bold,
color: Colors.black,
fontSize: 13),
)
),
)
),
margin: EdgeInsets.all(5),
child: projectViewModel.isArabic
? Align(
alignment: Alignment.topRight,
child: RichText(
text: TextSpan(
text: widget.data[index].specifications != null ? widget.data[index].specifications[0].nameN : "",
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[0].name : "",
style: TextStyle(fontWeight: FontWeight.bold, color: Colors.black, fontSize: 13),
)),
)),
Container(
margin: EdgeInsets.all(5),
child: projectViewModel.isArabic ?
Align(
alignment: Alignment.topRight,
child: RichText(
text:TextSpan(
text: widget.data[index].specifications != null ?
widget.data[index].specifications[0].defaultValuen:"",
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[0].defaultValue:"",
style: TextStyle(
color: Colors.black54,
fontSize: 15,
fontWeight: FontWeight.bold),
)
),
)
),
margin: EdgeInsets.all(5),
child: projectViewModel.isArabic
? Align(
alignment: Alignment.topRight,
child: RichText(
text: TextSpan(
text: widget.data[index].specifications != null ? widget.data[index].specifications[0].defaultValuen : "",
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[0].defaultValue : "",
style: TextStyle(color: Colors.black54, fontSize: 15, fontWeight: FontWeight.bold),
)),
)),
Padding(
padding: EdgeInsets.only(top: 8.0),
child: Container(
@ -297,62 +249,42 @@ class _slideDetailState extends State<slideDetail> {
),
Container(
margin: EdgeInsets.all(5),
child: projectViewModel.isArabic ?
Align(
alignment: Alignment.topRight,
child: RichText(
text: TextSpan(
text: widget.data[index].specifications != null ?
widget.data[index].specifications[1].nameN :"",
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),
child: projectViewModel.isArabic
? Align(
alignment: Alignment.topRight,
child: RichText(
text: TextSpan(
text: widget.data[index].specifications != null ? widget.data[index].specifications[1].nameN : "",
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(
margin: EdgeInsets.all(5),
child: projectViewModel.isArabic ?
Align(
alignment: Alignment.topRight,
child: RichText(
text:TextSpan(
text: widget.data[index].specifications != null ?
widget.data[index].specifications[1].defaultValuen:"",
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),
child: projectViewModel.isArabic
? Align(
alignment: Alignment.topRight,
child: RichText(
text: TextSpan(
text: widget.data[index].specifications != null ? widget.data[index].specifications[1].defaultValuen : "",
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: EdgeInsets.only(top: 8.0),
child: Container(
@ -363,62 +295,42 @@ class _slideDetailState extends State<slideDetail> {
),
Container(
margin: EdgeInsets.all(5),
child: projectViewModel.isArabic ?
Align(
alignment: Alignment.topRight,
child: RichText(
text: TextSpan(
text: widget.data[index].specifications != null ?
widget.data[index].specifications[2].nameN :"",
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),
child: projectViewModel.isArabic
? Align(
alignment: Alignment.topRight,
child: RichText(
text: TextSpan(
text: widget.data[index].specifications != null ? widget.data[index].specifications[2].nameN : "",
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(
margin: EdgeInsets.all(5),
child: projectViewModel.isArabic ?
Align(
alignment: Alignment.topRight,
child: RichText(
text:TextSpan(
text: widget.data[index].specifications != null ?
widget.data[index].specifications[2].defaultValuen:"",
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),
child: projectViewModel.isArabic
? Align(
alignment: Alignment.topRight,
child: RichText(
text: TextSpan(
text: widget.data[index].specifications != null ? widget.data[index].specifications[2].defaultValuen : "",
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: EdgeInsets.only(top: 8.0),
child: Container(
@ -429,62 +341,42 @@ class _slideDetailState extends State<slideDetail> {
),
Container(
margin: EdgeInsets.all(5),
child: projectViewModel.isArabic ?
Align(
alignment: Alignment.topRight,
child: RichText(
text: TextSpan(
text: widget.data[index].specifications != null ?
widget.data[index].specifications[3].nameN :"",
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),
child: projectViewModel.isArabic
? Align(
alignment: Alignment.topRight,
child: RichText(
text: TextSpan(
text: widget.data[index].specifications != null ? widget.data[index].specifications[3].nameN : "",
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(
margin: EdgeInsets.all(5),
child: projectViewModel.isArabic ?
Align(
alignment: Alignment.topRight,
child: RichText(
text:TextSpan(
text: widget.data[index].specifications != null ?
widget.data[index].specifications[3].defaultValuen:"",
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),
child: projectViewModel.isArabic
? Align(
alignment: Alignment.topRight,
child: RichText(
text: TextSpan(
text: widget.data[index].specifications != null ? widget.data[index].specifications[3].defaultValuen : "",
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: EdgeInsets.only(top: 8.0),
child: Container(
@ -495,62 +387,42 @@ class _slideDetailState extends State<slideDetail> {
),
Container(
margin: EdgeInsets.all(5),
child: projectViewModel.isArabic ?
Align(
alignment: Alignment.topRight,
child: RichText(
text: TextSpan(
text: widget.data[index].specifications != null ?
widget.data[index].specifications[4].nameN :"",
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),
child: projectViewModel.isArabic
? Align(
alignment: Alignment.topRight,
child: RichText(
text: TextSpan(
text: widget.data[index].specifications != null ? widget.data[index].specifications[4].nameN : "",
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(
margin: EdgeInsets.all(5),
child: projectViewModel.isArabic ?
Align(
alignment: Alignment.topRight,
child: RichText(
text:TextSpan(
text: widget.data[index].specifications != null ?
widget.data[index].specifications[4].defaultValuen:"",
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),
child: projectViewModel.isArabic
? Align(
alignment: Alignment.topRight,
child: RichText(
text: TextSpan(
text: widget.data[index].specifications != null ? widget.data[index].specifications[4].defaultValuen : "",
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: EdgeInsets.only(top: 8.0),
child: Container(
@ -561,63 +433,42 @@ class _slideDetailState extends State<slideDetail> {
),
Container(
margin: EdgeInsets.all(5),
child: projectViewModel.isArabic ?
Align(
alignment: Alignment.topRight,
child: RichText(
text: TextSpan(
text: widget.data[index].specifications != null ?
widget.data[index].specifications[5].nameN :"",
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),
child: projectViewModel.isArabic
? Align(
alignment: Alignment.topRight,
child: RichText(
text: TextSpan(
text: widget.data[index].specifications != null ? widget.data[index].specifications[5].nameN : "",
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(
margin: EdgeInsets.all(5),
child: projectViewModel.isArabic ?
Align(
alignment: Alignment.topRight,
child: RichText(
text:TextSpan(
text: widget.data[index].specifications != null ?
widget.data[index].specifications[5].defaultValuen:"",
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),
child: projectViewModel.isArabic
? Align(
alignment: Alignment.topRight,
child: RichText(
text: TextSpan(
text: widget.data[index].specifications != null ? widget.data[index].specifications[5].defaultValuen : "",
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/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/select_address_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:provider/provider.dart';
import 'lakum_widget.dart';
class OrderPreviewPage extends StatefulWidget {
final List<Addresses> addresses;
final OrderPreviewViewModel model;
OrderPreviewPage({this.addresses, this.model});
@override
_OrderPreviewPageState createState() => _OrderPreviewPageState();
}
@ -34,9 +30,6 @@ class _OrderPreviewPageState extends State<OrderPreviewPage> {
bool isLoading = true;
bool isChecked = false;
@override
void initState() {
super.initState();
@ -50,12 +43,11 @@ class _OrderPreviewPageState extends State<OrderPreviewPage> {
});
}
@override
Widget build(BuildContext context) {
final mediaQuery = MediaQuery.of(context);
final height = mediaQuery.size.height - 60 - mediaQuery.padding.top;
// OrderPreviewViewModel widget.model = Provider.of(context);
ProjectViewModel projectViewModel = Provider.of(context);
return AppScaffold(
appBarTitle: "${TranslationBase.of(context).checkOut}",
isShowAppBar: true,
@ -73,108 +65,108 @@ class _OrderPreviewPageState extends State<OrderPreviewPage> {
color: Color(0xFFF1F1F1),
child: Column(
children: [
SelectAddressWidget(widget.model, widget.addresses, changeMainState, isUpdating: true,),
SelectAddressWidget(
widget.model,
widget.addresses,
changeMainState,
isUpdating: true,
),
SizedBox(
height: 10,
),
SelectPaymentOptionWidget(widget.model, changeMainState,isUpdating: true,),
SelectPaymentOptionWidget(
widget.model,
changeMainState,
isUpdating: true,
),
SizedBox(
height: 10,
),
widget.model.paymentCheckoutData.lacumInformation != null
? AbsorbPointer(
absorbing: true,
child: Stack(
? Stack(
children: [
Container(
child: Column(
children: [
// LakumWidget(widget.model),
Container(
color: Colors.white,
padding: EdgeInsets.symmetric(vertical: 12, horizontal: 12),
child: Row(
children: [
Row(
children: [
SizedBox(
height: 24.0,
width: 24.0,
child: Checkbox(
activeColor: CustomColors.green,
value: isChecked,
onChanged: (bool value) {
setState(() {
isChecked = value;
print(isChecked);
if (value){
// isChecked;
child: Column(
children: [
Container(
color: Colors.white,
padding: EdgeInsets.symmetric(vertical: 12, horizontal: 12),
child: Row(
children: [
Row(
children: [
SizedBox(
height: 24.0,
width: 24.0,
child: Checkbox(
activeColor: CustomColors.green,
value: isChecked,
onChanged: (bool value) {
setState(() {
isChecked = value;
if (value) {
PaymentBottomWidget.isChecked = true;
print(value);
}else{
} else {
PaymentBottomWidget.isChecked = false;
}
setState(() {
});
});
},
),
setState(() {});
});
},
),
Padding(
padding: const EdgeInsets.only(left: 8.0, right: 8.0),
child: Text(
TranslationBase.of(context).useLakumPoints +
" (${widget.model.paymentCheckoutData.lacumInformation.lakumInquiryInformationObjVersion.pointsBalance.toString() + " " + TranslationBase.of(context).points})",
style: TextStyle(fontSize: 12.0, fontWeight: FontWeight.w600, letterSpacing: -0.56)),
),
],
),
Expanded(
child: Container(
decoration: BoxDecoration(color: Color(0x99ffffff)),
padding: const EdgeInsets.symmetric(horizontal: 8),
child: Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
Container(
decoration: BoxDecoration(color: Color(0x99ffffff)),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Texts(
"${TranslationBase.of(context).availableBalance}",
fontSize: 12,
fontWeight: FontWeight.bold,
),
Text(
"${TranslationBase.of(context).sar + " " + widget.model.paymentCheckoutData.lacumInformation.lakumInquiryInformationObjVersion.pointsBalanceAmount.toString()}",
style: TextStyle(fontSize: 12.0, fontWeight: FontWeight.w600, letterSpacing: -0.56)
),
],
),
),
Padding(
padding: const EdgeInsets.only(left: 8.0, right: 8.0),
child: Text(
TranslationBase.of(context).useLakumPoints +
" (${widget.model.paymentCheckoutData.lacumInformation.lakumInquiryInformationObjVersion.pointsBalance.toString() + " " + TranslationBase.of(context).points})",
style: TextStyle(fontSize: 12.0, fontWeight: FontWeight.w600, letterSpacing: -0.56)),
),
],
),
Expanded(
child: Container(
decoration: BoxDecoration(color: Color(0x99ffffff)),
padding: const EdgeInsets.symmetric(horizontal: 8),
child: Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
Container(
decoration: BoxDecoration(color: Color(0x99ffffff)),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Texts(
"${TranslationBase.of(context).availableBalance}",
fontSize: 12,
fontWeight: FontWeight.bold,
),
Text(
"${TranslationBase.of(context).sar + " " + widget.model.paymentCheckoutData.lacumInformation.lakumInquiryInformationObjVersion.pointsBalanceAmount.toString()}",
style: TextStyle(fontSize: 12.0, fontWeight: FontWeight.w600, letterSpacing: -0.56)),
],
),
],
),
),
],
),
),
],
),
),
SizedBox(
height: 10,
),
],
),
],
),
),
SizedBox(
height: 10,
),
],
),
Container(
height: MediaQuery.of(context).size.height * .10,
color: Colors.white.withOpacity(0.6),
)
),
projectViewModel.havePrivilege(83)
? Container()
: Container(
height: MediaQuery.of(context).size.height * .10,
color: Colors.white.withOpacity(0.6),
)
],
),
)
)
: Container(),
Container(
color: Colors.white,
@ -284,65 +276,70 @@ class _OrderPreviewPageState extends State<OrderPreviewPage> {
indent: 0,
endIndent: 0,
),
isChecked ?
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Texts(
"${TranslationBase.of(context).lakum}",
fontSize: 14,
color: Colors.green,
fontWeight: FontWeight.w500,
),
Texts(
"- ${TranslationBase.of(context).sar} ${(widget.model.paymentCheckoutData.lacumInformation.lakumInquiryInformationObjVersion.pointsBalanceAmount).toStringAsFixed(2)}",
fontSize: 14,
color: Colors.green,
fontWeight: FontWeight.w500,
),
],
) : Container(),
isChecked ? const Divider(
color: Color(0xFFD6D6D6),
height: 20,
thickness: 1,
indent: 0,
endIndent: 0,
): Container(),
isChecked ? Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Texts(
TranslationBase.of(context).total,
fontSize: 14,
color: Colors.black,
fontWeight: FontWeight.bold,
),
Texts(
" ${TranslationBase.of(context).sar}""${(widget.model.cartResponse.totalAmount - widget.model.paymentCheckoutData.lacumInformation.lakumInquiryInformationObjVersion.pointsBalanceAmount).toStringAsFixed(2)}",
fontSize: 14,
color: Colors.black,
fontWeight: FontWeight.bold,
),
],
)
: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Texts(
TranslationBase.of(context).total,
fontSize: 14,
color: Colors.black,
fontWeight: FontWeight.bold,
),
Texts(
" ${TranslationBase.of(context).sar} ${(widget.model.cartResponse.totalAmount).toStringAsFixed(2)}",
fontSize: 14,
color: Colors.black,
fontWeight: FontWeight.bold,
),
],
),
isChecked
? Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Texts(
"${TranslationBase.of(context).lakum}",
fontSize: 14,
color: Colors.green,
fontWeight: FontWeight.w500,
),
Texts(
"- ${TranslationBase.of(context).sar} ${(widget.model.paymentCheckoutData.lacumInformation.lakumInquiryInformationObjVersion.pointsBalanceAmount).toStringAsFixed(2)}",
fontSize: 14,
color: Colors.green,
fontWeight: FontWeight.w500,
),
],
)
: Container(),
isChecked
? const Divider(
color: Color(0xFFD6D6D6),
height: 20,
thickness: 1,
indent: 0,
endIndent: 0,
)
: Container(),
isChecked
? Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Texts(
TranslationBase.of(context).total,
fontSize: 14,
color: Colors.black,
fontWeight: FontWeight.bold,
),
Texts(
" ${TranslationBase.of(context).sar}"
"${(widget.model.cartResponse.totalAmount - widget.model.paymentCheckoutData.lacumInformation.lakumInquiryInformationObjVersion.pointsBalanceAmount).toStringAsFixed(2)}",
fontSize: 14,
color: Colors.black,
fontWeight: FontWeight.bold,
),
],
)
: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Texts(
TranslationBase.of(context).total,
fontSize: 14,
color: Colors.black,
fontWeight: FontWeight.bold,
),
Texts(
" ${TranslationBase.of(context).sar} ${(widget.model.cartResponse.totalAmount).toStringAsFixed(2)}",
fontSize: 14,
color: Colors.black,
fontWeight: FontWeight.bold,
),
],
),
SizedBox(
height: 10,
),
@ -364,12 +361,9 @@ class _OrderPreviewPageState extends State<OrderPreviewPage> {
child: PaymentBottomWidget(widget.model),
),
);
}
changeMainState() {
setState(() {});
}
}

@ -1,6 +1,7 @@
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/order_detail.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/models/Appointments/AppoimentAllHistoryResultList.dart';
import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart';
@ -25,7 +26,7 @@ class PaymentBottomWidget extends StatelessWidget {
@override
Widget build(BuildContext context) {
final scaffold = Scaffold.of(context);
ProjectViewModel projectViewModel = Provider.of(context);
this.context = context;
OrderPreviewViewModel orderPreviewViewModel = Provider.of(context);
return Container(
@ -44,7 +45,7 @@ class PaymentBottomWidget extends StatelessWidget {
child: Row(
children: [
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,
fontWeight: FontWeight.bold,
color: Color(0xff929295),
@ -88,7 +89,7 @@ class PaymentBottomWidget extends StatelessWidget {
onPressed: (orderPreviewViewModel.paymentCheckoutData.address != null && orderPreviewViewModel.paymentCheckoutData.paymentOption != null)
? () async {
GifLoaderDialogUtils.showMyDialog(context);
await model.makeOrder();
await model.makeOrder(projectViewModel.havePrivilege(83));
if (model.state == ViewState.Idle) {
AppToast.showSuccessToast(message: TranslationBase.of(context).compeleteOrderMsg);
GifLoaderDialogUtils.hideDialog(context);

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

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

@ -28,13 +28,11 @@ class LakumMainPage extends StatelessWidget {
return BaseView<LacumViewModel>(
onModelReady: (model) async {
await model.getLacumData();
if (model.lacumInformation.yahalaAccountNo == 0 ||
model.lacumInformation.yahalaAccountNo == null) {
if (model.lacumInformation.yahalaAccountNo == 0 || model.lacumInformation.yahalaAccountNo == null) {
navigateToLakumRegister(context);
} else {
if (model.lacumInformation.status == "Hold") {
Navigator.pushReplacement(
context, FadePage(page: LakumActivationVidaPage()));
Navigator.pushReplacement(context, FadePage(page: LakumActivationVidaPage()));
}
}
},
@ -53,10 +51,7 @@ class LakumMainPage extends StatelessWidget {
body: Container(
width: double.infinity,
child: SingleChildScrollView(
child: (model.lacumGroupInformation != null &&
model.lacumGroupInformation
.lakumInquiryInformationObjVersion !=
null)
child: (model.lacumGroupInformation != null && model.lacumGroupInformation.lakumInquiryInformationObjVersion != null)
? Column(
children: [
Stack(
@ -70,11 +65,7 @@ class LakumMainPage extends StatelessWidget {
SizedBox(
height: mediaQuery.size.height * 0.02,
),
Container(
width: mediaQuery.size.width * 1,
height: mediaQuery.size.width * .6,
child: LakumBannerWidget(
model, mediaQuery, true)),
Container(width: mediaQuery.size.width * 1, height: mediaQuery.size.width * .6, child: LakumBannerWidget(model, mediaQuery, true)),
],
)
],
@ -88,43 +79,17 @@ class LakumMainPage extends StatelessWidget {
),
Container(
height: 110,
margin: EdgeInsets.symmetric(
horizontal: 16, vertical: 12.0),
margin: EdgeInsets.symmetric(horizontal: 16, vertical: 12.0),
child: ListView(
scrollDirection: Axis.horizontal,
children: <Widget>[
LacumPointsWidget(
mediaQuery,
1,
TranslationBase.of(context).balance,
model
.lacumGroupInformation
.lakumInquiryInformationObjVersion
.pointsBalanceAmount,
model
.lacumGroupInformation
.lakumInquiryInformationObjVersion
.pointsBalance,
null),
LacumPointsWidget(mediaQuery, 1, TranslationBase.of(context).balance, model.lacumGroupInformation.lakumInquiryInformationObjVersion.pointsBalanceAmount,
model.lacumGroupInformation.lakumInquiryInformationObjVersion.pointsBalance, null),
SizedBox(
width: 8,
),
LacumPointsWidget(
mediaQuery,
2,
TranslationBase.of(context).gained,
model
.lacumGroupInformation
.lakumInquiryInformationObjVersion
.pointsBalanceAmount,
model
.lacumGroupInformation
.lakumInquiryInformationObjVersion
.gainedPoints,
model
.lacumGroupInformation
.lakumInquiryInformationObjVersion
.gainedPointsAmountPerYear),
LacumPointsWidget(mediaQuery, 2, TranslationBase.of(context).gained, model.lacumGroupInformation.lakumInquiryInformationObjVersion.pointsBalanceAmount,
model.lacumGroupInformation.lakumInquiryInformationObjVersion.gainedPoints, model.lacumGroupInformation.lakumInquiryInformationObjVersion.gainedPointsAmountPerYear),
SizedBox(
width: 8,
),
@ -132,40 +97,16 @@ class LakumMainPage extends StatelessWidget {
mediaQuery,
3,
TranslationBase.of(context).consumed,
model
.lacumGroupInformation
.lakumInquiryInformationObjVersion
.consumedPointsAmount !=
null
? int.parse(model
.lacumGroupInformation
.lakumInquiryInformationObjVersion
.consumedPointsAmount)
model.lacumGroupInformation.lakumInquiryInformationObjVersion.consumedPointsAmount != null
? num.parse(model.lacumGroupInformation.lakumInquiryInformationObjVersion.consumedPointsAmount)
: 0,
model
.lacumGroupInformation
.lakumInquiryInformationObjVersion
.consumedPoints,
model
.lacumGroupInformation
.lakumInquiryInformationObjVersion
.consumedPointsAmountPerYear),
model.lacumGroupInformation.lakumInquiryInformationObjVersion.consumedPoints,
model.lacumGroupInformation.lakumInquiryInformationObjVersion.consumedPointsAmountPerYear),
SizedBox(
width: 8,
),
LacumPointsWidget(
mediaQuery,
4,
TranslationBase.of(context).transferred,
0,
model
.lacumGroupInformation
.lakumInquiryInformationObjVersion
.transferPoints,
model
.lacumGroupInformation
.lakumInquiryInformationObjVersion
.transferPointsAmountPerYear),
LacumPointsWidget(mediaQuery, 4, TranslationBase.of(context).transferred, 0, model.lacumGroupInformation.lakumInquiryInformationObjVersion.transferPoints,
model.lacumGroupInformation.lakumInquiryInformationObjVersion.transferPointsAmountPerYear),
],
),
),
@ -189,8 +130,7 @@ class LakumMainPage extends StatelessWidget {
),
),
Container(
margin:
EdgeInsets.symmetric(vertical: 16, horizontal: 8),
margin: EdgeInsets.symmetric(vertical: 16, horizontal: 8),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
@ -226,45 +166,39 @@ class LakumMainPage extends StatelessWidget {
// fontSize: 14,
// ),
Container(
margin:
EdgeInsets.symmetric(vertical: 16, horizontal: 8),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
margin: EdgeInsets.symmetric(vertical: 16, horizontal: 8),
child: Row(mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [
Row(
children: [
Row(
children: [
Image.asset(
"assets/images/pharmacy_module/lakum/waiting_gained_icon.png",
fit: BoxFit.fill,
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,
Image.asset(
"assets/images/pharmacy_module/lakum/waiting_gained_icon.png",
fit: BoxFit.fill,
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,
),
])),
// Texts(
// "${model.lacumGroupInformation.lakumInquiryInformationObjVersion.waitingPoints} Points",
// fontWeight: FontWeight.bold,
// fontSize: 14,
// ),
Container(
margin:
EdgeInsets.symmetric(vertical: 16, horizontal: 8),
margin: EdgeInsets.symmetric(vertical: 16, horizontal: 8),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
@ -317,11 +251,7 @@ class LakumMainPage extends StatelessWidget {
}
navigateToLakumRegister(BuildContext context) {
Navigator.pushReplacement(
context,
FadePage(
page: LakumRegistrationPage(
projectViewModel.user.patientIdentificationNo)));
Navigator.pushReplacement(context, FadePage(page: LakumRegistrationPage(projectViewModel.user.patientIdentificationNo)));
}
}
@ -331,12 +261,7 @@ List<Widget> _buildAppBarICons(BuildContext context, LacumViewModel model) {
icon: Icon(Icons.settings),
color: Colors.white,
onPressed: () {
Navigator.push(
context,
FadePage(
page: LakumSettingPage(
model.lacumInformation, model.lacumGroupInformation)))
.then((result) => {model.getLacumGroupData()});
Navigator.push(context, FadePage(page: LakumSettingPage(model.lacumInformation, model.lacumGroupInformation))).then((result) => {model.getLacumGroupData()});
},
),
];
@ -402,13 +327,9 @@ class LakumHomeButtons extends StatelessWidget {
Expanded(
child: InkWell(
onTap: () {
print("Lacum transfer click");
Navigator.push(
context,
FadePage(
page: LacumTransferPage(model.lacumInformation,
model.lacumGroupInformation)))
.then((result) => {model.getLacumGroupData()});
Navigator.push(context, FadePage(page: LacumTransferPage(model.lacumInformation, model.lacumGroupInformation))).then((result) {
model.getLacumGroupData();
});
},
child: Container(
padding: EdgeInsets.symmetric(horizontal: 8),
@ -460,8 +381,7 @@ class LacumPointsWidget extends StatelessWidget {
Color titleColor;
final List<PointsAmountPerYear> pointsAmountPerYear;
LacumPointsWidget(this.mediaQuery, this.pointType, this.title, this.riyal,
this.point, this.pointsAmountPerYear) {
LacumPointsWidget(this.mediaQuery, this.pointType, this.title, this.riyal, this.point, this.pointsAmountPerYear) {
if (pointType == 1) {
titleColor = Color(0xffefefef);
} else if (pointType == 2) {
@ -480,11 +400,9 @@ class LacumPointsWidget extends StatelessWidget {
onTap: () {
if (pointType != 1) {
if (pointsAmountPerYear != null && pointsAmountPerYear.length > 0) {
Navigator.push(context,
FadePage(page: LakumPointsYearPage(pointsAmountPerYear)));
Navigator.push(context, FadePage(page: LakumPointsYearPage(pointsAmountPerYear)));
} else {
AppToast.showErrorToast(
message: TranslationBase.of(context).lakumMsg);
AppToast.showErrorToast(message: TranslationBase.of(context).lakumMsg);
// 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/pages/base/base_view.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/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
@ -26,9 +27,13 @@ class _LakumPointsMonthPageState extends State<LakumPointMonthPage> {
return BaseView<LacumViewModel>(
builder: (_, model, wi) => AppScaffold(
title: TranslationBase.of(context).LakumPoint,
appBarTitle: TranslationBase.of(context).LakumPoint,
isShowAppBar: true,
isPharmacy: true,
showPharmacyCart: false,
isShowDecPage: false,
showHomeAppBarIcon: false,
isBottomBar: true,
backgroundColor: Colors.white,
baseViewModel: model,
body: Container(
@ -50,16 +55,14 @@ class _LakumPointsMonthPageState extends State<LakumPointMonthPage> {
children: [
Container(
height: mediaQuery.size.height * 0.06,
margin: EdgeInsets.symmetric(
vertical: 16, horizontal: 24),
margin: EdgeInsets.symmetric(vertical: 16, horizontal: 24),
child: Row(
crossAxisAlignment: CrossAxisAlignment.end,
children: [
Expanded(
child: Column(
mainAxisAlignment: MainAxisAlignment.end,
crossAxisAlignment:
CrossAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Texts(
TranslationBase.of(context).month,
@ -78,15 +81,12 @@ class _LakumPointsMonthPageState extends State<LakumPointMonthPage> {
Expanded(
child: Row(
crossAxisAlignment: CrossAxisAlignment.end,
mainAxisAlignment:
MainAxisAlignment.spaceEvenly,
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
Expanded(
child: Column(
mainAxisAlignment:
MainAxisAlignment.end,
crossAxisAlignment:
CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.end,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Texts(
TranslationBase.of(context).point,
@ -110,10 +110,8 @@ class _LakumPointsMonthPageState extends State<LakumPointMonthPage> {
),
Expanded(
child: Column(
mainAxisAlignment:
MainAxisAlignment.end,
crossAxisAlignment:
CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.end,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Texts(
TranslationBase.of(context).riyal,
@ -143,16 +141,14 @@ class _LakumPointsMonthPageState extends State<LakumPointMonthPage> {
SizedBox(
height: 10,
),
LakumPointTableRowWidget(true, "DAY", 0, 0, null, 0),
LakumPointTableRowWidget(true, "DATE", 0, 0, null, 0),
...List.generate(
widget.pointsAmountPerMonth.pointsAmountPerday.length,
(index) => LakumPointTableRowWidget(
false,
widget.pointsAmountPerMonth.pointsAmountPerday[index].day,
widget.pointsAmountPerMonth.pointsAmountPerday[index]
.pointsPerDay,
widget.pointsAmountPerMonth.pointsAmountPerday[index]
.amountPerDay,
DateUtil.getWeekDayMonthDayYearDateFormatted(DateUtil.convertStringToDate(widget.pointsAmountPerMonth.pointsAmountPerday[index].transationDate), "en"),
widget.pointsAmountPerMonth.pointsAmountPerday[index].pointsPerDay,
widget.pointsAmountPerMonth.pointsAmountPerday[index].amountPerDay,
() {
setState(() {
if (widget.expandedItemIndex == index) {
@ -167,22 +163,11 @@ class _LakumPointsMonthPageState extends State<LakumPointMonthPage> {
collapsed: Column(
children: [
...List.generate(
widget.pointsAmountPerMonth.pointsAmountPerday[index]
.pointsDetails.length,
widget.pointsAmountPerMonth.pointsAmountPerday[index].pointsDetails.length,
(index) => DayPointsDetailWidget(
widget
.pointsAmountPerMonth
.pointsAmountPerday[index]
.pointsDetails[index]
.subTransactionTypeDescription,
widget
.pointsAmountPerMonth
.pointsAmountPerday[index]
.pointsDetails[index].purchasePoints,
widget
.pointsAmountPerMonth
.pointsAmountPerday[index]
.pointsDetails[index].amount),
widget.pointsAmountPerMonth.pointsAmountPerday[index].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 {
final String rowTitle;
final double points;
final double riyal;
final num points;
final num riyal;
DayPointsDetailWidget(this.rowTitle, this.points, this.riyal);
@ -237,7 +222,6 @@ class DayPointsDetailWidget extends StatelessWidget {
),
)),
Expanded(
child: Container(
child: Texts(
"$points",

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

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

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

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

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

@ -1,10 +1,12 @@
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/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:maps_launcher/maps_launcher.dart';
import 'package:provider/provider.dart';
import 'package:url_launcher/url_launcher.dart';
import 'package:map_launcher/map_launcher.dart';
import 'dart:io' show Platform;
@ -17,6 +19,7 @@ class pharmacyContactsPage extends StatefulWidget {
class _pharmacyContactsPageState extends State<pharmacyContactsPage> {
@override
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
final latitude = "24.704016";
final longitude = "46.676691";
final phone = "+966112833400";
@ -48,7 +51,7 @@ class _pharmacyContactsPageState extends State<pharmacyContactsPage> {
),
child: Container(
margin: EdgeInsets.all(10),
padding: EdgeInsets.fromLTRB(5, 15, 5, 15),
padding: EdgeInsets.fromLTRB(5, 15, 5, 5),
decoration: BoxDecoration(
borderRadius: BorderRadius.all(
Radius.circular(15),
@ -58,17 +61,82 @@ class _pharmacyContactsPageState extends State<pharmacyContactsPage> {
children: [
Padding(
padding: const EdgeInsets.all(8.0),
child: Container(
child: Text(TranslationBase.of(context).contactUsTime,
style: TextStyle(
color: Colors.grey[700],
fontSize: 16,
fontWeight: FontWeight.w600,
letterSpacing: -0.68)),
),
child: projectViewModel.isArabic ?
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text("أوقات عمل مركز الخدمات الصيدلانية:",
//TranslationBase.of(context).contactUsTime,
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(
height: 35,
height: 20,
),
Row(
children: <Widget>[
@ -94,12 +162,15 @@ class _pharmacyContactsPageState extends State<pharmacyContactsPage> {
SizedBox(
width: 30,
),
Text("+966 " + " -11- 2833400",
style: TextStyle(
color: Colors.grey[700],
fontSize: 16,
fontWeight: FontWeight.w600,
letterSpacing: -0.68)),
Directionality(
textDirection: TextDirection.ltr,
child: Text("+966" +"-11-2833400",
style: TextStyle(
color: Colors.grey[700],
fontSize: 16,
fontWeight: FontWeight.w600,
letterSpacing: -0.68)),
),
],
),
SizedBox(
@ -130,7 +201,7 @@ class _pharmacyContactsPageState extends State<pharmacyContactsPage> {
SizedBox(
width: 30,
),
Text("+966 " + " 558434444",
Text(projectViewModel.isArabic ? "558434444 " + " 966+" :"+966 " + " 558434444",
style: TextStyle(
color: Colors.grey[700],
fontSize: 16,

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

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

@ -22,6 +22,7 @@ import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart';
import 'package:rating_bar/rating_bar.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart' as utils ;
import 'base/base_view.dart';
import 'final_products_page.dart';
@ -151,7 +152,7 @@ class _SubCategorisePageState extends State<SubCategorisePage> {
padding: EdgeInsets.all(10.0),
child: Container(
child: Texts(TranslationBase.of(context)
.viewCategorise),
.viewSubCategorise),
),
),
Icon(Icons.arrow_forward)
@ -416,7 +417,7 @@ class _SubCategorisePageState extends State<SubCategorisePage> {
title: Texts(
TranslationBase.of(
context)
.categorise),
.subGroup),
children: [
ProcedureListWidget(
model: model,
@ -837,7 +838,7 @@ class _SubCategorisePageState extends State<SubCategorisePage> {
context)
.size
.width /
5
3
: 0,
padding:
EdgeInsets.all(4),
@ -993,273 +994,425 @@ class _SubCategorisePageState extends State<SubCategorisePage> {
itemCount: model.subProducts.length,
itemBuilder:
(BuildContext context, int index) {
return InkWell(
child: Card(
child: Row(
children: [
Stack(
return InkWell(
child: Card(
child: Row(
children: [
Column(
Stack(
children: [
Container(
decoration:
BoxDecoration(),
child: Padding(
padding:
EdgeInsets
.only(
left: 9.0,
top: 8.0,
right: 10.0,
Column(
children: [
Container(
decoration: BoxDecoration(),
child: Padding(
padding: EdgeInsets.only(
left: 9.0,
top: 8.0,
right: 10.0,
),
),
),
),
),
Container(
margin: EdgeInsets
.fromLTRB(
0, 0, 0, 0),
alignment: Alignment
.center,
child: model
.subProducts[
index]
.images
.isNotEmpty
? Image.network(
model
.subProducts[
index]
.images[
0]
.thumb,
fit: BoxFit
.contain,
height: 70,
)
: Text(TranslationBase.of(
context)
.noImage),
Container(
margin: EdgeInsets.fromLTRB(0, 0, 0, 8),
alignment: Alignment.center,
child:(model.subProducts[index].images != null &&
model.subProducts[index].images.length > 0)
? Image.network(
model.subProducts[index].images[0].src,
fit: BoxFit.cover,
height: 80,
width: 80,
)
: Image.asset(
"assets/images/no_image.png",
fit: BoxFit.cover,
height: 80,
width: 80,
),
),
],
),
],
),
Column(
children: [
Container(
width: model
.subProducts[
index]
.rxMessage !=
null
? MediaQuery.of(
context)
.size
.width /
5.3
: 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,
// ),
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(5)),
),
child:model.subProducts[index].rxMessage != null
? Texts(
projectProvider.isArabic ? model.subProducts[index].rxMessagen : model.subProducts[index].rxMessage,
color: Colors.white,
regular: true,
fontSize: 8,
fontWeight: FontWeight.w600,
)
: Texts(""),
),
],
),
],
),
],
),
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,
),
Container(
height: 100.0,
margin: EdgeInsets.symmetric(
horizontal: 6,
vertical: 0,
),
Row(
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceAround,
crossAxisAlignment: CrossAxisAlignment.start,
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,
SizedBox(
height: 4.0,
),
Container(
width: MediaQuery.of(context).size.width * 0.55,
child: Texts(projectViewModel.isArabic ? model.subProducts[index].namen : 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: [
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
? 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]),
)),
},
);
),
onTap: () => {
Navigator.push(
context,
FadePage(
page: ProductDetailPage(model.subProducts[index]),
)),
},
);
// return InkWell(
// child: Card(
// child: Row(
// children: [
// Stack(
// children: [
// Column(
// children: [
// Container(
// decoration:
// BoxDecoration(),
// child: Padding(
// padding:
// EdgeInsets
// .only(
// left: 9.0,
// top: 8.0,
// right: 10.0,
// ),
// ),
// ),
// Container(
// margin: EdgeInsets
// .fromLTRB(
// 0, 0, 0, 0),
// alignment: Alignment
// .center,
// child: model
// .subProducts[
// index]
// .images
// .isNotEmpty
// ? Image.network(
// model
// .subProducts[
// index]
// .images[
// 0]
// .thumb,
// fit: BoxFit
// .contain,
// 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(

@ -134,20 +134,20 @@ class Signaling {
void registerPeerConnectionListeners() {
peerConnection.onIceCandidate = (RTCIceCandidate candidate){
print(json.encode(candidate.toMap()));
// print(json.encode(candidate.toMap()));
signalR.addIceCandidate(json.encode(candidate.toMap()));
};
peerConnection?.onIceGatheringState = (RTCIceGatheringState state) {
print('ICE gathering state changed: $state');
// print('ICE gathering state changed: $state');
};
peerConnection?.onConnectionState = (RTCPeerConnectionState state) {
print('Connection state change: $state ${state.index}');
// print('Connection state change: $state ${state.index}');
};
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);
}
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 {
Map<String, dynamic> request;
if (await this.sharedPref.getObject(USER_PROFILE) != null) {

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

@ -40,11 +40,9 @@ class FamilyFilesProvider with ChangeNotifier {
dynamic localRes;
try {
var request = GetAllSharedRecordsByStatusReq();
var result = await sharedPref.getObject(MAIN_USER);
request.status = 0;
request.patientID = result["PatientID"];
// var result = await sharedPref.getObject(MAIN_USER);
// request.status = 0;
// request.patientID = result["PatientID"];
await new BaseAppClient().post(GET_SHARED_RECORD_BY_STATUS, onSuccess: (dynamic response, int statusCode) {
localRes = response;
}, 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/services/authentication/auth_provider.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:flutter/material.dart';
class CancelOrderService extends BaseService{

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

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

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

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

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

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

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

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

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

@ -1011,7 +1011,7 @@ class TranslationBase {
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];
@ -1225,6 +1225,8 @@ class TranslationBase {
String get refine => localizedValues['refine'][locale.languageCode];
String get subGroup => localizedValues['subGroup'][locale.languageCode];
String get max => localizedValues['max'][locale.languageCode];
String get min => localizedValues['min'][locale.languageCode];
@ -1253,6 +1255,8 @@ class TranslationBase {
String get viewCategorise => localizedValues['viewCategorise'][locale.languageCode];
String get viewSubCategorise => localizedValues['viewSubCategorise'][locale.languageCode];
String get cart => localizedValues['cart'][locale.languageCode];
String get wishList => localizedValues['wishList'][locale.languageCode];
@ -2819,6 +2823,10 @@ class TranslationBase {
String get requestedDateLiveCare => localizedValues["requestedDateLiveCare"][locale.languageCode];
String get yourTurn => localizedValues["yourTurn"][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> {

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

@ -28,12 +28,11 @@ var _InAppBrowserOptions = InAppBrowserClassOptions(
class MyInAppBrowser extends InAppBrowser {
_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/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
@ -77,7 +76,7 @@ class MyInAppBrowser extends InAppBrowser {
@override
Future onLoadStart(Uri url) async {
if (onLoadStartCallback != null) onLoadStartCallback(url);
if (onLoadStartCallback != null) onLoadStartCallback(url.toString());
}
@override

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

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

Loading…
Cancel
Save