diff --git a/PatientAppAPNSAuthKey.p8 b/PatientAppAPNSAuthKey.p8 new file mode 100755 index 00000000..0515964e --- /dev/null +++ b/PatientAppAPNSAuthKey.p8 @@ -0,0 +1,6 @@ +-----BEGIN PRIVATE KEY----- +MIGTAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBHkwdwIBAQQgJ5XRSnefd1apSG/z +YJTQ55ffLMlPgKlGM9edg88mUZagCgYIKoZIzj0DAQehRANCAATSA2MbS+J0cQsc +uBU0xaoxOUgGvnHCQSEK4t22i8eeKPPhH6RHJhK1ugPvj+Eyadf7j6pn3QRonEJu +mIL+qvqC +-----END PRIVATE KEY----- \ No newline at end of file diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index de6f8030..42fc0237 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -6,6 +6,9 @@ In most cases you can leave this as-is, but you if you want to provide additional functionality it is fine to subclass or reimplement FlutterApplication and put your custom class here. --> + + + diff --git a/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/HMG_Geofence.kt b/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/HMG_Geofence.kt index 5e7fe57b..8452a083 100644 --- a/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/HMG_Geofence.kt +++ b/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/geofence/HMG_Geofence.kt @@ -30,12 +30,12 @@ enum class GeofenceTransition(val value: Int) { fun fromInt(value: Int) = GeofenceTransition.values().first { it.value == value } } - fun named():String{ - if (value == 1)return "Enter" - if (value == 2)return "Exit" - if (value == 4)return "dWell" - if (value == (ENTER.value or EXIT.value))return "Enter or Exit" - if (value == (DWELL.value or EXIT.value))return "DWell or Exit" + fun named(): String { + if (value == 1) return "Enter" + if (value == 2) return "Exit" + if (value == 4) return "dWell" + if (value == (ENTER.value or EXIT.value)) return "Enter or Exit" + if (value == (DWELL.value or EXIT.value)) return "DWell or Exit" return "unknown" } } @@ -44,63 +44,65 @@ class HMG_Geofence { // https://developer.android.com/training/location/geofencing#java private lateinit var context: Context - private lateinit var preferences:SharedPreferences + private lateinit var preferences: SharedPreferences private val gson = Gson() - private lateinit var geofencingClient:GeofencingClient + private lateinit var geofencingClient: GeofencingClient private val geofencePendingIntent: PendingIntent by lazy { val intent = Intent(context, GeofenceBroadcastReceiver::class.java) PendingIntent.getBroadcast( - context, - 0, - intent, - PendingIntent.FLAG_UPDATE_CURRENT) + context, + 0, + intent, + PendingIntent.FLAG_IMMUTABLE + ) } - companion object{ + companion object { var instance: HMG_Geofence? = null - fun shared(context: Context) : HMG_Geofence { - if (instance == null) { + fun shared(context: Context): HMG_Geofence { + if (instance == null) { instance = HMG_Geofence() instance?.context = context instance?.geofencingClient = LocationServices.getGeofencingClient(context) - instance?.preferences = context.getSharedPreferences(PREFS_STORAGE, Context.MODE_PRIVATE) + instance?.preferences = + context.getSharedPreferences(PREFS_STORAGE, Context.MODE_PRIVATE) } - return instance!! + return instance!! } } - fun limitize(zones: List):List{ + private fun limitize(zones: List): List { var geoZones_ = zones - if(zones.size > 100) + if (zones.size > 100) geoZones_ = zones.subList(0, 99) return geoZones_ } - fun register(completion:((Boolean, java.lang.Exception?)->Unit)){ + fun register(completion: ((Boolean, java.lang.Exception?) -> Unit)) { unRegisterAll { status, exception -> val geoZones = getGeoZonesFromPreference(context) - doRegister(geoZones){ status_, error -> + doRegister(geoZones) { status_, error -> completion.let { it(status_, error) } } } } - fun unRegisterAll(completion: (status: Boolean, exception: Exception?) -> Unit){ + fun unRegisterAll(completion: (status: Boolean, exception: Exception?) -> Unit) { getActiveGeofences({ success -> removeActiveGeofences() - if(success.isNotEmpty()) + if (success.isNotEmpty()) geofencingClient - .removeGeofences(success) - .addOnSuccessListener { - completion(true, null) - } - .addOnFailureListener { - completion(false, it) - saveLog(context, "error:REMOVE_GEOFENCES", it.localizedMessage) - } + .removeGeofences(success) + .addOnSuccessListener { + completion(true, null) + } + .addOnFailureListener { + completion(false, it) + saveLog(context, "error:REMOVE_GEOFENCES", it.localizedMessage) + } else completion(true, null) @@ -109,7 +111,10 @@ class HMG_Geofence { }) } - private fun doRegister(geoZones: List, completion:((Boolean, java.lang.Exception?)->Unit)? = null){ + private fun doRegister( + geoZones: List, + completion: ((Boolean, java.lang.Exception?) -> Unit)? = null + ) { if (geoZones.isEmpty()) return @@ -117,9 +122,9 @@ class HMG_Geofence { fun buildGeofencingRequest(geofences: List): GeofencingRequest { return GeofencingRequest.Builder() - .setInitialTrigger(GeofencingRequest.INITIAL_TRIGGER_DWELL) - .addGeofences(geofences) - .build() + .setInitialTrigger(GeofencingRequest.INITIAL_TRIGGER_DWELL) + .addGeofences(geofences) + .build() } getActiveGeofences({ active -> @@ -135,26 +140,41 @@ class HMG_Geofence { if (checkPermission() && geofences.isNotEmpty()) { geofencingClient - .addGeofences(buildGeofencingRequest(geofences), geofencePendingIntent) - .addOnSuccessListener { - Logs.RegisterGeofence.save(context,"SUCCESS", "Successfuly registered the geofences", Logs.STATUS.SUCCESS) - saveActiveGeofence(geofences.map { it.requestId }, listOf()) - completion?.let { it(true,null) } - } - .addOnFailureListener { exc -> - Logs.RegisterGeofence.save(context,"FAILED_TO_REGISTER", "Failed to register geofence",Logs.STATUS.ERROR) - completion?.let { it(false,exc) } - } + .addGeofences(buildGeofencingRequest(geofences), geofencePendingIntent) + .addOnSuccessListener { + Logs.RegisterGeofence.save( + context, + "SUCCESS", + "Successfuly registered the geofences", + Logs.STATUS.SUCCESS + ) + saveActiveGeofence(geofences.map { it.requestId }, listOf()) + completion?.let { it(true, null) } + } + .addOnFailureListener { exc -> + Logs.RegisterGeofence.save( + context, + "FAILED_TO_REGISTER", + "Failed to register geofence", + Logs.STATUS.ERROR + ) + completion?.let { it(false, exc) } + } // Schedule the job to register after specified duration (due to: events not calling after long period.. days or days [Needs to register fences again]) - HMGUtils.scheduleJob(context, ReregisterGeofenceJobService::class.java,ReregisterGeofenceJobService.JobID, ReregisterGeofenceJobService.TriggerIntervalDuration) + HMGUtils.scheduleJob( + context, + ReregisterGeofenceJobService::class.java, + ReregisterGeofenceJobService.JobID, + ReregisterGeofenceJobService.TriggerIntervalDuration + ) } }, null) } - fun getGeoZonesFromPreference(context: Context):List{ + fun getGeoZonesFromPreference(context: Context): List { val pref = context.getSharedPreferences(PREFS_STORAGE, Context.MODE_PRIVATE) val json = pref.getString(PREF_KEY_HMG_ZONES, "[]") @@ -162,26 +182,29 @@ class HMG_Geofence { return geoZones } - fun saveActiveGeofence(success: List, failed: List){ + fun saveActiveGeofence(success: List, failed: List) { val jsonSuccess = gson.toJson(success) val jsonFailure = gson.toJson(failed) preferences.edit().putString(PREF_KEY_SUCCESS, jsonSuccess).apply() preferences.edit().putString(PREF_KEY_FAILED, jsonFailure).apply() } - fun removeActiveGeofences(){ + fun removeActiveGeofences() { preferences.edit().putString(PREF_KEY_SUCCESS, "[]").apply() preferences.edit().putString(PREF_KEY_FAILED, "[]").apply() } - fun getActiveGeofences(success: (success: List) -> Unit, failure: ((failed: List) -> Unit)?){ - val type = object : TypeToken?>() {}.type + fun getActiveGeofences( + success: (success: List) -> Unit, + failure: ((failed: List) -> Unit)? + ) { + val type = object : TypeToken?>() {}.type val jsonSuccess = preferences.getString(PREF_KEY_SUCCESS, "[]") val success = gson.fromJson>(jsonSuccess, type) success(success) - if(failure != null){ + if (failure != null) { val jsonFailure = preferences.getString(PREF_KEY_FAILED, "[]") val failed = gson.fromJson>(jsonFailure, type) failure(failed) @@ -189,47 +212,74 @@ class HMG_Geofence { } - private fun checkPermission() : Boolean{ - return ContextCompat.checkSelfPermission(context, Manifest.permission.ACCESS_FINE_LOCATION) == PackageManager.PERMISSION_GRANTED + private fun checkPermission(): Boolean { + return ContextCompat.checkSelfPermission( + context, + Manifest.permission.ACCESS_FINE_LOCATION + ) == PackageManager.PERMISSION_GRANTED } - fun getPatientID():Int?{ + fun getPatientID(): Int? { var profileJson = preferences.getString("flutter.imei-user-data", null) if (profileJson == null) profileJson = preferences.getString("flutter.user-profile", null) val type = object : TypeToken?>() {}.type return gson.fromJson?>(profileJson, type) - ?.get("PatientID") - .toString() - .toDoubleOrNull() - ?.toInt() + ?.get("PatientID") + .toString() + .toDoubleOrNull() + ?.toInt() } - fun handleEvent(triggerGeofences: List, location: Location, transition: GeofenceTransition) { + fun handleEvent( + triggerGeofences: List, + location: Location, + transition: GeofenceTransition + ) { getPatientID()?.let { patientId -> getActiveGeofences({ activeGeofences -> triggerGeofences.forEach { geofence -> // Extract PointID from 'geofence.requestId' and find from active geofences - val pointID = activeGeofences.firstOrNull { it == geofence.requestId }?.split('_')?.first() + val pointID = + activeGeofences.firstOrNull { it == geofence.requestId }?.split('_') + ?.first() if (!pointID.isNullOrEmpty() && pointID.toIntOrNull() != null) { val body = mutableMapOf( - "PointsID" to pointID.toIntOrNull(), - "GeoType" to transition.value, - "PatientID" to patientId + "PointsID" to pointID.toIntOrNull(), + "GeoType" to transition.value, + "PatientID" to patientId ) body.putAll(HMGUtils.defaultHTTPParams(context)) httpPost>(API.LOG_GEOFENCE, body, { response -> - saveLog(context, "HMG_GEOFENCE_NOTIFY", "Success: Notified to server\uD83D\uDE0E.") - sendNotification(context, transition.named(), geofence.requestId, "Notified to server.😎") + saveLog( + context, + "HMG_GEOFENCE_NOTIFY", + "Success: Notified to server\uD83D\uDE0E." + ) + sendNotification( + context, + transition.named(), + geofence.requestId, + "Notified to server.😎" + ) }, { exception -> val errorMessage = "${transition.named()}, ${geofence.requestId}" - saveLog(context, "HMG_GEOFENCE_NOTIFY", "failed: $errorMessage | error: ${exception.localizedMessage}") - sendNotification(context, transition.named(), geofence.requestId, "Failed to notify server😔 -> ${exception.localizedMessage}") + saveLog( + context, + "HMG_GEOFENCE_NOTIFY", + "failed: $errorMessage | error: ${exception.localizedMessage}" + ) + sendNotification( + context, + transition.named(), + geofence.requestId, + "Failed to notify server😔 -> ${exception.localizedMessage}" + ) }) } diff --git a/ios/Podfile b/ios/Podfile index e4393e8d..c92f7e80 100644 --- a/ios/Podfile +++ b/ios/Podfile @@ -52,6 +52,7 @@ post_install do |installer| 'PERMISSION_REMINDERS=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 diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index 5fea0490..240eb6e4 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -13,6 +13,7 @@ 306FE6C8271D790C002D6EFC /* OpenTokPlatformBridge.swift in Sources */ = {isa = PBXBuildFile; fileRef = 306FE6C7271D790C002D6EFC /* OpenTokPlatformBridge.swift */; }; 306FE6CB271D8B73002D6EFC /* OpenTok.swift in Sources */ = {isa = PBXBuildFile; fileRef = 306FE6CA271D8B73002D6EFC /* OpenTok.swift */; }; 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; + 4EE411B2E3CB5D4F81AE5078 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3D1513E0724DAFB89C198BDD /* Pods_Runner.framework */; }; 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; 762D738E274E42650063CE73 /* ring_30Sec.caf in Resources */ = {isa = PBXBuildFile; fileRef = 762D738C274E42650063CE73 /* ring_30Sec.caf */; }; 762D738F274E42650063CE73 /* ring_30Sec.mp3 in Resources */ = {isa = PBXBuildFile; fileRef = 762D738D274E42650063CE73 /* ring_30Sec.mp3 */; }; @@ -22,7 +23,6 @@ 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 */; }; - B40C32A62DF065A3A0414845 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8B99ADD0B93AC14DD8D0BAB0 /* Pods_Runner.framework */; }; E91B5396256AAA6500E96549 /* GlobalHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = E91B538D256AAA6500E96549 /* GlobalHelper.swift */; }; E91B5397256AAA6500E96549 /* Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = E91B538E256AAA6500E96549 /* Extensions.swift */; }; E91B5398256AAA6500E96549 /* API.swift in Sources */ = {isa = PBXBuildFile; fileRef = E91B538F256AAA6500E96549 /* API.swift */; }; @@ -63,6 +63,8 @@ 306FE6C7271D790C002D6EFC /* OpenTokPlatformBridge.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OpenTokPlatformBridge.swift; sourceTree = ""; }; 306FE6CA271D8B73002D6EFC /* OpenTok.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OpenTok.swift; sourceTree = ""; }; 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; + 3D1513E0724DAFB89C198BDD /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 6EE8819867EC2775AB578377 /* 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 = ""; }; 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; }; 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 762D738C274E42650063CE73 /* ring_30Sec.caf */ = {isa = PBXFileReference; lastKnownFileType = file; name = ring_30Sec.caf; path = ../../assets/sounds/ring_30Sec.caf; sourceTree = ""; }; @@ -70,9 +72,8 @@ 76815B26275F381C00E66E94 /* HealthKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = HealthKit.framework; path = System/Library/Frameworks/HealthKit.framework; sourceTree = SDKROOT; }; 76962ECD28AE5C10004EAE09 /* GoogleService-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "GoogleService-Info.plist"; sourceTree = ""; }; 76F2556027F1FFED0062C1CD /* PassKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = PassKit.framework; path = System/Library/Frameworks/PassKit.framework; sourceTree = SDKROOT; }; - 7805E271E86E72F39E68ADCC /* 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 = ""; }; 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; - 8B99ADD0B93AC14DD8D0BAB0 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 838788A2BEDC4910F4B029A6 /* 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 = ""; }; 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -80,7 +81,6 @@ 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - BC1BA79F1F6E9D7BE59D2AE4 /* 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 = ""; }; E91B538D256AAA6500E96549 /* GlobalHelper.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GlobalHelper.swift; sourceTree = ""; }; E91B538E256AAA6500E96549 /* Extensions.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Extensions.swift; sourceTree = ""; }; E91B538F256AAA6500E96549 /* API.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = API.swift; sourceTree = ""; }; @@ -99,7 +99,7 @@ E9C8C135256BACDA00EFFB62 /* HMG_Guest.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HMG_Guest.swift; sourceTree = ""; }; E9E27167256E3A4000F49B69 /* LocalizedFromFlutter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LocalizedFromFlutter.swift; sourceTree = ""; }; E9F7623A25922BCE00FB5CCF /* FlutterConstants.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FlutterConstants.swift; sourceTree = ""; }; - EBA301C32F4CA9F09D2D7713 /* 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 = ""; }; + F2C7D3C4718A1DED85DA3AD4 /* 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 = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -110,7 +110,7 @@ 76F2556127F1FFED0062C1CD /* PassKit.framework in Frameworks */, 76815B27275F381C00E66E94 /* HealthKit.framework in Frameworks */, E9620805255C2ED100D3A35D /* NetworkExtension.framework in Frameworks */, - B40C32A62DF065A3A0414845 /* Pods_Runner.framework in Frameworks */, + 4EE411B2E3CB5D4F81AE5078 /* Pods_Runner.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -133,7 +133,7 @@ 76F2556027F1FFED0062C1CD /* PassKit.framework */, 76815B26275F381C00E66E94 /* HealthKit.framework */, E9620804255C2ED100D3A35D /* NetworkExtension.framework */, - 8B99ADD0B93AC14DD8D0BAB0 /* Pods_Runner.framework */, + 3D1513E0724DAFB89C198BDD /* Pods_Runner.framework */, ); name = Frameworks; sourceTree = ""; @@ -141,9 +141,9 @@ 605039E5DDF72C245F9765FE /* Pods */ = { isa = PBXGroup; children = ( - EBA301C32F4CA9F09D2D7713 /* Pods-Runner.debug.xcconfig */, - 7805E271E86E72F39E68ADCC /* Pods-Runner.release.xcconfig */, - BC1BA79F1F6E9D7BE59D2AE4 /* Pods-Runner.profile.xcconfig */, + F2C7D3C4718A1DED85DA3AD4 /* Pods-Runner.debug.xcconfig */, + 838788A2BEDC4910F4B029A6 /* Pods-Runner.release.xcconfig */, + 6EE8819867EC2775AB578377 /* Pods-Runner.profile.xcconfig */, ); path = Pods; sourceTree = ""; @@ -246,15 +246,15 @@ isa = PBXNativeTarget; buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; buildPhases = ( - A37FFD337A0067237A8DACD6 /* [CP] Check Pods Manifest.lock */, + 6D0B2FE51DC05E2D0395E861 /* [CP] Check Pods Manifest.lock */, 9740EEB61CF901F6004384FC /* Run Script */, 97C146EA1CF9000F007C117D /* Sources */, 97C146EB1CF9000F007C117D /* Frameworks */, 97C146EC1CF9000F007C117D /* Resources */, 9705A1C41CF9048500538489 /* Embed Frameworks */, 3B06AD1E1E4923F5004D2608 /* Thin Binary */, - E1D6AED972DEFC56AA7DB402 /* [CP] Embed Pods Frameworks */, - 541D1D49FBD13BE6BA6DA5BC /* [CP] Copy Pods Resources */, + 487FDD6493EB9AE7D8E39485 /* [CP] Embed Pods Frameworks */, + 4671D3CD126F6635F4B75A6E /* [CP] Copy Pods Resources */, ); buildRules = ( ); @@ -334,7 +334,7 @@ shellPath = /bin/sh; shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin\n"; }; - 541D1D49FBD13BE6BA6DA5BC /* [CP] Copy Pods Resources */ = { + 4671D3CD126F6635F4B75A6E /* [CP] Copy Pods Resources */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( @@ -351,21 +351,24 @@ shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources.sh\"\n"; showEnvVarsInLog = 0; }; - 9740EEB61CF901F6004384FC /* Run Script */ = { + 487FDD6493EB9AE7D8E39485 /* [CP] Embed Pods Frameworks */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); - inputPaths = ( + inputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist", ); - name = "Run Script"; - outputPaths = ( + name = "[CP] Embed Pods Frameworks"; + outputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; + showEnvVarsInLog = 0; }; - A37FFD337A0067237A8DACD6 /* [CP] Check Pods Manifest.lock */ = { + 6D0B2FE51DC05E2D0395E861 /* [CP] Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( @@ -387,22 +390,19 @@ 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; }; - E1D6AED972DEFC56AA7DB402 /* [CP] Embed Pods Frameworks */ = { + 9740EEB61CF901F6004384FC /* Run Script */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); - inputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist", + inputPaths = ( ); - name = "[CP] Embed Pods Frameworks"; - outputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist", + name = "Run Script"; + outputPaths = ( ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; - showEnvVarsInLog = 0; + shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; }; /* End PBXShellScriptBuildPhase section */ @@ -538,7 +538,7 @@ "$(inherited)", "$(PROJECT_DIR)/Flutter", ); - MARKETING_VERSION = 4.5.57; + MARKETING_VERSION = 4.5.63; PRODUCT_BUNDLE_IDENTIFIER = "com.HMG.HMG-Smartphone"; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -682,7 +682,7 @@ "$(inherited)", "$(PROJECT_DIR)/Flutter", ); - MARKETING_VERSION = 4.5.57; + MARKETING_VERSION = 4.5.63; PRODUCT_BUNDLE_IDENTIFIER = "com.HMG.HMG-Smartphone"; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -720,7 +720,7 @@ "$(inherited)", "$(PROJECT_DIR)/Flutter", ); - MARKETING_VERSION = 4.5.57; + MARKETING_VERSION = 4.5.63; PRODUCT_BUNDLE_IDENTIFIER = "com.HMG.HMG-Smartphone"; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; diff --git a/lib/config/config.dart b/lib/config/config.dart index 5fc169de..1c0caeb9 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -20,9 +20,10 @@ var PACKAGES_ORDERS = '/api/orders'; var PACKAGES_ORDER_HISTORY = '/api/orders/items'; var PACKAGES_TAMARA_OPT = '/api/orders/paymentoptions/tamara'; // var BASE_URL = 'http://10.50.100.198:3334/'; - var BASE_URL = 'https://uat.hmgwebservices.com/'; -// var BASE_URL = 'https://hmgwebservices.com/'; +// var BASE_URL = 'https://uat.hmgwebservices.com/'; +var BASE_URL = 'https://hmgwebservices.com/'; // var BASE_URL = 'https://orash.cloudsolutions.com.sa/'; +// var BASE_URL = 'https://vidauat.cloudsolutions.com.sa/'; // Pharmacy UAT URLs // var BASE_PHARMACY_URL = 'https://uat.hmgwebservices.com/epharmacy/api/'; @@ -37,7 +38,7 @@ var PHARMACY_BASE_URL = 'https://mdlaboratories.com/exacartapi/api/'; // var PHARMACY_BASE_URL = 'https://mdlaboratories.com/exacartapitest/api/'; // RC API URL -var RC_BASE_URL = 'https://rc.hmg.com/mobile/'; +var RC_BASE_URL = 'https://rc.hmg.com/'; var PING_SERVICE = 'Services/Weather.svc/REST/CheckConnectivity'; @@ -322,7 +323,7 @@ var UPDATE_COVID_QUESTIONNAIRE = 'Services/Doctors.svc/REST/COVID19_Questionnari var CHANNEL = 3; var GENERAL_ID = 'Cs2020@2016\$2958'; var IP_ADDRESS = '10.20.10.20'; -var VERSION_ID = 10.3; +var VERSION_ID = 10.5; var SETUP_ID = '91877'; var LANGUAGE = 2; // var PATIENT_OUT_SA = 0; @@ -590,6 +591,8 @@ var CANCEL_PHARMA_LIVECARE_REQUEST = 'https://vcallapi.hmg.com/api/PharmaLiveCar var INSERT_FREE_SLOTS_LOGS = 'Services/Doctors.svc/Rest/InsertDoctorFreeSlotsLogs'; +var GET_NATIONALITY ='Services/Lists.svc/REST/GetNationality'; + // Check If InPatient API var CHECK_IF_INPATIENT = 'Services/Patients.svc/REST/GetInPatientAdmissionInfo'; diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index b14eca10..5580da41 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -208,7 +208,7 @@ const Map localizedValues = { "last-name": {"en": "Last Name", "ar": "إسم العائلة"}, "female": {"en": "Female", "ar": "أنثى"}, "male": {"en": "Male", "ar": "ذكر"}, - "preferred-language": {"en": "Preferred Language", "ar": "اللغة المفضلة"}, + "preferred-language": {"en": "Preferred Language *", "ar": "اللغة المفضلة *"}, "english": {"en": "English", "ar": "الإنجليزية"}, "arabic": {"en": "Arabic", "ar": "العربية"}, "locations-register": {"en": "Where do you want to create this file?", "ar": "أين تريد فتح هذا الملف؟"}, @@ -682,7 +682,7 @@ const Map localizedValues = { "ar": "توفر هذه الخدمة مجموعه من خدمات الرعايه الصحيه المنزلية و متابعه مستمره وشامله للذين لا يستطيعون الوصول للمنشات الصحيه في اماكن اقامتهم (التحاليل المخبرية – الاشعة – التطعيمات – العلاج الطبيعي) ..." }, - "email": {"en": "Email", "ar": "البريد الالكتروني"}, + "email": {"en": "Email *", "ar": "البريد الالكتروني *"}, "Book": {"en": "Book", "ar": "حجز"}, "AppointmentLabel": {"en": "Appointment", "ar": "موعد"}, "BloodType": {"en": "Blood Type", "ar": "فصيلة الدم"}, @@ -1324,7 +1324,7 @@ const Map localizedValues = { "notif-permission-title": {"en": "Could not set the water reminders", "ar": "لا يمكن ضبط اشعار شرب الماء"}, "notif-permission-msg": {"en": "To recieve water reminders, please turn on notifications in the system settings", "ar": "الرجاء تفعيل الاشعارات في الاعدادات"}, "verification_message_code": {"en": "Please enter verification code", "ar": "الرجاء إدخال رمز التحقق"}, - "select-location": {"en": "Select Location", "ar": "اختر الموقع"}, + "select-location": {"en": "Select Location *", "ar": "اختر الموقع *"}, "result-header": {"en": "Get the result in Few Hours", "ar": "احصل على النتيجة خلال عدة ساعات"}, "please_select_gender": {"en": "Please select gender", "ar": "يرجى تحديد الجنس"}, "covid-info": { @@ -1865,7 +1865,7 @@ const Map localizedValues = { "NFCNotSupported": { "en": "Your device does not support NFC. Please visit reception to Check-In", "ar": "جهازك لا يدعم NFC. يرجى زيارة مكتب الاستقبال لتسجيل الوصول" }, "enter-workplace-name": {"en": "Please enter your workplace name:", "ar": "رجاء إدخال مكان العمل:"}, "workplaceName": {"en": "Workplace name:", "ar": "مكان العمل:"}, - "callLiveCareSupport": {"en": "Call LiveCare Support", "ar": "اتصل بدعم لايف كير"}, + "callLiveCareSupport": {"en": "Call LiveCare Support", "ar": "اتصل بدعم اللايف كير"}, "needApproval": {"en": "Your sick leave is under process in medical administration, you will be notified once approved.", "ar": "جازتك المرضية تحت الإجراء في الإدارة الطبية ، سوف يتم إشعارك فور الموافقه عليها."}, "pendingActivation": {"en": "Pending Activation", "ar": "في انتظار التنشيط"}, "awaitingApproval": {"en": "Awaiting Approval", "ar": "انتظر القبول"}, diff --git a/lib/config/shared_pref_kay.dart b/lib/config/shared_pref_kay.dart index 9e5c4f27..ec82db11 100644 --- a/lib/config/shared_pref_kay.dart +++ b/lib/config/shared_pref_kay.dart @@ -42,3 +42,4 @@ const APPOINTMENT_HISTORY_MEDICAL = 'APPOINTMENT_HISTORY_MEDICAL'; const CLINICS_LIST = 'CLINICS_LIST'; const COVID_QA_LIST = 'COVID_QA_LIST'; const IS_COVID_CONSENT_SHOWN = 'IS_COVID_CONSENT_SHOWN'; +const REGISTER_INFO_DUBAI ='register-info-dubai'; diff --git a/lib/core/service/client/base_app_client.dart b/lib/core/service/client/base_app_client.dart index a87d71e7..9cb81a41 100644 --- a/lib/core/service/client/base_app_client.dart +++ b/lib/core/service/client/base_app_client.dart @@ -158,11 +158,11 @@ class BaseAppClient { body.removeWhere((key, value) => key == null || value == null); - if (AppGlobal.isNetworkDebugEnabled) { + // if (AppGlobal.isNetworkDebugEnabled) { print("URL : $url"); final jsonBody = json.encode(body); print(jsonBody); - } + // } if (await Utils.checkConnection(bypassConnectionCheck: bypassConnectionCheck)) { final response = await http.post(Uri.parse(url.trim()), body: json.encode(body), headers: headers); diff --git a/lib/core/service/geofencing/GeofencingServices.dart b/lib/core/service/geofencing/GeofencingServices.dart index 362416da..fe679984 100644 --- a/lib/core/service/geofencing/GeofencingServices.dart +++ b/lib/core/service/geofencing/GeofencingServices.dart @@ -32,6 +32,8 @@ class GeofencingServices extends BaseService { AppSharedPreferences pref = AppSharedPreferences(); await pref.setString(HMG_GEOFENCES, _zonesJsonString); + var res = await sharedPref.getStringWithDefaultValue(HMG_GEOFENCES, "[]"); + print("-------GEO ZONES----------: $res"); return geoZones; } diff --git a/lib/core/service/medical/labs_service.dart b/lib/core/service/medical/labs_service.dart index f12e4669..484bfff8 100644 --- a/lib/core/service/medical/labs_service.dart +++ b/lib/core/service/medical/labs_service.dart @@ -115,12 +115,12 @@ class LabsService extends BaseService { return Future.value(localRes); } - Future updateWorkplaceName(String workplaceName, int requestNumber, String setupID, int projectID) async { + Future updateWorkplaceName(String workplaceName, String workplaceNameAR, int requestNumber, String setupID, int projectID) async { hasError = false; Map body = Map(); body['Placeofwork'] = workplaceName; - body['Placeofworkar'] = workplaceName; + body['Placeofworkar'] = workplaceNameAR; body['Req_ID'] = requestNumber; body['TargetSetupID'] = setupID; body['ProjectID'] = projectID; diff --git a/lib/core/viewModels/project_view_model.dart b/lib/core/viewModels/project_view_model.dart index 0c438fb4..f5e3f802 100644 --- a/lib/core/viewModels/project_view_model.dart +++ b/lib/core/viewModels/project_view_model.dart @@ -8,6 +8,7 @@ import 'package:diplomaticquarterapp/core/model/privilege/PrivilegeModel.dart'; import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart'; import 'package:diplomaticquarterapp/locator.dart'; import 'package:diplomaticquarterapp/models/Appointments/laser_body_parts.dart'; +import 'package:diplomaticquarterapp/models/Authentication/register_info_response.dart'; import 'package:diplomaticquarterapp/uitl/PlatformBridge.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:flutter/cupertino.dart'; @@ -40,9 +41,10 @@ class ProjectViewModel extends BaseViewModel { double _latitude; double _longitude; + RegisterInfoResponse _registerInfo =RegisterInfoResponse(); double get latitude => _latitude; double get longitude => _longitude; - + RegisterInfoResponse get registerInfo=> _registerInfo; dynamic get searchValue => searchvalue; Locale get appLocal => _appLocale; @@ -176,4 +178,8 @@ class ProjectViewModel extends BaseViewModel { searchvalue = data; notifyListeners(); } + setRegisterData(RegisterInfoResponse data){ + _registerInfo =data; + notifyListeners(); + } } diff --git a/lib/models/Authentication/check_paitent_authentication_req.dart b/lib/models/Authentication/check_paitent_authentication_req.dart index 2846c1fc..76493f87 100644 --- a/lib/models/Authentication/check_paitent_authentication_req.dart +++ b/lib/models/Authentication/check_paitent_authentication_req.dart @@ -15,7 +15,9 @@ class CheckPatientAuthenticationReq { Null sessionID; bool isDentalAllowedBackend; int deviceTypeID; - + String dob; + int isHijri; + String healthId; CheckPatientAuthenticationReq( {this.patientMobileNumber, this.zipCode, @@ -32,7 +34,11 @@ class CheckPatientAuthenticationReq { this.patientOutSA, this.sessionID, this.isDentalAllowedBackend, - this.deviceTypeID}); + this.deviceTypeID, + this.dob, + this.isHijri, + this.healthId + }); CheckPatientAuthenticationReq.fromJson(Map json) { patientMobileNumber = json['PatientMobileNumber']; @@ -51,6 +57,9 @@ class CheckPatientAuthenticationReq { sessionID = json['SessionID']; isDentalAllowedBackend = json['isDentalAllowedBackend']; deviceTypeID = json['DeviceTypeID']; + dob = json['dob']; + isHijri = json['isHijri']; + healthId = json['HealthId']; } Map toJson() { @@ -71,6 +80,9 @@ class CheckPatientAuthenticationReq { data['SessionID'] = this.sessionID; data['isDentalAllowedBackend'] = this.isDentalAllowedBackend; data['DeviceTypeID'] = this.deviceTypeID; + data['dob'] =this.dob; + data['isHijri'] = this.isHijri; + data['HealthId'] = healthId; return data; } } diff --git a/lib/models/Authentication/countries_list.dart b/lib/models/Authentication/countries_list.dart new file mode 100644 index 00000000..3c314da9 --- /dev/null +++ b/lib/models/Authentication/countries_list.dart @@ -0,0 +1,21 @@ +class CountriesLists { + String iD; + String name; + dynamic nameN; + + CountriesLists({this.iD, this.name, this.nameN}); + + CountriesLists.fromJson(Map json) { + iD = json['ID']; + name = json['Name']; + nameN = json['NameN']; + } + + Map toJson() { + final Map data = new Map(); + data['ID'] = this.iD; + data['Name'] = this.name; + data['NameN'] = this.nameN; + return data; + } +} \ No newline at end of file diff --git a/lib/pages/AlHabibMedicalService/all_habib_medical_service_page2.dart b/lib/pages/AlHabibMedicalService/all_habib_medical_service_page2.dart index 5d0694ed..779c230e 100644 --- a/lib/pages/AlHabibMedicalService/all_habib_medical_service_page2.dart +++ b/lib/pages/AlHabibMedicalService/all_habib_medical_service_page2.dart @@ -65,29 +65,53 @@ class _AllHabibMedicalSevicePage2State extends State initialiseHmgServices(bool isLogin) { hmgServices.clear(); - hmgServices.add(new HmgServices(0, TranslationBase.of(context).liveCareTitle, TranslationBase.of(context).liveCareSubtitle, "assets/images/new/Live_Care.svg", isLogin)); - hmgServices.add(new HmgServices(1, TranslationBase.of(context).covidTest, TranslationBase.of(context).driveThru, "assets/images/new/CoronaIcon.svg", isLogin)); - hmgServices.add(new HmgServices(2, TranslationBase.of(context).onlinePayment, TranslationBase.of(context).onlinePaymentSubtitle, "assets/images/new/paymentMethods.png", isLogin)); + hmgServices.add(new HmgServices(0, TranslationBase.of(context).book, TranslationBase.of(context).appointmentLabel, "assets/images/new/book appointment.svg", isLogin)); + hmgServices.add(new HmgServices(1, TranslationBase.of(context).liveCare, TranslationBase.of(context).onlineConsulting, "assets/images/new/Live_Care.svg", isLogin)); + hmgServices.add(new HmgServices(2, TranslationBase.of(context).emergencyTitle, TranslationBase.of(context).emergencySubtitle, "assets/images/new/emergency.svg", isLogin)); hmgServices.add(new HmgServices(3, TranslationBase.of(context).hhcHome, TranslationBase.of(context).healthCare, "assets/images/new/HHC.svg", isLogin)); - hmgServices.add(new HmgServices(4, TranslationBase.of(context).cmcTitle, TranslationBase.of(context).cmcSubtitle, "assets/images/new/comprehensive_checkup.svg", isLogin)); - hmgServices.add(new HmgServices(5, TranslationBase.of(context).emergencyTitle, TranslationBase.of(context).emergencySubtitle, "assets/images/new/emergency.svg", isLogin)); - hmgServices.add(new HmgServices(6, TranslationBase.of(context).ereferralTitle, TranslationBase.of(context).ereferralSubtitle, "assets/images/new/E_Referral.svg", isLogin)); - hmgServices.add(new HmgServices(7, TranslationBase.of(context).waterTitle, TranslationBase.of(context).waterSubtitle, "assets/images/new/h2o.svg", isLogin)); - hmgServices.add(new HmgServices(8, TranslationBase.of(context).connectTitle, TranslationBase.of(context).connectSubtitle, "assets/images/new/reach_us.svg", isLogin)); - hmgServices.add(new HmgServices(9, TranslationBase.of(context).medicalFileTitle2, TranslationBase.of(context).medicalFileSubtitle, "assets/images/new/medical file.svg", isLogin)); - hmgServices.add(new HmgServices(10, TranslationBase.of(context).book, TranslationBase.of(context).appointmentLabel, "assets/images/new/book appointment.svg", isLogin)); - hmgServices.add(new HmgServices(11, TranslationBase.of(context).pharmacyTitle, TranslationBase.of(context).pharmacySubtitle, "assets/images/new/Pharmacy.svg", isLogin)); - hmgServices.add(new HmgServices(12, TranslationBase.of(context).updateInsurance, TranslationBase.of(context).updateInsuranceSubtitle, "assets/images/new/update insurance card.svg", isLogin)); - hmgServices.add(new HmgServices(13, TranslationBase.of(context).familyTitle, TranslationBase.of(context).familySubtitle, "assets/images/new/my family.svg", isLogin)); - hmgServices.add(new HmgServices(14, TranslationBase.of(context).My_Child, TranslationBase.of(context).Vaccines, "assets/images/new/child vaccines.svg", isLogin)); + hmgServices.add(new HmgServices(4, TranslationBase.of(context).checkup, TranslationBase.of(context).comprehensive, "assets/images/new/comprehensive_checkup.svg", isLogin)); + hmgServices.add(new HmgServices(5, TranslationBase.of(context).pharmacyTitle, TranslationBase.of(context).pharmacySubtitle, "assets/images/new/Pharmacy.svg", isLogin)); + + hmgServices.add(new HmgServices(6, TranslationBase.of(context).medicalFileTitle2, TranslationBase.of(context).medicalFileSubtitle, "assets/images/new/medical file.svg", isLogin)); + hmgServices.add(new HmgServices(7, TranslationBase.of(context).familyTitle, TranslationBase.of(context).familySubtitle, "assets/images/new/my family.svg", isLogin)); + hmgServices.add(new HmgServices(8, TranslationBase.of(context).online, TranslationBase.of(context).payment, "assets/images/new/paymentMethods.png", isLogin)); + hmgServices.add(new HmgServices(9, TranslationBase.of(context).My_Child, TranslationBase.of(context).Vaccines, "assets/images/new/child vaccines.svg", isLogin)); + hmgServices.add(new HmgServices(10, TranslationBase.of(context).updateInsurance, TranslationBase.of(context).updateInsuranceSubtitle, "assets/images/new/update insurance card.svg", isLogin)); + hmgServices.add(new HmgServices(11, TranslationBase.of(context).ereferralTitle, TranslationBase.of(context).ereferralSubtitle, "assets/images/new/E_Referral.svg", isLogin)); + hmgServices.add(new HmgServices(12, TranslationBase.of(context).waterTitle, TranslationBase.of(context).waterSubtitle, "assets/images/new/h2o.svg", isLogin)); + hmgServices.add(new HmgServices(13, TranslationBase.of(context).healthCalculatorTitle, TranslationBase.of(context).healthCalculatorSubtitle, "assets/images/new/health calculator.svg", isLogin)); + hmgServices.add(new HmgServices(14, TranslationBase.of(context).healthConvertersTitle, TranslationBase.of(context).healthConvertersSubtitle, "assets/images/new/health converter.svg", isLogin)); hmgServices.add(new HmgServices(15, TranslationBase.of(context).Todo, TranslationBase.of(context).list, "assets/images/new/todo.svg", isLogin)); hmgServices.add(new HmgServices(16, TranslationBase.of(context).Blood, TranslationBase.of(context).Donation, "assets/images/new/blood donation.svg", isLogin)); - hmgServices.add(new HmgServices(17, TranslationBase.of(context).healthCalculatorTitle, TranslationBase.of(context).healthCalculatorSubtitle, "assets/images/new/health calculator.svg", isLogin)); - hmgServices.add(new HmgServices(18, TranslationBase.of(context).healthConvertersTitle, TranslationBase.of(context).healthConvertersSubtitle, "assets/images/new/health converter.svg", isLogin)); + + hmgServices.add(new HmgServices(17, TranslationBase.of(context).covidTest, TranslationBase.of(context).driveThru, "assets/images/new/CoronaIcon.svg", isLogin)); + + hmgServices.add(new HmgServices(18, TranslationBase.of(context).Virtual, TranslationBase.of(context).Tour, "assets/images/new/virtual tour.svg", isLogin)); hmgServices.add(new HmgServices(19, TranslationBase.of(context).smartWatches.split(" ")[0], TranslationBase.of(context).smartWatches.split(" ")[1], "assets/images/new/smart watch.svg", isLogin)); hmgServices.add(new HmgServices(20, TranslationBase.of(context).parkingTitle2, TranslationBase.of(context).parkingSubtitle, "assets/images/new/parking details.svg", isLogin)); - hmgServices.add(new HmgServices(21, TranslationBase.of(context).Virtual, TranslationBase.of(context).Tour, "assets/images/new/virtual tour.svg", isLogin)); - hmgServices.add(new HmgServices(22, TranslationBase.of(context).latestNews.split(" ")[0], TranslationBase.of(context).latestNews.split(" ")[1], "assets/images/new/latest news.svg", isLogin)); + hmgServices.add(new HmgServices(21, TranslationBase.of(context).latestNews.split(" ")[0], TranslationBase.of(context).latestNews.split(" ")[1], "assets/images/new/latest news.svg", isLogin)); + + hmgServices.add(new HmgServices(22, TranslationBase.of(context).connectTitle, TranslationBase.of(context).connectSubtitle, "assets/images/new/reach_us.svg", isLogin)); + + + // hmgServices.add(new HmgServices(5, TranslationBase.of(context).emergencyTitle, TranslationBase.of(context).emergencySubtitle, "assets/images/new/emergency.svg", isLogin)); + // hmgServices.add(new HmgServices(6, TranslationBase.of(context).ereferralTitle, TranslationBase.of(context).ereferralSubtitle, "assets/images/new/E_Referral.svg", isLogin)); + // hmgServices.add(new HmgServices(7, TranslationBase.of(context).waterTitle, TranslationBase.of(context).waterSubtitle, "assets/images/new/h2o.svg", isLogin)); + // hmgServices.add(new HmgServices(8, TranslationBase.of(context).connectTitle, TranslationBase.of(context).connectSubtitle, "assets/images/new/reach_us.svg", isLogin)); + // hmgServices.add(new HmgServices(9, TranslationBase.of(context).medicalFileTitle2, TranslationBase.of(context).medicalFileSubtitle, "assets/images/new/medical file.svg", isLogin)); + // hmgServices.add(new HmgServices(10, TranslationBase.of(context).book, TranslationBase.of(context).appointmentLabel, "assets/images/new/book appointment.svg", isLogin)); + // hmgServices.add(new HmgServices(11, TranslationBase.of(context).pharmacyTitle, TranslationBase.of(context).pharmacySubtitle, "assets/images/new/Pharmacy.svg", isLogin)); + // hmgServices.add(new HmgServices(12, TranslationBase.of(context).updateInsurance, TranslationBase.of(context).updateInsuranceSubtitle, "assets/images/new/update insurance card.svg", isLogin)); + // hmgServices.add(new HmgServices(13, TranslationBase.of(context).familyTitle, TranslationBase.of(context).familySubtitle, "assets/images/new/my family.svg", isLogin)); + // hmgServices.add(new HmgServices(14, TranslationBase.of(context).My_Child, TranslationBase.of(context).Vaccines, "assets/images/new/child vaccines.svg", isLogin)); + // hmgServices.add(new HmgServices(15, TranslationBase.of(context).Todo, TranslationBase.of(context).list, "assets/images/new/todo.svg", isLogin)); + // hmgServices.add(new HmgServices(16, TranslationBase.of(context).Blood, TranslationBase.of(context).Donation, "assets/images/new/blood donation.svg", isLogin)); + // hmgServices.add(new HmgServices(17, TranslationBase.of(context).healthCalculatorTitle, TranslationBase.of(context).healthCalculatorSubtitle, "assets/images/new/health calculator.svg", isLogin)); + // hmgServices.add(new HmgServices(18, TranslationBase.of(context).healthConvertersTitle, TranslationBase.of(context).healthConvertersSubtitle, "assets/images/new/health converter.svg", isLogin)); + // hmgServices.add(new HmgServices(19, TranslationBase.of(context).smartWatches.split(" ")[0], TranslationBase.of(context).smartWatches.split(" ")[1], "assets/images/new/smart watch.svg", isLogin)); + // hmgServices.add(new HmgServices(20, TranslationBase.of(context).parkingTitle2, TranslationBase.of(context).parkingSubtitle, "assets/images/new/parking details.svg", isLogin)); + // hmgServices.add(new HmgServices(21, TranslationBase.of(context).Virtual, TranslationBase.of(context).Tour, "assets/images/new/virtual tour.svg", isLogin)); + // hmgServices.add(new HmgServices(22, TranslationBase.of(context).latestNews.split(" ")[0], TranslationBase.of(context).latestNews.split(" ")[1], "assets/images/new/latest news.svg", isLogin)); } @override @@ -211,7 +235,7 @@ class _AllHabibMedicalSevicePage2State extends State itemCount: hmgServices.length, padding: EdgeInsets.zero, itemBuilder: (BuildContext context, int index) { - return ServicesView(hmgServices[index], index); + return ServicesView(hmgServices[index], index, false); }, ), ), diff --git a/lib/pages/AlHabibMedicalService/h2o/h20_setting.dart b/lib/pages/AlHabibMedicalService/h2o/h20_setting.dart index 38d7a568..2feb7f0f 100644 --- a/lib/pages/AlHabibMedicalService/h2o/h20_setting.dart +++ b/lib/pages/AlHabibMedicalService/h2o/h20_setting.dart @@ -350,7 +350,7 @@ class _H2oSettingState extends State { TextField( enabled: isEnable, scrollPadding: EdgeInsets.zero, - keyboardType: TextInputType.number, + keyboardType: TextInputType.text, controller: _controller, onChanged: (value) => { // validateForm() diff --git a/lib/pages/BookAppointment/SearchResults.dart b/lib/pages/BookAppointment/SearchResults.dart index 0f80abac..3d95a694 100644 --- a/lib/pages/BookAppointment/SearchResults.dart +++ b/lib/pages/BookAppointment/SearchResults.dart @@ -52,6 +52,7 @@ class _SearchResultsState extends State { ? widget.patientDoctorAppointmentListHospital[index].filterName + " - " + widget.patientDoctorAppointmentListHospital[index].distanceInKMs + " " + TranslationBase.of(context).km : widget.patientDoctorAppointmentListHospital[index].filterName, isTitleSingleLine: false, + isExpand: widget.patientDoctorAppointmentListHospital.length == 1 ? true : false, bodyWidget: ListView.separated( shrinkWrap: true, physics: NeverScrollableScrollPhysics(), diff --git a/lib/pages/DrawerPages/family/my-family.dart b/lib/pages/DrawerPages/family/my-family.dart index d9f15af8..f7d58b36 100644 --- a/lib/pages/DrawerPages/family/my-family.dart +++ b/lib/pages/DrawerPages/family/my-family.dart @@ -447,9 +447,9 @@ class _MyFamily extends State with TickerProviderStateMixin { } refreshFamily(context) { - GifLoaderDialogUtils.hideDialog(context); setState(() { sharedPref.remove(FAMILY_FILE); + checkUserData(); }); } diff --git a/lib/pages/landing/fragments/home_page_fragment2.dart b/lib/pages/landing/fragments/home_page_fragment2.dart index 41bd0f9b..487dac82 100644 --- a/lib/pages/landing/fragments/home_page_fragment2.dart +++ b/lib/pages/landing/fragments/home_page_fragment2.dart @@ -51,14 +51,15 @@ class _HomePageFragment2State extends State { initialiseHmgServices(bool isLogin) { hmgServices.clear(); - hmgServices.add(new HmgServices(0, TranslationBase.of(context).liveCare, TranslationBase.of(context).onlineConsulting, "assets/images/new/Live_Care.svg", isLogin)); - hmgServices.add(new HmgServices(1, TranslationBase.of(context).covidTest, TranslationBase.of(context).driveThru, "assets/images/new/CoronaIcon.svg", isLogin)); - hmgServices.add(new HmgServices(2, TranslationBase.of(context).online, TranslationBase.of(context).payment, "assets/images/new/paymentMethods.png", isLogin)); + + hmgServices.add(new HmgServices(0, TranslationBase.of(context).book, TranslationBase.of(context).appointmentLabel, "assets/images/new/book appointment.svg", isLogin)); + hmgServices.add(new HmgServices(1, TranslationBase.of(context).liveCare, TranslationBase.of(context).onlineConsulting, "assets/images/new/Live_Care.svg", isLogin)); + hmgServices.add(new HmgServices(2, TranslationBase.of(context).emergencyTitle, TranslationBase.of(context).emergencySubtitle, "assets/images/new/emergency.svg", isLogin)); hmgServices.add(new HmgServices(3, TranslationBase.of(context).hhcHome, TranslationBase.of(context).healthCare, "assets/images/new/HHC.svg", isLogin)); hmgServices.add(new HmgServices(4, TranslationBase.of(context).checkup, TranslationBase.of(context).comprehensive, "assets/images/new/comprehensive_checkup.svg", isLogin)); - hmgServices.add(new HmgServices(5, TranslationBase.of(context).emergencyTitle, TranslationBase.of(context).emergencySubtitle, "assets/images/new/emergency.svg", isLogin)); + hmgServices.add(new HmgServices(5, TranslationBase.of(context).online, TranslationBase.of(context).payment, "assets/images/new/paymentMethods.png", isLogin)); hmgServices.add(new HmgServices(6, TranslationBase.of(context).ereferralTitle, TranslationBase.of(context).ereferralSubtitle, "assets/images/new/E_Referral.svg", isLogin)); - hmgServices.add(new HmgServices(7, "H\u2082O", TranslationBase.of(context).dailyWater, "assets/images/new/h2o.svg", isLogin)); + hmgServices.add(new HmgServices(7, TranslationBase.of(context).covidTest, TranslationBase.of(context).driveThru, "assets/images/new/CoronaIcon.svg", isLogin)); hmgServices.add(new HmgServices(8, TranslationBase.of(context).connectTitle, TranslationBase.of(context).connectSubtitle, "assets/images/new/reach_us.svg", isLogin)); } @@ -289,15 +290,16 @@ class _HomePageFragment2State extends State { margin: projectViewModel.isArabic ? EdgeInsets.only(left: 12.0) : EdgeInsets.only(right: 12.0), child: AspectRatio( aspectRatio: 2.15, - child: - ServicesView(new HmgServices(2, TranslationBase.of(context).InPatient, TranslationBase.of(context).inPatientServices, "assets/images/new/hospital.png", false), 23)), + child: ServicesView( + new HmgServices(2, TranslationBase.of(context).InPatient, TranslationBase.of(context).inPatientServices, "assets/images/new/hospital.png", false), 23, true)), ), ), Expanded( flex: 4, child: AspectRatio( aspectRatio: 1.0, - child: ServicesView(new HmgServices(2, TranslationBase.of(context).online, TranslationBase.of(context).payment, "assets/images/new/paymentMethods.png", false), 2)), + child: ServicesView( + new HmgServices(2, TranslationBase.of(context).online, TranslationBase.of(context).payment, "assets/images/new/paymentMethods.png", false), 2, true)), ), ], ), @@ -315,7 +317,7 @@ class _HomePageFragment2State extends State { itemCount: hmgServices.length, padding: EdgeInsets.zero, itemBuilder: (BuildContext context, int index) { - return ServicesView(hmgServices[index], index); + return ServicesView(hmgServices[index], index, true); }, ), ), @@ -334,7 +336,7 @@ class _HomePageFragment2State extends State { itemCount: hmgServices.length, padding: EdgeInsets.zero, itemBuilder: (BuildContext context, int index) { - return ServicesView(hmgServices[index], index); + return ServicesView(hmgServices[index], index, true); }, ), ), diff --git a/lib/pages/landing/widgets/services_view.dart b/lib/pages/landing/widgets/services_view.dart index 9cde947d..f1753f3c 100644 --- a/lib/pages/landing/widgets/services_view.dart +++ b/lib/pages/landing/widgets/services_view.dart @@ -21,8 +21,8 @@ import 'package:diplomaticquarterapp/pages/ContactUs/contact_us_page.dart'; import 'package:diplomaticquarterapp/pages/Covid-DriveThru/covid-drivethru-location.dart'; import 'package:diplomaticquarterapp/pages/DrawerPages/family/my-family.dart'; import 'package:diplomaticquarterapp/pages/ErService/ErOptions.dart'; -import 'package:diplomaticquarterapp/pages/InPatientServices/inpatient_home.dart'; import 'package:diplomaticquarterapp/pages/insurance/insurance_update_screen.dart'; +import 'package:diplomaticquarterapp/pages/landing/landing_page.dart'; import 'package:diplomaticquarterapp/pages/livecare/livecare_home.dart'; import 'package:diplomaticquarterapp/pages/medical/medical_profile_page_new.dart'; import 'package:diplomaticquarterapp/pages/medical/smart_watch_health_data/smart_watch_instructions.dart'; @@ -40,7 +40,6 @@ import 'package:flutter_svg/flutter_svg.dart'; import 'package:url_launcher/url_launcher.dart'; import '../../../locator.dart'; -import '../landing_page.dart'; import '../landing_page_pharmcy.dart'; class ServicesView extends StatelessWidget { @@ -50,136 +49,18 @@ class ServicesView extends StatelessWidget { AuthProvider authProvider = new AuthProvider(); PharmacyModuleViewModel pharmacyModuleViewModel = locator(); LocationUtils locationUtils; + bool isHomePage; - ServicesView(this.hmgServices, this.index); + ServicesView(this.hmgServices, this.index, this.isHomePage); @override Widget build(BuildContext context) { return InkWell( onTap: () { - if (index == 0) { - openLiveCare(context); - } else if (index == 1) { - showCovidDialog(context); - locator().hmgServices.logServiceName('covid-test drive-thru'); - } else if (index == 2) { - Navigator.push(context, FadePage(page: PaymentService())); - locator().hmgServices.logServiceName('online payments'); - } else if (index == 3) { - Navigator.push(context, FadePage(page: HomeHealthCarePage())); - locator().hmgServices.logServiceName('home health care'); - } else if (index == 4) { - Navigator.push(context, FadePage(page: CMCPage())); - locator().hmgServices.logServiceName('comprehensive medical checkup'); - } else if (index == 5) { - Navigator.push(context, FadePage(page: ErOptions(isAppbar: true))); - locator().hmgServices.logServiceName('emergency service'); - } else if (index == 6) { - Navigator.push(context, FadePage(page: EReferralPage())); - locator().hmgServices.logServiceName('e-referral service'); - } else if (index == 7) { - Navigator.push(context, FadePage(page: H2OPage())); - locator().hmgServices.logServiceName('water consumption'); - } else if (index == 8) { - Navigator.push(context, FadePage(page: ContactUsPage())); - locator().hmgServices.logServiceName('find us reach us'); - } else if (index == 9) { - Navigator.push( - context, - FadePage( - page: MedicalProfilePageNew(), - ), - ); - locator().hmgServices.logServiceName('my medical details'); - } else if (index == 10) { - Navigator.push( - context, - FadePage( - page: Search(), - ), - ); - locator().hmgServices.logServiceName('book appointment'); - } else if (index == 11) { - getPharmacyToken(context); - locator().hmgServices.logServiceName('al habib pharmacy'); - } else if (index == 12) { - Navigator.push( - context, - FadePage( - page: InsuranceUpdate(), - ), - ); - locator().hmgServices.logServiceName('update insurance'); - } else if (index == 13) { - Navigator.push( - context, - FadePage( - page: MyFamily(), - ), - ); - locator().hmgServices.logServiceName('my family files'); - } else if (index == 14) { - Navigator.push( - context, - FadePage(page: ChildInitialPage()), - ); - locator().hmgServices.logServiceName('my child vaccines'); - } else if (index == 15) { - // Navigator.pop(context); - LandingPage.shared.switchToDoFromHMGServices(); - locator().hmgServices.logServiceName('todo list'); - } else if (index == 16) { - Navigator.push( - context, - FadePage(page: BloodDonationPage()), - ); - locator().hmgServices.logServiceName('blood donation'); - } else if (index == 17) { - Navigator.push( - context, - FadePage( - page: (HealthCalculators()), - ), - ); - locator().hmgServices.logServiceName('health calculator'); - } else if (index == 18) { - Navigator.push( - context, - FadePage( - page: HealthConverter(), - ), - ); - locator().hmgServices.logServiceName('heath converters'); - } else if (index == 19) { - Navigator.push( - context, - FadePage(page: SmartWatchInstructions()), - ); - locator().hmgServices.logServiceName('smart watches'); - } else if (index == 20) { - locator().hmgServices.logServiceName('car parcking service'); - Navigator.push( - context, - FadePage( - page: ParkingPage(), - ), - ); - } else if (index == 21) { - launch("https://hmgwebservices.com/vt_mobile/html/index.html"); - locator().hmgServices.logServiceName('virtual tour'); - } else if (index == 22) { - Navigator.of(context).push( - MaterialPageRoute( - builder: (BuildContext context) => MyWebView( - title: "HMG News", - selectedUrl: "https://twitter.com/hashtag/مجموعة_د_سليمان_الحبيب_الطبية?src=hashtag_click&f=live", - ), - ), - ); - locator().hmgServices.logServiceName('latest news'); - } else if (index == 23) { - Navigator.push(context, FadePage(page: InPatientServicesHome())); - locator().hmgServices.logServiceName('InPatient Services'); + if (isHomePage) { + handleHomePageServices(hmgServices, context); + } else { + handleAllServices(hmgServices, context); } }, child: Container( @@ -206,7 +87,7 @@ class ServicesView extends StatelessWidget { padding: const EdgeInsets.all(12.0), child: Opacity( opacity: 0.04, - child: hmgServices.action == 2 + child: hmgServices.action == 5 ? Image.asset( hmgServices.icon, width: double.infinity, @@ -235,7 +116,7 @@ class ServicesView extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ mFlex(1), - hmgServices.action == 2 + hmgServices.action == (isHomePage ? 5 : 8) ? Image.asset( hmgServices.icon, height: index == 0 ? MediaQuery.of(context).size.width / 18 : MediaQuery.of(context).size.width / 18, @@ -282,6 +163,236 @@ class ServicesView extends StatelessWidget { ); } + handleHomePageServices(HmgServices hmgServices, BuildContext context) { + if (hmgServices.action == 0) { + Navigator.push(context, FadePage(page: Search())); + locator().hmgServices.logServiceName('book appointment'); + } else if (hmgServices.action == 1) { + openLiveCare(context); + } else if (hmgServices.action == 2) { + Navigator.push(context, FadePage(page: ErOptions(isAppbar: true))); + locator().hmgServices.logServiceName('emergency service'); + } else if (hmgServices.action == 3) { + Navigator.push(context, FadePage(page: HomeHealthCarePage())); + locator().hmgServices.logServiceName('home health care'); + } else if (hmgServices.action == 4) { + Navigator.push(context, FadePage(page: CMCPage())); + locator().hmgServices.logServiceName('comprehensive medical checkup'); + } else if (hmgServices.action == 5) { + Navigator.push(context, FadePage(page: PaymentService())); + locator().hmgServices.logServiceName('online payments'); + } else if (hmgServices.action == 6) { + Navigator.push(context, FadePage(page: EReferralPage())); + locator().hmgServices.logServiceName('e-referral service'); + } else if (hmgServices.action == 7) { + showCovidDialog(context); + locator().hmgServices.logServiceName('covid-test drive-thru'); + } else if (hmgServices.action == 8) { + Navigator.push(context, FadePage(page: ContactUsPage())); + locator().hmgServices.logServiceName('find us reach us'); + } + } + + handleAllServices(HmgServices hmgServices, BuildContext context) { + if (hmgServices.action == 0) { + Navigator.push(context, FadePage(page: Search())); + locator().hmgServices.logServiceName('book appointment'); + } else if (hmgServices.action == 1) { + openLiveCare(context); + } else if (hmgServices.action == 2) { + Navigator.push(context, FadePage(page: ErOptions(isAppbar: true))); + locator().hmgServices.logServiceName('emergency service'); + } else if (hmgServices.action == 3) { + Navigator.push(context, FadePage(page: HomeHealthCarePage())); + locator().hmgServices.logServiceName('home health care'); + } else if (hmgServices.action == 4) { + Navigator.push(context, FadePage(page: CMCPage())); + locator().hmgServices.logServiceName('comprehensive medical checkup'); + } else if (hmgServices.action == 5) { + getPharmacyToken(context); + locator().hmgServices.logServiceName('al habib pharmacy'); + } else if (hmgServices.action == 6) { + Navigator.push(context, FadePage(page: MedicalProfilePageNew())); + } else if (hmgServices.action == 7) { + Navigator.push(context, FadePage(page: MyFamily())); + locator().hmgServices.logServiceName('my family files'); + } else if (hmgServices.action == 8) { + Navigator.push(context, FadePage(page: PaymentService())); + locator().hmgServices.logServiceName('online payments'); + } else if (hmgServices.action == 9) { + Navigator.push(context, FadePage(page: ChildInitialPage())); + locator().hmgServices.logServiceName('my child vaccines'); + } else if (hmgServices.action == 10) { + Navigator.push(context, FadePage(page: InsuranceUpdate())); + locator().hmgServices.logServiceName('update insurance'); + } else if (hmgServices.action == 11) { + Navigator.push(context, FadePage(page: EReferralPage())); + locator().hmgServices.logServiceName('e-referral service'); + } else if (hmgServices.action == 12) { + Navigator.push(context, FadePage(page: H2OPage())); + locator().hmgServices.logServiceName('water consumption'); + } else if (hmgServices.action == 13) { + Navigator.push(context, FadePage(page: (HealthCalculators()))); + locator().hmgServices.logServiceName('health calculator'); + } else if (hmgServices.action == 14) { + Navigator.push(context, FadePage(page: HealthConverter())); + locator().hmgServices.logServiceName('heath converters'); + } else if (hmgServices.action == 15) { + Navigator.pop(context); + LandingPage.shared.switchToDoFromHMGServices(); + locator().hmgServices.logServiceName('todo list'); + } else if (hmgServices.action == 16) { + Navigator.push(context, FadePage(page: BloodDonationPage())); + locator().hmgServices.logServiceName('blood donation'); + } else if (hmgServices.action == 17) { + showCovidDialog(context); + locator().hmgServices.logServiceName('covid-test drive-thru'); + } else if (hmgServices.action == 18) { + launch("https://hmgwebservices.com/vt_mobile/html/index.html"); + locator().hmgServices.logServiceName('virtual tour'); + } else if (hmgServices.action == 19) { + Navigator.push(context, FadePage(page: SmartWatchInstructions())); + locator().hmgServices.logServiceName('smart watches'); + } else if (hmgServices.action == 20) { + Navigator.push(context, FadePage(page: ParkingPage())); + locator().hmgServices.logServiceName('car parcking service'); + } else if (hmgServices.action == 21) { + Navigator.of(context).push( + MaterialPageRoute( + builder: (BuildContext context) => MyWebView( + title: "HMG News", + selectedUrl: "https://twitter.com/hashtag/مجموعة_د_سليمان_الحبيب_الطبية?src=hashtag_click&f=live", + ), + ), + ); + locator().hmgServices.logServiceName('latest news'); + } else if (hmgServices.action == 22) { + Navigator.push(context, FadePage(page: ContactUsPage())); + locator().hmgServices.logServiceName('find us reach us'); + } + + // if (hmgServices.action == 10) { + // openLiveCare(context); + // } else if (index == 1) { + // showCovidDialog(context); + // locator().hmgServices.logServiceName('covid-test drive-thru'); + // } else if (index == 2) { + // Navigator.push(context, FadePage(page: PaymentService())); + // locator().hmgServices.logServiceName('online payments'); + // } else if (index == 3) { + // Navigator.push(context, FadePage(page: HomeHealthCarePage())); + // locator().hmgServices.logServiceName('home health care'); + // } else if (index == 4) { + // Navigator.push(context, FadePage(page: CMCPage())); + // locator().hmgServices.logServiceName('comprehensive medical checkup'); + // } else if (index == 5) { + // Navigator.push(context, FadePage(page: ErOptions(isAppbar: true))); + // locator().hmgServices.logServiceName('emergency service'); + // } else if (index == 6) { + // Navigator.push(context, FadePage(page: EReferralPage())); + // locator().hmgServices.logServiceName('e-referral service'); + // } else if (index == 7) { + // Navigator.push(context, FadePage(page: H2OPage())); + // locator().hmgServices.logServiceName('water consumption'); + // } else if (index == 8) { + // Navigator.push(context, FadePage(page: ContactUsPage())); + // locator().hmgServices.logServiceName('find us reach us'); + // } else if (index == 9) { + // Navigator.push( + // context, + // FadePage( + // page: MedicalProfilePageNew(), + // ), + // ); + // locator().hmgServices.logServiceName('my medical details'); + // } else if (index == 10) { + // Navigator.push( + // context, + // FadePage( + // page: Search(), + // ), + // ); + // locator().hmgServices.logServiceName('book appointment'); + // } else if (index == 11) { + // getPharmacyToken(context); + // locator().hmgServices.logServiceName('al habib pharmacy'); + // } else if (index == 12) { + // Navigator.push( + // context, + // FadePage( + // page: InsuranceUpdate(), + // ), + // ); + // locator().hmgServices.logServiceName('update insurance'); + // } else if (index == 13) { + // Navigator.push( + // context, + // FadePage( + // page: MyFamily(), + // ), + // ); + // locator().hmgServices.logServiceName('my family files'); + // } else if (index == 14) { + // Navigator.push( + // context, + // FadePage(page: ChildInitialPage()), + // ); + // locator().hmgServices.logServiceName('my child vaccines'); + // } else if (index == 15) { + // LandingPage.shared.switchToDoFromHMGServices(); + // locator().hmgServices.logServiceName('todo list'); + // } else if (index == 16) { + // Navigator.push( + // context, + // FadePage(page: BloodDonationPage()), + // ); + // locator().hmgServices.logServiceName('blood donation'); + // } else if (index == 17) { + // Navigator.push( + // context, + // FadePage( + // page: (HealthCalculators()), + // ), + // ); + // locator().hmgServices.logServiceName('health calculator'); + // } else if (index == 18) { + // Navigator.push( + // context, + // FadePage( + // page: HealthConverter(), + // ), + // ); + // locator().hmgServices.logServiceName('heath converters'); + // } else if (index == 19) { + // Navigator.push( + // context, + // FadePage(page: SmartWatchInstructions()), + // ); + // locator().hmgServices.logServiceName('smart watches'); + // } else if (index == 20) { + // locator().hmgServices.logServiceName('car parcking service'); + // Navigator.push( + // context, + // FadePage( + // page: ParkingPage(), + // ), + // ); + // } else if (index == 21) { + // launch("https://hmgwebservices.com/vt_mobile/html/index.html"); + // locator().hmgServices.logServiceName('virtual tour'); + // } else if (index == 22) { + // Navigator.of(context).push( + // MaterialPageRoute( + // builder: (BuildContext context) => MyWebView( + // title: "HMG News", + // selectedUrl: "https://twitter.com/hashtag/مجموعة_د_سليمان_الحبيب_الطبية?src=hashtag_click&f=live", + // ), + // ), + // ); + // locator().hmgServices.logServiceName('latest news'); + // } + } + showCovidDialog(BuildContext context) { if (Platform.isAndroid) { showDialog( diff --git a/lib/pages/livecare/widgets/LiveCarePendingRequest.dart b/lib/pages/livecare/widgets/LiveCarePendingRequest.dart index a866cc0b..a5392c8d 100644 --- a/lib/pages/livecare/widgets/LiveCarePendingRequest.dart +++ b/lib/pages/livecare/widgets/LiveCarePendingRequest.dart @@ -96,15 +96,15 @@ class _LiveCarePendingRequestState extends State { child: Text(TranslationBase.of(context).yourTurn + " " + widget.pendingERRequestHistoryList.patCount.toString() + " " + TranslationBase.of(context).patients, style: TextStyle(fontSize: 12.0, fontWeight: FontWeight.w600, letterSpacing: -0.48)), ), - Row( - children: [ - Container( - padding: const EdgeInsets.all(5.0), - child: Text(TranslationBase.of(context).liveCareSupportContact, style: TextStyle(fontSize: 12.0, fontWeight: FontWeight.w600, letterSpacing: -0.48)), - ), - Directionality(textDirection: TextDirection.ltr, child: Text("011 525 9553", style: TextStyle(fontSize: 12.0, fontWeight: FontWeight.w600, letterSpacing: -0.48))) - ], - ), + // Row( + // children: [ + // Container( + // padding: const EdgeInsets.all(5.0), + // child: Text(TranslationBase.of(context).liveCareSupportContact, style: TextStyle(fontSize: 12.0, fontWeight: FontWeight.w600, letterSpacing: -0.48)), + // ), + // Directionality(textDirection: TextDirection.ltr, child: Text("011 525 9553", style: TextStyle(fontSize: 12.0, fontWeight: FontWeight.w600, letterSpacing: -0.48))) + // ], + // ), mHeight(12.0), Container( child: DefaultButton(TranslationBase.of(context).callLiveCareSupport, () { diff --git a/lib/pages/login/confirm-login.dart b/lib/pages/login/confirm-login.dart index ac92c2db..e45cc333 100644 --- a/lib/pages/login/confirm-login.dart +++ b/lib/pages/login/confirm-login.dart @@ -42,8 +42,8 @@ import 'package:provider/provider.dart'; class ConfirmLogin extends StatefulWidget { final Function changePageViewIndex; final fromRegistration; - - const ConfirmLogin({Key key, this.changePageViewIndex, this.fromRegistration = false}) : super(key: key); + final bool isDubai; + const ConfirmLogin({Key key, this.changePageViewIndex, this.fromRegistration = false, this.isDubai =false}) : super(key: key); @override _ConfirmLogin createState() => _ConfirmLogin(); @@ -385,8 +385,10 @@ class _ConfirmLogin extends State { var request = this.getCommonRequest(type: type); request.sMSSignature = await SMSOTP.getSignature(); GifLoaderDialogUtils.showMyDialog(context); - if (healthId != null) { - request.dob = dob; //isHijri == 1 ? dob : dateFormat2.format(dateFormat.parse(dob)); + if (healthId != null || widget.isDubai) { + if(!widget.isDubai){ + request.dob = dob; //isHijri == 1 ? dob : dateFormat2.format(dateFormat.parse(dob)); + } request.healthId = healthId; request.isHijri = isHijri; await this.authService.sendActivationCodeRegister(request).then((result) { @@ -547,7 +549,7 @@ class _ConfirmLogin extends State { request.searchType = this.registerd_data.searchType != null ? this.registerd_data.searchType : 1; request.patientID = this.registerd_data.patientID != null ? this.registerd_data.patientID : 0; request.patientIdentificationID = request.nationalID = this.registerd_data.patientIdentificationID != null ? this.registerd_data.patientIdentificationID : '0'; - + request.dob = this.registerd_data.dob; request.isRegister = this.registerd_data.isRegister; } else { request.searchType = request.searchType != null ? request.searchType : 2; @@ -565,8 +567,10 @@ class _ConfirmLogin extends State { GifLoaderDialogUtils.showMyDialog(context); var request = this.getCommonRequest().toJson(); dynamic res; - if (healthId != null) { - request['DOB'] = dob; + if (healthId != null || widget.isDubai) { + if(!widget.isDubai) { + request['DOB'] = dob; + } request['HealthId'] = healthId; request['IsHijri'] = isHijri; @@ -579,6 +583,7 @@ class _ConfirmLogin extends State { result = CheckActivationCode.fromJson(result), if (this.registerd_data != null && this.registerd_data.isRegister == true) { + // if(widget.isDubai ==false){ widget.changePageViewIndex(1), Navigator.popUntil(context, (route) => Utils.route(route, equalsTo: RegisterNew)), } diff --git a/lib/pages/login/register-info.dart b/lib/pages/login/register-info.dart index 5d7db69f..1b81dbfb 100644 --- a/lib/pages/login/register-info.dart +++ b/lib/pages/login/register-info.dart @@ -8,6 +8,7 @@ import 'package:diplomaticquarterapp/locator.dart'; import 'package:diplomaticquarterapp/models/Appointments/toDoCountProviderModel.dart'; import 'package:diplomaticquarterapp/models/Authentication/check_activation_code_response.dart' as checkActivation; import 'package:diplomaticquarterapp/models/Authentication/check_paitent_authentication_req.dart'; +import 'package:diplomaticquarterapp/models/Authentication/countries_list.dart'; import 'package:diplomaticquarterapp/models/Authentication/register_info_response.dart'; import 'package:diplomaticquarterapp/pages/landing/landing_page.dart'; import 'package:diplomaticquarterapp/pages/rateAppointment/rate_appointment_doctor.dart'; @@ -45,21 +46,30 @@ class RegisterInfo extends StatefulWidget { class _RegisterInfo extends State { final authService = new AuthProvider(); final sharedPref = new AppSharedPreferences(); - RegisterInfoResponse registerInfo; + RegisterInfoResponse registerInfo = RegisterInfoResponse(); bool isLoading; int page; final List locationList = [ - new Location(name: 'KSA', value: '1'), - new Location(name: 'Dubai', value: '2'), + new Location(name: 'KSA', value: '1', nameAr: "السعودية"), + new Location(name: 'Dubai', value: '2', nameAr: "دبي"), ]; String language = '1'; - var registerd_data; + CheckPatientAuthenticationReq registerd_data; final List languageList = [ - new Language(name: 'English', value: '2'), - new Language(name: 'Arabic', value: '1'), + new Language(name: 'English', value: '2', nameAr: "إنجليزي"), + new Language(name: 'Arabic', value: '1', nameAr: "عربي"), + ]; + final List genderList = [ + new Language(name: 'Male', value: 'M', nameAr: "ذكر"), + new Language(name: 'Female', value: 'F', nameAr: "أنثى"), + ]; + final List maritalList = [ + new Language(name: 'Married', value: 'M', nameAr: "متزوج"), + new Language(name: 'Single', value: 'S', nameAr: "اعزب"), + new Language(name: 'Divorce', value: 'D', nameAr: "الطلاق"), ]; String email = ''; - + List countriesList = []; ToDoCountProviderModel toDoProvider; String location = '1'; AuthenticatedUserObject authenticatedUserObject = locator(); @@ -67,16 +77,22 @@ class _RegisterInfo extends State { ProjectViewModel projectViewModel; AppointmentRateViewModel appointmentRateViewModel = locator(); + bool isDubai = false; + RegisterInfoResponse data = RegisterInfoResponse(); + CheckPatientAuthenticationReq data2; + String gender = 'M'; + String maritalStatus = 'M'; + String nationality = 'SAU'; @override void initState() { + if (widget.page == 1) { + getCountries(); + } WidgetsBinding.instance.addPostFrameCallback((timeStamp) { getRegisterInfo(); }); - setState(() { - page = widget.page; - }); - + page = widget.page; super.initState(); } @@ -105,169 +121,279 @@ class _RegisterInfo extends State { ], ), SizedBox(height: 20), - registerInfo != null && page == 1 + (isDubai && page == 1) ? Column( children: [ SizedBox(height: 20), - getnameField(TranslationBase.of(context).identificationNumber, registerInfo.idNumber, TranslationBase.of(context).firstName, - registerInfo.firstNameEn == '-' ? registerInfo.firstNameAr : registerInfo.firstNameEn), - SizedBox(height: 20), - getnameField(TranslationBase.of(context).middleName, registerInfo.secondNameEn == '-' ? registerInfo.secondNameEn : registerInfo.secondNameEn, - TranslationBase.of(context).lastName, registerInfo.lastNameEn == '-' ? registerInfo.lastNameEn : registerInfo.lastNameEn), + getnameField(TranslationBase.of(context).identificationNumber, registerd_data.patientIdentificationID, TranslationBase.of(context).mobileNumber, + registerd_data.patientMobileNumber.toString()), + // SizedBox(height: 20), + projectViewModel.isArabic + ? getnameField( + '', + inputWidget("First Name", "First Name English", 'fNameEn'), + '', + inputWidget("Last Name", "Last Name English", 'lNameEn'), + ) + : SizedBox( + height: 0, + ), + getnameField( + '', + inputWidget(TranslationBase.of(context).firstName, TranslationBase.of(context).firstName, 'fName'), + '', + inputWidget(TranslationBase.of(context).middleName, TranslationBase.of(context).middleName, 'sName'), + ), + + getnameField( + '', + inputWidget(TranslationBase.of(context).lastName, TranslationBase.of(context).lastName, 'lName'), + TranslationBase.of(context).gender, + Container( + height: 20, + child: DropdownButtonHideUnderline( + child: DropdownButton( + isExpanded: true, + value: gender, + hint: Text(TranslationBase.of(context).gender), + iconSize: 40, + elevation: 16, + onChanged: (value) => { + setState(() { + gender = value; + registerInfo.gender = value; + }) + }, + items: genderList.map>((Language value) { + return DropdownMenuItem( + value: value.value, + child: Text( + projectViewModel.isArabic == 1 ? value.nameAr : value.name, + ), + ); + }).toList()))), + ), SizedBox(height: 20), getnameField( - TranslationBase.of(context).gender, - registerInfo.maritalStatusCode == 'U' - ? 'Unknown' - : registerInfo.maritalStatusCode == 'M' - ? 'Male' - : 'Female', TranslationBase.of(context).maritalStatus, - registerInfo.maritalStatus), - SizedBox(height: 20), - getnameField(TranslationBase.of(context).nationality, registerInfo.nationality, TranslationBase.of(context).mobileNumber, registerd_data.patientMobileNumber.toString()), + Container( + height: 18, + child: DropdownButtonHideUnderline( + child: DropdownButton( + isExpanded: true, + value: maritalStatus, + hint: Text(TranslationBase.of(context).maritalStatus), + iconSize: 40, + elevation: 16, + onChanged: (value) => { + setState(() { + maritalStatus = value; + registerInfo.maritalStatusCode = value; + }) + }, + items: maritalList.map>((Language value) { + return DropdownMenuItem( + value: value.value, + child: Text( + projectViewModel.isArabic == 1 ? value.nameAr : value.name, + ), + ); + }).toList()))), + TranslationBase.of(context).nationality, + Container( + height: 22, + child: DropdownButtonHideUnderline( + child: DropdownButton( + isExpanded: true, + value: nationality, + hint: Text(TranslationBase.of(context).nationality), + iconSize: 40, + elevation: 16, + onChanged: (value) => { + setState(() { + nationality = value; + registerInfo.nationalityCode = value; + }) + }, + items: countriesList.map>((CountriesLists value) { + return DropdownMenuItem( + value: value.iD, + child: Text( + value.name, + ), + ); + }).toList())))), SizedBox(height: 20), - getnameField(TranslationBase.of(context).dateOfBirth, registerInfo.dateOfBirth, "", ""), + getnameField(TranslationBase.of(context).dateOfBirth, registerd_data.dob, "", ""), SizedBox(height: 20), ], ) - : registerInfo != null && widget.page == 2 + : (registerInfo.healthId != null && page == 1) ? Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Container( - width: double.infinity, - decoration: containerRadius(Colors.white, 12), - padding: EdgeInsets.only(left: 10, right: 10, top: 5, bottom: 25), - child: Row(children: [ - Flexible( - child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ - Text( - TranslationBase.of(context).prefferedLanguage, - style: TextStyle( - fontSize: 11, - letterSpacing: -0.44, - fontWeight: FontWeight.w600, - ), - ), - Container( - height: 18, - child: DropdownButtonHideUnderline( - child: DropdownButton( - isExpanded: true, - value: language, - hint: Text(TranslationBase.of(context).prefferedLanguage), - iconSize: 40, - elevation: 16, - onChanged: (value) => { - setState(() { - language = value; - }) - }, - items: languageList.map>((Language value) { - return DropdownMenuItem( - value: value.value, - child: Text(value.name), - ); - }).toList()))) - ])) - ])), - SizedBox( - height: 20, - ), - Container( - width: double.infinity, - decoration: containerRadius(Colors.white, 12), - padding: EdgeInsets.only(left: 10, right: 10, top: 5, bottom: 25), - child: Row(children: [ - Flexible( - child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ - Text( - TranslationBase.of(context).selectLocation, - style: TextStyle( - fontSize: 11, - letterSpacing: -0.44, - fontWeight: FontWeight.w600, - ), - ), - Container( - height: 18, - child: DropdownButtonHideUnderline( - child: DropdownButton( - isExpanded: true, - value: location, - hint: Text(TranslationBase.of(context).selectLocation), - iconSize: 40, - elevation: 16, - onChanged: (value) => { - setState(() { - location = value; - }) - }, - items: locationList.map>((Location value) { - return DropdownMenuItem( - value: value.value, - child: Text( - value.name, - ), - ); - }).toList()))) - ])) - ])), - SizedBox( - height: 20, - ), - Container( - width: double.infinity, - decoration: containerRadius(Colors.white, 12), - padding: EdgeInsets.only(left: 10, right: 10, top: 5, bottom: 12), - margin: EdgeInsets.only(bottom: 0), - child: Row(children: [ - Flexible( - child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ - Text( - TranslationBase.of(context).email, - style: TextStyle( - fontSize: 11, - letterSpacing: -0.44, - fontWeight: FontWeight.w600, - ), - ), - Container( - child: TextField( - onChanged: (value) { - setState(() { - email = value; - }); - }, - style: TextStyle( - fontSize: 14, - height: 21 / 14, - fontWeight: FontWeight.w400, - color: Color(0xff2B353E), - letterSpacing: -0.44, - ), - decoration: InputDecoration( - isDense: true, - hintStyle: TextStyle( - fontSize: 14, - height: 21 / 14, - fontWeight: FontWeight.w400, - color: Color(0xff575757), - letterSpacing: -0.56, - ), - prefixIconConstraints: BoxConstraints(minWidth: 50), - contentPadding: EdgeInsets.zero, - border: InputBorder.none, - focusedBorder: InputBorder.none, - enabledBorder: InputBorder.none, - ), - )) - ])) - ])), + children: [ + SizedBox(height: 20), + getnameField(TranslationBase.of(context).identificationNumber, registerInfo.idNumber, TranslationBase.of(context).firstName, + registerInfo.firstNameEn == '-' ? registerInfo.firstNameAr : registerInfo.firstNameEn), + SizedBox(height: 20), + getnameField(TranslationBase.of(context).middleName, registerInfo.secondNameEn == '-' ? registerInfo.secondNameEn : registerInfo.secondNameEn, + TranslationBase.of(context).lastName, registerInfo.lastNameEn == '-' ? registerInfo.lastNameEn : registerInfo.lastNameEn), + SizedBox(height: 20), + getnameField( + TranslationBase.of(context).gender, + registerInfo.maritalStatusCode == 'U' + ? 'Unknown' + : registerInfo.maritalStatusCode == 'M' + ? 'Male' + : 'Female', + TranslationBase.of(context).maritalStatus, + registerInfo.maritalStatus), + SizedBox(height: 20), + getnameField(TranslationBase.of(context).nationality, registerInfo.nationality, TranslationBase.of(context).mobileNumber, registerd_data.patientMobileNumber.toString()), + SizedBox(height: 20), + getnameField(TranslationBase.of(context).dateOfBirth, registerInfo.dateOfBirth, "", ""), + SizedBox(height: 20), ], ) - : SizedBox(), + : widget.page == 2 + ? Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + width: double.infinity, + decoration: containerRadius(Colors.white, 12), + padding: EdgeInsets.only(left: 10, right: 10, top: 5, bottom: 25), + child: Row(children: [ + Flexible( + child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ + Text( + TranslationBase.of(context).prefferedLanguage, + style: TextStyle( + fontSize: 11, + letterSpacing: -0.44, + fontWeight: FontWeight.w600, + ), + ), + Container( + height: 18, + child: DropdownButtonHideUnderline( + child: DropdownButton( + isExpanded: true, + value: language, + hint: Text(TranslationBase.of(context).prefferedLanguage), + iconSize: 40, + elevation: 16, + onChanged: (value) => { + setState(() { + language = value; + }) + }, + items: languageList.map>((Language value) { + return DropdownMenuItem( + value: value.value, + child: Text( + projectViewModel.isArabic == 1 ? value.nameAr : value.name, + ), + ); + }).toList()))) + ])) + ])), + SizedBox( + height: 20, + ), + Container( + width: double.infinity, + decoration: containerRadius(Colors.white, 12), + padding: EdgeInsets.only(left: 10, right: 10, top: 5, bottom: 25), + child: Row(children: [ + Flexible( + child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ + Text( + TranslationBase.of(context).selectLocation, + style: TextStyle( + fontSize: 11, + letterSpacing: -0.44, + fontWeight: FontWeight.w600, + ), + ), + Container( + height: 18, + child: DropdownButtonHideUnderline( + child: DropdownButton( + isExpanded: true, + value: location, + hint: Text(TranslationBase.of(context).selectLocation), + iconSize: 40, + elevation: 16, + onChanged: (value) => { + setState(() { + location = value; + }) + }, + items: locationList.map>((Location value) { + return DropdownMenuItem( + value: value.value, + child: Text( + projectViewModel.isArabic == 1 ? value.nameAr : value.name, + ), + ); + }).toList()))) + ])) + ])), + SizedBox( + height: 20, + ), + Container( + width: double.infinity, + decoration: containerRadius(Colors.white, 12), + padding: EdgeInsets.only(left: 10, right: 10, top: 5, bottom: 12), + margin: EdgeInsets.only(bottom: 0), + child: Row(children: [ + Flexible( + child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ + Text( + TranslationBase.of(context).email, + style: TextStyle( + fontSize: 11, + letterSpacing: -0.44, + fontWeight: FontWeight.w600, + ), + ), + Container( + child: TextField( + keyboardType: TextInputType.emailAddress, + onChanged: (value) { + setState(() { + email = value; + }); + }, + style: TextStyle( + fontSize: 14, + height: 21 / 14, + fontWeight: FontWeight.w400, + color: Color(0xff2B353E), + letterSpacing: -0.44, + ), + decoration: InputDecoration( + isDense: true, + hintStyle: TextStyle( + fontSize: 14, + height: 21 / 14, + fontWeight: FontWeight.w400, + color: Color(0xff575757), + letterSpacing: -0.56, + ), + prefixIconConstraints: BoxConstraints(minWidth: 50), + contentPadding: EdgeInsets.zero, + border: InputBorder.none, + focusedBorder: InputBorder.none, + enabledBorder: InputBorder.none, + ), + )) + ])) + ])), + ], + ) + : SizedBox(), ]), ), bottomSheet: Container( @@ -289,24 +415,40 @@ class _RegisterInfo extends State { child: DefaultButton(page == 1 ? TranslationBase.of(context).next : TranslationBase.of(context).register, () { nextPage(); page == 1 ? locator().loginRegistration.registration_personal_info() : locator().loginRegistration.registration_patient_info(); - }, textColor: Colors.white, color: isValid() == true && page == 2 || page == 1 ? Color(0xff359846) : Colors.grey)), + }, textColor: Colors.white, color: isValid() == true ? Color(0xff359846) : Colors.grey)), ), ], ))); } - nextPage() { + nextPage() async { if (page == 1) { - setState(() { + if (isDubai) { + await setRegisterData(); widget.changePageViewIndex(2); - }); + } else { + widget.changePageViewIndex(2); + } } else { registerNow(); } } + setRegisterData() async { + registerInfo.gender = gender; + registerInfo.maritalStatusCode = maritalStatus; + registerInfo.nationalityCode = nationality; + projectViewModel.setRegisterData(registerInfo); + // await sharedPref.setObject(REGISTER_INFO_DUBAI, registerInfo); + } + registerNow() { - dynamic request = getTempUserRequest(); + dynamic request; + if (isDubai) + request = getTempUserRequestDubai(); + else + request = getTempUserRequest(); + GifLoaderDialogUtils.showMyDialog(context); dynamic res; this @@ -374,14 +516,17 @@ class _RegisterInfo extends State { } getRegisterInfo() async { - var data = RegisterInfoResponse.fromJson(await sharedPref.getObject(NHIC_DATA)); + if (await sharedPref.getObject(NHIC_DATA) != null) { + data = RegisterInfoResponse.fromJson(await sharedPref.getObject(NHIC_DATA)); + this.registerInfo = data; + } if (await sharedPref.getObject(REGISTER_DATA_FOR_LOGIIN) != null) { - var data2 = CheckPatientAuthenticationReq.fromJson(await sharedPref.getObject(REGISTER_DATA_FOR_LOGIIN)); + data2 = CheckPatientAuthenticationReq.fromJson(await sharedPref.getObject(REGISTER_DATA_FOR_LOGIIN)); setState(() { - this.registerInfo = data; - this.registerd_data = data2; + isDubai = data2.patientOutSA == 1 ? true : false; + if (isDubai) location = '2'; }); } } @@ -424,8 +569,54 @@ class _RegisterInfo extends State { }; } + getTempUserRequestDubai() { + DateFormat dateFormat = DateFormat("mm/dd/yyyy"); + registerInfo = projectViewModel.registerInfo; + print(dateFormat.parse(registerd_data.dob)); + var hDate = new HijriCalendar.fromDate(dateFormat.parse(registerd_data.dob)); + var date = hDate.toString(); + final DateFormat dateFormat1 = DateFormat('MM/dd/yyyy'); + final DateFormat dateFormat2 = DateFormat('dd/MM/yyyy'); + + return { + "Patientobject": { + "TempValue": true, + "PatientIdentificationType": registerd_data.patientIdentificationID.substring(0, 1) == "1" ? 1 : 2, + "PatientIdentificationNo": registerd_data.patientIdentificationID, + "MobileNumber": registerd_data.patientMobileNumber, + "PatientOutSA": (registerd_data.zipCode == '966' || registerd_data.zipCode == '+966') ? 0 : 1, + "FirstNameN": registerInfo.firstNameAr ?? "", + "FirstName": registerInfo.firstNameEn ?? "", + "MiddleNameN": registerInfo.secondNameAr ?? ".", + "MiddleName": registerInfo.secondNameEn ?? ".", + "LastNameN": registerInfo.lastNameAr ?? "", + "LastName": registerInfo.lastNameEn ?? "", + "StrDateofBirth": dateFormat1.format(dateFormat2.parse(registerd_data.dob)), + "DateofBirth": DateUtil.convertISODateToJsonDate(registerd_data.dob.replaceAll('/', '-')), + "Gender": registerInfo.gender == 'M' ? 1 : 2, + "NationalityID": registerInfo.nationalityCode, + "eHealthIDField": null, + "DateofBirthN": date, + "EmailAddress": email, + "SourceType": location, + "PreferredLanguage": registerd_data.languageID.toString(), + "Marital": registerInfo.maritalStatusCode == 'U' + ? '0' + : registerInfo.maritalStatusCode == 'M' + ? '1' + : '2', + }, + "PatientIdentificationID": registerd_data.patientIdentificationID, + "PatientMobileNumber": registerd_data.patientMobileNumber.toString()[0] == '0' ? registerd_data.patientMobileNumber : '0' + registerd_data.patientMobileNumber.toString(), + "DOB": registerd_data.dob, + "IsHijri": registerd_data.isHijri + }; + } + bool isValid() { - if (location != null && language != null && Utils.validEmail(email) == true) { + if ((location != null && language != null && Utils.validEmail(email) == true) || + (registerInfo.firstNameEn != null && registerInfo.lastNameEn != null) || + (projectViewModel.isArabic && registerInfo.firstNameEn != null && registerInfo.firstNameAr != null && registerInfo.lastNameEn != null && registerInfo.lastNameAr != null)) { return true; } else { return false; @@ -436,49 +627,57 @@ class _RegisterInfo extends State { return Row( children: [ Expanded( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - name1, - style: TextStyle( - fontSize: 14, - fontWeight: FontWeight.bold, - letterSpacing: -0.44, - ), - ), - Text( - value1, - style: TextStyle( - fontSize: 12, - fontWeight: FontWeight.w600, - letterSpacing: -0.44, - ), - ), - ], - )), + child: Padding( + padding: EdgeInsets.only(left: 5, right: 5), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + name1, + style: TextStyle( + fontSize: 14, + fontWeight: FontWeight.bold, + letterSpacing: -0.44, + ), + ), + value1 is String + ? Text( + value1, + style: TextStyle( + fontSize: 12, + fontWeight: FontWeight.w600, + letterSpacing: -0.44, + ), + ) + : value1, + ], + ))), Expanded( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - name2, - style: TextStyle( - fontSize: 14, - fontWeight: FontWeight.bold, - letterSpacing: -0.44, - ), - ), - Text( - value2, - style: TextStyle( - fontSize: 12, - fontWeight: FontWeight.w600, - letterSpacing: -0.44, - ), - ), - ], - )) + child: Padding( + padding: EdgeInsets.only(left: 5, right: 5), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + name2, + style: TextStyle( + fontSize: 14, + fontWeight: FontWeight.bold, + letterSpacing: -0.44, + ), + ), + value2 is String + ? Text( + value2, + style: TextStyle( + fontSize: 12, + fontWeight: FontWeight.w600, + letterSpacing: -0.44, + ), + ) + : value2, + ], + ))) ], ); } @@ -547,18 +746,146 @@ class _RegisterInfo extends State { print(err); }); } + + getCountries() { + ClinicListService service = new ClinicListService(); + service.getCountries().then((res) { + if (res['MessageStatus'] == 1) { + res['ListNationality'].forEach((items) => {countriesList.add(CountriesLists.fromJson(items))}); + + setState(() {}); + } + }).catchError((err) { + print(err); + }); + } + + Widget inputWidget(String _labelText, String _hintText, String name, {String prefix, bool isEnable = true, bool hasSelection = false}) { + return Container( + padding: EdgeInsets.only(left: 10, right: 10, bottom: 5, top: 5), + alignment: Alignment.center, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(15), + color: Colors.white, + border: Border.all( + color: Color(0xffefefef), + width: 1, + ), + ), + child: InkWell( + onTap: hasSelection ? () {} : null, + child: Row( + children: [ + Expanded( + child: Column( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + _labelText, + style: TextStyle( + fontSize: 11, + fontWeight: FontWeight.w600, + color: Color(0xff2B353E), + letterSpacing: -0.44, + ), + ), + TextField( + enabled: isEnable, + scrollPadding: EdgeInsets.zero, + keyboardType: TextInputType.text, + // controller: _controller, + onChanged: (value) => { + setState(() { + switch (name) { + case 'fName': + { + if (projectViewModel.isArabic) { + registerInfo.firstNameAr = value; + } else { + registerInfo.firstNameEn = value; + registerInfo.firstNameAr = '...'; + } + } + break; + case 'sName': + { + if (projectViewModel.isArabic) { + registerInfo.secondNameAr = value.isEmpty ? "." : value; + registerInfo.secondNameEn = '...'; + } else { + registerInfo.secondNameEn = value.isEmpty ? "." : value; + registerInfo.secondNameAr = '...'; + } + } + break; + case 'lName': + { + if (projectViewModel.isArabic) { + registerInfo.lastNameAr = value; + } else { + registerInfo.lastNameEn = value; + registerInfo.lastNameAr = '...'; + } + } + break; + case 'fNameEn': + registerInfo.firstNameEn = value; + break; + case 'lNameEn': + registerInfo.lastNameEn = value; + break; + } + }) + //_controller.text =value + }, + style: TextStyle( + fontSize: 14, + height: 21 / 14, + fontWeight: FontWeight.w400, + color: Color(0xff2B353E), + letterSpacing: -0.44, + ), + decoration: InputDecoration( + isDense: true, + hintText: _hintText, + hintStyle: TextStyle( + fontSize: 14, + height: 21 / 14, + fontWeight: FontWeight.w400, + color: Color(0xff575757), + letterSpacing: -0.56, + ), + prefixIconConstraints: BoxConstraints(minWidth: 50), + contentPadding: EdgeInsets.zero, + border: InputBorder.none, + focusedBorder: InputBorder.none, + enabledBorder: InputBorder.none, + ), + ), + ], + ), + ), + if (hasSelection) Icon(Icons.keyboard_arrow_down_outlined), + ], + ), + ), + ); + } } class Language { final String name; final String value; + final String nameAr; - Language({this.name, this.value}); + Language({this.name, this.value, this.nameAr}); } class Location { final String name; final String value; + final String nameAr; - Location({this.name, this.value}); + Location({this.name, this.value, this.nameAr}); } diff --git a/lib/pages/login/register.dart b/lib/pages/login/register.dart index bdb2b623..c3e8a275 100644 --- a/lib/pages/login/register.dart +++ b/lib/pages/login/register.dart @@ -2,7 +2,6 @@ import 'package:diplomaticquarterapp/analytics/flows/login_registration.dart'; import 'package:diplomaticquarterapp/analytics/google-analytics.dart'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/config/size_config.dart'; -import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/locator.dart'; import 'package:diplomaticquarterapp/models/Authentication/check_user_status_reponse.dart'; import 'package:diplomaticquarterapp/models/Authentication/check_user_status_req.dart'; @@ -56,125 +55,127 @@ class _Register extends State { @override Widget build(BuildContext context) { return AppScaffold( - - appBarTitle: TranslationBase.of(context).register, - isShowAppBar: false, - isShowDecPage: false, - showNewAppBar: false, - showNewAppBarTitle: true, - body: Column( - children: [ - Expanded( - child: ListView( - padding: EdgeInsets.all(21), - physics: BouncingScrollPhysics(), - children: [ - SizedBox(height: 10), - Padding( - padding: EdgeInsets.all(10), - child: Text( - TranslationBase.of(context).enterNationalId, - style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.64, height: 23 / 16), - )), - SizedBox(height: 10), - PhoneNumberSelectorWidget(onNumberChange: (value) => {mobileNo = value, validateForm()}, onCountryChange: (value) => countryCode = value), - SizedBox(height: 12), - Directionality(textDirection: TextDirection.ltr, child: inputWidget(TranslationBase.of(context).nationalIdNumber, "Xxxxxxxxx", nationalIDorFile)), - SizedBox(height: 20), - Row( - children: [ - Expanded( - child: Row( - children: [ - Radio( - value: 1, - groupValue: isHijri, - onChanged: (value) { - setState(() { - isHijri = value; - }); - validateForm(); - }, - ), - Text(TranslationBase.of(context).hijriDate), - ], - ), + appBarTitle: TranslationBase.of(context).register, + isShowAppBar: false, + isShowDecPage: false, + showNewAppBar: false, + showNewAppBarTitle: true, + body: Column( + children: [ + Expanded( + child: ListView( + padding: EdgeInsets.all(21), + physics: BouncingScrollPhysics(), + children: [ + SizedBox(height: 10), + Padding( + padding: EdgeInsets.all(10), + child: Text( + TranslationBase.of(context).enterNationalId, + style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.64, height: 23 / 16), + )), + SizedBox(height: 10), + PhoneNumberSelectorWidget(onNumberChange: (value) => {mobileNo = value, validateForm()}, onCountryChange: (value) => countryCode = value), + SizedBox(height: 12), + Directionality(textDirection: TextDirection.ltr, child: inputWidget(TranslationBase.of(context).nationalIdNumber, "Xxxxxxxxx", nationalIDorFile)), + SizedBox(height: 20), + Row( + children: [ + Expanded( + child: Row( + children: [ + Radio( + value: 1, + groupValue: isHijri, + onChanged: (value) { + setState(() { + isHijri = value; + }); + validateForm(); + }, + ), + Text(TranslationBase.of(context).hijriDate), + ], ), - Expanded( - child: Row( - children: [ - Radio( - value: 0, - groupValue: isHijri, - onChanged: (value) { - setState(() { - isHijri = value; - }); - validateForm(); - }, - ), - Text(TranslationBase.of(context).gregorianDate), - ], - ), + ), + Expanded( + child: Row( + children: [ + Radio( + value: 0, + groupValue: isHijri, + onChanged: (value) { + setState(() { + isHijri = value; + }); + validateForm(); + }, + ), + Text(TranslationBase.of(context).gregorianDate), + ], ), - ], - ), - Row(children: [ - Container( - width: SizeConfig.realScreenWidth * .9, - child: isHijri == 1 - ? Directionality( - textDirection: TextDirection.ltr, - child: inputWidget(TranslationBase.of(context).dob, "DD/MM/YYYYY", dob, - isNumber: false, - suffix: Icon( - Icons.calendar_today, - size: 16, - ))) - : Container( - child: InkWell( - onTap: () { - if (isHijri != null) _selectDate(context); - }, - child: Directionality( - textDirection: TextDirection.ltr, - child: inputWidget(TranslationBase.of(context).dob, "DD/MM/YYYYY", dobEn, - isNumber: false, - isEnable: false, - suffix: Icon( - Icons.calendar_today, - size: 16, - )))))), - ]) - ], - ), + ), + ], + ), + Row(children: [ + Container( + width: SizeConfig.realScreenWidth * .89, + child: isHijri == 1 + ? Directionality( + textDirection: TextDirection.ltr, + child: inputWidget(TranslationBase.of(context).dob, "DD/MM/YYYYY", dob, + isNumber: false, + suffix: Icon( + Icons.calendar_today, + size: 16, + ))) + : Container( + child: InkWell( + onTap: () { + if (isHijri != null) _selectDate(context); + }, + child: Directionality( + textDirection: TextDirection.ltr, + child: inputWidget(TranslationBase.of(context).dob, "DD/MM/YYYYY", dobEn, + isNumber: false, + isEnable: false, + suffix: Icon( + Icons.calendar_today, + size: 16, + )))))), + ]) + ], ), - Container( - width: double.maxFinite, - // height: 80.0, - color: Colors.white, - // margin: EdgeInsets.only(bottom: 50.0), - child: Row( - children: [ - Expanded( - child: Padding( - padding: EdgeInsets.all(10), child: DefaultButton(TranslationBase.of(context).cancel, () { - Navigator.of(context).pop(); - locator().loginRegistration.registration_cancel(step: 'enter details'); - }, textColor: Colors.white, color: Color(0xffD02127))), - ), - Expanded( - child: Padding( - padding: EdgeInsets.all(10), - child: DefaultButton(TranslationBase.of(context).next, (){ - startRegistration(); - locator().loginRegistration.registration_enter_details(); - }, textColor: Colors.white, color: isButtonDisabled == true ? Colors.grey : Color(0xff359846))), - ), - ], - ),) - ], - ),); + ), + Container( + width: double.maxFinite, + // height: 80.0, + color: Colors.white, + // margin: EdgeInsets.only(bottom: 50.0), + child: Row( + children: [ + Expanded( + child: Padding( + padding: EdgeInsets.all(10), + child: DefaultButton(TranslationBase.of(context).cancel, () { + Navigator.of(context).pop(); + locator().loginRegistration.registration_cancel(step: 'enter details'); + }, textColor: Colors.white, color: Color(0xffD02127))), + ), + Expanded( + child: Padding( + padding: EdgeInsets.all(10), + child: DefaultButton(TranslationBase.of(context).next, () { + startRegistration(); + locator().loginRegistration.registration_enter_details(); + }, textColor: Colors.white, color: isButtonDisabled == true ? Colors.grey : Color(0xff359846))), + ), + ], + ), + ) + ], + ), + ); } Future _selectDate(BuildContext context) async { @@ -349,12 +350,19 @@ class _Register extends State { cancelFunction: () {}) .showAlertDialog(context); } else { + final intl.DateFormat dateFormat = intl.DateFormat('dd/MM/yyyy'); nRequest['forRegister'] = true; nRequest['isRegister'] = true; nRequest["PatientIdentificationID"] = nRequest["PatientIdentificationID"].toString(); + nRequest['dob'] = isHijri == 1 ? dob.text : dateFormat.format(selectedDate); + nRequest['isHijri'] = isHijri; sharedPref.setObject(REGISTER_DATA_FOR_LOGIIN, nRequest); sharedPref.setString(LOGIN_TOKEN_ID, response['LogInTokenID']); - this.chekUserData(response['LogInTokenID']); + if(request.patientOutSA ==0 ) { + this.chekUserData(response['LogInTokenID']); + }else{ + Navigator.of(context).push(FadePage(page: ConfirmLogin(changePageViewIndex: widget.changePageViewIndex, fromRegistration: true, isDubai:true))); + } } } else { // if (response['ErrorCode'] == '-986') { diff --git a/lib/pages/login/register_new_dubai.dart b/lib/pages/login/register_new_dubai.dart new file mode 100644 index 00000000..e69de29b diff --git a/lib/pages/medical/allergies_page.dart b/lib/pages/medical/allergies_page.dart index e83cf1d5..b3f54a60 100644 --- a/lib/pages/medical/allergies_page.dart +++ b/lib/pages/medical/allergies_page.dart @@ -47,7 +47,7 @@ class AllergiesPage extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ Texts(TranslationBase.of(context).remarks+" :"), - Texts(TranslationBase.of(context).description + model.allergies[index].description ?? ''), + Texts(TranslationBase.of(context).description + ": " + model.allergies[index].description ?? ''), ], ), ) diff --git a/lib/pages/medical/labs/laboratory_result_page.dart b/lib/pages/medical/labs/laboratory_result_page.dart index 4bd29c19..847f979b 100644 --- a/lib/pages/medical/labs/laboratory_result_page.dart +++ b/lib/pages/medical/labs/laboratory_result_page.dart @@ -47,13 +47,26 @@ class _LaboratoryResultPageState extends State { GifLoaderDialogUtils.hideDialog(context); }, billNo: widget.patientLabOrders.invoiceNo, - details: model.patientLabSpecialResult[index].resultDataHTML, + // details: model.patientLabSpecialResult[index].resultDataHTML, + details: model.patientLabSpecialResult.isEmpty ? null : getSpecialResults(model), orderNo: widget.patientLabOrders.orderNo, patientLabOrder: widget.patientLabOrders, ), - itemCount: model.patientLabSpecialResult.length, + itemCount: 1, ), ), ); } + + String getSpecialResults(LabsViewModel model) { + String labResults = ""; + model.patientLabSpecialResult.forEach((element) { + if (element.resultDataHTML != null) { + labResults += (element.resultDataHTML + "

"); + } else { + labResults += ("
No Result Available
"); + } + }); + return labResults; + } } diff --git a/lib/pages/medical/patient_sick_leave_page.dart b/lib/pages/medical/patient_sick_leave_page.dart index 1ca32e02..3d977a96 100644 --- a/lib/pages/medical/patient_sick_leave_page.dart +++ b/lib/pages/medical/patient_sick_leave_page.dart @@ -57,8 +57,8 @@ class _PatientSickLeavePageState extends State { subName: model.sickLeaveList[index].clinicName, isSortByClinic: false, isInOutPatient: model.sickLeaveList[index].isInOutPatient, - // isSickLeave: true, - // sickLeaveStatus: model.sickLeaveList[index].status, + isSickLeave: true, + sickLeaveStatus: model.sickLeaveList[index].status, onEmailTap: () { showConfirmMessage(model, index); }, @@ -69,13 +69,13 @@ class _PatientSickLeavePageState extends State { } void showConfirmMessage(PatientSickLeaveViewMode model, int index) { - // if (model.sickLeaveList[index].status == 1) { - // openWorkPlaceUpdatePage(model.sickLeaveList[index].requestNo, model.sickLeaveList[index].setupID, model, index, model.sickLeaveList[index].projectID); - // } else if (model.sickLeaveList[index].status == 2) { + if (model.sickLeaveList[index].status == 1) { + openWorkPlaceUpdatePage(model.sickLeaveList[index].requestNo, model.sickLeaveList[index].setupID, model, index, model.sickLeaveList[index].projectID); + } else if (model.sickLeaveList[index].status == 2) { showEmailDialog(model, index); - // } else { - // showApprovalDialog(); - // } + } else { + showApprovalDialog(); + } } void showApprovalDialog() { @@ -111,7 +111,14 @@ class _PatientSickLeavePageState extends State { } void openWorkPlaceUpdatePage(int requestNumber, String setupID, PatientSickLeaveViewMode model, int index, int projectID) { - Navigator.push(context, FadePage(page: WorkplaceUpdatePage(requestNumber: requestNumber, setupID: setupID, projectID: projectID,))).then((value) { + Navigator.push( + context, + FadePage( + page: WorkplaceUpdatePage( + requestNumber: requestNumber, + setupID: setupID, + projectID: projectID, + ))).then((value) { print(value); if (value != null && value == true) { model.getSickLeave(); diff --git a/lib/pages/medical/sickleave_workplace_update_page.dart b/lib/pages/medical/sickleave_workplace_update_page.dart index 47ff2e1a..3b4a1f1b 100644 --- a/lib/pages/medical/sickleave_workplace_update_page.dart +++ b/lib/pages/medical/sickleave_workplace_update_page.dart @@ -222,7 +222,9 @@ class _WorkplaceUpdatePageState extends State { LabsService service = new LabsService(); GifLoaderDialogUtils.showMyDialog(context); - service.updateWorkplaceName(workplaceName.text, widget.requestNumber, widget.setupID, widget.projectID).then((res) { + service + .updateWorkplaceName(projectViewModel.isArabic ? "-" : workplaceName.text, projectViewModel.isArabic ? workplaceName.text : "-", widget.requestNumber, widget.setupID, widget.projectID) + .then((res) { GifLoaderDialogUtils.hideDialog(context); Navigator.of(context).pop(true); }).catchError((err) { diff --git a/lib/pages/medical/vital_sign/vital_sing_chart_blood_pressure.dart b/lib/pages/medical/vital_sign/vital_sing_chart_blood_pressure.dart index 424b0c90..2d04e91a 100644 --- a/lib/pages/medical/vital_sign/vital_sing_chart_blood_pressure.dart +++ b/lib/pages/medical/vital_sign/vital_sing_chart_blood_pressure.dart @@ -35,7 +35,7 @@ class VitalSingChartBloodPressure extends StatelessWidget { @override Widget build(BuildContext context) { - projectViewModel = Provider.of(context); + projectViewModel = Provider.of(context); generateData(); return SingleChildScrollView( child: Column( diff --git a/lib/services/authentication/auth_provider.dart b/lib/services/authentication/auth_provider.dart index 964a7edd..ec4446af 100644 --- a/lib/services/authentication/auth_provider.dart +++ b/lib/services/authentication/auth_provider.dart @@ -248,7 +248,7 @@ class AuthProvider with ChangeNotifier { return Future.value(localRes); } - Future checkActivationCode(request, [value]) async { + Future checkActivationCode(request, [value]) async { var neRequest = CheckActivationCodeReq.fromJson(request); neRequest.activationCode = value ?? "0000"; @@ -377,10 +377,16 @@ class AuthProvider with ChangeNotifier { requestN.patientOutSA = requestN.patientobject.patientOutSA; final DateFormat dateFormat = DateFormat('MM/dd/yyyy'); final DateFormat dateFormat2 = DateFormat('dd/MM/yyyy'); - requestN.dob = nhic['IsHijri'] ? nhic['DateOfBirth'] : dateFormat2.format(dateFormat.parse(nhic['DateOfBirth'])); + if(nhic !=null) { + requestN.dob = nhic['IsHijri'] ? nhic['DateOfBirth'] : dateFormat2.format( + dateFormat.parse(nhic['DateOfBirth'])); + requestN.isHijri = nhic['IsHijri'] ? 1 : 0; + requestN.healthId = requestN.patientobject.eHealthIDField; + } + requestN.zipCode = requestN.patientOutSA == 1 ? '971' : '966'; - requestN.healthId = requestN.patientobject.eHealthIDField; - requestN.isHijri = nhic['IsHijri'] ? 1 : 0; + + await sharedPref.remove(USER_PROFILE); dynamic localRes; diff --git a/lib/services/clinic_services/get_clinic_service.dart b/lib/services/clinic_services/get_clinic_service.dart index 0ebebfa2..6d22a472 100644 --- a/lib/services/clinic_services/get_clinic_service.dart +++ b/lib/services/clinic_services/get_clinic_service.dart @@ -199,4 +199,14 @@ class ClinicListService extends BaseService { }, body: request); return Future.value(localRes); } + Future getCountries() async { + Map request ={}; + dynamic localRes; + await baseAppClient.post(GET_NATIONALITY, onSuccess: (response, statusCode) async { + localRes = response; + }, onFailure: (String error, int statusCode) { + throw error; + }, body: request); + return Future.value(localRes); +} } diff --git a/lib/uitl/push-notification-handler.dart b/lib/uitl/push-notification-handler.dart index 60ac504e..d8895f9e 100644 --- a/lib/uitl/push-notification-handler.dart +++ b/lib/uitl/push-notification-handler.dart @@ -359,6 +359,10 @@ class PushNotificationHandler { onToken(token); }); + FirebaseMessaging.instance.getAPNSToken().then((value) { + print("Push APNS getToken: " + value); + }); + FirebaseMessaging.onBackgroundMessage(backgroundMessageHandler); } diff --git a/lib/widgets/charts/show_chart.dart b/lib/widgets/charts/show_chart.dart index 49273611..4d69cd84 100644 --- a/lib/widgets/charts/show_chart.dart +++ b/lib/widgets/charts/show_chart.dart @@ -183,9 +183,13 @@ class ShowChart extends StatelessWidget { getMaxX(); getMin(); getMinY(); - increasingY = ((maxY - minY) / timeSeries.length - 1) * 15; - maxY += increasingY.abs(); - minY -= increasingY.abs(); + try { + increasingY = ((maxY - minY) / timeSeries.length - 1) * 15; + maxY += increasingY.abs(); + minY -= increasingY.abs(); + } catch(ex) { + print(ex); + } } double _fetchLeftTileInterval() { @@ -259,7 +263,7 @@ class ShowChart extends StatelessWidget { barWidth: 1.5, isStrokeCapRound: true, dotData: FlDotData( - show: false, + show: true, ), belowBarData: BarAreaData( show: false, diff --git a/lib/widgets/data_display/medical/doctor_card.dart b/lib/widgets/data_display/medical/doctor_card.dart index d58dccf3..20b2714e 100644 --- a/lib/widgets/data_display/medical/doctor_card.dart +++ b/lib/widgets/data_display/medical/doctor_card.dart @@ -116,7 +116,7 @@ class DoctorCard extends StatelessWidget { ), Expanded( child: Padding( - padding: const EdgeInsets.only(left: 20, right: 12, top: 12, bottom: 12), + padding: const EdgeInsets.only(left: 20, right: 12, top: 12, bottom: 10), child: Column( crossAxisAlignment: CrossAxisAlignment.start, mainAxisSize: MainAxisSize.min, @@ -224,7 +224,7 @@ class DoctorCard extends StatelessWidget { onTap: onEmailTap, child: Icon( Icons.email, - color: Theme.of(context).primaryColor, + color: sickLeaveStatus != 3 ? Theme.of(context).primaryColor : Colors.grey[400], ), ) : onTap != null diff --git a/lib/widgets/new_design/doctor_header.dart b/lib/widgets/new_design/doctor_header.dart index 2c9bb42a..806cbb4a 100644 --- a/lib/widgets/new_design/doctor_header.dart +++ b/lib/widgets/new_design/doctor_header.dart @@ -302,7 +302,7 @@ class DoctorHeader extends StatelessWidget { ], ), Container( - margin: EdgeInsets.only(top: 10.0, left: 20.0, right: 20.0), + margin: EdgeInsets.only(top: 10.0, left: 10.0, right: 10.0), child: Text(getRatingWidth(doctorDetailsList[0].patientNumber).round().toString() + "%", style: TextStyle(fontSize: 14.0, color: Colors.black, fontWeight: FontWeight.w600)), ), @@ -323,7 +323,7 @@ class DoctorHeader extends StatelessWidget { ], ), Container( - margin: EdgeInsets.only(top: 10.0, left: 20.0, right: 20.0), + margin: EdgeInsets.only(top: 10.0, left: 10.0, right: 10.0), child: Text(getRatingWidth(doctorDetailsList[1].patientNumber).round().toString() + "%", style: TextStyle(fontSize: 14.0, color: Colors.black, fontWeight: FontWeight.w600)), ), @@ -344,7 +344,7 @@ class DoctorHeader extends StatelessWidget { ], ), Container( - margin: EdgeInsets.only(top: 10.0, left: 20.0, right: 20.0), + margin: EdgeInsets.only(top: 10.0, left: 10.0, right: 10.0), child: Text(getRatingWidth(doctorDetailsList[2].patientNumber).round().toString() + "%", style: TextStyle(fontSize: 14.0, color: Colors.black, fontWeight: FontWeight.w600)), ), @@ -365,7 +365,7 @@ class DoctorHeader extends StatelessWidget { ], ), Container( - margin: EdgeInsets.only(top: 10.0, left: 20.0, right: 20.0), + margin: EdgeInsets.only(top: 10.0, left: 10.0, right: 10.0), child: Text(getRatingWidth(doctorDetailsList[3].patientNumber).round().toString() + "%", style: TextStyle(fontSize: 14.0, color: Colors.black, fontWeight: FontWeight.w600)), ), @@ -387,7 +387,7 @@ class DoctorHeader extends StatelessWidget { ], ), Container( - margin: EdgeInsets.only(top: 10.0, left: 20.0, right: 20.0), + margin: EdgeInsets.only(top: 10.0, left: 10.0, right: 10.0), child: Text(getRatingWidth(doctorDetailsList[4].patientNumber).round().toString() + "%", style: TextStyle(fontSize: 14.0, color: Colors.black, fontWeight: FontWeight.w600)), ), diff --git a/pubspec.yaml b/pubspec.yaml index a7222ce6..39370e58 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,7 +1,7 @@ name: diplomaticquarterapp description: A new Flutter application. -version: 4.5.61+1 +version: 4.5.64+1 environment: sdk: ">=2.7.0 <3.0.0" @@ -34,7 +34,7 @@ dependencies: health: ^3.0.3 #chart - fl_chart: ^0.40.2 + fl_chart: ^0.45.0 #Camera Preview camera: ^0.10.1 @@ -172,6 +172,8 @@ dependencies: flutter_nfc_kit: ^3.3.1 + geofencing: ^0.1.0 + # speech_to_text: ^6.1.1 # path: speech_to_text @@ -205,6 +207,7 @@ dependencies: sms_otp_auto_verify: ^2.1.0 flutter_ios_voip_kit: ^0.0.5 google_api_availability: ^3.0.1 +# flutter_callkit_incoming: ^1.0.3+3 # firebase_core: 1.12.0 dependency_overrides: