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
#	lib/config/config.dart
#	lib/core/viewModels/project_view_model.dart
#	lib/main.dart
#	lib/pages/BookAppointment/BookConfirm.dart
#	lib/pages/landing/landing_page.dart
#	lib/pages/livecare/widgets/LiveCareHistoryCard.dart
#	lib/pages/medical/eye/ContactLensPage.dart
#	lib/pages/medical/medical_profile_page_new.dart
#	lib/uitl/LocalNotification.dart
#	lib/uitl/gif_loader_dialog_utils.dart
#	lib/widgets/Loader/gif_loader_container.dart
#	lib/widgets/data_display/medical/time_line_new_widget.dart
#	lib/widgets/drawer/app_drawer_widget.dart
#	pubspec.yaml
dev_v3.13.6_BLE_Faiz
Sultan khan 2 years ago
commit 08b4c8f86e

@ -25,13 +25,13 @@ var PACKAGES_TAMARA_OPT = '/api/orders/paymentoptions/tamara';
// 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/';
// var BASE_URL = 'https://vidamergeuat.cloudsolutions.com.sa/';
// var BASE_URL = 'https://webservices.hmg.com/';
var BASE_URL = 'https://webservices.hmg.com/';
// var BASE_URL = 'http://10.50.100.198:4422/';
@ -436,7 +436,7 @@ var UPDATE_COVID_QUESTIONNAIRE =
var CHANNEL = 3;
var GENERAL_ID = 'Cs2020@2016\$2958';
var IP_ADDRESS = '10.20.10.20';
var VERSION_ID = 12.4;
var VERSION_ID = 12.6;
var SETUP_ID = '91877';
var LANGUAGE = 2;
// var PATIENT_OUT_SA = 0;
@ -854,8 +854,6 @@ var addPayFortApplePayResponse = "Services/PayFort_Serv.svc/REST/AddResponse";
var payFortEnvironment = FortEnvironment.test;
var applePayMerchantId = "merchant.com.hmgwebservices.uat";
bool apiStatus = false;
class AppGlobal {
static var context;

@ -449,7 +449,7 @@ const Map localizedValues = {
"Cylinder": {"en": "Cylinder", "ar": "الدائرية"},
"Axis": {"en": "Axis", "ar": "المحاور"},
"Prism": {"en": "Prism", "ar": "موشور"},
"VA": {"en": "Prism", "ar": "المحاور"},
"VA": {"en": "VA", "ar": "فرجينيا"},
"LeftEye": {"en": "Left Eye", "ar": "العين اليسرى"},
"Brand": {"en": "Brand", "ar": "النوع"},
"Power": {"en": "Power", "ar": "القوة"},
@ -1953,4 +1953,5 @@ const Map localizedValues = {
"upcoming": {"en": "Upcoming", "ar": "المواعيد القادمة"},
"noUpcomingAppointment": {"en": "No upcoming appointments", "ar": "لا توجد مواعيد القادمة"},
"locationTimeoutError": {"en": "Unable to fetch your location, Please try again.", "ar": "غير قادر على جلب موقعك، يرجى المحاولة مرة أخرى."},
"loadMore": {"en": "Load More", "ar": "تحميل المزيد"},
};

@ -193,7 +193,7 @@ class BaseAppClient {
// body['IdentificationNo'] = 1023854217;
// body['MobileNo'] = "531940021"; //0560717232
// body['PatientID'] = 1374756; //4609100
// body['PatientID'] = 3300938; //4609100
// body['TokenID'] = "@dm!n";
// Patient ID: 3027574

@ -11,7 +11,7 @@ class MedicalService extends BaseService {
List<AppoitmentAllHistoryResultList> appoitmentAllHistoryResultList =[];
List<DoctorScheduleResponse> doctorScheduleResponse =[];
List<String> freeSlots = [];
getAppointmentHistory({bool isActiveAppointment = false}) async {
getAppointmentHistory({bool isActiveAppointment = false, bool isForTimeLine = false}) async {
hasError = false;
super.error = "";
Map<String, dynamic> body = Map();
@ -19,6 +19,7 @@ class MedicalService extends BaseService {
body['IsActiveAppointment'] = true;
body['isDentalAllowedBackend'] = false;
}
body['IsForTimeLine'] = isForTimeLine;
var appoHistory = await sharedPref.getObject(APPOINTMENT_HISTORY_MEDICAL);
if (appoHistory != null) {
appoitmentAllHistoryResultList.clear();

@ -29,6 +29,7 @@ class _RRTServiceData {
class RRTViewModel extends BaseViewModel {
var _service = RRTService();
late int createdRequestNo;
var _pharmacy_service = locator<PharmacyModuleService>();
var _pharmacy_address_service = locator<PharmacyAddressService>();
CustomerAddressesService _customerAddressesService = locator<CustomerAddressesService>();
@ -69,10 +70,10 @@ class RRTViewModel extends BaseViewModel {
// body['CreatedBy'] = user.patientIdentificationType;
// body['OrderServiceID'] = 5;
var localRes;
int requestNo;
await _service.baseAppClient.post(ADD_RRT_ORDER_RC, isRCService: true, body: body, onSuccess: (response, statusCode) {
requestNo = response['response'];
return requestNo;
createdRequestNo = response['response'];
Future.value(createdRequestNo);
}, onFailure: (error, statusCode) {
AppToast.showErrorToast(message: error);
return error;

@ -10,12 +10,15 @@ class MedicalViewModel extends BaseViewModel {
MedicalService _medicalService = locator<MedicalService>();
List<AppoitmentAllHistoryResultList> get appoitmentAllHistoryResultList => _medicalService.appoitmentAllHistoryResultList;
List<DoctorScheduleResponse> get getDoctorScheduleList => _medicalService.doctorScheduleResponse;
List<String> get freeSlots => _medicalService.freeSlots;
getAppointmentHistory() async {
getAppointmentHistory({bool isForTimeLine = false}) async {
if (authenticatedUserObject.isLogin) {
setState(ViewState.Busy);
await _medicalService.getAppointmentHistory();
await _medicalService.getAppointmentHistory(isForTimeLine: isForTimeLine);
if (_medicalService.hasError) {
error = _medicalService.error!;
setState(ViewState.Error);
@ -46,5 +49,5 @@ class MedicalViewModel extends BaseViewModel {
} else
setState(ViewState.Idle);
}
//}
//}
}

@ -37,12 +37,20 @@ class ProjectViewModel extends BaseViewModel {
String error = '';
dynamic searchvalue;
bool isLogin = false;
bool _isAllAppointmentsLoaded = false;
bool get isAllAppointmentsLoaded => _isAllAppointmentsLoaded;
bool isPatientAdmitted = false;
bool patientHasAdmissionRequest = false;
int inPatientProjectID = 0;
GetAdmissionInfoResponseModel getAdmissionInfoResponseModel = GetAdmissionInfoResponseModel();
GetAdmissionRequestInfoResponseModel getAdmissionRequestInfoResponseModel = GetAdmissionRequestInfoResponseModel();
void setIsAllAppointmentsLoaded(bool value) {
_isAllAppointmentsLoaded = value;
notifyListeners();
}
RegisterInfoResponse _registerInfo = RegisterInfoResponse();
RegisterInfoResponse get registerInfo => _registerInfo;

@ -27,27 +27,10 @@ import 'core/viewModels/project_view_model.dart';
import 'locator.dart';
import 'pages/pharmacies/compare-list.dart';
var logger = Logger(
printer: PrettyPrinter(
methodCount: 2,
// Number of method calls to be displayed
errorMethodCount: 8,
// Number of method calls if stacktrace is provided
lineLength: 500,
// Width of the output
colors: true,
// Colorful log messages
printEmojis: true,
// Print an emoji for each log message
printTime: false // Should each log print contain a timestamp
),
);
void main() async {
WidgetsFlutterBinding.ensureInitialized();
setupLocator();
await Firebase.initializeApp();
setupLocator();
HttpOverrides.global = MyHttpOverrides();
runApp(MyApp());
}
@ -108,10 +91,6 @@ class _MyApp extends State<MyApp> {
Widget build(BuildContext context) {
PlatformBridge.init(context);
LocalNotification.init(onNotificationClick: (payload) {
LocalNotification.getInstance()?.showNow(title: "Payload", subtitle: payload, payload: payload);
});
// SystemChrome.setPreferredOrientations([
// DeviceOrientation.portraitUp,
// DeviceOrientationO.portraitDown,

@ -138,7 +138,7 @@ class _ResultPageState extends State<ResultPage> {
}
callDoctorsSearchAPI() {
int languageID = Provider.of<ProjectViewModel>(context, listen: false).isArabic ? 1 : 2;
int languageID = Provider.of<ProjectViewModel>(context, listen: false).isArabic ? 1 : 2;
GifLoaderDialogUtils.showMyDialog(context);
List<DoctorList> doctorsList = [];
List<String> arr = [];

@ -246,7 +246,7 @@ class _BloodCholesterolState extends State<BloodCholesterol> {
TextField(
enabled: isEnable,
scrollPadding: EdgeInsets.zero,
keyboardType: TextInputType.number,
keyboardType: TextInputType.numberWithOptions(decimal: true),
controller: _controller,
onChanged: (value) => {},
style: TextStyle(

@ -263,7 +263,7 @@ class _BloodSugarState extends State<BloodSugar> {
TextField(
enabled: isEnable,
scrollPadding: EdgeInsets.zero,
keyboardType: TextInputType.number,
keyboardType: TextInputType.numberWithOptions(decimal: true),
controller: _controller,
onChanged: (value) => {},
style: TextStyle(

@ -252,7 +252,7 @@ class _TriglyceridesState extends State<Triglycerides> {
TextField(
enabled: isEnable,
scrollPadding: EdgeInsets.zero,
keyboardType: TextInputType.number,
keyboardType: TextInputType.numberWithOptions(decimal: true),
controller: _controller,
onChanged: (value) => {},
style: TextStyle(

@ -257,9 +257,9 @@ class _BookConfirmState extends State<BookConfirm> {
cancelAppointment(DoctorList docObject, AppoitmentAllHistoryResultList appo, BuildContext context) async {
ConfirmDialog.closeAlertDialog(context);
GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = DoctorsListService();
bool isLiveCareSchedule = await this.sharedPref.getBool(IS_LIVECARE_APPOINTMENT) ?? false;
GifLoaderDialogUtils.showMyDialog(context, barrierDismissible: false);
DoctorsListService service = new DoctorsListService();
bool isLiveCareSchedule = await this.sharedPref.getBool(IS_LIVECARE_APPOINTMENT);
service.cancelAppointment(appo, context, isReschedule: true).then((res) {
GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) {
@ -274,7 +274,7 @@ class _BookConfirmState extends State<BookConfirm> {
AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
}
}).catchError((err) {
logger.d(err);
GifLoaderDialogUtils.hideDialog(context);
});
}
@ -327,7 +327,7 @@ class _BookConfirmState extends State<BookConfirm> {
final timeSlot = DocAvailableAppointments.selectedAppoDateTime;
String logs = await sharedPref.getString('selectedLogSlots');
List<dynamic> decodedLogs = json.decode(logs);
GifLoaderDialogUtils.showMyDialog(context);
GifLoaderDialogUtils.showMyDialog(context, barrierDismissible: false);
AppoitmentAllHistoryResultList appo;
widget.service
// .insertAppointment(docObject.doctorID!, docObject.clinicID!, docObject.projectID!, widget.selectedTime, widget.selectedDate, initialSlotDuration, context, 'null', null, null, projectViewModel)
@ -375,7 +375,6 @@ class _BookConfirmState extends State<BookConfirm> {
dialog.showAlertDialog(context);
}
}).catchError((err) {
logger.d(err);
GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: err);
});
@ -386,18 +385,18 @@ class _BookConfirmState extends State<BookConfirm> {
final timeSlot = DocAvailableAppointments.selectedAppoDateTime;
widget.selectedDate = timeSlot!.toUtc().add(Duration(hours: 3)).toString().split(" ")[0];
widget.selectedTime = timeSlot.toUtc().add(Duration(hours: 3)).toString().split(" ")[1].substring(0, 5);
GifLoaderDialogUtils.showMyDialog(context);
GifLoaderDialogUtils.showMyDialog(context, barrierDismissible: false);
AppoitmentAllHistoryResultList appo;
widget.service
.insertLiveCareScheduleAppointment(
docObject.doctorID!, docObject.clinicID!, docObject.projectID!, docObject.serviceID, widget.selectedTime, widget.selectedDate, projectViewModel.isArabic ? 1 : 2, context)
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);
print(res['AppointmentNo']);
Future.delayed(new Duration(milliseconds: 500), () {
getLiveCareAppointmentPatientShare(context, res['AppointmentNo'], docObject.clinicID!, docObject.projectID!, docObject);
getLiveCareAppointmentPatientShare(context, res['AppointmentNo'], docObject!.clinicID!, docObject.projectID!, docObject);
getToDoCount();
});
projectViewModel.analytics.appointment.book_appointment_confirmation_success(appointment_type: 'livecare', dateTime: timeSlot, doctor: widget.doctor);
@ -450,7 +449,7 @@ class _BookConfirmState extends State<BookConfirm> {
getPatientShare(context, String appointmentNo, int clinicID, int projectID, DoctorList docObject) {
int languageID = projectViewModel.isArabic ? 1 : 2;
String errorMsg = "";
GifLoaderDialogUtils.showMyDialog(context);
GifLoaderDialogUtils.showMyDialog(context, barrierDismissible: false);
widget.service.getPatientShare(appointmentNo, clinicID, projectID, languageID, context).then((res) {
projectViewModel.selectedBodyPartList.clear();
projectViewModel.laserSelectionDuration = 0;

@ -201,18 +201,20 @@ class RRTPlaceOrderPage extends StatelessWidget {
// params['paymentAmount'] = selectedProcedure.patientShareWithTax;
// params['procedureId'] = selectedProcedure.procedureID;
var requestId = await viewModel!.createOrderRC(rrtRequestModel.toJson());
await viewModel!.createOrderRC(rrtRequestModel.toJson());
GifLoaderDialogUtils.hideDialog(_context);
if (requestId != null) {
if (viewModel!.createdRequestNo != null) {
showCMCConfirmDialog(
_context,
requestId.toString(),
viewModel!.createdRequestNo.toString(),
onClick: () {
Navigator.pop(_context);
Navigator.pop(_context);
gotoRRTRoot();
// Navigator.pop(_context);
// Navigator.pop(_context);
},
);
}

@ -297,10 +297,10 @@ class _AppointmentDetailsState extends State<AppointmentDetails> with SingleTick
}
void goToBookConfirm() {
if (DocAvailableAppointments.areAppointmentsAvailable)
if (DocAvailableAppointments.areSlotsAvailable)
navigateToBookConfirm(context);
else
AppToast.showErrorToast(message: TranslationBase.of(context).emptySchedule);
AppToast.showErrorToast(message: TranslationBase.of(context).selectSlot);
}
Future navigateToBookConfirm(context) async {

@ -99,6 +99,7 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
_tabController = TabController(length: 2, vsync: this);
WidgetsBinding.instance.addPostFrameCallback((_) {
getPatientAppointmentHistory();
getAncillaryOrders();
});
super.initState();
imagesInfo
@ -853,6 +854,36 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
obGyneProcedureListResponse: obGyneProcedureListResponse)));
}
getAncillaryOrders() {
DoctorsListService service = new DoctorsListService();
service.getAncillaryOrders().then((res) {
if (res['MessageStatus'] == 1) {
if (res['AncillaryOrderList'].length != 0) {
res['AncillaryOrderList'].forEach((v) {
ancillaryLists.add(new AncillaryOrdersListModel.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']);
}
}).catchError((err) {
print(err);
GifLoaderDialogUtils.hideDialog(context);
err != null ?? AppToast.showErrorToast(message: err);
});
}
getPatientAppointmentHistory() async {
int languageID = projectViewModel.isArabic ? 1 : 2;
GifLoaderDialogUtils.showMyDialog(context);
@ -867,11 +898,11 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
appoList.add(new AppoitmentAllHistoryResultList.fromJson(v));
});
}
if (res['AncillaryOrderList'].length != 0) {
res['AncillaryOrderList'].forEach((item) {
ancillaryLists.add(AncillaryOrdersListModel.fromJson(item));
});
}
// if (res['AncillaryOrderList'].length != 0) {
// res['AncillaryOrderList'].forEach((item) {
// ancillaryLists.add(AncillaryOrdersListModel.fromJson(item));
// });
// }
dataLoaded = true;
if (widget.isFromMyAppointments!) {
performNextAction(widget.appointment!);
@ -1202,9 +1233,9 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
addAdvancedNumberRequestTamara("Tamara-Advance-0000", tamaraOrderID, appo.appointmentNo.toString(), appo);
}
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
print(err);
AppToast.showErrorToast(message: err);
GifLoaderDialogUtils.hideDialog(context);
});
} catch (err) {
print(err);

@ -308,6 +308,9 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
: 2;
familyFileProvider.getSharedRecordByStatus(languageID);
}
// Future.delayed(Duration(seconds: 3)).then((result) async {
// LocalNotification.getInstance().showNow(title: "Payload Update", subtitle: "Payload Update", payload: "Payload Update");
// });
});
PayfortViewModel payfortViewModel = context.read<PayfortViewModel>();
@ -382,30 +385,21 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
} else {
// AppGlobal.context = context;
GifLoaderDialogUtils.showMyDialog(context);
//
// authService
// .selectDeviceImei(DEVICE_TOKEN)
// .then((value) {})
// .catchError((err) {
// print("error: ${err.toString()}");
// GifLoaderDialogUtils.hideDialog(context);
// Navigator.of(context).pushNamed(
// WELCOME_LOGIN,
// );
// });
int languageID = projectViewModel.isArabic ? 1 : 2;
await authService.selectDeviceImei(DEVICE_TOKEN, languageID: languageID);
var userData = await getUserInformation();
if (apiStatus && userData != null) {
authService.selectDeviceImei(DEVICE_TOKEN).then((SelectDeviceIMEIRES? value) {
GifLoaderDialogUtils.hideDialog(context);
Navigator.of(context).pushNamed(CONFIRM_LOGIN);
} else {
if (value != null) {
setUserValues(value);
Navigator.of(context).pushNamed(CONFIRM_LOGIN);
} else {
GifLoaderDialogUtils.hideDialog(context);
Navigator.of(context).pushNamed(
WELCOME_LOGIN,
);
}
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
Navigator.of(context).pushNamed(WELCOME_LOGIN);
}
});
}
}

@ -237,9 +237,10 @@ class _LiveCareHistoryCardState extends State<LiveCareHistoryCard> {
}
sendInvoiceEmail(context) {
int languageID = projectViewModel.isArabic ? 1 : 2;
LiveCareService service = new LiveCareService();
GifLoaderDialogUtils.showMyDialog(context);
service.sendLiveCareInvoiceEmail(widget.erRequestHistoryList!.appointmentNo.toString(), widget.erRequestHistoryList!.projectID!, authUser.emailAddress!, context).then((res) {
service.sendLiveCareInvoiceEmail(widget.erRequestHistoryList!.appointmentNo.toString(), widget.erRequestHistoryList!.projectID!, authUser.emailAddress!, languageID, context).then((res) {
GifLoaderDialogUtils.hideDialog(context);
AppToast.showSuccessToast(message: TranslationBase.of(context).emailSentSuccessfully);
}).catchError((err) {

@ -52,7 +52,7 @@ class ContactLensPage extends StatelessWidget {
getRow('OZ', '${listHISGetContactLensPerscription!.oZ}'),
getRow('CT', '${listHISGetContactLensPerscription!.cT}'),
getRow('Blend', '${listHISGetContactLensPerscription!.blend}'),
getRow(TranslationBase.of(context).reminder, '${listHISGetContactLensPerscription!.remarks}', isLast: true),
getRow(TranslationBase.of(context).remarks, '${listHISGetContactLensPerscription!.remarks}', isLast: true),
],
),
),
@ -78,13 +78,13 @@ class ContactLensPage extends StatelessWidget {
),
),
getRow(TranslationBase.of(context).brand, '${listHISGetContactLensPerscription!.brand}'),
getRow('B.C', '${listHISGetContactLensPerscription!.baseCurve}'),
getRow('B.C', '${listHISGetContactLensPerscription!.baseCurve!}'),
getRow(TranslationBase.of(context).power, '${listHISGetContactLensPerscription!.power}'),
getRow(TranslationBase.of(context).diameter, '${listHISGetContactLensPerscription!.diameter}'),
getRow('OZ', '${listHISGetContactLensPerscription!.oZ}'),
getRow('CT', '${listHISGetContactLensPerscription!.cT}'),
getRow('Blend', '${listHISGetContactLensPerscription!.blend}'),
getRow(TranslationBase.of(context).reminder, '${listHISGetContactLensPerscription!.remarks}', isLast: true),
getRow(TranslationBase.of(context).remarks, '${listHISGetContactLensPerscription!.remarks}', isLast: true),
],
),
),

@ -32,7 +32,7 @@ class _MedicalProfilePageState extends State<MedicalProfilePageNew> {
var appoCountProvider = Provider.of<ToDoCountProviderModel>(context);
List<Widget> myMedicalList = Utils.myMedicalList(projectViewModel: projectViewModel, context: context, count: appoCountProvider.count, isLogin: projectViewModel!.isLogin);
return BaseView<MedicalViewModel>(
onModelReady: (model) => model.getAppointmentHistory(),
onModelReady: (model) => model.getAppointmentHistory(isForTimeLine: true),
builder: (_, model, widget1) => AppScaffold(
isShowDecPage: false,
isShowAppBar: false,
@ -47,7 +47,7 @@ class _MedicalProfilePageState extends State<MedicalProfilePageNew> {
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
TimeLineView(model.isLogin, projectViewModel!.isArabic, model.appoitmentAllHistoryResultList),
TimeLineView(model.isLogin, projectViewModel!.isArabic, model.appoitmentAllHistoryResultList, model),
SizedBox(
height: 20,
),

@ -124,7 +124,7 @@ class _MyInvoicesState extends State<MyInvoices> {
GifLoaderDialogUtils.showMyDialog(context);
MyInvoicesService myInvoicesService = new MyInvoicesService();
myInvoicesService.getAllDentalAppointments(12, context).then((res) {
myInvoicesService.getAllDentalAppointments(0, context).then((res) {
GifLoaderDialogUtils.hideDialog(context);
setState(() {
if (res['MessageStatus'] == 1) {

@ -43,7 +43,6 @@ class ReportListWidget extends StatelessWidget {
separatorBuilder: (context, index) => SizedBox(height: 14),
itemBuilder: (context, index) {
Reports report = reportList[index];
logger.d(report.toJson());
return Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.all(

@ -396,7 +396,6 @@ class DoctorsListService extends BaseService {
}, body: request);
return Future.value(localRes);
} catch (e) {
logger.d(e);
return Future.error(e);
}
}
@ -1792,6 +1791,21 @@ class DoctorsListService extends BaseService {
return Future.value(localRes);
}
Future<Map> getAncillaryOrders() async {
Map<String, dynamic> body = Map();
hasError = false;
dynamic localRes;
await baseAppClient.post(GET_ANCILLARY_ORDERS, onSuccess: (dynamic response, int statusCode) {
localRes = response;
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: body);
return Future.value(localRes);
}
Future<Map> getPayfortSDKTokenForPayment(String deviceID, String signatureValue, {bool isTest = true}) async {
Map<String, dynamic> request;
request = {"service_command": "SDK_TOKEN", "access_code": "BsM6He4FMBaZ86W64kjZ", "merchant_identifier": "ipxnRXXq", "language": "en", "device_id": deviceID, "signature": signatureValue};

@ -183,7 +183,7 @@ class AuthProvider with ChangeNotifier {
print(
"Here response: ${response['Patient_SELECTDeviceIMEIbyIMEIList'][0]}");
if (response['Patient_SELECTDeviceIMEIbyIMEIList'][0] != null) {
apiStatus = true;
sharedPref.setObject(
IMEI_USER_DATA,
SelectDeviceIMEIRES.fromJson(

@ -290,13 +290,13 @@ class LiveCareService extends BaseService {
return Future.value(localRes);
}
Future<Map> sendLiveCareInvoiceEmail(String appoNo, int projectID, String emailAddress, BuildContext context) async {
Future<Map> sendLiveCareInvoiceEmail(String appoNo, int projectID, String emailAddress, 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 = {"To": emailAddress, "ProjectID": projectID, "AppointmentNo": appoNo};
request = {"To": emailAddress, "ProjectID": projectID, "AppointmentNo": appoNo, "LanguageID": languageID};
dynamic localRes;
await baseAppClient.post(SEND_LIVECARE_INVOICE_EMAIL, onSuccess: (response, statusCode) async {
localRes = response;

@ -7,6 +7,7 @@ import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/pages/landing/landing_page.dart';
import 'package:diplomaticquarterapp/theme/theme_notifier.dart';
import 'package:diplomaticquarterapp/theme/theme_value.dart';
import 'package:diplomaticquarterapp/uitl/LocalNotification.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/uitl/push-notification-handler.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
@ -39,6 +40,8 @@ class _SplashScreenState extends State<SplashScreen> {
Duration(seconds: 1, milliseconds: 500),
() async {
await loadPrivilege().then((value) {
LocalNotification.init(onNotificationClick: (payload) {});
// LocalNotification.getInstance().showNow(title: "Payload", subtitle: "Subtitle", payload: "Payload");
if(!_privilegeService.hasError) {
Navigator.of(context).pushReplacement(
MaterialPageRoute(

@ -31,25 +31,27 @@ class LocalNotification {
_initialize() async {
try {
var initializationSettingsAndroid = new AndroidInitializationSettings('app_icon');
// var initializationSettingsIOS = DarwinInitializationSettings(onDidReceiveLocalNotification: null);
// var initializationSettings = InitializationSettings(android: initializationSettingsAndroid, iOS: initializationSettingsIOS);
// await flutterLocalNotificationsPlugin.initialize(
// initializationSettings,
// onDidReceiveNotificationResponse: (NotificationResponse notificationResponse) {
// switch (notificationResponse.notificationResponseType) {
// case NotificationResponseType.selectedNotification:
// // selectNotificationStream.add(notificationResponse.payload);
// break;
// case NotificationResponseType.selectedNotificationAction:
// // if (notificationResponse.actionId == navigationActionId) {
// // selectNotificationStream.add(notificationResponse.payload);
// // }
// break;
// }
// },
// onDidReceiveBackgroundNotificationResponse: notificationTapBackground,
// );
} catch (ex) {}
var initializationSettingsIOS = DarwinInitializationSettings(onDidReceiveLocalNotification: null);
var initializationSettings = InitializationSettings(android: initializationSettingsAndroid, iOS: initializationSettingsIOS);
await flutterLocalNotificationsPlugin.initialize(
initializationSettings,
onDidReceiveNotificationResponse: (NotificationResponse notificationResponse) {
switch (notificationResponse.notificationResponseType) {
case NotificationResponseType.selectedNotification:
// selectNotificationStream.add(notificationResponse.payload);
break;
case NotificationResponseType.selectedNotificationAction:
// if (notificationResponse.actionId == navigationActionId) {
// selectNotificationStream.add(notificationResponse.payload);
// }
break;
}
},
// onDidReceiveBackgroundNotificationResponse: notificationTapBackground,
);
} catch (ex) {
print(ex.toString());
}
// flutterLocalNotificationsPlugin.initialize(initializationSettings, onDidReceiveNotificationResponse: (NotificationResponse notificationResponse)
// {
// switch (notificationResponse.notificationResponseType) {
@ -96,15 +98,26 @@ class LocalNotification {
}
Future? showNow({required String title, required String subtitle, required String payload}) {
// Future.delayed(Duration(seconds: 1)).then((result) async {
// var androidPlatformChannelSpecifics = AndroidNotificationDetails('com.hmg.local_notification', 'HMG',
// channelDescription: 'HMG', importance: Importance.max, priority: Priority.high, ticker: 'ticker', vibrationPattern: _vibrationPattern());
// var iOSPlatformChannelSpecifics = DarwinNotificationDetails();
// var platformChannelSpecifics = NotificationDetails(android: androidPlatformChannelSpecifics, iOS: iOSPlatformChannelSpecifics);
// await flutterLocalNotificationsPlugin.show(_randomNumber(), title, subtitle, platformChannelSpecifics, payload: payload).catchError((err) {
// print(err);
// });
// });
Future.delayed(Duration(seconds: 1)).then((result) async {
var androidPlatformChannelSpecifics = AndroidNotificationDetails(
'com.hmg.local_notification',
'HMG',
channelDescription: 'HMG',
importance: Importance.max,
priority: Priority.high,
ticker: 'ticker',
vibrationPattern: _vibrationPattern(),
ongoing: true,
autoCancel: false,
usesChronometer: true,
when: DateTime.now().millisecondsSinceEpoch - 120 * 1000,
);
var iOSPlatformChannelSpecifics = DarwinNotificationDetails();
var platformChannelSpecifics = NotificationDetails(android: androidPlatformChannelSpecifics, iOS: iOSPlatformChannelSpecifics);
await flutterLocalNotificationsPlugin.show(25613, title, subtitle, platformChannelSpecifics, payload: payload).catchError((err) {
print(err);
});
});
}
Future scheduleNotification({required DateTime scheduledNotificationDateTime, required String title, required String description}) async {
@ -115,7 +128,7 @@ class LocalNotification {
vibrationPattern[2] = 5000;
vibrationPattern[3] = 2000;
// var androidPlatformChannelSpecifics = AndroidNotificationDetails('active-prescriptions', 'ActivePrescriptions',
// var androidPlatformChannelSpecifics = AndroidNotificationDetails('active-prescriptions', 'ActivePrescriptions',
// channelDescription: 'ActivePrescriptionsDescription',
// // icon: 'secondary_icon',
// sound: RawResourceAndroidNotificationSound('slow_spring_board'),

@ -3,15 +3,43 @@ import 'package:flutter/material.dart';
import '../widgets/Loader/gif_loader_container.dart';
class GifLoaderDialogUtils {
static showMyDialog(BuildContext context) {
showDialog(context: context, builder: (cxt) => GifLoaderContainer());
static bool _isLoadingVisible = false;
static bool get isLoading => _isLoadingVisible;
static showMyDialog(BuildContext context, {bool barrierDismissible = true}) {
// showDialog(context: context, builder: (cxt) => GifLoaderContainer());
WidgetsBinding.instance.addPostFrameCallback((_) {
_isLoadingVisible = true;
showDialog(
barrierDismissible: barrierDismissible,
context: context,
barrierColor: Colors.black.withOpacity(0.5),
useRootNavigator: false,
builder: (BuildContext context) => GifLoaderContainer(barrierDismissible: barrierDismissible,),
).then((value) {
_isLoadingVisible = false;
});
});
}
static hideDialog(BuildContext context) {
try {
Navigator.of(context, rootNavigator: true).pop();
if (_isLoadingVisible) {
_isLoadingVisible = false;
Navigator.of(context).pop();
}
_isLoadingVisible = false;
// Navigator.of(context, rootNavigator: true).canPop();
} catch (error) {
Future.delayed(Duration(milliseconds: 250)).then((value) => Navigator.of(context, rootNavigator: true).canPop());
//Future.delayed(Duration(milliseconds: 250)).then((value) => Navigator.of(context, rootNavigator: true).canPop());
// Future.delayed(Duration(milliseconds: 250)).then((value) => Navigator.of(context, rootNavigator: true).canPop());
if (_isLoadingVisible) {
_isLoadingVisible = false;
Navigator.of(context).pop();
}
_isLoadingVisible = false;
}
}
}

@ -2959,6 +2959,7 @@ class TranslationBase {
String get upcoming => localizedValues["upcoming"][locale.languageCode];
String get noUpcomingAppointment => localizedValues["noUpcomingAppointment"][locale.languageCode];
String get locationTimeoutError => localizedValues["locationTimeoutError"][locale.languageCode];
String get loadMore => localizedValues["loadMore"][locale.languageCode];
}

@ -2,6 +2,10 @@ import 'package:flutter/cupertino.dart';
import 'package:gif_view/gif_view.dart';
class GifLoaderContainer extends StatefulWidget {
bool barrierDismissible;
GifLoaderContainer({this.barrierDismissible = true});
@override
_GifLoaderContainerState createState() => _GifLoaderContainerState();
}
@ -30,15 +34,20 @@ class _GifLoaderContainerState extends State<GifLoaderContainer> with TickerProv
@override
Widget build(BuildContext context) {
return Center(
return WillPopScope(
onWillPop: () async {
return widget.barrierDismissible;
},
child: Center(
//progress-loading.gif
child: Container(
// margin: EdgeInsets.only(bottom: 40),
child: GifView.asset(
'assets/images/progress-loading-red.gif',
controller: controller,
// image: AssetImage("assets/images/progress-loading-red.gif"), //NetworkImage("http://img.mp.itc.cn/upload/20161107/5cad975eee9e4b45ae9d3c1238ccf91e.jpg"),
// margin: EdgeInsets.only(bottom: 40),
child: GifView(
controller: controller,
image: AssetImage("assets/images/progress-loading-red.gif"), //NetworkImage("http://img.mp.itc.cn/upload/20161107/5cad975eee9e4b45ae9d3c1238ccf91e.jpg"),
),
),
),
));
);
}
}

@ -2,6 +2,7 @@ import 'package:auto_size_text/auto_size_text.dart';
import 'package:diplomaticquarterapp/analytics/google-analytics.dart';
import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/viewModels/medical/medical_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart';
import 'package:diplomaticquarterapp/models/Authentication/select_device_imei_res.dart';
@ -25,8 +26,9 @@ import 'package:provider/provider.dart';
class TimeLineView extends StatefulWidget {
bool isLogged, isArabic;
List<AppoitmentAllHistoryResultList> appoitmentAllHistoryResultList;
MedicalViewModel medicalViewModel;
TimeLineView(this.isLogged, this.isArabic, this.appoitmentAllHistoryResultList);
TimeLineView(this.isLogged, this.isArabic, this.appoitmentAllHistoryResultList, this.medicalViewModel);
@override
_TimeLineViewState createState() => _TimeLineViewState();
@ -40,19 +42,24 @@ class _TimeLineViewState extends State<TimeLineView> {
final authService = auth.AuthProvider();
ProjectViewModel? projectViewModel;
@override
void dispose() {
super.dispose();
}
@override
void initState() {
super.initState();
// selectedDateObj = DateObj(DateTime.august, 2021, 2021.toString());
dateObjs.add(DateObj(0, 0, widget.isArabic ? "الكل" : "All"));
for (int i = 0; i < widget.appoitmentAllHistoryResultList.length; i++) {
tempList.add(widget.appoitmentAllHistoryResultList[i]);
dateObjs.add(
DateObj(
DateUtil.convertStringToDate(widget.appoitmentAllHistoryResultList[i].appointmentDate!).month,
DateUtil.convertStringToDate(widget.appoitmentAllHistoryResultList[i].appointmentDate!).year,
dateObjs.add(new DateObj(0, 0, widget.isArabic ? "الكل" : "All"));
for (int i = 0; i < widget.medicalViewModel.appoitmentAllHistoryResultList.length; i++) {
tempList.add(widget.medicalViewModel.appoitmentAllHistoryResultList[i]);
dateObjs.add(new DateObj(
DateUtil.convertStringToDate(widget.medicalViewModel.appoitmentAllHistoryResultList[i].appointmentDate).month,
DateUtil.convertStringToDate(widget.medicalViewModel.appoitmentAllHistoryResultList[i].appointmentDate).year,
DateUtil.getMonthYearLangDateFormatted(
DateUtil.convertStringToDate(widget.appoitmentAllHistoryResultList[i].appointmentDate!),
DateUtil.convertStringToDate(widget.medicalViewModel.appoitmentAllHistoryResultList[i].appointmentDate),
widget.isArabic ? "ar" : "en",
),
),
@ -71,17 +78,17 @@ class _TimeLineViewState extends State<TimeLineView> {
applyFilter(bool isAll) {
tempList.clear();
if (isAll) {
for (int i = 0; i < widget.appoitmentAllHistoryResultList.length; i++) {
tempList.add(widget.appoitmentAllHistoryResultList[i]);
for (int i = 0; i < widget.medicalViewModel.appoitmentAllHistoryResultList.length; i++) {
tempList.add(widget.medicalViewModel.appoitmentAllHistoryResultList[i]);
}
} else {
for (int i = 0; i < widget.appoitmentAllHistoryResultList.length; i++) {
for (int i = 0; i < widget.medicalViewModel.appoitmentAllHistoryResultList.length; i++) {
if (DateUtil.getMonthYearLangDateFormatted(
DateUtil.convertStringToDate(widget.appoitmentAllHistoryResultList[i].appointmentDate!),
DateUtil.convertStringToDate(widget.medicalViewModel.appoitmentAllHistoryResultList[i].appointmentDate),
widget.isArabic ? "ar" : "en",
) ==
selectedDateObj!.monthYear) {
tempList.add(widget.appoitmentAllHistoryResultList[i]);
tempList.add(widget.medicalViewModel.appoitmentAllHistoryResultList[i]);
}
}
}
@ -90,6 +97,7 @@ class _TimeLineViewState extends State<TimeLineView> {
@override
Widget build(BuildContext context) {
projectViewModel = Provider.of(context);
return Container(
width: double.infinity,
height: 210,
@ -172,27 +180,70 @@ class _TimeLineViewState extends State<TimeLineView> {
),
mFlex(1),
widget.isLogged
? Container(
height: widget.isArabic ? 130 : 110,
width: double.infinity,
child: ListView.separated(
itemBuilder: (context, index) => Padding(
padding: widget.isArabic
? EdgeInsets.only(left: index == 0 ? 0 : 12, right: (tempList.length - 1) == index ? 0 : 12)
: EdgeInsets.only(left: index == 0 ? 12 : 0, right: (tempList.length - 1) == index ? 12 : 0),
child: TimelineNewWidget(
appoitmentAllHistoryResul: tempList[index],
isLast: tempList.length - 1 == index ? true : false,
? Row(
children: [
Container(
height: widget.isArabic ? 130 : 110,
// width: double.infinity,
width: MediaQuery.of(context).size.width,
child: ListView.separated(
itemBuilder: (context, index) => Padding(
padding: widget.isArabic
? EdgeInsets.only(left: index == 0 ? 0 : 12, right: (tempList.length - 1) == index ? 0 : 12)
: EdgeInsets.only(left: index == 0 ? 12 : 0, right: (tempList.length - 1) == index ? 12 : 0),
child: index < tempList.length
? TimelineNewWidget(
appoitmentAllHistoryResul: tempList[index],
isLast: tempList.length - 1 == index ? true : false,
)
: !projectViewModel!.isAllAppointmentsLoaded
? InkWell(
onTap: () async {
await sharedPref.remove(APPOINTMENT_HISTORY_MEDICAL);
widget.medicalViewModel.getAppointmentHistory(isForTimeLine: false);
projectViewModel!.setIsAllAppointmentsLoaded(true);
},
child: Row(
children: [
Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
mHeight(22.0),
Container(
child: Icon(
Icons.arrow_forward_outlined,
color: CustomColors.white,
size: 30,
),
),
mHeight(6.0),
Text(
TranslationBase.of(context).loadMore,
style: TextStyle(
color: CustomColors.white,
fontSize: 10,
fontWeight: FontWeight.w600,
letterSpacing: -0.36,
),
),
],
),
mWidth(24.0)
],
),
)
: Container(),
),
itemCount: (tempList.length + 1),
scrollDirection: Axis.horizontal,
shrinkWrap: false,
physics: BouncingScrollPhysics(),
separatorBuilder: (BuildContext context, int index) {
return index < tempList.length ? mWidth(8) : Container();
},
),
),
itemCount: tempList.length,
scrollDirection: Axis.horizontal,
shrinkWrap: false,
physics: BouncingScrollPhysics(),
separatorBuilder: (BuildContext context, int index) {
return mWidth(8);
},
),
],
)
: Container(),
],
@ -251,7 +302,7 @@ class _TimeLineViewState extends State<TimeLineView> {
height: MediaQuery.of(context).size.width / 14,
width: MediaQuery.of(context).size.width / (widget.isArabic ? 4 : 6),
child: CustomTextButton(
// shape: cardRadiusNew(8),
shape: cardRadiusNew(8),
elevation: 0,
backgroundColor: Color(0xFFFBF2E31),
onPressed: () {
@ -323,7 +374,7 @@ class TimelineNewWidget extends StatelessWidget {
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
return Container(
width: MediaQuery.of(context).size.width / 2.3,
width: isLast! ? MediaQuery.of(context).size.width / 3.5 : MediaQuery.of(context).size.width / 2.5,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,

@ -341,6 +341,7 @@ class _AppDrawerState extends State<AppDrawer> {
sharedPref.remove(APPOINTMENT_HISTORY_MEDICAL);
sharedPref.remove(CLINICS_LIST);
sharedPref.setBool(IS_ROBOT_INIT, false);
projectProvider!.setIsAllAppointmentsLoaded(false);
if (projectProvider!.isArabic) {
projectProvider!.changeLanguage('en');
locator<GAnalytics>().hamburgerMenu.logMenuItemClick('change language to english');
@ -614,6 +615,7 @@ class _AppDrawerState extends State<AppDrawer> {
await sharedPref.clear();
await sharedPref.setString(APP_LANGUAGE, appLanguage);
await sharedPref.remove(APPOINTMENT_HISTORY_MEDICAL);
projectProvider!.setIsAllAppointmentsLoaded(false);
this.user = null;
Navigator.of(context).pushNamed(HOME);
locator<GAnalytics>().hamburgerMenu.logMenuItemClick('logout');

Loading…
Cancel
Save