Merge remote-tracking branch 'origin/update_flutter_3.16.0' into update_flutter_3.16.0

update_flutter_3.16.0
Sultan Khan 8 months ago
commit 3dd5538dca

@ -212,7 +212,7 @@
isa = PBXProject; isa = PBXProject;
attributes = { attributes = {
BuildIndependentTargetsInParallel = YES; BuildIndependentTargetsInParallel = YES;
LastUpgradeCheck = 1500; LastUpgradeCheck = 1510;
ORGANIZATIONNAME = "The Chromium Authors"; ORGANIZATIONNAME = "The Chromium Authors";
TargetAttributes = { TargetAttributes = {
97C146ED1CF9000F007C117D = { 97C146ED1CF9000F007C117D = {
@ -355,19 +355,23 @@
"${BUILT_PRODUCTS_DIR}/Try/Try.framework", "${BUILT_PRODUCTS_DIR}/Try/Try.framework",
"${BUILT_PRODUCTS_DIR}/barcode_scan2/barcode_scan2.framework", "${BUILT_PRODUCTS_DIR}/barcode_scan2/barcode_scan2.framework",
"${BUILT_PRODUCTS_DIR}/connectivity/connectivity.framework", "${BUILT_PRODUCTS_DIR}/connectivity/connectivity.framework",
"${BUILT_PRODUCTS_DIR}/device_info/device_info.framework",
"${BUILT_PRODUCTS_DIR}/file_picker/file_picker.framework", "${BUILT_PRODUCTS_DIR}/file_picker/file_picker.framework",
"${BUILT_PRODUCTS_DIR}/flutter_inappwebview/flutter_inappwebview.framework", "${BUILT_PRODUCTS_DIR}/flutter_inappwebview_ios/flutter_inappwebview_ios.framework",
"${BUILT_PRODUCTS_DIR}/flutter_keyboard_visibility/flutter_keyboard_visibility.framework", "${BUILT_PRODUCTS_DIR}/flutter_keyboard_visibility/flutter_keyboard_visibility.framework",
"${BUILT_PRODUCTS_DIR}/fluttertoast/fluttertoast.framework", "${BUILT_PRODUCTS_DIR}/fluttertoast/fluttertoast.framework",
"${BUILT_PRODUCTS_DIR}/local_auth_ios/local_auth_ios.framework", "${BUILT_PRODUCTS_DIR}/local_auth_ios/local_auth_ios.framework",
"${BUILT_PRODUCTS_DIR}/maps_launcher/maps_launcher.framework", "${BUILT_PRODUCTS_DIR}/maps_launcher/maps_launcher.framework",
"${BUILT_PRODUCTS_DIR}/nanopb/nanopb.framework", "${BUILT_PRODUCTS_DIR}/nanopb/nanopb.framework",
"${BUILT_PRODUCTS_DIR}/path_provider_foundation/path_provider_foundation.framework", "${BUILT_PRODUCTS_DIR}/path_provider_foundation/path_provider_foundation.framework",
"${BUILT_PRODUCTS_DIR}/pointer_interceptor_ios/pointer_interceptor_ios.framework",
"${BUILT_PRODUCTS_DIR}/shared_preferences_foundation/shared_preferences_foundation.framework", "${BUILT_PRODUCTS_DIR}/shared_preferences_foundation/shared_preferences_foundation.framework",
"${BUILT_PRODUCTS_DIR}/speech_to_text/speech_to_text.framework", "${BUILT_PRODUCTS_DIR}/speech_to_text/speech_to_text.framework",
"${BUILT_PRODUCTS_DIR}/sqflite/sqflite.framework", "${BUILT_PRODUCTS_DIR}/sqflite/sqflite.framework",
"${BUILT_PRODUCTS_DIR}/url_launcher_ios/url_launcher_ios.framework", "${BUILT_PRODUCTS_DIR}/url_launcher_ios/url_launcher_ios.framework",
"${PODS_XCFRAMEWORKS_BUILD_DIR}/ZoomVideoSDK/CptShare/CptShare.framework/CptShare",
"${PODS_XCFRAMEWORKS_BUILD_DIR}/ZoomVideoSDK/ZoomVideoSDK/ZoomVideoSDK.framework/ZoomVideoSDK",
"${PODS_XCFRAMEWORKS_BUILD_DIR}/ZoomVideoSDK/zm_annoter_dynamic/zm_annoter_dynamic.framework/zm_annoter_dynamic",
"${PODS_XCFRAMEWORKS_BUILD_DIR}/ZoomVideoSDK/zoomcml/zoomcml.framework/zoomcml",
); );
name = "[CP] Embed Pods Frameworks"; name = "[CP] Embed Pods Frameworks";
outputPaths = ( outputPaths = (
@ -392,19 +396,23 @@
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Try.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Try.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/barcode_scan2.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/barcode_scan2.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/connectivity.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/connectivity.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/device_info.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/file_picker.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/file_picker.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/flutter_inappwebview.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/flutter_inappwebview_ios.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/flutter_keyboard_visibility.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/flutter_keyboard_visibility.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/fluttertoast.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/fluttertoast.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/local_auth_ios.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/local_auth_ios.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/maps_launcher.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/maps_launcher.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/nanopb.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/nanopb.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/path_provider_foundation.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/path_provider_foundation.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/pointer_interceptor_ios.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/shared_preferences_foundation.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/shared_preferences_foundation.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/speech_to_text.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/speech_to_text.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/sqflite.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/sqflite.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/url_launcher_ios.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/url_launcher_ios.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CptShare.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/ZoomVideoSDK.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/zm_annoter_dynamic.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/zoomcml.framework",
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh; shellPath = /bin/sh;
@ -453,6 +461,7 @@
/* Begin XCBuildConfiguration section */ /* Begin XCBuildConfiguration section */
249021D3217E4FDB00AE95B9 /* Profile */ = { 249021D3217E4FDB00AE95B9 /* Profile */ = {
isa = XCBuildConfiguration; isa = XCBuildConfiguration;
baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
buildSettings = { buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO; ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_NONNULL = YES; CLANG_ANALYZER_NONNULL = YES;
@ -505,13 +514,15 @@
}; };
249021D4217E4FDB00AE95B9 /* Profile */ = { 249021D4217E4FDB00AE95B9 /* Profile */ = {
isa = XCBuildConfiguration; isa = XCBuildConfiguration;
baseConfigurationReference = E333B59AA5538E0304102FD2 /* Pods-Runner.profile.xcconfig */; baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
buildSettings = { buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = YES;
CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_MODULES = YES;
CURRENT_PROJECT_VERSION = 4; CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = 3A359E86ZF; DEVELOPMENT_TEAM = 3A359E86ZF;
ENABLE_BITCODE = NO; ENABLE_BITCODE = NO;
ENABLE_USER_SCRIPT_SANDBOXING = NO;
FRAMEWORK_SEARCH_PATHS = ( FRAMEWORK_SEARCH_PATHS = (
"$(inherited)", "$(inherited)",
"$(PROJECT_DIR)/Flutter", "$(PROJECT_DIR)/Flutter",
@ -526,7 +537,7 @@
"$(inherited)", "$(inherited)",
"$(PROJECT_DIR)/Flutter", "$(PROJECT_DIR)/Flutter",
); );
MARKETING_VERSION = 1.3.99; MARKETING_VERSION = 1.4.19;
PRODUCT_BUNDLE_IDENTIFIER = com.hmg.hmgDr; PRODUCT_BUNDLE_IDENTIFIER = com.hmg.hmgDr;
PRODUCT_NAME = Runner; PRODUCT_NAME = Runner;
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
@ -537,7 +548,7 @@
}; };
97C147031CF9000F007C117D /* Debug */ = { 97C147031CF9000F007C117D /* Debug */ = {
isa = XCBuildConfiguration; isa = XCBuildConfiguration;
baseConfigurationReference = 9740EEB31CF90195004384FC /* Generated.xcconfig */; baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */;
buildSettings = { buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO; ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_NONNULL = YES; CLANG_ANALYZER_NONNULL = YES;
@ -595,6 +606,7 @@
}; };
97C147041CF9000F007C117D /* Release */ = { 97C147041CF9000F007C117D /* Release */ = {
isa = XCBuildConfiguration; isa = XCBuildConfiguration;
baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
buildSettings = { buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO; ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_NONNULL = YES; CLANG_ANALYZER_NONNULL = YES;
@ -649,13 +661,15 @@
}; };
97C147061CF9000F007C117D /* Debug */ = { 97C147061CF9000F007C117D /* Debug */ = {
isa = XCBuildConfiguration; isa = XCBuildConfiguration;
baseConfigurationReference = C55D4AE245B71956447BA22F /* Pods-Runner.debug.xcconfig */; baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */;
buildSettings = { buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = YES;
CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_MODULES = YES;
CURRENT_PROJECT_VERSION = 4; CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = 3A359E86ZF; DEVELOPMENT_TEAM = 3A359E86ZF;
ENABLE_BITCODE = NO; ENABLE_BITCODE = NO;
ENABLE_USER_SCRIPT_SANDBOXING = NO;
FRAMEWORK_SEARCH_PATHS = ( FRAMEWORK_SEARCH_PATHS = (
"$(inherited)", "$(inherited)",
"$(PROJECT_DIR)/Flutter", "$(PROJECT_DIR)/Flutter",
@ -670,7 +684,7 @@
"$(inherited)", "$(inherited)",
"$(PROJECT_DIR)/Flutter", "$(PROJECT_DIR)/Flutter",
); );
MARKETING_VERSION = 1.3.99; MARKETING_VERSION = 1.4.19;
PRODUCT_BUNDLE_IDENTIFIER = com.hmg.hmgDr; PRODUCT_BUNDLE_IDENTIFIER = com.hmg.hmgDr;
PRODUCT_NAME = Runner; PRODUCT_NAME = Runner;
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
@ -682,14 +696,16 @@
}; };
97C147071CF9000F007C117D /* Release */ = { 97C147071CF9000F007C117D /* Release */ = {
isa = XCBuildConfiguration; isa = XCBuildConfiguration;
baseConfigurationReference = C8801C5E6B82B6CB497CA5C7 /* Pods-Runner.release.xcconfig */; baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
buildSettings = { buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = YES;
CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Runner/RunnerRelease.entitlements; CODE_SIGN_ENTITLEMENTS = Runner/RunnerRelease.entitlements;
CURRENT_PROJECT_VERSION = 4; CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = 3A359E86ZF; DEVELOPMENT_TEAM = 3A359E86ZF;
ENABLE_BITCODE = NO; ENABLE_BITCODE = NO;
ENABLE_USER_SCRIPT_SANDBOXING = NO;
FRAMEWORK_SEARCH_PATHS = ( FRAMEWORK_SEARCH_PATHS = (
"$(inherited)", "$(inherited)",
"$(PROJECT_DIR)/Flutter", "$(PROJECT_DIR)/Flutter",
@ -704,7 +720,7 @@
"$(inherited)", "$(inherited)",
"$(PROJECT_DIR)/Flutter", "$(PROJECT_DIR)/Flutter",
); );
MARKETING_VERSION = 1.3.99; MARKETING_VERSION = 1.4.19;
PRODUCT_BUNDLE_IDENTIFIER = com.hmg.hmgDr; PRODUCT_BUNDLE_IDENTIFIER = com.hmg.hmgDr;
PRODUCT_NAME = Runner; PRODUCT_NAME = Runner;
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<Scheme <Scheme
LastUpgradeVersion = "1500" LastUpgradeVersion = "1510"
version = "1.3"> version = "1.3">
<BuildAction <BuildAction
parallelizeBuildables = "YES" parallelizeBuildables = "YES"

@ -25,11 +25,11 @@ class BaseAppClient {
//TODO change the post fun to nun static when you change all service //TODO change the post fun to nun static when you change all service
post(String endPoint, post(String endPoint,
{Map<String, dynamic>? body, {Map<String, dynamic>? body,
required Function(dynamic response, int statusCode) onSuccess, required Function(dynamic response, int statusCode) onSuccess,
required Function(String error, int statusCode) onFailure, required Function(String error, int statusCode) onFailure,
bool isAllowAny = false, bool isAllowAny = false,
bool isLiveCare = false, bool isLiveCare = false,
bool isFallLanguage = false}) async { bool isFallLanguage = false}) async {
String url; String url;
if (isLiveCare) if (isLiveCare)
url = BASE_URL_LIVE_CARE + endPoint; url = BASE_URL_LIVE_CARE + endPoint;
@ -46,9 +46,7 @@ class BaseAppClient {
if (body == null || body['DoctorID'] == null) { if (body == null || body['DoctorID'] == null) {
body!['DoctorID'] = doctorProfile.doctorID.toString(); body!['DoctorID'] = doctorProfile.doctorID.toString();
} }
if (body['DoctorID'] == "") if (body['DoctorID'] == "") body['DoctorID'] = doctorProfile.doctorID; // changed from null; because create update episode not working
body['DoctorID'] = doctorProfile
.doctorID; // changed from null; because create update episode not working
if (body['EditedBy'] == null) body['EditedBy'] = doctorProfile.doctorID.toString(); if (body['EditedBy'] == null) body['EditedBy'] = doctorProfile.doctorID.toString();
if (body['ProjectID'] == null) { if (body['ProjectID'] == null) {
body['ProjectID'] = doctorProfile.projectID.toString(); body['ProjectID'] = doctorProfile.projectID.toString();
@ -64,8 +62,8 @@ class BaseAppClient {
body['SetupID'] = body.containsKey('SetupID') body['SetupID'] = body.containsKey('SetupID')
? body['SetupID'] != null ? body['SetupID'] != null
? body['SetupID'] ? body['SetupID']
: await sharedPref.getString(DOCTOR_SETUP_ID) : await sharedPref.getString(DOCTOR_SETUP_ID)
: await sharedPref.getString(DOCTOR_SETUP_ID); : await sharedPref.getString(DOCTOR_SETUP_ID);
if (body['EditedBy'] == '') { if (body['EditedBy'] == '') {
@ -94,21 +92,16 @@ class BaseAppClient {
body['IsLoginForDoctorApp'] = IS_LOGIN_FOR_DOCTOR_APP.toString(); body['IsLoginForDoctorApp'] = IS_LOGIN_FOR_DOCTOR_APP.toString();
body['PatientOutSA'] = body['PatientOutSA'] ?? '0'; // PATIENT_OUT_SA; body['PatientOutSA'] = body['PatientOutSA'] ?? '0'; // PATIENT_OUT_SA;
if (body['VidaAuthTokenID'] == null) { if (body['VidaAuthTokenID'] == null) {
body['VidaAuthTokenID'] = body['VidaAuthTokenID'] = await sharedPref.getString(VIDA_AUTH_TOKEN_ID);
await sharedPref.getString(VIDA_AUTH_TOKEN_ID);
} }
if (body['VidaRefreshTokenID'] == null) { if (body['VidaRefreshTokenID'] == null) {
body['VidaRefreshTokenID'] = body['VidaRefreshTokenID'] = await sharedPref.getString(VIDA_REFRESH_TOKEN_ID);
await sharedPref.getString(VIDA_REFRESH_TOKEN_ID);
} }
int? projectID = await sharedPref.getInt(PROJECT_ID); int? projectID = await sharedPref.getInt(PROJECT_ID);
if (projectID == 2 || projectID == 3) if (projectID == 2 || projectID == 3)
body['PatientOutSA'] = true; body['PatientOutSA'] = true;
else if ((body.containsKey('facilityId') && body['facilityId'] == 2 || else if ((body.containsKey('facilityId') && body['facilityId'] == 2 || body['facilityId'] == 3) || body['ProjectID'] == 2 || body['ProjectID'] == 3)
body['facilityId'] == 3) ||
body['ProjectID'] == 2 ||
body['ProjectID'] == 3)
body['PatientOutSA'] = 'true'; body['PatientOutSA'] = 'true';
else else
body['PatientOutSA'] = 'false'; body['PatientOutSA'] = 'false';
@ -138,27 +131,25 @@ class BaseAppClient {
var asd = json.encode(body); var asd = json.encode(body);
var asd2; var asd2;
if (await Utils.checkConnection()) { if (await Utils.checkConnection()) {
final response = await http.post(Uri.parse(url), final response = await http.post(Uri.parse(url), body: json.encode(body), headers: {'Content-Type': 'application/json', 'Accept': 'application/json'});
body: json.encode(body),
headers: {
'Content-Type': 'application/json',
'Accept': 'application/json'
});
final int statusCode = response.statusCode; final int statusCode = response.statusCode;
if (body['DoctorID'] != null) {
postRequestAndResponse(
doctorId: body['DoctorID'],
completeUrl: url,
request: json.encode(body),
response: response.body,
urlSuffix: endPoint,
statusCode: statusCode.toString());
}
if (statusCode < 200 || statusCode >= 400) { if (statusCode < 200 || statusCode >= 400) {
onFailure(Utils.generateContactAdminMsg(), statusCode); onFailure(Utils.generateContactAdminMsg(), statusCode);
if (body['DoctorID'] != null) if (body['DoctorID'] != null) postFailureResponse(doctorId: body['DoctorID'], url: url, request: json.encode(body), response: response.body, exception: "$statusCode");
postFailureResponse(
doctorId: body['DoctorID'],
url: url,
request: json.encode(body),
response: response.body,
exception: "$statusCode");
} else { } else {
var parsed = json.decode(response.body.toString()); var parsed = json.decode(response.body.toString());
if (parsed['ErrorType'] == 4) { if (parsed['ErrorType'] == 4) {
helpers.navigateToUpdatePage(parsed['ErrorEndUserMessage'], helpers.navigateToUpdatePage(parsed['ErrorEndUserMessage'], parsed['AndroidLink'], parsed['IOSLink']);
parsed['AndroidLink'], parsed['IOSLink']);
} }
if (parsed['IsAuthenticated'] != null && !parsed['IsAuthenticated']) { if (parsed['IsAuthenticated'] != null && !parsed['IsAuthenticated']) {
@ -166,19 +157,11 @@ class BaseAppClient {
if (parsed['ErrorCode'] == '699') { if (parsed['ErrorCode'] == '699') {
onSuccess(parsed, statusCode); onSuccess(parsed, statusCode);
} else { } else {
if (body['DoctorID'] != null) if (body['DoctorID'] != null) postFailureResponse(doctorId: body['DoctorID'], url: url, request: json.encode(body), response: response.body, exception: getError(parsed));
postFailureResponse(
doctorId: body['DoctorID'],
url: url,
request: json.encode(body),
response: response.body,
exception: getError(parsed));
onFailure(getError(parsed), statusCode); onFailure(getError(parsed), statusCode);
} }
} else if (!isAllowAny) { } else if (!isAllowAny) {
await Provider.of<AuthenticationViewModel>(AppGlobal.CONTEX, await Provider.of<AuthenticationViewModel>(AppGlobal.CONTEX, listen: false).logout();
listen: false)
.logout();
//todo nofailure is placed here and but have to handle the response here as well //todo nofailure is placed here and but have to handle the response here as well
Utils.showErrorToast('Your session expired Please login again'); Utils.showErrorToast('Your session expired Please login again');
locator<NavigationService>().pushNamedAndRemoveUntil(ROOT); locator<NavigationService>().pushNamedAndRemoveUntil(ROOT);
@ -188,13 +171,7 @@ class BaseAppClient {
} }
} else if (parsed['MessageStatus'] == 1) { } else if (parsed['MessageStatus'] == 1) {
if (!parsed['IsAuthenticated']) { if (!parsed['IsAuthenticated']) {
if (body['DoctorID'] != null) if (body['DoctorID'] != null) postFailureResponse(doctorId: body['DoctorID'], url: url, request: json.encode(body), response: response.body, exception: getError(parsed));
postFailureResponse(
doctorId: body['DoctorID'],
url: url,
request: json.encode(body),
response: response.body,
exception: getError(parsed));
onFailure(getError(parsed), statusCode); onFailure(getError(parsed), statusCode);
} else } else
onSuccess(parsed, statusCode); onSuccess(parsed, statusCode);
@ -208,18 +185,13 @@ class BaseAppClient {
return; return;
} }
} }
if (body['DoctorID'] != null) { if (body['DoctorID'] != null) {
postFailureResponse( postFailureResponse(doctorId: body['DoctorID'], url: url, request: json.encode(body), response: response.body, exception: getError(parsed));
doctorId: body['DoctorID'],
url: url,
request: json.encode(body),
response: response.body,
exception: getError(parsed));
}
onFailure(getError(parsed), statusCode);
} }
onFailure(getError(parsed), statusCode);
} }
} else { }
} else {
onFailure('Please Check The Internet Connection', -1); onFailure('Please Check The Internet Connection', -1);
} }
} catch (e) { } catch (e) {
@ -228,264 +200,204 @@ class BaseAppClient {
} }
} }
postPatient(String endPoint, postPatient(String endPoint,
{Map<String, dynamic>? body, {Map<String, dynamic>? body,
required Function(dynamic response, int statusCode) onSuccess, required Function(dynamic response, int statusCode) onSuccess,
required Function(String error, int statusCode) onFailure, required Function(String error, int statusCode) onFailure,
PatiantInformtion? patient, PatiantInformtion? patient,
bool isExternal = false}) async { bool isExternal = false}) async {
String url = BASE_URL + endPoint; String url = BASE_URL + endPoint;
try { try {
Map<String, String> headers = { Map<String, String> headers = {'Content-Type': 'application/json', 'Accept': 'application/json'};
'Content-Type': 'application/json',
'Accept': 'application/json'
};
String? token = await sharedPref.getString(TOKEN);
Map<String, dynamic>? profile = await sharedPref.getObj(DOCTOR_PROFILE);
if (profile != null) {
DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile);
if (body!['DoctorID'] == null) {
body['DoctorID'] = doctorProfile.doctorID;
}
}
if (body!['DoctorID'] == 0) {
body['DoctorID'] = null;
}
var languageID =
await sharedPref.getStringWithDefaultValue(APP_Language, 'en');
body['SetupID'] = body!.containsKey('SetupID')
? body['SetupID'] != null
? body['SetupID']
: await sharedPref.getString(DOCTOR_SETUP_ID)
: await sharedPref.getString(DOCTOR_SETUP_ID);
body['VersionID'] = VERSION_ID;
body['Channel'] = CHANNEL;
body['LanguageID'] = languageID == 'ar' ? 1 : 2;
body['IPAdress'] = "10.20.10.20";
body['generalid'] = GENERAL_ID;
body['PatientOutSA'] = body.containsKey('PatientOutSA')
? body['PatientOutSA'] != null
? body['PatientOutSA']
: PATIENT_OUT_SA_PATIENT_REQ
: PATIENT_OUT_SA_PATIENT_REQ;
if (body.containsKey('isDentalAllowedBackend')) {
body['isDentalAllowedBackend'] =
body.containsKey('isDentalAllowedBackend')
? body['isDentalAllowedBackend'] != null
? body['isDentalAllowedBackend']
: IS_DENTAL_ALLOWED_BACKEND
: IS_DENTAL_ALLOWED_BACKEND;
}
body['DeviceTypeID'] = Platform.isAndroid ? 1 : 2; String? token = await sharedPref.getString(TOKEN);
Map<String, dynamic>? profile = await sharedPref.getObj(DOCTOR_PROFILE);
body['PatientType'] = body.containsKey('PatientType')
? body['PatientType'] != null if (profile != null) {
? body['PatientType'] DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile);
: patient!.patientType != null if (body!['DoctorID'] == null) {
? patient.patientType body['DoctorID'] = doctorProfile.doctorID;
: PATIENT_TYPE }
: PATIENT_TYPE; }
if (body!['DoctorID'] == 0) {
body['PatientTypeID'] = body.containsKey('PatientTypeID') body['DoctorID'] = null;
? body['PatientTypeID'] != null }
? body['PatientTypeID'] var languageID = await sharedPref.getStringWithDefaultValue(APP_Language, 'en');
: patient!.patientType != null body['SetupID'] = body!.containsKey('SetupID')
? patient.patientType ? body['SetupID'] != null
: PATIENT_TYPE_ID ? body['SetupID']
: PATIENT_TYPE_ID; : await sharedPref.getString(DOCTOR_SETUP_ID)
: await sharedPref.getString(DOCTOR_SETUP_ID);
body['TokenID'] =
body.containsKey('TokenID') ? body['TokenID'] ?? token : token; body['VersionID'] = VERSION_ID;
body['PatientID'] = body['PatientID'] != null body['Channel'] = CHANNEL;
? body['PatientID'] body['LanguageID'] = languageID == 'ar' ? 1 : 2;
: patient!.patientId ?? patient.patientMRN;
body['IPAdress'] = "10.20.10.20";
body['PatientOutSA'] = 0; //user['OutSA']; //TODO change it body['generalid'] = GENERAL_ID;
body['SessionID'] = SESSION_ID; //getSe body['PatientOutSA'] = body.containsKey('PatientOutSA')
? body['PatientOutSA'] != null
int? projectID = await sharedPref.getInt(PROJECT_ID); ? body['PatientOutSA']
if (projectID == 2 || projectID == 3) : PATIENT_OUT_SA_PATIENT_REQ
body['PatientOutSA'] = true; : PATIENT_OUT_SA_PATIENT_REQ;
else
body['PatientOutSA'] = false; if (body.containsKey('isDentalAllowedBackend')) {
body['isDentalAllowedBackend'] = body.containsKey('isDentalAllowedBackend')
// if(!body.containsKey('ProjectID')) { ? body['isDentalAllowedBackend'] != null
// if (projectID != null) { ? body['isDentalAllowedBackend']
// body['ProjectID'] = 313; : IS_DENTAL_ALLOWED_BACKEND
// } else { : IS_DENTAL_ALLOWED_BACKEND;
// body['ProjectID'] = 0; }
// }
// } body['DeviceTypeID'] = Platform.isAndroid ? 1 : 2;
// body['DoctorID'] = 24; //3844083 body['PatientType'] = body.containsKey('PatientType')
// body['TokenID'] = "@dm!n"; ? body['PatientType'] != null
? body['PatientType']
print("URL : $url"); : patient!.patientType != null
print("Body : ${json.encode(body)}"); ? patient.patientType
var asd = json.encode(body); : PATIENT_TYPE
var asd2; : PATIENT_TYPE;
if (await Utils.checkConnection()) {
final response = await http.post(Uri.parse(url.trim()), body['PatientTypeID'] = body.containsKey('PatientTypeID')
body: json.encode(body), headers: headers); ? body['PatientTypeID'] != null
final int statusCode = response.statusCode; ? body['PatientTypeID']
print("statusCode :$statusCode"); : patient!.patientType != null
if (statusCode < 200 || statusCode >= 400 || json == null) { ? patient.patientType
onFailure('Error While Fetching data', statusCode); : PATIENT_TYPE_ID
} else { : PATIENT_TYPE_ID;
// var parsed = json.decode(response.body.toString());
var parsed = json.decode(utf8.decode(response.bodyBytes)); body['TokenID'] = body.containsKey('TokenID') ? body['TokenID'] ?? token : token;
if (parsed['Response_Message'] != null) { body['PatientID'] = body['PatientID'] != null ? body['PatientID'] : patient!.patientId ?? patient.patientMRN;
onSuccess(parsed, statusCode);
} else { body['PatientOutSA'] = 0; //user['OutSA']; //TODO change it
if (parsed['ErrorType'] == 4) { body['SessionID'] = SESSION_ID; //getSe
helpers.navigateToUpdatePage(parsed['ErrorEndUserMessage'],
parsed['AndroidLink'], parsed['IOSLink']); int? projectID = await sharedPref.getInt(PROJECT_ID);
} if (projectID == 2 || projectID == 3)
if (parsed['IsAuthenticated'] == null) { body['PatientOutSA'] = true;
if (parsed['isSMSSent'] == true) { else
onSuccess(parsed, statusCode); body['PatientOutSA'] = false;
} else if (parsed['MessageStatus'] == 1) {
onSuccess(parsed, statusCode); // if(!body.containsKey('ProjectID')) {
} else if (parsed['Result'] == 'OK') { // if (projectID != null) {
onSuccess(parsed, statusCode); // body['ProjectID'] = 313;
} else { // } else {
if (parsed != null) { // body['ProjectID'] = 0;
onSuccess(parsed, statusCode); // }
} else { // }
if (body['DoctorID'] != null)
postFailureResponse( // body['DoctorID'] = 24; //3844083
doctorId: body['DoctorID'], // body['TokenID'] = "@dm!n";
url: url,
request: json.encode(body), print("URL : $url");
response: response.body, print("Body : ${json.encode(body)}");
exception: getError(parsed)); var asd = json.encode(body);
onFailure(getError(parsed), statusCode); var asd2;
} if (await Utils.checkConnection()) {
} final response = await http.post(Uri.parse(url.trim()), body: json.encode(body), headers: headers);
} else if (parsed['MessageStatus'] == 1 || final int statusCode = response.statusCode;
parsed['SMSLoginRequired'] == true) { print("statusCode :$statusCode");
onSuccess(parsed, statusCode); if (statusCode < 200 || statusCode >= 400 || json == null) {
} else if (parsed['MessageStatus'] == 2 && onFailure('Error While Fetching data', statusCode);
parsed['IsAuthenticated']) { } else {
if (parsed['SameClinicApptList'] != null) { // var parsed = json.decode(response.body.toString());
onSuccess(parsed, statusCode); var parsed = json.decode(utf8.decode(response.bodyBytes));
} else { if (parsed['Response_Message'] != null) {
if (parsed['message'] == null && onSuccess(parsed, statusCode);
parsed['ErrorEndUserMessage'] == null) { } else {
if (parsed['ErrorSearchMsg'] == null) { if (parsed['ErrorType'] == 4) {
if (body['DoctorID'] != null) helpers.navigateToUpdatePage(parsed['ErrorEndUserMessage'], parsed['AndroidLink'], parsed['IOSLink']);
postFailureResponse( }
doctorId: body['DoctorID'], if (parsed['IsAuthenticated'] == null) {
url: url, if (parsed['isSMSSent'] == true) {
request: json.encode(body), onSuccess(parsed, statusCode);
response: response.body, } else if (parsed['MessageStatus'] == 1) {
exception: onSuccess(parsed, statusCode);
"Server Error found with no available message"); } else if (parsed['Result'] == 'OK') {
onSuccess(parsed, statusCode);
onFailure("Server Error found with no available message", } else {
statusCode); if (parsed != null) {
} else { onSuccess(parsed, statusCode);
if (body['DoctorID'] != null) } else {
postFailureResponse( if (body['DoctorID'] != null) postFailureResponse(doctorId: body['DoctorID'], url: url, request: json.encode(body), response: response.body, exception: getError(parsed));
doctorId: body['DoctorID'], onFailure(getError(parsed), statusCode);
url: url, }
request: json.encode(body), }
response: response.body, } else if (parsed['MessageStatus'] == 1 || parsed['SMSLoginRequired'] == true) {
exception: parsed['ErrorSearchMsg']); onSuccess(parsed, statusCode);
onFailure(parsed['ErrorSearchMsg'], statusCode); } else if (parsed['MessageStatus'] == 2 && parsed['IsAuthenticated']) {
} if (parsed['SameClinicApptList'] != null) {
} else { onSuccess(parsed, statusCode);
if (body['DoctorID'] != null) } else {
postFailureResponse( if (parsed['message'] == null && parsed['ErrorEndUserMessage'] == null) {
doctorId: body['DoctorID'], if (parsed['ErrorSearchMsg'] == null) {
url: url, if (body['DoctorID'] != null)
request: json.encode(body), postFailureResponse(doctorId: body['DoctorID'], url: url, request: json.encode(body), response: response.body, exception: "Server Error found with no available message");
response: response.body,
exception: parsed['message'] ?? onFailure("Server Error found with no available message", statusCode);
parsed['ErrorEndUserMessage'] ?? } else {
parsed['ErrorMessage']); if (body['DoctorID'] != null) postFailureResponse(doctorId: body['DoctorID'], url: url, request: json.encode(body), response: response.body, exception: parsed['ErrorSearchMsg']);
onFailure( onFailure(parsed['ErrorSearchMsg'], statusCode);
parsed['message'] ?? }
parsed['ErrorEndUserMessage'] ?? } else {
parsed['ErrorMessage'], if (body['DoctorID'] != null)
statusCode); postFailureResponse(
} doctorId: body['DoctorID'],
} url: url,
} else { request: json.encode(body),
if (parsed['SameClinicApptList'] != null) { response: response.body,
onSuccess(parsed, statusCode); exception: parsed['message'] ?? parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage']);
} else { onFailure(parsed['message'] ?? parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], statusCode);
if (parsed['message'] != null) { }
if (body['DoctorID'] != null) }
postFailureResponse( } else {
doctorId: body['DoctorID'], if (parsed['SameClinicApptList'] != null) {
url: url, onSuccess(parsed, statusCode);
request: json.encode(body), } else {
response: response.body, if (parsed['message'] != null) {
exception: parsed['message']); if (body['DoctorID'] != null) postFailureResponse(doctorId: body['DoctorID'], url: url, request: json.encode(body), response: response.body, exception: parsed['message']);
onFailure(parsed['message'] ?? parsed['message'], statusCode); onFailure(parsed['message'] ?? parsed['message'], statusCode);
} else { } else {
if (body['DoctorID'] != null) if (body['DoctorID'] != null)
postFailureResponse( postFailureResponse(doctorId: body['DoctorID'], url: url, request: json.encode(body), response: response.body, exception: parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage']);
doctorId: body['DoctorID'],
url: url, onFailure(parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], statusCode);
request: json.encode(body), }
response: response.body, }
exception: parsed['ErrorEndUserMessage'] ?? }
parsed['ErrorMessage']); }
}
onFailure( } else {
parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], onFailure('Please Check The Internet Connection', -1);
statusCode); }
}
}
}
}
}
} else {
onFailure('Please Check The Internet Connection', -1);
}
} catch (e) { } catch (e) {
print(e); print(e);
onFailure(e.toString(), -1); onFailure(e.toString(), -1);
}
} }
}
String getError(parsed) { String getError(parsed) {
//TODO change this fun //TODO change this fun
String? error = parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage']; String? error = parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'];
if (parsed["ValidationErrors"] != null) { if (parsed["ValidationErrors"] != null) {
error = parsed["ValidationErrors"]["StatusMessage"].toString() + "\n"; error = parsed["ValidationErrors"]["StatusMessage"].toString() + "\n";
if (parsed["ValidationErrors"]["ValidationErrors"] != null && if (parsed["ValidationErrors"]["ValidationErrors"] != null && parsed["ValidationErrors"]["ValidationErrors"].length != 0) {
parsed["ValidationErrors"]["ValidationErrors"].length != 0) { for (var i = 0; i < parsed["ValidationErrors"]["ValidationErrors"].length; i++) {
for (var i = 0; error = error! + parsed["ValidationErrors"]["ValidationErrors"][i]["Messages"][0] + "\n";
i < parsed["ValidationErrors"]["ValidationErrors"].length; }
i++) { }
error = error! +
parsed["ValidationErrors"]["ValidationErrors"][i]["Messages"][0] +
"\n";
}
}
} }
if (error == null || error == "null" || error == "null\n") { if (error == null || error == "null" || error == "null\n") {
return Utils.generateContactAdminMsg(); return Utils.generateContactAdminMsg();
} }
return error; return error;
} }
get( get({required String endPoint, required Function(dynamic response, int statusCode) onSuccess, required Function(String error, int statusCode) onFailure}) async {
{required String endPoint,
required Function(dynamic response, int statusCode) onSuccess,
required Function(String error, int statusCode) onFailure}) async {
String token = await sharedPref.getString(TOKEN); String token = await sharedPref.getString(TOKEN);
String url = DOCTOR_ROTATION + endPoint + '&token=' + token; String url = DOCTOR_ROTATION + endPoint + '&token=' + token;
print(url); print(url);
@ -493,10 +405,10 @@ class BaseAppClient {
final int statusCode = response.statusCode; final int statusCode = response.statusCode;
if (statusCode < 200 || statusCode >= 400) { if (statusCode < 200 || statusCode >= 400) {
onFailure(Utils.generateContactAdminMsg(), statusCode); onFailure(Utils.generateContactAdminMsg(), statusCode);
} else { } else {
var parsed = json.decode(response.body.toString()); var parsed = json.decode(response.body.toString());
onSuccess(parsed, statusCode); onSuccess(parsed, statusCode);
}
} }
} }
}

@ -413,7 +413,7 @@ const TRANSACTION_NO = 0;
const LANGUAGE_ID = 2; const LANGUAGE_ID = 2;
const STAMP = '2020-04-27T12:17:17.721Z'; const STAMP = '2020-04-27T12:17:17.721Z';
const IP_ADDRESS = '9.9.9.9'; const IP_ADDRESS = '9.9.9.9';
const VERSION_ID = 9.5; const VERSION_ID = 9.7;
const CHANNEL = 9; const CHANNEL = 9;
const SESSION_ID = 'BlUSkYymTt'; const SESSION_ID = 'BlUSkYymTt';
const IS_LOGIN_FOR_DOCTOR_APP = true; const IS_LOGIN_FOR_DOCTOR_APP = true;

@ -40,13 +40,13 @@ class AuthenticationService extends BaseService {
try { try {
await baseAppClient.post(SELECT_DEVICE_IMEI, onSuccess: (dynamic response, int statusCode) { await baseAppClient.post(SELECT_DEVICE_IMEI, onSuccess: (dynamic response, int statusCode) {
_imeiDetails = []; _imeiDetails = [];
response['List_DoctorDeviceDetails'].forEach((v) { response['List_DoctorDeviceDetails']?.forEach((v) {
_imeiDetails.add(GetIMEIDetailsModel.fromJson(v)); _imeiDetails.add(GetIMEIDetailsModel.fromJson(v));
}); });
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
super.error = error; super.error = error;
}, body: {"IMEI": imei, "TokenID": "@dm!n"}); }, body: {"IMEI": imei, });
} catch (error) { } catch (error) {
hasError = true; hasError = true;
super.error = error.toString(); super.error = error.toString();

@ -1,4 +1,6 @@
import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/config/shared_pref_kay.dart';
import 'package:doctor_app_flutter/core/model/doctor/doctor_profile_model.dart';
import 'package:doctor_app_flutter/core/model/referral/ReferralRequest.dart'; import 'package:doctor_app_flutter/core/model/referral/ReferralRequest.dart';
import 'package:doctor_app_flutter/core/service/base/base_service.dart'; import 'package:doctor_app_flutter/core/service/base/base_service.dart';
@ -14,8 +16,10 @@ class ReferralService extends BaseService {
int? frequency, int? frequency,
String? referringDoctorRemarks, String? referringDoctorRemarks,
String? extension}) async { String? extension}) async {
await getDoctorProfile(); // await getDoctorProfile();
ReferralRequest referralRequest = ReferralRequest(); ReferralRequest referralRequest = ReferralRequest();
Map<String, dynamic>? profile = await sharedPref.getObj(DOCTOR_PROFILE);
DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile!);
referralRequest.admissionNo = admissionNo; referralRequest.admissionNo = admissionNo;
referralRequest.roomID = roomID; referralRequest.roomID = roomID;
referralRequest.referralClinic = referralClinic.toString(); referralRequest.referralClinic = referralClinic.toString();

@ -441,7 +441,8 @@ class AuthenticationViewModel extends BaseViewModel {
logout({bool isFromLogin = false}) async { logout({bool isFromLogin = false}) async {
localToken = ""; localToken = "";
String? lang = await sharedPref.getString(APP_Language); String? lang = await sharedPref.getString(APP_Language);
await Utils.clearSharedPref(); //COMMENTED THE NOT TO CLEAR THE SHARED PREF
// await Utils.clearSharedPref();
doctorProfile = null; doctorProfile = null;
sharedPref.setString(APP_Language, lang ?? 'en'); sharedPref.setString(APP_Language, lang ?? 'en');
deleteUser(); deleteUser();

@ -80,9 +80,7 @@ class _HomeScreenState extends State<HomeScreen> {
return BaseView<DashboardViewModel>( return BaseView<DashboardViewModel>(
onModelReady: (model) async { onModelReady: (model) async {
model model.startHomeScreenServices(projectsProvider, authenticationViewModel).then((value) {
.startHomeScreenServices(projectsProvider, authenticationViewModel)
.then((value) {
WidgetsBinding.instance.addPostFrameCallback((_) async { WidgetsBinding.instance.addPostFrameCallback((_) async {
if (model.radiologyCriticalFindingModel != null) { if (model.radiologyCriticalFindingModel != null) {
print("onModelReady radiologyCriticalFindingModel!!!"); print("onModelReady radiologyCriticalFindingModel!!!");
@ -113,12 +111,9 @@ class _HomeScreenState extends State<HomeScreen> {
//TODO Elham* make it componet //TODO Elham* make it componet
Container( Container(
width: 40, width: 40,
margin: EdgeInsets.only( margin: EdgeInsets.only(left: projectsProvider.isArabic ? 0 : 32, right: projectsProvider.isArabic ? 23 : 0),
left: projectsProvider.isArabic ? 0 : 32,
right: projectsProvider.isArabic ? 23 : 0),
child: IconButton( child: IconButton(
icon: SvgPicture.asset('assets/images/svgs/menu.svg', icon: SvgPicture.asset('assets/images/svgs/menu.svg', height: 25, width: 10),
height: 25, width: 10),
iconSize: 15, iconSize: 15,
color: Colors.black, color: Colors.black,
onPressed: () => Scaffold.of(context).openDrawer(), onPressed: () => Scaffold.of(context).openDrawer(),
@ -126,8 +121,6 @@ class _HomeScreenState extends State<HomeScreen> {
), ),
Column(children: <Widget>[ Column(children: <Widget>[
// //
// InkWell(onTap: (){ // InkWell(onTap: (){
// AppPermissionsUtils.requestVideoCallPermission( // AppPermissionsUtils.requestVideoCallPermission(
@ -322,14 +315,10 @@ class _HomeScreenState extends State<HomeScreen> {
); );
} }
showRadiologyFindingDialog(DashboardViewModel model) async{ showRadiologyFindingDialog(DashboardViewModel model) async {
await Utils.showConfirmationDialog( await Utils.showConfirmationDialog(context, model.radiologyCriticalFindingModel?.notificationMesssage ?? 'test radiology', () async {
context, model.radiologyCriticalFindingModel?.notificationMesssage ??'test radiology',
() async {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
await model.acknowledgeRadiologyCriticalFinding( await model.acknowledgeRadiologyCriticalFinding(model.radiologyCriticalFindingModel?.invoiceNo?.toString() ?? '', model.radiologyCriticalFindingModel?.invoiceLineItemNo?.toString() ?? '');
model.radiologyCriticalFindingModel?.invoiceNo?.toString() ?? '',
model.radiologyCriticalFindingModel?.invoiceLineItemNo?.toString() ?? '');
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
Navigator.of(context).pop(); Navigator.of(context).pop();
}, isShowCancelButton: false); }, isShowCancelButton: false);
@ -351,27 +340,19 @@ class _HomeScreenState extends State<HomeScreen> {
_showErrorBottomSheet(context, TranslationBase.of(context).youHavePendingInterventions); _showErrorBottomSheet(context, TranslationBase.of(context).youHavePendingInterventions);
} }
List<Widget> homePatientsCardsWidget( List<Widget> homePatientsCardsWidget(DashboardViewModel model, projectsProvider) {
DashboardViewModel model, projectsProvider) {
colorIndex = 0; colorIndex = 0;
List<LinearGradient> backgroundColors = []; List<LinearGradient> backgroundColors = [];
backgroundColors.add(LinearGradient( backgroundColors.add(LinearGradient(begin: Alignment(-1.0, -2.0), end: Alignment(1.0, 2.0), colors: [
begin: Alignment(-1.0, -2.0), AppGlobal.appRedColor,
end: Alignment(1.0, 2.0), Color(0xFFAD3B3B),
colors: [ ])); //AppGlobal.appRedColor;
AppGlobal.appRedColor, backgroundColors.add(LinearGradient(begin: Alignment.center, end: Alignment.center, colors: [
Color(0xFFAD3B3B),
])); //AppGlobal.appRedColor;
backgroundColors.add(
LinearGradient(begin: Alignment.center, end: Alignment.center, colors: [
Color(0xFFC9C9C9), Color(0xFFC9C9C9),
Color(0xFFC9C9C9), Color(0xFFC9C9C9),
])); ]));
backgroundColors.add(LinearGradient( backgroundColors.add(LinearGradient(begin: Alignment.center, end: Alignment.center, colors: [Color(0xFF71787E), AppGlobal.appTextColor]));
begin: Alignment.center,
end: Alignment.center,
colors: [Color(0xFF71787E), AppGlobal.appTextColor]));
List<Color> backgroundIconColors = []; List<Color> backgroundIconColors = [];
backgroundIconColors.add(Colors.white12); backgroundIconColors.add(Colors.white12);
backgroundIconColors.add(Colors.white38); backgroundIconColors.add(Colors.white38);
@ -390,8 +371,7 @@ class _HomeScreenState extends State<HomeScreen> {
cardIcon: DoctorApp.livecare, cardIcon: DoctorApp.livecare,
textColor: textColors[colorIndex], textColor: textColors[colorIndex],
iconSize: 21, iconSize: 21,
text: text: "${TranslationBase.of(context).liveCare}\n${TranslationBase.of(context).patients}",
"${TranslationBase.of(context).liveCare}\n${TranslationBase.of(context).patients}",
onTap: () { onTap: () {
// TODO MOSA TEST // TODO MOSA TEST
// PatiantInformtion patient = PatiantInformtion( // PatiantInformtion patient = PatiantInformtion(
@ -438,22 +418,19 @@ class _HomeScreenState extends State<HomeScreen> {
)); ));
changeColorIndex(); changeColorIndex();
if (model.doctorProfile !=null && !Utils.isVidaPlusInPatientProject(projectsProvider, model.doctorProfile!.projectID!)) { if (model.doctorProfile != null && !Utils.isVidaPlusInPatientProject(projectsProvider, model.doctorProfile!.projectID!)) {
patientCards.add(HomePatientCard( patientCards.add(HomePatientCard(
gradient: backgroundColors[colorIndex], gradient: backgroundColors[colorIndex],
backgroundIconColor: backgroundIconColors[colorIndex], backgroundIconColor: backgroundIconColors[colorIndex],
cardIcon: DoctorApp.inpatient, cardIcon: DoctorApp.inpatient,
textColor: textColors[colorIndex], textColor: textColors[colorIndex],
text: TranslationBase text: TranslationBase.of(context).myInPatient,
.of(context)
.myInPatient,
onTap: () { onTap: () {
Navigator.push( Navigator.push(
context, context,
FadePage( FadePage(
page: InPatientScreen( page: InPatientScreen(
specialClinic: model.getSpecialClinic( specialClinic: model.getSpecialClinic(clinicId ?? projectsProvider.doctorClinicsList[0].clinicID),
clinicId ?? projectsProvider.doctorClinicsList[0].clinicID),
), ),
), ),
); );
@ -469,12 +446,10 @@ class _HomeScreenState extends State<HomeScreen> {
cardIcon: DoctorApp.search_medicines, cardIcon: DoctorApp.search_medicines,
textColor: textColors[2], textColor: textColors[2],
text: TranslationBase.of(context).interventionPharmacyApproval, text: TranslationBase.of(context).interventionPharmacyApproval,
fontSize: SizeConfig.getTextMultiplierBasedOnWidth(width: width) * fontSize: SizeConfig.getTextMultiplierBasedOnWidth(width: width) * (SizeConfig.isHeightVeryShort ? 10 : 9),
(SizeConfig.isHeightVeryShort ? 10 : 9),
onTap: () { onTap: () {
if (!model.isInfectiousDiseaseConsultant) { if (!model.isInfectiousDiseaseConsultant) {
DrAppToastMsg.showErrorToast( DrAppToastMsg.showErrorToast(TranslationBase.of(context).unableToPerformTheAction);
TranslationBase.of(context).unableToPerformTheAction);
} }
Navigator.push( Navigator.push(
context, context,
@ -511,19 +486,13 @@ class _HomeScreenState extends State<HomeScreen> {
textColor: textColors[colorIndex], textColor: textColors[colorIndex],
text: TranslationBase.of(context).myOutPatient_2lines, text: TranslationBase.of(context).myOutPatient_2lines,
onTap: () { onTap: () {
String date = AppDateUtils.convertDateToFormat( String date = AppDateUtils.convertDateToFormat(DateTime(DateTime.now().year, DateTime.now().month, DateTime.now().day), 'yyyy-MM-dd');
DateTime(
DateTime.now().year, DateTime.now().month, DateTime.now().day),
'yyyy-MM-dd');
Navigator.push( Navigator.push(
context, context,
MaterialPageRoute( MaterialPageRoute(
builder: (context) => OutPatientsScreen( builder: (context) => OutPatientsScreen(
patientSearchRequestModel: PatientSearchRequestModel( patientSearchRequestModel: PatientSearchRequestModel(from: date, to: date, doctorID: authenticationViewModel.doctorProfile!.doctorID),
from: date,
to: date,
doctorID: authenticationViewModel.doctorProfile!.doctorID),
), ),
settings: RouteSettings(name: 'OutPatientsScreen'), settings: RouteSettings(name: 'OutPatientsScreen'),
)); ));
@ -583,10 +552,7 @@ class _HomeScreenState extends State<HomeScreen> {
)); ));
changeColorIndex(); changeColorIndex();
return [ return [...List.generate(patientCards.length, (index) => patientCards[index]).toList()];
...List.generate(patientCards.length, (index) => patientCards[index])
.toList()
];
} }
changeColorIndex() { changeColorIndex() {
@ -595,15 +561,17 @@ class _HomeScreenState extends State<HomeScreen> {
colorIndex = 0; colorIndex = 0;
} }
} }
void _showErrorBottomSheet(BuildContext context, String errorMessage) { void _showErrorBottomSheet(BuildContext context, String errorMessage) {
showModalBottomSheet( showModalBottomSheet(
isDismissible:true, isDismissible: true,
enableDrag:false, enableDrag: false,
context: context, context: context,
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
borderRadius: BorderRadius.vertical(top: Radius.circular(20)), borderRadius: BorderRadius.vertical(top: Radius.circular(20)),
), ),
backgroundColor: Colors.red[50], // Light red background backgroundColor: Colors.red[50],
// Light red background
builder: (context) { builder: (context) {
return Padding( return Padding(
padding: const EdgeInsets.all(16.0), padding: const EdgeInsets.all(16.0),
@ -615,13 +583,17 @@ class _HomeScreenState extends State<HomeScreen> {
children: [ children: [
Icon(Icons.error_outline, color: Colors.red, size: 40), Icon(Icons.error_outline, color: Colors.red, size: 40),
InkWell( InkWell(
onTap: () { onTap: () {
Navigator.pop(context); Navigator.pop(context);
}, },
child: Padding( child: Padding(
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0),
child: Icon(Icons.close,color: Colors.red,), child: Icon(
)) Icons.close,
color: Colors.red,
),
),
)
], ],
), ),
const SizedBox(height: 10), const SizedBox(height: 10),
@ -637,26 +609,28 @@ class _HomeScreenState extends State<HomeScreen> {
), ),
const SizedBox(height: 15), const SizedBox(height: 15),
SizedBox( SizedBox(
width: SizeConfig.realScreenWidth! * .4, width: SizeConfig.realScreenWidth! * .4,
child:AppButton( child: AppButton(
color: Colors.green, color: Colors.green,
onPressed: () => { // Navigator.pop(context); onPressed: () => {
Navigator.push( // Navigator.pop(context);
context, Navigator.push(
MaterialPageRoute( context,
builder: (context) => PharmacyIntervention(), MaterialPageRoute(
settings: RouteSettings(name: 'PharmacyIntervention'), builder: (context) => PharmacyIntervention(),
))}, settings: RouteSettings(name: 'PharmacyIntervention'),
title: TranslationBase.of(context).open, ))
},
)), title: TranslationBase.of(context).open,
)),
], ],
), ),
); );
}, },
); );
} }
void startZoom(){
void startZoom() {
var zoom = ZoomVideoSdk(); var zoom = ZoomVideoSdk();
InitConfig initConfig = InitConfig( InitConfig initConfig = InitConfig(
domain: "zoom.us", domain: "zoom.us",

@ -74,11 +74,10 @@ class PharmacyInterventionService extends BaseService {
var success = false; var success = false;
await baseAppClient.post(IS_INFECTIOUS_DISEASE_CONSULTANT, await baseAppClient.post(IS_INFECTIOUS_DISEASE_CONSULTANT,
onSuccess: (dynamic response, int statusCode) { onSuccess: (dynamic response, int statusCode) {
success = response['IsInfectiousDiseases']; success = response['IsInfectiousDiseases'];
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
DrAppToastMsg.showErrorToast(error); DrAppToastMsg.showErrorToast(error);
super.error = super.error ?? "" + "\n" + error;
}, body: {}); }, body: {});
return success; return success;
@ -97,8 +96,6 @@ class PharmacyInterventionService extends BaseService {
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
DrAppToastMsg.showErrorToast(error); DrAppToastMsg.showErrorToast(error);
super.error = super.error! + "\n" + error;
}, body: {}); }, body: {});
return success; return success;
} }
@ -125,9 +122,6 @@ class PharmacyInterventionService extends BaseService {
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
DrAppToastMsg.showErrorToast(error); DrAppToastMsg.showErrorToast(error);
super.error = super.error! + "\n" + error;
}, body: request); }, body: request);
return result; return result;
} }
@ -139,11 +133,10 @@ class PharmacyInterventionService extends BaseService {
var result = false; var result = false;
await baseAppClient.post(UPDATE_INFECTIOUS_STATUS, await baseAppClient.post(UPDATE_INFECTIOUS_STATUS,
onSuccess: (dynamic response, int statusCode) { onSuccess: (dynamic response, int statusCode) {
result = response['IsAccepted']; result = response['IsAccepted'] ?? false;
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
DrAppToastMsg.showErrorToast(error); DrAppToastMsg.showErrorToast(error);
super.error = super.error! + "\n" + error;
}, body: request); }, body: request);
return result; return result;
} }
@ -158,8 +151,6 @@ class PharmacyInterventionService extends BaseService {
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
DrAppToastMsg.showErrorToast(error); DrAppToastMsg.showErrorToast(error);
super.error = super.error! + "\n" + error;
}, body: {}); }, body: {});
return station; return station;
} }

@ -95,6 +95,10 @@ class PharmacyInterventionViewModel extends BaseViewModel {
NursingStation? nursingStations; NursingStation? nursingStations;
PharmacyInterventionViewModel(){
getDoctorProfile();
}
// InterventionHistoryList? interventionHistoryList = InterventionHistoryList.fromJson({ // InterventionHistoryList? interventionHistoryList = InterventionHistoryList.fromJson({
// "entityList": [ // "entityList": [
// { // {
@ -568,8 +572,10 @@ class PharmacyInterventionViewModel extends BaseViewModel {
String successMessage = '' String successMessage = ''
}) async { }) async {
Map<String, dynamic>? user = await sharedPref.getObj(LOGGED_IN_USER); Map<String, dynamic>? user = await sharedPref.getObj(LOGGED_IN_USER);
var userId = user?['List_MemberInformation'][0]['MemberID']; var userId = user?['List_MemberInformation'][0]['MemberID'] ?? doctorProfile?.doctorID;
if(userId == null) {
return;
}
var requestJson = { var requestJson = {
"PatientID":currentlySelectedMedication?.patientID ?? '', "PatientID":currentlySelectedMedication?.patientID ?? '',
'AdmissionNo': currentlySelectedMedication?.admissionNo.toString() ?? '', 'AdmissionNo': currentlySelectedMedication?.admissionNo.toString() ?? '',

@ -1,4 +1,23 @@
// import 'package:cloud_firestore/cloud_firestore.dart';
import 'package:cloud_firestore/cloud_firestore.dart';
List<String> monitoredEndpoints = [
"Services/Sentry.svc/REST/MemberLogIN_New",
'Services/DoctorApplication.svc/REST/GetProjectInfo',
'Services/DoctorApplication.svc/REST/DoctorApp_GetDeviceDetailsByIMEI',
'Services/DoctorApplication.svc/REST/SendActivationCodeForDoctorApp',
'Services/DoctorApplication.svc/REST/CheckActivationCodeForDoctorApp',
'Services/Doctors.svc/REST/GetDocProfiles',
'Services/DoctorApplication.svc/REST/DoctorApp_GetDoctorNotRepliedCounts',
'Services/DoctorApplication.svc/REST/GetClinicsForDoctor',
'Services/DoctorApplication.svc/REST/GetDoctorDashboardKPI',
'Services/DoctorApplication.svc/REST/GetSpecialClinicalCareList',
'Services/DoctorApplication.svc/REST/IsInfectiousDiseasesConsultant',
'Services/DoctorApplication.svc/REST/IsInterventionAccessLevel3Pending',
'Services/DoctorApplication.svc/REST/CheckDoctorHasLiveCare',
'Services/DoctorApplication.svc/REST/FetchRadCriticalFinding',
'Services/DoctorApplication.svc/REST/DoctorApp_InsertOrUpdateDeviceDetails'
];
void postFailureResponse({ void postFailureResponse({
required dynamic doctorId, required dynamic doctorId,
@ -16,4 +35,32 @@ void postFailureResponse({
// final firestore = FirebaseFirestore.instance; // final firestore = FirebaseFirestore.instance;
// final collectionRef = firestore.collection(doctorId.toString()); // final collectionRef = firestore.collection(doctorId.toString());
// await collectionRef.doc(DateTime.now().toIso8601String()).set(data); // await collectionRef.doc(DateTime.now().toIso8601String()).set(data);
}
void postRequestAndResponse({
required dynamic doctorId,
required String completeUrl,
required String urlSuffix,
required String request,
required String response,
required String statusCode,
}) async {
if(!monitoredEndpoints.contains(urlSuffix)) {
return;
}
print(" the url is being logged ");
Map<String, String> data = {
"url" : completeUrl,
"request" : request,
"response" : response,
"statusCode" : statusCode,
};
final firestore = FirebaseFirestore.instance;
// Sanitize urlSuffix to be Firestore-safe
final safeSuffix = urlSuffix.replaceAll(RegExp(r'[^a-zA-Z0-9_-]'), '_');
final collectionRef = firestore.collection('doctors')
.doc(doctorId.toString())
.collection(safeSuffix);
await collectionRef.doc(DateTime.now().toIso8601String()).set(data);
} }

@ -11,7 +11,7 @@ description: A new Flutter project.
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
# Read more about iOS versioning at # Read more about iOS versioning at
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
version: 1.4.22+33 version: 1.4.24+1
environment: environment:

Loading…
Cancel
Save