fix merge issues

merge-requests/224/merge
Mohammad Aljammal 5 years ago
parent aa89a05f1d
commit 7167d58ce2

@ -21,18 +21,29 @@ const GET_PROJECT = 'Services/Lists.svc/REST/GetProject';
///Geofencing
const GET_GEO_ZONES = 'Services/Patients.svc/REST/GeoF_GetAllPoints';
const LOG_GEO_ZONES = 'Services/Patients.svc/REST/GeoF_InsertPatientFileInfo';
//weather
const WEATHER_INDICATOR = 'Services/Weather.svc/REST/GetCityInfo';
///Doctor
const GET_MY_DOCTOR = 'Services/Doctors.svc/REST/GetPatientDoctorAppointmentResult';
const GET_MY_DOCTOR =
'Services/Doctors.svc/REST/GetPatientDoctorAppointmentResult';
const GET_DOCTOR_PROFILE = 'Services/Doctors.svc/REST/GetDocProfiles';
const GET_DOCTOR_RATING_NOTES =
'Services/Doctors.svc/REST/dr_GetNotesDoctorRating';
const GET_DOCTOR_RATING_DETAILS =
'Services/Doctors.svc/REST/dr_GetDoctorRatingDetails';
const GET_DOCTOR_RATING = 'Services/Doctors.svc/REST/dr_GetAvgDoctorRating';
///Prescriptions
const PRESCRIPTIONS = 'Services/Patients.svc/REST/GetPrescriptionApptList';
const GET_PRESCRIPTIONS_ALL_ORDERS = 'Services/Patients.svc/REST/PatientER_GetPatientAllPresOrders';
const GET_PRESCRIPTION_REPORT = 'Services/Patients.svc/REST/INP_GetPrescriptionReport';
const SEND_PRESCRIPTION_EMAIL = 'Services/Notifications.svc/REST/SendPrescriptionEmail';
const GET_PRESCRIPTION_REPORT_ENH = 'Services/Patients.svc/REST/GetPrescriptionReport_enh';
const GET_PRESCRIPTIONS_ALL_ORDERS =
'Services/Patients.svc/REST/PatientER_GetPatientAllPresOrders';
const GET_PRESCRIPTION_REPORT =
'Services/Patients.svc/REST/INP_GetPrescriptionReport';
const SEND_PRESCRIPTION_EMAIL =
'Services/Notifications.svc/REST/SendPrescriptionEmail';
const GET_PRESCRIPTION_REPORT_ENH =
'Services/Patients.svc/REST/GetPrescriptionReport_enh';
///Lab Order
const GET_Patient_LAB_ORDERS = 'Services/Patients.svc/REST/GetPatientLabOrders';

@ -339,19 +339,7 @@ const Map localizedValues = {
"remove-family-member": {"en": "Remove this member?", "ar": "إزالة ملف العضو؟"},
"MyMedicalFile": {"en": "My Medical File", 'ar': 'ملف الطبي الالكتروني'},
"myMedicalFileSubTitle": {"en": "All your medical records", 'ar': 'جميع سجلاتك الطبية'},
"register-info-family": {
"en": "How would like to add the new member?",
"ar": "كيف ترغب باضافة العضو الجديد؟"
},
"remove-family-member": {
"en": "Remove this member?",
"ar": "إزالة ملف العضو؟"
},
"MyMedicalFile": {"en": "My Medical File", 'ar': 'ملف الطبي'},
"myMedicalFileSubTitle": {
"en": "All your medical records",
'ar': 'جميع سجلاتك الطبية'
},
"viewMore": {"en": "View More", 'ar': 'عرض المزيد'},
"homeHealthCareService": {"en": "Home Health Care Service", 'ar': 'الرعاية الصحية المنزلية'},
"OnlinePharmacy": {"en": "Online Pharmacy", 'ar': 'صيدليات الحبيب'},
@ -501,9 +489,6 @@ const Map localizedValues = {
"BalanceAmount": {"en": "Balance Amount", "ar": "رصيدالحساب"},
"TotalBalance": {"en": "Total Balance", "ar": "الرصيد الكلي"},
"CreateAdvancedPayment": {"en": "Create Advanced Payment", "ar": "إنشاء دفعة مقدمة"},
"BalanceAmount": {"en": "Wallet Amount", "ar": "مبلغ المحفظة"},
"TotalBalance": {"en": "Total Amount", "ar": "المبلغ الإجمالي"},
"CreateAdvancedPayment": {"en": "Recharge Wallet", "ar": "إعادة شحن المحفظة"},
"AdvancePayment": {"en": "Advance Payment", "ar": "الدفع مقدما"},
"AdvancePaymentLabel": {"en": "You can create and add an Advanced Payment for you account or other accounts.", "ar": "يمكنك تحويل مبلغ لحسابك لدى المجموعة أو لحساب احد المراجعين"},
"FileNumber": {"en": "File Number", "ar": "رقم الملف"},

@ -151,13 +151,68 @@ class BaseAppClient {
onFailure('Please Check The Internet Connection', -1);
}
} catch (e) {
//print(e);
//
if (e is String) {
onFailure(e.toString(), -1);
print(e);
onFailure(e.toString(), -1);
}
}
get(String endPoint,
{Function(dynamic response, int statusCode) onSuccess,
Function(String error, int statusCode) onFailure,
Map<String, String> queryParams}) async {
String url = BASE_URL + endPoint;
if (queryParams != null) {
String queryString = Uri(queryParameters: queryParams).query;
url += '?' + queryString;
}
print("URL : $url");
if (await Utils.checkConnection()) {
final response = await http.get(url.trim(), headers: {
'Content-Type': 'application/json',
'Accept': 'application/json'
},);
final int statusCode = response.statusCode;
print("statusCode :$statusCode");
if (statusCode < 200 || statusCode >= 400 || json == null) {
onFailure('Error While Fetching data', statusCode);
} else {
var parsed = json.decode(response.body.toString());
onSuccess(parsed, statusCode);
}
} else {
onFailure('Please Check The Internet Connection', -1);
}
}
simpleGet(String fullUrl, {Function(dynamic response, int statusCode) onSuccess, Function(String error, int statusCode) onFailure, Map<String, String> queryParams}) async {
String url = fullUrl;
var haveParams = (queryParams != null);
if (haveParams) {
String queryString = Uri(queryParameters: queryParams).query;
url += '?' + queryString;
print("URL Query String: $url");
}
if (await Utils.checkConnection()) {
final response = await http.get(
url.trim(),
headers: {'Content-Type': 'application/json', 'Accept': 'application/json'},
);
final int statusCode = response.statusCode;
print("statusCode :$statusCode");
if (statusCode < 200 || statusCode >= 400 || json == null) {
onFailure('Error While Fetching data', statusCode);
} else {
onFailure('Failed to connect to the server', -1);
onSuccess(response.body.toString(), statusCode);
}
} else {
onFailure('Please Check The Internet Connection', -1);
}
}

@ -10,20 +10,20 @@ class OrderPreviewService extends BaseService{
List<Addresses> addresses = List();
Future getBannerListList() async {
hasError = false;
try {
await baseAppClient.get(GET_CUSTOMERS_ADDRESSES,
onSuccess: (dynamic response, int statusCode) {
addresses.clear();
response['customers'][0]['addresses'].forEach((item) {
addresses.add(Addresses.fromJson(item));
});
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
});
} catch (error) {
throw error;
}
// hasError = false;
// try {
// await baseAppClient.get(GET_CUSTOMERS_ADDRESSES,
// onSuccess: (dynamic response, int statusCode) {
// addresses.clear();
// response['customers'][0]['addresses'].forEach((item) {
// addresses.add(Addresses.fromJson(item));
// });
// }, onFailure: (String error, int statusCode) {
// hasError = true;
// super.error = error;
// });
// } catch (error) {
// throw error;
// }
}
}

@ -18,16 +18,16 @@ class PharmacyModuleService extends BaseService {
Future getBannerListList() async {
hasError = false;
try {
await baseAppClient.get(GET_PHARMACY_BANNER,
onSuccess: (dynamic response, int statusCode) {
bannerItems.clear();
response['images'].forEach((item) {
bannerItems.add(PharmacyImageObject.fromJson(item));
});
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
});
// await baseAppClient.get(GET_PHARMACY_BANNER,
// onSuccess: (dynamic response, int statusCode) {
// bannerItems.clear();
// response['images'].forEach((item) {
// bannerItems.add(PharmacyImageObject.fromJson(item));
// });
// }, onFailure: (String error, int statusCode) {
// hasError = true;
// super.error = error;
// });
} catch (error) {
throw error;
}
@ -36,16 +36,16 @@ class PharmacyModuleService extends BaseService {
Future getTopManufacturerList() async {
Map<String, String> queryParams = {'page': '1', 'limit': '8'};
try {
await baseAppClient.get(GET_PHARMACY_TOP_MANUFACTURER,
onSuccess: (dynamic response, int statusCode) {
manufacturerList.clear();
response['manufacturer'].forEach((item) {
manufacturerList.add(Manufacturer.fromJson(item));
});
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, queryParams: queryParams);
// await baseAppClient.get(GET_PHARMACY_TOP_MANUFACTURER,
// onSuccess: (dynamic response, int statusCode) {
// manufacturerList.clear();
// response['manufacturer'].forEach((item) {
// manufacturerList.add(Manufacturer.fromJson(item));
// });
// }, onFailure: (String error, int statusCode) {
// hasError = true;
// super.error = error;
// }, queryParams: queryParams);
} catch (error) {
throw error;
}
@ -57,16 +57,16 @@ class PharmacyModuleService extends BaseService {
'id,discount_ids,name,namen,localized_names,display_order,short_description,full_description,full_descriptionn,sku,order_minimum_quantity,order_maximum_quantity,price,old_price,images,is_rx,rx_message,rx_messagen,discount_name,discount_namen,approved_rating_sum,approved_total_reviews,allow_back_in_stock_subscriptions,stock_quantity,stock_availability,stock_availabilityn,discount_percentage,reviews',
};
try {
await baseAppClient.get(GET_PHARMACY_BEST_SELLER_PRODUCT,
onSuccess: (dynamic response, int statusCode) {
bestSellerProducts.clear();
response['products'].forEach((item) {
bestSellerProducts.add(PharmacyProduct.fromJson(item));
});
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, queryParams: queryParams);
// await baseAppClient.get(GET_PHARMACY_BEST_SELLER_PRODUCT,
// onSuccess: (dynamic response, int statusCode) {
// bestSellerProducts.clear();
// response['products'].forEach((item) {
// bestSellerProducts.add(PharmacyProduct.fromJson(item));
// });
// }, onFailure: (String error, int statusCode) {
// hasError = true;
// super.error = error;
// }, queryParams: queryParams);
} catch (error) {
throw error;
}
@ -79,16 +79,16 @@ class PharmacyModuleService extends BaseService {
lastVisited =
await this.sharedPref.getString(PHARMACY_LAST_VISITED_PRODUCTS);
try {
await baseAppClient.get("$GET_PHARMACY_PRODUCTs_BY_IDS$lastVisited",
onSuccess: (dynamic response, int statusCode) {
lastVisitedProducts.clear();
response['products'].forEach((item) {
lastVisitedProducts.add(PharmacyProduct.fromJson(item));
});
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
});
// await baseAppClient.get("$GET_PHARMACY_PRODUCTs_BY_IDS$lastVisited",
// onSuccess: (dynamic response, int statusCode) {
// lastVisitedProducts.clear();
// response['products'].forEach((item) {
// lastVisitedProducts.add(PharmacyProduct.fromJson(item));
// });
// }, onFailure: (String error, int statusCode) {
// hasError = true;
// super.error = error;
// });
} catch (error) {
throw error;
}

@ -103,9 +103,9 @@ class PrescriptionsViewModel extends BaseViewModel {
notifyListeners();
}
getPrescriptionReport({int dischargeNo,int projectId,int clinicID,String setupID,int episodeID}) async {
getPrescriptionReport({Prescriptions prescriptions}) async {
setState(ViewState.Busy);
await _prescriptionsService.getPrescriptionReport(dischargeNo: dischargeNo,projectId: projectId,clinicID: clinicID,setupID: setupID,episodeID: episodeID);
await _prescriptionsService.getPrescriptionReport(prescriptions: prescriptions);
if (_prescriptionsService.hasError) {
error = _prescriptionsService.error;
setState(ViewState.ErrorLocal);

@ -4,6 +4,7 @@ import 'package:connectivity/connectivity.dart';
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart';
import 'package:diplomaticquarterapp/locator.dart';
import 'package:diplomaticquarterapp/uitl/PlatformBridge.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter_datetime_picker/flutter_datetime_picker.dart';

@ -0,0 +1,32 @@
class DoctorRateDetails {
dynamic doctorID;
dynamic projectID;
dynamic clinicID;
dynamic rate;
dynamic patientNumber;
DoctorRateDetails(
{this.doctorID,
this.projectID,
this.clinicID,
this.rate,
this.patientNumber});
DoctorRateDetails.fromJson(Map<String, dynamic> json) {
doctorID = json['DoctorID'];
projectID = json['ProjectID'];
clinicID = json['ClinicID'];
rate = json['Rate'];
patientNumber = json['PatientNumber'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['DoctorID'] = this.doctorID;
data['ProjectID'] = this.projectID;
data['ClinicID'] = this.clinicID;
data['Rate'] = this.rate;
data['PatientNumber'] = this.patientNumber;
return data;
}
}

@ -2,6 +2,7 @@ import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/model/my_balance/AdvanceModel.dart';
import 'package:diplomaticquarterapp/core/model/my_balance/patient_info_and_mobile_number.dart';
import 'package:diplomaticquarterapp/core/viewModels/appointment_rate_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/medical/my_balance_view_model.dart';
import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart';
import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart';
@ -10,6 +11,7 @@ import 'package:diplomaticquarterapp/routes.dart';
import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
@ -18,7 +20,6 @@ import 'package:diplomaticquarterapp/widgets/in_app_browser/InAppBrowser.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:smart_progress_bar/smart_progress_bar.dart';
import 'dialogs/ConfirmSMSDialog.dart';
import 'new_text_Field.dart';
@ -159,16 +160,16 @@ class ConfirmPaymentPage extends StatelessWidget {
label: TranslationBase.of(context).confirm.toUpperCase(),
disabled: model.state == ViewState.Busy,
onTap: () {
GifLoaderDialogUtils.showMyDialog(context);
model
.sendActivationCodeForAdvancePayment(
patientID: int.parse(advanceModel.fileNumber),
projectID: advanceModel.hospitalsModel.iD)
.then((value) {
GifLoaderDialogUtils.hideDialog(context);
if (model.state != ViewState.ErrorLocal &&
model.state != ViewState.Error) showSMSDialog();
}).showProgressBar(
text: "Loading",
backgroundColor: Colors.blue.withOpacity(0.6));
});
},
),
),
@ -213,6 +214,9 @@ class ConfirmPaymentPage extends StatelessWidget {
appo.projectID.toString(),
authenticatedUser.emailAddress,
paymentMethod,
authenticatedUser.patientType,
authenticatedUser.firstName,
authenticatedUser.patientID,
authenticatedUser,
browser);
}
@ -245,12 +249,14 @@ class ConfirmPaymentPage extends StatelessWidget {
checkPaymentStatus(AppoitmentAllHistoryResultList appo) {
DoctorsListService service = new DoctorsListService();
GifLoaderDialogUtils.showMyDialog(AppGlobal.context);
service
.checkPaymentStatus(
Utils.getAppointmentTransID(
appo.projectID, appo.clinicID, appo.appointmentNo),
AppGlobal.context)
.then((res) {
GifLoaderDialogUtils.hideDialog(AppGlobal.context);
print("Printing Payment Status Reponse!!!!");
print(res);
String paymentInfo = res['Response_Message'];
@ -260,18 +266,21 @@ class ConfirmPaymentPage extends StatelessWidget {
AppToast.showErrorToast(message: res['Response_Message']);
}
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(AppGlobal.context);
AppToast.showErrorToast(message: err);
print(err);
}).showProgressBar(
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
});
}
createAdvancePayment(res, AppoitmentAllHistoryResultList appo) {
DoctorsListService service = new DoctorsListService();
String paymentReference = res['Fort_id'].toString();
GifLoaderDialogUtils.showMyDialog(AppGlobal.context);
service
.createAdvancePayment(appo, appo.projectID.toString(), res['Amount'], res['Fort_id'],
res['PaymentMethod'], AppGlobal.context)
.then((res) {
GifLoaderDialogUtils.hideDialog(AppGlobal.context);
print(res['OnlineCheckInAppointments'][0]['AdvanceNumber']);
addAdvancedNumberRequest(
res['OnlineCheckInAppointments'][0]['AdvanceNumber'].toString(),
@ -279,24 +288,28 @@ class ConfirmPaymentPage extends StatelessWidget {
appo.appointmentNo.toString(),
appo);
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(AppGlobal.context);
AppToast.showErrorToast(message: err);
print(err);
}).showProgressBar(
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
});
}
addAdvancedNumberRequest(String advanceNumber, String paymentReference,
String appointmentID, AppoitmentAllHistoryResultList appo) {
DoctorsListService service = new DoctorsListService();
GifLoaderDialogUtils.showMyDialog(AppGlobal.context);
service
.addAdvancedNumberRequest(
advanceNumber, paymentReference, appointmentID, AppGlobal.context)
.then((res) {
GifLoaderDialogUtils.hideDialog(AppGlobal.context);
print(res);
navigateToHome(AppGlobal.context);
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(AppGlobal.context);
AppToast.showErrorToast(message: err);
print(err);
}).showProgressBar(
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
});
}
Future navigateToHome(context) async {

@ -14,7 +14,6 @@ import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:diplomaticquarterapp/widgets/in_app_browser/InAppBrowser.dart';
import 'package:flutter/material.dart';
import 'package:flutter_inappwebview/flutter_inappwebview.dart';
import 'package:smart_progress_bar/smart_progress_bar.dart';
import 'QRCode.dart';
@ -454,36 +453,37 @@ class _BookSuccessState extends State<BookSuccess> {
confirmAppointment(AppoitmentAllHistoryResultList appo) {
DoctorsListService service = new DoctorsListService();
GifLoaderDialogUtils.showMyDialog(context);
service
.confirmAppointment(appo.appointmentNo, appo.clinicID, appo.projectID,
appo.isLiveCareAppointment, context)
.then((res) {
if (res['MessageStatus'] == 1) {
AppToast.showSuccessToast(message: res['ErrorEndUserMessage']);
} else {
AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
}
})
.catchError((err) {
print(err);
})
.showProgressBar(
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6))
.then((value) {
if (appo.isLiveCareAppointment) {
insertLiveCareVIDARequest(appo);
} else {
navigateToHome(context);
}
});
GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) {
AppToast.showSuccessToast(message: res['ErrorEndUserMessage']);
if (appo.isLiveCareAppointment) {
insertLiveCareVIDARequest(appo);
} else {
navigateToHome(context);
}
} else {
AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
}
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: err);
print(err);
});
}
insertLiveCareVIDARequest(AppoitmentAllHistoryResultList appo) {
DoctorsListService service = new DoctorsListService();
GifLoaderDialogUtils.showMyDialog(context);
service
.insertVIDARequest(appo.appointmentNo, appo.clinicID, appo.projectID,
appo.serviceID, appo.doctorID, context)
.then((res) {
GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) {
AppToast.showSuccessToast(message: res['ErrorEndUserMessage']);
navigateToHome(context);
@ -491,9 +491,10 @@ class _BookSuccessState extends State<BookSuccess> {
AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
}
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: err);
print(err);
}).showProgressBar(
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
});
}
Widget _getPayNowAppo() {
@ -613,7 +614,7 @@ class _BookSuccessState extends State<BookSuccess> {
AppoitmentAllHistoryResultList appo) async {
if (paymentMethod == "ApplePay") {
await widget.chromeBrowser.open(
url: "https://flutter.dev/",
url: "https://applepay-datatrans-sample.herokuapp.com/",
options: ChromeSafariBrowserClassOptions(
android: AndroidChromeCustomTabsOptions(
addDefaultShareMenuItem: false),
@ -632,6 +633,9 @@ class _BookSuccessState extends State<BookSuccess> {
appo.projectID.toString(),
authenticatedUser.emailAddress,
paymentMethod,
authenticatedUser.patientType,
authenticatedUser.firstName,
authenticatedUser.patientID,
authenticatedUser,
widget.browser);
}
@ -689,6 +693,7 @@ class _BookSuccessState extends State<BookSuccess> {
}
getApplePayAPQ(AppoitmentAllHistoryResultList appo) {
GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService();
service
.checkPaymentStatus(
@ -696,6 +701,7 @@ class _BookSuccessState extends State<BookSuccess> {
appo.projectID, appo.clinicID, appo.appointmentNo),
context)
.then((res) {
GifLoaderDialogUtils.hideDialog(context);
print("Printing Payment Status Reponse!!!!");
print(res);
String paymentInfo = res['Response_Message'];
@ -705,9 +711,10 @@ class _BookSuccessState extends State<BookSuccess> {
AppToast.showErrorToast(message: res['Response_Message']);
}
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: err);
print(err);
}).showProgressBar(
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
});
}
createAdvancePayment(res, AppoitmentAllHistoryResultList appo) {

@ -125,10 +125,9 @@ class _ApointmentCardState extends State<AppointmentCard> {
widget.appo.patientStatusType ==
AppointmentType.CONFIRMED)
? Container(
//TODO fix it remove couz merge
child: CountdownTimer(
endTime: DateTime.now().millisecondsSinceEpoch +
(widget.appo.remaniningHoursTocanPay * 1000) *
60,
// endTime: DateTime.now().millisecondsSinceEpoch + (widget.appo.remaniningHoursTocanPay * 1000) * 60,
widgetBuilder: (_, CurrentRemainingTime time) {
return Text(
'${time.days}:${time.hours}:${time.min}:${time.sec} ' +

@ -228,13 +228,9 @@ class _ToDoState extends State<ToDo> {
],
),
Container(
//TODO fix it removed by Mohammad Aljammal
child: CountdownTimer(
endTime: DateTime.now()
.millisecondsSinceEpoch +
(widget.appoList[index]
.remaniningHoursTocanPay *
1000) *
60,
//endTime: DateTime.now().millisecondsSinceEpoch + (widget.appoList[index].remaniningHoursTocanPay * 1000) * 60,
widgetBuilder:
(_, CurrentRemainingTime time) {
return Text(

@ -1,10 +1,12 @@
import 'package:diplomaticquarterapp/config/size_config.dart';
import 'package:diplomaticquarterapp/core/model/geofencing/requests/GeoZonesRequestModel.dart';
import 'package:diplomaticquarterapp/core/model/geofencing/requests/LogGeoZoneRequestModel.dart';
import 'package:diplomaticquarterapp/core/service/AuthenticatedUserObject.dart';
import 'package:diplomaticquarterapp/core/service/geofencing/GeofencingServices.dart';
import 'package:diplomaticquarterapp/core/viewModels/dashboard_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/locator.dart';
import 'package:diplomaticquarterapp/models/Appointments/toDoCountProviderModel.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_index_page.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/HomeHealthCare/home_health_care_index_page.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/all_habib_medical_service_page.dart';

@ -3,9 +3,7 @@ import 'dart:typed_data';
import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/model/geofencing/requests/GeoZonesRequestModel.dart';
import 'package:diplomaticquarterapp/core/service/AuthenticatedUserObject.dart';
import 'package:diplomaticquarterapp/core/service/geofencing/GeofencingServices.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart';
import 'package:diplomaticquarterapp/models/Authentication/select_device_imei_res.dart';
@ -18,11 +16,7 @@ import 'package:diplomaticquarterapp/pages/medical/medical_profile_page.dart';
import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart';
import 'package:diplomaticquarterapp/services/robo_search/event_provider.dart';
import 'package:diplomaticquarterapp/uitl/CalendarUtils.dart';
import 'package:diplomaticquarterapp/uitl/HMGNetworkConnectivity.dart';
import 'package:diplomaticquarterapp/uitl/HMG_Geofence.dart';
import 'package:diplomaticquarterapp/uitl/LocalNotification.dart';
import 'package:diplomaticquarterapp/uitl/PlatformBridge.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/bottom_navigation/bottom_nav_bar.dart';
import 'package:diplomaticquarterapp/widgets/buttons/floatingActionButton.dart';
@ -35,7 +29,7 @@ import 'package:flutter/material.dart';
import 'package:flutter_local_notifications/flutter_local_notifications.dart';
import 'package:permission_handler/permission_handler.dart';
import 'package:provider/provider.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import '../../locator.dart';
import '../../routes.dart';
import 'home_page.dart';
@ -52,9 +46,8 @@ class LandingPage extends StatefulWidget {
class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
int currentTab = 0;
PageController pageController;
ProjectViewModel projectViewModel;
ProjectViewModel projectProvider;
var notificationCount = '';
var themeNotifier;
///inject the user data
AuthenticatedUserObject authenticatedUserObject =
@ -76,7 +69,7 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
}
bool isPageNavigated = false;
LocationUtils locationUtils;
_changeCurrentTab(int tab) {
setState(() {
currentTab = tab;
@ -98,7 +91,6 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
print("didChangeAppLifecycleState");
print('state = $state');
AppGlobal.context = context;
if (state == AppLifecycleState.resumed) {
print(LandingPage.isOpenCallPage);
if (LandingPage.isOpenCallPage) {
@ -135,7 +127,6 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
@override
void initState() {
super.initState();
WidgetsBinding.instance.addObserver(this);
//setState(() {
AppGlobal.context = context;
@ -144,172 +135,136 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
pageController = PageController(keepPage: true);
_firebaseMessaging.setAutoInitEnabled(true);
// HMG (Guest/Internet) Wifi Access [Zohaib Kambrani]
HMGNetworkConnectivity(context, () {
GifLoaderDialogUtils.showMyDialog(context);
PlatformBridge().connectHMGGuestWifi().then((value) => {GifLoaderDialogUtils.hideDialog(context)});
}).checkAndConnectIfNoInternet();
if (Platform.isIOS) {
_firebaseMessaging.requestNotificationPermissions();
}
// Flip Permission Checks [Zohaib Kambrani]
requestPermissions().then((results) {
if (results[Permission.locationAlways].isGranted || results[Permission.location].isGranted) {
debugPrint("Fetching GEO ZONES from HMG service...");
locator<GeofencingServices>().getAllGeoZones(GeoZonesRequestModel()).then((geoZones) {
debugPrint("GEO ZONES saved to AppPreferences with key '$HMG_GEOFENCES'");
debugPrint("Finished Fetching GEO ZONES from HMG service...");
projectViewModel.platformBridge().registerHmgGeofences();
});
}
if (results[Permission.notification].isGranted)
_firebaseMessaging.getToken().then((String token) {
sharedPref.setString(PUSH_TOKEN, token);
if (token != null && DEVICE_TOKEN == "") {
DEVICE_TOKEN = token;
checkUserStatus(token);
}
});
if (results[Permission.storage].isGranted) ;
if (results[Permission.camera].isGranted) ;
if (results[Permission.photos].isGranted) ;
if (results[Permission.accessMediaLocation].isGranted) ;
if (results[Permission.calendar].isGranted) ;
_firebaseMessaging.getToken().then((String token) async {
_firebaseMessaging.getToken().then((String token) {
sharedPref.setString(PUSH_TOKEN, token);
if (token != null && await sharedPref.getObject(USER_PROFILE) == null) {
if (token != null && DEVICE_TOKEN == "") {
DEVICE_TOKEN = token;
checkUserStatus(token);
} else if (projectViewModel.isLogin) {
getNotificationCount(token);
}
requestPermissions();
}).catchError((err) {
print(err);
});
requestPermissions();
// });
//
// //_firebase Background message handler
Future.delayed(Duration.zero, () => setTheme());
//_firebase Background message handler
// _firebaseMessaging.configure(
// onMessage: (Map<String, dynamic> message) async {
// showDialog("onMessage: $message");
// print("onMessage: $message");
// print(message);
// print(message['name']);
// print(message['appointmentdate']);
//
// if (Platform.isIOS) {
// if (message['is_call'] == "true") {
// var route = ModalRoute.of(context);
//
// if (route != null) {
// print(route.settings.name);
// }
//
// Map<String, dynamic> myMap = new Map<String, dynamic>.from(message);
// print(myMap);
// LandingPage.isOpenCallPage = true;
// LandingPage.incomingCallData = IncomingCallData.fromJson(myMap);
// if (!isPageNavigated) {
// isPageNavigated = true;
// Navigator.push(
// context,
// MaterialPageRoute(
// builder: (context) => IncomingCall(
// incomingCallData: LandingPage.incomingCallData)))
// .then((value) {
// isPageNavigated = false;
// });
// }
// } else {
// print("Is Call Not Found iOS");
// }
// } else {
// print("Is Call Not Found iOS");
// }
//
// if (Platform.isAndroid) {
// if (message['data'].containsKey("is_call")) {
// var route = ModalRoute.of(context);
//
// if (route != null) {
// print(route.settings.name);
// }
//
// Map<String, dynamic> myMap =
// new Map<String, dynamic>.from(message['data']);
// print(myMap);
// LandingPage.isOpenCallPage = true;
// LandingPage.incomingCallData = IncomingCallData.fromJson(myMap);
// if (!isPageNavigated) {
// isPageNavigated = true;
// Navigator.push(
// context,
// MaterialPageRoute(
// builder: (context) => IncomingCall(
// incomingCallData: LandingPage.incomingCallData)))
// .then((value) {
// isPageNavigated = false;
// });
// }
// } else {
// print("Is Call Not Found Android");
// }
// } else {
// print("Is Call Not Found Android");
// }
// },
// onBackgroundMessage: Platform.isIOS ? null : myBackgroundMessageHandler,
// onLaunch: (Map<String, dynamic> message) async {
// print("onLaunch: $message");
// showDialog("onLaunch: $message");
// },
// onResume: (Map<String, dynamic> message) async {
// print("onResume: $message");
// print(message);
// print(message['name']);
// print(message['appointmentdate']);
//
// showDialog("onResume: $message");
//
// if (Platform.isIOS) {
// if (message['is_call'] == "true") {
// var route = ModalRoute.of(context);
//
// if (route != null) {
// print(route.settings.name);
// }
//
// Map<String, dynamic> myMap =
// new Map<String, dynamic>.from(message);
// print(myMap);
// LandingPage.isOpenCallPage = true;
// LandingPage.incomingCallData = IncomingCallData.fromJson(myMap);
// if (!isPageNavigated) {
// isPageNavigated = true;
// Navigator.push(
// context,
// MaterialPageRoute(
// builder: (context) => IncomingCall(
// incomingCallData: LandingPage.incomingCallData)))
// .then((value) {
// isPageNavigated = false;
// });
// }
// } else {
// print("Is Call Not Found iOS");
// }
// } else {
// print("Is Call Not Found iOS");
// }
// },
// );
// // onMessage: (Map<String, dynamic> message) async {
// // showDialog("onMessage: $message");
// // print("onMessage: $message");
// // print(message);
// // print(message['name']);
// // print(message['appointmentdate']);
// //
// // if (Platform.isIOS) {
// // if (message['is_call'] == "true") {
// // var route = ModalRoute.of(context);
// //
// // if (route != null) {
// // print(route.settings.name);
// // }
// //
// // Map<String, dynamic> myMap = new Map<String, dynamic>.from(message);
// // print(myMap);
// // LandingPage.isOpenCallPage = true;
// // LandingPage.incomingCallData = IncomingCallData.fromJson(myMap);
// // if (!isPageNavigated) {
// // isPageNavigated = true;
// // Navigator.push(
// // context,
// // MaterialPageRoute(
// // builder: (context) => IncomingCall(
// // incomingCallData: LandingPage.incomingCallData)))
// // .then((value) {
// // isPageNavigated = false;
// // });
// // }
// // } else {
// // print("Is Call Not Found iOS");
// // }
// // } else {
// // print("Is Call Not Found iOS");
// // }
// //
// // if (Platform.isAndroid) {
// // if (message['data'].containsKey("is_call")) {
// // var route = ModalRoute.of(context);
// //
// // if (route != null) {
// // print(route.settings.name);
// // }
// //
// // Map<String, dynamic> myMap =
// // new Map<String, dynamic>.from(message['data']);
// // print(myMap);
// // LandingPage.isOpenCallPage = true;
// // LandingPage.incomingCallData = IncomingCallData.fromJson(myMap);
// // if (!isPageNavigated) {
// // isPageNavigated = true;
// // Navigator.push(
// // context,
// // MaterialPageRoute(
// // builder: (context) => IncomingCall(
// // incomingCallData: LandingPage.incomingCallData)))
// // .then((value) {
// // isPageNavigated = false;
// // });
// // }
// // } else {
// // print("Is Call Not Found Android");
// // }
// // } else {
// // print("Is Call Not Found Android");
// // }
// // },
// // onBackgroundMessage: Platform.isIOS ? null : myBackgroundMessageHandler,
// // onLaunch: (Map<String, dynamic> message) async {
// // print("onLaunch: $message");
// // showDialog("onLaunch: $message");
// // },
// // onResume: (Map<String, dynamic> message) async {
// // print("onResume: $message");
// // print(message);
// // print(message['name']);
// // print(message['appointmentdate']);
// //
// // showDialog("onResume: $message");
// //
// // if (Platform.isIOS) {
// // if (message['is_call'] == "true") {
// // var route = ModalRoute.of(context);
// //
// // if (route != null) {
// // print(route.settings.name);
// // }
// //
// // Map<String, dynamic> myMap =
// // new Map<String, dynamic>.from(message);
// // print(myMap);
// // LandingPage.isOpenCallPage = true;
// // LandingPage.incomingCallData = IncomingCallData.fromJson(myMap);
// // if (!isPageNavigated) {
// // isPageNavigated = true;
// // Navigator.push(
// // context,
// // MaterialPageRoute(
// // builder: (context) => IncomingCall(
// // incomingCallData: LandingPage.incomingCallData)))
// // .then((value) {
// // isPageNavigated = false;
// // });
// // }
// // } else {
// // print("Is Call Not Found iOS");
// // }
// // } else {
// // print("Is Call Not Found iOS");
// // }
// // },
// );
}
showDialogs(String message) {
@ -379,9 +334,8 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
@override
Widget build(BuildContext context) {
projectViewModel = Provider.of<ProjectViewModel>(context);
themeNotifier = Provider.of<ThemeNotifier>(context);
//setTheme();
ProjectViewModel projectViewModel = Provider.of(context);
return Scaffold(
appBar: AppBar(
elevation: 0,
@ -425,7 +379,7 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
notificationCount,
style: new TextStyle(
color: Colors.white,
fontSize: projectViewModel.isArabic ? 8 : 9,
fontSize: projectViewModel.isArabic ? 8 : 9,
),
textAlign: TextAlign.center,
),
@ -449,7 +403,9 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
SETTINGS,
);
else
login();
Navigator.of(context).pushNamed(
WELCOME_LOGIN,
);
}, //do something,
)
],
@ -469,7 +425,7 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
MedicalProfilePage(),
BookingOptions(),
MyFamily(isAppbarVisible: false),
ToDo(isShowAppBar: false),
ToDo(),
], // Please do not remove the BookingOptions from this array
),
bottomNavigationBar: BottomNavBar(
@ -504,14 +460,26 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
return TranslationBase.of(context).bookAppo;
}
}
void checkUserStatus(token) async {
//GifLoaderDialogUtils.showMyDialog(context);
authService
.selectDeviceImei(token)
.then((SelectDeviceIMEIRES value) => setUserValues(value))
.catchError((err) {
//GifLoaderDialogUtils.hideDialog(context);
});
.then((SelectDeviceIMEIRES value) => setUserValues(value));
if (await sharedPref.getObject(USER_PROFILE) != null) {
var data =
AuthenticatedUser.fromJson(await sharedPref.getObject(USER_PROFILE));
if (data != null) {
authService
.registeredAuthenticatedUser(data, token, 0, 0)
.then((res) => {print(res)});
authService.getDashboard().then((value) => {
setState(() {
notificationCount = value['List_PatientDashboard']
[0]['UnreadPatientNotificationCount'].toString();
})
});
}
}
}
static Future<dynamic> myBackgroundMessageHandler(
@ -531,8 +499,6 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
}
void setUserValues(value) async {
//GifLoaderDialogUtils.hideDialog(context);
sharedPref.setObject(IMEI_USER_DATA, value);
}
@ -541,36 +507,4 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
_changeCurrentTab(2);
}
}
login() async {
var data = await sharedPref.getObject(IMEI_USER_DATA);
sharedPref.remove(REGISTER_DATA_FOR_LOGIIN);
if (data != null) {
Navigator.of(context).pushNamed(CONFIRM_LOGIN);
} else {
Navigator.of(context).pushNamed(
WELCOME_LOGIN,
);
}
}
getNotificationCount(token) async {
if (await sharedPref.getObject(USER_PROFILE) != null) {
var data =
AuthenticatedUser.fromJson(await sharedPref.getObject(USER_PROFILE));
if (data != null) {
authService
.registeredAuthenticatedUser(data, token, 0, 0)
.then((res) => {print(res)});
authService.getDashboard().then((value) => {
setState(() {
notificationCount = value['List_PatientDashboard'][0]
['UnreadPatientNotificationCount']
.toString();
sharedPref.setString(NOTIFICATION_COUNT, notificationCount);
})
});
}
}
}
}

@ -17,13 +17,13 @@ import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart'
import 'package:diplomaticquarterapp/services/livecare_services/livecare_provider.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart';
import 'package:diplomaticquarterapp/widgets/in_app_browser/InAppBrowser.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:smart_progress_bar/smart_progress_bar.dart';
class ClinicList extends StatefulWidget {
final Function getLiveCareHistory;
@ -79,31 +79,27 @@ class _clinic_listState extends State<ClinicList> {
void startLiveCare() {
bool isError = false;
LiveCareService service = new LiveCareService();
GifLoaderDialogUtils.showMyDialog(context);
ERAppointmentFeesResponse erAppointmentFeesResponse =
new ERAppointmentFeesResponse();
service
.getERAppointmentFees(selectedClinicID, context)
.then((res) {
if (res['HasAppointment'] == true) {
isError = true;
showLiveCareCancelDialog(res['ErrorEndUserMessage'], res);
} else {
erAppointmentFeesResponse = ERAppointmentFeesResponse.fromJson(res);
isError = false;
}
})
.catchError((err) {
print(err);
isError = true;
AppToast.showErrorToast(message: err);
})
.showProgressBar(
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6))
.then((value) {
if (!isError)
getERAppointmentTime(
erAppointmentFeesResponse.getERAppointmentFeesList);
});
service.getERAppointmentFees(selectedClinicID, context).then((res) {
GifLoaderDialogUtils.hideDialog(context);
if (res['HasAppointment'] == true) {
isError = true;
showLiveCareCancelDialog(res['ErrorEndUserMessage'], res);
} else {
erAppointmentFeesResponse = ERAppointmentFeesResponse.fromJson(res);
isError = false;
}
if (!isError)
getERAppointmentTime(
erAppointmentFeesResponse.getERAppointmentFeesList);
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
print(err);
isError = true;
AppToast.showErrorToast(message: err);
});
}
showLiveCareCancelDialog(String msg, res) {
@ -112,8 +108,7 @@ class _clinic_listState extends State<ClinicList> {
confirmMessage: msg,
okText: TranslationBase.of(context).confirm,
cancelText: TranslationBase.of(context).cancel_nocaps,
okFunction: () =>
{cancelAppointment(res)},
okFunction: () => {cancelAppointment(res)},
cancelFunction: () => {});
dialog.showAlertDialog(context);
}
@ -132,38 +127,37 @@ class _clinic_listState extends State<ClinicList> {
appo.appointmentDate = res['AppointmentDate'];
ConfirmDialog.closeAlertDialog(context);
GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService();
service
.cancelAppointment(appo, context)
.then((res) {
print(res);
if (res['MessageStatus'] == 1) {
AppToast.showSuccessToast(message: res['ErrorEndUserMessage']);
} else {
AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
}
})
.catchError((err) {
print(err);
})
.showProgressBar(
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6))
.then((value) {
startLiveCare();
});
service.cancelAppointment(appo, context).then((res) {
GifLoaderDialogUtils.hideDialog(context);
print(res);
if (res['MessageStatus'] == 1) {
AppToast.showSuccessToast(message: res['ErrorEndUserMessage']);
startLiveCare();
} else {
AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
}
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: err);
print(err);
});
}
getERAppointmentTime(GetERAppointmentFeesList getERAppointmentFeesList) {
LiveCareService service = new LiveCareService();
GifLoaderDialogUtils.showMyDialog(context);
service.getERAppointmentTime(selectedClinicID, context).then((res) {
GifLoaderDialogUtils.hideDialog(context);
print(res);
showLiveCarePaymentDialog(
getERAppointmentFeesList, res['WatingtimeInteger']);
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
print(err);
AppToast.showErrorToast(message: err);
}).showProgressBar(
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
});
}
showLiveCarePaymentDialog(
@ -285,6 +279,9 @@ class _clinic_listState extends State<ClinicList> {
"12",
authenticatedUser.emailAddress,
paymentMethod,
authenticatedUser.patientType,
authenticatedUser.firstName,
authenticatedUser.patientID,
authenticatedUser,
browser);
}
@ -317,12 +314,14 @@ class _clinic_listState extends State<ClinicList> {
checkPaymentStatus(AppoitmentAllHistoryResultList appo) {
DoctorsListService service = new DoctorsListService();
GifLoaderDialogUtils.showMyDialog(context);
service
.checkPaymentStatus(
Utils.getAppointmentTransID(
appo.projectID, appo.clinicID, appo.appointmentNo),
context)
.then((res) {
GifLoaderDialogUtils.hideDialog(context);
print("Printing Payment Status Reponse!!!!");
print(res);
String paymentInfo = res['Response_Message'];
@ -333,27 +332,27 @@ class _clinic_listState extends State<ClinicList> {
AppToast.showErrorToast(message: res['Response_Message']);
}
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: err);
print(err);
}).showProgressBar(
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
});
}
addNewCallForPatientER(String clientRequestID) {
LiveCareService service = new LiveCareService();
GifLoaderDialogUtils.showMyDialog(context);
service
.addNewCallForPatientER(selectedClinicID, clientRequestID, context)
.then((res) {
AppToast.showSuccessToast(
message: "New Call has been added successfully");
})
.catchError((err) {
print(err);
})
.showProgressBar(
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6))
.then((value) {
widget.getLiveCareHistory();
});
GifLoaderDialogUtils.hideDialog(context);
AppToast.showSuccessToast(
message: "New Call has been added successfully");
widget.getLiveCareHistory();
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: err);
print(err);
});
}
getLanguageID() async {
@ -363,7 +362,9 @@ class _clinic_listState extends State<ClinicList> {
getLiveCareClinicsList() {
isDataLoaded = false;
LiveCareService service = new LiveCareService();
GifLoaderDialogUtils.showMyDialog(context);
service.getLivecareClinics(context).then((res) {
GifLoaderDialogUtils.hideDialog(context);
print(res['PatientER_GetClinicsList'].length);
if (res['MessageStatus'] == 1) {
setState(() {
@ -381,15 +382,18 @@ class _clinic_listState extends State<ClinicList> {
AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
}
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: err);
print(err);
}).showProgressBar(
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
});
}
getLiveCareScheduleClinicsList() {
isDataLoaded = false;
LiveCareService service = new LiveCareService();
GifLoaderDialogUtils.showMyDialog(context);
service.getLiveCareScheduledClinics(context).then((res) {
GifLoaderDialogUtils.hideDialog(context);
print(res['ClinicsHaveScheduleList'].length);
if (res['MessageStatus'] == 1) {
setState(() {
@ -408,9 +412,10 @@ class _clinic_listState extends State<ClinicList> {
AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
}
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: err);
print(err);
}).showProgressBar(
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
});
}
openLiveCareSelectionDialog() {
@ -602,13 +607,13 @@ class _clinic_listState extends State<ClinicList> {
void startScheduleLiveCare() {
List<DoctorList> doctorsList = [];
LiveCareService service = new LiveCareService();
GifLoaderDialogUtils.showMyDialog(context);
List<PatientDoctorAppointmentList> _patientDoctorAppointmentListHospital =
List();
service
.getLiveCareScheduledDoctorList(context, selectedClinicID)
.then((res) {
print(res['DoctorByClinicIDList']);
print(res['DoctorByClinicIDList'].length);
GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) {
setState(() {
if (res['DoctorByClinicIDList'].length != 0) {
@ -647,9 +652,10 @@ class _clinic_listState extends State<ClinicList> {
context, doctorsList, _patientDoctorAppointmentListHospital);
} else {}
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: err);
print(err);
}).showProgressBar(
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
});
}
Future navigateToSearchResults(

@ -19,7 +19,6 @@ import 'package:diplomaticquarterapp/widgets/in_app_browser/InAppBrowser.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:smart_progress_bar/smart_progress_bar.dart';
import 'dialogs/ConfirmSMSDialog.dart';
import 'new_text_Field.dart';
@ -137,7 +136,11 @@ class ConfirmPaymentPage extends StatelessWidget {
),
NewTextFields(
hintText: TranslationBase.of(context).depositorName,
initialValue: advanceModel.depositorName,
initialValue: model.user.firstName +
" " +
model.user.middleName +
" " +
model.user.lastName,
isEnabled: false,
),
SizedBox(
@ -161,16 +164,16 @@ class ConfirmPaymentPage extends StatelessWidget {
label: TranslationBase.of(context).confirm.toUpperCase(),
disabled: model.state == ViewState.Busy,
onTap: () {
GifLoaderDialogUtils.showMyDialog(context);
model
.sendActivationCodeForAdvancePayment(
patientID: int.parse(advanceModel.fileNumber),
projectID: advanceModel.hospitalsModel.iD)
.then((value) {
GifLoaderDialogUtils.hideDialog(context);
if (model.state != ViewState.ErrorLocal &&
model.state != ViewState.Error) showSMSDialog();
}).showProgressBar(
text: "Loading",
backgroundColor: Colors.blue.withOpacity(0.6));
});
},
),
),
@ -217,6 +220,9 @@ class ConfirmPaymentPage extends StatelessWidget {
advanceModel.hospitalsModel.iD.toString(),
advanceModel.email,
paymentMethod,
patientInfoAndMobileNumber.patientType,
advanceModel.patientName,
advanceModel.fileNumber,
authenticatedUser,
browser);
}
@ -276,6 +282,9 @@ class ConfirmPaymentPage extends StatelessWidget {
res['Amount'],
res['Fort_id'],
res['PaymentMethod'],
patientInfoAndMobileNumber.patientType,
advanceModel.patientName,
advanceModel.fileNumber,
AppGlobal.context)
.then((res) {
print(res['OnlineCheckInAppointments'][0]['AdvanceNumber']);

@ -1,3 +1,4 @@
import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/model/radiology/final_radiology.dart';
import 'package:diplomaticquarterapp/core/viewModels/medical/radiology_view_model.dart';

@ -177,6 +177,72 @@ class DoctorsListService extends BaseService {
return Future.value(localRes);
}
Future<Map> getDoctorsRating(
int docID, context) async {
Map<String, dynamic> request;
var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
Request req = appGlobal.getPublicRequest();
request = {
"LanguageID": languageID == 'ar' ? 1 : 2,
"IPAdress": "10.20.10.20",
"VersionID": req.VersionID,
"Channel": req.Channel,
"generalid": 'Cs2020@2016\$2958',
"PatientOutSA": authUser.outSA,
"TokenID": "",
"DeviceTypeID": req.DeviceTypeID,
"SessionID": null,
"doctorID": docID,
"PatientID": 0,
"License": true,
"IsRegistered": true,
"isDentalAllowedBackend": false
};
dynamic localRes;
await baseAppClient.post(GET_DOCTOR_RATING_NOTES,
onSuccess: (response, statusCode) async {
localRes = response;
}, onFailure: (String error, int statusCode) {
throw error;
}, body: request);
return Future.value(localRes);
}
Future<Map> getDoctorsRatingDetails(
int docID, context) async {
Map<String, dynamic> request;
var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
Request req = appGlobal.getPublicRequest();
request = {
"LanguageID": languageID == 'ar' ? 1 : 2,
"IPAdress": "10.20.10.20",
"VersionID": req.VersionID,
"Channel": req.Channel,
"generalid": 'Cs2020@2016\$2958',
"PatientOutSA": authUser.outSA,
"TokenID": "",
"DeviceTypeID": req.DeviceTypeID,
"SessionID": null,
"DoctorID": docID,
"PatientID": 0,
"License": true,
"IsRegistered": true,
"isDentalAllowedBackend": false
};
dynamic localRes;
await baseAppClient.post(GET_DOCTOR_RATING_DETAILS,
onSuccess: (response, statusCode) async {
localRes = response;
}, onFailure: (String error, int statusCode) {
throw error;
}, body: request);
return Future.value(localRes);
}
Future<Map> getDoctorFreeSlots(
int docID, int clinicID, int projectID, BuildContext context) async {
Map<String, dynamic> request;
@ -1206,6 +1272,9 @@ class DoctorsListService extends BaseService {
double payedAmount,
String paymentReference,
String paymentMethodName,
dynamic patientType,
String patientName,
dynamic patientID,
BuildContext context) async {
Map<String, dynamic> request;
if (await this.sharedPref.getObject(USER_PROFILE) != null) {
@ -1217,12 +1286,12 @@ class DoctorsListService extends BaseService {
Request req = appGlobal.getPublicRequest();
request = {
"CustName": authUser.firstName + " " + authUser.lastName,
"CustID": authUser.patientID,
"CustName": patientName,
"CustID": patientID,
"SetupID": "010266",
"ProjectID": projectID,
"PatientID": authUser.patientID,
"AccountID": authUser.patientID,
"PatientID": patientID,
"AccountID": patientID,
"PaymentAmount": payedAmount,
"NationalityID": null,
"DepositorName": authUser.firstName + " " + authUser.lastName,
@ -1239,8 +1308,8 @@ class DoctorsListService extends BaseService {
"SessionID": "YckwoXhUmWBsnHKEKig",
"isDentalAllowedBackend": false,
"TokenID": "@dm!n",
"PatientTypeID": authUser.patientType,
"PatientType": authUser.patientType
"PatientTypeID": patientType,
"PatientType": patientType
};
dynamic localRes;
await baseAppClient.post(HIS_CREATE_ADVANCE_PAYMENT,

@ -37,6 +37,10 @@ const String SENT_REQUEST_URL =
'Services/Authentication.svc/REST/GetAllSharedRecordsByStatus';
const String RECEVIED_REQUEST_URL =
'Services/Authentication.svc/REST/GetAllPendingRecordsByResponseId';
const ACCEPT_REJECT_FAMILY =
'Services/Authentication.svc/REST/Update_FileStatus';
const DEACTIVATE_FAMILY =
'Services/Authentication.svc/REST/DeactivateRequestByRensponse';
class FamilyFilesProvider with ChangeNotifier {
bool isLogin = false;
@ -47,7 +51,9 @@ class FamilyFilesProvider with ChangeNotifier {
try {
dynamic localRes;
var request = GetAllSharedRecordsByStatusReq();
var result = await sharedPref.getObject(MAIN_USER);
request.status = 0;
request.patientID = result["PatientID"];
await new BaseAppClient().post(GET_SHARED_RECORD_BY_STATUS,
onSuccess: (dynamic response, int statusCode) {
localRes = response;
@ -55,7 +61,7 @@ class FamilyFilesProvider with ChangeNotifier {
AppToast.showErrorToast(message: error);
throw error;
}, body: request.toJson());
sharedPref.setObject(FAMILY_FILE, localRes);
return Future.value(
GetAllSharedRecordsByStatusResponse.fromJson(localRes));
@ -78,7 +84,7 @@ class FamilyFilesProvider with ChangeNotifier {
return Future.error(error);
}, body: request);
if (localRes != null) {
sharedPref.setObject(FAMILY_FILE, localRes);
// sharedPref.setObject(FAMILY_FILE, localRes);
allSharedRecordsByStatusResponse =
GetAllSharedRecordsByStatusResponse.fromJson(localRes);
return Future.value(allSharedRecordsByStatusResponse);
@ -103,7 +109,7 @@ class FamilyFilesProvider with ChangeNotifier {
//AppToast.showErrorToast(message: error);
//throw error;
}, body: request);
sharedPref.setObject(FAMILY_FILE, localRes);
//sharedPref.setObject(FAMILY_FILE, localRes);
return Future.value(
GetAllSharedRecordsByStatusResponse.fromJson(localRes));
} catch (error) {
@ -249,9 +255,9 @@ class FamilyFilesProvider with ChangeNotifier {
Future<dynamic> silentLoggin(GetAllSharedRecordsByStatusList switchUser,
{onSuccess, mainUser}) async {
Map<String, dynamic> request = {};
if(mainUser ==true){
if (mainUser == true) {
var currentUser =
AuthenticatedUser.fromJson(await sharedPref.getObject(MAIN_USER));
AuthenticatedUser.fromJson(await sharedPref.getObject(MAIN_USER));
//const request = new SwitchUserRequest();
request['LogInTokenID'] = '';
request['PatientOutSA'] = currentUser.outSA; //? 1 : 0;
@ -265,9 +271,9 @@ class FamilyFilesProvider with ChangeNotifier {
request['ZipCode'] = currentUser.outSA == 1 ? "971" : "966";
request['activationCode'] = '0000';
request['isRegister'] = false;
}else {
} else {
var currentUser =
AuthenticatedUser.fromJson(await sharedPref.getObject(USER_PROFILE));
AuthenticatedUser.fromJson(await sharedPref.getObject(USER_PROFILE));
//const request = new SwitchUserRequest();
request['LogInTokenID'] = '';
@ -300,4 +306,42 @@ class FamilyFilesProvider with ChangeNotifier {
throw error;
}
}
Future<dynamic> acceptRejectFamily(request) async {
try {
dynamic localRes;
await new BaseAppClient().post(ACCEPT_REJECT_FAMILY,
onSuccess: (dynamic response, int statusCode) {
localRes = response;
}, onFailure: (String error, int statusCode) {
AppToast.showErrorToast(message: error);
throw error;
}, body: request);
return Future.value(localRes);
} catch (error) {
print(error);
throw error;
}
}
Future<dynamic> deactivateFamily(request) async {
try {
dynamic localRes;
await new BaseAppClient().post(DEACTIVATE_FAMILY,
onSuccess: (dynamic response, int statusCode) {
localRes = response;
}, onFailure: (String error, int statusCode) {
AppToast.showErrorToast(message: error);
throw error;
}, body: request);
return Future.value(localRes);
} catch (error) {
print(error);
throw error;
}
}
}

@ -8,7 +8,8 @@ import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:localstorage/localstorage.dart';
import 'package:permission_handler/permission_handler.dart';
import 'package:vibration/vibration.dart';
class PermissionService extends BaseService {
final LocalStorage storage = new LocalStorage("permission");
@ -19,11 +20,19 @@ class PermissionService extends BaseService {
}
isVibrationEnabled() {
return storage.getItem('isVibration') ==null ? false :true;
return (storage.getItem('isVibration') ==null) || (storage.getItem('isVibration')) ==false ? false :true;
}
vibrate(){
vibrate(callback, context) async{
if (callback == null)
return null;
if(isVibrationEnabled() ==true){
HapticFeedback.vibrate();
if (await Vibration.hasVibrator()) {
Vibration.vibrate(duration: 100);
callback();
}
}else{
callback();
}
}
@ -35,5 +44,23 @@ class PermissionService extends BaseService {
isThemeEnabled() {
return storage.getItem('isTheme');
}
cameraPermission() async{
Map<Permission, PermissionStatus> statuses = await [
Permission.camera,
].request();
}
isCameraEnabled() async{
print(await Permission.camera.status);
return await Permission.camera.status == PermissionStatus.granted ? true : false;
}
setCameraLocationPermission(context) async{
Navigator.pop(context);
openAppSettings();
}
isLocationEnabled() async{
return await Permission.location.status == PermissionStatus.granted ? true : false;
}
openSettings() async{
openAppSettings();
}
}

@ -213,8 +213,6 @@ class TranslationBase {
String get upcomingConfirmMore =>
localizedValues['book-success-confirm-more-24-1-2'][locale.languageCode];
String get upcomingPaymentPending =>
localizedValues['upcoming-payment-pending'][locale.languageCode];
String get upcomingPaymentNow => localizedValues['upcoming-payment-now'][locale.languageCode];
@ -766,8 +764,6 @@ class TranslationBase {
String get failedToAccessHmgServices => localizedValues['failedToAccessHmgServices'][locale.languageCode];
String get enablingWifi => localizedValues['enablingWifi'][locale.languageCode];
String get offerAndPackages => localizedValues['offerAndPackages'][locale.languageCode];
String get itemInSearch =>
localizedValues['ItemInSearch'][locale.languageCode];
String get invoiceNo => localizedValues['InvoiceNo'][locale.languageCode];
String get specialResult =>
localizedValues['SpecialResult'][locale.languageCode];

@ -93,7 +93,7 @@ class _ButtonState extends State<Button> with TickerProviderStateMixin {
onTapCancel: () {
_animationController.forward();
},
onTap: (){Feedback.wrapForTap(widget.onTap, context); permission.vibrate();},
onTap: (){Feedback.wrapForTap(widget.onTap, context);},
behavior: HitTestBehavior.opaque,
child: Transform.scale(
scale: _buttonSize,

@ -24,6 +24,6 @@ class DefaultButton extends StatelessWidget {
this.text,
style: TextStyle(fontSize: SizeConfig.textMultiplier * 2),
),
onPressed: () =>{ this.onPress(), permission.vibrate()}));
onPressed: () =>{ this.onPress(), }));
}
}

@ -88,7 +88,7 @@ class _MiniButtonState extends State<MiniButton> with TickerProviderStateMixin {
_animationController.forward();
},
// onTap: Feedback.wrapForTap(widget.onTap, context),
onTap: () =>{ widget.onTap(), permission.vibrate()},
onTap: () =>{ widget.onTap(), },
behavior: HitTestBehavior.opaque,
child: Transform.scale(
scale: _buttonSize,

@ -144,7 +144,7 @@ class _SecondaryButtonState extends State<SecondaryButton>
onTapCancel: () {
_animationController.forward();
},
onTap: () =>{ widget.disabled ? null : widget.onTap(), permission.vibrate()},
onTap: () =>{ widget.disabled ? null : widget.onTap(), },
// onTap: widget.disabled?null:Feedback.wrapForTap(widget.onTap, context),
behavior: HitTestBehavior.opaque,
child: Transform.scale(

@ -15,6 +15,7 @@ import 'package:diplomaticquarterapp/routes.dart';
import 'package:diplomaticquarterapp/services/family_files/family_files_provider.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart';
@ -48,8 +49,7 @@ class _AppDrawerState extends State<AppDrawer> {
AuthenticatedUserObject authenticatedUserObject =
locator<AuthenticatedUserObject>();
AuthenticatedUserObject authenticatedUserObject =
locator<AuthenticatedUserObject>();
VitalSignService _vitalSignService = locator<VitalSignService>();
AppointmentRateViewModel appointmentRateViewModel =
locator<AppointmentRateViewModel>();

@ -10,17 +10,17 @@ import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:flutter_inappwebview/flutter_inappwebview.dart';
class MyInAppBrowser extends InAppBrowser {
static String SERVICE_URL =
'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort Payment Gateway URL UAT
// static String SERVICE_URL =
// 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort Payment Gateway URL UAT
// static String SERVICE_URL =
// 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL LIVE
static String SERVICE_URL =
'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL LIVE
static String PREAUTH_SERVICE_URL =
'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort PreAuth Payment Gateway URL UAT
// static String PREAUTH_SERVICE_URL =
// 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort PreAuth Payment Gateway URL UAT
// static String PREAUTH_SERVICE_URL =
// 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort PreAuth Payment Gateway URL Live Store
static String PREAUTH_SERVICE_URL =
'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort PreAuth Payment Gateway URL Live Store
static List<String> successURLS = [
'success',
@ -107,13 +107,16 @@ class MyInAppBrowser extends InAppBrowser {
String projId,
String emailId,
String paymentMethod,
dynamic patientType,
String patientName,
dynamic patientID,
AuthenticatedUser authenticatedUser,
InAppBrowser browser) {
getDeviceToken();
this.browser = browser;
this.browser.openUrl(
url: generateURL(amount, orderDesc, transactionID, projId, emailId,
paymentMethod, authenticatedUser));
paymentMethod, patientType, patientName, patientID, authenticatedUser));
}
openBrowser(String url) {
@ -128,6 +131,9 @@ class MyInAppBrowser extends InAppBrowser {
String projId,
String emailId,
String paymentMethod,
dynamic patientType,
String patientName,
dynamic patientID,
AuthenticatedUser authUser,
[var patientData,
var servID,
@ -136,11 +142,11 @@ class MyInAppBrowser extends InAppBrowser {
String currentLanguageID = getLanguageID() == 'ar' ? 'AR' : 'EN';
String form = getForm();
if (authUser != null) {
form = form.replaceFirst("EMAIL_VALUE", authUser.emailAddress);
} else {
// if (authUser != null) {
// form = form.replaceFirst("EMAIL_VALUE", authUser.emailAddress);
// } else {
form = form.replaceFirst("EMAIL_VALUE", emailId);
}
// }
form = form.replaceFirst('AMOUNT_VALUE', amount.toString());
form = form.replaceFirst('ORDER_DESCRIPTION_VALUE', orderDesc);
@ -152,7 +158,7 @@ class MyInAppBrowser extends InAppBrowser {
form = form.replaceFirst('PATIENT_OUT_SA',
authUser.outSA == 0 ? false.toString() : true.toString());
form = form.replaceFirst('PATIENT_TYPE_ID',
patientData == null ? authUser.patientType.toString() : "1");
patientData == null ? patientType.toString() : "1");
// form = form.replaceFirst('DEVICE_TOKEN', this.cs.sharedService.getSharedData(AuthenticationService.DEVICE_TOKEN, false) + "," + this.cs.sharedService.getSharedData(AuthenticationService.APNS_TOKEN, false));
// form = form.replaceFirst('LATITUDE_VALUE', this.cs.sharedService.getSharedData('userLat', false));
@ -172,13 +178,13 @@ class MyInAppBrowser extends InAppBrowser {
form = form.replaceFirst('LIVE_SERVICE_ID', "2");
}
if (patientData == null) {
form = form.replaceFirst('CUSTNAME_VALUE', authUser.firstName);
form = form.replaceFirst('CUSTID_VALUE', authUser.patientID.toString());
} else {
form = form.replaceFirst('CUSTNAME_VALUE', patientData.depositorName);
form = form.replaceFirst('CUSTID_VALUE', patientData.fileNumber);
}
// if (patientData == null) {
form = form.replaceFirst('CUSTNAME_VALUE', patientName);
form = form.replaceFirst('CUSTID_VALUE', patientID.toString());
// } else {
// form = form.replaceFirst('CUSTNAME_VALUE', patientData.depositorName);
// form = form.replaceFirst('CUSTID_VALUE', patientData.fileNumber);
// }
form = form.replaceFirst('LATITUDE_VALUE', "24.708488");
form = form.replaceFirst('LONGITUDE_VALUE', "46.665925");

@ -40,6 +40,7 @@ class AppScaffold extends StatelessWidget {
final String description;
final String image;
final bool isShowDecPage;
final Color backgroundColor;
final List<String> infoList;
final List<ImagesInfo> imagesInfo;
AuthenticatedUserObject authenticatedUserObject =
@ -60,7 +61,7 @@ class AppScaffold extends StatelessWidget {
this.isBottomBar,
this.image,
this.infoList,
this.imagesInfo});
this.imagesInfo, this.backgroundColor});
@override
Widget build(BuildContext context) {

@ -1,5 +1,9 @@
import 'package:carousel_slider/carousel_slider.dart';
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/pages/login/login-type.dart';
import 'package:diplomaticquarterapp/routes.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
@ -8,12 +12,24 @@ import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
class NotAutPage extends StatelessWidget {
import '../../splashPage.dart';
class NotAutPage extends StatefulWidget {
final String title;
final String description;
final List<String> infoList;
final List<ImagesInfo> imagesInfo;
NotAutPage({@required this.title, @required this.description, this.infoList, this.imagesInfo});
@override
_NotAutPageState createState() => _NotAutPageState();
}
class _NotAutPageState extends State<NotAutPage> {
int _current = 0;
NotAutPage({@required this.title, @required this.description, this.infoList});
@override
Widget build(BuildContext context) {
@ -25,7 +41,7 @@ class NotAutPage extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Texts(
title ?? 'Service',
widget.title ?? 'Service',
fontWeight: FontWeight.w800,
fontSize: 25,
bold: true,
@ -36,17 +52,17 @@ class NotAutPage extends StatelessWidget {
height: 12,
),
Texts(
description ?? 'Description',
widget.description ?? 'Description',
fontWeight: FontWeight.normal,
fontSize: 17,
),
if (infoList != null)
if (widget.infoList != null)
SizedBox(
height: 12,
),
if (infoList != null)
if (widget.infoList != null)
...List.generate(
infoList.length,
widget.infoList.length,
(index) => Container(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
@ -64,7 +80,7 @@ class NotAutPage extends StatelessWidget {
),
),
SizedBox(width: 6,),
Expanded(child: Texts('${infoList[index]}'))
Expanded(child: Texts('${widget.infoList[index]}'))
],
),
SizedBox(height: 12,),
@ -75,6 +91,7 @@ class NotAutPage extends StatelessWidget {
SizedBox(
height: 22,
),
if(!projectViewModel.isInternetConnection)
Center(
child: SizedBox(
height: MediaQuery.of(context).size.height * 0.55,
@ -84,6 +101,24 @@ class NotAutPage extends StatelessWidget {
: 'assets/images/wifi-EN.png'),
),
),
if(projectViewModel.isInternetConnection && widget.imagesInfo!=null)
CarouselSlider(
items: widget.imagesInfo.map((image) {
return Builder(
builder: (BuildContext context){
return SizedBox(
width: MediaQuery.of(context).size.width * 0.50,
child: Image.network(projectViewModel.isArabic ? image.imageAr : image.imageEn));
},
);
}).toList(),
options: CarouselOptions(
height: MediaQuery.of(context).size.height * 0.55,
autoPlay: widget.imagesInfo.length>1,
viewportFraction: 1.0,
),
),
SizedBox(
height: 77,
),
@ -98,8 +133,9 @@ class NotAutPage extends StatelessWidget {
Container(
width: MediaQuery.of(context).size.width * 0.9,
child: SecondaryButton(
onTap: () => Navigator.pushReplacement(
context, FadePage(page: LoginType())),
onTap: (){
loginCheck(context);
},
label: TranslationBase.of(context).serviceInformationButton,
textColor: Theme.of(context).backgroundColor),
),
@ -108,4 +144,16 @@ class NotAutPage extends StatelessWidget {
),
);
}
loginCheck(context) async{
var data = await sharedPref.getObject(IMEI_USER_DATA);
sharedPref.remove(REGISTER_DATA_FOR_LOGIIN);
if (data != null) {
Navigator.of(context).pushNamed(CONFIRM_LOGIN);
} else {
Navigator.of(context).pushNamed(
WELCOME_LOGIN,
);
}
}
}

@ -100,6 +100,7 @@ dependencies:
# Location Helper
map_launcher: ^0.8.1
#Calendar Events
manage_calendar_events: ^1.0.2
@ -141,12 +142,15 @@ dependencies:
device_calendar: ^3.1.0
#Handle Geolocation
geolocator: ^6.0.0+1
geolocator: ^6.1.10
screen: ^0.0.5
#google maps places
google_maps_place_picker: ^1.0.0
#countdown timer for Upcoming List
flutter_countdown_timer: ^1.4.0
#Dependencies for video call implementation
native_device_orientation: ^0.3.0
enum_to_string: ^1.0.9
@ -157,6 +161,7 @@ dependencies:
flutter_tts: ^1.2.6
wifi: ^0.1.5
vibration: ^1.7.3
speech_to_text:
path: speech_to_text

Loading…
Cancel
Save