Covid Payment fixes

merge-update-with-lab-changes
haroon amjad 5 years ago
parent ab8030416c
commit 184942e891

@ -12,7 +12,6 @@ class ActiveMedicationsService extends BaseService{
Map<String, dynamic> body = Map(); Map<String, dynamic> body = Map();
body['isDentalAllowedBackend'] = false; body['isDentalAllowedBackend'] = false;
body['PatientID'] = 1298851; body['PatientID'] = 1298851;
body['TokenID'] = "@dm!n";
await baseAppClient.post(ADD_ACTIVE_PRESCRIPTIONS_REPORT_BY_PATIENT_ID, await baseAppClient.post(ADD_ACTIVE_PRESCRIPTIONS_REPORT_BY_PATIENT_ID,
onSuccess: (response, statusCode) async { onSuccess: (response, statusCode) async {
activePrescriptionReport.clear(); activePrescriptionReport.clear();

@ -480,7 +480,11 @@ class _BookSuccessState extends State<BookSuccess> {
appo.clinicID = widget.patientShareResponse.clinicID; appo.clinicID = widget.patientShareResponse.clinicID;
appo.appointmentNo = widget.patientShareResponse.appointmentNo; appo.appointmentNo = widget.patientShareResponse.appointmentNo;
Navigator.push(context, FadePage(page: PaymentMethod())).then((value) { Navigator.push(context, FadePage(page: PaymentMethod(
onSelectedMethod: (String metohd) {
setState(() {});
}
))).then((value) {
if (value != null) { if (value != null) {
openPayment(value, authUser, double.parse(patientShareResponse.patientShareWithTax.toString()), patientShareResponse, appo); openPayment(value, authUser, double.parse(patientShareResponse.patientShareWithTax.toString()), patientShareResponse, appo);
} }

@ -4,9 +4,11 @@ import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart
import 'package:diplomaticquarterapp/models/Appointments/FreeSlot.dart'; import 'package:diplomaticquarterapp/models/Appointments/FreeSlot.dart';
import 'package:diplomaticquarterapp/models/Appointments/PatientShareResposne.dart'; import 'package:diplomaticquarterapp/models/Appointments/PatientShareResposne.dart';
import 'package:diplomaticquarterapp/models/Appointments/timeSlot.dart'; import 'package:diplomaticquarterapp/models/Appointments/timeSlot.dart';
import 'package:diplomaticquarterapp/models/Appointments/toDoCountProviderModel.dart';
import 'package:diplomaticquarterapp/models/CovidDriveThru/CovidTestProceduresResponse.dart'; import 'package:diplomaticquarterapp/models/CovidDriveThru/CovidTestProceduresResponse.dart';
import 'package:diplomaticquarterapp/pages/Covid-DriveThru/covid-payment-alert.dart'; import 'package:diplomaticquarterapp/pages/Covid-DriveThru/covid-payment-alert.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/services/covid-drivethru/covid-drivethru.dart'; import 'package:diplomaticquarterapp/services/covid-drivethru/covid-drivethru.dart';
import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
@ -65,6 +67,8 @@ class _CovidTimeSlotsState extends State<CovidTimeSlots> with TickerProviderStat
ScrollController _scrollController; ScrollController _scrollController;
ToDoCountProviderModel toDoProvider;
@override @override
void initState() { void initState() {
final _selectedDay = DateTime.now(); final _selectedDay = DateTime.now();
@ -117,6 +121,7 @@ class _CovidTimeSlotsState extends State<CovidTimeSlots> with TickerProviderStat
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context); ProjectViewModel projectViewModel = Provider.of(context);
toDoProvider = Provider.of<ToDoCountProviderModel>(context);
return AppScaffold( return AppScaffold(
appBarTitle: TranslationBase.of(context).covidTest, appBarTitle: TranslationBase.of(context).covidTest,
isShowAppBar: true, isShowAppBar: true,
@ -447,6 +452,7 @@ class _CovidTimeSlotsState extends State<CovidTimeSlots> with TickerProviderStat
.then((res) { .then((res) {
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
AppToast.showSuccessToast(message: "Appointment Booked Successfully"); AppToast.showSuccessToast(message: "Appointment Booked Successfully");
getToDoCount();
getPatientShare(context, res['AppointmentNo'], docObject.clinicID, docObject.projectID, docObject); getPatientShare(context, res['AppointmentNo'], docObject.clinicID, docObject.projectID, docObject);
} else { } else {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
@ -478,6 +484,19 @@ class _CovidTimeSlotsState extends State<CovidTimeSlots> with TickerProviderStat
}); });
} }
getToDoCount() {
toDoProvider.setState(0, true);
ClinicListService service = new ClinicListService();
service.getActiveAppointmentNo(context).then((res) {
print(res['AppointmentActiveNumber']);
if (res['MessageStatus'] == 1) {
toDoProvider.setState(res['AppointmentActiveNumber'], true);
} else {}
}).catchError((err) {
print(err);
});
}
cancelAppointment(DoctorList docObject, AppoitmentAllHistoryResultList appo, BuildContext context) { cancelAppointment(DoctorList docObject, AppoitmentAllHistoryResultList appo, BuildContext context) {
ConfirmDialog.closeAlertDialog(context); ConfirmDialog.closeAlertDialog(context);
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);

@ -71,7 +71,7 @@ class CovidDirveThruQuestionsState extends State<CovidDirveThruQuestions> {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Text( Text(
"Booking appointment for:", TranslationBase.of(context).covidBookAppo,
style: TextStyle( style: TextStyle(
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize: 16, fontSize: 16,
@ -130,7 +130,7 @@ class CovidDirveThruQuestionsState extends State<CovidDirveThruQuestions> {
), ),
mHeight(12), mHeight(12),
Text( Text(
"Please answer below questionnaire", TranslationBase.of(context).covidQuestionnaire,
style: TextStyle( style: TextStyle(
fontSize: 16, fontSize: 16,
letterSpacing: -0.64, letterSpacing: -0.64,

@ -1,3 +1,4 @@
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/models/CovidDriveThru/CovidPaymentInfoResponse.dart'; import 'package:diplomaticquarterapp/models/CovidDriveThru/CovidPaymentInfoResponse.dart';
import 'package:diplomaticquarterapp/models/CovidDriveThru/CovidTestProceduresResponse.dart'; import 'package:diplomaticquarterapp/models/CovidDriveThru/CovidTestProceduresResponse.dart';
import 'package:diplomaticquarterapp/pages/Covid-DriveThru/Covid-TimeSlots.dart'; import 'package:diplomaticquarterapp/pages/Covid-DriveThru/Covid-TimeSlots.dart';
@ -11,6 +12,7 @@ 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:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart'; import 'package:flutter_svg/flutter_svg.dart';
import 'package:provider/provider.dart';
class CovidPaymentDetails extends StatefulWidget { class CovidPaymentDetails extends StatefulWidget {
CovidPaymentInfoResponse covidPaymentInfoResponse; CovidPaymentInfoResponse covidPaymentInfoResponse;
@ -35,6 +37,7 @@ class _CovidPaymentDetailsState extends State<CovidPaymentDetails> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
return AppScaffold( return AppScaffold(
appBarTitle: TranslationBase.of(context).covidTest, appBarTitle: TranslationBase.of(context).covidTest,
isShowAppBar: true, isShowAppBar: true,
@ -118,7 +121,7 @@ class _CovidPaymentDetailsState extends State<CovidPaymentDetails> {
}, },
child: ListTile( child: ListTile(
title: Text( title: Text(
widget.proceduresList[index].procedureName, projectViewModel.isArabic ? widget.proceduresList[index].procedureNameN : widget.proceduresList[index].procedureName,
style: TextStyle( style: TextStyle(
fontSize: 12.0, fontSize: 12.0,
letterSpacing: -0.48, letterSpacing: -0.48,

@ -2,7 +2,6 @@ import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart'; import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart';
import 'package:diplomaticquarterapp/models/Appointments/PatientShareResposne.dart'; import 'package:diplomaticquarterapp/models/Appointments/PatientShareResposne.dart';
import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart';
import 'package:diplomaticquarterapp/pages/Blood/new_text_Field.dart';
import 'package:diplomaticquarterapp/pages/BookAppointment/QRCode.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/QRCode.dart';
import 'package:diplomaticquarterapp/pages/ToDoList/payment_method_select.dart'; import 'package:diplomaticquarterapp/pages/ToDoList/payment_method_select.dart';
import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart'; import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart';
@ -14,7 +13,6 @@ import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart'; import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/dragable_sheet.dart'; import 'package:diplomaticquarterapp/widgets/dragable_sheet.dart';
import 'package:diplomaticquarterapp/widgets/in_app_browser/InAppBrowser.dart'; import 'package:diplomaticquarterapp/widgets/in_app_browser/InAppBrowser.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
@ -26,7 +24,7 @@ import 'package:provider/provider.dart';
class CovidPaymentSummary extends StatefulWidget { class CovidPaymentSummary extends StatefulWidget {
PatientShareResponse patientShareResponse; PatientShareResponse patientShareResponse;
String selectedPaymentMethod; String selectedPaymentMethod;
MyInAppBrowser browser; MyInAppBrowser browser;
AuthenticatedUser authenticatedUser; AuthenticatedUser authenticatedUser;
AppSharedPreferences sharedPref = AppSharedPreferences(); AppSharedPreferences sharedPref = AppSharedPreferences();
@ -67,7 +65,6 @@ class _CovidPaymentSummaryState extends State<CovidPaymentSummary> {
height: 12, height: 12,
), ),
Row( Row(
children: [ children: [
Text( Text(
TranslationBase.of(context).totalBalance + ": ", TranslationBase.of(context).totalBalance + ": ",
@ -105,11 +102,9 @@ class _CovidPaymentSummaryState extends State<CovidPaymentSummary> {
InkWell( InkWell(
onTap: () { onTap: () {
showDraggableDialog(context, PaymentMethod( showDraggableDialog(context, PaymentMethod(
onSelectedMethod: (String metohd){ onSelectedMethod: (String metohd) {
widget.selectedPaymentMethod=metohd; widget.selectedPaymentMethod = metohd;
setState(() { setState(() {});
});
}, },
)); ));
}, },

@ -107,7 +107,7 @@ class _AppointmentDetailsState extends State<AppointmentDetails> with SingleTick
"", "",
//model.user.emailAddress, //model.user.emailAddress,
), ),
isNeedToShowButton: (widget.appo.clinicID == 17 || widget.appo.clinicID == 23 || widget.appo.isExecludeDoctor || widget.appo.isLiveCareAppointment) ? false : true, isNeedToShowButton: (widget.appo.clinicID == 17 || widget.appo.clinicID == 23 || widget.appo.clinicID == 265 || widget.appo.isExecludeDoctor || widget.appo.isLiveCareAppointment) ? false : true,
buttonTitle: TranslationBase.of(context).schedule, buttonTitle: TranslationBase.of(context).schedule,
buttonIcon: 'assets/images/new/Boo_ Appointment.svg', buttonIcon: 'assets/images/new/Boo_ Appointment.svg',
showConfirmMessageDialog: false, showConfirmMessageDialog: false,
@ -136,7 +136,7 @@ class _AppointmentDetailsState extends State<AppointmentDetails> with SingleTick
onTap: (index) { onTap: (index) {
setState(() { setState(() {
if (index == 1) { if (index == 1) {
if (widget.appo.clinicID == 17 || widget.appo.clinicID == 23 || widget.appo.isExecludeDoctor || widget.appo.isLiveCareAppointment) { if (widget.appo.clinicID == 17 || widget.appo.clinicID == 23 || widget.appo.clinicID == 265 || widget.appo.isExecludeDoctor || widget.appo.isLiveCareAppointment) {
_tabController.index = _tabController.previousIndex; _tabController.index = _tabController.previousIndex;
AppointmentDetails.showFooterButton = false; AppointmentDetails.showFooterButton = false;
} else { } else {
@ -147,7 +147,7 @@ class _AppointmentDetailsState extends State<AppointmentDetails> with SingleTick
}, },
tabs: [ tabs: [
Tab(child: Text(TranslationBase.of(context).appoActions, style: TextStyle(color: Colors.black))), Tab(child: Text(TranslationBase.of(context).appoActions, style: TextStyle(color: Colors.black))),
widget.appo.clinicID == 17 || widget.appo.clinicID == 23 || widget.appo.isExecludeDoctor || widget.appo.isLiveCareAppointment widget.appo.clinicID == 17 || widget.appo.clinicID == 23 || widget.appo.clinicID == 265 || widget.appo.isExecludeDoctor || widget.appo.isLiveCareAppointment
? Tab( ? Tab(
child: Text(TranslationBase.of(context).availableAppo, style: TextStyle(color: Colors.grey)), child: Text(TranslationBase.of(context).availableAppo, style: TextStyle(color: Colors.grey)),
) )

@ -121,7 +121,8 @@ class _ToDoState extends State<ToDo> {
DateUtil.getWeekDayMonthDayYearDateFormatted( DateUtil.getWeekDayMonthDayYearDateFormatted(
DateUtil.convertStringToDate(widget.appoList[index].appointmentDate), projectViewModel.isArabic ? "ar" : "en") + DateUtil.convertStringToDate(widget.appoList[index].appointmentDate), projectViewModel.isArabic ? "ar" : "en") +
" " + " " +
widget.appoList[index].startTime.substring(0, 5), overflow: TextOverflow.clip, widget.appoList[index].startTime.substring(0, 5),
overflow: TextOverflow.clip,
style: TextStyle(fontSize: 10.0)), 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(), !widget.appoList[index].isLiveCareAppointment ? Image.asset("assets/images/new-design/hospital_address_icon.png", width: 20.0, height: 20.0) : Container(),
@ -743,7 +744,10 @@ class _ToDoState extends State<ToDo> {
}); });
} }
Navigator.push(context, FadePage(page: PaymentMethod())).then((value) { Navigator.push(context, FadePage(page: PaymentMethod(
onSelectedMethod: (String metohd) {
setState(() {});
}))).then((value) {
print(value); print(value);
getPatientAppointmentHistory(); getPatientAppointmentHistory();

@ -9,7 +9,9 @@ import 'package:flutter_svg/flutter_svg.dart';
class PaymentMethod extends StatefulWidget { class PaymentMethod extends StatefulWidget {
Function onSelectedMethod; Function onSelectedMethod;
PaymentMethod({this.onSelectedMethod}); PaymentMethod({this.onSelectedMethod});
@override @override
_PaymentMethodState createState() => _PaymentMethodState(); _PaymentMethodState createState() => _PaymentMethodState();
} }
@ -56,13 +58,13 @@ class _PaymentMethodState extends State<PaymentMethod> {
children: [ children: [
Container( Container(
height: 60.0, height: 60.0,
width:60, width: 60,
padding: EdgeInsets.all(7.0), padding: EdgeInsets.all(7.0),
child: Image.asset("assets/images/new-design/mada.png"), child: Image.asset("assets/images/new-design/mada.png"),
), ),
mWidth(12), mWidth(12),
Text( Text(
"MADA", "Mada",
style: TextStyle( style: TextStyle(
color: Colors.black, color: Colors.black,
fontSize: 14, fontSize: 14,
@ -96,7 +98,8 @@ class _PaymentMethodState extends State<PaymentMethod> {
width: 60, width: 60,
child: Image.asset("assets/images/new-design/visa.png"), child: Image.asset("assets/images/new-design/visa.png"),
), ),
mWidth(12),Text( mWidth(12),
Text(
"VISA", "VISA",
style: TextStyle( style: TextStyle(
color: Colors.black, color: Colors.black,
@ -133,7 +136,7 @@ class _PaymentMethodState extends State<PaymentMethod> {
), ),
mWidth(12), mWidth(12),
Text( Text(
"MASTER CARD", "MasterCard",
style: TextStyle( style: TextStyle(
color: Colors.black, color: Colors.black,
fontSize: 14, fontSize: 14,
@ -169,7 +172,7 @@ class _PaymentMethodState extends State<PaymentMethod> {
), ),
mWidth(12), mWidth(12),
Text( Text(
"INSTALLMENT", "Installments",
style: TextStyle( style: TextStyle(
color: Colors.black, color: Colors.black,
fontSize: 14, fontSize: 14,
@ -183,39 +186,75 @@ class _PaymentMethodState extends State<PaymentMethod> {
), ),
Platform.isIOS Platform.isIOS
? Container( ? Container(
margin: EdgeInsets.only(top: 25.0), width: double.infinity,
child: Flex( child: InkWell(
direction: Axis.horizontal, onTap: () {
children: <Widget>[ updateSelectedPaymentMethod("ApplePay");
Expanded( },
child: Container( child: Card(
child: InkWell( elevation: 3.0,
onTap: () { margin: EdgeInsets.fromLTRB(8.0, 16.0, 8.0, 8.0),
updateSelectedPaymentMethod("ApplePay"); color: Colors.white,
}, shape: RoundedRectangleBorder(
child: Card( borderRadius: BorderRadius.circular(10),
elevation: 3.0, side: selectedPaymentMethod == "ApplePay" ? BorderSide(color: Colors.green, width: 5.0) : BorderSide(color: Colors.transparent, width: 0.0),
margin: EdgeInsets.fromLTRB(8.0, 16.0, 8.0, 8.0),
color: Colors.white,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10),
side: selectedPaymentMethod == "ApplePay" ? BorderSide(color: Colors.green, width: 5.0) : BorderSide(color: Colors.transparent, width: 0.0),
),
child: Container(
height: 120.0,
padding: EdgeInsets.all(20.0),
child: SvgPicture.asset("assets/images/new-design/applepay.svg"),
),
),
),
),
), ),
Expanded( child: Row(
child: Container(), children: [
Container(
height: 60.0,
padding: EdgeInsets.all(7.0),
width: 60,
child: SvgPicture.asset("assets/images/new-design/applepay.svg"),
),
mWidth(12),
Text(
"Apple Pay",
style: TextStyle(
color: Colors.black,
fontSize: 14,
fontWeight: FontWeight.bold,
),
)
],
), ),
], ),
), ),
) )
// Container(
// margin: EdgeInsets.only(top: 25.0),
// child: Flex(
// direction: Axis.horizontal,
// children: <Widget>[
// Expanded(
// child: Container(
// child: InkWell(
// onTap: () {
// updateSelectedPaymentMethod("ApplePay");
// },
// child: Card(
// elevation: 3.0,
// margin: EdgeInsets.fromLTRB(8.0, 16.0, 8.0, 8.0),
// color: Colors.white,
// shape: RoundedRectangleBorder(
// borderRadius: BorderRadius.circular(10),
// side: selectedPaymentMethod == "ApplePay" ? BorderSide(color: Colors.green, width: 5.0) : BorderSide(color: Colors.transparent, width: 0.0),
// ),
// child: Container(
// height: 120.0,
// padding: EdgeInsets.all(20.0),
// child: SvgPicture.asset("assets/images/new-design/applepay.svg"),
// ),
// ),
// ),
// ),
// ),
// Expanded(
// child: Container(),
// ),
// ],
// ),
// )
: Container(), : Container(),
SizedBox( SizedBox(
height: 150.0, height: 150.0,
@ -264,7 +303,6 @@ class _PaymentMethodState extends State<PaymentMethod> {
updateSelectedPaymentMethod(String selectedMethod) { updateSelectedPaymentMethod(String selectedMethod) {
setState(() { setState(() {
selectedPaymentMethod = selectedMethod; selectedPaymentMethod = selectedMethod;
}); });
} }
} }

@ -57,7 +57,7 @@ class _PassportUpdatePageState extends State<PassportUpdatePage> {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Text( Text(
"Booking appointment for:", TranslationBase.of(context).covidBookAppo,
style: TextStyle( style: TextStyle(
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize: 16, fontSize: 16,

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