working in LiveCare Scheduling

merge-requests/253/head
haroon amjad 5 years ago
parent 6945230965
commit dde10cd27b

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

@ -255,7 +255,7 @@ class _BookSuccessState extends State<BookSuccess> {
minWidth: MediaQuery.of(context).size.width * 0.7, minWidth: MediaQuery.of(context).size.width * 0.7,
height: 45.0, height: 45.0,
child: RaisedButton( child: RaisedButton(
color: new Color(0xFF40ACC9), color: new Color(0xffc5272d),
textColor: Colors.white, textColor: Colors.white,
disabledTextColor: Colors.white, disabledTextColor: Colors.white,
disabledColor: new Color(0xFFbcc2c4), disabledColor: new Color(0xFFbcc2c4),
@ -318,7 +318,7 @@ class _BookSuccessState extends State<BookSuccess> {
minWidth: MediaQuery.of(context).size.width * 0.7, minWidth: MediaQuery.of(context).size.width * 0.7,
height: 45.0, height: 45.0,
child: RaisedButton( child: RaisedButton(
color: new Color(0xFF40ACC9), color: new Color(0xFFc5272d),
textColor: Colors.white, textColor: Colors.white,
disabledTextColor: Colors.white, disabledTextColor: Colors.white,
disabledColor: new Color(0xFFbcc2c4), disabledColor: new Color(0xFFbcc2c4),

@ -61,7 +61,7 @@ class DoctorView extends StatelessWidget {
letterSpacing: 1.0)), letterSpacing: 1.0)),
Container( Container(
margin: EdgeInsets.only(top: 3.0), margin: EdgeInsets.only(top: 3.0),
child: Text(this.doctor.clinicName, child: Text(this.doctor.clinicName != null ? this.doctor.clinicName : "",
style: TextStyle( style: TextStyle(
fontSize: 12.0, fontSize: 12.0,
color: Colors.grey[600], 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/pages/ToDoList/widgets/paymentDialog.dart';
import 'package:diplomaticquarterapp/routes.dart'; import 'package:diplomaticquarterapp/routes.dart';
import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.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_shared_preferences.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.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/countdown_timer_controller.dart';
import 'package:flutter_countdown_timer/current_remaining_time.dart'; import 'package:flutter_countdown_timer/current_remaining_time.dart';
import 'package:flutter_countdown_timer/flutter_countdown_timer.dart'; import 'package:flutter_countdown_timer/flutter_countdown_timer.dart';
import 'package:flutter_svg/flutter_svg.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';
@ -130,24 +128,18 @@ class _ToDoState extends State<ToDo> {
.substring(0, 5), .substring(0, 5),
style: TextStyle(fontSize: 10.0)), style: TextStyle(fontSize: 10.0)),
), ),
widget.appoList[index].isLiveCareAppointment !widget.appoList[index].isLiveCareAppointment
? SvgPicture.asset( ? Image.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", "assets/images/new-design/hospital_address_icon.png",
width: 20.0, width: 20.0,
height: 20.0), height: 20.0)
: Container(),
Container( Container(
margin: margin:
EdgeInsets.only(left: 5.0, right: 5.0), EdgeInsets.only(left: 5.0, right: 5.0),
child: widget child: widget
.appoList[index].isLiveCareAppointment .appoList[index].isLiveCareAppointment
? Text( ? Container()
TranslationBase.of(context)
.liveCareAppo,
style: TextStyle(fontSize: 12.0))
: Text( : Text(
widget.appoList[index].projectName != widget.appoList[index].projectName !=
null null
@ -249,7 +241,7 @@ class _ToDoState extends State<ToDo> {
(_, CurrentRemainingTime time) { (_, CurrentRemainingTime time) {
return time != null return time != null
? Text( ? 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( TranslationBase.of(
context) context)
.upcomingTimeLeft, .upcomingTimeLeft,
@ -567,12 +559,34 @@ class _ToDoState extends State<ToDo> {
} }
getPatientShare(context, AppoitmentAllHistoryResultList appo) { getPatientShare(context, AppoitmentAllHistoryResultList appo) {
GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService(); 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 service
.getPatientShare(appo.appointmentNo.toString(), appo.clinicID, .getLiveCareAppointmentPatientShare(appo.appointmentNo.toString(),
appo.projectID, context) appo.clinicID, appo.projectID, context)
.then((res) { .then((res) {
print(res);
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
widget.patientShareResponse = new PatientShareResponse.fromJson(res); widget.patientShareResponse = new PatientShareResponse.fromJson(res);
openPaymentDialog(appo, widget.patientShareResponse); openPaymentDialog(appo, widget.patientShareResponse);

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

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

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

@ -1,8 +1,6 @@
import 'dart:convert'; import 'dart:convert';
import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/model/my_balance/AdvanceModel.dart';
import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart'; import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart';
import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart';
import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart'; import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart';
@ -13,14 +11,14 @@ class MyInAppBrowser extends InAppBrowser {
// static String SERVICE_URL = // static String SERVICE_URL =
// 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort Payment Gateway URL UAT // 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort Payment Gateway URL UAT
static String SERVICE_URL = static String SERVICE_URL =
'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL LIVE 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL LIVE
// static String PREAUTH_SERVICE_URL = // static String PREAUTH_SERVICE_URL =
// 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort PreAuth Payment Gateway URL UAT // 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort PreAuth Payment Gateway URL UAT
static String PREAUTH_SERVICE_URL = static String PREAUTH_SERVICE_URL =
'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort PreAuth Payment Gateway URL Live Store 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort PreAuth Payment Gateway URL Live Store
static List<String> successURLS = [ static List<String> successURLS = [
'success', 'success',
@ -42,6 +40,9 @@ class MyInAppBrowser extends InAppBrowser {
String deviceToken; String deviceToken;
double lat = 0.0;
double long = 0.0;
static bool isPaymentDone = false; static bool isPaymentDone = false;
MyInAppBrowser({this.onExitCallback, this.appo, this.onLoadStartCallback}); MyInAppBrowser({this.onExitCallback, this.appo, this.onLoadStartCallback});
@ -98,6 +99,11 @@ class MyInAppBrowser extends InAppBrowser {
await this.sharedPref.getObject(USER_PROFILE)); await this.sharedPref.getObject(USER_PROFILE));
authUser = data; 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( openPaymentBrowser(
@ -112,11 +118,22 @@ class MyInAppBrowser extends InAppBrowser {
dynamic patientID, dynamic patientID,
AuthenticatedUser authenticatedUser, AuthenticatedUser authenticatedUser,
InAppBrowser browser) { InAppBrowser browser) {
getDeviceToken();
this.browser = browser; this.browser = browser;
this.browser.openUrl( getPatientData();
url: generateURL(amount, orderDesc, transactionID, projId, emailId, generateURL(
paymentMethod, patientType, patientName, patientID, authenticatedUser)); amount,
orderDesc,
transactionID,
projId,
emailId,
paymentMethod,
patientType,
patientName,
patientID,
authenticatedUser)
.then((value) {
this.browser.openUrl(url: value);
});
} }
openBrowser(String url) { openBrowser(String url) {
@ -124,7 +141,7 @@ class MyInAppBrowser extends InAppBrowser {
this.browser.openUrl(url: url); this.browser.openUrl(url: url);
} }
String generateURL( Future<String> generateURL(
double amount, double amount,
String orderDesc, String orderDesc,
String transactionID, String transactionID,
@ -137,15 +154,16 @@ class MyInAppBrowser extends InAppBrowser {
AuthenticatedUser authUser, AuthenticatedUser authUser,
[var patientData, [var patientData,
var servID, var servID,
var LiveServID]) { var LiveServID]) async {
getPatientData(); // getPatientData();
getDeviceToken();
String currentLanguageID = getLanguageID() == 'ar' ? 'AR' : 'EN'; String currentLanguageID = getLanguageID() == 'ar' ? 'AR' : 'EN';
String form = getForm(); String form = getForm();
// if (authUser != null) { // if (authUser != null) {
// form = form.replaceFirst("EMAIL_VALUE", authUser.emailAddress); // form = form.replaceFirst("EMAIL_VALUE", authUser.emailAddress);
// } else { // } else {
form = form.replaceFirst("EMAIL_VALUE", emailId); form = form.replaceFirst("EMAIL_VALUE", emailId);
// } // }
form = form.replaceFirst('AMOUNT_VALUE', amount.toString()); form = form.replaceFirst('AMOUNT_VALUE', amount.toString());
@ -157,12 +175,13 @@ class MyInAppBrowser extends InAppBrowser {
form = form.replaceFirst('LANG_VALUE', currentLanguageID); form = form.replaceFirst('LANG_VALUE', currentLanguageID);
form = form.replaceFirst('PATIENT_OUT_SA', form = form.replaceFirst('PATIENT_OUT_SA',
authUser.outSA == 0 ? false.toString() : true.toString()); authUser.outSA == 0 ? false.toString() : true.toString());
form = form.replaceFirst('PATIENT_TYPE_ID', form = form.replaceFirst(
patientData == null ? patientType.toString() : "1"); '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(
// form = form.replaceFirst('LATITUDE_VALUE', this.cs.sharedService.getSharedData('userLat', false)); 'DEVICE_TOKEN', await sharedPref.getString(PUSH_TOKEN));
// form = form.replaceFirst('LONGITUDE_VALUE', this.cs.sharedService.getSharedData('userLong', false)); form = form.replaceFirst('LATITUDE_VALUE', this.lat.toString());
form = form.replaceFirst('LONGITUDE_VALUE', this.long.toString());
if (servID == "4") if (servID == "4")
form = form.replaceFirst( form = form.replaceFirst(
@ -179,16 +198,16 @@ class MyInAppBrowser extends InAppBrowser {
} }
// if (patientData == null) { // if (patientData == null) {
form = form.replaceFirst('CUSTNAME_VALUE', patientName); form = form.replaceFirst('CUSTNAME_VALUE', patientName);
form = form.replaceFirst('CUSTID_VALUE', patientID.toString()); form = form.replaceFirst('CUSTID_VALUE', patientID.toString());
// } else { // } else {
// form = form.replaceFirst('CUSTNAME_VALUE', patientData.depositorName); // form = form.replaceFirst('CUSTNAME_VALUE', patientData.depositorName);
// form = form.replaceFirst('CUSTID_VALUE', patientData.fileNumber); // form = form.replaceFirst('CUSTID_VALUE', patientData.fileNumber);
// } // }
form = form.replaceFirst('LATITUDE_VALUE', "24.708488"); // form = form.replaceFirst('LATITUDE_VALUE', "24.708488");
form = form.replaceFirst('LONGITUDE_VALUE', "46.665925"); // form = form.replaceFirst('LONGITUDE_VALUE', "46.665925");
form = form.replaceFirst('DEVICE_TOKEN', DEVICE_TOKEN); // form = form.replaceFirst('DEVICE_TOKEN', DEVICE_TOKEN);
var bytes = utf8.encode(form); var bytes = utf8.encode(form);
var base64Str = base64.encode(bytes); var base64Str = base64.encode(bytes);

Loading…
Cancel
Save