bug fixes

merge-requests/365/head
Sultan Khan 3 years ago
parent 5b656b0b51
commit 11ffed2ae3

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

@ -17,12 +17,12 @@ const BASE_URL = 'https://uat.hmgwebservices.com/';
// const BASE_URL = 'https://hmgwebservices.com/'; // const BASE_URL = 'https://hmgwebservices.com/';
// Pharmacy UAT URLs // Pharmacy UAT URLs
//const BASE_PHARMACY_URL = 'https://uat.hmgwebservices.com/epharmacy/api/'; const BASE_PHARMACY_URL = 'https://uat.hmgwebservices.com/epharmacy/api/';
//const PHARMACY_BASE_URL = 'https://uat.hmgwebservices.com/epharmacy/api/'; const PHARMACY_BASE_URL = 'https://uat.hmgwebservices.com/epharmacy/api/';
// Pharmacy Production URLs // Pharmacy Production URLs
const BASE_PHARMACY_URL = 'https://mdlaboratories.com/exacartapi/api/'; // const BASE_PHARMACY_URL = 'https://mdlaboratories.com/exacartapi/api/';
const PHARMACY_BASE_URL = 'https://mdlaboratories.com/exacartapi/api/'; // const PHARMACY_BASE_URL = 'https://mdlaboratories.com/exacartapi/api/';
const PING_SERVICE = 'Services/Weather.svc/REST/CheckConnectivity'; const PING_SERVICE = 'Services/Weather.svc/REST/CheckConnectivity';
@ -49,7 +49,8 @@ const WIFI_CREDENTIALS =
const GET_MY_DOCTOR = const GET_MY_DOCTOR =
'Services/Doctors.svc/REST/GetPatientDoctorAppointmentResult'; 'Services/Doctors.svc/REST/GetPatientDoctorAppointmentResult';
const GET_DOCTOR_PROFILE = 'Services/Doctors.svc/REST/GetDocProfiles'; const GET_DOCTOR_PROFILE = 'Services/Doctors.svc/REST/GetDocProfiles';
const GET_DOCTOR_PRE_POST_IMAGES = 'Services/Doctors.svc/REST/GetDoctorPrePostImages'; const GET_DOCTOR_PRE_POST_IMAGES =
'Services/Doctors.svc/REST/GetDoctorPrePostImages';
const GET_DOCTOR_RATING_NOTES = const GET_DOCTOR_RATING_NOTES =
'Services/Doctors.svc/REST/dr_GetNotesDoctorRating'; 'Services/Doctors.svc/REST/dr_GetNotesDoctorRating';
const GET_DOCTOR_RATING_DETAILS = const GET_DOCTOR_RATING_DETAILS =
@ -125,8 +126,10 @@ const INSERT_ER_INERT_PRES_ORDER =
/// ER RRT /// ER RRT
const GET_ALL_RC_TRANSPORTATION = 'rc/api/Transportation/getalltransportation'; const GET_ALL_RC_TRANSPORTATION = 'rc/api/Transportation/getalltransportation';
const GET_ALL_RRT_QUESTIONS = 'Services/Patients.svc/REST/PatientER_RRT_GetAllQuestions'; const GET_ALL_RRT_QUESTIONS =
const GET_RRT_SERVICE_PRICE = 'Services/Patients.svc/REST/PatientE_RealRRT_GetServicePrice'; 'Services/Patients.svc/REST/PatientER_RRT_GetAllQuestions';
const GET_RRT_SERVICE_PRICE =
'Services/Patients.svc/REST/PatientE_RealRRT_GetServicePrice';
///FindUs ///FindUs
const GET_FINDUS_REQUEST = 'Services/Lists.svc/REST/Get_HMG_Locations'; const GET_FINDUS_REQUEST = 'Services/Lists.svc/REST/Get_HMG_Locations';
@ -227,6 +230,9 @@ const GET_PATIENT_SHARE =
const GET_PATIENT_APPOINTMENT_HISTORY = const GET_PATIENT_APPOINTMENT_HISTORY =
"Services/Doctors.svc/REST/PateintHasAppoimentHistory"; "Services/Doctors.svc/REST/PateintHasAppoimentHistory";
const DOCTOR_SCHEDULE_URL =
'Services/Doctors.svc/REST/GetDoctorWorkingHoursTable';
const SEND_REPORT_EYE_EMAIL = const SEND_REPORT_EYE_EMAIL =
"Services/Notifications.svc/REST/SendGlassesPrescriptionEmail"; "Services/Notifications.svc/REST/SendGlassesPrescriptionEmail";

File diff suppressed because it is too large Load Diff

@ -29,38 +29,39 @@ class RequestInsertCOCItem {
int deviceTypeID; int deviceTypeID;
int patientType; int patientType;
double appVersion; double appVersion;
bool forDemo;
RequestInsertCOCItem( RequestInsertCOCItem(
{this.isUserLoggedIn, {this.isUserLoggedIn,
this.mobileNo, this.mobileNo,
this.identificationNo, this.identificationNo,
this.patientID, this.patientID,
this.patientOutSA, this.patientOutSA,
this.patientTypeID, this.patientTypeID,
this.tokenID, this.tokenID,
this.patientName, this.patientName,
this.projectID, this.projectID,
this.fileName, this.fileName,
this.attachment, this.attachment,
this.uILanguage, this.uILanguage,
this.browserInfo, this.browserInfo,
this.cOCTypeName, this.cOCTypeName,
this.formTypeID, this.formTypeID,
this.details, this.details,
this.deviceInfo, this.deviceInfo,
this.deviceType, this.deviceType,
this.title, this.title,
this.resolution, this.resolution,
this.versionID, this.versionID,
this.channel, this.channel,
this.languageID, this.languageID,
this.iPAdress, this.iPAdress,
this.generalid, this.generalid,
this.sessionID, this.sessionID,
this.isDentalAllowedBackend, this.isDentalAllowedBackend,
this.deviceTypeID, this.deviceTypeID,
this.patientType, this.patientType,
this.appVersion}); this.appVersion,
this.forDemo});
RequestInsertCOCItem.fromJson(Map<String, dynamic> json) { RequestInsertCOCItem.fromJson(Map<String, dynamic> json) {
isUserLoggedIn = json['IsUserLoggedIn']; isUserLoggedIn = json['IsUserLoggedIn'];
@ -93,6 +94,7 @@ class RequestInsertCOCItem {
deviceTypeID = json['DeviceTypeID']; deviceTypeID = json['DeviceTypeID'];
patientType = json['PatientType']; patientType = json['PatientType'];
appVersion = json['AppVersion']; appVersion = json['AppVersion'];
forDemo = json['ForDemo'];
} }
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
@ -127,6 +129,8 @@ class RequestInsertCOCItem {
data['DeviceTypeID'] = this.deviceTypeID; data['DeviceTypeID'] = this.deviceTypeID;
data['PatientType'] = this.patientType; data['PatientType'] = this.patientType;
data['AppVersion'] = this.appVersion; data['AppVersion'] = this.appVersion;
data['ForDemo'] = this.forDemo;
return data; return data;
} }
} }

@ -2,6 +2,7 @@ import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/core/service/base_service.dart'; import 'package:diplomaticquarterapp/core/service/base_service.dart';
import 'package:diplomaticquarterapp/models/anicllary-orders/ancillary_order_list_model.dart'; import 'package:diplomaticquarterapp/models/anicllary-orders/ancillary_order_list_model.dart';
import 'package:diplomaticquarterapp/models/anicllary-orders/ancillary_order_proc_model.dart'; import 'package:diplomaticquarterapp/models/anicllary-orders/ancillary_order_proc_model.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
class AncillaryOrdersService extends BaseService { class AncillaryOrdersService extends BaseService {
List<AncillaryOrdersListModel> _ancillaryLists = List(); List<AncillaryOrdersListModel> _ancillaryLists = List();
@ -18,9 +19,13 @@ class AncillaryOrdersService extends BaseService {
await baseAppClient.post(GET_ANCILLARY_ORDERS, await baseAppClient.post(GET_ANCILLARY_ORDERS,
onSuccess: (dynamic response, int statusCode) { onSuccess: (dynamic response, int statusCode) {
_ancillaryLists = []; _ancillaryLists = [];
response['AncillaryOrderList'].forEach((item) { if (response['AncillaryOrderList'].length == 0) {
ancillaryLists.add(AncillaryOrdersListModel.fromJson(item)); new AppToast().backWithEmpty();
}); } else {
response['AncillaryOrderList'].forEach((item) {
ancillaryLists.add(AncillaryOrdersListModel.fromJson(item));
});
}
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
super.error = error; super.error = error;

@ -20,32 +20,38 @@ class FeedbackService extends BaseService {
String attachment, String attachment,
AppointmentHistory appointHistory}) async { AppointmentHistory appointHistory}) async {
hasError = false; hasError = false;
var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); var languageID =
await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
_requestInsertCOCItem.attachment = attachment; _requestInsertCOCItem.attachment = attachment;
_requestInsertCOCItem.title = title; _requestInsertCOCItem.title = title;
_requestInsertCOCItem.details = details; _requestInsertCOCItem.details = details;
_requestInsertCOCItem.cOCTypeName = cOCTypeName; _requestInsertCOCItem.cOCTypeName = cOCTypeName;
_requestInsertCOCItem.formTypeID = cOCTypeName; _requestInsertCOCItem.formTypeID = cOCTypeName;
_requestInsertCOCItem.mobileNo = "966" + Utils.getPhoneNumberWithoutZero(user.mobileNumber); _requestInsertCOCItem.mobileNo =
"966" + Utils.getPhoneNumberWithoutZero(user.mobileNumber);
_requestInsertCOCItem.isUserLoggedIn = true; _requestInsertCOCItem.isUserLoggedIn = true;
_requestInsertCOCItem.projectID = user.projectID; _requestInsertCOCItem.projectID = user.projectID;
_requestInsertCOCItem.patientName = user.firstName + " " + user.lastName; _requestInsertCOCItem.patientName = user.firstName + " " + user.lastName;
_requestInsertCOCItem.fileName = ""; _requestInsertCOCItem.fileName = "";
_requestInsertCOCItem.appVersion = VERSION_ID; _requestInsertCOCItem.appVersion = VERSION_ID;
_requestInsertCOCItem.uILanguage = languageID; //TODO Change it to be dynamic _requestInsertCOCItem.uILanguage =
languageID; //TODO Change it to be dynamic
_requestInsertCOCItem.browserInfo = Platform.localHostname; _requestInsertCOCItem.browserInfo = Platform.localHostname;
_requestInsertCOCItem.deviceInfo = Platform.localHostname; _requestInsertCOCItem.deviceInfo = Platform.localHostname;
_requestInsertCOCItem.resolution = "400x847"; _requestInsertCOCItem.resolution = "400x847";
_requestInsertCOCItem.projectID = 0; _requestInsertCOCItem.projectID = 0;
_requestInsertCOCItem.identificationNo = _requestInsertCOCItem.identificationNo =
int.parse(user.patientIdentificationNo); int.parse(user.patientIdentificationNo);
if (BASE_URL.contains('uat')) {
_requestInsertCOCItem.forDemo = true;
}
final Map<String, dynamic> body = _requestInsertCOCItem.toJson(); final Map<String, dynamic> body = _requestInsertCOCItem.toJson();
if (appointHistory != null) { if (appointHistory != null) {
body['AppoinmentNo'] = appointHistory.appointmentNo; body['AppoinmentNo'] = appointHistory.appointmentNo;
body['AppointmentDate'] = DateUtil.convertDateToString(appointHistory.appointmentDate); body['AppointmentDate'] =
DateUtil.convertDateToString(appointHistory.appointmentDate);
body['ClinicID'] = appointHistory.clinicID; body['ClinicID'] = appointHistory.clinicID;
body['ClinicName'] = appointHistory.clinicName; body['ClinicName'] = appointHistory.clinicName;
body['DoctorID'] = appointHistory.doctorID; body['DoctorID'] = appointHistory.doctorID;
@ -65,9 +71,13 @@ class FeedbackService extends BaseService {
hasError = false; hasError = false;
Map<String, dynamic> body = new Map<String, dynamic>(); Map<String, dynamic> body = new Map<String, dynamic>();
body['IdentificationNo'] = user.patientIdentificationNo; body['IdentificationNo'] = user.patientIdentificationNo;
body['MobileNo'] = "966" + Utils.getPhoneNumberWithoutZero(user.mobileNumber); body['MobileNo'] =
"966" + Utils.getPhoneNumberWithoutZero(user.mobileNumber);
body['Searching_type'] = '1'; body['Searching_type'] = '1';
if (BASE_URL.contains('uat')) {
body['ForDemo'] = true;
}
await baseAppClient.post(GET_STATUS_FOR_COCO, await baseAppClient.post(GET_STATUS_FOR_COCO,
onSuccess: (dynamic response, int statusCode) { onSuccess: (dynamic response, int statusCode) {
cOCItemList = []; cOCItemList = [];

@ -4,6 +4,7 @@ import 'package:diplomaticquarterapp/core/model/eye/AppointmentFilter.dart';
import 'package:diplomaticquarterapp/core/service/medical/EyeService.dart'; import 'package:diplomaticquarterapp/core/service/medical/EyeService.dart';
import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart';
import 'package:diplomaticquarterapp/locator.dart'; import 'package:diplomaticquarterapp/locator.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
class EyeViewModel extends BaseViewModel { class EyeViewModel extends BaseViewModel {
EyeService _eyeService = locator<EyeService>(); EyeService _eyeService = locator<EyeService>();
@ -20,31 +21,35 @@ class EyeViewModel extends BaseViewModel {
error = _eyeService.error; error = _eyeService.error;
setState(ViewState.Error); setState(ViewState.Error);
} else { } else {
_eyeService.appoimentAllHistoryResultList.forEach((element) { if (_eyeService.appoimentAllHistoryResultList.length == 0) {
List<AppointmentFilter> _appointmentFilter = appointmentFilter new AppToast().backWithEmpty();
.where( } else {
(elementFilter) => _eyeService.appoimentAllHistoryResultList.forEach((element) {
elementFilter.filterName == element.projectName, List<AppointmentFilter> _appointmentFilter = appointmentFilter
) .where(
.toList(); (elementFilter) =>
elementFilter.filterName == element.projectName,
if (_appointmentFilter.length != 0) { )
appointmentFilter[appointmentFilter.indexOf(_appointmentFilter[0])] .toList();
.appointmentAllHistoryResultList
.add(element);
} else {
appointmentFilter.add(AppointmentFilter(
element,
element.projectName,
));
}
});
if (_appointmentFilter.length != 0) {
appointmentFilter[appointmentFilter.indexOf(_appointmentFilter[0])]
.appointmentAllHistoryResultList
.add(element);
} else {
appointmentFilter.add(AppointmentFilter(
element,
element.projectName,
));
}
});
}
setState(ViewState.Idle); setState(ViewState.Idle);
} }
} }
sendGlassesPrescriptionEmail({int appointmentNo, String projectName, int projectID}) async { sendGlassesPrescriptionEmail(
{int appointmentNo, String projectName, int projectID}) async {
setState(ViewState.Busy); setState(ViewState.Busy);
await _eyeService.sendGlassesPrescriptionEmail( await _eyeService.sendGlassesPrescriptionEmail(
appointmentNo: appointmentNo, appointmentNo: appointmentNo,
@ -58,7 +63,8 @@ class EyeViewModel extends BaseViewModel {
} }
} }
sendContactLensPrescriptionEmail({int appointmentNo, String projectName, int projectID}) async { sendContactLensPrescriptionEmail(
{int appointmentNo, String projectName, int projectID}) async {
setState(ViewState.Busy); setState(ViewState.Busy);
await _eyeService.sendContactLensPrescriptionEmail( await _eyeService.sendContactLensPrescriptionEmail(
appointmentNo: appointmentNo, appointmentNo: appointmentNo,
@ -71,6 +77,4 @@ class EyeViewModel extends BaseViewModel {
setState(ViewState.Idle); setState(ViewState.Idle);
} }
} }
} }

@ -142,10 +142,10 @@ class _AnicllaryOrdersState extends State<AnicllaryOrdersDetails>
), ),
Texts(" : "), Texts(" : "),
Texts( Texts(
DateUtil.getFormattedDate( DateUtil.getDayMonthYearDateFormatted(
DateUtil.convertStringToDate( DateUtil.convertStringToDate(
model.ancillaryListsDetails[0].appointmentDate), model.ancillaryListsDetails[0].appointmentDate),
"MMM dd,yyyy"), ),
) )
], ],
), ),

@ -103,14 +103,26 @@ class _DoctorProfileState extends State<DoctorProfile>
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Container( Row(
margin: EdgeInsets.only(top: 20.0), children: [
alignment: Alignment.center, Container(
child: ClipRRect( margin: EdgeInsets.only(top: 20.0),
borderRadius: BorderRadius.circular(100.0), alignment: Alignment.center,
child: Image.network(widget.doctor.doctorImageURL, child: ClipRRect(
fit: BoxFit.fill, height: 120.0, width: 120.0), borderRadius: BorderRadius.circular(100.0),
), child: Image.network(widget.doctor.doctorImageURL,
fit: BoxFit.fill, height: 120.0, width: 120.0),
),
),
Container(
margin: EdgeInsets.only(top: 20.0),
alignment: Alignment.center,
child: ClipRRect(
borderRadius: BorderRadius.circular(100.0),
child: Image.asset('assets/images/drSchedul.png'),
),
)
],
), ),
Container( Container(
margin: EdgeInsets.only(top: 10.0), margin: EdgeInsets.only(top: 10.0),
@ -178,14 +190,11 @@ class _DoctorProfileState extends State<DoctorProfile>
)), )),
), ),
), ),
if (widget.docProfileList.isDoctorHasPrePostImages == true)
if(widget.docProfileList.isDoctorHasPrePostImages == true)
Container( Container(
height: 50, height: 50,
alignment: Alignment.center, alignment: Alignment.center,
child: prePostImagesButton(context) child: prePostImagesButton(context)),
),
Container( Container(
child: Divider( child: Divider(
color: Colors.grey[500], color: Colors.grey[500],
@ -234,7 +243,7 @@ class _DoctorProfileState extends State<DoctorProfile>
); );
} }
Widget prePostImagesButton(BuildContext context){ Widget prePostImagesButton(BuildContext context) {
return Padding( return Padding(
padding: const EdgeInsets.all(10), padding: const EdgeInsets.all(10),
child: MaterialButton( child: MaterialButton(
@ -242,7 +251,10 @@ class _DoctorProfileState extends State<DoctorProfile>
color: Theme.of(context).appBarTheme.color, color: Theme.of(context).appBarTheme.color,
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(10)), shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(10)),
onPressed: () => openDoctorPrePostImages(), onPressed: () => openDoctorPrePostImages(),
child: Text(TranslationBase.of(context).beforeAfterImages, style: TextStyle(color: Colors.white, fontSize: 15, letterSpacing: 1),), child: Text(
TranslationBase.of(context).beforeAfterImages,
style: TextStyle(color: Colors.white, fontSize: 15, letterSpacing: 1),
),
), ),
); );
} }
@ -287,23 +299,24 @@ class _DoctorProfileState extends State<DoctorProfile>
}); });
} }
openDoctorPrePostImages(){ openDoctorPrePostImages() {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService().getDoctorPrePostImages(widget.docProfileList, context).then((images) { DoctorsListService()
.getDoctorPrePostImages(widget.docProfileList, context)
.then((images) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
showDialog( showDialog(
context: context, barrierDismissible: true, context: context,
builder: (ctx){ barrierDismissible: true,
builder: (ctx) {
return DoctorPostPreImagesContent(doctorPrePostImages: images); return DoctorPostPreImagesContent(doctorPrePostImages: images);
} });
);
// Navigator.push( // Navigator.push(
// context, // context,
// FadePage( // FadePage(
// page: DoctorPostPreImagesPage(doctorPrePostImages: images,) // page: DoctorPostPreImagesPage(doctorPrePostImages: images,)
// ) // )
// ); // );
}).catchError((err) { }).catchError((err) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: err); AppToast.showErrorToast(message: err);
@ -612,6 +625,4 @@ class _DoctorProfileState extends State<DoctorProfile>
selectedDate: DocAvailableAppointments.selectedDate, selectedDate: DocAvailableAppointments.selectedDate,
selectedTime: DocAvailableAppointments.selectedTime))); selectedTime: DocAvailableAppointments.selectedTime)));
} }
} }

@ -11,6 +11,7 @@ import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:diplomaticquarterapp/pages/MyAppointments/SchedulePage.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:rating_bar/rating_bar.dart'; import 'package:rating_bar/rating_bar.dart';
@ -82,155 +83,195 @@ class _AppointmentDetailsState extends State<AppointmentDetails>
body: Container( body: Container(
color: new Color(0xFFf6f6f6), color: new Color(0xFFf6f6f6),
child: SingleChildScrollView( child: SingleChildScrollView(
child: Column( child: Stack(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Container( Column(
color: Colors.white, crossAxisAlignment: CrossAxisAlignment.start,
child: Column( children: <Widget>[
crossAxisAlignment: CrossAxisAlignment.start, Container(
children: <Widget>[ color: Colors.white,
Container( child: Column(
margin: EdgeInsets.only(top: 20.0), crossAxisAlignment: CrossAxisAlignment.start,
alignment: Alignment.center, children: <Widget>[
child: ClipRRect( Container(
borderRadius: BorderRadius.circular(100.0), margin: EdgeInsets.only(top: 20.0),
child: Image.network(widget.appo.doctorImageURL, alignment: Alignment.center,
fit: BoxFit.fill, height: 120.0, width: 120.0), child: ClipRRect(
), borderRadius: BorderRadius.circular(100.0),
), child: Image.network(widget.appo.doctorImageURL,
Container( fit: BoxFit.fill, height: 120.0, width: 120.0),
margin: ),
EdgeInsets.only(top: 10.0, left: 10.0, right: 10.0), ),
alignment: Alignment.center, Container(
child: Text( margin: EdgeInsets.only(
widget.appo.doctorTitle + top: 10.0, left: 10.0, right: 10.0),
" " + alignment: Alignment.center,
widget.appo.doctorNameObj, child: Text(
textAlign: TextAlign.center, widget.appo.doctorTitle +
style: TextStyle( " " +
fontSize: 20.0, widget.appo.doctorNameObj,
color: Colors.grey[900], textAlign: TextAlign.center,
letterSpacing: 1.0)), style: TextStyle(
), fontSize: 20.0,
Container( color: Colors.grey[900],
margin: EdgeInsets.only(top: 10.0), letterSpacing: 1.0)),
alignment: Alignment.center, ),
child: Text( Container(
getDoctorSpeciality(widget.appo.doctorSpeciality), margin: EdgeInsets.only(top: 10.0),
style: TextStyle( alignment: Alignment.center,
fontSize: 12.0, child: Text(
color: Colors.grey[900], getDoctorSpeciality(widget.appo.doctorSpeciality),
letterSpacing: 1.0)), style: TextStyle(
), fontSize: 12.0,
Container( color: Colors.grey[900],
margin: EdgeInsets.only(top: 5.0), letterSpacing: 1.0)),
alignment: Alignment.center, ),
child: RatingBar.readOnly( Container(
initialRating: widget.appo.actualDoctorRate.toDouble(), margin: EdgeInsets.only(top: 5.0),
size: 35.0, alignment: Alignment.center,
filledColor: Colors.yellow[700], child: RatingBar.readOnly(
emptyColor: Colors.grey[500], initialRating:
isHalfAllowed: true, widget.appo.actualDoctorRate.toDouble(),
halfFilledIcon: Icons.star_half, size: 35.0,
filledIcon: Icons.star, filledColor: Colors.yellow[700],
emptyIcon: Icons.star, emptyColor: Colors.grey[500],
), isHalfAllowed: true,
), halfFilledIcon: Icons.star_half,
InkWell( filledIcon: Icons.star,
onTap: () { emptyIcon: Icons.star,
getDoctorRatingsDetails(); ),
}, ),
child: Container( InkWell(
margin: EdgeInsets.only(top: 5.0), onTap: () {
alignment: Alignment.center, getDoctorRatingsDetails();
child: Text( },
"(" + child: Container(
widget.appo.noOfPatientsRate.toString() + margin: EdgeInsets.only(top: 5.0),
" " + alignment: Alignment.center,
TranslationBase.of(context).reviews + child: Text(
")", "(" +
style: TextStyle( widget.appo.noOfPatientsRate.toString() +
fontSize: 14.0, " " +
color: Colors.blue[800], TranslationBase.of(context).reviews +
letterSpacing: 1.0, ")",
decoration: TextDecoration.underline, style: TextStyle(
)), fontSize: 14.0,
), color: Colors.blue[800],
), letterSpacing: 1.0,
Container( decoration: TextDecoration.underline,
alignment: Alignment.center, )),
child: Text(DateUtil.getWeekDayMonthDayYearDateFormatted( ),
DateUtil.convertStringToDate( ),
widget.appo.appointmentDate), Container(
projectViewModel.isArabic ? "ar" : "en")), alignment: Alignment.center,
), child: Text(
Container( DateUtil.getWeekDayMonthDayYearDateFormatted(
alignment: Alignment.center, DateUtil.convertStringToDate(
child: Text(widget.appo.startTime.substring(0, 5)), widget.appo.appointmentDate),
), projectViewModel.isArabic ? "ar" : "en")),
Container( ),
margin: EdgeInsets.only(top: 10.0), Container(
child: Divider( alignment: Alignment.center,
color: Colors.grey[500], child: Text(widget.appo.startTime.substring(0, 5)),
), ),
), Container(
TabBar( margin: EdgeInsets.only(top: 10.0),
onTap: (index) { child: Divider(
setState(() { color: Colors.grey[500],
if (index == 1) { ),
if (widget.appo.clinicID == 17 || ),
widget.appo.clinicID == 23 || TabBar(
widget.appo.isExecludeDoctor) { onTap: (index) {
_tabController.index = setState(() {
_tabController.previousIndex; if (index == 1) {
AppointmentDetails.showFooterButton = false; if (widget.appo.clinicID == 17 ||
} else { widget.appo.clinicID == 23 ||
AppointmentDetails.showFooterButton = true; widget.appo.isExecludeDoctor) {
} _tabController.index =
} _tabController.previousIndex;
}); AppointmentDetails.showFooterButton = false;
}, } else {
tabs: [ AppointmentDetails.showFooterButton = true;
Tab( }
child: Text(TranslationBase.of(context).appoActions, }
style: TextStyle(color: Colors.black))), });
widget.appo.clinicID == 17 || },
widget.appo.clinicID == 23 || tabs: [
widget.appo.isExecludeDoctor Tab(
? Tab(
child: Text(
TranslationBase.of(context).availableAppo,
style: TextStyle(color: Colors.grey)),
)
: Tab(
child: Text( child: Text(
TranslationBase.of(context).availableAppo, TranslationBase.of(context).appoActions,
style: TextStyle(color: Colors.black)), style: TextStyle(color: Colors.black))),
) widget.appo.clinicID == 17 ||
widget.appo.clinicID == 23 ||
widget.appo.isExecludeDoctor
? Tab(
child: Text(
TranslationBase.of(context)
.availableAppo,
style: TextStyle(color: Colors.grey)),
)
: Tab(
child: Text(
TranslationBase.of(context)
.availableAppo,
style: TextStyle(color: Colors.black)),
)
],
controller: _tabController,
),
],
),
),
Container(
height: MediaQuery.of(context).size.height * 0.87,
child: TabBarView(
physics: NeverScrollableScrollPhysics(),
children: [
AppointmentActions(
appo: widget.appo,
tabController: _tabController,
enableFooterButton: enableFooterButton),
DocAvailableAppointments(
doctor: getDoctorObject(),
isLiveCareAppointment:
widget.appo.isLiveCareAppointment)
], ],
controller: _tabController, controller: _tabController,
), ),
], ),
), ],
),
Container(
height: MediaQuery.of(context).size.height * 0.87,
child: TabBarView(
physics: NeverScrollableScrollPhysics(),
children: [
AppointmentActions(
appo: widget.appo,
tabController: _tabController,
enableFooterButton: enableFooterButton),
DocAvailableAppointments(
doctor: getDoctorObject(),
isLiveCareAppointment:
widget.appo.isLiveCareAppointment)
],
controller: _tabController,
),
), ),
_tabController.index == 0
? Positioned(
right: 30.0,
//top: 30.0,
child: Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(40),
color: Colors.white,
boxShadow: [
BoxShadow(
color: Colors.grey.withOpacity(0.5),
spreadRadius: 5,
blurRadius: 7,
offset:
Offset(0, 3), // changes position of shadow
),
]),
height: 50,
width: 50,
margin: EdgeInsets.only(top: 20.0),
alignment: Alignment.center,
child: ClipRRect(
borderRadius: BorderRadius.circular(100.0),
child: IconButton(
icon: Image.asset('assets/images/drSchedul.png'),
onPressed: () {
openSchedule();
}),
),
))
: SizedBox(),
], ],
), ),
), ),
@ -564,4 +605,8 @@ class _AppointmentDetailsState extends State<AppointmentDetails>
docObj.doctorImageURL = widget.appo.doctorImageURL; docObj.doctorImageURL = widget.appo.doctorImageURL;
return docObj; return docObj;
} }
void openSchedule() {
Navigator.push(context, FadePage(page: SchedulePage(getDoctorObject())));
}
} }

@ -0,0 +1,146 @@
import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart';
import 'package:diplomaticquarterapp/pages/MyAppointments/models/DoctorScheduleResponse.dart';
import 'package:diplomaticquarterapp/pages/MyAppointments/widgets/indicator.dart';
import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:flutter/material.dart';
import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart';
import 'package:hexcolor/hexcolor.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
class SchedulePage extends StatefulWidget {
final DoctorList doctorList;
SchedulePage(this.doctorList);
@override
_SchedulePageState createState() => _SchedulePageState();
}
class _SchedulePageState extends State<SchedulePage> {
DoctorsListService service;
PageController _pageController = PageController();
double currentPage = 0;
int selectedindex = 0;
List<DoctorScheduleResponse> doctorScheduleResponse = [];
final List<Widget> introWidgetsList = <Widget>[
Text('Hello'),
Text('Hi'),
Text('hey')
];
@override
void initState() {
getSchedule(widget.doctorList);
// _pageController.addListener(() {
// setState(() {
// currentPage = _pageController.page;
// });
// });
super.initState();
}
@override
Widget build(BuildContext context) {
return AppScaffold(
appBarTitle: TranslationBase.of(context).schedule,
isShowAppBar: true,
body: SizedBox(
height: MediaQuery.of(context).size.height,
child: Stack(
children: [
Container(
child: PageView.builder(
controller: _pageController,
itemCount: 3,
onPageChanged: (index) {
setState(() {
this.currentPage = index.toDouble();
});
},
itemBuilder: (context, index) {
return Container(
child: ListView.builder(
itemCount: doctorScheduleResponse.length,
itemBuilder: (context, index) => ClipRRect(
borderRadius: const BorderRadius.all(
Radius.circular(20.0)),
child: Container(
padding: EdgeInsets.only(
left: 10,
right: 10,
top: 25,
bottom: 25),
height: 100,
margin: EdgeInsets.all(10),
decoration: BoxDecoration(
boxShadow: [
BoxShadow(
color: Colors.green,
spreadRadius: 3),
],
borderRadius: const BorderRadius.all(
Radius.circular(10.0)),
color: Colors.white),
child: Row(
children: [
Expanded(
child: Row(children: [
Column(
children: [
Texts(
doctorScheduleResponse[index]
.dayName,
color: HexColor('#0bb690'),
),
Texts(
DateUtil
.getDayMonthYearDateFormatted(
DateUtil
.convertStringToDate(
doctorScheduleResponse[
index]
.date,
),
),
color: HexColor('#0bb690'),
)
],
)
]),
),
Expanded(
child: Texts(
doctorScheduleResponse[index]
.workingHours,
color: HexColor('#0bb690'),
),
)
],
)))));
},
)),
PageViewIndicator(
isActive: true,
currentPage: this.currentPage,
length: introWidgetsList.length,
)
],
)));
}
getSchedule(DoctorList doctor) {
// GifLoaderDialogUtils.showMyDialog(AppGlobal.context);
service = new DoctorsListService();
service.getSchedule(doctor).then((value) {
doctorScheduleResponse.clear();
setState(() {
value['List_DoctorWorkingHoursTable'].forEach((item) => {
doctorScheduleResponse.add(DoctorScheduleResponse.fromJson(item))
});
});
});
}
}

@ -0,0 +1,32 @@
class DoctorScheduleResponse {
String clinicName;
String date;
String dayName;
String projectName;
String workingHours;
DoctorScheduleResponse(
{this.clinicName,
this.date,
this.dayName,
this.projectName,
this.workingHours});
DoctorScheduleResponse.fromJson(Map<String, dynamic> json) {
clinicName = json['ClinicName'];
date = json['Date'];
dayName = json['DayName'];
projectName = json['ProjectName'];
workingHours = json['WorkingHours'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['ClinicName'] = this.clinicName;
data['Date'] = this.date;
data['DayName'] = this.dayName;
data['ProjectName'] = this.projectName;
data['WorkingHours'] = this.workingHours;
return data;
}
}

@ -0,0 +1,48 @@
import 'package:flutter/material.dart';
class PageViewIndicator extends StatelessWidget {
final bool isActive;
final int length;
final double currentPage;
PageViewIndicator({
@required this.isActive,
@required this.length,
@required this.currentPage,
});
@override
Widget build(BuildContext context) {
return _indicator(this.isActive);
}
Widget _indicator(bool isActive) {
return Positioned(
bottom: 10,
left: 0,
right: 0,
child: Container(
margin: EdgeInsets.only(bottom: 35),
child: Row(
mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
for (int i = 0; i < length; i++)
if (i == currentPage) ...[circleBar(true)] else circleBar(false),
],
),
),
);
}
Widget circleBar(bool isActive) {
return AnimatedContainer(
duration: Duration(milliseconds: 150),
margin: EdgeInsets.symmetric(horizontal: 8),
height: isActive ? 12 : 8,
width: isActive ? 12 : 8,
decoration: BoxDecoration(
color: isActive ? Colors.red : Colors.grey,
borderRadius: BorderRadius.all(Radius.circular(12))),
);
}
}

@ -195,7 +195,7 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
} }
requestPermissions().then((results) { requestPermissions().then((results) {
registerGeofences(); // registerGeofences();
if (results[Permission.notification].isGranted) if (results[Permission.notification].isGranted)
_firebaseMessaging.getToken().then((String token) { _firebaseMessaging.getToken().then((String token) {

@ -14,6 +14,7 @@ import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart';
class DoctorsListService extends BaseService { class DoctorsListService extends BaseService {
AppSharedPreferences sharedPref = AppSharedPreferences(); AppSharedPreferences sharedPref = AppSharedPreferences();
@ -159,7 +160,7 @@ class DoctorsListService extends BaseService {
"VersionID": req.VersionID, "VersionID": req.VersionID,
"Channel": req.Channel, "Channel": req.Channel,
"generalid": 'Cs2020@2016\$2958', "generalid": 'Cs2020@2016\$2958',
"PatientOutSA": authUser.outSA ?? false, "PatientOutSA": authUser.outSA ?? false,
"TokenID": "", "TokenID": "",
"DeviceTypeID": req.DeviceTypeID, "DeviceTypeID": req.DeviceTypeID,
"SessionID": null, "SessionID": null,
@ -186,7 +187,7 @@ class DoctorsListService extends BaseService {
Future<Map> getDoctorsRating(int docID, context) async { Future<Map> getDoctorsRating(int docID, context) async {
Map<String, dynamic> request; Map<String, dynamic> request;
var languageID = var languageID =
await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
Request req = appGlobal.getPublicRequest(); Request req = appGlobal.getPublicRequest();
request = { request = {
"LanguageID": languageID == 'ar' ? 1 : 2, "LanguageID": languageID == 'ar' ? 1 : 2,
@ -209,37 +210,38 @@ class DoctorsListService extends BaseService {
await baseAppClient.post(GET_DOCTOR_RATING_NOTES, await baseAppClient.post(GET_DOCTOR_RATING_NOTES,
onSuccess: (response, statusCode) async { onSuccess: (response, statusCode) async {
localRes = response; localRes = response;
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
throw error; throw error;
}, body: request); }, body: request);
return Future.value(localRes); return Future.value(localRes);
} }
Future<DoctorPrePostImages> getDoctorPrePostImages(DoctorProfileList doctorProfile, context) async { Future<DoctorPrePostImages> getDoctorPrePostImages(
DoctorProfileList doctorProfile, context) async {
Map<String, dynamic> request; Map<String, dynamic> request;
request = { request = {
"PatientOutSA": authUser.outSA ?? 0, "PatientOutSA": authUser.outSA ?? 0,
"isDentalAllowedBackend": false, "isDentalAllowedBackend": false,
"DoctorID" : doctorProfile.doctorID, "DoctorID": doctorProfile.doctorID,
"ClinicID":doctorProfile.clinicID, "ClinicID": doctorProfile.clinicID,
"ProjectID":doctorProfile.projectID "ProjectID": doctorProfile.projectID
}; };
var images = DoctorPrePostImages(); var images = DoctorPrePostImages();
await baseAppClient.post(GET_DOCTOR_PRE_POST_IMAGES, await baseAppClient.post(GET_DOCTOR_PRE_POST_IMAGES,
onSuccess: (response, statusCode) async { onSuccess: (response, statusCode) async {
var list = response['DoctorPrePostImagesList']; var list = response['DoctorPrePostImagesList'];
if (list is List && list.length > 0){ if (list is List && list.length > 0) {
list.forEach((j) { list.forEach((j) {
var image = DoctorPrePostImageModel.fromJson(j); var image = DoctorPrePostImageModel.fromJson(j);
if(image.imageType == 1) images.pre = image; if (image.imageType == 1) images.pre = image;
if(image.imageType == 2) images.post = image; if (image.imageType == 2) images.post = image;
}); });
} }
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
throw error; throw error;
}, body: request); }, body: request);
return Future.value(images); return Future.value(images);
} }
@ -350,7 +352,8 @@ class DoctorsListService extends BaseService {
} }
Future<Map> insertAppointment(int docID, int clinicID, int projectID, Future<Map> insertAppointment(int docID, int clinicID, int projectID,
String selectedTime, String selectedDate, BuildContext context, [String procedureID]) async { String selectedTime, String selectedDate, BuildContext context,
[String procedureID]) async {
Map<String, dynamic> request; Map<String, dynamic> request;
if (await this.sharedPref.getObject(USER_PROFILE) != null) { if (await this.sharedPref.getObject(USER_PROFILE) != null) {
@ -965,8 +968,8 @@ class DoctorsListService extends BaseService {
return Future.value(localRes); return Future.value(localRes);
} }
Future<Map> addVIDARequest(String advanceNumber, Future<Map> addVIDARequest(String advanceNumber, String paymentReference,
String paymentReference, dynamic apptData, BuildContext context) async { dynamic apptData, BuildContext context) async {
Map<String, dynamic> request; Map<String, dynamic> request;
if (await this.sharedPref.getObject(USER_PROFILE) != null) { if (await this.sharedPref.getObject(USER_PROFILE) != null) {
var data = AuthenticatedUser.fromJson( var data = AuthenticatedUser.fromJson(
@ -1476,23 +1479,41 @@ class DoctorsListService extends BaseService {
return Future.value(localRes); return Future.value(localRes);
} }
Future<Map> sendCheckinNfcRequest( Future<Map> sendCheckinNfcRequest(int appointmentNo, String nfcCode,
int appointmentNo, String nfcCode,int projectId, BuildContext context) async { int projectId, BuildContext context) async {
Map<String, dynamic> request; Map<String, dynamic> request;
Request req = appGlobal.getPublicRequest(); Request req = appGlobal.getPublicRequest();
request = { request = {
"AppointmentNo":appointmentNo, "AppointmentNo": appointmentNo,
"NFC_Code": nfcCode, "NFC_Code": nfcCode,
"ProjectID": projectId, "ProjectID": projectId,
}; };
dynamic localRes; dynamic localRes;
await baseAppClient.post(SEND_CHECK_IN_NFC_REQUEST, await baseAppClient.post(SEND_CHECK_IN_NFC_REQUEST,
onSuccess: (response, statusCode) async { onSuccess: (response, statusCode) async {
localRes = response; localRes = response;
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
throw error; throw error;
}, body: request); }, body: request);
return Future.value(localRes);
}
Future<Map> getSchedule(DoctorList doctorRequest) async {
Map<String, dynamic> request;
request = {
'DoctorID': doctorRequest.doctorID,
'ProjectID': doctorRequest.projectID,
'ClinicID': doctorRequest.clinicID,
'DoctorWorkingHoursDays': 7
};
dynamic localRes;
await baseAppClient.post(DOCTOR_SCHEDULE_URL,
onSuccess: (response, statusCode) async {
localRes = response;
}, onFailure: (String error, int statusCode) {
throw error;
}, body: request);
return Future.value(localRes); return Future.value(localRes);
} }
} }

@ -1,8 +1,9 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_flexible_toast/flutter_flexible_toast.dart'; import 'package:flutter_flexible_toast/flutter_flexible_toast.dart';
import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
class AppToast { class AppToast {
/// show long toast message /// show long toast message
/// [message] to show for user /// [message] to show for user
/// [timeInSeconds] how many second the toast will appear to the user /// [timeInSeconds] how many second the toast will appear to the user
@ -64,7 +65,7 @@ class AppToast {
FlutterFlexibleToast.showToast( FlutterFlexibleToast.showToast(
message: message, message: message,
toastLength: toastLength, toastLength: toastLength,
timeInSeconds: timeInSeconds=2, timeInSeconds: timeInSeconds = 2,
fontSize: fontSize, fontSize: fontSize,
toastGravity: toastGravity, toastGravity: toastGravity,
backgroundColor: Colors.green, backgroundColor: Colors.green,
@ -87,7 +88,7 @@ class AppToast {
static void showErrorToast({ static void showErrorToast({
@required String message, @required String message,
Toast toastLength = Toast.LENGTH_LONG, Toast toastLength = Toast.LENGTH_LONG,
int timeInSeconds=2, int timeInSeconds = 2,
double fontSize = 16, double fontSize = 16,
ToastGravity toastGravity = ToastGravity.TOP, ToastGravity toastGravity = ToastGravity.TOP,
Color textColor = Colors.white, Color textColor = Colors.white,
@ -113,4 +114,14 @@ class AppToast {
void cancelToast() { void cancelToast() {
FlutterFlexibleToast.cancel(); FlutterFlexibleToast.cancel();
} }
void backWithEmpty() {
AppToast.showErrorToast(
message: TranslationBase.of(AppGlobal.context).empty);
Navigator.of(AppGlobal.context).pop();
}
void back() {
Navigator.of(AppGlobal.context).pop();
}
} }

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save