ToDo & Appo Timeline changes

merge-update-with-lab-changes
haroon amjad 2 years ago
parent fe37de9621
commit 5256d8873f

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

@ -100,6 +100,7 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
_tabController = TabController(length: 2, vsync: this); _tabController = TabController(length: 2, vsync: this);
WidgetsBinding.instance.addPostFrameCallback((_) { WidgetsBinding.instance.addPostFrameCallback((_) {
getPatientAppointmentHistory(); getPatientAppointmentHistory();
getAncillaryOrders();
}); });
super.initState(); super.initState();
imagesInfo imagesInfo
@ -831,6 +832,36 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
obGyneProcedureListResponse: obGyneProcedureListResponse))); 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 { getPatientAppointmentHistory() async {
int languageID = projectViewModel.isArabic ? 1 : 2; int languageID = projectViewModel.isArabic ? 1 : 2;
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
@ -845,11 +876,11 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
appoList.add(new AppoitmentAllHistoryResultList.fromJson(v)); appoList.add(new AppoitmentAllHistoryResultList.fromJson(v));
}); });
} }
if (res['AncillaryOrderList'].length != 0) { // if (res['AncillaryOrderList'].length != 0) {
res['AncillaryOrderList'].forEach((item) { // res['AncillaryOrderList'].forEach((item) {
ancillaryLists.add(AncillaryOrdersListModel.fromJson(item)); // ancillaryLists.add(AncillaryOrdersListModel.fromJson(item));
}); // });
} // }
dataLoaded = true; dataLoaded = true;
if (widget.isFromMyAppointments) { if (widget.isFromMyAppointments) {
performNextAction(widget.appointment); performNextAction(widget.appointment);

@ -46,7 +46,7 @@ class _MedicalProfilePageState extends State<MedicalProfilePageNew> {
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
TimeLineView(model.isLogin, projectViewModel.isArabic, model.appoitmentAllHistoryResultList), TimeLineView(model.isLogin, projectViewModel.isArabic, model.appoitmentAllHistoryResultList, model),
SizedBox( SizedBox(
height: 20, height: 20,
), ),

@ -175,7 +175,7 @@ class DoctorsListService extends BaseService {
return Future.value(localRes); return Future.value(localRes);
} }
Future<Map> getDoctorsRating(int docID,int languageID, context) async { Future<Map> getDoctorsRating(int docID, int languageID, context) async {
Map<String, dynamic> request; Map<String, dynamic> request;
Request req = appGlobal.getPublicRequest(); Request req = appGlobal.getPublicRequest();
@ -226,7 +226,7 @@ class DoctorsListService extends BaseService {
return Future.value(images); return Future.value(images);
} }
Future<Map> getDoctorsRatingDetails(int docID,int languageID, context) async { Future<Map> getDoctorsRatingDetails(int docID, int languageID, context) async {
Map<String, dynamic> request; Map<String, dynamic> request;
Request req = appGlobal.getPublicRequest(); Request req = appGlobal.getPublicRequest();
@ -1790,6 +1790,21 @@ class DoctorsListService extends BaseService {
return Future.value(localRes); 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 { Future<Map> getPayfortSDKTokenForPayment(String deviceID, String signatureValue, {bool isTest = true}) async {
Map<String, dynamic> request; Map<String, dynamic> request;
request = {"service_command": "SDK_TOKEN", "access_code": "BsM6He4FMBaZ86W64kjZ", "merchant_identifier": "ipxnRXXq", "language": "en", "device_id": deviceID, "signature": signatureValue}; request = {"service_command": "SDK_TOKEN", "access_code": "BsM6He4FMBaZ86W64kjZ", "merchant_identifier": "ipxnRXXq", "language": "en", "device_id": deviceID, "signature": signatureValue};

@ -2,6 +2,7 @@ import 'package:auto_size_text/auto_size_text.dart';
import 'package:diplomaticquarterapp/analytics/google-analytics.dart'; import 'package:diplomaticquarterapp/analytics/google-analytics.dart';
import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/config/shared_pref_kay.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/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart'; import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart';
import 'package:diplomaticquarterapp/models/Authentication/select_device_imei_res.dart'; import 'package:diplomaticquarterapp/models/Authentication/select_device_imei_res.dart';
@ -25,8 +26,9 @@ import 'package:provider/provider.dart';
class TimeLineView extends StatefulWidget { class TimeLineView extends StatefulWidget {
bool isLogged, isArabic; bool isLogged, isArabic;
List<AppoitmentAllHistoryResultList> appoitmentAllHistoryResultList; List<AppoitmentAllHistoryResultList> appoitmentAllHistoryResultList;
MedicalViewModel medicalViewModel;
TimeLineView(this.isLogged, this.isArabic, this.appoitmentAllHistoryResultList); TimeLineView(this.isLogged, this.isArabic, this.appoitmentAllHistoryResultList, this.medicalViewModel);
@override @override
_TimeLineViewState createState() => _TimeLineViewState(); _TimeLineViewState createState() => _TimeLineViewState();
@ -38,17 +40,31 @@ class _TimeLineViewState extends State<TimeLineView> {
DateObj selectedDateObj = null; DateObj selectedDateObj = null;
final authService = new auth.AuthProvider(); final authService = new auth.AuthProvider();
static const _scrollThreshold = 1.00;
ScrollController _scrollController;
bool isAllAppointmentsLoaded = false;
@override
void dispose() {
_scrollController.removeListener(_scrollListener);
_scrollController.dispose();
super.dispose();
}
@override @override
void initState() { void initState() {
super.initState(); super.initState();
_scrollController = ScrollController();
_scrollController.addListener(_scrollListener);
dateObjs.add(new DateObj(0, 0, widget.isArabic ? "الكل" : "All")); dateObjs.add(new DateObj(0, 0, widget.isArabic ? "الكل" : "All"));
for (int i = 0; i < widget.appoitmentAllHistoryResultList.length; i++) { for (int i = 0; i < widget.medicalViewModel.appoitmentAllHistoryResultList.length; i++) {
tempList.add(widget.appoitmentAllHistoryResultList[i]); tempList.add(widget.medicalViewModel.appoitmentAllHistoryResultList[i]);
dateObjs.add(new DateObj( dateObjs.add(new DateObj(
DateUtil.convertStringToDate(widget.appoitmentAllHistoryResultList[i].appointmentDate).month, DateUtil.convertStringToDate(widget.medicalViewModel.appoitmentAllHistoryResultList[i].appointmentDate).month,
DateUtil.convertStringToDate(widget.appoitmentAllHistoryResultList[i].appointmentDate).year, DateUtil.convertStringToDate(widget.medicalViewModel.appoitmentAllHistoryResultList[i].appointmentDate).year,
DateUtil.getMonthYearLangDateFormatted( DateUtil.getMonthYearLangDateFormatted(
DateUtil.convertStringToDate(widget.appoitmentAllHistoryResultList[i].appointmentDate), DateUtil.convertStringToDate(widget.medicalViewModel.appoitmentAllHistoryResultList[i].appointmentDate),
widget.isArabic ? "ar" : "en", widget.isArabic ? "ar" : "en",
))); )));
} }
@ -61,20 +77,31 @@ class _TimeLineViewState extends State<TimeLineView> {
// } // }
} }
void _scrollListener() async {
if (_scrollController.offset >= _scrollController.position.maxScrollExtent * _scrollThreshold && !_scrollController.position.outOfRange) {
print('Scroll position is at ${_scrollThreshold * 100}%.');
if(!isAllAppointmentsLoaded) {
await sharedPref.remove(APPOINTMENT_HISTORY_MEDICAL);
widget.medicalViewModel.getAppointmentHistory(isForTimeLine: false);
isAllAppointmentsLoaded = true;
}
}
}
applyFilter(bool isAll) { applyFilter(bool isAll) {
tempList.clear(); tempList.clear();
if (isAll) { if (isAll) {
for (int i = 0; i < widget.appoitmentAllHistoryResultList.length; i++) { for (int i = 0; i < widget.medicalViewModel.appoitmentAllHistoryResultList.length; i++) {
tempList.add(widget.appoitmentAllHistoryResultList[i]); tempList.add(widget.medicalViewModel.appoitmentAllHistoryResultList[i]);
} }
} else { } else {
for (int i = 0; i < widget.appoitmentAllHistoryResultList.length; i++) { for (int i = 0; i < widget.medicalViewModel.appoitmentAllHistoryResultList.length; i++) {
if (DateUtil.getMonthYearLangDateFormatted( if (DateUtil.getMonthYearLangDateFormatted(
DateUtil.convertStringToDate(widget.appoitmentAllHistoryResultList[i].appointmentDate), DateUtil.convertStringToDate(widget.medicalViewModel.appoitmentAllHistoryResultList[i].appointmentDate),
widget.isArabic ? "ar" : "en", widget.isArabic ? "ar" : "en",
) == ) ==
selectedDateObj.monthYear) { selectedDateObj.monthYear) {
tempList.add(widget.appoitmentAllHistoryResultList[i]); tempList.add(widget.medicalViewModel.appoitmentAllHistoryResultList[i]);
} }
} }
} }
@ -182,6 +209,7 @@ class _TimeLineViewState extends State<TimeLineView> {
scrollDirection: Axis.horizontal, scrollDirection: Axis.horizontal,
shrinkWrap: false, shrinkWrap: false,
physics: BouncingScrollPhysics(), physics: BouncingScrollPhysics(),
controller: _scrollController,
separatorBuilder: (BuildContext context, int index) { separatorBuilder: (BuildContext context, int index) {
return mWidth(8); return mWidth(8);
}, },

Loading…
Cancel
Save