Merge branch 'development_v3.3' of http://34.17.52.79/Haroon6138/diplomatic-quarter into dev_v3.13.6

# Conflicts:
#	ios/Runner.xcodeproj/project.pbxproj
#	ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme
#	lib/core/model/reports/Reports.dart
#	lib/core/service/client/base_app_client.dart
#	lib/core/viewModels/medical/ask_doctor_view_model.dart
#	lib/pages/BookAppointment/BookConfirm.dart
#	lib/pages/BookAppointment/BookSuccess.dart
#	lib/pages/BookAppointment/DoctorProfile.dart
#	lib/pages/BookAppointment/QRCode.dart
#	lib/pages/Covid-DriveThru/Covid-TimeSlots.dart
#	lib/pages/DrawerPages/family/my-family.dart
#	lib/pages/MyAppointments/AppointmentDetails.dart
#	lib/pages/MyAppointments/MyAppointments.dart
#	lib/pages/MyAppointments/widgets/PrescriptionReport.dart
#	lib/pages/ToDoList/ObGyne/ObGyne-TimeSlots.dart
#	lib/pages/ToDoList/ToDo.dart
#	lib/pages/medical/eye/EyeHomePage.dart
#	lib/pages/medical/reports/report_list_widget.dart
#	lib/services/appointment_services/GetDoctorsList.dart
#	lib/uitl/location_util.dart
#	lib/uitl/utils.dart
#	lib/widgets/drawer/app_drawer_widget.dart
#	pubspec.yaml
dev_v3.13.6_voipcall
Sultan khan 2 years ago
commit 30c14c2167

@ -21,10 +21,10 @@ var PACKAGES_ORDER_HISTORY = '/api/orders/items';
var PACKAGES_TAMARA_OPT = '/api/orders/paymentoptions/tamara';
// var BASE_URL = 'http://10.50.100.198:2018/';
// var BASE_URL = 'http://10.50.100.198:4422/';
var BASE_URL = 'https://uat.hmgwebservices.com/';
// var BASE_URL = 'https://uat.hmgwebservices.com/';
// var BASE_URL = 'https://hmgwebservices.com/';
// var BASE_URL = 'http://10.20.200.111:1010/';
// var BASE_URL = 'https://uat.hmgwebservices.com/';
var BASE_URL = 'https://uat.hmgwebservices.com/';
// var BASE_URL = 'https://hmgwebservices.com/';
// var BASE_URL = 'https://orash.cloudsolutions.com.sa/';
// var BASE_URL = 'https://vidauat.cloudsolutions.com.sa/';
@ -343,7 +343,7 @@ var UPDATE_COVID_QUESTIONNAIRE = 'Services/Doctors.svc/REST/COVID19_Questionnari
var CHANNEL = 3;
var GENERAL_ID = 'Cs2020@2016\$2958';
var IP_ADDRESS = '10.20.10.20';
var VERSION_ID = 11.8;
var VERSION_ID = 11.9;
var SETUP_ID = '91877';
var LANGUAGE = 2;
// var PATIENT_OUT_SA = 0;

@ -5,6 +5,7 @@ class Reports {
DateTime? encounterDate;
int? projectID;
int? invoiceNo;
dynamic invoiceNo_VP;
int? encounterNo;
String? procedureId;
int? requestType;
@ -35,6 +36,7 @@ class Reports {
this.encounterDate,
this.projectID,
this.invoiceNo,
this.invoiceNo_VP,
this.encounterNo,
this.procedureId,
this.requestType,
@ -63,10 +65,10 @@ class Reports {
Reports.fromJson(Map<String, dynamic> json) {
try {
status = json['Status'];
encounterDate = DateUtil.convertStringToDate(
json['EncounterDate']); //json['EncounterDate'];
encounterDate = DateUtil.convertStringToDate(json['EncounterDate']); //json['EncounterDate'];
projectID = json['ProjectID'];
invoiceNo = json['InvoiceNo'];
invoiceNo_VP = json['InvoiceNo_VP'];
encounterNo = json['EncounterNo'];
procedureId = json['ProcedureId'];
requestType = json['RequestType'];
@ -74,11 +76,9 @@ class Reports {
patientID = json['PatientID'];
doctorID = json['DoctorID'];
clinicID = json['ClinicID'];
requestDate = DateUtil.convertStringToDate(
json['RequestDate']); //json['RequestDate'];
requestDate = DateUtil.convertStringToDate(json['RequestDate']); //json['RequestDate'];
isRead = json['IsRead'];
isReadOn =
DateUtil.convertStringToDate(json['IsReadOn']); //json['IsReadOn'];
isReadOn = DateUtil.convertStringToDate(json['IsReadOn']); //json['IsReadOn'];
actualDoctorRate = json['ActualDoctorRate'];
clinicDescription = json['ClinicDescription'];
clinicDescriptionN = json['ClinicDescriptionN'];
@ -93,7 +93,7 @@ class Reports {
noOfPatientsRate = json['NoOfPatientsRate'];
projectName = json['ProjectName'];
projectNameN = json['ProjectNameN'];
}catch(e){
} catch (e) {
print(e);
}
}
@ -104,6 +104,7 @@ class Reports {
data['EncounterDate'] = this.encounterDate;
data['ProjectID'] = this.projectID;
data['InvoiceNo'] = this.invoiceNo;
data['InvoiceNo_VP'] = this.invoiceNo_VP;
data['EncounterNo'] = this.encounterNo;
data['ProcedureId'] = this.procedureId;
data['RequestType'] = this.requestType;
@ -135,7 +136,7 @@ class Reports {
class ReportsList {
String? filterName = "";
List<Reports> reportsList =[];
List<Reports> reportsList = [];
ReportsList({this.filterName, Reports? reports}) {
reportsList.add(reports!);

@ -30,8 +30,7 @@ AppSharedPreferences sharedPref = new AppSharedPreferences();
/// onFailure: (String error, int statusCode) {},
/// body: Map();
///
AuthenticatedUserObject authenticatedUserObject =
locator<AuthenticatedUserObject>();
AuthenticatedUserObject authenticatedUserObject = locator<AuthenticatedUserObject>();
VitalSignService _vitalSignService = locator<VitalSignService>();
class BaseAppClient {
@ -55,17 +54,12 @@ class BaseAppClient {
url = BASE_URL + endPoint;
}
try {
String? pharmacyToken =
await sharedPref.getString(PHARMACY_AUTORZIE_TOKEN);
String? pharmacyToken = await sharedPref.getString(PHARMACY_AUTORZIE_TOKEN);
var user = await sharedPref.getObject(USER_PROFILE);
Map<String, String> headers = {
'Content-Type': 'application/json',
'Accept': 'application/json'
};
Map<String, String> headers = {'Content-Type': 'application/json', 'Accept': 'application/json'};
if (!isExternal) {
String? token = await sharedPref.getString(TOKEN);
String? languageID =
await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
String? languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
if (endPoint == SEND_ACTIVATION_CODE) {
languageID = 'en';
}
@ -81,24 +75,19 @@ class BaseAppClient {
body['Channel'] = CHANNEL;
if (body.containsKey('LanguageID')) {
if(body['LanguageID'] != null) {
if (body['LanguageID'] != null) {
//change this line because language issue happened on dental
body['LanguageID'] = body['LanguageID'] =='ar' ? 1 : body['LanguageID'] =='en' ? 2 : body['LanguageID'];
body['LanguageID'] = body['LanguageID'] == 'ar'
? 1
: body['LanguageID'] == 'en'
? 2
: body['LanguageID'];
} else {
body['LanguageID'] =
Provider.of<ProjectViewModel>(AppGlobal.context, listen: false)
.isArabic
? 1
: 2;
body['LanguageID'] = Provider.of<ProjectViewModel>(AppGlobal.context, listen: false).isArabic ? 1 : 2;
}
} else {
// body['LanguageID'] = (languageID.toString().toLowerCase() == 'ar' ? 1 : 2);
body['LanguageID'] =
Provider.of<ProjectViewModel>(AppGlobal.context, listen: false)
.isArabic
? 1
: 2;
body['LanguageID'] = Provider.of<ProjectViewModel>(AppGlobal.context, listen: false).isArabic ? 1 : 2;
}
// body['LanguageID'] = Provider.of<ProjectViewModel>(AppGlobal.context, listen: false).isArabic ? 1 : 2;
@ -114,12 +103,11 @@ class BaseAppClient {
body['Longitude'] = long;
if (body.containsKey('isDentalAllowedBackend')) {
body['isDentalAllowedBackend'] =
body.containsKey('isDentalAllowedBackend')
? body['isDentalAllowedBackend'] != null
? body['isDentalAllowedBackend']
: IS_DENTAL_ALLOWED_BACKEND
: IS_DENTAL_ALLOWED_BACKEND;
body['isDentalAllowedBackend'] = body.containsKey('isDentalAllowedBackend')
? body['isDentalAllowedBackend'] != null
? body['isDentalAllowedBackend']
: IS_DENTAL_ALLOWED_BACKEND
: IS_DENTAL_ALLOWED_BACKEND;
}
body['DeviceTypeID'] = Platform.isIOS
@ -163,16 +151,15 @@ class BaseAppClient {
if (user != null) {
body['TokenID'] = body['TokenID'] != null ? body['TokenID'] : token;
body['PatientID'] = body['PatientID'] != null
? body['PatientID']
: user['PatientID'];
body['PatientID'] = body['PatientID'] != null ? body['PatientID'] : user['PatientID'];
body['PatientOutSA'] = body.containsKey('PatientOutSA')
? body['PatientOutSA'] != null
? body['PatientOutSA']
: user['OutSA']
: user['OutSA'];
body['SessionID'] = getSessionId(body['TokenID']); //getSe
body['SessionID'] = getSessionId(body['TokenID'] != null ? body['TokenID'] : ""); //getSe
// body['SessionID'] = body['TokenID']; //getSe
// headers = {
// 'Content-Type': 'application/json',
@ -188,7 +175,7 @@ class BaseAppClient {
// body['IdentificationNo'] = 1023854217;
// body['MobileNo'] = "531940021";
// body['PatientID'] = 291367; //3844083
// body['PatientID'] = 1400563; //3844083
// body['TokenID'] = "@dm!n";
// Patient ID: 3027574
@ -203,15 +190,12 @@ class BaseAppClient {
print(jsonBody);
// }
if (await Utils.checkConnection(
bypassConnectionCheck: bypassConnectionCheck)) {
final response = await http.post(Uri.parse(url.trim()),
body: json.encode(body), headers: headers);
if (await Utils.checkConnection(bypassConnectionCheck: bypassConnectionCheck)) {
final response = await http.post(Uri.parse(url.trim()), body: json.encode(body), headers: headers);
final int statusCode = response.statusCode;
if (statusCode < 200 || statusCode >= 400 || json == null) {
onFailure('Error While Fetching data', statusCode);
logApiEndpointError(
endPoint, 'Error While Fetching data', statusCode);
logApiEndpointError(endPoint, 'Error While Fetching data', statusCode);
} else {
// var decoded = utf8.decode(response.bodyBytes);
var parsed = json.decode(utf8.decode(response.bodyBytes));
@ -225,12 +209,8 @@ class BaseAppClient {
onSuccess(parsed, statusCode);
} else {
if (parsed['ErrorType'] == 4) {
navigateToAppUpdate(
AppGlobal.context, parsed['ErrorEndUserMessage']);
logApiEndpointError(
endPoint,
parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'],
statusCode);
navigateToAppUpdate(AppGlobal.context, parsed['ErrorEndUserMessage']);
logApiEndpointError(endPoint, parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], statusCode);
}
if (parsed['ErrorType'] == 2) {
await logout();
@ -249,46 +229,28 @@ class BaseAppClient {
// if (parsed != null) {
// onSuccess(parsed, statusCode);
// } else {
onFailure(
parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'],
statusCode);
logApiEndpointError(
endPoint,
parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'],
statusCode);
onFailure(parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], statusCode);
logApiEndpointError(endPoint, parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], statusCode);
// logout();
// }
}
} else if (parsed['MessageStatus'] == 1 ||
parsed['SMSLoginRequired'] == true) {
} else if (parsed['MessageStatus'] == 1 || parsed['SMSLoginRequired'] == true) {
onSuccess(parsed, statusCode);
} else if (parsed['MessageStatus'] == 2 &&
parsed['IsAuthenticated']) {
} else if (parsed['MessageStatus'] == 2 && parsed['IsAuthenticated']) {
if (parsed['SameClinicApptList'] != null) {
onSuccess(parsed, statusCode);
} else {
if (parsed['message'] == null &&
parsed['ErrorEndUserMessage'] == null) {
if (parsed['message'] == null && parsed['ErrorEndUserMessage'] == null) {
if (parsed['ErrorSearchMsg'] == null) {
onFailure("Server Error found with no available message",
statusCode);
logApiEndpointError(
endPoint,
"Server Error found with no available message",
statusCode);
onFailure("Server Error found with no available message", statusCode);
logApiEndpointError(endPoint, "Server Error found with no available message", statusCode);
} else {
onFailure(parsed['ErrorSearchMsg'], statusCode);
logApiEndpointError(
endPoint, parsed['ErrorSearchMsg'], statusCode);
logApiEndpointError(endPoint, parsed['ErrorSearchMsg'], statusCode);
}
} else {
onFailure(
parsed['message'] ??
parsed['ErrorEndUserMessage'] ??
parsed['ErrorMessage'],
statusCode);
logApiEndpointError(endPoint,
parsed['message'] ?? parsed['message'], statusCode);
onFailure(parsed['message'] ?? parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], statusCode);
logApiEndpointError(endPoint, parsed['message'] ?? parsed['message'], statusCode);
}
}
}
@ -300,18 +262,11 @@ class BaseAppClient {
onSuccess(parsed, statusCode);
} else {
if (parsed['message'] != null) {
onFailure(
parsed['message'] ?? parsed['message'], statusCode);
logApiEndpointError(endPoint,
parsed['message'] ?? parsed['message'], statusCode);
onFailure(parsed['message'] ?? parsed['message'], statusCode);
logApiEndpointError(endPoint, parsed['message'] ?? parsed['message'], statusCode);
} else {
onFailure(
parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'],
statusCode);
logApiEndpointError(
endPoint,
parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'],
statusCode);
onFailure(parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], statusCode);
logApiEndpointError(endPoint, parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], statusCode);
}
}
}
@ -320,8 +275,7 @@ class BaseAppClient {
}
} else {
onFailure('Please Check The Internet Connection', -1);
_analytics.errorTracking
.log("internet_connectivity", error: "no internet available");
_analytics.errorTracking.log("internet_connectivity", error: "no internet available");
}
} catch (e) {
print(e);
@ -331,11 +285,7 @@ class BaseAppClient {
}
postPharmacy(String endPoint,
{Map<String, dynamic>? body,
Function(dynamic response, int statusCode)? onSuccess,
Function(String error, int statusCode)? onFailure,
bool isAllowAny = false,
bool isExternal = false}) async {
{Map<String, dynamic>? body, Function(dynamic response, int statusCode)? onSuccess, Function(String error, int statusCode)? onFailure, bool isAllowAny = false, bool isExternal = false}) async {
var token = await sharedPref.getString(PHARMACY_AUTORZIE_TOKEN);
var user = await sharedPref.getObject(USER_PROFILE);
String url;
@ -352,16 +302,13 @@ class BaseAppClient {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': pharmacyToken ?? '',
'Mobilenumber': user != null
? Utils.getPhoneNumberWithoutZero(user['MobileNumber'].toString())
: "",
'Mobilenumber': user != null ? Utils.getPhoneNumberWithoutZero(user['MobileNumber'].toString()) : "",
'Statictoken': 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9',
'Username': user != null ? user['PatientID'].toString() : "",
};
if (!isExternal) {
String token = await sharedPref.getString(TOKEN);
var languageID =
await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
// if (body.containsKey('SetupID')) {
// body['SetupID'] = body.containsKey('SetupID')
@ -423,14 +370,12 @@ class BaseAppClient {
print("Headers : ${json.encode(headers)}");
if (await Utils.checkConnection()) {
final response = await http.post(Uri.parse(url.trim()),
body: json.encode(body), headers: headers);
final response = await http.post(Uri.parse(url.trim()), body: json.encode(body), headers: headers);
final int statusCode = response.statusCode;
// print("statusCode :$statusCode");
if (statusCode < 200 || statusCode >= 400 || json == null) {
onFailure!('Error While Fetching data', statusCode);
logApiEndpointError(
endPoint, 'Error While Fetching data', statusCode);
logApiEndpointError(endPoint, 'Error While Fetching data', statusCode);
} else {
// var parsed = json.decode(response.body.toString());
var parsed = json.decode(utf8.decode(response.bodyBytes));
@ -438,12 +383,8 @@ class BaseAppClient {
onSuccess!(parsed, statusCode);
} else {
if (parsed['ErrorType'] == 4) {
navigateToAppUpdate(
AppGlobal.context, parsed['ErrorEndUserMessage']);
logApiEndpointError(
endPoint,
parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'],
statusCode);
navigateToAppUpdate(AppGlobal.context, parsed['ErrorEndUserMessage']);
logApiEndpointError(endPoint, parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], statusCode);
}
if (isAllowAny) {
onSuccess!(parsed, statusCode);
@ -458,56 +399,29 @@ class BaseAppClient {
if (parsed != null) {
onSuccess!(parsed, statusCode);
} else {
onFailure!(
parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'],
statusCode);
logApiEndpointError(
endPoint,
parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'],
statusCode);
logApiEndpointError(
endPoint, 'session logged out', statusCode);
onFailure!(parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], statusCode);
logApiEndpointError(endPoint, parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], statusCode);
logApiEndpointError(endPoint, 'session logged out', statusCode);
logout();
}
}
} else if (parsed['MessageStatus'] == 1 ||
parsed['SMSLoginRequired'] == true) {
} else if (parsed['MessageStatus'] == 1 || parsed['SMSLoginRequired'] == true) {
onSuccess!(parsed, statusCode);
} else if (parsed['MessageStatus'] == 2 &&
parsed['IsAuthenticated']) {
} else if (parsed['MessageStatus'] == 2 && parsed['IsAuthenticated']) {
if (parsed['SameClinicApptList'] != null) {
onSuccess!(parsed, statusCode);
} else {
if (parsed['message'] == null &&
parsed['ErrorEndUserMessage'] == null) {
if (parsed['message'] == null && parsed['ErrorEndUserMessage'] == null) {
if (parsed['ErrorSearchMsg'] == null) {
onFailure!("Server Error found with no available message",
statusCode);
logApiEndpointError(
endPoint,
"Server Error found with no available message",
statusCode);
onFailure!("Server Error found with no available message", statusCode);
logApiEndpointError(endPoint, "Server Error found with no available message", statusCode);
} else {
onFailure!(parsed['ErrorSearchMsg'], statusCode);
logApiEndpointError(
endPoint,
parsed['ErrorSearchMsg'] ??
parsed['ErrorEndUserMessage'] ??
parsed['ErrorMessage'],
statusCode);
logApiEndpointError(endPoint, parsed['ErrorSearchMsg'] ?? parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], statusCode);
}
} else {
onFailure!(
parsed['message'] ??
parsed['ErrorEndUserMessage'] ??
parsed['ErrorMessage'],
statusCode);
logApiEndpointError(
endPoint,
parsed['message'] ??
parsed['ErrorEndUserMessage'] ??
parsed['ErrorMessage'],
statusCode);
onFailure!(parsed['message'] ?? parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], statusCode);
logApiEndpointError(endPoint, parsed['message'] ?? parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], statusCode);
}
}
} else if (!parsed['IsAuthenticated']) {
@ -519,22 +433,11 @@ class BaseAppClient {
onSuccess!(parsed, statusCode);
} else {
if (parsed['message'] != null) {
onFailure!(
parsed['message'] ?? parsed['message'], statusCode);
logApiEndpointError(
endPoint,
parsed['message'] ??
parsed['ErrorEndUserMessage'] ??
parsed['ErrorMessage'],
statusCode);
onFailure!(parsed['message'] ?? parsed['message'], statusCode);
logApiEndpointError(endPoint, parsed['message'] ?? parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], statusCode);
} else {
onFailure!(
parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'],
statusCode);
logApiEndpointError(
endPoint,
parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'],
statusCode);
onFailure!(parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], statusCode);
logApiEndpointError(endPoint, parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], statusCode);
}
}
}
@ -542,8 +445,7 @@ class BaseAppClient {
}
} else {
onFailure!('Please Check The Internet Connection', -1);
_analytics.errorTracking
.log("internet_connectivity", error: "no internet available");
_analytics.errorTracking.log("internet_connectivity", error: "no internet available");
}
} catch (e) {
print(e);
@ -555,8 +457,7 @@ class BaseAppClient {
Future navigateToAppUpdate(context, String text) async {
Navigator.pushAndRemoveUntil(
context,
MaterialPageRoute(
builder: (context) => AppUpdatePage(appUpdateText: text)),
MaterialPageRoute(builder: (context) => AppUpdatePage(appUpdateText: text)),
(Route<dynamic> route) => false,
);
}
@ -587,10 +488,7 @@ class BaseAppClient {
if (await Utils.checkConnection()) {
final response = await http.get(
Uri.parse(url.trim()),
headers: {
'Content-Type': 'application/json',
'Accept': 'application/json'
},
headers: {'Content-Type': 'application/json', 'Accept': 'application/json'},
);
final int statusCode = response.statusCode;
// print("statusCode :$statusCode");
@ -604,8 +502,7 @@ class BaseAppClient {
}
} else {
onFailure!('Please Check The Internet Connection', -1);
_analytics.errorTracking
.log("internet_connectivity", error: "no internet available");
_analytics.errorTracking.log("internet_connectivity", error: "no internet available");
}
}
@ -637,9 +534,7 @@ class BaseAppClient {
'Content-Type': 'text/html; charset=utf-8',
'Accept': 'application/json',
'Authorization': token ?? '',
'Mobilenumber': user != null
? Utils.getPhoneNumberWithoutZero(user['MobileNumber'].toString())
: "",
'Mobilenumber': user != null ? Utils.getPhoneNumberWithoutZero(user['MobileNumber'].toString()) : "",
'Statictoken': 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9',
'Username': user != null ? user['PatientID'].toString() : "",
// 'Host': "mdlaboratories.com",
@ -649,19 +544,14 @@ class BaseAppClient {
if (statusCode < 200 || statusCode >= 400 || json == null) {
if (statusCode == 401) {
onFailure!(TranslationBase.of(AppGlobal.context).pharmacyRelogin,
statusCode);
logApiEndpointError(
endPoint,
TranslationBase.of(AppGlobal.context).pharmacyRelogin,
statusCode);
onFailure!(TranslationBase.of(AppGlobal.context).pharmacyRelogin, statusCode);
logApiEndpointError(endPoint, TranslationBase.of(AppGlobal.context).pharmacyRelogin, statusCode);
Navigator.of(AppGlobal.context).pushNamed(HOME);
} else {
var bodyUtf = json.decode(utf8.decode(response.bodyBytes));
// print(bodyUtf);
onFailure!(bodyUtf['error']['ErrorEndUserMsg'], statusCode);
logApiEndpointError(
endPoint, bodyUtf['error']['ErrorEndUserMsg'], statusCode);
logApiEndpointError(endPoint, bodyUtf['error']['ErrorEndUserMsg'], statusCode);
}
} else {
// var parsed = json.decode(response.body.toString());
@ -670,8 +560,7 @@ class BaseAppClient {
}
} else {
onFailure!('Please Check The Internet Connection', -1);
_analytics.errorTracking
.log("internet_connectivity", error: "no internet available");
_analytics.errorTracking.log("internet_connectivity", error: "no internet available");
}
}
@ -687,8 +576,7 @@ class BaseAppClient {
// print("body: $body");
if (await Utils.checkConnection()) {
headers!.addAll(
{'Content-Type': 'application/json', 'Accept': 'application/json'});
headers!.addAll({'Content-Type': 'application/json', 'Accept': 'application/json'});
final response = await http.post(
Uri.parse(url.trim()),
body: json.encode(body),
@ -696,12 +584,7 @@ class BaseAppClient {
);
final int statusCode = response.statusCode;
// print("statusCode :$statusCode");
if (await handleUnauthorized(statusCode, forUrl: fullUrl))
simplePost(fullUrl,
onFailure: onFailure,
onSuccess: onSuccess,
body: body,
headers: headers);
if (await handleUnauthorized(statusCode, forUrl: fullUrl)) simplePost(fullUrl, onFailure: onFailure, onSuccess: onSuccess, body: body, headers: headers);
// print(response.body.toString());
@ -713,16 +596,12 @@ class BaseAppClient {
}
} else {
onFailure!('Please Check The Internet Connection', -1);
_analytics.errorTracking
.log("internet_connectivity", error: "no internet available");
_analytics.errorTracking.log("internet_connectivity", error: "no internet available");
}
}
simpleGet(String fullUrl,
{Function(dynamic response, int statusCode)? onSuccess,
Function(String error, int statusCode)? onFailure,
Map<String, dynamic>? queryParams,
Map<String, String>? headers}) async {
{Function(dynamic response, int statusCode)? onSuccess, Function(String error, int statusCode)? onFailure, Map<String, dynamic>? queryParams, Map<String, String>? headers}) async {
headers = headers ?? {};
String url = fullUrl;
@ -734,8 +613,7 @@ class BaseAppClient {
}
if (await Utils.checkConnection()) {
headers.addAll(
{'Content-Type': 'application/json', 'Accept': 'application/json'});
headers.addAll({'Content-Type': 'application/json', 'Accept': 'application/json'});
final response = await http.get(
Uri.parse(url.trim()),
headers: headers,
@ -743,12 +621,7 @@ class BaseAppClient {
final int statusCode = response.statusCode;
// print("statusCode :$statusCode");
if (await handleUnauthorized(statusCode, forUrl: fullUrl))
simpleGet(fullUrl,
onFailure: onFailure,
onSuccess: onSuccess,
headers: headers,
queryParams: queryParams);
if (await handleUnauthorized(statusCode, forUrl: fullUrl)) simpleGet(fullUrl, onFailure: onFailure, onSuccess: onSuccess, headers: headers, queryParams: queryParams);
if (statusCode < 200 || statusCode >= 400 || json == null) {
onFailure!('Error While Fetching data', statusCode);
@ -758,22 +631,17 @@ class BaseAppClient {
}
} else {
onFailure!('Please Check The Internet Connection', -1);
_analytics.errorTracking
.log("internet_connectivity", error: "no internet available");
_analytics.errorTracking.log("internet_connectivity", error: "no internet available");
}
}
simplePut(String fullUrl,
{Map<String, dynamic>? body,
Map<String, String>? headers,
Function(dynamic response, int statusCode)? onSuccess,
Function(String error, int statusCode)? onFailure}) async {
{Map<String, dynamic>? body, Map<String, String>? headers, Function(dynamic response, int statusCode)? onSuccess, Function(String error, int statusCode)? onFailure}) async {
String url = fullUrl;
// print("URL Query String: $url");
if (await Utils.checkConnection()) {
headers!.addAll(
{'Content-Type': 'application/json', 'Accept': 'application/json'});
headers!.addAll({'Content-Type': 'application/json', 'Accept': 'application/json'});
final response = await http.put(
Uri.parse(url.trim()),
body: json.encode(body),
@ -782,12 +650,7 @@ class BaseAppClient {
final int statusCode = response.statusCode;
// print("statusCode :$statusCode");
if (await handleUnauthorized(statusCode, forUrl: fullUrl))
simplePut(fullUrl,
onFailure: onFailure,
onSuccess: onSuccess,
headers: headers,
body: body);
if (await handleUnauthorized(statusCode, forUrl: fullUrl)) simplePut(fullUrl, onFailure: onFailure, onSuccess: onSuccess, headers: headers, body: body);
if (statusCode < 200 || statusCode >= 400 || json == null) {
onFailure!('Error While Fetching data', statusCode);
@ -797,16 +660,12 @@ class BaseAppClient {
}
} else {
onFailure!('Please Check The Internet Connection', -1);
_analytics.errorTracking
.log("internet_connectivity", error: "no internet available");
_analytics.errorTracking.log("internet_connectivity", error: "no internet available");
}
}
simpleDelete(String fullUrl,
{Function(dynamic response, int statusCode)? onSuccess,
Function(String error, int statusCode)? onFailure,
Map<String, String>? queryParams,
Map<String, String>? headers}) async {
{Function(dynamic response, int statusCode)? onSuccess, Function(String error, int statusCode)? onFailure, Map<String, String>? queryParams, Map<String, String>? headers}) async {
String url = fullUrl;
// print("URL Query String: $url");
@ -818,8 +677,7 @@ class BaseAppClient {
}
if (await Utils.checkConnection()) {
headers!.addAll(
{'Content-Type': 'application/json', 'Accept': 'application/json'});
headers!.addAll({'Content-Type': 'application/json', 'Accept': 'application/json'});
final response = await http.delete(
Uri.parse(url.trim()),
headers: headers,
@ -827,12 +685,7 @@ class BaseAppClient {
final int statusCode = response.statusCode;
// print("statusCode :$statusCode");
if (await handleUnauthorized(statusCode, forUrl: fullUrl))
simpleDelete(fullUrl,
onFailure: onFailure,
onSuccess: onSuccess,
queryParams: queryParams,
headers: headers);
if (await handleUnauthorized(statusCode, forUrl: fullUrl)) simpleDelete(fullUrl, onFailure: onFailure, onSuccess: onSuccess, queryParams: queryParams, headers: headers);
if (statusCode < 200 || statusCode >= 400 || json == null) {
onFailure!('Error While Fetching data', statusCode);
@ -842,13 +695,11 @@ class BaseAppClient {
}
} else {
onFailure!('Please Check The Internet Connection', -1);
_analytics.errorTracking
.log("internet_connectivity", error: "no internet available");
_analytics.errorTracking.log("internet_connectivity", error: "no internet available");
}
}
Future<bool> handleUnauthorized(int statusCode,
{required String forUrl}) async {
Future<bool> handleUnauthorized(int statusCode, {required String forUrl}) async {
if (forUrl.startsWith(EXA_CART_API_BASE_URL) && statusCode == 401) {
final token = await generatePackagesToken();
packagesAuthHeader['Authorization'] = 'Bearer $token';
@ -861,10 +712,8 @@ class BaseAppClient {
await sharedPref.remove(LOGIN_TOKEN_ID);
await sharedPref.remove(PHARMACY_CUSTOMER_ID);
await authenticatedUserObject.getUser();
Provider.of<ProjectViewModel>(AppGlobal.context, listen: false).isLogin =
false;
var model =
Provider.of<ToDoCountProviderModel>(AppGlobal.context, listen: false);
Provider.of<ProjectViewModel>(AppGlobal.context, listen: false).isLogin = false;
var model = Provider.of<ToDoCountProviderModel>(AppGlobal.context, listen: false);
_vitalSignService.weightKg = "";
_vitalSignService.heightCm = "";
model.setState(0, 0, false, null);
@ -873,13 +722,13 @@ class BaseAppClient {
String getSessionId(String id) {
///return id.replaceAll(RegExp('/[^\w\s]/'), '');
// if (id != null) return id.replaceAll(RegExp('/[^a-zA-Z]'), '');
return id.replaceAll(RegExp('/[^a-zA-Z]'), '');
}
static defaultHttpParameters() async {
String token = await sharedPref.getString(TOKEN);
var languageID =
await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
var user = await sharedPref.getObject(USER_PROFILE);
var params = {};
if (user != null) {
@ -899,11 +748,7 @@ class BaseAppClient {
}
pharmacyPost(String endPoint,
{Map<String, dynamic>? body,
Function(dynamic response, int statusCode)? onSuccess,
Function(String error, int statusCode)? onFailure,
bool isAllowAny = false,
bool isExternal = false}) async {
{Map<String, dynamic>? body, Function(dynamic response, int statusCode)? onSuccess, Function(String error, int statusCode)? onFailure, bool isAllowAny = false, bool isExternal = false}) async {
var token = await sharedPref.getString(PHARMACY_AUTORZIE_TOKEN);
var user = await sharedPref.getObject(USER_PROFILE);
String url;
@ -915,8 +760,7 @@ class BaseAppClient {
try {
if (isExternal) {
String token = await sharedPref.getString(TOKEN);
var languageID =
await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
var user = await sharedPref.getObject(USER_PROFILE);
if (body!.containsKey('SetupID')) {
body['SetupID'] = body.containsKey('SetupID')
@ -939,12 +783,11 @@ class BaseAppClient {
: user['OutSA'];
if (body.containsKey('isDentalAllowedBackend')) {
body['isDentalAllowedBackend'] =
body.containsKey('isDentalAllowedBackend')
? body['isDentalAllowedBackend'] != null
? body['isDentalAllowedBackend']
: IS_DENTAL_ALLOWED_BACKEND
: IS_DENTAL_ALLOWED_BACKEND;
body['isDentalAllowedBackend'] = body.containsKey('isDentalAllowedBackend')
? body['isDentalAllowedBackend'] != null
? body['isDentalAllowedBackend']
: IS_DENTAL_ALLOWED_BACKEND
: IS_DENTAL_ALLOWED_BACKEND;
}
body['DeviceTypeID'] = Platform.isAndroid ? 1 : 2;
@ -967,9 +810,7 @@ class BaseAppClient {
: user['PatientType'];
if (user != null) {
body['TokenID'] = token;
body['PatientID'] = body['PatientID'] != null
? body['PatientID']
: user['PatientID'];
body['PatientID'] = body['PatientID'] != null ? body['PatientID'] : user['PatientID'];
body['PatientOutSA'] = user['OutSA'];
// body['SessionID'] = SESSION_ID; //getSessionId(token);
}
@ -981,14 +822,11 @@ class BaseAppClient {
var ss = json.encode(body);
if (await Utils.checkConnection()) {
final response = await http
.post(Uri.parse(url.trim()), body: json.encode(body), headers: {
final response = await http.post(Uri.parse(url.trim()), body: json.encode(body), headers: {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': token ?? '',
'Mobilenumber': user != null
? Utils.getPhoneNumberWithoutZero(user['MobileNumber'].toString())
: "",
'Mobilenumber': user != null ? Utils.getPhoneNumberWithoutZero(user['MobileNumber'].toString()) : "",
'Statictoken': 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9',
'Username': user != null ? user['PatientID'].toString() : "",
});
@ -996,15 +834,8 @@ class BaseAppClient {
// print("statusCode :$statusCode");
if (statusCode < 200 || statusCode >= 400 || json == null) {
var parsed = json.decode(utf8.decode(response.bodyBytes));
onFailure!(
parsed['error']['ErrorEndUserMsgN'] ??
'Error While Fetching data',
statusCode);
logApiEndpointError(
endPoint,
parsed['error']['ErrorEndUserMsgN'] ??
'Error While Fetching data',
statusCode);
onFailure!(parsed['error']['ErrorEndUserMsgN'] ?? 'Error While Fetching data', statusCode);
logApiEndpointError(endPoint, parsed['error']['ErrorEndUserMsgN'] ?? 'Error While Fetching data', statusCode);
} else {
// var parsed = json.decode(response.body.toString());
var parsed = json.decode(utf8.decode(response.bodyBytes));
@ -1012,8 +843,7 @@ class BaseAppClient {
onSuccess!(parsed, statusCode);
} else {
if (parsed['ErrorType'] == 4) {
navigateToAppUpdate(
AppGlobal.context, parsed['ErrorEndUserMessage']);
navigateToAppUpdate(AppGlobal.context, parsed['ErrorEndUserMessage']);
}
if (isAllowAny) {
onSuccess!(parsed, statusCode);
@ -1028,47 +858,25 @@ class BaseAppClient {
if (parsed != null) {
onSuccess!(parsed, statusCode);
} else {
onFailure!(
parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'],
statusCode);
logApiEndpointError(
endPoint,
parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'],
statusCode);
onFailure!(parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], statusCode);
logApiEndpointError(endPoint, parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], statusCode);
logout();
}
}
} else if (parsed['MessageStatus'] == 1 ||
parsed['SMSLoginRequired'] == true) {
} else if (parsed['MessageStatus'] == 1 || parsed['SMSLoginRequired'] == true) {
onSuccess!(parsed, statusCode);
} else if (parsed['MessageStatus'] == 2 &&
parsed['IsAuthenticated']) {
if (parsed['message'] == null &&
parsed['ErrorEndUserMessage'] == null) {
} else if (parsed['MessageStatus'] == 2 && parsed['IsAuthenticated']) {
if (parsed['message'] == null && parsed['ErrorEndUserMessage'] == null) {
if (parsed['ErrorSearchMsg'] == null) {
onFailure!("Server Error found with no available message",
statusCode);
logApiEndpointError(
endPoint,
"Server Error found with no available message",
statusCode);
onFailure!("Server Error found with no available message", statusCode);
logApiEndpointError(endPoint, "Server Error found with no available message", statusCode);
} else {
onFailure!(parsed['ErrorSearchMsg'], statusCode);
logApiEndpointError(
endPoint, parsed['ErrorSearchMsg'], statusCode);
logApiEndpointError(endPoint, parsed['ErrorSearchMsg'], statusCode);
}
} else {
onFailure!(
parsed['message'] ??
parsed['ErrorEndUserMessage'] ??
parsed['ErrorMessage'],
statusCode);
logApiEndpointError(
endPoint,
parsed['message'] ??
parsed['ErrorEndUserMessage'] ??
parsed['ErrorMessage'],
statusCode);
onFailure!(parsed['message'] ?? parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], statusCode);
logApiEndpointError(endPoint, parsed['message'] ?? parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], statusCode);
}
} else if (!parsed['IsAuthenticated']) {
await logout();
@ -1079,18 +887,11 @@ class BaseAppClient {
onSuccess!(parsed, statusCode);
} else {
if (parsed['message'] != null) {
onFailure!(
parsed['message'] ?? parsed['message'], statusCode);
logApiEndpointError(endPoint,
parsed['message'] ?? parsed['message'], statusCode);
onFailure!(parsed['message'] ?? parsed['message'], statusCode);
logApiEndpointError(endPoint, parsed['message'] ?? parsed['message'], statusCode);
} else {
onFailure!(
parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'],
statusCode);
logApiEndpointError(
endPoint,
parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'],
statusCode);
onFailure!(parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], statusCode);
logApiEndpointError(endPoint, parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], statusCode);
}
}
}
@ -1098,8 +899,7 @@ class BaseAppClient {
}
} else {
onFailure!('Please Check The Internet Connection', -1);
_analytics.errorTracking
.log("internet_connectivity", error: "no internet available");
_analytics.errorTracking.log("internet_connectivity", error: "no internet available");
}
} catch (e) {
print(e);
@ -1111,15 +911,11 @@ class BaseAppClient {
Future<String> generatePackagesToken() async {
var url = EXA_CART_API_BASE_URL + PACKAGES_TOKEN;
var body = {
"api_client": {
"client_id": "a4ab6be4-424f-4836-b032-46caed88e184",
"client_secret": "3c1a3e07-4a40-4510-9fb0-ee5f0a72752c"
}
"api_client": {"client_id": "a4ab6be4-424f-4836-b032-46caed88e184", "client_secret": "3c1a3e07-4a40-4510-9fb0-ee5f0a72752c"}
};
String? token;
final completer = Completer();
simplePost(url, body: body, headers: {},
onSuccess: (dynamic stringResponse, int statusCode) {
simplePost(url, body: body, headers: {}, onSuccess: (dynamic stringResponse, int statusCode) {
if (statusCode == 200) {
var jsonResponse = json.decode(stringResponse);
token = jsonResponse['auth_token'];

@ -191,6 +191,8 @@ class LabsService extends BaseService {
body['ProjectID'] = patientLabOrder.projectID;
body['ClinicID'] = patientLabOrder.clinicID;
body['Procedure'] = procedure;
body['Procedure'] = procedure;
body['LanguageID'] = 1;
await baseAppClient.post(GET_Patient_LAB_ORDERS_RESULT, onSuccess: (dynamic response, int statusCode) {
labOrdersResultsList.clear();
response['ListPLR'].forEach((lab) {
@ -223,6 +225,7 @@ class LabsService extends BaseService {
_requestSendLabReportEmail.orderNo = patientLabOrder.orderNo;
_requestSendLabReportEmail.isDownload = isDownload;
_requestSendLabReportEmail.doctorID = patientLabOrder.doctorID;
_requestSendLabReportEmail.languageID = 1;
await baseAppClient.post(SEND_LAB_RESULT_EMAIL, onSuccess: (dynamic response, int statusCode) {
if (isDownload) {

@ -42,9 +42,10 @@ class ReportsService extends BaseService {
}, body: _requestReportsInpatient.toJson());
}
Future getInpatientAdmissionsList() async {
Future getInpatientAdmissionsList(int languageID) async {
Map<String, dynamic> body = new Map<String, dynamic>();
body['IsForMedicalReport'] = true;
body['LanguageID'] = languageID;
hasError = false;
await baseAppClient.post(GET_INPATIENT_ADMISSIONS, onSuccess: (dynamic response, int statusCode) {
admissionsMedicalReport.clear();

@ -38,10 +38,10 @@ class RRTViewModel extends BaseViewModel {
_RRTServiceData rrtServiceData = _RRTServiceData();
Future<_RRTServiceData> loadRequiredData() async {
Future<_RRTServiceData> loadRequiredData(int languageID) async {
// await getServicePrice();
// await getAllOrders();
await getProcedureDetails();
await getProcedureDetails(languageID);
await getAllOrdersRC();
// getProcedureDetails();
return rrtServiceData;
@ -122,9 +122,9 @@ class RRTViewModel extends BaseViewModel {
return rrtServiceData;
}
Future<_RRTServiceData> getProcedureDetails() async {
Future<_RRTServiceData> getProcedureDetails(int languageID) async {
DoctorsListService service = new DoctorsListService();
await service.getRRTProcedures(15).then((res) {
await service.getRRTProcedures(15, languageID).then((res) {
rrtProcedureList.clear();
var data = res["Vida_ProcedureList"];
data.forEach((json) {

@ -14,7 +14,7 @@ class AskDoctorViewModel extends BaseViewModel {
AskDoctorService _askDoctorService = locator<AskDoctorService>();
MyDoctorService _myDoctorService = locator<MyDoctorService>();
List<PatientDoctorAppointmentList> patientDoctorAppointmentListHospital =[];
List<PatientDoctorAppointmentList> patientDoctorAppointmentListHospital = [];
List<AskDoctorReqTypes> get askDoctorReqTypes => _askDoctorService.askDoctorReqTypes;
@ -28,12 +28,14 @@ class AskDoctorViewModel extends BaseViewModel {
setState(ViewState.Error);
} else if (_myDoctorService.patientDoctorAppointmentList.length != 0) {
_myDoctorService.patientDoctorAppointmentList.forEach((element) {
List<PatientDoctorAppointmentList> doctorByClinic = patientDoctorAppointmentListHospital.where((elementClinic) => elementClinic.filterName == element.projectName).toList();
if (!element.isLiveCareClinic!) {
List<PatientDoctorAppointmentList> doctorByClinic = patientDoctorAppointmentListHospital.where((elementClinic) => elementClinic.filterName == element.projectName).toList();
if (doctorByClinic.length != 0) {
patientDoctorAppointmentListHospital[patientDoctorAppointmentListHospital.indexOf(doctorByClinic[0])].patientDoctorAppointmentList!.add(element);
} else {
patientDoctorAppointmentListHospital.add(PatientDoctorAppointmentList(filterName: element.projectName, patientDoctorAppointment: element));
if (doctorByClinic.length != 0) {
patientDoctorAppointmentListHospital[patientDoctorAppointmentListHospital.indexOf(doctorByClinic[0])].patientDoctorAppointmentList!.add(element);
} else {
patientDoctorAppointmentListHospital.add(PatientDoctorAppointmentList(filterName: element.projectName, patientDoctorAppointment: element));
}
}
setState(ViewState.Idle);
});

@ -26,7 +26,7 @@ class ReportsViewModel extends BaseViewModel {
List<AdmissionMedicalReport> get admissionsMedicalReportList => _reportsService.admissionsMedicalReport;
getReports() async {
getReports(int languageID) async {
setState(ViewState.Busy);
reportsOrderRequestList.clear();
reportsOrderReadyList.clear();
@ -37,7 +37,7 @@ class ReportsViewModel extends BaseViewModel {
setState(ViewState.Error);
} else {
_filterList();
await _reportsService.getInpatientAdmissionsList();
await _reportsService.getInpatientAdmissionsList(languageID);
setState(ViewState.Idle);
}
}

@ -16,6 +16,7 @@ import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:firebase_core/firebase_core.dart';
import 'package:flutter/material.dart';
import 'package:flutter_localizations/flutter_localizations.dart';
import 'package:fluttertoast/fluttertoast.dart';
import 'package:logger/logger.dart';
import 'package:provider/provider.dart';
@ -105,6 +106,7 @@ class _MyApp extends State<MyApp> {
@override
Widget build(BuildContext context) {
PlatformBridge.init(context);
LocalNotification.init(onNotificationClick: (payload) {
LocalNotification.getInstance()?.showNow(title: "Payload", subtitle: payload, payload: payload);
});

@ -330,7 +330,9 @@ class _BookConfirmState extends State<BookConfirm> {
GifLoaderDialogUtils.showMyDialog(context);
AppoitmentAllHistoryResultList appo;
widget.service
.insertAppointment(docObject.doctorID!, docObject.clinicID!, docObject.projectID!, widget.selectedTime, widget.selectedDate, initialSlotDuration, context, 'null', null, null, projectViewModel)
// .insertAppointment(docObject.doctorID!, docObject.clinicID!, docObject.projectID!, widget.selectedTime, widget.selectedDate, initialSlotDuration, context, 'null', null, null, projectViewModel)
.insertAppointment(docObject.doctorID!, docObject.clinicID!, docObject.projectID!, widget.selectedTime, widget.selectedDate, initialSlotDuration, projectViewModel.isArabic ? 1 : 2, context, null,
null, null, projectViewModel)
.then((res) {
if (res['MessageStatus'] == 1) {
AppToast.showSuccessToast(message: TranslationBase.of(context).bookedSuccess);
@ -387,7 +389,8 @@ class _BookConfirmState extends State<BookConfirm> {
GifLoaderDialogUtils.showMyDialog(context);
AppoitmentAllHistoryResultList appo;
widget.service
.insertLiveCareScheduleAppointment(docObject.doctorID!, docObject.clinicID!, docObject.projectID!, docObject.serviceID, widget.selectedTime, widget.selectedDate, context)
.insertLiveCareScheduleAppointment(
docObject.doctorID!, docObject.clinicID!, docObject.projectID!, docObject.serviceID, widget.selectedTime, widget.selectedDate, projectViewModel.isArabic ? 1 : 2, context)
.then((res) {
if (res['MessageStatus'] == 1) {
AppToast.showSuccessToast(message: TranslationBase.of(context).bookedSuccess);
@ -451,7 +454,7 @@ class _BookConfirmState extends State<BookConfirm> {
widget.service.getPatientShare(appointmentNo, clinicID, projectID, languageID, context).then((res) {
projectViewModel.selectedBodyPartList.clear();
projectViewModel.laserSelectionDuration = 0;
if(res['OnlineCheckInAppointments'].length != 0) {
if (res['OnlineCheckInAppointments'].length != 0) {
widget.patientShareResponse = new PatientShareResponse.fromJson(res['OnlineCheckInAppointments'][0]);
}
@ -492,7 +495,7 @@ class _BookConfirmState extends State<BookConfirm> {
}
getLiveCareAppointmentPatientShare(context, String appointmentNo, int clinicID, int projectID, DoctorList docObject) {
widget.service.getLiveCareAppointmentPatientShare(appointmentNo, clinicID, projectID, context).then((res) {
widget.service.getLiveCareAppointmentPatientShare(appointmentNo, clinicID, projectID, projectViewModel.isArabic ? 1 : 2, context).then((res) {
widget.patientShareResponse = new PatientShareResponse.fromJson(res);
GifLoaderDialogUtils.hideDialog(context);
navigateToBookSuccess(context, docObject, widget.patientShareResponse, false);

@ -493,7 +493,7 @@ class _BookSuccessState extends State<BookSuccess> {
setOnlineCheckInForAppointment() {
DoctorsListService service = new DoctorsListService();
GifLoaderDialogUtils.showMyDialog(context);
service.setOnlineCheckInForAppointment(widget.patientShareResponse.appointmentNo.toString(), widget.patientShareResponse.projectID!, context).then((res) {
service.setOnlineCheckInForAppointment(widget.patientShareResponse.appointmentNo.toString(), widget.patientShareResponse.projectID!, projectViewModel.isArabic ? 1 : 2, context).then((res) {
AppoitmentAllHistoryResultList appo = new AppoitmentAllHistoryResultList();
appo.clinicID = widget.docObject.clinicID;
appo.projectID = widget.docObject.projectID;
@ -537,8 +537,8 @@ class _BookSuccessState extends State<BookSuccess> {
DoctorsListService service = new DoctorsListService();
GifLoaderDialogUtils.showMyDialog(context);
service
.insertVIDARequest(appo.appointmentNo!, appo.clinicID!, appo.projectID!, appo.serviceID!, appo.doctorID!, appo.appointmentDate!,
Utils.getAppointmentTransID(appo.projectID!, appo.clinicID!, appo.appointmentNo!), context)
.insertVIDARequest(appo.appointmentNo, appo.clinicID, appo.projectID, appo.serviceID, appo.doctorID, appo.appointmentDate!,
Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), projectViewModel.isArabic ? 1 : 2, context)
.then((res) {
GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) {

@ -234,7 +234,7 @@ class _DoctorProfileState extends State<DoctorProfile> with TickerProviderStateM
getDoctorRatings() {
GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService();
service.getDoctorsRating(widget.doctor.doctorID!, context).then((res) {
service.getDoctorsRating(widget.doctor.doctorID!, projectViewModel.isArabic ? 1 : 2, context).then((res) {
GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) {
print(res['NotesDoctorRatingList']);
@ -251,7 +251,7 @@ class _DoctorProfileState extends State<DoctorProfile> with TickerProviderStateM
getDoctorRatingsDetails() {
GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService();
service.getDoctorsRatingDetails(widget.doctor.doctorID!, context).then((res) {
service.getDoctorsRatingDetails(widget.doctor.doctorID!, projectViewModel.isArabic ? 1 : 2, context).then((res) {
GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) {
doctorDetailsList.clear();
@ -494,7 +494,7 @@ class _DoctorProfileState extends State<DoctorProfile> with TickerProviderStateM
barrierDismissible: true,
barrierLabel: '',
context: context,
pageBuilder: (context, animation1, animation2){
pageBuilder: (context, animation1, animation2) {
return SizedBox();
});
}

@ -74,7 +74,7 @@ class _QRCodeState extends State<QRCode> {
Future.delayed(const Duration(milliseconds: 500), () {
showNfcReader(context, onNcfScan: (String nfcId) {
Future.delayed(const Duration(milliseconds: 100), () {
sendNfcCheckInRequest(nfcId,2);
sendNfcCheckInRequest(nfcId, 2);
locator<GAnalytics>().todoList.to_do_list_nfc(widget.appointment!);
});
}, onCancel: () {
@ -93,14 +93,16 @@ class _QRCodeState extends State<QRCode> {
}
startLocationCheckIn() async {
GifLoaderDialogUtils.showMyDialog(context);
locationUtils = new LocationUtils(isShowConfirmDialog: true, context: context);
locationUtils.getCurrentLocation(callBack: (value) {
projectDetailListModel = Utils.getProjectDetailObj(projectViewModel, widget.appointment!.projectID);
double dist = Utils.distance(value.latitude, value.longitude, double.parse(projectDetailListModel.latitude!), double.parse(projectDetailListModel.longitude!)).ceilToDouble() * 1000;
print(dist);
if (dist <= projectDetailListModel.geofenceRadius!) {
sendNfcCheckInRequest(projectDetailListModel.checkInQrCode!,2);
sendNfcCheckInRequest(projectDetailListModel.checkInQrCode!, 2);
} else {
GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: TranslationBase.of(context).locationCheckInError);
}
});

@ -69,7 +69,7 @@ class _LaserClinicState extends State<LaserClinic> with SingleTickerProviderStat
GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService();
service.getLaserBodyPartsList(laserCategoryId, widget.selectedHospital.iD).then((res) {
service.getLaserBodyPartsList(laserCategoryId, widget.selectedHospital.iD, projectViewModel.isArabic ? 1 : 2).then((res) {
GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) {
if (res['Laser_GetBodyPartsByCategoryList'].length != 0) {

@ -408,7 +408,7 @@ class _CovidTimeSlotsState extends State<CovidTimeSlots> with TickerProviderStat
insertCovidQuestionnaire(context, DoctorList docObject) async {
DoctorsListService service = new DoctorsListService();
List qa = await sharedPref.getObject(COVID_QA_LIST);
service.insertCovidQuestionnaire(qa, widget.projectID!, widget.selectedProject!.testTypeEnum!, widget.selectedProject!.testProcedureEnum!).then((res) {
service.insertCovidQuestionnaire(qa, widget.projectID!, widget.selectedProject!.testTypeEnum!, projectViewModel.isArabic ? 1 : 2, widget.selectedProject!.testProcedureEnum!).then((res) {
insertAppointmentCovidTest(context, docObject);
}).catchError((err) {
print(err);
@ -426,8 +426,8 @@ class _CovidTimeSlotsState extends State<CovidTimeSlots> with TickerProviderStat
DoctorsListService service = new DoctorsListService();
AppoitmentAllHistoryResultList appo;
service
.insertAppointment(docObject.doctorID!, docObject.clinicID!, docObject.projectID!, CovidTimeSlots.selectedTime!, CovidTimeSlots.selectedDate!, 0, context,
widget.selectedProcedure!.procedureID, widget.selectedProject!.testTypeEnum, widget.selectedProject!.testProcedureEnum)
.insertAppointment(docObject.doctorID!, docObject.clinicID!, docObject.projectID!, CovidTimeSlots.selectedTime!, CovidTimeSlots.selectedDate!, 0, projectViewModel.isArabic ? 1 : 2, context,
widget.selectedProcedure!.procedureID!, widget.selectedProject!.testTypeEnum!, widget.selectedProject!.testProcedureEnum)
.then((res) {
if (res['MessageStatus'] == 1) {
AppToast.showSuccessToast(message: TranslationBase.of(context).bookedSuccess);

@ -341,8 +341,8 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
return requestDecoratedContainerWithExpandable(
TranslationBase.of(context).sentRequest,
[
Expanded(flex: 4, child: columnText(TranslationBase.of(context).name)),
Expanded(flex: 2, child: columnText(TranslationBase.of(context).status)),
Expanded(flex: 3, child: columnText(TranslationBase.of(context).name)),
Expanded(flex: 1, child: columnText(TranslationBase.of(context).status)),
],
sentRecordsList.map<Widget>((result) {
return sentItemView(result);
@ -351,29 +351,26 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
Widget sentItemView(GetAllSharedRecordsByStatusList result) {
return Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
Expanded(flex: 2, child: rowText(result.patientName!)),
Expanded(flex: 3, child: rowText(result.patientName!)),
Expanded(
flex: 1,
child: Row(
children: [
Container(
padding: EdgeInsets.only(top: 3, bottom: 3, left: 8, right: 8),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(50),
color: result.status == 3 ? Color(0xff349745) : Color(0xffD02127),
),
child: Text(
result.statusDescription != null ? result.statusDescription! : "",
style: TextStyle(
fontSize: 10,
color: Colors.white,
letterSpacing: -0.4,
fontWeight: FontWeight.w600,
),
),
child: Container(
padding: EdgeInsets.only(top: 3, bottom: 3, left: 8, right: 8),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(50),
color: result.status == 3 ? Color(0xff349745) : Color(0xffD02127),
),
child: Text(
result.statusDescription != null ? result.statusDescription! : "",
style: TextStyle(
fontSize: 10,
color: Colors.white,
letterSpacing: -0.4,
fontWeight: FontWeight.w600,
),
],
),
),
),
],
@ -532,7 +529,7 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
request["Status"] = status;
this.familyFileProvider.acceptRejectFamily(request).then((value) async {
await refreshFamily(context);
await GifLoaderDialogUtils.hideDialog(context);
await GifLoaderDialogUtils.hideDialog(context);
});
}
@ -552,6 +549,7 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
List<GetAllSharedRecordsByStatusList> sentRecordsList = [];
Future getFamilyFiles() async {
int languageID = projectViewModel.isArabic ? 1 : 2;
GetAllSharedRecordsByStatusResponse? familySharedRecords;
if (await sharedPref.getObject(FAMILY_FILE) != null) {
familySharedRecords = GetAllSharedRecordsByStatusResponse.fromJson(await sharedPref.getObject(FAMILY_FILE));
@ -559,12 +557,11 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
GifLoaderDialogUtils.showMyDialog(context);
try {
if (familySharedRecords == null) {
int languageID = Provider.of<ProjectViewModel>(context, listen: false).isArabic ? 1 : 2;
familySharedRecords = await familyFileProvider.getSharedRecordByStatus(languageID);
}
familySharedRecordsList =[];
familySharedRecordsList = [];
sentRecordsList = [];
familySharedRecords.getAllSharedRecordsByStatusList!.forEach((element) {
familySharedRecords!.getAllSharedRecordsByStatusList!.forEach((element) {
if (element.status == 3) {
familySharedRecordsList.add(element);
}
@ -572,7 +569,7 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
});
approvedRecordsList = [];
pendingRecordsList = [];
GetAllSharedRecordsByStatusResponse pendingAndApprovedRecords = await getUserViewRequest();
GetAllSharedRecordsByStatusResponse pendingAndApprovedRecords = await getUserViewRequest(languageID);
pendingAndApprovedRecords.getAllSharedRecordsByStatusList!.forEach((element) {
print(element.toJson());
@ -589,9 +586,9 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
}
}
Future getUserViewRequest() async {
Future getUserViewRequest(int languageID) async {
var user = await sharedPref.getObject(USER_PROFILE);
return familyFileProvider.getUserViewRequest(user['PatientID']);
return familyFileProvider.getUserViewRequest(user['PatientID'], languageID);
}
Future<GetAllSharedRecordsByStatusResponse> getSentRequest() async {
@ -617,7 +614,7 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
Widget columnText(String title) {
return Text(
title,
textAlign: TextAlign.left,
// textAlign: TextAlign.left,
style: TextStyle(
fontSize: 12,
color: CustomColors.textDarkColor,
@ -630,7 +627,7 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
Widget rowText(String title) {
return Text(
title,
textAlign: TextAlign.left,
// textAlign: TextAlign.left,
style: TextStyle(
fontSize: 10,
color: CustomColors.textColor,

@ -57,7 +57,7 @@ class RRTMainScreenState extends State<RRTMainScreen> with SingleTickerProviderS
onModelReady: (vm) async {
viewModel = vm;
loadingData = true;
await vm.loadRequiredData().then((value) {}).whenComplete(() => setState(() => loadingData = false));
await vm.loadRequiredData(projectViewModel.isArabic ? 1 : 2).then((value) {}).whenComplete(() => setState(() => loadingData = false));
},
builder: (ctx, vm, widget) => content(),
));

@ -1,5 +1,6 @@
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/GetCMCAllOrdersResponseModel.dart';
import 'package:diplomaticquarterapp/core/viewModels/er/rrt-view-model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/models/rrt/RRTProcedureList.dart';
import 'package:diplomaticquarterapp/models/rrt/service_price.dart';
import 'package:diplomaticquarterapp/pages/ErService/rapid-response-team/rrt-order-list-item.dart';
@ -16,6 +17,7 @@ import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
class RRTRequestPage extends StatefulWidget {
final List<GetCMCAllOrdersResponseModel> pendingOrders;
@ -32,6 +34,8 @@ class RRTRequestPageState extends State<RRTRequestPage> {
bool acceptTerms = false;
late VidaProcedureList selectedProcedure;
ProjectViewModel? projectViewModel;
@override
void initState() {
// getProcedureDetails();
@ -40,6 +44,7 @@ class RRTRequestPageState extends State<RRTRequestPage> {
@override
Widget build(BuildContext context) {
projectViewModel = Provider.of(context);
return BaseView<RRTViewModel>(
onModelReady: (vm) {
// viewModel = vm;
@ -272,7 +277,7 @@ class RRTRequestPageState extends State<RRTRequestPage> {
getProcedureDetails() {
GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService();
service.getRRTProcedures(15).then((res) {
service.getRRTProcedures(15, projectViewModel!.isArabic ? 1 : 2).then((res) {
GifLoaderDialogUtils.hideDialog(context);
print(res['Vida_ProcedureList']);
}).catchError((err) {

@ -151,7 +151,6 @@ class _AppointmentDetailsState extends State<AppointmentDetails> with SingleTick
Material(
color: Color(0xffF8F8F8),
child: TabBar(
onTap: (index) {
setState(() {
if (index == 1) {
@ -248,21 +247,13 @@ class _AppointmentDetailsState extends State<AppointmentDetails> with SingleTick
list.add(
Expanded(
child: DefaultButton(
TranslationBase
.of(context)
.cancelAppointment,
() {
TranslationBase.of(context).cancelAppointment,
() {
ConfirmDialog dialog = new ConfirmDialog(
context: context,
confirmMessage: TranslationBase
.of(context)
.cancelAppoMsg,
okText: TranslationBase
.of(context)
.confirm,
cancelText: TranslationBase
.of(context)
.cancel_nocaps,
confirmMessage: TranslationBase.of(context).cancelAppoMsg,
okText: TranslationBase.of(context).confirm,
cancelText: TranslationBase.of(context).cancel_nocaps,
okFunction: cancelAppointment,
cancelFunction: () => {});
dialog.showAlertDialog(context);
@ -272,8 +263,7 @@ class _AppointmentDetailsState extends State<AppointmentDetails> with SingleTick
),
),
);
}
else if (_tabController!.index == 1) {
} else if (_tabController!.index == 1) {
list.add(
Expanded(
child: DefaultButton(
@ -329,7 +319,7 @@ class _AppointmentDetailsState extends State<AppointmentDetails> with SingleTick
void getDoctorRatingsDetails() {
GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService();
service.getDoctorsRatingDetails(widget.appo.doctorID!, context).then((res) {
service.getDoctorsRatingDetails(widget.appo.doctorID, projectViewModel!.isArabic ? 1 : 2, context).then((res) {
GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) {
doctorDetailsList.clear();
@ -678,7 +668,6 @@ class _AppointmentDetailsState extends State<AppointmentDetails> with SingleTick
}
getToDoCount() {
toDoProvider!.setState(0, 0, true, toDoProvider!.notificationsCount);
ClinicListService service = new ClinicListService();
service.getActiveAppointmentNo(context).then((res) {

@ -25,6 +25,11 @@ import 'package:provider/provider.dart';
import 'AppointmentDetails.dart';
class MyAppointments extends StatefulWidget {
@override
_MyAppointmentsState createState() => _MyAppointmentsState();
}
class _MyAppointmentsState extends State<MyAppointments> with SingleTickerProviderStateMixin {
List<AppoitmentAllHistoryResultList> upcomingAppoList = [];
List<AppoitmentAllHistoryResultList> arrivedAppoListNew = [];
@ -32,27 +37,22 @@ class MyAppointments extends StatefulWidget {
List<AppoitmentAllHistoryResultList> confirmedAppoList = [];
List<AppoitmentAllHistoryResultList> arrivedAppoList = [];
List<PatientAppointmentList> _patientBookedAppointmentListHospital =[];
List<PatientAppointmentList> _patientConfirmedAppointmentListHospital =[];
List<PatientAppointmentList> _patientArrivedAppointmentListHospital =[];
List<PatientAppointmentList> _patientBookedAppointmentListHospital = [];
List<PatientAppointmentList> _patientConfirmedAppointmentListHospital = [];
List<PatientAppointmentList> _patientArrivedAppointmentListHospital = [];
List<PatientAppointmentList> _patientBookedAppointmentListClinic =[];
List<PatientAppointmentList> _patientConfirmedAppointmentListClinic =[];
List<PatientAppointmentList> _patientArrivedAppointmentListClinic =[];
List<PatientAppointmentList> _patientBookedAppointmentListClinic = [];
List<PatientAppointmentList> _patientConfirmedAppointmentListClinic = [];
List<PatientAppointmentList> _patientArrivedAppointmentListClinic = [];
List<PatientAppointmentList> _patientBookedAndConfirmedAppointmentListHospital = [];
List<PatientAppointmentList> _patientBookedAndConfirmedAppointmentListClinic = [];
@override
_MyAppointmentsState createState() => _MyAppointmentsState();
}
class _MyAppointmentsState extends State<MyAppointments> with SingleTickerProviderStateMixin {
bool isDataLoaded = false;
var sharedPref = new AppSharedPreferences();
AuthenticatedUserObject authenticatedUserObject = locator<AuthenticatedUserObject>();
List<ImagesInfo> imagesInfo =[];
List<ImagesInfo> imagesInfo = [];
FilterType? filterType;
@ -145,23 +145,23 @@ class _MyAppointmentsState extends State<MyAppointments> with SingleTickerProvid
GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService();
widget.upcomingAppoList.clear();
widget.arrivedAppoListNew.clear();
upcomingAppoList.clear();
arrivedAppoListNew.clear();
widget.bookedAppoList.clear();
widget.confirmedAppoList.clear();
widget.arrivedAppoList.clear();
bookedAppoList.clear();
confirmedAppoList.clear();
arrivedAppoList.clear();
widget._patientBookedAppointmentListHospital.clear();
widget._patientConfirmedAppointmentListHospital.clear();
widget._patientArrivedAppointmentListHospital.clear();
_patientBookedAppointmentListHospital.clear();
_patientConfirmedAppointmentListHospital.clear();
_patientArrivedAppointmentListHospital.clear();
widget._patientBookedAppointmentListClinic.clear();
widget._patientConfirmedAppointmentListClinic.clear();
widget._patientArrivedAppointmentListClinic.clear();
_patientBookedAppointmentListClinic.clear();
_patientConfirmedAppointmentListClinic.clear();
_patientArrivedAppointmentListClinic.clear();
widget._patientBookedAndConfirmedAppointmentListHospital.clear();
widget._patientBookedAndConfirmedAppointmentListClinic.clear();
_patientBookedAndConfirmedAppointmentListHospital.clear();
_patientBookedAndConfirmedAppointmentListClinic.clear();
service.getPatientAppointmentHistory(false, languageID, context, isForUpcomming: isForUpcoming, IsForArrived: isForArrived).then((res) {
GifLoaderDialogUtils.hideDialog(context);
@ -170,9 +170,9 @@ class _MyAppointmentsState extends State<MyAppointments> with SingleTickerProvid
if (res['AppoimentAllHistoryResultList'].length != 0) {
res['AppoimentAllHistoryResultList'].forEach((v) {
if (isForArrived) {
widget.arrivedAppoListNew.add(new AppoitmentAllHistoryResultList.fromJson(v));
arrivedAppoListNew.add(new AppoitmentAllHistoryResultList.fromJson(v));
} else {
widget.upcomingAppoList.add(new AppoitmentAllHistoryResultList.fromJson(v));
upcomingAppoList.add(new AppoitmentAllHistoryResultList.fromJson(v));
}
});
sortAppointmentList(isForUpcoming, isForArrived);
@ -217,122 +217,122 @@ class _MyAppointmentsState extends State<MyAppointments> with SingleTickerProvid
sortAppointmentList(bool isForUpcoming, bool isForArrived) {
if (isForArrived) {
widget.arrivedAppoListNew.forEach((v) {
arrivedAppoListNew.forEach((v) {
if (isBooked(v)) {
widget.bookedAppoList.add(v);
bookedAppoList.add(v);
}
if (isConfirmed(v)) {
widget.confirmedAppoList.add(v);
confirmedAppoList.add(v);
}
if (isArrived(v)) {
widget.arrivedAppoList.add(v);
arrivedAppoList.add(v);
}
});
} else {
widget.upcomingAppoList.forEach((v) {
upcomingAppoList.forEach((v) {
if (isBooked(v)) {
widget.bookedAppoList.add(v);
bookedAppoList.add(v);
}
if (isConfirmed(v)) {
widget.confirmedAppoList.add(v);
confirmedAppoList.add(v);
}
if (isArrived(v)) {
widget.arrivedAppoList.add(v);
arrivedAppoList.add(v);
}
});
}
widget.bookedAppoList.forEach((element) {
List<PatientAppointmentList> doctorByClinic = widget._patientBookedAppointmentListClinic
bookedAppoList.forEach((element) {
List<PatientAppointmentList> doctorByClinic = _patientBookedAppointmentListClinic
.where(
(elementClinic) => elementClinic.filterName == element.clinicName,
)
.toList();
if (doctorByClinic.length != 0) {
widget._patientBookedAppointmentListClinic[widget._patientBookedAppointmentListClinic.indexOf(doctorByClinic[0])].patientDoctorAppointmentList!.add(element);
_patientBookedAppointmentListClinic[_patientBookedAppointmentListClinic.indexOf(doctorByClinic[0])].patientDoctorAppointmentList!.add(element);
} else {
widget._patientBookedAppointmentListClinic.add(PatientAppointmentList(filterName: element.clinicName, patientDoctorAppointment: element));
_patientBookedAppointmentListClinic.add(PatientAppointmentList(filterName: element.clinicName, patientDoctorAppointment: element));
}
List<PatientAppointmentList> doctorByHospital = widget._patientBookedAppointmentListHospital
List<PatientAppointmentList> doctorByHospital = _patientBookedAppointmentListHospital
.where(
(elementClinic) => elementClinic.filterName == element.projectName,
)
.toList();
if (doctorByHospital.length != 0) {
widget._patientBookedAppointmentListHospital[widget._patientBookedAppointmentListHospital.indexOf(doctorByHospital[0])].patientDoctorAppointmentList!.add(element);
_patientBookedAppointmentListHospital[_patientBookedAppointmentListHospital.indexOf(doctorByHospital[0])].patientDoctorAppointmentList!.add(element);
} else {
widget._patientBookedAppointmentListHospital.add(PatientAppointmentList(filterName: element.projectName, patientDoctorAppointment: element));
_patientBookedAppointmentListHospital.add(PatientAppointmentList(filterName: element.projectName, patientDoctorAppointment: element));
}
//Merging Booked & Confirmed Appointments into Upcoming Tab
widget._patientBookedAndConfirmedAppointmentListHospital.addAll(widget._patientBookedAppointmentListHospital);
widget._patientBookedAndConfirmedAppointmentListClinic.addAll(widget._patientBookedAppointmentListClinic);
});
widget.confirmedAppoList.forEach((element) {
List<PatientAppointmentList> doctorByClinic = widget._patientConfirmedAppointmentListClinic
confirmedAppoList.forEach((element) {
List<PatientAppointmentList> doctorByClinic = _patientConfirmedAppointmentListClinic
.where(
(elementClinic) => elementClinic.filterName == element.clinicName,
)
.toList();
if (doctorByClinic.length != 0) {
widget._patientConfirmedAppointmentListClinic[widget._patientConfirmedAppointmentListClinic.indexOf(doctorByClinic[0])].patientDoctorAppointmentList!.add(element);
_patientConfirmedAppointmentListClinic[_patientConfirmedAppointmentListClinic.indexOf(doctorByClinic[0])].patientDoctorAppointmentList!.add(element);
} else {
widget._patientConfirmedAppointmentListClinic.add(PatientAppointmentList(filterName: element.clinicName, patientDoctorAppointment: element));
_patientConfirmedAppointmentListClinic.add(PatientAppointmentList(filterName: element.clinicName, patientDoctorAppointment: element));
}
List<PatientAppointmentList> doctorByHospital = widget._patientConfirmedAppointmentListHospital
List<PatientAppointmentList> doctorByHospital = _patientConfirmedAppointmentListHospital
.where(
(elementClinic) => elementClinic.filterName == element.projectName,
)
.toList();
if (doctorByHospital.length != 0) {
widget._patientConfirmedAppointmentListHospital[widget._patientConfirmedAppointmentListHospital.indexOf(doctorByHospital[0])].patientDoctorAppointmentList!.add(element);
_patientConfirmedAppointmentListHospital[_patientConfirmedAppointmentListHospital.indexOf(doctorByHospital[0])].patientDoctorAppointmentList!.add(element);
} else {
widget._patientConfirmedAppointmentListHospital.add(PatientAppointmentList(filterName: element.projectName, patientDoctorAppointment: element));
_patientConfirmedAppointmentListHospital.add(PatientAppointmentList(filterName: element.projectName, patientDoctorAppointment: element));
}
//Merging Booked & Confirmed Appointments into Upcoming Tab
widget._patientBookedAndConfirmedAppointmentListHospital.addAll(widget._patientConfirmedAppointmentListHospital);
widget._patientBookedAndConfirmedAppointmentListClinic.addAll(widget._patientConfirmedAppointmentListClinic);
// _patientBookedAndConfirmedAppointmentListHospital.addAll(_patientConfirmedAppointmentListHospital);
// _patientBookedAndConfirmedAppointmentListClinic.addAll(_patientConfirmedAppointmentListClinic);
});
widget.arrivedAppoList.forEach((element) {
List<PatientAppointmentList> doctorByClinic = widget._patientArrivedAppointmentListClinic
arrivedAppoList.forEach((element) {
List<PatientAppointmentList> doctorByClinic = _patientArrivedAppointmentListClinic
.where(
(elementClinic) => elementClinic.filterName == element.clinicName,
)
.toList();
if (doctorByClinic.length != 0) {
widget._patientArrivedAppointmentListClinic[widget._patientArrivedAppointmentListClinic.indexOf(doctorByClinic[0])].patientDoctorAppointmentList!.add(element);
_patientArrivedAppointmentListClinic[_patientArrivedAppointmentListClinic.indexOf(doctorByClinic[0])].patientDoctorAppointmentList!.add(element);
} else {
widget._patientArrivedAppointmentListClinic.add(PatientAppointmentList(filterName: element.clinicName, patientDoctorAppointment: element));
_patientArrivedAppointmentListClinic.add(PatientAppointmentList(filterName: element.clinicName, patientDoctorAppointment: element));
}
List<PatientAppointmentList> doctorByHospital = widget._patientArrivedAppointmentListHospital
List<PatientAppointmentList> doctorByHospital = _patientArrivedAppointmentListHospital
.where(
(elementClinic) => elementClinic.filterName == element.projectName,
)
.toList();
if (doctorByHospital.length != 0) {
widget._patientArrivedAppointmentListHospital[widget._patientArrivedAppointmentListHospital.indexOf(doctorByHospital[0])].patientDoctorAppointmentList!.add(element);
_patientArrivedAppointmentListHospital[_patientArrivedAppointmentListHospital.indexOf(doctorByHospital[0])].patientDoctorAppointmentList!.add(element);
} else {
widget._patientArrivedAppointmentListHospital.add(PatientAppointmentList(filterName: element.projectName, patientDoctorAppointment: element));
_patientArrivedAppointmentListHospital.add(PatientAppointmentList(filterName: element.projectName, patientDoctorAppointment: element));
}
// openAppointmentsTab();
});
//Merging Booked & Confirmed Appointments into Upcoming Tab
_patientBookedAndConfirmedAppointmentListHospital.addAll(_patientBookedAppointmentListHospital);
_patientBookedAndConfirmedAppointmentListClinic.addAll(_patientBookedAppointmentListClinic);
}
openAppointmentsTab() async {
@ -345,11 +345,11 @@ class _MyAppointmentsState extends State<MyAppointments> with SingleTickerProvid
} else if (flag == 3) {
index = 2;
} else {
if (widget._patientBookedAppointmentListClinic.length != 0) {
if (_patientBookedAppointmentListClinic.length != 0) {
index = 0;
} else if (widget._patientConfirmedAppointmentListClinic.length != 0) {
} else if (_patientConfirmedAppointmentListClinic.length != 0) {
index = 1;
} else if (widget._patientArrivedAppointmentListClinic.length != 0) {
} else if (_patientArrivedAppointmentListClinic.length != 0) {
index = 2;
// return;
}
@ -359,12 +359,12 @@ class _MyAppointmentsState extends State<MyAppointments> with SingleTickerProvid
}
Widget getBookedAppointments() {
return _getAppointment(widget.bookedAppoList.length, (filterType == FilterType.Clinic) ? widget._patientBookedAppointmentListClinic : widget._patientBookedAppointmentListHospital);
return _getAppointment(bookedAppoList.length, (filterType == FilterType.Clinic) ? _patientBookedAppointmentListClinic : _patientBookedAppointmentListHospital);
}
Widget getBookedAndConfirmedAppointments() {
return _getAppointment((widget.bookedAppoList.length + widget.confirmedAppoList.length),
(filterType == FilterType.Clinic) ? widget._patientBookedAndConfirmedAppointmentListClinic : widget._patientBookedAndConfirmedAppointmentListHospital);
return _getAppointment(
(bookedAppoList.length + confirmedAppoList.length), (filterType == FilterType.Clinic) ? _patientBookedAndConfirmedAppointmentListClinic : _patientBookedAndConfirmedAppointmentListHospital);
}
Widget _getAppointment(int _listLength, List<PatientAppointmentList> _list) {
@ -382,7 +382,9 @@ class _MyAppointmentsState extends State<MyAppointments> with SingleTickerProvid
Container(
margin: EdgeInsets.only(top: 10.0),
child: Text(
_currentPage == 0 ? TranslationBase.of(context).noBookedAppo : (_currentPage == 1 ? TranslationBase.of(context).noUpcomingAppointment : TranslationBase.of(context).noArrivedAppo),
_currentPage == 0
? TranslationBase.of(context).noBookedAppo
: (_currentPage == 1 ? TranslationBase.of(context).noUpcomingAppointment : TranslationBase.of(context).noArrivedAppo),
style: TextStyle(
fontSize: 16.0,
),
@ -429,7 +431,12 @@ class _MyAppointmentsState extends State<MyAppointments> with SingleTickerProvid
),
),
).then((value) {
getPatientAppointmentHistory(true, false);
if (_currentPage == 1) {
getPatientAppointmentHistory(true, false);
}
if (_currentPage == 2) {
getPatientAppointmentHistory(false, true);
}
}),
isInOutPatient: _appointmentResult.isInOutPatient,
name: _appointmentResult.doctorTitle! + " " + _appointmentResult.doctorNameObj!,
@ -461,11 +468,11 @@ class _MyAppointmentsState extends State<MyAppointments> with SingleTickerProvid
}
Widget getConfirmedAppointments() {
return _getAppointment(widget.confirmedAppoList.length, (filterType == FilterType.Clinic) ? widget._patientConfirmedAppointmentListClinic : widget._patientConfirmedAppointmentListHospital);
return _getAppointment(confirmedAppoList.length, (filterType == FilterType.Clinic) ? _patientConfirmedAppointmentListClinic : _patientConfirmedAppointmentListHospital);
}
Widget getArrivedAppointments() {
return _getAppointment(widget.arrivedAppoList.length, (filterType == FilterType.Clinic) ? widget._patientArrivedAppointmentListClinic : widget._patientArrivedAppointmentListHospital);
return _getAppointment(arrivedAppoList.length, (filterType == FilterType.Clinic) ? _patientArrivedAppointmentListClinic : _patientArrivedAppointmentListHospital);
}
setFilterType(FilterType filterType) {
@ -479,6 +486,12 @@ class _MyAppointmentsState extends State<MyAppointments> with SingleTickerProvid
onTap: () {
setState(() {
_currentPage = _value;
if (_value == 1) {
getPatientAppointmentHistory(true, false);
}
if (_value == 2) {
getPatientAppointmentHistory(false, true);
}
});
},
child: Row(
@ -501,7 +514,6 @@ class _MyAppointmentsState extends State<MyAppointments> with SingleTickerProvid
getPatientAppointmentHistory(false, true);
}
});
//_pageController.animateToPage(index, duration: Duration(milliseconds: 250), curve: Curves.easeInOut);
},
),
),

@ -1,5 +1,6 @@
import 'package:diplomaticquarterapp/core/model/prescriptions/prescription_report.dart';
import 'package:diplomaticquarterapp/core/model/prescriptions/prescription_report_enh.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart';
import 'package:diplomaticquarterapp/pages/medical/prescriptions/prescription_details_page.dart';
import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart';
@ -10,22 +11,22 @@ import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
class PrescriptionReportPage extends StatefulWidget {
List<PrescriptionReportEnh> prescriptionReportEnhList;
dynamic listPres;
AppoitmentAllHistoryResultList appo;
PrescriptionReportPage(
{required this.prescriptionReportEnhList,
required this.listPres,
required this.appo});
PrescriptionReportPage({required this.prescriptionReportEnhList, required this.listPres, required this.appo});
@override
_PrescriptionReportState createState() => _PrescriptionReportState();
}
class _PrescriptionReportState extends State<PrescriptionReportPage> {
ProjectViewModel? projectViewModel;
@override
void initState() {
super.initState();
@ -33,6 +34,7 @@ class _PrescriptionReportState extends State<PrescriptionReportPage> {
@override
Widget build(BuildContext context) {
projectViewModel = Provider.of(context);
return AppScaffold(
isShowAppBar: true,
appBarTitle: 'Items',
@ -41,8 +43,7 @@ class _PrescriptionReportState extends State<PrescriptionReportPage> {
child: ListView.builder(
itemBuilder: (context, index) => InkWell(
onTap: () {
navigateToPrescriptionDetails(
widget.prescriptionReportEnhList[index]);
navigateToPrescriptionDetails(widget.prescriptionReportEnhList[index]);
},
child: Container(
width: double.infinity,
@ -69,9 +70,7 @@ class _PrescriptionReportState extends State<PrescriptionReportPage> {
Expanded(
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Center(
child: Texts(widget
.prescriptionReportEnhList[index].itemDescription)),
child: Center(child: Texts(widget.prescriptionReportEnhList[index].itemDescription)),
)),
Icon(
Icons.arrow_forward,
@ -116,10 +115,7 @@ class _PrescriptionReportState extends State<PrescriptionReportPage> {
sendPrescriptionReportEmail() {
DoctorsListService service = new DoctorsListService();
GifLoaderDialogUtils.showMyDialog(context);
service
.sendPrescriptionEmail(widget.appo.appointmentDate!, widget.appo.setupID!,
widget.listPres, context)
.then((res) {
service.sendPrescriptionEmail(widget.appo.appointmentDate!, widget.appo.setupID!, projectViewModel!.isArabic ? 1 : 2, widget.listPres, context).then((res) {
GifLoaderDialogUtils.hideDialog(context);
AppToast.showSuccessToast(message: 'A copy has been sent to the e-mail');
}).catchError((err) {
@ -142,8 +138,7 @@ class _PrescriptionReportState extends State<PrescriptionReportPage> {
prescriptionReport.frequency = prescriptionReportEnh.frequency;
prescriptionReport.frequencyN = prescriptionReportEnh.frequency;
prescriptionReport.doseDailyQuantity =
prescriptionReportEnh.doseDailyQuantity;
prescriptionReport.doseDailyQuantity = prescriptionReportEnh.doseDailyQuantity;
prescriptionReport.days = prescriptionReportEnh.days;

@ -315,8 +315,8 @@ class _CovidTimeSlotsState extends State<ObGyneTimeSlots> with TickerProviderSta
Widget getSelectedButton(int index) {
return CustomTextButton(
backgroundColor: CustomColors.green,
elevation: 0,
backgroundColor: CustomColors.green,
elevation: 0,
onPressed: () {
setState(() {
selectedButtonIndex = index;
@ -352,8 +352,8 @@ class _CovidTimeSlotsState extends State<ObGyneTimeSlots> with TickerProviderSta
DoctorsListService service = new DoctorsListService();
AppoitmentAllHistoryResultList appo;
service
.insertAppointment(
docObject.doctorID!, docObject.clinicID!, docObject.projectID!, ObGyneTimeSlots.selectedTime, ObGyneTimeSlots.selectedDate, 0, context, widget.obGyneProcedureListResponse!.procedureId!)
.insertAppointment(docObject.doctorID!, docObject.clinicID!, docObject.projectID!, ObGyneTimeSlots.selectedTime, ObGyneTimeSlots.selectedDate, 0, projectViewModel!.isArabic ? 1 : 2, context,
widget.obGyneProcedureListResponse!.procedureId)
.then((res) {
if (res['MessageStatus'] == 1) {
AppToast.showSuccessToast(message: TranslationBase.of(context).bookedSuccess);
@ -394,7 +394,7 @@ class _CovidTimeSlotsState extends State<ObGyneTimeSlots> with TickerProviderSta
DoctorsListService service = new DoctorsListService();
service
.updateObGyneAppointment(widget.obGyneProcedureListResponse!.episodeID!, int.parse(appoNo), widget.obGyneProcedureListResponse!.orderNo!, widget.obGyneProcedureListResponse!.procedureId!,
widget.obGyneProcedureListResponse!.lineItemNo!, widget.obGyneProcedureListResponse!.uniqueRowID!)
widget.obGyneProcedureListResponse!.lineItemNo!, widget.obGyneProcedureListResponse!.uniqueRowID!, projectViewModel!.isArabic ? 1 : 2)
.then((res) {})
.catchError((err) {
print(err);

@ -47,15 +47,12 @@ import 'package:flutter_svg/flutter_svg.dart';
import 'package:provider/provider.dart';
class ToDo extends StatefulWidget {
PatientShareResponse patientShareResponse = PatientShareResponse();
List<AppoitmentAllHistoryResultList> appoList = [];
List<AncillaryOrdersListModel> ancillaryLists = [];
List<OBGyneProcedureListResponse> obGyneAppoList = [];
PatientShareResponse? patientShareResponse;
var languageID;
MyInAppBrowser? browser;
bool isShowAppBar = true;
MyInAppBrowser? browser;
bool? isShowAppBar = true;
Function()? onBackClick;
bool isFromMyAppointments;
bool? isFromMyAppointments;
AppoitmentAllHistoryResultList? appointment;
ToDo({required this.isShowAppBar, this.onBackClick, this.isFromMyAppointments = false, this.appointment});
@ -86,6 +83,10 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
bool isCash = false;
MyInAppBrowser? browser;
List<AppoitmentAllHistoryResultList> appoList = [];
List<AncillaryOrdersListModel> ancillaryLists = [];
List<OBGyneProcedureListResponse> obGyneAppoList = [];
@override
void initState() {
widget.patientShareResponse = new PatientShareResponse();
@ -103,6 +104,7 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
@override
void dispose() {
super.dispose();
// getToDoCount();
_tabController.dispose();
}
@ -113,7 +115,7 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
return AppScaffold(
appBarTitle: TranslationBase.of(context).todoList,
imagesInfo: imagesInfo,
isShowAppBar: widget.isShowAppBar,
isShowAppBar: widget.isShowAppBar!,
isShowDecPage: true,
showNewAppBar: true,
showNewAppBarTitle: true,
@ -162,15 +164,15 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
child: AppExpandableNotifier(
isExpand: true,
hasCounter: true,
counter: widget.appoList.length.toString(),
counter: appoList.length.toString(),
title: TranslationBase.of(context).appointments,
bodyWidget: widget.appoList.length != 0
bodyWidget: appoList.length != 0
? ListView.builder(
scrollDirection: Axis.vertical,
shrinkWrap: true,
physics: ScrollPhysics(),
padding: EdgeInsets.all(0.0),
itemCount: widget.appoList.length,
itemCount: appoList.length,
itemBuilder: (context, index) {
return Container(
width: double.infinity,
@ -190,12 +192,12 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
children: [
Padding(
padding: const EdgeInsets.only(top: 4.0),
child: widget.appoList[index].clinicID == 265
child: appoList[index].clinicID == 265
? Container(
margin: EdgeInsets.only(left: 5.0, right: 5.0),
child: SvgPicture.asset("assets/images/new/CoronaIcon.svg", width: 35.0, height: 35.0),
)
: widget.appoList[index].isLiveCareAppointment!
: appoList[index].isLiveCareAppointment!
? SvgPicture.asset("assets/images/new/virtual.svg")
: SvgPicture.asset("assets/images/new/hospital-visit.svg"),
),
@ -205,9 +207,9 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
Padding(
padding: const EdgeInsets.only(left: 8.0, right: 8.0),
child: Text(
widget.appoList[index].clinicID == 265
appoList[index].clinicID == 265
? TranslationBase.of(context).covidTestTodo
: widget.appoList[index].isLiveCareAppointment!
: appoList[index].isLiveCareAppointment!
? TranslationBase.of(context).liveCareAppo
: TranslationBase.of(context).walkinAppo,
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48)),
@ -215,8 +217,8 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
Padding(
padding: const EdgeInsets.only(left: 8.0, right: 8.0),
child: CountdownTimer(
controller: new CountdownTimerController(
endTime: DateTime.now().millisecondsSinceEpoch + (widget.appoList[index].remaniningHoursTocanPay! * 1000) * 60),
controller:
new CountdownTimerController(endTime: DateTime.now().millisecondsSinceEpoch + (appoList[index].remaniningHoursTocanPay! * 1000) * 60),
widgetBuilder: (_, CurrentRemainingTime? time) {
return time != null
? Text(
@ -236,17 +238,17 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
child: Container(
child: InkWell(
onTap: () {
performNextAction(widget.appoList[index]);
performNextAction(appoList[index]);
},
child: Container(
padding: EdgeInsets.symmetric(vertical: 8, horizontal: 14),
decoration: BoxDecoration(
color: getNextActionButtonColor(widget.appoList[index].nextAction),
color: getNextActionButtonColor(appoList[index].nextAction),
border: Border.all(color: Colors.white, width: 1),
borderRadius: BorderRadius.circular(6),
),
child: Text(
getNextActionText(widget.appoList[index].nextAction),
getNextActionText(appoList[index].nextAction),
textAlign: TextAlign.center,
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Colors.white, letterSpacing: -0.4),
),
@ -259,7 +261,7 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
Padding(
padding: const EdgeInsets.only(top: 8.0),
child: Text(
widget.appoList[index].doctorTitle! + " " + widget.appoList[index].doctorNameObj!,
appoList[index].doctorTitle! + " " + appoList[index].doctorNameObj!,
style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64, height: 25 / 16),
),
),
@ -267,8 +269,8 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
mainAxisSize: MainAxisSize.min,
children: <Widget>[
LargeAvatar(
name: widget.appoList[index].doctorTitle! + " " + widget.appoList[index].doctorNameObj!,
url: widget.appoList[index].doctorImageURL,
name: appoList[index].doctorTitle! + " " + appoList[index].doctorNameObj!,
url: appoList[index].doctorImageURL,
width: 52,
height: 52,
),
@ -278,26 +280,26 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: <Widget>[
MyRichText(TranslationBase.of(context).clinic + ": ", widget.appoList[index].clinicName!, projectViewModel.isArabic),
MyRichText(TranslationBase.of(context).clinic + ": ", appoList[index].clinicName!, projectViewModel.isArabic),
// MyRichText(TranslationBase.of(context).appointmentDate + ": ",
// DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(widget.appoList[index].appointmentDate)) + " " + widget.appoList[index].startTime.substring(0, 5), projectViewModel.isArabic),
// DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(appoList[index].appointmentDate)) + " " + appoList[index].startTime.substring(0, 5), projectViewModel.isArabic),
// Timezone changes
widget.appoList[index].isLiveCareAppointment!
appoList[index].isLiveCareAppointment!
? MyRichText(
TranslationBase.of(context).appointmentDate + ": ",
DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(widget.appoList[index].appointmentDate!)) +
DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(appoList[index].appointmentDate)) +
" " +
DateUtil.convertStringToDate(widget.appoList[index].appointmentDate!).toString().split(" ")[1].substring(0, 5),
DateUtil.convertStringToDate(appoList[index].appointmentDate).toString().split(" ")[1].substring(0, 5),
projectViewModel.isArabic)
: MyRichText(
TranslationBase.of(context).appointmentDate + ": ",
DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(widget.appoList[index].appointmentDate!)) +
DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(appoList[index].appointmentDate)) +
" " +
widget.appoList[index].startTime!.substring(0, 5),
appoList[index].startTime!.substring(0, 5),
projectViewModel.isArabic),
MyRichText(TranslationBase.of(context).branch, widget.appoList[index].projectName!, projectViewModel.isArabic),
MyRichText(TranslationBase.of(context).branch, appoList[index].projectName!, projectViewModel.isArabic),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
mainAxisSize: MainAxisSize.max,
@ -315,7 +317,7 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
RatingBar(
itemSize: 20.0,
allowHalfRating: true,
initialRating: widget.appoList[index].actualDoctorRate!.toDouble(),
initialRating: appoList[index].actualDoctorRate!.toDouble(),
ratingWidget: RatingWidget(
full: Icon(
Icons.star,
@ -345,13 +347,13 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
Padding(
padding: const EdgeInsets.only(top: 12.0),
child: Text(
getNextActionDescription(widget.appoList[index].nextAction),
getNextActionDescription(appoList[index].nextAction),
style: TextStyle(fontSize: 10, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.48, height: 25 / 16),
),
),
InkWell(
onTap: () {
navigateToAppointmentDetails(context, widget.appoList[index]);
navigateToAppointmentDetails(context, appoList[index]);
},
child: Padding(
padding: const EdgeInsets.only(top: 0.0),
@ -380,9 +382,9 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
child: AppExpandableNotifier(
isExpand: true,
hasCounter: true,
counter: (widget.ancillaryLists.isNotEmpty) ? widget.ancillaryLists[0].ancillaryOrderList!.length.toString() : "0",
counter: (ancillaryLists.isNotEmpty) ? ancillaryLists[0].ancillaryOrderList!.length.toString() : "0",
title: TranslationBase.of(context).anicllaryOrders,
bodyWidget: widget.ancillaryLists.length != 0
bodyWidget: ancillaryLists.length != 0
? Container(
padding: EdgeInsets.all(12),
child: ListView.separated(
@ -391,18 +393,18 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
reverse: true,
itemBuilder: (context, index) {
return DoctorCard(
onTap: () => ancillaryOrdersDetails(widget.ancillaryLists[0].ancillaryOrderList![index], widget.ancillaryLists[0].projectID),
onTap: () => ancillaryOrdersDetails(ancillaryLists[0].ancillaryOrderList![index], ancillaryLists[0].projectID),
isInOutPatient: true,
name: TranslationBase.of(context).dr.toString() + " " + (widget.ancillaryLists[0].ancillaryOrderList![index].doctorName ?? ""),
billNo: widget.ancillaryLists[0].ancillaryOrderList![index].orderNo.toString(),
name: TranslationBase.of(context).dr.toString() + " " + (ancillaryLists[0].ancillaryOrderList![index].doctorName ?? ""),
billNo: ancillaryLists[0].ancillaryOrderList![index].orderNo.toString(),
profileUrl: "https://hmgwebservices.com/Images/MobileImages/DUBAI/unkown.png",
subName: widget.ancillaryLists[0].projectName,
subName: ancillaryLists[0].projectName,
isLiveCareAppointment: false,
date: DateUtil.convertStringToDate(widget.ancillaryLists[0]!.ancillaryOrderList![index].orderDate!),
date: DateUtil.convertStringToDate(ancillaryLists[0].ancillaryOrderList![index].orderDate),
isSortByClinic: true,
);
},
itemCount: widget.ancillaryLists[0].ancillaryOrderList!.length,
itemCount: ancillaryLists[0].ancillaryOrderList!.length,
separatorBuilder: (context, index) => SizedBox(height: 14),
),
)
@ -412,13 +414,13 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
),
),
Container(
child: widget.obGyneAppoList.length != 0
child: obGyneAppoList.length != 0
? ListView.builder(
scrollDirection: Axis.vertical,
shrinkWrap: true,
physics: ScrollPhysics(),
padding: EdgeInsets.all(0.0),
itemCount: widget.obGyneAppoList.length,
itemCount: obGyneAppoList.length,
itemBuilder: (context, index) {
return Container(
width: double.infinity,
@ -456,7 +458,7 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
Container(
child: InkWell(
onTap: () {
getOBGyneDoctorsList(widget.obGyneAppoList[index].projectID!, widget.obGyneAppoList[index].setupID!, widget.obGyneAppoList[index]);
getOBGyneDoctorsList(obGyneAppoList[index].projectID!, obGyneAppoList[index].setupID!, obGyneAppoList[index]);
},
child: Container(
padding: EdgeInsets.symmetric(vertical: 8, horizontal: 14),
@ -477,7 +479,7 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
Padding(
padding: const EdgeInsets.only(top: 8.0),
child: Text(
TranslationBase.of(context).dr + " " + widget.obGyneAppoList[index].doctorName!,
TranslationBase.of(context).dr + " " + obGyneAppoList[index].doctorName!,
style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64, height: 25 / 16),
),
),
@ -485,7 +487,7 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
mainAxisSize: MainAxisSize.min,
children: <Widget>[
LargeAvatar(
name: TranslationBase.of(context).dr + " " + widget.obGyneAppoList[index].doctorName!,
name: TranslationBase.of(context).dr + " " + obGyneAppoList[index].doctorName!,
url: "https://hmgwebservices.com/Images/MobileImages/DUBAI/unkown.png",
width: 52,
height: 52,
@ -496,12 +498,12 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: <Widget>[
MyRichText(TranslationBase.of(context).clinic + ": ", widget.obGyneAppoList[index].clinicDescription!, projectViewModel.isArabic),
MyRichText(TranslationBase.of(context).clinic + ": ", obGyneAppoList[index].clinicDescription!, projectViewModel.isArabic),
MyRichText(
TranslationBase.of(context).orderDate + ": ",
DateUtil.getDayMonthYearHourMinuteDateFormatted(DateUtil.convertStringToDate(widget.obGyneAppoList[index].orderDate!)).split(" ")[0],
DateUtil.getDayMonthYearHourMinuteDateFormatted(DateUtil.convertStringToDate(obGyneAppoList[index].orderDate)).split(" ")[0],
projectViewModel.isArabic),
MyRichText(TranslationBase.of(context).branch, widget.obGyneAppoList[index].projectDescription!, projectViewModel.isArabic),
MyRichText(TranslationBase.of(context).branch, obGyneAppoList[index].projectDescription!, projectViewModel.isArabic),
],
),
),
@ -772,14 +774,14 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService();
service.getOBGyneOrdersList(context).then((res) {
widget.obGyneAppoList.clear();
obGyneAppoList.clear();
GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) {
setState(() {
if (res['HIS_OBGYNEProcedureGet_List'].length != 0) {
widget.obGyneAppoList.clear();
obGyneAppoList.clear();
res['HIS_OBGYNEProcedureGet_List'].forEach((v) {
widget.obGyneAppoList.add(new OBGyneProcedureListResponse.fromJson(v));
obGyneAppoList.add(new OBGyneProcedureListResponse.fromJson(v));
});
} else {
// Navigator.of(context).popAndPushNamed(HOME);
@ -799,7 +801,7 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
DoctorsListService service = new DoctorsListService();
List<DoctorList> doctorsList = [];
List<PatientDoctorAppointmentList> _patientDoctorAppointmentListHospital = [];
service.getOBGyneDoctorsList(projectID, setupID, context).then((res) {
service.getOBGyneDoctorsList(projectID, setupID, projectViewModel.isArabic ? 1 : 2, context).then((res) {
GifLoaderDialogUtils.hideDialog(context);
print(res['HIS_ObgyneUltrasoundDoctorsList'][0]);
if (res['MessageStatus'] == 1) {
@ -845,32 +847,31 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
obGyneProcedureListResponse: obGyneProcedureListResponse)));
}
getPatientAppointmentHistory() {
getPatientAppointmentHistory() async {
int languageID = projectViewModel.isArabic ? 1 : 2;
GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService();
service.getPatientAppointmentHistory(true, languageID, context).then((res) {
widget.appoList.clear();
appoList.clear();
GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) {
setState(() {
if (res['AppoimentAllHistoryResultList'].length != 0) {
widget.appoList.clear();
res['AppoimentAllHistoryResultList'].forEach((v) {
widget.appoList.add(new AppoitmentAllHistoryResultList.fromJson(v));
});
}
if (res['AncillaryOrderList'].length != 0) {
res['AncillaryOrderList'].forEach((item) {
widget.ancillaryLists.add(AncillaryOrdersListModel.fromJson(item));
});
}
dataLoaded = true;
if (widget.isFromMyAppointments) {
performNextAction(widget.appointment!);
widget.isFromMyAppointments = false;
}
});
if (res['AppoimentAllHistoryResultList'].length != 0) {
appoList.clear();
res['AppoimentAllHistoryResultList'].forEach((v) {
appoList.add(new AppoitmentAllHistoryResultList.fromJson(v));
});
}
if (res['AncillaryOrderList'].length != 0) {
res['AncillaryOrderList'].forEach((item) {
ancillaryLists.add(AncillaryOrdersListModel.fromJson(item));
});
}
dataLoaded = true;
if (widget.isFromMyAppointments!) {
performNextAction(widget.appointment!);
widget.isFromMyAppointments = false;
}
setState(() {});
} else {
AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
}
@ -959,10 +960,10 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
isCash = res["IsCash"];
if (isCash) {
openPaymentDialog(appo, widget.patientShareResponse);
openPaymentDialog(appo, widget.patientShareResponse!);
} else {
if (isInsured && isEligible) {
openPaymentDialog(appo, widget.patientShareResponse);
openPaymentDialog(appo, widget.patientShareResponse!);
} else {
if (isInsured && !isEligible) {
errorMsg = TranslationBase.of(context).invalidEligibility;
@ -990,10 +991,10 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
getLiveCareAppointmentPatientShare(context, DoctorsListService service, AppoitmentAllHistoryResultList appo) {
GifLoaderDialogUtils.showMyDialog(context);
service.getLiveCareAppointmentPatientShare(appo.appointmentNo.toString(), appo.clinicID!, appo.projectID!, context).then((res) {
service.getLiveCareAppointmentPatientShare(appo.appointmentNo.toString(), appo.clinicID, appo.projectID, projectViewModel.isArabic ? 1 : 2, context).then((res) {
GifLoaderDialogUtils.hideDialog(context);
widget.patientShareResponse = new PatientShareResponse.fromJson(res);
openPaymentDialog(appo, widget.patientShareResponse);
openPaymentDialog(appo, widget.patientShareResponse!);
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: err);
@ -1084,7 +1085,7 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
openPayment(paymentMethod, AuthenticatedUser authenticatedUser, num amount, PatientShareResponse patientShareResponse, AppoitmentAllHistoryResultList appo) {
widget.browser = new MyInAppBrowser(onExitCallback: onBrowserExit, appo: appo, onLoadStartCallback: onBrowserLoadStart, context: context);
browser?.openPaymentBrowser(
widget.browser?.openPaymentBrowser(
amount,
"Appointment check in",
Utils.getAppointmentTransID(appo.projectID!, appo.clinicID!, appo.appointmentNo!),
@ -1098,7 +1099,7 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
widget!.browser!,
appo.isLiveCareAppointment!,
"2",
appo.isLiveCareAppointment! ? widget.patientShareResponse.clinicID.toString() : "",
appo.isLiveCareAppointment! ? widget.patientShareResponse!.clinicID.toString() : "",
context,
appo.appointmentDate,
appo.appointmentNo,
@ -1302,8 +1303,8 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService();
service
.insertVIDARequest(appo.appointmentNo!, appo.clinicID!, appo.projectID!, appo.serviceID!, appo.doctorID!, appo.appointmentDate!,
Utils.getAppointmentTransID(appo.projectID!, appo.clinicID!, appo.appointmentNo!), context)
.insertVIDARequest(appo.appointmentNo, appo.clinicID, appo.projectID, appo.serviceID, appo.doctorID, appo.appointmentDate!,
Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), projectViewModel.isArabic ? 1 : 2, context)
.then((res) {
GifLoaderDialogUtils.hideDialog(context);
getPatientAppointmentHistory();
@ -1321,7 +1322,7 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
onSelectedMethod: (String metohd, [String? selectedInstallmentPlan]) {
setState(() {});
},
patientShare: widget.patientShareResponse.patientShareWithTax)))
patientShare: widget.patientShareResponse!.patientShareWithTax)))
.then((value) {
print(value);
selectedPaymentMethod = value[0] ?? "";
@ -1330,7 +1331,7 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
if (value != null) {
final appType = appo.isLiveCareAppointment! ? 'livecare' : 'regular';
openPayment(value, projectViewModel.user , double.parse(patientShareResponse.patientShareWithTax.toString()), patientShareResponse, appo);
openPayment(value, projectViewModel.user, double.parse(patientShareResponse.patientShareWithTax.toString()), patientShareResponse, appo);
projectViewModel.analytics.appointment.payment_method(appointment_type: appType, clinic: appo.clinicName, payment_method: value[0], payment_type: 'appointment');
}
});
@ -1362,8 +1363,8 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService();
service
.insertVIDARequest(appo.appointmentNo!, appo.clinicID!, appo.projectID!, appo.serviceID!, appo.doctorID!, appo.appointmentDate!,
Utils.getAppointmentTransID(appo.projectID!, appo.clinicID!, appo.appointmentNo!), context)
.insertVIDARequest(appo.appointmentNo, appo.clinicID, appo.projectID, appo.serviceID, appo.doctorID, appo.appointmentDate!,
Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), projectViewModel.isArabic ? 1 : 2, context)
.then((res) {
GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) {

@ -634,7 +634,7 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
authService.getDashboard().then((value) async {
setState(() {
if (value != null) {
notificationCount = value['List_PatientDashboard'][0]['UnreadPatientNotificationCount'] > 99 ? '99+' : value['List_PatientDashboard'][0]['UnreadPatientNotificationCount'].toString();
notificationCount = value ['List_PatientDashboard'][0]['UnreadPatientNotificationCount'] > 99 ? '99+' : value['List_PatientDashboard'][0]['UnreadPatientNotificationCount'].toString();
model.setState(model.count, 0, true, notificationCount);
sharedPref.setString(NOTIFICATION_COUNT, notificationCount);
FlutterAppIconBadge.updateBadge(int.parse(notificationCount));

@ -454,7 +454,7 @@ class _AdvancePaymentPageState extends State<AdvancePaymentPage> {
String getPatientName() {
if (_selectedPatientInfo != null)
return _selectedPatientInfo.fullName!;
return _selectedPatientInfo.fullName ??"";
else
return TranslationBase.of(context).selectPatientName;
}
@ -469,7 +469,7 @@ class _AdvancePaymentPageState extends State<AdvancePaymentPage> {
}
String getFamilyMembersName() {
if (selectedPatientFamily != null)
if (selectedPatientFamily.patientName != null)
return selectedPatientFamily.patientName!;
else
return TranslationBase.of(context).selectFamilyPatientName;

@ -34,14 +34,15 @@ class EyeHomePage extends StatefulWidget {
}
class _EyeHomePageState extends State<EyeHomePage> with SingleTickerProviderStateMixin {
late TabController _tabController;
List<DoctorRateDetails> doctorDetailsList = [];
TabController? _tabController;
List<DoctorRateDetails>? doctorDetailsList = [];
ProjectViewModel? projectViewModel;
@override
void initState() {
super.initState();
_tabController = TabController(length: 2, vsync: this);
_tabController.addListener(() {
_tabController!.addListener(() {
setState(() {});
});
}
@ -49,12 +50,12 @@ class _EyeHomePageState extends State<EyeHomePage> with SingleTickerProviderStat
@override
void dispose() {
super.dispose();
_tabController.dispose();
_tabController!.dispose();
}
@override
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
projectViewModel = Provider.of(context);
return BaseView<EyeViewModel>(
builder: (_, model, w) => AppScaffold(
isShowAppBar: true,
@ -82,7 +83,7 @@ class _EyeHomePageState extends State<EyeHomePage> with SingleTickerProviderStat
"",
//model.user.emailAddress,
),
isNeedToShowButton: _tabController.index == 0 ? true : projectViewModel.havePrivilege(15),
isNeedToShowButton: _tabController!.index == 0 ? true : projectViewModel!.havePrivilege(15),
showConfirmMessageDialog: true,
onRatingAndReviewTap: getDoctorRatingsDetails,
onTap: () {
@ -93,7 +94,7 @@ class _EyeHomePageState extends State<EyeHomePage> with SingleTickerProviderStat
projectName: widget.appointmentAllHistoryResultList!.projectName!,
projectID: widget.appointmentAllHistoryResultList!.projectID!);
GifLoaderDialogUtils.hideDialog(context);
}, projectViewModel.user!.emailAddress!);
}, projectViewModel!.user!.emailAddress!);
},
),
Container(
@ -180,14 +181,14 @@ class _EyeHomePageState extends State<EyeHomePage> with SingleTickerProviderStat
void getDoctorRatingsDetails() {
GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService();
service.getDoctorsRatingDetails(widget.appointmentAllHistoryResultList!.doctorID!, context).then((res) {
service.getDoctorsRatingDetails(widget.appointmentAllHistoryResultList!.doctorID!, projectViewModel!.isArabic ? 1 : 2, context).then((res) {
GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) {
doctorDetailsList.clear();
doctorDetailsList!.clear();
res['DoctorRatingDetailsList'].forEach((v) {
doctorDetailsList.add(new DoctorRateDetails.fromJson(v));
doctorDetailsList!.add(new DoctorRateDetails.fromJson(v));
});
showRatingDialog(doctorDetailsList);
showRatingDialog(doctorDetailsList!);
} else {
AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
}

@ -31,6 +31,7 @@ class _HomeReportPageState extends State<HomeReportPage> with SingleTickerProvid
late TabController _tabController_new;
List<ImagesInfo> imagesInfo =[];
int _currentPage = 0;
ProjectViewModel? projectViewModel;
@override
void initState() {
@ -46,7 +47,7 @@ class _HomeReportPageState extends State<HomeReportPage> with SingleTickerProvid
@override
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
projectViewModel = Provider.of(context);
imagesInfo.add(ImagesInfo(
imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/medical-reorts/en/0.png', imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/medical-reorts/ar/0.png'));
imagesInfo.add(ImagesInfo(
@ -55,7 +56,7 @@ class _HomeReportPageState extends State<HomeReportPage> with SingleTickerProvid
imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/medical-reorts/en/2.png', imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/medical-reorts/ar/2.png'));
return BaseView<ReportsViewModel>(
onModelReady: (model) {
model.getReports();
model.getReports(projectViewModel!.isArabic ? 1 : 2);
},
builder: (_, model, widget) => AppScaffold(
isShowAppBar: true,
@ -156,11 +157,13 @@ class _HomeReportPageState extends State<HomeReportPage> with SingleTickerProvid
return InkWell(
onTap: () {
Navigator.push(
context,
FadePage(
page: InPatientMedicalReports(
context,
FadePage(
page: InPatientMedicalReports(
admissionMedicalReport: admissionMedicalReport,
)));
),
),
);
},
child: Container(
// height: 100.0,
@ -209,14 +212,14 @@ class _HomeReportPageState extends State<HomeReportPage> with SingleTickerProvid
mainAxisSize: MainAxisSize.min,
children: <Widget>[
if (admissionMedicalReport.clinicName != null)
MyRichText(TranslationBase.of(context).clinic + ":", admissionMedicalReport.clinicName!, projectViewModel.isArabic),
MyRichText(TranslationBase.of(context).clinic + ":", admissionMedicalReport.clinicName!, projectViewModel!.isArabic),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
MyRichText(
TranslationBase.of(context).status + ":",
projectViewModel.isArabic ? admissionMedicalReport.statusDescriptionN! : admissionMedicalReport.statusDescription!,
projectViewModel.isArabic),
projectViewModel!.isArabic ? admissionMedicalReport.statusDescriptionN! : admissionMedicalReport.statusDescription!,
projectViewModel!.isArabic),
Icon(
Icons.arrow_forward,
color: Theme.of(context).primaryColor,
@ -245,7 +248,7 @@ class _HomeReportPageState extends State<HomeReportPage> with SingleTickerProvid
],
),
),
if (projectViewModel.havePrivilege(21)
if (projectViewModel!.havePrivilege(21)
// && _tabController_new.index == 0
)
if (_tabController_new.index == 0)
@ -259,7 +262,7 @@ class _HomeReportPageState extends State<HomeReportPage> with SingleTickerProvid
page: MedicalReports(),
),
).then((value) {
model.getReports();
model.getReports(projectViewModel!.isArabic ? 1 : 2);
}),
),
)

@ -13,6 +13,7 @@ import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/avatar/large_avatar.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/confirm_send_email_dialog.dart';
@ -211,8 +212,15 @@ class ReportListWidget extends StatelessWidget {
GifLoaderDialogUtils.showMyDialog(AppGlobal.context);
ReportsService _reportsService = locator<ReportsService>();
_reportsService
.sendEmailForMedicalReport(report.projectName!, report.clinicDescription!, report.doctorName, DateUtil.convertDateToString(report.requestDate!), report.invoiceNo.toString(), report.projectID!,
DateUtil.convertDateToString(report.requestDate!), report.setupId!)
.sendEmailForMedicalReport(
report.projectName!,
report.clinicDescription!,
report.doctorName,
DateUtil.convertDateToString(report.requestDate!),
Utils.isVidaPlusProject(projectViewModel, report.projectID!) ? report.invoiceNo_VP.toString() : report.invoiceNo.toString(),
report.projectID!,
DateUtil.convertDateToString(report.requestDate!),
report.setupId!)
.then((value) {
GifLoaderDialogUtils.hideDialog(AppGlobal.context);
AppToast.showSuccessToast(message: TranslationBase.of(AppGlobal.context).emailSentSuccessfully);

@ -13,6 +13,7 @@ import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.da
import 'package:diplomaticquarterapp/models/Request.dart';
import 'package:diplomaticquarterapp/models/anicllary-orders/ancillary_orders_proc_list.dart';
import 'package:diplomaticquarterapp/models/apple_pay_request.dart';
import 'package:diplomaticquarterapp/pages/final_products_page.dart';
import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
@ -173,7 +174,7 @@ class DoctorsListService extends BaseService {
return Future.value(localRes);
}
Future<Map> getDoctorsRating(int docID, context) async {
Future<Map> getDoctorsRating(int docID, int languageID, context) async {
Map<String, dynamic> request;
Request req = appGlobal.getPublicRequest();
@ -190,6 +191,7 @@ class DoctorsListService extends BaseService {
"PatientID": 0,
"License": true,
"IsRegistered": true,
"LanguageID": languageID,
"isDentalAllowedBackend": false
};
@ -223,7 +225,7 @@ class DoctorsListService extends BaseService {
return Future.value(images);
}
Future<Map> getDoctorsRatingDetails(int docID, context) async {
Future<Map> getDoctorsRatingDetails(int docID, int languageID, context) async {
Map<String, dynamic> request;
Request req = appGlobal.getPublicRequest();
@ -240,6 +242,7 @@ class DoctorsListService extends BaseService {
"PatientID": 0,
"License": true,
"IsRegistered": true,
"LanguageID": languageID,
"isDentalAllowedBackend": false
};
@ -272,6 +275,7 @@ class DoctorsListService extends BaseService {
"PatientOutSA": authProvider.isLogin ? authUser.outSA : 0,
"SessionID": null,
"isDentalAllowedBackend": false,
"LanguageID": 1,
"DeviceTypeID": 1
};
@ -315,6 +319,7 @@ class DoctorsListService extends BaseService {
"PatientOutSA": authUser.outSA,
"SessionID": null,
"isDentalAllowedBackend": false,
"LanguageID": 1,
"DeviceTypeID": 1
};
@ -328,7 +333,7 @@ class DoctorsListService extends BaseService {
return Future.value(localRes);
}
Future<Map> insertAppointment(int docID, int clinicID, int projectID, String selectedTime, String selectedDate, int initialSlotDuration, BuildContext context,
Future<Map> insertAppointment(int docID, int clinicID, int projectID, String selectedTime, String selectedDate, int initialSlotDuration, int languageID, BuildContext context,
[String? procedureID, num? testTypeEnum, num? testProcedureEnum, ProjectViewModel? projectViewModel]) async {
Map<String, dynamic> request;
@ -395,7 +400,7 @@ class DoctorsListService extends BaseService {
}
}
Future<Map> insertLiveCareScheduleAppointment(int docID, int clinicID, int projectID, int serviceID, String selectedTime, String selectedDate, BuildContext context) async {
Future<Map> insertLiveCareScheduleAppointment(int docID, int clinicID, int projectID, int serviceID, String selectedTime, String selectedDate, int languageID, BuildContext context) async {
Map<String, dynamic> request;
if (await this.sharedPref.getObject(USER_PROFILE) != null) {
@ -485,14 +490,14 @@ class DoctorsListService extends BaseService {
return Future.value(localRes);
}
Future<Map> setOnlineCheckInForAppointment(String appoID, int projectID, BuildContext context) async {
Future<Map> setOnlineCheckInForAppointment(String appoID, int projectID, int languageID, BuildContext context) async {
Map<String, dynamic> request;
if (await this.sharedPref.getObject(USER_PROFILE) != null) {
var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE));
authUser = data;
}
request = {"ProjectID": projectID, "AppointmentNo": appoID};
request = {"ProjectID": projectID, "AppointmentNo": appoID, "LanguageID": languageID};
dynamic localRes;
@ -504,7 +509,7 @@ class DoctorsListService extends BaseService {
return Future.value(localRes);
}
Future<Map> getLiveCareAppointmentPatientShare(String appoID, int clinicID, int projectID, BuildContext context) async {
Future<Map> getLiveCareAppointmentPatientShare(String appoID, int clinicID, int projectID, int languageID, BuildContext context) async {
Map<String, dynamic> request;
if (await this.sharedPref.getObject(USER_PROFILE) != null) {
@ -530,6 +535,7 @@ class DoctorsListService extends BaseService {
"DeviceTypeID": req.DeviceTypeID,
"PatientID": authUser.patientID,
"PatientTypeID": authUser.patientType,
"LanguageID": languageID,
"PatientType": authUser.patientType
};
@ -565,7 +571,7 @@ class DoctorsListService extends BaseService {
return Future.value(localRes);
}
Future<Map> getOBGyneDoctorsList(int projectID, String setupID, BuildContext context) async {
Future<Map> getOBGyneDoctorsList(int projectID, String setupID, int languageID, BuildContext context) async {
Map<String, dynamic> request;
if (await this.sharedPref.getObject(USER_PROFILE) != null) {
@ -582,6 +588,7 @@ class DoctorsListService extends BaseService {
"DeviceTypeID": req.DeviceTypeID,
"PatientID": authUser.patientID,
"PatientTypeID": authUser.patientType,
"LanguageID": languageID,
"PatientType": authUser.patientType
};
@ -713,7 +720,7 @@ class DoctorsListService extends BaseService {
return Future.value(localRes);
}
Future<Map> insertVIDARequest(int appoNo, int clinicID, int projectID, int serviceID, int docID, String appoDate, String clientRequestID, BuildContext context) async {
Future<Map> insertVIDARequest(int appoNo, int clinicID, int projectID, int serviceID, int docID, String appoDate, String clientRequestID, int languageID, BuildContext context) async {
Map<String, dynamic> request;
if (await this.sharedPref.getObject(USER_PROFILE) != null) {
@ -754,6 +761,7 @@ class DoctorsListService extends BaseService {
"PatientTypeID": authUser.patientType,
"PatientType": authUser.patientType,
"VoipToken": await sharedPref.getString(ONESIGNAL_APNS_TOKEN),
"LanguageID": languageID,
"IsVoip": Platform.isIOS ? true : false
};
@ -799,6 +807,7 @@ class DoctorsListService extends BaseService {
"DeviceTypeID": req.DeviceTypeID,
"PatientID": authUser.patientID,
"PatientTypeID": authUser.patientType,
"LanguageID": 1,
"PatientType": authUser.patientType
};
@ -837,6 +846,7 @@ class DoctorsListService extends BaseService {
"DeviceTypeID": req.DeviceTypeID,
"PatientID": authUser.patientID,
"PatientTypeID": authUser.patientType,
"LanguageID": 1,
"PatientType": authUser.patientType
};
@ -912,6 +922,7 @@ class DoctorsListService extends BaseService {
"DeviceTypeID": req.DeviceTypeID,
"PatientID": authUser.patientID,
"PatientTypeID": authUser.patientType,
"LanguageID": 1,
"PatientType": authUser.patientType
};
dynamic localRes;
@ -958,6 +969,7 @@ class DoctorsListService extends BaseService {
"DeviceTypeID": req.DeviceTypeID,
"PatientID": authUser.patientID,
"PatientTypeID": authUser.patientType,
"LanguageID": 1,
"PatientType": authUser.patientType
};
dynamic localRes;
@ -1001,6 +1013,7 @@ class DoctorsListService extends BaseService {
"PatientType": authUser.patientType,
"DeviceToken": await sharedPref.getString(PUSH_TOKEN),
"VoipToken": await sharedPref.getString(ONESIGNAL_APNS_TOKEN),
"LanguageID": 1,
"IsVoip": Platform.isIOS ? true : false
};
@ -1037,6 +1050,7 @@ class DoctorsListService extends BaseService {
});
request = {
"LanguageID": 1,
"RequestAncillaryOrderInvoice": [
{"MemberID": 102, "ProjectID": projectID, "AppointmentNo": appointmentID, "OrderNo": orderNo, "AncillaryOrderInvoiceProcList": selectedProcListAPI}
],
@ -1237,7 +1251,7 @@ class DoctorsListService extends BaseService {
return Future.value(localRes);
}
Future<Map> getPatientPrescriptionReports(AppoitmentAllHistoryResultList appo, BuildContext context) async {
Future<Map> getPatientPrescriptionReports(AppoitmentAllHistoryResultList appo, int languageID, BuildContext context) async {
Map<String, dynamic> request;
if (await this.sharedPref.getObject(USER_PROFILE) != null) {
var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE));
@ -1261,6 +1275,7 @@ class DoctorsListService extends BaseService {
"DeviceTypeID": req.DeviceTypeID,
"PatientID": authUser.patientID,
"PatientTypeID": authUser.patientType,
"LanguageID": languageID,
"PatientType": authUser.patientType
};
@ -1273,7 +1288,7 @@ class DoctorsListService extends BaseService {
return Future.value(localRes);
}
Future<Map> sendPrescriptionEmail(String appoDate, String setupId, dynamic prescriptionReportEnhList, BuildContext context) async {
Future<Map> sendPrescriptionEmail(String appoDate, String setupId, int languageID, dynamic prescriptionReportEnhList, BuildContext context) async {
Map<String, dynamic> request;
if (await this.sharedPref.getObject(USER_PROFILE) != null) {
var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE));
@ -1300,6 +1315,7 @@ class DoctorsListService extends BaseService {
"DeviceTypeID": req.DeviceTypeID,
"PatientID": authUser.patientID,
"PatientTypeID": authUser.patientType,
"LanguageID": authUser.patientType,
"PatientType": authUser.patientType
};
@ -1343,6 +1359,7 @@ class DoctorsListService extends BaseService {
"isDentalAllowedBackend": false,
"PatientID": authUser.patientID,
"PatientTypeID": authUser.patientType,
"LanguageID": 1,
"PatientType": authUser.patientType
};
dynamic localRes;
@ -1381,7 +1398,7 @@ class DoctorsListService extends BaseService {
"PaymentMethod": paymentMethodName,
"VersionID": req.VersionID,
"Channel": req.Channel,
"LanguageID": 1,
"IPAdress": req.IPAdress,
"generalid": req.generalid,
"PatientOutSA": authUser.outSA,
@ -1417,6 +1434,7 @@ class DoctorsListService extends BaseService {
"generalid": req.generalid,
"PatientOutSA": authUser.outSA,
"PatientTypeID": authUser.patientType,
"LanguageID": 1,
"ERAdvanceAmount": {
"ProjectId": projectID,
"PatientId": authUser.patientID,
@ -1457,6 +1475,7 @@ class DoctorsListService extends BaseService {
"generalid": req.generalid,
"PatientOutSA": authUser.outSA,
"PatientTypeID": authUser.patientType,
"LanguageID": 1,
"EROnlineCheckinPaymentDetails": {
"CheckinDate": DateUtil.convertDateToString(DateTime.now()),
"ExpectedArrivalTime": DateUtil.convertDateToString(DateTime.now()),
@ -1534,6 +1553,7 @@ class DoctorsListService extends BaseService {
request = {
"ProjectID": projectID,
"LanguageID": 1,
};
dynamic localRes;
await baseAppClient.post(HAS_DENTAL_PLAN, onSuccess: (response, statusCode) async {
@ -1544,7 +1564,7 @@ class DoctorsListService extends BaseService {
return Future.value(localRes);
}
Future<Map<String,dynamic>> getTamaraPaymentDetails(BuildContext context) async {
Future<Map<String, dynamic>> getTamaraPaymentDetails(BuildContext context) async {
dynamic localRes;
await baseAppClient.get(GET_TAMARA_PLAN, isExternal: true, onSuccess: (response, statusCode) async {
print(response);
@ -1596,12 +1616,13 @@ class DoctorsListService extends BaseService {
return Future.value(localRes);
}
Future<Map> getLaserBodyPartsList(int laserCategoryID, int projectID) async {
Future<Map> getLaserBodyPartsList(int laserCategoryID, int projectID, int languageID) async {
Map<String, dynamic> request;
request = {
"LaserCategoryID": laserCategoryID,
"ProjectID": projectID,
"LanguageID": languageID,
};
dynamic localRes;
await baseAppClient.post(LASER_BODY_PARTS, onSuccess: (response, statusCode) async {
@ -1612,11 +1633,12 @@ class DoctorsListService extends BaseService {
return Future.value(localRes);
}
Future<Map> insertCovidQuestionnaire(List qa, int projectID, int testTypeEnum, int testProcedureEnum) async {
Future<Map> insertCovidQuestionnaire(List qa, int projectID, int testTypeEnum, int languageID, int testProcedureEnum) async {
Map<String, dynamic> request;
request = {
"ProjectID": projectID,
"LanguageID": languageID,
"IsForTravel": qa[0]['ans'].toString(),
"IsComingOutSA": qa[1]['ans'].toString(),
"IsFeverCurrently": qa[2]['ans'].toString(),
@ -1659,11 +1681,12 @@ class DoctorsListService extends BaseService {
return Future.value(localRes);
}
Future<Map> updateObGyneAppointment(int episodeID, int appointmentNo, int orderNo, String procedureId, int lineItemNo, int uniqueRowID) async {
Future<Map> updateObGyneAppointment(int episodeID, int appointmentNo, int orderNo, String procedureId, int lineItemNo, int uniqueRowID, int languageID) async {
Map<String, dynamic> request;
request = {
"EpisodeID": episodeID,
"LanguageID": languageID,
"AppointmentNo": appointmentNo,
"OrderNo": orderNo,
"ProcedureId": procedureId,
@ -1682,10 +1705,10 @@ class DoctorsListService extends BaseService {
return Future.value(localRes);
}
Future<Map> getRRTProcedures(int projectID) async {
Future<Map> getRRTProcedures(int projectID, int languageID) async {
Map<String, dynamic> request;
request = {"ProjectID": projectID};
request = {"ProjectID": projectID, "LanguageID": languageID};
dynamic localRes;
await baseAppClient.post(GET_RRT_PROCEDURE_LIST, onSuccess: (response, statusCode) async {
@ -1703,6 +1726,7 @@ class DoctorsListService extends BaseService {
"ClientRequestID": clientRequestID,
"Status": status,
"FortID": tamaraOrderID, // Tamara order ID
"LanguageID": 1,
"Installments_Number": selectedInstallments
};
@ -1718,7 +1742,7 @@ class DoctorsListService extends BaseService {
Future<Map> markAppointmentForTamara(int projectID, String appoNo) async {
Map<String, dynamic> request;
request = {"ProjectID": projectID, "AppointmentNo": appoNo};
request = {"ProjectID": projectID, "AppointmentNo": appoNo, "LanguageID": 1};
dynamic localRes;
await baseAppClient.post(MARK_APPOINTMENT_TAMARA_STATUS, onSuccess: (response, statusCode) async {
localRes = response;
@ -1731,7 +1755,7 @@ class DoctorsListService extends BaseService {
Future<Map> autoGenerateInvoiceTamara(int projectID, String appoNo, String mobileNo) async {
Map<String, dynamic> request;
request = {"ProjectID": projectID, "AppointmentNo": appoNo, "MobileNo": mobileNo, "UserID": 102};
request = {"ProjectID": projectID, "AppointmentNo": appoNo, "MobileNo": mobileNo, "UserID": 102, "LanguageID": 1};
dynamic localRes;
await baseAppClient.post(AUTO_GENERATE_INVOICE_TAMARA, onSuccess: (response, statusCode) async {
localRes = response;
@ -1744,7 +1768,7 @@ class DoctorsListService extends BaseService {
Future<Map> checkPatientNphiesEligibility(int projectID) async {
Map<String, dynamic> request;
request = {"ProjectID": projectID};
request = {"ProjectID": projectID, "LanguageID": 1};
dynamic localRes;
await baseAppClient.post(CHECK_PATIENT_NPHIES_ELIGIBILITY, onSuccess: (response, statusCode) async {
localRes = response;
@ -1757,7 +1781,7 @@ class DoctorsListService extends BaseService {
Future<Map> convertPatientToCash(int projectID) async {
Map<String, dynamic> request;
request = {"ProjectID": projectID};
request = {"ProjectID": projectID, "LanguageID": 1};
dynamic localRes;
await baseAppClient.post(CONVERT_PATIENT_TO_CASH, onSuccess: (response, statusCode) async {
localRes = response;
@ -1801,6 +1825,7 @@ class DoctorsListService extends BaseService {
"PatientOutSA": authProvider.isLogin ? authUser.outSA : 0,
"SessionID": null,
"isDentalAllowedBackend": false,
"LanguageID": 1,
"DeviceTypeID": 1
};

@ -43,6 +43,7 @@ class FamilyFilesProvider with ChangeNotifier {
dynamic localRes;
try {
var request = GetAllSharedRecordsByStatusReq();
// var request = {"LanguageID": languageID};
// var result = await sharedPref.getObject(MAIN_USER);
// request.status = 0;
// request.patientID = result["PatientID"];
@ -61,7 +62,7 @@ class FamilyFilesProvider with ChangeNotifier {
}
}
Future<GetAllSharedRecordsByStatusResponse> getUserViewRequest(responseID) async {
Future<GetAllSharedRecordsByStatusResponse> getUserViewRequest(responseID, int languageID) async {
try {
dynamic localRes;
Map<String, dynamic> request = {};
@ -237,7 +238,7 @@ class FamilyFilesProvider with ChangeNotifier {
}
}
Future<dynamic> silentLoggin(GetAllSharedRecordsByStatusList switchUser, int languageID, {onSuccess, mainUser}) async {
Future<dynamic> silentLoggin(GetAllSharedRecordsByStatusList? switchUser, int languageID, {onSuccess, mainUser}) async {
Map<String, dynamic> request = {};
if (mainUser == true) {
var currentUser = AuthenticatedUser.fromJson(await sharedPref.getObject(MAIN_USER) ?? "");
@ -262,17 +263,17 @@ class FamilyFilesProvider with ChangeNotifier {
// request['LogInTokenID'] = '';
// request['PatientOutSA'] = currentUser.outSA; //? 1 : 0;
request['PatientOutSA'] = switchUser.familyRegionID != null
? switchUser.familyRegionID == 1
request['PatientOutSA'] = switchUser!.familyRegionID != null
? switchUser!.familyRegionID == 1
? 0
: 1
: currentUser.outSA; //currentUser.outSA; //? 1 : 0;
request['PatientMobileNumber'] = switchUser.mobileNumber; //['MobileNumber'];
request['PatientMobileNumber'] = switchUser!.mobileNumber; //['MobileNumber'];
request['SearchType'] = 2;
request['SuperUser'] = switchUser.patientID; //currentUser.PatientID;
request['SuperUser'] = switchUser!.patientID; //currentUser.PatientID;
request['PatientIdentificationID'] = '';
request['IsSilentLogin'] = true;
request['PatientID'] = switchUser.responseID; //['PatientID'];
request['PatientID'] = switchUser!.responseID; //['PatientID'];
request['ZipCode'] = switchUser.familyRegionID != null
? switchUser.familyRegionID == 1
? "966"

@ -17,13 +17,19 @@ class AppToast {
int? imageSize,
}) {
Fluttertoast.showToast(
msg: message, toastLength: toastLength, gravity: toastGravity, timeInSecForIosWeb: timeInSeconds!, backgroundColor: backgroundColor, textColor: textColor, fontSize: fontSize);
msg: message,
toastLength: toastLength,
gravity: toastGravity,
timeInSecForIosWeb: timeInSeconds!,
backgroundColor: backgroundColor,
textColor: textColor,
fontSize: fontSize);
}
static void showSuccessToast({
required String message,
Toast toastLength = Toast.LENGTH_LONG,
int timeInSeconds =2,
int timeInSeconds = 2,
double fontSize = 16,
ToastGravity toastGravity = ToastGravity.TOP,
Color textColor = Colors.white,
@ -31,7 +37,14 @@ class AppToast {
int? elevation,
int imageSize = 32,
}) {
Fluttertoast.showToast(msg: message, toastLength: toastLength, gravity: toastGravity, timeInSecForIosWeb: timeInSeconds ?? 0, backgroundColor: Colors.green, textColor: textColor, fontSize: fontSize);
Fluttertoast.showToast(
msg: message,
toastLength: toastLength,
gravity: toastGravity,
timeInSecForIosWeb: timeInSeconds ?? 0,
backgroundColor: Colors.green,
textColor: textColor,
fontSize: fontSize);
}
static void showErrorToast({
@ -45,7 +58,34 @@ class AppToast {
int? elevation,
int imageSize = 32,
}) {
Fluttertoast.showToast(msg: message, toastLength: toastLength, gravity: toastGravity, timeInSecForIosWeb: timeInSeconds, backgroundColor: Colors.red, textColor: textColor, fontSize: fontSize);
FToast fToast = FToast();
fToast.init(AppGlobal.context);
Widget toast = Container(
padding: EdgeInsets.all(8),
alignment: Alignment.topCenter,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(radius.toDouble()),
color: Colors.red,
),
child: Wrap(
children: [
Text(
message,
style: TextStyle(color: textColor, fontSize: fontSize),
softWrap: true,
overflow: TextOverflow.clip,
),
],
),
);
fToast.showToast(
child: toast,
gravity: ToastGravity.TOP,
toastDuration: Duration(seconds: timeInSeconds),
positionedToastBuilder: (context, child) {
return Positioned(top: 50, left: 10, right: 10, child: child);
});
// Fluttertoast.showToast(msg: message, toastLength: toastLength, gravity: toastGravity, timeInSecForIosWeb: timeInSeconds, backgroundColor: Colors.red, textColor: textColor, fontSize: fontSize);
}
void cancelToast() {
@ -53,7 +93,8 @@ class AppToast {
}
void backWithEmpty() {
AppToast.showErrorToast(message: TranslationBase.of(AppGlobal.context).empty);
AppToast.showErrorToast(
message: TranslationBase.of(AppGlobal.context).empty);
Navigator.of(AppGlobal.context).pop();
}

@ -64,7 +64,7 @@ class LocationUtils {
print(err);
});
} else {
if (isShowConfirmDialog) showErrorLocationDialog(false);
if (isShowConfirmDialog) showErrorLocationDialog(false, failureCallBack: () {});
}
}).catchError((err) {
print(err);
@ -128,8 +128,8 @@ class LocationUtils {
heading: 0.0,
speed: 0.0,
speedAccuracy: 1, altitudeAccuracy: 0.0, headingAccuracy: 0.0,
// altitudeAccuracy: 0.0,
// headingAccuracy: 0.0,
// altitudeAccuracy: 0.0,
// headingAccuracy: 0.0,
// altitudeAccuracy: 0,
// headingAccuracy: 0,
// Added by Aamir
@ -155,14 +155,28 @@ class LocationUtils {
}
}
showErrorLocationDialog(bool isPermissionError) {
showErrorLocationDialog(bool isPermissionError, {Function()? failureCallBack}) {
ConfirmDialog dialog = new ConfirmDialog(
context: context,
confirmMessage: TranslationBase.of(context).locationDialogMessage,
okText: TranslationBase.of(context).confirm,
cancelText: TranslationBase.of(context).cancel_nocaps,
okFunction: () => {ConfirmDialog.closeAlertDialog(context), if (isPermissionError) Geolocator.openAppSettings() else Geolocator.openLocationSettings(), Navigator.of(context).canPop()},
cancelFunction: () => {});
okFunction: () {
ConfirmDialog.closeAlertDialog(context);
if (isPermissionError)
Geolocator.openAppSettings();
else
Geolocator.openLocationSettings();
Navigator.of(context).canPop();
if (failureCallBack != null) {
failureCallBack();
}
},
cancelFunction: () {
if (failureCallBack != null) {
failureCallBack();
}
});
return dialog.showAlertDialog(context);
}

@ -1,3 +1,4 @@
import 'dart:io' show Platform;
import 'package:barcode_scan2/barcode_scan2.dart';
import 'package:diplomaticquarterapp/analytics/google-analytics.dart';
import 'package:diplomaticquarterapp/config/config.dart';
@ -64,12 +65,6 @@ class AppDrawer extends StatefulWidget {
class _AppDrawerState extends State<AppDrawer> {
final InAppReview _inAppReview = InAppReview.instance;
@override
void initState() {
super.initState();
checkUserData();
}
ProjectViewModel? projectProvider;
var sharedPref = new AppSharedPreferences();
var familyFileProvider = FamilyFilesProvider();
@ -86,6 +81,12 @@ class _AppDrawerState extends State<AppDrawer> {
final authService = new AuthProvider();
String pharmacyLiveCareQRCode = "";
@override
void initState() {
super.initState();
checkUserData();
}
@override
Widget build(BuildContext context) {
projectProvider = Provider.of(context);
@ -219,7 +220,7 @@ class _AppDrawerState extends State<AppDrawer> {
builder: (BuildContext context, AsyncSnapshot<GetAllSharedRecordsByStatusResponse?> snapshot) {
switch (snapshot.connectionState) {
case ConnectionState.waiting:
return Padding(padding: EdgeInsets.all(10), child: Text(''));
return Padding(padding: EdgeInsets.all(10), child: CircularProgressIndicator());
default:
if (snapshot.hasError)
return Padding(padding: EdgeInsets.all(10), child: Text(snapshot.error.toString()));
@ -423,9 +424,9 @@ class _AppDrawerState extends State<AppDrawer> {
openAppReviewDialog();
locator<GAnalytics>().hamburgerMenu.logMenuItemClick('rate our app');
// if (Platform.isIOS) {
// launch("https://apps.apple.com/sa/app/dr-suliaman-alhabib/id733503978");
// launchUrl(Uri.parse("https://apps.apple.com/sa/app/dr-suliaman-alhabib/id733503978"));
// } else {
// launch("https://play.google.com/store/apps/details?id=com.ejada.hmg&hl=en");
// launchUrl(Uri.parse("https://play.google.com/store/apps/details?id=com.ejada.hmg&hl=en"));
// }
},
),
@ -674,7 +675,7 @@ class _AppDrawerState extends State<AppDrawer> {
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
print(err);
AppToast.showErrorToast(message: err.toString());
// AppToast.showErrorToast(message: err.toString());
Navigator.of(context).pop();
});
}
@ -689,20 +690,16 @@ class _AppDrawerState extends State<AppDrawer> {
var currentLang = await sharedPref.getString(APP_LANGUAGE);
var mainUser = await sharedPref.getObject(MAIN_USER);
var loginType = await sharedPref.getInt(LAST_LOGIN);
var pushToken = await sharedPref.getString(PUSH_TOKEN);
var oneSignalPushToken = await sharedPref.getString(ONESIGNAL_APNS_TOKEN);
this.sharedPref.clear();
// this.sharedPref.clear();
if (mainUser["PatientID"] != result.list.patientID) {
result.list.isFamily = true;
} else {
result.list.isFamily = false;
}
// result.list.cRSVerificationStatus = result['CRSVerificationStatus'];
this.sharedPref.setString(APP_LANGUAGE, currentLang);
this.sharedPref.setString(BLOOD_TYPE, bloodType);
this.sharedPref.setString(PUSH_TOKEN, pushToken);
this.sharedPref.setString(ONESIGNAL_APNS_TOKEN, oneSignalPushToken);
this.sharedPref.setInt(LAST_LOGIN, loginType ?? 1);
await this.sharedPref.setString(APP_LANGUAGE, currentLang);
await this.sharedPref.setString(BLOOD_TYPE, bloodType);
await this.sharedPref.setInt(LAST_LOGIN, loginType ?? 1 );
await this.sharedPref.setObject(MAIN_USER, mainUser);
await this.sharedPref.setObject(USER_PROFILE, result.list);
await this.sharedPref.setObject(FAMILY_FILE, familyFile);
@ -716,7 +713,7 @@ class _AppDrawerState extends State<AppDrawer> {
_vitalSignService.heightCm = "";
_vitalSignService.weightKg = "";
if (pharmacyModuleViewModel.error.isNotEmpty) await pharmacyModuleViewModel.createUser();
// if (pharmacyModuleViewModel.error.isNotEmpty) await pharmacyModuleViewModel.createUser();
int languageID = Provider.of<ProjectViewModel>(context, listen: false).isArabic ? 1 : 2;

@ -37,8 +37,8 @@ var _InAppBrowserOptions = InAppBrowserClassOptions(
class MyInAppBrowser extends InAppBrowser {
_PAYMENT_TYPE? paymentType;
// static String APPLE_PAY_PAYFORT_URL = 'https://hmgwebservices.com/PayFortWebLive/PayFortApi/MakeApplePayRequest'; // Payfort Payment Gateway URL LIVE
static String APPLE_PAY_PAYFORT_URL = 'https://hmgwebservices.com/PayFortWebLive/PayFortApi/MakeApplePayRequest'; // Payfort Payment Gateway URL UAT
static String APPLE_PAY_PAYFORT_URL = 'https://hmgwebservices.com/PayFortWebLive/PayFortApi/MakeApplePayRequest'; // Payfort Payment Gateway URL LIVE
// static String APPLE_PAY_PAYFORT_URL = 'https://hmgwebservices.com/PayFortWebLive/PayFortApi/MakeApplePayRequest'; // Payfort Payment Gateway URL UAT
static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort Payment Gateway URL UAT

@ -218,7 +218,7 @@ class DoctorHeader extends StatelessWidget {
List<DoctorRateDetails> doctorDetailsList = [];
DoctorsListService service = new DoctorsListService();
service.getDoctorsRatingDetails(headerModel.doctorId, context).then((res) {
service.getDoctorsRatingDetails(headerModel.doctorId, projectViewModel.isArabic ? 1 : 2, context).then((res) {
GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) {
doctorDetailsList.clear();

Loading…
Cancel
Save