Merge branch 'Haroon' into 'development'

Haroon

See merge request Cloud_Solution/diplomatic-quarter!253
merge-requests/254/merge
Mohammad Aljammal 5 years ago
commit f0ee9db952

@ -10,6 +10,7 @@
<uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="android.permission.ACTIVITY_RECOGNITION" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.CAMERA" />

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

@ -231,6 +231,8 @@ const SEND_LIVECARE_INVOICE_EMAIL = 'Services/Notifications.svc/REST/SendInvoice
const GET_USER_TERMS = 'Services/Patients.svc/REST/GetUserTermsAndConditions';
const UPDATE_HEALTH_TERMS = 'services/Patients.svc/REST/UpdatePateintHealthSummaryReport';
const GET_PATIENT_HEALTH_STATS = 'Services/Patients.svc/REST/Med_GetTransactionsSts';
//URL to get medicine and pharmacies list
const CHANNEL = 3;
const GENERAL_ID = 'Cs2020@2016\$2958';

@ -1625,5 +1625,13 @@ const Map localizedValues = {
"en": "To view the terms and conditions",
"ar": "لعرض الشروط والأحكام"
},
"WalkinAppo": {
"en": "Hospital Visit Appointment",
"ar": "موعد زيارة للمستشفى"
},
"videoAppo": {
"en": "Video Call Appointment",
"ar": "موعد اتصال فيديو"
},
// "visit": {"en" : "Visit", "ar": "الزيارة"},
};

@ -0,0 +1,8 @@
class healthData {
int MedCategoryID;
int MedSubCategoryID;
String Value;
String Notes;
String MachineDate;
int TransactionsListID;
}

@ -0,0 +1,36 @@
class YearlyStepsResModel {
double valueSum;
int medCategoryID;
int month;
String monthName;
int patientID;
int year;
YearlyStepsResModel(
{this.valueSum,
this.medCategoryID,
this.month,
this.monthName,
this.patientID,
this.year});
YearlyStepsResModel.fromJson(Map<String, dynamic> json) {
valueSum = json['ValueSum'];
medCategoryID = json['MedCategoryID'];
month = json['Month'];
monthName = json['MonthName'];
patientID = json['PatientID'];
year = json['Year'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['ValueSum'] = this.valueSum;
data['MedCategoryID'] = this.medCategoryID;
data['Month'] = this.month;
data['MonthName'] = this.monthName;
data['PatientID'] = this.patientID;
data['Year'] = this.year;
return data;
}
}

@ -2,7 +2,6 @@ import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/model/my_balance/AdvanceModel.dart';
import 'package:diplomaticquarterapp/core/model/my_balance/patient_info_and_mobile_number.dart';
import 'package:diplomaticquarterapp/core/viewModels/appointment_rate_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/medical/my_balance_view_model.dart';
import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart';
import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart';
@ -166,7 +165,7 @@ class ConfirmPaymentPage extends StatelessWidget {
patientID: int.parse(advanceModel.fileNumber),
projectID: advanceModel.hospitalsModel.iD)
.then((value) {
GifLoaderDialogUtils.hideDialog(context);
GifLoaderDialogUtils.hideDialog(context);
if (model.state != ViewState.ErrorLocal &&
model.state != ViewState.Error) showSMSDialog();
});
@ -218,7 +217,8 @@ class ConfirmPaymentPage extends StatelessWidget {
authenticatedUser.firstName,
authenticatedUser.patientID,
authenticatedUser,
browser);
browser,
false);
}
onBrowserLoadStart(String url) {
@ -277,8 +277,8 @@ class ConfirmPaymentPage extends StatelessWidget {
String paymentReference = res['Fort_id'].toString();
GifLoaderDialogUtils.showMyDialog(AppGlobal.context);
service
.createAdvancePayment(appo, appo.projectID.toString(), res['Amount'], res['Fort_id'],
res['PaymentMethod'], AppGlobal.context)
.createAdvancePayment(appo, appo.projectID.toString(), res['Amount'],
res['Fort_id'], res['PaymentMethod'], AppGlobal.context)
.then((res) {
GifLoaderDialogUtils.hideDialog(AppGlobal.context);
print(res['OnlineCheckInAppointments'][0]['AdvanceNumber']);
@ -315,5 +315,4 @@ class ConfirmPaymentPage extends StatelessWidget {
Future navigateToHome(context) async {
Navigator.of(context).pushNamed(HOME);
}
}

@ -187,27 +187,29 @@ class _BookConfirmState extends State<BookConfirm> {
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.max,
children: <Widget>[
Row(
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
Container(
margin: EdgeInsets.fromLTRB(5.0, 0.0, 5.0, 0.0),
child: Image.asset(
"assets/images/new-design/icon_hospital.png"),
),
Container(
margin: EdgeInsets.fromLTRB(20.0, 5.0, 10.0, 5.0),
child: Text(
TranslationBase.of(context).hospital +
": " +
widget.doctor.projectName,
style: TextStyle(
fontSize: 14.0,
color: Colors.grey[700],
letterSpacing: 1.0)),
),
],
),
!widget.isLiveCareAppointment ? Row(
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
Container(
margin:
EdgeInsets.fromLTRB(5.0, 0.0, 5.0, 0.0),
child: Image.asset(
"assets/images/new-design/icon_hospital.png"),
),
Container(
margin:
EdgeInsets.fromLTRB(20.0, 5.0, 10.0, 5.0),
child: Text(
TranslationBase.of(context).hospital +
": " +
widget.doctor.projectName,
style: TextStyle(
fontSize: 14.0,
color: Colors.grey[700],
letterSpacing: 1.0)),
),
],
) : Container(),
Row(
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
@ -325,7 +327,8 @@ class _BookConfirmState extends State<BookConfirm> {
Container(
margin: EdgeInsets.only(top: 5.0),
child: Text(
TranslationBase.of(context).gender + ": " +
TranslationBase.of(context).gender +
": " +
widget.authUser.genderDescription,
style: TextStyle(
fontSize: 12.0,
@ -335,7 +338,9 @@ class _BookConfirmState extends State<BookConfirm> {
Container(
margin: EdgeInsets.only(top: 5.0, bottom: 3.0),
child: Text(
TranslationBase.of(context).age + ": " + widget.authUser.age.toString(),
TranslationBase.of(context).age +
": " +
widget.authUser.age.toString(),
style: TextStyle(
fontSize: 12.0,
color: Colors.grey[600],
@ -423,7 +428,8 @@ class _BookConfirmState extends State<BookConfirm> {
context)
.then((res) {
if (res['MessageStatus'] == 1) {
AppToast.showSuccessToast(message: TranslationBase.of(context).bookedSuccess);
AppToast.showSuccessToast(
message: TranslationBase.of(context).bookedSuccess);
print(res['AppointmentNo']);
Future.delayed(new Duration(milliseconds: 500), () {
@ -543,13 +549,13 @@ class _BookConfirmState extends State<BookConfirm> {
getLiveCareAppointmentPatientShare(context, String appointmentNo,
int clinicID, int projectID, DoctorList docObject) {
GifLoaderDialogUtils.hideDialog(context);
widget.service
.getLiveCareAppointmentPatientShare(
appointmentNo, clinicID, projectID, context)
.then((res) {
print(res);
widget.patientShareResponse = new PatientShareResponse.fromJson(res);
GifLoaderDialogUtils.hideDialog(context);
navigateToBookSuccess(context, docObject, widget.patientShareResponse);
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);

@ -255,7 +255,7 @@ class _BookSuccessState extends State<BookSuccess> {
minWidth: MediaQuery.of(context).size.width * 0.7,
height: 45.0,
child: RaisedButton(
color: new Color(0xFF40ACC9),
color: new Color(0xffc5272d),
textColor: Colors.white,
disabledTextColor: Colors.white,
disabledColor: new Color(0xFFbcc2c4),
@ -318,7 +318,7 @@ class _BookSuccessState extends State<BookSuccess> {
minWidth: MediaQuery.of(context).size.width * 0.7,
height: 45.0,
child: RaisedButton(
color: new Color(0xFF40ACC9),
color: new Color(0xFFc5272d),
textColor: Colors.white,
disabledTextColor: Colors.white,
disabledColor: new Color(0xFFbcc2c4),
@ -637,7 +637,12 @@ class _BookSuccessState extends State<BookSuccess> {
authenticatedUser.firstName,
authenticatedUser.patientID,
authenticatedUser,
widget.browser);
widget.browser,
widget.patientShareResponse.isLiveCareAppointment,
widget.patientShareResponse.appointmentDate,
widget.patientShareResponse.appointmentNo,
widget.patientShareResponse.clinicID,
widget.patientShareResponse.doctorID);
}
}

@ -61,7 +61,7 @@ class DoctorView extends StatelessWidget {
letterSpacing: 1.0)),
Container(
margin: EdgeInsets.only(top: 3.0),
child: Text(this.doctor.clinicName,
child: Text(this.doctor.clinicName != null ? this.doctor.clinicName : "",
style: TextStyle(
fontSize: 12.0,
color: Colors.grey[600],

@ -9,6 +9,7 @@ import 'package:diplomaticquarterapp/services/covid-drivethru/covid-drivethru.da
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
@ -469,9 +470,7 @@ class _CovidTimeSlotsState extends State<CovidTimeSlots>
}
bookCovidTestAppointment() {
// Navigator.push(context,
// MaterialPageRoute(builder: (context) => CovidPaymentAlert()));
GifLoaderDialogUtils.showMyDialog(context);
DoctorList docObject = new DoctorList();
docObject.doctorID = widget.selectedDoctorID;
docObject.clinicID = widget.selectedClinicID;
@ -494,11 +493,12 @@ class _CovidTimeSlotsState extends State<CovidTimeSlots>
print(res);
if (res['MessageStatus'] == 1) {
AppToast.showSuccessToast(message: "Appointment Booked Successfully");
Future.delayed(new Duration(milliseconds: 1800), () {
getPatientShare(context, res['AppointmentNo'], docObject.clinicID,
docObject.projectID, docObject);
});
// Future.delayed(new Duration(milliseconds: 1800), () {
getPatientShare(context, res['AppointmentNo'], docObject.clinicID,
docObject.projectID, docObject);
// });
} else {
GifLoaderDialogUtils.hideDialog(context);
appo = new AppoitmentAllHistoryResultList();
appo.appointmentNo = res['SameClinicApptList'][0]['AppointmentNo'];
appo.clinicID = res['SameClinicApptList'][0]['DoctorID'];
@ -529,14 +529,16 @@ class _CovidTimeSlotsState extends State<CovidTimeSlots>
cancelAppointment(DoctorList docObject, AppoitmentAllHistoryResultList appo,
BuildContext context) {
GifLoaderDialogUtils.showMyDialog(context);
ConfirmDialog.closeAlertDialog(context);
DoctorsListService service = new DoctorsListService();
service.cancelAppointment(appo, context).then((res) {
if (res['MessageStatus'] == 1) {
Future.delayed(new Duration(milliseconds: 1500), () {
insertAppointmentCovidTest(context, docObject);
});
// Future.delayed(new Duration(milliseconds: 1500), () {
insertAppointmentCovidTest(context, docObject);
// });
} else {
GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
}
}).catchError((err) {
@ -592,6 +594,7 @@ class _CovidTimeSlotsState extends State<CovidTimeSlots>
});
} else {}
} else {
GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
}
}).catchError((err) {

@ -166,7 +166,7 @@ class _ApointmentCardState extends State<AppointmentCard> {
),
Container(
transform:
Matrix4.translationValues(15.0, -40.0, 0.0),
Matrix4.translationValues(15.0, -40.0, 0.0),
child: projectViewModel.isArabic
? Image.asset(
"assets/images/new-design/arrow_menu_black-ar.png",

@ -13,7 +13,6 @@ import 'package:diplomaticquarterapp/pages/ToDoList/payment_method_select.dart';
import 'package:diplomaticquarterapp/pages/ToDoList/widgets/paymentDialog.dart';
import 'package:diplomaticquarterapp/routes.dart';
import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart';
import 'package:diplomaticquarterapp/services/clinic_services/get_clinic_service.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
@ -26,7 +25,6 @@ import 'package:flutter/material.dart';
import 'package:flutter_countdown_timer/countdown_timer_controller.dart';
import 'package:flutter_countdown_timer/current_remaining_time.dart';
import 'package:flutter_countdown_timer/flutter_countdown_timer.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:provider/provider.dart';
import 'package:rating_bar/rating_bar.dart';
@ -95,249 +93,315 @@ class _ToDoState extends State<ToDo> {
itemBuilder: (context, index) {
return Container(
margin: EdgeInsets.all(10.0),
child: Card(
margin: EdgeInsets.fromLTRB(8.0, 0.0, 8.0, 8.0),
color: Colors.white,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10),
),
child: Container(
width: MediaQuery.of(context).size.width,
padding: EdgeInsets.all(10.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.max,
children: <Widget>[
Row(
children: <Widget>[
Image.asset(
"assets/images/new-design/time_icon.png",
width: 20.0,
height: 20.0),
Container(
margin:
EdgeInsets.only(left: 10.0, right: 10.0),
child: Text(
DateUtil.getWeekDayMonthDayYearDateFormatted(
DateUtil.convertStringToDate(
widget.appoList[index]
.appointmentDate),
projectViewModel.isArabic
? "ar"
: "en") +
" " +
widget.appoList[index].startTime
.substring(0, 5),
style: TextStyle(fontSize: 10.0)),
),
widget.appoList[index].isLiveCareAppointment
? SvgPicture.asset(
"assets/images/new-design/liveCare_logo_icon.svg",
width: 20.0,
height: 20.0)
: Image.asset(
"assets/images/new-design/hospital_address_icon.png",
width: 20.0,
height: 20.0),
Container(
margin:
EdgeInsets.only(left: 5.0, right: 5.0),
child: widget
.appoList[index].isLiveCareAppointment
? Text(
TranslationBase.of(context)
.liveCareAppo,
style: TextStyle(fontSize: 12.0))
: Text(
widget.appoList[index].projectName !=
null
? widget
.appoList[index].projectName
: "-",
overflow: TextOverflow.clip,
maxLines: 2,
style: TextStyle(fontSize: 10.0)),
),
],
),
Container(
margin: EdgeInsets.only(top: 5.0),
child: Divider(
color: Colors.grey[500],
),
child: Column(
children: [
Container(
child: Card(
margin: EdgeInsets.fromLTRB(8.0, 0.0, 8.0, 8.0),
color: Colors.white,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10),
),
Flex(
direction: Axis.horizontal,
children: <Widget>[
Expanded(
flex: 1,
child: Container(
height: MediaQuery.of(context).size.height *
0.1,
child: Container(
width: MediaQuery.of(context).size.width,
padding: EdgeInsets.all(10.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.max,
children: <Widget>[
Row(
children: <Widget>[
Image.asset(
"assets/images/new-design/time_icon.png",
width: 20.0,
height: 20.0),
Container(
margin: EdgeInsets.only(
left: 10.0, right: 10.0),
child: Text(
DateUtil.getWeekDayMonthDayYearDateFormatted(
DateUtil.convertStringToDate(
widget.appoList[index]
.appointmentDate),
projectViewModel.isArabic
? "ar"
: "en") +
" " +
widget.appoList[index].startTime
.substring(0, 5),
style: TextStyle(fontSize: 10.0)),
),
!widget.appoList[index]
.isLiveCareAppointment
? Image.asset(
"assets/images/new-design/hospital_address_icon.png",
width: 20.0,
height: 20.0)
: Container(),
Container(
margin: EdgeInsets.only(
left: 5.0, right: 5.0),
child: widget.appoList[index]
.isLiveCareAppointment
? Container()
: Text(
widget.appoList[index]
.projectName !=
null
? widget.appoList[index]
.projectName
: "-",
overflow: TextOverflow.clip,
maxLines: 2,
style:
TextStyle(fontSize: 10.0)),
),
],
),
Container(
margin: EdgeInsets.only(top: 5.0),
child: ClipRRect(
borderRadius:
BorderRadius.circular(100.0),
child: Image.network(
widget.appoList[index].doctorImageURL,
fit: BoxFit.fill),
child: Divider(
color: Colors.grey[500],
),
),
),
Expanded(
flex: 3,
child: Container(
margin: EdgeInsets.only(
top: 10.0, left: 20.0, right: 20.0),
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: <Widget>[
Text(
widget.appoList[index].doctorTitle +
" " +
Flex(
direction: Axis.horizontal,
children: <Widget>[
Expanded(
flex: 1,
child: Container(
height: MediaQuery.of(context)
.size
.height *
0.1,
margin: EdgeInsets.only(top: 5.0),
child: ClipRRect(
borderRadius:
BorderRadius.circular(100.0),
child: Image.network(
widget.appoList[index]
.doctorNameObj,
style: TextStyle(
fontSize: 14.0,
color: Colors.black,
fontWeight: FontWeight.bold,
letterSpacing: 1.0)),
Container(
margin: EdgeInsets.only(
top: 3.0, bottom: 3.0),
child: Text(
getDoctorSpeciality(widget
.appoList[index]
.doctorSpeciality)
.trim(),
style: TextStyle(
fontSize: 12.0,
color: Colors.grey[600],
letterSpacing: 1.0)),
.doctorImageURL,
fit: BoxFit.fill),
),
),
Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
mainAxisSize: MainAxisSize.max,
children: <Widget>[
RatingBar.readOnly(
initialRating: widget
.appoList[index]
.actualDoctorRate
.toDouble(),
size: 20.0,
filledColor: Colors.yellow[700],
emptyColor: Colors.grey[500],
isHalfAllowed: true,
halfFilledIcon: Icons.star_half,
filledIcon: Icons.star,
emptyIcon: Icons.star,
),
],
),
Expanded(
flex: 3,
child: Container(
margin: EdgeInsets.only(
top: 10.0,
left: 20.0,
right: 20.0),
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: <Widget>[
Text(
widget.appoList[index]
.doctorTitle +
" " +
widget.appoList[index]
.doctorNameObj,
style: TextStyle(
fontSize: 14.0,
color: Colors.black,
fontWeight:
FontWeight.bold,
letterSpacing: 1.0)),
Container(
margin: EdgeInsets.only(
top: 3.0, bottom: 3.0),
child: Text(
getDoctorSpeciality(widget
.appoList[index]
.doctorSpeciality)
.trim(),
style: TextStyle(
fontSize: 12.0,
color: Colors.grey[600],
letterSpacing: 1.0)),
),
Row(
mainAxisAlignment:
MainAxisAlignment
.spaceBetween,
mainAxisSize: MainAxisSize.max,
children: <Widget>[
RatingBar.readOnly(
initialRating: widget
.appoList[index]
.actualDoctorRate
.toDouble(),
size: 20.0,
filledColor:
Colors.yellow[700],
emptyColor:
Colors.grey[500],
isHalfAllowed: true,
halfFilledIcon:
Icons.star_half,
filledIcon: Icons.star,
emptyIcon: Icons.star,
),
],
),
Container(
child: CountdownTimer(
controller: new CountdownTimerController(
endTime: DateTime.now()
.millisecondsSinceEpoch +
(widget
.appoList[
index]
.remaniningHoursTocanPay *
1000) *
60),
widgetBuilder: (_,
CurrentRemainingTime
time) {
return time != null
? Text(
'${time.days != null ? time.days : "0"}:${time.hours.toString().length == 1 ? "0" + time.hours.toString() : time.hours}:${time.min}:${time.sec} ' +
TranslationBase.of(
context)
.upcomingTimeLeft,
style: TextStyle(
fontSize: 12.0,
color: Color(
0xff40ACC9)))
: Container();
},
),
),
],
),
),
Container(
child: CountdownTimer(
controller: new CountdownTimerController(
endTime: DateTime.now()
.millisecondsSinceEpoch +
(widget.appoList[index]
.remaniningHoursTocanPay *
1000) *
60),
widgetBuilder:
(_, CurrentRemainingTime time) {
return time != null
? Text(
'${time.days}:${time.hours}:${time.min}:${time.sec} ' +
TranslationBase.of(
context)
.upcomingTimeLeft,
),
Expanded(
flex: 1,
child: InkWell(
onTap: () => performNextAction(
widget.appoList[index]),
child: Container(
margin: EdgeInsets.only(top: 20.0),
child: Column(
children: <Widget>[
Image.asset(
getNextActionImage(widget
.appoList[index]
.nextAction),
width: 50.0,
height: 50.0),
Container(
margin:
EdgeInsets.only(top: 5.0),
child: Text(
getNextActionText(widget
.appoList[index]
.nextAction),
textAlign:
TextAlign.center,
style: TextStyle(
fontSize: 12.0,
color: Color(
0xff40ACC9)))
: Container();
},
fontSize: 12.0)),
)
],
),
),
),
],
),
)
],
),
),
Expanded(
flex: 1,
child: InkWell(
onTap: () => performNextAction(
widget.appoList[index]),
child: Container(
margin: EdgeInsets.only(top: 20.0),
child: Column(
children: <Widget>[
Image.asset(
getNextActionImage(widget
Divider(
color: Colors.grey[500],
),
Flex(
direction: Axis.horizontal,
children: <Widget>[
Expanded(
flex: 2,
child: Container(
child: Text(
getNextActionDescription(widget
.appoList[index].nextAction),
width: 50.0,
height: 50.0),
Container(
margin: EdgeInsets.only(top: 5.0),
child: Text(
getNextActionText(widget
.appoList[index]
.nextAction),
textAlign: TextAlign.center,
style:
TextStyle(fontSize: 12.0)),
)
],
style: TextStyle(
fontSize: 12.0,
color: Colors.grey[700])),
),
),
),
Expanded(
flex: 1,
child: GestureDetector(
onTap: () {
navigateToAppointmentDetails(
context,
widget.appoList[index]);
},
child: Container(
child: Text(
TranslationBase.of(context)
.upcomingDetails,
textAlign: TextAlign.end,
style: TextStyle(
fontSize: 12.0,
color:
new Color(0xFF40ACC9),
decoration: TextDecoration
.underline)),
),
),
)
],
),
)
],
),
Divider(
color: Colors.grey[500],
],
),
),
Flex(
direction: Axis.horizontal,
children: <Widget>[
Expanded(
flex: 2,
child: Container(
child: Text(
getNextActionDescription(
widget.appoList[index].nextAction),
style: TextStyle(
fontSize: 12.0,
color: Colors.grey[700])),
),
),
Expanded(
flex: 1,
child: GestureDetector(
onTap: () {
navigateToAppointmentDetails(
context, widget.appoList[index]);
},
child: Container(
child: Text(
TranslationBase.of(context)
.upcomingDetails,
textAlign: TextAlign.end,
style: TextStyle(
fontSize: 12.0,
color: new Color(0xFF40ACC9),
decoration:
TextDecoration.underline)),
),
),
Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.only(
bottomLeft: Radius.circular(10.0),
bottomRight: Radius.circular(10.0)),
color: Color(0xff20bc44),
),
height: 30.0,
margin: projectViewModel.isArabic ? EdgeInsets.fromLTRB(160.0, 0.0, 30.0, 0.0) : EdgeInsets.fromLTRB(30.0, 0.0, 160.0, 0.0),
transform: Matrix4.translationValues(0.0, -8.0, 0.0),
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
children: [
widget.appoList[index].isLiveCareAppointment
? Container(
margin: EdgeInsets.fromLTRB(
5.0, 0.0, 5.0, 0.0),
child: Image.asset(
"assets/images/new-design/video.png"),
)
: Container(
margin: EdgeInsets.fromLTRB(
5.0, 0.0, 5.0, 0.0),
child: Image.asset(
"assets/images/new-design/walkin.png"),
),
),
)
],
),
],
widget.appoList[index].isLiveCareAppointment
? Container(
child: Text(TranslationBase.of(context).videoAppo,
style: TextStyle(
color: Colors.white,
fontWeight: FontWeight.bold,
fontSize: 12.0)),
)
: Container(
child: Text(TranslationBase.of(context).walkinAppo,
style: TextStyle(
color: Colors.white,
fontWeight: FontWeight.bold,
fontSize: 12.0)),
)
],
),
),
),
],
),
);
},
@ -567,12 +631,34 @@ class _ToDoState extends State<ToDo> {
}
getPatientShare(context, AppoitmentAllHistoryResultList appo) {
GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService();
if (appo.isLiveCareAppointment) {
getLiveCareAppointmentPatientShare(context, service, appo);
} else {
GifLoaderDialogUtils.showMyDialog(context);
service
.getPatientShare(appo.appointmentNo.toString(), appo.clinicID,
appo.projectID, context)
.then((res) {
GifLoaderDialogUtils.hideDialog(context);
widget.patientShareResponse = new PatientShareResponse.fromJson(res);
openPaymentDialog(appo, widget.patientShareResponse);
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: err);
print(err);
});
}
}
getLiveCareAppointmentPatientShare(context, DoctorsListService service,
AppoitmentAllHistoryResultList appo) {
GifLoaderDialogUtils.showMyDialog(context);
service
.getPatientShare(appo.appointmentNo.toString(), appo.clinicID,
appo.projectID, context)
.getLiveCareAppointmentPatientShare(appo.appointmentNo.toString(),
appo.clinicID, appo.projectID, context)
.then((res) {
print(res);
GifLoaderDialogUtils.hideDialog(context);
widget.patientShareResponse = new PatientShareResponse.fromJson(res);
openPaymentDialog(appo, widget.patientShareResponse);
@ -674,7 +760,12 @@ class _ToDoState extends State<ToDo> {
authenticatedUser.firstName,
authenticatedUser.patientID,
authenticatedUser,
widget.browser);
widget.browser,
appo.isLiveCareAppointment,
appo.appointmentDate,
appo.appointmentNo,
appo.clinicID,
appo.doctorID);
}
onBrowserLoadStart(String url) {

@ -197,7 +197,7 @@ class _TodoListCardState extends State<TodoListCard> {
),
)
],
)
),
],
),
),

@ -326,6 +326,7 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
Permission.notification,
Permission.accessMediaLocation,
Permission.calendar,
Permission.activityRecognition
].request();
var permissionsGranted = await deviceCalendarPlugin.hasPermissions();

@ -49,6 +49,7 @@ class _LiveCareHomeState extends State<LiveCareHome>
child: Column(children: [
/// this is will not colored with theme data
TabBar(
labelColor: Colors.black,
tabs: [
Tab(text: TranslationBase.of(context).consultation),
Tab(text: TranslationBase.of(context).logs),

@ -21,7 +21,7 @@ class _ScheduleClinicCardState extends State<ScheduleClinicCard> {
return Container(
child: Card(
margin: EdgeInsets.fromLTRB(15.0, 10.0, 15.0, 8.0),
color: widget.isSelected ? Colors.blue : Colors.white,
color: widget.isSelected ? Color(0xff06b806) : Colors.white,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10),
),
@ -35,8 +35,8 @@ class _ScheduleClinicCardState extends State<ScheduleClinicCard> {
Container(
child: Text(
widget.languageID == 'ar'
? widget.clinicsHaveScheduleList.clinicDescN
: widget.clinicsHaveScheduleList.clinicDesc,
? widget.clinicsHaveScheduleList.clinicDescN != null ? widget.clinicsHaveScheduleList.clinicDescN: ""
: widget.clinicsHaveScheduleList.clinicDesc != null ? widget.clinicsHaveScheduleList.clinicDesc: "Dermatology",
style: TextStyle(
fontSize: 16.0,
color:

@ -42,10 +42,11 @@ class _LiveCareHistoryCardState extends State<LiveCareHistoryCard> {
),
child: Container(
width: MediaQuery.of(context).size.width,
height: MediaQuery.of(context).size.height * 0.22,
// height: MediaQuery.of(context).size.height * 0.22,
padding: EdgeInsets.all(10.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: <Widget>[
Text("Requested date:",
style:

@ -283,7 +283,8 @@ class _clinic_listState extends State<ClinicList> {
authenticatedUser.firstName,
authenticatedUser.patientID,
authenticatedUser,
browser);
browser,
false);
}
onBrowserLoadStart(String url) {

@ -225,7 +225,8 @@ class ConfirmPaymentPage extends StatelessWidget {
advanceModel.patientName,
advanceModel.fileNumber,
authenticatedUser,
browser);
browser,
false);
}
onBrowserLoadStart(String url) {

@ -0,0 +1,248 @@
import 'package:charts_flutter/flutter.dart' as charts;
import 'package:diplomaticquarterapp/models/SmartWatch/YearlyStepsResModel.dart';
import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/charts/app_time_series_chart.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/material.dart';
class StepsTracker extends StatefulWidget {
@override
_StepsTrackerState createState() => _StepsTrackerState();
}
class _StepsTrackerState extends State<StepsTracker>
with SingleTickerProviderStateMixin {
TabController _tabController;
int weeklyStatsAvgValue = 0;
int monthlyStatsAvgValue = 0;
int yearlyStatsAvgValue = 0;
int avgStepsValue = 0;
int dataLength = 0;
List<YearlyStepsResModel> yearlyStepsList = List();
List<TimeSeriesSales> yearlyTimeSeriesData = [];
bool isDataLoaded = false;
@override
void initState() {
_tabController = new TabController(length: 3, vsync: this);
WidgetsBinding.instance.addPostFrameCallback((_) {
getYearlyStepsData();
});
super.initState();
}
@override
Widget build(BuildContext context) {
return AppScaffold(
isShowAppBar: true,
appBarTitle: "Steps",
isShowDecPage: false,
body: Container(
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
TabBar(
tabs: [
Tab(text: TranslationBase.of(context).weekly),
Tab(text: TranslationBase.of(context).monthly),
Tab(text: TranslationBase.of(context).yearly),
],
controller: _tabController,
),
Expanded(
child: new TabBarView(
physics: NeverScrollableScrollPhysics(),
children: [
isDataLoaded ? getWeeklyStepsDetails() : Container(),
isDataLoaded ? getMonthlyStepsDetails() : Container(),
isDataLoaded ? getYearlyStepsDetails() : Container()
],
controller: _tabController,
),
),
],
),
),
);
}
getYearlyStepsData() {
avgStepsValue = 0;
dataLength = 0;
DoctorsListService service = new DoctorsListService();
GifLoaderDialogUtils.showMyDialog(context);
service.getPatientHealthDataStats(6, 3, context).then((res) {
GifLoaderDialogUtils.hideDialog(context);
print(res['Med_GetYearStepsTransactionsStsList']);
yearlyStepsList.clear();
res['Med_GetYearStepsTransactionsStsList'].forEach((element) {
yearlyStepsList.add(new YearlyStepsResModel.fromJson(element));
if (element['ValueSum'] != null) {
double value = element['ValueSum'];
avgStepsValue += value.toInt();
dataLength++;
}
});
print(avgStepsValue);
print(dataLength);
setState(() {
yearlyStatsAvgValue = avgStepsValue ~/ dataLength;
isDataLoaded = true;
});
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
// AppToast.showErrorToast(message: err);
print(err);
});
}
generateData() {
if (yearlyStepsList.length > 0) {
yearlyTimeSeriesData.clear();
yearlyStepsList.forEach(
(element) {
yearlyTimeSeriesData.add(
TimeSeriesSales(
new DateTime(element.year, element.month, 1),
element.valueSum != null ? element.valueSum.toInt() : 0,
),
);
},
);
yearlyTimeSeriesData.forEach((element) {
print(element.sales);
print(element.time);
});
}
return [
new charts.Series<TimeSeriesSales, DateTime>(
id: 'Sales',
colorFn: (_, __) => charts.MaterialPalette.red.shadeDefault,
domainFn: (TimeSeriesSales sales, _) => sales.time,
measureFn: (TimeSeriesSales sales, _) => sales.sales,
data: yearlyTimeSeriesData,
)
];
}
getWeeklyStepsDetails() {
return Container(
child: Text("Weekly"),
);
}
getMonthlyStepsDetails() {
return Container(
child: Text("Monthly"),
);
}
getYearlyStepsDetails() {
return Container(
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
Container(
child: AppTimeSeriesChart(
seriesList: generateData(),
chartName: "Steps",
startDate: DateTime(
yearlyStepsList[0].year, yearlyStepsList[0].month, 1),
endDate: DateTime(
yearlyStepsList[yearlyStepsList.length - 1].year,
yearlyStepsList[yearlyStepsList.length - 1].month,
1),
),
),
Container(
margin: EdgeInsets.only(top: 5.0),
child: Card(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10),
side: BorderSide(color: Colors.grey[400], width: 0.6)),
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
Container(
padding: EdgeInsets.fromLTRB(30.0, 15.0, 30.0, 15.0),
child:
Text("Average Steps", style: TextStyle(fontSize: 18.0)),
),
Container(
margin: EdgeInsets.only(bottom: 10.0),
child: Text(yearlyStatsAvgValue.toString() + " Steps",
style: TextStyle(
fontSize: 20.0, fontWeight: FontWeight.bold)),
),
],
),
),
),
Container(
margin: EdgeInsets.all(10.0),
child: Divider(
color: Colors.grey[500],
),
),
Container(
transform: Matrix4.translationValues(0.0, -10.0, 0.0),
margin: EdgeInsets.fromLTRB(20.0, 0.0, 20.0, 5.0),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text("History", style: TextStyle(fontSize: 14.0)),
Row(
children: [
Text("view more", style: TextStyle(fontSize: 14.0)),
Container(
margin: EdgeInsets.only(left: 3.0, right: 3.0),
transform: Matrix4.translationValues(0.0, 1.5, 0.0),
width: 30.0,
height: 30.0,
child: Image.asset(
"assets/images/new-design/view_more.png",
fit: BoxFit.contain),
),
],
),
],
),
),
Container(
margin: EdgeInsets.fromLTRB(20.0, 0.0, 20.0, 5.0),
child: Card(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10),
side: BorderSide(color: Colors.grey[400], width: 0.6)),
child: Row(
mainAxisSize: MainAxisSize.max,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Container(
padding: EdgeInsets.fromLTRB(30.0, 15.0, 30.0, 15.0),
child: Text("Date",
style: TextStyle(
fontSize: 18.0, fontWeight: FontWeight.bold)),
),
Container(
padding: EdgeInsets.fromLTRB(30.0, 0.0, 30.0, 0.0),
child: Text("Steps", style: TextStyle(fontSize: 18.0)),
),
],
),
),
),
],
),
);
}
}

@ -41,7 +41,8 @@ class DoctorsListService extends BaseService {
long = await this.sharedPref.getDouble(USER_LONG);
}
var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
var languageID =
await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
Request req = appGlobal.getPublicRequest();
request = {
"LanguageID": languageID == 'ar' ? 1 : 2,
@ -105,7 +106,8 @@ class DoctorsListService extends BaseService {
long = await this.sharedPref.getDouble(USER_LONG);
}
var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
var languageID =
await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
Request req = appGlobal.getPublicRequest();
request = {
"LanguageID": languageID == 'ar' ? 1 : 2,
@ -145,7 +147,8 @@ class DoctorsListService extends BaseService {
Future<Map> getDoctorsProfile(
int docID, int clinicID, int projectID, context) async {
Map<String, dynamic> request;
var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
var languageID =
await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
Request req = appGlobal.getPublicRequest();
request = {
"LanguageID": languageID == 'ar' ? 1 : 2,
@ -177,10 +180,10 @@ class DoctorsListService extends BaseService {
return Future.value(localRes);
}
Future<Map> getDoctorsRating(
int docID, context) async {
Future<Map> getDoctorsRating(int docID, context) async {
Map<String, dynamic> request;
var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
var languageID =
await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
Request req = appGlobal.getPublicRequest();
request = {
"LanguageID": languageID == 'ar' ? 1 : 2,
@ -203,17 +206,17 @@ class DoctorsListService extends BaseService {
await baseAppClient.post(GET_DOCTOR_RATING_NOTES,
onSuccess: (response, statusCode) async {
localRes = response;
}, onFailure: (String error, int statusCode) {
throw error;
}, body: request);
localRes = response;
}, onFailure: (String error, int statusCode) {
throw error;
}, body: request);
return Future.value(localRes);
}
Future<Map> getDoctorsRatingDetails(
int docID, context) async {
Future<Map> getDoctorsRatingDetails(int docID, context) async {
Map<String, dynamic> request;
var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
var languageID =
await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
Request req = appGlobal.getPublicRequest();
request = {
"LanguageID": languageID == 'ar' ? 1 : 2,
@ -236,17 +239,18 @@ class DoctorsListService extends BaseService {
await baseAppClient.post(GET_DOCTOR_RATING_DETAILS,
onSuccess: (response, statusCode) async {
localRes = response;
}, onFailure: (String error, int statusCode) {
throw error;
}, body: request);
localRes = response;
}, onFailure: (String error, int statusCode) {
throw error;
}, body: request);
return Future.value(localRes);
}
Future<Map> getDoctorFreeSlots(
int docID, int clinicID, int projectID, BuildContext context) async {
Map<String, dynamic> request;
var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
var languageID =
await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
Request req = appGlobal.getPublicRequest();
request = {
"DoctorID": docID,
@ -281,7 +285,8 @@ class DoctorsListService extends BaseService {
Future<Map> getDoctorScheduledFreeSlots(int docID, int clinicID,
int projectID, int serviceID, BuildContext context) async {
Map<String, dynamic> request;
var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
var languageID =
await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
Request req = appGlobal.getPublicRequest();
request = {
"DoctorID": docID,
@ -324,7 +329,8 @@ class DoctorsListService extends BaseService {
authUser = data;
}
var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
var languageID =
await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
Request req = appGlobal.getPublicRequest();
request = {
"IsForLiveCare": false,
@ -383,7 +389,8 @@ class DoctorsListService extends BaseService {
authUser = data;
}
var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
var languageID =
await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
Request req = appGlobal.getPublicRequest();
request = {
"IsForLiveCare": true,
@ -437,7 +444,8 @@ class DoctorsListService extends BaseService {
authUser = data;
}
var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
var languageID =
await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
Request req = appGlobal.getPublicRequest();
request = {
@ -481,7 +489,8 @@ class DoctorsListService extends BaseService {
authUser = data;
}
var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
var languageID =
await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
Request req = appGlobal.getPublicRequest();
request = {
@ -526,7 +535,8 @@ class DoctorsListService extends BaseService {
authUser = data;
}
var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
var languageID =
await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
Request req = appGlobal.getPublicRequest();
request = {
@ -560,7 +570,8 @@ class DoctorsListService extends BaseService {
Future<Map> getPatientAppointmentCurfewHistory(
bool isActiveAppointment) async {
Map<String, dynamic> request;
var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
var languageID =
await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
Request req = appGlobal.getPublicRequest();
request = {
@ -601,7 +612,8 @@ class DoctorsListService extends BaseService {
authUser = data;
}
var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
var languageID =
await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
Request req = appGlobal.getPublicRequest();
request = {
@ -654,7 +666,8 @@ class DoctorsListService extends BaseService {
long = await this.sharedPref.getDouble(USER_LONG);
}
var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
var languageID =
await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
Request req = appGlobal.getPublicRequest();
request = {
@ -701,7 +714,8 @@ class DoctorsListService extends BaseService {
authUser = data;
}
var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
var languageID =
await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
Request req = appGlobal.getPublicRequest();
request = {
@ -751,7 +765,8 @@ class DoctorsListService extends BaseService {
authUser = data;
}
var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
var languageID =
await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
Request req = appGlobal.getPublicRequest();
request = {
@ -802,7 +817,8 @@ class DoctorsListService extends BaseService {
authUser = data;
}
var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
var languageID =
await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
Request req = appGlobal.getPublicRequest();
request = {
@ -847,7 +863,8 @@ class DoctorsListService extends BaseService {
await this.sharedPref.getObject(USER_PROFILE));
authUser = data;
}
var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
var languageID =
await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
Request req = appGlobal.getPublicRequest();
request = {
"ClientRequestID": transactionID,
@ -886,7 +903,8 @@ class DoctorsListService extends BaseService {
await this.sharedPref.getObject(USER_PROFILE));
authUser = data;
}
var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
var languageID =
await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
Request req = appGlobal.getPublicRequest();
request = {
"AdvanceNumber": advanceNumber,
@ -923,7 +941,8 @@ class DoctorsListService extends BaseService {
await this.sharedPref.getObject(USER_PROFILE));
authUser = data;
}
var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
var languageID =
await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
Request req = appGlobal.getPublicRequest();
request = {
"IsForAskYourDoctor": true,
@ -963,7 +982,8 @@ class DoctorsListService extends BaseService {
await this.sharedPref.getObject(USER_PROFILE));
authUser = data;
}
var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
var languageID =
await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
Request req = appGlobal.getPublicRequest();
request = {
"VersionID": req.VersionID,
@ -999,7 +1019,8 @@ class DoctorsListService extends BaseService {
await this.sharedPref.getObject(USER_PROFILE));
authUser = data;
}
var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
var languageID =
await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
Request req = appGlobal.getPublicRequest();
request = {
@ -1058,7 +1079,8 @@ class DoctorsListService extends BaseService {
await this.sharedPref.getObject(USER_PROFILE));
authUser = data;
}
var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
var languageID =
await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
Request req = appGlobal.getPublicRequest();
request = {
"AppointmentNo": appoNo,
@ -1133,7 +1155,8 @@ class DoctorsListService extends BaseService {
await this.sharedPref.getObject(USER_PROFILE));
authUser = data;
}
var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
var languageID =
await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
Request req = appGlobal.getPublicRequest();
request = {
"AppointmentNo": appo.appointmentNo,
@ -1174,7 +1197,8 @@ class DoctorsListService extends BaseService {
await this.sharedPref.getObject(USER_PROFILE));
authUser = data;
}
var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
var languageID =
await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
Request req = appGlobal.getPublicRequest();
request = {
"AppointmentDate": appoDate,
@ -1223,7 +1247,8 @@ class DoctorsListService extends BaseService {
await this.sharedPref.getObject(USER_PROFILE));
authUser = data;
}
var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
var languageID =
await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
Request req = appGlobal.getPublicRequest();
request = {
"ProjectID": projectID,
@ -1282,7 +1307,8 @@ class DoctorsListService extends BaseService {
await this.sharedPref.getObject(USER_PROFILE));
authUser = data;
}
var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
var languageID =
await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
Request req = appGlobal.getPublicRequest();
request = {
@ -1320,4 +1346,42 @@ class DoctorsListService extends BaseService {
}, body: request);
return Future.value(localRes);
}
Future<Map> getPatientHealthDataStats(
int medCategoryId, int medCategoryStsId, 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;
}
var languageID =
await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
Request req = appGlobal.getPublicRequest();
request = {
"MedCategoryID": medCategoryId,
"MedGetStsID": medCategoryStsId,
"VersionID": req.VersionID,
"Channel": req.Channel,
"LanguageID": languageID == 'ar' ? 1 : 2,
"IPAdress": req.IPAdress,
"generalid": req.generalid,
"PatientOutSA": authUser.outSA,
"SessionID": "YckwoXhUmWBsnHKEKig",
"isDentalAllowedBackend": false,
"DeviceTypeID": req.DeviceTypeID,
"PatientID": authUser.patientID,
"TokenID": "@dm!n",
"PatientTypeID": authUser.patientType,
"PatientType": authUser.patientType
};
dynamic localRes;
await baseAppClient.post(GET_PATIENT_HEALTH_STATS,
onSuccess: (response, statusCode) async {
localRes = response;
}, onFailure: (String error, int statusCode) {
throw error;
}, body: request);
return Future.value(localRes);
}
}

@ -1375,6 +1375,9 @@ class TranslationBase {
localizedValues["bloodD-enter-desc"][locale.languageCode];
String get viewTermsConditions =>
localizedValues["viewTermsConditions"][locale.languageCode];
String get walkinAppo => localizedValues["WalkinAppo"][locale.languageCode];
String get videoAppo => localizedValues["videoAppo"][locale.languageCode];
}
class TranslationBaseDelegate extends LocalizationsDelegate<TranslationBase> {

@ -1,8 +1,6 @@
import 'dart:convert';
import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/model/my_balance/AdvanceModel.dart';
import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart';
import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart';
import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart';
@ -13,14 +11,14 @@ class MyInAppBrowser extends InAppBrowser {
// static String SERVICE_URL =
// 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort Payment Gateway URL UAT
static String SERVICE_URL =
'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL LIVE
static String SERVICE_URL =
'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL LIVE
// static String PREAUTH_SERVICE_URL =
// 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort PreAuth Payment Gateway URL UAT
static String PREAUTH_SERVICE_URL =
'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort PreAuth Payment Gateway URL Live Store
static String PREAUTH_SERVICE_URL =
'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort PreAuth Payment Gateway URL Live Store
static List<String> successURLS = [
'success',
@ -42,6 +40,9 @@ class MyInAppBrowser extends InAppBrowser {
String deviceToken;
double lat = 0.0;
double long = 0.0;
static bool isPaymentDone = false;
MyInAppBrowser({this.onExitCallback, this.appo, this.onLoadStartCallback});
@ -98,6 +99,11 @@ class MyInAppBrowser extends InAppBrowser {
await this.sharedPref.getObject(USER_PROFILE));
authUser = data;
}
if (await this.sharedPref.getDouble(USER_LAT) != null &&
await this.sharedPref.getDouble(USER_LONG) != null) {
lat = await this.sharedPref.getDouble(USER_LAT);
long = await this.sharedPref.getDouble(USER_LONG);
}
}
openPaymentBrowser(
@ -111,12 +117,33 @@ class MyInAppBrowser extends InAppBrowser {
String patientName,
dynamic patientID,
AuthenticatedUser authenticatedUser,
InAppBrowser browser) {
getDeviceToken();
InAppBrowser browser,
bool isLiveCareAppo,
[var appoDate,
var appoNo,
var clinicID,
var doctorID]) {
this.browser = browser;
this.browser.openUrl(
url: generateURL(amount, orderDesc, transactionID, projId, emailId,
paymentMethod, patientType, patientName, patientID, authenticatedUser));
getPatientData();
generateURL(
amount,
orderDesc,
transactionID,
projId,
emailId,
paymentMethod,
patientType,
patientName,
patientID,
authenticatedUser,
isLiveCareAppo,
appoDate,
appoNo,
clinicID,
doctorID)
.then((value) {
this.browser.openUrl(url: value);
});
}
openBrowser(String url) {
@ -124,7 +151,7 @@ class MyInAppBrowser extends InAppBrowser {
this.browser.openUrl(url: url);
}
String generateURL(
Future<String> generateURL(
double amount,
String orderDesc,
String transactionID,
@ -135,18 +162,19 @@ class MyInAppBrowser extends InAppBrowser {
String patientName,
dynamic patientID,
AuthenticatedUser authUser,
[var patientData,
bool isLiveCareAppo,
[var appoDate,
var appoNo,
var clinicID,
var doctorID,
var patientData,
var servID,
var LiveServID]) {
getPatientData();
var LiveServID]) async {
getDeviceToken();
String currentLanguageID = getLanguageID() == 'ar' ? 'AR' : 'EN';
String form = getForm();
String form = isLiveCareAppo ? getLiveCareForm() : getForm();
// if (authUser != null) {
// form = form.replaceFirst("EMAIL_VALUE", authUser.emailAddress);
// } else {
form = form.replaceFirst("EMAIL_VALUE", emailId);
// }
form = form.replaceFirst("EMAIL_VALUE", emailId);
form = form.replaceFirst('AMOUNT_VALUE', amount.toString());
form = form.replaceFirst('ORDER_DESCRIPTION_VALUE', orderDesc);
@ -157,12 +185,13 @@ class MyInAppBrowser extends InAppBrowser {
form = form.replaceFirst('LANG_VALUE', currentLanguageID);
form = form.replaceFirst('PATIENT_OUT_SA',
authUser.outSA == 0 ? false.toString() : true.toString());
form = form.replaceFirst('PATIENT_TYPE_ID',
patientData == null ? patientType.toString() : "1");
form = form.replaceFirst(
'PATIENT_TYPE_ID', patientData == null ? patientType.toString() : "1");
// form = form.replaceFirst('DEVICE_TOKEN', this.cs.sharedService.getSharedData(AuthenticationService.DEVICE_TOKEN, false) + "," + this.cs.sharedService.getSharedData(AuthenticationService.APNS_TOKEN, false));
// form = form.replaceFirst('LATITUDE_VALUE', this.cs.sharedService.getSharedData('userLat', false));
// form = form.replaceFirst('LONGITUDE_VALUE', this.cs.sharedService.getSharedData('userLong', false));
form = form.replaceFirst(
'DEVICE_TOKEN', await sharedPref.getString(PUSH_TOKEN));
form = form.replaceFirst('LATITUDE_VALUE', this.lat.toString());
form = form.replaceFirst('LONGITUDE_VALUE', this.long.toString());
if (servID == "4")
form = form.replaceFirst(
@ -178,17 +207,16 @@ class MyInAppBrowser extends InAppBrowser {
form = form.replaceFirst('LIVE_SERVICE_ID', "2");
}
// if (patientData == null) {
form = form.replaceFirst('CUSTNAME_VALUE', patientName);
form = form.replaceFirst('CUSTID_VALUE', patientID.toString());
// } else {
// form = form.replaceFirst('CUSTNAME_VALUE', patientData.depositorName);
// form = form.replaceFirst('CUSTID_VALUE', patientData.fileNumber);
// }
form = form.replaceFirst('CUSTNAME_VALUE', patientName);
form = form.replaceFirst('CUSTID_VALUE', patientID.toString());
form = form.replaceFirst('LATITUDE_VALUE', "24.708488");
form = form.replaceFirst('LONGITUDE_VALUE', "46.665925");
form = form.replaceFirst('DEVICE_TOKEN', DEVICE_TOKEN);
if (isLiveCareAppo) {
form = form.replaceFirst('IS_SCHEDULE_VALUE', "true");
form = form.replaceFirst('APPOINTMENT_DATE_VALUE', appoDate);
form = form.replaceFirst('APPOINTMENT_NO_VALUE', appoNo.toString());
form = form.replaceFirst('DOCTOR_ID_VALUE', doctorID.toString());
form = form.replaceFirst('CLINIC_ID_VALUE', clinicID.toString());
}
var bytes = utf8.encode(form);
var base64Str = base64.encode(bytes);
@ -228,6 +256,42 @@ class MyInAppBrowser extends InAppBrowser {
'</body>' +
'</html>';
}
String getLiveCareForm() {
return '<html> ' +
'<head></head>' +
'<body>' +
'<form id="paymentForm" action="SERVICE_URL_VALUE" method="post">' +
'<input type="hidden" name="Amount" value="AMOUNT_VALUE">' +
'<input type="hidden" name="ProjID" value="PROJECT_ID_VALUE">' +
'<input type="hidden" name="IsSchedule" value="IS_SCHEDULE_VALUE">' +
'<input type="hidden" name="AppointmentDate" value="APPOINTMENT_DATE_VALUE">' +
'<input type="hidden" name="AppointmentNo" value="APPOINTMENT_NO_VALUE">' +
'<input type="hidden" name="DoctorID" value="DOCTOR_ID_VALUE">' +
'<input type="hidden" name="ClinicID" value="CLINIC_ID_VALUE">' +
'<input type="hidden" name="Order_Desc" value="ORDER_DESCRIPTION_VALUE">' +
'<input type="hidden" name="OrderID" value="ORDER_ID_VALUE">' +
'<input type="hidden" name="PaymentOption" value="PAYMENT_OPTION_VALUE">' +
'<input type="hidden" name="Email" value="EMAIL_VALUE">' +
'<input type="hidden" name="ServID" value="SERV_ID" >' +
'<input type="hidden" name="ChannelID" value="2" >' +
'<input type="hidden" name="Lang" value="LANG_VALUE" >' +
'<input type="hidden" name="ReturnURL" value="" >' +
'<input type="hidden" name="CustName" value="CUSTNAME_VALUE" >' +
'<input type="hidden" name="PatientOutSA" value="PATIENT_OUT_SA" >' +
'<input type="hidden" name="PatientTypeID" value="PATIENT_TYPE_ID" >' +
'<input type="hidden" name="DeviceToken" value="DEVICE_TOKEN" >' +
'<input type="hidden" name="Longitude" value="LONGITUDE_VALUE" >' +
'<input type="hidden" name="Latitude" value="LATITUDE_VALUE" >' +
'<input type="hidden" name="Live_ServiceID" value="LIVE_SERVICE_ID" >' +
'<input type="hidden" name="CustID" value="CUSTID_VALUE" >' +
'<input type="hidden" name="ResponseContinueURL" value="http://hmg.com/Documents/success.html" >' +
'<input type="hidden" name="BackClickUrl" value="http://hmg.com/Documents/success.html" >' +
'</form>' +
'<script type="text/javascript"> document.getElementById("paymentForm").submit(); </script>' +
'</body>' +
'</html>';
}
}
class MyChromeSafariBrowser extends ChromeSafariBrowser {

Loading…
Cancel
Save