diff --git a/android/app/build.gradle b/android/app/build.gradle index e8edcc6e..5457931e 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -26,11 +26,11 @@ apply plugin: 'kotlin-android' apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" android { - compileSdkVersion 34 + compileSdkVersion 33 signingConfigs { release { - storeFile file('/Users/nextwo/Desktop/Elham/keys/doctor app key') + storeFile file('/Users/mohamedmekawy/Documents/Work/DoctorApp/android/doctor_app_key') storePassword 'Hmgdoctor1234' keyAlias 'hmgdoctor' keyPassword 'Hmgdoctor1234' @@ -59,8 +59,7 @@ android { buildTypes { release { // TODO: Add your own signing config for the release build. - signingConfig signingConfigs.debug - + signingConfig signingConfigs.release } debug { @@ -91,8 +90,6 @@ flutter { source '../..' } - - dependencies { implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" implementation 'androidx.appcompat:appcompat:1.1.0' @@ -115,8 +112,5 @@ dependencies { implementation 'com.squareup.retrofit2:adapter-rxjava:2.1.0' implementation 'com.google.firebase:firebase-analytics:17.4.1' - implementation 'com.android.support:multidex:2.0.1' - } - -apply plugin: 'com.google.gms.google-services' +apply plugin: 'com.google.gms.google-services' \ No newline at end of file diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index d6d2e9c7..a7a5340b 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -42,6 +42,7 @@ android:exported="true" android:launchMode="singleTop" android:theme="@style/LaunchTheme" + android:exported="true" android:windowSoftInputMode="adjustResize"> diff --git a/android/app/src/main/kotlin/com/hmg/hmgDr/MainActivity.kt b/android/app/src/main/kotlin/com/hmg/hmgDr/MainActivity.kt index f1c2c602..bfeaa3bf 100644 --- a/android/app/src/main/kotlin/com/hmg/hmgDr/MainActivity.kt +++ b/android/app/src/main/kotlin/com/hmg/hmgDr/MainActivity.kt @@ -17,8 +17,8 @@ import android.widget.Toast import androidx.annotation.NonNull import com.google.gson.GsonBuilder import com.hmg.hmgDr.Service.VideoStreamFloatingWidgetService -import com.hmg.hmgDr.model.GetSessionStatusModel -import com.hmg.hmgDr.model.SessionStatusModel +import com.hmg.hmgDr.Model.GetSessionStatusModel +import com.hmg.hmgDr.Model.SessionStatusModel import com.hmg.hmgDr.ui.VideoCallResponseListener import io.flutter.embedding.android.FlutterFragmentActivity import io.flutter.embedding.engine.FlutterEngine diff --git a/android/app/src/main/kotlin/com/hmg/hmgDr/Service/BaseMovingFloatingWidget.kt b/android/app/src/main/kotlin/com/hmg/hmgDr/Service/BaseMovingFloatingWidget.kt index 8608acae..8e36e71d 100644 --- a/android/app/src/main/kotlin/com/hmg/hmgDr/Service/BaseMovingFloatingWidget.kt +++ b/android/app/src/main/kotlin/com/hmg/hmgDr/Service/BaseMovingFloatingWidget.kt @@ -133,10 +133,10 @@ abstract class BaseMovingFloatingWidget : Service() { return true } - override fun onDoubleTap(e: MotionEvent): Boolean { - miniCircleDoubleTap() - return super.onDoubleTap(e) - } +// override fun onDoubleTap(e: MotionEvent?): Boolean { +// miniCircleDoubleTap() +// return super.onDoubleTap(e) +// } } diff --git a/android/app/src/main/kotlin/com/hmg/hmgDr/Service/SessionStatusAPI.java b/android/app/src/main/kotlin/com/hmg/hmgDr/Service/SessionStatusAPI.java index 7c458b25..e507650e 100644 --- a/android/app/src/main/kotlin/com/hmg/hmgDr/Service/SessionStatusAPI.java +++ b/android/app/src/main/kotlin/com/hmg/hmgDr/Service/SessionStatusAPI.java @@ -1,8 +1,8 @@ package com.hmg.hmgDr.Service; -import com.hmg.hmgDr.model.ChangeCallStatusRequestModel; -import com.hmg.hmgDr.model.GetSessionStatusModel; -import com.hmg.hmgDr.model.SessionStatusModel; +import com.hmg.hmgDr.Model.ChangeCallStatusRequestModel; +import com.hmg.hmgDr.Model.GetSessionStatusModel; +import com.hmg.hmgDr.Model.SessionStatusModel; import retrofit2.Call; diff --git a/android/app/src/main/kotlin/com/hmg/hmgDr/Service/VideoStreamFloatingWidgetService.kt b/android/app/src/main/kotlin/com/hmg/hmgDr/Service/VideoStreamFloatingWidgetService.kt index fb152322..f82eae3d 100644 --- a/android/app/src/main/kotlin/com/hmg/hmgDr/Service/VideoStreamFloatingWidgetService.kt +++ b/android/app/src/main/kotlin/com/hmg/hmgDr/Service/VideoStreamFloatingWidgetService.kt @@ -17,6 +17,9 @@ import androidx.core.app.NotificationCompat import androidx.core.app.NotificationManagerCompat import androidx.core.content.ContextCompat import androidx.core.view.GestureDetectorCompat +import com.hmg.hmgDr.Model.ChangeCallStatusRequestModel +import com.hmg.hmgDr.Model.GetSessionStatusModel +import com.hmg.hmgDr.Model.SessionStatusModel import com.hmg.hmgDr.R import com.hmg.hmgDr.model.* import com.hmg.hmgDr.ui.VideoCallContract diff --git a/android/app/src/main/kotlin/com/hmg/hmgDr/model/ChangeCallStatusRequestModel.java b/android/app/src/main/kotlin/com/hmg/hmgDr/model/ChangeCallStatusRequestModel.java index c7993d5f..5fcdb611 100644 --- a/android/app/src/main/kotlin/com/hmg/hmgDr/model/ChangeCallStatusRequestModel.java +++ b/android/app/src/main/kotlin/com/hmg/hmgDr/model/ChangeCallStatusRequestModel.java @@ -1,4 +1,4 @@ -package com.hmg.hmgDr.model; +package com.hmg.hmgDr.Model; import android.os.Parcel; diff --git a/android/app/src/main/kotlin/com/hmg/hmgDr/model/GetSessionStatusModel.java b/android/app/src/main/kotlin/com/hmg/hmgDr/model/GetSessionStatusModel.java index 32b3a96c..9e2e1cf4 100644 --- a/android/app/src/main/kotlin/com/hmg/hmgDr/model/GetSessionStatusModel.java +++ b/android/app/src/main/kotlin/com/hmg/hmgDr/model/GetSessionStatusModel.java @@ -1,4 +1,4 @@ -package com.hmg.hmgDr.model; +package com.hmg.hmgDr.Model; import android.os.Parcel; import android.os.Parcelable; diff --git a/android/app/src/main/kotlin/com/hmg/hmgDr/model/SessionStatusModel.java b/android/app/src/main/kotlin/com/hmg/hmgDr/model/SessionStatusModel.java index fe309922..51b0b1ee 100644 --- a/android/app/src/main/kotlin/com/hmg/hmgDr/model/SessionStatusModel.java +++ b/android/app/src/main/kotlin/com/hmg/hmgDr/model/SessionStatusModel.java @@ -1,4 +1,4 @@ -package com.hmg.hmgDr.model; +package com.hmg.hmgDr.Model; import android.os.Parcel; import android.os.Parcelable; diff --git a/android/app/src/main/kotlin/com/hmg/hmgDr/ui/VideoCallContract.java b/android/app/src/main/kotlin/com/hmg/hmgDr/ui/VideoCallContract.java index cf87e54e..c26f8df4 100644 --- a/android/app/src/main/kotlin/com/hmg/hmgDr/ui/VideoCallContract.java +++ b/android/app/src/main/kotlin/com/hmg/hmgDr/ui/VideoCallContract.java @@ -1,8 +1,8 @@ package com.hmg.hmgDr.ui; -import com.hmg.hmgDr.model.ChangeCallStatusRequestModel; -import com.hmg.hmgDr.model.GetSessionStatusModel; -import com.hmg.hmgDr.model.SessionStatusModel; +import com.hmg.hmgDr.Model.ChangeCallStatusRequestModel; +import com.hmg.hmgDr.Model.GetSessionStatusModel; +import com.hmg.hmgDr.Model.SessionStatusModel; public interface VideoCallContract { diff --git a/android/app/src/main/kotlin/com/hmg/hmgDr/ui/VideoCallPresenterImpl.java b/android/app/src/main/kotlin/com/hmg/hmgDr/ui/VideoCallPresenterImpl.java index eed191fb..4613c231 100644 --- a/android/app/src/main/kotlin/com/hmg/hmgDr/ui/VideoCallPresenterImpl.java +++ b/android/app/src/main/kotlin/com/hmg/hmgDr/ui/VideoCallPresenterImpl.java @@ -1,8 +1,8 @@ package com.hmg.hmgDr.ui; -import com.hmg.hmgDr.model.ChangeCallStatusRequestModel; -import com.hmg.hmgDr.model.GetSessionStatusModel; -import com.hmg.hmgDr.model.SessionStatusModel; +import com.hmg.hmgDr.Model.ChangeCallStatusRequestModel; +import com.hmg.hmgDr.Model.GetSessionStatusModel; +import com.hmg.hmgDr.Model.SessionStatusModel; import com.hmg.hmgDr.Service.AppRetrofit; import com.hmg.hmgDr.Service.SessionStatusAPI; diff --git a/android/app/src/main/kotlin/com/hmg/hmgDr/ui/fragment/VideoCallFragment.kt b/android/app/src/main/kotlin/com/hmg/hmgDr/ui/fragment/VideoCallFragment.kt index f96ec59c..e11e6b20 100644 --- a/android/app/src/main/kotlin/com/hmg/hmgDr/ui/fragment/VideoCallFragment.kt +++ b/android/app/src/main/kotlin/com/hmg/hmgDr/ui/fragment/VideoCallFragment.kt @@ -20,9 +20,9 @@ import androidx.constraintlayout.widget.ConstraintLayout import androidx.core.content.ContextCompat import androidx.core.view.GestureDetectorCompat import androidx.fragment.app.DialogFragment -import com.hmg.hmgDr.model.ChangeCallStatusRequestModel -import com.hmg.hmgDr.model.GetSessionStatusModel -import com.hmg.hmgDr.model.SessionStatusModel +import com.hmg.hmgDr.Model.ChangeCallStatusRequestModel +import com.hmg.hmgDr.Model.GetSessionStatusModel +import com.hmg.hmgDr.Model.SessionStatusModel import com.hmg.hmgDr.R import com.hmg.hmgDr.ui.VideoCallContract.VideoCallPresenter import com.hmg.hmgDr.ui.VideoCallContract.VideoCallView @@ -143,8 +143,9 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session return R.style.dialogTheme } + @SuppressLint("UseRequireInsteadOfGet") override fun onCreateDialog(@Nullable savedInstanceState: Bundle?): Dialog {// FullScreenVideoTheme - val layoutInflater = activity!!.layoutInflater + val layoutInflater = requireActivity().layoutInflater this.parentView = onCreateView(layoutInflater, null) val alertDialogBuilder: AlertDialog.Builder = @@ -230,7 +231,7 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session handleDragDialog() mDetector = GestureDetectorCompat( - requireContext(), + requireContext(), MyGestureListener({ showControlPanelTemporarily() }, { miniCircleDoubleTap() }) ) @@ -772,16 +773,16 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session val mCallBtnLayoutParam: ConstraintLayout.LayoutParams = mCallBtn.layoutParams as ConstraintLayout.LayoutParams - val iconSize: Int = context!!.resources.getDimension(R.dimen.video_icon_size).toInt() + val iconSize: Int = requireContext().resources.getDimension(R.dimen.video_icon_size).toInt() val iconSizeSmall: Int = - context!!.resources.getDimension(R.dimen.video_icon_size_small).toInt() + requireContext().resources.getDimension(R.dimen.video_icon_size_small).toInt() val localPreviewMargin: Int = - context!!.resources.getDimension(R.dimen.local_preview_margin_top).toInt() + requireContext().resources.getDimension(R.dimen.local_preview_margin_top).toInt() val localPreviewWidth: Int = - context!!.resources.getDimension(R.dimen.local_preview_width).toInt() + requireContext().resources.getDimension(R.dimen.local_preview_width).toInt() val localPreviewHeight: Int = - context!!.resources.getDimension(R.dimen.local_preview_height).toInt() + requireContext().resources.getDimension(R.dimen.local_preview_height).toInt() // val localPreviewIconSize: Int = context!!.resources.getDimension(R.dimen.local_back_icon_size).toInt() // val localPreviewMarginSmall : Int = context!!.resources.getDimension(R.dimen.local_preview_margin_small).toInt() // val localPreviewWidthSmall : Int = context!!.resources.getDimension(R.dimen.local_preview_width_small).toInt() @@ -792,9 +793,9 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session mPublisherViewContainer.layoutParams as RelativeLayout.LayoutParams val remotePreviewIconSize: Int = - context!!.resources.getDimension(R.dimen.remote_back_icon_size).toInt() + requireContext().resources.getDimension(R.dimen.remote_back_icon_size).toInt() val remotePreviewIconSizeSmall: Int = - context!!.resources.getDimension(R.dimen.remote_back_icon_size_small).toInt() + requireContext().resources.getDimension(R.dimen.remote_back_icon_size_small).toInt() val remotePreviewLayoutParam: FrameLayout.LayoutParams = mSubscriberViewIcon.layoutParams as FrameLayout.LayoutParams @@ -884,17 +885,17 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session controlPanel.layoutParams as ConstraintLayout.LayoutParams val layoutNameHeight: Int = - context!!.resources.getDimension(R.dimen.layout_name_height).toInt() + requireContext().resources.getDimension(R.dimen.layout_name_height).toInt() val layoutMiniHeight: Int = - context!!.resources.getDimension(R.dimen.layout_mini_height).toInt() - val panelHeight: Int = context!!.resources.getDimension(R.dimen.layout_panel_height).toInt() + requireContext().resources.getDimension(R.dimen.layout_mini_height).toInt() + val panelHeight: Int = requireContext().resources.getDimension(R.dimen.layout_panel_height).toInt() val panelHeightSmall: Int = - context!!.resources.getDimension(R.dimen.layout_panel_height_small).toInt() + requireContext().resources.getDimension(R.dimen.layout_panel_height_small).toInt() val panelPadding: Int = - context!!.resources.getDimension(R.dimen.padding_space_big).toInt() + requireContext().resources.getDimension(R.dimen.padding_space_big).toInt() val panelPaddingMedium: Int = - context!!.resources.getDimension(R.dimen.padding_space_medium).toInt() + requireContext().resources.getDimension(R.dimen.padding_space_medium).toInt() val temp = getStatusBarHeight() / 2 @@ -1152,10 +1153,10 @@ class VideoCallFragment : DialogFragment(), PermissionCallbacks, Session.Session return true } - override fun onDoubleTap(e: MotionEvent): Boolean { - miniCircleDoubleTap() - return super.onDoubleTap(e) - } +// override fun onDoubleTap(e: MotionEvent?): Boolean { +// miniCircleDoubleTap() +// return super.onDoubleTap(e) +// } } diff --git a/android/build.gradle b/android/build.gradle index 39833431..dc4d22a0 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -1,14 +1,14 @@ buildscript { - ext.kotlin_version = '1.8.21' + ext.kotlin_version = '1.7.20' repositories { google() jcenter() } dependencies { - classpath 'com.android.tools.build:gradle:7.3.0' + classpath 'com.android.tools.build:gradle:7.0.3' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" - classpath 'com.google.gms:google-services:4.3.14' + classpath 'com.google.gms:google-services:4.3.3' } } @@ -31,6 +31,6 @@ subprojects { project.evaluationDependsOn(':app') } -tasks.register("clean", Delete) { +task clean(type: Delete) { delete rootProject.buildDir } diff --git a/android/gradle/wrapper/gradle-wrapper.properties b/android/gradle/wrapper/gradle-wrapper.properties index 8049c684..02e5f581 100644 --- a/android/gradle/wrapper/gradle-wrapper.properties +++ b/android/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,6 @@ +#Fri Jun 23 08:50:38 CEST 2017 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-all.zip diff --git a/doctor_app_key b/doctor_app_key new file mode 100644 index 00000000..ae5bdbbc Binary files /dev/null and b/doctor_app_key differ diff --git a/ios/Podfile b/ios/Podfile index 1d3f65fc..e0cd5115 100644 --- a/ios/Podfile +++ b/ios/Podfile @@ -1,5 +1,5 @@ # Uncomment this line to define a global platform for your project - platform :ios, '11.0' + platform :ios, '13.0' # CocoaPods analytics sends network stats synchronously affecting flutter build latency. ENV['COCOAPODS_DISABLE_STATS'] = 'true' @@ -38,10 +38,24 @@ target 'Runner' do # Plugin Pods flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__)) + pod 'DKImagePickerController/PhotoGallery', :git => 'https://github.com/miguelpruivo/DKImagePickerController.git' end post_install do |installer| installer.pods_project.targets.each do |target| flutter_additional_ios_build_settings(target) + target.build_configurations.each do |build_configuration| + build_configuration.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= [ + '$(inherited)', + ## dart: [PermissionGroup.location, PermissionGroup.locationAlways, PermissionGroup.locationWhenInUse] + 'PERMISSION_CAMERA=1', + 'PERMISSION_MICROPHONE=1', + ] + build_configuration.build_settings['EXCLUDED_ARCHS[sdk=iphonesimulator*]'] = 'arm64 i386' + build_configuration.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '13.0' + if build_configuration.build_settings['WRAPPER_EXTENSION'] == 'bundle' + build_configuration.build_settings['DEVELOPMENT_TEAM'] = '3A359E86ZF' + end + end end end diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index 25bcec90..2475931a 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -3,7 +3,7 @@ archiveVersion = 1; classes = { }; - objectVersion = 54; + objectVersion = 50; objects = { /* Begin PBXBuildFile section */ @@ -14,8 +14,8 @@ 30F70E6C266F56FD005D8F8E /* MainAppViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 30F70E6B266F56FD005D8F8E /* MainAppViewController.swift */; }; 30F70E6F266F6509005D8F8E /* VideoCallRequestParameters.swift in Sources */ = {isa = PBXBuildFile; fileRef = 30F70E6E266F6509005D8F8E /* VideoCallRequestParameters.swift */; }; 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; - 3D7F2AC9B3EBF568D59B943B /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 104DCFE405BA413255D4BDD9 /* Pods_Runner.framework */; }; 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; + 7645621A848A5D0B29B97C46 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E4E9718EA62661304F55A32D /* Pods_Runner.framework */; }; 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; @@ -37,13 +37,10 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ - 0762701A9540BA69842BCA9C /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; }; - 104DCFE405BA413255D4BDD9 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; 29211CD725C165D600DD740D /* RunnerRelease.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = RunnerRelease.entitlements; sourceTree = ""; }; 29211E4125C172B700DD740D /* GoogleService-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "GoogleService-Info.plist"; sourceTree = ""; }; - 2ADF20AFB51DAEC9BED1884D /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; }; 300790F9266FB14B0052174C /* VCEmbeder.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VCEmbeder.swift; sourceTree = ""; }; 300790FB26710CAB0052174C /* Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Extensions.swift; sourceTree = ""; }; 30F70E6B266F56FD005D8F8E /* MainAppViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MainAppViewController.swift; sourceTree = ""; }; @@ -61,7 +58,10 @@ 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 9CE61EBC24AB366E008D68DD /* VideoCallViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VideoCallViewController.swift; sourceTree = ""; }; 9CE61ECC24ADBB4C008D68DD /* ICallProtocoll.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ICallProtocoll.swift; sourceTree = ""; }; - E5CA53445955DBB6BB6D164C /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; }; + C55D4AE245B71956447BA22F /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; }; + C8801C5E6B82B6CB497CA5C7 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; }; + E333B59AA5538E0304102FD2 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; }; + E4E9718EA62661304F55A32D /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -69,7 +69,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 3D7F2AC9B3EBF568D59B943B /* Pods_Runner.framework in Frameworks */, + 7645621A848A5D0B29B97C46 /* Pods_Runner.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -104,9 +104,9 @@ 7D66D387293CE5376A07EC5F /* Pods */ = { isa = PBXGroup; children = ( - 2ADF20AFB51DAEC9BED1884D /* Pods-Runner.debug.xcconfig */, - E5CA53445955DBB6BB6D164C /* Pods-Runner.release.xcconfig */, - 0762701A9540BA69842BCA9C /* Pods-Runner.profile.xcconfig */, + C55D4AE245B71956447BA22F /* Pods-Runner.debug.xcconfig */, + C8801C5E6B82B6CB497CA5C7 /* Pods-Runner.release.xcconfig */, + E333B59AA5538E0304102FD2 /* Pods-Runner.profile.xcconfig */, ); path = Pods; sourceTree = ""; @@ -129,7 +129,7 @@ 97C146F01CF9000F007C117D /* Runner */, 97C146EF1CF9000F007C117D /* Products */, 7D66D387293CE5376A07EC5F /* Pods */, - C1938275850F66EAA5D7AC0F /* Frameworks */, + A9562A4C43D78E443FA8BFD1 /* Frameworks */, ); sourceTree = ""; }; @@ -171,10 +171,10 @@ name = "Supporting Files"; sourceTree = ""; }; - C1938275850F66EAA5D7AC0F /* Frameworks */ = { + A9562A4C43D78E443FA8BFD1 /* Frameworks */ = { isa = PBXGroup; children = ( - 104DCFE405BA413255D4BDD9 /* Pods_Runner.framework */, + E4E9718EA62661304F55A32D /* Pods_Runner.framework */, ); name = Frameworks; sourceTree = ""; @@ -186,14 +186,14 @@ isa = PBXNativeTarget; buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; buildPhases = ( - C79BE4619064E868C0DFBD12 /* [CP] Check Pods Manifest.lock */, + 4CBD0CB2C106C3E696B88FDB /* [CP] Check Pods Manifest.lock */, 9740EEB61CF901F6004384FC /* Run Script */, 97C146EA1CF9000F007C117D /* Sources */, 97C146EB1CF9000F007C117D /* Frameworks */, 97C146EC1CF9000F007C117D /* Resources */, 9705A1C41CF9048500538489 /* Embed Frameworks */, 3B06AD1E1E4923F5004D2608 /* Thin Binary */, - 3DBDEDAE0EB70F8613EE7963 /* [CP] Embed Pods Frameworks */, + C21500C474806845DCE7C12A /* [CP] Embed Pods Frameworks */, ); buildRules = ( ); @@ -210,11 +210,12 @@ 97C146E61CF9000F007C117D /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 1430; + LastUpgradeCheck = 1300; ORGANIZATIONNAME = "The Chromium Authors"; TargetAttributes = { 97C146ED1CF9000F007C117D = { CreatedOnToolsVersion = 7.3.1; + DevelopmentTeam = 3A359E86ZF; LastSwiftMigration = 1100; }; }; @@ -255,12 +256,10 @@ /* Begin PBXShellScriptBuildPhase section */ 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { isa = PBXShellScriptBuildPhase; - alwaysOutOfDate = 1; buildActionMask = 2147483647; files = ( ); inputPaths = ( - "${TARGET_BUILD_DIR}/${INFOPLIST_PATH}", ); name = "Thin Binary"; outputPaths = ( @@ -269,7 +268,43 @@ shellPath = /bin/sh; shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin"; }; - 3DBDEDAE0EB70F8613EE7963 /* [CP] Embed Pods Frameworks */ = { + 4CBD0CB2C106C3E696B88FDB /* [CP] Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", + ); + name = "[CP] Check Pods Manifest.lock"; + outputFileListPaths = ( + ); + outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; + showEnvVarsInLog = 0; + }; + 9740EEB61CF901F6004384FC /* Run Script */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Run Script"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; + }; + C21500C474806845DCE7C12A /* [CP] Embed Pods Frameworks */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( @@ -306,11 +341,14 @@ "${BUILT_PRODUCTS_DIR}/local_auth_ios/local_auth_ios.framework", "${BUILT_PRODUCTS_DIR}/maps_launcher/maps_launcher.framework", "${BUILT_PRODUCTS_DIR}/nanopb/nanopb.framework", - "${BUILT_PRODUCTS_DIR}/path_provider_foundation/path_provider_foundation.framework", - "${BUILT_PRODUCTS_DIR}/shared_preferences_foundation/shared_preferences_foundation.framework", + "${BUILT_PRODUCTS_DIR}/path_provider_ios/path_provider_ios.framework", + "${BUILT_PRODUCTS_DIR}/shared_preferences_ios/shared_preferences_ios.framework", "${BUILT_PRODUCTS_DIR}/speech_to_text/speech_to_text.framework", "${BUILT_PRODUCTS_DIR}/sqflite/sqflite.framework", "${BUILT_PRODUCTS_DIR}/url_launcher_ios/url_launcher_ios.framework", + "${BUILT_PRODUCTS_DIR}/video_player_avfoundation/video_player_avfoundation.framework", + "${BUILT_PRODUCTS_DIR}/wakelock/wakelock.framework", + "${BUILT_PRODUCTS_DIR}/webview_flutter_wkwebview/webview_flutter_wkwebview.framework", ); name = "[CP] Embed Pods Frameworks"; outputPaths = ( @@ -344,54 +382,20 @@ "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/local_auth_ios.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/maps_launcher.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/nanopb.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/path_provider_foundation.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/shared_preferences_foundation.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/path_provider_ios.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/shared_preferences_ios.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/speech_to_text.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/sqflite.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/url_launcher_ios.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/video_player_avfoundation.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/wakelock.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/webview_flutter_wkwebview.framework", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; showEnvVarsInLog = 0; }; - 9740EEB61CF901F6004384FC /* Run Script */ = { - isa = PBXShellScriptBuildPhase; - alwaysOutOfDate = 1; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "Run Script"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; - }; - C79BE4619064E868C0DFBD12 /* [CP] Check Pods Manifest.lock */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - ); - inputPaths = ( - "${PODS_PODFILE_DIR_PATH}/Podfile.lock", - "${PODS_ROOT}/Manifest.lock", - ); - name = "[CP] Check Pods Manifest.lock"; - outputFileListPaths = ( - ); - outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; - showEnvVarsInLog = 0; - }; /* End PBXShellScriptBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ @@ -484,12 +488,12 @@ }; 249021D4217E4FDB00AE95B9 /* Profile */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; + baseConfigurationReference = E333B59AA5538E0304102FD2 /* Pods-Runner.profile.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CURRENT_PROJECT_VERSION = 4; - DEVELOPMENT_TEAM = ""; + DEVELOPMENT_TEAM = 3A359E86ZF; ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", @@ -497,10 +501,7 @@ ); INFOPLIST_FILE = Runner/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 11.0; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - ); + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; LIBRARY_SEARCH_PATHS = ( "$(inherited)", "$(PROJECT_DIR)/Flutter", @@ -516,6 +517,7 @@ }; 97C147031CF9000F007C117D /* Debug */ = { isa = XCBuildConfiguration; + baseConfigurationReference = 9740EEB31CF90195004384FC /* Generated.xcconfig */; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_ANALYZER_NONNULL = YES; @@ -622,12 +624,12 @@ }; 97C147061CF9000F007C117D /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; + baseConfigurationReference = C55D4AE245B71956447BA22F /* Pods-Runner.debug.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CURRENT_PROJECT_VERSION = 4; - DEVELOPMENT_TEAM = ""; + DEVELOPMENT_TEAM = 3A359E86ZF; ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", @@ -635,10 +637,7 @@ ); INFOPLIST_FILE = Runner/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 11.0; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - ); + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; LIBRARY_SEARCH_PATHS = ( "$(inherited)", "$(PROJECT_DIR)/Flutter", @@ -655,13 +654,13 @@ }; 97C147071CF9000F007C117D /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; + baseConfigurationReference = C8801C5E6B82B6CB497CA5C7 /* Pods-Runner.release.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = Runner/RunnerRelease.entitlements; CURRENT_PROJECT_VERSION = 4; - DEVELOPMENT_TEAM = ""; + DEVELOPMENT_TEAM = 3A359E86ZF; ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", @@ -669,10 +668,7 @@ ); INFOPLIST_FILE = Runner/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 11.0; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - ); + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; LIBRARY_SEARCH_PATHS = ( "$(inherited)", "$(PROJECT_DIR)/Flutter", @@ -697,7 +693,7 @@ 249021D3217E4FDB00AE95B9 /* Profile */, ); defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; + defaultConfigurationName = Debug; }; 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = { isa = XCConfigurationList; @@ -707,7 +703,7 @@ 249021D4217E4FDB00AE95B9 /* Profile */, ); defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; + defaultConfigurationName = Debug; }; /* End XCConfigurationList section */ }; diff --git a/ios/Runner/Info.plist b/ios/Runner/Info.plist index 5fc389f9..31c95209 100644 --- a/ios/Runner/Info.plist +++ b/ios/Runner/Info.plist @@ -67,7 +67,5 @@ CADisableMinimumFrameDurationOnPhone - UIApplicationSupportsIndirectInputEvents - diff --git a/key.properties b/key.properties new file mode 100644 index 00000000..92d5c684 --- /dev/null +++ b/key.properties @@ -0,0 +1,4 @@ +storePassword=HmGsa123 +keyPassword=HmGsa123 +keyAlias=hmgdoctor +storeFile=doctor_app_key \ No newline at end of file diff --git a/lib/client/base_app_client.dart b/lib/client/base_app_client.dart index c12158e5..2faae2c9 100644 --- a/lib/client/base_app_client.dart +++ b/lib/client/base_app_client.dart @@ -1,3 +1,5 @@ +//@dart=2.9 + import 'dart:convert'; import 'dart:io' show Platform; @@ -7,22 +9,24 @@ import 'package:doctor_app_flutter/core/model/doctor/doctor_profile_model.dart'; import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/core/service/NavigationService.dart'; import 'package:doctor_app_flutter/core/viewModel/authentication_view_model.dart'; -import 'package:doctor_app_flutter/locator.dart'; -import 'package:doctor_app_flutter/routes.dart'; import 'package:doctor_app_flutter/utils/dr_app_shared_pref.dart'; import 'package:doctor_app_flutter/utils/utils.dart'; +import 'package:flutter/cupertino.dart'; import 'package:http/http.dart' as http; import 'package:provider/provider.dart'; +import '../locator.dart'; +import '../routes.dart'; + DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); Utils helpers = new Utils(); class BaseAppClient { //TODO change the post fun to nun static when you change all service post(String endPoint, - {required Map body, - required Function(dynamic response, int statusCode) onSuccess, - required Function(String error, int statusCode) onFailure, + {Map body, + Function(dynamic response, int statusCode) onSuccess, + Function(String error, int statusCode) onFailure, bool isAllowAny = false, bool isLiveCare = false, bool isFallLanguage = false}) async { @@ -34,28 +38,34 @@ class BaseAppClient { bool callLog = true; try { - Map? profile = await sharedPref.getObj(DOCTOR_PROFILE); - String? token = await sharedPref.getString(TOKEN); + Map profile = await sharedPref.getObj(DOCTOR_PROFILE); + String token = await sharedPref.getString(TOKEN); if (profile != null) { DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile); if (body['DoctorID'] == null) { - body['DoctorID'] = doctorProfile.doctorID; + body['DoctorID'] = doctorProfile?.doctorID; } if (body['DoctorID'] == "") body['DoctorID'] = null; - if (body['EditedBy'] == null) body['EditedBy'] = doctorProfile.doctorID; + if (body['EditedBy'] == null) body['EditedBy'] = doctorProfile?.doctorID; if (body['ProjectID'] == null) { - body['ProjectID'] = doctorProfile.projectID; + body['ProjectID'] = doctorProfile?.projectID; } - if (body['ClinicID'] == null) body['ClinicID'] = doctorProfile.clinicID; + if (body['ClinicID'] == null) body['ClinicID'] = doctorProfile?.clinicID; } else { - String? doctorID = await sharedPref.getString(DOCTOR_ID); + String doctorID = await sharedPref.getString(DOCTOR_ID); if (body['DoctorID'] == '') { body['DoctorID'] = null; } else if (doctorID != null) body['DoctorID'] = int.parse(doctorID); } + body['SetupID'] = body.containsKey('SetupID') + ? body['SetupID'] != null + ? body['SetupID'] + : await sharedPref.getString(DOCTOR_SETUP_ID) + : await sharedPref.getString(DOCTOR_SETUP_ID); + if (body['EditedBy'] == '') { body.remove("EditedBy"); } @@ -64,7 +74,7 @@ class BaseAppClient { } if (!isFallLanguage) { - String? lang = await sharedPref.getString(APP_Language); + String lang = await sharedPref.getString(APP_Language); if (lang != null && lang == 'ar') body['LanguageID'] = 1; else @@ -88,10 +98,7 @@ class BaseAppClient { body['VidaRefreshTokenID'] = await sharedPref.getString(VIDA_REFRESH_TOKEN_ID); } - int? projectID = await sharedPref.getInt(PROJECT_ID); - // if (projectID != null) { - // projectID = 2; - // } + int projectID = await sharedPref.getInt(PROJECT_ID); if (projectID == 2 || projectID == 3) body['PatientOutSA'] = true; else if ((body.containsKey('facilityId') && body['facilityId'] == 2 || body['facilityId'] == 3) || body['ProjectID'] == 2 || body['ProjectID'] == 3) @@ -99,9 +106,23 @@ class BaseAppClient { else body['PatientOutSA'] = false; + // if (!body.containsKey('ProjectID')) { + // if (projectID != null) { + // body['ProjectID'] = projectID; + // } else { + // body['ProjectID'] = 0; + // } + // } + body['DeviceTypeID'] = Platform.isAndroid ? 1 : 2; - print("URL : $url"); - print("Body : ${json.encode(body)}"); + + // body['DoctorID'] = 1002; //3844083 + // body['TokenID'] = "@dm!n"; + + // print("ProjectID :"); + // print(body['ProjectID']); + debugPrint("URL : $url"); + debugPrint("Body : ${json.encode(body)}"); var asd = json.encode(body); var asd2; if (await Utils.checkConnection()) { @@ -111,6 +132,7 @@ class BaseAppClient { onFailure(Utils.generateContactAdminMsg(), statusCode); } else { var parsed = json.decode(response.body.toString()); + print("Response : $parsed"); if (parsed['ErrorType'] == 4) { helpers.navigateToUpdatePage(parsed['ErrorEndUserMessage'], parsed['AndroidLink'], parsed['IOSLink']); } @@ -145,11 +167,12 @@ class BaseAppClient { } } + postPatient(String endPoint, - {required Map body, - required Function(dynamic response, int statusCode) onSuccess, - required Function(String error, int statusCode) onFailure, - PatiantInformtion? patient, + {Map body, + Function(dynamic response, int statusCode) onSuccess, + Function(String error, int statusCode) onFailure, + @required PatiantInformtion patient, bool isExternal = false}) async { String url = BASE_URL + endPoint; @@ -157,20 +180,23 @@ class BaseAppClient { Map headers = {'Content-Type': 'application/json', 'Accept': 'application/json'}; String token = await sharedPref.getString(TOKEN); - Map? profile = await sharedPref.getObj(DOCTOR_PROFILE); + Map profile = await sharedPref.getObj(DOCTOR_PROFILE); if (profile != null) { DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile); if (body['DoctorID'] == null) { - body['DoctorID'] = doctorProfile.doctorID; + body['DoctorID'] = doctorProfile?.doctorID; } } + if (body['DoctorID'] == 0) { + body['DoctorID'] = null; + } var languageID = await sharedPref.getStringWithDefaultValue(APP_Language, 'en'); body['SetupID'] = body.containsKey('SetupID') ? body['SetupID'] != null ? body['SetupID'] - : SETUP_ID - : SETUP_ID; + : await sharedPref.getString(DOCTOR_SETUP_ID) + : await sharedPref.getString(DOCTOR_SETUP_ID); body['VersionID'] = VERSION_ID; body['Channel'] = CHANNEL; @@ -197,7 +223,7 @@ class BaseAppClient { body['PatientType'] = body.containsKey('PatientType') ? body['PatientType'] != null ? body['PatientType'] - : patient!.patientType != null + : patient.patientType != null ? patient.patientType : PATIENT_TYPE : PATIENT_TYPE; @@ -205,13 +231,13 @@ class BaseAppClient { body['PatientTypeID'] = body.containsKey('PatientTypeID') ? body['PatientTypeID'] != null ? body['PatientTypeID'] - : patient!.patientType != null + : patient.patientType != null ? patient.patientType : PATIENT_TYPE_ID : PATIENT_TYPE_ID; body['TokenID'] = body.containsKey('TokenID') ? body['TokenID'] ?? token : token; - body['PatientID'] = body['PatientID'] != null ? body['PatientID'] : patient!.patientId ?? patient.patientMRN; + body['PatientID'] = body['PatientID'] != null ? body['PatientID'] : patient.patientId ?? patient.patientMRN; body['PatientOutSA'] = 0; //user['OutSA']; //TODO change it body['SessionID'] = SESSION_ID; //getSe @@ -222,8 +248,21 @@ class BaseAppClient { else body['PatientOutSA'] = false; + // if(!body.containsKey('ProjectID')) { + // if (projectID != null) { + // body['ProjectID'] = 313; + // } else { + // body['ProjectID'] = 0; + // } + // } + + // body['DoctorID'] = 24; //3844083 + // body['TokenID'] = "@dm!n"; + print("URL : $url"); print("Body : ${json.encode(body)}"); + var asd = json.encode(body); + var asd2; if (await Utils.checkConnection()) { final response = await http.post(Uri.parse(url.trim()), body: json.encode(body), headers: headers); final int statusCode = response.statusCode; @@ -308,4 +347,19 @@ class BaseAppClient { } return error; } + get({String endPoint, + Function(dynamic response, int statusCode) onSuccess, + Function(String error, int statusCode) onFailure}) async{ + String token = await sharedPref.getString(TOKEN); + String url = DOCTOR_ROTATION + endPoint+'&token='+token; + + final response = await http.get(Uri.parse(url)); + final int statusCode = response.statusCode; + if (statusCode < 200 || statusCode >= 400) { + onFailure(Utils.generateContactAdminMsg(), statusCode); + } else { + var parsed = json.decode(response.body.toString()); + onSuccess(parsed,statusCode); + } + } } diff --git a/lib/config/config.dart b/lib/config/config.dart index 2195aff2..e248f70e 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -5,119 +5,95 @@ const ONLY_NUMBERS = "[0-9]"; const ONLY_LETTERS = "[a-zA-Z &'\"]"; const ONLY_DATE = "[0-9/]"; const BASE_URL_LIVE_CARE = 'https://livecare.hmg.com/'; +const DOCTOR_ROTATION = 'https://doctorrota.hmg.com/'; +// const BASE_URL_LIVE_CARE = 'https://livecareuat.hmg.com/'; // const BASE_URL = 'https://hmgwebservices.com/'; + const BASE_URL = 'https://uat.hmgwebservices.com/'; + +// const BASE_URL = 'https://webservices.hmg.com/'; + +// const BASE_URL = 'https://vidauat.cloudsolutions.com.sa/'; //Vida Plus URL + +// const BASE_URL = 'https://vidamergeuat.cloudsolutions.com.sa/'; //Vida Plus URL + const PHARMACY_ITEMS_URL = "Services/Lists.svc/REST/GetPharmcyItems_Region_enh"; const PHARMACY_LIST_URL = "Services/Patients.svc/REST/GetPharmcyList"; -const PATIENT_PROGRESS_NOTE_URL = - "Services/DoctorApplication.svc/REST/GetProgressNoteForInPatient"; -const PATIENT_INSURANCE_APPROVALS_URL = - "Services/DoctorApplication.svc/REST/GetApprovalStatusForInpatient"; -const PATIENT_REFER_TO_DOCTOR_URL = - "Services/DoctorApplication.svc/REST/ReferToDoctor"; -const PATIENT_GET_DOCTOR_BY_CLINIC_URL = - "Services/DoctorApplication.svc/REST/GetDoctorsByClinicID"; - -const PATIENT_GET_DOCTOR_BY_CLINIC_Hospital = - "Services/Doctors.svc/REST/SearchDoctorsByTime"; - -const GET_CLINICS_FOR_DOCTOR = - 'Services/DoctorApplication.svc/REST/GetClinicsForDoctor'; -const PATIENT_GET_LIST_REFERAL_URL = - "Services/Lists.svc/REST/GetList_STPReferralFrequency"; -const PATIENT_GET_CLINIC_BY_PROJECT_URL = - "Services/DoctorApplication.svc/REST/GetClinicsByProjectID"; +const PATIENT_PROGRESS_NOTE_URL = "Services/DoctorApplication.svc/REST/GetProgressNoteForInPatient"; +const PATIENT_INSURANCE_APPROVALS_URL = "Services/DoctorApplication.svc/REST/GetApprovalStatusForInpatient"; +const PATIENT_REFER_TO_DOCTOR_URL = "Services/DoctorApplication.svc/REST/ReferToDoctor"; +const PATIENT_GET_DOCTOR_BY_CLINIC_URL = "Services/DoctorApplication.svc/REST/GetDoctorsByClinicID"; + +const PATIENT_GET_DOCTOR_BY_CLINIC_Hospital = "Services/Doctors.svc/REST/SearchDoctorsByTime"; + +const GET_CLINICS_FOR_DOCTOR = 'Services/DoctorApplication.svc/REST/GetClinicsForDoctor'; +const PATIENT_GET_LIST_REFERAL_URL = "Services/Lists.svc/REST/GetList_STPReferralFrequency"; +const PATIENT_GET_CLINIC_BY_PROJECT_URL = "Services/DoctorApplication.svc/REST/GetClinicsByProjectID"; const PROJECT_GET_INFO = "Services/DoctorApplication.svc/REST/GetProjectInfo"; const GET_CLINICS = "Services/DoctorApplication.svc/REST/GetClinics"; -const GET_REFERRAL_FACILITIES = - 'Services/DoctorApplication.svc/REST/GetReferralFacilities'; +const GET_REFERRAL_FACILITIES = 'Services/DoctorApplication.svc/REST/GetReferralFacilities'; const GET_PROJECTS = 'Services/DoctorApplication.svc/REST/GetProjectInfo'; -const GET_PATIENT_VITAL_SIGN = - 'Services/Doctors.svc/REST/Doctor_GetPatientVitalSign'; -const GET_PATIENT_VITAL_SIGN_DATA = - 'Services/DoctorApplication.svc/REST/GetVitalSigns'; -const GET_PATIENT_LAB_OREDERS = - 'Services/DoctorApplication.svc/REST/GetPatientLabOreders'; +const GET_PATIENT_VITAL_SIGN = 'Services/Doctors.svc/REST/Doctor_GetPatientVitalSign'; +const GET_PATIENT_VITAL_SIGN_DATA = 'Services/DoctorApplication.svc/REST/GetVitalSigns'; +const GET_PATIENT_LAB_OREDERS = 'Services/DoctorApplication.svc/REST/GetPatientLabOreders'; const GET_PRESCRIPTION = 'Services/Patients.svc/REST/GetPrescriptionApptList'; -const GET_LIVECARE_PENDINGLIST = - 'Services/DoctorApplication.svc/REST/GetPendingPatientER'; +const GET_LIVECARE_PENDINGLIST = 'Services/DoctorApplication.svc/REST/GetPendingPatientER'; const START_LIVE_CARE_CALL = 'LiveCareApi/DoctorApp/CallPatient'; -const LIVE_CARE_STATISTICS_FOR_CERTAIN_DOCTOR_URL = - "Lists.svc/REST/DashBoard_GetLiveCareDoctorsStatsticsForCertainDoctor"; +const LIVE_CARE_STATISTICS_FOR_CERTAIN_DOCTOR_URL = "Lists.svc/REST/DashBoard_GetLiveCareDoctorsStatsticsForCertainDoctor"; -const GET_PRESCRIPTION_REPORT = - 'Services/Patients.svc/REST/GetPrescriptionReport'; +const GET_PRESCRIPTION_REPORT = 'Services/Patients.svc/REST/GetPrescriptionReport'; -const GT_MY_PATIENT_QUESTION = - 'Services/DoctorApplication.svc/REST/GtMyPatientsQuestions'; +const GT_MY_PATIENT_QUESTION = 'Services/DoctorApplication.svc/REST/GtMyPatientsQuestions'; -const PRM_SEARCH_PATIENT = - 'Services/Patients.svc/REST/GetPatientInformation_PRM'; +const PRM_SEARCH_PATIENT = 'Services/Patients.svc/REST/GetPatientInformation_PRM'; const GET_PATIENT = 'Services/DoctorApplication.svc/REST/'; -const GET_PRESCRIPTION_REPORT_FOR_IN_PATIENT = - 'Services/DoctorApplication.svc/REST/GetPrescriptionReportForInPatient'; +const GET_PRESCRIPTION_REPORT_FOR_IN_PATIENT = 'Services/DoctorApplication.svc/REST/GetPrescriptionReportForInPatient'; -const GET_MY_REFERRAL_PATIENT = - 'Services/DoctorApplication.svc/REST/GtMyReferralPatient'; +const GET_MY_REFERRAL_PATIENT = 'Services/DoctorApplication.svc/REST/GtMyReferralPatient'; const REFER_TO_DOCTOR = 'Services/DoctorApplication.svc/REST/ReferToDoctor'; -const ADD_REFERRED_DOCTOR_REMARKS = - 'Services/DoctorApplication.svc/REST/AddReferredDoctorRemarks'; +const ADD_REFERRED_DOCTOR_REMARKS = 'Services/DoctorApplication.svc/REST/AddReferredDoctorRemarks'; -const GET_MY_REFERRED_PATIENT = - 'Services/DoctorApplication.svc/REST/GtMyReferredPatient'; +const GET_MY_REFERRED_PATIENT = 'Services/DoctorApplication.svc/REST/GtMyReferredPatient'; -const GET_MY_REFERRED_OUT_PATIENT = - 'Services/DoctorApplication.svc/REST/GtMyReferredOutPatient'; +const GET_MY_REFERRED_OUT_PATIENT = 'Services/DoctorApplication.svc/REST/GtMyReferredOutPatient'; -const GET_PENDING_REFERRAL_PATIENT = - 'Services/DoctorApplication.svc/REST/PendingReferrals'; +const GET_PENDING_REFERRAL_PATIENT = 'Services/DoctorApplication.svc/REST/PendingReferrals'; -const CREATE_REFERRAL_PATIENT = - 'Services/DoctorApplication.svc/REST/CreateReferral'; +const CREATE_REFERRAL_PATIENT = 'Services/DoctorApplication.svc/REST/CreateReferral'; -const RESPONSE_PENDING_REFERRAL_PATIENT = - 'Services/DoctorApplication.svc/REST/RespondReferral'; +const RESPONSE_PENDING_REFERRAL_PATIENT = 'Services/DoctorApplication.svc/REST/RespondReferral'; const GET_PATIENT_REFERRAL = 'Services/DoctorApplication.svc/REST/GetRefferal'; const POST_UCAF = 'Services/DoctorApplication.svc/REST/PostUCAF'; -const GET_DOCTOR_WORKING_HOURS_TABLE = - 'Services/Doctors.svc/REST/GetDoctorWorkingHoursTable'; +const GET_DOCTOR_WORKING_HOURS_TABLE = 'Services/Doctors.svc/REST/GetDoctorWorkingHoursTable'; -const GET_PATIENT_LAB_RESULTS = - 'Services/DoctorApplication.svc/REST/GetPatientLabResults'; +const GET_PATIENT_LAB_RESULTS = 'Services/DoctorApplication.svc/REST/GetPatientLabResults'; const LOGIN_URL = 'Services/Sentry.svc/REST/MemberLogIN_New'; -const INSERT_DEVICE_IMEI = - 'Services/DoctorApplication.svc/REST/DoctorApp_InsertOrUpdateDeviceDetails'; +const INSERT_DEVICE_IMEI = 'Services/DoctorApplication.svc/REST/DoctorApp_InsertOrUpdateDeviceDetails'; // 'Services/Sentry.svc/REST/DoctorApplication_INSERTDeviceIMEI'; // const SELECT_DEVICE_IMEI = // 'Services/Sentry.svc/REST/DoctorApplication_SELECTDeviceIMEIbyIMEI'; -const SELECT_DEVICE_IMEI = - 'Services/DoctorApplication.svc/REST/DoctorApp_GetDeviceDetailsByIMEI'; +const SELECT_DEVICE_IMEI = 'Services/DoctorApplication.svc/REST/DoctorApp_GetDeviceDetailsByIMEI'; -const SEND_ACTIVATION_CODE_BY_OTP_NOTIFICATION_TYPE = - 'Services/Sentry.svc/REST/DoctorApplication_SendActivationCodebyOTPNotificationType'; +const SEND_ACTIVATION_CODE_BY_OTP_NOTIFICATION_TYPE = 'Services/Sentry.svc/REST/DoctorApplication_SendActivationCodebyOTPNotificationType'; -const SEND_ACTIVATION_CODE_FOR_DOCTOR_APP = - 'Services/DoctorApplication.svc/REST/SendActivationCodeForDoctorApp'; +const SEND_ACTIVATION_CODE_FOR_DOCTOR_APP = 'Services/DoctorApplication.svc/REST/SendActivationCodeForDoctorApp'; -const SEND_ACTIVATION_CODE_FOR_VERIFICATION_SCREEN = - 'Services/DoctorApplication.svc/REST/SendVerificationCode'; -const MEMBER_CHECK_ACTIVATION_CODE_NEW = - 'Services/Sentry.svc/REST/MemberCheckActivationCode_New'; +const SEND_ACTIVATION_CODE_FOR_VERIFICATION_SCREEN = 'Services/DoctorApplication.svc/REST/SendVerificationCode'; +const MEMBER_CHECK_ACTIVATION_CODE_NEW = 'Services/Sentry.svc/REST/MemberCheckActivationCode_New'; -const CHECK_ACTIVATION_CODE_FOR_DOCTOR_APP = - 'Services/DoctorApplication.svc/REST/CheckActivationCodeForDoctorApp'; +const CHECK_ACTIVATION_CODE_FOR_DOCTOR_APP = 'Services/DoctorApplication.svc/REST/CheckActivationCodeForDoctorApp'; const GET_DOC_PROFILES = 'Services/Doctors.svc/REST/GetDocProfiles'; const TRANSFERT_TO_ADMIN = 'LiveCareApi/DoctorApp/TransferToAdmin'; @@ -125,268 +101,182 @@ const SEND_SMS_INSTRUCTIONS = 'LiveCareApi/DoctorApp/SendSMSInstruction'; const GET_ALTERNATIVE_SERVICE = 'LiveCareApi/DoctorApp/GetAlternativeServices'; const END_CALL = 'LiveCareApi/DoctorApp/EndCall'; const END_CALL_WITH_CHARGE = 'LiveCareApi/DoctorApp/CompleteCallWithCharge'; -const GET_DASHBOARD = - 'Services/DoctorApplication.svc/REST/GetDoctorDashboardKPI'; -const GET_SICKLEAVE_STATISTIC = - 'Services/DoctorApplication.svc/REST/PreSickLeaveStatistics'; -const ARRIVED_PATIENT_URL = - 'Services/DoctorApplication.svc/REST/PatientArrivalList'; +const GET_DASHBOARD = 'Services/DoctorApplication.svc/REST/GetDoctorDashboardKPI'; +const GET_SICKLEAVE_STATISTIC = 'Services/DoctorApplication.svc/REST/PreSickLeaveStatistics'; +const ARRIVED_PATIENT_URL = 'Services/DoctorApplication.svc/REST/PatientArrivalList'; const ADD_SICK_LEAVE = 'Services/DoctorApplication.svc/REST/PostSickLeave'; const GET_SICK_LEAVE = 'Services/Patients.svc/REST/GetPatientSickLeave'; const EXTEND_SICK_LEAVE = 'Services/DoctorApplication.svc/REST/ExtendSickLeave'; const GET_MASTER_LOOKUP_LIST = 'Services/DoctorApplication.svc/REST/GetMasterLookUpList'; -const GET_COVERING_DOCTORS = - 'Services/DoctorApplication.svc/REST/GetCoveringDoctor'; +const GET_COVERING_DOCTORS = 'Services/DoctorApplication.svc/REST/GetCoveringDoctor'; const ADD_RESCHDEULE = 'Services/DoctorApplication.svc/REST/PostRequisition'; -const UPDATE_RESCHDEULE = - 'Services/DoctorApplication.svc/REST/PatchRequisition'; -const GET_RESCHEDULE_LEAVE = - 'Services/DoctorApplication.svc/REST/GetRequisition'; -const GET_PRESCRIPTION_LIST = - 'Services/DoctorApplication.svc/REST/GetPrescription'; - -const POST_PRESCRIPTION_LIST = - 'Services/DoctorApplication.svc/REST/PostPrescription'; -const GET_PROCEDURE_LIST = - 'Services/DoctorApplication.svc/REST/GetOrderedProcedure'; -const POST_PROCEDURE_LIST = 'Services/DoctorApplication.svc/REST/PostProcedure'; +const UPDATE_RESCHDEULE = 'Services/DoctorApplication.svc/REST/PatchRequisition'; +const GET_RESCHEDULE_LEAVE = 'Services/DoctorApplication.svc/REST/GetRequisition'; +const GET_PRESCRIPTION_LIST = 'Services/DoctorApplication.svc/REST/GetPrescription'; +const POST_PRESCRIPTION_LIST = 'Services/DoctorApplication.svc/REST/PostPrescription'; +const GET_PROCEDURE_LIST = 'Services/DoctorApplication.svc/REST/GetOrderedProcedure'; +const POST_PROCEDURE_LIST = 'Services/DoctorApplication.svc/REST/PostProcedure'; -const GET_PATIENT_IN_PATIENT_LIST = - 'Services/DoctorApplication.svc/REST/GetMyInPatient'; +const GET_PATIENT_IN_PATIENT_LIST = 'Services/DoctorApplication.svc/REST/GetMyInPatient'; -const Verify_Referral_Doctor_Remarks = - 'Services/DoctorApplication.svc/REST/VerifyReferralDoctorRemarks'; +const Verify_Referral_Doctor_Remarks = 'Services/DoctorApplication.svc/REST/VerifyReferralDoctorRemarks'; ///Lab Order const GET_Patient_LAB_ORDERS = 'Services/Patients.svc/REST/GetPatientLabOrders'; -const GET_Patient_LAB_SPECIAL_RESULT = - 'Services/Patients.svc/REST/GetPatientLabSpecialResults'; -const SEND_LAB_RESULT_EMAIL = - 'Services/Notifications.svc/REST/SendLabReportEmail'; -const GET_Patient_LAB_RESULT = - 'Services/Patients.svc/REST/GetPatientLabResults'; -const GET_Patient_LAB_ORDERS_RESULT = - 'Services/Patients.svc/REST/GetPatientLabOrdersResults'; -const GET_PATIENT_LAB_ORDERS_RESULT_HISTORY_BY_DESCRIPTION = - 'Services/Patients.svc/REST/GetPatientLabOrdersResultsHistoryByDescription'; +const GET_Patient_LAB_SPECIAL_RESULT = 'Services/Patients.svc/REST/GetPatientLabSpecialResults'; +const SEND_LAB_RESULT_EMAIL = 'Services/Notifications.svc/REST/SendLabReportEmail'; +const GET_Patient_LAB_RESULT = 'Services/Patients.svc/REST/GetPatientLabResults'; +const GET_Patient_LAB_ORDERS_RESULT = 'Services/Patients.svc/REST/GetPatientLabOrdersResults'; +const GET_PATIENT_LAB_ORDERS_RESULT_HISTORY_BY_DESCRIPTION = 'Services/Patients.svc/REST/GetPatientLabOrdersResultsHistoryByDescription'; // SOAP const GET_ALLERGIES = 'Services/DoctorApplication.svc/REST/GetAllergies'; const POST_EPISODE = 'Services/DoctorApplication.svc/REST/PostEpisode'; -const POST_EPISODE_FOR_IN_PATIENT = - 'Services/DoctorApplication.svc/REST/PostEpisodeForInpatient'; +const POST_EPISODE_FOR_IN_PATIENT = 'Services/DoctorApplication.svc/REST/PostEpisodeForInpatient'; const POST_ALLERGY = 'Services/DoctorApplication.svc/REST/PostAllergies'; const POST_HISTORY = 'Services/DoctorApplication.svc/REST/PostHistory'; -const POST_CHIEF_COMPLAINT = - 'Services/DoctorApplication.svc/REST/PostChiefcomplaint'; -const POST_PHYSICAL_EXAM = - 'Services/DoctorApplication.svc/REST/PostPhysicalExam'; -const POST_PROGRESS_NOTE = - '/Services/DoctorApplication.svc/REST/PostProgressNote'; +const POST_CHIEF_COMPLAINT = 'Services/DoctorApplication.svc/REST/PostChiefcomplaint'; +const POST_PHYSICAL_EXAM = 'Services/DoctorApplication.svc/REST/PostPhysicalExam'; +const POST_PROGRESS_NOTE = '/Services/DoctorApplication.svc/REST/PostProgressNote'; const POST_ASSESSMENT = 'Services/DoctorApplication.svc/REST/PostAssessment'; const PATCH_ALLERGY = 'Services/DoctorApplication.svc/REST/PatchAllergies'; const PATCH_HISTORY = 'Services/DoctorApplication.svc/REST/PatchHistory'; -const PATCH_CHIEF_COMPLAINT = - 'Services/DoctorApplication.svc/REST/PatchChiefcomplaint'; +const PATCH_CHIEF_COMPLAINT = 'Services/DoctorApplication.svc/REST/PatchChiefcomplaint'; -const PATCH_PHYSICAL_EXAM = - 'Services/DoctorApplication.svc/REST/PatchPhysicalExam'; -const PATCH_PROGRESS_NOTE = - 'Services/DoctorApplication.svc/REST/PatchProgressNote'; +const PATCH_PHYSICAL_EXAM = 'Services/DoctorApplication.svc/REST/PatchPhysicalExam'; +const PATCH_PROGRESS_NOTE = 'Services/DoctorApplication.svc/REST/PatchProgressNote'; const PATCH_ASSESSMENT = 'Services/DoctorApplication.svc/REST/PatchAssessment'; const GET_HISTORY = 'Services/DoctorApplication.svc/REST/GetHistory'; -const GET_CHIEF_COMPLAINT = - 'Services/DoctorApplication.svc/REST/GetChiefcomplaint'; +const GET_CHIEF_COMPLAINT = 'Services/DoctorApplication.svc/REST/GetChiefcomplaint'; const GET_PHYSICAL_EXAM = 'Services/DoctorApplication.svc/REST/GetPhysicalExam'; const GET_PROGRESS_NOTE = 'Services/DoctorApplication.svc/REST/GetProgressNote'; const GET_ASSESSMENT = 'Services/DoctorApplication.svc/REST/GetAssessment'; +const GET_LIST_CATEGORISE = 'Services/DoctorApplication.svc/REST/GetProcedureCategories'; -const GET_LIST_CATEGORISE = - 'Services/DoctorApplication.svc/REST/GetProcedureCategories'; - -const GET_CATEGORISE_PROCEDURE = - 'Services/DoctorApplication.svc/REST/GetProcedure'; +const GET_CATEGORISE_PROCEDURE = 'Services/DoctorApplication.svc/REST/GetProcedure'; const UPDATE_PROCEDURE = 'Services/DoctorApplication.svc/REST/PatchProcedure'; -const UPDATE_PRESCRIPTION = - 'Services/DoctorApplication.svc/REST/PatchPrescription'; +const UPDATE_PRESCRIPTION = 'Services/DoctorApplication.svc/REST/PatchPrescription'; const SEARCH_DRUG = 'Services/DoctorApplication.svc/REST/GetMedicationList'; -const DRUG_TO_DRUG = - 'Services/DoctorApplication.svc/REST/DrugToDrugInteraction'; +const DRUG_TO_DRUG = 'Services/DoctorApplication.svc/REST/DrugToDrugInteraction'; const GET_MEDICAL_FILE = 'Services/DoctorApplication.svc/REST/GetMedicalFile'; const GET_FLOORS = 'Services/DoctorApplication.svc/REST/GetFloors'; const GET_WARDS = 'Services/DoctorApplication.svc/REST/GetWards'; -const GET_ROOM_CATEGORIES = - 'Services/DoctorApplication.svc/REST/GetRoomCategories'; -const GET_DIAGNOSIS_TYPES = - 'Services/DoctorApplication.svc/REST/DiagnosisTypes'; +const GET_ROOM_CATEGORIES = 'Services/DoctorApplication.svc/REST/GetRoomCategories'; +const GET_DIAGNOSIS_TYPES = 'Services/DoctorApplication.svc/REST/DiagnosisTypes'; const GET_DIET_TYPES = 'Services/DoctorApplication.svc/REST/DietTypes'; const GET_ICD_CODES = 'Services/DoctorApplication.svc/REST/GetICDCodes'; -const POST_ADMISSION_REQUEST = - 'Services/DoctorApplication.svc/REST/PostAdmissionRequest'; -const GET_ITEM_BY_MEDICINE = - 'Services/DoctorApplication.svc/REST/GetItemByMedicineCode'; +const POST_ADMISSION_REQUEST = 'Services/DoctorApplication.svc/REST/PostAdmissionRequest'; +const GET_ITEM_BY_MEDICINE = 'Services/DoctorApplication.svc/REST/GetItemByMedicineCode'; -const GET_PROCEDURE_VALIDATION = - 'Services/DoctorApplication.svc/REST/ValidateProcedures'; -const GET_BOX_QUANTITY = - 'Services/DoctorApplication.svc/REST/CalculateBoxQuantity'; +const GET_PROCEDURE_VALIDATION = 'Services/DoctorApplication.svc/REST/ValidateProcedures'; +const GET_BOX_QUANTITY = 'Services/DoctorApplication.svc/REST/CalculateBoxQuantity'; ///GET ECG const GET_ECG = "Services/Patients.svc/REST/HIS_GetPatientMuseResults"; -const GET_MY_REFERRAL_INPATIENT = - "Services/DoctorApplication.svc/REST/GtMyReferralPatient"; +const GET_MY_REFERRAL_INPATIENT = "Services/DoctorApplication.svc/REST/GtMyReferralPatient"; -const GET_MY_REFERRAL_OUT_PATIENT = - "Services/DoctorApplication.svc/REST/GtMyReferralForOutPatient"; +const GET_MY_REFERRAL_OUT_PATIENT = "Services/DoctorApplication.svc/REST/GtMyReferralForOutPatient"; -const GET_MY_DISCHARGE_PATIENT = - "Services/DoctorApplication.svc/REST/GtMyDischargeReferralPatient"; -const GET_DISCHARGE_PATIENT = - "Services/DoctorApplication.svc/REST/GtMyDischargePatient"; +const GET_MY_DISCHARGE_PATIENT = "Services/DoctorApplication.svc/REST/GtMyDischargeReferralPatient"; +const GET_DISCHARGE_PATIENT = "Services/DoctorApplication.svc/REST/GtMyDischargePatient"; -const GET_PAtIENTS_INSURANCE_APPROVALS = - "Services/Patients.svc/REST/GetApprovalStatus"; +const GET_PAtIENTS_INSURANCE_APPROVALS = "Services/Patients.svc/REST/GetApprovalStatus"; const GET_RAD_IMAGE_URL = 'Services/Patients.svc/Rest/GetRadImageURL'; const GET_PATIENT_ORDERS = 'Services/Patients.svc/REST/GetPatientRadOrders'; -const GET_IN_PATIENT_ORDERS = - 'Services/DoctorApplication.svc/REST/GetPatientRadResult'; +const GET_IN_PATIENT_ORDERS = 'Services/DoctorApplication.svc/REST/GetPatientRadResult'; ///Prescriptions -const GET_PRESCRIPTIONS_ALL_ORDERS = - 'Services/Patients.svc/REST/PatientER_GetPatientAllPresOrders'; -const GET_PRESCRIPTION_REPORT_NEW = - 'Services/Patients.svc/REST/INP_GetPrescriptionReport'; -const SEND_PRESCRIPTION_EMAIL = - 'Services/Notifications.svc/REST/SendPrescriptionEmail'; -const GET_PRESCRIPTION_REPORT_ENH = - 'Services/Patients.svc/REST/GetPrescriptionReport_enh'; -const UPDATE_PROGRESS_NOTE_FOR_INPATIENT = - "Services/DoctorApplication.svc/REST/UpdateProgressNoteForInPatient"; -const CREATE_PROGRESS_NOTE_FOR_INPATIENT = - "Services/DoctorApplication.svc/REST/CreateProgressNoteForInPatient"; +const GET_PRESCRIPTIONS_ALL_ORDERS = 'Services/Patients.svc/REST/PatientER_GetPatientAllPresOrders'; +const GET_PRESCRIPTION_REPORT_NEW = 'Services/Patients.svc/REST/INP_GetPrescriptionReport'; +const SEND_PRESCRIPTION_EMAIL = 'Services/Notifications.svc/REST/SendPrescriptionEmail'; +const GET_PRESCRIPTION_REPORT_ENH = 'Services/Patients.svc/REST/GetPrescriptionReport_enh'; +const UPDATE_PROGRESS_NOTE_FOR_INPATIENT = "Services/DoctorApplication.svc/REST/UpdateProgressNoteForInPatient"; +const CREATE_PROGRESS_NOTE_FOR_INPATIENT = "Services/DoctorApplication.svc/REST/CreateProgressNoteForInPatient"; const GET_SICK_LEAVE_PATIENT = "Services/Patients.svc/REST/GetPatientSickLeave"; -const GET_MY_OUT_PATIENT = - "Services/DoctorApplication.svc/REST/GetMyOutPatient"; +const GET_MY_OUT_PATIENT = "Services/DoctorApplication.svc/REST/GetMyOutPatient"; -const PATIENT_MEDICAL_REPORT_GET_LIST = - "Services/Patients.svc/REST/DAPP_ListMedicalReport"; -const PATIENT_MEDICAL_REPORT_GET_TEMPLATE = - "Services/Patients.svc/REST/DAPP_GetTemplateByID"; -const PATIENT_MEDICAL_REPORT_INSERT = - "Services/Patients.svc/REST/DAPP_InsertMedicalReport"; -const PATIENT_MEDICAL_REPORT_VERIFIED = - "Services/Patients.svc/REST/DAPP_VerifiedMedicalReport"; +const PATIENT_MEDICAL_REPORT_GET_LIST = "Services/Patients.svc/REST/DAPP_ListMedicalReport"; +const PATIENT_MEDICAL_REPORT_GET_TEMPLATE = "Services/Patients.svc/REST/DAPP_GetTemplateByID"; +const PATIENT_MEDICAL_REPORT_INSERT = "Services/Patients.svc/REST/DAPP_InsertMedicalReport"; +const PATIENT_MEDICAL_REPORT_VERIFIED = "Services/Patients.svc/REST/DAPP_VerifiedMedicalReport"; -const GET_PROCEDURE_TEMPLETE = - 'Services/Doctors.svc/REST/DAPP_ProcedureTemplateGet'; +const GET_PROCEDURE_TEMPLETE = 'Services/Doctors.svc/REST/DAPP_ProcedureTemplateGet'; const GET_TEMPLETE_LIST = 'Services/Doctors.svc/REST/DAPP_TemplateGet'; -const GET_PROCEDURE_TEMPLETE_DETAILS = - "Services/Doctors.svc/REST/DAPP_ProcedureTemplateDetailsGet"; -const GET_PENDING_PATIENT_ER_FOR_DOCTOR_APP = - 'Services/DoctorApplication.svc/REST/GetPendingPatientERForDoctorApp'; +const GET_PROCEDURE_TEMPLETE_DETAILS = "Services/Doctors.svc/REST/DAPP_ProcedureTemplateDetailsGet"; +const GET_PENDING_PATIENT_ER_FOR_DOCTOR_APP = 'Services/DoctorApplication.svc/REST/GetPendingPatientERForDoctorApp'; -const DOCTOR_CHECK_HAS_LIVE_CARE = - "Services/DoctorApplication.svc/REST/CheckDoctorHasLiveCare"; +const DOCTOR_CHECK_HAS_LIVE_CARE = "Services/DoctorApplication.svc/REST/CheckDoctorHasLiveCare"; const LIVE_CARE_IS_LOGIN = "LiveCareApi/DoctorApp/UseIsLogin"; -const ADD_REFERRED_REMARKS_NEW = - "Services/DoctorApplication.svc/REST/AddReferredDoctorRemarks_New"; -const GET_SPECIAL_CLINICAL_CARE_LIST = - "Services/DoctorApplication.svc/REST/GetSpecialClinicalCareList"; -const GET_SPECIAL_CLINICAL_CARE_MAPPING_LIST = - "Services/DoctorApplication.svc/REST/GetSpecialClinicalCareMappingList"; - -const INSERT_MEDICAL_REPORT = - "Services/Patients.svc/REST/DAPP_InsertMedicalReport_New"; - -const UPDATE_MEDICAL_REPORT = - "Services/Patients.svc/REST/DAPP_UpdateMedicalReport"; -const GET_SICK_LEAVE_DOCTOR_APP = - "Services/DoctorApplication.svc/REST/GetAllSickLeaves"; +const ADD_REFERRED_REMARKS_NEW = "Services/DoctorApplication.svc/REST/AddReferredDoctorRemarks_New"; +const GET_SPECIAL_CLINICAL_CARE_LIST = "Services/DoctorApplication.svc/REST/GetSpecialClinicalCareList"; +const GET_SPECIAL_CLINICAL_CARE_MAPPING_LIST = "Services/DoctorApplication.svc/REST/GetSpecialClinicalCareMappingList"; + +const INSERT_MEDICAL_REPORT = "Services/Patients.svc/REST/DAPP_InsertMedicalReport_New"; + +const UPDATE_MEDICAL_REPORT = "Services/Patients.svc/REST/DAPP_UpdateMedicalReport"; +const GET_SICK_LEAVE_DOCTOR_APP = "Services/DoctorApplication.svc/REST/GetAllSickLeaves"; const ADD_PATIENT_TO_DOCTOR = "LiveCareApi/DoctorApp/AssignPatientToDoctor"; const REMOVE_PATIENT_FROM_DOCTOR = "LiveCareApi/DoctorApp/BackPatientToQueue"; -const CREATE_DOCTOR_RESPONSE = - "Services/DoctorApplication.svc/REST/CreateDoctorResponse"; -const GET_DOCTOR_NOT_REPLIED_COUNTS = - "Services/DoctorApplication.svc/REST/DoctorApp_GetDoctorNotRepliedCounts"; -const ALL_SPECIAL_LAB_RESULT = - "services/Patients.svc/REST/GetPatientLabSpecialResultsALL"; -const GET_MEDICATION_FOR_IN_PATIENT = - "Services/DoctorApplication.svc/REST/Doctor_GetMedicationForInpatient"; -const GET_EPISODE_FOR_INPATIENT = - "/Services/DoctorApplication.svc/REST/DoctorApp_GetEpisodeForInpatient"; +const CREATE_DOCTOR_RESPONSE = "Services/DoctorApplication.svc/REST/CreateDoctorResponse"; +const GET_DOCTOR_NOT_REPLIED_COUNTS = "Services/DoctorApplication.svc/REST/DoctorApp_GetDoctorNotRepliedCounts"; +const ALL_SPECIAL_LAB_RESULT = "services/Patients.svc/REST/GetPatientLabSpecialResultsALL"; +const GET_MEDICATION_FOR_IN_PATIENT = "Services/DoctorApplication.svc/REST/Doctor_GetMedicationForInpatient"; +const GET_EPISODE_FOR_INPATIENT = "/Services/DoctorApplication.svc/REST/DoctorApp_GetEpisodeForInpatient"; ///Operation Details Services -const GET_RESERVATIONS = - "Services/DoctorApplication.svc/REST/DoctorApp_GetReservationDetails"; -const GET_OPERATION_DETAILS = - "Services/DoctorApplication.svc/REST/DoctorApp_GetOperationDetails"; -const UPDATE_OPERATION_REPORT = - "Services/DoctorApplication.svc/REST/DoctorApp_CreateUpdateOperationReport"; +const GET_RESERVATIONS = "Services/DoctorApplication.svc/REST/DoctorApp_GetReservationDetails"; +const GET_OPERATION_DETAILS = "Services/DoctorApplication.svc/REST/DoctorApp_GetOperationDetails"; +const UPDATE_OPERATION_REPORT = "Services/DoctorApplication.svc/REST/DoctorApp_CreateUpdateOperationReport"; -const NURSING_PROGRESS_NOTE = - "Services/DoctorApplication.svc/REST/DoctorApp_GetNursingProgressNote"; -const GET_DIAGNOSIS_FOR_IN_PATIENT = - "Services/DoctorApplication.svc/REST/DoctorApp_GetDiagnosisForInPatient"; +const NURSING_PROGRESS_NOTE = "Services/DoctorApplication.svc/REST/DoctorApp_GetNursingProgressNote"; +const GET_DIAGNOSIS_FOR_IN_PATIENT = "Services/DoctorApplication.svc/REST/DoctorApp_GetDiagnosisForInPatient"; -const GET_DIABETIC_CHART_VALUES = - "Services/DoctorApplication.svc/REST/DoctorApp_GetDiabeticChartValues"; +const GET_DIABETIC_CHART_VALUES = "Services/DoctorApplication.svc/REST/DoctorApp_GetDiabeticChartValues"; -const GET_PENDING_ORDERS = - "Services/DoctorApplication.svc/REST/DoctorApp_GetPendingOrdersForInPatient"; +const GET_PENDING_ORDERS = "Services/DoctorApplication.svc/REST/DoctorApp_GetPendingOrdersForInPatient"; -const GET_ADMISSION_ORDERS = - "/Services/DoctorApplication.svc/REST/DoctorApp_GetAdmissionOrders"; +const GET_ADMISSION_ORDERS = "/Services/DoctorApplication.svc/REST/DoctorApp_GetAdmissionOrders"; ///Patient Registration Services -const CHECK_PATIENT_FOR_REGISTRATION = - "Services/Authentication.svc/REST/CheckPatientForRegisteration"; -const SEND_ACTIVATION_CODE_BY_OTP_NOT_TYPE_FOR_REGISTRATION = - "Services/Authentication.svc/REST/SendActivationCodebyOTPNotificationTypeForRegistration"; -const CHECK_ACTIVATION_CODE_FOR_PATIENT = - "Services/Authentication.svc/REST/CheckActivationCode"; -const PATIENT_REGISTRATION = - "Services/Authentication.svc/REST/PatientRegistration"; +const CHECK_PATIENT_FOR_REGISTRATION = "Services/Authentication.svc/REST/CheckPatientForRegisteration"; +const SEND_ACTIVATION_CODE_BY_OTP_NOT_TYPE_FOR_REGISTRATION = "Services/Authentication.svc/REST/SendActivationCodebyOTPNotificationTypeForRegistration"; +const CHECK_ACTIVATION_CODE_FOR_PATIENT = "Services/Authentication.svc/REST/CheckActivationCode"; +const PATIENT_REGISTRATION = "Services/Authentication.svc/REST/PatientRegistration"; const GET_PATIENT_INFO = "Services/NHIC.svc/REST/GetPatientInfo"; /// Discharge Summary -const GET_PENDING_DISCHARGE_SUMMARY = - "Services/DoctorApplication.svc/REST/DoctorApp_GetPendingDischargeSummary"; -const GET_ALL_DISCHARGE_SUMMARY = - "Services/DoctorApplication.svc/REST/DoctorApp_GetDischargeSummary"; +const GET_PENDING_DISCHARGE_SUMMARY = "Services/DoctorApplication.svc/REST/DoctorApp_GetPendingDischargeSummary"; +const GET_ALL_DISCHARGE_SUMMARY = "Services/DoctorApplication.svc/REST/DoctorApp_GetDischargeSummary"; + +const VTE_ASSESSMENT = "Services/Patients.svc/REST/INP_GetVTEHistoryByTransactionNo"; -const VTE_ASSESSMENT = - "Services/Patients.svc/REST/INP_GetVTEHistoryByTransactionNo"; +const GET_INTERVENTION_MEDICATION = "Services/DoctorApplication.svc/REST/DoctorApp_GetInterventionMedications"; -const GET_INTERVENTION_MEDICATION = - "Services/DoctorApplication.svc/REST/DoctorApp_GetInterventionMedications"; +const GET_INTERVENTION_MEDICATION_HISTORY = "Services/DoctorApplication.svc/REST/DoctorApp_GetInterventionHistory"; -const GET_INTERVENTION_MEDICATION_HISTORY = - "Services/DoctorApplication.svc/REST/DoctorApp_GetInterventionHistory"; +const SET_ACCEPTED_OR_REJECTED = "Services/DoctorApplication.svc/REST/DoctorApp_AcceptOrRejectIntervention"; -const SET_ACCEPTED_OR_REJECTED = - "Services/DoctorApplication.svc/REST/DoctorApp_AcceptOrRejectIntervention"; +const GET_STP_MASTER_LIST = "Services/DoctorApplication.svc/REST/DoctorApp_GetSTPMasterList"; -const GET_STP_MASTER_LIST = - "Services/DoctorApplication.svc/REST/DoctorApp_GetSTPMasterList"; +const DOCTOR_ER_SIGN_ASSESSMENT = "Services/DoctorApplication.svc/REST/DoctorApp_DoctorERSignAssessment"; -const DOCTOR_ER_SIGN_ASSESSMENT = - "Services/DoctorApplication.svc/REST/DoctorApp_DoctorERSignAssessment"; +const DOCTOR_SCHEDULE = "api/ScheduledSchedule/GetallSchedulebyUser"; var selectedPatientType = 1; @@ -411,26 +301,8 @@ var SERVICES_PATIANT2 = [ "List_MyReferralPatient", "patientArrivalList" ]; -var SERVICES_PATIANT_HEADER = [ - "My OutPatient", - "My InPatient", - "Discharge", - "Referred", - "Referral Discharge", - "Tomorrow", - "Referral", - "Arrival Patient" -]; -var SERVICES_PATIANT_HEADER_AR = [ - "المريض الخارجي", - "المريض المنوم", - "المريض المعافى", - "المريض المحول الي", - "المريض المحال المعافى", - "مريض الغد", - "المريض المحول مني", - "المريض الواصل" -]; +var SERVICES_PATIANT_HEADER = ["My OutPatient", "My InPatient", "Discharge", "Referred", "Referral Discharge", "Tomorrow", "Referral", "Arrival Patient"]; +var SERVICES_PATIANT_HEADER_AR = ["المريض الخارجي", "المريض المنوم", "المريض المعافى", "المريض المحول الي", "المريض المحال المعافى", "مريض الغد", "المريض المحول مني", "المريض الواصل"]; const PRIMARY_COLOR = 0xff515B5D; @@ -438,7 +310,7 @@ const TRANSACTION_NO = 0; const LANGUAGE_ID = 2; const STAMP = '2020-04-27T12:17:17.721Z'; const IP_ADDRESS = '9.9.9.9'; -const VERSION_ID = 8.3; +const VERSION_ID = 8.7; const CHANNEL = 9; const SESSION_ID = 'BlUSkYymTt'; const IS_LOGIN_FOR_DOCTOR_APP = true; @@ -450,7 +322,6 @@ const GENERAL_ID = 'Cs2020@2016\$2958'; const PATIENT_TYPE = 1; const PATIENT_TYPE_ID = 1; - /// Timer Info const TIMER_MIN = 10; @@ -459,7 +330,6 @@ class AppGlobal { static Color appRedColor = Color(0xFFD02127); static Color appGreenColor = Color(0xFF359846); static Color appTextColor = Color(0xFF2B353E); - static Color scheduleTextColor = Color(0xFF2E303A); - static Color inProgressColor = Color(0xFFCC9B14); - + static Color scheduleTextColor = Color(0xFF2E303A); + static Color inProgressColor = Color(0xFFCC9B14); } diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index c9b9a9a6..dfdcbd8e 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -800,7 +800,7 @@ const Map> localizedValues = { "open-rad": {"en": "Open Radiology Image", "ar": "فتح صور الاشعة"}, "fileNumber": {"en": "File Number: ", "ar": "رقم الملف : "}, "searchPatient-name": { - "en": "Search Name, Medical File, Phone Number", + "en": "Search Medical File, Phone Number", "ar": "اسم البحث ، الملف الطبي ، رقم الهاتف" }, "reschedule": {"en": "Reschedule", "ar": "إعادة جدولة"}, @@ -1146,4 +1146,9 @@ const Map> localizedValues = { "yourOrderAddedSuccessfully": {"en": "Your Order Added Successfully", "ar":"تم إضافة طلبك بنجاح"}, "youCannotAddOnlySpaces": {"en": "You Can't Add Only Spaces", "ar":""}, "conditionDescription": {"en": "Condition Description", "ar":"لا يمكنك إضافة مسافات فقط"}, + "doctorSchedule": {"en": "Doctor Schedule", "ar":"جدول الطبيب"}, + "doctorRota": {"en": "Doctor Rota", "ar":"دوران الطبيب"}, + "dateFrom": {"en": "Date From", "ar":"التاريخ من"}, + "searchFindSchedule": {"en": "Search and find out the doctor’s schedule ", "ar":"بحث ومعرفة جدول الطبيب"} + }; diff --git a/lib/config/shared_pref_kay.dart b/lib/config/shared_pref_kay.dart index 628f5a0e..a3656328 100644 --- a/lib/config/shared_pref_kay.dart +++ b/lib/config/shared_pref_kay.dart @@ -14,3 +14,4 @@ const DASHBOARD_DATA = 'dashboard-data'; const OTP_TYPE = 'otp-type'; const LAST_LOGIN_USER = 'last-login-user'; const CLINIC_NAME = 'clinic-name'; +const DOCTOR_SETUP_ID = 'doctor-setup-id'; diff --git a/lib/core/model/ER_sign_in/doctor_ER_sign_assessment_req_model.dart b/lib/core/model/ER_sign_in/doctor_ER_sign_assessment_req_model.dart index e1246086..b0d56669 100644 --- a/lib/core/model/ER_sign_in/doctor_ER_sign_assessment_req_model.dart +++ b/lib/core/model/ER_sign_in/doctor_ER_sign_assessment_req_model.dart @@ -1,14 +1,18 @@ class DoctorErSignAssessmentReqModel { - String? setupID; - int? signInType; - int? loginDoctorID; - int? patientID; + // String setupID; + int signInType; + int loginDoctorID; + int patientID; DoctorErSignAssessmentReqModel( - {this.setupID, this.signInType, this.loginDoctorID, this.patientID}); + { + // this.setupID, + this.signInType, + this.loginDoctorID, + this.patientID}); DoctorErSignAssessmentReqModel.fromJson(Map json) { - setupID = json['SetupID']; + // setupID = json['SetupID']; signInType = json['SignInType']; loginDoctorID = json['LoginDoctorID']; patientID = json['PatientID']; @@ -16,7 +20,7 @@ class DoctorErSignAssessmentReqModel { Map toJson() { final Map data = new Map(); - data['SetupID'] = this.setupID; + // data['SetupID'] = this.setupID; data['SignInType'] = this.signInType; data['LoginDoctorID'] = this.loginDoctorID; data['PatientID'] = this.patientID; diff --git a/lib/core/model/SOAP/assessment/post_assessment_request_model.dart b/lib/core/model/SOAP/assessment/post_assessment_request_model.dart index 0c6bd784..c71ed174 100644 --- a/lib/core/model/SOAP/assessment/post_assessment_request_model.dart +++ b/lib/core/model/SOAP/assessment/post_assessment_request_model.dart @@ -1,23 +1,29 @@ class PostAssessmentRequestModel { - int? patientMRN; - int? appointmentNo; - int? episodeId; - List? icdCodeDetails; + int patientMRN; + int appointmentNo; + int episodeId; + String createdByName; + int createdBy; + List icdCodeDetails; PostAssessmentRequestModel( {this.patientMRN, this.appointmentNo, this.episodeId, + this.createdByName, + this.createdBy, this.icdCodeDetails}); PostAssessmentRequestModel.fromJson(Map json) { patientMRN = json['PatientMRN']; appointmentNo = json['AppointmentNo']; episodeId = json['EpisodeID']; + createdByName = json['CreatedByName']; + createdBy= json['CreatedBy']; if (json['icdCodeDetails'] != null) { - icdCodeDetails = []; + icdCodeDetails = new List(); json['icdCodeDetails'].forEach((v) { - icdCodeDetails!.add(new IcdCodeDetails.fromJson(v)); + icdCodeDetails.add(new IcdCodeDetails.fromJson(v)); }); } } @@ -27,20 +33,22 @@ class PostAssessmentRequestModel { data['PatientMRN'] = this.patientMRN; data['AppointmentNo'] = this.appointmentNo; data['EpisodeID'] = this.episodeId; + data['CreatedByName'] = this.createdByName; + data['CreatedBy'] = this.createdBy; if (this.icdCodeDetails != null) { data['icdCodeDetails'] = - this.icdCodeDetails!.map((v) => v.toJson()).toList(); + this.icdCodeDetails.map((v) => v.toJson()).toList(); } return data; } } class IcdCodeDetails { - String? icdcode10Id; - int? conditionId; - int? diagnosisTypeId; - bool? complexDiagnosis; - String? remarks; + String icdcode10Id; + int conditionId; + int diagnosisTypeId; + bool complexDiagnosis; + String remarks; IcdCodeDetails( {this.icdcode10Id, diff --git a/lib/core/model/SOAP/progress_note/post_progress_note_request_model.dart b/lib/core/model/SOAP/progress_note/post_progress_note_request_model.dart index a96a9fcb..64071736 100644 --- a/lib/core/model/SOAP/progress_note/post_progress_note_request_model.dart +++ b/lib/core/model/SOAP/progress_note/post_progress_note_request_model.dart @@ -5,6 +5,8 @@ class PostProgressNoteRequestModel { String? planNote; dynamic doctorID; dynamic editedBy; + String createdByName; + int createdBy; PostProgressNoteRequestModel( {this.appointmentNo, @@ -12,7 +14,10 @@ class PostProgressNoteRequestModel { this.patientMRN, this.planNote, this.doctorID, - this.editedBy}); + this.editedBy, + this.createdByName, + this.createdBy + }); PostProgressNoteRequestModel.fromJson(Map json) { appointmentNo = json['AppointmentNo']; @@ -21,6 +26,8 @@ class PostProgressNoteRequestModel { planNote = json['PlanNote']; doctorID = json['DoctorID']; editedBy = json['EditedBy']; + createdByName = json['CreatedByName']; + createdBy = json['CreatedBy']; } Map toJson() { @@ -31,6 +38,8 @@ class PostProgressNoteRequestModel { data['PlanNote'] = this.planNote; data['DoctorID'] = this.doctorID; data['EditedBy'] = this.editedBy; + data['CreatedByName'] = this.createdByName; + data['CreatedBy'] = this.createdBy; return data; } } diff --git a/lib/core/model/admissionRequest/admission-request.dart b/lib/core/model/admissionRequest/admission-request.dart index d88d9c87..dc78f7af 100644 --- a/lib/core/model/admissionRequest/admission-request.dart +++ b/lib/core/model/admissionRequest/admission-request.dart @@ -1,190 +1,199 @@ class AdmissionRequest { - int? patientMRN; - int? admitToClinic; - bool? isPregnant; - int? pregnancyWeeks; - int? pregnancyType; - int? noOfBabies; - int? mrpDoctorID; - String? admissionDate; - int? expectedDays; - int? admissionType; - int? admissionLocationID; - int? roomCategoryID; - int? wardID; - bool? isSickLeaveRequired; - String? sickLeaveComments; - bool? isTransport; - String? transportComments; - bool? isPhysioAppointmentNeeded; - String? physioAppointmentComments; - bool? isOPDFollowupAppointmentNeeded; - String? opdFollowUpComments; - bool? isDietType; - int? dietType; - String? dietRemarks; - bool? isPhysicalActivityModification; - String? physicalActivityModificationComments; - int? orStatus; - String? mainLineOfTreatment; - int? estimatedCost; - String? elementsForImprovement; - bool? isPackagePatient; - String? complications; - String? otherDepartmentInterventions; - String? otherProcedures; - String? pastMedicalHistory; - String? pastSurgicalHistory; - List? admissionRequestDiagnoses; - List? admissionRequestProcedures; - int? appointmentNo; - int? episodeID; - int? admissionRequestNo; + int patientMRN; + int admitToClinic; + bool isPregnant; + int pregnancyWeeks; + int pregnancyType; + int noOfBabies; + int mrpDoctorID; + String admissionDate; + int expectedDays; + int admissionType; + int admissionLocationID; + int roomCategoryID; + int wardID; + bool isSickLeaveRequired; + String sickLeaveComments; + bool isTransport; + String transportComments; + bool isPhysioAppointmentNeeded; + String physioAppointmentComments; + bool isOPDFollowupAppointmentNeeded; + String opdFollowUpComments; + bool isDietType; + int dietType; + String dietRemarks; + String diagnosis; + bool isPhysicalActivityModification; + String physicalActivityModificationComments; + int orStatus; + String mainLineOfTreatment; + int estimatedCost; + String elementsForImprovement; + bool isPackagePatient; + String complications; + String otherDepartmentInterventions; + String otherProcedures; + String pastMedicalHistory; + String pastSurgicalHistory; + List admissionRequestDiagnoses; + List admissionRequestProcedures; + int appointmentNo; + int episodeID; + int admissionRequestNo; - AdmissionRequest({ - this.patientMRN, - this.admitToClinic, - this.isPregnant, - this.pregnancyWeeks, - this.pregnancyType, - this.noOfBabies, - this.mrpDoctorID, - this.admissionDate, - this.expectedDays, - this.admissionType, - this.admissionLocationID, - this.roomCategoryID, - this.wardID, - this.isSickLeaveRequired, - this.sickLeaveComments, - this.isTransport, - this.transportComments, - this.isPhysioAppointmentNeeded, - this.physioAppointmentComments, - this.isOPDFollowupAppointmentNeeded, - this.opdFollowUpComments, - this.isDietType, - this.dietType, - this.dietRemarks, - this.isPhysicalActivityModification, - this.physicalActivityModificationComments, - this.orStatus, - this.mainLineOfTreatment, - this.estimatedCost, - this.elementsForImprovement, - this.isPackagePatient, - this.complications, - this.otherDepartmentInterventions, - this.otherProcedures, - this.pastMedicalHistory, - this.pastSurgicalHistory, - this.admissionRequestDiagnoses, - this.admissionRequestProcedures, - this.appointmentNo, - this.episodeID, - this.admissionRequestNo, - }); + AdmissionRequest( + {this.patientMRN, + this.admitToClinic, + this.isPregnant, + this.pregnancyWeeks = 0, + this.pregnancyType = 0, + this.noOfBabies = 0, + this.mrpDoctorID, + this.admissionDate, + this.expectedDays, + this.admissionType, + this.admissionLocationID = 0, + this.roomCategoryID = 0, + this.wardID, + this.isSickLeaveRequired, + this.sickLeaveComments = "", + this.isTransport = false, + this.transportComments = "", + this.isPhysioAppointmentNeeded = false, + this.physioAppointmentComments = "", + this.isOPDFollowupAppointmentNeeded = false, + this.opdFollowUpComments = "", + this.isDietType, + this.dietType, + this.dietRemarks, + this.diagnosis, + this.isPhysicalActivityModification = false, + this.physicalActivityModificationComments = "", + this.orStatus = 1, + this.mainLineOfTreatment, + this.estimatedCost, + this.elementsForImprovement, + this.isPackagePatient = false, + this.complications = "", + this.otherDepartmentInterventions = "", + this.otherProcedures = "", + this.pastMedicalHistory = "", + this.pastSurgicalHistory = "", + this.admissionRequestDiagnoses, + this.admissionRequestProcedures, + this.appointmentNo, + this.episodeID, + this.admissionRequestNo}); - AdmissionRequest.fromJson(Map? json) { - if (json != null) { - patientMRN = json['patientMRN']; - admitToClinic = json['admitToClinic']; - isPregnant = json['isPregnant']; - pregnancyWeeks = json['pregnancyWeeks']; - pregnancyType = json['pregnancyType']; - noOfBabies = json['noOfBabies']; - mrpDoctorID = json['mrpDoctorID']; - admissionDate = json['admissionDate']; - expectedDays = json['expectedDays']; - admissionType = json['admissionType']; - admissionLocationID = json['admissionLocationID']; - roomCategoryID = json['roomCategoryID']; - wardID = json['wardID']; - isSickLeaveRequired = json['isSickLeaveRequired']; - sickLeaveComments = json['sickLeaveComments']; - isTransport = json['isTransport']; - transportComments = json['transportComments']; - isPhysioAppointmentNeeded = json['isPhysioAppointmentNeeded']; - physioAppointmentComments = json['physioAppointmentComments']; - isOPDFollowupAppointmentNeeded = json['isOPDFollowupAppointmentNeeded']; - opdFollowUpComments = json['opdFollowUpComments']; - isDietType = json['isDietType']; - dietType = json['dietType']; - dietRemarks = json['dietRemarks']; - isPhysicalActivityModification = - json['isPhysicalActivityModification']; - physicalActivityModificationComments = - json['physicalActivityModificationComments']; - orStatus = json['orStatus']; - mainLineOfTreatment = json['mainLineOfTreatment']; - estimatedCost = json['estimatedCost']; - elementsForImprovement = json['elementsForImprovement']; - isPackagePatient = json['isPackagePatient']; - complications = json['complications']; - otherDepartmentInterventions = json['otherDepartmentInterventions']; - otherProcedures = json['otherProcedures']; - pastMedicalHistory = json['pastMedicalHistory']; - pastSurgicalHistory = json['pastSurgicalHistory']; - if (json['admissionRequestDiagnoses'] != null) { - admissionRequestDiagnoses = List.from( - json['admissionRequestDiagnoses'], - ); - } - if (json['admissionRequestProcedures'] != null) { - admissionRequestProcedures = List.from( - json['admissionRequestProcedures'], - ); - } - appointmentNo = json['appointmentNo']; - episodeID = json['episodeID']; - admissionRequestNo = json['admissionRequestNo']; + AdmissionRequest.fromJson(Map json) { + patientMRN = json['patientMRN']; + admitToClinic = json['admitToClinic']; + isPregnant = json['isPregnant']; + pregnancyWeeks = json['pregnancyWeeks']; + pregnancyType = json['pregnancyType']; + noOfBabies = json['noOfBabies']; + mrpDoctorID = json['mrpDoctorID']; + admissionDate = json['admissionDate']; + expectedDays = json['expectedDays']; + admissionType = json['admissionType']; + admissionLocationID = json['admissionLocationID']; + roomCategoryID = json['roomCategoryID']; + wardID = json['wardID']; + isSickLeaveRequired = json['isSickLeaveRequired']; + sickLeaveComments = json['sickLeaveComments']; + isTransport = json['isTransport']; + transportComments = json['transportComments']; + isPhysioAppointmentNeeded = json['isPhysioAppointmentNeeded']; + physioAppointmentComments = json['physioAppointmentComments']; + isOPDFollowupAppointmentNeeded = json['isOPDFollowupAppointmentNeeded']; + opdFollowUpComments = json['opdFollowUpComments']; + isDietType = json['isDietType']; + dietType = json['dietType']; + dietRemarks = json['dietRemarks']; + diagnosis = json['diagnosis']; + isPhysicalActivityModification = json['isPhysicalActivityModification']; + physicalActivityModificationComments = json['physicalActivityModificationComments']; + orStatus = json['orStatus']; + mainLineOfTreatment = json['mainLineOfTreatment']; + estimatedCost = json['estimatedCost']; + elementsForImprovement = json['elementsForImprovement']; + isPackagePatient = json['isPackagePatient']; + complications = json['complications']; + otherDepartmentInterventions = json['otherDepartmentInterventions']; + otherProcedures = json['otherProcedures']; + pastMedicalHistory = json['pastMedicalHistory']; + pastSurgicalHistory = json['pastSurgicalHistory']; + if (json['admissionRequestDiagnoses'] != null) { + admissionRequestDiagnoses = new List(); + json['admissionRequestDiagnoses'].forEach((v) { + admissionRequestDiagnoses.add(v); + // admissionRequestDiagnoses + // .add(new AdmissionRequestDiagnoses.fromJson(v)); + }); } + if (json['admissionRequestProcedures'] != null) { + admissionRequestProcedures = new List(); + json['admissionRequestProcedures'].forEach((v) { + admissionRequestProcedures.add(v); + // admissionRequestProcedures + // .add(new AdmissionRequestProcedures.fromJson(v)); + }); + } + appointmentNo = json['appointmentNo']; + episodeID = json['episodeID']; + admissionRequestNo = json['admissionRequestNo']; } Map toJson() { - final Map data = {}; - data['patientMRN'] = patientMRN; - data['admitToClinic'] = admitToClinic; - data['isPregnant'] = isPregnant; - data['pregnancyWeeks'] = pregnancyWeeks; - data['pregnancyType'] = pregnancyType; - data['noOfBabies'] = noOfBabies; - data['mrpDoctorID'] = mrpDoctorID; - data['admissionDate'] = admissionDate; - data['expectedDays'] = expectedDays; - data['admissionType'] = admissionType; - data['admissionLocationID'] = admissionLocationID; - data['roomCategoryID'] = roomCategoryID; - data['wardID'] = wardID; - data['isSickLeaveRequired'] = isSickLeaveRequired; - data['sickLeaveComments'] = sickLeaveComments; - data['isTransport'] = isTransport; - data['transportComments'] = transportComments; - data['isPhysioAppointmentNeeded'] = isPhysioAppointmentNeeded; - data['physioAppointmentComments'] = physioAppointmentComments; - data['isOPDFollowupAppointmentNeeded'] = isOPDFollowupAppointmentNeeded; - data['opdFollowUpComments'] = opdFollowUpComments; - data['isDietType'] = isDietType; - data['dietType'] = dietType; - data['dietRemarks'] = dietRemarks; - data['isPhysicalActivityModification'] = isPhysicalActivityModification; - data['physicalActivityModificationComments'] = - physicalActivityModificationComments; - data['orStatus'] = orStatus; - data['mainLineOfTreatment'] = mainLineOfTreatment; - data['estimatedCost'] = estimatedCost; - data['elementsForImprovement'] = elementsForImprovement; - data['isPackagePatient'] = isPackagePatient; - data['complications'] = complications; - data['otherDepartmentInterventions'] = otherDepartmentInterventions; - data['otherProcedures'] = otherProcedures; - data['pastMedicalHistory'] = pastMedicalHistory; - data['pastSurgicalHistory'] = pastSurgicalHistory; - data['admissionRequestDiagnoses'] = admissionRequestDiagnoses; - data['admissionRequestProcedures'] = admissionRequestProcedures; - data['appointmentNo'] = appointmentNo; - data['episodeID'] = episodeID; - data['admissionRequestNo'] = admissionRequestNo; + final Map data = new Map(); + data['patientMRN'] = this.patientMRN; + data['admitToClinic'] = this.admitToClinic; + data['isPregnant'] = this.isPregnant; + data['pregnancyWeeks'] = this.pregnancyWeeks; + data['pregnancyType'] = this.pregnancyType; + data['noOfBabies'] = this.noOfBabies; + data['mrpDoctorID'] = this.mrpDoctorID; + data['admissionDate'] = this.admissionDate; + data['expectedDays'] = this.expectedDays; + data['admissionType'] = this.admissionType; + data['admissionLocationID'] = this.admissionLocationID; + data['roomCategoryID'] = this.roomCategoryID; + data['wardID'] = this.wardID; + data['isSickLeaveRequired'] = this.isSickLeaveRequired; + data['sickLeaveComments'] = this.sickLeaveComments; + data['isTransport'] = this.isTransport; + data['transportComments'] = this.transportComments; + data['isPhysioAppointmentNeeded'] = this.isPhysioAppointmentNeeded; + data['physioAppointmentComments'] = this.physioAppointmentComments; + data['isOPDFollowupAppointmentNeeded'] = this.isOPDFollowupAppointmentNeeded; + data['opdFollowUpComments'] = this.opdFollowUpComments; + data['isDietType'] = this.isDietType; + data['dietType'] = this.dietType; + data['dietRemarks'] = this.dietRemarks; + data['diagnosis'] = this.diagnosis; + data['isPhysicalActivityModification'] = this.isPhysicalActivityModification; + data['physicalActivityModificationComments'] = this.physicalActivityModificationComments; + data['orStatus'] = this.orStatus; + data['mainLineOfTreatment'] = this.mainLineOfTreatment; + data['estimatedCost'] = this.estimatedCost; + data['elementsForImprovement'] = this.elementsForImprovement; + data['isPackagePatient'] = this.isPackagePatient; + data['complications'] = this.complications; + data['otherDepartmentInterventions'] = this.otherDepartmentInterventions; + data['otherProcedures'] = this.otherProcedures; + data['pastMedicalHistory'] = this.pastMedicalHistory; + data['pastSurgicalHistory'] = this.pastSurgicalHistory; + if (this.admissionRequestDiagnoses != null) { + data['admissionRequestDiagnoses'] = this.admissionRequestDiagnoses; + // this.admissionRequestDiagnoses.map((v) => v.toJson()).toList(); + } + if (this.admissionRequestProcedures != null) { + data['admissionRequestProcedures'] = this.admissionRequestProcedures.map((v) => v.toJson()).toList(); + } + data['appointmentNo'] = this.appointmentNo; + data['episodeID'] = this.episodeID; + data['admissionRequestNo'] = this.admissionRequestNo; return data; } } diff --git a/lib/core/model/auth/check_activation_code_for_doctor_app_response_model.dart b/lib/core/model/auth/check_activation_code_for_doctor_app_response_model.dart index 949bafca..1bb10d1f 100644 --- a/lib/core/model/auth/check_activation_code_for_doctor_app_response_model.dart +++ b/lib/core/model/auth/check_activation_code_for_doctor_app_response_model.dart @@ -1,62 +1,79 @@ import 'package:doctor_app_flutter/core/model/doctor/doctor_profile_model.dart'; class CheckActivationCodeForDoctorAppResponseModel { - String? authenticationTokenID; - List? listDoctorsClinic; - List? listDoctorProfile; - MemberInformation? memberInformation; - String? vidaAuthTokenID; - String? vidaRefreshTokenID; - - CheckActivationCodeForDoctorAppResponseModel({this.authenticationTokenID, this.listDoctorsClinic, this.memberInformation, this.listDoctorProfile, this.vidaAuthTokenID, this.vidaRefreshTokenID}); - - CheckActivationCodeForDoctorAppResponseModel.fromJson(Map json) { + String authenticationTokenID; + List listDoctorsClinic; + List listDoctorProfile; + MemberInformation memberInformation; + String vidaAuthTokenID; + String vidaRefreshTokenID; + + CheckActivationCodeForDoctorAppResponseModel( + {this.authenticationTokenID, + this.listDoctorsClinic, + this.memberInformation, + this.listDoctorProfile, + this.vidaAuthTokenID, + this.vidaRefreshTokenID}); + + CheckActivationCodeForDoctorAppResponseModel.fromJson( + Map json) { authenticationTokenID = json['AuthenticationTokenID']; if (json['List_DoctorsClinic'] != null) { - listDoctorsClinic = []; + listDoctorsClinic = new List(); json['List_DoctorsClinic'].forEach((v) { - listDoctorsClinic!.add(new ListDoctorsClinic.fromJson(v)); + listDoctorsClinic.add(new ListDoctorsClinic.fromJson(v)); }); } if (json['List_DoctorProfile'] != null) { - listDoctorProfile = []; + listDoctorProfile = new List(); json['List_DoctorProfile'].forEach((v) { - listDoctorProfile!.add(new DoctorProfileModel.fromJson(v)); + listDoctorProfile.add(new DoctorProfileModel.fromJson(v)); }); } vidaAuthTokenID = json['VidaAuthTokenID']; vidaRefreshTokenID = json['VidaRefreshTokenID']; - memberInformation = json['memberInformation'] != null ? new MemberInformation.fromJson(json['memberInformation']) : null; + memberInformation = json['memberInformation'] != null + ? new MemberInformation.fromJson(json['memberInformation']) + : null; } Map toJson() { final Map data = new Map(); data['AuthenticationTokenID'] = this.authenticationTokenID; if (this.listDoctorsClinic != null) { - data['List_DoctorsClinic'] = this.listDoctorsClinic!.map((v) => v.toJson()).toList(); + data['List_DoctorsClinic'] = + this.listDoctorsClinic.map((v) => v.toJson()).toList(); } if (this.listDoctorProfile != null) { - data['List_DoctorProfile'] = this.listDoctorProfile!.map((v) => v.toJson()).toList(); + data['List_DoctorProfile'] = + this.listDoctorProfile.map((v) => v.toJson()).toList(); } if (this.memberInformation != null) { - data['memberInformation'] = this.memberInformation!.toJson(); + data['memberInformation'] = this.memberInformation.toJson(); } return data; } } class ListDoctorsClinic { - String? setupID; - int? projectID; - int? doctorID; - int? clinicID; - bool? isActive; - String? clinicName; - - ListDoctorsClinic({this.setupID, this.projectID, this.doctorID, this.clinicID, this.isActive, this.clinicName}); + String setupID; + int projectID; + int doctorID; + int clinicID; + bool isActive; + String clinicName; + + ListDoctorsClinic( + {this.setupID, + this.projectID, + this.doctorID, + this.clinicID, + this.isActive, + this.clinicName}); ListDoctorsClinic.fromJson(Map json) { setupID = json['SetupID']; @@ -80,23 +97,32 @@ class ListDoctorsClinic { } class MemberInformation { - List? clinics; - int? doctorId; - String? email; - int? employeeId; - int? memberId; - String? memberName; - String? memberNameArabic; - String? preferredLanguage; - List? roles; - - MemberInformation({this.clinics, this.doctorId, this.email, this.employeeId, this.memberId, this.memberName, this.memberNameArabic, this.preferredLanguage, this.roles}); + List clinics; + int doctorId; + String email; + int employeeId; + int memberId; + Null memberName; + Null memberNameArabic; + String preferredLanguage; + List roles; + + MemberInformation( + {this.clinics, + this.doctorId, + this.email, + this.employeeId, + this.memberId, + this.memberName, + this.memberNameArabic, + this.preferredLanguage, + this.roles}); MemberInformation.fromJson(Map json) { if (json['clinics'] != null) { - clinics = []; + clinics = new List(); json['clinics'].forEach((v) { - clinics!.add(new Clinics.fromJson(v)); + clinics.add(new Clinics.fromJson(v)); }); } doctorId = json['doctorId']; @@ -107,9 +133,9 @@ class MemberInformation { memberNameArabic = json['memberNameArabic']; preferredLanguage = json['preferredLanguage']; if (json['roles'] != null) { - roles = []; + roles = new List(); json['roles'].forEach((v) { - roles!.add(new Roles.fromJson(v)); + roles.add(new Roles.fromJson(v)); }); } } @@ -117,7 +143,7 @@ class MemberInformation { Map toJson() { final Map data = new Map(); if (this.clinics != null) { - data['clinics'] = this.clinics!.map((v) => v.toJson()).toList(); + data['clinics'] = this.clinics.map((v) => v.toJson()).toList(); } data['doctorId'] = this.doctorId; data['email'] = this.email; @@ -127,16 +153,16 @@ class MemberInformation { data['memberNameArabic'] = this.memberNameArabic; data['preferredLanguage'] = this.preferredLanguage; if (this.roles != null) { - data['roles'] = this.roles!.map((v) => v.toJson()).toList(); + data['roles'] = this.roles.map((v) => v.toJson()).toList(); } return data; } } class Clinics { - bool? defaultClinic; - int? id; - String? name; + bool defaultClinic; + int id; + String name; Clinics({this.defaultClinic, this.id, this.name}); @@ -156,8 +182,8 @@ class Clinics { } class Roles { - String? name; - int? roleId; + String name; + int roleId; Roles({this.name, this.roleId}); diff --git a/lib/core/model/dashboard/doctor_schedule.dart b/lib/core/model/dashboard/doctor_schedule.dart new file mode 100644 index 00000000..ab8cf192 --- /dev/null +++ b/lib/core/model/dashboard/doctor_schedule.dart @@ -0,0 +1,80 @@ +import 'dart:convert'; +List doctorScheduleFromJson(String str) => List.from(json.decode(str).map((x) => DoctorSchedule.fromJson(x))); + +String doctorScheduleToJson(List data) => json.encode(List.from(data.map((x) => x.toJson()))); + +class DoctorSchedule { + int scheduledid; + int status; + String clinicname; + int clinicid; + List scheduleforuser; + + DoctorSchedule({ + this.scheduledid, + this.status, + this.clinicname, + this.clinicid, + this.scheduleforuser, + }); + + factory DoctorSchedule.fromJson(Map json) => DoctorSchedule( + scheduledid: json["scheduledid"], + status: json["status"], + clinicname: json["clinicname"], + clinicid: json["clinicid"], + scheduleforuser: List.from(json["scheduleforuser"].map((x) => Scheduleforuser.fromJson(x))), + ); + + Map toJson() => { + "scheduledid": scheduledid, + "status": status, + "clinicname": clinicname, + "clinicid": clinicid, + "scheduleforuser": List.from(scheduleforuser.map((x) => x.toJson())), + }; +} + +class Scheduleforuser { + DateTime days; + int duration; + List shiftforuser; + + Scheduleforuser({ + this.days, + this.duration, + this.shiftforuser, + }); + + factory Scheduleforuser.fromJson(Map json) => Scheduleforuser( + days: DateTime.parse(json["days"]), + duration: json["duration"], + shiftforuser: List.from(json["shiftforuser"].map((x) => Shiftforuser.fromJson(x))), + ); + + Map toJson() => { + "days": days.toIso8601String(), + "duration": duration, + "shiftforuser": List.from(shiftforuser.map((x) => x.toJson())), + }; +} + +class Shiftforuser { + int fromtime; + int totime; + + Shiftforuser({ + this.fromtime, + this.totime, + }); + + factory Shiftforuser.fromJson(Map json) => Shiftforuser( + fromtime: json["fromtime"], + totime: json["totime"], + ); + + Map toJson() => { + "fromtime": fromtime, + "totime": totime, + }; +} diff --git a/lib/core/model/discharge_summary/GetDischargeSummaryReqModel.dart b/lib/core/model/discharge_summary/GetDischargeSummaryReqModel.dart index cc643e3f..e5551ff0 100644 --- a/lib/core/model/discharge_summary/GetDischargeSummaryReqModel.dart +++ b/lib/core/model/discharge_summary/GetDischargeSummaryReqModel.dart @@ -23,7 +23,7 @@ class GetDischargeSummaryReqModel { data['AdmissionNo'] = this.admissionNo; data['PatientType'] = this.patientType; data['PatientTypeID'] = this.patientTypeID; - data['SetupID'] = "010266"; + data['isDentalAllowedBackend'] = false; return data; } diff --git a/lib/core/model/doctor/clinic_model.dart b/lib/core/model/doctor/clinic_model.dart index 319a925d..4ea7636c 100644 --- a/lib/core/model/doctor/clinic_model.dart +++ b/lib/core/model/doctor/clinic_model.dart @@ -1,12 +1,25 @@ +/* + *@author: Elham Rababah + *@Date:17/5/2020 + *@param: + *@return: + *@desc: Clinic Model + */ class ClinicModel { - String? setupID; - int? projectID; - int? doctorID; - int? clinicID; - bool? isActive; - String? clinicName; + String setupID; + int projectID; + int doctorID; + int clinicID; + bool isActive; + String clinicName; - ClinicModel({this.setupID, this.projectID, this.doctorID, this.clinicID, this.isActive, this.clinicName}); + ClinicModel( + {this.setupID, + this.projectID, + this.doctorID, + this.clinicID, + this.isActive, + this.clinicName}); ClinicModel.fromJson(Map json) { setupID = json['SetupID']; diff --git a/lib/core/model/hospitals/VidaPlusProjectListModel.dart b/lib/core/model/hospitals/VidaPlusProjectListModel.dart new file mode 100644 index 00000000..e56b82db --- /dev/null +++ b/lib/core/model/hospitals/VidaPlusProjectListModel.dart @@ -0,0 +1,15 @@ +class VidaPlusProjectListModel { + int projectID; + + VidaPlusProjectListModel({this.projectID}); + + VidaPlusProjectListModel.fromJson(Map json) { + projectID = json['ProjectID']; + } + + Map toJson() { + final Map data = new Map(); + data['ProjectID'] = this.projectID; + return data; + } +} diff --git a/lib/core/model/hospitals/get_hospitals_request_model.dart b/lib/core/model/hospitals/get_hospitals_request_model.dart index 35925a80..03485aa2 100644 --- a/lib/core/model/hospitals/get_hospitals_request_model.dart +++ b/lib/core/model/hospitals/get_hospitals_request_model.dart @@ -1,15 +1,27 @@ class GetHospitalsRequestModel { - int? languageID; - String? stamp; - String? iPAdress; - double? versionID; - int? channel; - String? tokenID; - String? sessionID; - bool? isLoginForDoctorApp; - String? memberID; + int languageID; + String stamp; + String iPAdress; + double versionID; + int channel; + String tokenID; + String sessionID; + bool isLoginForDoctorApp; + String memberID; + String doctorID; - GetHospitalsRequestModel({this.languageID, this.stamp, this.iPAdress, this.versionID, this.channel, this.tokenID, this.sessionID, this.isLoginForDoctorApp, this.memberID}); + GetHospitalsRequestModel( + {this.languageID, + this.stamp, + this.iPAdress, + this.versionID, + this.channel, + this.tokenID, + this.sessionID, + this.isLoginForDoctorApp, + this.memberID, + this.doctorID, + }); GetHospitalsRequestModel.fromJson(Map json) { languageID = json['LanguageID']; @@ -21,6 +33,7 @@ class GetHospitalsRequestModel { sessionID = json['SessionID']; isLoginForDoctorApp = json['IsLoginForDoctorApp']; memberID = json['MemberID']; + doctorID = json['DoctorID']; } Map toJson() { @@ -34,6 +47,7 @@ class GetHospitalsRequestModel { data['SessionID'] = this.sessionID; data['IsLoginForDoctorApp'] = this.isLoginForDoctorApp; data['MemberID'] = this.memberID; + data['DoctorID'] = this.doctorID; return data; } } diff --git a/lib/core/model/labs/patient_lab_orders.dart b/lib/core/model/labs/patient_lab_orders.dart index fa58d491..d4d621b0 100644 --- a/lib/core/model/labs/patient_lab_orders.dart +++ b/lib/core/model/labs/patient_lab_orders.dart @@ -1,43 +1,42 @@ import 'package:doctor_app_flutter/utils/date-utils.dart'; class PatientLabOrders { - int? actualDoctorRate; - String? clinicDescription; - String? clinicDescriptionEnglish; - dynamic clinicDescriptionN; - int? clinicID; - int? doctorID; - String? doctorImageURL; - String? doctorName; - String? doctorNameEnglish; - dynamic doctorNameN; - int? doctorRate; - String? doctorTitle; - int? gender; - String? genderDescription; - String? invoiceNo; - bool? isActiveDoctorProfile; - bool? isDoctorAllowVedioCall; - bool? isExecludeDoctor; - bool? isInOutPatient; - String? isInOutPatientDescription; - String? isInOutPatientDescriptionN; - bool? isRead; - String? nationalityFlagURL; - int? noOfPatientsRate; - DateTime? orderDate; - DateTime? createdOn; - String? orderNo; - String? patientID; - String? projectID; - String? projectName; - dynamic projectNameN; - String? qR; - String? setupID; - List? speciality; - bool? isLiveCareAppointment; - - + int actualDoctorRate; + String clinicDescription; + String clinicDescriptionEnglish; + Null clinicDescriptionN; + int clinicID; + int doctorID; + String doctorImageURL; + String doctorName; + String doctorNameEnglish; + Null doctorNameN; + int doctorRate; + String doctorTitle; + int gender; + String genderDescription; + String invoiceNo; + bool isActiveDoctorProfile; + bool isDoctorAllowVedioCall; + bool isExecludeDoctor; + bool isInOutPatient; + String isInOutPatientDescription; + String isInOutPatientDescriptionN; + bool isRead; + String nationalityFlagURL; + int noOfPatientsRate; + DateTime orderDate; + DateTime createdOn; + String orderNo; + String patientID; + String projectID; + String projectName; + Null projectNameN; + String qR; + String setupID; + List speciality; + bool isLiveCareAppointment; + String invoiceType; PatientLabOrders( {this.actualDoctorRate, this.clinicDescription, @@ -72,7 +71,9 @@ class PatientLabOrders { this.qR, this.setupID, this.speciality, - this.isLiveCareAppointment}); + this.isLiveCareAppointment, + this.invoiceType + }); PatientLabOrders.fromJson(Map json) { actualDoctorRate = json['ActualDoctorRate']; @@ -109,6 +110,7 @@ class PatientLabOrders { qR = json['QR']; setupID = json['SetupID']; isLiveCareAppointment = json['IsLiveCareAppointment']; + invoiceType = json["InvoiceType"]; // speciality = json['Speciality'].cast(); } @@ -148,16 +150,17 @@ class PatientLabOrders { data['SetupID'] = this.setupID; data['Speciality'] = this.speciality; data['IsLiveCareAppointment'] = this.isLiveCareAppointment; + data['InvoiceType'] = this.invoiceType; return data; } } class PatientLabOrdersList { String filterName = ""; - List patientLabOrdersList = []; + List patientLabOrdersList = List(); PatientLabOrdersList( - {required this.filterName, PatientLabOrders? patientDoctorAppointment}) { - patientLabOrdersList.add(patientDoctorAppointment!); + {this.filterName, PatientLabOrders patientDoctorAppointment}) { + patientLabOrdersList.add(patientDoctorAppointment); } } diff --git a/lib/core/model/patient/get_doctor_by_clinic_id_request.dart b/lib/core/model/patient/get_doctor_by_clinic_id_request.dart index 351f19f7..2dff34a5 100644 --- a/lib/core/model/patient/get_doctor_by_clinic_id_request.dart +++ b/lib/core/model/patient/get_doctor_by_clinic_id_request.dart @@ -1,16 +1,17 @@ class DoctorsByClinicIdRequest { - int? clinicID; - int? projectID; - bool? continueDentalPlan; - bool? isSearchAppointmnetByClinicID; - int? patientID; - int? gender; - bool? isGetNearAppointment; - bool? isVoiceCommand; - int? latitude; - int? longitude; - bool? license; - bool? isDentalAllowedBackend; + int clinicID; + int projectID; + bool continueDentalPlan; + bool isSearchAppointmnetByClinicID; + int patientID; + int doctorID; + int gender; + bool isGetNearAppointment; + bool isVoiceCommand; + int latitude; + int longitude; + bool license; + bool isDentalAllowedBackend; DoctorsByClinicIdRequest({ this.clinicID, @@ -18,6 +19,7 @@ class DoctorsByClinicIdRequest { this.continueDentalPlan = false, this.isSearchAppointmnetByClinicID = true, this.patientID, + this.doctorID, this.gender, this.isGetNearAppointment = false, this.isVoiceCommand = true, @@ -30,6 +32,7 @@ class DoctorsByClinicIdRequest { DoctorsByClinicIdRequest.fromJson(Map json) { clinicID = json['ClinicID']; projectID = json['ProjectID']; + doctorID = json['DoctorID']; continueDentalPlan = json['ContinueDentalPlan']; isSearchAppointmnetByClinicID = json['IsSearchAppointmnetByClinicID']; patientID = json['PatientID']; @@ -49,6 +52,7 @@ class DoctorsByClinicIdRequest { data['ContinueDentalPlan'] = this.continueDentalPlan; data['IsSearchAppointmnetByClinicID'] = this.isSearchAppointmnetByClinicID; data['PatientID'] = this.patientID; + data['DoctorID'] = this.doctorID; data['gender'] = this.gender; data['IsGetNearAppointment'] = this.isGetNearAppointment; data['IsVoiceCommand'] = this.isVoiceCommand; diff --git a/lib/core/model/patient/patiant_info_model.dart b/lib/core/model/patient/patiant_info_model.dart index b1002e6c..af04e752 100644 --- a/lib/core/model/patient/patiant_info_model.dart +++ b/lib/core/model/patient/patiant_info_model.dart @@ -227,7 +227,7 @@ class PatiantInformtion { endTime = json['endTime']; episodeNo = json['episodeNo'] ?? json['EpisodeID'] ?? json['EpisodeNo']; fallRiskScore = json['fallRiskScore']; - isSigned = json['isSigned']; + isSigned = json['IsSigned']; medicationOrders = json['medicationOrders']; nationality = json['nationality'] ?? json['NationalityNameN']; patientMRN = json['patientMRN'] ?? diff --git a/lib/core/model/patient/vital_sign/patient-vital-sign-data.dart b/lib/core/model/patient/vital_sign/patient-vital-sign-data.dart index 89c17946..25104d07 100644 --- a/lib/core/model/patient/vital_sign/patient-vital-sign-data.dart +++ b/lib/core/model/patient/vital_sign/patient-vital-sign-data.dart @@ -1,36 +1,35 @@ class VitalSignData { - int? appointmentNo; - int? bloodPressureCuffLocation; - int? bloodPressureCuffSize; - int? bloodPressureHigher; - int? bloodPressureLower; - int? bloodPressurePatientPosition; - dynamic bodyMassIndex; - int? fio2; - int? headCircumCm; - dynamic heightCm; - int? idealBodyWeightLbs; - bool? isPainManagementDone; - bool? isVitalsRequired; - int? leanBodyWeightLbs; - String? painCharacter; - String? painDuration; - String? painFrequency; - String? painLocation; - int? painScore; - int? patientMRN; - int? patientType; - int? pulseBeatPerMinute; - int? pulseRhythm; - int? respirationBeatPerMinute; - int? respirationPattern; - int? sao2; - int? status; - dynamic temperatureCelcius; - int? temperatureCelciusMethod; - dynamic waistSizeInch; - dynamic weightKg; - + int appointmentNo; + int bloodPressureCuffLocation; + int bloodPressureCuffSize; + int bloodPressureHigher; + int bloodPressureLower; + int bloodPressurePatientPosition; + var bodyMassIndex; + int fio2; + int headCircumCm; + var heightCm; + int idealBodyWeightLbs; + bool isPainManagementDone; + bool isVitalsRequired; + int leanBodyWeightLbs; + String painCharacter; + String painDuration; + String painFrequency; + String painLocation; + int painScore; + int patientMRN; + int patientType; + int pulseBeatPerMinute; + int pulseRhythm; + num respirationBeatPerMinute; + int respirationPattern; + int sao2; + int status; + var temperatureCelcius; + int temperatureCelciusMethod; + var waistSizeInch; + var weightKg; VitalSignData( {this.appointmentNo, diff --git a/lib/core/model/pharmacy-intervention-model/intervention_medication_history_res_model.dart b/lib/core/model/pharmacy-intervention-model/intervention_medication_history_res_model.dart index 88eeb952..e753ad62 100644 --- a/lib/core/model/pharmacy-intervention-model/intervention_medication_history_res_model.dart +++ b/lib/core/model/pharmacy-intervention-model/intervention_medication_history_res_model.dart @@ -1,21 +1,21 @@ class InterventionMedicationHistoryResModel { - String? setupId; - String? projectId; - int? patientId; - int? admissionNo; - int? prescriptionId; - int? orderNo; - int? id; - int? interventionId; + String setupId; + String projectId; + int patientId; + int admissionNo; + int prescriptionId; + int orderNo; + int id; + int interventionId; dynamic intervention; - String? remark; - int? commentedBy; - bool? isDoctor; - bool? isActive; - int? createdBy; - String? createdByName; - String? createdByNameN; - String? createdOn; + String remark; + int commentedBy; + bool isDoctor; + bool isActive; + int createdBy; + String createdByName; + String createdByNameN; + String createdOn; dynamic editedBy; dynamic editedByName; dynamic editedByNameN; diff --git a/lib/core/model/procedure/categories_procedure.dart b/lib/core/model/procedure/categories_procedure.dart index 8fb38586..525cfe42 100644 --- a/lib/core/model/procedure/categories_procedure.dart +++ b/lib/core/model/procedure/categories_procedure.dart @@ -58,7 +58,7 @@ class EntityList { this.subGroup, this.template, this.remarks, - this.type}); + this.type ='1'}); EntityList.fromJson(Map json) { allowedClinic = json['allowedClinic']; diff --git a/lib/core/model/radiology/final_radiology.dart b/lib/core/model/radiology/final_radiology.dart index 8f5b8a5c..f5fae7c6 100644 --- a/lib/core/model/radiology/final_radiology.dart +++ b/lib/core/model/radiology/final_radiology.dart @@ -6,19 +6,20 @@ class FinalRadiology { dynamic patientID; dynamic invoiceLineItemNo; dynamic invoiceNo; + dynamic invoiceNo_VP; dynamic doctorID; dynamic clinicID; - DateTime? orderDate; - DateTime? reportDate; + DateTime orderDate; + DateTime reportDate; dynamic reportData; dynamic imageURL; dynamic procedureID; dynamic appodynamicmentNo; dynamic dIAPacsURL; - bool? isRead; + bool isRead; dynamic readOn; var admissionNo; - bool? isInOutPatient; + bool isInOutPatient; dynamic actualDoctorRate; dynamic clinicDescription; dynamic dIAPACSURL; @@ -28,8 +29,8 @@ class FinalRadiology { dynamic doctorTitle; dynamic gender; dynamic genderDescription; - bool? isActiveDoctorProfile; - bool? isExecludeDoctor; + bool isActiveDoctorProfile; + bool isExecludeDoctor; dynamic isInOutPatientDescription; dynamic isInOutPatientDescriptionN; dynamic nationalityFlagURL; @@ -39,17 +40,19 @@ class FinalRadiology { dynamic qR; dynamic reportDataHTML; dynamic reportDataTextdynamic; - List? speciality; - bool? isCVI; - bool? isRadMedicalReport; - bool? isLiveCareAppodynamicment; - + List speciality; + bool isCVI; + bool isRadMedicalReport; + bool isLiveCareAppodynamicment; + bool isRecordFromVidaPlus; + String invoiceType; FinalRadiology( {this.setupID, this.projectID, this.patientID, this.invoiceLineItemNo, this.invoiceNo, + this.invoiceNo_VP, this.doctorID, this.clinicID, this.orderDate, @@ -86,7 +89,7 @@ class FinalRadiology { this.speciality, this.isCVI, this.isRadMedicalReport, - this.isLiveCareAppodynamicment}); + this.isLiveCareAppodynamicment, this.isRecordFromVidaPlus, this.invoiceType}); FinalRadiology.fromJson(Map json) { try { @@ -95,6 +98,7 @@ class FinalRadiology { patientID = json['PatientID']; invoiceLineItemNo = json['InvoiceLineItemNo']; invoiceNo = json['InvoiceNo']; + invoiceNo_VP = json['InvoiceNo_VP']; doctorID = json['DoctorID']; clinicID = json['ClinicID']; orderDate = AppDateUtils.convertStringToDate(json['OrderDate']); @@ -132,6 +136,8 @@ class FinalRadiology { // speciality = json['Speciality'].cast(); isCVI = json['isCVI']; isRadMedicalReport = json['isRadMedicalReport']; + isRecordFromVidaPlus = json['IsRecordFromVidaPlus']; + invoiceType = json["InvoiceType"]; } catch (e) { print(e); } @@ -144,6 +150,7 @@ class FinalRadiology { data['PatientID'] = this.patientID; data['InvoiceLineItemNo'] = this.invoiceLineItemNo; data['InvoiceNo'] = this.invoiceNo; + data['InvoiceNo_VP'] = this.invoiceNo_VP; data['DoctorID'] = this.doctorID; data['ClinicID'] = this.clinicID; data['OrderDate'] = this.orderDate; @@ -179,15 +186,17 @@ class FinalRadiology { data['Speciality'] = this.speciality; data['isCVI'] = this.isCVI; data['isRadMedicalReport'] = this.isRadMedicalReport; + data['IsRecordFromVidaPlus'] = this.isRecordFromVidaPlus; + data["InvoiceType"] =invoiceType; return data; } } class FinalRadiologyList { dynamic filterName = ""; - List finalRadiologyList = []; + List finalRadiologyList = List(); - FinalRadiologyList({this.filterName, FinalRadiology? finalRadiology}) { - finalRadiologyList.add(finalRadiology!); + FinalRadiologyList({this.filterName, FinalRadiology finalRadiology}) { + finalRadiologyList.add(finalRadiology); } } diff --git a/lib/core/model/sick_leave/sick_leave_patient_model.dart b/lib/core/model/sick_leave/sick_leave_patient_model.dart index 26c87b93..525ad448 100644 --- a/lib/core/model/sick_leave/sick_leave_patient_model.dart +++ b/lib/core/model/sick_leave/sick_leave_patient_model.dart @@ -9,6 +9,7 @@ class SickLeavePatientModel { dynamic requestDate; dynamic sickLeaveDays; dynamic appointmentNo; + dynamic appointmentNO; dynamic admissionNo; dynamic actualDoctorRate; dynamic appointmentDate; @@ -98,7 +99,7 @@ class SickLeavePatientModel { requestNo = json['RequestNo']; requestDate = json['RequestDate']; sickLeaveDays = json['SickLeaveDays']; - appointmentNo = json['AppointmentNo']; + appointmentNo = (json['AppointmentNo'] ==null ? json['appointmentNo'] : json['AppointmentNo']); admissionNo = json['AdmissionNo']; actualDoctorRate = json['ActualDoctorRate']; appointmentDate = json['AppointmentDate']; diff --git a/lib/core/model/vte_assessment/vte_assessment_req_model.dart b/lib/core/model/vte_assessment/vte_assessment_req_model.dart index dda08133..2b9dee59 100644 --- a/lib/core/model/vte_assessment/vte_assessment_req_model.dart +++ b/lib/core/model/vte_assessment/vte_assessment_req_model.dart @@ -4,7 +4,7 @@ class VteAssessmentRequestModel { int? transactionNo; VteAssessmentRequestModel( - {this.setupID = "010266", this.parameterGroup = 7, this.transactionNo}); + {this.setupID, this.parameterGroup = 7, this.transactionNo}); VteAssessmentRequestModel.fromJson(Map json) { setupID = json['SetupID']; diff --git a/lib/core/service/AnalyticsService.dart b/lib/core/service/AnalyticsService.dart index ffb4d84a..b2290299 100644 --- a/lib/core/service/AnalyticsService.dart +++ b/lib/core/service/AnalyticsService.dart @@ -3,14 +3,13 @@ import 'package:firebase_analytics/observer.dart'; import 'package:flutter/cupertino.dart'; class AnalyticsService { - final FirebaseAnalytics _analytics = FirebaseAnalytics.instance; + // final FirebaseAnalytics _analytics = FirebaseAnalytics(); + static FirebaseAnalyticsObserver observer = FirebaseAnalyticsObserver(analytics: analytics); + static FirebaseAnalytics analytics = FirebaseAnalytics.instance; + FirebaseAnalyticsObserver getAnalyticsObserver() => FirebaseAnalyticsObserver(analytics: analytics); - FirebaseAnalyticsObserver getAnalyticsObserver() => - FirebaseAnalyticsObserver(analytics: _analytics); - - Future logEvent( - {required String eventCategory, required String eventAction}) async { - await _analytics.logEvent(name: 'event', parameters: { + Future logEvent({@required String eventCategory, @required String eventAction}) async { + await analytics.logEvent(name: 'event', parameters: { "eventCategory": eventCategory, "eventAction": eventAction, }); diff --git a/lib/core/service/VideoCallService.dart b/lib/core/service/VideoCallService.dart index 98823ece..0aa770ca 100644 --- a/lib/core/service/VideoCallService.dart +++ b/lib/core/service/VideoCallService.dart @@ -17,8 +17,8 @@ import '../../routes.dart'; import 'NavigationService.dart'; class VideoCallService extends BaseService { - StartCallRes? startCallRes; - PatiantInformtion? patient; + StartCallRes startCallRes; + PatiantInformtion patient; LiveCarePatientServices _liveCarePatientServices = locator(); @@ -34,21 +34,23 @@ class VideoCallService extends BaseService { await getDoctorProfile(isGetProfile: true); await VideoChannel.openVideoCallScreen( // TODO MOSA TEST - kToken: startCallRes!.openTokenID, - kSessionId: startCallRes!.openSessionID, kApiKey: '46209962', - // kToken: "T1==cGFydG5lcl9pZD00NzI0Nzk1NCZzaWc9NGUyZjgxMjFlYTFkNzU5NjcxNDY2ZTM2ZjM3YTVhNTI2NGY0NTI2NzpzZXNzaW9uX2lkPTJfTVg0ME56STBOemsxTkg1LU1UWXlOVGN5TmpnMk5qZzNOMzQ1YUhCcGRtcDFXbVpDTDFkNE1qbDRkWFY2TTA4cmIySi1mZyZjcmVhdGVfdGltZT0xNjI1NzI2ODg5Jm5vbmNlPTAuNjc2Nzc4OTQxNjA1MTMxNSZyb2xlPXB1Ymxpc2hlciZleHBpcmVfdGltZT0xNjI4MzE4ODg4JmluaXRpYWxfbGF5b3V0X2NsYXNzX2xpc3Q9", - // kSessionId: "2_MX40NzI0Nzk1NH5-MTYyNTcyNjg2Njg3N345aHBpdmp1WmZCL1d4Mjl4dXV6M08rb2J-fg", - // kApiKey:'47247954', - vcId: patient!.vcId!, + + kToken: startCallRes.openTokenID, + kSessionId: startCallRes.openSessionID, + // + // kToken: "T1==cGFydG5lcl9pZD00NjIwOTk2MiZzaWc9NzE0MGE4YzM0ZTU2YjQ5NmQzOTgwOTNkYmU1NzEzMmQxYTdkMDliZTpzZXNzaW9uX2lkPTFfTVg0ME5qSXdPVGsyTW41LU1UWTVNakkxTkRjMU1EUTRObjVCVFZsM2MwODFNV1ZhTjFsUlEyZGxiRFZxZVZjNWNHMS1mbjQmY3JlYXRlX3RpbWU9MTY5MjI1NDc1MCZub25jZT0wLjY5OTQyNzkzMTg1NDg4NSZyb2xlPW1vZGVyYXRvciZleHBpcmVfdGltZT0xNjkyMjU2NTUwJmluaXRpYWxfbGF5b3V0X2NsYXNzX2xpc3Q9", + // kSessionId: "1_MX40NjIwOTk2Mn5-MTY5MjI1NDc1MDQ4Nn5BTVl3c081MWVaN1lRQ2dlbDVqeVc5cG1-fn4", + + vcId: patient.vcId, isRecording: isRecording, - patientName: patient!.fullName ?? - (patient!.firstName != null - ? "${patient!.firstName} ${patient!.lastName}" + patientName: patient.fullName ?? + (patient.firstName != null + ? "${patient.firstName} ${patient.lastName}" : "-"), tokenID: await sharedPref.getString(TOKEN), generalId: GENERAL_ID, - doctorId: doctorProfile.doctorID!, + doctorId: doctorProfile.doctorID, onFailure: (String error) { DrAppToastMsg.showErrorToast(error); }, @@ -57,13 +59,13 @@ class VideoCallService extends BaseService { onCallEnd: () { WidgetsBinding.instance.addPostFrameCallback((_) async { GifLoaderDialogUtils.showMyDialog( - locator().navigatorKey.currentContext!); + locator().navigatorKey.currentContext); endCall( - patient!.vcId!, + patient.vcId, false, ).then((value) { GifLoaderDialogUtils.hideDialog( - locator().navigatorKey.currentContext!); + locator().navigatorKey.currentContext); if (hasError) { DrAppToastMsg.showErrorToast(error); } else @@ -77,13 +79,13 @@ class VideoCallService extends BaseService { onCallNotRespond: (SessionStatusModel sessionStatusModel) { WidgetsBinding.instance.addPostFrameCallback((_) { GifLoaderDialogUtils.showMyDialog( - locator().navigatorKey.currentContext!); + locator().navigatorKey.currentContext); endCall( - patient!.vcId!, + patient.vcId, sessionStatusModel.sessionStatus == 3, ).then((value) { GifLoaderDialogUtils.hideDialog( - locator().navigatorKey.currentContext!); + locator().navigatorKey.currentContext); if (hasError) { DrAppToastMsg.showErrorToast(error); } else { @@ -101,7 +103,7 @@ class VideoCallService extends BaseService { hasError = false; await getDoctorProfile(isGetProfile: true); EndCallReq endCallReq = new EndCallReq(); - endCallReq.doctorId = doctorProfile!.doctorID; + endCallReq.doctorId = doctorProfile.doctorID; endCallReq.generalid = 'Cs2020@2016\$2958'; endCallReq.vCID = vCID; endCallReq.isDestroy = isPatient; diff --git a/lib/core/service/authentication_service.dart b/lib/core/service/authentication_service.dart index 0c1b743c..b25dbcc6 100644 --- a/lib/core/service/authentication_service.dart +++ b/lib/core/service/authentication_service.dart @@ -16,7 +16,7 @@ class AuthenticationService extends BaseService { List _imeiDetails = []; List get dashboardItemsList => _imeiDetails; - late NewLoginInformationModel _loginInfo; + NewLoginInformationModel _loginInfo = NewLoginInformationModel(); NewLoginInformationModel get loginInfo => _loginInfo; SendActivationCodeForDoctorAppResponseModel _activationCodeVerificationScreenRes = SendActivationCodeForDoctorAppResponseModel(); @@ -29,7 +29,7 @@ class AuthenticationService extends BaseService { CheckActivationCodeForDoctorAppResponseModel _checkActivationCodeForDoctorAppRes = CheckActivationCodeForDoctorAppResponseModel(); CheckActivationCodeForDoctorAppResponseModel get checkActivationCodeForDoctorAppRes => _checkActivationCodeForDoctorAppRes; - late Map _insertDeviceImeiRes; + Map _insertDeviceImeiRes = {}; List _doctorProfilesList = []; @@ -45,10 +45,10 @@ class AuthenticationService extends BaseService { }, onFailure: (String error, int statusCode) { hasError = true; super.error = error; - }, body: {"IMEI": imei, "TokenID": "@dm!n"}); + }, body: {"IMEI": imei}); } catch (error) { hasError = true; - super.error = error.toString(); + super.error = error; } } @@ -64,7 +64,7 @@ class AuthenticationService extends BaseService { }, body: userInfo.toJson()); } catch (error) { hasError = true; - super.error = error.toString(); + super.error = error; } } @@ -80,7 +80,7 @@ class AuthenticationService extends BaseService { }, body: activationCodeModel.toJson()); } catch (error) { hasError = true; - super.error = error.toString(); + super.error = error; } } @@ -96,7 +96,7 @@ class AuthenticationService extends BaseService { }, body: activationCodeModel.toJson()); } catch (error) { hasError = true; - super.error = error.toString(); + super.error = error; } } @@ -106,13 +106,13 @@ class AuthenticationService extends BaseService { try { await baseAppClient.post(CHECK_ACTIVATION_CODE_FOR_DOCTOR_APP, onSuccess: (dynamic response, int statusCode) { _checkActivationCodeForDoctorAppRes = CheckActivationCodeForDoctorAppResponseModel.fromJson(response); - }, onFailure: (String? error, int statusCode) { + }, onFailure: (String error, int statusCode) { hasError = true; super.error = error; }, body: checkActivationCodeRequestModel.toJson()); } catch (error) { hasError = true; - super.error = error.toString(); + super.error = error; } } @@ -128,7 +128,7 @@ class AuthenticationService extends BaseService { }, body: insertIMEIDetailsModel.toJson()); } catch (error) { hasError = true; - super.error = error.toString(); + super.error = error; } } @@ -146,7 +146,7 @@ class AuthenticationService extends BaseService { }, body: profileReqModel.toJson()); } catch (error) { hasError = true; - super.error = error.toString(); + super.error = error; } } } diff --git a/lib/core/service/base/lookup-service.dart b/lib/core/service/base/lookup-service.dart index d630f07a..f1e086a1 100644 --- a/lib/core/service/base/lookup-service.dart +++ b/lib/core/service/base/lookup-service.dart @@ -55,10 +55,11 @@ class LookupService extends BaseService { List listOfAdmissionType = []; List listOfDiagnosisSelectionTypes = []; - Future getMasterLookup(MasterKeysService masterKeys) async { + Future getMasterLookup(MasterKeysService masterKeys, {String searchKey = ""}) async { hasError = false; Map body = { - "MasterInput": masterKeys.getMasterKeyService() + "MasterInput": masterKeys.getMasterKeyService(), + "SearchKey": searchKey }; await baseAppClient.post(GET_MASTER_LOOKUP_LIST, onSuccess: (dynamic response, int statusCode) { diff --git a/lib/core/service/home/dasboard_service.dart b/lib/core/service/home/dasboard_service.dart index 4d837753..27b5ee57 100644 --- a/lib/core/service/home/dasboard_service.dart +++ b/lib/core/service/home/dasboard_service.dart @@ -2,11 +2,13 @@ import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/core/service/base/base_service.dart'; import 'package:doctor_app_flutter/core/model/dashboard/dashboard_model.dart'; +import '../../model/dashboard/doctor_schedule.dart'; + class DashboardService extends BaseService { List _dashboardItemsList = []; List get dashboardItemsList => _dashboardItemsList; - + bool hasVirtualClinic = false; String? sServiceID; diff --git a/lib/core/service/home/schedule_service.dart b/lib/core/service/home/schedule_service.dart index f884516f..c0167592 100644 --- a/lib/core/service/home/schedule_service.dart +++ b/lib/core/service/home/schedule_service.dart @@ -3,13 +3,17 @@ import 'package:doctor_app_flutter/core/service/base/base_service.dart'; import 'package:doctor_app_flutter/core/model/doctor/list_doctor_working_hours_table_model.dart'; import 'package:doctor_app_flutter/core/model/doctor/request_schedule.dart'; +import '../../../config/shared_pref_kay.dart'; +import '../../model/dashboard/doctor_schedule.dart'; + class ScheduleService extends BaseService { List get listDoctorWorkingHoursTable => _listDoctorWorkingHoursTable; List _listDoctorWorkingHoursTable = []; RequestSchedule _requestSchedule = RequestSchedule(); - + List _doctorRota= []; + List get doctorRotation => _doctorRota; Future getDoctorSchedule() async { await baseAppClient.post(GET_DOCTOR_WORKING_HOURS_TABLE, onSuccess: (dynamic response, int statusCode) { @@ -23,4 +27,23 @@ class ScheduleService extends BaseService { super.error = error; }, body: _requestSchedule.toJson(), isFallLanguage: true); } + + + Future getDoctorRota(String fromDate, String toDate,{int pageNo = 1}) async{ + hasError = false; + String doctorId = '7826'; //await sharedPref.getString(DOCTOR_ID); + String url = DOCTOR_SCHEDULE + '?userid='+doctorId+'&fromDate='+fromDate+'&toDate='+toDate+'&pagenumber='+pageNo.toString()+'&pagesize=10'; + await baseAppClient.get( endPoint: url, onSuccess: (dynamic response, int statusCode) { + _doctorRota =[]; + + response['response'].forEach((res){ + _doctorRota.add(DoctorSchedule.fromJson(res)); + }); + print(_doctorRota); + }, onFailure: (String error, int statusCode) { + print(error); + }, + + ); + } } diff --git a/lib/core/service/hospitals/hospitals_service.dart b/lib/core/service/hospitals/hospitals_service.dart index efa24209..09e5a365 100644 --- a/lib/core/service/hospitals/hospitals_service.dart +++ b/lib/core/service/hospitals/hospitals_service.dart @@ -1,10 +1,12 @@ import 'package:doctor_app_flutter/config/config.dart'; +import 'package:doctor_app_flutter/core/model/hospitals/VidaPlusProjectListModel.dart'; import 'package:doctor_app_flutter/core/model/hospitals/get_hospitals_request_model.dart'; import 'package:doctor_app_flutter/core/model/hospitals/get_hospitals_response_model.dart'; import 'package:doctor_app_flutter/core/service/base/base_service.dart'; class HospitalsService extends BaseService { - List hospitals = []; + List hospitals = List(); + List vidaPlusProjectListModel = List(); Future getHospitals(GetHospitalsRequestModel getHospitalsRequestModel) async { hasError = false; @@ -15,6 +17,12 @@ class HospitalsService extends BaseService { response['ProjectInfo'].forEach((hospital) { hospitals.add(GetHospitalsResponseModel.fromJson(hospital)); }); + vidaPlusProjectListModel.clear(); + if (response['ProjectListVidaPlus'].length != 0) { + response['ProjectListVidaPlus'].forEach((item) { + vidaPlusProjectListModel.add(VidaPlusProjectListModel.fromJson(item)); + }); + } }, onFailure: (String error, int statusCode) { hasError = true; diff --git a/lib/core/service/patient/out_patient_service.dart b/lib/core/service/patient/out_patient_service.dart index 74db4453..81a939e7 100644 --- a/lib/core/service/patient/out_patient_service.dart +++ b/lib/core/service/patient/out_patient_service.dart @@ -8,8 +8,7 @@ class OutPatientService extends BaseService { List get patientList => _patientList; - Future getOutPatient( - PatientSearchRequestModel patientSearchRequestModel) async { + Future getOutPatient(PatientSearchRequestModel patientSearchRequestModel) async { hasError = false; await baseAppClient.post( GET_MY_OUT_PATIENT, @@ -27,8 +26,7 @@ class OutPatientService extends BaseService { ); } - Future getPatientFileInformation( - PatientSearchRequestModel patientSearchRequestModel) async { + Future getPatientFileInformation(PatientSearchRequestModel patientSearchRequestModel) async { hasError = false; await baseAppClient.post( PRM_SEARCH_PATIENT, diff --git a/lib/core/service/patient/patient-doctor-referral-service.dart b/lib/core/service/patient/patient-doctor-referral-service.dart index 62ffe818..d379d47d 100644 --- a/lib/core/service/patient/patient-doctor-referral-service.dart +++ b/lib/core/service/patient/patient-doctor-referral-service.dart @@ -114,6 +114,7 @@ class PatientReferralService extends LookupService { _doctorsByClinicIdRequest.clinicID = clinicId; _doctorsByClinicIdRequest.patientID = patient.patientId; _doctorsByClinicIdRequest.gender = patient.gender; + _doctorsByClinicIdRequest.doctorID = 0; await baseAppClient.postPatient(PATIENT_GET_DOCTOR_BY_CLINIC_Hospital, onSuccess: (dynamic response, int statusCode) { diff --git a/lib/core/service/patient_medical_file/ER_signin/ER_signin_service.dart b/lib/core/service/patient_medical_file/ER_signin/ER_signin_service.dart index b16a932f..4d953350 100644 --- a/lib/core/service/patient_medical_file/ER_signin/ER_signin_service.dart +++ b/lib/core/service/patient_medical_file/ER_signin/ER_signin_service.dart @@ -1,23 +1,46 @@ import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/core/model/ER_sign_in/doctor_ER_sign_assessment_req_model.dart'; +import 'package:doctor_app_flutter/core/model/Prescriptions/Prescriptions.dart'; +import 'package:doctor_app_flutter/core/model/Prescriptions/get_medication_for_inpatient_model.dart'; +import 'package:doctor_app_flutter/core/model/Prescriptions/get_medication_for_inpatient_request_model.dart'; +import 'package:doctor_app_flutter/core/model/Prescriptions/perscription_pharmacy.dart'; +import 'package:doctor_app_flutter/core/model/Prescriptions/post_prescrition_req_model.dart'; +import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_entity_model.dart'; +import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_in_patient.dart'; +import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_model.dart'; +import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_report.dart'; +import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_report_enh.dart'; +import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_req_model.dart'; +import 'package:doctor_app_flutter/core/model/Prescriptions/prescriptions_order.dart'; +import 'package:doctor_app_flutter/core/model/Prescriptions/request_get_list_pharmacy_for_prescriptions.dart'; +import 'package:doctor_app_flutter/core/model/Prescriptions/request_prescription_report.dart'; +import 'package:doctor_app_flutter/core/model/Prescriptions/request_prescription_report_enh.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/Allergy/get_allergies_res_model.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/Assessment/get_assessment_res_model.dart'; +import 'package:doctor_app_flutter/core/model/calculate_box_request_model.dart'; +import 'package:doctor_app_flutter/core/model/search_drug/get_medication_response_model.dart'; +import 'package:doctor_app_flutter/core/model/search_drug/item_by_medicine_request_model.dart'; +import 'package:doctor_app_flutter/core/model/search_drug/search_drug_model.dart'; +import 'package:doctor_app_flutter/core/model/search_drug/search_drug_request_model.dart'; import 'package:doctor_app_flutter/core/service/base/lookup-service.dart'; - +import 'package:doctor_app_flutter/core/model/SOAP/Assessment/get_assessment_req_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/vital_sign/patient-vital-sign-data.dart'; +import 'package:doctor_app_flutter/utils/date-utils.dart'; +import 'package:flutter/cupertino.dart'; class ERSignInService extends LookupService { - Future signInERPatient({DoctorErSignAssessmentReqModel? doctorErSignAssessmentReqModel}) async { - - + Future signInERPatient({DoctorErSignAssessmentReqModel doctorErSignAssessmentReqModel}) async { hasError = false; - await baseAppClient.post(DOCTOR_ER_SIGN_ASSESSMENT, onSuccess: (dynamic response, int statusCode) { }, onFailure: (String error, int statusCode) { hasError = true; super.error = error; - }, body: doctorErSignAssessmentReqModel!.toJson()); + }, body: doctorErSignAssessmentReqModel.toJson()); } } diff --git a/lib/core/service/patient_medical_file/lab_order/labs_service.dart b/lib/core/service/patient_medical_file/lab_order/labs_service.dart index 9fae9580..0e0e99c0 100644 --- a/lib/core/service/patient_medical_file/lab_order/labs_service.dart +++ b/lib/core/service/patient_medical_file/lab_order/labs_service.dart @@ -13,8 +13,8 @@ import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import '../../base/base_service.dart'; class LabsService extends BaseService { - List patientLabOrdersList = []; - List _allSpecialLab = []; + List patientLabOrdersList = List(); + List _allSpecialLab = List(); List get allSpecialLab => _allSpecialLab; @@ -28,7 +28,7 @@ class LabsService extends BaseService { String url = ""; if (isInpatient) { await getDoctorProfile(); - body['ProjectID'] = doctorProfile!.projectID; + body['ProjectID'] = doctorProfile.projectID; url = GET_PATIENT_LAB_OREDERS; } else { body['isDentalAllowedBackend'] = false; @@ -58,18 +58,18 @@ class LabsService extends BaseService { RequestPatientLabSpecialResult _requestPatientLabSpecialResult = RequestPatientLabSpecialResult(); - List patientLabSpecialResult =[]; - List labResultList = []; - List labOrdersResultsList = []; - List labOrdersResultHistoryList = []; + List patientLabSpecialResult = List(); + List labResultList = List(); + List labOrdersResultsList = List(); + List labOrdersResultHistoryList = List(); Future getLaboratoryResult( - {String? projectID, - int? clinicID, - String? invoiceNo, - String? orderNo, - PatiantInformtion? patient, - bool? isInpatient = false}) async { + {String projectID, + int clinicID, + String invoiceNo, + String orderNo, + PatiantInformtion patient, + bool isInpatient = false}) async { hasError = false; Map body = Map(); @@ -80,7 +80,7 @@ class LabsService extends BaseService { body = _requestPatientLabSpecialResult.toJson(); await baseAppClient.postPatient(GET_Patient_LAB_SPECIAL_RESULT, - patient: patient!, onSuccess: (dynamic response, int statusCode) { + patient: patient, onSuccess: (dynamic response, int statusCode) { patientLabSpecialResult.clear(); response['ListPLSR'].forEach((hospital) { @@ -93,9 +93,9 @@ class LabsService extends BaseService { } Future getPatientLabResult( - {PatientLabOrders? patientLabOrder, - PatiantInformtion? patient, - bool isInpatient = false}) async { + {PatientLabOrders patientLabOrder, + PatiantInformtion patient, + bool isInpatient}) async { hasError = false; String url = ""; @@ -106,14 +106,14 @@ class LabsService extends BaseService { } Map body = Map(); - body['InvoiceNo'] = patientLabOrder!.invoiceNo; + body['InvoiceNo'] = patientLabOrder.invoiceNo; body['OrderNo'] = patientLabOrder.orderNo; body['isDentalAllowedBackend'] = false; body['SetupID'] = patientLabOrder.setupID; body['ProjectID'] = patientLabOrder.projectID; body['ClinicID'] = patientLabOrder.clinicID ?? 0; - - await baseAppClient.postPatient(url, patient: patient!, + body['InvoiceType'] = patientLabOrder.invoiceType ??""; + await baseAppClient.postPatient(url, patient: patient, onSuccess: (dynamic response, int statusCode) { patientLabSpecialResult = []; labResultList = []; @@ -138,9 +138,9 @@ class LabsService extends BaseService { } Future getPatientLabOrdersResults( - {PatientLabOrders? patientLabOrder, - String? procedure, - PatiantInformtion? patient}) async { + {PatientLabOrders patientLabOrder, + String procedure, + PatiantInformtion patient}) async { hasError = false; Map body = Map(); if (patientLabOrder != null) { @@ -153,7 +153,7 @@ class LabsService extends BaseService { body['isDentalAllowedBackend'] = false; body['Procedure'] = procedure; await baseAppClient.postPatient(GET_Patient_LAB_ORDERS_RESULT, - patient: patient!, onSuccess: (dynamic response, int statusCode) { + patient: patient, onSuccess: (dynamic response, int statusCode) { labOrdersResultsList.clear(); response['ListPLR'].forEach((lab) { labOrdersResultsList.add(LabOrderResult.fromJson(lab)); @@ -167,7 +167,7 @@ class LabsService extends BaseService { RequestSendLabReportEmail _requestSendLabReportEmail = RequestSendLabReportEmail(); - Future sendLabReportEmail({PatientLabOrders? patientLabOrder}) async { + Future sendLabReportEmail({PatientLabOrders patientLabOrder}) async { // _requestSendLabReportEmail.projectID = patientLabOrder.projectID; // _requestSendLabReportEmail.invoiceNo = patientLabOrder.invoiceNo; // _requestSendLabReportEmail.doctorName = patientLabOrder.doctorName; @@ -192,9 +192,9 @@ class LabsService extends BaseService { } Future getPatientLabOrdersResultHistoryByDescription( - {PatientLabOrders? patientLabOrder, - String? procedureDescription, - PatiantInformtion? patient}) async { + {PatientLabOrders patientLabOrder, + String procedureDescription, + PatiantInformtion patient}) async { hasError = false; Map body = Map(); if (patientLabOrder != null) { @@ -206,7 +206,7 @@ class LabsService extends BaseService { body['ProcedureDescription'] = procedureDescription; await baseAppClient.postPatient( GET_PATIENT_LAB_ORDERS_RESULT_HISTORY_BY_DESCRIPTION, - patient: patient!, onSuccess: (dynamic response, int statusCode) { + patient: patient, onSuccess: (dynamic response, int statusCode) { labOrdersResultHistoryList.clear(); response['ListGeneralResultHistory'].forEach((lab) { labOrdersResultHistoryList.add(LabResultHistory.fromJson(lab)); @@ -217,7 +217,7 @@ class LabsService extends BaseService { }, body: body); } - Future getAllSpecialLabResult({int? mrn}) async { + Future getAllSpecialLabResult({int mrn}) async { _allSpecialLabResultRequestModel = AllSpecialLabResultRequestModel( patientID: mrn, patientType: 1, diff --git a/lib/core/service/patient_medical_file/prescription/medicine_service.dart b/lib/core/service/patient_medical_file/prescription/medicine_service.dart index cd61e783..567fd556 100644 --- a/lib/core/service/patient_medical_file/prescription/medicine_service.dart +++ b/lib/core/service/patient_medical_file/prescription/medicine_service.dart @@ -19,12 +19,12 @@ class MedicineService extends BaseService { PharmaciesListRequestModel _listRequestModel = PharmaciesListRequestModel(); Future getMedicineItem(String itemName) async { + _pharmacyItemsList.clear(); _itemsRequestModel.pHRItemName = itemName; searchText = itemName; await baseAppClient.post( PHARMACY_ITEMS_URL, onSuccess: (dynamic response, int statusCode) { - _pharmacyItemsList.clear(); _pharmacyItemsList = response['ListPharmcy_Region_enh']; }, onFailure: (String error, int statusCode) { diff --git a/lib/core/service/patient_medical_file/radiology/radiology_service.dart b/lib/core/service/patient_medical_file/radiology/radiology_service.dart index a554b7d2..1dca2462 100644 --- a/lib/core/service/patient_medical_file/radiology/radiology_service.dart +++ b/lib/core/service/patient_medical_file/radiology/radiology_service.dart @@ -1,27 +1,24 @@ import 'package:doctor_app_flutter/config/config.dart'; -import 'package:doctor_app_flutter/core/model/radiology/final_radiology.dart'; import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/radiology/final_radiology.dart'; import 'package:flutter/cupertino.dart'; import '../../base/base_service.dart'; class RadiologyService extends BaseService { - List finalRadiologyList =[]; + List finalRadiologyList = List(); String url = ''; + bool isRadiologyVIDAPlus = false; - Future getRadImageURL( - {required int invoiceNo, - required int lineItem, - required int projectId, - required PatiantInformtion patient}) async { + Future getRadImageURL({int invoiceNo, int lineItem, int projectId, bool isVidaPlus, @required PatiantInformtion patient,String invoiceType}) async { hasError = false; final Map body = new Map(); - body['InvoiceNo'] = invoiceNo; + body['InvoiceNo'] = isVidaPlus ? "0" : invoiceNo; + body['InvoiceNo_VP'] = isVidaPlus ? invoiceNo : "0"; body['LineItemNo'] = lineItem; body['ProjectID'] = projectId; - - await baseAppClient.postPatient(GET_RAD_IMAGE_URL, patient: patient, - onSuccess: (dynamic response, int statusCode) { + body["InvoiceType"] = invoiceType; + await baseAppClient.postPatient(GET_RAD_IMAGE_URL, patient: patient, onSuccess: (dynamic response, int statusCode) { url = response['Data']; }, onFailure: (String error, int statusCode) { hasError = true; @@ -29,8 +26,7 @@ class RadiologyService extends BaseService { }, body: body); } - Future getPatientRadOrders(PatiantInformtion patient, - {isInPatient = false}) async { + Future getPatientRadOrders(PatiantInformtion patient, {isInPatient = false}) async { String url = GET_PATIENT_ORDERS; final Map body = new Map(); if (isInPatient) { @@ -39,19 +35,29 @@ class RadiologyService extends BaseService { } finalRadiologyList.clear(); hasError = false; - await baseAppClient.postPatient(url, patient: patient, - onSuccess: (dynamic response, int statusCode) { + await baseAppClient.postPatient(url, patient: patient, onSuccess: (dynamic response, int statusCode) { finalRadiologyList = []; String label = "ListRAD"; if (isInPatient) { label = "List_GetRadOreders"; } - if (response[label] == null || response[label].length == 0) { - label = "FinalRadiologyList"; + if (response['FinalRadiologyList'] != null && response['FinalRadiologyList'].length != 0) { + isRadiologyVIDAPlus = false; + response['FinalRadiologyList'].forEach((radiology) { + finalRadiologyList.add(FinalRadiology.fromJson(radiology)); + }); + } else { + isRadiologyVIDAPlus = true; + response['FinalRadiologyListAPI'].forEach((radiology) { + finalRadiologyList.add(FinalRadiology.fromJson(radiology)); + }); } - response[label].forEach((radiology) { - finalRadiologyList.add(FinalRadiology.fromJson(radiology)); - }); + // if (response[label] == null || response[label].length == 0) { + // label = "FinalRadiologyList"; + // } + // response[label].forEach((radiology) { + // finalRadiologyList.add(FinalRadiology.fromJson(radiology)); + // }); }, onFailure: (String error, int statusCode) { hasError = true; super.error = error; diff --git a/lib/core/service/patient_medical_file/sick_leave/sickleave_service.dart b/lib/core/service/patient_medical_file/sick_leave/sickleave_service.dart index e7068c9e..54fdb631 100644 --- a/lib/core/service/patient_medical_file/sick_leave/sickleave_service.dart +++ b/lib/core/service/patient_medical_file/sick_leave/sickleave_service.dart @@ -100,6 +100,7 @@ class SickLeaveService extends BaseService { onSuccess: (dynamic response, int statusCode) { // Future.value(response); getAllSickLeavePatient = []; + getAllSickLeavePatient.clear(); response['List_SickLeave'].forEach((v) { getAllSickLeavePatient.add(SickLeavePatientModel.fromJson(v)); }); diff --git a/lib/core/service/pending_order_service.dart b/lib/core/service/pending_order_service.dart index ead87a74..8f148f21 100644 --- a/lib/core/service/pending_order_service.dart +++ b/lib/core/service/pending_order_service.dart @@ -6,19 +6,28 @@ import 'package:doctor_app_flutter/core/model/pending_orders/pending_order_reque import 'package:doctor_app_flutter/core/model/pending_orders/pending_orders_model.dart'; class PendingOrderService extends BaseService { - List _pendingOrderList = []; + List _pendingOrderList = List(); List get pendingOrderList => _pendingOrderList; - List _admissionOrderList = []; + List _admissionOrderList = List(); List get admissionOrderList => _admissionOrderList; - Future getPendingOrders({PendingOrderRequestModel? pendingOrderRequestModel, int? patientId, int? admissionNo}) async { - pendingOrderRequestModel = PendingOrderRequestModel(patientID: patientId, admissionNo: admissionNo, patientTypeID: 1, patientType: 1, setupID: "010266"); + Future getPendingOrders( + {PendingOrderRequestModel pendingOrderRequestModel, + int patientId, + int admissionNo}) async { + pendingOrderRequestModel = PendingOrderRequestModel( + patientID: patientId, + admissionNo: admissionNo, + patientTypeID: 1, + patientType: 1, + ); hasError = false; - await baseAppClient.post(GET_PENDING_ORDERS, onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(GET_PENDING_ORDERS, + onSuccess: (dynamic response, int statusCode) { print("Success"); _pendingOrderList.clear(); response['List_PendingOrders'].forEach( @@ -32,11 +41,20 @@ class PendingOrderService extends BaseService { }, body: pendingOrderRequestModel.toJson()); } - Future getAdmissionOrders({AdmissionOrdersRequestModel? admissionOrdersRequestModel, int? patientId, int? admissionNo}) async { - admissionOrdersRequestModel = AdmissionOrdersRequestModel(patientID: patientId, admissionNo: admissionNo, patientTypeID: 1, patientType: 1, setupID: "010266"); + Future getAdmissionOrders( + {AdmissionOrdersRequestModel admissionOrdersRequestModel, + int patientId, + int admissionNo}) async { + admissionOrdersRequestModel = AdmissionOrdersRequestModel( + patientID: patientId, + admissionNo: admissionNo, + patientTypeID: 1, + patientType: 1, + ); hasError = false; - await baseAppClient.post(GET_ADMISSION_ORDERS, onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(GET_ADMISSION_ORDERS, + onSuccess: (dynamic response, int statusCode) { print("Success"); //admissionOrderList.clear(); response['List_AdmissionOrders'].forEach( diff --git a/lib/core/viewModel/ER_sign_in/ER_sign_in_view_model.dart b/lib/core/viewModel/ER_sign_in/ER_sign_in_view_model.dart index f76c55a5..f1e9104f 100644 --- a/lib/core/viewModel/ER_sign_in/ER_sign_in_view_model.dart +++ b/lib/core/viewModel/ER_sign_in/ER_sign_in_view_model.dart @@ -1,27 +1,37 @@ +import 'package:doctor_app_flutter/core/enum/filter_type.dart'; import 'package:doctor_app_flutter/core/enum/view_state.dart'; import 'package:doctor_app_flutter/core/model/ER_sign_in/doctor_ER_sign_assessment_req_model.dart'; +import 'package:doctor_app_flutter/core/model/Prescriptions/Prescriptions.dart'; +import 'package:doctor_app_flutter/core/model/Prescriptions/get_medication_for_inpatient_model.dart'; +import 'package:doctor_app_flutter/core/model/Prescriptions/perscription_pharmacy.dart'; +import 'package:doctor_app_flutter/core/model/Prescriptions/post_prescrition_req_model.dart'; +import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_entity_model.dart'; +import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_model.dart'; +import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_report.dart'; +import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_report_enh.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/Allergy/get_allergies_res_model.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/Assessment/get_assessment_res_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/vital_sign/patient-vital-sign-data.dart'; import 'package:doctor_app_flutter/core/service/patient_medical_file/ER_signin/ER_signin_service.dart'; +import 'package:doctor_app_flutter/core/service/patient_medical_file/prescription/prescription_service.dart'; import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart'; import 'package:doctor_app_flutter/locator.dart'; +import 'package:flutter/cupertino.dart'; class ERSignInViewModel extends BaseViewModel { bool hasError = false; ERSignInService _ERSignInService = locator(); - Future signInERPatient({int? patientId, int? signInType}) async { + Future signInERPatient({int patientId, int signInType}) async { hasError = false; await getDoctorProfile(); - DoctorErSignAssessmentReqModel doctorErSignAssessmentReqModel = new DoctorErSignAssessmentReqModel( - setupID: "010266", - signInType: signInType, - loginDoctorID: doctorProfile!.doctorID, - patientID: patientId, - ); + DoctorErSignAssessmentReqModel doctorErSignAssessmentReqModel = new DoctorErSignAssessmentReqModel(signInType: signInType, loginDoctorID: doctorProfile.doctorID, patientID: patientId); setState(ViewState.BusyLocal); await _ERSignInService.signInERPatient(doctorErSignAssessmentReqModel: doctorErSignAssessmentReqModel); if (_ERSignInService.hasError) { - error = _ERSignInService.error!; + error = _ERSignInService.error; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); diff --git a/lib/core/viewModel/SOAP_view_model.dart b/lib/core/viewModel/SOAP_view_model.dart index c46bb9c3..866321fe 100644 --- a/lib/core/viewModel/SOAP_view_model.dart +++ b/lib/core/viewModel/SOAP_view_model.dart @@ -79,7 +79,7 @@ class SOAPViewModel extends BaseViewModel { List get patientAssessmentList => _SOAPService.patientAssessmentList; - int get episodeID => _SOAPService.episodeID!; + int get episodeID => _SOAPService.episodeID; bool isAddProgress = true; bool isAddExamInProgress = true; @@ -98,52 +98,52 @@ class SOAPViewModel extends BaseViewModel { List get allMedicationList => _prescriptionService.allMedicationList; - SubjectiveCallBack? subjectiveCallBack; + SubjectiveCallBack subjectiveCallBack; setSubjectiveCallBack(SubjectiveCallBack callBack) { this.subjectiveCallBack = callBack; } nextOnSubjectPage(model) { - subjectiveCallBack!.nextFunction(model); + subjectiveCallBack.nextFunction(model); } - ObjectiveCallBack? objectiveCallBack; + ObjectiveCallBack objectiveCallBack; setObjectiveCallBack(ObjectiveCallBack callBack) { this.objectiveCallBack = callBack; } nextOnObjectivePage(model) { - objectiveCallBack!.nextFunction(model); + objectiveCallBack.nextFunction(model); } - AssessmentCallBack? assessmentCallBack; + AssessmentCallBack assessmentCallBack; setAssessmentCallBack(AssessmentCallBack callBack) { this.assessmentCallBack = callBack; } nextOnAssessmentPage(model) { - assessmentCallBack!.nextFunction(model); + assessmentCallBack.nextFunction(model); } - PlanCallBack? planCallBack; + PlanCallBack planCallBack; setPlanCallBack(PlanCallBack callBack) { this.planCallBack = callBack; } nextOnPlanPage(model) { - planCallBack!.nextFunction(model); + planCallBack.nextFunction(model); } - Future getMasterLookup(MasterKeysService masterKeys, {bool isBusyLocal = false}) async { + Future getMasterLookup(MasterKeysService masterKeys, {bool isBusyLocal = false, String searchKey = ""}) async { if (isBusyLocal) { setState(ViewState.Busy); } else setState(ViewState.Busy); - await _SOAPService.getMasterLookup(masterKeys); + await _SOAPService.getMasterLookup(masterKeys, searchKey: searchKey); if (_SOAPService.hasError) { error = _SOAPService.error; setState(ViewState.Error); @@ -251,7 +251,7 @@ class SOAPViewModel extends BaseViewModel { String allergiesString = ''; patientAllergiesList.forEach((element) { MasterKeyModel selectedAllergy = getOneMasterKey(masterKeys: MasterKeysService.Allergies, id: element.allergyDiseaseId, typeId: element.allergyDiseaseType); - if (selectedAllergy != null && element.isChecked!) allergiesString += (isArabic ? selectedAllergy.nameAr : selectedAllergy.nameEn)! + ' , '; + if (selectedAllergy != null && element.isChecked) allergiesString += (isArabic ? selectedAllergy.nameAr : selectedAllergy.nameEn) + ' , '; }); return allergiesString; } @@ -268,8 +268,8 @@ class SOAPViewModel extends BaseViewModel { patientInfo.appointmentNo.toString(), ), ); - if (patientInfo.admissionNo != null && patientInfo.admissionNo!.isNotEmpty) - getPhysicalExamReqModel.admissionNo = int.parse(patientInfo.admissionNo!); + if (patientInfo.admissionNo != null && patientInfo.admissionNo.isNotEmpty) + getPhysicalExamReqModel.admissionNo = int.parse(patientInfo.admissionNo); else getPhysicalExamReqModel.admissionNo = 0; setState(ViewState.Busy); @@ -303,7 +303,7 @@ class SOAPViewModel extends BaseViewModel { Future getEpisodeForInpatient(PatiantInformtion patient) async { setState(ViewState.BusyLocal); - GetEpisodeForInpatientReqModel getEpisodeForInpatientReqModel = GetEpisodeForInpatientReqModel(patientID: patient.patientId, admissionNo: int.parse(patient.admissionNo!), patientTypeID: 1); + GetEpisodeForInpatientReqModel getEpisodeForInpatientReqModel = GetEpisodeForInpatientReqModel(patientID: patient.patientId, admissionNo: int.parse(patient.admissionNo), patientTypeID: 1); await _SOAPService.getEpisodeForInpatient(getEpisodeForInpatientReqModel); if (_SOAPService.hasError) { error = _SOAPService.error; @@ -315,7 +315,7 @@ class SOAPViewModel extends BaseViewModel { } // ignore: missing_return - MasterKeyModel getOneMasterKey({required MasterKeysService masterKeys, dynamic id, int? typeId}) { + MasterKeyModel getOneMasterKey({@required MasterKeysService masterKeys, dynamic id, int typeId}) { switch (masterKeys) { case MasterKeysService.Allergies: List result = allergiesList.where((element) { @@ -406,35 +406,12 @@ class SOAPViewModel extends BaseViewModel { return result.first; } break; - - case MasterKeysService.physiotherapyGoals: - break; - case MasterKeysService.TemperatureMethods: - break; - case MasterKeysService.Speciality: - break; - case MasterKeysService.MedicationStrength: - break; - case MasterKeysService.MedicationDuration: - break; - case MasterKeysService.MedicationRoute: - break; - case MasterKeysService.MedicationFrequency: - break; - case MasterKeysService.MedicationDoseTime: - break; - case MasterKeysService.MedicationIndications: - break; - case MasterKeysService.AdmissionRequestType: - break; - case MasterKeysService.DiagnosisSelectionType: break; } - return MasterKeyModel(); } int getFirstIndexForOldExamination(List mySelectedExamination) { - Iterable examList = mySelectedExamination.where((element) => !element.isLocal!); + Iterable examList = mySelectedExamination.where((element) => !element.isLocal); if (examList.length > 0) { return mySelectedExamination.indexOf(examList.first); @@ -444,7 +421,7 @@ class SOAPViewModel extends BaseViewModel { onUpdateSubjectStepStart(PatiantInformtion patientInfo) async { GetChiefComplaintReqModel getChiefComplaintReqModel = GetChiefComplaintReqModel( - admissionNo: patientInfo.admissionNo != null ? int.parse(patientInfo.admissionNo!) : null, + admissionNo: patientInfo.admissionNo != null ? int.parse(patientInfo.admissionNo) : null, patientMRN: patientInfo.patientMRN, appointmentNo: patientInfo.appointmentNo != null ? int.parse(patientInfo.appointmentNo.toString()) : null, episodeId: patientInfo.episodeNo, @@ -564,15 +541,15 @@ class SOAPViewModel extends BaseViewModel { final results = await Future.wait(services ?? []); if (_SOAPService.hasError || _prescriptionService.hasError) { - error = _SOAPService.error! + _prescriptionService.error!; + error = _SOAPService.error + _prescriptionService.error; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); } - callAddAssessmentLookupsServices({bool allowSetState = true}) async { + callAddAssessmentLookupsServices({String searchKey = "", bool allowSetState = true}) async { if (allowSetState) setState(ViewState.Busy); - dynamic services; + var services; if (listOfDiagnosisCondition.length == 0) { if (services == null) { services = [_SOAPService.getMasterLookup(MasterKeysService.DiagnosisCondition)]; @@ -589,9 +566,9 @@ class SOAPViewModel extends BaseViewModel { } if (listOfICD10.length == 0) { if (services == null) { - services = [_SOAPService.getMasterLookup(MasterKeysService.ICD10)]; + services = [_SOAPService.getMasterLookup(MasterKeysService.ICD10, searchKey: searchKey)]; } else { - services.add(_SOAPService.getMasterLookup(MasterKeysService.ICD10)); + services.add(_SOAPService.getMasterLookup(MasterKeysService.ICD10, searchKey: searchKey)); } } @@ -607,14 +584,7 @@ class SOAPViewModel extends BaseViewModel { onUpdateAssessmentStepStart(PatiantInformtion patientInfo) async { GetAssessmentReqModel getAssessmentReqModel = GetAssessmentReqModel( - patientMRN: patientInfo.patientMRN!, - episodeID: patientInfo.episodeNo.toString(), - editedBy: '', - doctorID: '', - appointmentNo: int.parse( - patientInfo.appointmentNo.toString(), - ), - ); + patientMRN: patientInfo.patientMRN, episodeID: patientInfo.episodeNo.toString(), editedBy: '', doctorID: '', appointmentNo: int.parse(patientInfo.appointmentNo.toString())); var services = [_SOAPService.getPatientAssessment(getAssessmentReqModel)]; @@ -631,22 +601,11 @@ class SOAPViewModel extends BaseViewModel { setState(ViewState.Idle); } - postSubjectServices({ - patientInfo, - String? complaintsText, - String? medicationText, - String? illnessText, - List? myHistoryList, - List? myAllergiesList, - }) async { + postSubjectServices({patientInfo, String complaintsText, String medicationText, String illnessText, List myHistoryList, List myAllergiesList}) async { var services; - PostChiefComplaintRequestModel postChiefComplaintRequestModel = createPostChiefComplaintRequestModel( - patientInfo: patientInfo, - illnessText: illnessText!, - medicationText: medicationText!, - complaintsText: complaintsText!, - ); + PostChiefComplaintRequestModel postChiefComplaintRequestModel = + createPostChiefComplaintRequestModel(patientInfo: patientInfo, illnessText: illnessText, medicationText: medicationText, complaintsText: complaintsText); if (patientChiefComplaintList.isEmpty) { postChiefComplaintRequestModel.editedBy = ''; services = [_SOAPService.postChiefComplaint(postChiefComplaintRequestModel)]; @@ -655,7 +614,7 @@ class SOAPViewModel extends BaseViewModel { services = [_SOAPService.patchChiefComplaint(postChiefComplaintRequestModel)]; } - if (myHistoryList!.length != 0) { + if (myHistoryList.length != 0) { PostHistoriesRequestModel postHistoriesRequestModel = createPostHistoriesRequestModel(patientInfo: patientInfo, myHistoryList: myHistoryList); if (patientHistoryList.isEmpty) { @@ -665,7 +624,7 @@ class SOAPViewModel extends BaseViewModel { } } - if (myAllergiesList!.length != 0) { + if (myAllergiesList.length != 0) { PostAllergyRequestModel postAllergyRequestModel = createPostAllergyRequestModel(myAllergiesList: myAllergiesList, patientInfo: patientInfo); if (patientAllergiesList.isEmpty) { services.add(_SOAPService.postAllergy(postAllergyRequestModel)); @@ -683,12 +642,7 @@ class SOAPViewModel extends BaseViewModel { setState(ViewState.Idle); } - PostChiefComplaintRequestModel createPostChiefComplaintRequestModel({ - patientInfo, - String? complaintsText, - String? medicationText, - String? illnessText, - }) { + PostChiefComplaintRequestModel createPostChiefComplaintRequestModel({patientInfo, String complaintsText, String medicationText, String illnessText}) { return new PostChiefComplaintRequestModel( admissionNo: patientInfo.admissionNo != null ? int.parse(patientInfo.admissionNo) : null, patientMRN: patientInfo.patientMRN, @@ -703,17 +657,17 @@ class SOAPViewModel extends BaseViewModel { numberOfWeeks: 0); } - PostHistoriesRequestModel createPostHistoriesRequestModel({patientInfo, List? myHistoryList}) { + PostHistoriesRequestModel createPostHistoriesRequestModel({patientInfo, List myHistoryList}) { PostHistoriesRequestModel postHistoriesRequestModel = new PostHistoriesRequestModel(doctorID: ''); - myHistoryList!.forEach((history) { + myHistoryList.forEach((history) { if (postHistoriesRequestModel.listMedicalHistoryVM == null) postHistoriesRequestModel.listMedicalHistoryVM = []; - postHistoriesRequestModel.listMedicalHistoryVM!.add(ListMedicalHistoryVM( + postHistoriesRequestModel.listMedicalHistoryVM.add(ListMedicalHistoryVM( patientMRN: patientInfo.patientMRN, episodeId: patientInfo.episodeNo, appointmentNo: patientInfo.appointmentNo, remarks: "", - historyId: history.selectedHistory!.id, - historyType: history.selectedHistory!.typeId, + historyId: history.selectedHistory.id, + historyType: history.selectedHistory.typeId, isChecked: history.isChecked, )); }); @@ -725,7 +679,7 @@ class SOAPViewModel extends BaseViewModel { PostAllergyRequestModel postAllergyRequestModel = new PostAllergyRequestModel(); myAllergiesList.forEach((allergy) { if (postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM == null) postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM = []; - postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM!.add(ListHisProgNotePatientAllergyDiseaseVM( + postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM.add(ListHisProgNotePatientAllergyDiseaseVM( allergyDiseaseId: allergy.selectedAllergy.id, allergyDiseaseType: allergy.selectedAllergy.typeId, patientMRN: patientInfo.patientMRN, @@ -733,9 +687,9 @@ class SOAPViewModel extends BaseViewModel { appointmentNo: patientInfo.appointmentNo, severity: allergy.selectedAllergySeverity.id, remarks: allergy.remark, - createdBy: allergy.createdBy ?? doctorProfile!.doctorID, + createdBy: allergy.createdBy ?? doctorProfile.doctorID, createdOn: DateTime.now().toIso8601String(), - editedBy: doctorProfile!.doctorID!, + editedBy: doctorProfile.doctorID, editedOn: DateTime.now().toIso8601String(), isChecked: allergy.isChecked, isUpdatedByNurse: false)); diff --git a/lib/core/viewModel/authentication_view_model.dart b/lib/core/viewModel/authentication_view_model.dart index 0c135dd9..aec315c8 100644 --- a/lib/core/viewModel/authentication_view_model.dart +++ b/lib/core/viewModel/authentication_view_model.dart @@ -15,6 +15,7 @@ import 'package:doctor_app_flutter/core/model/doctor/clinic_model.dart'; import 'package:doctor_app_flutter/core/model/doctor/doctor_profile_model.dart'; import 'package:doctor_app_flutter/core/model/doctor/profile_req_Model.dart'; import 'package:doctor_app_flutter/core/model/doctor/user_model.dart'; +import 'package:doctor_app_flutter/core/model/hospitals/VidaPlusProjectListModel.dart'; import 'package:doctor_app_flutter/core/model/hospitals/get_hospitals_request_model.dart'; import 'package:doctor_app_flutter/core/model/hospitals/get_hospitals_response_model.dart'; import 'package:doctor_app_flutter/core/service/authentication_service.dart'; @@ -26,8 +27,11 @@ import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; import 'package:doctor_app_flutter/utils/utils.dart'; import 'package:firebase_messaging/firebase_messaging.dart'; import 'package:flutter/services.dart'; +import 'package:local_auth/auth_strings.dart'; + +// import 'package:huawei_hmsavailability/huawei_hmsavailability.dart'; +// import 'package:local_auth/auth_strings.dart'; import 'package:local_auth/local_auth.dart'; -import 'package:local_auth_ios/local_auth_ios.dart'; enum APP_STATUS { LOADING, UNAUTHENTICATED, AUTHENTICATED, UNVERIFIED } @@ -49,13 +53,14 @@ class AuthenticationViewModel extends BaseViewModel { CheckActivationCodeForDoctorAppResponseModel get checkActivationCodeForDoctorAppRes => _authService.checkActivationCodeForDoctorAppRes; - NewLoginInformationModel? loggedUser; + List get vidaPlusProjectList => _hospitalsService.vidaPlusProjectListModel; - GetIMEIDetailsModel? user; + NewLoginInformationModel loggedUser; + GetIMEIDetailsModel user; UserModel userInfo = UserModel(); final LocalAuthentication auth = LocalAuthentication(); - List? _availableBiometrics; + List _availableBiometrics; final FirebaseMessaging _firebaseMessaging = FirebaseMessaging.instance; bool isLogin = false; @@ -63,6 +68,7 @@ class AuthenticationViewModel extends BaseViewModel { bool isFromLogin = false; APP_STATUS appStatus = APP_STATUS.LOADING; String localToken = ""; + bool isHuawei = false; AuthenticationViewModel({bool checkDeviceInfo = false}) { getDeviceInfoFromFirebase(); @@ -76,11 +82,13 @@ class AuthenticationViewModel extends BaseViewModel { if (data != null) { user = GetIMEIDetailsModel.fromJson(data); } + var profileInfo = await sharedPref.getObj(DOCTOR_PROFILE); + profileInfo['IMEI'] = token; profileInfo['LogInTypeID'] = await sharedPref.getInt(OTP_TYPE); profileInfo['BioMetricEnabled'] = true; - profileInfo['MobileNo'] = loggedIn != null ? loggedIn['MobileNumber'] : user!.mobile; + profileInfo['MobileNo'] = loggedIn != null ? loggedIn['MobileNumber'] : user.mobile; InsertIMEIDetailsModel insertIMEIDetailsModel = InsertIMEIDetailsModel.fromJson(profileInfo); insertIMEIDetailsModel.genderDescription = profileInfo['Gender_Description']; insertIMEIDetailsModel.genderDescriptionN = profileInfo['Gender_DescriptionN']; @@ -88,12 +96,12 @@ class AuthenticationViewModel extends BaseViewModel { insertIMEIDetailsModel.titleDescription = profileInfo['Title_Description']; insertIMEIDetailsModel.titleDescriptionN = profileInfo['Title_DescriptionN']; insertIMEIDetailsModel.projectID = await sharedPref.getInt(PROJECT_ID); - insertIMEIDetailsModel.doctorID = loggedIn != null ? loggedIn['List_MemberInformation'][0]['MemberID'] : user!.doctorID; - insertIMEIDetailsModel.outSA = loggedIn != null ? loggedIn['PatientOutSA'] : user!.outSA; + insertIMEIDetailsModel.doctorID = loggedIn != null ? loggedIn['List_MemberInformation'][0]['MemberID'] : user.doctorID; + insertIMEIDetailsModel.outSA = loggedIn != null ? loggedIn['PatientOutSA'] : user.outSA; insertIMEIDetailsModel.vidaAuthTokenID = await sharedPref.getString(VIDA_AUTH_TOKEN_ID); insertIMEIDetailsModel.vidaRefreshTokenID = await sharedPref.getString(VIDA_REFRESH_TOKEN_ID); insertIMEIDetailsModel.password = userInfo.password; - insertIMEIDetailsModel.loginDoctorID = loggedIn != null ? loggedIn["employeeID"] : int.parse(user!.editedBy.toString()); + insertIMEIDetailsModel.loginDoctorID = loggedUser != null ? loggedUser.listMemberInformation[0].employeeID : int.parse(user.editedBy.toString()); await _authService.insertDeviceImei(insertIMEIDetailsModel); if (_authService.hasError) { @@ -111,11 +119,11 @@ class AuthenticationViewModel extends BaseViewModel { error = _authService.error; setState(ViewState.ErrorLocal); } else { - await sharedPref.setInt(PROJECT_ID, userInfo.projectID!); + sharedPref.setInt(PROJECT_ID, userInfo.projectID); loggedUser = loginInfo; - await saveObjToString(LOGGED_IN_USER, loginInfo); - await sharedPref.remove(LAST_LOGIN_USER); - await sharedPref.setString(TOKEN, loginInfo.logInTokenID!); + saveObjToString(LOGGED_IN_USER, loginInfo); + sharedPref.remove(LAST_LOGIN_USER); + sharedPref.setString(TOKEN, loginInfo.logInTokenID); setState(ViewState.Idle); } } @@ -124,17 +132,17 @@ class AuthenticationViewModel extends BaseViewModel { Future sendActivationCodeVerificationScreen(AuthMethodTypes authMethodType) async { setState(ViewState.BusyLocal); ActivationCodeForVerificationScreenModel activationCodeModel = ActivationCodeForVerificationScreenModel( - iMEI: user!.iMEI, - facilityId: user!.projectID, - memberID: user!.doctorID, - loginDoctorID: int.parse(user!.editedBy.toString()), - zipCode: user!.outSA == true ? '971' : '966', - mobileNumber: user!.mobile, + iMEI: user.iMEI, + facilityId: user.projectID, + memberID: user.doctorID, + loginDoctorID: int.parse(user.editedBy.toString()), + zipCode: user.outSA == true ? '971' : '966', + mobileNumber: user.mobile, oTPSendType: authMethodType.getTypeIdService(), isMobileFingerPrint: 1, - vidaAuthTokenID: user!.vidaAuthTokenID, - vidaRefreshTokenID: user!.vidaRefreshTokenID); - await sharedPref.setString(DOCTOR_ID, user!.editedBy.toString()); + vidaAuthTokenID: user.vidaAuthTokenID, + vidaRefreshTokenID: user.vidaRefreshTokenID); + await sharedPref.setString(DOCTOR_ID, user.editedBy.toString()); await _authService.sendActivationCodeVerificationScreen(activationCodeModel); if (_authService.hasError) { @@ -145,42 +153,42 @@ class AuthenticationViewModel extends BaseViewModel { } /// send activation code for silent login - Future sendActivationCodeForDoctorApp({AuthMethodTypes? authMethodType, String? password}) async { + Future sendActivationCodeForDoctorApp({AuthMethodTypes authMethodType, String password}) async { setState(ViewState.BusyLocal); int projectID = await sharedPref.getInt(PROJECT_ID); ActivationCodeModel activationCodeModel = ActivationCodeModel( facilityId: projectID, - memberID: loggedUser!.listMemberInformation![0].memberID, - loginDoctorID: loggedUser!.listMemberInformation![0].employeeID, - otpSendType: authMethodType!.getTypeIdService().toString(), + memberID: loggedUser.listMemberInformation[0].memberID, + loginDoctorID: loggedUser.listMemberInformation[0].employeeID, + otpSendType: authMethodType.getTypeIdService().toString(), ); - await sharedPref.setString(DOCTOR_ID, (loggedUser!.listMemberInformation![0].employeeID).toString()); + await sharedPref.setString(DOCTOR_ID, (loggedUser.listMemberInformation[0].employeeID).toString()); await _authService.sendActivationCodeForDoctorApp(activationCodeModel); if (_authService.hasError) { error = _authService.error; setState(ViewState.ErrorLocal); } else { - await sharedPref.setString(TOKEN, _authService.activationCodeForDoctorAppRes.logInTokenID!); + await sharedPref.setString(TOKEN, _authService.activationCodeForDoctorAppRes.logInTokenID); setState(ViewState.Idle); } } /// check activation code for sms and whats app - Future checkActivationCodeForDoctorApp({String? activationCode, bool isSilentLogin = false}) async { + Future checkActivationCodeForDoctorApp({String activationCode, bool isSilentLogin = false}) async { setState(ViewState.BusyLocal); CheckActivationCodeRequestModel checkActivationCodeForDoctorApp = new CheckActivationCodeRequestModel( - zipCode: loggedUser != null ? loggedUser!.zipCode : user!.zipCode, - mobileNumber: loggedUser != null ? loggedUser!.mobileNumber : user!.mobile, - projectID: await sharedPref.getInt(PROJECT_ID) != null ? await sharedPref.getInt(PROJECT_ID) : user!.projectID, + zipCode: loggedUser != null ? loggedUser.zipCode : user.zipCode, + mobileNumber: loggedUser != null ? loggedUser.mobileNumber : user.mobile, + projectID: await sharedPref.getInt(PROJECT_ID) != null ? await sharedPref.getInt(PROJECT_ID) : user.projectID, logInTokenID: await sharedPref.getString(TOKEN), activationCode: activationCode ?? '0000', - memberID: userInfo.userID != null ? int.parse(userInfo.userID!) : user!.doctorID, + memberID: userInfo.userID != null ? int.parse(userInfo.userID) : user.doctorID, password: userInfo.password, - facilityId: userInfo.projectID != null ? userInfo.projectID.toString() : user!.projectID.toString(), + facilityId: userInfo.projectID != null ? userInfo.projectID.toString() : user.projectID.toString(), oTPSendType: await sharedPref.getInt(OTP_TYPE), iMEI: localToken, - loginDoctorID: loggedUser != null ? loggedUser!.listMemberInformation![0].employeeID : int.parse(user!.editedBy.toString()), + loginDoctorID: loggedUser != null ? loggedUser.listMemberInformation[0].employeeID : int.parse(user.editedBy.toString()), ///loggedUser.listMemberInformation[0].employeeID, // loggedUser.listMemberInformation[0].employeeID, @@ -200,6 +208,7 @@ class AuthenticationViewModel extends BaseViewModel { Future getHospitalsList(memberID) async { GetHospitalsRequestModel getHospitalsRequestModel = GetHospitalsRequestModel(); getHospitalsRequestModel.memberID = memberID; + getHospitalsRequestModel.doctorID = memberID; await _hospitalsService.getHospitals(getHospitalsRequestModel); if (_hospitalsService.hasError) { error = _hospitalsService.error; @@ -229,12 +238,14 @@ class AuthenticationViewModel extends BaseViewModel { } } - /// add  token to shared preferences in case of send activation code is success + /// add token to shared preferences in case of send activation code is success setDataAfterSendActivationSuccess(CheckActivationCodeForDoctorAppResponseModel sendActivationCodeForDoctorAppResponseModel) async { // print("VerificationCode : " + sendActivationCodeForDoctorAppResponseModel.verificationCode); - await sharedPref.setString(VIDA_AUTH_TOKEN_ID, sendActivationCodeForDoctorAppResponseModel.vidaAuthTokenID!); - await sharedPref.setString(VIDA_REFRESH_TOKEN_ID, sendActivationCodeForDoctorAppResponseModel.vidaRefreshTokenID!); - await sharedPref.setString(TOKEN, sendActivationCodeForDoctorAppResponseModel.authenticationTokenID!); + await sharedPref.setString( + DOCTOR_SETUP_ID, sendActivationCodeForDoctorAppResponseModel.listDoctorsClinic[0].setupID != null ? sendActivationCodeForDoctorAppResponseModel.listDoctorsClinic[0].setupID : ""); + await sharedPref.setString(VIDA_AUTH_TOKEN_ID, sendActivationCodeForDoctorAppResponseModel.vidaAuthTokenID); + await sharedPref.setString(VIDA_REFRESH_TOKEN_ID, sendActivationCodeForDoctorAppResponseModel.vidaRefreshTokenID); + await sharedPref.setString(TOKEN, sendActivationCodeForDoctorAppResponseModel.authenticationTokenID); } saveObjToString(String key, value) async { @@ -243,16 +254,10 @@ class AuthenticationViewModel extends BaseViewModel { /// ask user to add his biometric showIOSAuthMessages() async { - const iosStrings = IOSAuthMessages(cancelButton: 'cancel', goToSettingsButton: 'settings', goToSettingsDescription: 'Please set up your Touch ID.', lockOut: 'Please Enable Your Touch ID'); + const iosStrings = const IOSAuthMessages(cancelButton: 'cancel', goToSettingsButton: 'settings', goToSettingsDescription: 'Please set up your Touch ID.', lockOut: 'Please Enable Your Touch ID'); + try { - await auth.authenticate( - localizedReason: 'Scan your fingerprint to authenticate', - authMessages: [iosStrings], - options: AuthenticationOptions( - useErrorDialogs: true, - stickyAuth: true, - ), - ); + await auth.authenticateWithBiometrics(localizedReason: 'Scan your fingerprint to authenticate', useErrorDialogs: true, stickyAuth: true, iOSAuthStrings: iosStrings); } on PlatformException catch (e) { DrAppToastMsg.showErrorToast(e.toString()); } @@ -280,12 +285,12 @@ class AuthenticationViewModel extends BaseViewModel { /// add some logic in case of check activation code is success onCheckActivationCodeSuccess({bool isSilentLogin = false}) async { - sharedPref.setString(TOKEN, checkActivationCodeForDoctorAppRes.authenticationTokenID!); - if (checkActivationCodeForDoctorAppRes.listDoctorProfile != null && checkActivationCodeForDoctorAppRes.listDoctorProfile!.isNotEmpty) { - localSetDoctorProfile(checkActivationCodeForDoctorAppRes.listDoctorProfile![0]); + sharedPref.setString(TOKEN, checkActivationCodeForDoctorAppRes.authenticationTokenID); + if (checkActivationCodeForDoctorAppRes.listDoctorProfile != null && checkActivationCodeForDoctorAppRes.listDoctorProfile.isNotEmpty) { + localSetDoctorProfile(checkActivationCodeForDoctorAppRes.listDoctorProfile[0]); } else { sharedPref.setObj(CLINIC_NAME, checkActivationCodeForDoctorAppRes.listDoctorsClinic); - ClinicModel clinic = ClinicModel.fromJson(checkActivationCodeForDoctorAppRes.listDoctorsClinic![0].toJson()); + ClinicModel clinic = ClinicModel.fromJson(checkActivationCodeForDoctorAppRes.listDoctorsClinic[0].toJson()); await getDoctorProfileBasedOnClinic(clinic); } } @@ -295,8 +300,8 @@ class AuthenticationViewModel extends BaseViewModel { bool isAvailable = false; await _getAvailableBiometrics(); if (_availableBiometrics != null) { - for (var i = 0; i < _availableBiometrics!.length; i++) { - if (biometricType == _availableBiometrics![i]) isAvailable = true; + for (var i = 0; i < _availableBiometrics.length; i++) { + if (biometricType == _availableBiometrics[i]) isAvailable = true; } } return isAvailable; @@ -311,16 +316,31 @@ class AuthenticationViewModel extends BaseViewModel { } } + // checkIsHuawei() async { + // HmsApiAvailability hmsApiAvailability = HmsApiAvailability(); + // await hmsApiAvailability.isHMSAvailable().then((value) { + // isHuawei = value == 0 ? true : false; + // }); + // print(isHuawei); + // } + /// call firebase service to check if the user already login in before or not getDeviceInfoFromFirebase() async { + // await checkIsHuawei(); + var token; _firebaseMessaging.setAutoInitEnabled(true); if (Platform.isIOS) { _firebaseMessaging.requestPermission(); } setState(ViewState.Busy); - var token = await _firebaseMessaging.getToken(); + try { + token = await _firebaseMessaging.getToken(); + } catch (ex) { + print(ex); + } + if (localToken == "") { - localToken = token!; + localToken = token; await _authService.selectDeviceImei(localToken); if (_authService.hasError) { @@ -330,8 +350,8 @@ class AuthenticationViewModel extends BaseViewModel { if (_authService.dashboardItemsList.length > 0) { user = _authService.dashboardItemsList[0]; sharedPref.setObj(LAST_LOGIN_USER, _authService.dashboardItemsList[0]); - await sharedPref.setString(VIDA_REFRESH_TOKEN_ID, user!.vidaRefreshTokenID!); - await sharedPref.setString(VIDA_AUTH_TOKEN_ID, user!.vidaAuthTokenID!); + await sharedPref.setString(VIDA_REFRESH_TOKEN_ID, user.vidaRefreshTokenID); + await sharedPref.setString(VIDA_AUTH_TOKEN_ID, user.vidaAuthTokenID); this.unverified = true; } setState(ViewState.Idle); @@ -385,7 +405,7 @@ class AuthenticationViewModel extends BaseViewModel { } deleteUser() { - user = GetIMEIDetailsModel(); + user = null; unverified = false; isLogin = false; } diff --git a/lib/core/viewModel/dashboard_view_model.dart b/lib/core/viewModel/dashboard_view_model.dart index d25e56b9..76e4efcd 100644 --- a/lib/core/viewModel/dashboard_view_model.dart +++ b/lib/core/viewModel/dashboard_view_model.dart @@ -1,4 +1,5 @@ import 'package:doctor_app_flutter/core/enum/view_state.dart'; +import 'package:doctor_app_flutter/core/model/dashboard/doctor_schedule.dart'; import 'package:doctor_app_flutter/core/service/home/dasboard_service.dart'; import 'package:doctor_app_flutter/core/service/home/doctor_reply_service.dart'; import 'package:doctor_app_flutter/core/service/special_clinics/special_clinic_service.dart'; @@ -15,20 +16,23 @@ import 'base_view_model.dart'; class DashboardViewModel extends BaseViewModel { final FirebaseMessaging _firebaseMessaging = FirebaseMessaging.instance; DashboardService _dashboardService = locator(); - SpecialClinicsService _specialClinicsService = locator(); + SpecialClinicsService _specialClinicsService = + locator(); DoctorReplyService _doctorReplyService = locator(); - List get dashboardItemsList => _dashboardService.dashboardItemsList; + List get dashboardItemsList => + _dashboardService.dashboardItemsList; bool get hasVirtualClinic => _dashboardService.hasVirtualClinic; - String? get sServiceID => _dashboardService.sServiceID; + String get sServiceID => _dashboardService.sServiceID; int get notRepliedCount => _doctorReplyService.notRepliedCount; - List get specialClinicalCareList => _specialClinicsService.specialClinicalCareList; - - Future startHomeScreenServices(ProjectViewModel projectsProvider, AuthenticationViewModel authProvider) async { + List get specialClinicalCareList => + _specialClinicsService.specialClinicalCareList; + Future startHomeScreenServices(ProjectViewModel projectsProvider, + AuthenticationViewModel authProvider) async { setState(ViewState.Busy); await getDoctorProfile(isGetProfile: true); @@ -49,13 +53,14 @@ class DashboardViewModel extends BaseViewModel { } Future setFirebaseNotification(AuthenticationViewModel authProvider) async { - _firebaseMessaging.requestPermission(sound: true, badge: true, alert: true, provisional: true); + _firebaseMessaging.requestPermission( + sound: true, badge: true, alert: true, provisional: true); - _firebaseMessaging.getToken().then((String? token) async { - if (token != null && token != '') { + _firebaseMessaging.getToken().then((String token) async { + if (token != '') { // DEVICE_TOKEN = token; ///TODO Elham* return it back - authProvider.insertDeviceImei(token); + authProvider.insertDeviceImei(token); } }); } @@ -80,13 +85,14 @@ class DashboardViewModel extends BaseViewModel { // setState(ViewState.Idle); } - Future changeClinic(int clinicId, AuthenticationViewModel authProvider) async { + Future changeClinic( + int clinicId, AuthenticationViewModel authProvider) async { setState(ViewState.BusyLocal); await getDoctorProfile(); ClinicModel clinicModel = ClinicModel( - doctorID: doctorProfile!.doctorID, + doctorID: doctorProfile.doctorID, clinicID: clinicId, - projectID: doctorProfile!.projectID, + projectID: doctorProfile.projectID, ); await authProvider.getDoctorProfileBasedOnClinic(clinicModel); if (authProvider.state == ViewState.ErrorLocal) { @@ -96,15 +102,13 @@ class DashboardViewModel extends BaseViewModel { getPatientCount(DashboardModel inPatientCount) { int value = 0; - inPatientCount.summaryoptions!.forEach((result) { - value += result.value!; - }); + inPatientCount.summaryoptions.forEach((result) => {value += result.value}); return value.toString(); } GetSpecialClinicalCareListResponseModel getSpecialClinic(clinicId) { - GetSpecialClinicalCareListResponseModel special = GetSpecialClinicalCareListResponseModel(); + GetSpecialClinicalCareListResponseModel special; specialClinicalCareList.forEach((element) { if (element.clinicID == clinicId) { special = element; @@ -126,4 +130,6 @@ class DashboardViewModel extends BaseViewModel { setState(ViewState.Idle); } } + + } diff --git a/lib/core/viewModel/doctor_replay_view_model.dart b/lib/core/viewModel/doctor_replay_view_model.dart index a63cc4b2..86c04528 100644 --- a/lib/core/viewModel/doctor_replay_view_model.dart +++ b/lib/core/viewModel/doctor_replay_view_model.dart @@ -53,9 +53,9 @@ class DoctorReplayViewModel extends BaseViewModel { transactionNo: model.transactionNo.toString(), doctorResponse: response, infoStatus: 6, - createdBy: this.doctorProfile!.doctorID, - infoEnteredBy: this.doctorProfile!.doctorID, - setupID: "010266"); + createdBy: this.doctorProfile.doctorID, + infoEnteredBy: this.doctorProfile.doctorID, + ); setState(ViewState.BusyLocal); await _doctorReplyService.createDoctorResponse(createDoctorResponseModel); if (_doctorReplyService.hasError) { diff --git a/lib/core/viewModel/patient-ucaf-viewmodel.dart b/lib/core/viewModel/patient-ucaf-viewmodel.dart index 04458804..741344b2 100644 --- a/lib/core/viewModel/patient-ucaf-viewmodel.dart +++ b/lib/core/viewModel/patient-ucaf-viewmodel.dart @@ -18,9 +18,9 @@ import '../../locator.dart'; class UcafViewModel extends BaseViewModel { UcafService _ucafService = locator(); - List get patientChiefComplaintList => _ucafService.patientChiefComplaintList!; + List get patientChiefComplaintList => _ucafService.patientChiefComplaintList; - List get patientVitalSignsHistory => _ucafService.patientVitalSignsHistory!; + List get patientVitalSignsHistory => _ucafService.patientVitalSignsHistory; List get patientAssessmentList => _ucafService.patientAssessmentList; @@ -28,13 +28,13 @@ class UcafViewModel extends BaseViewModel { List get diagnosisConditions => _ucafService.listOfDiagnosisCondition; - PrescriptionModel get prescriptionList => _ucafService.prescriptionList!; + PrescriptionModel get prescriptionList => _ucafService.prescriptionList; - List get orderProcedures => _ucafService.orderProcedureList!; + List get orderProcedures => _ucafService.orderProcedureList; - Function? saveUCAFOnTap; + Function saveUCAFOnTap; - String? selectedLanguage; + String selectedLanguage; String heightCm = "0"; String weightKg = "0"; String bodyMax = "0"; @@ -60,8 +60,8 @@ class UcafViewModel extends BaseViewModel { Future getUCAFData(PatiantInformtion patient) async { // setState(ViewState.Busy); - String? from; - String? to; + String from; + String to; if (from == null || from == "0") { from = AppDateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'); } @@ -96,7 +96,7 @@ class UcafViewModel extends BaseViewModel { if (respirationBeatPerMinute == "0" || respirationBeatPerMinute == null || respirationBeatPerMinute == 'null') { respirationBeatPerMinute = element.respirationBeatPerMinute.toString(); } - if (bloodPressure == "0 / 0" || bloodPressure == null || bloodPressure == 'null') { + if (bloodPressure == "0/0" || bloodPressure == null || bloodPressure == 'null') { bloodPressure = element.bloodPressure.toString(); } }); @@ -157,7 +157,7 @@ class UcafViewModel extends BaseViewModel { } } - MasterKeyModel findMasterDataById({required MasterKeysService masterKeys, dynamic id}) { + MasterKeyModel findMasterDataById({@required MasterKeysService masterKeys, dynamic id}) { switch (masterKeys) { case MasterKeysService.DiagnosisCondition: List result = diagnosisConditions.where((element) { @@ -166,7 +166,7 @@ class UcafViewModel extends BaseViewModel { if (result.isNotEmpty) { return result.first; } - return MasterKeyModel(); + return null; case MasterKeysService.DiagnosisType: List result = diagnosisTypes.where((element) { return element.id == id && element.typeId == masterKeys.getMasterKeyService(); @@ -174,9 +174,9 @@ class UcafViewModel extends BaseViewModel { if (result.isNotEmpty) { return result.first; } - return MasterKeyModel(); + return null; default: - return MasterKeyModel(); + return null; } } diff --git a/lib/core/viewModel/patient_view_model.dart b/lib/core/viewModel/patient_view_model.dart index ae28428b..7e62daee 100644 --- a/lib/core/viewModel/patient_view_model.dart +++ b/lib/core/viewModel/patient_view_model.dart @@ -354,7 +354,7 @@ class PatientViewModel extends BaseViewModel { patientTypeID: 1, patientType: 1, resultType: resultType, - setupID: "010266"); + ); await _patientService.getDiabeticChartValues(requestModel); if (_patientService.hasError) { error = _patientService.error; diff --git a/lib/core/viewModel/procedure_View_model.dart b/lib/core/viewModel/procedure_View_model.dart index 4b3dc786..005d095d 100644 --- a/lib/core/viewModel/procedure_View_model.dart +++ b/lib/core/viewModel/procedure_View_model.dart @@ -44,8 +44,8 @@ class ProcedureViewModel extends BaseViewModel { List get categoryList => _procedureService.categoryList; RadiologyService _radiologyService = locator(); LabsService _labsService = locator(); - List _finalRadiologyListClinic = []; - List _finalRadiologyListHospital = []; + List _finalRadiologyListClinic = List(); + List _finalRadiologyListHospital = List(); List get finalRadiologyList => filterType == FilterType.Clinic ? _finalRadiologyListClinic : _finalRadiologyListHospital; @@ -56,11 +56,15 @@ class ProcedureViewModel extends BaseViewModel { List get labOrdersResultsList => _labsService.labOrdersResultsList; List get procedureTemplate => _procedureService.templateList; - List templateList = []; + List templateList = List(); List get procedureTemplateDetails => _procedureService.templateDetailsList; - Future getProcedure({int? mrn, String? patientType, int? appointmentNo, bool isLocalBusy = false}) async { + bool _isRadiologyVIDAPlus = false; + + bool get isRadiologyVIDAPlus => _isRadiologyVIDAPlus; + + Future getProcedure({int mrn, String patientType, int appointmentNo, bool isLocalBusy = false}) async { hasError = false; await getDoctorProfile(); if (isLocalBusy) @@ -78,7 +82,7 @@ class ProcedureViewModel extends BaseViewModel { setState(ViewState.Idle); } - Future getProcedureCategory({String? categoryName, String? categoryID, patientId, bool isLocalBusy = false}) async { + Future getProcedureCategory({String categoryName, String categoryID, patientId, bool isLocalBusy = false}) async { if (categoryName == null) return; hasError = false; if (isLocalBusy) @@ -105,7 +109,7 @@ class ProcedureViewModel extends BaseViewModel { setState(ViewState.Idle); } - Future getProcedureTemplate({String? categoryID, bool isLocalBusy = false, BuildContext? context}) async { + Future getProcedureTemplate({String categoryID, bool isLocalBusy = false, BuildContext context}) async { if (isLocalBusy) { setState(ViewState.BusyLocal); } else { @@ -136,7 +140,7 @@ class ProcedureViewModel extends BaseViewModel { int tempId = 0; - Future getProcedureTemplateDetails({required int templateId}) async { + Future getProcedureTemplateDetails({int templateId}) async { tempId = templateId; hasError = false; //_insuranceCardService.clearInsuranceCard(); @@ -181,13 +185,13 @@ class ProcedureViewModel extends BaseViewModel { } } - Future updateProcedure({UpdateProcedureRequestModel? updateProcedureRequestModel, int? mrn, bool isLocalBusy = false}) async { + Future updateProcedure({UpdateProcedureRequestModel updateProcedureRequestModel, int mrn, bool isLocalBusy = false}) async { hasError = false; if (isLocalBusy) setState(ViewState.BusyLocal); else setState(ViewState.Busy); - await _procedureService.updateProcedure(updateProcedureRequestModel!); + await _procedureService.updateProcedure(updateProcedureRequestModel); if (_procedureService.hasError) { error = _procedureService.error; setState(ViewState.ErrorLocal); @@ -196,9 +200,10 @@ class ProcedureViewModel extends BaseViewModel { //await getProcedure(mrn: mrn); } - void getPatientRadOrders(PatiantInformtion patient, {String? patientType, bool isInPatient = false}) async { + void getPatientRadOrders(PatiantInformtion patient, {String patientType, bool isInPatient = false}) async { setState(ViewState.Busy); await _radiologyService.getPatientRadOrders(patient, isInPatient: isInPatient); + _isRadiologyVIDAPlus = _radiologyService.isRadiologyVIDAPlus; if (_radiologyService.hasError) { error = _radiologyService.error; if (patientType == "7") @@ -235,7 +240,7 @@ class ProcedureViewModel extends BaseViewModel { String get radImageURL => _radiologyService.url; - getRadImageURL({int invoiceNo = 0, int lineItem = 0, int projectId = 0, required PatiantInformtion patient}) async { + getRadImageURL({int invoiceNo, int lineItem, int projectId, @required PatiantInformtion patient}) async { setState(ViewState.Busy); await _radiologyService.getRadImageURL(invoiceNo: invoiceNo, lineItem: lineItem, projectId: projectId, patient: patient); if (_radiologyService.hasError) { @@ -254,7 +259,7 @@ class ProcedureViewModel extends BaseViewModel { List get labResultList => _labsService.labResultList; - List labResultLists = []; + List labResultLists = List(); List get labResultListsCoustom { return labResultLists; @@ -271,7 +276,7 @@ class ProcedureViewModel extends BaseViewModel { } } - getLaboratoryResult({String? projectID, int? clinicID, String? invoiceNo, String? orderNo, PatiantInformtion? patient}) async { + getLaboratoryResult({String projectID, int clinicID, String invoiceNo, String orderNo, PatiantInformtion patient}) async { setState(ViewState.Busy); await _labsService.getLaboratoryResult(invoiceNo: invoiceNo, orderNo: orderNo, projectID: projectID, clinicID: clinicID, patient: patient); if (_labsService.hasError) { @@ -282,7 +287,7 @@ class ProcedureViewModel extends BaseViewModel { } } - getPatientLabOrdersResults({PatientLabOrders? patientLabOrder, String? procedure, PatiantInformtion? patient}) async { + getPatientLabOrdersResults({PatientLabOrders patientLabOrder, String procedure, PatiantInformtion patient}) async { setState(ViewState.Busy); await _labsService.getPatientLabOrdersResults(patientLabOrder: patientLabOrder, procedure: procedure, patient: patient); if (_labsService.hasError) { @@ -292,7 +297,7 @@ class ProcedureViewModel extends BaseViewModel { bool isShouldClear = false; if (_labsService.labOrdersResultsList.length == 1) { labOrdersResultsList.forEach((element) { - if (element.resultValue!.contains('/') || element.resultValue!.contains('*') || element.resultValue!.isEmpty) isShouldClear = true; + if (element.resultValue.contains('/') || element.resultValue.contains('*') || element.resultValue.isEmpty) isShouldClear = true; }); } if (isShouldClear) _labsService.labOrdersResultsList.clear(); @@ -300,7 +305,7 @@ class ProcedureViewModel extends BaseViewModel { } } - sendLabReportEmail({PatientLabOrders? patientLabOrder, String? mes}) async { + sendLabReportEmail({PatientLabOrders patientLabOrder, String mes}) async { await _labsService.sendLabReportEmail(patientLabOrder: patientLabOrder); if (_labsService.hasError) { error = _labsService.error; @@ -309,11 +314,11 @@ class ProcedureViewModel extends BaseViewModel { } Future preparePostProcedure({ - String? remarks, - String? orderType, - PatiantInformtion? patient, - List? entityList, - ProcedureType? procedureType, + String remarks, + String orderType, + PatiantInformtion patient, + List entityList, + ProcedureType procedureType, bool isLocalBusy = false, }) async { ///TODO Roaa Move it to function @@ -324,19 +329,19 @@ class ProcedureViewModel extends BaseViewModel { } PostProcedureReqModel postProcedureReqModel = new PostProcedureReqModel(); ProcedureValidationRequestModel procedureValadteRequestModel = new ProcedureValidationRequestModel(); - procedureValadteRequestModel.patientMRN = patient!.patientMRN; + procedureValadteRequestModel.patientMRN = patient.patientMRN; procedureValadteRequestModel.episodeID = patient.episodeNo; procedureValadteRequestModel.appointmentNo = patient.appointmentNo; - List controlsProcedure = []; + List controlsProcedure = List(); postProcedureReqModel.appointmentNo = patient.appointmentNo; postProcedureReqModel.episodeID = patient.episodeNo; postProcedureReqModel.patientMRN = patient.patientMRN; - entityList!.forEach((element) { - procedureValadteRequestModel.procedure = [element.procedureId!]; - List controls = []; + entityList.forEach((element) { + procedureValadteRequestModel.procedure = [element.procedureId]; + List controls = List(); controls.add( Controls(code: "remarks", controlValue: element.remarks != null ? element.remarks : ""), ); @@ -349,8 +354,8 @@ class ProcedureViewModel extends BaseViewModel { postProcedureReqModel.procedures = controlsProcedure; await validationProcedure(procedureValadteRequestModel, isLocalBusy: isLocalBusy); if (state == ViewState.Idle) { - if (valadteProcedureList[0].entityList!.length == 0) { - await postProcedure(postProcedureReqModel, patient.patientMRN!, isLocalBusy: isLocalBusy); + if (valadteProcedureList[0].entityList.length == 0) { + await postProcedure(postProcedureReqModel, patient.patientMRN, isLocalBusy: isLocalBusy); if (state == ViewState.ErrorLocal) { Utils.showErrorToast(error); @@ -365,7 +370,7 @@ class ProcedureViewModel extends BaseViewModel { Utils.showErrorToast(error); getProcedure(mrn: patient.patientMRN); } else if (state == ViewState.Idle) { - Utils.showErrorToast(valadteProcedureList[0].entityList![0].warringMessages); + Utils.showErrorToast(valadteProcedureList[0].entityList[0].warringMessages); } } } else { @@ -395,7 +400,7 @@ class ProcedureViewModel extends BaseViewModel { } else { setState(ViewState.Busy); } - List entityList = []; + List entityList = List(); items.forEach((element) { entityList.add( cpe.EntityList( @@ -414,12 +419,12 @@ class ProcedureViewModel extends BaseViewModel { } Future filterSearchResults(String query, List masterList, List items) async { - List dummySearchList = []; + List dummySearchList = List(); dummySearchList.addAll(masterList); if (query.isNotEmpty) { - List dummyListData = []; + List dummyListData = List(); dummySearchList.forEach((item) { - if (item.procedureName!.toLowerCase().contains(query.toLowerCase())) { + if (item.procedureName.toLowerCase().contains(query.toLowerCase())) { dummyListData.add(item); } }); @@ -431,13 +436,13 @@ class ProcedureViewModel extends BaseViewModel { } } - void filterProcedureSearchResults(String query, List? masterList, List items) { - List dummySearchList = []; + void filterProcedureSearchResults(String query, List masterList, List items) { + List dummySearchList = List(); if (masterList != null) dummySearchList.addAll(masterList); if (query.isNotEmpty) { - List dummyListData = []; + List dummyListData = List(); dummySearchList.forEach((item) { - if (item.templateName!.toLowerCase().contains(query.toLowerCase())) { + if (item.templateName.toLowerCase().contains(query.toLowerCase())) { dummyListData.add(item); } }); @@ -446,7 +451,7 @@ class ProcedureViewModel extends BaseViewModel { return; } else { items.clear(); - items.addAll(masterList!); + items.addAll(masterList); } } } diff --git a/lib/core/viewModel/profile/operation_report_view_model.dart b/lib/core/viewModel/profile/operation_report_view_model.dart index 944995b2..dab6b5fd 100644 --- a/lib/core/viewModel/profile/operation_report_view_model.dart +++ b/lib/core/viewModel/profile/operation_report_view_model.dart @@ -38,7 +38,7 @@ class OperationReportViewModel extends BaseViewModel { GetOperationDetailsRequestModel( reservationNo: reservation.oTReservationID, patientID: reservation.patientID, - setupID: "010266"); + ); await _operationReportService.getOperationReportDetails( getOperationReportRequestModel: getOperationReportRequestModel); if (_operationReportService.hasError) { diff --git a/lib/core/viewModel/project_view_model.dart b/lib/core/viewModel/project_view_model.dart index 9f8afe7f..72206475 100644 --- a/lib/core/viewModel/project_view_model.dart +++ b/lib/core/viewModel/project_view_model.dart @@ -6,6 +6,7 @@ import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; import 'package:doctor_app_flutter/core/model/doctor/clinic_model.dart'; import 'package:doctor_app_flutter/core/model/doctor/doctor_profile_model.dart'; +import 'package:doctor_app_flutter/core/model/hospitals/VidaPlusProjectListModel.dart'; import 'package:doctor_app_flutter/utils/dr_app_shared_pref.dart'; import 'package:doctor_app_flutter/utils/utils.dart'; import 'package:flutter/cupertino.dart'; @@ -34,6 +35,10 @@ class ProjectViewModel with ChangeNotifier { bool get isArabic => _isArabic; late StreamSubscription subscription; + List _vidaPlusProjectListModel = List(); + + List get vidaPlusProjectList => _vidaPlusProjectListModel; + ProjectViewModel() { loadSharedPrefLanguage(); @@ -53,6 +58,11 @@ class ProjectViewModel with ChangeNotifier { }); } + setVidaPlusProjectList(List vidaPlusProjectListModelInput) { + _vidaPlusProjectListModel = vidaPlusProjectListModelInput; + notifyListeners(); + } + void loadSharedPrefLanguage() async { currentLanguage = await sharedPref.getString(APP_Language); _appLocale = Locale(currentLanguage ?? 'en'); @@ -100,6 +110,13 @@ class ProjectViewModel with ChangeNotifier { response['List_DoctorsClinic'].forEach((v) { doctorClinicsList.add(new ClinicModel.fromJson(v)); }); + _vidaPlusProjectListModel.clear(); + if (response['ProjectListVidaPlus'].length != 0) { + response['ProjectListVidaPlus'].forEach((item) { + _vidaPlusProjectListModel.add(VidaPlusProjectListModel.fromJson(item)); + }); + setVidaPlusProjectList(_vidaPlusProjectListModel); + } localRes = response; }, onFailure: (String error, int statusCode) { throw error; diff --git a/lib/core/viewModel/radiology_view_model.dart b/lib/core/viewModel/radiology_view_model.dart index df864605..a5241ed9 100644 --- a/lib/core/viewModel/radiology_view_model.dart +++ b/lib/core/viewModel/radiology_view_model.dart @@ -12,57 +12,38 @@ class RadiologyViewModel extends BaseViewModel { FilterType filterType = FilterType.Clinic; RadiologyService _radiologyService = locator(); - List _finalRadiologyListClinic = []; - List _finalRadiologyListHospital = []; + List _finalRadiologyListClinic = List(); + List _finalRadiologyListHospital = List(); - List get finalRadiologyList => - filterType == FilterType.Clinic - ? _finalRadiologyListClinic - : _finalRadiologyListHospital; + List get finalRadiologyList => filterType == FilterType.Clinic ? _finalRadiologyListClinic : _finalRadiologyListHospital; - void getPatientRadOrders(PatiantInformtion patient, - {isInPatient = false}) async { + void getPatientRadOrders(PatiantInformtion patient, {isInPatient = false}) async { setState(ViewState.Busy); - await _radiologyService.getPatientRadOrders(patient, - isInPatient: isInPatient); + await _radiologyService.getPatientRadOrders(patient, isInPatient: isInPatient); if (_radiologyService.hasError) { error = _radiologyService.error; setState(ViewState.Error); } else { _radiologyService.finalRadiologyList.forEach((element) { - List finalRadiologyListClinic = - _finalRadiologyListClinic - .where((elementClinic) => - elementClinic.filterName == element.clinicDescription) - .toList(); + List finalRadiologyListClinic = _finalRadiologyListClinic.where((elementClinic) => elementClinic.filterName == element.clinicDescription).toList(); if (finalRadiologyListClinic.length != 0) { - _finalRadiologyListClinic[ - finalRadiologyListClinic.indexOf(finalRadiologyListClinic[0])] - .finalRadiologyList - .add(element); + _finalRadiologyListClinic[finalRadiologyListClinic.indexOf(finalRadiologyListClinic[0])].finalRadiologyList.add(element); } else { - _finalRadiologyListClinic.add(FinalRadiologyList( - filterName: element.clinicDescription, finalRadiology: element)); + _finalRadiologyListClinic.add(FinalRadiologyList(filterName: element.clinicDescription, finalRadiology: element)); } // FinalRadiologyList list sort via project - List finalRadiologyListHospital = - _finalRadiologyListHospital - .where( - (elementClinic) => - elementClinic.filterName == element.projectName, - ) - .toList(); + List finalRadiologyListHospital = _finalRadiologyListHospital + .where( + (elementClinic) => elementClinic.filterName == element.projectName, + ) + .toList(); if (finalRadiologyListHospital.length != 0) { - _finalRadiologyListHospital[finalRadiologyListHospital - .indexOf(finalRadiologyListHospital[0])] - .finalRadiologyList - .add(element); + _finalRadiologyListHospital[finalRadiologyListHospital.indexOf(finalRadiologyListHospital[0])].finalRadiologyList.add(element); } else { - _finalRadiologyListHospital.add(FinalRadiologyList( - filterName: element.projectName, finalRadiology: element)); + _finalRadiologyListHospital.add(FinalRadiologyList(filterName: element.projectName, finalRadiology: element)); } }); @@ -72,17 +53,9 @@ class RadiologyViewModel extends BaseViewModel { String get radImageURL => _radiologyService.url; - getRadImageURL( - {int? invoiceNo, - int? lineItem, - int? projectId, - required PatiantInformtion patient}) async { + getRadImageURL({int invoiceNo, int lineItem, int projectId, bool isVidaPlus, @required PatiantInformtion patient, String invoiceType}) async { setState(ViewState.Busy); - await _radiologyService.getRadImageURL( - invoiceNo: invoiceNo!, - lineItem: lineItem!, - projectId: projectId!, - patient: patient); + await _radiologyService.getRadImageURL(invoiceNo: invoiceNo, lineItem: lineItem, projectId: projectId, isVidaPlus: isVidaPlus, patient: patient, invoiceType: invoiceType); if (_radiologyService.hasError) { error = _radiologyService.error; setState(ViewState.Error); diff --git a/lib/core/viewModel/schedule_view_model.dart b/lib/core/viewModel/schedule_view_model.dart index d5bc45b7..234199ea 100644 --- a/lib/core/viewModel/schedule_view_model.dart +++ b/lib/core/viewModel/schedule_view_model.dart @@ -1,4 +1,5 @@ import 'package:doctor_app_flutter/core/enum/view_state.dart'; +import 'package:doctor_app_flutter/core/model/dashboard/doctor_schedule.dart'; import 'package:doctor_app_flutter/core/service/home/schedule_service.dart'; import 'package:doctor_app_flutter/core/model/doctor/list_doctor_working_hours_table_model.dart'; @@ -11,6 +12,8 @@ class ScheduleViewModel extends BaseViewModel { List get listDoctorWorkingHoursTable => _scheduleService.listDoctorWorkingHoursTable; + List get getDoctorRotation => + _scheduleService.doctorRotation; Future getDoctorSchedule() async { setState(ViewState.Busy); await _scheduleService.getDoctorSchedule(); @@ -20,4 +23,15 @@ class ScheduleViewModel extends BaseViewModel { } else setState(ViewState.Idle); } + + Future getDoctorRota(String fromDate, String toDate,{int pageNo=1}) async { + setState(ViewState.Busy); + await _scheduleService.getDoctorRota(fromDate,toDate,pageNo:pageNo); + if (_scheduleService.hasError) { + error = _scheduleService.error; + setState(ViewState.ErrorLocal); + } else { + setState(ViewState.Idle); + } + } } diff --git a/lib/core/viewModel/sick_leave_view_model.dart b/lib/core/viewModel/sick_leave_view_model.dart index 4a9a5875..c06ff542 100644 --- a/lib/core/viewModel/sick_leave_view_model.dart +++ b/lib/core/viewModel/sick_leave_view_model.dart @@ -1,4 +1,5 @@ import 'package:doctor_app_flutter/core/enum/view_state.dart'; +import 'package:doctor_app_flutter/core/model/sick_leave/sick_leave_patient_model.dart'; import 'package:doctor_app_flutter/core/service/patient/patient_service.dart'; import 'package:doctor_app_flutter/core/service/patient_medical_file/sick_leave/sickleave_service.dart'; import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; @@ -13,8 +14,7 @@ class SickLeaveViewModel extends BaseViewModel { SickLeaveService _sickLeaveService = locator(); PatientService _patientService = locator(); - SickLeaveStatisticsModel get sickLeaveStatistics => - _sickLeaveService.sickLeavestatisitics; + SickLeaveStatisticsModel get sickLeaveStatistics => _sickLeaveService.sickLeavestatisitics; get getAllSIckLeave => _sickLeaveService.getAllSickLeave; @@ -30,10 +30,7 @@ class SickLeaveViewModel extends BaseViewModel { get postSechedule => _sickLeaveService.postReschedule; - get getAllSIckLeavePatient => [ - ..._sickLeaveService.getAllSickLeavePatient, - ..._sickLeaveService.getAllSickLeaveDoctor - ]; + get getAllSIckLeavePatient => removeDuplicates([..._sickLeaveService.getAllSickLeaveDoctor, ..._sickLeaveService.getAllSickLeavePatient]); Future addSickLeave(AddSickLeaveRequest addSickLeaveRequest) async { setState(ViewState.BusyLocal); @@ -88,17 +85,13 @@ class SickLeaveViewModel extends BaseViewModel { setState(ViewState.Idle); } - Future getSickLeaveForPatient(PatiantInformtion patient, - {bool isLocalBusy = false}) async { + Future getSickLeaveForPatient(PatiantInformtion patient, {bool isLocalBusy = false}) async { if (isLocalBusy) setState(ViewState.BusyLocal); else setState(ViewState.Busy); var patientMRN = patient.patientMRN ?? patient.patientId; - var services = [ - _sickLeaveService.getSickLeavePatient(patientMRN), - _sickLeaveService.getSickLeaveDoctor(patientMRN) - ]; + var services = [_sickLeaveService.getSickLeavePatient(patientMRN), _sickLeaveService.getSickLeaveDoctor(patientMRN)]; final results = await Future.wait(services); if (_sickLeaveService.hasError) { @@ -183,4 +176,13 @@ class SickLeaveViewModel extends BaseViewModel { } else setState(ViewState.Idle); } + + List removeDuplicates(List items) { + List uniqueItems = []; + var uniqueIDs = items.map((e) => e.appointmentNo).toSet(); + uniqueIDs.forEach((e) { + uniqueItems.add(items.firstWhere((i) => i.appointmentNo == e)); + }); + return uniqueItems; + } } diff --git a/lib/screens/ER_singin/ER_singin_screen.dart b/lib/screens/ER_singin/ER_singin_screen.dart index c8fd6743..b4f6a363 100644 --- a/lib/screens/ER_singin/ER_singin_screen.dart +++ b/lib/screens/ER_singin/ER_singin_screen.dart @@ -1,22 +1,26 @@ import 'package:barcode_scan2/barcode_scan2.dart'; import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/enum/view_state.dart'; +import 'package:doctor_app_flutter/core/model/patient_muse/PatientSearchRequestModel.dart'; import 'package:doctor_app_flutter/core/service/AnalyticsService.dart'; import 'package:doctor_app_flutter/core/viewModel/ER_sign_in/ER_sign_in_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; +import 'package:doctor_app_flutter/core/viewModel/scan_qr_view_model.dart'; import 'package:doctor_app_flutter/locator.dart'; import 'package:doctor_app_flutter/screens/patients/patient_search/patient_search_header.dart'; import 'package:doctor_app_flutter/utils/dr_app_toast_msg.dart'; -import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; import 'package:doctor_app_flutter/utils/utils.dart'; +import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/divider_with_spaces_around.dart'; import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; +import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; +import '../../routes.dart'; import '../base/base_view.dart'; Utils helpers = Utils(); @@ -27,7 +31,7 @@ class ErSignInScreen extends StatefulWidget { } class _ErSignInScreenState extends State { - ProjectViewModel? projectViewModel; + ProjectViewModel projectViewModel; @override Widget build(BuildContext context) { projectViewModel = Provider.of(context); @@ -41,7 +45,7 @@ class _ErSignInScreenState extends State { ), body: Center( child: Container( - margin: EdgeInsets.only(top: SizeConfig.realScreenHeight! / 7), + margin: EdgeInsets.only(top: SizeConfig.realScreenHeight / 7), child: FractionallySizedBox( widthFactor: 0.9, child: ListView( @@ -107,12 +111,13 @@ class _ErSignInScreenState extends State { } } - signInERPatient({BuildContext? context, ERSignInViewModel? model, patientId, signInType}) async { - GifLoaderDialogUtils.showMyDialog(context!); - await model!.signInERPatient(patientId: patientId, signInType: signInType); + signInERPatient({BuildContext context, ERSignInViewModel model, patientId, signInType}) async { + GifLoaderDialogUtils.showMyDialog(context); + await model.signInERPatient(patientId: patientId, signInType: signInType); if (model.state == ViewState.ErrorLocal) { Utils.showErrorToast(model.error); } else { + /// TODO Elham* Create this in Utils DrAppToastMsg.showSuccesToast("Add successfully"); } GifLoaderDialogUtils.hideDialog(context); @@ -121,12 +126,12 @@ class _ErSignInScreenState extends State { /// TODO Elham* Make this as custom Dialog showMyDialog({ - BuildContext? context, - Function? firstAction, - Function? secondAction, + BuildContext context, + Function firstAction, + Function secondAction, }) { showDialog( - context: context!, + context: context, builder: (ctx) => Center( child: Container( width: MediaQuery.of(context).size.width * 0.8, @@ -167,7 +172,7 @@ class _ErSignInScreenState extends State { padding: EdgeInsets.all(20), color: Colors.white, child: AppText( - projectViewModel!.isArabic ? "الرجاء اختيار الإجراء الذي تريد القيام به" : 'Please choose the action you want to do ', + projectViewModel.isArabic ? "الرجاء اختيار الإجراء الذي تريد القيام به" : 'Please choose the action you want to do ', fontSize: 15, textAlign: TextAlign.center, ), @@ -184,23 +189,23 @@ class _ErSignInScreenState extends State { children: [ ElevatedButton( child: AppText( - "Sing In", + "Sign In", fontWeight: FontWeight.w600, color: Colors.black, fontSize: 16, ), //Text("Cancel"), onPressed: () async { - await firstAction!(); + await firstAction(); }), ElevatedButton( child: AppText( - "Sing Out", + "Sign Out", fontWeight: FontWeight.w600, color: Colors.black, fontSize: 16, ), //Text("Confirm", ), onPressed: () async { - await secondAction!(); + await secondAction(); }) ], ), diff --git a/lib/screens/auth/login_screen.dart b/lib/screens/auth/login_screen.dart index 502e65ee..c1ce9c3c 100644 --- a/lib/screens/auth/login_screen.dart +++ b/lib/screens/auth/login_screen.dart @@ -3,8 +3,9 @@ import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/enum/view_state.dart'; import 'package:doctor_app_flutter/core/model/hospitals/get_hospitals_response_model.dart'; import 'package:doctor_app_flutter/core/viewModel/authentication_view_model.dart'; -import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; +import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/utils/utils.dart'; +import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart'; @@ -20,7 +21,7 @@ class LoginScreen extends StatefulWidget { } class _LoginScreenState extends State { - String? platformImei; + String platformImei; bool allowCallApi = true; //TODO change AppTextFormField to AppTextFormFieldCustom @@ -31,11 +32,13 @@ class _LoginScreenState extends State { List projectsList = []; FocusNode focusPass = FocusNode(); FocusNode focusProject = FocusNode(); - AuthenticationViewModel authenticationViewModel = AuthenticationViewModel(); + AuthenticationViewModel authenticationViewModel; + ProjectViewModel projectViewModel; @override Widget build(BuildContext context) { authenticationViewModel = Provider.of(context); + projectViewModel = Provider.of(context); return AppScaffold( isShowAppBar: false, backgroundColor: HexColor('#F8F8F8'), @@ -48,6 +51,7 @@ class _LoginScreenState extends State { Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ + //TODO Use App Text rather than text Container( child: Column( crossAxisAlignment: CrossAxisAlignment.start, @@ -70,11 +74,11 @@ class _LoginScreenState extends State { ), Text( TranslationBase.of(context).drSulaimanAlHabib, - style: TextStyle(color: Color(0xFF2B353E), fontWeight: FontWeight.bold, fontSize: SizeConfig.isMobile ? 24 : SizeConfig.realScreenWidth! * 0.029, fontFamily: 'Poppins'), + style: TextStyle(color: Color(0xFF2B353E), fontWeight: FontWeight.bold, fontSize: SizeConfig.isMobile ? 24 : SizeConfig.realScreenWidth * 0.029, fontFamily: 'Poppins'), ), Text( "Doctor App", - style: TextStyle(fontSize: SizeConfig.isMobile ? 16 : SizeConfig.realScreenWidth! * 0.030, fontWeight: FontWeight.w600, color: Color(0xFFD02127)), + style: TextStyle(fontSize: SizeConfig.isMobile ? 16 : SizeConfig.realScreenWidth * 0.030, fontWeight: FontWeight.w600, color: Color(0xFFD02127)), ), ]), ], @@ -88,8 +92,8 @@ class _LoginScreenState extends State { mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Container( - width: SizeConfig.realScreenWidth! * 0.90, - height: SizeConfig.realScreenHeight! * 0.65, + width: SizeConfig.realScreenWidth * 0.90, + height: SizeConfig.realScreenHeight * 0.65, child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ buildSizedBox(), AppTextFieldCustom( @@ -97,12 +101,11 @@ class _LoginScreenState extends State { hasBorder: true, controller: userIdController, onChanged: (value) { - if (value != null) authenticationViewModel.userInfo.userID = value.trim(); - print(authenticationViewModel.userInfo.userID); - //setState(() {}); + if (value != null) + setState(() { + authenticationViewModel.userInfo.userID = value.trim(); + }); }, - onClick: () {}, - onFieldSubmitted: () {}, ), buildSizedBox(), AppTextFieldCustom( @@ -111,12 +114,18 @@ class _LoginScreenState extends State { isSecure: true, controller: passwordController, onChanged: (value) { - if (value != null) authenticationViewModel.userInfo.password = value.trim(); - getProjects(authenticationViewModel.userInfo.userID); - setState(() {}); + if (value != null) + setState(() { + authenticationViewModel.userInfo.password = value.trim(); + }); + // if(allowCallApi) { + this.getProjects(authenticationViewModel.userInfo.userID); + // setState(() { + // allowCallApi = false; + // }); + // } }, onClick: () {}, - onFieldSubmitted: () {}, ), buildSizedBox(), AppTextFieldCustom( @@ -126,10 +135,8 @@ class _LoginScreenState extends State { isTextFieldHasSuffix: true, enabled: false, onClick: () { - if (projectsList.isNotEmpty) Utils.showCupertinoPicker(context, projectsList, 'facilityName', onSelectProject, authenticationViewModel); + Utils.showCupertinoPicker(context, projectsList, 'facilityName', onSelectProject, authenticationViewModel); }, - onFieldSubmitted: () {}, - onChanged: (value) {}, ), buildSizedBox() ]), @@ -143,7 +150,7 @@ class _LoginScreenState extends State { ]), ), bottomSheet: Container( - height: 100, + height: 90, width: double.infinity, child: Center( child: FractionallySizedBox( @@ -180,8 +187,8 @@ class _LoginScreenState extends State { login( context, ) async { - if (loginFormKey.currentState!.validate()) { - loginFormKey.currentState!.save(); + if (loginFormKey.currentState.validate()) { + loginFormKey.currentState.save(); GifLoaderDialogUtils.showMyDialog(context); await authenticationViewModel.login(authenticationViewModel.userInfo); if (authenticationViewModel.state == ViewState.ErrorLocal) { @@ -206,10 +213,10 @@ class _LoginScreenState extends State { onSelectProject(index) { setState(() { authenticationViewModel.userInfo.projectID = projectsList[index].facilityId; - projectIdController.text = projectsList[index].facilityName!; + projectIdController.text = projectsList[index].facilityName; }); - primaryFocus!.unfocus(); + primaryFocus.unfocus(); } String memberID = ""; @@ -222,8 +229,9 @@ class _LoginScreenState extends State { if (authenticationViewModel.state == ViewState.Idle) { projectsList = authenticationViewModel.hospitals; setState(() { + projectViewModel.setVidaPlusProjectList(authenticationViewModel.vidaPlusProjectList); authenticationViewModel.userInfo.projectID = projectsList[0].facilityId; - projectIdController.text = projectsList[0].facilityName!; + projectIdController.text = projectsList[0].facilityName; }); } } diff --git a/lib/screens/auth/verification_methods_screen.dart b/lib/screens/auth/verification_methods_screen.dart index 620bb5a2..06b5d2ec 100644 --- a/lib/screens/auth/verification_methods_screen.dart +++ b/lib/screens/auth/verification_methods_screen.dart @@ -23,7 +23,7 @@ import '../../utils/dr_app_shared_pref.dart'; import '../../utils/utils.dart'; import '../../widgets/auth/verification_methods_list.dart'; -DrAppSharedPreferances sharedPref = DrAppSharedPreferances(); +DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); Utils helpers = Utils(); ///TODO Elham* check if this still in user or not @@ -39,13 +39,12 @@ class VerificationMethodsScreen extends StatefulWidget { } class _VerificationMethodsScreenState extends State { - late ProjectViewModel projectsProvider; + ProjectViewModel projectsProvider; bool isMoreOption = false; bool onlySMSBox = false; - AuthMethodTypes fingerPrintBefore = AuthMethodTypes.Fingerprint; - - late AuthMethodTypes selectedOption; - late AuthenticationViewModel authenticationViewModel; + AuthMethodTypes fingerPrintBefore; + AuthMethodTypes selectedOption; + AuthenticationViewModel authenticationViewModel; @override Widget build(BuildContext context) { @@ -64,7 +63,7 @@ class _VerificationMethodsScreenState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ SizedBox( - height: SizeConfig.heightMultiplier! * (SizeConfig.isHeightVeryShort ? 6 : 4), + height: SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort ? 6 : 4), ), if (authenticationViewModel.isFromLogin) InkWell( @@ -79,7 +78,7 @@ class _VerificationMethodsScreenState extends State { Column( children: [ SizedBox( - height: SizeConfig.heightMultiplier! * (SizeConfig.isHeightVeryShort ? 3 : 4), + height: SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort ? 3 : 4), ), authenticationViewModel.user != null && isMoreOption == false ? Column( @@ -94,14 +93,14 @@ class _VerificationMethodsScreenState extends State { letterSpacing: -0.72, ), AppText( - Utils.convertToTitleCase(authenticationViewModel.user!.doctorName!), + Utils.convertToTitleCase(authenticationViewModel.user.doctorName), fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 6, color: AppGlobal.appTextColor, fontWeight: FontWeight.bold, letterSpacing: -1.44, ), SizedBox( - height: SizeConfig.heightMultiplier! * 4, + height: SizeConfig.heightMultiplier * 4, ), AppText( TranslationBase.of(context).accountInfo, @@ -110,7 +109,7 @@ class _VerificationMethodsScreenState extends State { fontWeight: FontWeight.w600, letterSpacing: -0.64, ), - SizedBox(height: SizeConfig.heightMultiplier! * 4), + SizedBox(height: SizeConfig.heightMultiplier * 4), Container( padding: EdgeInsets.all(15), decoration: BoxDecoration( @@ -125,7 +124,7 @@ class _VerificationMethodsScreenState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ Container( - width: SizeConfig.realScreenWidth! * .5, + width: SizeConfig.realScreenWidth * .5, padding: EdgeInsets.all(0), child: Column( mainAxisAlignment: MainAxisAlignment.start, @@ -153,7 +152,7 @@ class _VerificationMethodsScreenState extends State { letterSpacing: -0.4), children: [ TextSpan( - text: authenticationViewModel.getType(authenticationViewModel.user!.logInTypeID, context), + text: authenticationViewModel.getType(authenticationViewModel.user.logInTypeID, context), style: TextStyle( color: AppGlobal.appTextColor, fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.5, @@ -172,10 +171,10 @@ class _VerificationMethodsScreenState extends State { mainAxisAlignment: MainAxisAlignment.start, children: [ AppText( - authenticationViewModel.user!.editedOn != null - ? AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.convertStringToDate(authenticationViewModel.user!.editedOn!), isMonthShort: true) - : authenticationViewModel.user!.createdOn != null - ? AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.convertStringToDate(authenticationViewModel.user!.createdOn!), isMonthShort: true) + authenticationViewModel.user.editedOn != null + ? AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.convertStringToDate(authenticationViewModel.user.editedOn), isMonthShort: true) + : authenticationViewModel.user.createdOn != null + ? AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.convertStringToDate(authenticationViewModel.user.createdOn), isMonthShort: true) : '--', textAlign: TextAlign.right, fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 4.5, @@ -184,10 +183,10 @@ class _VerificationMethodsScreenState extends State { letterSpacing: -0.48, ), AppText( - authenticationViewModel.user!.editedOn != null - ? AppDateUtils.getHour(AppDateUtils.convertStringToDate(authenticationViewModel.user!.editedOn!)) - : authenticationViewModel.user!.createdOn != null - ? AppDateUtils.getHour(AppDateUtils.convertStringToDate(authenticationViewModel.user!.createdOn!)) + authenticationViewModel.user.editedOn != null + ? AppDateUtils.getHour(AppDateUtils.convertStringToDate(authenticationViewModel.user.editedOn)) + : authenticationViewModel.user.createdOn != null + ? AppDateUtils.getHour(AppDateUtils.convertStringToDate(authenticationViewModel.user.createdOn)) : '--', textAlign: TextAlign.right, fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.5, @@ -202,7 +201,7 @@ class _VerificationMethodsScreenState extends State { ), ), SizedBox( - height: SizeConfig.heightMultiplier! * 3, + height: SizeConfig.heightMultiplier * 3, ), Row( children: [ @@ -217,7 +216,7 @@ class _VerificationMethodsScreenState extends State { ], ), SizedBox( - height: SizeConfig.heightMultiplier! * 2, + height: SizeConfig.heightMultiplier * 2, ), ], ) @@ -245,12 +244,13 @@ class _VerificationMethodsScreenState extends State { Expanded( child: InkWell( onTap: () => { + print("Fingerprint"), // TODO check this logic it seem it will create bug to us authenticateUser(AuthMethodTypes.Fingerprint, true) }, child: VerificationMethodsList( authenticationViewModel: authenticationViewModel, - authMethodType: SelectedAuthMethodTypesService.getMethodsTypeService(authenticationViewModel.user!.logInTypeID!), + authMethodType: SelectedAuthMethodTypesService.getMethodsTypeService(authenticationViewModel.user.logInTypeID), authenticateUser: (AuthMethodTypes authMethodType, isActive) => authenticateUser(authMethodType, isActive), )), ), @@ -350,6 +350,7 @@ class _VerificationMethodsScreenState extends State { sendActivationCodeByOtpNotificationType(AuthMethodTypes authMethodType) async { if (authMethodType == AuthMethodTypes.SMS || authMethodType == AuthMethodTypes.WhatsApp) { GifLoaderDialogUtils.showMyDialog(context); + await authenticationViewModel.sendActivationCodeForDoctorApp(authMethodType: authMethodType, password: authenticationViewModel.userInfo.password); if (authenticationViewModel.state == ViewState.ErrorLocal) { Utils.showErrorToast(authenticationViewModel.error); @@ -374,7 +375,7 @@ class _VerificationMethodsScreenState extends State { GifLoaderDialogUtils.hideDialog(context); Utils.showErrorToast(authenticationViewModel.error); } else { - await sharedPref.setString(TOKEN, authenticationViewModel.activationCodeVerificationScreenRes.logInTokenID!); + await sharedPref.setString(TOKEN, authenticationViewModel.activationCodeVerificationScreenRes.logInTokenID); if (authMethodType == AuthMethodTypes.SMS || authMethodType == AuthMethodTypes.WhatsApp) { GifLoaderDialogUtils.hideDialog(context); this.startSMSService(authMethodType, isSilentLogin: true); @@ -417,11 +418,11 @@ class _VerificationMethodsScreenState extends State { } } - startSMSService(AuthMethodTypes type, {isSilentLogin = false}) { + startSMSService(AuthMethodTypes type, {isSilentLogin: false}) { new SMSOTP( context, type, - authenticationViewModel.loggedUser != null ? authenticationViewModel.loggedUser!.mobileNumber : authenticationViewModel.user!.mobile, + authenticationViewModel.loggedUser != null ? authenticationViewModel.loggedUser.mobileNumber : authenticationViewModel.user.mobile, (value) { showDialog( context: context, @@ -442,8 +443,8 @@ class _VerificationMethodsScreenState extends State { await authenticationViewModel.showIOSAuthMessages(); if (!mounted) return; if (authenticationViewModel.user != null && - (SelectedAuthMethodTypesService.getMethodsTypeService(authenticationViewModel.user!.logInTypeID!) == AuthMethodTypes.Fingerprint || - SelectedAuthMethodTypesService.getMethodsTypeService(authenticationViewModel.user!.logInTypeID!) == AuthMethodTypes.FaceID)) { + (SelectedAuthMethodTypesService.getMethodsTypeService(authenticationViewModel.user.logInTypeID) == AuthMethodTypes.Fingerprint || + SelectedAuthMethodTypesService.getMethodsTypeService(authenticationViewModel.user.logInTypeID) == AuthMethodTypes.FaceID)) { this.sendActivationCode(authMethodTypes); } else { setState(() { @@ -453,7 +454,7 @@ class _VerificationMethodsScreenState extends State { } } - checkActivationCode({String? value, bool isSilentLogin = false}) async { + checkActivationCode({String value, bool isSilentLogin = false}) async { await authenticationViewModel.checkActivationCodeForDoctorApp(activationCode: value, isSilentLogin: isSilentLogin); if (authenticationViewModel.state == ViewState.ErrorLocal) { Navigator.pop(context); diff --git a/lib/screens/doctor_schedule/doctor_schedule.dart b/lib/screens/doctor_schedule/doctor_schedule.dart new file mode 100644 index 00000000..9bdd4b62 --- /dev/null +++ b/lib/screens/doctor_schedule/doctor_schedule.dart @@ -0,0 +1,465 @@ +import 'package:doctor_app_flutter/core/service/home/dasboard_service.dart'; +import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_datetime_picker/flutter_datetime_picker.dart'; +import 'package:intl/intl.dart'; +import 'package:provider/provider.dart'; +import 'package:flutter_svg/flutter_svg.dart'; +import '../../core/viewModel/project_view_model.dart'; +import '../../core/viewModel/schedule_view_model.dart'; +import '../../icons_app/doctor_app_icons.dart'; +import '../../utils/date-utils.dart'; +import '../../utils/dr_app_toast_msg.dart'; +import '../../utils/translations_delegate_base_utils.dart'; +import '../../widgets/shared/app_scaffold_widget.dart'; +import '../../widgets/shared/errors/error_message.dart'; +import '../base/base_view.dart'; +import '../patients/register_patient/CustomEditableText.dart'; + +class DoctorSchedulePage extends StatefulWidget { + @override + _DoctorSchedulePageState createState() => _DoctorSchedulePageState(); +} + +class _DoctorSchedulePageState extends State { + DashboardService service; + PageController _pageController = PageController(); + double currentPage = 0; + int selectedindex = 0; + List weeks = []; + // List doctorScheduleResponse = []; + int weekMS = 604800 * 1000; + // DoctorList? doctorList; + List freeSlots = []; + bool isPageChange = false; + String fromDate = DateFormat('yyyy-MM-dd').format(DateTime.now()); + String toDate = + DateFormat('yyyy-MM-dd').format(DateTime.now().add(Duration(days: 30))); + // AppSharedPreferences sharedPref = AppSharedPreferences(); + + @override + void initState() { + // this.doctorList = widget.doctorList; + + super.initState(); + } + + @override + Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); + return BaseView( + onModelReady: (model) => model.getDoctorRota(fromDate, toDate), + builder: (_, model, widget2) { + return AppScaffold( + appBarTitle: TranslationBase.of(context).doctorSchedule, + isShowAppBar: true, + baseViewModel: model, + isHomeIcon: false, + isLoading: true, + actionButton: IconButton( + icon: Icon(DoctorApp.search_1), + color: Colors.black, //Colors.black, + onPressed: () => searchSchedule(model), + ), + body: SizedBox( + height: MediaQuery.of(context).size.height, + child: Stack( + children: [ + Column( + children: [ + Padding( + padding: EdgeInsets.only(left: 20), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text( + TranslationBase.of(context).dateFrom + + " " + + DateFormat("dd-MMM").format( + DateFormat('yyyy-MM-dd') + .parse(fromDate)) + + " " + + TranslationBase.of(context).to + + " " + + DateFormat("dd-MMM").format( + DateFormat('yyyy-MM-dd') + .parse(toDate)), + style: TextStyle(fontWeight: FontWeight.w600), + ), + Row( + children: [ + IconButton( + onPressed: () { + + model.getDoctorRota(fromDate, toDate,); + }, + icon: SvgPicture.asset( + 'assets/images/svgs/prev.svg', + height: 25, + width: 10)), + IconButton( + onPressed: () {}, + icon: SvgPicture.asset( + 'assets/images/svgs/next.svg', + height: 25, + width: 10)) + ], + ), + ], + )), + ], + ), + model.getDoctorRotation.length ==0 ? Center( + child: ErrorMessage( + error: TranslationBase.of(context).noDataAvailable, + )) : + Container( + margin: EdgeInsets.only(top: 45), + child: PageView.builder( + controller: _pageController, + itemCount: model.getDoctorRotation.length, + onPageChanged: (index) { + setState(() { + isPageChange = true; + this.currentPage = index.toDouble(); + }); + }, + itemBuilder: (context, index) { + return Container( + child: ListView.builder( + itemCount: model.getDoctorRotation[index] + .scheduleforuser.length, + itemBuilder: (context, index2) => InkWell( + onTap: () { + // final weekDay = weeks[index][index2]['DayName']; + }, + child: Row( + children: [ + Expanded( + flex: 1, + child: Padding( + padding: + projectViewModel.isArabic + ? EdgeInsets.only( + right: 17) + : EdgeInsets.only( + left: 17), + child: Row(children: [ + Column( + children: [ + Text(DateFormat('EEEE') + .format(model + .getDoctorRotation[ + index] + .scheduleforuser[ + index2] + .days) + + // fontSize: 13, + // fontWeight: projectViewModel.isArabic ? FontWeight.w600 : FontWeight.w500, + ), + Text(getDayMonths(model + .getDoctorRotation[ + index] + .scheduleforuser[ + index2] + .days)) + + // fontWeight: FontWeight.bold, + // fontSize: 18, + ], + ) + ])), + ), + Expanded( + flex: 3, + child: ClipRRect( + borderRadius: + const BorderRadius.all( + Radius.circular( + 20.0)), + child: Container( + padding: EdgeInsets.only( + left: 10, + right: 10, + top: 15, + bottom: 20), + margin: EdgeInsets.only( + left: 20, + right: 20, + top: 7, + bottom: 7), + decoration: BoxDecoration( + boxShadow: [ + model + .getDoctorRotation[ + index] + .scheduleforuser[ + index2] + .days + .toString() + .substring( + 0, + 10) == + DateTime.now() + .toString() + .substring( + 0, 10) + ? BoxShadow( + color: Colors + .green, + offset: Offset( + projectViewModel.isArabic + ? 5 + : -5, + 0)) + : BoxShadow( + color: Colors + .grey[ + 100], + blurRadius: + 5, + spreadRadius: + 4, + offset: + Offset( + 0, + 10), + ), + ], + borderRadius: + const BorderRadius.all( + Radius.circular( + 10.0)), + color: Colors.white), + child: Column( + crossAxisAlignment: + CrossAxisAlignment + .start, + children: [ + model + .getDoctorRotation[ + index] + .scheduleforuser[ + index2] + .days + .toString() + .substring( + 0, + 10) == + DateTime.now() + .toString() + .substring( + 0, + 10) + ? Text( + TranslationBase.of( + context) + .today, + style: + TextStyle( + color: Colors + .green, + fontWeight: + FontWeight + .w600, + fontSize: + 12, + )) + : SizedBox(), + // : SizedBox(), + Row( + children: [ + Expanded( + child: Text( + model + .getDoctorRotation[ + index] + .clinicname, + style: + TextStyle( + fontWeight: + FontWeight + .w600, + ), + ), + ), + // Icon(Icons.arrow_forward, size: 16.0), + ], + ), + Container( + height: 45, + child: ListView + .builder( + itemCount: model + .getDoctorRotation[ + index] + .scheduleforuser[ + index2] + .shiftforuser + .length, + itemBuilder: (context, + index3) => + Row(children: [ + Text(model.getDoctorRotation[index].scheduleforuser[index2].shiftforuser[index3].fromtime.toString()), + Text(" To "), + Text(model.getDoctorRotation[index].scheduleforuser[index2].shiftforuser[index3].totime.toString()) + ]))) + + // ],) + ]))), + ), + ], + )))); + }, + )), + // PageViewIndicator( + // isActive: true, + // currentPage: this.currentPage, + // length: weeks.length, + // ) + ], + )), + ); + }); + } + + searchSchedule(model) { + showDialog( + context: context, + builder: (BuildContext context) { + return StatefulBuilder( + builder:(context, setState) { + return + AlertDialog( + title: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + TranslationBase.of(context).search, + style: TextStyle(fontSize: 22), + ), + Text( + TranslationBase.of(context).searchFindSchedule, + style: TextStyle(fontSize: 16), + ) + ], + ), + content: Container( + height: 150, + child: Column(children: [ + InkWell( + onTap: () { + DatePicker.showDatePicker( + context, + showTitleActions: true, + minTime: DateTime(DateTime.now().year - 1, 1, 1), + maxTime: DateTime.now().add(Duration(days:365)), + onConfirm: (date) { + setState(() { + fromDate = DateFormat('yyyy-MM-dd').format(date); + }); + }, + ); + }, + child: Container( + padding: + EdgeInsets.only(top: 5, left: 12, right: 12, bottom: 5), + width: double.infinity, + height: 55, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(12), + color: Colors.white, + boxShadow: [ + BoxShadow( + blurRadius: .26, + spreadRadius: 1 * 1.5, + color: Colors.black.withOpacity(.05)) + ]), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + TranslationBase.of(context).dateFrom, + style: TextStyle(fontSize: 12), + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text(fromDate), + Icon(Icons.calendar_month_outlined) + ]) + ], + ))), + SizedBox(height: 20,), + InkWell( + onTap: () { + DatePicker.showDatePicker( + context, + showTitleActions: true, + minTime: DateTime(DateTime.now().year - 1, 1, 1), + maxTime: DateTime.now().add(Duration(days:365)), + onConfirm: (date) { + setState(() { + toDate = DateFormat('yyyy-MM-dd').format(date); + }); + }, + ); + }, + child: Container( + padding: + EdgeInsets.only(top: 5, left: 12, right: 12, bottom: 5), + width: double.infinity, + height: 55, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(12), + color: Colors.white, + boxShadow: [ + BoxShadow( + blurRadius: .26, + spreadRadius: 1 * 1.5, + color: Colors.black.withOpacity(.05)) + ]), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + TranslationBase.of(context).toDate, + style: TextStyle(fontSize: 12), + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text(toDate), + Icon(Icons.calendar_month_outlined) + ]) + ], + ))) + ]), + ), + actions: [ + AppButton( + title:TranslationBase.of(context).search, + onPressed: () { + setState((){ + model.getDoctorRota(fromDate, toDate); + Navigator.pop(context); + }); + }, + ) + ], + ); + ; + } + ); + + }, + ); + } + + String getDayMonths(DateTime dateTime) { + String dateFormat = + '${dateTime.day} ${AppDateUtils.getMonth(dateTime.month).toString().substring(0, 3)}'; + return dateFormat; + } +} diff --git a/lib/screens/live_care/video_call.dart b/lib/screens/live_care/video_call.dart index fc12d05b..146519c6 100644 --- a/lib/screens/live_care/video_call.dart +++ b/lib/screens/live_care/video_call.dart @@ -19,7 +19,7 @@ class VideoCallPage extends StatefulWidget { final listContext; final LiveCarePatientViewModel model; - VideoCallPage({required this.patientData, this.listContext, required this.model}); + VideoCallPage({this.patientData, this.listContext, this.model}); @override _VideoCallPageState createState() => _VideoCallPageState(); @@ -28,10 +28,10 @@ class VideoCallPage extends StatefulWidget { DrAppSharedPreferances sharedPref = DrAppSharedPreferances(); class _VideoCallPageState extends State { - Timer? _timmerInstance; + Timer _timmerInstance; int _start = 0; String _timmer = ''; - LiveCareViewModel _liveCareProvider = LiveCareViewModel(); + LiveCareViewModel _liveCareProvider; bool _isInit = true; var _tokenData; bool isTransfer = false; @@ -68,13 +68,9 @@ class _VideoCallPageState extends State { kSessionId: tokenData.openSessionID, //'1_MX40NjgwMzIyNH5-MTU5MzY4MzYzODYwM35ucExWYVRVSm5Hcy9uWGZmM1lOa3czZHV-fg', kApiKey: '46209962', - vcId: widget.patientData.vcId!, - isRecording: tokenData != null ? tokenData.isRecording! : false, - patientName: widget.patientData.fullName == null - ? widget.patientData.firstName != null - ? "${widget.patientData.firstName} ${widget.patientData.lastName}" - : "-" - : "", + vcId: widget.patientData.vcId, + isRecording: tokenData != null ? tokenData.isRecording : false, + patientName: widget.patientData.fullName ?? widget.patientData.firstName != null ? "${widget.patientData.firstName} ${widget.patientData.lastName}" : "-", tokenID: token, //"hfkjshdf347r8743", generalId: "Cs2020@2016\$2958", @@ -140,7 +136,7 @@ class _VideoCallPageState extends State { height: MediaQuery.of(context).size.height * 0.02, ), Text( - widget.patientData.fullName!, + widget.patientData.fullName, style: TextStyle(color: Colors.deepPurpleAccent, fontWeight: FontWeight.w900, fontSize: 20), ), SizedBox( @@ -202,7 +198,8 @@ class _VideoCallPageState extends State { width: MediaQuery.of(context).size.width * .9, child: Stack( fit: StackFit.loose, - clipBehavior: Clip.none, + // overflow: Overflow.visible, + children: [ Positioned( right: -40.0, @@ -226,43 +223,30 @@ class _VideoCallPageState extends State { Padding( padding: EdgeInsets.all(8.0), child: ElevatedButton( - onPressed: () => {endCall()}, - child: Text(TranslationBase.of(context).endcall), - style: ButtonStyle( - backgroundColor: MaterialStateProperty.all( - Colors.red, - ), - textStyle: MaterialStateProperty.all( - TextStyle(color: Colors.white), - ), - ), - )), + onPressed: () => {endCall()}, + child: Text(TranslationBase.of(context).endcall), + style: ElevatedButton.styleFrom(backgroundColor: Colors.red, textStyle: TextStyle(color: Colors.white)) + + //color: Colors.red, + //textColor: Colors.white, + )), Padding( padding: EdgeInsets.all(8.0), child: ElevatedButton( - onPressed: () => {resumeCall()}, - child: Text(TranslationBase.of(context).resumecall), - style: ButtonStyle( - backgroundColor: MaterialStateProperty.all( - AppGlobal.appGreenColor, - ), - textStyle: MaterialStateProperty.all( - TextStyle(color: Colors.white), + onPressed: () => {resumeCall()}, + child: Text(TranslationBase.of(context).resumecall), + style: ElevatedButton.styleFrom(backgroundColor: AppGlobal.appGreenColor, textStyle: TextStyle(color: Colors.white)) + + // color: AppGlobal.appGreenColor, + // textColor: Colors.white, ), - ), - ), ), Padding( padding: EdgeInsets.all(8.0), child: ElevatedButton( - onPressed: () => {endCallWithCharge()}, - child: Text(TranslationBase.of(context).endcallwithcharge), - style: ButtonStyle( - textStyle: MaterialStateProperty.all( - TextStyle(color: Colors.white), - ), - ), - ), + onPressed: () => {endCallWithCharge()}, + child: Text(TranslationBase.of(context).endcallwithcharge), + style: ElevatedButton.styleFrom(textStyle: TextStyle(color: Colors.white))), ), Padding( padding: EdgeInsets.all(8.0), @@ -271,11 +255,8 @@ class _VideoCallPageState extends State { setState(() => {isTransfer = true}) }, child: Text(TranslationBase.of(context).transfertoadmin), - style: ButtonStyle( - backgroundColor: MaterialStateProperty.all( - Colors.yellow[900], - ), - ), + style: ElevatedButton.styleFrom(textStyle: TextStyle(color: Colors.yellow[900])), + // color: Colors.yellow[900], ), ), isTransfer == true @@ -294,11 +275,7 @@ class _VideoCallPageState extends State { child: ElevatedButton( onPressed: () => {this.transferToAdmin(notes)}, child: Text('Transfer'), - style: ButtonStyle( - backgroundColor: MaterialStateProperty.all( - Colors.yellow[900], - ), - ), + style: ElevatedButton.styleFrom(textStyle: TextStyle(color: Colors.yellow[900])), )) ], ) diff --git a/lib/screens/medical-file/medical_file_details.dart b/lib/screens/medical-file/medical_file_details.dart index bdf0c28c..1f2666ff 100644 --- a/lib/screens/medical-file/medical_file_details.dart +++ b/lib/screens/medical-file/medical_file_details.dart @@ -1,6 +1,6 @@ +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/core/viewModel/medical_file_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; -import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/utils/date-utils.dart'; import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; @@ -16,52 +16,52 @@ import 'package:provider/provider.dart'; import '../../widgets/shared/errors/error_message.dart'; class MedicalFileDetails extends StatefulWidget { - String? age; - String? firstName; - String? lastName; - String? gender; - int? encounterNumber; - int? pp; - PatiantInformtion? patient; - String? clinicName; - String? episode; - String? doctorName; - String? vistDate; - String? doctorImage; + String age; + String firstName; + String lastName; + String gender; + int encounterNumber; + int pp; + PatiantInformtion patient; + String clinicName; + String episode; + String doctorName; + String vistDate; + String doctorImage; MedicalFileDetails( {this.age, this.firstName, this.lastName, this.gender, this.encounterNumber, this.pp, this.patient, this.doctorName, this.vistDate, this.clinicName, this.episode, this.doctorImage}); @override _MedicalFileDetailsState createState() => _MedicalFileDetailsState( - firstName: firstName!, - age: age!, - lastName: lastName!, - gender: gender!, - encounterNumber: encounterNumber!, - pp: pp!, - patient: patient!, - clinicName: clinicName!, - doctorName: doctorName!, - episode: episode!, - vistDate: vistDate!, - doctorImage: doctorImage!, + firstName: firstName, + age: age, + lastName: lastName, + gender: gender, + encounterNumber: encounterNumber, + pp: pp, + patient: patient, + clinicName: clinicName, + doctorName: doctorName, + episode: episode, + vistDate: vistDate, + doctorImage: doctorImage, ); } class _MedicalFileDetailsState extends State { - int? encounterNumber; - String? age; - String? firstName; - String? lastName; - String? gender; - int? pp; - PatiantInformtion? patient; - String? clinicName; - String? episode; - String? doctorName; - String? vistDate; - String? doctorImage; + int encounterNumber; + String age; + String firstName; + String lastName; + String gender; + int pp; + PatiantInformtion patient; + String clinicName; + String episode; + String doctorName; + String vistDate; + String doctorImage; _MedicalFileDetailsState( {this.age, this.firstName, this.lastName, this.gender, this.encounterNumber, this.pp, this.patient, this.doctorName, this.vistDate, this.clinicName, this.episode, this.doctorImage}); @@ -77,20 +77,20 @@ class _MedicalFileDetailsState extends State { return BaseView( onModelReady: (model) async { if (model.medicalFileList.length == 0) { - model.getMedicalFile(mrn: pp!); + model.getMedicalFile(mrn: pp); } }, - builder: (BuildContext context, MedicalFileViewModel model, Widget? child) => AppScaffold( + builder: (BuildContext context, MedicalFileViewModel model, Widget child) => AppScaffold( appBar: PatientProfileAppBar( - patient!, - doctorName: doctorName!, - profileUrl: doctorImage!, - clinic: clinicName!, + patient, + doctorName: doctorName, + profileUrl: doctorImage, + clinic: clinicName, isPrescriptions: true, isMedicalFile: true, - episode: episode!, + episode: episode, visitDate: '${AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat( - vistDate!, + vistDate, ), isArabic: projectViewModel.isArabic)}', isAppointmentHeader: true, ), @@ -103,14 +103,14 @@ class _MedicalFileDetailsState extends State { child: Container( child: Column( children: [ - model.medicalFileList.length != 0 && model.medicalFileList[0].entityList![0].timelines![encounterNumber!].timeLineEvents![0].consulations!.length != 0 + model.medicalFileList.length != 0 && model.medicalFileList[0].entityList[0].timelines[encounterNumber].timeLineEvents[0].consulations.length != 0 ? Padding( padding: EdgeInsets.all(10.0), child: Container( child: Column( children: [ SizedBox(height: 25.0), - if (model.medicalFileList.length != 0 && model.medicalFileList[0].entityList![0].timelines![encounterNumber!].timeLineEvents![0].consulations!.length != 0) + if (model.medicalFileList.length != 0 && model.medicalFileList[0].entityList[0].timelines[encounterNumber].timeLineEvents[0].consulations.length != 0) Container( width: double.infinity, margin: EdgeInsets.only(top: 10, left: 10, right: 10), @@ -120,7 +120,7 @@ class _MedicalFileDetailsState extends State { borderRadius: BorderRadius.all( Radius.circular(10.0), ), - border: Border.all(color: Colors.grey[200]!, width: 0.5), + border: Border.all(color: Colors.grey[200], width: 0.5), ), child: Padding( padding: const EdgeInsets.all(15.0), @@ -147,7 +147,7 @@ class _MedicalFileDetailsState extends State { physics: NeverScrollableScrollPhysics(), scrollDirection: Axis.vertical, shrinkWrap: true, - itemCount: model.medicalFileList[0].entityList![0].timelines![encounterNumber!].timeLineEvents![0].consulations![0].lstCheifComplaint!.length, + itemCount: model.medicalFileList[0].entityList[0].timelines[encounterNumber].timeLineEvents[0].consulations[0].lstCheifComplaint.length, itemBuilder: (BuildContext ctxt, int index) { return Padding( padding: EdgeInsets.all(8.0), @@ -159,7 +159,7 @@ class _MedicalFileDetailsState extends State { children: [ Expanded( child: AppText( - model.medicalFileList[0].entityList![0].timelines![encounterNumber!].timeLineEvents![0].consulations![0].lstCheifComplaint![index].hOPI! + model.medicalFileList[0].entityList[0].timelines[encounterNumber].timeLineEvents[0].consulations[0].lstCheifComplaint[index].hOPI .trim(), ), ), @@ -182,7 +182,7 @@ class _MedicalFileDetailsState extends State { SizedBox( height: 30, ), - if (model.medicalFileList.length != 0 && model.medicalFileList[0].entityList![0].timelines![encounterNumber!].timeLineEvents![0].consulations!.length != 0) + if (model.medicalFileList.length != 0 && model.medicalFileList[0].entityList[0].timelines[encounterNumber].timeLineEvents[0].consulations.length != 0) Container( width: double.infinity, margin: EdgeInsets.only(top: 10, left: 10, right: 10), @@ -192,7 +192,7 @@ class _MedicalFileDetailsState extends State { borderRadius: BorderRadius.all( Radius.circular(10.0), ), - border: Border.all(color: Colors.grey[200]!, width: 0.5), + border: Border.all(color: Colors.grey[200], width: 0.5), ), child: Padding( padding: const EdgeInsets.all(15.0), @@ -219,7 +219,7 @@ class _MedicalFileDetailsState extends State { physics: NeverScrollableScrollPhysics(), scrollDirection: Axis.vertical, shrinkWrap: true, - itemCount: model.medicalFileList[0].entityList![0].timelines![encounterNumber!].timeLineEvents![0].consulations![0].lstAssessments!.length, + itemCount: model.medicalFileList[0].entityList[0].timelines[encounterNumber].timeLineEvents[0].consulations[0].lstAssessments.length, itemBuilder: (BuildContext ctxt, int index) { return Padding( padding: EdgeInsets.all(8.0), @@ -234,8 +234,7 @@ class _MedicalFileDetailsState extends State { fontSize: 13.0, ), AppText( - model.medicalFileList[0].entityList![0].timelines![encounterNumber!].timeLineEvents![0].consulations![0].lstAssessments![index].iCD10! - .trim(), + model.medicalFileList[0].entityList[0].timelines[encounterNumber].timeLineEvents[0].consulations[0].lstAssessments[index].iCD10.trim(), fontSize: 13.5, fontWeight: FontWeight.w700, ), @@ -250,8 +249,7 @@ class _MedicalFileDetailsState extends State { ), Expanded( child: AppText( - model.medicalFileList[0].entityList![0].timelines![encounterNumber!].timeLineEvents![0].consulations![0].lstAssessments![index] - .condition! + model.medicalFileList[0].entityList[0].timelines[encounterNumber].timeLineEvents[0].consulations[0].lstAssessments[index].condition .trim(), fontSize: 13.0, fontWeight: FontWeight.w700, @@ -263,8 +261,7 @@ class _MedicalFileDetailsState extends State { children: [ Expanded( child: AppText( - model.medicalFileList[0].entityList![0].timelines![encounterNumber!].timeLineEvents![0].consulations![0].lstAssessments![index] - .description!, + model.medicalFileList[0].entityList[0].timelines[encounterNumber].timeLineEvents[0].consulations[0].lstAssessments[index].description, fontWeight: FontWeight.w700, fontSize: 15.0, ), @@ -279,7 +276,7 @@ class _MedicalFileDetailsState extends State { ), Expanded( child: AppText( - model.medicalFileList[0].entityList![0].timelines![encounterNumber!].timeLineEvents![0].consulations![0].lstAssessments![index].type!, + model.medicalFileList[0].entityList[0].timelines[encounterNumber].timeLineEvents[0].consulations[0].lstAssessments[index].type, fontSize: 16.0, fontWeight: FontWeight.w700, ), @@ -290,8 +287,7 @@ class _MedicalFileDetailsState extends State { height: 15.0, ), AppText( - model.medicalFileList[0].entityList![0].timelines![encounterNumber!].timeLineEvents![0].consulations![0].lstAssessments![index].remarks! - .trim(), + model.medicalFileList[0].entityList[0].timelines[encounterNumber].timeLineEvents[0].consulations[0].lstAssessments[index].remarks.trim(), ), Divider( height: 1, @@ -314,7 +310,7 @@ class _MedicalFileDetailsState extends State { SizedBox( height: 30, ), - if (model.medicalFileList.length != 0 && model.medicalFileList[0].entityList![0].timelines![encounterNumber!].timeLineEvents![0].consulations!.length != 0) + if (model.medicalFileList.length != 0 && model.medicalFileList[0].entityList[0].timelines[encounterNumber].timeLineEvents[0].consulations.length != 0) Container( width: double.infinity, margin: EdgeInsets.only(top: 10, left: 10, right: 10), @@ -324,7 +320,7 @@ class _MedicalFileDetailsState extends State { borderRadius: BorderRadius.all( Radius.circular(10.0), ), - border: Border.all(color: Colors.grey[200]!, width: 0.5), + border: Border.all(color: Colors.grey[200], width: 0.5), ), child: Padding( padding: const EdgeInsets.all(15.0), @@ -351,7 +347,7 @@ class _MedicalFileDetailsState extends State { physics: NeverScrollableScrollPhysics(), scrollDirection: Axis.vertical, shrinkWrap: true, - itemCount: model.medicalFileList[0].entityList![0].timelines![encounterNumber!].timeLineEvents![0].consulations![0].lstProcedure!.length, + itemCount: model.medicalFileList[0].entityList[0].timelines[encounterNumber].timeLineEvents[0].consulations[0].lstProcedure.length, itemBuilder: (BuildContext ctxt, int index) { return Padding( padding: EdgeInsets.all(8.0), @@ -367,8 +363,7 @@ class _MedicalFileDetailsState extends State { 'Procedure ID: ', ), AppText( - model.medicalFileList[0].entityList![0].timelines![encounterNumber!].timeLineEvents![0].consulations![0].lstProcedure![index] - .procedureId! + model.medicalFileList[0].entityList[0].timelines[encounterNumber].timeLineEvents[0].consulations[0].lstProcedure[index].procedureId .trim(), fontSize: 13.5, fontWeight: FontWeight.w700, @@ -383,8 +378,7 @@ class _MedicalFileDetailsState extends State { ), AppText( AppDateUtils.getDateFormatted(DateTime.parse( - model.medicalFileList[0].entityList![0].timelines![encounterNumber!].timeLineEvents![0].consulations![0].lstProcedure![index] - .orderDate! + model.medicalFileList[0].entityList[0].timelines[encounterNumber].timeLineEvents[0].consulations[0].lstProcedure[index].orderDate .trim(), )), fontSize: 13.5, @@ -401,7 +395,7 @@ class _MedicalFileDetailsState extends State { children: [ Expanded( child: AppText( - model.medicalFileList[0].entityList![0].timelines![encounterNumber!].timeLineEvents![0].consulations![0].lstProcedure![index].procName!, + model.medicalFileList[0].entityList[0].timelines[encounterNumber].timeLineEvents[0].consulations[0].lstProcedure[index].procName, fontWeight: FontWeight.w700, ), ) @@ -413,7 +407,7 @@ class _MedicalFileDetailsState extends State { 'CPT Code : ', ), AppText( - model.medicalFileList[0].entityList![0].timelines![encounterNumber!].timeLineEvents![0].consulations![0].lstProcedure![index].patientID + model.medicalFileList[0].entityList[0].timelines[encounterNumber].timeLineEvents[0].consulations[0].lstProcedure[index].patientID .toString(), fontWeight: FontWeight.w700, ), @@ -443,7 +437,7 @@ class _MedicalFileDetailsState extends State { SizedBox( height: 30, ), - if (model.medicalFileList.length != 0 && model.medicalFileList[0].entityList![0].timelines![encounterNumber!].timeLineEvents![0].consulations!.length != 0) + if (model.medicalFileList.length != 0 && model.medicalFileList[0].entityList[0].timelines[encounterNumber].timeLineEvents[0].consulations.length != 0) Container( width: double.infinity, margin: EdgeInsets.only(top: 10, left: 10, right: 10), @@ -453,7 +447,7 @@ class _MedicalFileDetailsState extends State { borderRadius: BorderRadius.all( Radius.circular(10.0), ), - border: Border.all(color: Colors.grey[200]!, width: 0.5), + border: Border.all(color: Colors.grey[200], width: 0.5), ), child: Padding( padding: const EdgeInsets.all(15.0), @@ -480,7 +474,7 @@ class _MedicalFileDetailsState extends State { physics: NeverScrollableScrollPhysics(), scrollDirection: Axis.vertical, shrinkWrap: true, - itemCount: model.medicalFileList[0].entityList![0].timelines![encounterNumber!].timeLineEvents![0].consulations![0].lstPhysicalExam!.length, + itemCount: model.medicalFileList[0].entityList[0].timelines[encounterNumber].timeLineEvents[0].consulations[0].lstPhysicalExam.length, itemBuilder: (BuildContext ctxt, int index) { return Padding( padding: EdgeInsets.all(8.0), @@ -491,7 +485,7 @@ class _MedicalFileDetailsState extends State { children: [ AppText(TranslationBase.of(context).examType + ": "), AppText( - model.medicalFileList[0].entityList![0].timelines![encounterNumber!].timeLineEvents![0].consulations![0].lstPhysicalExam![index].examDesc!, + model.medicalFileList[0].entityList[0].timelines[encounterNumber].timeLineEvents[0].consulations[0].lstPhysicalExam[index].examDesc, fontWeight: FontWeight.w700, ), ], @@ -499,7 +493,7 @@ class _MedicalFileDetailsState extends State { Row( children: [ AppText( - model.medicalFileList[0].entityList![0].timelines![encounterNumber!].timeLineEvents![0].consulations![0].lstPhysicalExam![index].examDesc!, + model.medicalFileList[0].entityList[0].timelines[encounterNumber].timeLineEvents[0].consulations[0].lstPhysicalExam[index].examDesc, fontWeight: FontWeight.w700, ) ], @@ -508,7 +502,7 @@ class _MedicalFileDetailsState extends State { children: [ AppText(TranslationBase.of(context).abnormal + ": "), AppText( - model.medicalFileList[0].entityList![0].timelines![encounterNumber!].timeLineEvents![0].consulations![0].lstPhysicalExam![index].abnormal!, + model.medicalFileList[0].entityList[0].timelines[encounterNumber].timeLineEvents[0].consulations[0].lstPhysicalExam[index].abnormal, fontWeight: FontWeight.w700, ), ], @@ -517,7 +511,7 @@ class _MedicalFileDetailsState extends State { height: 15.0, ), AppText( - model.medicalFileList[0].entityList![0].timelines![encounterNumber!].timeLineEvents![0].consulations![0].lstPhysicalExam![index].remarks!, + model.medicalFileList[0].entityList[0].timelines[encounterNumber].timeLineEvents[0].consulations[0].lstPhysicalExam[index].remarks, ), Divider( height: 1, diff --git a/lib/screens/medicine/medicine_search_screen.dart b/lib/screens/medicine/medicine_search_screen.dart index 25d751c7..b7e49ca5 100644 --- a/lib/screens/medicine/medicine_search_screen.dart +++ b/lib/screens/medicine/medicine_search_screen.dart @@ -1,5 +1,4 @@ import 'dart:math'; - import 'package:autocomplete_textfield/autocomplete_textfield.dart'; import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/core/model/search_drug/get_medication_response_model.dart'; @@ -7,10 +6,11 @@ import 'package:doctor_app_flutter/core/viewModel/medicine_view_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/medicine/pharmacies_list_screen.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.dart'; -import 'package:doctor_app_flutter/utils/dr_app_shared_pref.dart'; import 'package:doctor_app_flutter/utils/extenstions_utils.dart'; -import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; +import 'package:doctor_app_flutter/utils/dr_app_shared_pref.dart'; +import 'package:doctor_app_flutter/utils/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/utils/utils.dart'; +import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; import 'package:doctor_app_flutter/widgets/medicine/medicine_item_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; @@ -25,10 +25,10 @@ import 'package:speech_to_text/speech_to_text.dart'; DrAppSharedPreferances sharedPref = DrAppSharedPreferances(); -class MedicineSearchScreen extends StatefulWidget { +class MedicineSearchScreen extends StatefulWidget with DrAppToastMsg { MedicineSearchScreen({this.changeLoadingState}); - final Function? changeLoadingState; + final Function changeLoadingState; @override _MedicineSearchState createState() => _MedicineSearchState(); @@ -42,22 +42,27 @@ class _MedicineSearchState extends State { String _currentLocaleId = ""; final SpeechToText speech = SpeechToText(); String lastStatus = ''; - GlobalKey key = new GlobalKey>(); + GlobalKey key = + new GlobalKey>(); - String? lastError; + String lastError; double level = 0.0; double minSoundLevel = 50000; double maxSoundLevel = -50000; - String? recognizedWord; + String recognizedWord; @override void didChangeDependencies() { super.didChangeDependencies(); } + Future initSpeechState() async { - bool hasSpeech = await speech.initialize(onError: errorListener, onStatus: statusListener); - _currentLocaleId = TranslationBase.of(context).locale.languageCode == 'en' ? 'en-GB' : 'ar-SA'; // systemLocale.localeId; + bool hasSpeech = await speech.initialize( + onError: errorListener, onStatus: statusListener); + _currentLocaleId = TranslationBase.of(context).locale.languageCode == 'en' + ? 'en-GB' + : 'ar-SA'; // systemLocale.localeId; if (!mounted) return; setState(() { @@ -65,46 +70,54 @@ class _MedicineSearchState extends State { }); } + + @override + void dispose() { + super.dispose(); + + } + @override Widget build(BuildContext context) { - return BaseView( - onModelReady: (model) async {}, - builder: (_, model, w) { - myController.text = model.searchText; - return AppScaffold( - // baseViewModel: model, - isShowAppBar: true, - appBar: BottomSheetTitle( - title: TranslationBase.of(context).searchMedicine, - ), - body: SingleChildScrollView( - child: Column( + return BaseView(onModelReady: (model) async { + }, builder: (_, model, w) { + // myController.text = model.searchText; + return AppScaffold( + // baseViewModel: model, + isShowAppBar: true, + appBar: BottomSheetTitle( + title: TranslationBase.of(context).searchMedicine, + ), + body: SingleChildScrollView( + child: Column( mainAxisAlignment: MainAxisAlignment.start, children: [ SizedBox( - height: 20, + height: 10, ), AppTextFieldCustomSearch( - hintText: TranslationBase.of(context).searchMedicineNameHere, + hintText: + TranslationBase.of(context).searchMedicineNameHere, searchController: myController, onFieldSubmitted: (value) { searchMedicine(context, model); }, marginTop: 5, - onChangeFun: (val) {}, ), Container( margin: EdgeInsets.only(left: 16, right: 16, bottom: 16, top: 0), + child: Row( crossAxisAlignment: CrossAxisAlignment.start, children: [ Expanded( child: AppText( TranslationBase.of(context).youCanFind + - (myController.text != '' ? model.pharmacyItemsList.length.toString() : '0') + + (myController.text != '' + ? model.pharmacyItemsList.length.toString() + : '0') + " " + - TranslationBase.of(context).medicineSearchResult + - " '${myController.text}'", + TranslationBase.of(context).medicineSearchResult +" '${myController.text}'", fontHeight: 1.4, color: AppGlobal.appTextColor, textAlign: TextAlign.start, @@ -121,23 +134,33 @@ class _MedicineSearchState extends State { if (myController.text != '') Container( margin: EdgeInsets.only(left: 16, right: 16, bottom: 16, top: 0), + height: MediaQuery.of(context).size.height * 0.6, child: ListView.builder( padding: const EdgeInsets.only(top: 20), scrollDirection: Axis.vertical, - itemCount: model.pharmacyItemsList == null ? 0 : model.pharmacyItemsList.length, + itemCount: model.pharmacyItemsList == null + ? 0 + : model.pharmacyItemsList.length, itemBuilder: (BuildContext context, int index) { return InkWell( child: MedicineItemWidget( - label: model.pharmacyItemsList[index]["ItemDescription"], - url: model.pharmacyItemsList[index]["ImageSRCUrl"], + label: model.pharmacyItemsList[index] + ["ItemDescription"], + url: model.pharmacyItemsList[index] + ["ImageSRCUrl"], ), onTap: () { Navigator.push( context, MaterialPageRoute( - builder: (context) => PharmaciesListScreen(itemID: model.pharmacyItemsList[index]["ItemID"], url: model.pharmacyItemsList[index]["ImageSRCUrl"]), - settings: RouteSettings(name: 'PharmaciesListScreen'), + builder: (context) => PharmaciesListScreen( + itemID: model.pharmacyItemsList[index] + ["ItemID"], + url: model.pharmacyItemsList[index] + ["ImageSRCUrl"]), + settings: RouteSettings( + name: 'PharmaciesListScreen'), ), ); }, @@ -147,44 +170,45 @@ class _MedicineSearchState extends State { ), ], )), - bottomSheet: Container( - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.all( - Radius.circular(0.0), - ), - border: Border.all(color: HexColor('#707070'), width: 0), + bottomSheet: Container( + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.all( + Radius.circular(0.0), + ), + border: Border.all(color: HexColor('#707070'), width: 0), + ), + height: MediaQuery.of(context).size.height * 0.1, + width: double.infinity, + child: Column( + children: [ + SizedBox( + height: 10, ), - height: MediaQuery.of(context).size.height * 0.1, - width: double.infinity, - child: Column( - children: [ - SizedBox( - height: 10, - ), - Container( - child: FractionallySizedBox( - widthFactor: .80, - child: Center( - child: AppButton( - fontWeight: FontWeight.w700, - title: TranslationBase.of(context).search, - onPressed: () async { - await searchMedicine(context, model); - }, - color: AppGlobal.appRedColor, - ), - ), + Container( + child: FractionallySizedBox( + widthFactor: .80, + child: Center( + child: AppButton( + fontWeight: FontWeight.w700, + title: TranslationBase.of(context).search, + onPressed: () async { + await searchMedicine(context, model); + }, + color: AppGlobal.appRedColor, ), ), - SizedBox( - height: 5, - ), - ], + ), ), - ), - ); - }); + SizedBox( + height: 5, + ), + ], + ), + ), + + ); + }); } searchMedicine(context, MedicineViewModel model) async { @@ -222,8 +246,9 @@ class _MedicineSearchState extends State { setState(() { recognizedWord = result.recognizedWords; lastStatus = ''; - myController.text = recognizedWord!; - Future.delayed(const Duration(seconds: 2), () {}); + myController.text = recognizedWord; + Future.delayed(const Duration(seconds: 2), () { + }); }); } @@ -240,6 +265,7 @@ class _MedicineSearchState extends State { }); } + void soundLevelListener(double level) { minSoundLevel = min(minSoundLevel, level); maxSoundLevel = max(maxSoundLevel, level); diff --git a/lib/screens/patient-sick-leave/patient_sick_leave_screen.dart b/lib/screens/patient-sick-leave/patient_sick_leave_screen.dart index d81ffa82..6382ce1f 100644 --- a/lib/screens/patient-sick-leave/patient_sick_leave_screen.dart +++ b/lib/screens/patient-sick-leave/patient_sick_leave_screen.dart @@ -1,16 +1,16 @@ import 'package:cached_network_image/cached_network_image.dart'; import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/core/model/sick_leave/sick_leave_patient_model.dart'; import 'package:doctor_app_flutter/core/service/AnalyticsService.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/sick_leave_view_model.dart'; import 'package:doctor_app_flutter/locator.dart'; -import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/patient-sick-leave/add_patient_sick_leave_screen.dart'; import 'package:doctor_app_flutter/utils/date-utils.dart'; -import 'package:doctor_app_flutter/utils/utils.dart'; import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; +import 'package:doctor_app_flutter/utils/utils.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/add-order/addNewOrder.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-profile-app-bar.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; @@ -64,18 +64,14 @@ class PatientSickLeaveScreen extends StatelessWidget { if (!projectsProvider.isArabic) AppText( TranslationBase.of(context).patient, - fontSize: - SizeConfig.getTextMultiplierBasedOnWidth() * - (SizeConfig.isWidthLarge ? 3 : 4), + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * (SizeConfig.isWidthLarge ? 3 : 4), fontWeight: FontWeight.w700, letterSpacing: -0.72, color: Color(0xFF2E303A), ), AppText( TranslationBase.of(context).sickLeave, - fontSize: - SizeConfig.getTextMultiplierBasedOnWidth() * - (SizeConfig.isWidthLarge ? 6 : 6), + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * (SizeConfig.isWidthLarge ? 6 : 6), fontWeight: FontWeight.bold, letterSpacing: -1.44, color: Color(0xFF2E303A), @@ -105,8 +101,7 @@ class PatientSickLeaveScreen extends StatelessWidget { shrinkWrap: true, itemCount: model.getAllSIckLeavePatient.length, itemBuilder: (BuildContext ctxt, int index) { - SickLeavePatientModel item = - model.getAllSIckLeavePatient[index]; + SickLeavePatientModel item = model.getAllSIckLeavePatient[index]; return Column( children: [ CardWithBgWidget( @@ -122,42 +117,31 @@ class PatientSickLeaveScreen extends StatelessWidget { child: Column( children: [ if (item.doctorName != null) - Row( - crossAxisAlignment: - CrossAxisAlignment.start, - mainAxisAlignment: - MainAxisAlignment.start, - children: [ - Expanded( - // width: MediaQuery.of(context).size.width*0.51, - child: AppText( - Utils.capitalize( - item.doctorName ?? ""), - fontSize: 18, - color: Color(0xff2e303a), - fontWeight: FontWeight.w700, - fontFamily: 'Poppins', - textOverflow: - TextOverflow.ellipsis, - ), - ), - ]), + Row(crossAxisAlignment: CrossAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start, children: [ + Expanded( + // width: MediaQuery.of(context).size.width*0.51, + child: AppText( + Utils.capitalize(item.doctorName ?? ""), + fontSize: 18, + color: Color(0xff2e303a), + fontWeight: FontWeight.w700, + fontFamily: 'Poppins', + textOverflow: TextOverflow.ellipsis, + ), + ), + ]), SizedBox( height: 10, ), Row( children: [ ClipRRect( - borderRadius: - BorderRadius.circular(50.0), + borderRadius: BorderRadius.circular(50.0), child: CachedNetworkImage( - imageUrl: item.doctorImageURL ?? - "https://hmgwebservices.com/Images/MobileImages/DUBAI/unkown.png", + imageUrl: item.doctorImageURL ?? "https://hmgwebservices.com/Images/MobileImages/DUBAI/unkown.png", height: 30, width: 30, - errorWidget: - (context, url, error) => - AppText( + errorWidget: (context, url, error) => AppText( 'No Image', fontSize: 10, ), @@ -170,90 +154,36 @@ class PatientSickLeaveScreen extends StatelessWidget { child: Column( children: [ CustomRow( - label: TranslationBase.of( - context) - .daysSickleave, - labelSize: SizeConfig - .getTextMultiplierBasedOnWidth() * - 3.3, - valueSize: SizeConfig - .getTextMultiplierBasedOnWidth() * - 4, - value: (item.sickLeaveDays - .toString() != - null && - item.sickLeaveDays - .toString() != - "null") - ? item.sickLeaveDays - .toString() - : item.noOfDays - .toString(), + label: TranslationBase.of(context).daysSickleave, + labelSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.3, + valueSize: SizeConfig.getTextMultiplierBasedOnWidth() * 4, + value: + (item.sickLeaveDays.toString() != null && item.sickLeaveDays.toString() != "null") ? item.sickLeaveDays.toString() : item.noOfDays.toString(), ), CustomRow( - label: TranslationBase.of( - context) - .startDate + - ' ' ?? - "", - labelSize: SizeConfig - .getTextMultiplierBasedOnWidth() * - 3.3, - valueSize: SizeConfig - .getTextMultiplierBasedOnWidth() * - 4, - value: AppDateUtils - .getDayMonthYearDateFormatted( - item.startDate.contains( - "/Date(") - ? AppDateUtils - .convertStringToDate( - item - .startDate) - : DateTime.parse( - item.startDate), + label: TranslationBase.of(context).startDate + ' ' ?? "", + labelSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.3, + valueSize: SizeConfig.getTextMultiplierBasedOnWidth() * 4, + value: AppDateUtils.getDayMonthYearDateFormatted( + item.startDate.contains("/Date(") ? AppDateUtils.convertStringToDate(item.startDate) : DateTime.parse(item.startDate), ), ), CustomRow( - label: TranslationBase.of( - context) - .endDate + - ' ' ?? - "", - labelSize: SizeConfig - .getTextMultiplierBasedOnWidth() * - 3.3, - valueSize: SizeConfig - .getTextMultiplierBasedOnWidth() * - 4, - value: AppDateUtils - .getDayMonthYearDateFormatted( - item.startDate.contains( - "/Date(") - ? AppDateUtils - .convertStringToDate( - item.endDate ?? - "") - .add( - Duration( - days: item - .noOfDays ?? - item.sickLeaveDays), + label: TranslationBase.of(context).endDate + ' ' ?? "", + labelSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.3, + valueSize: SizeConfig.getTextMultiplierBasedOnWidth() * 4, + value: AppDateUtils.getDayMonthYearDateFormatted( + item.startDate.contains("/Date(") + ? AppDateUtils.convertStringToDate(item.endDate ?? "").add( + Duration(days: item.noOfDays ?? item.sickLeaveDays), ) - : DateTime.parse( - item.startDate ?? - "") - .add( - Duration( - days: - item.noOfDays ?? - ""), + : DateTime.parse(item.startDate ?? "").add( + Duration(days: item.noOfDays ?? ""), ), ), ), ], - crossAxisAlignment: - CrossAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, ), ), ], diff --git a/lib/screens/patients/DischargedPatientPage.dart b/lib/screens/patients/DischargedPatientPage.dart index 30cf3642..546a331b 100644 --- a/lib/screens/patients/DischargedPatientPage.dart +++ b/lib/screens/patients/DischargedPatientPage.dart @@ -29,7 +29,7 @@ class _DischargedPatientState extends State { builder: (_, model, w) => AppScaffold( //appBarTitle: 'Discharged Patient', //subtitle: "Last Three Months", - backgroundColor: Colors.grey[200]!, + backgroundColor: Colors.grey[200], isShowAppBar: false, baseViewModel: model, body: model.myDischargedPatient.isEmpty @@ -59,9 +59,7 @@ class _DischargedPatientState extends State { color: Colors.black, ), iconSize: 20, - onPressed: () {}, ), - onFieldSubmitted: () {}, ), SizedBox( height: 5, @@ -117,11 +115,11 @@ class _DischargedPatientState extends State { children: [ AppText( model.filterData[index].nationalityName != null - ? model.filterData[index].nationalityName!.trim() + ? model.filterData[index].nationalityName.trim() : model.filterData[index].nationality != null - ? model.filterData[index].nationality!.trim() + ? model.filterData[index].nationality.trim() : model.filterData[index].nationalityId != null - ? model.filterData[index].nationalityId! + ? model.filterData[index].nationalityId : "", fontWeight: FontWeight.bold, fontSize: 14, @@ -131,10 +129,10 @@ class _DischargedPatientState extends State { ? ClipRRect( borderRadius: BorderRadius.circular(20.0), child: Image.network( - model.filterData[index].nationalityFlagURL != null ? model.filterData[index].nationalityFlagURL! : '', + model.filterData[index].nationalityFlagURL != null ? model.filterData[index].nationalityFlagURL : '', height: 25, width: 30, - errorBuilder: (BuildContext context, Object exception, StackTrace? stackTrace) { + errorBuilder: (BuildContext context, Object exception, StackTrace stackTrace) { return AppText( '', fontSize: 10, @@ -174,7 +172,7 @@ class _DischargedPatientState extends State { Container( child: RichText( text: new TextSpan( - style: new TextStyle(fontSize: 2.0 * SizeConfig.textMultiplier!, color: Colors.black), + style: new TextStyle(fontSize: 2.0 * SizeConfig.textMultiplier, color: Colors.black), children: [ new TextSpan(text: TranslationBase.of(context).fileNumber, style: TextStyle(fontSize: 14, fontFamily: 'Poppins')), new TextSpan( @@ -188,7 +186,7 @@ class _DischargedPatientState extends State { child: RichText( text: new TextSpan( style: new TextStyle( - fontSize: 2.0 * SizeConfig.textMultiplier!, + fontSize: 2.0 * SizeConfig.textMultiplier, color: Colors.black, fontFamily: 'Poppins', ), @@ -209,7 +207,7 @@ class _DischargedPatientState extends State { child: RichText( text: new TextSpan( style: new TextStyle( - fontSize: 2.0 * SizeConfig.textMultiplier!, + fontSize: 2.0 * SizeConfig.textMultiplier, color: Colors.black, fontFamily: 'Poppins', ), @@ -232,7 +230,7 @@ class _DischargedPatientState extends State { fontWeight: FontWeight.w300, ), AppText( - "${AppDateUtils.convertStringToDate(model.filterData[index].dischargeDate!).difference(AppDateUtils.getDateTimeFromServerFormat(model.filterData[index].admissionDate!)).inDays + 1}", + "${AppDateUtils.convertStringToDate(model.filterData[index].dischargeDate).difference(AppDateUtils.getDateTimeFromServerFormat(model.filterData[index].admissionDate)).inDays + 1}", fontSize: 15, fontWeight: FontWeight.w700), ], diff --git a/lib/screens/patients/ECGPage.dart b/lib/screens/patients/ECGPage.dart index 683698a5..e65b0c1d 100644 --- a/lib/screens/patients/ECGPage.dart +++ b/lib/screens/patients/ECGPage.dart @@ -5,6 +5,7 @@ import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/utils/date-utils.dart'; +import 'package:doctor_app_flutter/utils/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-profile-app-bar.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; @@ -17,16 +18,13 @@ import 'package:url_launcher/url_launcher.dart'; class ECGPage extends StatelessWidget { @override Widget build(BuildContext context) { - final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; + final routeArgs = ModalRoute.of(context).settings.arguments as Map; PatiantInformtion patient = routeArgs['patient']; String patientType = routeArgs['patient-type']; String arrivalType = routeArgs['arrival-type']; ProjectViewModel projectViewModel = Provider.of(context); return BaseView( - onModelReady: (model) => model.getECGPatient( - patientType: patient.patientType, - patientOutSA: 0, - patientID: patient.patientId), + onModelReady: (model) => model.getECGPatient(patientType: patient.patientType, patientOutSA: 0, patientID: patient.patientId), builder: (_, model, w) => AppScaffold( baseViewModel: model, isShowAppBar: true, @@ -59,19 +57,24 @@ class ECGPage extends StatelessWidget { model.patientMuseResultsModelList.length, (index) => InkWell( onTap: () async { - await launch(model - .patientMuseResultsModelList[index].imageURL!); + Uri ecgImageURL = Uri.parse(model.patientMuseResultsModelList[index].imageURL); + await canLaunchUrl(ecgImageURL).then((value) async { + await launchUrl(ecgImageURL); + }).catchError((err) { + DrAppToastMsg.showErrorToast(err.toString()); + }); + // if (await canLaunchUrl(ecgImageURL)) { + // await launchUrl(ecgImageURL); + // } else { + // DrAppToastMsg.showErrorToast("Unable to open ECG Image"); + // } }, child: Container( width: double.infinity, height: 120, margin: EdgeInsets.only(top: 5, bottom: 5), padding: EdgeInsets.all(10), - decoration: BoxDecoration( - border: - Border.all(color: Colors.white, width: 2), - color: Colors.white, - borderRadius: BorderRadius.circular(8)), + decoration: BoxDecoration(border: Border.all(color: Colors.white, width: 2), color: Colors.white, borderRadius: BorderRadius.circular(8)), child: Column( children: [ Row( @@ -79,8 +82,7 @@ class ECGPage extends StatelessWidget { children: [ Expanded( child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( 'ECG Report', @@ -90,26 +92,12 @@ class ECGPage extends StatelessWidget { SizedBox(height: 3), RichText( text: TextSpan( - style: TextStyle( - fontSize: 1.6 * - SizeConfig.textMultiplier!, - color: Colors.black), + style: TextStyle(fontSize: 1.6 * SizeConfig.textMultiplier, color: Colors.black), children: [ + new TextSpan(text: TranslationBase.of(context).orderNo, style: TextStyle(fontSize: 12, fontFamily: 'Poppins')), new TextSpan( - text: TranslationBase.of( - context) - .orderNo, - style: TextStyle( - fontSize: 12, - fontFamily: 'Poppins')), - new TextSpan( - text: - '${/*model.patientMuseResultsModelList[index].orderNo?? */ '3455'}', - style: TextStyle( - fontWeight: - FontWeight.w600, - fontFamily: 'Poppins', - fontSize: 14)), + text: '${/*model.patientMuseResultsModelList[index].orderNo?? */ '3455'}', + style: TextStyle(fontWeight: FontWeight.w600, fontFamily: 'Poppins', fontSize: 14)), ], ), ) @@ -118,19 +106,18 @@ class ECGPage extends StatelessWidget { ), Expanded( child: Column( - crossAxisAlignment: - CrossAxisAlignment.end, + crossAxisAlignment: CrossAxisAlignment.end, children: [ AppText( - '${AppDateUtils.getDayMonthYearDateFormatted(model.patientMuseResultsModelList[index].createdOnDateTime!, isArabic: projectViewModel.isArabic)}', + '${AppDateUtils.getDayMonthYearDateFormatted(model.patientMuseResultsModelList[index].createdOnDateTime, isArabic: projectViewModel.isArabic)}', color: Colors.black, fontWeight: FontWeight.w600, fontSize: 14, ), AppText( - '${AppDateUtils.getHour(model.patientMuseResultsModelList[index].createdOnDateTime!)}', + '${AppDateUtils.getHour(model.patientMuseResultsModelList[index].createdOnDateTime)}', fontWeight: FontWeight.w600, - color: Colors.grey[700]!, + color: Colors.grey[700], fontSize: 14, ), ], diff --git a/lib/screens/patients/out_patient/out_patient_screen.dart b/lib/screens/patients/out_patient/out_patient_screen.dart index 6f376470..237a1b3b 100644 --- a/lib/screens/patients/out_patient/out_patient_screen.dart +++ b/lib/screens/patients/out_patient/out_patient_screen.dart @@ -1,12 +1,12 @@ import 'package:doctor_app_flutter/core/enum/filter_type.dart'; import 'package:doctor_app_flutter/core/enum/patient_type.dart'; import 'package:doctor_app_flutter/core/enum/view_state.dart'; +import 'package:doctor_app_flutter/core/model/patient/patient_model.dart'; import 'package:doctor_app_flutter/core/model/patient_muse/PatientSearchRequestModel.dart'; import 'package:doctor_app_flutter/core/viewModel/PatientSearchViewModel.dart'; import 'package:doctor_app_flutter/core/viewModel/authentication_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; -import 'package:doctor_app_flutter/core/model/patient/patient_model.dart'; import 'package:doctor_app_flutter/routes.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/patients/patient_search/patient_search_header.dart'; @@ -20,6 +20,7 @@ import 'package:doctor_app_flutter/widgets/shared/text_fields/app_text_field_cus import 'package:flutter/material.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart'; import 'package:provider/provider.dart'; + import 'filter_date_page.dart'; // ignore: must_be_immutable @@ -29,13 +30,13 @@ class OutPatientsScreen extends StatefulWidget { final isAppbar; final arrivalType; final isView; - final PatientType? selectedPatientType; - final PatientSearchRequestModel? patientSearchRequestModel; + final PatientType selectedPatientType; + final PatientSearchRequestModel patientSearchRequestModel; final bool isSearchWithKeyInfo; final bool isSearch; final bool isInpatient; final bool isSearchAndOut; - final String? searchKey; + final String searchKey; OutPatientsScreen( {this.patientSearchForm, @@ -56,18 +57,21 @@ class OutPatientsScreen extends StatefulWidget { } class _OutPatientsScreenState extends State { - int? clinicId; - AuthenticationViewModel authenticationViewModel = AuthenticationViewModel(); + int clinicId; + AuthenticationViewModel authenticationViewModel; + List _times = []; + int _activeLocation = 1; - String? patientType; - String? patientTypeTitle; + String patientType; + String patientTypeTitle; var selectedFilter = 1; - String? arrivalType; - late ProjectViewModel projectsProvider; + String arrivalType; + ProjectViewModel projectsProvider; var isView; final _controller = TextEditingController(); - late PatientModel patient; + + PatientModel patient; OutPatientFilterType outPatientFilterType = OutPatientFilterType.Today; bool isSortDes = true; @@ -85,7 +89,7 @@ class _OutPatientsScreenState extends State { return BaseView( onModelReady: (model) async { - await model.getOutPatient(widget.patientSearchRequestModel!); + await model.getOutPatient(widget.patientSearchRequestModel); }, builder: (_, model, w) => AppScaffold( appBarTitle: "Search Patient", @@ -191,7 +195,7 @@ class _OutPatientsScreenState extends State { model.sortOutPatient(isDes: isSortDes); isSortDes = !isSortDes; }, - ), onFieldSubmitted: (){}, + ), ), Expanded( child: Container( @@ -211,8 +215,8 @@ class _OutPatientsScreenState extends State { padding: EdgeInsets.symmetric(horizontal: 8, vertical: 0), child: PatientCard( patientInfo: model.filterData[index], - patientType: patientType!, - arrivalType: arrivalType!, + patientType: patientType, + arrivalType: arrivalType, isFromSearch: widget.isSearchAndOut, isInpatient: widget.isInpatient, onTap: () { @@ -220,12 +224,13 @@ class _OutPatientsScreenState extends State { Navigator.of(context).pushNamed(PATIENTS_PROFILE, arguments: { "patient": model.filterData[index], "patientType": "1", - "from": widget.patientSearchRequestModel!.from, - "to": widget.patientSearchRequestModel!.from, + "from": widget.patientSearchRequestModel.from, + "to": widget.patientSearchRequestModel.from, "isSearch": false, "isInpatient": false, "arrivalType": "7", "isSearchAndOut": false, + "isSigned": model.filterData[index].isSigned != null ? model.filterData[index].isSigned : false, }); }, // isFromSearch: widget.isSearch, diff --git a/lib/screens/patients/profile/admission_request/admission_request_first_screen.dart b/lib/screens/patients/profile/admission_request/admission_request_first_screen.dart index 1856d31c..4668222a 100644 --- a/lib/screens/patients/profile/admission_request/admission_request_first_screen.dart +++ b/lib/screens/patients/profile/admission_request/admission_request_first_screen.dart @@ -1,11 +1,11 @@ import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/enum/view_state.dart'; import 'package:doctor_app_flutter/core/model/admissionRequest/admission-request.dart'; -import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/core/service/AnalyticsService.dart'; import 'package:doctor_app_flutter/core/viewModel/patient-admission-request-viewmodel.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/locator.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/utils/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; @@ -19,9 +19,9 @@ import 'package:doctor_app_flutter/widgets/shared/dialogs/dailog-list-select.dar import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart'; import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; import 'package:hexcolor/hexcolor.dart'; import 'package:provider/provider.dart'; - import '../../../../routes.dart'; class AdmissionRequestFirstScreen extends StatefulWidget { @@ -42,11 +42,16 @@ class _AdmissionRequestThirdScreenState extends State? timeSeries1; - final int? indexes; + final String title; + final List timeSeries1; + final int indexes; final bool isOX; LineChartForDiabetic({this.title, this.timeSeries1, this.indexes, this.isOX = false}); - List xAxixs = []; - List yAxixs = []; + List xAxixs = List(); + List yAxixs = List(); @override Widget build(BuildContext context) { @@ -37,8 +37,8 @@ class LineChartForDiabetic extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - title!, - fontSize: SizeConfig.textMultiplier! * 2.1, + title, + fontSize: SizeConfig.textMultiplier * 2.1, fontWeight: FontWeight.bold, fontFamily: 'Poppins', textAlign: TextAlign.center, @@ -54,7 +54,7 @@ class LineChartForDiabetic extends StatelessWidget { padding: const EdgeInsets.only(right: 18.0, left: 16.0, top: 15), child: LineChart( sampleData1(context), - duration: const Duration(milliseconds: 250), + swapAnimationDuration: const Duration(milliseconds: 250), ), ), ), @@ -68,9 +68,9 @@ class LineChartForDiabetic extends StatelessWidget { } getXaxix() { - for (int index = 0; index < timeSeries1!.length; index++) { - int mIndex = indexes! * index; - if (mIndex < timeSeries1!.length) { + for (int index = 0; index < timeSeries1.length; index++) { + int mIndex = indexes * index; + if (mIndex < timeSeries1.length) { xAxixs.add(mIndex); } } @@ -82,80 +82,45 @@ class LineChartForDiabetic extends StatelessWidget { touchTooltipData: LineTouchTooltipData( tooltipBgColor: Colors.white, ), - touchCallback: (FlTouchEvent event, LineTouchResponse? touchResponse) {}, + //touchCallback: (LineTouchResponse touchResponse) {}, handleBuiltInTouches: true, ), gridData: FlGridData(show: true, drawVerticalLine: true, drawHorizontalLine: true), titlesData: FlTitlesData( - bottomTitles: AxisTitles( - sideTitles: SideTitles( + bottomTitles: SideTitles( showTitles: true, - getTitlesWidget: (value, meta) { - if (timeSeries1!.length < 15) { - if (timeSeries1!.length > value.toInt()) { - return Text( - '${timeSeries1![value.toInt()].time.month}/ ${timeSeries1![value.toInt()].time.year}', - style: TextStyle( - color: Colors.black, - fontSize: 10, - ), - ); + getTextStyles: (context, value) { + return TextStyle( + color: Colors.black, + fontSize: 10, + ); + }, + rotateAngle: -65, + //rotateAngle:-65, + interval: 100, + margin: 22, + getTitles: (value) { + if (timeSeries1.length < 15) { + if (timeSeries1.length > value.toInt()) { + return '${timeSeries1[value.toInt()].time.month}/ ${timeSeries1[value.toInt()].time.year}'; } else - return Text(""); + return ''; } else { - if (value.toInt() == 0) - return Text( - '${timeSeries1![value.toInt()].time.month}/ ${timeSeries1![value.toInt()].time.year}', - style: TextStyle( - color: Colors.black, - fontSize: 10, - ), - ); - if (value.toInt() == timeSeries1!.length - 1) - return Text( - '${timeSeries1![value.toInt()].time.month}/ ${timeSeries1![value.toInt()].time.year}', - style: TextStyle( - color: Colors.black, - fontSize: 10, - ), - ); + if (value.toInt() == 0) return '${timeSeries1[value.toInt()].time.month}/ ${timeSeries1[value.toInt()].time.year}'; + if (value.toInt() == timeSeries1.length - 1) return '${timeSeries1[value.toInt()].time.month}/ ${timeSeries1[value.toInt()].time.year}'; if (xAxixs.contains(value.toInt())) { - return Text( - '${timeSeries1![value.toInt()].time.month}/ ${timeSeries1![value.toInt()].time.year}', - style: TextStyle( - color: Colors.black, - fontSize: 10, - ), - ); + return '${timeSeries1[value.toInt()].time.month}/ ${timeSeries1[value.toInt()].time.year}'; } } - return Text( - "", - style: TextStyle( - color: Colors.black, - fontSize: 10, - ), - ); + return ''; }, - // rotateAngle: -65, - //rotateAngle:-65, - interval: 100, - reservedSize: 22, - // getTitles: (value) { - // - // }, - )), - leftTitles: AxisTitles( - sideTitles: SideTitles( + ), + leftTitles: SideTitles( showTitles: true, - // getTextStyles: - getTitlesWidget: (val, MetaVal) { - return Text( - "", - style: TextStyle( - color: Colors.black, - fontSize: 10, - ), + getTextStyles: (context, value) { + return TextStyle( + color: Colors.black, + fontSize: 10, ); }, interval: getMaxY() - getMinY() <= 500 @@ -163,8 +128,8 @@ class LineChartForDiabetic extends StatelessWidget { : getMaxY() - getMinY() <= 1000 ? 100 : 200, - reservedSize: 12, - )), + margin: 12, + ), ), borderData: FlBorderData( show: true, @@ -185,7 +150,7 @@ class LineChartForDiabetic extends StatelessWidget { ), ), minX: 0, - maxX: (timeSeries1!.length - 1).toDouble(), + maxX: (timeSeries1.length - 1).toDouble(), maxY: getMaxY() + 0.3, minY: getMinY(), lineBarsData: getData(context), @@ -194,8 +159,8 @@ class LineChartForDiabetic extends StatelessWidget { double getMaxY() { double max = 0; - timeSeries1!.forEach((element) { - double resultValueDouble = element.sales!; + timeSeries1.forEach((element) { + double resultValueDouble = element.sales; if (resultValueDouble > max) max = resultValueDouble; }); // timeSeries2.forEach((element) { @@ -207,9 +172,9 @@ class LineChartForDiabetic extends StatelessWidget { } double getMinY() { - double min = timeSeries1![0].sales!; - timeSeries1!.forEach((element) { - double resultValueDouble = element.sales!; + double min = timeSeries1[0].sales; + timeSeries1.forEach((element) { + double resultValueDouble = element.sales; if (resultValueDouble < min) min = resultValueDouble; }); // timeSeries2.forEach((element) { @@ -223,12 +188,12 @@ class LineChartForDiabetic extends StatelessWidget { } List getData(context) { - List spots = []; - for (int index = 0; index < timeSeries1!.length; index++) { - spots.add(FlSpot(index.toDouble(), timeSeries1![index].sales!)); + List spots = List(); + for (int index = 0; index < timeSeries1.length; index++) { + spots.add(FlSpot(index.toDouble(), timeSeries1[index].sales)); } - List spots2 = []; + List spots2 = List(); // for (int index = 0; index < timeSeries2.length; index++) { // spots2.add(FlSpot(index.toDouble(), timeSeries2[index].sales)); // } @@ -236,7 +201,7 @@ class LineChartForDiabetic extends StatelessWidget { final LineChartBarData lineChartBarData1 = LineChartBarData( spots: spots, isCurved: true, - color: Colors.red, + colors: [Colors.red], barWidth: 5, isStrokeCapRound: true, dotData: FlDotData( @@ -249,7 +214,7 @@ class LineChartForDiabetic extends StatelessWidget { final LineChartBarData lineChartBarData2 = LineChartBarData( spots: spots2, isCurved: true, - color: Colors.red, + colors: [Colors.red], barWidth: 5, isStrokeCapRound: true, dotData: FlDotData( @@ -260,7 +225,7 @@ class LineChartForDiabetic extends StatelessWidget { ), ); - List lineChartData = []; + List lineChartData = List(); if (spots.isNotEmpty) { lineChartData.add(lineChartBarData1); } diff --git a/lib/screens/patients/profile/diagnosis/diagnosis_screen.dart b/lib/screens/patients/profile/diagnosis/diagnosis_screen.dart index 06194156..2bf1d249 100644 --- a/lib/screens/patients/profile/diagnosis/diagnosis_screen.dart +++ b/lib/screens/patients/profile/diagnosis/diagnosis_screen.dart @@ -42,7 +42,7 @@ class _ProgressNoteState extends State { admissionNo: int.parse(patient.admissionNo!), patientTypeID: patient.patientType, patientID: patient.patientId, - setupID: "010266"); + ); model.getDiagnosisForInPatient(getDiagnosisForInPatientRequestModel); } diff --git a/lib/screens/patients/profile/lab_result/history/line_chart_curved_lab_history.dart b/lib/screens/patients/profile/lab_result/history/line_chart_curved_lab_history.dart index d2c4e4f3..f23f973a 100644 --- a/lib/screens/patients/profile/lab_result/history/line_chart_curved_lab_history.dart +++ b/lib/screens/patients/profile/lab_result/history/line_chart_curved_lab_history.dart @@ -9,20 +9,22 @@ class LineChartCurvedLabHistory extends StatefulWidget { final String title; final List labResultHistory; - LineChartCurvedLabHistory({required this.title, required this.labResultHistory}); + LineChartCurvedLabHistory({this.title, this.labResultHistory}); @override State createState() => LineChartCurvedLabHistoryState(); } class LineChartCurvedLabHistoryState extends State { - List xAxixs = []; + bool isShowingMainData; + List xAxixs = List(); int indexes = 0; @override void initState() { super.initState(); getXaxix(); + isShowingMainData = true; } getXaxix() { @@ -54,7 +56,7 @@ class LineChartCurvedLabHistoryState extends State { ), AppText( widget.title, - fontSize: SizeConfig.textMultiplier! * 2.1, + fontSize: SizeConfig.textMultiplier * 2.1, fontWeight: FontWeight.bold, fontFamily: 'Poppins', textAlign: TextAlign.center, @@ -67,7 +69,7 @@ class LineChartCurvedLabHistoryState extends State { padding: const EdgeInsets.only(right: 16.0, left: 8.0), child: LineChart( sampleData1(), - duration: const Duration(milliseconds: 250), + swapAnimationDuration: const Duration(milliseconds: 250), ), ), ), @@ -88,73 +90,53 @@ class LineChartCurvedLabHistoryState extends State { touchTooltipData: LineTouchTooltipData( tooltipBgColor: Colors.white, ), - touchCallback: (event, touchResponse) {}, + // touchCallback: (LineTouchResponse touchResponse) {}, handleBuiltInTouches: true, ), gridData: FlGridData(show: true, drawVerticalLine: true, drawHorizontalLine: true), titlesData: FlTitlesData( - bottomTitles: AxisTitles( - sideTitles: SideTitles( + bottomTitles: SideTitles( showTitles: true, - reservedSize: 28, - // rotateAngle: -65, - getTitlesWidget: (value, meta) { - DateTime date = AppDateUtils.convertStringToDate(widget.labResultHistory[value.toInt()].verifiedOnDateTime!); + getTextStyles: (context, value) { + return TextStyle( + color: Colors.black, + fontSize: 10, + ); + }, + margin: 28, + rotateAngle: -65, + getTitles: (value) { + print(value); + DateTime date = AppDateUtils.convertStringToDate(widget.labResultHistory[value.toInt()].verifiedOnDateTime); if (widget.labResultHistory.length < 8) { if (widget.labResultHistory.length > value.toInt()) { - return Text( - '${date.day}/ ${date.year}', - style: TextStyle( - color: Colors.black, - fontSize: 10, - ), - ); + return '${date.day}/ ${date.year}'; } else - return Text(""); + return ''; } else { - if (value.toInt() == 0) - return Text( - '${date.day}/ ${date.year}', - style: TextStyle( - color: Colors.black, - fontSize: 10, - ), - ); - if (value.toInt() == widget.labResultHistory.length - 1) - return Text( - '${date.day}/ ${date.year}', - style: TextStyle( - color: Colors.black, - fontSize: 10, - ), - ); + if (value.toInt() == 0) return '${date.day}/ ${date.year}'; + if (value.toInt() == widget.labResultHistory.length - 1) return '${date.day}/ ${date.year}'; if (xAxixs.contains(value.toInt())) { - return Text( - '${date.day}/ ${date.year}', - style: TextStyle( - color: Colors.black, - fontSize: 10, - ), - ); + return '${date.day}/ ${date.year}'; } } - return Text(""); + return ''; }, - )), - leftTitles: AxisTitles( - sideTitles: SideTitles( - showTitles: true, - getTitlesWidget: (value, meta) { - return Text('${value.toInt()}', - style: TextStyle( - color: Colors.black, - fontSize: 10, - )); - }, - reservedSize: 8, - //reservedSize: 30, - ), + ), + leftTitles: SideTitles( + showTitles: true, + getTextStyles: (context, value) { + return TextStyle( + color: Colors.black, + fontSize: 10, + ); + }, + getTitles: (value) { + return '${value.toInt()}'; + }, + margin: 8, + //reservedSize: 30, ), ), borderData: FlBorderData( @@ -187,7 +169,7 @@ class LineChartCurvedLabHistoryState extends State { double max = 0; widget.labResultHistory.forEach((element) { try { - double resultValueDouble = double.parse(element.resultValue!); + double resultValueDouble = double.parse(element.resultValue); if (resultValueDouble > max) max = resultValueDouble; } catch (e) { print(e); @@ -200,10 +182,10 @@ class LineChartCurvedLabHistoryState extends State { double getMinY() { double min = 0; try { - min = double.parse(widget.labResultHistory[0].resultValue!); + min = double.parse(widget.labResultHistory[0].resultValue); widget.labResultHistory.forEach((element) { - double resultValueDouble = double.parse(element.resultValue!); + double resultValueDouble = double.parse(element.resultValue); if (resultValueDouble < min) min = resultValueDouble; }); } catch (e) { @@ -215,10 +197,10 @@ class LineChartCurvedLabHistoryState extends State { } List getData() { - List spots = []; + List spots = List(); for (int index = 0; index < widget.labResultHistory.length; index++) { try { - var resultValueDouble = double.parse(widget.labResultHistory[index].resultValue!); + var resultValueDouble = double.parse(widget.labResultHistory[index].resultValue); spots.add(FlSpot(index.toDouble(), resultValueDouble)); } catch (e) { print(e); @@ -229,7 +211,7 @@ class LineChartCurvedLabHistoryState extends State { final LineChartBarData lineChartBarData1 = LineChartBarData( spots: spots, isCurved: true, - color: Colors.red, + colors: [Colors.red], barWidth: 3, isStrokeCapRound: true, curveSmoothness: 0.12, diff --git a/lib/screens/patients/profile/lab_result/laboratory_result/laboratory_result_page.dart b/lib/screens/patients/profile/lab_result/laboratory_result/laboratory_result_page.dart index 564e605b..1c4359ea 100644 --- a/lib/screens/patients/profile/lab_result/laboratory_result/laboratory_result_page.dart +++ b/lib/screens/patients/profile/lab_result/laboratory_result/laboratory_result_page.dart @@ -58,6 +58,7 @@ class _LaboratoryResultPageState extends State { patientLabOrder: widget.patientLabOrders, patient: widget.patient, isInpatient: widget.patientType == "1", + invoiceType:widget.patientLabOrders.invoiceType ), ), ), diff --git a/lib/screens/patients/profile/lab_result/laboratory_result/laboratory_result_widget.dart b/lib/screens/patients/profile/lab_result/laboratory_result/laboratory_result_widget.dart index e5b780ef..2248b4f6 100644 --- a/lib/screens/patients/profile/lab_result/laboratory_result/laboratory_result_widget.dart +++ b/lib/screens/patients/profile/lab_result/laboratory_result/laboratory_result_widget.dart @@ -16,23 +16,25 @@ import 'package:flutter_html/flutter_html.dart'; import 'package:provider/provider.dart'; class LaboratoryResultWidget extends StatefulWidget { - final GestureTapCallback? onTap; - final String? billNo; - final String? details; - final String? orderNo; - final PatientLabOrders? patientLabOrder; - final PatiantInformtion? patient; - final bool? isInpatient; - - const LaboratoryResultWidget( - {Key? key, + final GestureTapCallback onTap; + final String billNo; + final String details; + final String orderNo; + final PatientLabOrders patientLabOrder; + final PatiantInformtion patient; + final bool isInpatient; + final String invoiceType; + const LaboratoryResultWidget( + {Key key, this.onTap, this.billNo, this.details, this.orderNo, this.patientLabOrder, this.patient, - this.isInpatient}) + this.isInpatient, + this.invoiceType + }) : super(key: key); @override @@ -42,7 +44,7 @@ class LaboratoryResultWidget extends StatefulWidget { class _LaboratoryResultWidgetState extends State { bool _isShowMoreGeneral = true; bool _isShowMore = true; - late ProjectViewModel projectViewModel; + ProjectViewModel projectViewModel; @override Widget build(BuildContext context) { @@ -97,7 +99,7 @@ class _LaboratoryResultWidgetState extends State { TranslationBase.of(context) .generalResult, fontSize: - SizeConfig.textMultiplier! * 2.3, + SizeConfig.textMultiplier * 2.3, bold: false, ))), Container( @@ -141,15 +143,15 @@ class _LaboratoryResultWidgetState extends State { itemBuilder: (context, index) { return LabResultWidget( patientLabOrder: - widget.patientLabOrder!, + widget.patientLabOrder, filterName: model .labResultLists[index] .filterName, patientLabResultList: model .labResultLists[index] .patientLabResultList, - patient: widget.patient!, - isInpatient: widget.isInpatient!, + patient: widget.patient, + isInpatient: widget.isInpatient, ); }), ], @@ -168,7 +170,7 @@ class _LaboratoryResultWidgetState extends State { SizedBox( height: 15, ), - if (widget.details != null && widget.details!.isNotEmpty) + if (widget.details != null && widget.details.isNotEmpty) Column( children: [ InkWell( @@ -196,7 +198,7 @@ class _LaboratoryResultWidgetState extends State { TranslationBase.of(context) .specialResult, fontSize: - SizeConfig.textMultiplier! * 2.3, + SizeConfig.textMultiplier * 2.3, bold: false, ))), Container( @@ -228,7 +230,7 @@ class _LaboratoryResultWidgetState extends State { duration: Duration(milliseconds: 7000), child: Container( width: double.infinity, - child: !Utils.isTextHtml(widget.details!) + child: !Utils.isTextHtml(widget.details) ? AppText( widget.details ?? TranslationBase.of(context) diff --git a/lib/screens/patients/profile/notes/note/progress_note_screen.dart b/lib/screens/patients/profile/notes/note/progress_note_screen.dart index 2347f936..a32a8791 100644 --- a/lib/screens/patients/profile/notes/note/progress_note_screen.dart +++ b/lib/screens/patients/profile/notes/note/progress_note_screen.dart @@ -32,21 +32,21 @@ DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); class ProgressNoteScreen extends StatefulWidget { final int visitType; - const ProgressNoteScreen({Key? key, required this.visitType}) : super(key: key); + const ProgressNoteScreen({Key key, this.visitType}) : super(key: key); @override _ProgressNoteState createState() => _ProgressNoteState(); } class _ProgressNoteState extends State { - List? notesList; + List notesList; var filteredNotesList; bool isDischargedPatient = false; - AuthenticationViewModel authenticationViewModel = AuthenticationViewModel(); - late ProjectViewModel projectViewModel; + AuthenticationViewModel authenticationViewModel; + ProjectViewModel projectViewModel; getProgressNoteList(BuildContext context, PatientViewModel model, {bool isLocalBusy = false}) async { - final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; + final routeArgs = ModalRoute.of(context).settings.arguments as Map; PatiantInformtion patient = routeArgs['patient']; String token = await sharedPref.getString(TOKEN); String type = await sharedPref.getString(SLECTED_PATIENT_TYPE); @@ -55,7 +55,7 @@ class _ProgressNoteState extends State { ProgressNoteRequest progressNoteRequest = ProgressNoteRequest( visitType: widget.visitType, // if equal 5 then this will return progress note - admissionNo: int.parse(patient.admissionNo!), + admissionNo: int.parse(patient.admissionNo), projectID: patient.projectId, tokenID: token, patientTypeID: patient.patientType, @@ -69,7 +69,7 @@ class _ProgressNoteState extends State { Widget build(BuildContext context) { authenticationViewModel = Provider.of(context); projectViewModel = Provider.of(context); - final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; + final routeArgs = ModalRoute.of(context).settings.arguments as Map; PatiantInformtion patient = routeArgs['patient']; String arrivalType = routeArgs['arrivalType']; if (routeArgs.containsKey('isDischargedPatient')) isDischargedPatient = routeArgs['isDischargedPatient']; @@ -118,7 +118,7 @@ class _ProgressNoteState extends State { widthFactor: 0.95, child: CardWithBgWidget( hasBorder: false, - bgColor: model.patientProgressNoteList[index].status == 1 && authenticationViewModel.doctorProfile!.doctorID != model.patientProgressNoteList[index].createdBy + bgColor: model.patientProgressNoteList[index].status == 1 && authenticationViewModel.doctorProfile.doctorID != model.patientProgressNoteList[index].createdBy ? Color(0xFFCC9B14) : model.patientProgressNoteList[index].status == 4 ? Colors.red.shade700 @@ -130,7 +130,7 @@ class _ProgressNoteState extends State { Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - if (model.patientProgressNoteList[index].status == 1 && authenticationViewModel.doctorProfile!.doctorID != model.patientProgressNoteList[index].createdBy) + if (model.patientProgressNoteList[index].status == 1 && authenticationViewModel.doctorProfile.doctorID != model.patientProgressNoteList[index].createdBy) AppText( TranslationBase.of(context).notePending, fontWeight: FontWeight.bold, @@ -153,7 +153,7 @@ class _ProgressNoteState extends State { ), if (model.patientProgressNoteList[index].status != 2 && model.patientProgressNoteList[index].status != 4 && - authenticationViewModel.doctorProfile!.doctorID == model.patientProgressNoteList[index].createdBy) + authenticationViewModel.doctorProfile.doctorID == model.patientProgressNoteList[index].createdBy) Row( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -209,7 +209,7 @@ class _ProgressNoteState extends State { confirmFun: () async { GifLoaderDialogUtils.showMyDialog(context); UpdateNoteReqModel reqModel = UpdateNoteReqModel( - admissionNo: int.parse(patient.admissionNo!), + admissionNo: int.parse(patient.admissionNo), cancelledNote: false, lineItemNo: model.patientProgressNoteList[index].lineItemNo, conditionId: model.patientProgressNoteList[index].condition, @@ -264,7 +264,7 @@ class _ProgressNoteState extends State { context, ); UpdateNoteReqModel reqModel = UpdateNoteReqModel( - admissionNo: int.parse(patient.admissionNo!), + admissionNo: int.parse(patient.admissionNo), conditionId: model.patientProgressNoteList[index].condition, cancelledNote: true, lineItemNo: model.patientProgressNoteList[index].lineItemNo, @@ -364,7 +364,7 @@ class _ProgressNoteState extends State { children: [ AppText( model.patientProgressNoteList[index].createdOn != null - ? AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat(model.patientProgressNoteList[index].createdOn!), + ? AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat(model.patientProgressNoteList[index].createdOn), isArabic: projectViewModel.isArabic, isMonthShort: true) : AppDateUtils.getDayMonthYearDateFormatted(DateTime.now(), isArabic: projectViewModel.isArabic), fontWeight: FontWeight.w600, @@ -373,7 +373,7 @@ class _ProgressNoteState extends State { ), AppText( model.patientProgressNoteList[index].createdOn != null - ? AppDateUtils.getHour(AppDateUtils.getDateTimeFromServerFormat(model.patientProgressNoteList[index].createdOn!)) + ? AppDateUtils.getHour(AppDateUtils.getDateTimeFromServerFormat(model.patientProgressNoteList[index].createdOn)) : AppDateUtils.getHour(DateTime.now()), fontWeight: FontWeight.w600, fontSize: 14, @@ -390,7 +390,7 @@ class _ProgressNoteState extends State { Row(mainAxisAlignment: MainAxisAlignment.start, children: [ Expanded( child: AppText( - model.patientProgressNoteList[index].notes!, + model.patientProgressNoteList[index].notes, fontSize: 10, isCopyable: true, ), @@ -416,7 +416,7 @@ class _ProgressNoteState extends State { } /// TODO Elham* Make this as custom Dialog - showMyDialog({required BuildContext context, required Function confirmFun, required String actionName}) { + showMyDialog({BuildContext context, Function confirmFun, String actionName}) { showDialog( context: context, builder: (ctx) => Center( diff --git a/lib/screens/patients/profile/notes/note/update_note.dart b/lib/screens/patients/profile/notes/note/update_note.dart index ba5a11da..4369506f 100644 --- a/lib/screens/patients/profile/notes/note/update_note.dart +++ b/lib/screens/patients/profile/notes/note/update_note.dart @@ -14,8 +14,9 @@ import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.dart'; import 'package:doctor_app_flutter/utils/dr_app_toast_msg.dart'; -import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; +import 'package:doctor_app_flutter/utils/extenstions_utils.dart'; import 'package:doctor_app_flutter/utils/utils.dart'; +import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; @@ -26,20 +27,28 @@ import 'package:permission_handler/permission_handler.dart'; import 'package:provider/provider.dart'; import 'package:speech_to_text/speech_recognition_error.dart'; import 'package:speech_to_text/speech_to_text.dart' as stt; - import '../../../../../widgets/shared/dialogs/dailog-list-select.dart'; import '../../../../base/base_view.dart'; class UpdateNoteOrder extends StatefulWidget { - final NoteModel? note; - final PatientViewModel? patientModel; - final PatiantInformtion? patient; - final int? visitType; + final NoteModel note; + final PatientViewModel patientModel; + final PatiantInformtion patient; + final int visitType; final bool isUpdate; - final List? elementList; - final Function(dynamic)? okFunction; + final List elementList; + final Function(dynamic) okFunction; - UpdateNoteOrder({Key? key, this.note, this.patientModel, this.patient, this.visitType, this.isUpdate = false, this.elementList, this.okFunction}) : super(key: key); + const UpdateNoteOrder( + {Key key, + this.note, + this.patientModel, + this.patient, + this.visitType, + this.isUpdate, + this.elementList, + this.okFunction}) + : super(key: key); @override _UpdateNoteOrderState createState() => _UpdateNoteOrderState(); @@ -47,12 +56,12 @@ class UpdateNoteOrder extends StatefulWidget { class _UpdateNoteOrderState extends State { dynamic selectValue; - int selectedType = 0; + int selectedType; bool isSubmitted = false; stt.SpeechToText speech = stt.SpeechToText(); var recognizedWord; var event = RobotProvider(); - late ProjectViewModel projectViewModel; + ProjectViewModel projectViewModel; TextEditingController progressNoteController = TextEditingController(); @@ -82,10 +91,12 @@ class _UpdateNoteOrderState extends State { projectViewModel = Provider.of(context); if (widget.note != null) { - progressNoteController.text = widget.note!.notes!; - if (selectValue == null) selectValue = {}; - selectValue[keyId] = widget.note!.condition; - selectValue['Description'] = widget.note!.conditionDescription!; + progressNoteController.text = widget.note.notes; + if(selectValue==null) + selectValue={}; + selectValue[keyId] = widget.note.condition; + selectValue['Description'] = widget.note.conditionDescription; + } return BaseView( @@ -105,8 +116,14 @@ class _UpdateNoteOrderState extends State { children: [ BottomSheetTitle( title: widget.visitType == 3 - ? (widget.isUpdate ? TranslationBase.of(context).noteUpdate : TranslationBase.of(context).noteAdd) + TranslationBase.of(context).orderSheet - : (widget.isUpdate ? TranslationBase.of(context).noteUpdate : TranslationBase.of(context).noteAdd) + TranslationBase.of(context).progressNote, + ? (widget.isUpdate + ? TranslationBase.of(context).noteUpdate + : TranslationBase.of(context).noteAdd) + + TranslationBase.of(context).orderSheet + : (widget.isUpdate + ? TranslationBase.of(context).noteUpdate + : TranslationBase.of(context).noteAdd) + + TranslationBase.of(context).progressNote, ), SizedBox( height: 10.0, @@ -120,7 +137,11 @@ class _UpdateNoteOrderState extends State { ListSelectDialog dialog = ListSelectDialog( list: model.stpMasterList, attributeName: 'Description', - attributeValueId: model.stpMasterList.length == 1 ? model.stpMasterList[0]['${keyId}'].toString() : '${keyId}', + attributeValueId: + model.stpMasterList.length == 1 + ? model.stpMasterList[0]['${keyId}'] + .toString() + : '${keyId}', okText: TranslationBase.of(context).ok, okFunction: (selectedValue) => { setState(() { @@ -139,8 +160,7 @@ class _UpdateNoteOrderState extends State { } : null, child: AppTextFieldCustom( - hintText: TranslationBase.of(context).selectCondition, - //'Select Condition', + hintText: TranslationBase.of(context).selectCondition,//'Select Condition', dropDownText: model.stpMasterList.length == 1 ? model.stpMasterList[0]['Description'] : selectValue == null @@ -148,9 +168,6 @@ class _UpdateNoteOrderState extends State { : selectValue['Description'], enabled: false, isTextFieldHasSuffix: true, - onClick: () {}, - onChanged: (value) {}, - onFieldSubmitted: () {}, ), ), ), @@ -166,8 +183,19 @@ class _UpdateNoteOrderState extends State { children: [ AppTextFieldCustom( hintText: widget.visitType == 3 - ? (widget.isUpdate! ? TranslationBase.of(context).noteUpdate : TranslationBase.of(context).noteAdd) + TranslationBase.of(context).orderSheet - : (widget.isUpdate! ? TranslationBase.of(context).noteUpdate : TranslationBase.of(context).noteAdd) + TranslationBase.of(context).progressNote, + ? (widget.isUpdate + ? TranslationBase.of(context) + .noteUpdate + : TranslationBase.of(context) + .noteAdd) + + TranslationBase.of(context).orderSheet + : (widget.isUpdate + ? TranslationBase.of(context) + .noteUpdate + : TranslationBase.of(context) + .noteAdd) + + TranslationBase.of(context) + .progressNote, //TranslationBase.of(context).addProgressNote, controller: progressNoteController, maxLines: 40, @@ -175,21 +203,26 @@ class _UpdateNoteOrderState extends State { hasBorder: true, // isTextFieldHasSuffix: true, - validationError: progressNoteController.text.isEmpty && isSubmitted ? TranslationBase.of(context).emptyMessage : "", - onClick: () {}, - onChanged: (value) {}, - onFieldSubmitted: () {}, + validationError: progressNoteController + .text.isEmpty && + isSubmitted + ? TranslationBase.of(context).emptyMessage + : null, ), Positioned( top: -2, //MediaQuery.of(context).size.height * 0, - right: projectViewModel.isArabic ? MediaQuery.of(context).size.width * 0.75 : 15, + right: projectViewModel.isArabic + ? MediaQuery.of(context).size.width * 0.75 + : 15, child: Column( children: [ IconButton( - icon: Icon(DoctorApp.speechtotext, color: Colors.black, size: 35), + icon: Icon(DoctorApp.speechtotext, + color: Colors.black, size: 35), onPressed: () { - initSpeechState().then((value) => {onVoiceText()}); + initSpeechState() + .then((value) => {onVoiceText()}); }, ), ], @@ -207,7 +240,7 @@ class _UpdateNoteOrderState extends State { ), bottomSheet: Container( height: progressNoteController.text.isNotEmpty ? 130 : 70, - margin: EdgeInsets.all(SizeConfig.widthMultiplier! * 5), + margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5), child: Column( children: [ if (progressNoteController.text.isNotEmpty) @@ -226,8 +259,14 @@ class _UpdateNoteOrderState extends State { margin: EdgeInsets.all(5), child: AppButton( title: widget.visitType == 3 - ? (widget.isUpdate ? TranslationBase.of(context).noteUpdate : TranslationBase.of(context).noteAdd) + TranslationBase.of(context).orderSheet - : (widget.isUpdate ? TranslationBase.of(context).noteUpdate : TranslationBase.of(context).noteAdd) + TranslationBase.of(context).progressNote, + ? (widget.isUpdate + ? TranslationBase.of(context).noteUpdate + : TranslationBase.of(context).noteAdd) + + TranslationBase.of(context).orderSheet + : (widget.isUpdate + ? TranslationBase.of(context).noteUpdate + : TranslationBase.of(context).noteAdd) + + TranslationBase.of(context).progressNote, color: AppGlobal.appGreenColor, // disabled: progressNoteController.text.isEmpty, fontWeight: FontWeight.w700, @@ -237,51 +276,61 @@ class _UpdateNoteOrderState extends State { }); if (progressNoteController.text.trim().isNotEmpty) { GifLoaderDialogUtils.showMyDialog(context); - Map profile = await sharedPref.getObj(DOCTOR_PROFILE); + Map profile = await sharedPref.getObj(DOCTOR_PROFILE); - DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile); + DoctorProfileModel doctorProfile = + DoctorProfileModel.fromJson(profile); if (widget.isUpdate) { UpdateNoteReqModel reqModel = UpdateNoteReqModel( - admissionNo: int.parse(widget.patient!.admissionNo!), + admissionNo: + int.parse(widget.patient.admissionNo), cancelledNote: false, - lineItemNo: widget.note!.lineItemNo!, - createdBy: widget.note!.createdBy!, + lineItemNo: widget.note.lineItemNo, + createdBy: widget.note.createdBy, notes: progressNoteController.text, verifiedNote: false, - patientTypeID: widget.patient!.patientType, + patientTypeID: widget.patient.patientType, patientOutSA: false, conditionId: selectValue['ParameterCode']); - await widget.patientModel!.updatePatientProgressNote(reqModel); + await widget.patientModel + .updatePatientProgressNote(reqModel); } else { CreateNoteModel reqModel = CreateNoteModel( - admissionNo: int.parse(widget.patient!.admissionNo!), + admissionNo: + int.parse(widget.patient.admissionNo), createdBy: doctorProfile.doctorID, visitType: widget.visitType, - patientID: widget.patient!.patientId, + patientID: widget.patient.patientId, nursingRemarks: ' ', - patientTypeID: widget.patient!.patientType, + patientTypeID: widget.patient.patientType, patientOutSA: false, notes: progressNoteController.text, conditionId: selectValue['ParameterCode']); - await widget.patientModel!.createPatientProgressNote(reqModel); + await widget.patientModel + .createPatientProgressNote(reqModel); } - if (widget.patientModel!.state == ViewState.ErrorLocal) { - Utils.showErrorToast(widget.patientModel!.error); + if (widget.patientModel.state == + ViewState.ErrorLocal) { + Utils.showErrorToast(widget.patientModel.error); } else { - ProgressNoteRequest progressNoteRequest = ProgressNoteRequest( - visitType: widget.visitType, - // if equal 5 then this will return progress note - admissionNo: int.parse(widget.patient!.admissionNo!), - projectID: widget.patient!.projectId, - patientTypeID: widget.patient!.patientType, - languageID: 2); - await widget.patientModel!.getPatientProgressNote(progressNoteRequest.toJson()); + ProgressNoteRequest progressNoteRequest = + ProgressNoteRequest( + visitType: widget.visitType, + // if equal 5 then this will return progress note + admissionNo: + int.parse(widget.patient.admissionNo), + projectID: widget.patient.projectId, + patientTypeID: widget.patient.patientType, + languageID: 2); + await widget.patientModel.getPatientProgressNote( + progressNoteRequest.toJson()); } GifLoaderDialogUtils.hideDialog(context); - DrAppToastMsg.showSuccesToast(TranslationBase.of(context).yourOrderAddedSuccessfully); + DrAppToastMsg.showSuccesToast( + TranslationBase.of(context).yourOrderAddedSuccessfully); Navigator.of(context).pop(); } else { Utils.showErrorToast(TranslationBase.of(context).youCannotAddOnlySpaces); @@ -297,7 +346,8 @@ class _UpdateNoteOrderState extends State { onVoiceText() async { new SpeechToText(context: context).showAlertDialog(context); var lang = TranslationBase.of(AppGlobal.CONTEX).locale.languageCode; - bool available = await speech.initialize(onStatus: statusListener, onError: errorListener); + bool available = await speech.initialize( + onStatus: statusListener, onError: errorListener); if (available) { speech.listen( onResult: resultListener, @@ -328,12 +378,14 @@ class _UpdateNoteOrderState extends State { void resultListener(result) { recognizedWord = result.recognizedWords; event.setValue({"searchText": recognizedWord}); - - if (result.finalResult == true) { + if (result.finalResult ==true) { setState(() { - SpeechToText.closeAlertDialog(context); - speech.stop(); - progressNoteController.text += recognizedWord + '\n'; + if (mounted) { + // speech.stop(); + progressNoteController.text += recognizedWord + '\n'; + SpeechToText.closeAlertDialog(context); + + } }); } else { print(result.finalResult); @@ -341,7 +393,8 @@ class _UpdateNoteOrderState extends State { } Future initSpeechState() async { - bool hasSpeech = await speech.initialize(onError: errorListener, onStatus: statusListener); + bool hasSpeech = await speech.initialize( + onError: errorListener, onStatus: statusListener); print(hasSpeech); if (!mounted) return; } diff --git a/lib/screens/patients/profile/notes/nursing_note/nursing_note_screen.dart b/lib/screens/patients/profile/notes/nursing_note/nursing_note_screen.dart index d4499286..418b800b 100644 --- a/lib/screens/patients/profile/notes/nursing_note/nursing_note_screen.dart +++ b/lib/screens/patients/profile/notes/nursing_note/nursing_note_screen.dart @@ -45,7 +45,7 @@ class _ProgressNoteState extends State { admissionNo: int.parse(patient.admissionNo!), patientTypeID: patient.patientType, patientID: patient.patientId, - setupID: "010266"); + ); model.getNursingProgressNote(getNursingProgressNoteRequestModel); } diff --git a/lib/screens/patients/profile/operation_report/update_operation_report.dart b/lib/screens/patients/profile/operation_report/update_operation_report.dart index 63ad0ee8..c15a3f88 100644 --- a/lib/screens/patients/profile/operation_report/update_operation_report.dart +++ b/lib/screens/patients/profile/operation_report/update_operation_report.dart @@ -1,18 +1,17 @@ -import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/enum/view_state.dart'; +import 'package:doctor_app_flutter/core/provider/robot_provider.dart'; +import 'package:doctor_app_flutter/core/viewModel/profile/operation_report_view_model.dart'; +import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/core/model/operation_report/create_update_operation_report_request_model.dart'; import 'package:doctor_app_flutter/core/model/operation_report/get_operation_details_response_modle.dart'; import 'package:doctor_app_flutter/core/model/operation_report/get_reservations_response_model.dart'; import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; -import 'package:doctor_app_flutter/core/provider/robot_provider.dart'; -import 'package:doctor_app_flutter/core/viewModel/profile/operation_report_view_model.dart'; -import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.dart'; import 'package:doctor_app_flutter/utils/dr_app_toast_msg.dart'; -import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; import 'package:doctor_app_flutter/utils/utils.dart'; +import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; @@ -21,14 +20,18 @@ import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; import 'package:speech_to_text/speech_to_text.dart' as stt; +import '../../../../config/config.dart'; + class UpdateOperationReport extends StatefulWidget { - final GetReservationsResponseModel? reservation; - final PatiantInformtion? patient; - final int? visitType; - final bool? isUpdate; + final GetReservationsResponseModel reservation; + + // final OperationReportViewModel operationReportViewModel; + final PatiantInformtion patient; + final int visitType; + final bool isUpdate; const UpdateOperationReport( - {Key? key, + {Key key, // this.operationReportViewModel, this.patient, this.visitType, @@ -41,12 +44,12 @@ class UpdateOperationReport extends StatefulWidget { } class _UpdateOperationReportState extends State { - int? selectedType; + int selectedType; bool isSubmitted = false; stt.SpeechToText speech = stt.SpeechToText(); var recognizedWord; var event = RobotProvider(); - late ProjectViewModel projectViewModel; + ProjectViewModel projectViewModel; TextEditingController preOpDiagmosisController = TextEditingController(); TextEditingController postOpDiagmosisNoteController = TextEditingController(); @@ -60,11 +63,13 @@ class _UpdateOperationReportState extends State { TextEditingController complicationDetailsController = TextEditingController(); TextEditingController bloodLossDetailController = TextEditingController(); TextEditingController histopathSpecimenController = TextEditingController(); - TextEditingController microbiologySpecimenController = TextEditingController(); + TextEditingController microbiologySpecimenController = + TextEditingController(); TextEditingController otherSpecimenController = TextEditingController(); TextEditingController scrubNurseController = TextEditingController(); TextEditingController circulatingNurseController = TextEditingController(); - TextEditingController BloodTransfusedDetailController = TextEditingController(); + TextEditingController BloodTransfusedDetailController = + TextEditingController(); TextEditingController anasthetistController = TextEditingController(); TextEditingController OTReservationID = TextEditingController(); @@ -86,30 +91,33 @@ class _UpdateOperationReportState extends State { return BaseView( onModelReady: (model) async { - await model.getOperationReportDetails(widget.reservation!); - OTReservationID.text = widget.reservation!.oTReservationID.toString(); + await model.getOperationReportDetails(widget.reservation); + OTReservationID.text = widget.reservation.oTReservationID.toString(); if (model.operationDetailsList.isNotEmpty) { - GetOperationDetailsResponseModel oldDetails = model.operationDetailsList[0]; - - postOpDiagmosisNoteController.text = oldDetails.postOpInstruction!; - preOpDiagmosisController.text = oldDetails.preOpDiagnosis!; - surgeonController.text = oldDetails.surgeon!; - assistantNoteController.text = oldDetails.assistant!; - operationController.text = oldDetails.operation!; - inasionController.text = oldDetails.inasion!; - findingController.text = oldDetails.finding!; - surgeryProcedureController.text = oldDetails.surgeryProcedure!; - postOpInstructionController.text = oldDetails.postOpInstruction!; - complicationDetailsController.text = oldDetails.complicationDetail!; - bloodLossDetailController.text = oldDetails.bloodLossDetail!; - histopathSpecimenController.text = oldDetails.histopathSpecimen!; - microbiologySpecimenController.text = oldDetails.microbiologySpecimen!; - otherSpecimenController.text = oldDetails.otherSpecimen!; + GetOperationDetailsResponseModel oldDetails = + model.operationDetailsList[0]; + + postOpDiagmosisNoteController.text = oldDetails.postOpInstruction; + preOpDiagmosisController.text = oldDetails.preOpDiagnosis; + surgeonController.text = oldDetails.surgeon; + assistantNoteController.text = oldDetails.assistant; + operationController.text = oldDetails.operation; + inasionController.text = oldDetails.inasion; + findingController.text = oldDetails.finding; + surgeryProcedureController.text = oldDetails.surgeryProcedure; + postOpInstructionController.text = oldDetails.postOpInstruction; + complicationDetailsController.text = oldDetails.complicationDetail; + bloodLossDetailController.text = oldDetails.bloodLossDetail; + histopathSpecimenController.text = oldDetails.histopathSpecimen; + microbiologySpecimenController.text = + oldDetails.microbiologySpecimen; + otherSpecimenController.text = oldDetails.otherSpecimen; scrubNurseController.text = oldDetails.scrubNurse; circulatingNurseController.text = oldDetails.circulatingNurse; - BloodTransfusedDetailController.text = oldDetails.bloodTransfusedDetail; - anasthetistController.text = oldDetails.anasthetist!; + BloodTransfusedDetailController.text = + oldDetails.bloodTransfusedDetail; + anasthetistController.text = oldDetails.anasthetist; } }, builder: (_, model, w) => AppScaffold( @@ -138,92 +146,107 @@ class _UpdateOperationReportState extends State { child: Column( children: [ AppTextFieldCustom( - hintText: TranslationBase.of(context).reservation, + hintText: TranslationBase.of(context) + .reservation, controller: OTReservationID, maxLines: 1, minLines: 1, enabled: false, hasBorder: true, - onClick: () {}, - onChanged: (value) {}, - onFieldSubmitted: () {}, ), SizedBox( height: 4, ), AppTextFieldCustom( - hintText: TranslationBase.of(context).preOperationDiagnosis, + hintText: TranslationBase.of(context) + .preOperationDiagnosis, controller: preOpDiagmosisController, maxLines: 20, minLines: 8, hasBorder: true, + // isTextFieldHasSuffix: true, - validationError: preOpDiagmosisController.text.isEmpty && isSubmitted ? TranslationBase.of(context).emptyMessage : "", - onClick: () {}, - onChanged: (value) {}, - onFieldSubmitted: () {}, + validationError: preOpDiagmosisController + .text.isEmpty && + isSubmitted + ? TranslationBase.of(context) + .emptyMessage + : null, ), SizedBox( height: 4, ), AppTextFieldCustom( - hintText: TranslationBase.of(context).postOperationDiagnosis, + hintText: TranslationBase.of(context) + .postOperationDiagnosis, controller: postOpDiagmosisNoteController, maxLines: 20, minLines: 8, hasBorder: true, // isTextFieldHasSuffix: true, - validationError: postOpDiagmosisNoteController.text.isEmpty && isSubmitted ? TranslationBase.of(context).emptyMessage : "", - onClick: () {}, - onChanged: (value) {}, - onFieldSubmitted: () {}, + validationError: + postOpDiagmosisNoteController + .text.isEmpty && + isSubmitted + ? TranslationBase.of(context) + .emptyMessage + : null, ), SizedBox( height: 4, ), AppTextFieldCustom( - hintText: TranslationBase.of(context).surgeon, + hintText: + TranslationBase.of(context).surgeon, controller: surgeonController, maxLines: 1, minLines: 1, hasBorder: true, // isTextFieldHasSuffix: true, - validationError: surgeonController.text.isEmpty && isSubmitted ? TranslationBase.of(context).emptyMessage : "", - onClick: () {}, - onChanged: (value) {}, - onFieldSubmitted: () {}, + validationError: + surgeonController.text.isEmpty && + isSubmitted + ? TranslationBase.of(context) + .emptyMessage + : null, ), SizedBox( height: 4, ), AppTextFieldCustom( - hintText: TranslationBase.of(context).assistant, + hintText: + TranslationBase.of(context).assistant, controller: assistantNoteController, maxLines: 1, minLines: 1, hasBorder: true, // isTextFieldHasSuffix: true, - validationError: assistantNoteController.text.isEmpty && isSubmitted ? TranslationBase.of(context).emptyMessage : "", - onClick: () {}, - onChanged: (value) {}, - onFieldSubmitted: () {}, + validationError: assistantNoteController + .text.isEmpty && + isSubmitted + ? TranslationBase.of(context) + .emptyMessage + : null, ), SizedBox( height: 4, ), AppTextFieldCustom( - hintText: TranslationBase.of(context).operation, + hintText: + TranslationBase.of(context).operation, controller: operationController, maxLines: 20, minLines: 4, hasBorder: true, // isTextFieldHasSuffix: true, - validationError: operationController.text.isEmpty && isSubmitted ? TranslationBase.of(context).emptyMessage : "", - onClick: () {}, - onChanged: (value) {}, - onFieldSubmitted: () {}, + validationError: + operationController.text.isEmpty && + isSubmitted + ? TranslationBase.of(context) + .emptyMessage + : null, ), SizedBox( height: 4, @@ -237,201 +260,248 @@ class _UpdateOperationReportState extends State { hasBorder: true, // isTextFieldHasSuffix: true, - validationError: inasionController.text.isEmpty && isSubmitted ? TranslationBase.of(context).emptyMessage : "", - onClick: () {}, - onChanged: (value) {}, - onFieldSubmitted: () {}, + validationError: + inasionController.text.isEmpty && + isSubmitted + ? TranslationBase.of(context) + .emptyMessage + : null, ), SizedBox( height: 4, ), AppTextFieldCustom( - hintText: TranslationBase.of(context).finding, + hintText: + TranslationBase.of(context).finding, controller: findingController, maxLines: 20, minLines: 4, hasBorder: true, // isTextFieldHasSuffix: true, - validationError: findingController.text.isEmpty && isSubmitted ? TranslationBase.of(context).emptyMessage : "", - onClick: () {}, - onChanged: (value) {}, - onFieldSubmitted: () {}, + validationError: + findingController.text.isEmpty && + isSubmitted + ? TranslationBase.of(context) + .emptyMessage + : null, ), SizedBox( height: 4, ), AppTextFieldCustom( - hintText: TranslationBase.of(context).surgeryProcedure, + hintText: TranslationBase.of(context) + .surgeryProcedure, controller: surgeryProcedureController, maxLines: 20, minLines: 8, hasBorder: true, // isTextFieldHasSuffix: true, - validationError: surgeryProcedureController.text.isEmpty && isSubmitted ? TranslationBase.of(context).emptyMessage : "", - onClick: () {}, - onChanged: (value) {}, - onFieldSubmitted: () {}, + validationError: + surgeryProcedureController + .text.isEmpty && + isSubmitted + ? TranslationBase.of(context) + .emptyMessage + : null, ), SizedBox( height: 4, ), AppTextFieldCustom( - hintText: TranslationBase.of(context).postOperationInstruction, + hintText: TranslationBase.of(context) + .postOperationInstruction, controller: postOpInstructionController, maxLines: 20, minLines: 8, hasBorder: true, // isTextFieldHasSuffix: true, - validationError: postOpInstructionController.text.isEmpty && isSubmitted ? TranslationBase.of(context).emptyMessage : "", - onClick: () {}, - onChanged: (value) {}, - onFieldSubmitted: () {}, + validationError: + postOpInstructionController + .text.isEmpty && + isSubmitted + ? TranslationBase.of(context) + .emptyMessage + : null, ), SizedBox( height: 4, ), AppTextFieldCustom( - hintText: TranslationBase.of(context).complicationDetails1, + hintText: TranslationBase.of(context) + .complicationDetails1, controller: complicationDetailsController, maxLines: 20, minLines: 4, hasBorder: true, // isTextFieldHasSuffix: true, - validationError: complicationDetailsController.text.isEmpty && isSubmitted ? TranslationBase.of(context).emptyMessage : "", - onClick: () {}, - onChanged: (value) {}, - onFieldSubmitted: () {}, + validationError: + complicationDetailsController + .text.isEmpty && + isSubmitted + ? TranslationBase.of(context) + .emptyMessage + : null, ), SizedBox( height: 4, ), AppTextFieldCustom( - hintText: TranslationBase.of(context).bloodLossDetail, + hintText: TranslationBase.of(context) + .bloodLossDetail, controller: bloodLossDetailController, maxLines: 20, minLines: 4, hasBorder: true, // isTextFieldHasSuffix: true, - validationError: bloodLossDetailController.text.isEmpty && isSubmitted ? TranslationBase.of(context).emptyMessage : "", - onClick: () {}, - onChanged: (value) {}, - onFieldSubmitted: () {}, + validationError: bloodLossDetailController + .text.isEmpty && + isSubmitted + ? TranslationBase.of(context) + .emptyMessage + : null, ), SizedBox( height: 4, ), AppTextFieldCustom( - hintText: TranslationBase.of(context).histopathSpecimen, + hintText: TranslationBase.of(context) + .histopathSpecimen, controller: histopathSpecimenController, maxLines: 20, minLines: 4, hasBorder: true, // isTextFieldHasSuffix: true, - validationError: histopathSpecimenController.text.isEmpty && isSubmitted ? TranslationBase.of(context).emptyMessage : "", - onClick: () {}, - onChanged: (value) {}, - onFieldSubmitted: () {}, + validationError: + histopathSpecimenController + .text.isEmpty && + isSubmitted + ? TranslationBase.of(context) + .emptyMessage + : null, ), SizedBox( height: 4, ), AppTextFieldCustom( - hintText: TranslationBase.of(context).microbiologySpecimen, - controller: microbiologySpecimenController, + hintText: TranslationBase.of(context) + .microbiologySpecimen, + controller: + microbiologySpecimenController, maxLines: 20, minLines: 4, hasBorder: true, // isTextFieldHasSuffix: true, - validationError: microbiologySpecimenController.text.isEmpty && isSubmitted ? TranslationBase.of(context).emptyMessage : "", - onClick: () {}, - onChanged: (value) {}, - onFieldSubmitted: () {}, + validationError: + microbiologySpecimenController + .text.isEmpty && + isSubmitted + ? TranslationBase.of(context) + .emptyMessage + : null, ), SizedBox( height: 4, ), AppTextFieldCustom( - hintText: TranslationBase.of(context).otherSpecimen, + hintText: TranslationBase.of(context) + .otherSpecimen, controller: otherSpecimenController, maxLines: 20, minLines: 4, hasBorder: true, // isTextFieldHasSuffix: true, - validationError: otherSpecimenController.text.isEmpty && isSubmitted ? TranslationBase.of(context).emptyMessage : "", - onClick: () {}, - onChanged: (value) {}, - onFieldSubmitted: () {}, + validationError: otherSpecimenController + .text.isEmpty && + isSubmitted + ? TranslationBase.of(context) + .emptyMessage + : null, ), SizedBox( height: 4, ), AppTextFieldCustom( - hintText: TranslationBase.of(context).scrubNurse, + hintText: TranslationBase.of(context) + .scrubNurse, controller: scrubNurseController, maxLines: 1, minLines: 1, hasBorder: true, // isTextFieldHasSuffix: true, - validationError: scrubNurseController.text.isEmpty && isSubmitted ? TranslationBase.of(context).emptyMessage : "", - onClick: () {}, - onChanged: (value) {}, - onFieldSubmitted: () {}, + validationError: + scrubNurseController.text.isEmpty && + isSubmitted + ? TranslationBase.of(context) + .emptyMessage + : null, ), SizedBox( height: 4, ), AppTextFieldCustom( - hintText: TranslationBase.of(context).circulatingNurse, + hintText: TranslationBase.of(context) + .circulatingNurse, controller: circulatingNurseController, maxLines: 1, minLines: 1, hasBorder: true, // isTextFieldHasSuffix: true, - validationError: circulatingNurseController.text.isEmpty && isSubmitted ? TranslationBase.of(context).emptyMessage : "", - onClick: () {}, - onChanged: (value) {}, - onFieldSubmitted: () {}, + validationError: + circulatingNurseController + .text.isEmpty && + isSubmitted + ? TranslationBase.of(context) + .emptyMessage + : null, ), SizedBox( height: 4, ), AppTextFieldCustom( - hintText: TranslationBase.of(context).bloodTransfusedDetail, - controller: BloodTransfusedDetailController, + hintText: TranslationBase.of(context) + .bloodTransfusedDetail, + controller: + BloodTransfusedDetailController, maxLines: 20, minLines: 4, hasBorder: true, // isTextFieldHasSuffix: true, - validationError: BloodTransfusedDetailController.text.isEmpty && isSubmitted ? TranslationBase.of(context).emptyMessage : "", - onClick: () {}, - onChanged: (value) {}, - onFieldSubmitted: () {}, + validationError: + BloodTransfusedDetailController + .text.isEmpty && + isSubmitted + ? TranslationBase.of(context) + .emptyMessage + : null, ), SizedBox( height: 4, ), AppTextFieldCustom( - hintText: TranslationBase.of(context).anesthetist, + hintText: TranslationBase.of(context) + .anesthetist, controller: anasthetistController, maxLines: 1, minLines: 1, hasBorder: true, // isTextFieldHasSuffix: true, - validationError: anasthetistController.text.isEmpty && isSubmitted ? TranslationBase.of(context).emptyMessage : "", - onClick: () {}, - onChanged: (value) {}, - onFieldSubmitted: () {}, + validationError: + anasthetistController.text.isEmpty && + isSubmitted + ? TranslationBase.of(context) + .emptyMessage + : null, ), SizedBox( height: 250, @@ -453,13 +523,17 @@ class _UpdateOperationReportState extends State { ) : Container( height: 70, - margin: EdgeInsets.all(SizeConfig.widthMultiplier! * 5), + margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5), child: Column( children: [ Container( margin: EdgeInsets.all(5), child: AppButton( - title: (widget.isUpdate! ? TranslationBase.of(context).noteUpdate : TranslationBase.of(context).noteAdd) + " " + TranslationBase.of(context).operationReports, + title: (widget.isUpdate + ? TranslationBase.of(context).noteUpdate + : TranslationBase.of(context).noteAdd) + + " " + + TranslationBase.of(context).operationReports, color: AppGlobal.appGreenColor, // disabled: operationReportsController.text.isEmpty, fontWeight: FontWeight.w700, @@ -471,33 +545,55 @@ class _UpdateOperationReportState extends State { GifLoaderDialogUtils.showMyDialog(context); await model.getDoctorProfile(); - CreateUpdateOperationReportRequestModel createUpdateOperationReportRequestModel = CreateUpdateOperationReportRequestModel( - inasion: inasionController.text, - - /// TODO Elham* Add dynamic reservation - reservationNo: widget.reservation!.oTReservationID, - preOpDiagmosis: preOpDiagmosisController.text, - postOpDiagmosis: postOpDiagmosisNoteController.text, - surgeon: surgeonController.text, - assistant: assistantNoteController.text, - anasthetist: assistantNoteController.text, - operation: operationController.text, - finding: findingController.text, - surgeryProcedure: surgeonController.text, - postOpInstruction: postOpInstructionController.text, - complicationDetails: complicationDetailsController.text, - bloodLossDetail: bloodLossDetailController.text, - histopathSpecimen: histopathSpecimenController.text, - microbiologySpecimen: microbiologySpecimenController.text, - otherSpecimen: otherSpecimenController.text, - scrubNurse: surgeonController.text, - circulatingNurse: circulatingNurseController.text, - bloodTransfusedDetail: bloodLossDetailController.text, - patientID: widget.patient!.patientId!, - admissionNo: int.parse(widget.patient!.admissionNo!), - createdBy: model.doctorProfile!.doctorID!, - setupID: "010266"); - await model.updateOperationReport(createUpdateOperationReportRequestModel); + CreateUpdateOperationReportRequestModel + createUpdateOperationReportRequestModel = + CreateUpdateOperationReportRequestModel( + inasion: inasionController.text, + + /// TODO Elham* Add dynamic reservation + reservationNo: widget + .reservation.oTReservationID, + preOpDiagmosis: + preOpDiagmosisController.text, + postOpDiagmosis: + postOpDiagmosisNoteController + .text, + surgeon: surgeonController.text, + assistant: + assistantNoteController.text, + anasthetist: + assistantNoteController.text, + operation: operationController.text, + finding: findingController.text, + surgeryProcedure: + surgeonController.text, + postOpInstruction: + postOpInstructionController.text, + complicationDetails: + complicationDetailsController + .text, + bloodLossDetail: + bloodLossDetailController.text, + histopathSpecimen: + histopathSpecimenController.text, + microbiologySpecimen: + microbiologySpecimenController + .text, + otherSpecimen: + otherSpecimenController.text, + scrubNurse: surgeonController.text, + circulatingNurse: + circulatingNurseController.text, + bloodTransfusedDetail: + bloodLossDetailController.text, + patientID: widget.patient.patientId, + admissionNo: int.parse( + widget.patient.admissionNo), + createdBy: + model.doctorProfile.doctorID, + ); + await model.updateOperationReport( + createUpdateOperationReportRequestModel); if (model.state == ViewState.ErrorLocal) { Utils.showErrorToast(model.error); @@ -505,7 +601,8 @@ class _UpdateOperationReportState extends State { // await model.( // operationReportsRequest.toJson()); - DrAppToastMsg.showSuccesToast("Your Order added Successfully"); + DrAppToastMsg.showSuccesToast( + "Your Order added Successfully"); } GifLoaderDialogUtils.hideDialog(context); } diff --git a/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart b/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart index b447130b..a18a93a2 100644 --- a/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart +++ b/lib/screens/patients/profile/profile_screen/patient_profile_screen.dart @@ -1,24 +1,24 @@ import 'dart:async'; + import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/enum/view_state.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/in_patient/post_episode_for_Inpatient_request_model.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/post_episode_req_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/core/service/AnalyticsService.dart'; import 'package:doctor_app_flutter/core/service/VideoCallService.dart'; import 'package:doctor_app_flutter/core/viewModel/LiveCarePatientViewModel.dart'; import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; -import 'package:doctor_app_flutter/core/model/SOAP/post_episode_req_model.dart'; -import 'package:doctor_app_flutter/core/model/SOAP/in_patient/post_episode_for_Inpatient_request_model.dart'; -import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; -import 'package:doctor_app_flutter/locator.dart'; -import 'package:doctor_app_flutter/routes.dart'; +import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/live_care/end_call_screen.dart'; import 'package:doctor_app_flutter/screens/patients/profile/profile_screen/profile_gird_for_InPatient.dart'; import 'package:doctor_app_flutter/screens/patients/profile/profile_screen/profile_gird_for_other.dart'; import 'package:doctor_app_flutter/screens/patients/profile/profile_screen/profile_gird_for_search.dart'; import 'package:doctor_app_flutter/utils/notification_permission_utils.dart'; -import 'package:doctor_app_flutter/utils/utils.dart'; import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; +import 'package:doctor_app_flutter/utils/utils.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-profile-header-new-design-app-bar.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; @@ -26,36 +26,42 @@ import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils import 'package:flutter/material.dart'; import 'package:flutter_svg/svg.dart'; import 'package:hexcolor/hexcolor.dart'; +import 'package:provider/provider.dart'; import 'package:quiver/async.dart'; +import '../../../../locator.dart'; +import '../../../../routes.dart'; + class PatientProfileScreen extends StatefulWidget { @override _PatientProfileScreenState createState() => _PatientProfileScreenState(); } class _PatientProfileScreenState extends State with SingleTickerProviderStateMixin { - PatiantInformtion patient = PatiantInformtion(); + PatiantInformtion patient; LiveCarePatientViewModel _liveCareViewModel = LiveCarePatientViewModel(); bool isFromSearch = false; bool isFromLiveCare = false; + bool isSigned = false; + bool isInpatient = false; bool isMyPatient = false; bool isCallFinished = false; bool isDischargedPatient = false; bool isSearchAndOut = false; bool isCallStarted = false; - String? patientType; - String? arrivalType; - String? from; - String? to; - TabController? _tabController; + String patientType; + String arrivalType; + String from; + String to; + TabController _tabController; int index = 0; int _activeTab = 0; - late StreamController videoCallDurationStreamController; - late Stream videoCallDurationStream; + StreamController videoCallDurationStreamController; + Stream videoCallDurationStream = (() async* {})(); @override void initState() { @@ -67,22 +73,23 @@ class _PatientProfileScreenState extends State with Single @override void dispose() { - _tabController!.dispose(); + _tabController.dispose(); super.dispose(); if (isFromLiveCare) { - _liveCareViewModel.removePatientFromDoctorList(patient.vcId!); + _liveCareViewModel.removePatientFromDoctorList(patient.vcId); } } @override void didChangeDependencies() { super.didChangeDependencies(); - final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; + final routeArgs = ModalRoute.of(context).settings.arguments as Map; patient = routeArgs['patient']; patientType = routeArgs['patientType']; arrivalType = routeArgs['arrivalType']; from = routeArgs['from']; to = routeArgs['to']; + isSigned = routeArgs['isSigned']; if (routeArgs.containsKey("isSearch")) { isFromSearch = routeArgs['isSearch']; } @@ -110,7 +117,7 @@ class _PatientProfileScreenState extends State with Single _activeTab = 1; } - late StreamSubscription callTimer; + StreamSubscription callTimer; callConnected() { callTimer = CountdownTimer(Duration(minutes: 90), Duration(seconds: 1)).listen(null) @@ -125,7 +132,7 @@ class _PatientProfileScreenState extends State with Single callDisconnected() { callTimer.cancel(); - videoCallDurationStreamController.sink.add(""); + videoCallDurationStreamController.sink.add(null); setState(() { isCallStarted = false; @@ -135,9 +142,10 @@ class _PatientProfileScreenState extends State with Single @override Widget build(BuildContext context) { final screenSize = MediaQuery.of(context).size; + ProjectViewModel projectViewModel = Provider.of(context); return BaseView( onModelReady: (model) async { - if (isFromLiveCare && patient.patientStatus == 1) await model.addPatientToDoctorList(patient.vcId!); + if (isFromLiveCare && patient.patientStatus == 1) await model.addPatientToDoctorList(patient.vcId); }, builder: (_, model, w) => AppScaffold( baseViewModel: model, @@ -150,7 +158,7 @@ class _PatientProfileScreenState extends State with Single children: [ Column( children: [ - PatientProfileHeaderNewDesignAppBar(patient, arrivalType ?? '0', patientType!, + PatientProfileHeaderNewDesignAppBar(patient, arrivalType ?? '0', patientType, videoCallDurationStream: videoCallDurationStream, isInpatient: isInpatient, isFromLiveCare: isFromLiveCare, @@ -172,31 +180,32 @@ class _PatientProfileScreenState extends State with Single child: isSearchAndOut ? ProfileGridForSearch( patient: patient, - patientType: patientType!, - arrivalType: arrivalType!, + patientType: patientType, + arrivalType: arrivalType, isInpatient: isInpatient, - from: from!, - to: to!, + from: from, + to: to, ) : isInpatient ? ProfileGridForInPatient( patient: patient, - patientType: patientType!, - arrivalType: arrivalType!, + patientType: patientType, + arrivalType: arrivalType, isInpatient: isInpatient, - from: from!, - to: to!, + from: from, + to: to, isDischargedPatient: isDischargedPatient, isFromSearch: isFromSearch, ) : ProfileGridForOther( patient: patient, - patientType: patientType!, - arrivalType: arrivalType!, + patientType: patientType, + arrivalType: arrivalType, isInpatient: isInpatient, isFromLiveCare: isFromLiveCare, - from: from!, - to: to!, + from: from, + to: to, + projectViewModel: projectViewModel, ), ), SizedBox( @@ -238,7 +247,7 @@ class _PatientProfileScreenState extends State with Single : AppGlobal.appRedColor, fontColor: Colors.white, // vPadding: 8, - height: SizeConfig.heightMultiplier! * (SizeConfig.isHeightVeryShort ? 9 : 6), + height: SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort ? 9 : 6), radius: 30, hPadding: 25, fontWeight: FontWeight.normal, @@ -257,7 +266,7 @@ class _PatientProfileScreenState extends State with Single if (patient.episodeNo != 0) AppButton( loading: model.state == ViewState.BusyLocal, - disabled: model.state == ViewState.BusyLocal, + // disabled: model.state == ViewState.BusyLocal || isSigned, title: "${TranslationBase.of(context).update}\n${TranslationBase.of(context).episode}", color: ((isInpatient) || isFromLiveCare) && model.state != ViewState.BusyLocal ? AppGlobal.appRedColor @@ -266,7 +275,7 @@ class _PatientProfileScreenState extends State with Single : AppGlobal.appRedColor, fontColor: Colors.white, // vPadding: 8, - height: SizeConfig.heightMultiplier! * (SizeConfig.isHeightVeryShort ? 9 : 6), + height: SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort ? 9 : 6), radius: 30, hPadding: 25, fontWeight: FontWeight.normal, @@ -314,7 +323,7 @@ class _PatientProfileScreenState extends State with Single child: Center( child: AppButton( fontWeight: FontWeight.w700, - color: isCallFinished ? Colors.red[600]! : AppGlobal.appGreenColor, + color: isCallFinished ? Colors.red[600] : AppGlobal.appGreenColor, title: isCallFinished ? TranslationBase.of(context).endCall : TranslationBase.of(context).initiateCall, disabled: isCallStarted || model.state == ViewState.BusyLocal, onPressed: () async { @@ -340,7 +349,7 @@ class _PatientProfileScreenState extends State with Single ); } else { GifLoaderDialogUtils.showMyDialog(context); - await model.startCall(isReCall: false, vCID: patient.vcId!); + await model.startCall(isReCall: false, vCID: patient.vcId); if (model.state == ViewState.ErrorLocal) { GifLoaderDialogUtils.hideDialog(context); @@ -358,7 +367,7 @@ class _PatientProfileScreenState extends State with Single context: context, onTapGrant: () { locator() - .openVideo(model.startCallRes, patient, model.startCallRes != null ? model.startCallRes.isRecording! : true, callConnected, callDisconnected); + .openVideo(model.startCallRes, patient, model.startCallRes != null ? model.startCallRes.isRecording : true, callConnected, callDisconnected); }); } } @@ -373,24 +382,24 @@ class _PatientProfileScreenState extends State with Single ], ), ) - : SizedBox(), + : null, ), ); } - createEpisode({PatiantInformtion? patient, SOAPViewModel? model}) async { + createEpisode({PatiantInformtion patient, SOAPViewModel model}) async { await locator().logEvent( eventCategory: "Patient Profile", eventAction: "Create Episode", ); GifLoaderDialogUtils.showMyDialog(context); - if (patient!.admissionNo != null && patient.admissionNo!.isNotEmpty) { - PostEpisodeForInpatientRequestModel postEpisodeReqModel = PostEpisodeForInpatientRequestModel(admissionNo: int.parse(patient.admissionNo!), patientID: patient.patientId); - await model!.postEpisodeForInPatient(postEpisodeReqModel); + if (patient.admissionNo != null && patient.admissionNo.isNotEmpty) { + PostEpisodeForInpatientRequestModel postEpisodeReqModel = PostEpisodeForInpatientRequestModel(admissionNo: int.parse(patient.admissionNo), patientID: patient.patientId); + await model.postEpisodeForInPatient(postEpisodeReqModel); } else { PostEpisodeReqModel postEpisodeReqModel = PostEpisodeReqModel(appointmentNo: int.parse(patient.appointmentNo.toString()), patientMRN: patient.patientMRN); - await model!.postEpisode(postEpisodeReqModel); + await model.postEpisode(postEpisodeReqModel); } GifLoaderDialogUtils.hideDialog(context); diff --git a/lib/screens/patients/profile/profile_screen/profile_gird_for_other.dart b/lib/screens/patients/profile/profile_screen/profile_gird_for_other.dart index 2dedca9d..f9ea94a0 100644 --- a/lib/screens/patients/profile/profile_screen/profile_gird_for_other.dart +++ b/lib/screens/patients/profile/profile_screen/profile_gird_for_other.dart @@ -1,144 +1,67 @@ import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; -import 'package:doctor_app_flutter/routes.dart'; +import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/screens/patients/profile/profile_screen/patient_profile_card_model.dart'; import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; +import 'package:doctor_app_flutter/utils/utils.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/PatientProfileButton.dart'; import 'package:flutter/material.dart'; +import '../../../../routes.dart'; + // ignore: must_be_immutable class ProfileGridForOther extends StatelessWidget { - final PatiantInformtion? patient; - final String? patientType; - final String? arrivalType; - final double? height; + final PatiantInformtion patient; + final String patientType; + final String arrivalType; + final double height; final bool isInpatient; final bool isFromLiveCare; - String? from; - String? to; + String from; + String to; + ProjectViewModel projectViewModel; - ProfileGridForOther({Key? key, this.patient, this.patientType, this.arrivalType, this.height, this.isInpatient = false, this.from, this.to, this.isFromLiveCare = false}) : super(key: key); + ProfileGridForOther({Key key, this.patient, this.patientType, this.arrivalType, this.height, this.isInpatient, this.from, this.to, this.isFromLiveCare, this.projectViewModel}) : super(key: key); @override Widget build(BuildContext context) { final List cardsList = [ - PatientProfileCardModel( - TranslationBase.of(context).vital, - TranslationBase.of(context).signs, - VITAL_SIGN_DETAILS, - 'assets/images/svgs/profile_screen/vital signs.svg', - isInPatient: isInpatient, - //onTap: () {}, - ), - PatientProfileCardModel( - TranslationBase.of(context).lab, - TranslationBase.of(context).result, - LAB_RESULT, - 'assets/images/svgs/profile_screen/lab results.svg', - isInPatient: isInpatient, - //onTap: () {}, - ), - PatientProfileCardModel( - TranslationBase.of(context).lab, - TranslationBase.of(context).special, - ALL_SPECIAL_LAB_RESULT, - 'assets/images/svgs/profile_screen/lab results.svg', - isInPatient: isInpatient, - //onTap: () {}, - ), - PatientProfileCardModel( - TranslationBase.of(context).radiology, - TranslationBase.of(context).service, - RADIOLOGY_PATIENT, - 'assets/images/svgs/profile_screen/health summary.svg', - isInPatient: isInpatient, - //onTap: () {}, - ), - PatientProfileCardModel( - TranslationBase.of(context).orders, - TranslationBase.of(context).prescription + ' (${TranslationBase.of(context).old})', - ORDER_PRESCRIPTION_OLD, - 'assets/images/svgs/profile_screen/order prescription.svg', - isInPatient: isInpatient, - //onTap: () {}, - ), - PatientProfileCardModel( - TranslationBase.of(context).patient, - TranslationBase.of(context).prescription, - ORDER_PRESCRIPTION_NEW, - 'assets/images/svgs/profile_screen/order prescription.svg', - isInPatient: isInpatient, - //onTap: () {}, - ), - PatientProfileCardModel( - TranslationBase.of(context).health, - TranslationBase.of(context).summary, - HEALTH_SUMMARY, - 'assets/images/svgs/profile_screen/health summary.svg', - isInPatient: isInpatient, - //onTap: () {}, - ), - PatientProfileCardModel( - TranslationBase.of(context).patient, - "ECG", - PATIENT_ECG, - 'assets/images/svgs/profile_screen/ECG.svg', - isInPatient: isInpatient, - //onTap: () {}, - ), - PatientProfileCardModel( - TranslationBase.of(context).orders, - TranslationBase.of(context).procedures, - ORDER_PROCEDURE, - 'assets/images/svgs/profile_screen/Order Procedures.svg', - isInPatient: isInpatient, - //onTap: () {}, - ), - PatientProfileCardModel( - TranslationBase.of(context).insurance, - TranslationBase.of(context).service, - PATIENT_INSURANCE_APPROVALS_NEW, - 'assets/images/svgs/profile_screen/insurance approval.svg', - isInPatient: isInpatient, - //onTap: () {}, - ), - PatientProfileCardModel( - TranslationBase.of(context).patientSick, - TranslationBase.of(context).leave, - ADD_SICKLEAVE, - 'assets/images/svgs/profile_screen/patient sick leave.svg', - isInPatient: isInpatient, - //onTap: () {}, - ), - if (isFromLiveCare || (patient!.appointmentNo != null && patient!.appointmentNo != 0)) - PatientProfileCardModel( - TranslationBase.of(context).patient, - TranslationBase.of(context).ucaf, - PATIENT_UCAF_REQUEST, - 'assets/images/svgs/profile_screen/UCAF.svg', - isInPatient: isInpatient, - isDisable: isFromLiveCare ? patient!.appointmentNo == null : patient!.patientStatusType != 43 || patient!.appointmentNo == null, - //onTap: () {}, - ), - if (isFromLiveCare || (patient!.appointmentNo != null && patient!.appointmentNo != 0)) + PatientProfileCardModel(TranslationBase.of(context).vital, TranslationBase.of(context).signs, VITAL_SIGN_DETAILS, 'assets/images/svgs/profile_screen/vital signs.svg', isInPatient: isInpatient), + PatientProfileCardModel(TranslationBase.of(context).lab, TranslationBase.of(context).result, LAB_RESULT, 'assets/images/svgs/profile_screen/lab results.svg', isInPatient: isInpatient), + PatientProfileCardModel(TranslationBase.of(context).lab, TranslationBase.of(context).special, ALL_SPECIAL_LAB_RESULT, 'assets/images/svgs/profile_screen/lab results.svg', + isInPatient: isInpatient), + PatientProfileCardModel(TranslationBase.of(context).radiology, TranslationBase.of(context).service, RADIOLOGY_PATIENT, 'assets/images/svgs/profile_screen/health summary.svg', + isInPatient: isInpatient), + PatientProfileCardModel(TranslationBase.of(context).orders, TranslationBase.of(context).prescription + ' (${TranslationBase.of(context).old})', ORDER_PRESCRIPTION_OLD, + 'assets/images/svgs/profile_screen/order prescription.svg', + isInPatient: isInpatient), + PatientProfileCardModel(TranslationBase.of(context).patient, TranslationBase.of(context).prescription, ORDER_PRESCRIPTION_NEW, 'assets/images/svgs/profile_screen/order prescription.svg', + isInPatient: isInpatient), + PatientProfileCardModel(TranslationBase.of(context).health, TranslationBase.of(context).summary, HEALTH_SUMMARY, 'assets/images/svgs/profile_screen/health summary.svg', + isInPatient: isInpatient), + PatientProfileCardModel(TranslationBase.of(context).patient, "ECG", PATIENT_ECG, 'assets/images/svgs/profile_screen/ECG.svg', isInPatient: isInpatient), + PatientProfileCardModel(TranslationBase.of(context).orders, TranslationBase.of(context).procedures, ORDER_PROCEDURE, 'assets/images/svgs/profile_screen/Order Procedures.svg', + isInPatient: isInpatient), + PatientProfileCardModel(TranslationBase.of(context).insurance, TranslationBase.of(context).service, PATIENT_INSURANCE_APPROVALS_NEW, 'assets/images/svgs/profile_screen/insurance approval.svg', + isInPatient: isInpatient), + PatientProfileCardModel(TranslationBase.of(context).patientSick, TranslationBase.of(context).leave, ADD_SICKLEAVE, 'assets/images/svgs/profile_screen/patient sick leave.svg', + isInPatient: isInpatient), + if (isFromLiveCare || (patient.appointmentNo != null && patient.appointmentNo != 0)) + PatientProfileCardModel(TranslationBase.of(context).patient, TranslationBase.of(context).ucaf, PATIENT_UCAF_REQUEST, 'assets/images/svgs/profile_screen/UCAF.svg', + isInPatient: isInpatient, isDisable: isFromLiveCare ? patient.appointmentNo == null : patient.patientStatusType != 43 || patient.appointmentNo == null), + if (isFromLiveCare || (patient.appointmentNo != null && patient.appointmentNo != 0)) PatientProfileCardModel( TranslationBase.of(context).referral, TranslationBase.of(context).patient, REFER_PATIENT_TO_DOCTOR, 'assets/images/svgs/profile_screen/refer patient.svg', isInPatient: isInpatient, - isDisable: isFromLiveCare ? patient!.appointmentNo == null : patient!.patientStatusType != 43 || patient!.appointmentNo == null, - //onTap: () {}, - ), - if (isFromLiveCare || (patient!.appointmentNo != null && patient!.appointmentNo != 0)) - PatientProfileCardModel( - TranslationBase.of(context).admission, - TranslationBase.of(context).request, - PATIENT_ADMISSION_REQUEST, - 'assets/images/svgs/profile_screen/admission req.svg', - isInPatient: isInpatient, - isDisable: isFromLiveCare ? patient!.appointmentNo == null : patient!.patientStatusType != 43 || patient!.appointmentNo == null, - //onTap: () {}, + isDisable: isFromLiveCare ? patient.appointmentNo == null : patient.patientStatusType != 43 || patient.appointmentNo == null, ), + if (isFromLiveCare || (patient.appointmentNo != null && patient.appointmentNo != 0)) + PatientProfileCardModel(TranslationBase.of(context).admission, TranslationBase.of(context).request, PATIENT_ADMISSION_REQUEST, 'assets/images/svgs/profile_screen/admission req.svg', + isInPatient: isInpatient, + isDisable: + Utils.isVidaPlusProject(projectViewModel, patient.projectId) || (isFromLiveCare ? patient.appointmentNo == null : patient.patientStatusType != 43) || patient.appointmentNo == null), ]; return Padding( padding: const EdgeInsets.symmetric(vertical: 15.0, horizontal: 15), @@ -155,11 +78,11 @@ class ProfileGridForOther extends StatelessWidget { //change the number as you want children: cardsList.map((item) { return PatientProfileButton( - patient: patient!, - patientType: patientType!, - arrivalType: arrivalType!, - from: from!, - to: to!, + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + from: from, + to: to, nameLine1: item.nameLine1, nameLine2: item.nameLine2, route: item.route, @@ -167,8 +90,7 @@ class ProfileGridForOther extends StatelessWidget { isInPatient: item.isInPatient, isDischargedPatient: item.isDischargedPatient, isDisable: item.isDisable, - onTap: () {}, - //item.onTap!(), + onTap: item.onTap, isLoading: item.isLoading, ); }).toList(), diff --git a/lib/screens/patients/profile/radiology/radiology_details_page.dart b/lib/screens/patients/profile/radiology/radiology_details_page.dart index 2cb282ba..f6989964 100644 --- a/lib/screens/patients/profile/radiology/radiology_details_page.dart +++ b/lib/screens/patients/profile/radiology/radiology_details_page.dart @@ -1,41 +1,55 @@ +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/core/model/radiology/final_radiology.dart'; import 'package:doctor_app_flutter/core/service/AnalyticsService.dart'; +import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/radiology_view_model.dart'; -import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; -import 'package:doctor_app_flutter/locator.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; +import 'package:doctor_app_flutter/utils/utils.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-profile-app-bar.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; import 'package:url_launcher/url_launcher.dart'; -import 'package:url_launcher/url_launcher_string.dart'; + +import '../../../../locator.dart'; class RadiologyDetailsPage extends StatelessWidget { - final FinalRadiology? finalRadiology; - final PatiantInformtion? patient; - final String? patientType; - final String? arrivalType; + final FinalRadiology finalRadiology; + final PatiantInformtion patient; + final String patientType; + final String arrivalType; final bool isInpatient; + final bool isVidaPlus; - RadiologyDetailsPage({Key? key, this.finalRadiology, this.patient, this.patientType, this.arrivalType, this.isInpatient = false}); + RadiologyDetailsPage({Key key, this.finalRadiology, this.patient, this.patientType, this.arrivalType, this.isInpatient = false, this.isVidaPlus = false}); @override Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); return BaseView( - onModelReady: (model) => model.getRadImageURL(patient: patient!, projectId: finalRadiology!.projectID, lineItem: finalRadiology!.invoiceLineItemNo, invoiceNo: finalRadiology!.invoiceNo), + onModelReady: (model) => model.getRadImageURL( + patient: patient, + projectId: finalRadiology.projectID, + lineItem: finalRadiology.invoiceLineItemNo, + invoiceType:finalRadiology.invoiceType, + invoiceNo: Utils.isVidaPlusProject(projectViewModel, finalRadiology.projectID) ? finalRadiology.invoiceNo_VP : finalRadiology.invoiceNo, + isVidaPlus: Utils.isVidaPlusProject(projectViewModel, finalRadiology.projectID, + + ), + ), builder: (_, model, widget) => AppScaffold( appBar: PatientProfileAppBar( - patient!, - appointmentDate: finalRadiology!.orderDate!, - doctorName: finalRadiology!.doctorName, - clinic: finalRadiology!.clinicDescription, - branch: finalRadiology!.projectName, - profileUrl: finalRadiology!.doctorImageURL, - invoiceNO: finalRadiology!.invoiceNo.toString(), + patient, + appointmentDate: finalRadiology.orderDate, + doctorName: finalRadiology.doctorName, + clinic: finalRadiology.clinicDescription, + branch: finalRadiology.projectName, + profileUrl: finalRadiology.doctorImageURL, + invoiceNO: finalRadiology.invoiceNo.toString(), isAppointmentHeader: true, ), isShowAppBar: true, @@ -68,7 +82,7 @@ class RadiologyDetailsPage extends StatelessWidget { Padding( padding: const EdgeInsets.all(8.0), child: AppText( - '${finalRadiology!.reportData.trim()}', + '${finalRadiology.reportData.trim()}', textAlign: TextAlign.start, isCopyable: true, fontSize: 17, @@ -92,19 +106,18 @@ class RadiologyDetailsPage extends StatelessWidget { margin: EdgeInsets.only(left: 35, right: 35, top: 12, bottom: 12), child: AppButton( color: Color(0xffD02127), - disabled: finalRadiology!.dIAPACSURL == "", onPressed: () async { await locator().logEvent( eventCategory: "RadiologyDetailsPage", eventAction: "Open Radiology Image", ); - launchUrlString(model.radImageURL); + launch(model.radImageURL); }, title: TranslationBase.of(context).openRad, ), ), ) - : SizedBox(), + : null, ), ); } diff --git a/lib/screens/patients/profile/radiology/radiology_home_page.dart b/lib/screens/patients/profile/radiology/radiology_home_page.dart index 2fbc6737..cc419e06 100644 --- a/lib/screens/patients/profile/radiology/radiology_home_page.dart +++ b/lib/screens/patients/profile/radiology/radiology_home_page.dart @@ -1,6 +1,6 @@ +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/core/viewModel/procedure_View_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; -import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/patients/profile/radiology/radiology_details_page.dart'; import 'package:doctor_app_flutter/screens/procedures/base_add_procedure_tab_page.dart'; @@ -12,29 +12,30 @@ import 'package:doctor_app_flutter/widgets/patients/profile/add-order/addNewOrde import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-profile-app-bar.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/doctor_card.dart'; -import 'package:doctor_app_flutter/widgets/shared/errors/error_message.dart'; import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart'; import 'package:doctor_app_flutter/widgets/transitions/slide_up_page.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; +import '../../../../widgets/shared/errors/error_message.dart'; + class RadiologyHomePage extends StatefulWidget { @override _RadiologyHomePageState createState() => _RadiologyHomePageState(); } class _RadiologyHomePageState extends State { - String? patientType; - PatiantInformtion? patient; - String? arrivalType; - bool isInpatient = false; - bool isFromLiveCare = false; + String patientType; + PatiantInformtion patient; + String arrivalType; + bool isInpatient; + bool isFromLiveCare; @override void didChangeDependencies() { super.didChangeDependencies(); - final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; + final routeArgs = ModalRoute.of(context).settings.arguments as Map; patient = routeArgs['patient']; patientType = routeArgs['patientType']; arrivalType = routeArgs['arrivalType']; @@ -47,14 +48,13 @@ class _RadiologyHomePageState extends State { Widget build(BuildContext context) { ProjectViewModel projectViewModel = Provider.of(context); return BaseView( - onModelReady: (model) => model.getPatientRadOrders(patient!, - patientType: patientType, isInPatient: false), + onModelReady: (model) => model.getPatientRadOrders(patient, patientType: patientType, isInPatient: false), builder: (_, model, widget) => AppScaffold( isShowAppBar: true, - backgroundColor: Colors.grey[100]!, + backgroundColor: Colors.grey[100], // appBarTitle: TranslationBase.of(context).radiology, appBar: PatientProfileAppBar( - patient!, + patient, isInpatient: isInpatient, ), baseViewModel: model, @@ -66,28 +66,24 @@ class _RadiologyHomePageState extends State { SizedBox( height: 12, ), - if (model.radiologyList.isNotEmpty && - patient!.patientStatusType != 43) + if (model.radiologyList.isNotEmpty && patient.patientStatusType != 43) ServiceTitle( title: TranslationBase.of(context).radiology, subTitle: TranslationBase.of(context).result, ), - if (patient!.patientStatusType != null && - patient!.patientStatusType == 43) + if (patient.patientStatusType != null && patient.patientStatusType == 43) ServiceTitle( title: TranslationBase.of(context).radiology, subTitle: TranslationBase.of(context).result, ), - if ((patient!.patientStatusType != null && - patient!.patientStatusType == 43) || - (isFromLiveCare && patient!.appointmentNo != null)) + if ((patient.patientStatusType != null && patient.patientStatusType == 43) || (isFromLiveCare && patient.appointmentNo != null)) AddNewOrder( onTap: () { Navigator.push( context, SlideUpPageRoute( widget: BaseAddProcedureTabPage( - patient: patient!, + patient: patient, previousProcedureViewModel: model, procedureType: ProcedureType.RADIOLOGY, ), @@ -96,6 +92,7 @@ class _RadiologyHomePageState extends State { }, label: TranslationBase.of(context).applyForRadiologyOrder, ), + ///TODO Elham * fix this to be list view builder ...List.generate( model.radiologyList.length, @@ -117,43 +114,26 @@ class _RadiologyHomePageState extends State { height: 160, decoration: BoxDecoration( //Colors.red[900] Color(0xff404545) - color: model.radiologyList[index] - .isLiveCareAppodynamicment! - ? Colors.red[900]! - : !model.radiologyList[index].isInOutPatient! + color: model.radiologyList[index].isLiveCareAppodynamicment + ? Colors.red[900] + : !model.radiologyList[index].isInOutPatient ? Colors.black : Color(0xffa9a089), borderRadius: BorderRadius.only( - topLeft: projectViewModel.isArabic - ? Radius.circular(0) - : Radius.circular(8), - bottomLeft: projectViewModel.isArabic - ? Radius.circular(0) - : Radius.circular(8), - topRight: projectViewModel.isArabic - ? Radius.circular(8) - : Radius.circular(0), - bottomRight: projectViewModel.isArabic - ? Radius.circular(8) - : Radius.circular(0)), + topLeft: projectViewModel.isArabic ? Radius.circular(0) : Radius.circular(8), + bottomLeft: projectViewModel.isArabic ? Radius.circular(0) : Radius.circular(8), + topRight: projectViewModel.isArabic ? Radius.circular(8) : Radius.circular(0), + bottomRight: projectViewModel.isArabic ? Radius.circular(8) : Radius.circular(0)), ), child: RotatedBox( quarterTurns: 3, child: Center( child: Text( - model.radiologyList[index] - .isLiveCareAppodynamicment! - ? TranslationBase.of(context) - .liveCare - .toUpperCase() - : !model.radiologyList[index] - .isInOutPatient! - ? TranslationBase.of(context) - .inPatientLabel - .toUpperCase() - : TranslationBase.of(context) - .outpatient - .toUpperCase(), + model.radiologyList[index].isLiveCareAppodynamicment + ? TranslationBase.of(context).liveCare.toUpperCase() + : !model.radiologyList[index].isInOutPatient + ? TranslationBase.of(context).inPatientLabel.toUpperCase() + : TranslationBase.of(context).outpatient.toUpperCase(), style: TextStyle(color: Colors.white), ), )), @@ -161,28 +141,27 @@ class _RadiologyHomePageState extends State { Expanded( child: DoctorCard( isNoMargin: true, - doctorName: - Utils.convertToTitleCase(model.radiologyList[index].doctorName), - profileUrl: - model.radiologyList[index].doctorImageURL, - invoiceNO: - '${model.radiologyList[index].invoiceNo}', - branch: - '${model.radiologyList[index].projectName}', - clinic: - Utils.convertToTitleCase(model.radiologyList[index].clinicDescription), - appointmentDate: - model.radiologyList[index].orderDate ?? - model.radiologyList[index].reportDate!, + doctorName: Utils.convertToTitleCase(model.radiologyList[index].doctorName), + profileUrl: model.radiologyList[index].doctorImageURL, + invoiceNO: Utils.isVidaPlusProject(projectViewModel, model.radiologyList[index].projectID) + ? '${model.radiologyList[index].invoiceNo_VP}' + : '${model.radiologyList[index].invoiceNo}', + // model.isRadiologyVIDAPlus ? '${model.radiologyList[index].invoiceNo}' : '${model.radiologyList[index].invoiceNo}', + branch: '${model.radiologyList[index].projectName}', + clinic: Utils.convertToTitleCase(model.radiologyList[index].clinicDescription), + appointmentDate: model.radiologyList[index].orderDate ?? model.radiologyList[index].reportDate, onTap: () { Navigator.push( context, FadePage( page: RadiologyDetailsPage( - finalRadiology: - model.radiologyList[index], + finalRadiology: model.radiologyList[index], patient: patient, - isInpatient: isInpatient), + isInpatient: isInpatient, + isVidaPlus: Utils.isVidaPlusProject(projectViewModel, model.radiologyList[index].projectID) + // false + // model.radiologyList[index].isRecordFromVidaPlus + ), ), ); }, @@ -191,8 +170,7 @@ class _RadiologyHomePageState extends State { ], ), )), - if (model.radiologyList.isEmpty && - patient!.patientStatusType != 43) + if (model.radiologyList.isEmpty && patient.patientStatusType != 43) Center( child: ErrorMessage( error: TranslationBase.of(context).noDataAvailable, diff --git a/lib/screens/patients/profile/referral/refer_details/referred_patient_detail_in-paint.dart b/lib/screens/patients/profile/referral/refer_details/referred_patient_detail_in-paint.dart index bd2ed818..f33ec6bc 100644 --- a/lib/screens/patients/profile/referral/refer_details/referred_patient_detail_in-paint.dart +++ b/lib/screens/patients/profile/referral/refer_details/referred_patient_detail_in-paint.dart @@ -2,21 +2,22 @@ import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/enum/PatientType.dart'; import 'package:doctor_app_flutter/core/enum/view_state.dart'; -import 'package:doctor_app_flutter/core/viewModel/patient-referral-viewmodel.dart'; -import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; import 'package:doctor_app_flutter/core/model/patient/my_referral/my_referred_patient_model.dart'; import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; -import 'package:doctor_app_flutter/routes.dart'; +import 'package:doctor_app_flutter/core/viewModel/patient-referral-viewmodel.dart'; +import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/utils/date-utils.dart'; import 'package:doctor_app_flutter/utils/dr_app_toast_msg.dart'; -import 'package:doctor_app_flutter/utils/utils.dart'; import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; +import 'package:doctor_app_flutter/utils/utils.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; import 'package:flutter/material.dart'; +import '../../../../../routes.dart'; + class ReferredPatientDetailScreen extends StatelessWidget { final MyReferredPatientModel referredPatient; final PatientType patientType; @@ -52,9 +53,8 @@ class ReferredPatientDetailScreen extends StatelessWidget { ), Expanded( child: AppText( - (Utils.capitalize( - "${referredPatient.firstName} ${referredPatient.lastName}")), - fontSize: SizeConfig.textMultiplier!! * 2.5, + (Utils.capitalize("${referredPatient.firstName} ${referredPatient.lastName}")), + fontSize: SizeConfig.textMultiplier * 2.5, fontWeight: FontWeight.bold, fontFamily: 'Poppins', ), @@ -70,19 +70,14 @@ class ReferredPatientDetailScreen extends StatelessWidget { ), InkWell( onTap: () { - PatiantInformtion patient = - model.getPatientFromReferral(referredPatient); - Navigator.of(context) - .pushNamed(PATIENTS_PROFILE, arguments: { + PatiantInformtion patient = model.getPatientFromReferral(referredPatient); + Navigator.of(context).pushNamed(PATIENTS_PROFILE, arguments: { "patient": patient, "patientType": "1", - "isInpatient": - patientType == PatientType.IN_PATIENT, + "isInpatient": patientType == PatientType.IN_PATIENT, "arrivalType": "1", - "from": AppDateUtils.convertDateToFormat( - DateTime.now(), 'yyyy-MM-dd'), - "to": AppDateUtils.convertDateToFormat( - DateTime.now(), 'yyyy-MM-dd'), + "from": AppDateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'), + "to": AppDateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'), }); }, child: Icon( @@ -97,19 +92,14 @@ class ReferredPatientDetailScreen extends StatelessWidget { children: [ InkWell( onTap: () { - PatiantInformtion patient = - model.getPatientFromReferral(referredPatient); - Navigator.of(context) - .pushNamed(PATIENTS_PROFILE, arguments: { + PatiantInformtion patient = model.getPatientFromReferral(referredPatient); + Navigator.of(context).pushNamed(PATIENTS_PROFILE, arguments: { "patient": patient, "patientType": "1", - "isInpatient": - patientType == PatientType.IN_PATIENT, + "isInpatient": patientType == PatientType.IN_PATIENT, "arrivalType": "1", - "from": AppDateUtils.convertDateToFormat( - DateTime.now(), 'yyyy-MM-dd'), - "to": AppDateUtils.convertDateToFormat( - DateTime.now(), 'yyyy-MM-dd'), + "from": AppDateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'), + "to": AppDateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'), }); }, child: Column( @@ -120,9 +110,7 @@ class ReferredPatientDetailScreen extends StatelessWidget { width: 60, height: 60, child: Image.asset( - referredPatient.gender == 1 - ? 'assets/images/male_avatar.png' - : 'assets/images/female_avatar.png', + referredPatient.gender == 1 ? 'assets/images/male_avatar.png' : 'assets/images/female_avatar.png', fit: BoxFit.cover, ), ), @@ -133,8 +121,8 @@ class ReferredPatientDetailScreen extends StatelessWidget { AppText( TranslationBase.of(context).viewProfile, fontWeight: FontWeight.w700, - fontSize: 1.7 * SizeConfig.textMultiplier!, - color: Colors.red[700]!, + fontSize: 1.7 * SizeConfig.textMultiplier, + color: Colors.red[700], ) ], ), @@ -146,46 +134,39 @@ class ReferredPatientDetailScreen extends StatelessWidget { child: Column( children: [ Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, + mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ AppText( - referredPatient.referralStatusDesc!, + referredPatient.referralStatusDesc, fontFamily: 'Poppins', - fontSize: 1.9 * SizeConfig.textMultiplier!, + fontSize: 1.9 * SizeConfig.textMultiplier, fontWeight: FontWeight.w700, color: referredPatient.referralStatus == 1 ? AppGlobal.inProgressColor : referredPatient.referralStatus == 46 ? AppGlobal.appGreenColor - : Colors.red[700]!, + : Colors.red[700], ), AppText( - AppDateUtils.convertDateFromServerFormat( - referredPatient.referralDate!, - "dd MMM,yyyy"), + AppDateUtils.convertDateFromServerFormat(referredPatient.referralDate, "dd MMM,yyyy"), fontFamily: 'Poppins', fontWeight: FontWeight.w600, - fontSize: 2.0 * SizeConfig.textMultiplier!, + fontSize: 2.0 * SizeConfig.textMultiplier, color: Color(0XFF28353E), ) ], ), Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, + mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Row( - mainAxisAlignment: - MainAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.start, children: [ AppText( - TranslationBase.of(context) - .fileNumber, + TranslationBase.of(context).fileNumber, fontFamily: 'Poppins', fontWeight: FontWeight.w600, - fontSize: - 1.7 * SizeConfig.textMultiplier!, + fontSize: 1.7 * SizeConfig.textMultiplier, color: Color(0XFF575757), ), AppText( @@ -198,40 +179,34 @@ class ReferredPatientDetailScreen extends StatelessWidget { ], ), AppText( - AppDateUtils.convertDateFromServerFormat( - referredPatient.referralDate!, - "hh:mm a"), + AppDateUtils.convertDateFromServerFormat(referredPatient.referralDate, "hh:mm a"), fontFamily: 'Poppins', fontWeight: FontWeight.w600, - fontSize: 1.8 * SizeConfig.textMultiplier!, + fontSize: 1.8 * SizeConfig.textMultiplier, color: Color(0XFF575757), ) ], ), Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, + mainAxisAlignment: MainAxisAlignment.spaceBetween, crossAxisAlignment: CrossAxisAlignment.center, children: [ Expanded( child: Column( children: [ Row( - mainAxisAlignment: - MainAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.start, children: [ AppText( "${TranslationBase.of(context).refClinic}: ", fontFamily: 'Poppins', fontWeight: FontWeight.w600, - fontSize: 1.7 * - SizeConfig.textMultiplier!, + fontSize: 1.7 * SizeConfig.textMultiplier, color: Color(0XFF575757), ), Expanded( child: AppText( - referredPatient - .referralClinicDescription!, + referredPatient.referralClinicDescription, fontFamily: 'Poppins', fontWeight: FontWeight.w700, fontSize: 13, @@ -240,29 +215,21 @@ class ReferredPatientDetailScreen extends StatelessWidget { ), ], ), - if (referredPatient - .frequencyDescription != - null) + if (referredPatient.frequencyDescription != null) Row( - mainAxisAlignment: - MainAxisAlignment.start, - crossAxisAlignment: - CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - TranslationBase.of(context) - .frequency + - ": ", + TranslationBase.of(context).frequency + ": ", fontFamily: 'Poppins', fontWeight: FontWeight.w600, - fontSize: 1.7 * - SizeConfig.textMultiplier!, + fontSize: 1.7 * SizeConfig.textMultiplier, color: Color(0XFF575757), ), Expanded( child: AppText( - referredPatient - .frequencyDescription!, + referredPatient.frequencyDescription, fontFamily: 'Poppins', fontWeight: FontWeight.w700, fontSize: 14, @@ -277,29 +244,19 @@ class ReferredPatientDetailScreen extends StatelessWidget { Row( children: [ AppText( - referredPatient.nationalityName != - null - ? referredPatient.nationalityName! - : "", + referredPatient.nationalityName != null ? referredPatient.nationalityName : "", fontWeight: FontWeight.bold, color: Color(0xFF2E303A), - fontSize: - 1.4 * SizeConfig.textMultiplier!, + fontSize: 1.4 * SizeConfig.textMultiplier, ), - referredPatient.nationalityFlagURL != - null + referredPatient.nationalityFlagURL != null ? ClipRRect( - borderRadius: - BorderRadius.circular(20.0), + borderRadius: BorderRadius.circular(20.0), child: Image.network( - referredPatient - .nationalityFlagURL!, + referredPatient.nationalityFlagURL, height: 25, width: 30, - errorBuilder: (BuildContext - context, - Object exception, - StackTrace? stackTrace) { + errorBuilder: (BuildContext context, Object exception, StackTrace stackTrace) { return Text('No Image'); }, )) @@ -311,20 +268,17 @@ class ReferredPatientDetailScreen extends StatelessWidget { if (referredPatient.priorityDescription != null) Row( mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: - CrossAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - TranslationBase.of(context).priority + - ": ", + TranslationBase.of(context).priority + ": ", fontFamily: 'Poppins', fontWeight: FontWeight.w600, - fontSize: - 1.7 * SizeConfig.textMultiplier!, + fontSize: 1.7 * SizeConfig.textMultiplier, color: Color(0XFF575757), ), AppText( - referredPatient.priorityDescription!, + referredPatient.priorityDescription, fontFamily: 'Poppins', fontWeight: FontWeight.w700, fontSize: 14, @@ -335,33 +289,21 @@ class ReferredPatientDetailScreen extends StatelessWidget { if (referredPatient.mAXResponseTime != null) Row( mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: - CrossAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - TranslationBase.of(context) - .maxResponseTime + - ": ", + TranslationBase.of(context).maxResponseTime + ": ", fontFamily: 'Poppins', fontWeight: FontWeight.w600, - fontSize: - 1.7 * SizeConfig.textMultiplier!, + fontSize: 1.7 * SizeConfig.textMultiplier, color: Color(0XFF575757), ), Expanded( child: AppText( - referredPatient.mAXResponseTime != - null - ? AppDateUtils - .convertDateFromServerFormat( - referredPatient - .mAXResponseTime!, - "dd MMM,yyyy") - : '', + referredPatient.mAXResponseTime != null ? AppDateUtils.convertDateFromServerFormat(referredPatient.mAXResponseTime, "dd MMM,yyyy") : '', fontFamily: 'Poppins', fontWeight: FontWeight.w700, - fontSize: - 1.8 * SizeConfig.textMultiplier!, + fontSize: 1.8 * SizeConfig.textMultiplier, color: Color(0XFF2E303A), ), ), @@ -371,8 +313,7 @@ class ReferredPatientDetailScreen extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ Container( - margin: - EdgeInsets.only(left: 10, right: 0), + margin: EdgeInsets.only(left: 10, right: 0), child: Image.asset( 'assets/images/patient/ic_ref_arrow_left.png', height: 50, @@ -380,34 +321,22 @@ class ReferredPatientDetailScreen extends StatelessWidget { ), ), Container( - margin: EdgeInsets.only( - left: 0, - top: 25, - right: 0, - bottom: 0), - padding: EdgeInsets.only( - left: 4.0, right: 4.0), - child: referredPatient.doctorImageURL != - null + margin: EdgeInsets.only(left: 0, top: 25, right: 0, bottom: 0), + padding: EdgeInsets.only(left: 4.0, right: 4.0), + child: referredPatient.doctorImageURL != null ? ClipRRect( - borderRadius: - BorderRadius.circular(20.0), + borderRadius: BorderRadius.circular(20.0), child: Image.network( - referredPatient.doctorImageURL!, + referredPatient.doctorImageURL, height: 25, width: 30, - errorBuilder: - (BuildContext context, - Object exception, - StackTrace? stackTrace) { + errorBuilder: (BuildContext context, Object exception, StackTrace stackTrace) { return Text('No Image'); }, )) : Container( child: Image.asset( - referredPatient.gender == 1 - ? 'assets/images/male_avatar.png' - : 'assets/images/female_avatar.png', + referredPatient.gender == 1 ? 'assets/images/male_avatar.png' : 'assets/images/female_avatar.png', fit: BoxFit.cover, ), ), @@ -415,30 +344,22 @@ class ReferredPatientDetailScreen extends StatelessWidget { Expanded( flex: 4, child: Container( - margin: EdgeInsets.only( - left: 10, - top: 30, - right: 10, - bottom: 0), + margin: EdgeInsets.only(left: 10, top: 30, right: 10, bottom: 0), child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( "${TranslationBase.of(context).dr} ${referredPatient.referralDoctorName}", fontFamily: 'Poppins', fontWeight: FontWeight.w800, - fontSize: 1.5 * - SizeConfig.textMultiplier!, + fontSize: 1.5 * SizeConfig.textMultiplier, color: Colors.black, ), AppText( - referredPatient - .referralClinicDescription!, + referredPatient.referralClinicDescription, fontFamily: 'Poppins', fontWeight: FontWeight.w700, - fontSize: 1.3 * - SizeConfig.textMultiplier!, + fontSize: 1.3 * SizeConfig.textMultiplier, color: Color(0XFF2E303A), ), ], @@ -478,14 +399,14 @@ class ReferredPatientDetailScreen extends StatelessWidget { TranslationBase.of(context).remarks, fontFamily: 'Poppins', fontWeight: FontWeight.w700, - fontSize: 2.4 * SizeConfig.textMultiplier!, + fontSize: 2.4 * SizeConfig.textMultiplier, color: Color(0XFF2E303A), ), AppText( - referredPatient.referringDoctorRemarks!, + referredPatient.referringDoctorRemarks, fontFamily: 'Poppins', fontWeight: FontWeight.w600, - fontSize: 1.8 * SizeConfig.textMultiplier!, + fontSize: 1.8 * SizeConfig.textMultiplier, color: Color(0XFF2E303A), ), SizedBox( @@ -495,27 +416,22 @@ class ReferredPatientDetailScreen extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ Container( - margin: EdgeInsets.only( - left: 0, top: 0, right: 4, bottom: 0), + margin: EdgeInsets.only(left: 0, top: 0, right: 4, bottom: 0), padding: EdgeInsets.only(left: 4.0, right: 4.0), child: referredPatient.doctorImageURL != null ? ClipRRect( borderRadius: BorderRadius.circular(20.0), child: Image.network( - referredPatient.doctorImageURL!, + referredPatient.doctorImageURL, height: 25, width: 30, - errorBuilder: (BuildContext context, - Object exception, - StackTrace? stackTrace) { + errorBuilder: (BuildContext context, Object exception, StackTrace stackTrace) { return Text('No Image'); }, )) : Container( child: Image.asset( - referredPatient.gender == 1 - ? 'assets/images/male_avatar.png' - : 'assets/images/female_avatar.png', + referredPatient.gender == 1 ? 'assets/images/male_avatar.png' : 'assets/images/female_avatar.png', fit: BoxFit.cover, ), ), @@ -528,22 +444,18 @@ class ReferredPatientDetailScreen extends StatelessWidget { TranslationBase.of(context).reply, fontFamily: 'Poppins', fontWeight: FontWeight.w700, - fontSize: 1.8 * SizeConfig.textMultiplier!, + fontSize: 1.8 * SizeConfig.textMultiplier, color: Color(0XFF2E303A), ), AppText( - referredPatient.referredDoctorRemarks == - null + referredPatient.referredDoctorRemarks == null ? '' - : referredPatient.referredDoctorRemarks! - .isNotEmpty - ? referredPatient - .referredDoctorRemarks! - : TranslationBase.of(context) - .notRepliedYet, + : referredPatient.referredDoctorRemarks.isNotEmpty + ? referredPatient.referredDoctorRemarks + : TranslationBase.of(context).notRepliedYet, fontFamily: 'Poppins', fontWeight: FontWeight.w600, - fontSize: 1.6 * SizeConfig.textMultiplier!, + fontSize: 1.6 * SizeConfig.textMultiplier, color: Color(0XFF2E303A), ), ], @@ -561,14 +473,14 @@ class ReferredPatientDetailScreen extends StatelessWidget { margin: EdgeInsets.symmetric(horizontal: 16, vertical: 16), child: AppButton( title: TranslationBase.of(context).acknowledged, - color: Colors.red[700]!, + color: Colors.red[700], fontColor: Colors.white, fontWeight: FontWeight.w700, hPadding: 8, vPadding: 12, disabled: referredPatient.referredDoctorRemarks == null ? true - : referredPatient.referredDoctorRemarks!.isNotEmpty + : referredPatient.referredDoctorRemarks.isNotEmpty ? false : true, onPressed: () async { @@ -576,8 +488,7 @@ class ReferredPatientDetailScreen extends StatelessWidget { if (model.state == ViewState.ErrorLocal) { DrAppToastMsg.showErrorToast(model.error); } else { - DrAppToastMsg.showSuccesToast( - "Referral is acknowledged"); + DrAppToastMsg.showSuccesToast("Referral is acknowledged"); Navigator.pop(context); } }, diff --git a/lib/screens/patients/profile/soap_update/assessment/add_assessment_details.dart b/lib/screens/patients/profile/soap_update/assessment/add_assessment_details.dart index e16b6848..af217257 100644 --- a/lib/screens/patients/profile/soap_update/assessment/add_assessment_details.dart +++ b/lib/screens/patients/profile/soap_update/assessment/add_assessment_details.dart @@ -2,18 +2,19 @@ import 'package:autocomplete_textfield/autocomplete_textfield.dart'; import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/enum/view_state.dart'; +import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; +import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/core/model/SOAP/Assessment/patch_assessment_req_model.dart'; -import 'package:doctor_app_flutter/core/model/SOAP/Assessment/post_assessment_request_model.dart'; import 'package:doctor_app_flutter/core/model/SOAP/master_key_model.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/Assessment/post_assessment_request_model.dart'; import 'package:doctor_app_flutter/core/model/SOAP/selected_items/my_selected_assement.dart'; import 'package:doctor_app_flutter/core/model/doctor/doctor_profile_model.dart'; import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; -import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; -import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.dart'; -import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; +import 'package:doctor_app_flutter/utils/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/utils/utils.dart'; +import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; import 'package:doctor_app_flutter/widgets/bottom_sheet/custom_bottom_sheet_container.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; @@ -26,13 +27,13 @@ import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; class AddAssessmentDetails extends StatefulWidget { - final MySelectedAssessment? mySelectedAssessment; - final List? mySelectedAssessmentList; - final Function(MySelectedAssessment mySelectedAssessment, bool isUpdate)? addSelectedAssessment; - final PatiantInformtion? patientInfo; + final MySelectedAssessment mySelectedAssessment; + final List mySelectedAssessmentList; + final Function(MySelectedAssessment mySelectedAssessment, bool isUpdate) addSelectedAssessment; + final PatiantInformtion patientInfo; final bool isUpdate; - AddAssessmentDetails({Key? key, this.mySelectedAssessment, this.addSelectedAssessment, this.patientInfo, this.isUpdate = false, this.mySelectedAssessmentList}); + AddAssessmentDetails({Key key, this.mySelectedAssessment, this.addSelectedAssessment, this.patientInfo, this.isUpdate = false, this.mySelectedAssessmentList}); @override _AddAssessmentDetailsState createState() => _AddAssessmentDetailsState(); @@ -45,23 +46,23 @@ class _AddAssessmentDetailsState extends State { TextEditingController typeController = TextEditingController(); TextEditingController icdNameController = TextEditingController(); - GlobalKey> key = GlobalKey>(); + GlobalKey key = new GlobalKey>(); bool isFormSubmitted = false; @override Widget build(BuildContext context) { ProjectViewModel projectViewModel = Provider.of(context); - remarkController.text = widget.mySelectedAssessment!.remark ?? ""; - appointmentIdController.text = widget.mySelectedAssessment!.appointmentId.toString(); + remarkController.text = widget.mySelectedAssessment.remark ?? ""; + appointmentIdController.text = widget.mySelectedAssessment.appointmentId.toString(); if (widget.isUpdate) { - if (widget.mySelectedAssessment!.selectedDiagnosisCondition != null) - conditionController.text = projectViewModel.isArabic ? widget.mySelectedAssessment!.selectedDiagnosisCondition!.nameAr! : widget.mySelectedAssessment!.selectedDiagnosisCondition!.nameEn!; - if (widget.mySelectedAssessment!.selectedDiagnosisType != null) - typeController.text = projectViewModel.isArabic ? widget.mySelectedAssessment!.selectedDiagnosisType!.nameAr! : widget.mySelectedAssessment!.selectedDiagnosisType!.nameEn!; - if (widget.mySelectedAssessment!.selectedICD != null) icdNameController.text = widget.mySelectedAssessment!.selectedICD!.code; + if (widget.mySelectedAssessment.selectedDiagnosisCondition != null) + conditionController.text = projectViewModel.isArabic ? widget.mySelectedAssessment.selectedDiagnosisCondition.nameAr : widget.mySelectedAssessment.selectedDiagnosisCondition.nameEn; + if (widget.mySelectedAssessment.selectedDiagnosisType != null) + typeController.text = projectViewModel.isArabic ? widget.mySelectedAssessment.selectedDiagnosisType.nameAr : widget.mySelectedAssessment.selectedDiagnosisType.nameEn; + if (widget.mySelectedAssessment.selectedICD != null) icdNameController.text = widget.mySelectedAssessment.selectedICD.code; } - InputDecoration textFieldSelectorDecoration(String hintText, String selectedText, bool isDropDown, {IconData? icon, String? validationError}) { + InputDecoration textFieldSelectorDecoration(String hintText, String selectedText, bool isDropDown, {IconData icon, String validationError}) { return new InputDecoration( fillColor: Colors.white, contentPadding: EdgeInsets.symmetric(vertical: 15, horizontal: 10), @@ -91,7 +92,7 @@ class _AddAssessmentDetailsState extends State { heightFactor: 1, child: BaseView( onModelReady: (model) async { - model.callAddAssessmentLookupsServices(); + // model.callAddAssessmentLookupsServices(); }, builder: (_, model, w) => AppScaffold( baseViewModel: model, @@ -114,76 +115,133 @@ class _AddAssessmentDetailsState extends State { child: AppTextFieldCustom( // height: 55.0, height: Utils.getTextFieldHeight(), - hintText: TranslationBase.of(context).appointmentNumber, isTextFieldHasSuffix: false, enabled: false, controller: appointmentIdController, - onClick: () {}, - onChanged: (value) {}, - onFieldSubmitted: () {}, ), ), SizedBox( height: 10, ), - Container( - child: InkWell( + Column( + children:[ InkWell( onTap: model.listOfICD10 != null ? () { setState(() { - widget.mySelectedAssessment!.selectedICD = null; - icdNameController.text = ""; + widget.mySelectedAssessment.selectedICD = null; + icdNameController.text = null; }); } : null, - child: widget.mySelectedAssessment!.selectedICD == null - ? CustomAutoCompleteTextField( - isShowError: isFormSubmitted && widget.mySelectedAssessment!.selectedICD == null, - child: AutoCompleteTextField( - decoration: TextFieldsUtils.textFieldSelectorDecoration(TranslationBase.of(context).nameOrICD, "", true, suffixIcon: Icons.search), - itemSubmitted: (item) => setState(() { - widget.mySelectedAssessment!.selectedICD = item; - icdNameController.text = '${item.code.trim()}/${item.description}'; - }), - key: key, - suggestions: model.listOfICD10, - itemBuilder: (context, suggestion) => new Padding(child: AppText(suggestion.description + " / " + suggestion.code.toString()), padding: EdgeInsets.all(8.0)), - itemSorter: (a, b) => 1, - itemFilter: (suggestion, input) => - suggestion.description.toLowerCase().startsWith(input.toLowerCase()) || - suggestion.description.toLowerCase().startsWith(input.toLowerCase()) || - suggestion.code.toLowerCase().startsWith(input.toLowerCase()), - ), - ) - : AppTextFieldCustom( - height: Utils.getTextFieldHeight(), - onClick: model.listOfICD10 != null - ? () { - setState(() { - widget.mySelectedAssessment!.selectedICD = null; - icdNameController.text = ""; - }); - } - : () {}, - hintText: TranslationBase.of(context).nameOrICD, - maxLines: 1, - minLines: 1, - controller: icdNameController, - enabled: true, - isTextFieldHasSuffix: true, - suffixIcon: IconButton( - icon: Icon( - Icons.search, - color: Colors.grey.shade600, - ), - onPressed: () {}, - ), - onChanged: (value) {}, - onFieldSubmitted: () {}, + child: AppTextFieldCustom( + onChanged: (text){ + setState(() { + icdNameController.text; + }); + }, + height: Utils.getTextFieldHeight(), + onClick: model.listOfICD10 != null + ? () { + setState(() { + widget.mySelectedAssessment.selectedICD = null; + icdNameController.text = null; + }); + } + : null, + hintText: TranslationBase.of(context).nameOrICD, + maxLines: 1, + minLines: 1, + controller: icdNameController, + enabled: true, + isTextFieldHasSuffix: true, + suffixIcon: IconButton( + onPressed: () { + print(icdNameController.text); + if (icdNameController.text.length <= 3) { + DrAppToastMsg.showErrorToast("Please enter 4 or more characters"); + } else { + model.listOfICD10.clear(); + model.callAddAssessmentLookupsServices(searchKey: icdNameController.text); + } + }, + icon: Icon( + Icons.search, + color: Colors.grey.shade600, )), - ), - if (widget.mySelectedAssessment!.selectedICD != null) + )), + + model.listOfICD10.length >0 && icdNameController.text.isNotEmpty ? Container( + color: Colors.white, + height: MediaQuery.of(context).size.height * 0.4, //height to 9% of screen height, + child:ListView.builder( + shrinkWrap: true, + itemCount: model.listOfICD10.length, + itemBuilder: (context, index) { + return InkWell(child:ListTile( + title: AppText( model.listOfICD10[index].description + " / " + model.listOfICD10[index].code.toString(), fontSize: 12.0)), + onTap: (){ + + widget.mySelectedAssessment.selectedICD = model.listOfICD10[index]; + icdNameController.text = model.listOfICD10[index].description; + model.listOfICD10.clear(); + setState(() { + + }); + } + ); + + }, + )) :SizedBox() + // CustomAutoCompleteTextField( + // isShowError: isFormSubmitted && widget.mySelectedAssessment.selectedICD == null, + // child: Row( + // mainAxisAlignment: MainAxisAlignment.spaceBetween, + // mainAxisSize: MainAxisSize.min, + // children: [ + // AutoCompleteTextField( + // decoration: TextFieldsUtils.textFieldSelectorDecoration(TranslationBase.of(context).nameOrICD, null, true, suffixIcon: null), + // controller: icdNameController, + // itemSubmitted: (item) => setState(() { + // widget.mySelectedAssessment.selectedICD = item; + // // icdNameController.text = '${item.code.trim()}/${item.description}'; + // icdNameController.text = '${item.description}'; + // }), + // key: key, + // suggestions: model.listOfICD10, + // suggestionsAmount: model.listOfICD10.length, + // itemBuilder: (context, suggestion) => + // new Padding(child: AppText(suggestion.description + " / " + suggestion.code.toString(), fontSize: 12.0), padding: EdgeInsets.all(8.0)), + // itemSorter: (a, b) => 1, + // itemFilter: (suggestion, input) => + // // suggestion.description.toLowerCase().startsWith(input.toLowerCase()) || + // // suggestion.description.toLowerCase().startsWith(input.toLowerCase()) || + // // suggestion.code.toLowerCase().startsWith(input.toLowerCase()), + // suggestion.description.toLowerCase().contains(input.toLowerCase()) || + // // suggestion.description.toLowerCase().startsWith(input.toLowerCase()) || + // suggestion.code.toLowerCase().contains(input.toLowerCase()), + // + // ), + // Expanded( + // child: IconButton( + // onPressed: () { + // print(icdNameController.text); + // if (icdNameController.text.length <= 3) { + // DrAppToastMsg.showErrorToast("Please enter 4 or more characters"); + // } else { + // model.listOfICD10.clear(); + // model.callAddAssessmentLookupsServices(searchKey: icdNameController.text); + // } + // }, + // icon: Icon(Icons.search), + // ), + // ), + // ], + // ), + // ) + + ]), + if (widget.mySelectedAssessment.selectedICD != null) Column( children: [ SizedBox( @@ -192,7 +250,7 @@ class _AddAssessmentDetailsState extends State { Container( width: MediaQuery.of(context).size.width * 0.7, child: AppText( - widget.mySelectedAssessment!.selectedICD!.description + (' (${widget.mySelectedAssessment!.selectedICD!.code} )'), + widget.mySelectedAssessment.selectedICD.description + (' (${widget.mySelectedAssessment.selectedICD.code} )'), color: Color(0xFF575757), fontSize: 10, fontWeight: FontWeight.w700, @@ -211,13 +269,12 @@ class _AddAssessmentDetailsState extends State { MasterKeyDailog dialog = MasterKeyDailog( list: model.listOfDiagnosisCondition, okText: TranslationBase.of(context).ok, - selectedValue: widget.mySelectedAssessment!.selectedDiagnosisCondition!, + selectedValue: widget.mySelectedAssessment.selectedDiagnosisCondition, okFunction: (MasterKeyModel selectedValue) { setState(() { - widget.mySelectedAssessment!.selectedDiagnosisCondition = selectedValue; - conditionController.text = projectViewModel.isArabic - ? widget.mySelectedAssessment!.selectedDiagnosisCondition!.nameAr! - : widget.mySelectedAssessment!.selectedDiagnosisCondition!.nameEn!; + widget.mySelectedAssessment.selectedDiagnosisCondition = selectedValue; + conditionController.text = + projectViewModel.isArabic ? widget.mySelectedAssessment.selectedDiagnosisCondition.nameAr : widget.mySelectedAssessment.selectedDiagnosisCondition.nameEn; }); }, ); @@ -229,7 +286,7 @@ class _AddAssessmentDetailsState extends State { }, ); } - : () {}, + : null, hintText: TranslationBase.of(context).condition, maxLines: 1, minLines: 1, @@ -237,9 +294,7 @@ class _AddAssessmentDetailsState extends State { isTextFieldHasSuffix: true, enabled: false, hasBorder: true, - validationError: isFormSubmitted && widget.mySelectedAssessment!.selectedDiagnosisCondition == null ? TranslationBase.of(context).emptyMessage : "", - onChanged: (value) {}, - onFieldSubmitted: () {}, + validationError: isFormSubmitted && widget.mySelectedAssessment.selectedDiagnosisCondition == null ? TranslationBase.of(context).emptyMessage : null, ), SizedBox( height: 10, @@ -251,11 +306,11 @@ class _AddAssessmentDetailsState extends State { MasterKeyDailog dialog = MasterKeyDailog( list: model.listOfDiagnosisType, okText: TranslationBase.of(context).ok, - selectedValue: widget.mySelectedAssessment!.selectedDiagnosisType!, + selectedValue: widget.mySelectedAssessment.selectedDiagnosisType, okFunction: (MasterKeyModel selectedValue) { setState(() { - widget.mySelectedAssessment!.selectedDiagnosisType = selectedValue; - typeController.text = projectViewModel.isArabic ? selectedValue.nameAr! : selectedValue.nameEn!; + widget.mySelectedAssessment.selectedDiagnosisType = selectedValue; + typeController.text = projectViewModel.isArabic ? selectedValue.nameAr : selectedValue.nameEn; }); }, ); @@ -267,7 +322,7 @@ class _AddAssessmentDetailsState extends State { }, ); } - : () {}, + : null, hintText: TranslationBase.of(context).dType, maxLines: 1, minLines: 1, @@ -275,9 +330,7 @@ class _AddAssessmentDetailsState extends State { isTextFieldHasSuffix: true, controller: typeController, hasBorder: true, - validationError: isFormSubmitted && widget.mySelectedAssessment!.selectedDiagnosisType == null ? TranslationBase.of(context).emptyMessage : "", - onChanged: (value) {}, - onFieldSubmitted: () {}, + validationError: isFormSubmitted && widget.mySelectedAssessment.selectedDiagnosisType == null ? TranslationBase.of(context).emptyMessage : null, ), SizedBox( height: 10, @@ -291,14 +344,12 @@ class _AddAssessmentDetailsState extends State { inputType: TextInputType.multiline, controller: remarkController, onChanged: (value) { - widget.mySelectedAssessment!.remark = remarkController.text; + widget.mySelectedAssessment.remark = remarkController.text; }, - onClick: () {}, - onFieldSubmitted: () {}, ), ), SizedBox( - height: SizeConfig.heightMultiplier! * + height: SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort ? 20 : SizeConfig.isHeightShort @@ -321,12 +372,12 @@ class _AddAssessmentDetailsState extends State { setState(() { isFormSubmitted = true; }); - widget.mySelectedAssessment!.remark = remarkController.text; - widget.mySelectedAssessment!.appointmentId = int.parse(appointmentIdController.text); - if (widget.mySelectedAssessment!.selectedDiagnosisCondition != null && - widget.mySelectedAssessment!.selectedDiagnosisType != null && - widget.mySelectedAssessment!.selectedICD != null) { - await submitAssessment(isUpdate: widget.isUpdate, model: model, mySelectedAssessment: widget.mySelectedAssessment!); + widget.mySelectedAssessment.remark = remarkController.text; + widget.mySelectedAssessment.appointmentId = int.parse(appointmentIdController.text); + if (widget.mySelectedAssessment.selectedDiagnosisCondition != null && + widget.mySelectedAssessment.selectedDiagnosisType != null && + widget.mySelectedAssessment.selectedICD != null) { + await submitAssessment(isUpdate: widget.isUpdate, model: model, mySelectedAssessment: widget.mySelectedAssessment); } }, ), @@ -335,44 +386,50 @@ class _AddAssessmentDetailsState extends State { ); } - submitAssessment({SOAPViewModel? model, MySelectedAssessment? mySelectedAssessment, bool isUpdate = false}) async { + submitAssessment({SOAPViewModel model, MySelectedAssessment mySelectedAssessment, bool isUpdate = false}) async { GifLoaderDialogUtils.showMyDialog(context); if (isUpdate) { PatchAssessmentReqModel patchAssessmentReqModel = PatchAssessmentReqModel( - patientMRN: widget.patientInfo!.patientMRN, - episodeID: widget.patientInfo!.episodeNo, - appointmentNo: widget.patientInfo!.appointmentNo, - remarks: mySelectedAssessment!.remark, + patientMRN: widget.patientInfo.patientMRN, + episodeID: widget.patientInfo.episodeNo, + appointmentNo: widget.patientInfo.appointmentNo, + remarks: mySelectedAssessment.remark, complexDiagnosis: true, - conditionId: mySelectedAssessment.selectedDiagnosisCondition!.id, - diagnosisTypeId: mySelectedAssessment.selectedDiagnosisType!.id, - icdcode10Id: mySelectedAssessment.selectedICD!.code, + conditionId: mySelectedAssessment.selectedDiagnosisCondition.id, + diagnosisTypeId: mySelectedAssessment.selectedDiagnosisType.id, + icdcode10Id: mySelectedAssessment.selectedICD.code, prevIcdCode10ID: mySelectedAssessment.icdCode10ID); - await model!.patchAssessment(patchAssessmentReqModel); + await model.patchAssessment(patchAssessmentReqModel); } else { - PostAssessmentRequestModel postAssessmentRequestModel = - new PostAssessmentRequestModel(patientMRN: widget.patientInfo!.patientMRN, episodeId: widget.patientInfo!.episodeNo, appointmentNo: widget.patientInfo!.appointmentNo, icdCodeDetails: [ - new IcdCodeDetails( - remarks: mySelectedAssessment!.remark, - complexDiagnosis: true, - conditionId: mySelectedAssessment.selectedDiagnosisCondition!.id, - diagnosisTypeId: mySelectedAssessment.selectedDiagnosisType!.id, - icdcode10Id: mySelectedAssessment.selectedICD!.code) - ]); - - await model!.postAssessment(postAssessmentRequestModel); + Map profile = await sharedPref.getObj(DOCTOR_PROFILE); + DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile); + PostAssessmentRequestModel postAssessmentRequestModel = new PostAssessmentRequestModel( + patientMRN: widget.patientInfo.patientMRN, + episodeId: widget.patientInfo.episodeNo, + appointmentNo: widget.patientInfo.appointmentNo, + createdByName: doctorProfile.doctorName, + createdBy: doctorProfile.doctorID, + icdCodeDetails: [ + new IcdCodeDetails( + remarks: mySelectedAssessment.remark, + complexDiagnosis: true, + conditionId: mySelectedAssessment.selectedDiagnosisCondition.id, + diagnosisTypeId: mySelectedAssessment.selectedDiagnosisType.id, + icdcode10Id: mySelectedAssessment.selectedICD.code) + ]); + await model.postAssessment(postAssessmentRequestModel); } GifLoaderDialogUtils.hideDialog(context); if (model.state == ViewState.ErrorLocal) { Utils.showErrorToast(model.error); } else { - Map profile = await sharedPref.getObj(DOCTOR_PROFILE); + Map profile = await sharedPref.getObj(DOCTOR_PROFILE); DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile); - mySelectedAssessment.icdCode10ID = mySelectedAssessment.selectedICD!.code; + mySelectedAssessment.icdCode10ID = mySelectedAssessment.selectedICD.code; mySelectedAssessment.doctorName = doctorProfile.doctorName; - widget.addSelectedAssessment!(mySelectedAssessment, isUpdate); + widget.addSelectedAssessment(mySelectedAssessment, isUpdate); Navigator.of(context).pop(); } } diff --git a/lib/screens/patients/profile/soap_update/assessment/update_assessment_page.dart b/lib/screens/patients/profile/soap_update/assessment/update_assessment_page.dart index e759199b..74b9a1f4 100644 --- a/lib/screens/patients/profile/soap_update/assessment/update_assessment_page.dart +++ b/lib/screens/patients/profile/soap_update/assessment/update_assessment_page.dart @@ -25,26 +25,20 @@ import 'assessment_call_back.dart'; // ignore: must_be_immutable class UpdateAssessmentPage extends StatefulWidget { - final Function? changePageViewIndex; - final PatiantInformtion? patientInfo; - final Function? changeLoadingState; - final int? currentIndex; + final Function changePageViewIndex; + final PatiantInformtion patientInfo; + final Function changeLoadingState; + final int currentIndex; - UpdateAssessmentPage( - {Key? key, - this.changePageViewIndex, - this.patientInfo, - this.changeLoadingState, - this.currentIndex}); + UpdateAssessmentPage({Key key, this.changePageViewIndex, this.patientInfo, this.changeLoadingState, this.currentIndex}); @override _UpdateAssessmentPageState createState() => _UpdateAssessmentPageState(); } -class _UpdateAssessmentPageState extends State - implements AssessmentCallBack { +class _UpdateAssessmentPageState extends State implements AssessmentCallBack { bool isAssessmentExpand = false; - List mySelectedAssessmentList = []; + List mySelectedAssessmentList = List(); @override Widget build(BuildContext context) { @@ -55,7 +49,7 @@ class _UpdateAssessmentPageState extends State model.setAssessmentCallBack(this); mySelectedAssessmentList.clear(); - await model.onUpdateAssessmentStepStart(widget.patientInfo!); + await model.onUpdateAssessmentStepStart(widget.patientInfo); if (model.patientAssessmentList.isNotEmpty) { model.patientAssessmentList.forEach((element) { @@ -71,28 +65,25 @@ class _UpdateAssessmentPageState extends State masterKeys: MasterKeysService.DiagnosisCondition, id: element.conditionID, ); - if (diagnosisCondition != null && - diagnosisType != null && - diagnosisCondition != null) { - MySelectedAssessment temMySelectedAssessment = - SoapUtils.generateMySelectedAssessment( - appointmentNo: element.appointmentNo, - remark: element.remarks, - diagnosisType: diagnosisType, - diagnosisCondition: diagnosisCondition, - selectedICD: selectedICD, - doctorID: element.doctorID, - doctorName: element.doctorName, - createdBy: element.createdBy, - createdOn: element.createdOn, - icdCode10ID: element.icdCode10ID); + if (diagnosisCondition != null && diagnosisType != null && diagnosisCondition != null) { + MySelectedAssessment temMySelectedAssessment = SoapUtils.generateMySelectedAssessment( + appointmentNo: element.appointmentNo, + remark: element.remarks, + diagnosisType: diagnosisType, + diagnosisCondition: diagnosisCondition, + selectedICD: selectedICD, + doctorID: element.doctorID, + doctorName: element.doctorName, + createdBy: element.createdBy, + createdOn: element.createdOn, + icdCode10ID: element.icdCode10ID); mySelectedAssessmentList.add(temMySelectedAssessment); } }); } - widget.changeLoadingState!(false); + widget.changeLoadingState(false); }, builder: (_, model, w) => AppScaffold( isShowAppBar: false, @@ -108,9 +99,9 @@ class _UpdateAssessmentPageState extends State mainAxisAlignment: MainAxisAlignment.start, children: [ SOAPStepHeader( - currentIndex: widget.currentIndex!, - changePageViewIndex: widget.changePageViewIndex!, - patientInfo: widget.patientInfo!, + currentIndex: widget.currentIndex, + changePageViewIndex: widget.changePageViewIndex, + patientInfo: widget.patientInfo, ), ExpandableSOAPWidget( headerTitle: TranslationBase.of(context).assessment, @@ -126,111 +117,73 @@ class _UpdateAssessmentPageState extends State Column( children: [ SOAPOpenItems( - label: - "${TranslationBase.of(context).addAssessment}", + label: "${TranslationBase.of(context).addAssessment}", onTap: () { - openAssessmentDialog(context, - isUpdate: false, model: model); + openAssessmentDialog(context, isUpdate: false, model: model); }, ), SizedBox( height: 20, ), Column( - children: - mySelectedAssessmentList.map((assessment) { + children: mySelectedAssessmentList.map((assessment) { return Container( - margin: EdgeInsets.only( - left: 5, right: 5, top: 15, bottom: 15), + margin: EdgeInsets.only(left: 5, right: 5, top: 15, bottom: 15), child: Column( children: [ Row( - children: [ - RichText( - text: new TextSpan( - style: new TextStyle( - fontSize: SizeConfig - .getTextMultiplierBasedOnWidth() * - 3.6, - color: Color(0xFF2E303A), - fontFamily: 'Poppins', + RichText( + text: new TextSpan( + style: new TextStyle( + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.6, + color: Color(0xFF2E303A), + fontFamily: 'Poppins', + fontWeight: FontWeight.w600, + letterSpacing: -0.4), + children: [ + new TextSpan( + text: "ICD : ".toUpperCase(), + ), + new TextSpan(text: (assessment != null && assessment.selectedICD != null) ? assessment.selectedICD.code.trim().toUpperCase() ?? "" : ""), + ], + ), + ), + Column( + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + AppText( + assessment.createdOn != null + ? AppDateUtils.getDayMonthYearDateFormatted(DateTime.parse(assessment.createdOn), isMonthShort: true) + : AppDateUtils.getDayMonthYearDateFormatted(DateTime.now()), fontWeight: FontWeight.w600, - letterSpacing: -0.4), - children: [ - new TextSpan( - text: "ICD : ".toUpperCase(), + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.6, + ), + AppText( + assessment.createdOn != null ? AppDateUtils.getHour(DateTime.parse(assessment.createdOn)) : AppDateUtils.getHour(DateTime.now()), + fontWeight: FontWeight.w600, + color: Color(0xFF575757), + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.6, ), - new TextSpan( - text: assessment - .selectedICD!.code - .trim() - .toUpperCase() ?? - ""), ], ), - ), - Column( - crossAxisAlignment: - CrossAxisAlignment.end, - children: [ - AppText( - assessment.createdOn != null - ? AppDateUtils - .getDayMonthYearDateFormatted( - DateTime.parse( - assessment - .createdOn!), isMonthShort: true) - : AppDateUtils - .getDayMonthYearDateFormatted( - DateTime.now()), - fontWeight: FontWeight.w600, - fontSize: SizeConfig - .getTextMultiplierBasedOnWidth() * - 3.6, - ), - AppText( - assessment.createdOn != null - ? AppDateUtils.getHour( - DateTime.parse( - assessment - .createdOn!)) - : AppDateUtils.getHour( - DateTime.now()), - fontWeight: FontWeight.w600, - color: Color(0xFF575757), - fontSize: SizeConfig - .getTextMultiplierBasedOnWidth() * - 3.6, - ), - ], - ), - ], + ], mainAxisAlignment: MainAxisAlignment.spaceBetween, crossAxisAlignment: CrossAxisAlignment.start, ), Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - crossAxisAlignment: - CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.start, children: [ Column( - crossAxisAlignment: - CrossAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, children: [ - Container( - width: MediaQuery.of(context) - .size - .width * - 0.50, + width: MediaQuery.of(context).size.width * 0.50, child: RichText( text: new TextSpan( style: new TextStyle( - fontSize: SizeConfig - .getTextMultiplierBasedOnWidth() * - 4.3, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 4.3, color: Color(0xFF2E303A), fontFamily: 'Poppins', fontWeight: FontWeight.w600, @@ -238,9 +191,8 @@ class _UpdateAssessmentPageState extends State ), children: [ new TextSpan( - text: assessment - .selectedICD!.description - .toString(), + text: (assessment != null && assessment.selectedICD != null) ? assessment.selectedICD.description.toString() : "", + // text: assessment.selectedICD.description.toString(), ), ], ), @@ -249,34 +201,24 @@ class _UpdateAssessmentPageState extends State RichText( text: new TextSpan( style: new TextStyle( - fontSize: SizeConfig - .getTextMultiplierBasedOnWidth() * - 3.5, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.5, color: Color(0xFF2E303A), fontFamily: 'Poppins', fontWeight: FontWeight.w600, ), children: [ new TextSpan( - text: TranslationBase.of( - context) - .appointmentNo, + text: TranslationBase.of(context).appointmentNo, style: new TextStyle( - fontSize: SizeConfig - .getTextMultiplierBasedOnWidth() * - 3, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3, letterSpacing: -0.4, color: Color(0xFF575757), ), ), new TextSpan( - text: assessment.appointmentId - .toString() ?? - "", + text: assessment.appointmentId.toString() ?? "", style: new TextStyle( - fontSize: SizeConfig - .getTextMultiplierBasedOnWidth() * - 3.6, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.6, letterSpacing: -0.48, color: Color(0xFF2B353E), ), @@ -287,36 +229,19 @@ class _UpdateAssessmentPageState extends State RichText( text: new TextSpan( style: new TextStyle( - fontSize: SizeConfig - .getTextMultiplierBasedOnWidth() * - 3, - color: Color(0xFF2E303A), - fontFamily: 'Poppins', - fontWeight: FontWeight.w600), + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3, color: Color(0xFF2E303A), fontFamily: 'Poppins', fontWeight: FontWeight.w600), children: [ new TextSpan( - text: TranslationBase.of( - context) - .condition + - " : ", + text: TranslationBase.of(context).condition + " : ", style: new TextStyle( letterSpacing: -0.4, color: Color(0xFF575757), ), ), new TextSpan( - text: projectViewModel - .isArabic - ? assessment - .selectedDiagnosisCondition - !.nameAr - : assessment - .selectedDiagnosisCondition - !.nameEn, + text: projectViewModel.isArabic ? assessment.selectedDiagnosisCondition.nameAr : assessment.selectedDiagnosisCondition.nameEn, style: new TextStyle( - fontSize: SizeConfig - .getTextMultiplierBasedOnWidth() * - 3.6, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.6, letterSpacing: -0.48, color: Color(0xFF2B353E), ), @@ -327,36 +252,19 @@ class _UpdateAssessmentPageState extends State RichText( text: new TextSpan( style: new TextStyle( - fontSize: SizeConfig - .getTextMultiplierBasedOnWidth() * - 3, - color: Color(0xFF2E303A), - fontFamily: 'Poppins', - fontWeight: FontWeight.w600), + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3, color: Color(0xFF2E303A), fontFamily: 'Poppins', fontWeight: FontWeight.w600), children: [ new TextSpan( - text: TranslationBase.of( - context) - .dType + - ' : ', + text: TranslationBase.of(context).dType + ' : ', style: new TextStyle( letterSpacing: -0.4, color: Color(0xFF575757), ), ), new TextSpan( - text: projectViewModel - .isArabic - ? assessment - .selectedDiagnosisType - !.nameAr - : assessment - .selectedDiagnosisType - !.nameEn, + text: projectViewModel.isArabic ? assessment.selectedDiagnosisType.nameAr : assessment.selectedDiagnosisType.nameEn, style: new TextStyle( - fontSize: SizeConfig - .getTextMultiplierBasedOnWidth() * - 3.6, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.6, letterSpacing: -0.48, color: Color(0xFF2B353E), ), @@ -368,35 +276,20 @@ class _UpdateAssessmentPageState extends State RichText( text: new TextSpan( style: new TextStyle( - fontSize: SizeConfig - .getTextMultiplierBasedOnWidth() * - 3.6, - color: Color(0xFF2E303A), - fontFamily: 'Poppins', - fontWeight: - FontWeight.w600), + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.6, color: Color(0xFF2E303A), fontFamily: 'Poppins', fontWeight: FontWeight.w600), children: [ new TextSpan( - text: TranslationBase.of( - context) - .doctor + - ' : ', + text: TranslationBase.of(context).doctor + ' : ', style: new TextStyle( - fontSize: SizeConfig - .getTextMultiplierBasedOnWidth() * - 3, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3, letterSpacing: -0.4, color: Color(0xFF575757), ), ), new TextSpan( - text: - assessment.doctorName ?? - '', + text: assessment.doctorName ?? '', style: new TextStyle( - fontSize: SizeConfig - .getTextMultiplierBasedOnWidth() * - 3.6, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.6, letterSpacing: -0.48, color: Color(0xFF2B353E), ), @@ -408,29 +301,14 @@ class _UpdateAssessmentPageState extends State height: 6, ), Row( - mainAxisAlignment: - MainAxisAlignment.start, - crossAxisAlignment: - CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, children: [ SizedBox( height: 6, ), - AppText( - (assessment.remark != null && - assessment.remark != - '') - ? TranslationBase.of( - context) - .remarks + - " : " - : '', - fontSize: SizeConfig - .getTextMultiplierBasedOnWidth() * - 3, - color: Color(0xFF2E303A), - fontFamily: 'Poppins', - fontWeight: FontWeight.w600), + AppText((assessment.remark != null && assessment.remark != '') ? TranslationBase.of(context).remarks + " : " : '', + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3, color: Color(0xFF2E303A), fontFamily: 'Poppins', fontWeight: FontWeight.w600), RemarkText( remark: assessment.remark ?? "", ), @@ -439,22 +317,14 @@ class _UpdateAssessmentPageState extends State ], ), Column( - crossAxisAlignment: - CrossAxisAlignment.end, + crossAxisAlignment: CrossAxisAlignment.end, children: [ - SizedBox( - height: MediaQuery.of(context) - .size - .height * - 0.05, + height: MediaQuery.of(context).size.height * 0.05, ), InkWell( onTap: () { - openAssessmentDialog(context, - isUpdate: true, - assessment: assessment, - model: model); + openAssessmentDialog(context, isUpdate: true, assessment: assessment, model: model); }, child: Icon( DoctorApp.edit, @@ -488,11 +358,9 @@ class _UpdateAssessmentPageState extends State ); } - openAssessmentDialog(BuildContext context, - {MySelectedAssessment? assessment, bool isUpdate = false, SOAPViewModel? model}) { + openAssessmentDialog(BuildContext context, {MySelectedAssessment assessment, bool isUpdate, SOAPViewModel model}) { if (assessment == null) { - assessment = SoapUtils.generateMySelectedAssessment( - remark: '', appointmentNo: widget.patientInfo!.appointmentNo); + assessment = SoapUtils.generateMySelectedAssessment(remark: '', appointmentNo: widget.patientInfo.appointmentNo); } showModalBottomSheet( backgroundColor: Colors.white, @@ -504,11 +372,9 @@ class _UpdateAssessmentPageState extends State patientInfo: widget.patientInfo, isUpdate: isUpdate, mySelectedAssessmentList: mySelectedAssessmentList, - addSelectedAssessment: (MySelectedAssessment mySelectedAssessment, - bool isUpdate) async { + addSelectedAssessment: (MySelectedAssessment mySelectedAssessment, bool isUpdate) async { setState(() { - if (!isUpdate) - mySelectedAssessmentList.add(mySelectedAssessment); + if (!isUpdate) mySelectedAssessmentList.add(mySelectedAssessment); }); }); }); @@ -519,8 +385,8 @@ class _UpdateAssessmentPageState extends State if (mySelectedAssessmentList.isEmpty) { Utils.showErrorToast(TranslationBase.of(context).assessmentErrorMsg); } else { - widget.changeLoadingState!(true); - widget.changePageViewIndex!(3); + widget.changeLoadingState(true); + widget.changePageViewIndex(3); } } } diff --git a/lib/screens/patients/profile/soap_update/objective/update_objective_page.dart b/lib/screens/patients/profile/soap_update/objective/update_objective_page.dart index 7ac48f78..451fd5d8 100644 --- a/lib/screens/patients/profile/soap_update/objective/update_objective_page.dart +++ b/lib/screens/patients/profile/soap_update/objective/update_objective_page.dart @@ -26,12 +26,12 @@ import 'examination_item_card.dart'; import 'objective_call_back.dart'; class UpdateObjectivePage extends StatefulWidget { - final Function? changePageViewIndex; - final Function? changeLoadingState; + final Function changePageViewIndex; + final Function changeLoadingState; final int currentIndex; - final PatiantInformtion? patientInfo; + final PatiantInformtion patientInfo; - UpdateObjectivePage({Key? key, this.changePageViewIndex, this.patientInfo, this.changeLoadingState, this.currentIndex = 0}); + UpdateObjectivePage({Key key, this.changePageViewIndex, this.patientInfo, this.changeLoadingState, this.currentIndex}); @override _UpdateObjectivePageState createState() => _UpdateObjectivePageState(); @@ -39,7 +39,7 @@ class UpdateObjectivePage extends StatefulWidget { class _UpdateObjectivePageState extends State implements ObjectiveCallBack { bool isSysExaminationExpand = false; - List mySelectedExamination = []; + List mySelectedExamination = List(); BoxDecoration containerBorderDecoration(Color containerColor, Color borderColor) { return BoxDecoration( @@ -60,7 +60,7 @@ class _UpdateObjectivePageState extends State implements Ob model.setObjectiveCallBack(this); mySelectedExamination.clear(); model.isAddExamInProgress = true; - await model.getPatientPhysicalExam(widget.patientInfo!); + await model.getPatientPhysicalExam(widget.patientInfo); if (model.patientPhysicalExamList.isNotEmpty) { if (model.physicalExaminationList.length == 0) { await model.getMasterLookup(MasterKeysService.PhysicalExamination); @@ -85,7 +85,7 @@ class _UpdateObjectivePageState extends State implements Ob mySelectedExamination.add(tempEam); }); } - widget.changeLoadingState!(false); + widget.changeLoadingState(false); }, builder: (_, model, w) => AppScaffold( isShowAppBar: false, @@ -101,8 +101,8 @@ class _UpdateObjectivePageState extends State implements Ob children: [ SOAPStepHeader( currentIndex: widget.currentIndex, - changePageViewIndex: widget.changePageViewIndex!, - patientInfo: widget.patientInfo!, + changePageViewIndex: widget.changePageViewIndex, + patientInfo: widget.patientInfo, ), ExpandableSOAPWidget( headerTitle: TranslationBase.of(context).physicalSystemExamination, @@ -135,7 +135,7 @@ class _UpdateObjectivePageState extends State implements Ob .sublist(0, model.getFirstIndexForOldExamination(mySelectedExamination) == -1 ? 0 : model.getFirstIndexForOldExamination(mySelectedExamination)) .map((examination) { return ExaminationItemCard(examination, () { - removeExamination(examination.selectedExamination!); + removeExamination(examination.selectedExamination); }); }).toList(), ), @@ -155,7 +155,7 @@ class _UpdateObjectivePageState extends State implements Ob .sublist(model.getFirstIndexForOldExamination(mySelectedExamination) == -1 ? 0 : model.getFirstIndexForOldExamination(mySelectedExamination)) .map((examination) { return ExaminationItemCard(examination, () { - removeExamination(examination.selectedExamination!); + removeExamination(examination.selectedExamination); }); }).toList(), ) @@ -164,7 +164,7 @@ class _UpdateObjectivePageState extends State implements Ob isExpanded: isSysExaminationExpand, ), SizedBox( - height: SizeConfig.heightMultiplier! * (SizeConfig.isHeightVeryShort ? 14 : 12), + height: SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort ? 14 : 12), ) ], ), @@ -177,27 +177,27 @@ class _UpdateObjectivePageState extends State implements Ob submitUpdateObjectivePage(SOAPViewModel model) async { if (mySelectedExamination.isNotEmpty) { - if (!model.isAddExamInProgress && widget.patientInfo!.admissionNo != null && widget.patientInfo!.admissionNo!.isNotEmpty) { + if (!model.isAddExamInProgress && widget.patientInfo.admissionNo != null && widget.patientInfo.admissionNo.isNotEmpty) { Navigator.of(context).pop(); } else { - widget.changeLoadingState!(true); - Map profile = await sharedPref.getObj(DOCTOR_PROFILE); + widget.changeLoadingState(true); + Map profile = await sharedPref.getObj(DOCTOR_PROFILE); DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile); PostPhysicalExamRequestModel postPhysicalExamRequestModel = new PostPhysicalExamRequestModel(); mySelectedExamination.forEach((exam) { if (postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM == null) postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM = []; ListHisProgNotePhysicalExaminationVM listHisProgNotePhysicalExaminationVM = ListHisProgNotePhysicalExaminationVM( - patientMRN: widget.patientInfo!.patientMRN, - episodeId: widget.patientInfo!.episodeNo == null ? 0 : widget.patientInfo!.episodeNo, - appointmentNo: widget.patientInfo!.appointmentNo == null ? 0 : widget.patientInfo!.appointmentNo, + patientMRN: widget.patientInfo.patientMRN, + episodeId: widget.patientInfo.episodeNo == null ? 0 : widget.patientInfo.episodeNo, + appointmentNo: widget.patientInfo.appointmentNo == null ? 0 : widget.patientInfo.appointmentNo, remarks: exam.remark ?? '', createdBy: exam.createdBy ?? doctorProfile.doctorID, createdOn: exam.createdOn ?? DateTime.now().toIso8601String(), editedBy: doctorProfile.doctorID, editedOn: DateTime.now().toIso8601String(), - examId: exam.selectedExamination!.id, - examType: exam.selectedExamination!.typeId, + examId: exam.selectedExamination.id, + examType: exam.selectedExamination.typeId, isAbnormal: exam.isAbnormal, isNormal: exam.isNormal, notExamined: exam.notExamined, @@ -213,12 +213,12 @@ class _UpdateObjectivePageState extends State implements Ob : "Not Examined", isNew: exam.isNew, ); - if (widget.patientInfo!.admissionNo != null && widget.patientInfo!.admissionNo!.isNotEmpty) { - listHisProgNotePhysicalExaminationVM.admissionNo = int.parse(widget.patientInfo!.admissionNo!); + if (widget.patientInfo.admissionNo != null && widget.patientInfo.admissionNo.isNotEmpty) { + listHisProgNotePhysicalExaminationVM.admissionNo = int.parse(widget.patientInfo.admissionNo); } else { listHisProgNotePhysicalExaminationVM.admissionNo = 0; } - postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM!.add(listHisProgNotePhysicalExaminationVM); + postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM.add(listHisProgNotePhysicalExaminationVM); }); if (model.patientPhysicalExamList.isEmpty) { @@ -228,20 +228,20 @@ class _UpdateObjectivePageState extends State implements Ob } if (model.state == ViewState.ErrorLocal) { - widget.changeLoadingState!(false); + widget.changeLoadingState(false); Utils.showErrorToast(model.error); - if (widget.patientInfo!.admissionNo != null && widget.patientInfo!.admissionNo!.isNotEmpty) { + if (widget.patientInfo.admissionNo != null && widget.patientInfo.admissionNo.isNotEmpty) { // Navigator.of(context).pop(); model.isAddExamInProgress = false; } } else { - if (widget.patientInfo!.admissionNo != null && widget.patientInfo!.admissionNo!.isNotEmpty) { + if (widget.patientInfo.admissionNo != null && widget.patientInfo.admissionNo.isNotEmpty) { // Navigator.of(context).pop(); - widget.changeLoadingState!(false); + widget.changeLoadingState(false); model.isAddExamInProgress = false; } else { - widget.changeLoadingState!(true); - widget.changePageViewIndex!(2); + widget.changeLoadingState(true); + widget.changePageViewIndex(2); } } } @@ -251,7 +251,7 @@ class _UpdateObjectivePageState extends State implements Ob } removeExamination(MasterKeyModel masterKey) { - Iterable history = mySelectedExamination.where((element) => masterKey.id == element.selectedExamination!.id && masterKey.typeId == element.selectedExamination!.typeId); + Iterable history = mySelectedExamination.where((element) => masterKey.id == element.selectedExamination.id && masterKey.typeId == element.selectedExamination.typeId); if (history.length > 0) { setState(() { @@ -276,13 +276,7 @@ class _UpdateObjectivePageState extends State implements Ob setState(() { { mySelectedExaminationLocal.forEach((element) { - if (( - mySelectedExamination.singleWhere( - (it) => it.selectedExamination!.id == element.selectedExamination!.id, - orElse: () => MySelectedExamination(), - ), - ) == - null) { + if ((mySelectedExamination.singleWhere((it) => it.selectedExamination.id == element.selectedExamination.id, orElse: () => null)) == null) { mySelectedExamination.insert(0, element); } }); @@ -290,13 +284,13 @@ class _UpdateObjectivePageState extends State implements Ob /// remove items. List removedList = []; mySelectedExamination.forEach((element) { - if ((mySelectedExaminationLocal.singleWhere((it) => it.selectedExamination!.id == element.selectedExamination!.id, orElse: () => MySelectedExamination())) == null) { + if ((mySelectedExaminationLocal.singleWhere((it) => it.selectedExamination.id == element.selectedExamination.id, orElse: () => null)) == null) { removedList.add(element); } }); removedList.forEach((element) { - removeExamination(element.selectedExamination!); + removeExamination(element.selectedExamination); }); Navigator.of(context).pop(); } diff --git a/lib/screens/patients/profile/soap_update/plan/update_plan_page.dart b/lib/screens/patients/profile/soap_update/plan/update_plan_page.dart index 0b558783..ae472115 100644 --- a/lib/screens/patients/profile/soap_update/plan/update_plan_page.dart +++ b/lib/screens/patients/profile/soap_update/plan/update_plan_page.dart @@ -22,15 +22,15 @@ import '../shared_soap_widgets/SOAP_step_header.dart'; import '../shared_soap_widgets/expandable_SOAP_widget.dart'; class UpdatePlanPage extends StatefulWidget { - final Function? changePageViewIndex; - final PatiantInformtion? patientInfo; - final Function? changeLoadingState; - final Function? changeStateFun; - final SOAPViewModel? sOAPViewModel; + final Function changePageViewIndex; + final PatiantInformtion patientInfo; + final Function changeLoadingState; + final Function changeStateFun; + final SOAPViewModel sOAPViewModel; - final int? currentIndex; + final int currentIndex; - UpdatePlanPage({Key? key, this.changePageViewIndex, this.patientInfo, this.changeLoadingState, this.currentIndex, this.sOAPViewModel, this.changeStateFun}); + UpdatePlanPage({Key key, this.changePageViewIndex, this.patientInfo, this.changeLoadingState, this.currentIndex, this.sOAPViewModel, this.changeStateFun}); @override _UpdatePlanPageState createState() => _UpdatePlanPageState(); @@ -67,27 +67,27 @@ class _UpdatePlanPageState extends State implements PlanCallBack getPatientProgressNote(SOAPViewModel model, {bool isAddProgress = false}) async { GetProgressNoteReqModel getGetProgressNoteReqModel = GetProgressNoteReqModel( - appointmentNo: int.parse(widget.patientInfo!.appointmentNo.toString()), - patientMRN: widget.patientInfo!.patientMRN, - episodeID: widget.patientInfo!.episodeNo.toString(), + appointmentNo: int.parse(widget.patientInfo.appointmentNo.toString()), + patientMRN: widget.patientInfo.patientMRN, + episodeID: widget.patientInfo.episodeNo.toString(), editedBy: '', doctorID: ''); - await widget.sOAPViewModel!.getPatientProgressNote(getGetProgressNoteReqModel); + await widget.sOAPViewModel.getPatientProgressNote(getGetProgressNoteReqModel); ///TODO set progressNote in model; - if (widget.sOAPViewModel!.patientProgressNoteList.isNotEmpty) { - progressNoteController.text = Utils.parseHtmlString(widget.sOAPViewModel!.patientProgressNoteList[0].planNote!); + if (widget.sOAPViewModel.patientProgressNoteList.isNotEmpty) { + progressNoteController.text = Utils.parseHtmlString(widget.sOAPViewModel.patientProgressNoteList[0].planNote); patientProgressNote.planNote = progressNoteController.text; - patientProgressNote.createdByName = widget.sOAPViewModel!.patientProgressNoteList[0].createdByName; - patientProgressNote.createdOn = widget.sOAPViewModel!.patientProgressNoteList[0].createdOn; - patientProgressNote.editedOn = widget.sOAPViewModel!.patientProgressNoteList[0].editedOn; - patientProgressNote.editedByName = widget.sOAPViewModel!.patientProgressNoteList[0].editedByName; - patientProgressNote.appointmentNo = widget.sOAPViewModel!.patientProgressNoteList[0].appointmentNo; + patientProgressNote.createdByName = widget.sOAPViewModel.patientProgressNoteList[0].createdByName; + patientProgressNote.createdOn = widget.sOAPViewModel.patientProgressNoteList[0].createdOn; + patientProgressNote.editedOn = widget.sOAPViewModel.patientProgressNoteList[0].editedOn; + patientProgressNote.editedByName = widget.sOAPViewModel.patientProgressNoteList[0].editedByName; + patientProgressNote.appointmentNo = widget.sOAPViewModel.patientProgressNoteList[0].appointmentNo; setState(() { isAddProgress = isAddProgress; - widget.sOAPViewModel!.isAddProgress = isAddProgress; - widget.sOAPViewModel!.progressNoteText = progressNoteController.text; + widget.sOAPViewModel.isAddProgress = isAddProgress; + widget.sOAPViewModel.progressNoteText = progressNoteController.text; }); } } @@ -96,31 +96,31 @@ class _UpdatePlanPageState extends State implements PlanCallBack Widget build(BuildContext context) { return BaseView( onModelReady: (model) async { - widget.sOAPViewModel!.setPlanCallBack(this); + widget.sOAPViewModel.setPlanCallBack(this); GetProgressNoteReqModel getGetProgressNoteReqModel = GetProgressNoteReqModel( - appointmentNo: int.parse(widget.patientInfo!.appointmentNo.toString()), - patientMRN: widget.patientInfo!.patientMRN, - episodeID: widget.patientInfo!.episodeNo.toString(), + appointmentNo: int.parse(widget.patientInfo.appointmentNo.toString()), + patientMRN: widget.patientInfo.patientMRN, + episodeID: widget.patientInfo.episodeNo.toString(), editedBy: '', doctorID: ''); - await widget.sOAPViewModel!.getPatientProgressNote(getGetProgressNoteReqModel); + await widget.sOAPViewModel.getPatientProgressNote(getGetProgressNoteReqModel); - if (widget.sOAPViewModel!.patientProgressNoteList.isNotEmpty) { - progressNoteController.text = Utils.parseHtmlString(widget.sOAPViewModel!.patientProgressNoteList[0].planNote!); + if (widget.sOAPViewModel.patientProgressNoteList.isNotEmpty) { + progressNoteController.text = Utils.parseHtmlString(widget.sOAPViewModel.patientProgressNoteList[0].planNote); patientProgressNote.planNote = progressNoteController.text; - patientProgressNote.createdByName = widget.sOAPViewModel!.patientProgressNoteList[0].createdByName; - patientProgressNote.createdOn = widget.sOAPViewModel!.patientProgressNoteList[0].createdOn; - patientProgressNote.editedOn = widget.sOAPViewModel!.patientProgressNoteList[0].editedOn; - patientProgressNote.editedByName = widget.sOAPViewModel!.patientProgressNoteList[0].editedByName; - patientProgressNote.appointmentNo = widget.sOAPViewModel!.patientProgressNoteList[0].appointmentNo; - widget.sOAPViewModel!.progressNoteText = progressNoteController.text; + patientProgressNote.createdByName = widget.sOAPViewModel.patientProgressNoteList[0].createdByName; + patientProgressNote.createdOn = widget.sOAPViewModel.patientProgressNoteList[0].createdOn; + patientProgressNote.editedOn = widget.sOAPViewModel.patientProgressNoteList[0].editedOn; + patientProgressNote.editedByName = widget.sOAPViewModel.patientProgressNoteList[0].editedByName; + patientProgressNote.appointmentNo = widget.sOAPViewModel.patientProgressNoteList[0].appointmentNo; + widget.sOAPViewModel.progressNoteText = progressNoteController.text; setState(() { isAddProgress = false; - widget.sOAPViewModel!.isAddProgress = false; + widget.sOAPViewModel.isAddProgress = false; }); } - widget.changeLoadingState!(false); + widget.changeLoadingState(false); }, builder: (_, model, w) => AppScaffold( backgroundColor: Theme.of(context).scaffoldBackgroundColor, @@ -133,9 +133,9 @@ class _UpdatePlanPageState extends State implements PlanCallBack child: Column( children: [ SOAPStepHeader( - currentIndex: widget.currentIndex!, - changePageViewIndex: widget.changePageViewIndex!, - patientInfo: widget.patientInfo!, + currentIndex: widget.currentIndex, + changePageViewIndex: widget.changePageViewIndex, + patientInfo: widget.patientInfo, ), SizedBox( height: 10, @@ -163,15 +163,12 @@ class _UpdatePlanPageState extends State implements PlanCallBack maxLines: 4, inputType: TextInputType.multiline, onChanged: (value) { - if (value != null) - setState(() { - patientProgressNote.planNote = value; - model.progressNoteText = value; - widget.changeStateFun!(); - }); + setState(() { + patientProgressNote.planNote = value; + model.progressNoteText = value; + widget.changeStateFun(); + }); }, - onClick: () {}, - onFieldSubmitted: () {}, ), ), SizedBox( @@ -209,7 +206,7 @@ class _UpdatePlanPageState extends State implements PlanCallBack ), AppText( patientProgressNote.createdOn != null - ? AppDateUtils.getDayMonthYearDateFormatted(DateTime.parse(patientProgressNote.createdOn!)) + ? AppDateUtils.getDayMonthYearDateFormatted(DateTime.parse(patientProgressNote.createdOn)) : AppDateUtils.getDayMonthYearDateFormatted(DateTime.now()), fontWeight: FontWeight.w600, fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.6, @@ -233,7 +230,7 @@ class _UpdatePlanPageState extends State implements PlanCallBack // ], // ), AppText( - patientProgressNote.createdOn != null ? AppDateUtils.getHour(DateTime.parse(patientProgressNote.createdOn!)) : AppDateUtils.getHour(DateTime.now()), + patientProgressNote.createdOn != null ? AppDateUtils.getHour(DateTime.parse(patientProgressNote.createdOn)) : AppDateUtils.getHour(DateTime.now()), fontWeight: FontWeight.w600, color: Color(0xFF575757), fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.6, @@ -256,7 +253,7 @@ class _UpdatePlanPageState extends State implements PlanCallBack onTap: () { setState(() { isAddProgress = true; - widget.sOAPViewModel!.isAddProgress = true; + widget.sOAPViewModel.isAddProgress = true; }); }, child: Icon( @@ -275,7 +272,7 @@ class _UpdatePlanPageState extends State implements PlanCallBack isExpanded: isProgressExpanded, ), SizedBox( - height: SizeConfig.heightMultiplier! * (SizeConfig.isHeightVeryShort ? 20 : 10), + height: SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort ? 20 : 10), ), ], ), @@ -287,50 +284,56 @@ class _UpdatePlanPageState extends State implements PlanCallBack submitPlan(SOAPViewModel model) async { if (progressNoteController.text.isNotEmpty) { - widget.changeLoadingState!(true); + widget.changeLoadingState(true); PostProgressNoteRequestModel postProgressNoteRequestModel = new PostProgressNoteRequestModel( - patientMRN: widget.patientInfo!.patientMRN, - episodeId: widget.patientInfo!.episodeNo!, - appointmentNo: widget.patientInfo!.appointmentNo, + patientMRN: widget.patientInfo.patientMRN, + episodeId: widget.patientInfo.episodeNo, + appointmentNo: widget.patientInfo.appointmentNo, planNote: patientProgressNote.planNote, - doctorID: '', + doctorID: widget.patientInfo.doctorId, + createdBy:widget.patientInfo.doctorId , + createdByName:widget.patientInfo.doctorName , editedBy: ''); - if (widget.sOAPViewModel!.patientProgressNoteList.isEmpty) { - await widget.sOAPViewModel!.postProgressNote(postProgressNoteRequestModel); + if (widget.sOAPViewModel.patientProgressNoteList.isEmpty) { + await widget.sOAPViewModel.postProgressNote(postProgressNoteRequestModel); } else { - Map profile = await sharedPref.getObj(DOCTOR_PROFILE); + Map profile = await sharedPref.getObj(DOCTOR_PROFILE); DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile); postProgressNoteRequestModel.editedBy = doctorProfile.doctorID; - await widget.sOAPViewModel!.patchProgressNote(postProgressNoteRequestModel); + await widget.sOAPViewModel.patchProgressNote(postProgressNoteRequestModel); } - if (widget.sOAPViewModel!.state == ViewState.ErrorLocal) { - Utils.showErrorToast(widget.sOAPViewModel!.error); + if (widget.sOAPViewModel.state == ViewState.ErrorLocal) { + Utils.showErrorToast(widget.sOAPViewModel.error); } else { GetProgressNoteReqModel getGetProgressNoteReqModel = GetProgressNoteReqModel( - appointmentNo: int.parse(widget.patientInfo!.appointmentNo.toString()), - patientMRN: widget.patientInfo!.patientMRN, - episodeID: widget.patientInfo!.episodeNo.toString(), + appointmentNo: int.parse(widget.patientInfo.appointmentNo.toString()), + patientMRN: widget.patientInfo.patientMRN, + episodeID: widget.patientInfo.episodeNo.toString(), editedBy: '', doctorID: ''); - await widget.sOAPViewModel!.getPatientProgressNote(getGetProgressNoteReqModel); - if (widget.sOAPViewModel!.patientProgressNoteList.isNotEmpty) { - progressNoteController.text = Utils.parseHtmlString(widget.sOAPViewModel!.patientProgressNoteList[0].planNote!); + await widget.sOAPViewModel.getPatientProgressNote(getGetProgressNoteReqModel); + if (widget.sOAPViewModel.patientProgressNoteList.isNotEmpty) { + progressNoteController.text = Utils.parseHtmlString(widget.sOAPViewModel.patientProgressNoteList[0].planNote); patientProgressNote.planNote = progressNoteController.text; - patientProgressNote.createdByName = widget.sOAPViewModel!.patientProgressNoteList[0].createdByName; - patientProgressNote.createdOn = widget.sOAPViewModel!.patientProgressNoteList[0].createdOn; - patientProgressNote.editedOn = widget.sOAPViewModel!.patientProgressNoteList[0].editedOn; - patientProgressNote.editedByName = widget.sOAPViewModel!.patientProgressNoteList[0].editedByName; - patientProgressNote.appointmentNo = widget.sOAPViewModel!.patientProgressNoteList[0].appointmentNo; + patientProgressNote.createdByName = widget.sOAPViewModel.patientProgressNoteList[0].createdByName; + patientProgressNote.createdOn = widget.sOAPViewModel.patientProgressNoteList[0].createdOn; + patientProgressNote.editedOn = widget.sOAPViewModel.patientProgressNoteList[0].editedOn; + patientProgressNote.editedByName = widget.sOAPViewModel.patientProgressNoteList[0].editedByName; + patientProgressNote.appointmentNo = widget.sOAPViewModel.patientProgressNoteList[0].appointmentNo; setState(() { isAddProgress = false; - widget.sOAPViewModel!.isAddProgress = false; + widget.sOAPViewModel.isAddProgress = false; }); } + + Navigator.of(context).pop(); + Utils.showErrorToast("Episode Created Successfully"); + } - widget.changeLoadingState!(false); + widget.changeLoadingState(false); } else { Utils.showErrorToast(TranslationBase.of(context).progressNoteErrorMsg); } diff --git a/lib/screens/patients/profile/soap_update/soap_utils.dart b/lib/screens/patients/profile/soap_update/soap_utils.dart index a7206aa2..5100c613 100644 --- a/lib/screens/patients/profile/soap_update/soap_utils.dart +++ b/lib/screens/patients/profile/soap_update/soap_utils.dart @@ -4,48 +4,19 @@ import 'package:doctor_app_flutter/core/model/SOAP/selected_items/my_selected_ex import 'package:doctor_app_flutter/core/model/SOAP/selected_items/my_selected_history.dart'; class SoapUtils { - static MySelectedHistory generateMySelectedHistory( - {history, isChecked = false, remark, isLocal = true}) { - MySelectedHistory mySelectedHistory = MySelectedHistory( - selectedHistory: history, - isChecked: isChecked, - remark: remark, - isLocal: isLocal); + static MySelectedHistory generateMySelectedHistory({history, isChecked = false, remark, isLocal = true}) { + MySelectedHistory mySelectedHistory = MySelectedHistory(selectedHistory: history, isChecked: isChecked, remark: remark, isLocal: isLocal); return mySelectedHistory; } - static MySelectedAllergy generateMySelectedAllergy( - {allergy, - allergySeverity, - isChecked = false, - remark, - isLocal = true, - int? createdBy, - bool isExpanded = false}) { - MySelectedAllergy mySelectedAllergy = MySelectedAllergy( - selectedAllergy: allergy, - selectedAllergySeverity: allergySeverity, - isChecked: isChecked, - remark: remark, - isLocal: isLocal, - createdBy: createdBy, - isExpanded: isExpanded); + static MySelectedAllergy generateMySelectedAllergy({allergy, allergySeverity, isChecked = false, remark, isLocal = true, int createdBy, bool isExpanded = false}) { + MySelectedAllergy mySelectedAllergy = + MySelectedAllergy(selectedAllergy: allergy, selectedAllergySeverity: allergySeverity, isChecked: isChecked, remark: remark, isLocal: isLocal, createdBy: createdBy, isExpanded: isExpanded); return mySelectedAllergy; } static MySelectedExamination generateMySelectedExamination( - {examination, - allergySeverity, - isChecked = false, - remark, - isLocal = true, - isNormal, - createdBy, - createdOn, - editedOn, - notExamined, - isNew, - isAbnormal}) { + {examination, allergySeverity, isChecked = false, remark, isLocal = true, isNormal, createdBy, createdOn, editedOn, notExamined, isNew, isAbnormal}) { MySelectedExamination mySelectedExamination = MySelectedExamination( selectedExamination: examination, remark: remark, @@ -61,17 +32,7 @@ class SoapUtils { return mySelectedExamination; } - static MySelectedAssessment generateMySelectedAssessment( - {appointmentNo, - remark, - diagnosisType, - diagnosisCondition, - selectedICD, - doctorID, - doctorName, - createdBy, - createdOn, - icdCode10ID}) { + static MySelectedAssessment generateMySelectedAssessment({appointmentNo, remark, diagnosisType, diagnosisCondition, selectedICD, doctorID, doctorName, createdBy, createdOn, icdCode10ID}) { MySelectedAssessment mySelectedAssessment = MySelectedAssessment( appointmentId: appointmentNo, remark: remark, diff --git a/lib/screens/patients/profile/soap_update/subjective/allergies/add_allergies.dart b/lib/screens/patients/profile/soap_update/subjective/allergies/add_allergies.dart index e06bd80d..652a1bbb 100644 --- a/lib/screens/patients/profile/soap_update/subjective/allergies/add_allergies.dart +++ b/lib/screens/patients/profile/soap_update/subjective/allergies/add_allergies.dart @@ -41,40 +41,30 @@ class _AddAllergiesState extends State { @override Widget build(BuildContext context) { - return FractionallySizedBox( - heightFactor: 1, - child: BaseView( - onModelReady: (model) async { - if (model.allergiesList.length == 0) { - await model.getMasterLookup(MasterKeysService.Allergies); - } - if (model.allergySeverityList.length == 0) { - await model.getMasterLookup(MasterKeysService.AllergySeverity); - } - }, - builder: (_, model, w) => AppScaffold( - baseViewModel: model, - isShowAppBar: true, - appBar: BottomSheetTitle( - title: TranslationBase.of(context).addAllergies, - ), - body: Center( - child: Container( - child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ - SizedBox( - height: 10, - ), - SizedBox( - height: 16, - ), - Expanded( + return AppScaffold( + // baseViewModel: model, + isShowAppBar: true, + appBar: BottomSheetTitle( + title: TranslationBase.of(context).addAllergies, + ), + body: Center( + child: Container( + child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ + SizedBox( + height: 10, + ), + SizedBox( + height: 16, + ), + Expanded( + child: Center( + child: FractionallySizedBox( + widthFactor: 0.9, child: Center( - child: FractionallySizedBox( - widthFactor: 0.9, - child: Center( - child: NetworkBaseView( - baseViewModel: model, - child: MasterKeyCheckboxSearchAllergiesWidget( + child: BaseView( + onModelReady: (model) async {}, + builder: (_, model, w) { + return MasterKeyCheckboxSearchAllergiesWidget( model: model, masterList: model.allergiesList, removeAllergy: (master) { @@ -87,43 +77,44 @@ class _AddAllergiesState extends State { }, addSelectedAllergy: () { setState(() { - widget.addAllergiesFun!(myAllergiesListLocal); + widget.addAllergiesFun(myAllergiesListLocal); }); }, isServiceSelected: (master) => isServiceSelected(master), getServiceSelectedAllergy: (master) => getSelectedAllergy(master), - ), - ), - ), - ), + ); + }), ), ), - SizedBox( - height: MediaQuery.of(context).size.height * 0.11, - ), - ]), + ), ), - ), - bottomSheet: model.state != ViewState.Idle - ? Container( - height: 0, - ) - : CustomBottomSheetContainer( - label: TranslationBase.of(context).addAllergies, - onTap: () { - setState(() { - widget.addAllergiesFun!(myAllergiesListLocal); - }); - }, - ), + SizedBox( + height: MediaQuery.of(context).size.height * 0.11, + ), + ]), ), ), + bottomSheet: + // model.state != ViewState.Idle + // ? + // Container( + // height: 0, + // ) + // : + CustomBottomSheetContainer( + label: TranslationBase.of(context).addAllergies, + onTap: () { + setState(() { + widget.addAllergiesFun(myAllergiesListLocal); + }); + }, + ), ); } isServiceSelected(MasterKeyModel masterKey) { Iterable allergy = - myAllergiesListLocal.where((element) => masterKey.id == element.selectedAllergy?.id && masterKey.typeId == element.selectedAllergy?.typeId && element.isChecked!); + myAllergiesListLocal.where((element) => masterKey.id == element.selectedAllergy.id && masterKey.typeId == element.selectedAllergy.typeId && element.isChecked); if (allergy.length > 0) { return true; } @@ -131,16 +122,16 @@ class _AddAllergiesState extends State { } removeAllergyFromLocalList(MasterKeyModel masterKey) { - myAllergiesListLocal.removeWhere((element) => element.selectedAllergy!.id == masterKey.id); + myAllergiesListLocal.removeWhere((element) => element.selectedAllergy.id == masterKey.id); } MySelectedAllergy getSelectedAllergy(MasterKeyModel masterKey) { Iterable allergy = - myAllergiesListLocal.where((element) => masterKey.id == element.selectedAllergy!.id && masterKey.typeId == element.selectedAllergy!.typeId && element.isChecked!); + myAllergiesListLocal.where((element) => masterKey.id == element.selectedAllergy.id && masterKey.typeId == element.selectedAllergy.typeId && element.isChecked); if (allergy.length > 0) { return allergy.first; } - return MySelectedAllergy(); + return null; } addAllergyLocally(MySelectedAllergy mySelectedAllergy) { @@ -150,7 +141,7 @@ class _AddAllergiesState extends State { setState(() { List allergy = // ignore: missing_return - myAllergiesListLocal.where((element) => mySelectedAllergy.selectedAllergy!.id == element.selectedAllergy!.id).toList(); + myAllergiesListLocal.where((element) => mySelectedAllergy.selectedAllergy.id == element.selectedAllergy.id).toList(); if (allergy.isEmpty) { myAllergiesListLocal.add(mySelectedAllergy); diff --git a/lib/screens/patients/profile/soap_update/subjective/allergies/master_key_checkbox_search_allergies_widget.dart b/lib/screens/patients/profile/soap_update/subjective/allergies/master_key_checkbox_search_allergies_widget.dart index e6fab52f..fb8043cb 100644 --- a/lib/screens/patients/profile/soap_update/subjective/allergies/master_key_checkbox_search_allergies_widget.dart +++ b/lib/screens/patients/profile/soap_update/subjective/allergies/master_key_checkbox_search_allergies_widget.dart @@ -1,28 +1,31 @@ +import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; +import 'package:doctor_app_flutter/core/enum/view_state.dart'; +import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; import 'package:doctor_app_flutter/core/model/SOAP/master_key_model.dart'; import 'package:doctor_app_flutter/core/model/SOAP/selected_items/my_selected_allergy.dart'; -import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; -import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; import 'package:doctor_app_flutter/utils/utils.dart'; +import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; import 'package:doctor_app_flutter/widgets/shared/divider_with_spaces_around.dart'; import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart'; +import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'allergies_item.dart'; class MasterKeyCheckboxSearchAllergiesWidget extends StatefulWidget { - final SOAPViewModel? model; - final Function()? addSelectedAllergy; - final Function(MasterKeyModel)? removeAllergy; - final Function(MySelectedAllergy mySelectedAllergy)? addAllergy; - final bool Function(MasterKeyModel)? isServiceSelected; - final MySelectedAllergy Function(MasterKeyModel)? getServiceSelectedAllergy; + final SOAPViewModel model; + final Function() addSelectedAllergy; + final Function(MasterKeyModel) removeAllergy; + final Function(MySelectedAllergy mySelectedAllergy) addAllergy; + final bool Function(MasterKeyModel) isServiceSelected; + final MySelectedAllergy Function(MasterKeyModel) getServiceSelectedAllergy; - final List? masterList; - final String? buttonName; - final String? hintSearchText; + final List masterList; + final String buttonName; + final String hintSearchText; MasterKeyCheckboxSearchAllergiesWidget( - {Key? key, + {Key key, this.model, this.addSelectedAllergy, this.removeAllergy, @@ -39,12 +42,12 @@ class MasterKeyCheckboxSearchAllergiesWidget extends StatefulWidget { } class _MasterKeyCheckboxSearchAllergiesWidgetState extends State { - List items = []; + List items = List(); TextEditingController filteredSearchController = TextEditingController(); @override void initState() { - items.addAll(widget.masterList!); + items.addAll(widget.masterList); super.initState(); } @@ -57,55 +60,66 @@ class _MasterKeyCheckboxSearchAllergiesWidgetState extends State dummySearchList = []; - dummySearchList.addAll(widget.masterList as Iterable); + List dummySearchList = List(); + dummySearchList.addAll(widget.masterList); if (query.isNotEmpty) { - List dummyListData = []; + List dummyListData = List(); dummySearchList.forEach((items) { - if (items.nameAr!.toLowerCase().contains(query.toLowerCase()) || items.nameEn!.toLowerCase().contains(query.toLowerCase())) { + if (items.nameAr.toLowerCase().contains(query.toLowerCase()) || items.nameEn.toLowerCase().contains(query.toLowerCase())) { dummyListData.add(items); } }); @@ -134,7 +148,7 @@ class _MasterKeyCheckboxSearchAllergiesWidgetState extends State); + items.addAll(widget.masterList); }); } } diff --git a/lib/screens/patients/profile/soap_update/subjective/medication/add_medication.dart b/lib/screens/patients/profile/soap_update/subjective/medication/add_medication.dart index 24bc82cc..2a9f14c4 100644 --- a/lib/screens/patients/profile/soap_update/subjective/medication/add_medication.dart +++ b/lib/screens/patients/profile/soap_update/subjective/medication/add_medication.dart @@ -2,13 +2,13 @@ import 'package:autocomplete_textfield/autocomplete_textfield.dart'; import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/enum/view_state.dart'; -import 'package:doctor_app_flutter/core/model/SOAP/master_key_model.dart'; import 'package:doctor_app_flutter/core/model/search_drug/get_medication_response_model.dart'; import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/master_key_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; -import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; import 'package:doctor_app_flutter/utils/utils.dart'; +import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; import 'package:doctor_app_flutter/widgets/bottom_sheet/custom_bottom_sheet_container.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; @@ -23,28 +23,28 @@ import '../../shared_soap_widgets/bottom_sheet_title.dart'; // ignore: must_be_immutable class AddMedication extends StatefulWidget { - final Function? addMedicationFun; - TextEditingController? medicationController; + final Function addMedicationFun; + TextEditingController medicationController; - AddMedication({Key? key, this.addMedicationFun, this.medicationController}) : super(key: key); + AddMedication({Key key, this.addMedicationFun, this.medicationController}) : super(key: key); @override _AddMedicationState createState() => _AddMedicationState(); } class _AddMedicationState extends State { - MasterKeyModel _selectedMedicationDose = MasterKeyModel(); - MasterKeyModel _selectedMedicationStrength = MasterKeyModel(); - MasterKeyModel _selectedMedicationRoute = MasterKeyModel(); - MasterKeyModel _selectedMedicationFrequency = MasterKeyModel(); + MasterKeyModel _selectedMedicationDose; + MasterKeyModel _selectedMedicationStrength; + MasterKeyModel _selectedMedicationRoute; + MasterKeyModel _selectedMedicationFrequency; TextEditingController doseController = TextEditingController(); TextEditingController strengthController = TextEditingController(); TextEditingController routeController = TextEditingController(); TextEditingController frequencyController = TextEditingController(); - GetMedicationResponseModel _selectedMedication = GetMedicationResponseModel(); + GetMedicationResponseModel _selectedMedication; - GlobalKey> key = new GlobalKey>(); + GlobalKey key = new GlobalKey>(); bool isFormSubmitted = false; @override @@ -74,7 +74,7 @@ class _AddMedicationState extends State { child: Column( children: [ SizedBox( - height: SizeConfig.heightMultiplier! * + height: SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort ? 2 : SizeConfig.isHeightShort @@ -87,7 +87,7 @@ class _AddMedicationState extends State { onTap: model.allMedicationList != null ? () { setState(() { - _selectedMedication = GetMedicationResponseModel(); + _selectedMedication = null; }); } : null, @@ -95,37 +95,32 @@ class _AddMedicationState extends State { ? CustomAutoCompleteTextField( isShowError: isFormSubmitted && _selectedMedication == null, child: AutoCompleteTextField( - decoration: TextFieldsUtils.textFieldSelectorDecoration(TranslationBase.of(context).searchMedicineNameHere, "", true, suffixIcon: Icons.search), + decoration: TextFieldsUtils.textFieldSelectorDecoration(TranslationBase.of(context).searchMedicineNameHere, null, true, suffixIcon: Icons.search), itemSubmitted: (item) => setState(() => _selectedMedication = item), key: key, suggestions: model.allMedicationList, - itemBuilder: (context, suggestion) => new Padding(child: AppText(suggestion.description! + '/' + suggestion.genericName!), padding: EdgeInsets.all(8.0)), + itemBuilder: (context, suggestion) => new Padding(child: AppText(suggestion.description + '/' + suggestion.genericName), padding: EdgeInsets.all(8.0)), itemSorter: (a, b) => 1, itemFilter: (suggestion, input) => - suggestion.genericName!.toLowerCase().startsWith(input.toLowerCase()) || - suggestion.description!.toLowerCase().startsWith(input.toLowerCase()) || - suggestion.keywords!.toLowerCase().startsWith(input.toLowerCase()), + suggestion.genericName.toLowerCase().startsWith(input.toLowerCase()) || + suggestion.description.toLowerCase().startsWith(input.toLowerCase()) || + suggestion.keywords.toLowerCase().startsWith(input.toLowerCase()), ), ) : AppTextFieldCustom( height: Utils.getTextFieldHeight(), hintText: _selectedMedication != null - ? _selectedMedication.description! + (' (${_selectedMedication.genericName} )') + ? _selectedMedication.description + (' (${_selectedMedication.genericName} )') : TranslationBase.of(context).searchMedicineNameHere, minLines: 1, maxLines: 1, isTextFieldHasSuffix: true, suffixIcon: IconButton( - icon: Icon( - Icons.search, - color: Colors.grey.shade600, - ), - onPressed: () {}, - ), + icon: Icon( + Icons.search, + color: Colors.grey.shade600, + )), enabled: false, - onClick: () {}, - onChanged: (value) {}, - onFieldSubmitted: () {}, ), ), ), @@ -138,7 +133,7 @@ class _AddMedicationState extends State { Container( width: MediaQuery.of(context).size.width * 0.7, child: AppText( - _selectedMedication.description! + (' (${_selectedMedication.genericName} )'), + _selectedMedication.description + (' (${_selectedMedication.genericName} )'), color: Color(0xFF575757), fontSize: 10, fontWeight: FontWeight.w700, @@ -163,7 +158,7 @@ class _AddMedicationState extends State { setState(() { _selectedMedicationDose = selectedValue; - doseController.text = projectViewModel.isArabic ? _selectedMedicationDose.nameAr! : _selectedMedicationDose.nameEn!; + doseController.text = projectViewModel.isArabic ? _selectedMedicationDose.nameAr : _selectedMedicationDose.nameEn; }); }, ); @@ -175,15 +170,13 @@ class _AddMedicationState extends State { }, ); } - : () {}, + : null, hintText: TranslationBase.of(context).doseTime, maxLines: 1, minLines: 1, isTextFieldHasSuffix: true, controller: doseController, - validationError: isFormSubmitted && _selectedMedicationDose == null ? TranslationBase.of(context).emptyMessage : "", - onChanged: (value) {}, - onFieldSubmitted: () {}, + validationError: isFormSubmitted && _selectedMedicationDose == null ? TranslationBase.of(context).emptyMessage : null, ), SizedBox( height: 5, @@ -202,7 +195,7 @@ class _AddMedicationState extends State { setState(() { _selectedMedicationStrength = selectedValue; - strengthController.text = projectViewModel.isArabic ? _selectedMedicationStrength.nameAr! : _selectedMedicationStrength.nameEn!; + strengthController.text = projectViewModel.isArabic ? _selectedMedicationStrength.nameAr : _selectedMedicationStrength.nameEn; }); }, ); @@ -214,14 +207,12 @@ class _AddMedicationState extends State { }, ); } - : () {}, + : null, hintText: TranslationBase.of(context).strength, maxLines: 1, minLines: 1, controller: strengthController, - validationError: isFormSubmitted && _selectedMedicationStrength == null ? TranslationBase.of(context).emptyMessage : "", - onChanged: (value) {}, - onFieldSubmitted: () {}, + validationError: isFormSubmitted && _selectedMedicationStrength == null ? TranslationBase.of(context).emptyMessage : null, ), SizedBox( height: 5, @@ -243,7 +234,7 @@ class _AddMedicationState extends State { setState(() { _selectedMedicationRoute = selectedValue; - routeController.text = projectViewModel.isArabic ? _selectedMedicationRoute.nameAr! : _selectedMedicationRoute.nameEn!; + routeController.text = projectViewModel.isArabic ? _selectedMedicationRoute.nameAr : _selectedMedicationRoute.nameEn; }); }, ); @@ -255,14 +246,12 @@ class _AddMedicationState extends State { }, ); } - : () {}, + : null, hintText: TranslationBase.of(context).route, maxLines: 1, minLines: 1, controller: routeController, - validationError: isFormSubmitted && _selectedMedicationRoute == null ? TranslationBase.of(context).emptyMessage : "", - onChanged: (value) {}, - onFieldSubmitted: () {}, + validationError: isFormSubmitted && _selectedMedicationRoute == null ? TranslationBase.of(context).emptyMessage : null, ), SizedBox( height: 5, @@ -282,7 +271,7 @@ class _AddMedicationState extends State { setState(() { _selectedMedicationFrequency = selectedValue; - frequencyController.text = projectViewModel.isArabic ? _selectedMedicationFrequency.nameAr! : _selectedMedicationFrequency.nameEn!; + frequencyController.text = projectViewModel.isArabic ? _selectedMedicationFrequency.nameAr : _selectedMedicationFrequency.nameEn; }); }, ); @@ -294,19 +283,17 @@ class _AddMedicationState extends State { }, ); } - : () {}, + : null, hintText: TranslationBase.of(context).frequency, enabled: false, maxLines: 1, minLines: 1, isTextFieldHasSuffix: true, controller: frequencyController, - validationError: isFormSubmitted && _selectedMedicationFrequency == null ? TranslationBase.of(context).emptyMessage : "", - onChanged: (value) {}, - onFieldSubmitted: () {}, + validationError: isFormSubmitted && _selectedMedicationFrequency == null ? TranslationBase.of(context).emptyMessage : null, ), SizedBox( - height: SizeConfig.heightMultiplier! * + height: SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort ? 20 : SizeConfig.isHeightShort @@ -335,7 +322,7 @@ class _AddMedicationState extends State { _selectedMedicationStrength != null && _selectedMedicationRoute != null && _selectedMedicationFrequency != null) { - widget.medicationController!.text = widget.medicationController!.text + + widget.medicationController.text = widget.medicationController.text + '${_selectedMedication.description} (${TranslationBase.of(context).doseTime} ) ${doseController.text} (${TranslationBase.of(context).strength}) ${strengthController.text} (${TranslationBase.of(context).route}) ${routeController.text} (${TranslationBase.of(context).frequency}) ${frequencyController.text} \n \n'; Navigator.of(context).pop(); } diff --git a/lib/screens/patients/profile/soap_update/subjective/update_subjective_page.dart b/lib/screens/patients/profile/soap_update/subjective/update_subjective_page.dart index a2501595..de4fa392 100644 --- a/lib/screens/patients/profile/soap_update/subjective/update_subjective_page.dart +++ b/lib/screens/patients/profile/soap_update/subjective/update_subjective_page.dart @@ -20,12 +20,12 @@ import 'cheif_complaints/update_Chief_complaints.dart'; import 'history/update_history_widget.dart'; class UpdateSubjectivePage extends StatefulWidget { - final Function? changePageViewIndex; - final Function? changeLoadingState; - final PatiantInformtion? patientInfo; - final int? currentIndex; + final Function changePageViewIndex; + final Function changeLoadingState; + final PatiantInformtion patientInfo; + final int currentIndex; - UpdateSubjectivePage({Key? key, this.changePageViewIndex, this.patientInfo, this.changeLoadingState, this.currentIndex}); + UpdateSubjectivePage({Key key, this.changePageViewIndex, this.patientInfo, this.changeLoadingState, this.currentIndex}); @override _UpdateSubjectivePageState createState() => _UpdateSubjectivePageState(); @@ -40,11 +40,11 @@ class _UpdateSubjectivePageState extends State implements TextEditingController medicationController = TextEditingController(); final formKey = GlobalKey(); - List myAllergiesList = []; - List myHistoryList = []; + List myAllergiesList = List(); + List myHistoryList = List(); getHistory(SOAPViewModel model) async { - widget.changeLoadingState!(true); + widget.changeLoadingState(true); if (model.patientHistoryList.isNotEmpty) { model.patientHistoryList.forEach((element) { if (element.historyType == MasterKeysService.HistoryFamily.getMasterKeyService()) { @@ -106,7 +106,7 @@ class _UpdateSubjectivePageState extends State implements } MySelectedAllergy mySelectedAllergy = SoapUtils.generateMySelectedAllergy( - allergy: selectedAllergy, isChecked: element.isChecked, createdBy: element.createdBy!, remark: element.remarks, isLocal: false, allergySeverity: selectedAllergySeverity); + allergy: selectedAllergy, isChecked: element.isChecked, createdBy: element.createdBy, remark: element.remarks, isLocal: false, allergySeverity: selectedAllergySeverity); if (selectedAllergy != null && selectedAllergySeverity != null) myAllergiesList.add(mySelectedAllergy); }); @@ -120,23 +120,23 @@ class _UpdateSubjectivePageState extends State implements myAllergiesList.clear(); myHistoryList.clear(); model.setSubjectiveCallBack(this); - await model.onUpdateSubjectStepStart(widget.patientInfo!); + await model.onUpdateSubjectStepStart(widget.patientInfo); if (model.patientChiefComplaintList.isNotEmpty) { isChiefExpand = true; - complaintsController.text = Utils.parseHtmlString(model.patientChiefComplaintList[0].chiefComplaint!); - illnessController.text = model.patientChiefComplaintList[0].hopi!; - medicationController.text = !(model.patientChiefComplaintList[0].currentMedication)!.isNotEmpty - ? model.patientChiefComplaintList[0].currentMedication! + '\n \n' - : model.patientChiefComplaintList[0].currentMedication!; + complaintsController.text = Utils.parseHtmlString(model.patientChiefComplaintList[0].chiefComplaint); + illnessController.text = model.patientChiefComplaintList[0].hopi; + medicationController.text = model.patientChiefComplaintList[0].currentMedication != null ? !(model.patientChiefComplaintList[0].currentMedication).isNotEmpty + ? model.patientChiefComplaintList[0].currentMedication + '\n \n' + : model.patientChiefComplaintList[0].currentMedication : ""; } - if (widget.patientInfo!.admissionNo == null) { + if (widget.patientInfo.admissionNo == null) { await getHistory(model); await getAllergies(model); } - widget.changeLoadingState!(false); + widget.changeLoadingState(false); }, builder: (_, model, w) => AppScaffold( isShowAppBar: false, @@ -174,9 +174,9 @@ class _UpdateSubjectivePageState extends State implements isExpanded: isChiefExpand, ), SizedBox( - height: SizeConfig.heightMultiplier! * (SizeConfig.isHeightVeryShort ? 4 : 2), + height: SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort ? 4 : 2), ), - if (widget.patientInfo!.admissionNo == null) + if (widget.patientInfo.admissionNo == null) ExpandableSOAPWidget( headerTitle: TranslationBase.of(context).histories, isRequired: false, @@ -191,9 +191,9 @@ class _UpdateSubjectivePageState extends State implements isExpanded: isHistoryExpand, ), SizedBox( - height: SizeConfig.heightMultiplier! * (SizeConfig.isHeightVeryShort ? 4 : 2), + height: SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort ? 4 : 2), ), - if (widget.patientInfo!.admissionNo == null) + if (widget.patientInfo.admissionNo == null) ExpandableSOAPWidget( headerTitle: TranslationBase.of(context).allergiesSoap, isRequired: false, @@ -215,7 +215,7 @@ class _UpdateSubjectivePageState extends State implements isExpanded: isAllergiesExpand, ), SizedBox( - height: SizeConfig.heightMultiplier! * (SizeConfig.isHeightVeryShort ? 20 : 10), + height: SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort ? 20 : 10), ), ], ), @@ -226,13 +226,13 @@ class _UpdateSubjectivePageState extends State implements ); } - addSubjectiveInfo({SOAPViewModel? model, List? myAllergiesList, List? myHistoryList}) async { + addSubjectiveInfo({SOAPViewModel model, List myAllergiesList, List myHistoryList}) async { if (FocusScope.of(context).hasFocus) FocusScope.of(context).unfocus(); - widget.changeLoadingState!(true); - formKey.currentState!.save(); - formKey.currentState!.validate(); + widget.changeLoadingState(true); + formKey.currentState.save(); + formKey.currentState.validate(); - model!.complaintsControllerError = ''; + model.complaintsControllerError = ''; model.medicationControllerError = ''; model.illnessControllerError = ''; if (complaintsController.text.isNotEmpty && illnessController.text.isNotEmpty) { @@ -245,9 +245,9 @@ class _UpdateSubjectivePageState extends State implements myAllergiesList: myAllergiesList, ); - widget.changeLoadingState!(true); + widget.changeLoadingState(true); - widget.changePageViewIndex!(1); + widget.changePageViewIndex(1); } else { setState(() { if (complaintsController.text.isEmpty) { @@ -263,13 +263,13 @@ class _UpdateSubjectivePageState extends State implements } }); - widget.changeLoadingState!(false); + widget.changeLoadingState(false); Utils.showErrorToast(TranslationBase.of(context).chiefComplaintErrorMsg); } } @override Function nextFunction(model) { - return addSubjectiveInfo(model: model, myAllergiesList: myAllergiesList, myHistoryList: myHistoryList); + addSubjectiveInfo(model: model, myAllergiesList: myAllergiesList.where((i) => i.isChecked).toList(), myHistoryList: myHistoryList); } } diff --git a/lib/screens/patients/profile/vital_sign/LineChartCurvedBloodPressure.dart b/lib/screens/patients/profile/vital_sign/LineChartCurvedBloodPressure.dart new file mode 100644 index 00000000..c493135e --- /dev/null +++ b/lib/screens/patients/profile/vital_sign/LineChartCurvedBloodPressure.dart @@ -0,0 +1,296 @@ +import 'package:doctor_app_flutter/core/model/charts/app_time_series_chart.dart'; +import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; +import 'package:fl_chart/fl_chart.dart'; +import 'package:flutter/material.dart'; + +class LineChartCurvedBloodPressureNew extends StatelessWidget { + final String title; + final List timeSeries1; + final List timeSeries2; + final int indexes; + final bool isOX; + + LineChartCurvedBloodPressureNew({this.title, this.timeSeries1, this.indexes, this.timeSeries2, this.isOX = false}); + + List xAxixs = List(); + List yAxixs = List(); + + @override + Widget build(BuildContext context) { + getXaxix(); + return AspectRatio( + aspectRatio: 1.1, + child: Container( + decoration: const BoxDecoration( + borderRadius: BorderRadius.all(Radius.circular(18)), + // color: Colors.white, + ), + child: Stack( + children: [ + Column( + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + const SizedBox( + height: 12, + ), + Padding( + padding: const EdgeInsets.only( + left: 20, + right: 20, + ), + child: Text( + title, + style: TextStyle( + color: Colors.black, + fontSize: 16, + letterSpacing: -0.64, + fontWeight: FontWeight.w600, + ), + textAlign: TextAlign.start, + ), + ), + SizedBox( + height: 10, + ), + Expanded( + child: Padding( + padding: const EdgeInsets.only(right: 18.0, left: 16.0, top: 15), + child: LineChart( + sampleData1(context), + swapAnimationDuration: const Duration(milliseconds: 250), + ), + ), + ), + SizedBox( + height: 10, + ), + Row( + crossAxisAlignment: CrossAxisAlignment.center, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Row( + children: [ + Container( + width: 16, + height: 16, + decoration: containerRadius(Theme.of(context).primaryColor, 100), + ), + SizedBox( + width: 5, + ), + Text( + TranslationBase.of(context).systolicLng, + style: TextStyle( + color: Colors.black, + fontSize: 12, + letterSpacing: -0.64, + fontWeight: FontWeight.w600, + ), + ), + ], + ), + SizedBox( + width: 15, + ), + Row( + children: [ + Container( + width: 16, + height: 16, + decoration: containerRadius(Color(0xFFD02127), 100), + ), + SizedBox( + width: 5, + ), + Text( + TranslationBase.of(context).diastolicLng, + style: TextStyle( + color: Colors.black, + fontSize: 12, + letterSpacing: -0.64, + fontWeight: FontWeight.w600, + ), + ), + ], + ), + ], + ), + const SizedBox( + height: 12, + ), + ], + ), + ], + ), + ), + ); + } + + getXaxix() { + for (int index = 0; index < timeSeries1.length; index++) { + int mIndex = indexes * index; + if (mIndex < timeSeries1.length) { + xAxixs.add(mIndex); + } + } + } + + LineChartData sampleData1(context) { + return LineChartData( + lineTouchData: LineTouchData( + touchTooltipData: LineTouchTooltipData( + tooltipBgColor: Colors.white, + ), + touchCallback: (touchEvent, LineTouchResponse touchResponse) {}, + handleBuiltInTouches: true, + ), + gridData: FlGridData(show: true, drawVerticalLine: true, drawHorizontalLine: true, horizontalInterval: 14, verticalInterval: 14), + titlesData: FlTitlesData( + bottomTitles: SideTitles( + showTitles: true, + getTextStyles: (cxt, value) => const TextStyle( + color: Colors.black, + fontSize: 10, + ), + rotateAngle: -65, + margin: 22, + getTitles: (value) { + if (timeSeries1.length < 15) { + if (timeSeries1.length > value.toInt()) { + return '${timeSeries1[value.toInt()].time.month}/ ${timeSeries1[value.toInt()].time.year}'; + } else + return ''; + } else { + if (value.toInt() == 0) return '${timeSeries1[value.toInt()].time.month}/ ${timeSeries1[value.toInt()].time.year}'; + if (value.toInt() == timeSeries1.length - 1) return '${timeSeries1[value.toInt()].time.month}/ ${timeSeries1[value.toInt()].time.year}'; + if (xAxixs.contains(value.toInt())) { + return '${timeSeries1[value.toInt()].time.month}/ ${timeSeries1[value.toInt()].time.year}'; + } + } + return ''; + }, + ), + leftTitles: SideTitles( + showTitles: true, + getTextStyles: (cxt, value) => const TextStyle( + color: Colors.black, + fontWeight: FontWeight.bold, + fontSize: 10, + ), + interval: getMaxY() - getMinY() <= 500 + ? 50 + : getMaxY() - getMinY() <= 1000 + ? 100 + : 200, + margin: 12, + ), + ), + borderData: FlBorderData( + show: true, + border: const Border( + bottom: BorderSide( + color: Colors.black, + width: 0.5, + ), + left: BorderSide( + color: Colors.black, + ), + right: BorderSide( + color: Colors.black, + ), + top: BorderSide( + color: Colors.transparent, + ), + ), + ), + minX: 0, + maxX: (timeSeries1.length - 1).toDouble(), + maxY: getMaxY() + 15, + minY: getMinY() - 15, + lineBarsData: getData(context), + ); + } + + double getMaxY() { + double max = 0; + timeSeries1.forEach((element) { + double resultValueDouble = element.sales; + if (resultValueDouble > max) max = resultValueDouble; + }); + timeSeries2.forEach((element) { + double resultValueDouble = element.sales; + if (resultValueDouble > max) max = resultValueDouble; + }); + + return max.roundToDouble(); + } + + double getMinY() { + double min = timeSeries1[0].sales; + timeSeries1.forEach((element) { + double resultValueDouble = element.sales; + if (resultValueDouble < min) min = resultValueDouble; + }); + timeSeries2.forEach((element) { + double resultValueDouble = element.sales; + if (resultValueDouble < min) min = resultValueDouble; + }); + + int value = min.toInt(); + + return value.toDouble(); + } + + List getData(context) { + List spots = List(); + for (int index = 0; index < timeSeries1.length; index++) { + spots.add(FlSpot(index.toDouble(), timeSeries1[index].sales)); + } + + List spots2 = List(); + for (int index = 0; index < timeSeries2.length; index++) { + spots2.add(FlSpot(index.toDouble(), timeSeries2[index].sales)); + } + + final LineChartBarData lineChartBarData1 = LineChartBarData( + spots: spots, + isCurved: true, + colors: [Colors.red], + barWidth: 1.5, + isStrokeCapRound: true, + dotData: FlDotData( + show: false, + ), + belowBarData: BarAreaData( + show: false, + ), + ); + final LineChartBarData lineChartBarData2 = LineChartBarData( + spots: spots2, + isCurved: true, + colors: [Theme.of(context).primaryColor], + barWidth: 1.5, + isStrokeCapRound: true, + dotData: FlDotData( + show: false, + ), + belowBarData: BarAreaData( + show: false, + ), + ); + + return [lineChartBarData1, lineChartBarData2]; + } + + Decoration containerRadius(Color background, double radius) { + return BoxDecoration( + color: background, + border: Border.all( + width: 1, // + color: background // <--- border width here + ), + borderRadius: BorderRadius.circular(radius), + ); + } + +} diff --git a/lib/screens/patients/profile/vital_sign/line_chart_curved.dart b/lib/screens/patients/profile/vital_sign/line_chart_curved.dart index 51cc3bb9..c97c6041 100644 --- a/lib/screens/patients/profile/vital_sign/line_chart_curved.dart +++ b/lib/screens/patients/profile/vital_sign/line_chart_curved.dart @@ -7,13 +7,13 @@ import 'package:intl/intl.dart'; class LineChartCurved extends StatelessWidget { final String title; - final List? timeSeries; + final List timeSeries; final int indexes; - LineChartCurved({this.title = '', this.timeSeries, this.indexes = 0}); + LineChartCurved({this.title, this.timeSeries, this.indexes}); - List xAxixs = []; - List yAxixs = []; + List xAxixs = List(); + List yAxixs = List(); // DateFormat format = DateFormat("yyyy-MM-dd"); DateFormat yearFormat = DateFormat("yyyy/MMM/dd"); @@ -46,7 +46,7 @@ class LineChartCurved extends StatelessWidget { children: [ AppText( title, - fontSize: SizeConfig.textMultiplier! * 2.1, + fontSize: SizeConfig.textMultiplier * 2.1, fontWeight: FontWeight.bold, fontFamily: 'Poppins', textAlign: TextAlign.center, @@ -62,7 +62,7 @@ class LineChartCurved extends StatelessWidget { padding: const EdgeInsets.only(right: 18.0, left: 16.0), child: LineChart( sampleData1(context), - duration: const Duration(milliseconds: 250), + swapAnimationDuration: const Duration(milliseconds: 250), ), ), ), @@ -78,20 +78,20 @@ class LineChartCurved extends StatelessWidget { } getXaxix() { - for (int index = 0; index < timeSeries!.length; index++) { + for (int index = 0; index < timeSeries.length; index++) { int mIndex = indexes * index; - if (mIndex < timeSeries!.length) { + if (mIndex < timeSeries.length) { xAxixs.add(mIndex); } } } getYaxix() { - int indexess = (timeSeries!.length * 0.30).toInt(); - for (int index = 0; index < timeSeries!.length; index++) { + int indexess = (timeSeries.length * 0.30).toInt(); + for (int index = 0; index < timeSeries.length; index++) { int mIndex = indexess * index; - if (mIndex < timeSeries!.length) { - yAxixs.add(timeSeries![mIndex].sales!); + if (mIndex < timeSeries.length) { + yAxixs.add(timeSeries[mIndex].sales); } } } @@ -102,73 +102,82 @@ class LineChartCurved extends StatelessWidget { touchTooltipData: LineTouchTooltipData( tooltipBgColor: Colors.white, ), - touchCallback: (event, LineTouchResponse? touchResponse) {}, + //touchCallback: (LineTouchResponse touchResponse) {}, handleBuiltInTouches: true, ), gridData: FlGridData(show: true, drawVerticalLine: true, drawHorizontalLine: true), titlesData: FlTitlesData( - bottomTitles: AxisTitles( - sideTitles: SideTitles( - showTitles: true, - //rotateAngle: -65, - //rotateAngle:-65, - reservedSize: 22, - getTitlesWidget: (value, meta) { - if (timeSeries!.length < 15) { - if (timeSeries!.length > value.toInt()) { - DateTime dateTime = timeSeries![value.toInt()].time; - if (isDatesSameYear) { - return Text( - monthFormat.format(dateTime), - style: TextStyle( - color: Colors.black, - fontSize: 10, - ), - ); - } else { - return Text( - yearFormat.format(dateTime), - style: TextStyle( - color: Colors.black, - fontSize: 10, - ), - ); - } + bottomTitles: SideTitles( + showTitles: true, + getTextStyles: (context, value) { + return TextStyle( + color: Colors.black, + fontSize: 10, + ); + }, + rotateAngle: -65, + //rotateAngle:-65, + margin: 22, + getTitles: (value) { + if (timeSeries.length < 15) { + if (timeSeries.length > value.toInt()) { + DateTime dateTime = timeSeries[value.toInt()].time; + if (isDatesSameYear) { + return monthFormat.format(dateTime); } else { - return Text(''); + return yearFormat.format(dateTime); } } else { - if (value.toInt() == 0 || value.toInt() == timeSeries!.length - 1 || xAxixs.contains(value.toInt())) { - DateTime dateTime = timeSeries![value.toInt()].time; - if (isDatesSameYear) { - return Text( - monthFormat.format(dateTime), - style: TextStyle( - color: Colors.black, - fontSize: 10, - ), - ); - } else { - return Text( - yearFormat.format(dateTime), - style: TextStyle( - color: Colors.black, - fontSize: 10, - ), - ); - } + return ''; + } + } else { + if (value.toInt() == 0 || value.toInt() == timeSeries.length - 1 || xAxixs.contains(value.toInt())) { + DateTime dateTime = timeSeries[value.toInt()].time; + if (isDatesSameYear) { + return monthFormat.format(dateTime); + } else { + return yearFormat.format(dateTime); } } - return Text(''); - }, - ), + } + + /*if (timeSeries.length < 15) { + if (timeSeries.length > value.toInt()) { + DateTime dateTime = timeSeries[value.toInt()].time; + return '${timeSeries[value.toInt()].time.month}/ ${timeSeries[value.toInt()].time.year}'; + } else + return ''; + } else { + if (value.toInt() == 0) + return '${timeSeries[value.toInt()].time.month}/ ${timeSeries[value.toInt()].time.year}'; + if (value.toInt() == timeSeries.length - 1) + return '${timeSeries[value.toInt()].time.month}/ ${timeSeries[value.toInt()].time.year}'; + if (xAxixs.contains(value.toInt())) { + return '${timeSeries[value.toInt()].time.month}/ ${timeSeries[value.toInt()].time.year}'; + } + }*/ + return ''; + }, ), - leftTitles: AxisTitles( - sideTitles: SideTitles( + leftTitles: SideTitles( showTitles: true, + getTextStyles: (cxt, value) => const TextStyle( + color: Colors.black, + fontWeight: FontWeight.bold, + fontSize: 10, + ), interval: getInterval(), - reservedSize: 12, - )), + + // getTitles: (value) { + // if (value.toInt() == 0) + // return '${value.toInt()}'; + // else if (value.toInt() % horizontalInterval == 0) + // return '${value.toInt()}'; + // else + // return ''; + // }, + margin: 12, + ), ), borderData: FlBorderData( show: true, @@ -189,7 +198,7 @@ class LineChartCurved extends StatelessWidget { ), ), minX: 0, - maxX: (timeSeries!.length - 1).toDouble(), + maxX: (timeSeries.length - 1).toDouble(), maxY: getMaxY() + getInterval(), minY: 0, lineBarsData: getData(context), @@ -227,8 +236,8 @@ class LineChartCurved extends StatelessWidget { double getMaxY() { double max = 0; - timeSeries!.forEach((element) { - double resultValueDouble = element.sales!; + timeSeries.forEach((element) { + double resultValueDouble = element.sales; if (resultValueDouble > max) max = resultValueDouble; }); @@ -236,9 +245,9 @@ class LineChartCurved extends StatelessWidget { } double getMinY() { - double min = timeSeries![0].sales!; - timeSeries!.forEach((element) { - double resultValueDouble = element.sales!; + double min = timeSeries[0].sales; + timeSeries.forEach((element) { + double resultValueDouble = element.sales; if (resultValueDouble < min) min = resultValueDouble; }); int value = min.toInt(); @@ -247,21 +256,21 @@ class LineChartCurved extends StatelessWidget { } List getData(context) { - List spots = []; + List spots = List(); isDatesSameYear = true; int previousDateYear = 0; - for (int index = 0; index < timeSeries!.length; index++) { - spots.add(FlSpot(index.toDouble(), timeSeries![index].sales!)); - if (isDatesSameYear == false || (previousDateYear != 0 && previousDateYear != timeSeries![index].time.year)) { + for (int index = 0; index < timeSeries.length; index++) { + spots.add(FlSpot(index.toDouble(), timeSeries[index].sales)); + if (isDatesSameYear == false || (previousDateYear != 0 && previousDateYear != timeSeries[index].time.year)) { isDatesSameYear = false; } - previousDateYear = timeSeries![index].time.year; + previousDateYear = timeSeries[index].time.year; } final LineChartBarData lineChartBarData1 = LineChartBarData( spots: spots, isCurved: true, - color: Colors.red /*[Theme.of(context).primaryColor]*/, + colors: [Colors.red] /*[Theme.of(context).primaryColor]*/, barWidth: 5, isStrokeCapRound: true, dotData: FlDotData( diff --git a/lib/screens/patients/profile/vital_sign/line_chart_curved_blood_pressure.dart b/lib/screens/patients/profile/vital_sign/line_chart_curved_blood_pressure.dart index e843a4d1..ba983005 100644 --- a/lib/screens/patients/profile/vital_sign/line_chart_curved_blood_pressure.dart +++ b/lib/screens/patients/profile/vital_sign/line_chart_curved_blood_pressure.dart @@ -7,15 +7,15 @@ import 'package:flutter/material.dart'; class LineChartCurvedBloodPressure extends StatelessWidget { final String title; - final List? timeSeries1; - final List? timeSeries2; + final List timeSeries1; + final List timeSeries2; final int indexes; final bool isOX; - LineChartCurvedBloodPressure({this.title = '', this.timeSeries1, this.indexes = 0, this.timeSeries2, this.isOX = false}); + LineChartCurvedBloodPressure({this.title, this.timeSeries1, this.indexes, this.timeSeries2, this.isOX = false}); - List xAxixs = []; - List yAxixs = []; + List xAxixs = List(); + List yAxixs = List(); @override Widget build(BuildContext context) { @@ -40,7 +40,7 @@ class LineChartCurvedBloodPressure extends StatelessWidget { children: [ AppText( title, - fontSize: SizeConfig.textMultiplier! * 2.1, + fontSize: SizeConfig.textMultiplier * 2.1, fontWeight: FontWeight.bold, fontFamily: 'Poppins', textAlign: TextAlign.center, @@ -56,7 +56,7 @@ class LineChartCurvedBloodPressure extends StatelessWidget { padding: const EdgeInsets.only(right: 18.0, left: 16.0, top: 15), child: LineChart( sampleData1(context), - duration: const Duration(milliseconds: 250), + swapAnimationDuration: const Duration(milliseconds: 250), ), ), ), @@ -107,9 +107,9 @@ class LineChartCurvedBloodPressure extends StatelessWidget { } getXaxix() { - for (int index = 0; index < timeSeries1!.length; index++) { + for (int index = 0; index < timeSeries1.length; index++) { int mIndex = indexes * index; - if (mIndex < timeSeries1!.length) { + if (mIndex < timeSeries1.length) { xAxixs.add(mIndex); } } @@ -121,73 +121,51 @@ class LineChartCurvedBloodPressure extends StatelessWidget { touchTooltipData: LineTouchTooltipData( tooltipBgColor: Colors.white, ), - touchCallback: (event, LineTouchResponse? touchResponse) {}, + // touchCallback: (LineTouchResponse touchResponse) {}, handleBuiltInTouches: true, ), gridData: FlGridData(show: true, drawVerticalLine: true, drawHorizontalLine: true), titlesData: FlTitlesData( - bottomTitles: AxisTitles( - sideTitles: SideTitles( + bottomTitles: SideTitles( showTitles: true, - //rotateAngle: -65, + getTextStyles: (context, value) { + return TextStyle( + color: Colors.black, + fontSize: 10, + ); + }, + rotateAngle: -65, //rotateAngle:-65, - reservedSize: 22, - getTitlesWidget: (value, meta) { - if (timeSeries1!.length < 15) { - if (timeSeries1!.length > value.toInt()) { - return Text( - '${timeSeries1![value.toInt()].time.month}/ ${timeSeries1![value.toInt()].time.year}', - style: TextStyle( - color: Colors.black, - fontSize: 10, - ), - ); + margin: 22, + getTitles: (value) { + if (timeSeries1.length < 15) { + if (timeSeries1.length > value.toInt()) { + return '${timeSeries1[value.toInt()].time.month}/ ${timeSeries1[value.toInt()].time.year}'; } else - return Text(""); + return ''; } else { - if (value.toInt() == 0) - return Text( - '${timeSeries1![value.toInt()].time.month}/ ${timeSeries1![value.toInt()].time.year}', - style: TextStyle( - color: Colors.black, - fontSize: 10, - ), - ); - if (value.toInt() == timeSeries1!.length - 1) - return Text('${timeSeries1![value.toInt()].time.month}/ ${timeSeries1![value.toInt()].time.year}', - style: TextStyle( - color: Colors.black, - fontSize: 10, - )); + if (value.toInt() == 0) return '${timeSeries1[value.toInt()].time.month}/ ${timeSeries1[value.toInt()].time.year}'; + if (value.toInt() == timeSeries1.length - 1) return '${timeSeries1[value.toInt()].time.month}/ ${timeSeries1[value.toInt()].time.year}'; if (xAxixs.contains(value.toInt())) { - return Text( - '${timeSeries1![value.toInt()].time.month}/ ${timeSeries1![value.toInt()].time.year}', - style: TextStyle( - color: Colors.black, - fontSize: 10, - ), - ); + return '${timeSeries1[value.toInt()].time.month}/ ${timeSeries1[value.toInt()].time.year}'; } } - return Text(""); + return ''; }, - )), - leftTitles: AxisTitles( - sideTitles: SideTitles( + ), + leftTitles: SideTitles( showTitles: true, + getTextStyles: (cxt, value) => const TextStyle( + color: Colors.black, + fontWeight: FontWeight.bold, + fontSize: 10, + ), interval: getInterval(), - getTitlesWidget: (value, meta) { - return Text( - '${value.toInt()}', - style: TextStyle( - color: Colors.black, - fontWeight: FontWeight.bold, - fontSize: 10, - ), - ); + getTitles: (value) { + return '${value.toInt()}'; }, - reservedSize: 12, - )), + margin: 12, + ), ), borderData: FlBorderData( show: true, @@ -225,8 +203,8 @@ class LineChartCurvedBloodPressure extends StatelessWidget { double getMaxY() { double max = 0; - timeSeries1!.forEach((element) { - double resultValueDouble = element.sales!; + timeSeries1.forEach((element) { + double resultValueDouble = element.sales; if (resultValueDouble > max) max = resultValueDouble; }); @@ -234,16 +212,15 @@ class LineChartCurvedBloodPressure extends StatelessWidget { } double getMinY() { - double min = timeSeries1![0].sales!; - timeSeries1!.forEach((element) { - double resultValueDouble = element.sales!; + double min = timeSeries1[0].sales; + timeSeries1.forEach((element) { + double resultValueDouble = element.sales; if (resultValueDouble < min) min = resultValueDouble; }); int value = min.toInt(); return value.toDouble(); } - // double getMaxY() { // double max = 0; // timeSeries1.forEach((element) { @@ -275,20 +252,20 @@ class LineChartCurvedBloodPressure extends StatelessWidget { // } List getData(context) { - List spots = []; - for (int index = 0; index < timeSeries1!.length; index++) { - spots.add(FlSpot(index.toDouble(), timeSeries1![index].sales!)); + List spots = List(); + for (int index = 0; index < timeSeries1.length; index++) { + spots.add(FlSpot(index.toDouble(), timeSeries1[index].sales)); } - List spots2 = []; - for (int index = 0; index < timeSeries2!.length; index++) { - spots2.add(FlSpot(index.toDouble(), timeSeries2![index].sales!)); + List spots2 = List(); + for (int index = 0; index < timeSeries2.length; index++) { + spots2.add(FlSpot(index.toDouble(), timeSeries2[index].sales)); } final LineChartBarData lineChartBarData1 = LineChartBarData( spots: spots, isCurved: true, - color: Theme.of(context).primaryColor, + colors: [Theme.of(context).primaryColor], barWidth: 5, isStrokeCapRound: true, dotData: FlDotData( @@ -301,7 +278,7 @@ class LineChartCurvedBloodPressure extends StatelessWidget { final LineChartBarData lineChartBarData2 = LineChartBarData( spots: spots2, isCurved: true, - color: Colors.red, + colors: [Colors.red], barWidth: 5, isStrokeCapRound: true, dotData: FlDotData( @@ -312,7 +289,7 @@ class LineChartCurvedBloodPressure extends StatelessWidget { ), ); - List lineChartData = []; + List lineChartData = List(); if (spots.isNotEmpty) { lineChartData.add(lineChartBarData1); } diff --git a/lib/screens/patients/profile/vital_sign/vital_sign_details_screen.dart b/lib/screens/patients/profile/vital_sign/vital_sign_details_screen.dart index 1e1c41ea..85a29937 100644 --- a/lib/screens/patients/profile/vital_sign/vital_sign_details_screen.dart +++ b/lib/screens/patients/profile/vital_sign/vital_sign_details_screen.dart @@ -1,9 +1,9 @@ import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/core/service/AnalyticsService.dart'; import 'package:doctor_app_flutter/core/viewModel/patient-vital-sign-viewmodel.dart'; import 'package:doctor_app_flutter/locator.dart'; import 'package:doctor_app_flutter/lookups/patient_lookup.dart'; -import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/patients/profile/vital_sign/vital_sign_item.dart'; import 'package:doctor_app_flutter/screens/patients/profile/vital_sign/vital_sign_item_details_screen.dart'; @@ -20,11 +20,11 @@ class VitalSignDetailsScreen extends StatelessWidget { int projectID; bool isNotOneAppointment; - VitalSignDetailsScreen({this.appointmentNo = 0, this.projectID = 0, this.isNotOneAppointment = true}); + VitalSignDetailsScreen({this.appointmentNo, this.projectID, this.isNotOneAppointment = true}); @override Widget build(BuildContext context) { - final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; + final routeArgs = ModalRoute.of(context).settings.arguments as Map; PatiantInformtion patient = routeArgs['patient']; String patientType = routeArgs['patientType']; String arrivalType = routeArgs['arrivalType']; @@ -57,13 +57,13 @@ class VitalSignDetailsScreen extends StatelessWidget { children: [ AppText( "${patient.firstName ?? patient?.patientDetails?.firstName ?? patient.fullName ?? ''}'s", - fontSize: SizeConfig.textMultiplier! * 1.6, + fontSize: SizeConfig.textMultiplier * 1.6, fontWeight: FontWeight.w700, color: Color(0xFF2E303A), ), AppText( TranslationBase.of(context).vitalSign, - fontSize: SizeConfig.textMultiplier! * 3, + fontSize: SizeConfig.textMultiplier * 3, fontWeight: FontWeight.bold, color: Color(0xFF2E303A), ) @@ -90,7 +90,7 @@ class VitalSignDetailsScreen extends StatelessWidget { AppText( "${TranslationBase.of(context).yourBodyMassIndex} ${mode.bodyMax}", color: Color(0xFF2E303A), - fontSize: SizeConfig.textMultiplier! * 2.0, + fontSize: SizeConfig.textMultiplier * 2.0, fontWeight: FontWeight.w700, ), Row( @@ -110,15 +110,15 @@ class VitalSignDetailsScreen extends StatelessWidget { AppText( "${TranslationBase.of(context).bmiUnderWeight}", fontFamily: 'Poppins', - fontSize: SizeConfig.textMultiplier! * 1.15, - color: mode.getBMIStatus() == 1 ? Color(0XFFD02127) : Colors.grey, + fontSize: SizeConfig.textMultiplier * 1.15, + color: mode.getBMIStatus() == 1 ? Color(0XFFD02127) : null, fontWeight: FontWeight.w700, ), AppText( "(<18.5)", fontFamily: 'Poppins', - fontSize: SizeConfig.textMultiplier! * 1.15, - color: mode.getBMIStatus() == 1 ? Color(0XFFD02127) : Colors.grey, + fontSize: SizeConfig.textMultiplier * 1.15, + color: mode.getBMIStatus() == 1 ? Color(0XFFD02127) : null, fontWeight: FontWeight.w700, ), ], @@ -138,17 +138,17 @@ class VitalSignDetailsScreen extends StatelessWidget { child: AppText( "${TranslationBase.of(context).normal}", fontFamily: 'Poppins', - fontSize: SizeConfig.textMultiplier! * 1.15, + fontSize: SizeConfig.textMultiplier * 1.15, fontWeight: FontWeight.w700, - color: mode.getBMIStatus() == 2 ? Color(0XFFD02127) : Colors.grey, + color: mode.getBMIStatus() == 2 ? Color(0XFFD02127) : null, ), ), AppText( "(18.5-24.9)", fontFamily: 'Poppins', - fontSize: SizeConfig.textMultiplier! * 1.15, + fontSize: SizeConfig.textMultiplier * 1.15, fontWeight: FontWeight.w700, - color: mode.getBMIStatus() == 2 ? Color(0XFFD02127) : Colors.grey, + color: mode.getBMIStatus() == 2 ? Color(0XFFD02127) : null, ), ], )), @@ -166,16 +166,16 @@ class VitalSignDetailsScreen extends StatelessWidget { AppText( "${TranslationBase.of(context).bmiOverWeight}", fontFamily: 'Poppins', - fontSize: SizeConfig.textMultiplier! * 1.155, + fontSize: SizeConfig.textMultiplier * 1.155, fontWeight: FontWeight.w700, - color: mode.getBMIStatus() == 3 ? Color(0XFFD02127) : Colors.grey, + color: mode.getBMIStatus() == 3 ? Color(0XFFD02127) : null, ), AppText( "(25-29.9)", fontFamily: 'Poppins', - fontSize: SizeConfig.textMultiplier! * 1.155, + fontSize: SizeConfig.textMultiplier * 1.155, fontWeight: FontWeight.w700, - color: mode.getBMIStatus() == 3 ? Color(0XFFD02127) : Colors.grey, + color: mode.getBMIStatus() == 3 ? Color(0XFFD02127) : null, ), ], )), @@ -193,16 +193,16 @@ class VitalSignDetailsScreen extends StatelessWidget { AppText( "${TranslationBase.of(context).bmiObese}", fontFamily: 'Poppins', - fontSize: SizeConfig.textMultiplier! * 1.15, + fontSize: SizeConfig.textMultiplier * 1.15, fontWeight: FontWeight.w700, - color: mode.getBMIStatus() == 4 ? Color(0XFFD02127) : Colors.grey, + color: mode.getBMIStatus() == 4 ? Color(0XFFD02127) : null, ), AppText( "(30-34.9)", fontFamily: 'Poppins', - fontSize: SizeConfig.textMultiplier! * 1.15, + fontSize: SizeConfig.textMultiplier * 1.15, fontWeight: FontWeight.w700, - color: mode.getBMIStatus() == 4 ? Color(0XFFD02127) : Colors.grey, + color: mode.getBMIStatus() == 4 ? Color(0XFFD02127) : null, ), ], )), @@ -222,17 +222,17 @@ class VitalSignDetailsScreen extends StatelessWidget { child: AppText( "${TranslationBase.of(context).bmiObeseExtreme}", fontFamily: 'Poppins', - fontSize: SizeConfig.textMultiplier! * 1.15, + fontSize: SizeConfig.textMultiplier * 1.15, fontWeight: FontWeight.w700, - color: mode.getBMIStatus() == 5 ? Color(0XFFD02127) : Colors.grey, + color: mode.getBMIStatus() == 5 ? Color(0XFFD02127) : null, ), ), AppText( "(35<)", fontFamily: 'Poppins', - fontSize: SizeConfig.textMultiplier! * 1.15, + fontSize: SizeConfig.textMultiplier * 1.15, fontWeight: FontWeight.w700, - color: mode.getBMIStatus() == 5 ? Color(0XFFD02127) : Colors.grey, + color: mode.getBMIStatus() == 5 ? Color(0XFFD02127) : null, ), ], )), @@ -392,6 +392,8 @@ class VitalSignDetailsScreen extends StatelessWidget { patient: patient, patientType: patientType, arrivalType: arrivalType, + viewKey1: 'BloodPressureHigher', + viewKey2: 'BloodPressureLower', ), ), ) diff --git a/lib/screens/patients/profile/vital_sign/vital_sign_item_details_screen.dart b/lib/screens/patients/profile/vital_sign/vital_sign_item_details_screen.dart index b06a6784..57a14675 100644 --- a/lib/screens/patients/profile/vital_sign/vital_sign_item_details_screen.dart +++ b/lib/screens/patients/profile/vital_sign/vital_sign_item_details_screen.dart @@ -1,11 +1,13 @@ import 'package:doctor_app_flutter/config/size_config.dart'; -import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; -import 'package:doctor_app_flutter/lookups/patient_lookup.dart'; +import 'package:doctor_app_flutter/core/model/charts/app_time_series_chart.dart'; import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/core/model/patient/vital_sign/patient-vital-sign-history.dart'; +import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; +import 'package:doctor_app_flutter/lookups/patient_lookup.dart'; import 'package:doctor_app_flutter/screens/patients/profile/vital_sign/vital_sign_detail_pain_scale.dart'; import 'package:doctor_app_flutter/screens/patients/profile/vital_sign/vital_sing_chart_and_detials.dart'; import 'package:doctor_app_flutter/screens/patients/profile/vital_sign/vital_sing_chart_blood_pressure.dart'; +import 'package:doctor_app_flutter/utils/date-utils.dart'; import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-profile-app-bar.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; @@ -14,22 +16,22 @@ import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; class VitalSignItemDetailsScreen extends StatelessWidget { - final vitalSignDetails? pageKey; + final vitalSignDetails pageKey; final String pageTitle; - List? VSchart; - PatiantInformtion? patient; + List VSchart; + PatiantInformtion patient; String patientType; String arrivalType; - VitalSignItemDetailsScreen( - {this.vitalList, - this.pageKey, - this.pageTitle = '', - this.patient, - this.patientType = '', - this.arrivalType = ''}); + List timeSeriesData1 = []; + List timeSeriesData2 = []; + + final String viewKey1; + final String viewKey2; + + VitalSignItemDetailsScreen({this.vitalList, this.pageKey, @required this.viewKey1, @required this.viewKey2, this.pageTitle, this.patient, this.patientType, this.arrivalType}); - final List? vitalList; + final List vitalList; @override Widget build(BuildContext context) { @@ -191,7 +193,7 @@ class VitalSignItemDetailsScreen extends StatelessWidget { backgroundColor: Color.fromRGBO(248, 248, 248, 1), isShowAppBar: true, appBar: PatientProfileAppBar( - patient!, + patient, ), body: SingleChildScrollView( child: Column( @@ -203,15 +205,15 @@ class VitalSignItemDetailsScreen extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - "${patient!.firstName ?? patient?.patientDetails?.firstName ?? patient!.fullName ?? ''}'s", + "${patient.firstName ?? patient?.patientDetails?.firstName ?? patient.fullName ?? ''}'s", fontFamily: 'Poppins', - fontSize: SizeConfig.textMultiplier! * 1.6, + fontSize: SizeConfig.textMultiplier * 1.6, fontWeight: FontWeight.w600, ), AppText( TranslationBase.of(context).vitalSign, fontFamily: 'Poppins', - fontSize: SizeConfig.textMultiplier! * 3, + fontSize: SizeConfig.textMultiplier * 3, fontWeight: FontWeight.bold, ) ], @@ -221,49 +223,33 @@ class VitalSignItemDetailsScreen extends StatelessWidget { child: ListView( shrinkWrap: true, physics: NeverScrollableScrollPhysics(), - children: VSchart!.map((chartInfo) { - var vitalListTemp = vitalList!.where( + children: VSchart.map((chartInfo) { + var vitalListTemp = vitalList.where( (element) => element.toJson()[chartInfo['viewKey']] != null, ); if (chartInfo['viewKey'] == 'PainScore') { - return VitalSignDetailPainScale(vitalList!); + return VitalSignDetailPainScale(vitalList); } - if (vitalListTemp.length != 0 && - chartInfo['viewKey'] == 'BloodPressure' || - chartInfo['viewKey'] == 'O2') { + if (vitalListTemp.length != 0 && chartInfo['viewKey'] == 'BloodPressure' || chartInfo['viewKey'] == 'O2') { return VitalSingChartBloodPressure( - vitalList: vitalList!, - name: projectViewModel.isArabic - ? chartInfo['nameAr'] - : chartInfo['name'], + vitalList: vitalList, + name: projectViewModel.isArabic ? chartInfo['nameAr'] : chartInfo['name'], title1: chartInfo['title1'], - title2: projectViewModel.isArabic - ? chartInfo['title2Ar'] - : chartInfo['title2'], - title3: projectViewModel.isArabic - ? chartInfo['title3Ar'] - : chartInfo['title3'], - viewKey1: chartInfo['viewKey'] == 'BloodPressure' - ? 'BloodPressureHigher' - : 'SAO2', - viewKey2: chartInfo['viewKey'] == 'BloodPressure' - ? 'BloodPressureLower' - : 'FIO2', + title2: projectViewModel.isArabic ? chartInfo['title2Ar'] : chartInfo['title2'], + title3: projectViewModel.isArabic ? chartInfo['title3Ar'] : chartInfo['title3'], + viewKey1: chartInfo['viewKey'] == 'BloodPressure' ? 'BloodPressureHigher' : 'SAO2', + viewKey2: chartInfo['viewKey'] == 'BloodPressure' ? 'BloodPressureLower' : 'FIO2', ); } return vitalListTemp.length != 0 ? VitalSingChartAndDetials( - vitalList: vitalList!, - name: projectViewModel.isArabic - ? chartInfo['nameAr'] - : chartInfo['name'], + vitalList: vitalList, + name: projectViewModel.isArabic ? chartInfo['nameAr'] : chartInfo['name'], title1: chartInfo['title1'], - title2: projectViewModel.isArabic - ? chartInfo['title2Ar'] - : chartInfo['title2'], + title2: projectViewModel.isArabic ? chartInfo['title2Ar'] : chartInfo['title2'], viewKey: chartInfo['viewKey']) : Container(); }).toList(), diff --git a/lib/screens/patients/profile/vital_sign/vital_sing_chart_blood_pressure.dart b/lib/screens/patients/profile/vital_sign/vital_sing_chart_blood_pressure.dart index 0a0bd6e4..b4af3874 100644 --- a/lib/screens/patients/profile/vital_sign/vital_sing_chart_blood_pressure.dart +++ b/lib/screens/patients/profile/vital_sign/vital_sing_chart_blood_pressure.dart @@ -1,6 +1,7 @@ import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/model/charts/app_time_series_chart.dart'; import 'package:doctor_app_flutter/core/model/patient/vital_sign/patient-vital-sign-history.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/vital_sign/LineChartCurvedBloodPressure.dart'; import 'package:doctor_app_flutter/screens/patients/profile/vital_sign/vital_sign_details_blood_pressurewideget.dart'; import 'package:doctor_app_flutter/utils/date-utils.dart'; import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; @@ -45,7 +46,7 @@ class VitalSingChartBloodPressure extends StatelessWidget { decoration: BoxDecoration( color: Colors.white, borderRadius: BorderRadius.circular(12)), - child: LineChartCurvedBloodPressure( + child: LineChartCurvedBloodPressureNew( title: name, isOX: title2 == "SAO2", timeSeries1: timeSeriesData1, diff --git a/lib/screens/prescription/add_prescription/add_drug/drug_to_drug.dart b/lib/screens/prescription/add_prescription/add_drug/drug_to_drug.dart index d5d92dc3..869e45a5 100644 --- a/lib/screens/prescription/add_prescription/add_drug/drug_to_drug.dart +++ b/lib/screens/prescription/add_prescription/add_drug/drug_to_drug.dart @@ -29,6 +29,7 @@ class DrugToDrug extends StatefulWidget { class _DrugToDrug extends State { int typeID = 1; bool isLoaded = false; + /// TODO Elham* fix this List> expandableList = [ {'name': 'CRITICAL', 'level': 'LEVEL_4'}, @@ -38,7 +39,6 @@ class _DrugToDrug extends State { {'name': 'INFO', 'level': 'INFO'}, ]; - VitalSignsViewModel vitalSignsViewModel = new VitalSignsViewModel(); SOAPViewModel soapViewModel = new SOAPViewModel(); @@ -53,49 +53,31 @@ class _DrugToDrug extends State { Widget build(BuildContext context) { return isLoaded == true ? BaseView( - onModelReady: (prescriptionViewModel) => prescriptionViewModel.getDrugToDrug( - vitalSignsViewModel.patientVitalSigns, - widget.listAssessment, - soapViewModel.patientAllergiesList, - widget.patient, - widget.prescription), - builder: (BuildContext context, PrescriptionViewModel prescriptionViewModel, - Widget? child) => - NetworkBaseView( - baseViewModel: prescriptionViewModel, - child: Container( - height: SizeConfig.realScreenHeight! * .9, - child: new ListView.builder( - itemCount: expandableList.length, - itemBuilder: (context, i) { - return new ExpansionTile( - title: new AppText( - expandableList[i]['name'] + - ' ' + - '(' + - getDrugInfo(expandableList[i]['level'], - prescriptionViewModel) - .length - .toString() + - ')', - fontSize: 20, - fontWeight: FontWeight.bold, - ), - children: getDrugInfo( - expandableList[i]['level'], prescriptionViewModel) - .map((item) { - return Container( - padding: EdgeInsets.all(10), - child: AppText( - item['comment'], - color: Colors.red[900]!, - )); - }).toList()); - })))) - : Container( - height: SizeConfig.realScreenHeight! * .45, - child: GifLoaderContainer() - ); + onModelReady: (prescriptionViewModel) => + prescriptionViewModel.getDrugToDrug(vitalSignsViewModel.patientVitalSigns, widget.listAssessment, soapViewModel.patientAllergiesList, widget.patient, widget.prescription), + builder: (BuildContext context, PrescriptionViewModel prescriptionViewModel, Widget child) => NetworkBaseView( + baseViewModel: prescriptionViewModel, + child: Container( + height: SizeConfig.realScreenHeight * .9, + child: new ListView.builder( + itemCount: expandableList.length, + itemBuilder: (context, i) { + return new ExpansionTile( + title: new AppText( + expandableList[i]['name'] + ' ' + '(' + getDrugInfo(expandableList[i]['level'], prescriptionViewModel).length.toString() + ')', + fontSize: 20, + fontWeight: FontWeight.bold, + ), + children: getDrugInfo(expandableList[i]['level'], prescriptionViewModel).map((item) { + return Container( + padding: EdgeInsets.all(10), + child: AppText( + item['comment'], + color: Colors.red[900], + )); + }).toList()); + })))) + : Container(height: SizeConfig.realScreenHeight * .45, child: GifLoaderContainer()); } getTypeID() async { @@ -106,14 +88,12 @@ class _DrugToDrug extends State { } getRequestedData() async { - - GeneralGetReqForSOAP generalGetReqForSOAP = GeneralGetReqForSOAP( - /// TODO Elham* fix this today + + /// TODO Elham* fix this today patientMRN: widget.patient.patientMRN, episodeId: widget.patient.episodeNo, - appointmentNo: - widget.patient.appointmentNo, + appointmentNo: widget.patient.appointmentNo, doctorID: '', editedBy: ''); diff --git a/lib/screens/prescription/add_prescription/prescription_form_widget.dart b/lib/screens/prescription/add_prescription/prescription_form_widget.dart index 5305032e..cb4ebf06 100644 --- a/lib/screens/prescription/add_prescription/prescription_form_widget.dart +++ b/lib/screens/prescription/add_prescription/prescription_form_widget.dart @@ -13,43 +13,43 @@ import 'package:doctor_app_flutter/locator.dart'; import 'package:doctor_app_flutter/screens/prescription/prescription_text_filed.dart'; import 'package:doctor_app_flutter/utils/date-utils.dart'; import 'package:doctor_app_flutter/utils/dr_app_toast_msg.dart'; -import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; import 'package:doctor_app_flutter/utils/utils.dart'; +import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; +import 'package:doctor_app_flutter/widgets/shared/text_fields/TextFields.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/speech-text-popup.dart'; -import 'package:doctor_app_flutter/widgets/shared/text_fields/TextFields.dart'; import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart'; import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; import 'package:hexcolor/hexcolor.dart'; import 'package:speech_to_text/speech_recognition_error.dart'; import 'package:speech_to_text/speech_to_text.dart' as stt; - import '../../../widgets/transitions/slide_up_page.dart'; import 'add_drug/add_drug_widget.dart'; class PrescriptionFormWidget extends StatefulWidget { - final PatiantInformtion? patient; - final List? prescriptionList; - final PrescriptionViewModel? prescriptionViewModel; - final MedicineViewModel? medicineViewModel; - final GetMedicationResponseModel? selectedMedication; + final PatiantInformtion patient; + final List prescriptionList; + final PrescriptionViewModel prescriptionViewModel; + final MedicineViewModel medicineViewModel; + final GetMedicationResponseModel selectedMedication; - const PrescriptionFormWidget({Key? key, this.patient, this.prescriptionList, this.prescriptionViewModel, this.medicineViewModel, this.selectedMedication}); + const PrescriptionFormWidget({Key key, this.patient, this.prescriptionList, this.prescriptionViewModel, this.medicineViewModel, this.selectedMedication}); @override _PrescriptionFormWidgetState createState() => _PrescriptionFormWidgetState(); } class _PrescriptionFormWidgetState extends State { - String? routeError; - String? frequencyError; - String? doseTimeError; - String? durationError; - String? unitError; - String? strengthError; + String routeError; + String frequencyError; + String doseTimeError; + String durationError; + String unitError; + String strengthError; - int? selectedType; + int selectedType; TextEditingController strengthController = TextEditingController(); TextEditingController unitController = TextEditingController(); @@ -60,7 +60,7 @@ class _PrescriptionFormWidgetState extends State { bool visibilitySearch = true; DateTime selectedDate = DateTime.now(); - int? strengthChar; + int strengthChar; GlobalKey key = new GlobalKey>(); TextEditingController drugIdController = TextEditingController(); @@ -165,7 +165,7 @@ class _PrescriptionFormWidgetState extends State { value: 1, groupValue: selectedType, onChanged: (value) { - setSelectedType(value!); + setSelectedType(value); }, ), Text(TranslationBase.of(context).regular), @@ -177,17 +177,16 @@ class _PrescriptionFormWidgetState extends State { Container( width: MediaQuery.of(context).size.width * 0.35, child: AppTextFieldCustom( - validationError: strengthError!, + validationError: strengthError, hintText: TranslationBase.of(context).strength, isTextFieldHasSuffix: false, enabled: true, controller: strengthController, - onChanged: (value) { - if (value != null) - setState(() { - strengthChar = value.length; - }); - if (strengthChar! >= 5) { + onChanged: (String value) { + setState(() { + strengthChar = value.length; + }); + if (strengthChar >= 5) { DrAppToastMsg.showErrorToast( TranslationBase.of(context).only5DigitsAllowedForStrength, ); @@ -196,8 +195,6 @@ class _PrescriptionFormWidgetState extends State { inputType: TextInputType.numberWithOptions( decimal: true, ), - onClick: () {}, - onFieldSubmitted: () {}, ), ), SizedBox( @@ -205,12 +202,12 @@ class _PrescriptionFormWidgetState extends State { ), PrescriptionTextFiled( width: MediaQuery.of(context).size.width * 0.510, - element: widget.medicineViewModel!.itemMedicineListUnit.length == 1 ? widget.medicineViewModel!.itemMedicineListUnit[0] : units, - elementError: unitError!, + element: widget.medicineViewModel.itemMedicineListUnit.length == 1 ? widget.medicineViewModel.itemMedicineListUnit[0] : units, + elementError: unitError, keyName: 'description', keyId: 'parameterCode', hintText: TranslationBase.of(context).unit, - elementList: widget.medicineViewModel!.itemMedicineListUnit, + elementList: widget.medicineViewModel.itemMedicineListUnit, okFunction: (selectedValue) { setState(() { units = selectedValue; @@ -222,9 +219,9 @@ class _PrescriptionFormWidgetState extends State { ), SizedBox(height: spaceBetweenTextFields), PrescriptionTextFiled( - elementList: widget.medicineViewModel!.itemMedicineListRoute, - element: widget.medicineViewModel!.itemMedicineListRoute.length == 1 ? route = widget.medicineViewModel!.itemMedicineListRoute[0] : route, - elementError: routeError!, + elementList: widget.medicineViewModel.itemMedicineListRoute, + element: widget.medicineViewModel.itemMedicineListRoute.length == 1 ? route = widget.medicineViewModel.itemMedicineListRoute[0] : route, + elementError: routeError, keyId: 'parameterCode', keyName: 'description', okFunction: (selectedValue) { @@ -238,10 +235,10 @@ class _PrescriptionFormWidgetState extends State { SizedBox(height: spaceBetweenTextFields), PrescriptionTextFiled( hintText: TranslationBase.of(context).frequency, - elementError: frequencyError!, + elementError: frequencyError, // element: frequency, - element: widget.medicineViewModel!.itemMedicineListRoute.length == 1 ? frequency = widget.medicineViewModel!.itemMedicineListRoute[0] : frequency, - elementList: widget.medicineViewModel!.itemMedicineList, + element: widget.medicineViewModel.itemMedicineListRoute.length == 1 ? frequency = widget.medicineViewModel.itemMedicineListRoute[0] : frequency, + elementList: widget.medicineViewModel.itemMedicineList, keyId: 'parameterCode', keyName: 'description', okFunction: (selectedValue) { @@ -249,8 +246,8 @@ class _PrescriptionFormWidgetState extends State { frequency = selectedValue; frequency['isDefault'] = true; if (widget.selectedMedication != null && duration != null && frequency != null && strengthController.text != null) { - widget.medicineViewModel! - .getBoxQuantity(freq: frequency['parameterCode'], duration: duration['id'], itemCode: widget.selectedMedication!.itemId, strength: double.parse(strengthController.text)); + widget.medicineViewModel + .getBoxQuantity(freq: frequency['parameterCode'], duration: duration['id'], itemCode: widget.selectedMedication.itemId, strength: double.parse(strengthController.text)); return; } @@ -259,9 +256,9 @@ class _PrescriptionFormWidgetState extends State { SizedBox(height: spaceBetweenTextFields), PrescriptionTextFiled( hintText: TranslationBase.of(context).doseTime, - elementError: doseTimeError!, + elementError: doseTimeError, element: doseTime, - elementList: widget.medicineViewModel!.medicationDoseTimeList, + elementList: widget.medicineViewModel.medicationDoseTimeList, keyId: 'id', keyName: 'nameEn', okFunction: (selectedValue) { @@ -270,7 +267,7 @@ class _PrescriptionFormWidgetState extends State { }); }), SizedBox(height: spaceBetweenTextFields), - if (widget.medicineViewModel!.patientAssessmentList.isNotEmpty) + if (widget.medicineViewModel.patientAssessmentList.isNotEmpty) Container( height: screenSize.height * 0.070, width: double.infinity, @@ -280,11 +277,8 @@ class _PrescriptionFormWidgetState extends State { Container( width: MediaQuery.of(context).size.width * 0.29, child: AppTextFieldCustom( - hintText: widget.medicineViewModel!.patientAssessmentList[0].icdCode10ID.toString(), + hintText: widget.medicineViewModel.patientAssessmentList[0].icdCode10ID.toString(), enabled: true, - onClick: () {}, - onChanged: (value) {}, - onFieldSubmitted: () {}, ), ), Container( @@ -292,11 +286,8 @@ class _PrescriptionFormWidgetState extends State { color: Colors.white, child: AppTextFieldCustom( maxLines: 5, - hintText: widget.medicineViewModel!.patientAssessmentList[0].asciiDesc.toString(), + hintText: widget.medicineViewModel.patientAssessmentList[0].asciiDesc.toString(), enabled: true, - onClick: () {}, - onChanged: (value) {}, - onFieldSubmitted: () {}, ), ), ], @@ -306,9 +297,9 @@ class _PrescriptionFormWidgetState extends State { Container( color: Colors.transparent, child: InkWell( - onTap: () => selectDate(context, widget.prescriptionViewModel!), + onTap: () => selectDate(context, widget.prescriptionViewModel), child: AppTextFieldCustom( - validationError: strengthError!, + validationError: strengthError, hintText: TranslationBase.of(context).date, isTextFieldHasSuffix: true, suffixIcon: IconButton( @@ -316,12 +307,8 @@ class _PrescriptionFormWidgetState extends State { Icons.calendar_today, color: Colors.black, ), - onPressed: () {}, ), - dropDownText: selectedDate != null ? "${AppDateUtils.convertStringToDateFormat(selectedDate.toString(), "yyyy-MM-dd")}" : "", - onClick: () {}, - onChanged: (value) {}, - onFieldSubmitted: () {}, + dropDownText: selectedDate != null ? "${AppDateUtils.convertStringToDateFormat(selectedDate.toString(), "yyyy-MM-dd")}" : null, enabled: false, ), ), @@ -329,16 +316,16 @@ class _PrescriptionFormWidgetState extends State { SizedBox(height: spaceBetweenTextFields), PrescriptionTextFiled( element: duration, - elementError: durationError!, + elementError: durationError, hintText: TranslationBase.of(context).duration, - elementList: widget.medicineViewModel!.medicationDurationList, + elementList: widget.medicineViewModel.medicationDurationList, keyName: 'nameEn', keyId: 'id', okFunction: (selectedValue) { setState(() { duration = selectedValue; if (widget.selectedMedication != null && duration != null && frequency != null && strengthController.text != null) { - box = widget.medicineViewModel!.boxQuintity; + box = widget.medicineViewModel.boxQuintity; return; } }); @@ -352,9 +339,6 @@ class _PrescriptionFormWidgetState extends State { isTextFieldHasSuffix: false, dropDownText: uom != null ? uom : null, enabled: false, - onClick: () {}, - onChanged: (value) {}, - onFieldSubmitted: () {}, ), ), SizedBox(height: spaceBetweenTextFields), @@ -363,11 +347,8 @@ class _PrescriptionFormWidgetState extends State { child: AppTextFieldCustom( hintText: TranslationBase.of(context).boxQuantity, isTextFieldHasSuffix: false, - dropDownText: box != null ? widget.medicineViewModel!.boxQuintity.toString() : "", + dropDownText: box != null ? widget.medicineViewModel.boxQuintity.toString() : null, enabled: false, - onClick: () {}, - onChanged: (value) {}, - onFieldSubmitted: () {}, ), ), SizedBox(height: spaceBetweenTextFields), @@ -400,7 +381,7 @@ class _PrescriptionFormWidgetState extends State { ), SizedBox(height: spaceBetweenTextFields), Container( - margin: EdgeInsets.all(SizeConfig.widthMultiplier! * 5), + margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5), child: Wrap( alignment: WrapAlignment.center, children: [ @@ -409,7 +390,7 @@ class _PrescriptionFormWidgetState extends State { title: TranslationBase.of(context).addMedication, fontWeight: FontWeight.w600, onPressed: () async { - addMedicationButton(widget.medicineViewModel!); + addMedicationButton(widget.medicineViewModel); }, ), ], @@ -424,7 +405,7 @@ class _PrescriptionFormWidgetState extends State { Utils.hideKeyboard(context); DateTime selectedDate; selectedDate = DateTime.now(); - final DateTime? picked = await showDatePicker( + final DateTime picked = await showDatePicker( context: context, initialDate: selectedDate, firstDate: DateTime.now(), @@ -444,7 +425,7 @@ class _PrescriptionFormWidgetState extends State { eventAction: "Add Prescription", ); if (duration != null && doseTime != null && frequency != null && selectedDate != null && strengthController.text != "") { - if (widget.selectedMedication!.isNarcotic == true) { + if (widget.selectedMedication.isNarcotic == true) { DrAppToastMsg.showErrorToast(TranslationBase.of(context).narcoticMedicineCanOnlyBePrescribedFromVida); Navigator.pop(context); return; @@ -459,7 +440,7 @@ class _PrescriptionFormWidgetState extends State { return; } - if (formKey.currentState!.validate()) { + if (formKey.currentState.validate()) { Navigator.push( context, SlideUpPageRoute( @@ -520,6 +501,6 @@ class _PrescriptionFormWidgetState extends State { } }); } - formKey.currentState!.save(); + formKey.currentState.save(); } } diff --git a/lib/screens/prescription/old_prescriptions_page.dart b/lib/screens/prescription/old_prescriptions_page.dart index 08220f28..1b9ab395 100644 --- a/lib/screens/prescription/old_prescriptions_page.dart +++ b/lib/screens/prescription/old_prescriptions_page.dart @@ -1,6 +1,6 @@ import 'package:doctor_app_flutter/config/size_config.dart'; -import 'package:doctor_app_flutter/core/viewModel/prescription/prescription_view_model.dart'; import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/core/viewModel/prescription/prescription_view_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/prescription/prescriptions_items/prescription_items_in_patient.dart'; import 'package:doctor_app_flutter/screens/prescription/prescriptions_items/prescription_items_out_patient.dart'; @@ -15,13 +15,14 @@ import 'package:doctor_app_flutter/widgets/shared/user-guid/CusomRow.dart'; import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; + import '../../utils/utils.dart'; import '../../widgets/shared/errors/error_message.dart'; class OldPrescriptionsPage extends StatelessWidget { @override Widget build(BuildContext context) { - final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; + final routeArgs = ModalRoute.of(context).settings.arguments as Map; PatiantInformtion patient = routeArgs['patient']; String patientType = routeArgs['patientType']; String arrivalType = routeArgs['arrivalType']; @@ -29,15 +30,12 @@ class OldPrescriptionsPage extends StatelessWidget { bool isFromLiveCare = routeArgs['isFromLiveCare']; return BaseView( onModelReady: (model) async { - patient.admissionNo == null - ? model.getPrescriptions(patient, - patientType: patientType, isLocalBusy: false) - : model.getMedicationForInPatient(patient); + patient.admissionNo == null ? model.getPrescriptions(patient, patientType: patientType, isLocalBusy: false) : model.getMedicationForInPatient(patient); }, builder: (_, model, w) => AppScaffold( baseViewModel: model, isShowAppBar: true, - backgroundColor: Colors.grey[100]!, + backgroundColor: Colors.grey[100], appBar: PatientProfileAppBar( patient, isInpatient: isInpatient, @@ -52,20 +50,18 @@ class OldPrescriptionsPage extends StatelessWidget { SizedBox( height: 12, ), - Padding( - padding: const EdgeInsets.all(8.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - ServiceTitle( - title: TranslationBase.of(context).orders, - subTitle: TranslationBase.of(context) - .prescriptions + "(${TranslationBase.of(context) - .old }) ", - ), - ], - ), + Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + ServiceTitle( + title: TranslationBase.of(context).orders, + subTitle: TranslationBase.of(context).prescriptions + "(${TranslationBase.of(context).old}) ", + ), + ], ), + ), ListView.builder( physics: BouncingScrollPhysics(), itemCount: model.prescriptionsList.length, @@ -76,8 +72,7 @@ class OldPrescriptionsPage extends StatelessWidget { context, FadePage( page: PrescriptionItemsPage( - prescriptions: model - .prescriptionsList[index], + prescriptions: model.prescriptionsList[index], patient: patient, arrivalType: arrivalType, ), @@ -86,143 +81,109 @@ class OldPrescriptionsPage extends StatelessWidget { child: Column( children: [ DoctorCard( - doctorName: - Utils.convertToTitleCase(model - .prescriptionsList[index] - .doctorName!), - profileUrl: model - .prescriptionsList[index] - .doctorImageURL!, - branch: model - .prescriptionsList[index].name!, - clinic: model.prescriptionsList[index] - .clinicDescription!, + doctorName: Utils.convertToTitleCase(model.prescriptionsList[index].doctorName), + profileUrl: model.prescriptionsList[index].doctorImageURL, + branch: model.prescriptionsList[index].name, + clinic: model.prescriptionsList[index].clinicDescription, isPrescriptions: true, - appointmentDate: AppDateUtils - .getDateTimeFromServerFormat( - model.prescriptionsList[index] - .appointmentDate!, + appointmentDate: AppDateUtils.getDateTimeFromServerFormat( + model.prescriptionsList[index].appointmentDate, ), ), ], )); }), - if (model.prescriptionsList.isEmpty && - patient.patientStatusType != 43) + if (model.prescriptionsList.isEmpty && patient.patientStatusType != 43) Center( child: ErrorMessage( - error: TranslationBase.of(context) - .noPrescriptionsFound, + error: TranslationBase.of(context).noPrescriptionsFound, )) ], ), ), ) : Center( - child: FractionallySizedBox( - widthFactor: 0.9, - child: SingleChildScrollView( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - SizedBox( - height: 12, - ), - ServiceTitle( - title: TranslationBase.of(context).orders, - subTitle: TranslationBase.of(context) - .prescriptions + "(${TranslationBase.of(context) - .old }) ", - ), - model.medicationForInPatient.length == 0? - Center( - child: ErrorMessage( - error: TranslationBase.of(context) - .noPrescriptionsFound, - )): ListView.builder( - scrollDirection: Axis.vertical, - physics: NeverScrollableScrollPhysics(), - shrinkWrap: true, - itemCount: model.medicationForInPatient.length, - itemBuilder: (context, index) { - //model.medicationForInPatient.length, - return InkWell( - child: CardWithBgWidget( - bgColor: Colors.transparent, - widget: Column( - children: [ - CustomRow( - label: "", - value: Utils.convertToTitleCase(model - .medicationForInPatient[index] - .pHRItemDescription!), - valueSize: SizeConfig - .getTextMultiplierBasedOnWidth() * - 3.5, - ), - SizedBox( - height: 10, - ), - CustomRow( - label: "Doctor Name :", - value: Utils.convertToTitleCase(model - .medicationForInPatient[index] - .doctorName - .toString()), - ), - CustomRow( - label: "Status :", - value: Utils.convertToTitleCase(model - .medicationForInPatient[index] - .statusDescription - .toString()), - ), - CustomRow( - label: "dose :", - value: Utils.convertToTitleCase(model - .medicationForInPatient[index] - .dose - .toString()), - ), CustomRow( - label: "comments :", - value: Utils.convertToTitleCase(model - .medicationForInPatient[index] - .comments - .toString()), - ), - - ], - ), - ), - onTap: () => Navigator.push( - context, - FadePage( - page: PrescriptionItemsInPatientPage( - prescriptionIndex: index, - prescriptions: - model.medicationForInPatient[index], - patient: patient, - patientType: patientType, - arrivalType: arrivalType, - startOn: AppDateUtils - .getDateTimeFromServerFormat( - model.medicationForInPatient[index] - .startDatetime!, + child: FractionallySizedBox( + widthFactor: 0.9, + child: SingleChildScrollView( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 12, + ), + ServiceTitle( + title: TranslationBase.of(context).orders, + subTitle: TranslationBase.of(context).prescriptions + "(${TranslationBase.of(context).old}) ", + ), + model.medicationForInPatient.length == 0 + ? Center( + child: ErrorMessage( + error: TranslationBase.of(context).noPrescriptionsFound, + )) + : ListView.builder( + scrollDirection: Axis.vertical, + physics: NeverScrollableScrollPhysics(), + shrinkWrap: true, + itemCount: model.medicationForInPatient.length, + itemBuilder: (context, index) { + //model.medicationForInPatient.length, + return InkWell( + child: CardWithBgWidget( + bgColor: Colors.transparent, + widget: Column( + children: [ + CustomRow( + label: "", + value: Utils.convertToTitleCase(model.medicationForInPatient[index].pHRItemDescription), + valueSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.5, + ), + SizedBox( + height: 10, + ), + CustomRow( + label: "Doctor Name :", + value: Utils.convertToTitleCase(model.medicationForInPatient[index].doctorName.toString()), + ), + CustomRow( + label: "Status :", + value: Utils.convertToTitleCase(model.medicationForInPatient[index].statusDescription.toString()), + ), + CustomRow( + label: "dose :", + value: Utils.convertToTitleCase(model.medicationForInPatient[index].dose.toString()), + ), + CustomRow( + label: "comments :", + value: Utils.convertToTitleCase(model.medicationForInPatient[index].comments.toString()), + ), + ], + ), ), - stopOn: AppDateUtils - .getDateTimeFromServerFormat( - model.medicationForInPatient[index] - .stopDatetime!, + onTap: () => Navigator.push( + context, + FadePage( + page: PrescriptionItemsInPatientPage( + prescriptionIndex: index, + prescriptions: model.medicationForInPatient[index], + patient: patient, + patientType: patientType, + arrivalType: arrivalType, + startOn: AppDateUtils.getDateTimeFromServerFormat( + model.medicationForInPatient[index].startDatetime, + ), + stopOn: AppDateUtils.getDateTimeFromServerFormat( + model.medicationForInPatient[index].stopDatetime, + ), + ), + ), ), - ), - ), - ), - ); - }), - ], + ); + }), + ], + ), ), ), - ), - ))); + ))); } } diff --git a/lib/screens/prescription/prescription_checkout_screen.dart b/lib/screens/prescription/prescription_checkout_screen.dart index 6537e08a..b336bde3 100644 --- a/lib/screens/prescription/prescription_checkout_screen.dart +++ b/lib/screens/prescription/prescription_checkout_screen.dart @@ -4,26 +4,26 @@ import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/enum/view_state.dart'; import 'package:doctor_app_flutter/core/model/Prescriptions/post_prescrition_req_model.dart'; import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_model.dart'; -import 'package:doctor_app_flutter/core/model/SOAP/Assessment/get_assessment_req_model.dart'; -import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/core/model/procedure/procedure_template_details_model.dart'; import 'package:doctor_app_flutter/core/model/search_drug/get_medication_response_model.dart'; import 'package:doctor_app_flutter/core/provider/robot_provider.dart'; import 'package:doctor_app_flutter/core/viewModel/medicine_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/prescription/prescription_view_model.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; +import 'package:doctor_app_flutter/core/model/SOAP/Assessment/get_assessment_req_model.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/prescription/prescription_text_filed.dart'; import 'package:doctor_app_flutter/utils/date-utils.dart'; import 'package:doctor_app_flutter/utils/dr_app_toast_msg.dart'; -import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; import 'package:doctor_app_flutter/utils/utils.dart'; +import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; +import 'package:doctor_app_flutter/widgets/shared/text_fields/TextFields.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart'; import 'package:doctor_app_flutter/widgets/shared/speech-text-popup.dart'; -import 'package:doctor_app_flutter/widgets/shared/text_fields/TextFields.dart'; import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart'; import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; @@ -32,12 +32,12 @@ import 'package:speech_to_text/speech_recognition_error.dart'; import 'package:speech_to_text/speech_to_text.dart' as stt; class PrescriptionCheckOutScreen extends StatefulWidget { - final PrescriptionViewModel? model; - final PatiantInformtion? patient; - final List? prescriptionList; - final ProcedureTempleteDetailsModel? groupProcedures; + final PrescriptionViewModel model; + final PatiantInformtion patient; + final List prescriptionList; + final ProcedureTempleteDetailsModel groupProcedures; - const PrescriptionCheckOutScreen({Key? key, this.model, this.patient, this.prescriptionList, this.groupProcedures}) : super(key: key); + const PrescriptionCheckOutScreen({Key key, this.model, this.patient, this.prescriptionList, this.groupProcedures}) : super(key: key); @override _PrescriptionCheckOutScreenState createState() => _PrescriptionCheckOutScreenState(); @@ -45,44 +45,44 @@ class PrescriptionCheckOutScreen extends StatefulWidget { class _PrescriptionCheckOutScreenState extends State { postPrescription( - {String? duration, - String? doseTimeIn, - String? dose, - String? drugId, - String? strength, - String? route, - String? frequency, - String? indication, - String? instruction, - PrescriptionViewModel? model, - DateTime? doseTime, - String? doseUnit, - String? icdCode, - PatiantInformtion? patient, - String? patientType}) async { + {String duration, + String doseTimeIn, + String dose, + String drugId, + String strength, + String route, + String frequency, + String indication, + String instruction, + PrescriptionViewModel model, + DateTime doseTime, + String doseUnit, + String icdCode, + PatiantInformtion patient, + String patientType}) async { PostPrescriptionReqModel postProcedureReqModel = new PostPrescriptionReqModel(); - List prescriptionList = []; + List prescriptionList = List(); - postProcedureReqModel.appointmentNo = patient!.appointmentNo; + postProcedureReqModel.appointmentNo = patient.appointmentNo; postProcedureReqModel.clinicID = patient.clinicId; postProcedureReqModel.episodeID = patient.episodeNo; postProcedureReqModel.patientMRN = patient.patientMRN; prescriptionList.add(PrescriptionRequestModel( covered: true, - dose: double.parse(dose!), - itemId: drugId!.isEmpty ? 1 : int.parse(drugId), - doseUnitId: int.parse(doseUnit!), - route: route!.isEmpty ? 1 : int.parse(route), - frequency: frequency!.isEmpty ? 1 : int.parse(frequency), + dose: double.parse(dose), + itemId: drugId.isEmpty ? 1 : int.parse(drugId), + doseUnitId: int.parse(doseUnit), + route: route.isEmpty ? 1 : int.parse(route), + frequency: frequency.isEmpty ? 1 : int.parse(frequency), remarks: instruction, approvalRequired: true, icdcode10Id: icdCode.toString(), - doseTime: doseTimeIn!.isEmpty ? 1 : int.parse(doseTimeIn), - duration: duration!.isEmpty ? 1 : int.parse(duration), - doseStartDate: doseTime!.toIso8601String())); + doseTime: doseTimeIn.isEmpty ? 1 : int.parse(doseTimeIn), + duration: duration.isEmpty ? 1 : int.parse(duration), + doseStartDate: doseTime.toIso8601String())); postProcedureReqModel.prescriptionRequestModel = prescriptionList; - await model!.postPrescription(postProcedureReqModel, patient.patientMRN!); + await model.postPrescription(postProcedureReqModel, patient.patientMRN); if (model.state == ViewState.ErrorLocal) { Utils.showErrorToast(model.error); @@ -92,14 +92,14 @@ class _PrescriptionCheckOutScreenState extends State } } - String? routeError; - String? frequencyError; - String? doseTimeError; - String? durationError; - String? unitError; - String? strengthError; + String routeError; + String frequencyError; + String doseTimeError; + String durationError; + String unitError; + String strengthError; - int? selectedType; + int selectedType; TextEditingController strengthController = TextEditingController(); TextEditingController indicationController = TextEditingController(); @@ -109,10 +109,10 @@ class _PrescriptionCheckOutScreenState extends State bool visibilitySearch = true; final myController = TextEditingController(); - DateTime? selectedDate; - int? strengthChar; - GetMedicationResponseModel _selectedMedication = GetMedicationResponseModel(); - GlobalKey> key = GlobalKey>(); + DateTime selectedDate; + int strengthChar; + GetMedicationResponseModel _selectedMedication; + GlobalKey key = new GlobalKey>(); TextEditingController drugIdController = TextEditingController(); TextEditingController doseController = TextEditingController(); @@ -210,13 +210,13 @@ class _PrescriptionCheckOutScreenState extends State return BaseView( onModelReady: (model) async { // TODO Elham* move this logic to the model - model.getItem(itemID: int.parse(widget.groupProcedures!.aliasN!.replaceAll("item code ;", ""))); + model.getItem(itemID: int.parse(widget.groupProcedures.aliasN.replaceAll("item code ;", ""))); x = model.patientAssessmentList.map((element) { return element.icdCode10ID; }); GetAssessmentReqModel getAssessmentReqModel = - GetAssessmentReqModel(patientMRN: widget.patient!.patientMRN, episodeID: widget.patient!.episodeNo.toString(), editedBy: '', doctorID: '', appointmentNo: widget.patient!.appointmentNo); + GetAssessmentReqModel(patientMRN: widget.patient.patientMRN, episodeID: widget.patient.episodeNo.toString(), editedBy: '', doctorID: '', appointmentNo: widget.patient.appointmentNo); if (model.medicationStrengthList.length == 0) { await model.getMedicationStrength(); } @@ -231,7 +231,7 @@ class _PrescriptionCheckOutScreenState extends State builder: ( BuildContext context, MedicineViewModel model, - Widget? child, + Widget child, ) => AppScaffold( backgroundColor: Color(0xffF8F8F8).withOpacity(0.9), @@ -305,7 +305,7 @@ class _PrescriptionCheckOutScreenState extends State child: Column( children: [ AppText( - widget.groupProcedures!.procedureName ?? "", + widget.groupProcedures.procedureName ?? "", bold: true, ), Container( @@ -320,7 +320,7 @@ class _PrescriptionCheckOutScreenState extends State value: 1, groupValue: selectedType, onChanged: (value) { - setSelectedType(value!); + setSelectedType(value); }, ), Text(TranslationBase.of(context).regular), @@ -336,17 +336,16 @@ class _PrescriptionCheckOutScreenState extends State width: MediaQuery.of(context).size.width * 0.35, child: AppTextFieldCustom( height: 40, - validationError: strengthError!, + validationError: strengthError, hintText: TranslationBase.of(context).strength, isTextFieldHasSuffix: false, enabled: true, controller: strengthController, - onChanged: (value) { - if (value != null) - setState(() { - strengthChar = value.length; - }); - if (strengthChar! >= 5) { + onChanged: (String value) { + setState(() { + strengthChar = value.length; + }); + if (strengthChar >= 5) { DrAppToastMsg.showErrorToast( TranslationBase.of(context).only5DigitsAllowedForStrength, ); @@ -355,8 +354,6 @@ class _PrescriptionCheckOutScreenState extends State inputType: TextInputType.numberWithOptions( decimal: true, ), - onClick: () {}, - onFieldSubmitted: () {}, ), ), SizedBox( @@ -365,7 +362,7 @@ class _PrescriptionCheckOutScreenState extends State PrescriptionTextFiled( width: MediaQuery.of(context).size.width * 0.560, element: units, - elementError: unitError!, + elementError: unitError, keyName: 'description', keyId: 'parameterCode', hintText: 'Select', @@ -384,7 +381,7 @@ class _PrescriptionCheckOutScreenState extends State PrescriptionTextFiled( elementList: model.itemMedicineListRoute, element: route, - elementError: routeError!, + elementError: routeError, keyId: 'parameterCode', keyName: 'description', okFunction: (selectedValue) { @@ -398,7 +395,7 @@ class _PrescriptionCheckOutScreenState extends State SizedBox(height: spaceBetweenTextFields), PrescriptionTextFiled( hintText: TranslationBase.of(context).frequency, - elementError: frequencyError!, + elementError: frequencyError, element: frequency, elementList: model.itemMedicineList, keyId: 'parameterCode', @@ -418,7 +415,7 @@ class _PrescriptionCheckOutScreenState extends State SizedBox(height: spaceBetweenTextFields), PrescriptionTextFiled( hintText: TranslationBase.of(context).doseTime, - elementError: doseTimeError!, + elementError: doseTimeError, element: doseTime, elementList: model.medicationDoseTimeList, keyId: 'id', @@ -462,10 +459,10 @@ class _PrescriptionCheckOutScreenState extends State height: screenSize.height * 0.070, color: Colors.white, child: InkWell( - onTap: () => selectDate(context, widget.model!), + onTap: () => selectDate(context, widget.model), child: TextField( - decoration: textFieldSelectorDecoration( - TranslationBase.of(context).date, selectedDate != null ? "${AppDateUtils.convertStringToDateFormat(selectedDate.toString(), "yyyy-MM-dd")}" : "", true, + decoration: textFieldSelectorDecoration(TranslationBase.of(context).date, + selectedDate != null ? "${AppDateUtils.convertStringToDateFormat(selectedDate.toString(), "yyyy-MM-dd")}" : null, true, suffixIcon: Icon( Icons.calendar_today, color: Colors.black, @@ -477,7 +474,7 @@ class _PrescriptionCheckOutScreenState extends State SizedBox(height: spaceBetweenTextFields), PrescriptionTextFiled( element: duration, - elementError: durationError!, + elementError: durationError, hintText: TranslationBase.of(context).duration, elementList: model.medicationDurationList, keyName: 'nameEn', @@ -532,7 +529,7 @@ class _PrescriptionCheckOutScreenState extends State ), SizedBox(height: spaceBetweenTextFields), Container( - margin: EdgeInsets.all(SizeConfig.widthMultiplier! * 5), + margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5), child: Wrap( alignment: WrapAlignment.center, children: [ @@ -560,12 +557,12 @@ class _PrescriptionCheckOutScreenState extends State ); return; } - if (formKey.currentState!.validate()) { + if (formKey.currentState.validate()) { Navigator.pop(context); { postPrescription( icdCode: model.patientAssessmentList.isNotEmpty - ? model.patientAssessmentList[0].icdCode10ID!.isEmpty + ? model.patientAssessmentList[0].icdCode10ID.isEmpty ? "test" : model.patientAssessmentList[0].icdCode10ID.toString() : "test", @@ -578,7 +575,7 @@ class _PrescriptionCheckOutScreenState extends State duration: duration['id'].toString(), frequency: model.itemMedicineList.length == 1 ? model.itemMedicineList[0]['parameterCode'].toString() : frequency['parameterCode'].toString(), route: model.itemMedicineListRoute.length == 1 ? model.itemMedicineListRoute[0]['parameterCode'].toString() : route['parameterCode'].toString(), - drugId: (widget.groupProcedures!.aliasN!.replaceAll("item code ;", "")), + drugId: (widget.groupProcedures.aliasN.replaceAll("item code ;", "")), strength: strengthController.text, indication: indicationController.text, instruction: instructionController.text, @@ -621,7 +618,7 @@ class _PrescriptionCheckOutScreenState extends State }); } - formKey.currentState!.save(); + formKey.currentState.save(); }, ), ], @@ -650,7 +647,7 @@ class _PrescriptionCheckOutScreenState extends State Utils.hideKeyboard(context); DateTime selectedDate; selectedDate = DateTime.now(); - final DateTime? picked = await showDatePicker( + final DateTime picked = await showDatePicker( context: context, initialDate: selectedDate, firstDate: DateTime.now(), @@ -666,7 +663,7 @@ class _PrescriptionCheckOutScreenState extends State /// TODO Elham* Use it from the textfeild utils - InputDecoration textFieldSelectorDecoration(String hintText, String selectedText, bool isDropDown, {Icon? suffixIcon}) { + InputDecoration textFieldSelectorDecoration(String hintText, String selectedText, bool isDropDown, {Icon suffixIcon}) { return InputDecoration( focusedBorder: OutlineInputBorder( borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), diff --git a/lib/screens/procedures/add_procedure_page.dart b/lib/screens/procedures/add_procedure_page.dart index b5940b0d..efb1185f 100644 --- a/lib/screens/procedures/add_procedure_page.dart +++ b/lib/screens/procedures/add_procedure_page.dart @@ -17,33 +17,36 @@ import 'package:flutter/material.dart'; import 'entity_list_checkbox_search_widget.dart'; class AddProcedurePage extends StatefulWidget { - final ProcedureViewModel? model; - final PatiantInformtion? patient; + final ProcedureViewModel model; + final PatiantInformtion patient; final ProcedureType procedureType; - const AddProcedurePage({Key? key, this.model, this.patient, required this.procedureType}) : super(key: key); + const AddProcedurePage( + {Key key, this.model, this.patient, @required this.procedureType}) + : super(key: key); @override - _AddProcedurePageState createState() => _AddProcedurePageState(patient: patient, model: model, procedureType: this.procedureType); + _AddProcedurePageState createState() => _AddProcedurePageState( + patient: patient, model: model, procedureType: this.procedureType); } class _AddProcedurePageState extends State { - int? selectedType; - ProcedureViewModel? model; - PatiantInformtion? patient; - ProcedureType? procedureType; + String selectedType; + ProcedureViewModel model; + PatiantInformtion patient; + ProcedureType procedureType; _AddProcedurePageState({this.patient, this.model, this.procedureType}); TextEditingController procedureController = TextEditingController(); TextEditingController remarksController = TextEditingController(); - List entityList = []; - List entityListProcedure = []; + List entityList = List(); + List entityListProcedure = List(); TextEditingController procedureName = TextEditingController(); dynamic selectedCategory; - setSelectedType(int val) { + setSelectedType(String val) { setState(() { selectedType = val; }); @@ -53,9 +56,13 @@ class _AddProcedurePageState extends State { Widget build(BuildContext context) { return BaseView( onModelReady: (model) { - model.getProcedureCategory(categoryName: procedureType!.getCategoryName(), categoryID: procedureType!.getCategoryId(), patientId: patient!.patientId); + model.getProcedureCategory( + categoryName: procedureType.getCategoryName(), + categoryID: procedureType.getCategoryId(), + patientId: patient.patientId); }, - builder: (BuildContext context, ProcedureViewModel model, Widget? child) => AppScaffold( + builder: (BuildContext context, ProcedureViewModel model, Widget child) => + AppScaffold( isShowAppBar: false, body: SingleChildScrollView( child: FractionallySizedBox( @@ -78,50 +85,62 @@ class _AddProcedurePageState extends State { Column( children: [ Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, + mainAxisAlignment: + MainAxisAlignment.spaceBetween, children: [ AppText( - TranslationBase.of(context).pleaseEnterProcedure, + TranslationBase.of(context) + .pleaseEnterProcedure, fontWeight: FontWeight.w700, fontSize: 20, ), ], ), SizedBox( - height: MediaQuery.of(context).size.height * 0.02, + height: + MediaQuery.of(context).size.height * 0.02, ), Row( children: [ Container( - width: MediaQuery.of(context).size.width * 0.79, + width: MediaQuery.of(context).size.width * + 0.79, child: AppTextFieldCustom( - hintText: TranslationBase.of(context).searchProcedureHere, + hintText: TranslationBase.of(context) + .searchProcedureHere, isTextFieldHasSuffix: false, maxLines: 1, minLines: 1, hasBorder: true, controller: procedureName, - onClick: () {}, - onChanged: (value) {}, - onFieldSubmitted: () {}, ), ), SizedBox( - width: MediaQuery.of(context).size.width * 0.02, + width: MediaQuery.of(context).size.width * + 0.02, ), Expanded( child: InkWell( onTap: () async { - if (procedureName.text.isNotEmpty && procedureName.text.length >= 3) { - GifLoaderDialogUtils.showMyDialog(context); - await model.getProcedureCategory(patientId: patient!.patientId, categoryName: procedureName.text, isLocalBusy: true); - if (model.state == ViewState.ErrorLocal) { - DrAppToastMsg.showErrorToast(model.error); + if (procedureName.text.isNotEmpty && + procedureName.text.length >= 3) { + GifLoaderDialogUtils.showMyDialog( + context); + await model.getProcedureCategory( + patientId: patient.patientId, + categoryName: procedureName.text, + isLocalBusy: true); + if (model.state == + ViewState.ErrorLocal) { + DrAppToastMsg.showErrorToast( + model.error); } - GifLoaderDialogUtils.hideDialog(context); + GifLoaderDialogUtils.hideDialog( + context); } else { DrAppToastMsg.showErrorToast( - TranslationBase.of(context).atLeastThreeCharacters, + TranslationBase.of(context) + .atLeastThreeCharacters, ); } }, @@ -135,12 +154,15 @@ class _AddProcedurePageState extends State { ), ], ), - if ((procedureType == ProcedureType.PROCEDURE ? procedureName.text.isNotEmpty : true) && model.categoriesList.length != 0) + if ((procedureType == ProcedureType.PROCEDURE + ? procedureName.text.isNotEmpty + : true) && + model.categoriesList.length != 0) NetworkBaseView( baseViewModel: model, child: EntityListCheckboxSearchWidget( - model: widget.model!, - masterList: model.categoriesList[0].entityList!, + model: widget.model, + masterList: model.categoriesList[0].entityList, removeProcedure: (item) { setState(() { entityList.remove(item); @@ -152,7 +174,8 @@ class _AddProcedurePageState extends State { }); }, addSelectedHistories: () {}, - isEntityListSelected: (master) => widget.model!.isEntityListSelected(master, entityList), + isEntityListSelected: (master) => widget.model + .isEntityListSelected(master, entityList), )), SizedBox( height: 10, @@ -172,19 +195,20 @@ class _AddProcedurePageState extends State { height: 0, ) : CustomBottomSheetContainer( - label: procedureType!.getAddButtonTitle(context), + label: procedureType.getAddButtonTitle(context), onTap: () async { { GifLoaderDialogUtils.showMyDialog(context); if (entityList.isEmpty == true) { DrAppToastMsg.showErrorToast( - TranslationBase.of(context).fillTheMandatoryProcedureDetails, + TranslationBase.of(context) + .fillTheMandatoryProcedureDetails, ); GifLoaderDialogUtils.hideDialog(context); return; } GifLoaderDialogUtils.showMyDialog(context); - await widget.model!.preparePostProcedure( + await widget.model.preparePostProcedure( orderType: selectedType.toString(), entityList: entityList, patient: patient, diff --git a/lib/screens/procedures/entity_list_checkbox_search_widget.dart b/lib/screens/procedures/entity_list_checkbox_search_widget.dart index c68389c5..6e55c77e 100644 --- a/lib/screens/procedures/entity_list_checkbox_search_widget.dart +++ b/lib/screens/procedures/entity_list_checkbox_search_widget.dart @@ -13,15 +13,15 @@ import 'package:flutter/material.dart'; import '../../config/config.dart'; class EntityListCheckboxSearchWidget extends StatefulWidget { - final ProcedureViewModel? model; - final Function? addSelectedHistories; - final Function(EntityList)? removeProcedure; - final Function(EntityList)? addProcedure; - final bool Function(EntityList)? isEntityListSelected; - final List? masterList; + final ProcedureViewModel model; + final Function addSelectedHistories; + final Function(EntityList) removeProcedure; + final Function(EntityList) addProcedure; + final bool Function(EntityList) isEntityListSelected; + final List masterList; EntityListCheckboxSearchWidget({ - Key? key, + Key key, this.model, this.addSelectedHistories, this.removeProcedure, @@ -37,23 +37,23 @@ class EntityListCheckboxSearchWidget extends StatefulWidget { class _EntityListCheckboxSearchWidgetState extends State { - int selectedType = 0; - int typeUrgent = 0; - int typeRegular = 0; + String selectedType = '0'; + int typeUrgent; + int typeRegular; - setSelectedType(int val) { + setSelectedType(String val) { setState(() { selectedType = val; }); } - List items = []; - List remarksList = []; - List typeList = []; + List items = List(); + List remarksList = List(); + List typeList = List(); @override void initState() { - items.addAll(widget.masterList!); + items.addAll(widget.masterList); super.initState(); } @@ -65,7 +65,7 @@ class _EntityListCheckboxSearchWidgetState child: Column( children: [ NetworkBaseView( - baseViewModel: widget.model!, + baseViewModel: widget.model, child: Container( height: MediaQuery.of(context).size.height * 0.75, child: Center( @@ -81,8 +81,8 @@ class _EntityListCheckboxSearchWidgetState suffixIcon: EvaIcons.search, suffixIconColor: Color(0xff2B353E), onChanged: (value) { - widget.model!.filterSearchResults( - value, widget.masterList!, items); + widget.model.filterSearchResults( + value, widget.masterList, items); }, hasBorder: false, ), @@ -98,17 +98,17 @@ class _EntityListCheckboxSearchWidgetState title: Row( children: [ Checkbox( - value: widget.isEntityListSelected!( + value: widget.isEntityListSelected( historyInfo), activeColor: Color(0xffD02127), - onChanged: (bool? newValue) { + onChanged: (bool newValue) { setState(() { - if (widget.isEntityListSelected!( + if (widget.isEntityListSelected( historyInfo)) { - widget.removeProcedure!( + widget.removeProcedure( historyInfo); } else { - widget.addProcedure!( + widget.addProcedure( historyInfo); } }); @@ -118,7 +118,7 @@ class _EntityListCheckboxSearchWidgetState padding: const EdgeInsets.symmetric( horizontal: 10, vertical: 0), child: AppText( - Utils.convertToTitleCase( historyInfo.procedureName!), + Utils.convertToTitleCase( historyInfo.procedureName), fontSize: 14.0, variant: "bodyText", bold: true, @@ -158,11 +158,11 @@ class _EntityListCheckboxSearchWidgetState Radio( activeColor: Color(0xFFD02127), - value: 0, - groupValue: selectedType, + value: '0', + groupValue: historyInfo.type, onChanged: (value) { historyInfo.type = - setSelectedType(value!) + setSelectedType(value) .toString(); historyInfo.type = @@ -177,11 +177,11 @@ class _EntityListCheckboxSearchWidgetState Radio( activeColor: Color(0xFFD02127), - groupValue: selectedType, - value: 1, + groupValue: historyInfo.type, + value: '1', onChanged: (value) { historyInfo.type = - setSelectedType(value!) + setSelectedType(value) .toString(); historyInfo.type = @@ -216,7 +216,7 @@ class _EntityListCheckboxSearchWidgetState minLines: 3, maxLines: 5, borderWidth: 0.5, - borderColor: Colors.grey[500]!, + borderColor: Colors.grey[500], ), ), DividerWithSpacesAround(), diff --git a/lib/screens/reschedule_leaves/reschedule_leave.dart b/lib/screens/reschedule_leaves/reschedule_leave.dart index c4e1925c..35de7fe7 100644 --- a/lib/screens/reschedule_leaves/reschedule_leave.dart +++ b/lib/screens/reschedule_leaves/reschedule_leave.dart @@ -1,3 +1,4 @@ +import 'package:date_time_picker/date_time_picker.dart'; import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; import 'package:doctor_app_flutter/config/size_config.dart'; @@ -38,8 +39,8 @@ class _RescheduleLeaveScreen extends State { DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); TextEditingController _toDateController = new TextEditingController(); TextEditingController _toDateController2 = new TextEditingController(); - ProjectViewModel? projectsProvider; - SickLeaveViewModel? sickLeaveViewModel; + ProjectViewModel projectsProvider; + SickLeaveViewModel sickLeaveViewModel; Map profile = {}; var offTime = '1'; var date; @@ -48,19 +49,15 @@ class _RescheduleLeaveScreen extends State { dynamic fromDate; dynamic toDate; var clinicID; - String? fromTime; - String? toTime; + String fromTime; + String toTime; TextEditingController _controller4 = new TextEditingController(); TextEditingController _controller5 = new TextEditingController(); void _presentDatePicker(id) { var date = new DateTime.now(); - var initialDate = id == 'fromDate' - ? new DateTime(date.year, date.month, date.day + 15) - : new DateTime(fromDate.year, fromDate.month, fromDate.day); - var firstDate = id == 'fromDate' - ? new DateTime(date.year, date.month, date.day + 15) - : new DateTime(fromDate.year, fromDate.month, fromDate.day); + var initialDate = id == 'fromDate' ? new DateTime(date.year, date.month, date.day + 15) : new DateTime(fromDate.year, fromDate.month, fromDate.day); + var firstDate = id == 'fromDate' ? new DateTime(date.year, date.month, date.day + 15) : new DateTime(fromDate.year, fromDate.month, fromDate.day); showDatePicker( context: context, initialDate: initialDate, @@ -93,9 +90,7 @@ class _RescheduleLeaveScreen extends State { @override Widget build(BuildContext context) { projectsProvider = Provider.of(context); - offTime = widget.updateData != null - ? widget.updateData.requisitionType.toString() - : offTime; + offTime = widget.updateData != null ? widget.updateData.requisitionType.toString() : offTime; return BaseView( onModelReady: (model) => model.getClinicsList(), builder: (_, model, w) => BaseView( @@ -125,23 +120,13 @@ class _RescheduleLeaveScreen extends State { children: [ Container( margin: EdgeInsets.all(8), - decoration: BoxDecoration( - borderRadius: BorderRadius.all( - Radius.circular(6.0)), - border: Border.all( - width: 1.0, - color: HexColor("#CCCCCC"))), + decoration: BoxDecoration(borderRadius: BorderRadius.all(Radius.circular(6.0)), border: Border.all(width: 1.0, color: HexColor("#CCCCCC"))), width: double.infinity, child: Padding( padding: EdgeInsets.only( - top: SizeConfig.widthMultiplier! * 0.9, - bottom: - SizeConfig.widthMultiplier! * 0.9, - right: SizeConfig.widthMultiplier! * 3, - left: SizeConfig.widthMultiplier! * 3), + top: SizeConfig.widthMultiplier * 0.9, bottom: SizeConfig.widthMultiplier * 0.9, right: SizeConfig.widthMultiplier * 3, left: SizeConfig.widthMultiplier * 3), child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, children: [ Row( mainAxisSize: MainAxisSize.max, @@ -149,35 +134,22 @@ class _RescheduleLeaveScreen extends State { model2.allOffTime.length > 0 ? Expanded( // add Expanded to have your dropdown button fill remaining space - child: - DropdownButtonHideUnderline( - child: - DropdownButton( + child: DropdownButtonHideUnderline( + child: DropdownButton( // focusColor: Colors.grey, isExpanded: true, - value: offTime == null - ? model2.allOffTime[0] - ['code'] - : offTime, + value: offTime == null ? model2.allOffTime[0]['code'] : offTime, iconSize: 40, elevation: 16, - selectedItemBuilder: - (BuildContext - context) { - return model2.allOffTime - .map((item) { + selectedItemBuilder: (BuildContext context) { + return model2.allOffTime.map((item) { return Row( - mainAxisSize: - MainAxisSize - .max, + mainAxisSize: MainAxisSize.max, children: [ AppText( - item[ - 'description'], + item['description'], - fontSize: SizeConfig - .textMultiplier! * - 2.1, + fontSize: SizeConfig.textMultiplier * 2.1, // color: // Colors.grey, ), @@ -187,35 +159,25 @@ class _RescheduleLeaveScreen extends State { }, onChanged: (newValue) { setState(() { - offTime = newValue - as String; + offTime = newValue; }); if (offTime == '1') { model2.getReasons(18); - } else if (offTime == - '2') { + } else if (offTime == '2') { model2.getReasons(19); - } else if (offTime == - '3' || - offTime == '5') { - model2 - .getReasons(102); + } else if (offTime == '3' || offTime == '5') { + model2.getReasons(102); setState(() { - offTime = newValue - as String; + offTime = newValue; }); } }, - items: model2.allOffTime - .map((item) { - return DropdownMenuItem< - String>( - value: item['code'] - .toString(), + items: model2.allOffTime.map((item) { + return DropdownMenuItem( + value: item['code'].toString(), child: Text( item['description'], - textAlign: - TextAlign.end, + textAlign: TextAlign.end, ), ); }).toList(), @@ -232,40 +194,23 @@ class _RescheduleLeaveScreen extends State { children: [ Container( margin: EdgeInsets.all(8), - decoration: BoxDecoration( - borderRadius: BorderRadius.all( - Radius.circular(6.0)), - border: Border.all( - width: 1.0, - color: - HexColor("#CCCCCC"))), + decoration: BoxDecoration(borderRadius: BorderRadius.all(Radius.circular(6.0)), border: Border.all(width: 1.0, color: HexColor("#CCCCCC"))), padding: EdgeInsets.all(5), child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, children: [ AppTextFormField( - hintText: TranslationBase.of( - context) - .fromDate, + hintText: TranslationBase.of(context).fromDate, borderColor: Colors.white, - prefix: IconButton( - icon: Icon( - Icons.calendar_today), - onPressed: () {}, - ), - textInputType: - TextInputType.number, + prefix: IconButton(icon: Icon(Icons.calendar_today)), + textInputType: TextInputType.number, controller: _toDateController, onTap: () { - _presentDatePicker( - 'fromDate'); + _presentDatePicker('fromDate'); }, inputFormatter: ONLY_DATE, - onChanged: (val) => - fromDate = val, - onSaved: (val) => - fromDate = val, + onChanged: (val) => fromDate = val, + onSaved: (val) => fromDate = val, ) ], )), @@ -274,40 +219,24 @@ class _RescheduleLeaveScreen extends State { Expanded( child: Container( margin: EdgeInsets.all(8), - decoration: BoxDecoration( - borderRadius: - BorderRadius.all( - Radius.circular( - 6.0)), - border: Border.all( - width: 1.0, - color: HexColor( - "#CCCCCC"))), + decoration: BoxDecoration(borderRadius: BorderRadius.all(Radius.circular(6.0)), border: Border.all(width: 1.0, color: HexColor("#CCCCCC"))), padding: EdgeInsets.all(5), child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, children: [ - // Need Fix - // DateTimePicker( - // timeHintText: - // TranslationBase.of( - // context) - // .fromTime, - // type: DateTimePickerType - // .time, - // controller: _controller4, - // onChanged: (val) => - // fromTime = val, - // validator: (val) { - // print(val); - // // setState( - // // () => _valueToValidate4 = val); - // return null; - // }, - // onSaved: (val) => - // fromTime = val, - // ) + DateTimePicker( + timeHintText: TranslationBase.of(context).fromTime, + type: DateTimePickerType.time, + controller: _controller4, + onChanged: (val) => fromTime = val, + validator: (val) { + print(val); + // setState( + // () => _valueToValidate4 = val); + return null; + }, + onSaved: (val) => fromTime = val, + ) ], ), ), @@ -315,40 +244,24 @@ class _RescheduleLeaveScreen extends State { Expanded( child: Container( margin: EdgeInsets.all(8), - decoration: BoxDecoration( - borderRadius: - BorderRadius.all( - Radius.circular( - 6.0)), - border: Border.all( - width: 1.0, - color: HexColor( - "#CCCCCC"))), + decoration: BoxDecoration(borderRadius: BorderRadius.all(Radius.circular(6.0)), border: Border.all(width: 1.0, color: HexColor("#CCCCCC"))), padding: EdgeInsets.all(5), child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, children: [ - // Need Fix - // DateTimePicker( - // timeHintText: - // TranslationBase.of( - // context) - // .toTime, - // type: DateTimePickerType - // .time, - // controller: _controller5, - // onChanged: (val) => - // toTime = val, - // validator: (val) { - // print(val); - // // setState( - // // () => _valueToValidate4 = val); - // return null; - // }, - // onSaved: (val) => - // toTime = val, - // ) + DateTimePicker( + timeHintText: TranslationBase.of(context).toTime, + type: DateTimePickerType.time, + controller: _controller5, + onChanged: (val) => toTime = val, + validator: (val) { + print(val); + // setState( + // () => _valueToValidate4 = val); + return null; + }, + onSaved: (val) => toTime = val, + ) ], ), ), @@ -361,37 +274,20 @@ class _RescheduleLeaveScreen extends State { children: [ Container( margin: EdgeInsets.all(8), - decoration: BoxDecoration( - borderRadius: BorderRadius.all( - Radius.circular(6.0)), - border: Border.all( - width: 1.0, - color: - HexColor("#CCCCCC"))), + decoration: BoxDecoration(borderRadius: BorderRadius.all(Radius.circular(6.0)), border: Border.all(width: 1.0, color: HexColor("#CCCCCC"))), padding: EdgeInsets.all(5), child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, children: [ AppTextFormField( - hintText: - TranslationBase.of( - context) - .fromDate, + hintText: TranslationBase.of(context).fromDate, borderColor: Colors.white, - prefix: IconButton( - icon: Icon( - Icons.calendar_today), - onPressed: () {}, - ), - textInputType: - TextInputType.number, + prefix: IconButton(icon: Icon(Icons.calendar_today)), + textInputType: TextInputType.number, readOnly: true, - controller: - _toDateController, + controller: _toDateController, onTap: () { - _presentDatePicker( - 'fromDate'); + _presentDatePicker('fromDate'); }, inputFormatter: ONLY_DATE, onChanged: (value) { @@ -403,37 +299,20 @@ class _RescheduleLeaveScreen extends State { )), Container( margin: EdgeInsets.all(8), - decoration: BoxDecoration( - borderRadius: BorderRadius.all( - Radius.circular(6.0)), - border: Border.all( - width: 1.0, - color: - HexColor("#CCCCCC"))), + decoration: BoxDecoration(borderRadius: BorderRadius.all(Radius.circular(6.0)), border: Border.all(width: 1.0, color: HexColor("#CCCCCC"))), padding: EdgeInsets.all(5), child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, children: [ AppTextFormField( - hintText: - TranslationBase.of( - context) - .toDate, + hintText: TranslationBase.of(context).toDate, readOnly: true, borderColor: Colors.white, - prefix: IconButton( - icon: Icon( - Icons.calendar_today), - onPressed: () {}, - ), - textInputType: - TextInputType.number, - controller: - _toDateController2, + prefix: IconButton(icon: Icon(Icons.calendar_today)), + textInputType: TextInputType.number, + controller: _toDateController2, onTap: () { - _presentDatePicker( - 'toDate'); + _presentDatePicker('toDate'); }, inputFormatter: ONLY_DATE, onChanged: (value) { @@ -447,23 +326,13 @@ class _RescheduleLeaveScreen extends State { ), Container( margin: EdgeInsets.all(8), - decoration: BoxDecoration( - borderRadius: BorderRadius.all( - Radius.circular(6.0)), - border: Border.all( - width: 1.0, - color: HexColor("#CCCCCC"))), + decoration: BoxDecoration(borderRadius: BorderRadius.all(Radius.circular(6.0)), border: Border.all(width: 1.0, color: HexColor("#CCCCCC"))), width: double.infinity, child: Padding( padding: EdgeInsets.only( - top: SizeConfig.widthMultiplier! * 0.9, - bottom: - SizeConfig.widthMultiplier! * 0.9, - right: SizeConfig.widthMultiplier! * 3, - left: SizeConfig.widthMultiplier! * 3), + top: SizeConfig.widthMultiplier * 0.9, bottom: SizeConfig.widthMultiplier * 0.9, right: SizeConfig.widthMultiplier * 3, left: SizeConfig.widthMultiplier * 3), child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, children: [ Row( mainAxisSize: MainAxisSize.max, @@ -471,39 +340,21 @@ class _RescheduleLeaveScreen extends State { model2.allReasons.length > 0 ? Expanded( // add Expanded to have your dropdown button fill remaining space - child: - DropdownButtonHideUnderline( - child: - DropdownButton( + child: DropdownButtonHideUnderline( + child: DropdownButton( focusColor: Colors.grey, isExpanded: true, - value: model2 - .allReasons[0] - ['id'] - .toString() ?? - "", + value: model2.allReasons[0]['id'].toString() ?? "", iconSize: 40, elevation: 16, - selectedItemBuilder: - (BuildContext - context) { - return model2.allReasons - .map((item) { + selectedItemBuilder: (BuildContext context) { + return model2.allReasons.map((item) { return Row( - mainAxisSize: - MainAxisSize - .max, + mainAxisSize: MainAxisSize.max, children: [ AppText( - projectsProvider! - .isArabic - ? item[ - 'nameAr'] - : item[ - 'nameEn'], - fontSize: SizeConfig - .textMultiplier! * - 2.1, + projectsProvider.isArabic ? item['nameAr'] : item['nameEn'], + fontSize: SizeConfig.textMultiplier * 2.1, // color: // Colors.grey, ), @@ -516,20 +367,12 @@ class _RescheduleLeaveScreen extends State { reason = newValue; }) }, - items: model2.allReasons - .map((item) { - return DropdownMenuItem< - String>( - value: item['id'] - .toString(), + items: model2.allReasons.map((item) { + return DropdownMenuItem( + value: item['id'].toString(), child: Text( - projectsProvider! - .isArabic - ? item['nameAr'] - : item[ - 'nameEn'], - textAlign: - TextAlign.end, + projectsProvider.isArabic ? item['nameAr'] : item['nameEn'], + textAlign: TextAlign.end, ), ); }).toList(), @@ -544,23 +387,13 @@ class _RescheduleLeaveScreen extends State { Container( margin: EdgeInsets.all(8), - decoration: BoxDecoration( - borderRadius: BorderRadius.all( - Radius.circular(6.0)), - border: Border.all( - width: 1.0, - color: HexColor("#CCCCCC"))), + decoration: BoxDecoration(borderRadius: BorderRadius.all(Radius.circular(6.0)), border: Border.all(width: 1.0, color: HexColor("#CCCCCC"))), width: double.infinity, child: Padding( padding: EdgeInsets.only( - top: SizeConfig.widthMultiplier! * 0.9, - bottom: - SizeConfig.widthMultiplier! * 0.9, - right: SizeConfig.widthMultiplier! * 3, - left: SizeConfig.widthMultiplier! * 3), + top: SizeConfig.widthMultiplier * 0.9, bottom: SizeConfig.widthMultiplier * 0.9, right: SizeConfig.widthMultiplier * 3, left: SizeConfig.widthMultiplier * 3), child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, children: [ Row( mainAxisSize: MainAxisSize.max, @@ -569,112 +402,45 @@ class _RescheduleLeaveScreen extends State { ? Expanded( // add Expanded to have your dropdown button fill remaining space child: DropdownSearch( - dropdownDecoratorProps: - DropDownDecoratorProps( - dropdownSearchDecoration: - InputDecoration( - contentPadding: - EdgeInsets - .all(0), - border: - InputBorder - .none), - ), - popupProps: PopupProps - .bottomSheet( - showSearchBox: - true, - title: Container( - height: 50, - decoration: - BoxDecoration( - color: Theme.of( - context) - .primaryColorDark, - borderRadius: - BorderRadius - .only( - topLeft: Radius - .circular( - 20), - topRight: Radius - .circular( - 20), - ), - ), - child: Center( - child: Text( - '', - style: - TextStyle( - fontSize: - 24, - fontWeight: - FontWeight - .bold, - color: Colors - .white, - ), - ), - ), - ), - bottomSheetProps: - BottomSheetProps( - shape: - RoundedRectangleBorder( - borderRadius: - BorderRadius - .only( - topLeft: Radius - .circular( - 24), - topRight: Radius - .circular( - 24), - ), - ), - )), - // mode: Mode.BOTTOM_SHEET, + mode: Mode.BOTTOM_SHEET, + dropdownSearchDecoration: InputDecoration(contentPadding: EdgeInsets.all(0), border: InputBorder.none), //maxHeight: 300, - items: model2 - .coveringDoctors - .map((item) { - return projectsProvider! - .isArabic - ? item[ - 'doctorNameN'] - : item[ - 'doctorName']; + items: model2.coveringDoctors.map((item) { + return projectsProvider.isArabic ? item['doctorNameN'] : item['doctorName']; }).toList(), // label: "Doctor List", onChanged: (item) { - model2.coveringDoctors - .forEach( - (newVal) => { - if (newVal[ - 'doctorName'] == - item) - doctorID = - newVal['DoctorID'] - }); + model2.coveringDoctors.forEach((newVal) => {if (newVal['doctorName'] == item) doctorID = newVal['DoctorID']}); }, - selectedItem: - getSelectedDoctor( - model2), - // showSearchBox: true, - // popupShape: - // RoundedRectangleBorder( - // borderRadius: - // BorderRadius.only( - // topLeft: - // Radius.circular( - // 24), - // topRight: - // Radius.circular( - // 24), - // ), - // ), + selectedItem: getSelectedDoctor(model2), + showSearchBox: true, + popupTitle: Container( + height: 50, + decoration: BoxDecoration( + color: Theme.of(context).primaryColorDark, + borderRadius: BorderRadius.only( + topLeft: Radius.circular(20), + topRight: Radius.circular(20), + ), + ), + child: Center( + child: Text( + '', + style: TextStyle( + fontSize: 24, + fontWeight: FontWeight.bold, + color: Colors.white, + ), + ), + ), + ), + popupShape: RoundedRectangleBorder( + borderRadius: BorderRadius.only( + topLeft: Radius.circular(24), + topRight: Radius.circular(24), + ), + ), ), ) : SizedBox(), @@ -683,19 +449,14 @@ class _RescheduleLeaveScreen extends State { ], ), )), - SizedBox(height: SizeConfig.screenHeight! * .3), + SizedBox(height: SizeConfig.screenHeight * .3), Container( - margin: EdgeInsets.all( - SizeConfig.widthMultiplier! * 5), + margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5), child: Wrap( alignment: WrapAlignment.center, children: [ AppButton( - title: widget.isUpdate == true - ? TranslationBase.of(context) - .updateReschedule - : TranslationBase.of(context) - .addReschedule, + title: widget.isUpdate == true ? TranslationBase.of(context).updateReschedule : TranslationBase.of(context).addReschedule, color: HexColor('#359846'), onPressed: () { if (offTime == '1' || offTime == '2') { @@ -705,9 +466,7 @@ class _RescheduleLeaveScreen extends State { addRecheduleLeave(model2); } } else { - DrAppToastMsg.showErrorToast( - TranslationBase.of(context) - .onlyOfftimeHoliday); + DrAppToastMsg.showErrorToast(TranslationBase.of(context).onlyOfftimeHoliday); } }, ), @@ -740,18 +499,15 @@ class _RescheduleLeaveScreen extends State { final df = new DateFormat('HH:mm:ss'); final dateFormat = new DateFormat('yyyy-MM-dd'); this.offTime = widget.updateData.requisitionType.toString(); - _toDateController.text = - dateFormat.format(DateTime.parse(widget.updateData.dateTimeFrom)); + _toDateController.text = dateFormat.format(DateTime.parse(widget.updateData.dateTimeFrom)); //df.format(DateTime.parse(widget.updateData.dateTimeFrom)); - this.fromTime = - df.format(DateTime.parse(widget.updateData.dateTimeFrom)); - this.fromTime = this.fromTime!.substring(0, this.fromTime!.length - 3); + this.fromTime = df.format(DateTime.parse(widget.updateData.dateTimeFrom)); + this.fromTime = this.fromTime.substring(0, this.fromTime.length - 3); this.toTime = df.format(DateTime.parse(widget.updateData.dateTimeTo)); - this.toTime = this.toTime!.substring(0, this.toTime!.length - 3); - _toDateController2.text = - dateFormat.format(DateTime.parse(widget.updateData.dateTimeTo)); - _controller5.text = toTime!; - _controller4.text = fromTime!; + this.toTime = this.toTime.substring(0, this.toTime.length - 3); + _toDateController2.text = dateFormat.format(DateTime.parse(widget.updateData.dateTimeTo)); + _controller5.text = toTime; + _controller4.text = fromTime; toDate = _toDateController2.text; fromDate = _toDateController.text; this.reason = widget.updateData.reasonId.toString(); @@ -762,8 +518,7 @@ class _RescheduleLeaveScreen extends State { getClinicName(model) { var clinicID = this.profile['ClinicID'] ?? 1; - var clinicInfo = - model.clinicsList.where((i) => i['ClinicID'] == clinicID).toList(); + var clinicInfo = model.clinicsList.where((i) => i['ClinicID'] == clinicID).toList(); return clinicInfo.length > 0 ? clinicInfo[0]['ClinicDescription'] : ""; } @@ -773,16 +528,8 @@ class _RescheduleLeaveScreen extends State { var fromDates = fromDate; var toDates = toDate; if (offTime == '1') { - fromDate = df.format(DateTime.parse(dateFormat.format(fromDates) + - 'T' + - fromTime! + - ':' + - DateTime.now().second.toString())); - toDate = df.format(DateTime.parse(dateFormat.format(fromDates) + - 'T' + - toTime! + - ':' + - DateTime.now().second.toString())); + fromDate = df.format(DateTime.parse(dateFormat.format(fromDates) + 'T' + fromTime + ':' + DateTime.now().second.toString())); + toDate = df.format(DateTime.parse(dateFormat.format(fromDates) + 'T' + toTime + ':' + DateTime.now().second.toString())); } else { fromDate = df.format(fromDates); toDate = df.format(toDates); @@ -797,19 +544,10 @@ class _RescheduleLeaveScreen extends State { "dateTimeTo": toDate, "date": offTime == '1' ? fromDate : df.format(DateTime.now()), "reasonId": reason == null ? model.allOffTime[0]['code'] : reason, - "coveringDoctorId": - doctorID == null ? model.coveringDoctors[0]['doctorID'] : doctorID, + "coveringDoctorId": doctorID == null ? model.coveringDoctors[0]['doctorID'] : doctorID, "status": 2, "schedule": [ - { - "weekDayId": 1, - "shiftId": 1, - "isOpen": true, - "timeFrom": fromTime, - "timeTo": toTime, - "timeFromstr": "", - "timeTostr": "" - } + {"weekDayId": 1, "shiftId": 1, "isOpen": true, "timeFrom": fromTime, "timeTo": toTime, "timeFromstr": "", "timeTostr": ""} ] } }; @@ -820,9 +558,7 @@ class _RescheduleLeaveScreen extends State { Navigator.pushNamedAndRemoveUntil(context, HOME, (r) => false); Navigator.push( context, - MaterialPageRoute( - builder: (context) => AddRescheduleLeaveScreen(), - settings: RouteSettings(name: 'AddRescheduleLeaveScreen') + MaterialPageRoute(builder: (context) => AddRescheduleLeaveScreen(), settings: RouteSettings(name: 'AddRescheduleLeaveScreen') // MyReferredPatient(), ), ); @@ -837,21 +573,11 @@ class _RescheduleLeaveScreen extends State { dynamic fromDates = fromDate; dynamic toDates = toDate; if (offTime == '1') { - fromDate = df.format(DateTime.parse(_toDateController.text)) + - 'T' + - fromTime! + - ':' + - DateTime.now().second.toString(); - toDate = df.format(DateTime.parse(_toDateController2.text)) + - 'T' + - toTime! + - ':' + - DateTime.now().second.toString(); + fromDate = df.format(DateTime.parse(_toDateController.text)) + 'T' + fromTime + ':' + DateTime.now().second.toString(); + toDate = df.format(DateTime.parse(_toDateController2.text)) + 'T' + toTime + ':' + DateTime.now().second.toString(); } else { - fromDate = df.format( - fromDates is DateTime ? fromDates : DateTime.parse(fromDates)); - toDate = - df.format(toDates is DateTime ? toDates : DateTime.parse(toDates)); + fromDate = df.format(fromDates is DateTime ? fromDates : DateTime.parse(fromDates)); + toDate = df.format(toDates is DateTime ? toDates : DateTime.parse(toDates)); } Map request = { @@ -864,19 +590,10 @@ class _RescheduleLeaveScreen extends State { "dateTimeTo": toDate, "date": offTime == '1' ? fromDate : df.format(DateTime.now()), "reasonId": reason == null ? model.allOffTime[0]['code'] : reason, - "coveringDoctorId": - doctorID == null ? model.coveringDoctors[0]['doctorID'] : doctorID, + "coveringDoctorId": doctorID == null ? model.coveringDoctors[0]['doctorID'] : doctorID, "status": 2, "schedule": [ - { - "weekDayId": 1, - "shiftId": 1, - "isOpen": true, - "timeFrom": "", - "timeTo": "", - "timeFromstr": fromTime, - "timeTostr": toTime - } + {"weekDayId": 1, "shiftId": 1, "isOpen": true, "timeFrom": "", "timeTo": "", "timeFromstr": fromTime, "timeTostr": toTime} ] } }; @@ -887,9 +604,7 @@ class _RescheduleLeaveScreen extends State { Navigator.pushNamedAndRemoveUntil(context, HOME, (r) => false); Navigator.push( context, - MaterialPageRoute( - builder: (context) => AddRescheduleLeaveScreen(), - settings: RouteSettings(name: 'AddRescheduleLeaveScreen')), + MaterialPageRoute(builder: (context) => AddRescheduleLeaveScreen(), settings: RouteSettings(name: 'AddRescheduleLeaveScreen')), ); } }); @@ -898,13 +613,10 @@ class _RescheduleLeaveScreen extends State { getSelectedDoctor(model2) { var doctorName; if (doctorID == null) - return projectsProvider!.isArabic - ? model2.coveringDoctors[0]['doctorNameN'] - : model2.coveringDoctors[0]['doctorName']; + return projectsProvider.isArabic ? model2.coveringDoctors[0]['doctorNameN'] : model2.coveringDoctors[0]['doctorName']; else { model2.coveringDoctors.forEach((newVal) => { - if (newVal['doctorID'].toString() == doctorID) - {doctorName = newVal['doctorName']} + if (newVal['doctorID'].toString() == doctorID) {doctorName = newVal['doctorName']} }); return doctorName; } diff --git a/lib/utils/translations_delegate_base_utils.dart b/lib/utils/translations_delegate_base_utils.dart index dc8d7f0e..462f6372 100644 --- a/lib/utils/translations_delegate_base_utils.dart +++ b/lib/utils/translations_delegate_base_utils.dart @@ -10,1841 +10,1725 @@ class TranslationBase { final Locale locale; static TranslationBase of(BuildContext context) { - return Localizations.of(context, TranslationBase)!; + return Localizations.of(context, TranslationBase); } - String get dashboardScreenToolbarTitle => - localizedValues['dashboardScreenToolbarTitle']![locale.languageCode]!; + String get dashboardScreenToolbarTitle => localizedValues['dashboardScreenToolbarTitle'][locale.languageCode]; - String get settings => localizedValues['settings']![locale.languageCode]!; + String get settings => localizedValues['settings'][locale.languageCode]; - String get areYouSureYouWantTo => - localizedValues['areYouSureYouWantTo']![locale.languageCode]!; + String get areYouSureYouWantTo => localizedValues['areYouSureYouWantTo'][locale.languageCode]; - String get language => localizedValues['language']![locale.languageCode]!; + String get language => localizedValues['language'][locale.languageCode]; - String get lanEnglish => localizedValues['lanEnglish']![locale.languageCode]!; + String get lanEnglish => localizedValues['lanEnglish'][locale.languageCode]; - String get lanArabic => localizedValues['lanArabic']![locale.languageCode]!; + String get lanArabic => localizedValues['lanArabic'][locale.languageCode]; - String get theDoctor => localizedValues['theDoctor']![locale.languageCode]!; + String get theDoctor => localizedValues['theDoctor'][locale.languageCode]; - String get reply => localizedValues['reply']![locale.languageCode]!; + String get reply => localizedValues['reply'][locale.languageCode]; - String get time => localizedValues['time']![locale.languageCode]!; + String get time => localizedValues['time'][locale.languageCode]; - String get fileNo => localizedValues['fileNo']![locale.languageCode]!; + String get fileNo => localizedValues['fileNo'][locale.languageCode]; - String get mobileNo => localizedValues['mobileNo']![locale.languageCode]!; + String get mobileNo => localizedValues['mobileNo'][locale.languageCode]; - String get replySuccessfully => - localizedValues['replySuccessfully']![locale.languageCode]!; + String get replySuccessfully => localizedValues['replySuccessfully'][locale.languageCode]; - String get messagesScreenToolbarTitle => - localizedValues['messagesScreenToolbarTitle']![locale.languageCode]!; + String get messagesScreenToolbarTitle => localizedValues['messagesScreenToolbarTitle'][locale.languageCode]; - String get mySchedule => localizedValues['mySchedule']![locale.languageCode]!; + String get mySchedule => localizedValues['mySchedule'][locale.languageCode]; - String get errorNoSchedule => - localizedValues['errorNoSchedule']![locale.languageCode]!; + String get errorNoSchedule => localizedValues['errorNoSchedule'][locale.languageCode]; - String get verify => localizedValues['verify']![locale.languageCode]!; + String get verify => localizedValues['verify'][locale.languageCode]; - String get referralDoctor => - localizedValues['referralDoctor']![locale.languageCode]!; + String get referralDoctor => localizedValues['referralDoctor'][locale.languageCode]; - String get referringClinic => - localizedValues['referringClinic']![locale.languageCode]!; + String get referringClinic => localizedValues['referringClinic'][locale.languageCode]; - String get frequency => localizedValues['frequency']![locale.languageCode]!; + String get frequency => localizedValues['frequency'][locale.languageCode]; - String get priority => localizedValues['priority']![locale.languageCode]!; + String get priority => localizedValues['priority'][locale.languageCode]; - String get maxResponseTime => - localizedValues['maxResponseTime']![locale.languageCode]!; + String get maxResponseTime => localizedValues['maxResponseTime'][locale.languageCode]; - String get clinicDetailsandRemarks => - localizedValues['clinicDetailsandRemarks']![locale.languageCode]!; + String get clinicDetailsandRemarks => localizedValues['clinicDetailsandRemarks'][locale.languageCode]; - String get answerSuggestions => - localizedValues['answerSuggestions']![locale.languageCode]!; + String get answerSuggestions => localizedValues['answerSuggestions'][locale.languageCode]; - String get outPatients => - localizedValues['outPatients']![locale.languageCode]!; + String get outPatients => localizedValues['outPatients'][locale.languageCode]; - String get searchPatient => - localizedValues['searchPatient']![locale.languageCode]!; + String get searchPatient => localizedValues['searchPatient'][locale.languageCode]; - String get searchPatientDashBoard => - localizedValues['searchPatientDashBoard']![locale.languageCode]!; + String get searchPatientDashBoard => localizedValues['searchPatientDashBoard'][locale.languageCode]; - String get searchPatientName => - localizedValues['searchPatient-name']![locale.languageCode]!; + String get searchPatientName => localizedValues['searchPatient-name'][locale.languageCode]; - String get searchAbout => - localizedValues['searchAbout']![locale.languageCode]!; + String get searchAbout => localizedValues['searchAbout'][locale.languageCode]; - String get patient => localizedValues['patient']![locale.languageCode]!; + String get patient => localizedValues['patient'][locale.languageCode]; - String get patients => localizedValues['patients']![locale.languageCode]!; + String get patients => localizedValues['patients'][locale.languageCode]; - String get labResult => localizedValues['labResult']![locale.languageCode]!; + String get labResult => localizedValues['labResult'][locale.languageCode]; - String get todayStatistics => - localizedValues['todayStatistics']![locale.languageCode]!; + String get todayStatistics => localizedValues['todayStatistics'][locale.languageCode]; - String get familyMedicine => - localizedValues['familyMedicine']![locale.languageCode]!; + String get familyMedicine => localizedValues['familyMedicine'][locale.languageCode]; - String get arrived => localizedValues['arrived']![locale.languageCode]!; + String get arrived => localizedValues['arrived'][locale.languageCode]; - String get er => localizedValues['er']![locale.languageCode]!; + String get er => localizedValues['er'][locale.languageCode]; - String get walkIn => localizedValues['walkIn']![locale.languageCode]!; + String get walkIn => localizedValues['walkIn'][locale.languageCode]; - String get notArrived => localizedValues['notArrived']![locale.languageCode]!; + String get notArrived => localizedValues['notArrived'][locale.languageCode]; - String get radiology => localizedValues['radiology']![locale.languageCode]!; + String get radiology => localizedValues['radiology'][locale.languageCode]; - String get service => localizedValues['service']![locale.languageCode]!; + String get service => localizedValues['service'][locale.languageCode]; - String get referral => localizedValues['referral']![locale.languageCode]!; + String get referral => localizedValues['referral'][locale.languageCode]; - String get inPatient => localizedValues['inPatient']![locale.languageCode]!; + String get inPatient => localizedValues['inPatient'][locale.languageCode]; - String get myInPatient => - localizedValues['myInPatient']![locale.languageCode]!; + String get myInPatient => localizedValues['myInPatient'][locale.languageCode]; - String get myInPatientTitle => - localizedValues['myInPatientTitle']![locale.languageCode]!; + String get myInPatientTitle => localizedValues['myInPatientTitle'][locale.languageCode]; - String get inPatientLabel => - localizedValues['inPatientLabel']![locale.languageCode]!; + String get inPatientLabel => localizedValues['inPatientLabel'][locale.languageCode]; - String get inPatientAll => - localizedValues['inPatientAll']![locale.languageCode]!; + String get inPatientAll => localizedValues['inPatientAll'][locale.languageCode]; - String get operations => localizedValues['operations']![locale.languageCode]!; + String get operations => localizedValues['operations'][locale.languageCode]; - String get patientServices => - localizedValues['patientServices']![locale.languageCode]!; + String get patientServices => localizedValues['patientServices'][locale.languageCode]; - String get searchMedicine => - localizedValues['searchMedicine']![locale.languageCode]!; + String get searchMedicine => localizedValues['searchMedicine'][locale.languageCode]; - String get searchMedicineDashboard => - localizedValues['searchMedicineDashboard']![locale.languageCode]!; + String get searchMedicineDashboard => localizedValues['searchMedicineDashboard'][locale.languageCode]; - String get myReferralPatient => - localizedValues['myReferralPatient']![locale.languageCode]!; + String get myReferralPatient => localizedValues['myReferralPatient'][locale.languageCode]; - String get referPatient => - localizedValues['referPatient']![locale.languageCode]!; + String get referPatient => localizedValues['referPatient'][locale.languageCode]; - String get myReferral => localizedValues['myReferral']![locale.languageCode]!; + String get myReferral => localizedValues['myReferral'][locale.languageCode]; - String get myReferredPatient => - localizedValues['myReferredPatient']![locale.languageCode]!; + String get myReferredPatient => localizedValues['myReferredPatient'][locale.languageCode]; String get referredPatient => - localizedValues['referredPatient']![locale.languageCode]!; + localizedValues['referredPatient'][locale.languageCode]; - String get referredOn => localizedValues['referredOn']![locale.languageCode]!; + String get referredOn => localizedValues['referredOn'][locale.languageCode]; - String get firstName => localizedValues['firstName']![locale.languageCode]!; + String get firstName => localizedValues['firstName'][locale.languageCode]; - String get firstNameInAr => - localizedValues['firstNameInAr']![locale.languageCode]!; + String get firstNameInAr => localizedValues['firstNameInAr'][locale.languageCode]; - String get middleName => localizedValues['middleName']![locale.languageCode]!; + String get middleName => localizedValues['middleName'][locale.languageCode]; - String get middleNameInAr => - localizedValues['middleNameInAr']![locale.languageCode]!; + String get middleNameInAr => localizedValues['middleNameInAr'][locale.languageCode]; - String get lastName => localizedValues['lastName']![locale.languageCode]!; + String get lastName => localizedValues['lastName'][locale.languageCode]; - String get lastNameInAr => - localizedValues['lastNameInAr']![locale.languageCode]!; + String get lastNameInAr => localizedValues['lastNameInAr'][locale.languageCode]; - String get phoneNumber => - localizedValues['phoneNumber']![locale.languageCode]!; + String get phoneNumber => localizedValues['phoneNumber'][locale.languageCode]; - String get patientID => localizedValues['patientID']![locale.languageCode]!; + String get patientID => localizedValues['patientID'][locale.languageCode]; - String get patientFile => - localizedValues['patientFile']![locale.languageCode]!; + String get patientFile => localizedValues['patientFile'][locale.languageCode]; - String get search => localizedValues['search']![locale.languageCode]!; + String get search => localizedValues['search'][locale.languageCode]; - String get onlyArrivedPatient => - localizedValues['onlyArrivedPatient']![locale.languageCode]!; + String get onlyArrivedPatient => localizedValues['onlyArrivedPatient'][locale.languageCode]; - String get searchMedicineNameHere => - localizedValues['searchMedicineNameHere']![locale.languageCode]!; + String get searchMedicineNameHere => localizedValues['searchMedicineNameHere'][locale.languageCode]; - String get youCanFind => localizedValues['youCanFind']![locale.languageCode]!; + String get youCanFind => localizedValues['youCanFind'][locale.languageCode]; - String get medicineSearchResult => - localizedValues['medicineSearchResult']![locale.languageCode]!; + String get medicineSearchResult => localizedValues['medicineSearchResult'][locale.languageCode]; - String get qr => localizedValues['qr']![locale.languageCode]!; + String get qr => localizedValues['qr'][locale.languageCode]; - String get reader => localizedValues['reader']![locale.languageCode]!; + String get reader => localizedValues['reader'][locale.languageCode]; - String get startScanning => - localizedValues['startScanning']![locale.languageCode]!; + String get startScanning => localizedValues['startScanning'][locale.languageCode]; - String get scanQrCode => localizedValues['scanQrCode']![locale.languageCode]!; + String get scanQrCode => localizedValues['scanQrCode'][locale.languageCode]; + String get scanERQrCode => localizedValues['scanERQrCode'][locale.languageCode]; - String get scanERQrCode => - localizedValues['scanERQrCode']![locale.languageCode]!; + String get scanQr => localizedValues['scanQr'][locale.languageCode]; - String get scanQr => localizedValues['scanQr']![locale.languageCode]!; + String get profile => localizedValues['profile'][locale.languageCode]; - String get profile => localizedValues['profile']![locale.languageCode]!; + String get gender => localizedValues['gender'][locale.languageCode]; - String get gender => localizedValues['gender']![locale.languageCode]!; + String get clinic => localizedValues['clinic'][locale.languageCode]; - String get clinic => localizedValues['clinic']![locale.languageCode]!; + String get clinicSelect => localizedValues['clinicSelect'][locale.languageCode]; - String get clinicSelect => - localizedValues['clinicSelect']![locale.languageCode]!; + String get doctorSelect => localizedValues['doctorSelect'][locale.languageCode]; - String get doctorSelect => - localizedValues['doctorSelect']![locale.languageCode]!; + String get hospital => localizedValues['hospital'][locale.languageCode]; - String get hospital => localizedValues['hospital']![locale.languageCode]!; + String get speciality => localizedValues['speciality'][locale.languageCode]; - String get speciality => localizedValues['speciality']![locale.languageCode]!; + String get errorMessage => localizedValues['errorMessage'][locale.languageCode]; - String get errorMessage => - localizedValues['errorMessage']![locale.languageCode]!; + String get patientProfile => localizedValues['patientProfile'][locale.languageCode]; - String get patientProfile => - localizedValues['patientProfile']![locale.languageCode]!; + String get vitalSign => localizedValues['vitalSign'][locale.languageCode]; - String get vitalSign => localizedValues['vitalSign']![locale.languageCode]!; + String get vital => localizedValues['vital'][locale.languageCode]; - String get vital => localizedValues['vital']![locale.languageCode]!; + String get signs => localizedValues['signs'][locale.languageCode]; - String get signs => localizedValues['signs']![locale.languageCode]!; + String get labOrder => localizedValues['labOrder'][locale.languageCode]; - String get labOrder => localizedValues['labOrder']![locale.languageCode]!; + String get lab => localizedValues['lab'][locale.languageCode]; - String get lab => localizedValues['lab']![locale.languageCode]!; + String get result => localizedValues['result'][locale.languageCode]; - String get result => localizedValues['result']![locale.languageCode]!; + String get medicines => localizedValues['medicines'][locale.languageCode]; - String get medicines => localizedValues['medicines']![locale.languageCode]!; + String get prescription => localizedValues['prescription'][locale.languageCode]; - String get prescription => - localizedValues['prescription']![locale.languageCode]!; + String get insuranceApprovals => localizedValues['insuranceApprovals'][locale.languageCode]; - String get insuranceApprovals => - localizedValues['insuranceApprovals']![locale.languageCode]!; + String get insurance => localizedValues['insurance'][locale.languageCode]; - String get insurance => localizedValues['insurance']![locale.languageCode]!; + String get approvals => localizedValues['approvals'][locale.languageCode]; - String get approvals => localizedValues['approvals']![locale.languageCode]!; + String get bodyMeasurements => localizedValues['bodyMeasurements'][locale.languageCode]; - String get bodyMeasurements => - localizedValues['bodyMeasurements']![locale.languageCode]!; + String get temperature => localizedValues['temperature'][locale.languageCode]; - String get temperature => - localizedValues['temperature']![locale.languageCode]!; + String get pulse => localizedValues['pulse'][locale.languageCode]; - String get pulse => localizedValues['pulse']![locale.languageCode]!; + String get respiration => localizedValues['respiration'][locale.languageCode]; - String get respiration => - localizedValues['respiration']![locale.languageCode]!; + String get bloodPressure => localizedValues['bloodPressure'][locale.languageCode]; - String get bloodPressure => - localizedValues['bloodPressure']![locale.languageCode]!; + String get oxygenation => localizedValues['oxygenation'][locale.languageCode]; - String get oxygenation => - localizedValues['oxygenation']![locale.languageCode]!; + String get painScale => localizedValues['painScale'][locale.languageCode]; - String get painScale => localizedValues['painScale']![locale.languageCode]!; + String get errorNoVitalSign => localizedValues['errorNoVitalSign'][locale.languageCode]; - String get errorNoVitalSign => - localizedValues['errorNoVitalSign']![locale.languageCode]!; + String get labOrders => localizedValues['labOrders'][locale.languageCode]; - String get labOrders => localizedValues['labOrders']![locale.languageCode]!; + String get errorNoLabOrders => localizedValues['errorNoLabOrders'][locale.languageCode]; - String get errorNoLabOrders => - localizedValues['errorNoLabOrders']![locale.languageCode]!; + String get answerThePatient => localizedValues['answerThePatient'][locale.languageCode]; - String get answerThePatient => - localizedValues['answerThePatient']![locale.languageCode]!; + String get pleaseEnterAnswer => localizedValues['pleaseEnterAnswer'][locale.languageCode]; - String get pleaseEnterAnswer => - localizedValues['pleaseEnterAnswer']![locale.languageCode]!; + String get replay => localizedValues['replay'][locale.languageCode]; - String get replay => localizedValues['replay']![locale.languageCode]!; + String get progressNote => localizedValues['progressNote'][locale.languageCode]; - String get progressNote => - localizedValues['progressNote']![locale.languageCode]!; + String get operationReports => localizedValues['operationReports'][locale.languageCode]; - String get operationReports => - localizedValues['operationReports']![locale.languageCode]!; + String get reports => localizedValues['reports'][locale.languageCode]; - String get reports => localizedValues['reports']![locale.languageCode]!; + String get operation => localizedValues['operation'][locale.languageCode]; - String get operation => localizedValues['operation']![locale.languageCode]!; + String get progress => localizedValues['progress'][locale.languageCode]; - String get progress => localizedValues['progress']![locale.languageCode]!; + String get note => localizedValues['note'][locale.languageCode]; - String get note => localizedValues['note']![locale.languageCode]!; + String get searchNote => localizedValues['searchNote'][locale.languageCode]; - String get searchNote => localizedValues['searchNote']![locale.languageCode]!; + String get errorNoProgressNote => localizedValues['errorNoProgressNote'][locale.languageCode]; - String get errorNoProgressNote => - localizedValues['errorNoProgressNote']![locale.languageCode]!; + String get invoiceNo => localizedValues['invoiceNo:'][locale.languageCode]; - String get invoiceNo => localizedValues['invoiceNo:']![locale.languageCode]!; + String get orderNo => localizedValues['orderNo'][locale.languageCode]; - String get orderNo => localizedValues['orderNo']![locale.languageCode]!; + String get generalResult => localizedValues['generalResult'][locale.languageCode]; - String get generalResult => - localizedValues['generalResult']![locale.languageCode]!; + String get description => localizedValues['description'][locale.languageCode]; - String get description => - localizedValues['description']![locale.languageCode]!; + String get value => localizedValues['value'][locale.languageCode]; - String get value => localizedValues['value']![locale.languageCode]!; + String get range => localizedValues['range'][locale.languageCode]; - String get range => localizedValues['range']![locale.languageCode]!; + String get enterId => localizedValues['enterId'][locale.languageCode]; - String get enterId => localizedValues['enterId']![locale.languageCode]!; + String get pleaseEnterYourID => localizedValues['pleaseEnterYourID'][locale.languageCode]; - String get pleaseEnterYourID => - localizedValues['pleaseEnterYourID']![locale.languageCode]!; + String get enterPassword => localizedValues['enterPassword'][locale.languageCode]; - String get enterPassword => - localizedValues['enterPassword']![locale.languageCode]!; + String get pleaseEnterPassword => localizedValues['pleaseEnterPassword'][locale.languageCode]; - String get pleaseEnterPassword => - localizedValues['pleaseEnterPassword']![locale.languageCode]!; + String get selectYourProject => localizedValues['selectYourProject'][locale.languageCode]; - String get selectYourProject => - localizedValues['selectYourProject']![locale.languageCode]!; + String get pleaseEnterYourProject => localizedValues['pleaseEnterYourProject'][locale.languageCode]; - String get pleaseEnterYourProject => - localizedValues['pleaseEnterYourProject']![locale.languageCode]!; + String get login => localizedValues['login'][locale.languageCode]; - String get login => localizedValues['login']![locale.languageCode]!; + String get drSulaimanAlHabib => localizedValues['drSulaimanAlHabib'][locale.languageCode]; - String get drSulaimanAlHabib => - localizedValues['drSulaimanAlHabib']![locale.languageCode]!; + String get welcomeTo => localizedValues['welcomeTo'][locale.languageCode]; - String get welcomeTo => localizedValues['welcomeTo']![locale.languageCode]!; + String get welcomeBackTo => localizedValues['welcomeBackTo'][locale.languageCode]; - String get welcomeBackTo => - localizedValues['welcomeBackTo']![locale.languageCode]!; + String get home => localizedValues['home'][locale.languageCode]; - String get home => localizedValues['home']![locale.languageCode]!; + String get services => localizedValues['services'][locale.languageCode]; - String get services => localizedValues['services']![locale.languageCode]!; + String get sms => localizedValues['sms'][locale.languageCode]; - String get sms => localizedValues['sms']![locale.languageCode]!; + String get fingerprint => localizedValues['fingerprint'][locale.languageCode]; - String get fingerprint => - localizedValues['fingerprint']![locale.languageCode]!; + String get faceId => localizedValues['faceId'][locale.languageCode]; - String get faceId => localizedValues['faceId']![locale.languageCode]!; + String get whatsApp => localizedValues['whatsApp'][locale.languageCode]; - String get whatsApp => localizedValues['whatsApp']![locale.languageCode]!; + String get whatsAppBy => localizedValues['whatsAppBy'][locale.languageCode]; - String get whatsAppBy => localizedValues['whatsAppBy']![locale.languageCode]!; + String get pleaseChoose => localizedValues['pleaseChoose'][locale.languageCode]; - String get pleaseChoose => - localizedValues['pleaseChoose']![locale.languageCode]!; + String get choose => localizedValues['choose'][locale.languageCode]; - String get choose => localizedValues['choose']![locale.languageCode]!; + String get verification => localizedValues['verification'][locale.languageCode]; - String get verification => - localizedValues['verification']![locale.languageCode]!; + String get firstStep => localizedValues['firstStep'][locale.languageCode]; - String get firstStep => localizedValues['firstStep']![locale.languageCode]!; + String get yourAccount => localizedValues['yourAccount!'][locale.languageCode]; - String get yourAccount => - localizedValues['yourAccount!']![locale.languageCode]!; + String get verify1 => localizedValues['verify1'][locale.languageCode]; - String get verify1 => localizedValues['verify1']![locale.languageCode]!; + String get youWillReceiveA => localizedValues['youWillReceiveA'][locale.languageCode]; - String get youWillReceiveA => - localizedValues['youWillReceiveA']![locale.languageCode]!; + String get loginCode => localizedValues['loginCode'][locale.languageCode]; - String get loginCode => localizedValues['loginCode']![locale.languageCode]!; - - String get smsBy => localizedValues['smsBy']![locale.languageCode]!; + String get smsBy => localizedValues['smsBy'][locale.languageCode]; String get pleaseEnterTheCode => - localizedValues['pleaseEnterTheCode']![locale.languageCode]!; + localizedValues['pleaseEnterTheCode'][locale.languageCode]; String get youDontHaveAnyPatient => - localizedValues['youDontHaveAnyPatient']![locale.languageCode]!; + localizedValues['youDontHaveAnyPatient'][locale.languageCode]; String get youDoNotHaveAnyItem => - localizedValues['youDoNotHaveAnyItem']![locale.languageCode]!; + localizedValues['youDoNotHaveAnyItem'][locale.languageCode]; - String get age => localizedValues['age']![locale.languageCode]!; + String get age => localizedValues['age'][locale.languageCode]; - String get nationality => - localizedValues['nationality']![locale.languageCode]!; + String get nationality => localizedValues['nationality'][locale.languageCode]; - String get occupation => localizedValues['occupation']![locale.languageCode]!; + String get occupation => localizedValues['occupation'][locale.languageCode]; - String get healthID => localizedValues['healthID']![locale.languageCode]!; + String get healthID => localizedValues['healthID'][locale.languageCode]; String get identityNumber => - localizedValues['identityNumber']![locale.languageCode]!; + localizedValues['identityNumber'][locale.languageCode]; String get maritalStatus => - localizedValues['maritalStatus']![locale.languageCode]!; + localizedValues['maritalStatus'][locale.languageCode]; - String get today => localizedValues['today']![locale.languageCode]!; + String get today => localizedValues['today'][locale.languageCode]; - String get tomorrow => localizedValues['tomorrow']![locale.languageCode]!; + String get tomorrow => localizedValues['tomorrow'][locale.languageCode]; - String get all => localizedValues['all']![locale.languageCode]!; + String get all => localizedValues['all'][locale.languageCode]; - String get nextWeek => localizedValues['nextWeek']![locale.languageCode]!; + String get nextWeek => localizedValues['nextWeek'][locale.languageCode]; - String get yesterday => localizedValues['yesterday']![locale.languageCode]!; + String get yesterday => localizedValues['yesterday'][locale.languageCode]; String get errorNoInsuranceApprovals => - localizedValues['errorNoInsuranceApprovals']![locale.languageCode]!; + localizedValues['errorNoInsuranceApprovals'][locale.languageCode]; String get searchInsuranceApprovals => - localizedValues['searchInsuranceApprovals']![locale.languageCode]!; + localizedValues['searchInsuranceApprovals'][locale.languageCode]; - String get status => localizedValues['status']![locale.languageCode]!; + String get status => localizedValues['status'][locale.languageCode]; - String get expiryDate => localizedValues['expiryDate']![locale.languageCode]!; + String get expiryDate => localizedValues['expiryDate'][locale.languageCode]; String get producerName => - localizedValues['producerName']![locale.languageCode]!; + localizedValues['producerName'][locale.languageCode]; - String get receiptOn => localizedValues['receiptOn']![locale.languageCode]!; + String get receiptOn => localizedValues['receiptOn'][locale.languageCode]; - String get approvalNo => localizedValues['approvalNo']![locale.languageCode]!; + String get approvalNo => localizedValues['approvalNo'][locale.languageCode]; - String get doctor => localizedValues['doctor']![locale.languageCode]!; + String get doctor => localizedValues['doctor'][locale.languageCode]; - String get ext => localizedValues['ext']![locale.languageCode]!; + String get ext => localizedValues['ext'][locale.languageCode]; - String get veryUrgent => localizedValues['veryUrgent']![locale.languageCode]!; + String get veryUrgent => localizedValues['veryUrgent'][locale.languageCode]; - String get urgent => localizedValues['urgent']![locale.languageCode]!; + String get urgent => localizedValues['urgent'][locale.languageCode]; - String get routine => localizedValues['routine']![locale.languageCode]!; + String get routine => localizedValues['routine'][locale.languageCode]; - String get send => localizedValues['send']![locale.languageCode]!; + String get send => localizedValues['send'][locale.languageCode]; String get referralFrequency => - localizedValues['referralFrequency']![locale.languageCode]!; + localizedValues['referralFrequency'][locale.languageCode]; String get selectReferralFrequency => - localizedValues['selectReferralFrequency']![locale.languageCode]!; + localizedValues['selectReferralFrequency'][locale.languageCode]; String get clinicalDetailsAndRemarks => - localizedValues['clinicalDetailsAndRemarks']![locale.languageCode]!; + localizedValues['clinicalDetailsAndRemarks'][locale.languageCode]; - String get remarks => localizedValues['remarks']![locale.languageCode]!; + String get remarks => localizedValues['remarks'][locale.languageCode]; - String get pleaseFill => localizedValues['pleaseFill']![locale.languageCode]!; + String get pleaseFill => localizedValues['pleaseFill'][locale.languageCode]; - String get replay2 => localizedValues['replay2']![locale.languageCode]!; + String get replay2 => localizedValues['replay2'][locale.languageCode]; - String get outPatient => - localizedValues['outPatients']![locale.languageCode]!; + String get outPatient => localizedValues['outPatients'][locale.languageCode]; String get myOutPatient => - localizedValues['myOutPatient']![locale.languageCode]!; + localizedValues['myOutPatient'][locale.languageCode]; String get myOutPatient_2lines => - localizedValues['myOutPatient_2lines']![locale.languageCode]!; + localizedValues['myOutPatient_2lines'][locale.languageCode]; - String get logout => localizedValues['logout']![locale.languageCode]!; + String get logout => localizedValues['logout'][locale.languageCode]; String get pharmaciesList => - localizedValues['pharmaciesList']![locale.languageCode]!; + localizedValues['pharmaciesList'][locale.languageCode]; - String get price => localizedValues['price']![locale.languageCode]!; + String get price => localizedValues['price'][locale.languageCode]; String get youCanFindItIn => - localizedValues['youCanFindItIn']![locale.languageCode]!; + localizedValues['youCanFindItIn'][locale.languageCode]; String get radiologyReport => - localizedValues['radiologyReport']![locale.languageCode]!; + localizedValues['radiologyReport'][locale.languageCode]; - String get orders => localizedValues['orders']![locale.languageCode]!; + String get orders => localizedValues['orders'][locale.languageCode]; - String get list => localizedValues['list']![locale.languageCode]!; + String get list => localizedValues['list'][locale.languageCode]; String get searchOrders => - localizedValues['searchOrders']![locale.languageCode]!; + localizedValues['searchOrders'][locale.languageCode]; String get prescriptionDetails => - localizedValues['prescriptionDetails']![locale.languageCode]!; + localizedValues['prescriptionDetails'][locale.languageCode]; String get prescriptionInfo => - localizedValues['prescriptionInfo']![locale.languageCode]!; + localizedValues['prescriptionInfo'][locale.languageCode]; String get errorNoOrders => - localizedValues['errorNoOrders']![locale.languageCode]!; + localizedValues['errorNoOrders'][locale.languageCode]; - String get livecare => localizedValues['livecare']![locale.languageCode]!; + String get livecare => localizedValues['livecare'][locale.languageCode]; - String get beingBad => localizedValues['beingBad']![locale.languageCode]!; + String get beingBad => localizedValues['beingBad'][locale.languageCode]; - String get beingGreat => localizedValues['beingGreat']![locale.languageCode]!; + String get beingGreat => localizedValues['beingGreat'][locale.languageCode]; - String get cancel => localizedValues['cancel']![locale.languageCode]!; + String get cancel => localizedValues['cancel'][locale.languageCode]; - String get ok => localizedValues['ok']![locale.languageCode]!; + String get ok => localizedValues['ok'][locale.languageCode]; - String get done => localizedValues['done']![locale.languageCode]!; + String get done => localizedValues['done'][locale.languageCode]; String get searchMedicineImageCaption => - localizedValues['searchMedicineImageCaption']![locale.languageCode]!; + localizedValues['searchMedicineImageCaption'][locale.languageCode]; - String get type => localizedValues['type']![locale.languageCode]!; + String get type => localizedValues['type'][locale.languageCode]; - String get resumecall => localizedValues['resumecall']![locale.languageCode]!; + String get resumecall => localizedValues['resumecall'][locale.languageCode]; String get endcallwithcharge => - localizedValues['endcallwithcharge']![locale.languageCode]!; + localizedValues['endcallwithcharge'][locale.languageCode]; - String get endcall => localizedValues['endcall']![locale.languageCode]!; + String get endcall => localizedValues['endcall'][locale.languageCode]; String get transfertoadmin => - localizedValues['transfertoadmin']![locale.languageCode]!; + localizedValues['transfertoadmin'][locale.languageCode]; - String get fromDate => localizedValues['fromDate']![locale.languageCode]!; + String get fromDate => localizedValues['fromDate'][locale.languageCode]; - String get toDate => localizedValues['toDate']![locale.languageCode]!; + String get toDate => localizedValues['toDate'][locale.languageCode]; - String get fromTime => localizedValues['fromTime']![locale.languageCode]!; + String get fromTime => localizedValues['fromTime'][locale.languageCode]; - String get toTime => localizedValues['toTime']![locale.languageCode]!; + String get toTime => localizedValues['toTime'][locale.languageCode]; String get searchPatientImageCaptionTitle => - localizedValues['searchPatientImageCaptionTitle']![locale.languageCode]!; + localizedValues['searchPatientImageCaptionTitle'][locale.languageCode]; String get searchPatientImageCaptionBody => - localizedValues['searchPatientImageCaptionBody']![locale.languageCode]!; + localizedValues['searchPatientImageCaptionBody'][locale.languageCode]; - String get welcome => localizedValues['welcome']![locale.languageCode]!; + String get welcome => localizedValues['welcome'][locale.languageCode]; String get typeMedicineName => - localizedValues['typeMedicineName']![locale.languageCode]!; + localizedValues['typeMedicineName'][locale.languageCode]; String get moreThan3Letter => - localizedValues['moreThan3Letter']![locale.languageCode]!; + localizedValues['moreThan3Letter'][locale.languageCode]; - String get gender2 => localizedValues['gender2']![locale.languageCode]!; + String get gender2 => localizedValues['gender2'][locale.languageCode]; - String get age2 => localizedValues['age2']![locale.languageCode]!; + String get age2 => localizedValues['age2'][locale.languageCode]; - String get sickleave => localizedValues['sick-leaves']![locale.languageCode]!; + String get sickleave => localizedValues['sick-leaves'][locale.languageCode]; String get patientSick => - localizedValues['patient-sick']![locale.languageCode]!; + localizedValues['patient-sick'][locale.languageCode]; - String get leave => localizedValues['leave']![locale.languageCode]!; + String get leave => localizedValues['leave'][locale.languageCode]; - String get submit => localizedValues['submit']![locale.languageCode]!; + String get submit => localizedValues['submit'][locale.languageCode]; - String get doctorName => localizedValues['doc-name']![locale.languageCode]!; + String get doctorName => localizedValues['doc-name'][locale.languageCode]; - String get clinicName => localizedValues['clinicname']![locale.languageCode]!; + String get clinicName => localizedValues['clinicname'][locale.languageCode]; String get sickLeaveDate => - localizedValues['sick-leave-date']![locale.languageCode]!; + localizedValues['sick-leave-date'][locale.languageCode]; String get sickLeaveDays => - localizedValues['sick-leave-days']![locale.languageCode]!; + localizedValues['sick-leave-days'][locale.languageCode]; String get admissionDetail => - localizedValues['admissionDetail']![locale.languageCode]!; + localizedValues['admissionDetail'][locale.languageCode]; - String get dateTime => localizedValues['dateTime']![locale.languageCode]!; + String get dateTime => localizedValues['dateTime'][locale.languageCode]; - String get date => localizedValues['date']![locale.languageCode]!; + String get date => localizedValues['date'][locale.languageCode]; - String get admissionNo => - localizedValues['admissionNo']![locale.languageCode]!; + String get admissionNo => localizedValues['admissionNo'][locale.languageCode]; - String get losNo => localizedValues['losNo']![locale.languageCode]!; + String get losNo => localizedValues['losNo'][locale.languageCode]; - String get area => localizedValues['area']![locale.languageCode]!; + String get area => localizedValues['area'][locale.languageCode]; - String get room => localizedValues['room']![locale.languageCode]!; + String get room => localizedValues['room'][locale.languageCode]; - String get bed => localizedValues['bed']![locale.languageCode]!; + String get bed => localizedValues['bed'][locale.languageCode]; String get previousSickLeaveIssue => - localizedValues['prevoius-sickleave-issed']![locale.languageCode]!; + localizedValues['prevoius-sickleave-issed'][locale.languageCode]; String get noSickLeaveApplied => - localizedValues['no-sickleve-applied']![locale.languageCode]!; + localizedValues['no-sickleve-applied'][locale.languageCode]; - String get applyNow => localizedValues['applynow']![locale.languageCode]!; + String get applyNow => localizedValues['applynow'][locale.languageCode]; String get addSickLeave => - localizedValues['add-sickleave']![locale.languageCode]!; + localizedValues['add-sickleave'][locale.languageCode]; String get pharmacyIntervention => - localizedValues['pharmacy-intervention']![locale.languageCode]!; + localizedValues['pharmacy-intervention'][locale.languageCode]; - String get add => localizedValues['add']![locale.languageCode]!; + String get add => localizedValues['add'][locale.languageCode]; String get addSickLeaverequest => - localizedValues['addSickLeaveRequest']![locale.languageCode]!; + localizedValues['addSickLeaveRequest'][locale.languageCode]; String get extendSickLeaverequest => - localizedValues['extendSickLeaveRequest']![locale.languageCode]!; + localizedValues['extendSickLeaveRequest'][locale.languageCode]; - String get approved => localizedValues['approved']![locale.languageCode]!; + String get approved => localizedValues['approved'][locale.languageCode]; - String get extended => localizedValues['extended']![locale.languageCode]!; + String get extended => localizedValues['extended'][locale.languageCode]; - String get pending => localizedValues['pending']![locale.languageCode]!; + String get pending => localizedValues['pending'][locale.languageCode]; String get leaveStartDate => - localizedValues['leave-start-date']![locale.languageCode]!; + localizedValues['leave-start-date'][locale.languageCode]; String get daysSickleave => - localizedValues['days-sick-leave']![locale.languageCode]!; + localizedValues['days-sick-leave'][locale.languageCode]; - String get extend => localizedValues['extend']![locale.languageCode]!; + String get extend => localizedValues['extend'][locale.languageCode]; String get extendSickLeave => - localizedValues['extend-sickleave']![locale.languageCode]!; + localizedValues['extend-sickleave'][locale.languageCode]; String get targetPatient => - localizedValues['patient-target']![locale.languageCode]!; + localizedValues['patient-target'][locale.languageCode]; String get noPrescription => - localizedValues['no-priscription-listed']![locale.languageCode]!; + localizedValues['no-priscription-listed'][locale.languageCode]; - String get next => localizedValues['next']![locale.languageCode]!; + String get next => localizedValues['next'][locale.languageCode]; - String get finish => localizedValues['finish']![locale.languageCode]!; + String get finish => localizedValues['finish'][locale.languageCode]; - String get previous => localizedValues['previous']![locale.languageCode]!; + String get previous => localizedValues['previous'][locale.languageCode]; String get emptyMessage => - localizedValues['empty-message']![locale.languageCode]!; + localizedValues['empty-message'][locale.languageCode]; String get healthRecordInformation => - localizedValues['healthRecordInformation']![locale.languageCode]!; + localizedValues['healthRecordInformation'][locale.languageCode]; String get chiefComplaintLength => - localizedValues['chiefComplaintLength']![locale.languageCode]!; + localizedValues['chiefComplaintLength'][locale.languageCode]; - String get referTo => localizedValues['referTo']![locale.languageCode]!; + String get referTo => localizedValues['referTo'][locale.languageCode]; String get referredFrom => - localizedValues['referredFrom']![locale.languageCode]!; + localizedValues['referredFrom'][locale.languageCode]; - String get refClinic => localizedValues['refClinic']![locale.languageCode]!; + String get refClinic => localizedValues['refClinic'][locale.languageCode]; - String get branch => localizedValues['branch']![locale.languageCode]!; + String get branch => localizedValues['branch'][locale.languageCode]; String get chooseAppointment => - localizedValues['chooseAppointment']![locale.languageCode]!; + localizedValues['chooseAppointment'][locale.languageCode]; String get appointmentNo => - localizedValues['appointmentNo']![locale.languageCode]!; + localizedValues['appointmentNo'][locale.languageCode]; - String get refer => localizedValues['refer']![locale.languageCode]!; + String get refer => localizedValues['refer'][locale.languageCode]; - String get rejected => localizedValues['rejected']![locale.languageCode]!; + String get rejected => localizedValues['rejected'][locale.languageCode]; - String get sameBranch => localizedValues['sameBranch']![locale.languageCode]!; + String get sameBranch => localizedValues['sameBranch'][locale.languageCode]; - String get otherBranch => - localizedValues['otherBranch']![locale.languageCode]!; + String get otherBranch => localizedValues['otherBranch'][locale.languageCode]; - String get dr => localizedValues['dr']![locale.languageCode]!; + String get dr => localizedValues['dr'][locale.languageCode]; String get previewHealth => - localizedValues['previewHealth']![locale.languageCode]!; + localizedValues['previewHealth'][locale.languageCode]; String get summaryReport => - localizedValues['summaryReport']![locale.languageCode]!; + localizedValues['summaryReport'][locale.languageCode]; - String get accept => localizedValues['accept']![locale.languageCode]!; + String get accept => localizedValues['accept'][locale.languageCode]; - String get reject => localizedValues['reject']![locale.languageCode]!; + String get reject => localizedValues['reject'][locale.languageCode]; String get noAppointmentsErrorMsg => - localizedValues['noAppointmentsErrorMsg']![locale.languageCode]!; + localizedValues['noAppointmentsErrorMsg'][locale.languageCode]; String get referralPatient => - localizedValues['referralPatient']![locale.languageCode]!; + localizedValues['referralPatient'][locale.languageCode]; String get noPrescriptionListed => - localizedValues['noPrescriptionListed']![locale.languageCode]!; + localizedValues['noPrescriptionListed'][locale.languageCode]; - String get addNow => localizedValues['addNow']![locale.languageCode]!; + String get addNow => localizedValues['addNow'][locale.languageCode]; - String get orderType => localizedValues['orderType']![locale.languageCode]!; + String get orderType => localizedValues['orderType'][locale.languageCode]; - String get strength => localizedValues['strength']![locale.languageCode]!; + String get strength => localizedValues['strength'][locale.languageCode]; - String get doseTime => localizedValues['doseTime']![locale.languageCode]!; + String get doseTime => localizedValues['doseTime'][locale.languageCode]; - String get indication => localizedValues['indication']![locale.languageCode]!; + String get indication => localizedValues['indication'][locale.languageCode]; - String get duration => localizedValues['duration']![locale.languageCode]!; + String get duration => localizedValues['duration'][locale.languageCode]; - String get instruction => - localizedValues['instruction']![locale.languageCode]!; + String get instruction => localizedValues['instruction'][locale.languageCode]; String get rescheduleLeaves => - localizedValues['reschedule-leave']![locale.languageCode]!; + localizedValues['reschedule-leave'][locale.languageCode]; String get applyOrRescheduleLeave => - localizedValues['applyOrRescheduleLeave']![locale.languageCode]!; + localizedValues['applyOrRescheduleLeave'][locale.languageCode]; - String get myQRCode => localizedValues['myQRCode']![locale.languageCode]!; + String get myQRCode => localizedValues['myQRCode'][locale.languageCode]; String get addMedication => - localizedValues['addMedication']![locale.languageCode]!; + localizedValues['addMedication'][locale.languageCode]; - String get route => localizedValues['route']![locale.languageCode]!; + String get route => localizedValues['route'][locale.languageCode]; String get noReScheduleLeave => - localizedValues['no-reschedule-leave']![locale.languageCode]!; + localizedValues['no-reschedule-leave'][locale.languageCode]; - String get weight => localizedValues['weight']![locale.languageCode]!; + String get weight => localizedValues['weight'][locale.languageCode]; - String get kg => localizedValues['kg']![locale.languageCode]!; + String get kg => localizedValues['kg'][locale.languageCode]; - String get height => localizedValues['height']![locale.languageCode]!; + String get height => localizedValues['height'][locale.languageCode]; - String get cm => localizedValues['cm']![locale.languageCode]!; + String get cm => localizedValues['cm'][locale.languageCode]; String get idealBodyWeight => - localizedValues['idealBodyWeight']![locale.languageCode]!; + localizedValues['idealBodyWeight'][locale.languageCode]; - String get waistSize => localizedValues['waistSize']![locale.languageCode]!; + String get waistSize => localizedValues['waistSize'][locale.languageCode]; - String get inch => localizedValues['inch']![locale.languageCode]!; + String get inch => localizedValues['inch'][locale.languageCode]; - String get headCircum => localizedValues['headCircum']![locale.languageCode]!; + String get headCircum => localizedValues['headCircum'][locale.languageCode]; String get leanBodyWeight => - localizedValues['leanBodyWeight']![locale.languageCode]!; + localizedValues['leanBodyWeight'][locale.languageCode]; String get bodyMassIndex => - localizedValues['bodyMassIndex']![locale.languageCode]!; + localizedValues['bodyMassIndex'][locale.languageCode]; String get yourBodyMassIndex => - localizedValues['yourBodyMassIndex']![locale.languageCode]!; + localizedValues['yourBodyMassIndex'][locale.languageCode]; String get bmiUnderWeight => - localizedValues['bmiUnderWeight']![locale.languageCode]!; + localizedValues['bmiUnderWeight'][locale.languageCode]; - String get bmiHealthy => localizedValues['bmiHealthy']![locale.languageCode]!; + String get bmiHealthy => localizedValues['bmiHealthy'][locale.languageCode]; String get bmiOverWeight => - localizedValues['bmiOverWeight']![locale.languageCode]!; + localizedValues['bmiOverWeight'][locale.languageCode]; - String get bmiObese => localizedValues['bmiObese']![locale.languageCode]!; + String get bmiObese => localizedValues['bmiObese'][locale.languageCode]; String get bmiObeseExtreme => - localizedValues['bmiObeseExtreme']![locale.languageCode]!; + localizedValues['bmiObeseExtreme'][locale.languageCode]; - String get method => localizedValues['method']![locale.languageCode]!; + String get method => localizedValues['method'][locale.languageCode]; - String get pulseBeats => localizedValues['pulseBeats']![locale.languageCode]!; + String get pulseBeats => localizedValues['pulseBeats'][locale.languageCode]; - String get rhythm => localizedValues['rhythm']![locale.languageCode]!; + String get rhythm => localizedValues['rhythm'][locale.languageCode]; - String get respBeats => localizedValues['respBeats']![locale.languageCode]!; + String get respBeats => localizedValues['respBeats'][locale.languageCode]; String get patternOfRespiration => - localizedValues['patternOfRespiration']![locale.languageCode]!; + localizedValues['patternOfRespiration'][locale.languageCode]; String get bloodPressureDiastoleAndSystole => - localizedValues['bloodPressureDiastoleAndSystole']![locale.languageCode]!; + localizedValues['bloodPressureDiastoleAndSystole'][locale.languageCode]; String get cuffLocation => - localizedValues['cuffLocation']![locale.languageCode]!; + localizedValues['cuffLocation'][locale.languageCode]; - String get cuffSize => localizedValues['cuffSize']![locale.languageCode]!; + String get cuffSize => localizedValues['cuffSize'][locale.languageCode]; String get patientPosition => - localizedValues['patientPosition']![locale.languageCode]!; + localizedValues['patientPosition'][locale.languageCode]; - String get fio2 => localizedValues['fio2']![locale.languageCode]!; + String get fio2 => localizedValues['fio2'][locale.languageCode]; - String get sao2 => localizedValues['sao2']![locale.languageCode]!; + String get sao2 => localizedValues['sao2'][locale.languageCode]; String get painManagement => - localizedValues['painManagement']![locale.languageCode]!; + localizedValues['painManagement'][locale.languageCode]; - String get holiday => localizedValues['holiday']![locale.languageCode]!; + String get holiday => localizedValues['holiday'][locale.languageCode]; - String get to => localizedValues['to']![locale.languageCode]!; + String get to => localizedValues['to'][locale.languageCode]; String get coveringDoctor => - localizedValues['coveringDoctor']![locale.languageCode]!; + localizedValues['coveringDoctor'][locale.languageCode]; String get requestLeave => - localizedValues['requestLeave']![locale.languageCode]!; + localizedValues['requestLeave'][locale.languageCode]; String get pleaseEnterDate => - localizedValues['pleaseEnterDate']![locale.languageCode]!; + localizedValues['pleaseEnterDate'][locale.languageCode]; String get pleaseEnterNoOfDays => - localizedValues['pleaseEnterNoOfDays']![locale.languageCode]!; + localizedValues['pleaseEnterNoOfDays'][locale.languageCode]; String get pleaseEnterRemarks => - localizedValues['pleaseEnterRemarks']![locale.languageCode]!; + localizedValues['pleaseEnterRemarks'][locale.languageCode]; - String get update => localizedValues['update']![locale.languageCode]!; + String get update => localizedValues['update'][locale.languageCode]; - String get admission => localizedValues['admission']![locale.languageCode]!; + String get admission => localizedValues['admission'][locale.languageCode]; - String get request => localizedValues['request']![locale.languageCode]!; + String get request => localizedValues['request'][locale.languageCode]; String get admissionRequest => - localizedValues['admissionRequest']![locale.languageCode]!; + localizedValues['admissionRequest'][locale.languageCode]; String get patientDetails => - localizedValues['patientDetails']![locale.languageCode]!; + localizedValues['patientDetails'][locale.languageCode]; String get specialityAndDoctorDetail => - localizedValues['specialityAndDoctorDetail']![locale.languageCode]!; + localizedValues['specialityAndDoctorDetail'][locale.languageCode]; String get referringDate => - localizedValues['referringDate']![locale.languageCode]!; + localizedValues['referringDate'][locale.languageCode]; String get referringDoctor => - localizedValues['referringDoctor']![locale.languageCode]!; + localizedValues['referringDoctor'][locale.languageCode]; String get otherInformation => - localizedValues['otherInformation']![locale.languageCode]!; + localizedValues['otherInformation'][locale.languageCode]; String get expectedDays => - localizedValues['expectedDays']![locale.languageCode]!; + localizedValues['expectedDays'][locale.languageCode]; String get expectedAdmissionDate => - localizedValues['expectedAdmissionDate']![locale.languageCode]!; + localizedValues['expectedAdmissionDate'][locale.languageCode]; String get emergencyAdmission => - localizedValues['emergencyAdmission']![locale.languageCode]!; + localizedValues['emergencyAdmission'][locale.languageCode]; String get isSickLeaveRequired => - localizedValues['isSickLeaveRequired']![locale.languageCode]!; + localizedValues['isSickLeaveRequired'][locale.languageCode]; String get patientPregnant => - localizedValues['patientPregnant']![locale.languageCode]!; + localizedValues['patientPregnant'][locale.languageCode]; String get treatmentLine => - localizedValues['treatmentLine']![locale.languageCode]!; + localizedValues['treatmentLine'][locale.languageCode]; - String get ward => localizedValues['ward']![locale.languageCode]!; + String get ward => localizedValues['ward'][locale.languageCode]; String get preAnesthesiaReferred => - localizedValues['preAnesthesiaReferred']![locale.languageCode]!; + localizedValues['preAnesthesiaReferred'][locale.languageCode]; String get admissionType => - localizedValues['admissionType']![locale.languageCode]!; + localizedValues['admissionType'][locale.languageCode]; - String get diagnosis => localizedValues['diagnosis']![locale.languageCode]!; + String get diagnosis => localizedValues['diagnosis'][locale.languageCode]; - String get allergies => localizedValues['allergies']![locale.languageCode]!; + String get allergies => localizedValues['allergies'][locale.languageCode]; String get preOperativeOrders => - localizedValues['preOperativeOrders']![locale.languageCode]!; + localizedValues['preOperativeOrders'][locale.languageCode]; String get elementForImprovement => - localizedValues['elementForImprovement']![locale.languageCode]!; + localizedValues['elementForImprovement'][locale.languageCode]; String get dischargeDate => - localizedValues['dischargeDate']![locale.languageCode]!; + localizedValues['dischargeDate'][locale.languageCode]; - String get dietType => localizedValues['dietType']![locale.languageCode]!; + String get dietType => localizedValues['dietType'][locale.languageCode]; String get dietTypeRemarks => - localizedValues['dietTypeRemarks']![locale.languageCode]!; + localizedValues['dietTypeRemarks'][locale.languageCode]; - String get save => localizedValues['save']![locale.languageCode]!; + String get save => localizedValues['save'][locale.languageCode]; String get postPlansEstimatedCost => - localizedValues['postPlansEstimatedCost']![locale.languageCode]!; + localizedValues['postPlansEstimatedCost'][locale.languageCode]; - String get postPlans => localizedValues['postPlans']![locale.languageCode]!; + String get postPlans => localizedValues['postPlans'][locale.languageCode]; - String get ucaf => localizedValues['ucaf']![locale.languageCode]!; + String get ucaf => localizedValues['ucaf'][locale.languageCode]; String get emergencyCase => - localizedValues['emergencyCase']![locale.languageCode]!; + localizedValues['emergencyCase'][locale.languageCode]; String get durationOfIllness => - localizedValues['durationOfIllness']![locale.languageCode]!; + localizedValues['durationOfIllness'][locale.languageCode]; String get chiefComplaintsAndSymptoms => - localizedValues['chiefComplaintsAndSymptoms']![locale.languageCode]!; + localizedValues['chiefComplaintsAndSymptoms'][locale.languageCode]; - String get patientFeelsPainInHisBackAndCough => localizedValues[ - 'patientFeelsPainInHisBackAndCough']![locale.languageCode]!; + String get patientFeelsPainInHisBackAndCough => + localizedValues['patientFeelsPainInHisBackAndCough'][locale.languageCode]; String get additionalTextComplaints => - localizedValues['additionalTextComplaints']![locale.languageCode]!; + localizedValues['additionalTextComplaints'][locale.languageCode]; String get otherConditions => - localizedValues['otherConditions']![locale.languageCode]!; + localizedValues['otherConditions'][locale.languageCode]; - String get other => localizedValues['other']![locale.languageCode]!; + String get other => localizedValues['other'][locale.languageCode]; - String get how => localizedValues['how']![locale.languageCode]!; + String get how => localizedValues['how'][locale.languageCode]; - String get when => localizedValues['when']![locale.languageCode]!; + String get when => localizedValues['when'][locale.languageCode]; - String get where => localizedValues['where']![locale.languageCode]!; + String get where => localizedValues['where'][locale.languageCode]; String get specifyPossibleLineManagement => - localizedValues['specifyPossibleLineManagement']![locale.languageCode]!; + localizedValues['specifyPossibleLineManagement'][locale.languageCode]; String get significantSigns => - localizedValues['significantSigns']![locale.languageCode]!; + localizedValues['significantSigns'][locale.languageCode]; - String get backAbdomen => - localizedValues['backAbdomen']![locale.languageCode]!; + String get backAbdomen => localizedValues['backAbdomen'][locale.languageCode]; - String get reasons => localizedValues['reasons']![locale.languageCode]!; + String get reasons => localizedValues['reasons'][locale.languageCode]; - String get createNew => localizedValues['createNew']![locale.languageCode]!; + String get createNew => localizedValues['createNew'][locale.languageCode]; - String get episode => localizedValues['episode']![locale.languageCode]!; + String get episode => localizedValues['episode'][locale.languageCode]; - String get medications => - localizedValues['medications']![locale.languageCode]!; + String get medications => localizedValues['medications'][locale.languageCode]; - String get medication => localizedValues['medication']![locale.languageCode]!; + String get medication => localizedValues['medication'][locale.languageCode]; - String get doctorComments => - localizedValues['doctorComments']![locale.languageCode]!; + String get doctorComments => localizedValues['doctorComments'][locale.languageCode]; - String get statusDescription => - localizedValues['statusDescription']![locale.languageCode]!; + String get statusDescription => localizedValues['statusDescription'][locale.languageCode]; - String get createdByName => - localizedValues['createdByName']![locale.languageCode]!; + String get createdByName => localizedValues['createdByName'][locale.languageCode]; - String get procedures => localizedValues['procedures']![locale.languageCode]!; + String get procedures => localizedValues['procedures'][locale.languageCode]; String get chiefComplaints => - localizedValues['chiefComplaints']![locale.languageCode]!; + localizedValues['chiefComplaints'][locale.languageCode]; - String get histories => localizedValues['histories']![locale.languageCode]!; + String get histories => localizedValues['histories'][locale.languageCode]; String get allergiesSoap => - localizedValues['allergiesSoap']![locale.languageCode]!; + localizedValues['allergiesSoap'][locale.languageCode]; String get addChiefComplaints => - localizedValues['addChiefComplaints']![locale.languageCode]!; + localizedValues['addChiefComplaints'][locale.languageCode]; String get historyOfPresentIllness => - localizedValues['historyOfPresentIllness']![locale.languageCode]!; + localizedValues['historyOfPresentIllness'][locale.languageCode]; - String get requiredMsg => - localizedValues['requiredMsg']![locale.languageCode]!; + String get requiredMsg => localizedValues['requiredMsg'][locale.languageCode]; - String get addHistory => localizedValues['addHistory']![locale.languageCode]!; + String get addHistory => localizedValues['addHistory'][locale.languageCode]; String get searchHistory => - localizedValues['searchHistory']![locale.languageCode]!; + localizedValues['searchHistory'][locale.languageCode]; String get addSelectedHistories => - localizedValues['addSelectedHistories']![locale.languageCode]!; + localizedValues['addSelectedHistories'][locale.languageCode]; String get addAllergies => - localizedValues['addAllergies']![locale.languageCode]!; + localizedValues['addAllergies'][locale.languageCode]; - String get itemExist => localizedValues['itemExist']![locale.languageCode]!; + String get itemExist => localizedValues['itemExist'][locale.languageCode]; String get selectAllergy => - localizedValues['selectAllergy']![locale.languageCode]!; + localizedValues['selectAllergy'][locale.languageCode]; String get selectSeverity => - localizedValues['selectSeverity']![locale.languageCode]!; + localizedValues['selectSeverity'][locale.languageCode]; String get leaveCreated => - localizedValues['leaveCreated']![locale.languageCode]!; + localizedValues['leaveCreated'][locale.languageCode]; String get vitalSignEmptyMsg => - localizedValues['vitalSignEmptyMsg']![locale.languageCode]!; + localizedValues['vitalSignEmptyMsg'][locale.languageCode]; String get referralEmptyMsg => - localizedValues['referralEmptyMsg']![locale.languageCode]!; + localizedValues['referralEmptyMsg'][locale.languageCode]; String get referralSuccessMsg => - localizedValues['referralSuccessMsg']![locale.languageCode]!; + localizedValues['referralSuccessMsg'][locale.languageCode]; String get diagnoseType => - localizedValues['diagnoseType']![locale.languageCode]!; + localizedValues['diagnoseType'][locale.languageCode]; - String get condition => localizedValues['condition']![locale.languageCode]!; + String get condition => localizedValues['condition'][locale.languageCode]; - String get id => localizedValues['id']![locale.languageCode]!; + String get id => localizedValues['id'][locale.languageCode]; - String get quantity => localizedValues['quantity']![locale.languageCode]!; + String get quantity => localizedValues['quantity'][locale.languageCode]; - String get durDays => localizedValues['durDays']![locale.languageCode]!; + String get durDays => localizedValues['durDays'][locale.languageCode]; - String get codeNo => localizedValues['codeNo']![locale.languageCode]!; + String get codeNo => localizedValues['codeNo'][locale.languageCode]; - String get covered => localizedValues['covered']![locale.languageCode]!; + String get covered => localizedValues['covered'][locale.languageCode]; String get approvalRequired => - localizedValues['approvalRequired']![locale.languageCode]!; + localizedValues['approvalRequired'][locale.languageCode]; String get uncoveredByDoctor => - localizedValues['uncoveredByDoctor']![locale.languageCode]!; + localizedValues['uncoveredByDoctor'][locale.languageCode]; String get chiefComplaintEmptyMsg => - localizedValues['chiefComplaintEmptyMsg']![locale.languageCode]!; + localizedValues['chiefComplaintEmptyMsg'][locale.languageCode]; String get moreVerification => - localizedValues['more-verify']![locale.languageCode]!; + localizedValues['more-verify'][locale.languageCode]; String get welcomeBack => - localizedValues['welcome-back']![locale.languageCode]!; + localizedValues['welcome-back'][locale.languageCode]; String get accountInfo => - localizedValues['account-info']![locale.languageCode]!; + localizedValues['account-info'][locale.languageCode]; String get useAnotherAccount => - localizedValues['another-acc']![locale.languageCode]!; + localizedValues['another-acc'][locale.languageCode]; String get verifyLoginWith => - localizedValues['verify-login-with']![locale.languageCode]!; + localizedValues['verify-login-with'][locale.languageCode]; - String get register => - localizedValues['register-user']![locale.languageCode]!; + String get register => localizedValues['register-user'][locale.languageCode]; String get verifyFingerprint => - localizedValues['verify-with-fingerprint']![locale.languageCode]!; + localizedValues['verify-with-fingerprint'][locale.languageCode]; String get verifyFaceID => - localizedValues['verify-with-faceid']![locale.languageCode]!; + localizedValues['verify-with-faceid'][locale.languageCode]; String get verifySMS => - localizedValues['verify-with-sms']![locale.languageCode]!; + localizedValues['verify-with-sms'][locale.languageCode]; - String get verifyWith => - localizedValues['verify-with']![locale.languageCode]!; + String get verifyWith => localizedValues['verify-with'][locale.languageCode]; String get verifyWhatsApp => - localizedValues['verify-with-whatsapp']![locale.languageCode]!; + localizedValues['verify-with-whatsapp'][locale.languageCode]; - String get lastLoginAt => - localizedValues['last-login']![locale.languageCode]!; + String get lastLoginAt => localizedValues['last-login'][locale.languageCode]; String get lastLoginWith => - localizedValues['last-login-with']![locale.languageCode]!; + localizedValues['last-login-with'][locale.languageCode]; String get verifyFingerprint2 => - localizedValues['verify-fingerprint']![locale.languageCode]!; + localizedValues['verify-fingerprint'][locale.languageCode]; String get verificationMessage => - localizedValues['verification_message']![locale.languageCode]!; + localizedValues['verification_message'][locale.languageCode]; String get validationMessage => - localizedValues['validation_message']![locale.languageCode]!; + localizedValues['validation_message'][locale.languageCode]; String get addAssessment => - localizedValues['addAssessment']![locale.languageCode]!; + localizedValues['addAssessment'][locale.languageCode]; - String get assessment => localizedValues['assessment']![locale.languageCode]!; + String get assessment => localizedValues['assessment'][locale.languageCode]; String get physicalSystemExamination => - localizedValues['physicalSystemExamination']![locale.languageCode]!; + localizedValues['physicalSystemExamination'][locale.languageCode]; String get searchExamination => - localizedValues['searchExamination']![locale.languageCode]!; + localizedValues['searchExamination'][locale.languageCode]; String get addExamination => - localizedValues['addExamination']![locale.languageCode]!; + localizedValues['addExamination'][locale.languageCode]; - String get doc => localizedValues['doc']![locale.languageCode]!; + String get doc => localizedValues['doc'][locale.languageCode]; - String get allergicTO => localizedValues['allergicTO']![locale.languageCode]!; + String get allergicTO => localizedValues['allergicTO'][locale.languageCode]; - String get normal => localizedValues['normal']![locale.languageCode]!; + String get normal => localizedValues['normal'][locale.languageCode]; - String get notExamined => - localizedValues['notExamined']![locale.languageCode]!; + String get notExamined => localizedValues['notExamined'][locale.languageCode]; - String get abnormal => localizedValues['abnormal']![locale.languageCode]!; + String get abnormal => localizedValues['abnormal'][locale.languageCode]; String get patientNoDetailErrMsg => - localizedValues['patientNoDetailErrMsg']![locale.languageCode]!; + localizedValues['patientNoDetailErrMsg'][locale.languageCode]; String get systolicLng => - localizedValues['systolic-lng']![locale.languageCode]!; + localizedValues['systolic-lng'][locale.languageCode]; String get diastolicLng => - localizedValues['diastolic-lng']![locale.languageCode]!; + localizedValues['diastolic-lng'][locale.languageCode]; - String get mass => localizedValues['mass']![locale.languageCode]!; + String get mass => localizedValues['mass'][locale.languageCode]; - String get tempC => localizedValues['temp-c']![locale.languageCode]!; + String get tempC => localizedValues['temp-c'][locale.languageCode]; - String get bpm => localizedValues['bpm']![locale.languageCode]!; + String get bpm => localizedValues['bpm'][locale.languageCode]; String get respirationSigns => - localizedValues['respiration-signs']![locale.languageCode]!; + localizedValues['respiration-signs'][locale.languageCode]; - String get sysDias => localizedValues['sys-dias']![locale.languageCode]!; + String get sysDias => localizedValues['sys-dias'][locale.languageCode]; - String get body => localizedValues['body']![locale.languageCode]!; + String get body => localizedValues['body'][locale.languageCode]; String get respirationRate => - localizedValues['respirationRate']![locale.languageCode]!; + localizedValues['respirationRate'][locale.languageCode]; - String get heart => localizedValues['heart']![locale.languageCode]!; + String get heart => localizedValues['heart'][locale.languageCode]; String get medicalReport => - localizedValues['medicalReport']![locale.languageCode]!; + localizedValues['medicalReport'][locale.languageCode]; - String get visitDate => localizedValues['visitDate']![locale.languageCode]!; + String get visitDate => localizedValues['visitDate'][locale.languageCode]; - String get test => localizedValues['test']![locale.languageCode]!; + String get test => localizedValues['test'][locale.languageCode]; String get addMoreProcedure => - localizedValues['addMoreProcedure']![locale.languageCode]!; + localizedValues['addMoreProcedure'][locale.languageCode]; - String get regular => localizedValues['regular']![locale.languageCode]!; + String get regular => localizedValues['regular'][locale.languageCode]; String get searchProcedures => - localizedValues['searchProcedures']![locale.languageCode]!; + localizedValues['searchProcedures'][locale.languageCode]; String get procedureCategorise => - localizedValues['procedureCategorise']![locale.languageCode]!; + localizedValues['procedureCategorise'][locale.languageCode]; String get selectProcedures => - localizedValues['selectProcedures']![locale.languageCode]!; + localizedValues['selectProcedures'][locale.languageCode]; String get addSelectedProcedures => - localizedValues['addSelectedProcedures']![locale.languageCode]!; + localizedValues['addSelectedProcedures'][locale.languageCode]; String get addProcedures => - localizedValues['addProcedures']![locale.languageCode]!; + localizedValues['addProcedures'][locale.languageCode]; String get updateProcedure => - localizedValues['updateProcedure']![locale.languageCode]!; + localizedValues['updateProcedure'][locale.languageCode]; String get orderProcedure => - localizedValues['orderProcedure']![locale.languageCode]!; + localizedValues['orderProcedure'][locale.languageCode]; - String get nameOrICD => localizedValues['nameOrICD']![locale.languageCode]!; + String get nameOrICD => localizedValues['nameOrICD'][locale.languageCode]; - String get dType => localizedValues['dType']![locale.languageCode]!; + String get dType => localizedValues['dType'][locale.languageCode]; String get addAssessmentDetails => - localizedValues['addAssessmentDetails']![locale.languageCode]!; + localizedValues['addAssessmentDetails'][locale.languageCode]; String get progressNoteSOAP => - localizedValues['progressNoteSOAP']![locale.languageCode]!; + localizedValues['progressNoteSOAP'][locale.languageCode]; String get addProgressNote => - localizedValues['addProgressNote']![locale.languageCode]!; + localizedValues['addProgressNote'][locale.languageCode]; - String get createdBy => localizedValues['createdBy']![locale.languageCode]!; + String get createdBy => localizedValues['createdBy'][locale.languageCode]; - String get riskScore => localizedValues['riskScore']![locale.languageCode]!; + String get riskScore => localizedValues['riskScore'][locale.languageCode]; - String get editedBy => localizedValues['editedBy']![locale.languageCode]!; + String get editedBy => localizedValues['editedBy'][locale.languageCode]; String get currentMedications => - localizedValues['currentMedications']![locale.languageCode]!; + localizedValues['currentMedications'][locale.languageCode]; - String get noItem => localizedValues['noItem']![locale.languageCode]!; + String get noItem => localizedValues['noItem'][locale.languageCode]; String get postUcafSuccessMsg => - localizedValues['postUcafSuccessMsg']![locale.languageCode]!; + localizedValues['postUcafSuccessMsg'][locale.languageCode]; String get vitalSignDetailEmpty => - localizedValues['vitalSignDetailEmpty']![locale.languageCode]!; + localizedValues['vitalSignDetailEmpty'][locale.languageCode]; String get onlyOfftimeHoliday => - localizedValues['onlyOfftimeHoliday']![locale.languageCode]!; + localizedValues['onlyOfftimeHoliday'][locale.languageCode]; - String get active => localizedValues['active']![locale.languageCode]!; + String get active => localizedValues['active'][locale.languageCode]; - String get hold => localizedValues['hold']![locale.languageCode]!; + String get hold => localizedValues['hold'][locale.languageCode]; - String get loading => localizedValues['loading']![locale.languageCode]!; + String get loading => localizedValues['loading'][locale.languageCode]; String get assessmentErrorMsg => - localizedValues['assessmentErrorMsg']![locale.languageCode]!; + localizedValues['assessmentErrorMsg'][locale.languageCode]; String get examinationErrorMsg => - localizedValues['examinationErrorMsg']![locale.languageCode]!; + localizedValues['examinationErrorMsg'][locale.languageCode]; String get progressNoteErrorMsg => - localizedValues['progressNoteErrorMsg']![locale.languageCode]!; + localizedValues['progressNoteErrorMsg'][locale.languageCode]; String get chiefComplaintErrorMsg => - localizedValues['chiefComplaintErrorMsg']![locale.languageCode]!; + localizedValues['chiefComplaintErrorMsg'][locale.languageCode]; - String get ICDName => localizedValues['ICDName']![locale.languageCode]!; + String get ICDName => localizedValues['ICDName'][locale.languageCode]; String get referralStatus => - localizedValues['referralStatus']![locale.languageCode]!; + localizedValues['referralStatus'][locale.languageCode]; String get referralRemark => - localizedValues['referralRemark']![locale.languageCode]!; + localizedValues['referralRemark'][locale.languageCode]; - String get offTime => localizedValues['offTime']![locale.languageCode]!; + String get offTime => localizedValues['offTime'][locale.languageCode]; - String get icd => localizedValues['icd']![locale.languageCode]!; + String get icd => localizedValues['icd'][locale.languageCode]; - String get days => localizedValues['days']![locale.languageCode]!; + String get days => localizedValues['days'][locale.languageCode]; - String get hr => localizedValues['hr']![locale.languageCode]!; + String get hr => localizedValues['hr'][locale.languageCode]; - String get min => localizedValues['min']![locale.languageCode]!; + String get min => localizedValues['min'][locale.languageCode]; - String get months => localizedValues['months']![locale.languageCode]!; + String get months => localizedValues['months'][locale.languageCode]; - String get years => localizedValues['years']![locale.languageCode]!; + String get years => localizedValues['years'][locale.languageCode]; String get referralStatusHold => - localizedValues['referralStatusHold']![locale.languageCode]!; + localizedValues['referralStatusHold'][locale.languageCode]; String get referralStatusActive => - localizedValues['referralStatusActive']![locale.languageCode]!; + localizedValues['referralStatusActive'][locale.languageCode]; String get referralStatusCancelled => - localizedValues['referralStatusCancelled']![locale.languageCode]!; + localizedValues['referralStatusCancelled'][locale.languageCode]; String get referralStatusCompleted => - localizedValues['referralStatusCompleted']![locale.languageCode]!; + localizedValues['referralStatusCompleted'][locale.languageCode]; String get referralStatusNotSeen => - localizedValues['referralStatusNotSeen']![locale.languageCode]!; + localizedValues['referralStatusNotSeen'][locale.languageCode]; String get clinicSearch => - localizedValues['clinicSearch']![locale.languageCode]!; + localizedValues['clinicSearch'][locale.languageCode]; String get doctorSearch => - localizedValues['doctorSearch']![locale.languageCode]!; + localizedValues['doctorSearch'][locale.languageCode]; String get referralResponse => - localizedValues['referralResponse']![locale.languageCode]!; + localizedValues['referralResponse'][locale.languageCode]; String get estimatedCost => - localizedValues['estimatedCost']![locale.languageCode]!; + localizedValues['estimatedCost'][locale.languageCode]; String get diagnosisDetail => - localizedValues['diagnosisDetail']![locale.languageCode]!; + localizedValues['diagnosisDetail'][locale.languageCode]; String get referralSuccessMsgAccept => - localizedValues['referralSuccessMsgAccept']![locale.languageCode]!; + localizedValues['referralSuccessMsgAccept'][locale.languageCode]; String get referralSuccessMsgReject => - localizedValues['referralSuccessMsgReject']![locale.languageCode]!; + localizedValues['referralSuccessMsgReject'][locale.languageCode]; String get patientName => - localizedValues['patient-name']![locale.languageCode]!; + localizedValues['patient-name'][locale.languageCode]; String get appointmentNumber => - localizedValues['appointmentNumber']![locale.languageCode]!; + localizedValues['appointmentNumber'][locale.languageCode]; String get sickLeaveComments => - localizedValues['sickLeaveComments']![locale.languageCode]!; + localizedValues['sickLeaveComments'][locale.languageCode]; String get pastMedicalHistory => - localizedValues['pastMedicalHistory']![locale.languageCode]!; + localizedValues['pastMedicalHistory'][locale.languageCode]; String get pastSurgicalHistory => - localizedValues['pastSurgicalHistory']![locale.languageCode]!; + localizedValues['pastSurgicalHistory'][locale.languageCode]; String get complications => - localizedValues['complications']![locale.languageCode]!; + localizedValues['complications'][locale.languageCode]; - String get floor => localizedValues['floor']![locale.languageCode]!; + String get floor => localizedValues['floor'][locale.languageCode]; String get roomCategory => - localizedValues['roomCategory']![locale.languageCode]!; + localizedValues['roomCategory'][locale.languageCode]; String get otherDepartmentsInterventions => - localizedValues['otherDepartmentsInterventions']![locale.languageCode]!; + localizedValues['otherDepartmentsInterventions'][locale.languageCode]; String get otherProcedure => - localizedValues['otherProcedure']![locale.languageCode]!; + localizedValues['otherProcedure'][locale.languageCode]; String get admissionRequestSuccessMsg => - localizedValues['admissionRequestSuccessMsg']![locale.languageCode]!; + localizedValues['admissionRequestSuccessMsg'][locale.languageCode]; - String get infoStatus => localizedValues['infoStatus']![locale.languageCode]!; + String get infoStatus => localizedValues['infoStatus'][locale.languageCode]; String get doctorResponse => - localizedValues['doctorResponse']![locale.languageCode]!; + localizedValues['doctorResponse'][locale.languageCode]; String get sickleaveonhold => - localizedValues['sickleaveonhold']![locale.languageCode]!; + localizedValues['sickleaveonhold'][locale.languageCode]; - String get noClinic => localizedValues['no-clinic']![locale.languageCode]!; + String get noClinic => localizedValues['no-clinic'][locale.languageCode]; String get otherStatistic => - localizedValues['otherStatistic']![locale.languageCode]!; + localizedValues['otherStatistic'][locale.languageCode]; String get patientsreferral => - localizedValues['ptientsreferral']![locale.languageCode]!; + localizedValues['ptientsreferral'][locale.languageCode]; String get myPatientsReferral => - localizedValues['myPatientsReferral']![locale.languageCode]!; + localizedValues['myPatientsReferral'][locale.languageCode]; String get arrivalpatient => - localizedValues['arrivalpatient']![locale.languageCode]!; + localizedValues['arrivalpatient'][locale.languageCode]; String get searchmedicinepatient => - localizedValues['searchmedicinepatient']![locale.languageCode]!; + localizedValues['searchmedicinepatient'][locale.languageCode]; String get appointmentDate => - localizedValues['appointmentDate']![locale.languageCode]!; + localizedValues['appointmentDate'][locale.languageCode]; - String get arrivedP => localizedValues['arrived_p']![locale.languageCode]!; + String get arrivedP => localizedValues['arrived_p'][locale.languageCode]; - String get details => localizedValues['details']![locale.languageCode]!; + String get details => localizedValues['details'][locale.languageCode]; - String get liveCare => localizedValues['liveCare']![locale.languageCode]!; + String get liveCare => localizedValues['liveCare'][locale.languageCode]; - String get outpatient => - localizedValues['out-patient']![locale.languageCode]!; + String get outpatient => localizedValues['out-patient'][locale.languageCode]; - String get billNo => localizedValues['BillNo']![locale.languageCode]!; + String get billNo => localizedValues['BillNo'][locale.languageCode]; - String get labResults => localizedValues['labResults']![locale.languageCode]!; + String get labResults => localizedValues['labResults'][locale.languageCode]; - String get sendSuc => localizedValues['sendSuc']![locale.languageCode]!; + String get sendSuc => localizedValues['sendSuc'][locale.languageCode]; String get specialResult => - localizedValues['SpecialResult']![locale.languageCode]!; + localizedValues['SpecialResult'][locale.languageCode]; String get noDataAvailable => - localizedValues['noDataAvailable']![locale.languageCode]!; + localizedValues['noDataAvailable'][locale.languageCode]; String get showMoreBtn => - localizedValues['show-more-btn']![locale.languageCode]!; + localizedValues['show-more-btn'][locale.languageCode]; - String get showDetail => localizedValues['showDetail']![locale.languageCode]!; + String get showDetail => localizedValues['showDetail'][locale.languageCode]; - String get viewProfile => - localizedValues['viewProfile']![locale.languageCode]!; + String get viewProfile => localizedValues['viewProfile'][locale.languageCode]; - String get fileNumber => localizedValues['fileNumber']![locale.languageCode]!; + String get fileNumber => localizedValues['fileNumber'][locale.languageCode]; - String get reschedule => localizedValues['reschedule']![locale.languageCode]!; + String get reschedule => localizedValues['reschedule'][locale.languageCode]; - String get leaves => localizedValues['leaves']![locale.languageCode]!; + String get leaves => localizedValues['leaves'][locale.languageCode]; - String get openRad => localizedValues['open-rad']![locale.languageCode]!; + String get openRad => localizedValues['open-rad'][locale.languageCode]; String get totalApproval => - localizedValues['totalApproval']![locale.languageCode]!; + localizedValues['totalApproval'][locale.languageCode]; String get procedureStatus => - localizedValues['procedureStatus']![locale.languageCode]!; + localizedValues['procedureStatus'][locale.languageCode]; - String get unusedCount => - localizedValues['unusedCount']![locale.languageCode]!; + String get unusedCount => localizedValues['unusedCount'][locale.languageCode]; - String get companyName => - localizedValues['companyName']![locale.languageCode]!; + String get companyName => localizedValues['companyName'][locale.languageCode]; String get procedureName => - localizedValues['procedureName']![locale.languageCode]!; + localizedValues['procedureName'][locale.languageCode]; - String get usageStatus => - localizedValues['usageStatus']![locale.languageCode]!; + String get usageStatus => localizedValues['usageStatus'][locale.languageCode]; String get prescriptions => - localizedValues['prescriptions']![locale.languageCode]!; + localizedValues['prescriptions'][locale.languageCode]; - String get notes => localizedValues['notes']![locale.languageCode]!; + String get notes => localizedValues['notes'][locale.languageCode]; - String get dailyDoses => localizedValues['dailyDoses']![locale.languageCode]!; + String get dailyDoses => localizedValues['dailyDoses'][locale.languageCode]; String get searchWithOther => - localizedValues['searchWithOther']![locale.languageCode]!; + localizedValues['searchWithOther'][locale.languageCode]; String get hideOtherCriteria => - localizedValues['hideOtherCriteria']![locale.languageCode]!; + localizedValues['hideOtherCriteria'][locale.languageCode]; String get applyForReschedule => - localizedValues['applyForReschedule']![locale.languageCode]!; + localizedValues['applyForReschedule'][locale.languageCode]; - String get startDate => localizedValues['startDate']![locale.languageCode]!; + String get startDate => localizedValues['startDate'][locale.languageCode]; - String get endDate => localizedValues['endDate']![locale.languageCode]!; + String get endDate => localizedValues['endDate'][locale.languageCode]; String get addReschedule => - localizedValues['add-reschedule']![locale.languageCode]!; + localizedValues['add-reschedule'][locale.languageCode]; String get updateReschedule => - localizedValues['update-reschedule']![locale.languageCode]!; + localizedValues['update-reschedule'][locale.languageCode]; - String get sickLeave => localizedValues['sick_leave']![locale.languageCode]!; + String get sickLeave => localizedValues['sick_leave'][locale.languageCode]; - String get accepted => localizedValues['accepted']![locale.languageCode]!; + String get accepted => localizedValues['accepted'][locale.languageCode]; - String get cancelled => localizedValues['cancelled']![locale.languageCode]!; + String get cancelled => localizedValues['cancelled'][locale.languageCode]; - String get unReplied => localizedValues['unReplied']![locale.languageCode]!; + String get unReplied => localizedValues['unReplied'][locale.languageCode]; - String get replied => localizedValues['replied']![locale.languageCode]!; + String get replied => localizedValues['replied'][locale.languageCode]; String get typeHereToReply => - localizedValues['typeHereToReply']![locale.languageCode]!; + localizedValues['typeHereToReply'][locale.languageCode]; - String get searchHere => localizedValues['searchHere']![locale.languageCode]!; + String get searchHere => localizedValues['searchHere'][locale.languageCode]; - String get remove => localizedValues['remove']![locale.languageCode]!; + String get remove => localizedValues['remove'][locale.languageCode]; - String get inProgress => localizedValues['inProgress']![locale.languageCode]!; + String get inProgress => localizedValues['inProgress'][locale.languageCode]; - String get completed => localizedValues['Completed']![locale.languageCode]!; + String get completed => localizedValues['Completed'][locale.languageCode]; - String get locked => localizedValues['Locked']![locale.languageCode]!; + String get locked => localizedValues['Locked'][locale.languageCode]; - String get step => localizedValues['step']![locale.languageCode]!; + String get step => localizedValues['step'][locale.languageCode]; String get fieldRequired => - localizedValues['fieldRequired']![locale.languageCode]!; + localizedValues['fieldRequired'][locale.languageCode]; - String get noSickLeave => - localizedValues['no-sickleve']![locale.languageCode]!; + String get noSickLeave => localizedValues['no-sickleve'][locale.languageCode]; String get changeOfSchedule => - localizedValues['changeOfSchedule']![locale.languageCode]!; + localizedValues['changeOfSchedule'][locale.languageCode]; - String get newSchedule => - localizedValues['newSchedule']![locale.languageCode]!; + String get newSchedule => localizedValues['newSchedule'][locale.languageCode]; String get enterCredentials => - localizedValues['enter_credentials']![locale.languageCode]!; + localizedValues['enter_credentials'][locale.languageCode]; String get patpatientIDMobilenationalientID => - localizedValues['patientIDMobilenational']![locale.languageCode]!; + localizedValues['patientIDMobilenational'][locale.languageCode]; - String get updateNow => localizedValues['updateNow']![locale.languageCode]!; + String get updateNow => localizedValues['updateNow'][locale.languageCode]; String get updateTheApp => - localizedValues['updateTheApp']![locale.languageCode]!; + localizedValues['updateTheApp'][locale.languageCode]; String get admissionDate => - localizedValues['admission-date']![locale.languageCode]!; + localizedValues['admission-date'][locale.languageCode]; - String get noOfDays => localizedValues['noOfDays']![locale.languageCode]!; + String get noOfDays => localizedValues['noOfDays'][locale.languageCode]; - String get numOfDays => localizedValues['numOfDays']![locale.languageCode]!; + String get numOfDays => localizedValues['numOfDays'][locale.languageCode]; String get replayBefore => - localizedValues['replayBefore']![locale.languageCode]!; + localizedValues['replayBefore'][locale.languageCode]; - String get trySaying => localizedValues["try-saying"]![locale.languageCode]!; + String get trySaying => localizedValues["try-saying"][locale.languageCode]; String get acknowledged => - localizedValues['acknowledged']![locale.languageCode]!; + localizedValues['acknowledged'][locale.languageCode]; - String get didntCatch => localizedValues["didntCatch"]![locale.languageCode]!; + String get didntCatch => localizedValues["didntCatch"][locale.languageCode]; String get pleaseEnterProcedure => - localizedValues["pleaseEnterProcedure"]![locale.languageCode]!; + localizedValues["pleaseEnterProcedure"][locale.languageCode]; - String get fillTheMandatoryProcedureDetails => localizedValues[ - "fillTheMandatoryProcedureDetails"]![locale.languageCode]!; + String get fillTheMandatoryProcedureDetails => + localizedValues["fillTheMandatoryProcedureDetails"][locale.languageCode]; String get atLeastThreeCharacters => - localizedValues["atLeastThreeCharacters"]![locale.languageCode]!; + localizedValues["atLeastThreeCharacters"][locale.languageCode]; String get searchProcedureHere => - localizedValues["searchProcedureHere"]![locale.languageCode]!; + localizedValues["searchProcedureHere"][locale.languageCode]; String get noInsuranceApprovalFound => - localizedValues["noInsuranceApprovalFound"]![locale.languageCode]!; + localizedValues["noInsuranceApprovalFound"][locale.languageCode]; - String get procedure => localizedValues["procedure"]![locale.languageCode]!; + String get procedure => localizedValues["procedure"][locale.languageCode]; - String get stopDate => localizedValues["stopDate"]![locale.languageCode]!; + String get stopDate => localizedValues["stopDate"][locale.languageCode]; - String get processed => localizedValues["processed"]![locale.languageCode]!; + String get processed => localizedValues["processed"][locale.languageCode]; - String get direction => localizedValues["direction"]![locale.languageCode]!; + String get direction => localizedValues["direction"][locale.languageCode]; - String get refill => localizedValues["refill"]![locale.languageCode]!; + String get refill => localizedValues["refill"][locale.languageCode]; String get medicationHasBeenAdded => - localizedValues["medicationHasBeenAdded"]![locale.languageCode]!; + localizedValues["medicationHasBeenAdded"][locale.languageCode]; String get newPrescriptionOrder => - localizedValues["newPrescriptionOrder"]![locale.languageCode]!; + localizedValues["newPrescriptionOrder"][locale.languageCode]; String get pleaseFillAllFields => - localizedValues["pleaseFillAllFields"]![locale.languageCode]!; + localizedValues["pleaseFillAllFields"][locale.languageCode]; String get narcoticMedicineCanOnlyBePrescribedFromVida => localizedValues["narcoticMedicineCanOnlyBePrescribedFromVida"] - ![locale.languageCode]!; + [locale.languageCode]; String get only5DigitsAllowedForStrength => - localizedValues["only5DigitsAllowedForStrength"]![locale.languageCode]!; + localizedValues["only5DigitsAllowedForStrength"][locale.languageCode]; - String get unit => localizedValues["unit"]![locale.languageCode]!; + String get unit => localizedValues["unit"][locale.languageCode]; - String get boxQuantity => - localizedValues["boxQuantity"]![locale.languageCode]!; + String get boxQuantity => localizedValues["boxQuantity"][locale.languageCode]; - String get orderTestOr => - localizedValues["orderTestOr"]![locale.languageCode]!; + String get orderTestOr => localizedValues["orderTestOr"][locale.languageCode]; String get applyForRadiologyOrder => - localizedValues["applyForRadiologyOrder"]![locale.languageCode]!; + localizedValues["applyForRadiologyOrder"][locale.languageCode]; String get applyForNewLabOrder => - localizedValues["applyForNewLabOrder"]![locale.languageCode]!; + localizedValues["applyForNewLabOrder"][locale.languageCode]; - String get addLabOrder => - localizedValues["addLabOrder"]![locale.languageCode]!; + String get addLabOrder => localizedValues["addLabOrder"][locale.languageCode]; String get addRadiologyOrder => - localizedValues["addRadiologyOrder"]![locale.languageCode]!; + localizedValues["addRadiologyOrder"][locale.languageCode]; String get newRadiologyOrder => - localizedValues["newRadiologyOrder"]![locale.languageCode]!; + localizedValues["newRadiologyOrder"][locale.languageCode]; - String get orderDate => localizedValues["orderDate"]![locale.languageCode]!; + String get orderDate => localizedValues["orderDate"][locale.languageCode]; - String get examType => localizedValues["examType"]![locale.languageCode]!; + String get examType => localizedValues["examType"][locale.languageCode]; - String get health => localizedValues["health"]![locale.languageCode]!; + String get health => localizedValues["health"][locale.languageCode]; - String get summary => localizedValues["summary"]![locale.languageCode]!; + String get summary => localizedValues["summary"][locale.languageCode]; String get applyForNewPrescriptionsOrder => - localizedValues["applyForNewPrescriptionsOrder"]![locale.languageCode]!; + localizedValues["applyForNewPrescriptionsOrder"][locale.languageCode]; String get noPrescriptionsFound => - localizedValues["noPrescriptionsFound"]![locale.languageCode]!; + localizedValues["noPrescriptionsFound"][locale.languageCode]; String get noMedicalFileFound => - localizedValues["noMedicalFileFound"]![locale.languageCode]!; + localizedValues["noMedicalFileFound"][locale.languageCode]; - String get insurance22 => - localizedValues["insurance22"]![locale.languageCode]!; + String get insurance22 => localizedValues["insurance22"][locale.languageCode]; - String get approvals22 => - localizedValues["approvals22"]![locale.languageCode]!; + String get approvals22 => localizedValues["approvals22"][locale.languageCode]; - String get severe => localizedValues["severe"]![locale.languageCode]!; + String get severe => localizedValues["severe"][locale.languageCode]; String get graphDetails => - localizedValues["graphDetails"]![locale.languageCode]!; + localizedValues["graphDetails"][locale.languageCode]; - String get discharged => localizedValues["discharged"]![locale.languageCode]!; + String get discharged => localizedValues["discharged"][locale.languageCode]; String get addNewOrderSheet => - localizedValues["addNewOrderSheet"]![locale.languageCode]!; + localizedValues["addNewOrderSheet"][locale.languageCode]; String get addNewProgressNote => - localizedValues["addNewProgressNote"]![locale.languageCode]!; + localizedValues["addNewProgressNote"][locale.languageCode]; - String get notePending => - localizedValues["notePending"]![locale.languageCode]!; + String get notePending => localizedValues["notePending"][locale.languageCode]; String get noteCanceled => - localizedValues["noteCanceled"]![locale.languageCode]!; + localizedValues["noteCanceled"][locale.languageCode]; String get noteVerified => - localizedValues["noteVerified"]![locale.languageCode]!; + localizedValues["noteVerified"][locale.languageCode]; - String get noteVerify => localizedValues["noteVerify"]![locale.languageCode]!; + String get noteVerify => localizedValues["noteVerify"][locale.languageCode]; - String get noteConfirm => - localizedValues["noteConfirm"]![locale.languageCode]!; + String get noteConfirm => localizedValues["noteConfirm"][locale.languageCode]; - String get noteAdd => localizedValues["noteAdd"]![locale.languageCode]!; + String get noteAdd => localizedValues["noteAdd"][locale.languageCode]; - String get noteUpdate => localizedValues["noteUpdate"]![locale.languageCode]!; + String get noteUpdate => localizedValues["noteUpdate"][locale.languageCode]; - String get orderSheet => localizedValues["orderSheet"]![locale.languageCode]!; + String get orderSheet => localizedValues["orderSheet"][locale.languageCode]; - String get order => localizedValues["order"]![locale.languageCode]!; + String get order => localizedValues["order"][locale.languageCode]; - String get sheet => localizedValues["sheet"]![locale.languageCode]!; + String get sheet => localizedValues["sheet"][locale.languageCode]; - String get medical => localizedValues["medical"]![locale.languageCode]!; + String get medical => localizedValues["medical"][locale.languageCode]; - String get report => localizedValues["report"]![locale.languageCode]!; + String get report => localizedValues["report"][locale.languageCode]; - String get discharge => localizedValues["discharge"]![locale.languageCode]!; + String get discharge => localizedValues["discharge"][locale.languageCode]; - String get none => localizedValues["none"]![locale.languageCode]!; + String get none => localizedValues["none"][locale.languageCode]; String get notRepliedYet => - localizedValues["notRepliedYet"]![locale.languageCode]!; + localizedValues["notRepliedYet"][locale.languageCode]; - String get clearText => localizedValues["clearText"]![locale.languageCode]!; + String get clearText => localizedValues["clearText"][locale.languageCode]; String get medicalReportAdd => - localizedValues['medicalReportAdd']![locale.languageCode]!; + localizedValues['medicalReportAdd'][locale.languageCode]; String get medicalReportVerify => - localizedValues['medicalReportVerify']![locale.languageCode]!; + localizedValues['medicalReportVerify'][locale.languageCode]; - String get comments => localizedValues['comments']![locale.languageCode]!; + String get comments => localizedValues['comments'][locale.languageCode]; String get initiateCall => - localizedValues['initiateCall']![locale.languageCode]!; + localizedValues['initiateCall'][locale.languageCode]; - String get endCall => localizedValues['endCall']![locale.languageCode]!; + String get endCall => localizedValues['endCall'][locale.languageCode]; - String get transferTo => localizedValues['transferTo']![locale.languageCode]!; + String get transferTo => localizedValues['transferTo'][locale.languageCode]; - String get admin => localizedValues['admin']![locale.languageCode]!; + String get admin => localizedValues['admin'][locale.languageCode]; String get instructions => - localizedValues['instructions']![locale.languageCode]!; + localizedValues['instructions'][locale.languageCode]; - String get sendLC => localizedValues['sendLC']![locale.languageCode]!; + String get sendLC => localizedValues['sendLC'][locale.languageCode]; - String get endLC => localizedValues['endLC']![locale.languageCode]!; + String get endLC => localizedValues['endLC'][locale.languageCode]; String get consultation => - localizedValues['consultation']![locale.languageCode]!; + localizedValues['consultation'][locale.languageCode]; - String get resume => localizedValues['resume']![locale.languageCode]!; + String get resume => localizedValues['resume'][locale.languageCode]; - String get theCall => localizedValues['theCall']![locale.languageCode]!; + String get theCall => localizedValues['theCall'][locale.languageCode]; String get createNewMedicalReport => - localizedValues['createNewMedicalReport']![locale.languageCode]!; + localizedValues['createNewMedicalReport'][locale.languageCode]; String get historyPhysicalFinding => - localizedValues['historyPhysicalFinding']![locale.languageCode]!; + localizedValues['historyPhysicalFinding'][locale.languageCode]; String get laboratoryPhysicalData => - localizedValues['laboratoryPhysicalData']![locale.languageCode]!; + localizedValues['laboratoryPhysicalData'][locale.languageCode]; String get impressionRecommendation => - localizedValues['impressionRecommendation']![locale.languageCode]!; + localizedValues['impressionRecommendation'][locale.languageCode]; - String get onHold => localizedValues['onHold']![locale.languageCode]!; + String get onHold => localizedValues['onHold'][locale.languageCode]; - String get verified => localizedValues['verified']![locale.languageCode]!; + String get verified => localizedValues['verified'][locale.languageCode]; String get favoriteTemplates => - localizedValues['favoriteTemplates']![locale.languageCode]!; + localizedValues['favoriteTemplates'][locale.languageCode]; String get allProcedures => - localizedValues['allProcedures']![locale.languageCode]!; + localizedValues['allProcedures'][locale.languageCode]; String get allRadiology => - localizedValues['allRadiology']![locale.languageCode]!; + localizedValues['allRadiology'][locale.languageCode]; - String get allLab => localizedValues['allLab']![locale.languageCode]!; + String get allLab => localizedValues['allLab'][locale.languageCode]; String get allPrescription => - localizedValues['allPrescription']![locale.languageCode]!; + localizedValues['allPrescription'][locale.languageCode]; String get addPrescription => - localizedValues['addPrescription']![locale.languageCode]!; + localizedValues['addPrescription'][locale.languageCode]; - String get edit => localizedValues['edit']![locale.languageCode]!; + String get edit => localizedValues['edit'][locale.languageCode]; String get summeryReply => - localizedValues['summeryReply']![locale.languageCode]!; + localizedValues['summeryReply'][locale.languageCode]; String get severityValidationError => - localizedValues['severityValidationError']![locale.languageCode]!; + localizedValues['severityValidationError'][locale.languageCode]; String get textCopiedSuccessfully => - localizedValues['textCopiedSuccessfully']![locale.languageCode]!; + localizedValues['textCopiedSuccessfully'][locale.languageCode]; - String get roomNo => localizedValues['roomNo']![locale.languageCode]!; + String get roomNo => localizedValues['roomNo'][locale.languageCode]; - String get seeMore => localizedValues['seeMore']![locale.languageCode]!; + String get seeMore => localizedValues['seeMore'][locale.languageCode]; String get replayCallStatus => - localizedValues['replayCallStatus']![locale.languageCode]!; + localizedValues['replayCallStatus'][locale.languageCode]; String get patientArrived => - localizedValues['patientArrived']![locale.languageCode]!; + localizedValues['patientArrived'][locale.languageCode]; String get calledAndNoResponse => - localizedValues['calledAndNoResponse']![locale.languageCode]!; + localizedValues['calledAndNoResponse'][locale.languageCode]; String get underProcess => - localizedValues['underProcess']![locale.languageCode]!; + localizedValues['underProcess'][locale.languageCode]; String get textResponse => - localizedValues['textResponse']![locale.languageCode]!; + localizedValues['textResponse'][locale.languageCode]; - String get special => localizedValues['special']![locale.languageCode]!; + String get special => localizedValues['special'][locale.languageCode]; - String get requestType => - localizedValues['requestType']![locale.languageCode]!; + String get requestType => localizedValues['requestType'][locale.languageCode]; - String get allClinic => localizedValues['allClinic']![locale.languageCode]!; + String get allClinic => localizedValues['allClinic'][locale.languageCode]; - String get notReplied => localizedValues['notReplied']![locale.languageCode]!; + String get notReplied => localizedValues['notReplied'][locale.languageCode]; String get registerNewPatient => - localizedValues['registerNewPatient']![locale.languageCode]!; + localizedValues['registerNewPatient'][locale.languageCode]; String get registeraPatient => - localizedValues['registeraPatient']![locale.languageCode]!; + localizedValues['registeraPatient'][locale.languageCode]; String get operationTimeStart => - localizedValues['operationTimeStart']![locale.languageCode]!; + localizedValues['operationTimeStart'][locale.languageCode]; String get operationDate => - localizedValues['operationDate']![locale.languageCode]!; + localizedValues['operationDate'][locale.languageCode]; - String get reservation => - localizedValues['reservation']![locale.languageCode]!; + String get reservation => localizedValues['reservation'][locale.languageCode]; - String get anesthetist => - localizedValues['anesthetist']![locale.languageCode]!; + String get anesthetist => localizedValues['anesthetist'][locale.languageCode]; String get bloodTransfusedDetail => - localizedValues['bloodTransfusedDetail']![locale.languageCode]!; + localizedValues['bloodTransfusedDetail'][locale.languageCode]; String get circulatingNurse => - localizedValues['circulatingNurse']![locale.languageCode]!; + localizedValues['circulatingNurse'][locale.languageCode]; - String get scrubNurse => localizedValues['scrubNurse']![locale.languageCode]!; + String get scrubNurse => localizedValues['scrubNurse'][locale.languageCode]; String get otherSpecimen => - localizedValues['otherSpecimen']![locale.languageCode]!; + localizedValues['otherSpecimen'][locale.languageCode]; String get microbiologySpecimen => - localizedValues['microbiologySpecimen']![locale.languageCode]!; + localizedValues['microbiologySpecimen'][locale.languageCode]; String get histopathSpecimen => - localizedValues['histopathSpecimen']![locale.languageCode]!; + localizedValues['histopathSpecimen'][locale.languageCode]; String get bloodLossDetail => - localizedValues['bloodLossDetail']![locale.languageCode]!; + localizedValues['bloodLossDetail'][locale.languageCode]; String get complicationDetails1 => - localizedValues['complicationDetails1']![locale.languageCode]!; + localizedValues['complicationDetails1'][locale.languageCode]; String get postOperationInstruction => - localizedValues['postOperationInstruction']![locale.languageCode]!; + localizedValues['postOperationInstruction'][locale.languageCode]; String get surgeryProcedure => - localizedValues['surgeryProcedure']![locale.languageCode]!; + localizedValues['surgeryProcedure'][locale.languageCode]; - String get finding => localizedValues['finding']![locale.languageCode]!; + String get finding => localizedValues['finding'][locale.languageCode]; String get preOperationDiagnosis => - localizedValues['preOperationDiagnosis']![locale.languageCode]!; + localizedValues['preOperationDiagnosis'][locale.languageCode]; String get postOperationDiagnosis => - localizedValues['postOperationDiagnosis']![locale.languageCode]!; + localizedValues['postOperationDiagnosis'][locale.languageCode]; - String get surgeon => localizedValues['surgeon']![locale.languageCode]!; + String get surgeon => localizedValues['surgeon'][locale.languageCode]; - String get assistant => localizedValues['assistant']![locale.languageCode]!; + String get assistant => localizedValues['assistant'][locale.languageCode]; String get askForIdentification => - localizedValues['askForIdentification']![locale.languageCode]!; + localizedValues['askForIdentification'][locale.languageCode]; - String get iDNumber => localizedValues['iDNumber']![locale.languageCode]!; + String get iDNumber => localizedValues['iDNumber'][locale.languageCode]; - String get calender => localizedValues['calender']![locale.languageCode]!; + String get calender => localizedValues['calender'][locale.languageCode]; - String get gregorian => localizedValues['gregorian']![locale.languageCode]!; + String get gregorian => localizedValues['gregorian'][locale.languageCode]; - String get hijri => localizedValues['hijri']![locale.languageCode]!; + String get hijri => localizedValues['hijri'][locale.languageCode]; - String get birthdate => localizedValues['birthdate']![locale.languageCode]!; + String get birthdate => localizedValues['birthdate'][locale.languageCode]; - String get activation => localizedValues['activation']![locale.languageCode]!; + String get activation => localizedValues['activation'][locale.languageCode]; String get confirmation => - localizedValues['confirmation']![locale.languageCode]!; + localizedValues['confirmation'][locale.languageCode]; + + String get diabetic => localizedValues['diabetic'][locale.languageCode]; - String get diabetic => localizedValues['diabetic']![locale.languageCode]!; + String get pharmacy => localizedValues['pharmacy'][locale.languageCode]; - String get pharmacy => localizedValues['pharmacy']![locale.languageCode]!; + String get intervention => localizedValues['intervention'][locale.languageCode]; - String get intervention => - localizedValues['intervention']![locale.languageCode]!; + String get chart => localizedValues['chart'][locale.languageCode]; - String get chart => localizedValues['chart']![locale.languageCode]!; + String get investigation => localizedValues['investigation'][locale.languageCode]; - String get investigation => - localizedValues['investigation']![locale.languageCode]!; + String get conditionOnDischarge => localizedValues['conditionOnDischarge'][locale.languageCode]; - String get conditionOnDischarge => - localizedValues['conditionOnDischarge']![locale.languageCode]!; + String get planedProcedure => localizedValues['planedProcedure'][locale.languageCode]; - String get planedProcedure => - localizedValues['planedProcedure']![locale.languageCode]!; + String get moreDetails => localizedValues['moreDetails'][locale.languageCode]; - String get moreDetails => - localizedValues['moreDetails']![locale.languageCode]!; + String get VTE_Type => localizedValues['VTE_Type'][locale.languageCode]; - String get VTE_Type => localizedValues['VTE_Type']![locale.languageCode]!; + String get pharmacology => localizedValues['pharmacology'][locale.languageCode]; - String get pharmacology => - localizedValues['pharmacology']![locale.languageCode]!; + String get reasonsThrombo => localizedValues['reasonsThrombo'][locale.languageCode]; - String get reasonsThrombo => - localizedValues['reasonsThrombo']![locale.languageCode]!; + String get youDoNotHaveFavoriteTemplate => localizedValues['youDoNotHaveFavoriteTemplate'][locale.languageCode]; - String get youDoNotHaveFavoriteTemplate => - localizedValues['youDoNotHaveFavoriteTemplate']![locale.languageCode]!; + String get pleaseSelectItem => localizedValues['pleaseSelectItem'][locale.languageCode]; - String get pleaseSelectItem => - localizedValues['pleaseSelectItem']![locale.languageCode]!; + String get searchFavoriteTemplate => localizedValues['searchFavoriteTemplate'][locale.languageCode]; - String get searchFavoriteTemplate => - localizedValues['searchFavoriteTemplate']![locale.languageCode]!; + String get sorryNoMatch => localizedValues['sorryNoMatch'][locale.languageCode]; - String get sorryNoMatch => - localizedValues['sorryNoMatch']![locale.languageCode]!; + String get thousandIsTheMAXForTheStrength => localizedValues['thousandIsTheMAXForTheStrength'][locale.languageCode]; - String get thousandIsTheMAXForTheStrength => - localizedValues['thousandIsTheMAXForTheStrength']![locale.languageCode]!; + String get strengthCanNotBeZero => localizedValues['strengthCanNotBeZero'][locale.languageCode]; - String get strengthCanNotBeZero => - localizedValues['strengthCanNotBeZero']![locale.languageCode]!; + String get old => localizedValues['old'][locale.languageCode]; - String get old => localizedValues['old']![locale.languageCode]!; + String get orderTypeDescription => localizedValues['orderTypeDescription'][locale.languageCode]; - String get orderTypeDescription => - localizedValues['orderTypeDescription']![locale.languageCode]!; + String get doseDetails => localizedValues['doseDetails'][locale.languageCode]; - String get doseDetails => - localizedValues['doseDetails']![locale.languageCode]!; + String get selectCondition => localizedValues['selectCondition'][locale.languageCode]; - String get selectCondition => - localizedValues['selectCondition']![locale.languageCode]!; + String get yourOrderAddedSuccessfully => localizedValues['yourOrderAddedSuccessfully'][locale.languageCode]; - String get yourOrderAddedSuccessfully => - localizedValues['yourOrderAddedSuccessfully']![locale.languageCode]!; + String get youCannotAddOnlySpaces => localizedValues['youCannotAddOnlySpaces'][locale.languageCode]; - String get youCannotAddOnlySpaces => - localizedValues['youCannotAddOnlySpaces']![locale.languageCode]!; + String get conditionDescription => localizedValues['conditionDescription'][locale.languageCode]; - String get conditionDescription => - localizedValues['conditionDescription']![locale.languageCode]!; + String get doctorSchedule => localizedValues['doctorSchedule'][locale.languageCode]; + String get doctorRota => localizedValues['doctorRota'][locale.languageCode]; + String get dateFrom => localizedValues['dateFrom'][locale.languageCode]; + String get searchFindSchedule => localizedValues['searchFindSchedule'][locale.languageCode]; } class TranslationBaseDelegate extends LocalizationsDelegate { diff --git a/lib/utils/utils.dart b/lib/utils/utils.dart index c2057ec3..9907a032 100644 --- a/lib/utils/utils.dart +++ b/lib/utils/utils.dart @@ -1,9 +1,10 @@ import 'package:connectivity/connectivity.dart'; import 'package:doctor_app_flutter/config/config.dart'; -import 'package:doctor_app_flutter/core/model/doctor/list_doctor_working_hours_table_model.dart'; import 'package:doctor_app_flutter/core/model/hospitals/get_hospitals_response_model.dart'; import 'package:doctor_app_flutter/core/service/NavigationService.dart'; import 'package:doctor_app_flutter/core/viewModel/authentication_view_model.dart'; +import 'package:doctor_app_flutter/core/model/doctor/list_doctor_working_hours_table_model.dart'; +import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/utils/dr_app_shared_pref.dart'; import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; @@ -12,13 +13,13 @@ import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:html/parser.dart'; - +import '../update_page.dart'; import '../config/size_config.dart'; import '../locator.dart'; -import '../update_page.dart'; import '../utils/dr_app_toast_msg.dart'; +import 'dr_app_shared_pref.dart'; -DrAppSharedPreferances sharedPref = DrAppSharedPreferances(); +DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); class Utils { static int cupertinoPickerIndex = 0; @@ -41,7 +42,7 @@ class Utils { ), actions: [ AppButton( - onPressed: okFunction(), + onPressed: okFunction, title: TranslationBase.of(context).noteConfirm, fontColor: Colors.white, color: AppGlobal.appGreenColor, @@ -52,7 +53,7 @@ class Utils { }, title: TranslationBase.of(context).cancel, fontColor: Colors.white, - color: Colors.red[600]!, + color: Colors.red[600], ), ], ), @@ -69,7 +70,7 @@ class Utils { builder: (BuildContext builder) { return Container( // height: 500, - height: SizeConfig.realScreenHeight! * 0.4, + height: SizeConfig.realScreenHeight * 0.4, color: Color(0xfff7f7f7), child: Column( mainAxisAlignment: MainAxisAlignment.end, @@ -98,7 +99,7 @@ class Utils { ], ), ), - Container(height: SizeConfig.realScreenHeight! * 0.3, color: Color(0xfff7f7f7), child: buildPickerItems(context, items, decKey, onSelectFun, model)) + Container(height: SizeConfig.realScreenHeight * 0.3, color: Color(0xfff7f7f7), child: buildPickerItems(context, items, decKey, onSelectFun, model)) ], ), ); @@ -114,7 +115,7 @@ class Utils { children: items.map((item) { return Text( '${item.facilityName}', - style: TextStyle(fontSize: SizeConfig.textMultiplier! * 2), + style: TextStyle(fontSize: SizeConfig.textMultiplier * 2), ); }).toList(), itemExtent: 25, @@ -213,12 +214,12 @@ class Utils { static String parseHtmlString(String htmlString) { final document = parse(htmlString); - final String parsedString = parse(document.body!.text).documentElement!.text; + final String parsedString = parse(document.body.text).documentElement.text; return parsedString; } - static InputDecoration textFieldSelectorDecoration(String hintText, String selectedText, bool isDropDown, {Icon? suffixIcon, Color? dropDownColor}) { + static InputDecoration textFieldSelectorDecoration(String hintText, String selectedText, bool isDropDown, {Icon suffixIcon, Color dropDownColor}) { return InputDecoration( focusedBorder: OutlineInputBorder( borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), @@ -278,7 +279,7 @@ class Utils { return htmlRegex.hasMatch(text); } - static String timeFrom({required Duration duration}) { + static String timeFrom({Duration duration}) { String twoDigits(int n) => n.toString().padLeft(2, "0"); String twoDigitMinutes = twoDigits(duration.inMinutes.remainder(60)); String twoDigitSeconds = twoDigits(duration.inSeconds.remainder(60)); @@ -286,7 +287,7 @@ class Utils { } static double getTextFieldHeight() { - return SizeConfig.heightMultiplier! * + return SizeConfig.heightMultiplier * (SizeConfig.isHeightVeryShort ? 10 : SizeConfig.isHeightShort @@ -310,7 +311,7 @@ class Utils { static String convertToTitleCase(String text) { if (text == null) { - return ""; + return null; } if (text.length <= 1) { @@ -334,4 +335,14 @@ class Utils { // Join/Merge all words back to one String return capitalizedWords.join(' '); } + + static bool isVidaPlusProject(ProjectViewModel projectViewModel, int projectID) { + bool isVidaPlus = false; + projectViewModel.vidaPlusProjectList.forEach((element) { + if (element.projectID == projectID) { + isVidaPlus = true; + } + }); + return isVidaPlus; + } } diff --git a/lib/widgets/patients/profile/app_bar/patient-profile-app-bar.dart b/lib/widgets/patients/profile/app_bar/patient-profile-app-bar.dart index 2cb9a831..19578c2b 100644 --- a/lib/widgets/patients/profile/app_bar/patient-profile-app-bar.dart +++ b/lib/widgets/patients/profile/app_bar/patient-profile-app-bar.dart @@ -1,11 +1,11 @@ import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/size_config.dart'; -import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/utils/date-utils.dart'; -import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; import 'package:doctor_app_flutter/utils/utils.dart'; +import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; @@ -14,7 +14,7 @@ import 'package:url_launcher/url_launcher.dart'; import '../large_avatar.dart'; import 'header_row.dart'; -class PatientProfileAppBar extends StatelessWidget implements PreferredSizeWidget { +class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget { final PatiantInformtion patient; final double height; final bool isInpatient; @@ -23,7 +23,7 @@ class PatientProfileAppBar extends StatelessWidget implements PreferredSizeWidge final String doctorName; final String branch; - final DateTime? appointmentDate; + final DateTime appointmentDate; final String profileUrl; final String invoiceNO; final String orderNo; @@ -34,24 +34,24 @@ class PatientProfileAppBar extends StatelessWidget implements PreferredSizeWidge final String clinic; final bool isAppointmentHeader; final bool isFromLabResult; - final VoidCallback? onPressed; + final VoidCallback onPressed; PatientProfileAppBar(this.patient, {this.height = 0.0, this.isInpatient = false, this.isDischargedPatient = false, this.isFromLiveCare = false, - this.doctorName = '', - this.branch = '', + this.doctorName, + this.branch, this.appointmentDate, - this.profileUrl = '', - this.invoiceNO = '', - this.orderNo = '', + this.profileUrl, + this.invoiceNO, + this.orderNo, this.isPrescriptions = false, - this.clinic = '', + this.clinic, this.isMedicalFile = false, - this.episode = '', - this.visitDate = '', + this.episode, + this.visitDate, this.isAppointmentHeader = false, this.isFromLabResult = false, this.onPressed}); @@ -62,9 +62,9 @@ class PatientProfileAppBar extends StatelessWidget implements PreferredSizeWidge int gender = 1; if (patient.patientDetails != null) { - gender = patient.patientDetails!.gender!; + gender = patient.patientDetails.gender; } else { - gender = patient.gender!; + gender = patient.gender; } return Container( @@ -75,7 +75,7 @@ class PatientProfileAppBar extends StatelessWidget implements PreferredSizeWidge ), decoration: BoxDecoration(color: Colors.white, border: Border(bottom: BorderSide(color: Color(0xFFEFEFEF)))), child: Container( - padding: EdgeInsets.only(left: 10, right: 10, bottom: 10), + padding: EdgeInsets.only(left: 10, right: 10, bottom: 0), margin: EdgeInsets.only(top: SizeConfig.isHeightVeryShort ? 30 : 50), child: Column( children: [ @@ -86,7 +86,7 @@ class PatientProfileAppBar extends StatelessWidget implements PreferredSizeWidge icon: Icon(Icons.arrow_back_ios), color: Color(0xFF2B353E), //Colors.black, onPressed: () { - if (onPressed != null) onPressed!(); + if (onPressed != null) onPressed(); Navigator.pop(context); }, ), @@ -94,8 +94,8 @@ class PatientProfileAppBar extends StatelessWidget implements PreferredSizeWidge child: AppText( patient.firstName != null ? (Utils.capitalize(patient.firstName) + " " + Utils.capitalize(patient.lastName)) - : Utils.capitalize(patient.fullName ?? patient.patientDetails!.fullName), - fontSize: SizeConfig.textMultiplier! * 1.8, + : Utils.capitalize(patient.fullName ?? patient.patientDetails.fullName), + fontSize: SizeConfig.textMultiplier * 1.8, fontWeight: FontWeight.bold, fontFamily: 'Poppins', color: Color(0xFF2B353E), @@ -115,7 +115,7 @@ class PatientProfileAppBar extends StatelessWidget implements PreferredSizeWidge margin: EdgeInsets.symmetric(horizontal: 4), child: InkWell( onTap: () { - launch("tel://" + patient.mobileNumber!); + launch("tel://" + patient.mobileNumber); }, child: Icon( Icons.phone, @@ -159,13 +159,13 @@ class PatientProfileAppBar extends StatelessWidget implements PreferredSizeWidge ) : AppText( TranslationBase.of(context).notArrived, - color: Colors.red[800]!, + color: Colors.red[800], fontWeight: FontWeight.bold, fontFamily: 'Poppins', fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.5, ), patient.startTime != null - ? AppText(patient.startTime != null ? patient.startTime! : '', + ? AppText(patient.startTime != null ? patient.startTime : '', fontWeight: FontWeight.w700, fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.5, color: Color(0xFF2E303A)) : SizedBox() ], @@ -206,10 +206,10 @@ class PatientProfileAppBar extends StatelessWidget implements PreferredSizeWidge ? ClipRRect( borderRadius: BorderRadius.circular(20.0), child: Image.network( - patient.nationalityFlagURL!, + patient.nationalityFlagURL, height: 25, width: 30, - errorBuilder: (BuildContext context, Object exception, StackTrace? stackTrace) { + errorBuilder: (BuildContext context, Object exception, StackTrace stackTrace) { return Text('No Image'); }, )) @@ -222,24 +222,24 @@ class PatientProfileAppBar extends StatelessWidget implements PreferredSizeWidge HeaderRow( label: TranslationBase.of(context).age + " : ", value: - "${AppDateUtils.getAgeByBirthday(patient.patientDetails != null ? patient.patientDetails!.dateofBirth ?? "" : patient.dateofBirth ?? "", context, isServerFormat: !isFromLiveCare)}", + "${AppDateUtils.getAgeByBirthday(patient.patientDetails != null ? patient.patientDetails.dateofBirth ?? "" : patient.dateofBirth ?? "", context, isServerFormat: !isFromLiveCare)}", ), - if (patient.appointmentDate != null && patient.appointmentDate!.isNotEmpty && !isFromLabResult) + if (patient.appointmentDate != null && patient.appointmentDate.isNotEmpty && !isFromLabResult) HeaderRow( label: TranslationBase.of(context).appointmentDate + " : ", - value: AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.convertStringToDate(patient.appointmentDate!)), + value: AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.convertStringToDate(patient.appointmentDate)), ), if (isFromLabResult) HeaderRow( label: "Result Date: ", - value: '${AppDateUtils.getDayMonthYearDateFormatted(appointmentDate!, isArabic: projectViewModel.isArabic)}', + value: '${AppDateUtils.getDayMonthYearDateFormatted(appointmentDate, isArabic: projectViewModel.isArabic)}', ), // if(isInpatient) Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - if (patient.admissionDate != null && patient.admissionDate!.isNotEmpty) + if (patient.admissionDate != null && patient.admissionDate.isNotEmpty) HeaderRow( label: patient.admissionDate == null ? "" : TranslationBase.of(context).admissionDate + " : ", value: patient.admissionDate == null ? "" : "${AppDateUtils.getDayMonthYearDateFormatted((AppDateUtils.getDateTimeFromServerFormat(patient.admissionDate.toString())))}", @@ -248,8 +248,8 @@ class PatientProfileAppBar extends StatelessWidget implements PreferredSizeWidge HeaderRow( label: "${TranslationBase.of(context).numOfDays}: ", value: isDischargedPatient && patient.dischargeDate != null - ? "${AppDateUtils.getDateTimeFromServerFormat(patient.dischargeDate!).difference(AppDateUtils.getDateTimeFromServerFormat(patient.admissionDate!)).inDays + 1}" - : "${DateTime.now().difference(AppDateUtils.getDateTimeFromServerFormat(patient.admissionDate!)).inDays + 1}", + ? "${AppDateUtils.getDateTimeFromServerFormat(patient.dischargeDate).difference(AppDateUtils.getDateTimeFromServerFormat(patient.admissionDate)).inDays + 1}" + : "${DateTime.now().difference(AppDateUtils.getDateTimeFromServerFormat(patient.admissionDate)).inDays + 1}", ) ], ), @@ -268,8 +268,8 @@ class PatientProfileAppBar extends StatelessWidget implements PreferredSizeWidge decoration: BoxDecoration( shape: BoxShape.rectangle, border: Border( - bottom: BorderSide(color: Colors.grey[400]!, width: 2.5), - left: BorderSide(color: Colors.grey[400]!, width: 2.5), + bottom: BorderSide(color: Colors.grey[400], width: 2.5), + left: BorderSide(color: Colors.grey[400], width: 2.5), )), ), Expanded( @@ -332,7 +332,7 @@ class PatientProfileAppBar extends StatelessWidget implements PreferredSizeWidge if (!isMedicalFile) HeaderRow( label: !isPrescriptions ? 'Result Date:' : 'Prescriptions Date ', - value: '${AppDateUtils.getDayMonthYearDateFormatted(appointmentDate!, isArabic: projectViewModel.isArabic)}', + value: '${AppDateUtils.getDayMonthYearDateFormatted(appointmentDate, isArabic: projectViewModel.isArabic)}', ), ]), ), @@ -361,6 +361,6 @@ class PatientProfileAppBar extends StatelessWidget implements PreferredSizeWidge ? 137 : SizeConfig.isHeightShort ? 190 - : SizeConfig.heightMultiplier! * (SizeConfig.isWidthLarge ? 25 : 20) + : SizeConfig.heightMultiplier * (SizeConfig.isWidthLarge ? 25 : 20) : height); } diff --git a/lib/widgets/patients/profile/app_bar/patient-profile-header-new-design-app-bar.dart b/lib/widgets/patients/profile/app_bar/patient-profile-header-new-design-app-bar.dart index c6f69580..7f19b5e4 100644 --- a/lib/widgets/patients/profile/app_bar/patient-profile-header-new-design-app-bar.dart +++ b/lib/widgets/patients/profile/app_bar/patient-profile-header-new-design-app-bar.dart @@ -1,12 +1,12 @@ import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/core/service/AnalyticsService.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; import 'package:doctor_app_flutter/locator.dart'; -import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/utils/date-utils.dart'; -import 'package:doctor_app_flutter/utils/utils.dart'; import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; +import 'package:doctor_app_flutter/utils/utils.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; @@ -15,7 +15,7 @@ import 'package:url_launcher/url_launcher.dart'; import 'header_row.dart'; -class PatientProfileHeaderNewDesignAppBar extends StatelessWidget { +class PatientProfileHeaderNewDesignAppBar extends StatelessWidget with PreferredSizeWidget { final PatiantInformtion patient; final String patientType; final String arrivalType; @@ -24,23 +24,18 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget { final bool isDischargedPatient; final bool isFromLiveCare; - final Stream? videoCallDurationStream; + final Stream videoCallDurationStream; - PatientProfileHeaderNewDesignAppBar( - this.patient, this.patientType, this.arrivalType, - {this.height = 0.0, - this.isInpatient = false, - this.isDischargedPatient = false, - this.isFromLiveCare = false, - this.videoCallDurationStream}); + PatientProfileHeaderNewDesignAppBar(this.patient, this.patientType, this.arrivalType, + {this.height = 0.0, this.isInpatient = false, this.isDischargedPatient = false, this.isFromLiveCare = false, this.videoCallDurationStream}); @override Widget build(BuildContext context) { int gender = 1; if (patient.patientDetails != null) { - gender = patient.patientDetails!.gender!; + gender = patient.patientDetails.gender; } else { - gender = patient.gender!; + gender = patient.gender; } return Container( padding: EdgeInsets.only( @@ -72,12 +67,9 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget { Expanded( child: AppText( patient.firstName != null - ? (Utils.capitalize(patient.firstName) + - " " + - Utils.capitalize(patient.lastName)) - : Utils.capitalize(patient.fullName ?? - patient.patientDetails!.fullName), - fontSize: SizeConfig.textMultiplier! * 1.8, + ? (Utils.capitalize(patient.firstName) + " " + Utils.capitalize(patient.lastName)) + : Utils.capitalize(patient.fullName ?? patient.patientDetails.fullName), + fontSize: SizeConfig.textMultiplier * 1.8, fontWeight: FontWeight.bold, fontFamily: 'Poppins', ), @@ -99,7 +91,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget { eventCategory: "Patient Profile Header", eventAction: "Call Patient", ); - launch("tel://" + patient.mobileNumber!); + launch("tel://" + patient.mobileNumber); }, child: Icon( Icons.phone, @@ -109,19 +101,15 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget { ), StreamBuilder( stream: videoCallDurationStream, - builder: - (BuildContext context, AsyncSnapshot snapshot) { + builder: (BuildContext context, AsyncSnapshot snapshot) { if (snapshot.hasData && snapshot.data != null) return InkWell( onTap: () {}, child: Container( - decoration: BoxDecoration( - color: Colors.red, - borderRadius: BorderRadius.circular(20)), - padding: - EdgeInsets.symmetric(vertical: 2, horizontal: 10), + decoration: BoxDecoration(color: Colors.red, borderRadius: BorderRadius.circular(20)), + padding: EdgeInsets.symmetric(vertical: 2, horizontal: 10), child: Text( - snapshot.data!, + snapshot.data, style: TextStyle(color: Colors.white), ), ), @@ -139,9 +127,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget { width: 60, height: 60, child: Image.asset( - gender == 1 - ? 'assets/images/male_avatar.png' - : 'assets/images/female_avatar.png', + gender == 1 ? 'assets/images/male_avatar.png' : 'assets/images/female_avatar.png', fit: BoxFit.cover, ), ), @@ -153,58 +139,48 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - SERVICES_PATIANT2[int.parse(patientType)] == - "patientArrivalList" + SERVICES_PATIANT2[int.parse(patientType)] == "patientArrivalList" ? Container( child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - patient.patientStatusType == 43 - ? AppText( - TranslationBase.of(context).arrivedP, - color: AppGlobal.appGreenColor, - fontWeight: FontWeight.bold, - fontFamily: 'Poppins', - fontSize: 12, - ) - : AppText( - TranslationBase.of(context).notArrived, - color: Colors.red[800]!, - fontWeight: FontWeight.bold, - fontFamily: 'Poppins', - fontSize: 12, - ), + if (patient.patientStatusType != null) + patient.patientStatusType == 43 + ? AppText( + TranslationBase.of(context).arrivedP, + color: AppGlobal.appGreenColor, + fontWeight: FontWeight.bold, + fontFamily: 'Poppins', + fontSize: 12, + ) + : AppText( + TranslationBase.of(context).notArrived, + color: Colors.red[800], + fontWeight: FontWeight.bold, + fontFamily: 'Poppins', + fontSize: 12, + ), arrivalType == '1' || patient.arrivedOn == null ? AppText( - patient.startTime != null - ? patient.startTime! - : '', + patient.startTime != null ? patient.startTime : '', fontFamily: 'Poppins', fontWeight: FontWeight.w600, ) : AppText( - patient.arrivedOn != null - ? AppDateUtils - .convertStringToDateFormat( - patient.arrivedOn!, - 'MM-dd-yyyy HH:mm') - : '', + patient.arrivedOn != null ? AppDateUtils.convertStringToDateFormat(patient.arrivedOn, 'MM-dd-yyyy HH:mm') : '', fontFamily: 'Poppins', fontWeight: FontWeight.w600, ) ], )) : SizedBox(), - if (SERVICES_PATIANT2[int.parse(patientType)] == - "List_MyOutPatient" && - !isFromLiveCare) + if (SERVICES_PATIANT2[int.parse(patientType)] == "List_MyOutPatient" && !isFromLiveCare) Container( child: Row( mainAxisAlignment: MainAxisAlignment.start, children: [ AppText( - TranslationBase.of(context).appointmentDate + - " : ", + TranslationBase.of(context).appointmentDate + " : ", fontSize: 14, ), patient.startTime != null @@ -218,8 +194,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget { child: AppText( patient.startTime ?? "", color: Colors.white, - fontSize: - 1.5 * SizeConfig.textMultiplier!, + fontSize: 1.5 * SizeConfig.textMultiplier, textAlign: TextAlign.center, fontWeight: FontWeight.bold, ), @@ -230,9 +205,8 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget { ), Container( child: AppText( - convertDateFormat2( - patient.appointmentDate ?? ''), - fontSize: 1.5 * SizeConfig.textMultiplier!, + convertDateFormat2(patient.appointmentDate ?? ''), + fontSize: 1.5 * SizeConfig.textMultiplier, fontWeight: FontWeight.bold, ), ), @@ -261,10 +235,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget { child: Container( alignment: Alignment.centerRight, child: AppText( - patient.nationalityName ?? - patient.nationality ?? - patient.nationalityId ?? - '', + patient.nationalityName ?? patient.nationality ?? patient.nationalityId ?? '', fontWeight: FontWeight.bold, fontSize: 12, ), @@ -274,12 +245,10 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget { ? ClipRRect( borderRadius: BorderRadius.circular(20.0), child: Image.network( - patient.nationalityFlagURL!, + patient.nationalityFlagURL, height: 25, width: 30, - errorBuilder: (BuildContext context, - Object exception, - StackTrace? stackTrace) { + errorBuilder: (BuildContext context, Object exception, StackTrace stackTrace) { return Text(''); }, )) @@ -292,28 +261,21 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget { HeaderRow( label: TranslationBase.of(context).age + " : ", value: - "${AppDateUtils.getAgeByBirthday(patient.patientDetails != null ? patient.patientDetails!.dateofBirth ?? "" : patient.dateofBirth ?? "", context, isServerFormat: !isFromLiveCare)}", + "${AppDateUtils.getAgeByBirthday(patient.patientDetails != null ? patient.patientDetails.dateofBirth ?? "" : patient.dateofBirth ?? "", context, isServerFormat: !isFromLiveCare)}", ), if (isInpatient) Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ HeaderRow( - label: patient.admissionDate == null - ? "" - : TranslationBase.of(context).admissionDate + - " : ", - value: patient.admissionDate == null - ? "" - : "${AppDateUtils.convertDateFromServerFormat(patient.admissionDate.toString(), 'yyyy-MM-dd')}"), + label: patient.admissionDate == null ? "" : TranslationBase.of(context).admissionDate + " : ", + value: patient.admissionDate == null ? "" : "${AppDateUtils.convertDateFromServerFormat(patient.admissionDate.toString(), 'yyyy-MM-dd')}"), if (patient.admissionDate != null) HeaderRow( - label: - "${TranslationBase.of(context).numOfDays}: ", - value: isDischargedPatient && - patient.dischargeDate != null - ? "${AppDateUtils.getDateTimeFromServerFormat(patient.dischargeDate!).difference(AppDateUtils.getDateTimeFromServerFormat(patient.admissionDate!)).inDays + 1}" - : "${DateTime.now().difference(AppDateUtils.getDateTimeFromServerFormat(patient.admissionDate!)).inDays + 1}", + label: "${TranslationBase.of(context).numOfDays}: ", + value: isDischargedPatient && patient.dischargeDate != null + ? "${AppDateUtils.getDateTimeFromServerFormat(patient.dischargeDate).difference(AppDateUtils.getDateTimeFromServerFormat(patient.admissionDate)).inDays + 1}" + : "${DateTime.now().difference(AppDateUtils.getDateTimeFromServerFormat(patient.admissionDate)).inDays + 1}", ) ], ) @@ -328,7 +290,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget { } convertDateFormat2(String str) { - String newDate = ''; + String newDate; const start = "/Date("; if (str.isNotEmpty) { const end = "+0300)"; @@ -336,13 +298,8 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget { final startIndex = str.indexOf(start); final endIndex = str.indexOf(end, startIndex + start.length); - var date = new DateTime.fromMillisecondsSinceEpoch( - int.parse(str.substring(startIndex + start.length, endIndex))); - newDate = date.year.toString() + - "/" + - date.month.toString().padLeft(2, '0') + - "/" + - date.day.toString().padLeft(2, '0'); + var date = new DateTime.fromMillisecondsSinceEpoch(int.parse(str.substring(startIndex + start.length, endIndex))); + newDate = date.year.toString() + "/" + date.month.toString().padLeft(2, '0') + "/" + date.day.toString().padLeft(2, '0'); } return newDate ?? ''; @@ -350,8 +307,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget { isToday(date) { DateTime tempDate = new DateFormat("yyyy-MM-dd").parse(date); - return DateFormat("yyyy-MM-dd").format(tempDate) == - DateFormat("yyyy-MM-dd").format(DateTime.now()); + return DateFormat("yyyy-MM-dd").format(tempDate) == DateFormat("yyyy-MM-dd").format(DateTime.now()); } myBoxDecoration() { diff --git a/lib/widgets/shared/app_drawer_widget.dart b/lib/widgets/shared/app_drawer_widget.dart index 7a8f5efe..ccc6bb48 100644 --- a/lib/widgets/shared/app_drawer_widget.dart +++ b/lib/widgets/shared/app_drawer_widget.dart @@ -1,6 +1,7 @@ import 'package:doctor_app_flutter/core/viewModel/authentication_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; +import 'package:doctor_app_flutter/screens/doctor_schedule/doctor_schedule.dart'; import 'package:doctor_app_flutter/screens/reschedule_leaves/add_reschedule_leave.dart'; import 'package:doctor_app_flutter/utils/utils.dart'; import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; @@ -137,6 +138,28 @@ class _AppDrawerState extends State { }, ), SizedBox(height: 15), + + InkWell( + child: DrawerItem( + TranslationBase.of(context).doctorRota, + icon: Icons.punch_clock, + + // subTitle: , + ), + onTap: () { + Navigator.pop(context); + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => DoctorSchedulePage(), + settings: RouteSettings( + name: 'doctorSchedule') + // MyReferredPatient(), + )); + }, + ), + SizedBox(height: 15), + InkWell( child: DrawerItem( TranslationBase.of(context).myQRCode, @@ -144,6 +167,7 @@ class _AppDrawerState extends State { // subTitle: , ), ), + SizedBox(height: MediaQuery.of(context).size.height * 0.02), InkWell( child: Container( diff --git a/lib/widgets/shared/app_scaffold_widget.dart b/lib/widgets/shared/app_scaffold_widget.dart index f7580fe9..44106147 100644 --- a/lib/widgets/shared/app_scaffold_widget.dart +++ b/lib/widgets/shared/app_scaffold_widget.dart @@ -12,31 +12,31 @@ import 'network_base_view.dart'; class AppScaffold extends StatelessWidget { final String appBarTitle; - final Widget? body; + final Widget body; final bool isLoading; final bool isShowAppBar; - final BaseViewModel? baseViewModel; - final Widget? bottomSheet; - final Color? backgroundColor; - final PreferredSizeWidget? appBar; - final Widget? drawer; - final Widget? bottomNavigationBar; - final String? subtitle; + final BaseViewModel baseViewModel; + final Widget bottomSheet; + final Color backgroundColor; + final Widget appBar; + final Widget drawer; + final Widget bottomNavigationBar; + final String subtitle; final bool isHomeIcon; final bool extendBody; - + final Widget actionButton; AppScaffold( {this.appBarTitle = '', this.body, this.isLoading = false, - this.isShowAppBar = false, + this.isShowAppBar = true, this.baseViewModel, this.bottomSheet, this.backgroundColor, this.isHomeIcon = true, this.appBar, this.subtitle, - this.drawer, + this.drawer, this.actionButton, this.extendBody = false, this.bottomNavigationBar}); @@ -49,59 +49,62 @@ class AppScaffold extends StatelessWidget { FocusScope.of(context).requestFocus(new FocusNode()); }, child: Scaffold( - backgroundColor: backgroundColor ?? Theme.of(context).scaffoldBackgroundColor, + backgroundColor: backgroundColor ?? Theme.of(context).scaffoldBackgroundColor + , drawer: drawer, extendBody: extendBody, bottomNavigationBar: bottomNavigationBar, appBar: isShowAppBar - ? appBar != null - ? appBar as PreferredSizeWidget - : AppBar( - elevation: 0, - backgroundColor: Colors.white, - //HexColor('#515B5D'), - titleTextStyle: TextStyle( - color: Colors.black87, - fontSize: 16.8, - ), - title: Column( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Text(appBarTitle.toUpperCase()), - if (subtitle != null) - Text( - subtitle!, - style: TextStyle(fontSize: 12, color: Colors.red), - ), - ], - ), - leading: Builder(builder: (BuildContext context) { - return IconButton( - icon: Icon(Icons.arrow_back_ios), - color: Colors.black, //Colors.black, - onPressed: () => Navigator.pop(context), - ); - }), - centerTitle: true, - actions: [ - isHomeIcon - ? IconButton( - icon: Icon(DoctorApp.home_icon_active), - color: Colors.black, //Colors.black, - onPressed: () => Navigator.pushNamedAndRemoveUntil(context, HOME, (r) => false), - ) - : SizedBox() + ? appBar ?? + AppBar( + elevation: 0, + backgroundColor: Colors.white, + //HexColor('#515B5D'), + textTheme: TextTheme( + headline6: TextStyle( + color: Colors.black87, + fontSize: 16.8, + )), + title: Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Text(appBarTitle.toUpperCase()), + if (subtitle != null) + Text( + subtitle, + style: TextStyle(fontSize: 12, color: Colors.red), + ), ], - ) + ), + leading: Builder(builder: (BuildContext context) { + return IconButton( + icon: Icon(Icons.arrow_back_ios), + color: Colors.black, //Colors.black, + onPressed: () => Navigator.pop(context), + ); + }), + centerTitle: true, + actions: [ + isHomeIcon + ? IconButton( + icon: Icon(DoctorApp.home_icon_active), + color: Colors.black, //Colors.black, + onPressed: () => Navigator.pushNamedAndRemoveUntil( + context, HOME, (r) => false), + ) + : actionButton !=null ? actionButton :SizedBox() + ], + ) : null, bottomSheet: bottomSheet, body: projectProvider.isInternetConnection ? baseViewModel != null ? NetworkBaseView( - baseViewModel: baseViewModel!, - child: body!, + baseViewModel: baseViewModel, + child: body, ) - : Stack(children: [body!, buildAppLoaderWidget(isLoading)]) + : Stack( + children: [body, buildAppLoaderWidget(isLoading)]) : Center( child: Column( mainAxisAlignment: MainAxisAlignment.center, diff --git a/lib/widgets/shared/app_texts_widget.dart b/lib/widgets/shared/app_texts_widget.dart index 78a1af9c..2ea3aa8f 100644 --- a/lib/widgets/shared/app_texts_widget.dart +++ b/lib/widgets/shared/app_texts_widget.dart @@ -1,34 +1,35 @@ import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; class AppText extends StatefulWidget { final String text; - final String? variant; - final Color? color; - final FontWeight? fontWeight; - final double? fontSize; - final double? fontHeight; - final String? fontFamily; + final String variant; + final Color color; + final FontWeight fontWeight; + final double fontSize; + final double fontHeight; + final String fontFamily; final int maxLength; final bool italic; - final double? margin; + final double margin; final double marginTop; final double marginRight; final double marginBottom; final double marginLeft; - final double? letterSpacing; - final TextAlign? textAlign; - final bool? bold; - final bool? regular; - final bool? medium; - final int? maxLines; + final double letterSpacing; + final TextAlign textAlign; + final bool bold; + final bool regular; + final bool medium; + final int maxLines; final bool readMore; - final String? style; + final String style; final bool allowExpand; final bool visibility; - final TextOverflow? textOverflow; - final TextDecoration? textDecoration; + final TextOverflow textOverflow; + final TextDecoration textDecoration; final bool isCopyable; AppText( @@ -96,7 +97,7 @@ class _AppTextState extends State { Widget build(BuildContext context) { return GestureDetector( child: Container( - margin: widget.margin != null ? EdgeInsets.all(widget.margin!) : EdgeInsets.only(top: widget.marginTop, right: widget.marginRight, bottom: widget.marginBottom, left: widget.marginLeft), + margin: widget.margin != null ? EdgeInsets.all(widget.margin) : EdgeInsets.only(top: widget.marginTop, right: widget.marginRight, bottom: widget.marginBottom, left: widget.marginLeft), child: Column( mainAxisAlignment: MainAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.start, @@ -112,8 +113,8 @@ class _AppTextState extends State { child: Container( decoration: BoxDecoration( gradient: LinearGradient(colors: [ - Theme.of(context).colorScheme.background, - Theme.of(context).colorScheme.background.withOpacity(0), + Theme.of(context).backgroundColor, + Theme.of(context).backgroundColor.withOpacity(0), ], begin: Alignment.bottomCenter, end: Alignment.topCenter)), height: 30, ), @@ -130,7 +131,7 @@ class _AppTextState extends State { }); }, child: Text(hidden ? "Read More" : "Read less", - style: _getFontStyle()!.copyWith( + style: _getFontStyle().copyWith( color: HexColor('#FF0000'), fontWeight: FontWeight.w800, fontFamily: "Poppins", @@ -153,9 +154,7 @@ class _AppTextState extends State { if (widget.isCopyable) { return Theme( data: ThemeData( - textSelectionTheme: TextSelectionThemeData( - selectionColor: Colors.lightBlueAccent, - ), + highlightColor: Colors.lightBlueAccent, ), child: Container( child: SelectableText( @@ -168,12 +167,7 @@ class _AppTextState extends State { // : null, maxLines: widget.maxLines ?? null, style: widget.style != null - ? _getFontStyle()!.copyWith( - fontStyle: widget.italic ? FontStyle.italic : null, - fontSize: widget.fontSize ?? _getFontSize(), - color: widget.color, - fontWeight: widget.fontWeight ?? _getFontWeight(), - height: widget.fontHeight) + ? _getFontStyle().copyWith(fontStyle: widget.italic ? FontStyle.italic : null, color: widget.color, fontWeight: widget.fontWeight ?? _getFontWeight(), height: widget.fontHeight) : TextStyle( fontStyle: widget.italic ? FontStyle.italic : null, color: widget.color != null ? widget.color : Color(0xff2E303A), @@ -182,8 +176,7 @@ class _AppTextState extends State { fontWeight: widget.fontWeight ?? _getFontWeight(), fontFamily: widget.fontFamily ?? 'Poppins', decoration: widget.textDecoration, - height: widget.fontHeight, - ), + height: widget.fontHeight), ), ), ); @@ -191,16 +184,10 @@ class _AppTextState extends State { return Text( !hidden ? text : (text.substring(0, text.length > widget.maxLength ? widget.maxLength : text.length)), textAlign: widget.textAlign, - overflow: widget.maxLines != null ? ((widget.maxLines! > 1) ? TextOverflow.fade : TextOverflow.ellipsis) : null, + overflow: widget.maxLines != null ? ((widget.maxLines > 1) ? TextOverflow.fade : TextOverflow.ellipsis) : null, maxLines: widget.maxLines ?? null, style: widget.style != null - ? _getFontStyle()?.copyWith( - fontStyle: widget.italic ? FontStyle.italic : null, - fontSize: widget.fontSize ?? _getFontSize(), - color: widget.color, - fontWeight: widget.fontWeight ?? _getFontWeight(), - height: widget.fontHeight, - ) + ? _getFontStyle().copyWith(fontStyle: widget.italic ? FontStyle.italic : null, color: widget.color, fontWeight: widget.fontWeight ?? _getFontWeight(), height: widget.fontHeight) : TextStyle( fontStyle: widget.italic ? FontStyle.italic : null, color: widget.color != null ? widget.color : Colors.black, @@ -214,30 +201,32 @@ class _AppTextState extends State { } } - TextStyle? _getFontStyle() { + TextStyle _getFontStyle() { switch (widget.style) { case "headline2": - return Theme.of(context).textTheme.displayMedium; + return Theme.of(context).textTheme.headline2; case "headline3": - return Theme.of(context).textTheme.displaySmall; + return Theme.of(context).textTheme.headline3; case "headline4": - return Theme.of(context).textTheme.headlineMedium; + return Theme.of(context).textTheme.headline4; case "headline5": - return Theme.of(context).textTheme.headlineSmall; + return Theme.of(context).textTheme.headline5; case "headline6": - return Theme.of(context).textTheme.titleLarge; + return Theme.of(context).textTheme.headline6; case "bodyText2": - return Theme.of(context).textTheme.bodyMedium; + return Theme.of(context).textTheme.bodyText2; case "bodyText_15": - return Theme.of(context).textTheme.bodyMedium!.copyWith(fontSize: 15.0); + return Theme.of(context).textTheme.bodyText2.copyWith(fontSize: 15.0); case "bodyText1": - return Theme.of(context).textTheme.bodyLarge; + return Theme.of(context).textTheme.bodyText1; case "caption": - return Theme.of(context).textTheme.bodySmall; + return Theme.of(context).textTheme.caption; case "overline": - return Theme.of(context).textTheme.labelSmall; + return Theme.of(context).textTheme.overline; case "button": - return Theme.of(context).textTheme.labelLarge; + return Theme.of(context).textTheme.button; + default: + return TextStyle(); } } @@ -274,7 +263,7 @@ class _AppTextState extends State { case "date": return 24.0; default: - return SizeConfig.textMultiplier! * 2; + return SizeConfig.textMultiplier * 2; } } @@ -320,7 +309,7 @@ class _AppTextState extends State { return FontWeight.w500; } } else { - return FontWeight.normal; + return null; } } } diff --git a/lib/widgets/shared/dialogs/dailog-list-select.dart b/lib/widgets/shared/dialogs/dailog-list-select.dart index 9a16fa24..ed06506c 100644 --- a/lib/widgets/shared/dialogs/dailog-list-select.dart +++ b/lib/widgets/shared/dialogs/dailog-list-select.dart @@ -16,14 +16,14 @@ class ListSelectDialog extends StatefulWidget { final String hintSearchText; ListSelectDialog({ - required this.list, - required this.attributeName, - required this.attributeValueId, - required this.okText, - required this.okFunction, - this.searchWidget = const SizedBox(), + @required this.list, + @required this.attributeName, + @required this.attributeValueId, + @required this.okText, + @required this.okFunction, + this.searchWidget, this.usingSearch = false, - this.hintSearchText = '', + this.hintSearchText, }); @override @@ -31,7 +31,7 @@ class ListSelectDialog extends StatefulWidget { } class _ListSelectDialogState extends State { - List items = []; + List items = List(); @override void initState() { @@ -77,11 +77,7 @@ class _ListSelectDialogState extends State { Container( height: MediaQuery.of(context).size.height * 0.070, child: TextField( - decoration: Utils.textFieldSelectorDecoration( - widget.hintSearchText ?? - TranslationBase.of(context).search, - "", - false, + decoration: Utils.textFieldSelectorDecoration(widget.hintSearchText ?? TranslationBase.of(context).search, null, false, suffixIcon: Icon( Icons.search, )), @@ -97,17 +93,11 @@ class _ListSelectDialogState extends State { children: [ ...items .map((item) => RadioListTile( - title: Text( - "${Utils.convertToTitleCase(item[widget.attributeName].toString())}"), - groupValue: Utils.convertToTitleCase(widget - .selectedValue[widget.attributeValueId] - .toString()), + title: Text("${Utils.convertToTitleCase(item[widget.attributeName].toString())}"), + groupValue: Utils.convertToTitleCase(widget.selectedValue[widget.attributeValueId].toString()), value: item[widget.attributeValueId].toString(), activeColor: AppGlobal.appRedColor, - selected: item[widget.attributeValueId] - .toString() == - widget.selectedValue[widget.attributeValueId] - .toString(), + selected: item[widget.attributeValueId].toString() == widget.selectedValue[widget.attributeValueId].toString(), onChanged: (val) { setState(() { widget.selectedValue = item; @@ -129,14 +119,12 @@ class _ListSelectDialogState extends State { } void filterSearchResults(String query) { - List dummySearchList = []; + List dummySearchList = List(); dummySearchList.addAll(widget.list); if (query.isNotEmpty) { - List dummyListData = []; + List dummyListData = List(); dummySearchList.forEach((item) { - if ("${item[widget.attributeName].toString()}" - .toLowerCase() - .contains(query.toLowerCase())) { + if ("${item[widget.attributeName].toString()}".toLowerCase().contains(query.toLowerCase())) { dummyListData.add(item); } }); diff --git a/lib/widgets/shared/dialogs/master_key_dailog.dart b/lib/widgets/shared/dialogs/master_key_dailog.dart index cb277121..3ea6fa43 100644 --- a/lib/widgets/shared/dialogs/master_key_dailog.dart +++ b/lib/widgets/shared/dialogs/master_key_dailog.dart @@ -12,15 +12,10 @@ class MasterKeyDailog extends StatefulWidget { final List list; final okText; final Function(MasterKeyModel) okFunction; - MasterKeyModel? selectedValue; + MasterKeyModel selectedValue; final bool isICD; - MasterKeyDailog( - {required this.list, - required this.okText, - required this.okFunction, - this.selectedValue, - this.isICD = false}); + MasterKeyDailog({@required this.list, @required this.okText, @required this.okFunction, this.selectedValue, this.isICD = false}); @override _MasterKeyDailogState createState() => _MasterKeyDailogState(); @@ -44,9 +39,8 @@ class _MasterKeyDailogState extends State { Widget cancelButton = ElevatedButton( child: AppText( TranslationBase.of(context).cancel, - color: Colors.grey, - fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * - (SizeConfig.isWidthLarge ? 3.5 : 5), + color: Colors.white, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * (SizeConfig.isWidthLarge ? 3.5 : 5), ), onPressed: () { Navigator.of(context).pop(); @@ -54,12 +48,11 @@ class _MasterKeyDailogState extends State { Widget continueButton = ElevatedButton( child: AppText( this.widget.okText, - color: Colors.grey, - fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * - (SizeConfig.isWidthLarge ? 3.5 : 5), + color: Colors.white, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * (SizeConfig.isWidthLarge ? 3.5 : 5), ), onPressed: () { - this.widget.okFunction(widget.selectedValue!); + this.widget.okFunction(widget.selectedValue); Navigator.of(context).pop(); }); // set up the AlertDialog @@ -83,21 +76,12 @@ class _MasterKeyDailogState extends State { ...widget.list .map((item) => RadioListTile( title: AppText( - '${projectViewModel.isArabic ? item.nameAr : item.nameEn}' + - (widget.isICD ? '/${item.code}' : ''), + '${projectViewModel.isArabic ? item.nameAr : item.nameEn}' + (widget.isICD ? '/${item.code}' : ''), ), - groupValue: widget.isICD - ? widget.selectedValue!.code.toString() - : widget.selectedValue!.id.toString(), - value: widget.isICD - ? widget.selectedValue!.code.toString() - : item.id.toString(), + groupValue: widget.isICD ? widget.selectedValue.code.toString() : widget.selectedValue.id.toString(), + value: widget.isICD ? widget.selectedValue.code.toString() : item.id.toString(), activeColor: Colors.blue.shade700, - selected: widget.isICD - ? item.code.toString() == - widget.selectedValue!.code.toString() - : item.id.toString() == - widget.selectedValue!.id.toString(), + selected: widget.isICD ? item.code.toString() == widget.selectedValue.code.toString() : item.id.toString() == widget.selectedValue.id.toString(), onChanged: (val) { setState(() { widget.selectedValue = item; diff --git a/lib/widgets/shared/dialogs/search-drugs-dailog-list.dart b/lib/widgets/shared/dialogs/search-drugs-dailog-list.dart index a4c3ac95..0bfa2a42 100644 --- a/lib/widgets/shared/dialogs/search-drugs-dailog-list.dart +++ b/lib/widgets/shared/dialogs/search-drugs-dailog-list.dart @@ -1,5 +1,3 @@ -import 'dart:html'; - import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; import 'package:flutter/material.dart'; @@ -11,12 +9,7 @@ class ListSelectDialog extends StatefulWidget { final Function(dynamic) okFunction; dynamic selectedValue; - ListSelectDialog( - {required this.list, - required this.attributeName, - required this.attributeValueId, - required this.okText, - required this.okFunction}); + ListSelectDialog({@required this.list, @required this.attributeName, @required this.attributeValueId, @required this.okText, @required this.okFunction}); @override _ListSelectDialogState createState() => _ListSelectDialogState(); @@ -68,13 +61,10 @@ class _ListSelectDialogState extends State { ...widget.list .map((item) => RadioListTile( title: Text("${item[widget.attributeName].toString()}"), - groupValue: widget.selectedValue[widget.attributeValueId] - .toString(), + groupValue: widget.selectedValue[widget.attributeValueId].toString(), value: item[widget.attributeValueId].toString(), activeColor: Colors.blue.shade700, - selected: item[widget.attributeValueId].toString() == - widget.selectedValue[widget.attributeValueId] - .toString(), + selected: item[widget.attributeValueId].toString() == widget.selectedValue[widget.attributeValueId].toString(), onChanged: (val) { setState(() { widget.selectedValue = item; diff --git a/lib/widgets/shared/speech-text-popup.dart b/lib/widgets/shared/speech-text-popup.dart index cfa10ed3..5ddf6860 100644 --- a/lib/widgets/shared/speech-text-popup.dart +++ b/lib/widgets/shared/speech-text-popup.dart @@ -66,10 +66,10 @@ class _MyStatefulBuilderState extends State { if ((p['searchText'] != 'null' && p['searchText'] != null && p['searchText'] != "" && - isClosed == false) && - mounted) { + isClosed == false)) { setState(() { searchText = p['searchText']; + SpeechToText.closeAlertDialog(context); }); } else if (p['searchText'] == 'null') { setState(() { diff --git a/lib/widgets/shared/text_fields/TextFields.dart b/lib/widgets/shared/text_fields/TextFields.dart index 66f810c7..005d4c0e 100644 --- a/lib/widgets/shared/text_fields/TextFields.dart +++ b/lib/widgets/shared/text_fields/TextFields.dart @@ -4,8 +4,7 @@ import 'package:flutter/services.dart'; class NumberTextInputFormatter extends TextInputFormatter { @override - TextEditingValue formatEditUpdate( - TextEditingValue oldValue, TextEditingValue newValue) { + TextEditingValue formatEditUpdate(TextEditingValue oldValue, TextEditingValue newValue) { final int newTextLength = newValue.text.length; int selectionIndex = newValue.selection.end; int usedSubstringIndex = 0; @@ -27,8 +26,7 @@ class NumberTextInputFormatter extends TextInputFormatter { if (newValue.selection.end >= 10) selectionIndex++; } // Dump the rest. - if (newTextLength >= usedSubstringIndex) - newText.write(newValue.text.substring(usedSubstringIndex)); + if (newTextLength >= usedSubstringIndex) newText.write(newValue.text.substring(usedSubstringIndex)); return TextEditingValue( text: newText.toString(), selection: TextSelection.collapsed(offset: selectionIndex), @@ -40,11 +38,11 @@ final _mobileFormatter = NumberTextInputFormatter(); class TextFields extends StatefulWidget { TextFields({ - Key? key, + Key key, this.type, this.hintText, this.suffixIcon, - this.autoFocus = false, + this.autoFocus, this.onChanged, this.initialValue, this.minLines, @@ -64,7 +62,7 @@ class TextFields extends StatefulWidget { this.borderOnlyError = false, this.onSaved, this.onSuffixTap, - this.readOnly = false, + this.readOnly: false, this.maxLength, this.prefixIcon, this.bare = false, @@ -83,26 +81,26 @@ class TextFields extends StatefulWidget { this.borderWidth = 1, }) : super(key: key); - final String? hintText; - final String? initialValue; - final String? type; + final String hintText; + final String initialValue; + final String type; final bool autoFocus; - final IconData? suffixIcon; - final Color? suffixIconColor; - final Icon? prefixIcon; - final VoidCallback? onTap; - final Function? onTapTextFields; - final TextEditingController? controller; - final TextInputType? keyboardType; - final FormFieldValidator? validator; - final Function? onSaved; - final Function? onSuffixTap; - final Function? onChanged; - final Function? onSubmit; + final IconData suffixIcon; + final Color suffixIconColor; + final Icon prefixIcon; + final VoidCallback onTap; + final Function onTapTextFields; + final TextEditingController controller; + final TextInputType keyboardType; + final FormFieldValidator validator; + final Function onSaved; + final Function onSuffixTap; + final Function onChanged; + final Function onSubmit; final bool readOnly; - final int? maxLength; - final int? minLines; - final int? maxLines; + final int maxLength; + final int minLines; + final int maxLines; final bool maxLengthEnforced; final bool bare; final TextInputAction inputAction; @@ -110,16 +108,16 @@ class TextFields extends StatefulWidget { final FontWeight fontWeight; final bool keepPadding; final TextCapitalization textCapitalization; - final List? inputFormatters; + final List inputFormatters; final bool autoValidate; - final EdgeInsets? padding; + final EdgeInsets padding; final bool focus; final bool borderOnlyError; - final Color? hintColor; - final Color? fillColor; + final Color hintColor; + final Color fillColor; final bool hasBorder; final bool showLabelText; - Color? borderColor; + Color borderColor; final double borderRadius; final double borderWidth; bool hasLabelText; @@ -168,30 +166,22 @@ class _TextFieldsState extends State { view = false; }); }, - child: Icon(EvaIcons.eye, - size: 24.0, color: Color.fromRGBO(78, 62, 253, 1.0))) + child: Icon(EvaIcons.eye, size: 24.0, color: Color.fromRGBO(78, 62, 253, 1.0))) : InkWell( onTap: () { this.setState(() { view = true; }); }, - child: Icon(EvaIcons.eyeOff, - size: 24.0, color: Colors.grey[500]))); + child: Icon(EvaIcons.eyeOff, size: 24.0, color: Colors.grey[500]))); } break; default: if (widget.suffixIcon != null) - return InkWell( - onTap: widget.onSuffixTap!(), - child: Icon(widget.suffixIcon, - size: 22.0, - color: widget.suffixIconColor != null - ? widget.suffixIconColor - : Colors.grey[500])); + return InkWell(onTap: widget.onSuffixTap, child: Icon(widget.suffixIcon, size: 22.0, color: widget.suffixIconColor != null ? widget.suffixIconColor : Colors.grey[500])); else - return SizedBox(); + return null; } } @@ -216,22 +206,19 @@ class _TextFieldsState extends State { // color: Color.fromRGBO(70, 68, 167, focus ? 0.20 : 0), // offset: Offset(0.0, 13.0), // blurRadius: focus ? 34.0 : 12.0) - BoxShadow( - color: Color.fromRGBO(110, 68, 80, focus ? 0.20 : 0), - offset: Offset(0.0, 13.0), - blurRadius: focus ? 34.0 : 12.0) + BoxShadow(color: Color.fromRGBO(110, 68, 80, focus ? 0.20 : 0), offset: Offset(0.0, 13.0), blurRadius: focus ? 34.0 : 12.0) ]), child: Column( children: [ TextFormField( - onTap: widget.onTapTextFields!(), + onTap: widget.onTapTextFields, keyboardAppearance: Theme.of(context).brightness, scrollPhysics: BouncingScrollPhysics(), // autovalidate: widget.autoValidate, textCapitalization: widget.textCapitalization, onFieldSubmitted: widget.inputAction == TextInputAction.next ? (widget.onSubmit != null - ? widget.onSubmit!() + ? widget.onSubmit : (val) { _focusNode.nextFocus(); }) @@ -239,7 +226,7 @@ class _TextFieldsState extends State { textInputAction: widget.inputAction, minLines: widget.minLines ?? 1, maxLines: widget.maxLines ?? 1, - // maxLengthEnforcement: widget.maxLengthEnforced, + //maxLengthEnforced: widget.maxLengthEnforced, initialValue: widget.initialValue, onChanged: (value) { if (widget.showLabelText) { @@ -253,7 +240,7 @@ class _TextFieldsState extends State { }); } } - if (widget.onChanged != null) widget.onChanged!(value); + if (widget.onChanged != null) widget.onChanged(value); }, focusNode: _focusNode, maxLength: widget.maxLength ?? null, @@ -263,9 +250,8 @@ class _TextFieldsState extends State { obscureText: widget.type == "password" && !view ? true : false, autofocus: widget.autoFocus ?? false, validator: widget.validator, - onSaved: widget.onSaved!(), - style: Theme.of(context).textTheme.bodyLarge!.copyWith( - fontSize: widget.fontSize, fontWeight: widget.fontWeight), + onSaved: widget.onSaved, + style: Theme.of(context).textTheme.bodyText1.copyWith(fontSize: widget.fontSize, fontWeight: widget.fontWeight), inputFormatters: widget.keyboardType == TextInputType.phone ? [ // WhitelistingTextInputFormatter.digitsOnly, @@ -286,73 +272,29 @@ class _TextFieldsState extends State { fontWeight: widget.fontWeight, color: widget.hintColor ?? Theme.of(context).hintColor, ), - contentPadding: widget.padding != null - ? widget.padding - : EdgeInsets.symmetric( - vertical: - (widget.bare && !widget.keepPadding) ? 0.0 : 10.0, - horizontal: 16.0), + contentPadding: widget.padding != null ? widget.padding : EdgeInsets.symmetric(vertical: (widget.bare && !widget.keepPadding) ? 0.0 : 10.0, horizontal: 16.0), filled: true, - fillColor: widget.bare - ? Colors.transparent - : Theme.of(context).backgroundColor, + fillColor: widget.bare ? Colors.transparent : Theme.of(context).backgroundColor, suffixIcon: _buildSuffixIcon(), prefixIcon: widget.prefixIcon, - errorStyle: TextStyle( - fontSize: 12.0, - fontWeight: widget.fontWeight, - height: widget.borderOnlyError ? 0.0 : null), + errorStyle: TextStyle(fontSize: 12.0, fontWeight: widget.fontWeight, height: widget.borderOnlyError ? 0.0 : null), errorBorder: OutlineInputBorder( - borderSide: widget.hasBorder - ? BorderSide( - color: Theme.of(context) - .errorColor - .withOpacity(widget.bare ? 0.0 : 0.5), - width: 1.0) - : BorderSide(color: Colors.transparent, width: 0), - borderRadius: widget.hasBorder - ? BorderRadius.circular( - widget.bare ? 0.0 : widget.borderRadius) - : BorderRadius.circular(0.0), + borderSide: widget.hasBorder ? BorderSide(color: Theme.of(context).errorColor.withOpacity(widget.bare ? 0.0 : 0.5), width: 1.0) : BorderSide(color: Colors.transparent, width: 0), + borderRadius: widget.hasBorder ? BorderRadius.circular(widget.bare ? 0.0 : widget.borderRadius) : BorderRadius.circular(0.0), ), focusedErrorBorder: OutlineInputBorder( - borderSide: widget.hasBorder - ? BorderSide( - color: Theme.of(context) - .errorColor - .withOpacity(widget.bare ? 0.0 : 0.5), - width: 1.0) - : BorderSide(color: Colors.transparent, width: 0), - borderRadius: BorderRadius.circular( - widget.bare ? 0.0 : widget.borderRadius)), + borderSide: widget.hasBorder ? BorderSide(color: Theme.of(context).errorColor.withOpacity(widget.bare ? 0.0 : 0.5), width: 1.0) : BorderSide(color: Colors.transparent, width: 0), + borderRadius: BorderRadius.circular(widget.bare ? 0.0 : widget.borderRadius)), focusedBorder: OutlineInputBorder( - borderSide: widget.hasBorder - ? BorderSide( - color: widget.borderColor!, width: widget.borderWidth) - : BorderSide(color: Colors.transparent, width: 0), - borderRadius: widget.hasBorder - ? BorderRadius.circular( - widget.bare ? 0.0 : widget.borderRadius) - : BorderRadius.circular(0.0), + borderSide: widget.hasBorder ? BorderSide(color: widget.borderColor, width: widget.borderWidth) : BorderSide(color: Colors.transparent, width: 0), + borderRadius: widget.hasBorder ? BorderRadius.circular(widget.bare ? 0.0 : widget.borderRadius) : BorderRadius.circular(0.0), ), disabledBorder: OutlineInputBorder( - borderSide: widget.hasBorder - ? BorderSide( - color: widget.borderColor!, width: widget.borderWidth) - : BorderSide(color: Colors.transparent, width: 0), - borderRadius: widget.hasBorder - ? BorderRadius.circular( - widget.bare ? 0.0 : widget.borderRadius) - : BorderRadius.circular(0.0)), + borderSide: widget.hasBorder ? BorderSide(color: widget.borderColor, width: widget.borderWidth) : BorderSide(color: Colors.transparent, width: 0), + borderRadius: widget.hasBorder ? BorderRadius.circular(widget.bare ? 0.0 : widget.borderRadius) : BorderRadius.circular(0.0)), enabledBorder: OutlineInputBorder( - borderSide: widget.hasBorder - ? BorderSide( - color: widget.borderColor!, width: widget.borderWidth) - : BorderSide(color: Colors.transparent, width: 0), - borderRadius: widget.hasBorder - ? BorderRadius.circular( - widget.bare ? 0.0 : widget.borderRadius) - : BorderRadius.circular(0.0), + borderSide: widget.hasBorder ? BorderSide(color: widget.borderColor, width: widget.borderWidth) : BorderSide(color: Colors.transparent, width: 0), + borderRadius: widget.hasBorder ? BorderRadius.circular(widget.bare ? 0.0 : widget.borderRadius) : BorderRadius.circular(0.0), ), ), ), diff --git a/lib/widgets/shared/text_fields/html_rich_editor.dart b/lib/widgets/shared/text_fields/html_rich_editor.dart index a79bf107..6b5cd080 100644 --- a/lib/widgets/shared/text_fields/html_rich_editor.dart +++ b/lib/widgets/shared/text_fields/html_rich_editor.dart @@ -14,13 +14,13 @@ import '../speech-text-popup.dart'; class HtmlRichEditor extends StatefulWidget { final String hint; - final String? initialText; + final String initialText; final double height; - final BoxDecoration? decoration; + final BoxDecoration decoration; final bool darkMode; final bool showBottomToolbar; - final List? toolbar; - final HtmlEditorController? controller; + final List toolbar; + final HtmlEditorController controller; HtmlRichEditor({ key, @@ -39,7 +39,7 @@ class HtmlRichEditor extends StatefulWidget { } class _HtmlRichEditorState extends State { - late ProjectViewModel projectViewModel; + ProjectViewModel projectViewModel; stt.SpeechToText speech = stt.SpeechToText(); var recognizedWord; var event = RobotProvider(); @@ -64,7 +64,7 @@ class _HtmlRichEditorState extends State { return Stack( children: [ HtmlEditor( - controller: widget.controller!, + controller: widget.controller, htmlToolbarOptions: HtmlToolbarOptions(defaultToolbarButtons: [ StyleButtons(), FontSettingButtons(), @@ -88,7 +88,7 @@ class _HtmlRichEditorState extends State { borderRadius: BorderRadius.all( Radius.circular(30.0), ), - border: Border.all(color: Colors.grey[200]!, width: 0.5), + border: Border.all(color: Colors.grey[200], width: 0.5), ), )), Positioned( @@ -146,12 +146,13 @@ class _HtmlRichEditorState extends State { void resultListener(result) async { recognizedWord = result.recognizedWords; event.setValue({"searchText": recognizedWord}); - String? txt = await widget.controller!.getText(); + String txt = await widget.controller.getText(); if (result.finalResult == true) { setState(() { + widget.controller.setText(txt + recognizedWord); SpeechToText.closeAlertDialog(context); - speech.stop(); - widget.controller!.setText(txt! + recognizedWord); + // speech.stop(); + }); } else { print(result.finalResult); diff --git a/pubspec.lock b/pubspec.lock new file mode 100644 index 00000000..b12aacbb --- /dev/null +++ b/pubspec.lock @@ -0,0 +1,1529 @@ +# Generated by pub +# See https://dart.dev/tools/pub/glossary#lockfile +packages: + _fe_analyzer_shared: + dependency: transitive + description: + name: _fe_analyzer_shared + url: "https://pub.dartlang.org" + source: hosted + version: "22.0.0" + _flutterfire_internals: + dependency: transitive + description: + name: _flutterfire_internals + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.12" + analyzer: + dependency: transitive + description: + name: analyzer + url: "https://pub.dartlang.org" + source: hosted + version: "1.7.2" + archive: + dependency: transitive + description: + name: archive + url: "https://pub.dartlang.org" + source: hosted + version: "3.3.5" + args: + dependency: transitive + description: + name: args + url: "https://pub.dartlang.org" + source: hosted + version: "2.3.1" + async: + dependency: transitive + description: + name: async + url: "https://pub.dartlang.org" + source: hosted + version: "2.9.0" + autocomplete_textfield: + dependency: "direct main" + description: + name: autocomplete_textfield + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.1" + badges: + dependency: "direct main" + description: + name: badges + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.3" + barcode_scan2: + dependency: "direct main" + description: + name: barcode_scan2 + url: "https://pub.dartlang.org" + source: hosted + version: "4.2.2" + bazel_worker: + dependency: transitive + description: + name: bazel_worker + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.2" + boolean_selector: + dependency: transitive + description: + name: boolean_selector + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.0" + build: + dependency: transitive + description: + name: build + url: "https://pub.dartlang.org" + source: hosted + version: "1.6.3" + build_config: + dependency: transitive + description: + name: build_config + url: "https://pub.dartlang.org" + source: hosted + version: "0.4.6" + build_daemon: + dependency: transitive + description: + name: build_daemon + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.10" + build_modules: + dependency: transitive + description: + name: build_modules + url: "https://pub.dartlang.org" + source: hosted + version: "3.0.5" + build_resolvers: + dependency: transitive + description: + name: build_resolvers + url: "https://pub.dartlang.org" + source: hosted + version: "1.5.4" + build_runner: + dependency: "direct dev" + description: + name: build_runner + url: "https://pub.dartlang.org" + source: hosted + version: "1.11.5" + build_runner_core: + dependency: transitive + description: + name: build_runner_core + url: "https://pub.dartlang.org" + source: hosted + version: "6.1.10" + build_web_compilers: + dependency: "direct dev" + description: + name: build_web_compilers + url: "https://pub.dartlang.org" + source: hosted + version: "2.16.5" + built_collection: + dependency: transitive + description: + name: built_collection + url: "https://pub.dartlang.org" + source: hosted + version: "5.1.1" + built_value: + dependency: transitive + description: + name: built_value + url: "https://pub.dartlang.org" + source: hosted + version: "8.4.2" + cached_network_image: + dependency: "direct main" + description: + name: cached_network_image + url: "https://pub.dartlang.org" + source: hosted + version: "3.2.3" + cached_network_image_platform_interface: + dependency: transitive + description: + name: cached_network_image_platform_interface + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.0" + cached_network_image_web: + dependency: transitive + description: + name: cached_network_image_web + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.2" + characters: + dependency: transitive + description: + name: characters + url: "https://pub.dartlang.org" + source: hosted + version: "1.2.1" + charts_common: + dependency: transitive + description: + name: charts_common + url: "https://pub.dartlang.org" + source: hosted + version: "0.12.0" + charts_flutter: + dependency: "direct main" + description: + name: charts_flutter + url: "https://pub.dartlang.org" + source: hosted + version: "0.12.0" + checked_yaml: + dependency: transitive + description: + name: checked_yaml + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.4" + chewie: + dependency: transitive + description: + name: chewie + url: "https://pub.dartlang.org" + source: hosted + version: "1.3.6" + chewie_audio: + dependency: transitive + description: + name: chewie_audio + url: "https://pub.dartlang.org" + source: hosted + version: "1.3.0" + cli_util: + dependency: transitive + description: + name: cli_util + url: "https://pub.dartlang.org" + source: hosted + version: "0.3.5" + clock: + dependency: transitive + description: + name: clock + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.1" + code_builder: + dependency: transitive + description: + name: code_builder + url: "https://pub.dartlang.org" + source: hosted + version: "3.7.0" + collection: + dependency: transitive + description: + name: collection + url: "https://pub.dartlang.org" + source: hosted + version: "1.16.0" + connectivity: + dependency: "direct main" + description: + name: connectivity + url: "https://pub.dartlang.org" + source: hosted + version: "3.0.6" + connectivity_for_web: + dependency: transitive + description: + name: connectivity_for_web + url: "https://pub.dartlang.org" + source: hosted + version: "0.4.0+1" + connectivity_macos: + dependency: transitive + description: + name: connectivity_macos + url: "https://pub.dartlang.org" + source: hosted + version: "0.2.1+2" + connectivity_platform_interface: + dependency: transitive + description: + name: connectivity_platform_interface + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.1" + convert: + dependency: transitive + description: + name: convert + url: "https://pub.dartlang.org" + source: hosted + version: "3.1.1" + crypto: + dependency: transitive + description: + name: crypto + url: "https://pub.dartlang.org" + source: hosted + version: "3.0.2" + csslib: + dependency: transitive + description: + name: csslib + url: "https://pub.dartlang.org" + source: hosted + version: "0.17.2" + cupertino_icons: + dependency: "direct main" + description: + name: cupertino_icons + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.5" + dart_style: + dependency: transitive + description: + name: dart_style + url: "https://pub.dartlang.org" + source: hosted + version: "1.3.14" + date_time_picker: + dependency: "direct main" + description: + name: date_time_picker + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.0" + device_info: + dependency: "direct main" + description: + name: device_info + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.3" + device_info_platform_interface: + dependency: transitive + description: + name: device_info_platform_interface + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.1" + dropdown_search: + dependency: "direct main" + description: + name: dropdown_search + url: "https://pub.dartlang.org" + source: hosted + version: "3.0.1" + equatable: + dependency: transitive + description: + name: equatable + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.5" + eva_icons_flutter: + dependency: "direct main" + description: + name: eva_icons_flutter + url: "https://pub.dartlang.org" + source: hosted + version: "3.1.0" + expandable: + dependency: "direct main" + description: + name: expandable + url: "https://pub.dartlang.org" + source: hosted + version: "5.0.1" + fake_async: + dependency: transitive + description: + name: fake_async + url: "https://pub.dartlang.org" + source: hosted + version: "1.3.1" + ffi: + dependency: transitive + description: + name: ffi + url: "https://pub.dartlang.org" + source: hosted + version: "1.2.1" + file: + dependency: transitive + description: + name: file + url: "https://pub.dartlang.org" + source: hosted + version: "6.1.4" + file_picker: + dependency: "direct main" + description: + name: file_picker + url: "https://pub.dartlang.org" + source: hosted + version: "4.6.1" + firebase_analytics: + dependency: "direct main" + description: + name: firebase_analytics + url: "https://pub.dartlang.org" + source: hosted + version: "10.1.0" + firebase_analytics_platform_interface: + dependency: transitive + description: + name: firebase_analytics_platform_interface + url: "https://pub.dartlang.org" + source: hosted + version: "3.3.17" + firebase_analytics_web: + dependency: transitive + description: + name: firebase_analytics_web + url: "https://pub.dartlang.org" + source: hosted + version: "0.5.1+8" + firebase_core: + dependency: transitive + description: + name: firebase_core + url: "https://pub.dartlang.org" + source: hosted + version: "2.4.1" + firebase_core_platform_interface: + dependency: transitive + description: + name: firebase_core_platform_interface + url: "https://pub.dartlang.org" + source: hosted + version: "4.5.2" + firebase_core_web: + dependency: transitive + description: + name: firebase_core_web + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.0" + firebase_messaging: + dependency: "direct main" + description: + name: firebase_messaging + url: "https://pub.dartlang.org" + source: hosted + version: "14.2.1" + firebase_messaging_platform_interface: + dependency: transitive + description: + name: firebase_messaging_platform_interface + url: "https://pub.dartlang.org" + source: hosted + version: "4.2.10" + firebase_messaging_web: + dependency: transitive + description: + name: firebase_messaging_web + url: "https://pub.dartlang.org" + source: hosted + version: "3.2.11" + fixnum: + dependency: transitive + description: + name: fixnum + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.1" + fl_chart: + dependency: "direct main" + description: + name: fl_chart + url: "https://pub.dartlang.org" + source: hosted + version: "0.40.6" + flex_color_picker: + dependency: transitive + description: + name: flex_color_picker + url: "https://pub.dartlang.org" + source: hosted + version: "2.6.1" + flex_seed_scheme: + dependency: transitive + description: + name: flex_seed_scheme + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.0" + flutter: + dependency: "direct main" + description: flutter + source: sdk + version: "0.0.0" + flutter_blurhash: + dependency: transitive + description: + name: flutter_blurhash + url: "https://pub.dartlang.org" + source: hosted + version: "0.7.0" + flutter_cache_manager: + dependency: transitive + description: + name: flutter_cache_manager + url: "https://pub.dartlang.org" + source: hosted + version: "3.3.0" + flutter_colorpicker: + dependency: "direct main" + description: + name: flutter_colorpicker + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.3" + flutter_datetime_picker: + dependency: "direct main" + description: + name: flutter_datetime_picker + url: "https://pub.dartlang.org" + source: hosted + version: "1.5.1" + flutter_device_type: + dependency: "direct main" + description: + name: flutter_device_type + url: "https://pub.dartlang.org" + source: hosted + version: "0.4.0" + flutter_gifimage: + dependency: "direct main" + description: + name: flutter_gifimage + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.1" + flutter_html: + dependency: "direct main" + description: + name: flutter_html + url: "https://pub.dartlang.org" + source: hosted + version: "2.2.1" + flutter_inappwebview: + dependency: transitive + description: + name: flutter_inappwebview + url: "https://pub.dartlang.org" + source: hosted + version: "5.7.2+3" + flutter_keyboard_visibility: + dependency: transitive + description: + name: flutter_keyboard_visibility + url: "https://pub.dartlang.org" + source: hosted + version: "5.4.0" + flutter_keyboard_visibility_linux: + dependency: transitive + description: + name: flutter_keyboard_visibility_linux + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.0" + flutter_keyboard_visibility_macos: + dependency: transitive + description: + name: flutter_keyboard_visibility_macos + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.0" + flutter_keyboard_visibility_platform_interface: + dependency: transitive + description: + name: flutter_keyboard_visibility_platform_interface + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.0" + flutter_keyboard_visibility_web: + dependency: transitive + description: + name: flutter_keyboard_visibility_web + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.0" + flutter_keyboard_visibility_windows: + dependency: transitive + description: + name: flutter_keyboard_visibility_windows + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.0" + flutter_layout_grid: + dependency: transitive + description: + name: flutter_layout_grid + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.6" + flutter_localizations: + dependency: "direct main" + description: flutter + source: sdk + version: "0.0.0" + flutter_math_fork: + dependency: transitive + description: + name: flutter_math_fork + url: "https://pub.dartlang.org" + source: hosted + version: "0.5.0" + flutter_page_indicator: + dependency: transitive + description: + name: flutter_page_indicator + url: "https://pub.dartlang.org" + source: hosted + version: "0.0.3" + flutter_plugin_android_lifecycle: + dependency: transitive + description: + name: flutter_plugin_android_lifecycle + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.7" + flutter_staggered_grid_view: + dependency: "direct main" + description: + name: flutter_staggered_grid_view + url: "https://pub.dartlang.org" + source: hosted + version: "0.4.1" + flutter_svg: + dependency: transitive + description: + name: flutter_svg + url: "https://pub.dartlang.org" + source: hosted + version: "0.23.0+1" + flutter_swiper: + dependency: "direct main" + description: + name: flutter_swiper + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.6" + flutter_test: + dependency: "direct dev" + description: flutter + source: sdk + version: "0.0.0" + flutter_web_plugins: + dependency: transitive + description: flutter + source: sdk + version: "0.0.0" + fluttertoast: + dependency: "direct main" + description: + name: fluttertoast + url: "https://pub.dartlang.org" + source: hosted + version: "8.1.2" + font_awesome_flutter: + dependency: "direct main" + description: + name: font_awesome_flutter + url: "https://pub.dartlang.org" + source: hosted + version: "10.3.0" + get_it: + dependency: "direct main" + description: + name: get_it + url: "https://pub.dartlang.org" + source: hosted + version: "7.2.0" + glob: + dependency: transitive + description: + name: glob + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.1" + graphs: + dependency: transitive + description: + name: graphs + url: "https://pub.dartlang.org" + source: hosted + version: "0.2.0" + hexcolor: + dependency: "direct main" + description: + name: hexcolor + url: "https://pub.dartlang.org" + source: hosted + version: "3.0.1" + hijri: + dependency: transitive + description: + name: hijri + url: "https://pub.dartlang.org" + source: hosted + version: "3.0.0" + hijri_picker: + dependency: "direct main" + description: + name: hijri_picker + url: "https://pub.dartlang.org" + source: hosted + version: "3.0.0" + html: + dependency: "direct main" + description: + name: html + url: "https://pub.dartlang.org" + source: hosted + version: "0.15.1" + html_editor_enhanced: + dependency: "direct main" + description: + name: html_editor_enhanced + url: "https://pub.dartlang.org" + source: hosted + version: "2.5.0" + http: + dependency: "direct main" + description: + name: http + url: "https://pub.dartlang.org" + source: hosted + version: "0.13.5" + http_interceptor: + dependency: "direct main" + description: + name: http_interceptor + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.2" + http_multi_server: + dependency: transitive + description: + name: http_multi_server + url: "https://pub.dartlang.org" + source: hosted + version: "2.2.0" + http_parser: + dependency: transitive + description: + name: http_parser + url: "https://pub.dartlang.org" + source: hosted + version: "4.0.2" + infinite_listview: + dependency: transitive + description: + name: infinite_listview + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.0" + intl: + dependency: "direct main" + description: + name: intl + url: "https://pub.dartlang.org" + source: hosted + version: "0.17.0" + io: + dependency: transitive + description: + name: io + url: "https://pub.dartlang.org" + source: hosted + version: "0.3.5" + js: + dependency: transitive + description: + name: js + url: "https://pub.dartlang.org" + source: hosted + version: "0.6.4" + json_annotation: + dependency: transitive + description: + name: json_annotation + url: "https://pub.dartlang.org" + source: hosted + version: "4.7.0" + local_auth: + dependency: "direct main" + description: + name: local_auth + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.3" + local_auth_android: + dependency: transitive + description: + name: local_auth_android + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.17" + local_auth_ios: + dependency: transitive + description: + name: local_auth_ios + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.12" + local_auth_platform_interface: + dependency: transitive + description: + name: local_auth_platform_interface + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.6" + local_auth_windows: + dependency: transitive + description: + name: local_auth_windows + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.4" + logging: + dependency: transitive + description: + name: logging + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.0" + maps_launcher: + dependency: "direct main" + description: + name: maps_launcher + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.1" + matcher: + dependency: transitive + description: + name: matcher + url: "https://pub.dartlang.org" + source: hosted + version: "0.12.12" + material_color_utilities: + dependency: transitive + description: + name: material_color_utilities + url: "https://pub.dartlang.org" + source: hosted + version: "0.1.5" + meta: + dependency: transitive + description: + name: meta + url: "https://pub.dartlang.org" + source: hosted + version: "1.8.0" + mime: + dependency: transitive + description: + name: mime + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.3" + nested: + dependency: transitive + description: + name: nested + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.0" + numberpicker: + dependency: transitive + description: + name: numberpicker + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.1" + numerus: + dependency: transitive + description: + name: numerus + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.1" + octo_image: + dependency: transitive + description: + name: octo_image + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.2" + package_config: + dependency: transitive + description: + name: package_config + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.0" + path: + dependency: transitive + description: + name: path + url: "https://pub.dartlang.org" + source: hosted + version: "1.8.2" + path_drawing: + dependency: transitive + description: + name: path_drawing + url: "https://pub.dartlang.org" + source: hosted + version: "0.5.1+1" + path_parsing: + dependency: transitive + description: + name: path_parsing + url: "https://pub.dartlang.org" + source: hosted + version: "0.2.1" + path_provider: + dependency: transitive + description: + name: path_provider + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.11" + path_provider_android: + dependency: transitive + description: + name: path_provider_android + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.22" + path_provider_ios: + dependency: transitive + description: + name: path_provider_ios + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.11" + path_provider_linux: + dependency: transitive + description: + name: path_provider_linux + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.7" + path_provider_macos: + dependency: transitive + description: + name: path_provider_macos + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.6" + path_provider_platform_interface: + dependency: transitive + description: + name: path_provider_platform_interface + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.5" + path_provider_windows: + dependency: transitive + description: + name: path_provider_windows + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.7" + pedantic: + dependency: transitive + description: + name: pedantic + url: "https://pub.dartlang.org" + source: hosted + version: "1.11.1" + percent_indicator: + dependency: "direct main" + description: + name: percent_indicator + url: "https://pub.dartlang.org" + source: hosted + version: "4.2.2" + permission_handler: + dependency: "direct main" + description: + name: permission_handler + url: "https://pub.dartlang.org" + source: hosted + version: "10.2.0" + permission_handler_android: + dependency: transitive + description: + name: permission_handler_android + url: "https://pub.dartlang.org" + source: hosted + version: "10.2.0" + permission_handler_apple: + dependency: transitive + description: + name: permission_handler_apple + url: "https://pub.dartlang.org" + source: hosted + version: "9.0.7" + permission_handler_platform_interface: + dependency: transitive + description: + name: permission_handler_platform_interface + url: "https://pub.dartlang.org" + source: hosted + version: "3.9.0" + permission_handler_windows: + dependency: transitive + description: + name: permission_handler_windows + url: "https://pub.dartlang.org" + source: hosted + version: "0.1.2" + petitparser: + dependency: transitive + description: + name: petitparser + url: "https://pub.dartlang.org" + source: hosted + version: "5.1.0" + platform: + dependency: transitive + description: + name: platform + url: "https://pub.dartlang.org" + source: hosted + version: "3.1.0" + plugin_platform_interface: + dependency: transitive + description: + name: plugin_platform_interface + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.3" + pointer_interceptor: + dependency: transitive + description: + name: pointer_interceptor + url: "https://pub.dartlang.org" + source: hosted + version: "0.9.3+3" + pointycastle: + dependency: transitive + description: + name: pointycastle + url: "https://pub.dartlang.org" + source: hosted + version: "3.6.2" + pool: + dependency: transitive + description: + name: pool + url: "https://pub.dartlang.org" + source: hosted + version: "1.5.1" + process: + dependency: transitive + description: + name: process + url: "https://pub.dartlang.org" + source: hosted + version: "4.2.4" + protobuf: + dependency: transitive + description: + name: protobuf + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.0" + provider: + dependency: "direct main" + description: + name: provider + url: "https://pub.dartlang.org" + source: hosted + version: "6.0.5" + pub_semver: + dependency: transitive + description: + name: pub_semver + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.3" + pubspec_parse: + dependency: transitive + description: + name: pubspec_parse + url: "https://pub.dartlang.org" + source: hosted + version: "0.1.8" + quiver: + dependency: "direct main" + description: + name: quiver + url: "https://pub.dartlang.org" + source: hosted + version: "3.2.1" + rxdart: + dependency: transitive + description: + name: rxdart + url: "https://pub.dartlang.org" + source: hosted + version: "0.27.7" + scratch_space: + dependency: transitive + description: + name: scratch_space + url: "https://pub.dartlang.org" + source: hosted + version: "0.0.4+3" + shared_preferences: + dependency: "direct main" + description: + name: shared_preferences + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.15" + shared_preferences_android: + dependency: transitive + description: + name: shared_preferences_android + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.14" + shared_preferences_ios: + dependency: transitive + description: + name: shared_preferences_ios + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.1" + shared_preferences_linux: + dependency: transitive + description: + name: shared_preferences_linux + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.2" + shared_preferences_macos: + dependency: transitive + description: + name: shared_preferences_macos + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.4" + shared_preferences_platform_interface: + dependency: transitive + description: + name: shared_preferences_platform_interface + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.0" + shared_preferences_web: + dependency: transitive + description: + name: shared_preferences_web + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.4" + shared_preferences_windows: + dependency: transitive + description: + name: shared_preferences_windows + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.2" + shelf: + dependency: transitive + description: + name: shelf + url: "https://pub.dartlang.org" + source: hosted + version: "1.4.0" + shelf_web_socket: + dependency: transitive + description: + name: shelf_web_socket + url: "https://pub.dartlang.org" + source: hosted + version: "0.2.4+1" + sky_engine: + dependency: transitive + description: flutter + source: sdk + version: "0.0.99" + source_maps: + dependency: transitive + description: + name: source_maps + url: "https://pub.dartlang.org" + source: hosted + version: "0.10.11" + source_span: + dependency: transitive + description: + name: source_span + url: "https://pub.dartlang.org" + source: hosted + version: "1.9.0" + speech_to_text: + dependency: "direct main" + description: + name: speech_to_text + url: "https://pub.dartlang.org" + source: hosted + version: "6.1.1" + speech_to_text_macos: + dependency: transitive + description: + name: speech_to_text_macos + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.2" + speech_to_text_platform_interface: + dependency: transitive + description: + name: speech_to_text_platform_interface + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.1" + sqflite: + dependency: transitive + description: + name: sqflite + url: "https://pub.dartlang.org" + source: hosted + version: "2.2.2" + sqflite_common: + dependency: transitive + description: + name: sqflite_common + url: "https://pub.dartlang.org" + source: hosted + version: "2.4.0+2" + stack_trace: + dependency: transitive + description: + name: stack_trace + url: "https://pub.dartlang.org" + source: hosted + version: "1.10.0" + sticky_headers: + dependency: "direct main" + description: + name: sticky_headers + url: "https://pub.dartlang.org" + source: hosted + version: "0.3.0+2" + stream_channel: + dependency: transitive + description: + name: stream_channel + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.0" + stream_transform: + dependency: transitive + description: + name: stream_transform + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.0" + string_scanner: + dependency: transitive + description: + name: string_scanner + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.1" + synchronized: + dependency: transitive + description: + name: synchronized + url: "https://pub.dartlang.org" + source: hosted + version: "3.0.0+3" + term_glyph: + dependency: transitive + description: + name: term_glyph + url: "https://pub.dartlang.org" + source: hosted + version: "1.2.1" + test_api: + dependency: transitive + description: + name: test_api + url: "https://pub.dartlang.org" + source: hosted + version: "0.4.12" + timing: + dependency: transitive + description: + name: timing + url: "https://pub.dartlang.org" + source: hosted + version: "0.1.1+3" + transformer_page_view: + dependency: transitive + description: + name: transformer_page_view + url: "https://pub.dartlang.org" + source: hosted + version: "0.1.6" + tuple: + dependency: transitive + description: + name: tuple + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.1" + typed_data: + dependency: transitive + description: + name: typed_data + url: "https://pub.dartlang.org" + source: hosted + version: "1.3.1" + url_launcher: + dependency: "direct main" + description: + name: url_launcher + url: "https://pub.dartlang.org" + source: hosted + version: "6.1.7" + url_launcher_android: + dependency: transitive + description: + name: url_launcher_android + url: "https://pub.dartlang.org" + source: hosted + version: "6.0.22" + url_launcher_ios: + dependency: transitive + description: + name: url_launcher_ios + url: "https://pub.dartlang.org" + source: hosted + version: "6.0.17" + url_launcher_linux: + dependency: transitive + description: + name: url_launcher_linux + url: "https://pub.dartlang.org" + source: hosted + version: "3.0.1" + url_launcher_macos: + dependency: transitive + description: + name: url_launcher_macos + url: "https://pub.dartlang.org" + source: hosted + version: "3.0.1" + url_launcher_platform_interface: + dependency: transitive + description: + name: url_launcher_platform_interface + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.1" + url_launcher_web: + dependency: transitive + description: + name: url_launcher_web + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.13" + url_launcher_windows: + dependency: transitive + description: + name: url_launcher_windows + url: "https://pub.dartlang.org" + source: hosted + version: "3.0.1" + uuid: + dependency: transitive + description: + name: uuid + url: "https://pub.dartlang.org" + source: hosted + version: "3.0.7" + vector_math: + dependency: transitive + description: + name: vector_math + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.2" + video_player: + dependency: transitive + description: + name: video_player + url: "https://pub.dartlang.org" + source: hosted + version: "2.4.10" + video_player_android: + dependency: transitive + description: + name: video_player_android + url: "https://pub.dartlang.org" + source: hosted + version: "2.3.10" + video_player_avfoundation: + dependency: transitive + description: + name: video_player_avfoundation + url: "https://pub.dartlang.org" + source: hosted + version: "2.3.8" + video_player_platform_interface: + dependency: transitive + description: + name: video_player_platform_interface + url: "https://pub.dartlang.org" + source: hosted + version: "6.0.1" + video_player_web: + dependency: transitive + description: + name: video_player_web + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.13" + visibility_detector: + dependency: transitive + description: + name: visibility_detector + url: "https://pub.dartlang.org" + source: hosted + version: "0.3.3" + wakelock: + dependency: transitive + description: + name: wakelock + url: "https://pub.dartlang.org" + source: hosted + version: "0.6.2" + wakelock_macos: + dependency: transitive + description: + name: wakelock_macos + url: "https://pub.dartlang.org" + source: hosted + version: "0.4.0" + wakelock_platform_interface: + dependency: transitive + description: + name: wakelock_platform_interface + url: "https://pub.dartlang.org" + source: hosted + version: "0.3.0" + wakelock_web: + dependency: transitive + description: + name: wakelock_web + url: "https://pub.dartlang.org" + source: hosted + version: "0.4.0" + wakelock_windows: + dependency: transitive + description: + name: wakelock_windows + url: "https://pub.dartlang.org" + source: hosted + version: "0.2.0" + watcher: + dependency: transitive + description: + name: watcher + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.2" + web_socket_channel: + dependency: transitive + description: + name: web_socket_channel + url: "https://pub.dartlang.org" + source: hosted + version: "1.2.0" + webview_flutter: + dependency: transitive + description: + name: webview_flutter + url: "https://pub.dartlang.org" + source: hosted + version: "2.8.0" + webview_flutter_android: + dependency: transitive + description: + name: webview_flutter_android + url: "https://pub.dartlang.org" + source: hosted + version: "2.10.4" + webview_flutter_platform_interface: + dependency: transitive + description: + name: webview_flutter_platform_interface + url: "https://pub.dartlang.org" + source: hosted + version: "1.9.5" + webview_flutter_wkwebview: + dependency: transitive + description: + name: webview_flutter_wkwebview + url: "https://pub.dartlang.org" + source: hosted + version: "2.9.5" + win32: + dependency: transitive + description: + name: win32 + url: "https://pub.dartlang.org" + source: hosted + version: "2.6.1" + xdg_directories: + dependency: transitive + description: + name: xdg_directories + url: "https://pub.dartlang.org" + source: hosted + version: "0.2.0+2" + xml: + dependency: transitive + description: + name: xml + url: "https://pub.dartlang.org" + source: hosted + version: "5.4.1" + yaml: + dependency: transitive + description: + name: yaml + url: "https://pub.dartlang.org" + source: hosted + version: "3.1.1" +sdks: + dart: ">=2.18.1 <3.0.0" + flutter: ">=3.3.0" diff --git a/pubspec.yaml b/pubspec.yaml index f7f236cb..e73526f3 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -11,11 +11,11 @@ description: A new Flutter project. # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. # Read more about iOS versioning at # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html -version: 4.3.5+1 +version: 1.3.9+19 environment: - sdk: ">=3.0.0 <3.13.0" + sdk: ">=2.7.0 <3.0.0" #dependency_overrides: @@ -28,106 +28,96 @@ dependencies: flutter: sdk: flutter hexcolor: ^3.0.1 + flutter_localizations: + sdk: flutter flutter_device_type: ^0.4.0 - http: ^1.1.2 - provider: ^6.1.1 - shared_preferences: ^2.2.2 + intl: ^0.17.0 + http: ^0.13.0 + provider: ^6.0.1 + shared_preferences: ^2.0.6 # imei_plugin: ^1.2.0 # flutter_flexible_toast: ^0.1.4 - fluttertoast: ^8.2.4 - local_auth: ^2.1.7 - http_interceptor: any + fluttertoast: ^8.0.8 + local_auth: 1.1.8 + http_interceptor: ^1.0.2 connectivity: ^3.0.6 - maps_launcher: ^2.2.0 - url_launcher: ^6.2.1 + maps_launcher: ^2.0.0 + url_launcher: ^6.0.6 charts_flutter: ^0.12.0 - #flutter_charts: ^0.5.2 - #gelin: ^0.1.6 - #flutter_swiper: ^1.1.6 - flutter_swiper_view: ^1.1.8 + flutter_swiper: ^1.1.6 #Icons - eva_icons_flutter: ^3.1.0 - font_awesome_flutter: ^10.6.0 - dropdown_search: ^5.0.6 - flutter_staggered_grid_view: ^0.7.0 + eva_icons_flutter: ^3.0.0 + font_awesome_flutter: ^10.3.0 + dropdown_search: ^3.0.1 + flutter_staggered_grid_view: ^0.4.0 expandable: ^5.0.1 # Qr code Scanner - barcode_scan2: ^4.3.0 + barcode_scan2: ^4.1.4 # permissions - permission_handler: ^11.1.0 + permission_handler: ^10.2.0 device_info: ^2.0.2 # The following adds the Cupertino Icons font to your application. # Use with the CupertinoIcons class for iOS style icons. - cupertino_icons: ^1.0.6 + cupertino_icons: ^1.0.3 # SVG #flutter_svg: ^1.0.0 - percent_indicator: ^4.2.3 + percent_indicator: ^4.2.2 #Dependency Injection - get_it: ^7.6.4 + get_it: ^7.1.3 #chart - fl_chart: ^0.65.0 + fl_chart: ^0.45.0 # Firebase - firebase_messaging: ^14.7.5 - firebase_analytics : ^10.7.1 + firebase_messaging: ^14.2.1 + firebase_analytics : ^10.1.0 #GIF image -# flutter_gifimage: ^1.0.1 - gif: ^2.3.0 + flutter_gifimage: ^1.0.1 + #Autocomplete TextField autocomplete_textfield: ^2.0.1 - #date_time_picker: ^2.0.0 - flutter_datetime_picker_plus: ^2.1.0 + date_time_picker: ^2.0.0 # Html - html: ^0.15.4 + html: ^0.15.0 # Flutter Html View - flutter_html: ^3.0.0-beta.2 - + flutter_html: ^2.1.0 sticky_headers: ^0.3.0+2 - file_picker: 5.2.0+1 + file_picker: ^4.6.1 #speech to text -# speech_to_text: -# path: speech_to_text - - speech_to_text: ^6.4.1 + # speech_to_text: + # path: speech_to_text + speech_to_text: ^6.1.1 - quiver: ^3.2.1 + quiver: ^3.0.0 flutter_colorpicker: ^1.0.3 # Html Editor Enhanced - #html_editor_enhanced: any - html_editor_enhanced: ^2.5.1 - jhijri_picker: ^1.0.1 - jhijri: ^1.0.0 + html_editor_enhanced: ^2.1.1 #Network Image - cached_network_image: ^3.3.0 + cached_network_image: ^3.1.0+1 - # Badges - badges: ^3.1.2 + # Badges + badges: ^2.0.1 + # Hijri + # hijri: ^2.0.3 + hijri_picker: ^3.0.0 flutter_datetime_picker: ^1.5.1 - localization: ^2.1.1 - - flutter_math_fork: ^0.7.2 - + # flutter_math_fork: ^0.6.0 +# flutter_math_fork: ^0.6.0 -dependency_overrides: - flutter_localizations: - sdk: flutter - intl: ^0.18.1 - #hijri_picker: ^3.0.0 dev_dependencies: @@ -136,7 +126,6 @@ dev_dependencies: build_runner: any build_web_compilers: any - # For information on the generic Dart part of this file, see the # following page: https://dart.dev/tools/pub/pubspec @@ -198,4 +187,4 @@ flutter: - asset: assets/fonts/DoctorApp.ttf # # For details regarding fonts from package dependencies, - # see https://flutter.dev/custom-fonts/#from-packages + # see https://flutter.dev/custom-fonts/#from-packages \ No newline at end of file