working in LiveCare Scheduling

merge-update-with-lab-changes
haroon amjad 5 years ago
parent 6945230965
commit dde10cd27b

@ -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),

@ -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],

@ -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';
@ -130,24 +128,18 @@ class _ToDoState extends State<ToDo> {
.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(
!widget.appoList[index].isLiveCareAppointment
? Image.asset(
"assets/images/new-design/hospital_address_icon.png",
width: 20.0,
height: 20.0),
height: 20.0)
: Container(),
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))
? Container()
: Text(
widget.appoList[index].projectName !=
null
@ -249,7 +241,7 @@ class _ToDoState extends State<ToDo> {
(_, CurrentRemainingTime time) {
return time != null
? Text(
'${time.days}:${time.hours}:${time.min}:${time.sec} ' +
'${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,
@ -567,12 +559,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);

@ -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:

@ -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(
@ -112,11 +118,22 @@ class MyInAppBrowser extends InAppBrowser {
dynamic patientID,
AuthenticatedUser authenticatedUser,
InAppBrowser browser) {
getDeviceToken();
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)
.then((value) {
this.browser.openUrl(url: value);
});
}
openBrowser(String url) {
@ -124,7 +141,7 @@ class MyInAppBrowser extends InAppBrowser {
this.browser.openUrl(url: url);
}
String generateURL(
Future<String> generateURL(
double amount,
String orderDesc,
String transactionID,
@ -137,15 +154,16 @@ class MyInAppBrowser extends InAppBrowser {
AuthenticatedUser authUser,
[var patientData,
var servID,
var LiveServID]) {
getPatientData();
var LiveServID]) async {
// getPatientData();
getDeviceToken();
String currentLanguageID = getLanguageID() == 'ar' ? 'AR' : 'EN';
String form = 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());
@ -157,12 +175,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(
@ -179,16 +198,16 @@ class MyInAppBrowser extends InAppBrowser {
}
// if (patientData == null) {
form = form.replaceFirst('CUSTNAME_VALUE', patientName);
form = form.replaceFirst('CUSTID_VALUE', patientID.toString());
form = form.replaceFirst('CUSTNAME_VALUE', patientName);
form = form.replaceFirst('CUSTID_VALUE', patientID.toString());
// } else {
// form = form.replaceFirst('CUSTNAME_VALUE', patientData.depositorName);
// form = form.replaceFirst('CUSTID_VALUE', patientData.fileNumber);
// }
form = form.replaceFirst('LATITUDE_VALUE', "24.708488");
form = form.replaceFirst('LONGITUDE_VALUE', "46.665925");
form = form.replaceFirst('DEVICE_TOKEN', DEVICE_TOKEN);
// form = form.replaceFirst('LATITUDE_VALUE', "24.708488");
// form = form.replaceFirst('LONGITUDE_VALUE', "46.665925");
// form = form.replaceFirst('DEVICE_TOKEN', DEVICE_TOKEN);
var bytes = utf8.encode(form);
var base64Str = base64.encode(bytes);

Loading…
Cancel
Save