diff --git a/android/app/build.gradle b/android/app/build.gradle
index a75b8ca5..78b1c7ab 100644
--- a/android/app/build.gradle
+++ b/android/app/build.gradle
@@ -210,6 +210,7 @@ dependencies {
implementation 'androidx.core:core-ktx:1.6.0'
implementation 'androidx.appcompat:appcompat:1.3.1'
implementation 'com.google.android.material:material:1.9.0'
+ implementation 'pl.droidsonroids.gif:android-gif-drawable:1.2.22'
androidTestImplementation "androidx.test:core:1.4.0"
}
diff --git a/android/app/libs/PenNavUI.aar b/android/app/libs/PenNavUI.aar
index 6291c4ec..d423bc11 100644
Binary files a/android/app/libs/PenNavUI.aar and b/android/app/libs/PenNavUI.aar differ
diff --git a/android/app/libs/Penguin.aar b/android/app/libs/Penguin.aar
index 7cdc0b71..5c789c6f 100644
Binary files a/android/app/libs/Penguin.aar and b/android/app/libs/Penguin.aar differ
diff --git a/android/app/libs/PenguinRenderer.aar b/android/app/libs/PenguinRenderer.aar
index c60248c9..b657ac66 100644
Binary files a/android/app/libs/PenguinRenderer.aar and b/android/app/libs/PenguinRenderer.aar differ
diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml
index 64d3eed4..2856e8f1 100644
--- a/android/app/src/main/AndroidManifest.xml
+++ b/android/app/src/main/AndroidManifest.xml
@@ -34,8 +34,8 @@
-
-
+
+
diff --git a/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/penguin/PenguinView.kt b/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/penguin/PenguinView.kt
index 743ce93b..238765b2 100644
--- a/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/penguin/PenguinView.kt
+++ b/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/penguin/PenguinView.kt
@@ -207,12 +207,12 @@ internal class PenguinView(
.build()
// Set location delegate to handle location updates
- PlugAndPlaySDK.setPiLocationDelegate {
+// PlugAndPlaySDK.setPiLocationDelegate {
// Example code to handle location updates
// Uncomment and modify as needed
// if (location.size() > 0)
// Toast.makeText(_context, "Location Info Latitude: ${location[0]}, Longitude: ${location[1]}", Toast.LENGTH_SHORT).show()
- }
+// }
// Set events delegate for reporting issues
PlugAndPlaySDK.setPiEventsDelegate { }
@@ -231,14 +231,8 @@ internal class PenguinView(
try {
if (refID.isBlank()) {
Log.e("navigateTo", "Invalid refID: The reference ID is blank.")
-
}
-
-
-
// referenceId = refID
-
-
navigator.navigateTo(mContext, refID,object : RefIdDelegate {
override fun onRefByIDSuccess(PoiId: String?) {
Log.e("navigateTo", "PoiId is penguin view+++++++ $PoiId")
diff --git a/android/build.gradle b/android/build.gradle
index c5f1baa2..e9b66680 100644
--- a/android/build.gradle
+++ b/android/build.gradle
@@ -12,6 +12,7 @@ buildscript {
repositories {
google()
jcenter()
+ mavenCentral()
maven { url 'https://developer.huawei.com/repo/' }
maven {
url 'https://api.mapbox.com/downloads/v2/releases/maven'
diff --git a/assets/images/progress-loading-red-crop-1.gif b/assets/images/progress-loading-red-crop-1.gif
new file mode 100644
index 00000000..6dba7901
Binary files /dev/null and b/assets/images/progress-loading-red-crop-1.gif differ
diff --git a/ios/Podfile b/ios/Podfile
index 5564c00b..7721bb87 100644
--- a/ios/Podfile
+++ b/ios/Podfile
@@ -1,9 +1,9 @@
# Uncomment this line to define a global platform for your project
-platform :ios, '13.0'
+platform :ios, '14.0'
# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
-
+# use_frameworks! :linkage => :static
project 'Runner', {
'Debug' => :debug,
'Profile' => :release,
@@ -34,6 +34,7 @@ target 'Runner' do
pod 'OpenTok', '~> 2.22.0'
pod 'VTO2Lib'
pod 'MapboxMaps', '10.18.2'
+ pod 'FLAnimatedImage'
flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
end
diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj
index 5dad833f..2c0073ff 100644
--- a/ios/Runner.xcodeproj/project.pbxproj
+++ b/ios/Runner.xcodeproj/project.pbxproj
@@ -31,7 +31,6 @@
76D71B6E2C6B81CC00DAFB84 /* PenguinPlugin.swift in Sources */ = {isa = PBXBuildFile; fileRef = 76D71B6D2C6B81CC00DAFB84 /* PenguinPlugin.swift */; };
76D71B702C6B81EA00DAFB84 /* PenguinViewFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = 76D71B6F2C6B81EA00DAFB84 /* PenguinViewFactory.swift */; };
76F2556127F1FFED0062C1CD /* PassKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 76F2556027F1FFED0062C1CD /* PassKit.framework */; };
- 76F9B0E22C6DED310064C51B /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 13E5B711BC29EB6ECCE1964C /* Pods_Runner.framework */; };
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; };
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; };
97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; };
@@ -52,6 +51,7 @@
E9C8C136256BACDA00EFFB62 /* HMG_Guest.swift in Sources */ = {isa = PBXBuildFile; fileRef = E9C8C135256BACDA00EFFB62 /* HMG_Guest.swift */; };
E9E27168256E3A4000F49B69 /* LocalizedFromFlutter.swift in Sources */ = {isa = PBXBuildFile; fileRef = E9E27167256E3A4000F49B69 /* LocalizedFromFlutter.swift */; };
E9F7623B25922BCE00FB5CCF /* FlutterConstants.swift in Sources */ = {isa = PBXBuildFile; fileRef = E9F7623A25922BCE00FB5CCF /* FlutterConstants.swift */; };
+ FD7241B0D73FB24C87572FAC /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8E413842321D0D624872E9BE /* Pods_Runner.framework */; };
/* End PBXBuildFile section */
/* Begin PBXCopyFilesBuildPhase section */
@@ -71,7 +71,6 @@
/* End PBXCopyFilesBuildPhase section */
/* Begin PBXFileReference section */
- 13E5B711BC29EB6ECCE1964C /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; };
1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; };
1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; };
29631B9D2C96C7F600DF5916 /* PenguinNavigator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PenguinNavigator.swift; sourceTree = ""; };
@@ -101,6 +100,7 @@
76F2556027F1FFED0062C1CD /* PassKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = PassKit.framework; path = System/Library/Frameworks/PassKit.framework; sourceTree = SDKROOT; };
7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; };
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 = ""; };
+ 8E413842321D0D624872E9BE /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; };
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; };
@@ -134,13 +134,13 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
- 76F9B0E22C6DED310064C51B /* Pods_Runner.framework in Frameworks */,
76F2556127F1FFED0062C1CD /* PassKit.framework in Frameworks */,
76815B27275F381C00E66E94 /* HealthKit.framework in Frameworks */,
E9620805255C2ED100D3A35D /* NetworkExtension.framework in Frameworks */,
47C935042C91766A00981BA7 /* PenNavUI.xcframework in Frameworks */,
47C935002C91766800981BA7 /* Penguin.xcframework in Frameworks */,
47C935022C91766900981BA7 /* PenguinINRenderer.xcframework in Frameworks */,
+ FD7241B0D73FB24C87572FAC /* Pods_Runner.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -166,7 +166,7 @@
76F2556027F1FFED0062C1CD /* PassKit.framework */,
76815B26275F381C00E66E94 /* HealthKit.framework */,
E9620804255C2ED100D3A35D /* NetworkExtension.framework */,
- 13E5B711BC29EB6ECCE1964C /* Pods_Runner.framework */,
+ 8E413842321D0D624872E9BE /* Pods_Runner.framework */,
);
name = Frameworks;
sourceTree = "";
@@ -600,7 +600,7 @@
"$(inherited)",
"$(PROJECT_DIR)/Flutter",
);
- MARKETING_VERSION = 4.5.95;
+ MARKETING_VERSION = 4.5.991;
PRODUCT_BUNDLE_IDENTIFIER = "com.HMG.HMG-Smartphone";
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
@@ -751,7 +751,7 @@
"$(inherited)",
"$(PROJECT_DIR)/Flutter",
);
- MARKETING_VERSION = 4.5.95;
+ MARKETING_VERSION = 4.5.991;
PRODUCT_BUNDLE_IDENTIFIER = "com.HMG.HMG-Smartphone";
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
@@ -794,7 +794,7 @@
"$(inherited)",
"$(PROJECT_DIR)/Flutter",
);
- MARKETING_VERSION = 4.5.95;
+ MARKETING_VERSION = 4.5.991;
PRODUCT_BUNDLE_IDENTIFIER = "com.HMG.HMG-Smartphone";
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
diff --git a/ios/Runner/Helper/HMGPenguinInPlatformBridge.swift b/ios/Runner/Helper/HMGPenguinInPlatformBridge.swift
index 00383010..c4a44243 100644
--- a/ios/Runner/Helper/HMGPenguinInPlatformBridge.swift
+++ b/ios/Runner/Helper/HMGPenguinInPlatformBridge.swift
@@ -1,11 +1,6 @@
-//
-// HMGPenguinInPlatformBridge.swift
-// Runner
-//
-// Created by Haroon Amjad on 13/08/2024.
-//
-
import Foundation
+import FLAnimatedImage
+
var flutterMethodChannelPenguinIn:FlutterMethodChannel? = nil
fileprivate var mainViewController:MainFlutterVC!
@@ -34,6 +29,7 @@ class HMGPenguinInPlatformBridge{
if let arguments = methodCall.arguments as Any? {
if methodCall.method == "launchPenguin"{
+ print("====== launchPenguinView Launched =========")
self.launchPenguinView(arguments: arguments, result: result)
}
} else {
@@ -41,8 +37,9 @@ class HMGPenguinInPlatformBridge{
}
}
}
-
+
private func launchPenguinView(arguments: Any, result: @escaping FlutterResult) {
+
let penguinView = PenguinView(
frame: CGRect(x: 0, y: 0, width: UIScreen.main.bounds.width, height: UIScreen.main.bounds.height),
viewIdentifier: 0,
@@ -53,9 +50,45 @@ class HMGPenguinInPlatformBridge{
let penguinUIView = penguinView.view()
penguinUIView.frame = mainViewController.view.bounds
penguinUIView.autoresizingMask = [.flexibleWidth, .flexibleHeight]
+
mainViewController.view.addSubview(penguinUIView)
- result(nil) // Call result to indicate the method was successfully handled
- }
+ guard let args = arguments as? [String: Any],
+ let loaderImageData = args["loaderImage"] as? FlutterStandardTypedData else {
+ print("loaderImage data not found in arguments")
+ result(FlutterError(code: "ARGUMENT_ERROR", message: "Missing loaderImage data", details: nil))
+ return
+ }
+
+ let loadingOverlay = UIView(frame: UIScreen.main.bounds)
+ loadingOverlay.backgroundColor = UIColor.black.withAlphaComponent(0.5) // Semi-transparent overlay
+ loadingOverlay.autoresizingMask = [.flexibleWidth, .flexibleHeight]
+
+ // Display the GIF using FLAnimatedImage
+ let animatedImage = FLAnimatedImage(animatedGIFData: loaderImageData.data)
+ let gifImageView = FLAnimatedImageView()
+ gifImageView.animatedImage = animatedImage
+ gifImageView.frame = CGRect(x: 0, y: 0, width: UIScreen.main.bounds.width, height: UIScreen.main.bounds.height)
+ gifImageView.center = loadingOverlay.center
+ gifImageView.contentMode = .scaleAspectFit
+ loadingOverlay.addSubview(gifImageView)
+
+
+ if let window = UIApplication.shared.windows.first {
+ window.addSubview(loadingOverlay)
+
+ } else {
+ print("Error: Main window not found")
+ }
+
+ penguinView.onSuccess = {
+ // Hide and remove the loader
+ DispatchQueue.main.async {
+ loadingOverlay.removeFromSuperview()
+
+ }
+ }
+ result(nil)
+ }
}
diff --git a/ios/Runner/Penguin/PenguinView.swift b/ios/Runner/Penguin/PenguinView.swift
index 81377f7b..b5161eb0 100644
--- a/ios/Runner/Penguin/PenguinView.swift
+++ b/ios/Runner/Penguin/PenguinView.swift
@@ -1,10 +1,17 @@
//
+
// BlueGpsView.swift
+
// Runner
+
//
+
// Created by Penguin.
+
//
+
+
import Foundation
import UIKit
import Flutter
@@ -14,211 +21,425 @@ import Foundation
import Flutter
import UIKit
+
+
/**
+
* A custom Flutter platform view for displaying Penguin UI components.
+
* This class integrates with the Penguin navigation SDK and handles UI events.
+
*/
-class PenguinView: NSObject, FlutterPlatformView
-, PIEventsDelegate, PenNavInitializationDelegate
+class PenguinView: NSObject, FlutterPlatformView, PIEventsDelegate, PenNavInitializationDelegate
+
{
-
// The main view displayed within the platform view
+
private var _view: UIView
+
private var model: PenguinModel?
+
+ private var methodChannel: FlutterMethodChannel
+
+ var onSuccess: (() -> Void)?
+
+
+
+
+
/**
+
* Initializes the PenguinView with the provided parameters.
+
*
+
* @param frame The frame of the view, specifying its size and position.
+
* @param viewId A unique identifier for this view instance.
+
* @param args Optional arguments provided for creating the view.
+
* @param messenger The [FlutterBinaryMessenger] used for communication with Dart.
+
*/
+
init(
+
frame: CGRect,
+
viewIdentifier viewId: Int64,
+
arguments args: Any?,
+
binaryMessenger messenger: FlutterBinaryMessenger?
+
) {
+
_view = UIView()
+
+ methodChannel = FlutterMethodChannel(name: "launch_penguin_ui", binaryMessenger: messenger!)
+
+
+
super.init()
+
+
// Get the screen's width and height to set the view's frame
+
let screenWidth = UIScreen.main.bounds.width
+
let screenHeight = UIScreen.main.bounds.height
+
+
// Uncomment to set the background color of the view
+
// _view.backgroundColor = UIColor.red
+
+
// Set the frame of the view to cover the entire screen
+
_view.frame = CGRect(x: 0, y: 0, width: screenWidth, height: screenHeight)
+
print("========Inside Penguin View ========")
+
print(args)
+
guard let arguments = args as? [String: Any] else {
+
print("Error: Arguments are not in the expected format.")
+
return
+
}
+
print("===== i got tha Args=======")
+
+
// Initialize the model from the arguments
+
if let penguinModel = PenguinModel(from: arguments) {
+
self.model = penguinModel
+
initPenguin(args: penguinModel)
+
} else {
+
print("Error: Failed to initialize PenguinModel from arguments ")
+
}
+
// Initialize the Penguin SDK with required configurations
+
// initPenguin( arguments: args)
+
}
+
+
/**
+
* Initializes the Penguin SDK with custom configuration settings.
+
*/
+
func initPenguin(args: PenguinModel) {
+
// Set the initialization delegate to handle SDK initialization events
+
PenNavUIManager.shared.initializationDelegate = self
+
// Configure the Penguin SDK with necessary parameters
+
PenNavUIManager.shared
+
.setClientKey(args.clientKey)
+
.setClientID(args.clientID)
+
.setUsername(args.username)
+
.setSimulationModeEnabled(isEnable: args.isSimulationModeEnabled)
+
.setBaseURL(dataURL: args.dataURL, positionURL: args.positionURL)
+
.setServiceName(dataServiceName: args.dataServiceName, positionServiceName: args.positionServiceName)
+
.setIsShowUserName(args.isShowUserName)
+
.setIsUpdateUserLocationSmoothly(args.isUpdateUserLocationSmoothly)
+
.setEnableReportIssue(enable: args.isEnableReportIssue)
+
.setLanguage(args.languageCode)
+
.setBackButtonVisibility(true)
+
.build()
+
}
+
+
+
+
/**
+
* Returns the main view associated with this platform view.
+
*
+
* @return The UIView instance that represents this platform view.
+
*/
+
func view() -> UIView {
+
return _view
+
}
+
+
// MARK: - PIEventsDelegate Methods
+
+
+
+
+
+
+
+
/**
+
* Called when the Penguin UI is dismissed.
+
*/
+
func onPenNavUIDismiss() {
+
// Handle UI dismissal if needed
+
print("====== onPenNavUIDismiss =========")
+
+
+
self.view().removeFromSuperview()
+
}
+
+
/**
+
* Called when a report issue is generated.
+
*
+
* @param issue The type of issue reported.
+
*/
+
func onReportIssue(_ issue: PenNavUI.IssueType) {
+
// Handle report issue events if needed
+
print("====== onReportIssueError =========")
+
+ methodChannel.invokeMethod("onReportIssue", arguments: ["issueType": issue])
+
+
+
}
+
+
/**
+
* Called when the Penguin UI setup is successful.
+
*/
+
func onPenNavSuccess() {
+
print("====== onPenNavSuccess =========")
+
+ onSuccess?()
+
+ methodChannel.invokeMethod("onPenNavSuccess", arguments: nil)
+
// Obtain the FlutterViewController instance
+
let controller: FlutterViewController = UIApplication.shared.windows.first?.rootViewController as! FlutterViewController
+
- print("====== after contoller onPenNavSuccess =========")
+
+ print("====== after controller onPenNavSuccess =========")
+
+
// Set the events delegate to handle SDK events
+
PenNavUIManager.shared.eventsDelegate = self
+
+
print("====== after eventsDelegate onPenNavSuccess =========")
+
+
// Present the Penguin UI on top of the Flutter view controller
+
PenNavUIManager.shared.present(root: controller, view: _view)
+
+
+
print("====== after present onPenNavSuccess =========")
+
print(model?.clinicID)
+
print("====== after present onPenNavSuccess =========")
+
+
guard let config = self.model else {
+
print("Error: Config Model is nil")
+
return
+
}
+
+
guard let clinicID = self.model?.clinicID,
+
let clientID = self.model?.clientID, !clientID.isEmpty else {
+
print("Error: Config Client ID is nil or empty")
+
return
+
}
+
+
let navigator = PenguinNavigator(config: config)
+
+
PenNavUIManager.shared.getToken(clientID: config.clientID, clientKey: config.clientKey) { [weak self] token, error in
+
if let error = error {
+
let errorMessage = "Token error while getting the for Navigate to method"
+
print("Failed to get token: \(errorMessage)")
+
return
+
}
+
+
guard let token = token else {
+
print("Token is nil")
+
return
+
}
+
print("Token Generated")
+
print(token);
+
+
self?.handleNavigation(clinicID: clinicID, token: token) { success, errorMessage in
+
if success {
+
print("Navigation successful")
+
} else {
+
print("Navigation failed: \(errorMessage ?? "Unknown error")")
+
}
+
+
}
+
+
print("====== after Token onPenNavSuccess =========")
+
}
+
+
}
+
+
+
+
private func handleNavigation(clinicID: String, token: String, completion: @escaping (Bool, String?) -> Void) {
+
DispatchQueue.main.async {
+
PenNavUIManager.shared.setToken(token: token)
+
PenNavUIManager.shared.navigate(to: clinicID)
+
completion(true,nil)
+
}
+
}
+
+
+
+
+
/**
+
* Called when there is an initialization error with the Penguin UI.
+
*
+
* @param errorType The type of initialization error.
+
* @param errorDescription A description of the error.
+
*/
+
func onPenNavInitializationError(errorType: PenNavUI.PenNavUIError, errorDescription: String) {
+
// Handle initialization errors if needed
-
+
print("onPenNavInitializationErrorType: \(errorType.rawValue)")
+
print("onPenNavInitializationError: \(errorDescription)")
-
}
-
-
-
-
}
diff --git a/lib/config/config.dart b/lib/config/config.dart
index 53b28a48..f40455ce 100644
--- a/lib/config/config.dart
+++ b/lib/config/config.dart
@@ -31,7 +31,7 @@ var BASE_URL = 'https://uat.hmgwebservices.com/';
// var BASE_URL = 'https://webservices.hmg.com/';
- // var BASE_URL = 'http://10.200.204.42/';
+// var BASE_URL = 'http://10.200.204.42/';
// Pharmacy UAT URLs
// var BASE_PHARMACY_URL = 'https://uat.hmgwebservices.com/epharmacy/api/';
@@ -677,6 +677,11 @@ var GET_DENTAL_INSTRUCTIONS = 'Services/OUTPs.svc/Rest/getProcedureNotification'
var INSERT_WALKIN_APPOINTMENT = "Services/Doctors.svc/REST/InsertWalkinAppointment";
+//Usage Agreement APIs
+var CHECK_USAGE_AGREEMENT = "Services/Patients.svc/REST/CheckForUsageAgreement";
+var GET_USAGE_AGREEMENT = "Services/Patients.svc/REST/GetUsageAgreementText";
+var ADD_USAGE_AGREEMENT = "Services/Patients.svc/REST/AddUsageAgreement";
+
//PAYFORT
var getPayFortProjectDetails = "Services/PayFort_Serv.svc/REST/GetPayFortProjectDetails";
var addPayFortApplePayResponse = "Services/PayFort_Serv.svc/REST/AddResponse";
diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart
index 546c2aeb..d67d284f 100644
--- a/lib/config/localized_values.dart
+++ b/lib/config/localized_values.dart
@@ -2013,4 +2013,6 @@ const Map localizedValues = {
"searchByBranch": {"en": "Search By Branch Name", "ar": "البحث عن طريق اسم الفرع"},
"hospitalNavigationTitle": {"en": "Hospital", "ar": "الملاحة"},
"hospitalNavigationSubtitle": {"en": "Navigation", "ar": "المستشفى"},
+ "continueAgreeTerms": {"en": "By continuing, You agree to the above Terms and Conditions.", "ar": "من خلال المتابعة، فإنك توافق على الشروط والأحكام المذكورة أعلاه."},
+ "agreeText": {"en": "Agree", "ar": "أوافق"},
};
diff --git a/lib/core/viewModels/project_view_model.dart b/lib/core/viewModels/project_view_model.dart
index d4707aa9..57362d6f 100644
--- a/lib/core/viewModels/project_view_model.dart
+++ b/lib/core/viewModels/project_view_model.dart
@@ -48,7 +48,7 @@ class ProjectViewModel extends BaseViewModel {
GetAdmissionInfoResponseModel getAdmissionInfoResponseModel = GetAdmissionInfoResponseModel();
GetAdmissionRequestInfoResponseModel getAdmissionRequestInfoResponseModel = GetAdmissionRequestInfoResponseModel();
- bool isIndoorNavigationEnabled = false;
+ bool isIndoorNavigationEnabled = true;
int waitingAppointmentProjectID = 0;
DoctorList? waitingAppointmentDoctor;
diff --git a/lib/pages/MyAppointments/widgets/AppointmentActions.dart b/lib/pages/MyAppointments/widgets/AppointmentActions.dart
index e7e7b1d0..feb7a514 100644
--- a/lib/pages/MyAppointments/widgets/AppointmentActions.dart
+++ b/lib/pages/MyAppointments/widgets/AppointmentActions.dart
@@ -204,7 +204,7 @@ class _AppointmentActionsState extends State {
Permission.bluetoothScan,
Permission.activityRecognition,
].request().whenComplete(() {
- PenguinMethodChannel.launch("penguin", widget.projectViewModel!.isArabic ? "ar" : "en", widget.projectViewModel!.authenticatedUserObject.user.patientID.toString(), details: data);
+ PenguinMethodChannel().launch("penguin", widget.projectViewModel!.isArabic ? "ar" : "en", widget.projectViewModel!.authenticatedUserObject.user.patientID.toString(), details: data);
});
}
}
diff --git a/lib/pages/ToDoList/ToDo.dart b/lib/pages/ToDoList/ToDo.dart
index 6ab67f12..c225987c 100644
--- a/lib/pages/ToDoList/ToDo.dart
+++ b/lib/pages/ToDoList/ToDo.dart
@@ -576,7 +576,7 @@ class _ToDoState extends State with SingleTickerProviderStateMixin {
Permission.bluetoothScan,
Permission.activityRecognition,
].request().whenComplete(() {
- PenguinMethodChannel.launch("penguin", projectViewModel.isArabic ? "ar" : "en", projectViewModel.authenticatedUserObject.user.patientID.toString(), details: data);
+ PenguinMethodChannel().launch("penguin", projectViewModel.isArabic ? "ar" : "en", projectViewModel.authenticatedUserObject.user.patientID.toString(), details: data);
});
}
}
diff --git a/lib/pages/landing/home_page_2.dart b/lib/pages/landing/home_page_2.dart
index 9b52958b..af02e200 100644
--- a/lib/pages/landing/home_page_2.dart
+++ b/lib/pages/landing/home_page_2.dart
@@ -33,6 +33,11 @@ class _HomePageState2 extends State {
PharmacyModuleViewModel pharmacyModuleViewModel = locator();
late ProjectViewModel projectViewModel;
+ @override
+ void initState() {
+ super.initState();
+ }
+
@override
Widget build(BuildContext context) {
projectViewModel = Provider.of(context);
diff --git a/lib/pages/landing/widgets/services_view.dart b/lib/pages/landing/widgets/services_view.dart
index e98855aa..5acee08f 100644
--- a/lib/pages/landing/widgets/services_view.dart
+++ b/lib/pages/landing/widgets/services_view.dart
@@ -216,7 +216,7 @@ class ServicesView extends StatelessWidget {
Permission.bluetoothScan,
Permission.activityRecognition,
].request().whenComplete(() {
- PenguinMethodChannel.launch("penguin", projectViewModel.isArabic ? "ar" : "en", projectViewModel.authenticatedUserObject.user.patientID.toString());
+ PenguinMethodChannel().launch("penguin", projectViewModel.isArabic ? "ar" : "en", projectViewModel.authenticatedUserObject.user.patientID.toString());
});
} //
}
diff --git a/lib/pages/login/confirm-login.dart b/lib/pages/login/confirm-login.dart
index e4a55d25..dafbe327 100644
--- a/lib/pages/login/confirm-login.dart
+++ b/lib/pages/login/confirm-login.dart
@@ -19,6 +19,7 @@ import 'package:diplomaticquarterapp/models/InPatientServices/get_admission_requ
import 'package:diplomaticquarterapp/pages/landing/landing_page.dart';
import 'package:diplomaticquarterapp/pages/login/login.dart';
import 'package:diplomaticquarterapp/pages/login/register_new.dart';
+import 'package:diplomaticquarterapp/pages/login/user-login-agreement-page.dart';
import 'package:diplomaticquarterapp/pages/rateAppointment/rate_appointment_doctor.dart';
import 'package:diplomaticquarterapp/routes.dart';
import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart';
@@ -48,11 +49,7 @@ class ConfirmLogin extends StatefulWidget {
final fromRegistration;
final bool isDubai;
- const ConfirmLogin({Key? key,
- this.changePageViewIndex,
- this.fromRegistration = false,
- this.isDubai = false})
- : super(key: key);
+ const ConfirmLogin({Key? key, this.changePageViewIndex, this.fromRegistration = false, this.isDubai = false}) : super(key: key);
@override
_ConfirmLogin createState() => _ConfirmLogin();
@@ -64,8 +61,7 @@ class _ConfirmLogin extends State {
var sharedPref = AppSharedPreferences();
bool authenticated = false;
final authService = AuthProvider();
- PharmacyModuleViewModel pharmacyModuleViewModel =
- locator();
+ PharmacyModuleViewModel pharmacyModuleViewModel = locator();
late int mobileNumber;
String errorMsg = '';
SelectDeviceIMEIRES? user;
@@ -95,10 +91,8 @@ class _ConfirmLogin extends State {
int fingrePrintBefore = 0;
- AuthenticatedUserObject authenticatedUserObject =
- locator();
- AppointmentRateViewModel appointmentRateViewModel =
- locator();
+ AuthenticatedUserObject authenticatedUserObject = locator();
+ AppointmentRateViewModel appointmentRateViewModel = locator();
late ProjectViewModel projectViewModel;
late ToDoCountProviderModel toDoProvider;
@@ -145,35 +139,17 @@ class _ConfirmLogin extends State {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
- TranslationBase
- .of(context)
- .welcomeBack,
- style: TextStyle(
- fontSize: 12,
- fontWeight: FontWeight.w600,
- color: Color(0xff2B353E),
- letterSpacing: -0.64),
+ TranslationBase.of(context).welcomeBack,
+ style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.64),
),
Text(
user!.name!.toLowerCase().capitalizeFirstofEach,
- style: TextStyle(
- fontSize: 24,
- fontWeight: FontWeight.w700,
- color: Color(0xff2B353E),
- height: 1,
- letterSpacing: -1.44),
+ style: TextStyle(fontSize: 24, fontWeight: FontWeight.w700, color: Color(0xff2B353E), height: 1, letterSpacing: -1.44),
),
SizedBox(height: 10),
Text(
- TranslationBase
- .of(context)
- .accountInfo,
- style: TextStyle(
- fontSize: 16,
- fontWeight: FontWeight.w600,
- color: Color(0xff2B353E),
- letterSpacing: -0.64,
- height: 25 / 16),
+ TranslationBase.of(context).accountInfo,
+ style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.64, height: 25 / 16),
),
Container(
height: 72,
@@ -192,48 +168,28 @@ class _ConfirmLogin extends State {
mainAxisSize: MainAxisSize.min,
children: [
Row(
- mainAxisAlignment:
- MainAxisAlignment.spaceBetween,
+ mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Text(
- TranslationBase
- .of(context)
- .lastLoginAt
- .toCamelCase,
- style: TextStyle(
- fontSize: 16,
- fontWeight: FontWeight.w600,
- color: Color(0xff2B353E),
- letterSpacing: -0.64),
+ TranslationBase.of(context).lastLoginAt.toCamelCase,
+ style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.64),
),
Text(
// user!.editedOn != null
// ? DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(user!.editedOn!))
// :
- user!.createdOn != null
- ? DateUtil.getDayMonthYearDateFormatted(
- DateUtil.convertStringToDate(
- user!.createdOn!))
- : '--',
- style: TextStyle(
- fontSize: 12,
- fontWeight: FontWeight.w600,
- color: Color(0xff2B353E),
- letterSpacing: -0.48),
+ user!.createdOn != null ? DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(user!.createdOn!)) : '--',
+ style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48),
),
],
),
Row(
- mainAxisAlignment:
- MainAxisAlignment.spaceBetween,
+ mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Text(
- TranslationBase
- .of(context)
- .lastLoginWith
- .toCamelCase,
+ TranslationBase.of(context).lastLoginWith.toCamelCase,
style: TextStyle(
fontSize: 10,
fontWeight: FontWeight.w600,
@@ -256,17 +212,8 @@ class _ConfirmLogin extends State {
// user!.editedOn!),
// false)
// :
- user!.createdOn != null
- ? DateUtil.formatDateToTimeLang(
- DateUtil.convertStringToDate(
- user!.createdOn!),
- false)
- : '--',
- style: TextStyle(
- fontSize: 12,
- fontWeight: FontWeight.w600,
- color: Color(0xff575757),
- letterSpacing: -0.48),
+ user!.createdOn != null ? DateUtil.formatDateToTimeLang(DateUtil.convertStringToDate(user!.createdOn!), false) : '--',
+ style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff575757), letterSpacing: -0.48),
),
],
)
@@ -274,21 +221,11 @@ class _ConfirmLogin extends State {
),
),
Text(
- TranslationBase
- .of(context)
- .pleaseVerify,
- style: TextStyle(
- fontSize: 16,
- fontWeight: FontWeight.w600,
- color: Color(0xff2E303A),
- letterSpacing: -0.64),
+ TranslationBase.of(context).pleaseVerify,
+ style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64),
),
GridView(
- gridDelegate:
- SliverGridDelegateWithFixedCrossAxisCount(
- crossAxisCount: 2,
- crossAxisSpacing: 13,
- mainAxisSpacing: 9),
+ gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 2, crossAxisSpacing: 13, mainAxisSpacing: 9),
physics: NeverScrollableScrollPhysics(),
padding: EdgeInsets.only(top: 9),
shrinkWrap: true,
@@ -302,67 +239,40 @@ class _ConfirmLogin extends State {
],
)
else
- Column(
- mainAxisAlignment: MainAxisAlignment.start,
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- Image.asset(
- 'assets/images/habib-logo.png',
- height: 90,
- width: 90,
- ),
- SizedBox(height: 23),
- this.onlySMSBox == false
- ? Text(
- TranslationBase
- .of(context)
- .verifyLoginWith,
- style: TextStyle(
- fontSize: 16,
- fontWeight: FontWeight.w600,
- color: Color(0xff2B353E),
- letterSpacing: -0.64,
- height: 25 / 16),
- )
- : Text(
- TranslationBase
- .of(context)
- .verifyFingerprint2,
- style: TextStyle(
- fontSize: 16,
- fontWeight: FontWeight.w600,
- color: Color(0xff2B353E),
- letterSpacing: -0.64,
- height: 25 / 16),
- ),
- SizedBox(height: 23),
- Text(
- TranslationBase
- .of(context)
- .pleaseVerify,
- style: TextStyle(
- fontSize: 16,
- fontWeight: FontWeight.w600,
- color: Color(0xff2E303A),
- letterSpacing: -0.64),
- ),
- GridView(
- gridDelegate:
- SliverGridDelegateWithFixedCrossAxisCount(
- crossAxisCount: 2,
- crossAxisSpacing: 13,
- mainAxisSpacing: 9),
- physics: NeverScrollableScrollPhysics(),
- padding: EdgeInsets.only(top: 9),
- shrinkWrap: true,
- children: [
- if (onlySMSBox == false) getButton(3),
- if (onlySMSBox == false) getButton(2),
- getButton(1),
- getButton(4),
- ],
- ),
- ]),
+ Column(mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start, children: [
+ Image.asset(
+ 'assets/images/habib-logo.png',
+ height: 90,
+ width: 90,
+ ),
+ SizedBox(height: 23),
+ this.onlySMSBox == false
+ ? Text(
+ TranslationBase.of(context).verifyLoginWith,
+ style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.64, height: 25 / 16),
+ )
+ : Text(
+ TranslationBase.of(context).verifyFingerprint2,
+ style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.64, height: 25 / 16),
+ ),
+ SizedBox(height: 23),
+ Text(
+ TranslationBase.of(context).pleaseVerify,
+ style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64),
+ ),
+ GridView(
+ gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 2, crossAxisSpacing: 13, mainAxisSpacing: 9),
+ physics: NeverScrollableScrollPhysics(),
+ padding: EdgeInsets.only(top: 9),
+ shrinkWrap: true,
+ children: [
+ if (onlySMSBox == false) getButton(3),
+ if (onlySMSBox == false) getButton(2),
+ getButton(1),
+ getButton(4),
+ ],
+ ),
+ ]),
],
),
),
@@ -370,13 +280,10 @@ class _ConfirmLogin extends State {
height: 12,
),
DefaultButton(
- TranslationBase
- .of(context)
- .useAnotherAccount,
- () {
+ TranslationBase.of(context).useAnotherAccount,
+ () {
Navigator.of(context).pushNamed(LOGIN_TYPE);
- projectViewModel.analytics.loginRegistration
- .login_with_other_account();
+ projectViewModel.analytics.loginRegistration.login_with_other_account();
},
),
],
@@ -387,8 +294,7 @@ class _ConfirmLogin extends State {
Future _getAvailableBiometrics() async {
final bool canAuthenticateWithBiometrics = await auth.canCheckBiometrics;
- final bool canAuthenticate =
- canAuthenticateWithBiometrics || await auth.isDeviceSupported();
+ final bool canAuthenticate = canAuthenticateWithBiometrics || await auth.isDeviceSupported();
var availableBiometrics;
try {
@@ -417,8 +323,7 @@ class _ConfirmLogin extends State {
login_method = type;
LoginRegistration.verificationMethod = type;
// if(!widget.fromRegistration)
- projectViewModel.analytics.loginRegistration
- .login_verfication(forRegistration: widget.fromRegistration);
+ projectViewModel.analytics.loginRegistration.login_verfication(forRegistration: widget.fromRegistration);
switch (type) {
case 1:
@@ -436,8 +341,7 @@ class _ConfirmLogin extends State {
default:
break;
}
- sharedPref.setInt(LAST_LOGIN,
- this.selectedOption); //this.cs.sharedService.setStorage(this.selectedOption, AuthenticationService.LAST_LOGIN);
+ sharedPref.setInt(LAST_LOGIN, this.selectedOption); //this.cs.sharedService.setStorage(this.selectedOption, AuthenticationService.LAST_LOGIN);
}
loginWithSMS(type) {
@@ -465,23 +369,22 @@ class _ConfirmLogin extends State {
sharedPref.setObject(REGISTER_DATA_FOR_REGISTER, request);
authService
.checkPatientAuthentication(request)
- .then((value) =>
- {
- GifLoaderDialogUtils.hideDialog(context),
- if (value['isSMSSent'])
- {
- sharedPref.setString(LOGIN_TOKEN_ID, value['LogInTokenID']),
- this.loginTokenID = value['LogInTokenID'],
- sharedPref.setObject(REGISTER_DATA_FOR_LOGIIN, request),
- // Future.delayed(Duration(seconds: 1), () {
- this.sendActivationCode(type)
- // })
- }
- else
- {
- if (value['IsAuthenticated']) {this.checkActivationCode()}
- }
- })
+ .then((value) => {
+ GifLoaderDialogUtils.hideDialog(context),
+ if (value['isSMSSent'])
+ {
+ sharedPref.setString(LOGIN_TOKEN_ID, value['LogInTokenID']),
+ this.loginTokenID = value['LogInTokenID'],
+ sharedPref.setObject(REGISTER_DATA_FOR_LOGIIN, request),
+ // Future.delayed(Duration(seconds: 1), () {
+ this.sendActivationCode(type)
+ // })
+ }
+ else
+ {
+ if (value['IsAuthenticated']) {this.checkActivationCode()}
+ }
+ })
.catchError((err) {
print(err);
GifLoaderDialogUtils.hideDialog(context);
@@ -494,8 +397,7 @@ class _ConfirmLogin extends State {
GifLoaderDialogUtils.showMyDialog(context);
if (healthId != null || widget.isDubai) {
if (!widget.isDubai) {
- request.dob =
- dob; //isHijri == 1 ? dob : dateFormat2.format(dateFormat.parse(dob));
+ request.dob = dob; //isHijri == 1 ? dob : dateFormat2.format(dateFormat.parse(dob));
}
request.healthId = healthId;
request.isHijri = isHijri;
@@ -532,11 +434,10 @@ class _ConfirmLogin extends State {
context,
type,
this.mobileNumber,
- (value) {
+ (value) {
this.checkActivationCode(value: value);
},
- () =>
- {
+ () => {
Navigator.pop(context),
},
).displayDialog(context);
@@ -612,28 +513,23 @@ class _ConfirmLogin extends State {
setDefault() async {
showLoader(true);
- if (await sharedPref.getObject(IMEI_USER_DATA) != null)
- user = SelectDeviceIMEIRES.fromJson(
- await sharedPref.getObject(IMEI_USER_DATA));
+ if (await sharedPref.getObject(IMEI_USER_DATA) != null) user = SelectDeviceIMEIRES.fromJson(await sharedPref.getObject(IMEI_USER_DATA));
if (await sharedPref.getObject(REGISTER_DATA_FOR_LOGIIN) != null) {
isMoreOption = true;
- this.registerd_data = await CheckPatientAuthenticationReq.fromJson(
- await sharedPref.getObject(REGISTER_DATA_FOR_LOGIIN));
+ this.registerd_data = await CheckPatientAuthenticationReq.fromJson(await sharedPref.getObject(REGISTER_DATA_FOR_LOGIIN));
}
- this.mobileNumber = this.registerd_data != null
- ? this.registerd_data.patientMobileNumber
- : int.parse(this.user!.mobile!);
+ this.mobileNumber = this.registerd_data != null ? this.registerd_data.patientMobileNumber : int.parse(this.user!.mobile!);
this.zipCode = this.registerd_data != null
? this.registerd_data.zipCode
: this.user!.outSA == true
- ? "971"
- : "966";
+ ? "971"
+ : "966";
this.patientOutSA = this.registerd_data != null
? this.registerd_data.zipCode == "966"
- ? 0
- : 1
+ ? 0
+ : 1
: this.user!.outSA;
if (this.registerd_data != null) {
this.loginTokenID = await sharedPref.getString(LOGIN_TOKEN_ID);
@@ -643,9 +539,7 @@ class _ConfirmLogin extends State {
if (nhic != null) {
final DateFormat dateFormat = DateFormat('MM/dd/yyyy');
final DateFormat dateFormat2 = DateFormat('dd/MM/yyyy');
- dob = nhic['IsHijri']
- ? nhic['DateOfBirth']
- : dateFormat2.format(dateFormat.parse(nhic['DateOfBirth']));
+ dob = nhic['IsHijri'] ? nhic['DateOfBirth'] : dateFormat2.format(dateFormat.parse(nhic['DateOfBirth']));
isHijri = nhic['IsHijri'] ? 1 : 0;
healthId = nhic['HealthId'];
@@ -654,8 +548,8 @@ class _ConfirmLogin extends State {
this.lastLogin = await sharedPref.getInt(LAST_LOGIN) != null
? await sharedPref.getInt(LAST_LOGIN)
: user != null
- ? user!.logInType
- : null;
+ ? user!.logInType
+ : null;
showLoader(false);
//this.cs.sharedService.getStorage(AuthenticationService.LAST_LOGIN);
@@ -668,34 +562,22 @@ class _ConfirmLogin extends State {
request.deviceToken = this.deviceToken;
request.projectOutSA = this.patientOutSA == true ? true : false;
request.loginType = this.selectedOption;
- request.oTPSendType =
- type == 1 ? type : 2; //this.selectedOption == 1 ? 1 : 2;
+ request.oTPSendType = type == 1 ? type : 2; //this.selectedOption == 1 ? 1 : 2;
request.zipCode = this.zipCode;
request.logInTokenID = this.loginTokenID ?? "";
if (this.registerd_data != null) {
- 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.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;
- request.patientID =
- this.user!.patientID != null ? this.user!.patientID : 0;
- request.nationalID =
- request.nationalID != null ? request.nationalID : '0';
- request.patientIdentificationID = request.patientIdentificationID != null
- ? request.patientIdentificationID
- : '0';
+ request.patientID = this.user!.patientID != null ? this.user!.patientID : 0;
+ request.nationalID = request.nationalID != null ? request.nationalID : '0';
+ request.patientIdentificationID = request.patientIdentificationID != null ? request.patientIdentificationID : '0';
request.isRegister = false;
}
request.deviceTypeID = request.searchType;
@@ -716,40 +598,31 @@ class _ConfirmLogin extends State {
authService
.checkActivationCodeRegister(request, value)
- .then((result) =>
- {
- res = result,
- if (result is Map)
- {
- result = CheckActivationCode.fromJson(
- result as Map),
- if (this.registerd_data != null &&
- this.registerd_data.isRegister == true)
- {
- // if(widget.isDubai ==false){
- widget.changePageViewIndex!(1),
- // if(widget.isDubai ==false){
-
- Navigator.popUntil(
- context,
- (route) =>
- Utils.route(route, equalsTo: RegisterNew)),
- }
- }
- else
- {
- // Navigator.of(context).pop(),
- GifLoaderDialogUtils.hideDialog(context),
- Future.delayed(Duration(seconds: 1), () {
- AppToast.showErrorToast(message: result);
- }),
- projectViewModel.analytics.loginRegistration
- .login_fail(error: result),
- projectViewModel.analytics.errorTracking.log(
- 'otp_verification_at_confirm_login',
- error: result),
- }
- })
+ .then((result) => {
+ res = result,
+ if (result is Map)
+ {
+ result = CheckActivationCode.fromJson(result as Map),
+ if (this.registerd_data != null && this.registerd_data.isRegister == true)
+ {
+ // if(widget.isDubai ==false){
+ widget.changePageViewIndex!(1),
+ // if(widget.isDubai ==false){
+
+ Navigator.popUntil(context, (route) => Utils.route(route, equalsTo: RegisterNew)),
+ }
+ }
+ else
+ {
+ // Navigator.of(context).pop(),
+ GifLoaderDialogUtils.hideDialog(context),
+ Future.delayed(Duration(seconds: 1), () {
+ AppToast.showErrorToast(message: result);
+ }),
+ projectViewModel.analytics.loginRegistration.login_fail(error: result),
+ projectViewModel.analytics.errorTracking.log('otp_verification_at_confirm_login', error: result),
+ }
+ })
.catchError((err) {
print(err);
GifLoaderDialogUtils.hideDialog(context);
@@ -762,62 +635,56 @@ class _ConfirmLogin extends State {
authService
.checkActivationCode(request, value)
.then((result) => {
- res = result,
- if (result is Map)
- {
- result = CheckActivationCode.fromJson(result as Map),
- if(result.errorCode =='699'){
- //699 block run here
- GifLoaderDialogUtils.hideDialog(context),
- Future.delayed(Duration(seconds: 2), () {
- AppToast.showErrorToast(message: result.errorEndUserMessage);
- Navigator.popUntil(context, (route) => Utils.route(route, equalsTo: Login));
+ res = result,
+ if (result is Map)
+ {
+ result = CheckActivationCode.fromJson(result as Map),
+ if (result.errorCode == '699')
+ {
+ //699 block run here
+ GifLoaderDialogUtils.hideDialog(context),
+ Future.delayed(Duration(seconds: 2), () {
+ AppToast.showErrorToast(message: result.errorEndUserMessage);
+ Navigator.popUntil(context, (route) => Utils.route(route, equalsTo: Login));
+ })
+ }
+ else if (this.registerd_data != null && this.registerd_data.isRegister == true)
+ {
+ widget.changePageViewIndex!(1),
+ Navigator.popUntil(context, (route) => Utils.route(route, equalsTo: RegisterNew)),
+ }
+ else
+ {
+ sharedPref.remove(FAMILY_FILE),
+ result.list.isFamily = false,
+ userData = result.list,
+ sharedPref.setString(BLOOD_TYPE, result.patientBloodType ?? ""),
+ //Remove o+ from here Added by Aamir
+ authenticatedUserObject.user = result.list,
+ projectViewModel.setPrivilege(privilegeList: res),
+ sharedPref.setObject(MAIN_USER, result.list),
+ sharedPref.setObject(USER_PROFILE, result.list),
+ loginTokenID = result.logInTokenID,
+ sharedPref.setObject(LOGIN_TOKEN_ID, result.logInTokenID),
+ sharedPref.setString(TOKEN, result.authenticationTokenID),
+ checkIfUserAgreedBefore(result),
+ projectViewModel.analytics.loginRegistration.login_successful(),
+ }
+ }
+ else
+ {
+ // Navigator.of(context).pop(),
+ GifLoaderDialogUtils.hideDialog(context),
+ Future.delayed(Duration(seconds: 1), () {
+ Navigator.of(context).pop();
+ AppToast.showErrorToast(message: result, localContext: context);
+ startSMSService(tempType);
+ }),
+
+ projectViewModel.analytics.loginRegistration.login_fail(error: result),
+ projectViewModel.analytics.errorTracking.log('otp_verification_at_confirm_login', error: result)
+ }
})
- }
- else if (this.registerd_data != null &&
- this.registerd_data.isRegister == true)
- {
- widget.changePageViewIndex!(1),
- Navigator.popUntil(
- context,
- (route) =>
- Utils.route(route, equalsTo: RegisterNew)),
- }
- else
- {
- sharedPref.remove(FAMILY_FILE),
- result.list.isFamily = false,
- userData = result.list,
- sharedPref.setString(BLOOD_TYPE, result.patientBloodType ?? ""),
- //Remove o+ from here Added by Aamir
- authenticatedUserObject.user = result.list,
- projectViewModel.setPrivilege(privilegeList: res),
- sharedPref.setObject(MAIN_USER, result.list),
- sharedPref.setObject(USER_PROFILE, result.list),
- loginTokenID = result.logInTokenID,
- sharedPref.setObject(LOGIN_TOKEN_ID, result.logInTokenID),
- sharedPref.setString(TOKEN, result.authenticationTokenID),
- checkIfUserAgreedBefore(result),
- projectViewModel.analytics.loginRegistration.login_successful(),
-
- }
- }
- else
- {
- // Navigator.of(context).pop(),
- GifLoaderDialogUtils.hideDialog(context),
- Future.delayed(Duration(seconds: 1), () {
- Navigator.of(context).pop();
- AppToast.showErrorToast(message: result, localContext: context);
- startSMSService(tempType);
- }),
-
- projectViewModel.analytics.loginRegistration
- .login_fail(error: result),
- projectViewModel.analytics.errorTracking
- .log('otp_verification_at_confirm_login', error: result)
- }
- })
.catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
Future.delayed(Duration(seconds: 1), () {
@@ -830,10 +697,37 @@ class _ConfirmLogin extends State {
}
checkIfUserAgreedBefore(CheckActivationCode result) {
+ this.authService.checkIfUserAgreed().then((result) {
+ if (result['IsPatientAlreadyAgreed']) {
+ goToHome();
+ } else {
+ this.authService.getUserAgreementContent().then((result) {
+ GifLoaderDialogUtils.hideDialog(AppGlobal.context);
+ Navigator.pushAndRemoveUntil(
+ context,
+ FadePage(
+ page: UserLoginAgreementPage(
+ userAgreementText: result['UserAgreementContent'],
+ authenticatedUserObject: authenticatedUserObject,
+ appointmentRateViewModel: appointmentRateViewModel,
+ selectedOption: selectedOption,
+ ),
+ ),
+ (r) => false);
+ }).catchError((err) {
+ GifLoaderDialogUtils.hideDialog(context);
+ print(err);
+ });
+ }
+ }).catchError((err) {
+ GifLoaderDialogUtils.hideDialog(context);
+ print(err);
+ });
+
// if (result.isNeedUserAgreement == true) {
//move to agreement page.
// } else {
- goToHome();
+ // goToHome();
// }
}
@@ -851,25 +745,17 @@ class _ConfirmLogin extends State {
print("Has Admission Request: $hasAdmissionRequest");
if (isAdmitted) {
if (res['PatientAdmittedInformation'].length != 0) {
- getAdmissionInfoResponseModel =
- GetAdmissionInfoResponseModel.fromJson(
- res['PatientAdmittedInformation'][0]);
- projectViewModel.setInPatientProjectID(
- res['PatientAdmittedInformation'][0]['ProjectID']);
- projectViewModel
- .setInPatientAdmissionInfo(getAdmissionInfoResponseModel);
+ getAdmissionInfoResponseModel = GetAdmissionInfoResponseModel.fromJson(res['PatientAdmittedInformation'][0]);
+ projectViewModel.setInPatientProjectID(res['PatientAdmittedInformation'][0]['ProjectID']);
+ projectViewModel.setInPatientAdmissionInfo(getAdmissionInfoResponseModel);
projectViewModel.setIsPatientAdmitted(true);
}
}
if (hasAdmissionRequest) {
if (res['MedicalInstruction'].length != 0) {
- getAdmissionRequestInfoResponseModel =
- GetAdmissionRequestInfoResponseModel.fromJson(
- res['MedicalInstruction'][0]);
- projectViewModel.setInPatientProjectID(
- res['MedicalInstruction'][0]['ProjectID']);
- projectViewModel.setInPatientAdmissionRequest(
- getAdmissionRequestInfoResponseModel);
+ getAdmissionRequestInfoResponseModel = GetAdmissionRequestInfoResponseModel.fromJson(res['MedicalInstruction'][0]);
+ projectViewModel.setInPatientProjectID(res['MedicalInstruction'][0]['ProjectID']);
+ projectViewModel.setInPatientAdmissionRequest(getAdmissionRequestInfoResponseModel);
projectViewModel.setPatientHasAdmissionRequest(true);
}
}
@@ -878,10 +764,7 @@ class _ConfirmLogin extends State {
}
insertIMEI() {
- authService
- .insertDeviceImei(selectedOption)
- .then((value) => {})
- .catchError((err) {
+ authService.insertDeviceImei(selectedOption).then((value) => {}).catchError((err) {
print(err);
});
}
@@ -891,8 +774,7 @@ class _ConfirmLogin extends State {
ClinicListService service = new ClinicListService();
service.getActiveAppointmentNo(context).then((res) {
if (res['MessageStatus'] == 1) {
- toDoProvider.setState(res['AppointmentActiveNumber'],
- res['AncillaryOrderListCount'], true, "0");
+ toDoProvider.setState(res['AppointmentActiveNumber'], res['AncillaryOrderListCount'], true, "0");
// toDoProvider.setState(res['AppointmentActiveNumber'], true, "0");
} else {}
}).catchError((err) {
@@ -911,42 +793,31 @@ class _ConfirmLogin extends State {
getToDoCount();
appointmentRateViewModel
.getIsLastAppointmentRatedList(projectViewModel.isArabic ? 1 : 2)
- .then((value) =>
- {
- GifLoaderDialogUtils.hideDialog(AppGlobal.context),
- if (appointmentRateViewModel.isHaveAppointmentNotRate)
- {
- Navigator.pushAndRemoveUntil(
- context,
- FadePage(
- page: RateAppointmentDoctor(),
- ),
- (r) => false)
- }
- else
- {
- Navigator.pushAndRemoveUntil(
- context,
- FadePage(
- page: LandingPage(),
- ),
- (r) => false)
- },
- insertIMEI()
- })
+ .then((value) => {
+ GifLoaderDialogUtils.hideDialog(AppGlobal.context),
+ if (appointmentRateViewModel.isHaveAppointmentNotRate)
+ {
+ Navigator.pushAndRemoveUntil(
+ context,
+ FadePage(
+ page: RateAppointmentDoctor(),
+ ),
+ (r) => false)
+ }
+ else
+ {
+ Navigator.pushAndRemoveUntil(
+ context,
+ FadePage(
+ page: LandingPage(),
+ ),
+ (r) => false)
+ },
+ insertIMEI()
+ })
.catchError((err) {
print(err);
});
-
- // getToDoCount();
-
- // Navigator.pushAndRemoveUntil(
- // context,
- // FadePage(
- // page: LandingPage(),
- // ),
- // (r) => false);
- // insertIMEI();
}
loading(flag) {
@@ -956,26 +827,21 @@ class _ConfirmLogin extends State {
}
Widget _loginOptionButton(String _title, String _icon, int _flag, int? _loginIndex) {
- bool isDisable =
- (_flag == 3 && !checkIfBiometricAvailable(BiometricType.face) ||
- _flag == 2 &&
- !checkIfBiometricAvailable(BiometricType.fingerprint) &&
- _flag == 2 &&
- !checkIfBiometricAvailable(BiometricType.strong));
+ bool isDisable = (_flag == 3 && !checkIfBiometricAvailable(BiometricType.face) ||
+ _flag == 2 && !checkIfBiometricAvailable(BiometricType.fingerprint) && _flag == 2 && !checkIfBiometricAvailable(BiometricType.strong));
return InkWell(
onTap: isDisable
? null
: () {
- if (_flag == 0) {
- setState(() {
- isMoreOption = true;
- });
- } else {
- authenticateUser(_flag, isActive: _loginIndex);
- projectViewModel.analytics.loginRegistration.verify_otp_method(
- forRegistration: widget.fromRegistration);
- }
- },
+ if (_flag == 0) {
+ setState(() {
+ isMoreOption = true;
+ });
+ } else {
+ authenticateUser(_flag, isActive: _loginIndex);
+ projectViewModel.analytics.loginRegistration.verify_otp_method(forRegistration: widget.fromRegistration);
+ }
+ },
child: Container(
padding: EdgeInsets.only(left: 20, right: 20, bottom: 15, top: 28),
decoration: BoxDecoration(
@@ -997,17 +863,8 @@ class _ConfirmLogin extends State {
color: isDisable ? Color(0xff2B353E).withOpacity(0.7) : null,
),
Text(
- TranslationBase
- .of(context)
- .verifyThrough + " " + _title,
- style: TextStyle(
- fontSize: 16,
- fontWeight: FontWeight.w600,
- color: isDisable
- ? Color(0xff2B353E).withOpacity(0.7)
- : Color(0xff2B353E),
- letterSpacing: -0.48,
- height: 20 / 16),
+ TranslationBase.of(context).verifyThrough + " " + _title,
+ style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: isDisable ? Color(0xff2B353E).withOpacity(0.7) : Color(0xff2B353E), letterSpacing: -0.48, height: 20 / 16),
),
],
),
@@ -1019,49 +876,28 @@ class _ConfirmLogin extends State {
Widget getButton(int flag) {
switch (flag) {
case 4:
- return _loginOptionButton(TranslationBase
- .of(context)
- .verifyWhatsApp,
- 'assets/images/new/verify_whatsapp.svg', flag, null);
+ return _loginOptionButton(TranslationBase.of(context).verifyWhatsApp, 'assets/images/new/verify_whatsapp.svg', flag, null);
break;
case 1:
- return _loginOptionButton(TranslationBase
- .of(context)
- .verifySMS,
- 'assets/images/new/verify_sms.svg', flag, null);
+ return _loginOptionButton(TranslationBase.of(context).verifySMS, 'assets/images/new/verify_sms.svg', flag, null);
break;
case 2:
- return _loginOptionButton(
- TranslationBase
- .of(context)
- .verifyFingerprint,
- 'assets/images/new/verify_thumb.svg',
- flag,
- BiometricType.fingerprint.index);
+ return _loginOptionButton(TranslationBase.of(context).verifyFingerprint, 'assets/images/new/verify_thumb.svg', flag, BiometricType.fingerprint.index);
break;
case 3:
- return _loginOptionButton(
- TranslationBase
- .of(context)
- .verifyFaceID,
- 'assets/images/new/verify_face.svg',
- flag,
- BiometricType.face.index);
+ return _loginOptionButton(TranslationBase.of(context).verifyFaceID, 'assets/images/new/verify_face.svg', flag, BiometricType.face.index);
break;
default:
return InkWell(
- onTap: () =>
- {
+ onTap: () => {
setState(() {
isMoreOption = true;
})
},
child: RoundedContainer(
height: 150,
- backgroundColor: BiometricType.fingerprint.index == 1
- ? Colors.white
- : Colors.white.withOpacity(.7),
+ backgroundColor: BiometricType.fingerprint.index == 1 ? Colors.white : Colors.white.withOpacity(.7),
borderColor: Colors.grey,
showBorder: true,
child: Padding(
@@ -1075,17 +911,12 @@ class _ConfirmLogin extends State {
),
projectViewModel.isArabic
? SizedBox(
- height: 15,
- )
+ height: 15,
+ )
: SizedBox(
- height: 20,
- ),
- Texts(TranslationBase
- .of(context)
- .moreVerification,
- fontSize: SizeConfig.textMultiplier! * 1.8,
- textAlign: TextAlign.center,
- color: Colors.black)
+ height: 20,
+ ),
+ Texts(TranslationBase.of(context).moreVerification, fontSize: SizeConfig.textMultiplier! * 1.8, textAlign: TextAlign.center, color: Colors.black)
],
),
),
@@ -1097,29 +928,19 @@ class _ConfirmLogin extends State {
getType(type, context) {
switch (type) {
case 1:
- return TranslationBase
- .of(context)
- .verifySMS;
+ return TranslationBase.of(context).verifySMS;
break;
case 2:
- return TranslationBase
- .of(context)
- .verifyFingerprint;
+ return TranslationBase.of(context).verifyFingerprint;
break;
case 3:
- return TranslationBase
- .of(context)
- .verifyFaceID;
+ return TranslationBase.of(context).verifyFaceID;
break;
case 4:
- return TranslationBase
- .of(context)
- .verifyWhatsApp;
+ return TranslationBase.of(context).verifyWhatsApp;
break;
default:
- return TranslationBase
- .of(context)
- .verifySMS;
+ return TranslationBase.of(context).verifySMS;
break;
}
}
diff --git a/lib/pages/login/user-login-agreement-page.dart b/lib/pages/login/user-login-agreement-page.dart
new file mode 100644
index 00000000..f01a0c96
--- /dev/null
+++ b/lib/pages/login/user-login-agreement-page.dart
@@ -0,0 +1,215 @@
+import 'package:diplomaticquarterapp/core/service/AuthenticatedUserObject.dart';
+import 'package:diplomaticquarterapp/core/viewModels/TermsConditionsViewModel.dart';
+import 'package:diplomaticquarterapp/core/viewModels/appointment_rate_view_model.dart';
+import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
+import 'package:diplomaticquarterapp/models/Appointments/toDoCountProviderModel.dart';
+import 'package:diplomaticquarterapp/pages/base/base_view.dart';
+import 'package:diplomaticquarterapp/pages/landing/landing_page.dart';
+import 'package:diplomaticquarterapp/pages/rateAppointment/rate_appointment_doctor.dart';
+import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart';
+import 'package:diplomaticquarterapp/services/clinic_services/get_clinic_service.dart';
+import 'package:diplomaticquarterapp/theme/colors.dart';
+import 'package:diplomaticquarterapp/uitl/app_toast.dart';
+import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
+import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
+import 'package:diplomaticquarterapp/uitl/utils_new.dart';
+import 'package:diplomaticquarterapp/widgets/buttons/custom_text_button.dart';
+import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
+import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
+import 'package:flutter/cupertino.dart';
+import 'package:flutter/material.dart';
+import 'package:flutter_html/flutter_html.dart';
+import 'package:provider/provider.dart';
+
+class UserLoginAgreementPage extends StatefulWidget {
+ final String userAgreementText;
+ final AuthenticatedUserObject authenticatedUserObject;
+ final AppointmentRateViewModel appointmentRateViewModel;
+ final int selectedOption;
+
+ UserLoginAgreementPage({required this.userAgreementText, required this.authenticatedUserObject, required this.appointmentRateViewModel, required this.selectedOption});
+
+ @override
+ State createState() => _UserLoginAgreementPageState();
+}
+
+class _UserLoginAgreementPageState extends State {
+ late ProjectViewModel projectViewModel;
+ late ToDoCountProviderModel toDoProvider;
+ final authService = AuthProvider();
+
+ @override
+ Widget build(BuildContext context) {
+ projectViewModel = Provider.of(context);
+ toDoProvider = Provider.of(context);
+ return BaseView(
+ builder: (_, model, w) => AppScaffold(
+ isShowAppBar: true,
+ showNewAppBarTitle: true,
+ showNewAppBar: true,
+ isShowDecPage: false,
+ appBarTitle: TranslationBase.of(context).userAgreement,
+ body: Padding(
+ padding: const EdgeInsets.all(8.0),
+ child: SingleChildScrollView(
+ child: Html(
+ data: widget.userAgreementText,
+ ),
+ ),
+ ),
+ bottomSheet: Container(
+ decoration: BoxDecoration(
+ color: Colors.white,
+ borderRadius: BorderRadius.only(topLeft: Radius.circular(10), topRight: Radius.circular(10), bottomLeft: Radius.circular(10), bottomRight: Radius.circular(10)),
+ boxShadow: [
+ BoxShadow(
+ color: Colors.grey.withOpacity(0.5),
+ spreadRadius: 5,
+ blurRadius: 7,
+ offset: Offset(0, 3), // changes position of shadow
+ ),
+ ],
+ ),
+ padding: EdgeInsets.only(left: 21, right: 21, top: 15, bottom: 15),
+ width: double.infinity,
+ // color: Colors.white,
+ child: Column(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ mainAxisSize: MainAxisSize.min,
+ children: [
+ SizedBox(height: 12),
+ Text(
+ TranslationBase.of(context).continueAgreeTerms,
+ style: TextStyle(
+ fontSize: 16.0,
+ fontWeight: FontWeight.w600,
+ color: Color(0xff2B353E),
+ letterSpacing: -0.64,
+ ),
+ ),
+ SizedBox(height: 12),
+ Row(
+ mainAxisAlignment: MainAxisAlignment.end,
+ children: [
+ Expanded(
+ flex: 1,
+ child: ButtonTheme(
+ shape: RoundedRectangleBorder(
+ borderRadius: BorderRadius.circular(10.0),
+ ),
+ height: 45.0,
+ child: CustomTextButton(
+ backgroundColor: CustomColors.green,
+ elevation: 0,
+ onPressed: () {
+ addUsageAgreement();
+ },
+ child: Text(TranslationBase.of(context).acceptLbl.toUpperCase(),
+ style: TextStyle(
+ fontSize: 18.0,
+ color: Colors.white,
+ )),
+ ),
+ ),
+ ),
+ mWidth(7),
+ Expanded(
+ flex: 1,
+ child: ButtonTheme(
+ shape: RoundedRectangleBorder(
+ borderRadius: BorderRadius.circular(10.0),
+ ),
+ height: 45.0,
+ child: CustomTextButton(
+ backgroundColor: Color(0xffc5272d),
+ elevation: 0,
+ onPressed: () {
+ Navigator.pushAndRemoveUntil(
+ context,
+ FadePage(
+ page: LandingPage(),
+ ),
+ (r) => false);
+ },
+ child: Text(TranslationBase.of(context).declineLbl.toUpperCase(), style: TextStyle(fontSize: 18.0, color: Colors.white)),
+ ),
+ ),
+ ),
+ ],
+ ),
+ ],
+ ),
+ ),
+ ),
+ );
+ }
+
+ addUsageAgreement() {
+ GifLoaderDialogUtils.showMyDialog(context);
+ this.authService.addUserAgreementContent().then((result) {
+ goToHome();
+ }).catchError((err) {
+ GifLoaderDialogUtils.hideDialog(context);
+ AppToast.showErrorToast(message: err);
+ print(err);
+ });
+ }
+
+ goToHome() async {
+ widget.authenticatedUserObject.isLogin = true;
+ widget.appointmentRateViewModel.isLogin = true;
+ projectViewModel.isLogin = true;
+ projectViewModel.user = widget.authenticatedUserObject.user;
+ await widget.authenticatedUserObject.getUser(getUser: true);
+
+ // GifLoaderDialogUtils.hideDialog(context);
+ getToDoCount();
+ widget.appointmentRateViewModel
+ .getIsLastAppointmentRatedList(projectViewModel.isArabic ? 1 : 2)
+ .then((value) => {
+ GifLoaderDialogUtils.hideDialog(context),
+ if (widget.appointmentRateViewModel.isHaveAppointmentNotRate)
+ {
+ Navigator.pushAndRemoveUntil(
+ context,
+ FadePage(
+ page: RateAppointmentDoctor(),
+ ),
+ (r) => false)
+ }
+ else
+ {
+ GifLoaderDialogUtils.hideDialog(context),
+ Navigator.pushAndRemoveUntil(
+ context,
+ FadePage(
+ page: LandingPage(),
+ ),
+ (r) => false)
+ },
+ insertIMEI()
+ })
+ .catchError((err) {
+ print(err);
+ });
+ }
+
+ insertIMEI() {
+ authService.insertDeviceImei(widget.selectedOption).then((value) => {}).catchError((err) {
+ print(err);
+ });
+ }
+
+ getToDoCount() {
+ toDoProvider.setState(0, 0, true, "0");
+ ClinicListService service = new ClinicListService();
+ service.getActiveAppointmentNo(context).then((res) {
+ if (res['MessageStatus'] == 1) {
+ toDoProvider.setState(res['AppointmentActiveNumber'], res['AncillaryOrderListCount'], true, "0");
+ // toDoProvider.setState(res['AppointmentActiveNumber'], true, "0");
+ } else {}
+ }).catchError((err) {
+ print(err);
+ });
+ }
+}
diff --git a/lib/services/authentication/auth_provider.dart b/lib/services/authentication/auth_provider.dart
index 4f4e6a1d..81a3dfad 100644
--- a/lib/services/authentication/auth_provider.dart
+++ b/lib/services/authentication/auth_provider.dart
@@ -1775,6 +1775,60 @@ class AuthProvider with ChangeNotifier {
}
}
+ Future checkIfUserAgreed() async {
+ Map request;
+ request = {"Region": 1};
+ dynamic localRes;
+ try {
+ await new BaseAppClient().post(CHECK_USAGE_AGREEMENT, onSuccess: (dynamic response, int statusCode) {
+ localRes = response;
+ }, onFailure: (String error, int statusCode) {
+ localRes = error;
+ return Future.value(error);
+ // throw error;
+ }, body: request);
+ return Future.value(localRes);
+ } catch (error) {
+ throw error;
+ }
+ }
+
+ Future getUserAgreementContent() async {
+ Map request;
+ request = {"Region": 1};
+ dynamic localRes;
+ try {
+ await new BaseAppClient().post(GET_USAGE_AGREEMENT, onSuccess: (dynamic response, int statusCode) {
+ localRes = response;
+ }, onFailure: (String error, int statusCode) {
+ localRes = error;
+ return Future.value(error);
+ // throw error;
+ }, body: request);
+ return Future.value(localRes);
+ } catch (error) {
+ throw error;
+ }
+ }
+
+ Future addUserAgreementContent() async {
+ Map request;
+ request = {"Region": 1};
+ dynamic localRes;
+ try {
+ await new BaseAppClient().post(ADD_USAGE_AGREEMENT, onSuccess: (dynamic response, int statusCode) {
+ localRes = response;
+ }, onFailure: (String error, int statusCode) {
+ localRes = error;
+ return Future.value(error);
+ // throw error;
+ }, body: request);
+ return Future.value(localRes);
+ } catch (error) {
+ throw error;
+ }
+ }
+
Future getDashboard() async {
Map request = {};
diff --git a/lib/uitl/penguin_method_channel.dart b/lib/uitl/penguin_method_channel.dart
index 7b50d635..50a642a7 100644
--- a/lib/uitl/penguin_method_channel.dart
+++ b/lib/uitl/penguin_method_channel.dart
@@ -3,7 +3,12 @@ import 'package:flutter/services.dart';
class PenguinMethodChannel {
static const MethodChannel _channel = MethodChannel('launch_penguin_ui');
- static Future launch(String storyboardName, String languageCode, String username, {NavigationClinicDetails? details}) async {
+ Future loadGif() async {
+ return await rootBundle.load("assets/images/progress-loading-red-crop-1.gif").then((data) => data.buffer.asUint8List());
+ }
+
+ Future launch(String storyboardName, String languageCode, String username, {NavigationClinicDetails? details}) async {
+ Uint8List image = await loadGif();
try {
await _channel.invokeMethod('launchPenguin', {
"storyboardName": storyboardName,
@@ -26,10 +31,11 @@ class PenguinMethodChannel {
"languageCode": languageCode,
"clientKey": "UGVuZ3VpbklOX1Blbk5hdl9QSUY=",
"mapBoxKey": "sk.eyJ1IjoicndhaWQiLCJhIjoiY2x6NWo0bTMzMWZodzJrcGZpemYzc3Z4dSJ9.uSSZuwNSGCcCdPAiORECmg",
- // "clinicID": details?.clinicId ?? "",
- "clinicID": details?.clinicId ?? "", // 46 ,49, 133
+ "clinicID": details?.clinicId ?? "",
+ // "clinicID": "108", // 46 ,49, 133
"patientID": details?.patientId ?? "",
"projectID": details?.projectId ?? "",
+ "loaderImage": image,
});
} on PlatformException catch (e) {
print("Failed to launch PenguinIn: '${e.message}'.");
diff --git a/lib/uitl/push-notification-handler.dart b/lib/uitl/push-notification-handler.dart
index 5bf073b3..2ad0203a 100644
--- a/lib/uitl/push-notification-handler.dart
+++ b/lib/uitl/push-notification-handler.dart
@@ -426,7 +426,7 @@ class PushNotificationHandler {
Permission.bluetoothScan,
Permission.activityRecognition,
].request().whenComplete(() {
- PenguinMethodChannel.launch("penguin", "en", "1231755", details: data);
+ PenguinMethodChannel().launch("penguin", "en", "1231755", details: data);
});
}
}
diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart
index be20b67a..06037958 100644
--- a/lib/uitl/translations_delegate_base.dart
+++ b/lib/uitl/translations_delegate_base.dart
@@ -2984,10 +2984,11 @@ class TranslationBase {
String get proceedPackage => localizedValues["proceedPackage"][locale.languageCode];
String get hospitalNavigationTitle => localizedValues["hospitalNavigationTitle"][locale.languageCode];
String get hospitalNavigationSubtitle => localizedValues["hospitalNavigationSubtitle"][locale.languageCode];
-
String get workplaceNameAr => localizedValues["workplaceNameAr"][locale.languageCode];
String get occupationNameEn => localizedValues["occupationNameEn"][locale.languageCode];
String get occupationNameAr => localizedValues["occupationNameAr"][locale.languageCode];
+ String get continueAgreeTerms => localizedValues["continueAgreeTerms"][locale.languageCode];
+ String get agreeText => localizedValues["agreeText"][locale.languageCode];
}
class TranslationBaseDelegate extends LocalizationsDelegate {
diff --git a/pubspec.yaml b/pubspec.yaml
index 143df07f..16e395b3 100644
--- a/pubspec.yaml
+++ b/pubspec.yaml
@@ -1,7 +1,7 @@
name: diplomaticquarterapp
description: A new Flutter application.
-version: 4.5.068+4050068
+version: 4.5.069+4050069
environment:
sdk: ">=3.0.0 <3.13.0"
@@ -36,7 +36,7 @@ dependencies:
#Google Fit & Apple HealthKit
# health: ^3.0.3
health: ^11.1.0
- pedometer: ^4.0.2
+# pedometer: ^4.0.2
#chart
fl_chart: ^0.64.0