From eea701907dfe9c63af79e16e33314069066b1db0 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Tue, 14 Dec 2021 14:17:53 +0300 Subject: [PATCH 01/19] Login fixes --- lib/pages/login/login.dart | 4 +--- lib/uitl/app_shared_preferences.dart | 36 ++++++++++++++++++---------- 2 files changed, 25 insertions(+), 15 deletions(-) diff --git a/lib/pages/login/login.dart b/lib/pages/login/login.dart index 49c8d0d6..984f64bf 100644 --- a/lib/pages/login/login.dart +++ b/lib/pages/login/login.dart @@ -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'; @@ -315,7 +313,7 @@ class _Login extends State { 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); diff --git a/lib/uitl/app_shared_preferences.dart b/lib/uitl/app_shared_preferences.dart index f90a2f98..726aa543 100644 --- a/lib/uitl/app_shared_preferences.dart +++ b/lib/uitl/app_shared_preferences.dart @@ -7,38 +7,50 @@ class AppSharedPreferences { /// Save String [key] the key for save value [value] the value we need to save it setString(String key, String value) async { - final SharedPreferences prefs = await _prefs; - return prefs.setString(key, value); + 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 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 prefs.setString(key, json.encode(value)); + } } /// Get String [key] the key was saved From 3107d1e86db2da253c0424dba223a8955dcab8ba Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Wed, 15 Dec 2021 11:57:35 +0300 Subject: [PATCH 02/19] Updates & fixes --- android/app/build.gradle | 2 +- .../diplomaticquarterapp/MainActivity.kt | 2 +- .../opentok/LocalVideo.kt | 116 +++--- .../diplomaticquarterapp/opentok/OpenTok.kt | 340 +++++++++--------- .../opentok/RemoteVideo.kt | 116 +++--- .../utils/OpenTokPlatformBridge.kt | 84 ++--- android/build.gradle | 6 + ios/Podfile | 2 +- ios/Runner/Runner.entitlements | 11 +- .../authentication/auth_provider.dart | 12 +- .../family_files/family_files_provider.dart | 8 +- lib/uitl/app_shared_preferences.dart | 24 +- pubspec.yaml | 3 +- 13 files changed, 375 insertions(+), 351 deletions(-) diff --git a/android/app/build.gradle b/android/app/build.gradle index 65bb55fe..dc377f5c 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -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' diff --git a/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/MainActivity.kt b/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/MainActivity.kt index 957262c3..0e5e1117 100644 --- a/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/MainActivity.kt +++ b/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/MainActivity.kt @@ -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") diff --git a/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/opentok/LocalVideo.kt b/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/opentok/LocalVideo.kt index cfebfe65..960665d5 100644 --- a/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/opentok/LocalVideo.kt +++ b/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/opentok/LocalVideo.kt @@ -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) - } -} \ No newline at end of file +//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) +// } +//} \ No newline at end of file diff --git a/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/opentok/OpenTok.kt b/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/opentok/OpenTok.kt index d53d6f9a..6d8e668a 100644 --- a/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/opentok/OpenTok.kt +++ b/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/opentok/OpenTok.kt @@ -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("apiKey")) - val sessionId = requireNotNull(call.argument("sessionId")) - val token = requireNotNull(call.argument("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("publishAudio")) - publisher?.publishAudio = publishAudio - result.success("") - } - - fun toggleVideo(call: MethodCall, result: MethodChannel.Result) { - val publishVideo = requireNotNull(call.argument("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("apiKey")) +// val sessionId = requireNotNull(call.argument("sessionId")) +// val token = requireNotNull(call.argument("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("publishAudio")) +// publisher?.publishAudio = publishAudio +// result.success("") +// } +// +// fun toggleVideo(call: MethodCall, result: MethodChannel.Result) { +// val publishVideo = requireNotNull(call.argument("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()) +// } +// } +//} diff --git a/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/opentok/RemoteVideo.kt b/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/opentok/RemoteVideo.kt index 9116a1e8..8c822839 100644 --- a/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/opentok/RemoteVideo.kt +++ b/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/opentok/RemoteVideo.kt @@ -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) - } -} \ No newline at end of file +//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) +// } +//} \ No newline at end of file diff --git a/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/utils/OpenTokPlatformBridge.kt b/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/utils/OpenTokPlatformBridge.kt index 6ac62546..33d9ff0a 100644 --- a/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/utils/OpenTokPlatformBridge.kt +++ b/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/utils/OpenTokPlatformBridge.kt @@ -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() +// } +// } +// } +// } +// +//} diff --git a/android/build.gradle b/android/build.gradle index e4985a55..b514b78d 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -44,3 +44,9 @@ subprojects { task clean(type: Delete) { delete rootProject.buildDir } + +configurations.all { + resolutionStrategy { + force 'androidx.core:core-ktx:1.6.0' + } +} diff --git a/ios/Podfile b/ios/Podfile index 1e8c3c90..10f3c9b4 100644 --- a/ios/Podfile +++ b/ios/Podfile @@ -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' diff --git a/ios/Runner/Runner.entitlements b/ios/Runner/Runner.entitlements index be2e0283..38553e31 100644 --- a/ios/Runner/Runner.entitlements +++ b/ios/Runner/Runner.entitlements @@ -2,13 +2,20 @@ - - aps-environment development + com.apple.developer.healthkit + + com.apple.developer.healthkit.access + com.apple.developer.networking.HotspotConfiguration com.apple.developer.networking.wifi-info + com.apple.developer.nfc.readersession.formats + + NDEF + TAG + diff --git a/lib/services/authentication/auth_provider.dart b/lib/services/authentication/auth_provider.dart index 3d759ce6..dc3a5813 100644 --- a/lib/services/authentication/auth_provider.dart +++ b/lib/services/authentication/auth_provider.dart @@ -468,12 +468,12 @@ class AuthProvider with ChangeNotifier { Future getDashboard() async { Map 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 { diff --git a/lib/services/family_files/family_files_provider.dart b/lib/services/family_files/family_files_provider.dart index cc151c7b..2ca4ee8a 100644 --- a/lib/services/family_files/family_files_provider.dart +++ b/lib/services/family_files/family_files_provider.dart @@ -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) { diff --git a/lib/uitl/app_shared_preferences.dart b/lib/uitl/app_shared_preferences.dart index 726aa543..517bfee7 100644 --- a/lib/uitl/app_shared_preferences.dart +++ b/lib/uitl/app_shared_preferences.dart @@ -49,19 +49,21 @@ class AppSharedPreferences { setObject(String key, value) async { if (value != null) { final SharedPreferences prefs = await _prefs; - return prefs.setString(key, json.encode(value)); + return await prefs.setString(key, json.encode(value)); } } /// Get String [key] the key was saved 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; } @@ -69,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 diff --git a/pubspec.yaml b/pubspec.yaml index a7996dc8..2a581ac5 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -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 From c2b0326676d97759f8d8c9bf346f7bdaedbb2ed3 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Wed, 15 Dec 2021 14:35:44 +0300 Subject: [PATCH 03/19] Updates & fixes --- .../parmacyModule/order-preview-service.dart | 4 +- .../pharmacyModule/OrderPreviewViewModel.dart | 4 +- .../fragments/home_page_fragment2.dart | 286 ++++++++-------- .../screens/cart-page/cart-order-preview.dart | 304 +++++++++--------- .../cart-page/payment_bottom_widget.dart | 5 +- .../medical/LabResult/LabResultWidget.dart | 2 +- lib/widgets/in_app_browser/InAppBrowser.dart | 5 +- 7 files changed, 308 insertions(+), 302 deletions(-) diff --git a/lib/core/service/parmacyModule/order-preview-service.dart b/lib/core/service/parmacyModule/order-preview-service.dart index b9368180..17dfaf99 100644 --- a/lib/core/service/parmacyModule/order-preview-service.dart +++ b/lib/core/service/parmacyModule/order-preview-service.dart @@ -176,7 +176,7 @@ class OrderPreviewService extends BaseService { } } - Future makeOrder(PaymentCheckoutData paymentCheckoutData, List shoppingCarts) async { + Future makeOrder(PaymentCheckoutData paymentCheckoutData, List 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> itemsList = List(); shoppingCarts.forEach((item) { diff --git a/lib/core/viewModels/pharmacyModule/OrderPreviewViewModel.dart b/lib/core/viewModels/pharmacyModule/OrderPreviewViewModel.dart index 12623290..eb074e59 100644 --- a/lib/core/viewModels/pharmacyModule/OrderPreviewViewModel.dart +++ b/lib/core/viewModels/pharmacyModule/OrderPreviewViewModel.dart @@ -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); diff --git a/lib/pages/landing/fragments/home_page_fragment2.dart b/lib/pages/landing/fragments/home_page_fragment2.dart index 75b9a473..8fa20eaa 100644 --- a/lib/pages/landing/fragments/home_page_fragment2.dart +++ b/lib/pages/landing/fragments/home_page_fragment2.dart @@ -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,24 +10,19 @@ 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/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; @@ -284,150 +280,166 @@ class _HomePageFragment2State extends State { child: InkWell( onTap: () { AuthenticatedUser user = projectViewModel.user; - Navigator.of(context).push(MaterialPageRoute(builder: (context) => PackagesHomePage(user))); + if (projectViewModel.havePrivilege(82)) Navigator.of(context).push(MaterialPageRoute(builder: (context) => PackagesHomePage(user))); }, - child: Container( - 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, + ), + ) + ], ), ), ); diff --git a/lib/pages/pharmacies/screens/cart-page/cart-order-preview.dart b/lib/pages/pharmacies/screens/cart-page/cart-order-preview.dart index dc8dc0d7..48dbcbad 100644 --- a/lib/pages/pharmacies/screens/cart-page/cart-order-preview.dart +++ b/lib/pages/pharmacies/screens/cart-page/cart-order-preview.dart @@ -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; final OrderPreviewViewModel model; - - OrderPreviewPage({this.addresses, this.model}); - @override _OrderPreviewPageState createState() => _OrderPreviewPageState(); } @@ -34,9 +30,6 @@ class _OrderPreviewPageState extends State { bool isLoading = true; bool isChecked = false; - - - @override void initState() { super.initState(); @@ -50,12 +43,11 @@ class _OrderPreviewPageState extends State { }); } - @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 { 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 { 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 { child: PaymentBottomWidget(widget.model), ), ); - } changeMainState() { setState(() {}); } - - } diff --git a/lib/pages/pharmacies/screens/cart-page/payment_bottom_widget.dart b/lib/pages/pharmacies/screens/cart-page/payment_bottom_widget.dart index 00595711..61248543 100644 --- a/lib/pages/pharmacies/screens/cart-page/payment_bottom_widget.dart +++ b/lib/pages/pharmacies/screens/cart-page/payment_bottom_widget.dart @@ -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( @@ -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); diff --git a/lib/widgets/data_display/medical/LabResult/LabResultWidget.dart b/lib/widgets/data_display/medical/LabResult/LabResultWidget.dart index f396a2f4..427b16e1 100644 --- a/lib/widgets/data_display/medical/LabResult/LabResultWidget.dart +++ b/lib/widgets/data_display/medical/LabResult/LabResultWidget.dart @@ -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), diff --git a/lib/widgets/in_app_browser/InAppBrowser.dart b/lib/widgets/in_app_browser/InAppBrowser.dart index 9e363e4d..82af9e49 100644 --- a/lib/widgets/in_app_browser/InAppBrowser.dart +++ b/lib/widgets/in_app_browser/InAppBrowser.dart @@ -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 From d7c3cb3dbc3f7cceb6743e8ce997cecd03c61835 Mon Sep 17 00:00:00 2001 From: Fatimah Alshammari Date: Sun, 19 Dec 2021 08:50:02 +0300 Subject: [PATCH 04/19] fix conflict --- lib/pages/Blood/new_text_Field.dart | 3 +-- lib/pages/medical/balance/new_text_Field.dart | 3 +-- lib/widgets/input/text_field.dart | 3 +-- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/lib/pages/Blood/new_text_Field.dart b/lib/pages/Blood/new_text_Field.dart index 643e1a93..200574dd 100644 --- a/lib/pages/Blood/new_text_Field.dart +++ b/lib/pages/Blood/new_text_Field.dart @@ -166,7 +166,6 @@ class _NewTextFieldsState extends State { initialValue: widget.initialValue, keyboardAppearance: Theme.of(context).brightness, scrollPhysics: BouncingScrollPhysics(), - autovalidate: widget.autoValidate, textCapitalization: widget.textCapitalization, onFieldSubmitted: widget.inputAction == TextInputAction.next ? (widget.onSubmit != null @@ -196,7 +195,7 @@ class _NewTextFieldsState extends State { .copyWith(fontSize: widget.fontSize, fontWeight: widget.fontWeight), inputFormatters: widget.keyboardType == TextInputType.phone ? [ - WhitelistingTextInputFormatter.digitsOnly, + FilteringTextInputFormatter.digitsOnly, _mobileFormatter, ] : widget.inputFormatters, diff --git a/lib/pages/medical/balance/new_text_Field.dart b/lib/pages/medical/balance/new_text_Field.dart index e1f7fdd4..bad103a9 100644 --- a/lib/pages/medical/balance/new_text_Field.dart +++ b/lib/pages/medical/balance/new_text_Field.dart @@ -166,7 +166,6 @@ class _NewTextFieldsState extends State { initialValue: widget.initialValue, keyboardAppearance: Theme.of(context).brightness, scrollPhysics: BouncingScrollPhysics(), - autovalidate: widget.autoValidate, textCapitalization: widget.textCapitalization, onFieldSubmitted: widget.inputAction == TextInputAction.next ? (widget.onSubmit != null @@ -193,7 +192,7 @@ class _NewTextFieldsState extends State { fontSize: widget.fontSize, fontWeight: widget.fontWeight), inputFormatters: widget.keyboardType == TextInputType.phone ? [ - WhitelistingTextInputFormatter.digitsOnly, + FilteringTextInputFormatter.digitsOnly, _mobileFormatter, ] : widget.inputFormatters, diff --git a/lib/widgets/input/text_field.dart b/lib/widgets/input/text_field.dart index 9bb899cb..f3580c17 100644 --- a/lib/widgets/input/text_field.dart +++ b/lib/widgets/input/text_field.dart @@ -214,7 +214,6 @@ class _TextFieldsState extends State { keyboardAppearance: Theme.of(context).brightness, scrollPhysics: BouncingScrollPhysics(), - autovalidate: widget.autoValidate, textCapitalization: widget.textCapitalization, onFieldSubmitted: widget.inputAction == TextInputAction.next ? (widget.onSubmit != null @@ -245,7 +244,7 @@ class _TextFieldsState extends State { inputFormatters: widget.keyboardType == TextInputType.phone ? [ - WhitelistingTextInputFormatter.digitsOnly, + FilteringTextInputFormatter.digitsOnly, _mobileFormatter, ] : widget.inputFormatters, From b15bd2362be8eab2a0b4a5ecfbeb87463fdcff98 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Mon, 20 Dec 2021 15:37:34 +0300 Subject: [PATCH 05/19] Updates & fixes --- lib/config/config.dart | 6 +- lib/config/localized_values.dart | 1 + lib/pages/BookAppointment/DoctorProfile.dart | 5 +- lib/pages/BookAppointment/SearchResults.dart | 2 +- .../components/DocAvailableAppointments.dart | 1 + lib/pages/landing/landing_page_pharmcy.dart | 2 +- lib/pages/parent_categorise_page.dart | 1942 +++++++---------- lib/pages/pharmacy/order/ProductReview.dart | 2 +- lib/pages/pharmacy/profile/profile.dart | 6 +- .../orderDetails_service.dart | 2 +- lib/uitl/translations_delegate_base.dart | 1 + 11 files changed, 796 insertions(+), 1174 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index 3ed8d764..1e0df374 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -15,8 +15,8 @@ const PACKAGES_CUSTOMER = '/api/customers'; const PACKAGES_SHOPPING_CART = '/api/shopping_cart_items'; const PACKAGES_ORDERS = '/api/orders'; 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/'; @@ -600,7 +600,6 @@ 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 = @@ -639,6 +638,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"; diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 83fedc90..e028af76 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -1746,4 +1746,5 @@ const Map localizedValues = { "yourTurn": {"en": "your turn is after", "ar": "دورك بعد"}, "patients": {"en": "patients", "ar": "مرضي"}, + "group": {"en": "Group", "ar": "مجموعة"}, }; diff --git a/lib/pages/BookAppointment/DoctorProfile.dart b/lib/pages/BookAppointment/DoctorProfile.dart index 87941ed5..0357acb6 100644 --- a/lib/pages/BookAppointment/DoctorProfile.dart +++ b/lib/pages/BookAppointment/DoctorProfile.dart @@ -148,13 +148,12 @@ class _DoctorProfileState extends State 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); }); }, diff --git a/lib/pages/BookAppointment/SearchResults.dart b/lib/pages/BookAppointment/SearchResults.dart index 0a654e22..e4744c4e 100644 --- a/lib/pages/BookAppointment/SearchResults.dart +++ b/lib/pages/BookAppointment/SearchResults.dart @@ -52,7 +52,7 @@ class _SearchResultsState extends State { //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), diff --git a/lib/pages/BookAppointment/components/DocAvailableAppointments.dart b/lib/pages/BookAppointment/components/DocAvailableAppointments.dart index 3a6d9185..47e14629 100644 --- a/lib/pages/BookAppointment/components/DocAvailableAppointments.dart +++ b/lib/pages/BookAppointment/components/DocAvailableAppointments.dart @@ -238,6 +238,7 @@ class _DocAvailableAppointmentsState extends State wit }); openTimeSlotsPickerForDate(DateUtil.convertStringToDate(selectedDateJSON), docFreeSlots); _calendarController.selectedDate = DateUtil.convertStringToDate(selectedDateJSON); + _calendarController.displayDate = _calendarController.selectedDate; return _eventsParsed; } diff --git a/lib/pages/landing/landing_page_pharmcy.dart b/lib/pages/landing/landing_page_pharmcy.dart index 42ec25a6..4ba5758e 100644 --- a/lib/pages/landing/landing_page_pharmcy.dart +++ b/lib/pages/landing/landing_page_pharmcy.dart @@ -76,7 +76,7 @@ class _LandingPagePharmacyState extends State { children: [ PharmacyPage(), PharmacyCategorisePage(), - PharmacyProfilePage(moveToOrder: false), + PharmacyProfilePage(moveToOrder: false, changeTab: changeCurrentTab), CartOrderPage(changeTab: changeCurrentTab), ], ), diff --git a/lib/pages/parent_categorise_page.dart b/lib/pages/parent_categorise_page.dart index 6bdc9080..87b3e53a 100644 --- a/lib/pages/parent_categorise_page.dart +++ b/lib/pages/parent_categorise_page.dart @@ -31,14 +31,12 @@ class ParentCategorisePage extends StatefulWidget { String id; String titleName; - AuthenticatedUserObject authenticatedUserObject = - locator(); + AuthenticatedUserObject authenticatedUserObject = locator(); ParentCategorisePage({this.id, this.titleName}); @override - _ParentCategorisePageState createState() => - _ParentCategorisePageState(id: id, titleName: titleName); + _ParentCategorisePageState createState() => _ParentCategorisePageState(id: id, titleName: titleName); } class _ParentCategorisePageState extends State { @@ -77,782 +75,571 @@ class _ParentCategorisePageState extends State { ProjectViewModel projectViewModel = Provider.of(context); ProjectViewModel projectProvider = Provider.of(context); return BaseView( - onModelReady: (model) => model.getCategoriseParent( - i: id, pageIndex: pageIndex, isLoading: false, context: context), + onModelReady: (model) => model.getCategoriseParent(i: id, pageIndex: pageIndex, isLoading: false, context: context), allowAny: true, - builder: - (BuildContext context, PharmacyCategoriseViewModel model, - Widget child) => - AppScaffold( - isPharmacy: true, - appBarTitle: titleName, - isBottomBar: true, - isShowAppBar: true, - backgroundColor: Colors.white, - isShowDecPage: false, - showPharmacyCart: false, - showHomeAppBarIcon: false, - baseViewModel: model, - body: SmartRefresher( - enablePullDown: false, - controller: controller, - enablePullUp: true, - onLoading: () async { - setState(() { - ++pageIndex; - }); - await model.getParentProducts( - pageIndex: pageIndex, - i: id, - isLoading: true, - context: context); - if (model.state != ViewState.BusyLocal && - pageIndex < 5) { - controller.loadComplete(); - } else { - controller.loadFailed(); - } - }, - child: SingleChildScrollView( - child: Container( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Container( - child: Image.network( - id == '1' - ? 'https://uat.hmgwebservices.com/epharmacy/content/images/thumbs/0089188_personal-care_2.png' - : id == '2' - ? 'https://uat.hmgwebservices.com/epharmacy/content/images/thumbs/0089189_skin-care_2.png' - : id == '3' - ? 'https://uat.hmgwebservices.com/epharmacy/content/images/thumbs/0089190_health-care_2.png' - : id == '4' - ? 'https://uat.hmgwebservices.com/epharmacy/content/images/thumbs/0089191_sexual-health_2.png' - : id == '5' - ? 'https://uat.hmgwebservices.com/epharmacy/content/images/thumbs/0089192_beauty_2.png' - : id == '6' - ? 'https://uat.hmgwebservices.com/epharmacy/content/images/thumbs/0089193_baby-child_2.png' - : id == '7' - ? 'https://uat.hmgwebservices.com/epharmacy/content/images/thumbs/0089194_vitamins-supplements_2.png' - : id == '8' - ? 'https://uat.hmgwebservices.com/epharmacy/content/images/thumbs/0089195_diet-nutrition_2.png' - : id == '9' - ? 'https://uat.hmgwebservices.com/epharmacy/content/images/thumbs/0089196_household_2.png' - : id == '10' - ? 'https://uat.hmgwebservices.com/epharmacy/content/images/thumbs/0089197_home-care-appliances_2.png' - : '', - fit: BoxFit.fill, - height: 160.0, - width: double.infinity), - ), - if (model.categoriseParent.length > 8) - Column( - crossAxisAlignment: CrossAxisAlignment.start, + builder: (BuildContext context, PharmacyCategoriseViewModel model, Widget child) => AppScaffold( + isPharmacy: true, + appBarTitle: titleName, + isBottomBar: true, + isShowAppBar: true, + backgroundColor: Colors.white, + isShowDecPage: false, + showPharmacyCart: false, + showHomeAppBarIcon: false, + baseViewModel: model, + body: SmartRefresher( + enablePullDown: false, + controller: controller, + enablePullUp: true, + onLoading: () async { + setState(() { + ++pageIndex; + }); + await model.getParentProducts(pageIndex: pageIndex, i: id, isLoading: true, context: context); + if (model.state != ViewState.BusyLocal && pageIndex < 5) { + controller.loadComplete(); + } else { + controller.loadFailed(); + } + }, + child: SingleChildScrollView( + child: Container( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + child: Image.network( + id == '1' + ? 'https://uat.hmgwebservices.com/epharmacy/content/images/thumbs/0089188_personal-care_2.png' + : id == '2' + ? 'https://uat.hmgwebservices.com/epharmacy/content/images/thumbs/0089189_skin-care_2.png' + : id == '3' + ? 'https://uat.hmgwebservices.com/epharmacy/content/images/thumbs/0089190_health-care_2.png' + : id == '4' + ? 'https://uat.hmgwebservices.com/epharmacy/content/images/thumbs/0089191_sexual-health_2.png' + : id == '5' + ? 'https://uat.hmgwebservices.com/epharmacy/content/images/thumbs/0089192_beauty_2.png' + : id == '6' + ? 'https://uat.hmgwebservices.com/epharmacy/content/images/thumbs/0089193_baby-child_2.png' + : id == '7' + ? 'https://uat.hmgwebservices.com/epharmacy/content/images/thumbs/0089194_vitamins-supplements_2.png' + : id == '8' + ? 'https://uat.hmgwebservices.com/epharmacy/content/images/thumbs/0089195_diet-nutrition_2.png' + : id == '9' + ? 'https://uat.hmgwebservices.com/epharmacy/content/images/thumbs/0089196_household_2.png' + : id == '10' + ? 'https://uat.hmgwebservices.com/epharmacy/content/images/thumbs/0089197_home-care-appliances_2.png' + : '', + fit: BoxFit.fill, + height: 160.0, + width: double.infinity), + ), + if (model.categoriseParent.length > 8) + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + InkWell( + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - InkWell( - child: Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - children: [ - Padding( - padding: EdgeInsets.all(10.0), - child: Container( - child: Texts( - TranslationBase.of(context) - .viewCategorise, + Padding( + padding: EdgeInsets.all(10.0), + child: Container( + child: Texts( + TranslationBase.of(context).viewCategorise, // 'View All Categories', - fontWeight: FontWeight.w300, - ), - ), - ), - Icon(Icons.arrow_forward) - ], + fontWeight: FontWeight.w300, ), - onTap: () { - Navigator.push( - context, - FadePage( - page: SubCategoriseModalsheet( -// id: model.categorise[0].id, -// titleName: model.categorise[0].name, - )), - ); - }), - Divider( - thickness: 1.0, - color: Colors.grey.shade400, + ), ), + Icon(Icons.arrow_forward) ], ), + onTap: () { + Navigator.push( + context, + FadePage( + page: SubCategoriseModalsheet( +// id: model.categorise[0].id, +// titleName: model.categorise[0].name, + )), + ); + }), + Divider( + thickness: 1.0, + color: Colors.grey.shade400, + ), + ], + ), //Expanded widget heree if nassery - Padding( - padding: EdgeInsets.only(top: 35.0), - child: Container( - height: - MediaQuery.of(context).size.height * 0.2, - child: Center( - child: ListView.builder( - scrollDirection: Axis.horizontal, - itemCount: - model.categoriseParent.length > 8 - ? 8 - : model.categoriseParent.length, - itemBuilder: - (BuildContext context, int index) { - return Padding( - padding: EdgeInsets.symmetric( - horizontal: 8.0), - child: InkWell( - child: Column( - crossAxisAlignment: - CrossAxisAlignment.center, - children: [ - Padding( - padding: - EdgeInsets.symmetric( - horizontal: 13.0), - child: Container( - height: 60.0, - width: 65.0, - decoration: BoxDecoration( - shape: BoxShape.circle, - color: Colors - .orange.shade200 - .withOpacity(0.45), - ), - child: Center( - child: Icon( - Icons.apps_sharp, - size: 32.0, - ), - ), - ), - ), - Container( - width: - MediaQuery.of(context) - .size - .width * - 0.197, - // height: MediaQuery.of(context) - // .size - // .height * - // 0.08, - child: Center( - child: Texts( - projectViewModel - .isArabic - ? model - .categoriseParent[ - index] - .namen - : model - .categoriseParent[ - index] - .name, - fontSize: 13.4, - fontWeight: - FontWeight.w600, - maxLines: 3, - ), - ), - ), - ], + Padding( + padding: EdgeInsets.only(top: 35.0), + child: Container( + height: MediaQuery.of(context).size.height * 0.2, + child: Center( + child: ListView.builder( + scrollDirection: Axis.horizontal, + itemCount: model.categoriseParent.length > 8 ? 8 : model.categoriseParent.length, + itemBuilder: (BuildContext context, int index) { + return Padding( + padding: EdgeInsets.symmetric(horizontal: 8.0), + child: InkWell( + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Padding( + padding: EdgeInsets.symmetric(horizontal: 13.0), + child: Container( + height: 60.0, + width: 65.0, + decoration: BoxDecoration( + shape: BoxShape.circle, + color: Colors.orange.shade200.withOpacity(0.45), + ), + child: Center( + child: Icon( + Icons.apps_sharp, + size: 32.0, + ), ), - onTap: () { - Navigator.push( - context, - FadePage( - page: SubCategorisePage( - title: projectViewModel - .isArabic - ? model - .categoriseParent[ - index] - .namen - : model - .categoriseParent[ - index] - .name, - id: model - .categoriseParent[index] - .id, - parentId: id, - )), - ); - print(id); - }, ), - ); - }), - ), - ), - ), - - Divider( - thickness: 1.0, - color: Colors.grey.shade400, - ), - Padding( - padding: EdgeInsets.symmetric(horizontal: 8.0), - child: Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - children: [ - InkWell( - child: Row( - children: [ - Icon( - Icons.wrap_text, ), - SizedBox( - width: 10.0, - ), - Texts( - TranslationBase.of(context).refine, - fontWeight: FontWeight.w600, + Container( + width: MediaQuery.of(context).size.width * 0.197, + // height: MediaQuery.of(context) + // .size + // .height * + // 0.08, + child: Center( + child: Texts( + projectViewModel.isArabic ? model.categoriseParent[index].namen : model.categoriseParent[index].name, + fontSize: 13.4, + fontWeight: FontWeight.w600, + maxLines: 3, + ), + ), ), ], ), onTap: () { - showModalBottomSheet( - isScrollControlled: true, - context: context, - builder: (BuildContext context) { - return DraggableScrollableSheet( - initialChildSize: 0.95, - maxChildSize: 0.95, - minChildSize: 0.9, - builder: (BuildContext context, - ScrollController - scrollController) { - return SingleChildScrollView( - controller: - scrollController, - child: Container( - color: Colors.white, - height: - MediaQuery.of(context) - .size - .height * - 1.95, - child: Column( - children: [ - Padding( - padding: - EdgeInsets.all( - 8.0), - child: Row( - children: [ - Icon( - Icons - .wrap_text, - ), - SizedBox( - width: 10.0, - ), - Texts( - TranslationBase.of( - context) - .refine, + Navigator.push( + context, + FadePage( + page: SubCategorisePage( + title: projectViewModel.isArabic ? model.categoriseParent[index].namen : model.categoriseParent[index].name, + id: model.categoriseParent[index].id, + parentId: id, + )), + ); + print(id); + }, + ), + ); + }), + ), + ), + ), + + Divider( + thickness: 1.0, + color: Colors.grey.shade400, + ), + Padding( + padding: EdgeInsets.symmetric(horizontal: 8.0), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + InkWell( + child: Row( + children: [ + Icon( + Icons.wrap_text, + ), + SizedBox( + width: 10.0, + ), + Texts( + TranslationBase.of(context).refine, + fontWeight: FontWeight.w600, + ), + ], + ), + onTap: () { + showModalBottomSheet( + isScrollControlled: true, + context: context, + builder: (BuildContext context) { + return DraggableScrollableSheet( + initialChildSize: 0.95, + maxChildSize: 0.95, + minChildSize: 0.9, + builder: (BuildContext context, ScrollController scrollController) { + return SingleChildScrollView( + controller: scrollController, + child: Container( + color: Colors.white, + height: MediaQuery.of(context).size.height * 1.95, + child: Column( + children: [ + Padding( + padding: EdgeInsets.all(8.0), + child: Row( + children: [ + Icon( + Icons.wrap_text, + ), + SizedBox( + width: 10.0, + ), + Texts( + TranslationBase.of(context).refine, // 'Refine', - fontWeight: - FontWeight - .w600, - ), - SizedBox( - width: 250.0, - ), - InkWell( - child: Texts( + fontWeight: FontWeight.w600, + ), + SizedBox( + width: 250.0, + ), + InkWell( + child: Texts( // 'Close', - TranslationBase.of( - context) - .closeIt, - color: Colors - .red, - fontWeight: - FontWeight - .w600, - fontSize: - 15.0, - ), - onTap: () { - Navigator.pop( - context); - }, - ), - ], - ), + TranslationBase.of(context).closeIt, + color: Colors.red, + fontWeight: FontWeight.w600, + fontSize: 15.0, ), - Divider( - thickness: 1.0, - color: - Colors.black12, - ), - Column( - children: [ - ExpansionTile( - title: Texts( - TranslationBase.of( - context) - .categorise), - children: [ - ProcedureListWidget( - model: - model, - masterList: - model - .categoriseParent, - removeHistory: - (item) { - setState( - () { - entityList - .remove(item); - }); - }, - addHistory: - (history) { - setState( - () { - entityList - .add(history); - }); - }, - addSelectedHistories: - () { - //TODO build your fun herr - // widget.addSelectedHistories(); - }, - isEntityListSelected: - (master) => - isEntityListSelected(master), - ) - ], - ), - Divider( - thickness: 1.0, - color: Colors - .black12, - ), - ExpansionTile( - title: Texts( - TranslationBase.of( - context) - .brands), - children: [ - ProcedureListWidget( - model: - model, - masterList: - model - .brandsList, - removeHistory: - (item) { - setState( - () { - entityListBrands - .remove(item); - }); - }, - addHistory: - (history) { - setState( - () { - entityListBrands - .add(history); - }); - }, - addSelectedHistories: - () { - //TODO build your fun herr - // widget.addSelectedHistories(); - }, - isEntityListSelected: - (master) => - isEntityListSelectedBrands(master), - ) - ], - ), - Divider( - thickness: 1.0, - color: Colors - .black12, - ), - ExpansionTile( - title: Texts( - TranslationBase.of( - context) - .price), - children: [ - Container( - color: Color( - 0xffEEEEEE), - child: Row( - mainAxisAlignment: - MainAxisAlignment - .spaceAround, - children: [ - Column( - mainAxisAlignment: - MainAxisAlignment.start, - children: [ - Texts(TranslationBase.of(context).min), - Container( - color: Colors.white, - width: 200, - height: 40, - child: TextFormField( - decoration: InputDecoration( - border: OutlineInputBorder(), - ), - controller: minField, - ), - ), - ], - ), - Column( - mainAxisAlignment: - MainAxisAlignment.start, - children: [ - Texts(TranslationBase.of(context).max), - Container( - color: Colors.white, - width: 200, - height: 40, - child: TextFormField( - decoration: InputDecoration( - border: OutlineInputBorder(), - ), - controller: maxField, - ), - ), - ], - ), - ], - ), - ) - ], - ), - Divider( - thickness: 1.0, - color: Colors - .black12, - ), - SizedBox( - height: MediaQuery.of( - context) - .size - .height * - 0.4, - ), - Padding( - padding: - EdgeInsets - .all( - 8.0), - child: Row( - mainAxisAlignment: - MainAxisAlignment - .spaceEvenly, + onTap: () { + Navigator.pop(context); + }, + ), + ], + ), + ), + Divider( + thickness: 1.0, + color: Colors.black12, + ), + Column( + children: [ + ExpansionTile( + title: Texts(TranslationBase.of(context).group), + children: [ + ProcedureListWidget( + model: model, + masterList: model.categoriseParent, + removeHistory: (item) { + setState(() { + entityList.remove(item); + }); + }, + addHistory: (history) { + setState(() { + entityList.add(history); + }); + }, + addSelectedHistories: () { + //TODO build your fun herr + // widget.addSelectedHistories(); + }, + isEntityListSelected: (master) => isEntityListSelected(master), + ) + ], + ), + Divider( + thickness: 1.0, + color: Colors.black12, + ), + ExpansionTile( + title: Texts(TranslationBase.of(context).brands), + children: [ + ProcedureListWidget( + model: model, + masterList: model.brandsList, + removeHistory: (item) { + setState(() { + entityListBrands.remove(item); + }); + }, + addHistory: (history) { + setState(() { + entityListBrands.add(history); + }); + }, + addSelectedHistories: () { + //TODO build your fun herr + // widget.addSelectedHistories(); + }, + isEntityListSelected: (master) => isEntityListSelectedBrands(master), + ) + ], + ), + Divider( + thickness: 1.0, + color: Colors.black12, + ), + ExpansionTile( + title: Texts(TranslationBase.of(context).price), + children: [ + Container( + color: Color(0xffEEEEEE), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceAround, + children: [ + Column( + mainAxisAlignment: MainAxisAlignment.start, children: [ + Texts(TranslationBase.of(context).min), Container( - width: - 150, - child: - Button( - label: TranslationBase.of(context) - .reset, - backgroundColor: - Colors.red, - onTap: - () { - setState( - () { - entityList.clear(); - entityListBrands.clear(); - }); - minField - .clear(); - maxField - .clear(); - }, + color: Colors.white, + width: 200, + height: 40, + child: TextFormField( + decoration: InputDecoration( + border: OutlineInputBorder(), + ), + controller: minField, ), ), - SizedBox( - width: 10, - ), + ], + ), + Column( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Texts(TranslationBase.of(context).max), Container( - width: - 150, - child: - Button( - onTap: - () async { - String - categoriesId = - ""; - for (CategoriseParentModel category - in entityList) { - if (categoriesId == - "") { - categoriesId = category.id; - } else { - categoriesId = "$categoriesId,${category.id}"; - } - } - String - brandIds = - ""; - for (CategoriseParentModel brand - in entityListBrands) { - if (brandIds == - "") { - brandIds = brand.id; - } else { - brandIds = "$brandIds,${brand.id}"; - } - } - - GifLoaderDialogUtils.showMyDialog( - context); - - await model.getFilteredProducts( - min: minField.text.isEmpty ? "" : "&price_min=" + minField.text.toString(), - max: maxField.text.isEmpty ? "" : "&price_max=" + maxField.text.toString(), - categoryId: categoriesId, - brandId: brandIds.isEmpty ? "" : "&manufacturerids=" + brandIds); - GifLoaderDialogUtils.hideDialog( - context); - - Navigator.pop( - context); - }, - label: TranslationBase.of(context) - .apply, - backgroundColor: - Colors.green, + color: Colors.white, + width: 200, + height: 40, + child: TextFormField( + decoration: InputDecoration( + border: OutlineInputBorder(), + ), + controller: maxField, ), ), ], ), - ), - ], - ), + ], + ), + ) ], ), - ), - ); - }); - }, - ); - }, - ), - Row( - children: [ - Container( - height: 44.0, - child: VerticalDivider( - color: Colors.black45, - thickness: 1.0, + Divider( + thickness: 1.0, + color: Colors.black12, + ), + SizedBox( + height: MediaQuery.of(context).size.height * 0.4, + ), + Padding( + padding: EdgeInsets.all(8.0), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + Container( + width: 150, + child: Button( + label: TranslationBase.of(context).reset, + backgroundColor: Colors.red, + onTap: () { + setState(() { + entityList.clear(); + entityListBrands.clear(); + }); + minField.clear(); + maxField.clear(); + }, + ), + ), + SizedBox( + width: 10, + ), + Container( + width: 150, + child: Button( + onTap: () async { + String categoriesId = ""; + for (CategoriseParentModel category in entityList) { + if (categoriesId == "") { + categoriesId = category.id; + } else { + categoriesId = "$categoriesId,${category.id}"; + } + } + String brandIds = ""; + for (CategoriseParentModel brand in entityListBrands) { + if (brandIds == "") { + brandIds = brand.id; + } else { + brandIds = "$brandIds,${brand.id}"; + } + } + + GifLoaderDialogUtils.showMyDialog(context); + + await model.getFilteredProducts( + min: minField.text.isEmpty ? "" : "&price_min=" + minField.text.toString(), + max: maxField.text.isEmpty ? "" : "&price_max=" + maxField.text.toString(), + categoryId: categoriesId, + brandId: brandIds.isEmpty ? "" : "&manufacturerids=" + brandIds); + GifLoaderDialogUtils.hideDialog(context); + + Navigator.pop(context); + }, + label: TranslationBase.of(context).apply, + backgroundColor: Colors.green, + ), + ), + ], + ), + ), + ], + ), + ], + ), + ), + ); + }); + }, + ); + }, + ), + Row( + children: [ + Container( + height: 44.0, + child: VerticalDivider( + color: Colors.black45, + thickness: 1.0, //width: 0.3, // indent: 0.0, - ), - ), - Padding( - padding: EdgeInsets.all(8.0), - child: InkWell( - child: styleIcon, - onTap: () { - setState(() { - if (styleOne == true) { - styleOne = false; - styleTwo = true; - styleIcon = Icon( - Icons.auto_awesome_mosaic, - color: CustomColors.green, - size: 29.0, - ); - } else { - styleOne = true; - styleTwo = false; - styleIcon = Icon( - Icons.widgets_sharp, - color: CustomColors.green, - size: 29.0, - ); - } - }); - }, - ), - ), - ], - ), - ], + ), ), - ), - Divider( - thickness: 1.0, - color: Colors.grey.shade400, - ), - model.parentProducts.isNotEmpty - ? styleOne == true - ? Container( - height: model.parentProducts.length * - MediaQuery.of(context) - .size - .height * - 0.15, - child: GridView.builder( - physics: - NeverScrollableScrollPhysics(), - gridDelegate: - SliverGridDelegateWithFixedCrossAxisCount( - crossAxisCount: 2, - crossAxisSpacing: 0.5, - mainAxisSpacing: 2.0, - childAspectRatio: 0.9, - ), - itemCount: - model.parentProducts.length, - itemBuilder: (BuildContext context, - int index) { - return NetworkBaseView( - baseViewModel: model, - child: InkWell( - child: Card( - color: model - .parentProducts[ - index] - .discountName != - null - ? Color(0xffFFFF00) - : Colors.white, - elevation: 0, - shape: Border( - right: BorderSide( - color: Colors - .grey.shade300, - width: 1, - ), - left: BorderSide( - color: Colors - .grey.shade300, - width: 1, - ), - bottom: BorderSide( - color: Colors - .grey.shade300, - width: 1, - ), - top: BorderSide( - color: Colors - .grey.shade300, - width: 1, - ), - ), - margin: - EdgeInsets.symmetric( - horizontal: 8, - vertical: 4, - ), - child: Container( - decoration: - BoxDecoration( - borderRadius: - BorderRadius.only( - topLeft: - Radius.circular( - 110.0), + Padding( + padding: EdgeInsets.all(8.0), + child: InkWell( + child: styleIcon, + onTap: () { + setState(() { + if (styleOne == true) { + styleOne = false; + styleTwo = true; + styleIcon = Icon( + Icons.auto_awesome_mosaic, + color: CustomColors.green, + size: 29.0, + ); + } else { + styleOne = true; + styleTwo = false; + styleIcon = Icon( + Icons.widgets_sharp, + color: CustomColors.green, + size: 29.0, + ); + } + }); + }, + ), + ), + ], + ), + ], + ), + ), + Divider( + thickness: 1.0, + color: Colors.grey.shade400, + ), + model.parentProducts.isNotEmpty + ? styleOne == true + ? Container( + height: model.parentProducts.length * MediaQuery.of(context).size.height * 0.15, + child: GridView.builder( + physics: NeverScrollableScrollPhysics(), + gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( + crossAxisCount: 2, + crossAxisSpacing: 0.5, + mainAxisSpacing: 2.0, + childAspectRatio: 0.9, + ), + itemCount: model.parentProducts.length, + itemBuilder: (BuildContext context, int index) { + return NetworkBaseView( + baseViewModel: model, + child: InkWell( + child: Card( + color: model.parentProducts[index].discountName != null ? Color(0xffFFFF00) : Colors.white, + elevation: 0, + shape: Border( + right: BorderSide( + color: Colors.grey.shade300, + width: 1, + ), + left: BorderSide( + color: Colors.grey.shade300, + width: 1, + ), + bottom: BorderSide( + color: Colors.grey.shade300, + width: 1, + ), + top: BorderSide( + color: Colors.grey.shade300, + width: 1, + ), + ), + margin: EdgeInsets.symmetric( + horizontal: 8, + vertical: 4, + ), + child: Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.only( + topLeft: Radius.circular(110.0), + ), + color: Colors.white, + ), + padding: EdgeInsets.symmetric(horizontal: 0), + width: MediaQuery.of(context).size.width / 3, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Stack( + children: [ + if (model.parentProducts[index].discountName != null) + RotatedBox( + quarterTurns: 4, + child: Container( + decoration: BoxDecoration(), + child: Padding( + padding: EdgeInsets.only( + right: 5.0, + top: 20.0, + bottom: 5.0, + ), + child: Texts( + TranslationBase.of(context).offers.toUpperCase(), + color: Colors.red, + fontSize: 13.0, + fontWeight: FontWeight.w900, + ), + ), + transform: new Matrix4.rotationZ(5.837200), + ), + ), + Container( + margin: EdgeInsets.fromLTRB(0, 16, 0, 0), + alignment: Alignment.center, + child: Image.network( + model.parentProducts[index].images.isNotEmpty + ? model.parentProducts[index].images[0].thumb + : 'https://upload.wikimedia.org/wikipedia/commons/thumb/6/6c/No_image_3x4.svg/1200px-No_image_3x4.svg.png', + fit: BoxFit.cover, + height: 80, ), - color: Colors.white, ), - padding: EdgeInsets - .symmetric( - horizontal: 0), - width: MediaQuery.of( - context) - .size - .width / - 3, - child: Column( - crossAxisAlignment: - CrossAxisAlignment - .start, - children: [ - Stack( - children: [ - if (model - .parentProducts[ - index] - .discountName != - null) - RotatedBox( - quarterTurns: - 4, - child: - Container( - decoration: - BoxDecoration(), - child: - Padding( - padding: - EdgeInsets.only( - right: - 5.0, - top: - 20.0, - bottom: - 5.0, - ), - child: - Texts( - TranslationBase.of(context) - .offers - .toUpperCase(), - color: - Colors.red, - fontSize: - 13.0, - fontWeight: - FontWeight.w900, - ), - ), - transform: - new Matrix4.rotationZ( - 5.837200), - ), - ), - Container( - margin: EdgeInsets - .fromLTRB( - 0, - 16, - 0, - 0), - alignment: - Alignment - .center, - child: Image - .network( - model - .parentProducts[ - index] - .images - .isNotEmpty - ? model - .parentProducts[index] - .images[0] - .thumb - : 'https://upload.wikimedia.org/wikipedia/commons/thumb/6/6c/No_image_3x4.svg/1200px-No_image_3x4.svg.png', - fit: BoxFit - .cover, - height: 80, - ), - ), // Container( // width: model.parentProducts[index].rxMessage != // null @@ -902,251 +689,144 @@ class _ParentCategorisePageState extends State { // .w400, // // ), // ), - ], - ), + ], + ), + Container( + margin: EdgeInsets.symmetric( + horizontal: 6, + vertical: 0, + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + if (model.parentProducts[index].discountName != null) Container( - margin: EdgeInsets - .symmetric( - horizontal: 6, - vertical: 0, + width: double.infinity, + height: 13.0, + decoration: BoxDecoration( + color: Color(0xff5AB145), ), - child: Column( - crossAxisAlignment: - CrossAxisAlignment - .start, - children: [ - if (model - .parentProducts[ - index] - .discountName != - null) - Container( - width: double - .infinity, - height: - 13.0, - decoration: - BoxDecoration( - color: Color( - 0xff5AB145), - ), - child: - Center( - child: - Texts( - model - .parentProducts[index] - .discountName, - regular: - true, - color: - Colors.white, - fontSize: - 10.4, - ), - ), - ), - Texts( - projectViewModel - .isArabic - ? model - .parentProducts[ - index] - .namen - : model - .parentProducts[index] - .name, - regular: - true, - fontSize: - 12, - fontWeight: - FontWeight - .w700, - ), - Padding( - padding: const EdgeInsets - .only( - top: 4, - bottom: - 4), - child: - Texts( - "SAR ${model.parentProducts[index].price}", - bold: - true, - fontSize: - 14, - ), - ), - Row( - children: [ + child: Center( + child: Texts( + model.parentProducts[index].discountName, + regular: true, + color: Colors.white, + fontSize: 10.4, + ), + ), + ), + Texts( + projectViewModel.isArabic ? model.parentProducts[index].namen : model.parentProducts[index].name, + regular: true, + fontSize: 12, + fontWeight: FontWeight.w700, + ), + Padding( + padding: const EdgeInsets.only(top: 4, bottom: 4), + child: Texts( + "SAR ${model.parentProducts[index].price}", + bold: true, + fontSize: 14, + ), + ), + Row( + children: [ // StarRating( // totalAverage: model.parentProducts[index].approvedRatingSum > 0 // ? (model.parentProducts[index].approvedRatingSum.toDouble() / model.parentProducts[index].approvedRatingSum.toDouble()).toDouble() // : 0, // forceStars: true), - RatingBar - .readOnly( - initialRating: model - .parentProducts[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.parentProducts[index].approvedTotalReviews})", - regular: - true, - fontSize: - 10, - fontWeight: - FontWeight.w400, - ) - ], - ), - ], + RatingBar.readOnly( + initialRating: model.parentProducts[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.parentProducts[index].approvedTotalReviews})", + regular: true, + fontSize: 10, + fontWeight: FontWeight.w400, + ) + ], + ), + ], ), ), - onTap: () => { - Navigator.push( - context, - FadePage( - page: ProductDetailPage( - model.parentProducts[ - index]), - )), - }, - )); + ], + ), + ), + ), + onTap: () => { + Navigator.push( + context, + FadePage( + page: ProductDetailPage(model.parentProducts[index]), + )), }, - ), - ) - : Container( - height: model.parentProducts.length * - MediaQuery.of(context) - .size - .height * - 0.122, - child: ListView.builder( - physics: - NeverScrollableScrollPhysics(), - itemCount: - model.parentProducts.length, - itemBuilder: - (BuildContext context, - int index) { - return InkWell( - child: Card( - child: Row( + )); + }, + ), + ) + : Container( + height: model.parentProducts.length * MediaQuery.of(context).size.height * 0.122, + child: ListView.builder( + physics: NeverScrollableScrollPhysics(), + itemCount: model.parentProducts.length, + itemBuilder: (BuildContext context, int index) { + return InkWell( + child: Card( + child: Row( + children: [ + Stack( + children: [ + Column( 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 - .parentProducts[ - index] - .images - .isNotEmpty - ? Image - .network( - model - .parentProducts[index] - .images[0] - .thumb, - fit: BoxFit - .contain, - height: - 70, - ) - : Text(TranslationBase.of( - context) - .noImage), - ), - ], + Container( + decoration: BoxDecoration(), + child: Padding( + padding: EdgeInsets.only( + left: 9.0, + top: 8.0, + right: 10.0, ), - Column( - children: [ - Container( - width: model.parentProducts[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.parentProducts[index] - .rxMessage != - null - ? Texts( - projectProvider.isArabic - ? model.parentProducts[index].rxMessagen - : model.parentProducts[index].rxMessage, - color: - Colors.white, - regular: - true, - fontSize: - 10, - fontWeight: - FontWeight.w400, - ) - : Texts(""), + ), + ), + Container( + margin: EdgeInsets.fromLTRB(0, 0, 0, 0), + alignment: Alignment.center, + child: model.parentProducts[index].images.isNotEmpty + ? Image.network( + model.parentProducts[index].images[0].thumb, + fit: BoxFit.contain, + height: 70, + ) + : Text(TranslationBase.of(context).noImage), + ), + ], + ), + Column( + children: [ + Container( + width: model.parentProducts[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.parentProducts[index].rxMessage != null + ? Texts( + projectProvider.isArabic ? model.parentProducts[index].rxMessagen : model.parentProducts[index].rxMessage, + color: Colors.white, + regular: true, + fontSize: 10, + fontWeight: FontWeight.w400, + ) + : Texts(""), // Texts( // model.parentProducts[index].rxMessage != null ? model.parentProducts[index].rxMessage : "", // color: Colors.white, @@ -1154,201 +834,139 @@ class _ParentCategorisePageState extends State { // fontSize: 10, // fontWeight: FontWeight.w400, // ), - ), - ], - ), - ], ), - Container( - 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.635, - child: Texts( - projectViewModel - .isArabic - ? model - .parentProducts[ - index] - .namen - : model - .parentProducts[ - 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.parentProducts[index].price}", - bold: true, - fontSize: 14, - ), - ), - Row( - children: [ + ], + ), + ], + ), + Container( + 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.635, + child: Texts( + projectViewModel.isArabic ? model.parentProducts[index].namen : model.parentProducts[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.parentProducts[index].price}", + bold: true, + fontSize: 14, + ), + ), + Row( + children: [ // StarRating( // totalAverage: model.parentProducts[index].approvedRatingSum > 0 // ? (model.parentProducts[index].approvedRatingSum.toDouble() / model.parentProducts[index].approvedRatingSum.toDouble()).toDouble() // : 0, // forceStars: true), - RatingBar - .readOnly( - initialRating: model - .parentProducts[ - 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.parentProducts[index].approvedTotalReviews})", - regular: - true, - fontSize: - 10, - fontWeight: - FontWeight - .w400, - ) - ], - ), - ], + RatingBar.readOnly( + initialRating: model.parentProducts[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, ), - ), - widget.authenticatedUserObject - .isLogin - ? Container( - child: - IconButton( - icon: - Icon( - Icons - .shopping_cart, - size: - 18, - color: - CustomColors.green, - ), - onPressed: - () async { - if (model.parentProducts[index].isRx == - false) { - GifLoaderDialogUtils.showMyDialog(context); - await addToCartFunction(1, - model.parentProducts[index].id); - GifLoaderDialogUtils.hideDialog(context); - Utils.navigateToCartPage(); - } else { - AppToast.showErrorToast(message: TranslationBase.of(context).needPrescription); - } - }), - ) - : Container(), - ], - ), + Texts( + "(${model.parentProducts[index].approvedTotalReviews})", + regular: true, + fontSize: 10, + fontWeight: FontWeight.w400, + ) + ], + ), + ], ), - onTap: () => { - Navigator.push( - context, - FadePage( - page: ProductDetailPage( - model.parentProducts[ - index]), - )), - }, - ); - }), - ) - : Padding( - padding: const EdgeInsets.all(12.0), - child: Container( - child: Center( - child: Column( - mainAxisAlignment: - MainAxisAlignment.center, - children: [ - Padding( - padding: - const EdgeInsets.all(8.0), - child: Image.asset( - 'assets/images/new-design/empty_box.png', - width: 100, - height: 100, - fit: BoxFit.cover, - ), - ), - Padding( - padding: - const EdgeInsets.all(8.0), - child: Text( - TranslationBase.of(context) - .noData, - // 'There is no data', - style: - TextStyle(fontSize: 30), ), - ) - ], + widget.authenticatedUserObject.isLogin + ? Container( + child: IconButton( + icon: Icon( + Icons.shopping_cart, + size: 18, + color: CustomColors.green, + ), + onPressed: () async { + if (model.parentProducts[index].isRx == false) { + GifLoaderDialogUtils.showMyDialog(context); + await addToCartFunction(1, model.parentProducts[index].id); + GifLoaderDialogUtils.hideDialog(context); + Utils.navigateToCartPage(); + } else { + AppToast.showErrorToast(message: TranslationBase.of(context).needPrescription); + } + }), + ) + : Container(), + ], + ), ), + onTap: () => { + Navigator.push( + context, + FadePage( + page: ProductDetailPage(model.parentProducts[index]), + )), + }, + ); + }), + ) + : Padding( + padding: const EdgeInsets.all(12.0), + child: Container( + child: Center( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Padding( + padding: const EdgeInsets.all(8.0), + child: Image.asset( + 'assets/images/new-design/empty_box.png', + width: 100, + height: 100, + fit: BoxFit.cover, ), ), - ) - ], - ), - ), - ), - ))); + Padding( + padding: const EdgeInsets.all(8.0), + child: Text( + TranslationBase.of(context).noData, + // 'There is no data', + style: TextStyle(fontSize: 30), + ), + ) + ], + ), + ), + ), + ) + ], + ), + ), + ), + ))); } addToCartFunction(quantity, itemID) async { @@ -1357,8 +975,7 @@ class _ParentCategorisePageState extends State { } bool isEntityListSelected(CategoriseParentModel masterKey) { - Iterable history = - entityList.where((element) => masterKey.id == element.id); + Iterable history = entityList.where((element) => masterKey.id == element.id); if (history.length > 0) { return true; } @@ -1366,8 +983,7 @@ class _ParentCategorisePageState extends State { } bool isEntityListSelectedBrands(CategoriseParentModel masterKey) { - Iterable history = - entityListBrands.where((element) => masterKey.id == element.id); + Iterable history = entityListBrands.where((element) => masterKey.id == element.id); if (history.length > 0) { return true; } diff --git a/lib/pages/pharmacy/order/ProductReview.dart b/lib/pages/pharmacy/order/ProductReview.dart index 04c67079..2b278958 100644 --- a/lib/pages/pharmacy/order/ProductReview.dart +++ b/lib/pages/pharmacy/order/ProductReview.dart @@ -333,7 +333,7 @@ class _ProductReviewPageState extends State { Navigator.push( context, MaterialPageRoute(builder: (context) { - return PharmacyProfilePage(); + return PharmacyProfilePage(moveToOrder: true); }), ); }, diff --git a/lib/pages/pharmacy/profile/profile.dart b/lib/pages/pharmacy/profile/profile.dart index 2c72c14e..ecbd97ca 100644 --- a/lib/pages/pharmacy/profile/profile.dart +++ b/lib/pages/pharmacy/profile/profile.dart @@ -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(); @@ -114,6 +115,9 @@ class _ProfilePageState extends State { showPharmacyCart: false, showHomeAppBarIcon: false, isMainPharmacyPages: true, + backButtonTab: () { + widget.changeTab(0); + }, body: user != null ? Container( color: Colors.white, diff --git a/lib/services/pharmacy_services/orderDetails_service.dart b/lib/services/pharmacy_services/orderDetails_service.dart index 3b03dabc..49506bfb 100644 --- a/lib/services/pharmacy_services/orderDetails_service.dart +++ b/lib/services/pharmacy_services/orderDetails_service.dart @@ -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": { diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index 5fdcbb01..eebe7b8c 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -2818,6 +2818,7 @@ 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]; } class TranslationBaseDelegate extends LocalizationsDelegate { From c05772c63a6d8e16d1aec521399833c7fa944b62 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Tue, 21 Dec 2021 10:52:13 +0300 Subject: [PATCH 06/19] pharmacy fixes --- .../model/pharmacies/PointsAmountPerday.dart | 4 ++-- lib/core/model/pharmacies/PointsDetails.dart | 6 ++--- .../service/parmacyModule/lacum-service.dart | 8 +++++-- .../PharmacyAddressesViewModel.dart | 5 ++++- .../pharmacyAddresses/PharmacyAddresses.dart | 22 +++++++++---------- .../pharmacyAddress_service.dart | 2 +- lib/uitl/translations_delegate_base.dart | 2 +- 7 files changed, 27 insertions(+), 22 deletions(-) diff --git a/lib/core/model/pharmacies/PointsAmountPerday.dart b/lib/core/model/pharmacies/PointsAmountPerday.dart index e78e87b7..634233b9 100644 --- a/lib/core/model/pharmacies/PointsAmountPerday.dart +++ b/lib/core/model/pharmacies/PointsAmountPerday.dart @@ -1,10 +1,10 @@ import 'PointsDetails.dart'; class PointsAmountPerday { - double amountPerDay; + num amountPerDay; String day; List pointsDetails; - double pointsPerDay; + num pointsPerDay; String transationDate; PointsAmountPerday( diff --git a/lib/core/model/pharmacies/PointsDetails.dart b/lib/core/model/pharmacies/PointsDetails.dart index 7b342af9..9a251d83 100644 --- a/lib/core/model/pharmacies/PointsDetails.dart +++ b/lib/core/model/pharmacies/PointsDetails.dart @@ -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; diff --git a/lib/core/service/parmacyModule/lacum-service.dart b/lib/core/service/parmacyModule/lacum-service.dart index 122bafd6..1401df17 100644 --- a/lib/core/service/parmacyModule/lacum-service.dart +++ b/lib/core/service/parmacyModule/lacum-service.dart @@ -39,8 +39,12 @@ class LacumService extends BaseService{ super.error = ""; Map body = Map(); - body['IdentificationNo'] = user.patientIdentificationNo; - body['AccountNumber'] = "${lacumInformation.yahalaAccountNo}"; + // body['IdentificationNo'] = user.patientIdentificationNo; + // body['AccountNumber'] = "${lacumInformation.yahalaAccountNo}"; + + body['IdentificationNo'] = "2076117163"; + body['AccountNumber'] = "2019000006"; + body['IsDetailsRequired'] = true; try { diff --git a/lib/core/viewModels/pharmacyModule/PharmacyAddressesViewModel.dart b/lib/core/viewModels/pharmacyModule/PharmacyAddressesViewModel.dart index 2e883e5e..c1f8f1d1 100644 --- a/lib/core/viewModels/pharmacyModule/PharmacyAddressesViewModel.dart +++ b/lib/core/viewModels/pharmacyModule/PharmacyAddressesViewModel.dart @@ -77,7 +77,6 @@ class PharmacyAddressesViewModel extends BaseViewModel { await _pharmacyAddressService.addCustomerAddress(sendingAddress); } else { await _pharmacyAddressService.editCustomerAddress(sendingAddress).then((value) async { - // await _pharmacyAddressService.getAddresses(); }); } @@ -85,6 +84,8 @@ class PharmacyAddressesViewModel extends BaseViewModel { setState(ViewState.Idle); } else { setState(ViewState.Idle); + await Future.delayed(Duration(milliseconds: 800)); + getAddressesList(); } } @@ -96,6 +97,8 @@ class PharmacyAddressesViewModel extends BaseViewModel { setState(ViewState.Error); } else { setState(ViewState.Idle); + await Future.delayed(Duration(milliseconds: 800)); + getAddressesList(); } } diff --git a/lib/pages/pharmacy/pharmacyAddresses/PharmacyAddresses.dart b/lib/pages/pharmacy/pharmacyAddresses/PharmacyAddresses.dart index 3a9c4da4..69986350 100644 --- a/lib/pages/pharmacy/pharmacyAddresses/PharmacyAddresses.dart +++ b/lib/pages/pharmacy/pharmacyAddresses/PharmacyAddresses.dart @@ -314,26 +314,24 @@ class _AddressItemWidgetState extends State { 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, diff --git a/lib/services/pharmacy_services/pharmacyAddress_service.dart b/lib/services/pharmacy_services/pharmacyAddress_service.dart index 352473e4..17428438 100644 --- a/lib/services/pharmacy_services/pharmacyAddress_service.dart +++ b/lib/services/pharmacy_services/pharmacyAddress_service.dart @@ -104,7 +104,7 @@ class PharmacyAddressService extends BaseService { response['customers'][0]['addresses'].forEach((item) { addresses.add(AddressInfo.fromJson(item)); }); - getAddresses(); + // getAddresses(); }, onFailure: (String error, int statusCode) { hasError = true; super.error = error; diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index eebe7b8c..22282832 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -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]; From cc783045bb16095dea867634246fadbe2ef92e37 Mon Sep 17 00:00:00 2001 From: Fatimah Alshammari Date: Tue, 21 Dec 2021 14:32:20 +0300 Subject: [PATCH 07/19] fix categories & cantact design --- .../order_model_view_model.dart | 5 +- lib/pages/final_products_page.dart | 4 +- lib/pages/pharmacy/order/ProductReview.dart | 5 +- lib/pages/pharmacy/pharmacyContacts.dart | 92 ++++++++++++++++--- 4 files changed, 88 insertions(+), 18 deletions(-) diff --git a/lib/core/viewModels/pharmacyModule/order_model_view_model.dart b/lib/core/viewModels/pharmacyModule/order_model_view_model.dart index 0ea53363..47950b3d 100644 --- a/lib/core/viewModels/pharmacyModule/order_model_view_model.dart +++ b/lib/core/viewModels/pharmacyModule/order_model_view_model.dart @@ -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"); } diff --git a/lib/pages/final_products_page.dart b/lib/pages/final_products_page.dart index 41fa74f0..6eea4537 100644 --- a/lib/pages/final_products_page.dart +++ b/lib/pages/final_products_page.dart @@ -421,7 +421,7 @@ class _FinalProductsPageState extends State { 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 { 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, diff --git a/lib/pages/pharmacy/order/ProductReview.dart b/lib/pages/pharmacy/order/ProductReview.dart index 04c67079..22483b02 100644 --- a/lib/pages/pharmacy/order/ProductReview.dart +++ b/lib/pages/pharmacy/order/ProductReview.dart @@ -36,6 +36,7 @@ class _ProductReviewPageState extends State { isPharmacy: true, showPharmacyCart: false, showHomeAppBarIcon: false, + isBottomBar: true, body: Container( color: Colors.white, child: !finishReview ? SingleChildScrollView( @@ -118,7 +119,7 @@ class _ProductReviewPageState extends State { 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 { ? () { model .makeReview( - widget.product, ratingValue, reviewText, context) + widget.product, ratingValue, reviewText) .then((value) { setState(() { finishReview = true; diff --git a/lib/pages/pharmacy/pharmacyContacts.dart b/lib/pages/pharmacy/pharmacyContacts.dart index a4ce3a56..fc88ce89 100644 --- a/lib/pages/pharmacy/pharmacyContacts.dart +++ b/lib/pages/pharmacy/pharmacyContacts.dart @@ -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 { @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 { ), 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 { 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: [ @@ -94,7 +162,7 @@ class _pharmacyContactsPageState extends State { SizedBox( width: 30, ), - Text("+966 " + " -11- 2833400", + Text(projectViewModel.isArabic ? "2833400 " + " -11- 966+": "+966 " + " -11- 2833400", style: TextStyle( color: Colors.grey[700], fontSize: 16, @@ -130,7 +198,7 @@ class _pharmacyContactsPageState extends State { SizedBox( width: 30, ), - Text("+966 " + " 558434444", + Text(projectViewModel.isArabic ? "558434444 " + " 966+" :"+966 " + " 558434444", style: TextStyle( color: Colors.grey[700], fontSize: 16, From c175139a29fe57855092009a2ef149789d3b6699 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Tue, 21 Dec 2021 14:53:56 +0300 Subject: [PATCH 08/19] pharmacy fixes --- .../service/PrescriptionDeliveryService.dart | 4 +-- .../PrescriptionDeliveryViewModel.dart | 4 +-- .../fragments/home_page_fragment2.dart | 27 ++++++++++--------- .../PrescriptionOrderOverveiw.dart | 1 + 4 files changed, 19 insertions(+), 17 deletions(-) diff --git a/lib/core/service/PrescriptionDeliveryService.dart b/lib/core/service/PrescriptionDeliveryService.dart index 28e5bae4..16fcf1d0 100644 --- a/lib/core/service/PrescriptionDeliveryService.dart +++ b/lib/core/service/PrescriptionDeliveryService.dart @@ -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 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.toString(); 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); diff --git a/lib/core/viewModels/medical/PrescriptionDeliveryViewModel.dart b/lib/core/viewModels/medical/PrescriptionDeliveryViewModel.dart index ada4da78..d4ceff00 100644 --- a/lib/core/viewModels/medical/PrescriptionDeliveryViewModel.dart +++ b/lib/core/viewModels/medical/PrescriptionDeliveryViewModel.dart @@ -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); diff --git a/lib/pages/landing/fragments/home_page_fragment2.dart b/lib/pages/landing/fragments/home_page_fragment2.dart index 8fa20eaa..bbbf90fc 100644 --- a/lib/pages/landing/fragments/home_page_fragment2.dart +++ b/lib/pages/landing/fragments/home_page_fragment2.dart @@ -280,7 +280,8 @@ class _HomePageFragment2State extends State { child: InkWell( onTap: () { AuthenticatedUser user = projectViewModel.user; - if (projectViewModel.havePrivilege(82)) Navigator.of(context).push(MaterialPageRoute(builder: (context) => PackagesHomePage(user))); + // if (projectViewModel.havePrivilege(82)) + Navigator.of(context).push(MaterialPageRoute(builder: (context) => PackagesHomePage(user))); }, child: Stack( children: [ @@ -427,18 +428,18 @@ class _HomePageFragment2State extends State { ], ), ), - 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, - ), - ) + // 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, + // ), + // ) ], ), ), diff --git a/lib/pages/medical/prescriptions/PrescriptionOrderOverveiw.dart b/lib/pages/medical/prescriptions/PrescriptionOrderOverveiw.dart index 8d601081..37fb937a 100644 --- a/lib/pages/medical/prescriptions/PrescriptionOrderOverveiw.dart +++ b/lib/pages/medical/prescriptions/PrescriptionOrderOverveiw.dart @@ -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); From 57d10d9e1fc89ee88b7da5fd5829296d513f2af2 Mon Sep 17 00:00:00 2001 From: Fatimah Alshammari Date: Sun, 26 Dec 2021 09:17:49 +0300 Subject: [PATCH 09/19] fix compare issue --- lib/core/model/pharmacies/Specifications.dart | 12 ++++++------ .../parmacyModule/parmacy_module_service.dart | 4 ++-- lib/core/service/pharmacy_categorise_service.dart | 4 ++-- lib/pages/pharmacies/compare-list.dart | 4 ++-- .../pharmacy_services/product_detail_service.dart | 3 ++- 5 files changed, 14 insertions(+), 13 deletions(-) diff --git a/lib/core/model/pharmacies/Specifications.dart b/lib/core/model/pharmacies/Specifications.dart index f227de69..30a4a7cd 100644 --- a/lib/core/model/pharmacies/Specifications.dart +++ b/lib/core/model/pharmacies/Specifications.dart @@ -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, diff --git a/lib/core/service/parmacyModule/parmacy_module_service.dart b/lib/core/service/parmacyModule/parmacy_module_service.dart index 7c7afa30..c6fc6b72 100644 --- a/lib/core/service/parmacyModule/parmacy_module_service.dart +++ b/lib/core/service/parmacyModule/parmacy_module_service.dart @@ -137,7 +137,7 @@ class PharmacyModuleService extends BaseService { Map 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 +181,7 @@ class PharmacyModuleService extends BaseService { hasError = false; Map 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) { diff --git a/lib/core/service/pharmacy_categorise_service.dart b/lib/core/service/pharmacy_categorise_service.dart index ef8650c8..aa3c9e95 100644 --- a/lib/core/service/pharmacy_categorise_service.dart +++ b/lib/core/service/pharmacy_categorise_service.dart @@ -281,7 +281,7 @@ class PharmacyCategoriseService extends BaseService { Future getBestSellerProducts() async { Map 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 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, diff --git a/lib/pages/pharmacies/compare-list.dart b/lib/pages/pharmacies/compare-list.dart index 0b1aa73d..be969678 100644 --- a/lib/pages/pharmacies/compare-list.dart +++ b/lib/pages/pharmacies/compare-list.dart @@ -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' ); diff --git a/lib/services/pharmacy_services/product_detail_service.dart b/lib/services/pharmacy_services/product_detail_service.dart index d326c130..aaa0ab9b 100644 --- a/lib/services/pharmacy_services/product_detail_service.dart +++ b/lib/services/pharmacy_services/product_detail_service.dart @@ -162,8 +162,9 @@ class ProductDetailService extends BaseService { Future getWishlistItems() async { var customerId = await sharedPref.getString(PHARMACY_CUSTOMER_ID); + var customerGUID = 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+ "/$customerGUID/" + "?shopping_cart_type=2", onSuccess: (dynamic response, int statusCode) { _wishListProducts.clear(); response['shopping_carts'].forEach((item) { _wishListProducts.add(Wishlist.fromJson(item)); From 6d886076319df65d1a0022a88383c6156049689a Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Sun, 26 Dec 2021 10:20:58 +0300 Subject: [PATCH 10/19] Updates & fixes --- lib/config/config.dart | 42 +++++++++---------- .../service/PrescriptionDeliveryService.dart | 2 +- .../PharmacyAddressesViewModel.dart | 2 + .../cart-page/payment_bottom_widget.dart | 2 +- .../pharmacyAddresses/PharmacyAddresses.dart | 17 +++++--- lib/pages/pharmacy/pharmacyContacts.dart | 15 ++++--- .../pharmacyAddress_service.dart | 12 +++--- .../product_detail_service.dart | 6 ++- 8 files changed, 55 insertions(+), 43 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index 1e0df374..90d4cb77 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -31,7 +31,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'; @@ -146,18 +146,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'; @@ -606,27 +606,27 @@ 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/"; diff --git a/lib/core/service/PrescriptionDeliveryService.dart b/lib/core/service/PrescriptionDeliveryService.dart index 16fcf1d0..02831893 100644 --- a/lib/core/service/PrescriptionDeliveryService.dart +++ b/lib/core/service/PrescriptionDeliveryService.dart @@ -28,7 +28,7 @@ class PrescriptionDeliveryService extends BaseService { body['AppointmentNo'] = appointmentNo.toString(); // body['CreatedBy'] = createdBy; body['DischargeID'] = dischargeID.toString(); - body['ProjectID'] = projectID.toString(); + body['ProjectID'] = projectID; await baseAppClient.post(ADD_PRESCRIPTION_ORDER_RC, isRCService: true, onSuccess: (dynamic response, int statusCode) { }, onFailure: (String error, int statusCode) { hasError = true; diff --git a/lib/core/viewModels/pharmacyModule/PharmacyAddressesViewModel.dart b/lib/core/viewModels/pharmacyModule/PharmacyAddressesViewModel.dart index c1f8f1d1..02783f9f 100644 --- a/lib/core/viewModels/pharmacyModule/PharmacyAddressesViewModel.dart +++ b/lib/core/viewModels/pharmacyModule/PharmacyAddressesViewModel.dart @@ -82,6 +82,8 @@ class PharmacyAddressesViewModel extends BaseViewModel { if (_pharmacyAddressService.hasError) { setState(ViewState.Idle); + await Future.delayed(Duration(milliseconds: 800)); + getAddressesList(); } else { setState(ViewState.Idle); await Future.delayed(Duration(milliseconds: 800)); diff --git a/lib/pages/pharmacies/screens/cart-page/payment_bottom_widget.dart b/lib/pages/pharmacies/screens/cart-page/payment_bottom_widget.dart index 61248543..d74bfa87 100644 --- a/lib/pages/pharmacies/screens/cart-page/payment_bottom_widget.dart +++ b/lib/pages/pharmacies/screens/cart-page/payment_bottom_widget.dart @@ -45,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), diff --git a/lib/pages/pharmacy/pharmacyAddresses/PharmacyAddresses.dart b/lib/pages/pharmacy/pharmacyAddresses/PharmacyAddresses.dart index 69986350..2930e51e 100644 --- a/lib/pages/pharmacy/pharmacyAddresses/PharmacyAddresses.dart +++ b/lib/pages/pharmacy/pharmacyAddresses/PharmacyAddresses.dart @@ -34,11 +34,16 @@ class PharmacyAddressesPage extends StatefulWidget { class _PharmacyAddressesState extends State { 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(); }); } @@ -320,7 +325,7 @@ class _AddressItemWidgetState extends State { okText: TranslationBase.of(context).delete, cancelText: TranslationBase.of(context).cancel_nocaps, okFunction: () => { - ConfirmDialog.closeAlertDialog(context), + ConfirmDialog.closeAlertDialog(context), setState(() { widget.model.deleteAddresses(widget.address).then((_) { AppToast.showSuccessToast( diff --git a/lib/pages/pharmacy/pharmacyContacts.dart b/lib/pages/pharmacy/pharmacyContacts.dart index fc88ce89..bb3a4728 100644 --- a/lib/pages/pharmacy/pharmacyContacts.dart +++ b/lib/pages/pharmacy/pharmacyContacts.dart @@ -162,12 +162,15 @@ class _pharmacyContactsPageState extends State { SizedBox( width: 30, ), - Text(projectViewModel.isArabic ? "2833400 " + " -11- 966+": "+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( diff --git a/lib/services/pharmacy_services/pharmacyAddress_service.dart b/lib/services/pharmacy_services/pharmacyAddress_service.dart index 17428438..4ed6ce3f 100644 --- a/lib/services/pharmacy_services/pharmacyAddress_service.dart +++ b/lib/services/pharmacy_services/pharmacyAddress_service.dart @@ -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)); - }); + // 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); } } diff --git a/lib/services/pharmacy_services/product_detail_service.dart b/lib/services/pharmacy_services/product_detail_service.dart index d326c130..c16f2d90 100644 --- a/lib/services/pharmacy_services/product_detail_service.dart +++ b/lib/services/pharmacy_services/product_detail_service.dart @@ -162,8 +162,9 @@ class ProductDetailService extends BaseService { 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,8 +177,9 @@ 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)); From 4e3d99b0078c129753811179f20b652575f4c24b Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Sun, 26 Dec 2021 11:08:46 +0300 Subject: [PATCH 11/19] Updates & fixes --- lib/config/localized_values.dart | 4 ++-- lib/pages/pharmacies/screens/lacum-activitaion-vida-page.dart | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index e028af76..86cb7469 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -809,7 +809,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 +1570,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": "سنة"}, diff --git a/lib/pages/pharmacies/screens/lacum-activitaion-vida-page.dart b/lib/pages/pharmacies/screens/lacum-activitaion-vida-page.dart index 9e281694..4d2c5fbd 100644 --- a/lib/pages/pharmacies/screens/lacum-activitaion-vida-page.dart +++ b/lib/pages/pharmacies/screens/lacum-activitaion-vida-page.dart @@ -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( From 28107f9a484adb057223d62616db4b3ca3bc3061 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Sun, 26 Dec 2021 12:20:03 +0300 Subject: [PATCH 12/19] Compare duplication fixed --- lib/pages/pharmacies/compare.dart | 639 +++++++++++------------------- 1 file changed, 239 insertions(+), 400 deletions(-) diff --git a/lib/pages/pharmacies/compare.dart b/lib/pages/pharmacies/compare.dart index 34b21001..67ba25b5 100644 --- a/lib/pages/pharmacies/compare.dart +++ b/lib/pages/pharmacies/compare.dart @@ -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 { 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 { icon: Icon(FontAwesomeIcons.trashAlt, size: 15), onPressed: () { setState(() { - Provider.of(context, listen: false) - .deleteItem(widget.data[index].id); + Provider.of(context, listen: false).deleteItem(widget.data[index].id); }); }, ), @@ -173,53 +156,42 @@ class _slideDetailState extends State { ), 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 { ), ), 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 { ), 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 { ), 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 { ), 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 { ), 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 { ), 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 { ); } } - -String returnString(data) { - for (int i = 0; i < data.length; i++) { - print(data[i]); -// if(data[i] == null){ -// if(counter == i){ -// -// } -// } - } - return "ENAD HILAL"; -} From 0985436a1059f6758c2d5ec8b144360d3ad771ed Mon Sep 17 00:00:00 2001 From: Fatimah Alshammari Date: Sun, 26 Dec 2021 12:32:33 +0300 Subject: [PATCH 13/19] fix translation issue --- lib/config/localized_values.dart | 1 + lib/pages/sub_categorise_page.dart | 2 +- lib/uitl/translations_delegate_base.dart | 2 ++ 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index e028af76..b9e446d9 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -656,6 +656,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": "حسابي"}, diff --git a/lib/pages/sub_categorise_page.dart b/lib/pages/sub_categorise_page.dart index 1856aedb..325e5fd9 100644 --- a/lib/pages/sub_categorise_page.dart +++ b/lib/pages/sub_categorise_page.dart @@ -151,7 +151,7 @@ class _SubCategorisePageState extends State { padding: EdgeInsets.all(10.0), child: Container( child: Texts(TranslationBase.of(context) - .viewCategorise), + .viewSubCategorise), ), ), Icon(Icons.arrow_forward) diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index 22282832..ff0043e0 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -1253,6 +1253,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]; From 40d649dfa469a1db223e126ccf087e3b528ef9a3 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Mon, 27 Dec 2021 17:39:01 +0300 Subject: [PATCH 14/19] Updates & fixes --- lib/analytics/google-analytics.dart | 2 +- lib/config/config.dart | 4 +- .../pharmacies/PointsAmountPerMonth.dart | 8 +- .../service/ancillary_orders_service.dart | 8 - lib/core/service/client/base_app_client.dart | 10 +- lib/core/service/er/am_service.dart | 7 - .../geofencing/GeofencingServices.dart | 15 +- .../service/medical/my_balance_service.dart | 1 - .../service/parmacyModule/lacum-service.dart | 12 +- .../parmacyModule/parmacy_module_service.dart | 5 - .../NewHomeHealthCare/location_page.dart | 3 - .../ancillary-orders/ancillaryOrders.dart | 229 ++++++++-------- .../ancillaryOrdersDetails.dart | 126 ++++++--- .../body_fat/body_fat_result_page.dart | 1 - .../carbs/carbs_result_page.dart | 1 - .../ideal_body/ideal_body.dart | 9 - .../BookAppointment/DentalComplaints.dart | 2 - lib/pages/BookAppointment/QRCode.dart | 67 ++--- .../components/SearchByClinic.dart | 4 - lib/pages/TestPage.dart | 2 +- lib/pages/ToDoList/ToDo.dart | 221 --------------- lib/pages/livecare/livecare_home.dart | 1 - lib/pages/login/login.dart | 18 +- .../medical/balance/confirm_payment_page.dart | 3 - .../medical/labs/passport_update_page.dart | 1 - .../medical/medical_profile_page_new.dart | 28 -- .../syncHealthData.dart | 1 - .../ClinicOfferAndPackagesPage.dart | 1 - .../OfferAndPackagesCartPage.dart | 2 +- .../screens/lacum-transfer-page.dart | 118 +++----- .../pharmacies/screens/lakum-main-page.dart | 180 ++++-------- .../screens/lakum-points-month-page.dart | 62 ++--- .../screens/lakum-points-year-page.dart | 9 +- .../widgets/lakum-point-table-row-widget.dart | 4 +- .../pharmacyAddresses/PharmacyAddresses.dart | 2 - lib/pages/pharmacy/profile/profile.dart | 4 - lib/pages/webRTC/signaling.dart | 8 +- .../cancelOrder_service.dart | 1 + .../pharmacy_services/review_service.dart | 2 - lib/uitl/HMG_Geofence.dart | 6 +- lib/uitl/date_uitl.dart | 3 - lib/uitl/location_util.dart | 2 +- lib/uitl/push-notification-handler.dart | 4 - lib/uitl/utils.dart | 256 +++++------------- lib/widgets/in_app_browser/InAppBrowser.dart | 2 +- 45 files changed, 458 insertions(+), 997 deletions(-) diff --git a/lib/analytics/google-analytics.dart b/lib/analytics/google-analytics.dart index 0ded8cc6..93a67811 100644 --- a/lib/analytics/google-analytics.dart +++ b/lib/analytics/google-analytics.dart @@ -33,7 +33,7 @@ class NavObserver extends RouteObserver> { screenName: event.flutterName(), screenClassOverride: className) .catchError( (Object error) { - debugPrint('$FirebaseAnalyticsObserver: $error'); + print('$FirebaseAnalyticsObserver: $error'); }, test: (Object error) { return error is PlatformException; diff --git a/lib/config/config.dart b/lib/config/config.dart index 90d4cb77..006acf22 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -15,8 +15,8 @@ const PACKAGES_CUSTOMER = '/api/customers'; const PACKAGES_SHOPPING_CART = '/api/shopping_cart_items'; const PACKAGES_ORDERS = '/api/orders'; 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/'; diff --git a/lib/core/model/pharmacies/PointsAmountPerMonth.dart b/lib/core/model/pharmacies/PointsAmountPerMonth.dart index c5b96bd8..bd566828 100644 --- a/lib/core/model/pharmacies/PointsAmountPerMonth.dart +++ b/lib/core/model/pharmacies/PointsAmountPerMonth.dart @@ -1,11 +1,11 @@ import 'PointsAmountPerday.dart'; class PointsAmountPerMonth { - dynamic amountPerMonth; - dynamic month; - int monthNumber; + num amountPerMonth; + String month; + num monthNumber; List pointsAmountPerday; - dynamic pointsPerMonth; + num pointsPerMonth; PointsAmountPerMonth( {this.amountPerMonth, diff --git a/lib/core/service/ancillary_orders_service.dart b/lib/core/service/ancillary_orders_service.dart index 4bfbad53..c068ad3e 100644 --- a/lib/core/service/ancillary_orders_service.dart +++ b/lib/core/service/ancillary_orders_service.dart @@ -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; diff --git a/lib/core/service/client/base_app_client.dart b/lib/core/service/client/base_app_client.dart index fefc9139..8d722568 100644 --- a/lib/core/service/client/base_app_client.dart +++ b/lib/core/service/client/base_app_client.dart @@ -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"); diff --git a/lib/core/service/er/am_service.dart b/lib/core/service/er/am_service.dart index a76ae73a..c1bae0a9 100644 --- a/lib/core/service/er/am_service.dart +++ b/lib/core/service/er/am_service.dart @@ -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; diff --git a/lib/core/service/geofencing/GeofencingServices.dart b/lib/core/service/geofencing/GeofencingServices.dart index 0ae93dff..362416da 100644 --- a/lib/core/service/geofencing/GeofencingServices.dart +++ b/lib/core/service/geofencing/GeofencingServices.dart @@ -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 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}); - } } diff --git a/lib/core/service/medical/my_balance_service.dart b/lib/core/service/medical/my_balance_service.dart index 283eac4b..04f0bd09 100644 --- a/lib/core/service/medical/my_balance_service.dart +++ b/lib/core/service/medical/my_balance_service.dart @@ -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; diff --git a/lib/core/service/parmacyModule/lacum-service.dart b/lib/core/service/parmacyModule/lacum-service.dart index 1401df17..c7117303 100644 --- a/lib/core/service/parmacyModule/lacum-service.dart +++ b/lib/core/service/parmacyModule/lacum-service.dart @@ -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; @@ -39,20 +37,14 @@ class LacumService extends BaseService{ super.error = ""; Map body = Map(); - // body['IdentificationNo'] = user.patientIdentificationNo; - // body['AccountNumber'] = "${lacumInformation.yahalaAccountNo}"; - - body['IdentificationNo'] = "2076117163"; - body['AccountNumber'] = "2019000006"; - + body['IdentificationNo'] = user.patientIdentificationNo; + body['AccountNumber'] = "${lacumInformation.yahalaAccountNo}"; body['IsDetailsRequired'] = true; try { 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; diff --git a/lib/core/service/parmacyModule/parmacy_module_service.dart b/lib/core/service/parmacyModule/parmacy_module_service.dart index c6fc6b72..d13a8895 100644 --- a/lib/core/service/parmacyModule/parmacy_module_service.dart +++ b/lib/core/service/parmacyModule/parmacy_module_service.dart @@ -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']); } @@ -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; diff --git a/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/location_page.dart b/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/location_page.dart index 7a4c02a4..ffbf5b18 100644 --- a/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/location_page.dart +++ b/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/location_page.dart @@ -64,7 +64,6 @@ class _LocationPageState extends State { enableMapTypeButton: true, searchForInitialValue: false, onPlacePicked: (PickResult result) { - print("onPlacePickedonPlacePickedonPlacePickedonPlacePicked"); print(result.adrAddress); }, selectedPlaceWidgetBuilder: (_, selectedPlace, state, isSearchBarFocused) { @@ -79,8 +78,6 @@ class _LocationPageState extends State { 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( diff --git a/lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrders.dart b/lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrders.dart index 02ad27ec..fa230891 100644 --- a/lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrders.dart +++ b/lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrders.dart @@ -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 - with SingleTickerProviderStateMixin { +class _AnicllaryOrdersState extends State with SingleTickerProviderStateMixin { TabController _tabController; + ProjectViewModel projectViewModel; + void initState() { super.initState(); _tabController = TabController(length: 2, vsync: this); @@ -28,58 +33,103 @@ class _AnicllaryOrdersState extends State @override Widget build(BuildContext context) { + projectViewModel = Provider.of(context); return BaseView( 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 } 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), ), ); } diff --git a/lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrdersDetails.dart b/lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrdersDetails.dart index 24f00ea5..0576193b 100644 --- a/lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrdersDetails.dart +++ b/lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrdersDetails.dart @@ -1,15 +1,19 @@ import "package:collection/collection.dart"; import 'package:diplomaticquarterapp/core/viewModels/ancillary_orders_view_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/ancillary-orders/ordersPayment.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/uitl/utils_new.dart'; import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.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 +21,14 @@ class AnicllaryOrdersDetails extends StatefulWidget { final dynamic projectID; AnicllaryOrdersDetails(this.appoNo, this.orderNo, this.projectID); + @override _AnicllaryOrdersState createState() => _AnicllaryOrdersState(); } class _AnicllaryOrdersState extends State with SingleTickerProviderStateMixin { + ProjectViewModel projectViewModel; + void initState() { super.initState(); } @@ -32,10 +39,13 @@ class _AnicllaryOrdersState extends State with SingleTic @override Widget build(BuildContext context) { + projectViewModel = Provider.of(context); return BaseView( 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( @@ -83,48 +93,94 @@ class _AnicllaryOrdersState extends State with SingleTic } 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, + 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( - color: Colors.black26, - ) + Divider() ], ), - padding: EdgeInsets.only(top: 5.0, bottom: 5.0), + padding: EdgeInsets.only(top: 5.0, bottom: 10.0), ); } diff --git a/lib/pages/AlHabibMedicalService/health_calculator/body_fat/body_fat_result_page.dart b/lib/pages/AlHabibMedicalService/health_calculator/body_fat/body_fat_result_page.dart index b8285083..3c0b56cf 100644 --- a/lib/pages/AlHabibMedicalService/health_calculator/body_fat/body_fat_result_page.dart +++ b/lib/pages/AlHabibMedicalService/health_calculator/body_fat/body_fat_result_page.dart @@ -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) { diff --git a/lib/pages/AlHabibMedicalService/health_calculator/carbs/carbs_result_page.dart b/lib/pages/AlHabibMedicalService/health_calculator/carbs/carbs_result_page.dart index 44363734..d9f70ab9 100644 --- a/lib/pages/AlHabibMedicalService/health_calculator/carbs/carbs_result_page.dart +++ b/lib/pages/AlHabibMedicalService/health_calculator/carbs/carbs_result_page.dart @@ -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) { diff --git a/lib/pages/AlHabibMedicalService/health_calculator/ideal_body/ideal_body.dart b/lib/pages/AlHabibMedicalService/health_calculator/ideal_body/ideal_body.dart index a594846e..86c72ae3 100644 --- a/lib/pages/AlHabibMedicalService/health_calculator/ideal_body/ideal_body.dart +++ b/lib/pages/AlHabibMedicalService/health_calculator/ideal_body/ideal_body.dart @@ -250,16 +250,7 @@ class _IdealBodyState extends State { color: CustomColors.accentColor, onTap: () { setState(() { - // calculateBmr(); - // calculateCalories(); calculateIdealWeight(); - - print(idealWeight); - print(minRange); - print(maxRange); - print(overWeightBy); - print(textResult); - //print(overWeightBy); { Navigator.push( context, diff --git a/lib/pages/BookAppointment/DentalComplaints.dart b/lib/pages/BookAppointment/DentalComplaints.dart index 4fb1b581..f68d9503 100644 --- a/lib/pages/BookAppointment/DentalComplaints.dart +++ b/lib/pages/BookAppointment/DentalComplaints.dart @@ -200,7 +200,6 @@ class _DentalComplaintsState extends State { 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 { res['List_DentalChiefComplain'].forEach((v) { complaintsList.add(new ListDentalChiefComplain.fromJson(v)); }); - print(complaintsList.length); }); } else {} }).catchError((err) { diff --git a/lib/pages/BookAppointment/QRCode.dart b/lib/pages/BookAppointment/QRCode.dart index 5bf0a9f0..6fe2be98 100644 --- a/lib/pages/BookAppointment/QRCode.dart +++ b/lib/pages/BookAppointment/QRCode.dart @@ -43,8 +43,12 @@ class _QRCodeState extends State { _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 { 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( diff --git a/lib/pages/BookAppointment/components/SearchByClinic.dart b/lib/pages/BookAppointment/components/SearchByClinic.dart index 7fb724b8..d2fd68c9 100644 --- a/lib/pages/BookAppointment/components/SearchByClinic.dart +++ b/lib/pages/BookAppointment/components/SearchByClinic.dart @@ -196,7 +196,6 @@ class _SearchByClinicState extends State { onChanged: (bool value) { setState(() { nearestAppo = value; - print(nearestAppo); if (nearestAppo) getProjectsList(); else @@ -231,7 +230,6 @@ class _SearchByClinicState extends State { 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 { projectDropdownValue = ""; getDoctorsList(context); } else { - print("Dental"); } }); }); @@ -534,7 +531,6 @@ class _SearchByClinicState extends State { ), ).then((value) { setState(() { - print(value); if (value == "false") dropdownValue = null; }); if (value == "livecare") { diff --git a/lib/pages/TestPage.dart b/lib/pages/TestPage.dart index 8ec70237..6aacc345 100644 --- a/lib/pages/TestPage.dart +++ b/lib/pages/TestPage.dart @@ -27,7 +27,7 @@ class TestPageState extends State{ void location(){ LocationUtils().getCurrentLocation(callBack: (latLng){ - debugPrint(latLng.toString()); + print(latLng.toString()); }); } diff --git a/lib/pages/ToDoList/ToDo.dart b/lib/pages/ToDoList/ToDo.dart index b46e1958..4db905fc 100644 --- a/lib/pages/ToDoList/ToDo.dart +++ b/lib/pages/ToDoList/ToDo.dart @@ -243,205 +243,6 @@ class _ToDoState extends State { ], ), ); - // 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: [ - // Row( - // children: [ - // 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: [ - // 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: [ - // 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: [ - // 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: [ - // 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: [ - // 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 { 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 { 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 { 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 { }); } - // 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) { diff --git a/lib/pages/livecare/livecare_home.dart b/lib/pages/livecare/livecare_home.dart index b0150c03..396b629d 100644 --- a/lib/pages/livecare/livecare_home.dart +++ b/lib/pages/livecare/livecare_home.dart @@ -139,7 +139,6 @@ class _LiveCareHomeState extends State 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; diff --git a/lib/pages/login/login.dart b/lib/pages/login/login.dart index 984f64bf..8332d19b 100644 --- a/lib/pages/login/login.dart +++ b/lib/pages/login/login.dart @@ -257,7 +257,6 @@ class _Login extends State { authService .checkPatientAuthentication(request) .then((value) => { - //showLoader(false), if (value['isSMSSent']) { sharedPref.setString(LOGIN_TOKEN_ID, value['LogInTokenID']), @@ -284,17 +283,11 @@ class _Login extends State { cancelFunction: () => {}); dialog.showAlertDialog(context); }); - // SMSOTP.showLoadingDialog(context, false), } checkActivationCode({code}) async { Map 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; @@ -305,10 +298,8 @@ class _Login extends State { 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); @@ -323,15 +314,8 @@ class _Login extends State { 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) => { diff --git a/lib/pages/medical/balance/confirm_payment_page.dart b/lib/pages/medical/balance/confirm_payment_page.dart index 2d79219d..d838d6eb 100644 --- a/lib/pages/medical/balance/confirm_payment_page.dart +++ b/lib/pages/medical/balance/confirm_payment_page.dart @@ -297,8 +297,6 @@ class _ConfirmPaymentPageState extends State { 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 { widget.advanceModel.fileNumber, AppGlobal.context) .then((res) { - print(res['OnlineCheckInAppointments'][0]['AdvanceNumber']); addAdvancedNumberRequest( res['OnlineCheckInAppointments'][0]['AdvanceNumber'].toString(), paymentReference, diff --git a/lib/pages/medical/labs/passport_update_page.dart b/lib/pages/medical/labs/passport_update_page.dart index cca80905..992f8131 100644 --- a/lib/pages/medical/labs/passport_update_page.dart +++ b/lib/pages/medical/labs/passport_update_page.dart @@ -283,7 +283,6 @@ class _PassportUpdatePageState extends State { 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; diff --git a/lib/pages/medical/medical_profile_page_new.dart b/lib/pages/medical/medical_profile_page_new.dart index d128f460..35f6cd45 100644 --- a/lib/pages/medical/medical_profile_page_new.dart +++ b/lib/pages/medical/medical_profile_page_new.dart @@ -30,7 +30,6 @@ class _MedicalProfilePageState extends State { projectViewModel = Provider.of(context); var appoCountProvider = Provider.of(context); List myMedicalList = Utils.myMedicalList(projectViewModel: projectViewModel, context: context, count: appoCountProvider.count, isLogin: projectViewModel.isLogin); - print(myMedicalList); return BaseView( onModelReady: (model) => model.getAppointmentHistory(), builder: (_, model, widget1) => AppScaffold( @@ -47,25 +46,6 @@ class _MedicalProfilePageState extends State { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - // Container( - // width: double.infinity, - // height: 210, - // decoration: containerBottomRightRadiusWithGradientBorder(0, darkColor: Color(0xFFF2B353E), lightColor: Color(0xFFF2B353E)), - // child: Stack( - // children: [ - // 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 { 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, diff --git a/lib/pages/medical/smart_watch_health_data/syncHealthData.dart b/lib/pages/medical/smart_watch_health_data/syncHealthData.dart index 4fcb08e1..cf172286 100644 --- a/lib/pages/medical/smart_watch_health_data/syncHealthData.dart +++ b/lib/pages/medical/smart_watch_health_data/syncHealthData.dart @@ -124,7 +124,6 @@ class _syncHealthDataButtonState extends State { 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++)); diff --git a/lib/pages/packages_offers/ClinicOfferAndPackagesPage.dart b/lib/pages/packages_offers/ClinicOfferAndPackagesPage.dart index da983d56..e0c715f6 100644 --- a/lib/pages/packages_offers/ClinicOfferAndPackagesPage.dart +++ b/lib/pages/packages_offers/ClinicOfferAndPackagesPage.dart @@ -37,7 +37,6 @@ class _ClinicPackagesPageState extends State 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); }); diff --git a/lib/pages/packages_offers/OfferAndPackagesCartPage.dart b/lib/pages/packages_offers/OfferAndPackagesCartPage.dart index ee0e3880..d3e45853 100644 --- a/lib/pages/packages_offers/OfferAndPackagesCartPage.dart +++ b/lib/pages/packages_offers/OfferAndPackagesCartPage.dart @@ -284,7 +284,7 @@ class _PackagesCartPageState extends State 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); }); } diff --git a/lib/pages/pharmacies/screens/lacum-transfer-page.dart b/lib/pages/pharmacies/screens/lacum-transfer-page.dart index 057b444c..9ac7d168 100644 --- a/lib/pages/pharmacies/screens/lacum-transfer-page.dart +++ b/lib/pages/pharmacies/screens/lacum-transfer-page.dart @@ -18,8 +18,7 @@ class LacumTransferPage extends StatefulWidget { } class _LacumTransferPageState extends State { - TextEditingController _beneficieryAccountController = - new TextEditingController(); + TextEditingController _beneficieryAccountController = new TextEditingController(); TextEditingController _transferPointsController = new TextEditingController(); @override @@ -34,8 +33,7 @@ class _LacumTransferPageState extends State { final mediaQuery = MediaQuery.of(context); return BaseView( - 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 { 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 { 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 { ), 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 { 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 { 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 { ), 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 { 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 { 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 { : 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 { 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)} + }); }, ), ) diff --git a/lib/pages/pharmacies/screens/lakum-main-page.dart b/lib/pages/pharmacies/screens/lakum-main-page.dart index db441433..cbdd8e66 100644 --- a/lib/pages/pharmacies/screens/lakum-main-page.dart +++ b/lib/pages/pharmacies/screens/lakum-main-page.dart @@ -28,13 +28,11 @@ class LakumMainPage extends StatelessWidget { return BaseView( 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: [ - 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 + ? int.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 _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; - 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 } } diff --git a/lib/pages/pharmacies/screens/lakum-points-month-page.dart b/lib/pages/pharmacies/screens/lakum-points-month-page.dart index 26c88755..7f821f55 100644 --- a/lib/pages/pharmacies/screens/lakum-points-month-page.dart +++ b/lib/pages/pharmacies/screens/lakum-points-month-page.dart @@ -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 { return BaseView( 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 { 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 { 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 { ), 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 { 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 { 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 { 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", diff --git a/lib/pages/pharmacies/screens/lakum-points-year-page.dart b/lib/pages/pharmacies/screens/lakum-points-year-page.dart index ba6e4537..b55ae8a9 100644 --- a/lib/pages/pharmacies/screens/lakum-points-year-page.dart +++ b/lib/pages/pharmacies/screens/lakum-points-year-page.dart @@ -27,9 +27,13 @@ class _LakumPointsYearPageState extends State { return BaseView( 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, ), diff --git a/lib/pages/pharmacies/widgets/lakum-point-table-row-widget.dart b/lib/pages/pharmacies/widgets/lakum-point-table-row-widget.dart index ad53efd0..e31dc441 100644 --- a/lib/pages/pharmacies/widgets/lakum-point-table-row-widget.dart +++ b/lib/pages/pharmacies/widgets/lakum-point-table-row-widget.dart @@ -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; diff --git a/lib/pages/pharmacy/pharmacyAddresses/PharmacyAddresses.dart b/lib/pages/pharmacy/pharmacyAddresses/PharmacyAddresses.dart index 2930e51e..609606ec 100644 --- a/lib/pages/pharmacy/pharmacyAddresses/PharmacyAddresses.dart +++ b/lib/pages/pharmacy/pharmacyAddresses/PharmacyAddresses.dart @@ -158,8 +158,6 @@ class _PharmacyAddressesState extends State { _navigateToPaymentOption(model) { if (widget.isUpdate) { - print("sfsf"); - widget.orderPreviewViewModel.paymentCheckoutData.address = Addresses.fromJson(model.addresses[model.selectedAddressIndex].toJson()); widget.changeMainState(); Navigator.pop(context); diff --git a/lib/pages/pharmacy/profile/profile.dart b/lib/pages/pharmacy/profile/profile.dart index ecbd97ca..184cdccc 100644 --- a/lib/pages/pharmacy/profile/profile.dart +++ b/lib/pages/pharmacy/profile/profile.dart @@ -63,8 +63,6 @@ class _ProfilePageState extends State { customerId = custID; customerGUID = custGUID; }); - print("customer Id is" + customerId); - print("customer GUID is" + customerGUID); return customerId; } @@ -74,8 +72,6 @@ class _ProfilePageState extends State { 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) { diff --git a/lib/pages/webRTC/signaling.dart b/lib/pages/webRTC/signaling.dart index 93c30f07..1e50c534 100644 --- a/lib/pages/webRTC/signaling.dart +++ b/lib/pages/webRTC/signaling.dart @@ -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'); }; } } diff --git a/lib/services/pharmacy_services/cancelOrder_service.dart b/lib/services/pharmacy_services/cancelOrder_service.dart index c19186d0..80be905b 100644 --- a/lib/services/pharmacy_services/cancelOrder_service.dart +++ b/lib/services/pharmacy_services/cancelOrder_service.dart @@ -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{ diff --git a/lib/services/pharmacy_services/review_service.dart b/lib/services/pharmacy_services/review_service.dart index 329d52af..b60ad412 100644 --- a/lib/services/pharmacy_services/review_service.dart +++ b/lib/services/pharmacy_services/review_service.dart @@ -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; diff --git a/lib/uitl/HMG_Geofence.dart b/lib/uitl/HMG_Geofence.dart index 54c789ba..751c4ba6 100644 --- a/lib/uitl/HMG_Geofence.dart +++ b/lib/uitl/HMG_Geofence.dart @@ -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"); // } // } // } diff --git a/lib/uitl/date_uitl.dart b/lib/uitl/date_uitl.dart index 177b5127..370914f0 100644 --- a/lib/uitl/date_uitl.dart +++ b/lib/uitl/date_uitl.dart @@ -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) + diff --git a/lib/uitl/location_util.dart b/lib/uitl/location_util.dart index 2daa392f..43b5df01 100644 --- a/lib/uitl/location_util.dart +++ b/lib/uitl/location_util.dart @@ -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") { diff --git a/lib/uitl/push-notification-handler.dart b/lib/uitl/push-notification-handler.dart index c25f8954..da34b296 100644 --- a/lib/uitl/push-notification-handler.dart +++ b/lib/uitl/push-notification-handler.dart @@ -31,9 +31,6 @@ Future 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); diff --git a/lib/uitl/utils.dart b/lib/uitl/utils.dart index f20f4243..75e9ee2b 100644 --- a/lib/uitl/utils.dart +++ b/lib/uitl/utils.dart @@ -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 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 myMedicalList( - {ProjectViewModel projectViewModel, - BuildContext context, - bool isLogin, - count}) { + static List myMedicalList({ProjectViewModel projectViewModel, BuildContext context, bool isLogin, count}) { List 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) { 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 myMedicalListHomePage( - {ProjectViewModel projectViewModel, - BuildContext context, - bool isLogin, - count}) { + static List myMedicalListHomePage({ProjectViewModel projectViewModel, BuildContext context, bool isLogin, count}) { List 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().navigatorKey.currentContext, - MaterialPageRoute( - builder: (context) => LandingPagePharmacy(currentTab: 3)), - (Route r) => false); + Navigator.pushAndRemoveUntil(locator().navigatorKey.currentContext, MaterialPageRoute(builder: (context) => LandingPagePharmacy(currentTab: 3)), (Route 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 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 on Iterable { 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) => ' '); } } diff --git a/lib/widgets/in_app_browser/InAppBrowser.dart b/lib/widgets/in_app_browser/InAppBrowser.dart index 82af9e49..de94ad0f 100644 --- a/lib/widgets/in_app_browser/InAppBrowser.dart +++ b/lib/widgets/in_app_browser/InAppBrowser.dart @@ -101,7 +101,7 @@ class MyInAppBrowser extends InAppBrowser { // @override // Future shouldOverrideUrlLoading(ShouldOverrideUrlLoadingRequest shouldOverrideUrlLoadingRequest) async { // var url = shouldOverrideUrlLoadingRequest.url; - // debugPrint("redirecting/overriding to: $url"); + // print("redirecting/overriding to: $url"); // // if (paymentType == _PAYMENT_TYPE.PACKAGES && [PACKAGES_PAYMENT_SUCCESS_URL, PACKAGES_PAYMENT_FAIL_URL].contains(url)) { // isPaymentDone = (url == PACKAGES_PAYMENT_SUCCESS_URL); From 8f91d0a0dce57fb624ef8b5fcda33a4d8d12f3a0 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Wed, 29 Dec 2021 09:46:17 +0300 Subject: [PATCH 15/19] lakum fix --- lib/pages/pharmacies/screens/lakum-main-page.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/pages/pharmacies/screens/lakum-main-page.dart b/lib/pages/pharmacies/screens/lakum-main-page.dart index cbdd8e66..a6d8aec5 100644 --- a/lib/pages/pharmacies/screens/lakum-main-page.dart +++ b/lib/pages/pharmacies/screens/lakum-main-page.dart @@ -98,7 +98,7 @@ class LakumMainPage extends StatelessWidget { 3, TranslationBase.of(context).consumed, model.lacumGroupInformation.lakumInquiryInformationObjVersion.consumedPointsAmount != null - ? int.parse(model.lacumGroupInformation.lakumInquiryInformationObjVersion.consumedPointsAmount) + ? num.parse(model.lacumGroupInformation.lakumInquiryInformationObjVersion.consumedPointsAmount) : 0, model.lacumGroupInformation.lakumInquiryInformationObjVersion.consumedPoints, model.lacumGroupInformation.lakumInquiryInformationObjVersion.consumedPointsAmountPerYear), From 4acdad0e999fa9fd85b1c1b7f2cc1f13fef77236 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Sun, 2 Jan 2022 18:09:17 +0300 Subject: [PATCH 16/19] fixes & updates --- .../ancillaryOrdersDetails.dart | 342 +++++++----------- .../my_invoices/invoice_detail_page.dart | 1 - .../medical/LabResult/LabResultWidget.dart | 2 +- 3 files changed, 140 insertions(+), 205 deletions(-) diff --git a/lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrdersDetails.dart b/lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrdersDetails.dart index 0576193b..de26c4b9 100644 --- a/lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrdersDetails.dart +++ b/lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrdersDetails.dart @@ -4,13 +4,12 @@ import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/ancillary-orders/ordersPayment.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/uitl/utils.dart'; import 'package:diplomaticquarterapp/uitl/utils_new.dart'; -import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.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'; @@ -49,47 +48,46 @@ class _AnicllaryOrdersState extends State with SingleTic 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()))); + padding: EdgeInsets.all(12), + child: model.ancillaryListsDetails.length > 0 + ? Column(children: [ + getPatientInfo(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, + ) + ], + ), + ]) + : getNoDataWidget(context), + ), + bottomSheet: Container( + color: Theme.of(context).scaffoldBackgroundColor, + margin: EdgeInsets.only(bottom: 5.0), + width: double.infinity, + padding: EdgeInsets.all(12), + child: DefaultButton( + TranslationBase.of(context).payNow.toUpperCase(), + () { + Navigator.push( + context, + FadePage( + page: OrdersPayment(), + ), + ); + }, + ), + ))); } Widget getPatientInfo(AnciallryOrdersViewModel model) { @@ -172,6 +170,51 @@ class _AnicllaryOrdersState extends State with SingleTic ), ], ), + 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, + ), + ), + ], + ), ], ), ), @@ -184,153 +227,42 @@ class _AnicllaryOrdersState extends State with SingleTic ); } - 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, - ), - ], - ), - SizedBox( - height: 10, - ), - Divider( - color: Colors.black26, - ) - ], - ); - } - - Widget getInsuranceDetails(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: [], - ), - 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, - ), - ], - )); - } - 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: 10), child: getHeaderDetails(newMap)); } Widget getHeaderDetails(newMap) { - List list = new List(); - + List 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(2.0), + 1: FlexColumnWidth(1.5), + 2: FlexColumnWidth(1.5), + 3: FlexColumnWidth(1.5), + }, + children: fullData(context, value), + ), + ], + ), + ), ), ); - list.add(Row( - mainAxisAlignment: MainAxisAlignment.start, - children: [ - getLabDetails(value), - ], - )); }); return Column( @@ -341,30 +273,34 @@ class _AnicllaryOrdersState extends State with SingleTic String getTotalValue(value) { double total = 0.0; - value.ancillaryListsDetails[0].ancillaryOrderProcDetailsList.forEach((result) => {total += result.companyShareWithTax}); + value.ancillaryListsDetails[0].ancillaryOrderProcDetailsList.forEach((result) => {total += result.patientShareWithTax}); return total.toStringAsFixed(2); } - getLabDetails(value) { - return Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: value.map((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 fullData(context, value) { + List tableRow = []; + + tableRow.add( + TableRow( + children: [ + 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: [ + Utils.tableColumnValue('${value[i].procedureName.toString()}', isLast: true), + Utils.tableColumnValue('${value[i].patientShare.toString()}', isLast: true), + Utils.tableColumnValue('${value[i].patientTaxAmount.toString() + " " + TranslationBase.of(context).sar}', isLast: true), + Utils.tableColumnValue('${value[i].patientShareWithTax.toString() + " " + TranslationBase.of(context).sar}', isLast: true), + ]), + ); + } + return tableRow; } } diff --git a/lib/pages/medical/my_invoices/invoice_detail_page.dart b/lib/pages/medical/my_invoices/invoice_detail_page.dart index 55a91b9a..b928e0f8 100644 --- a/lib/pages/medical/my_invoices/invoice_detail_page.dart +++ b/lib/pages/medical/my_invoices/invoice_detail_page.dart @@ -76,7 +76,6 @@ class _InvoiceDetailState extends State { ), Container( child: Container( - decoration: cardRadius(12), margin: EdgeInsets.only(left: 16, top: 8, right: 16, bottom: 16), child: Padding( diff --git a/lib/widgets/data_display/medical/LabResult/LabResultWidget.dart b/lib/widgets/data_display/medical/LabResult/LabResultWidget.dart index 427b16e1..1a3245cf 100644 --- a/lib/widgets/data_display/medical/LabResult/LabResultWidget.dart +++ b/lib/widgets/data_display/medical/LabResult/LabResultWidget.dart @@ -144,7 +144,7 @@ class LabResultWidget extends StatelessWidget { bool checkIfCovidLab(List 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; } From 0b21252ae77217a178b31c8d618f07f1822932a7 Mon Sep 17 00:00:00 2001 From: Fatimah Alshammari Date: Mon, 3 Jan 2022 14:25:07 +0300 Subject: [PATCH 17/19] fix category issue --- lib/config/localized_values.dart | 1 + lib/pages/search_products_page.dart | 2 +- lib/pages/sub_categorise_page.dart | 665 ++++++++++++++--------- lib/uitl/translations_delegate_base.dart | 2 + 4 files changed, 413 insertions(+), 257 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index b9e446d9..79294bfb 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -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": "تمت الاضافه لقائمة المقارنه"}, diff --git a/lib/pages/search_products_page.dart b/lib/pages/search_products_page.dart index d40d490f..022dde75 100644 --- a/lib/pages/search_products_page.dart +++ b/lib/pages/search_products_page.dart @@ -202,7 +202,7 @@ class _SearchProductsPageState extends State { ? MediaQuery.of(context) .size .width / - 5 + 3 : 0, padding: EdgeInsets.all(4), decoration: BoxDecoration( diff --git a/lib/pages/sub_categorise_page.dart b/lib/pages/sub_categorise_page.dart index 325e5fd9..94afac3b 100644 --- a/lib/pages/sub_categorise_page.dart +++ b/lib/pages/sub_categorise_page.dart @@ -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'; @@ -416,7 +417,7 @@ class _SubCategorisePageState extends State { title: Texts( TranslationBase.of( context) - .categorise), + .subGroup), children: [ ProcedureListWidget( model: model, @@ -837,7 +838,7 @@ class _SubCategorisePageState extends State { context) .size .width / - 5 + 3 : 0, padding: EdgeInsets.all(4), @@ -993,273 +994,425 @@ class _SubCategorisePageState extends State { 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( diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index ff0043e0..a7dc47db 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -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]; From 693f8cb09005f2ae21d97d03ca88005f426b79cc Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Tue, 4 Jan 2022 13:12:31 +0300 Subject: [PATCH 18/19] Updates & fixes --- lib/config/localized_values.dart | 4 +- .../ancillaryOrdersDetails.dart | 339 +++++++++++++++--- lib/pages/BookAppointment/BookConfirm.dart | 1 - .../screens/product-details/reviews_info.dart | 2 +- lib/pages/pharmacy/order/ProductReview.dart | 70 ++-- .../appointment_services/GetDoctorsList.dart | 22 ++ lib/uitl/translations_delegate_base.dart | 3 + 7 files changed, 345 insertions(+), 96 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 9eb6548d..5e4631d7 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -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": " تم حذف العنوان"}, @@ -1744,8 +1744,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": "هل أنت متأكد أنك تريد سداد قيمة الطلبات المختارة؟"}, }; diff --git a/lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrdersDetails.dart b/lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrdersDetails.dart index de26c4b9..8d0ebabd 100644 --- a/lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrdersDetails.dart +++ b/lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrdersDetails.dart @@ -1,16 +1,23 @@ import "package:collection/collection.dart"; +import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/core/viewModels/ancillary_orders_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; -import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/ancillary-orders/ordersPayment.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/services/appointment_services/GetDoctorsList.dart'; import 'package:diplomaticquarterapp/theme/colors.dart'; +import 'package:diplomaticquarterapp/uitl/app_toast.dart'; +import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:diplomaticquarterapp/uitl/utils_new.dart'; import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; -import 'package:diplomaticquarterapp/widgets/data_display/text.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/transitions/fade_page.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; @@ -27,6 +34,12 @@ class AnicllaryOrdersDetails extends StatefulWidget { class _AnicllaryOrdersState extends State with SingleTickerProviderStateMixin { ProjectViewModel projectViewModel; + bool _agreeTerms = false; + String selectedPaymentMethod; + MyInAppBrowser browser; + String transID = ""; + + List selectedProcList = []; void initState() { super.initState(); @@ -40,54 +53,105 @@ class _AnicllaryOrdersState extends State with SingleTic Widget build(BuildContext context) { projectViewModel = Provider.of(context); return BaseView( - 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), - Row( - mainAxisAlignment: MainAxisAlignment.spaceAround, - children: [ - Texts( - TranslationBase.of(context).total, - fontSize: 20, - fontWeight: FontWeight.bold, - ), - Texts( - getTotalValue(model), - fontSize: 20, - fontWeight: FontWeight.bold, - ) - ], + 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, ), - ]) - : getNoDataWidget(context), - ), - bottomSheet: Container( - color: Theme.of(context).scaffoldBackgroundColor, - margin: EdgeInsets.only(bottom: 5.0), - width: double.infinity, - padding: EdgeInsets.all(12), - child: DefaultButton( - TranslationBase.of(context).payNow.toUpperCase(), - () { - Navigator.push( - context, - FadePage( - page: OrdersPayment(), ), - ); - }, - ), - ))); + 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(), + ), + ); + } + + _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, + ), + ); + } + + _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), + ), + Expanded( + child: _getNormalText(value, isBold: isBold, isTotal: isTotal), + ), + ]), + ); } Widget getPatientInfo(AnciallryOrdersViewModel model) { @@ -229,7 +293,7 @@ class _AnicllaryOrdersState extends State with SingleTic Widget getAncillaryDetails(model) { Map newMap = groupBy(model.ancillaryListsDetails[0].ancillaryOrderProcDetailsList, (obj) => obj.procedureCategoryName); - return Padding(padding: EdgeInsets.only(top: 0, bottom: 10), child: getHeaderDetails(newMap)); + return Padding(padding: EdgeInsets.only(top: 0, bottom: 200), child: getHeaderDetails(newMap)); } Widget getHeaderDetails(newMap) { @@ -251,10 +315,11 @@ class _AnicllaryOrdersState extends State with SingleTic children: [ Table( columnWidths: { - 0: FlexColumnWidth(2.0), - 1: FlexColumnWidth(1.5), + 0: FlexColumnWidth(1.0), + 1: FlexColumnWidth(2.5), 2: FlexColumnWidth(1.5), 3: FlexColumnWidth(1.5), + 4: FlexColumnWidth(1.5), }, children: fullData(context, value), ), @@ -271,9 +336,9 @@ class _AnicllaryOrdersState extends State with SingleTic ); } - String getTotalValue(value) { + String getTotalValue() { double total = 0.0; - value.ancillaryListsDetails[0].ancillaryOrderProcDetailsList.forEach((result) => {total += result.patientShareWithTax}); + selectedProcList.forEach((result) => {total += result.patientShareWithTax}); return total.toStringAsFixed(2); } @@ -283,6 +348,7 @@ class _AnicllaryOrdersState extends State with SingleTic tableRow.add( TableRow( children: [ + Utils.tableColumnTitle(""), Utils.tableColumnTitle(TranslationBase.of(context).procedure), Utils.tableColumnTitle(TranslationBase.of(context).price), Utils.tableColumnTitle(TranslationBase.of(context).vat), @@ -294,13 +360,172 @@ class _AnicllaryOrdersState extends State with SingleTic 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()}', isLast: true), - Utils.tableColumnValue('${value[i].patientTaxAmount.toString() + " " + TranslationBase.of(context).sar}', isLast: true), - Utils.tableColumnValue('${value[i].patientShareWithTax.toString() + " " + TranslationBase.of(context).sar}', 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 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); + } + } } diff --git a/lib/pages/BookAppointment/BookConfirm.dart b/lib/pages/BookAppointment/BookConfirm.dart index 63e711e5..59b8eeda 100644 --- a/lib/pages/BookAppointment/BookConfirm.dart +++ b/lib/pages/BookAppointment/BookConfirm.dart @@ -270,7 +270,6 @@ class _BookConfirmState extends State { 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); diff --git a/lib/pages/pharmacies/screens/product-details/reviews_info.dart b/lib/pages/pharmacies/screens/product-details/reviews_info.dart index 52efd3e9..7743fbbb 100644 --- a/lib/pages/pharmacies/screens/product-details/reviews_info.dart +++ b/lib/pages/pharmacies/screens/product-details/reviews_info.dart @@ -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), ), ), diff --git a/lib/pages/pharmacy/order/ProductReview.dart b/lib/pages/pharmacy/order/ProductReview.dart index 288d50dd..5857b802 100644 --- a/lib/pages/pharmacy/order/ProductReview.dart +++ b/lib/pages/pharmacy/order/ProductReview.dart @@ -327,41 +327,41 @@ class _ProductReviewPageState extends State { ], ), ), - 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, - ), - ), - ), - ), - ), - ), - ), + // 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, + // ), + // ), + // ), + // ), + // ), + // ), + // ), ], ); } diff --git a/lib/services/appointment_services/GetDoctorsList.dart b/lib/services/appointment_services/GetDoctorsList.dart index 80039ece..b317e106 100644 --- a/lib/services/appointment_services/GetDoctorsList.dart +++ b/lib/services/appointment_services/GetDoctorsList.dart @@ -904,6 +904,28 @@ class DoctorsListService extends BaseService { return Future.value(localRes); } + Future autoGenerateAncillaryOrdersInvoice(String orderNo, int projectID, dynamic appointmentID, List selectedProcListAPI, BuildContext context) async { + Map 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 isAllowedToAskDoctor(int docID, BuildContext context) async { Map request; if (await this.sharedPref.getObject(USER_PROFILE) != null) { diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index ff0043e0..bda03125 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -2821,6 +2821,9 @@ class TranslationBase { 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 { From 7dbc00a864707a78ad27ae9676a5e9b20909dc2b Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Tue, 4 Jan 2022 13:17:37 +0300 Subject: [PATCH 19/19] ancillary orders update --- lib/config/config.dart | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index 006acf22..f3038cf7 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -15,8 +15,8 @@ const PACKAGES_CUSTOMER = '/api/customers'; const PACKAGES_SHOPPING_CART = '/api/shopping_cart_items'; const PACKAGES_ORDERS = '/api/orders'; 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/'; @@ -304,6 +304,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 =