Covid Payment fixes

merge-requests/404/head
haroon amjad 3 years ago
parent ab8030416c
commit 184942e891

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

@ -480,7 +480,11 @@ class _BookSuccessState extends State<BookSuccess> {
appo.clinicID = widget.patientShareResponse.clinicID;
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) {
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/PatientShareResposne.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/pages/Covid-DriveThru/covid-payment-alert.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/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
@ -65,6 +67,8 @@ class _CovidTimeSlotsState extends State<CovidTimeSlots> with TickerProviderStat
ScrollController _scrollController;
ToDoCountProviderModel toDoProvider;
@override
void initState() {
final _selectedDay = DateTime.now();
@ -117,6 +121,7 @@ class _CovidTimeSlotsState extends State<CovidTimeSlots> with TickerProviderStat
@override
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
toDoProvider = Provider.of<ToDoCountProviderModel>(context);
return AppScaffold(
appBarTitle: TranslationBase.of(context).covidTest,
isShowAppBar: true,
@ -447,6 +452,7 @@ class _CovidTimeSlotsState extends State<CovidTimeSlots> with TickerProviderStat
.then((res) {
if (res['MessageStatus'] == 1) {
AppToast.showSuccessToast(message: "Appointment Booked Successfully");
getToDoCount();
getPatientShare(context, res['AppointmentNo'], docObject.clinicID, docObject.projectID, docObject);
} else {
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) {
ConfirmDialog.closeAlertDialog(context);
GifLoaderDialogUtils.showMyDialog(context);

@ -71,7 +71,7 @@ class CovidDirveThruQuestionsState extends State<CovidDirveThruQuestions> {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
"Booking appointment for:",
TranslationBase.of(context).covidBookAppo,
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 16,
@ -130,7 +130,7 @@ class CovidDirveThruQuestionsState extends State<CovidDirveThruQuestions> {
),
mHeight(12),
Text(
"Please answer below questionnaire",
TranslationBase.of(context).covidQuestionnaire,
style: TextStyle(
fontSize: 16,
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/CovidTestProceduresResponse.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:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:provider/provider.dart';
class CovidPaymentDetails extends StatefulWidget {
CovidPaymentInfoResponse covidPaymentInfoResponse;
@ -35,6 +37,7 @@ class _CovidPaymentDetailsState extends State<CovidPaymentDetails> {
@override
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
return AppScaffold(
appBarTitle: TranslationBase.of(context).covidTest,
isShowAppBar: true,
@ -118,7 +121,7 @@ class _CovidPaymentDetailsState extends State<CovidPaymentDetails> {
},
child: ListTile(
title: Text(
widget.proceduresList[index].procedureName,
projectViewModel.isArabic ? widget.proceduresList[index].procedureNameN : widget.proceduresList[index].procedureName,
style: TextStyle(
fontSize: 12.0,
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/PatientShareResposne.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/ToDoList/payment_method_select.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_new.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/in_app_browser/InAppBrowser.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
@ -26,7 +24,7 @@ import 'package:provider/provider.dart';
class CovidPaymentSummary extends StatefulWidget {
PatientShareResponse patientShareResponse;
String selectedPaymentMethod;
String selectedPaymentMethod;
MyInAppBrowser browser;
AuthenticatedUser authenticatedUser;
AppSharedPreferences sharedPref = AppSharedPreferences();
@ -67,7 +65,6 @@ class _CovidPaymentSummaryState extends State<CovidPaymentSummary> {
height: 12,
),
Row(
children: [
Text(
TranslationBase.of(context).totalBalance + ": ",
@ -105,11 +102,9 @@ class _CovidPaymentSummaryState extends State<CovidPaymentSummary> {
InkWell(
onTap: () {
showDraggableDialog(context, PaymentMethod(
onSelectedMethod: (String metohd){
widget.selectedPaymentMethod=metohd;
setState(() {
});
onSelectedMethod: (String metohd) {
widget.selectedPaymentMethod = metohd;
setState(() {});
},
));
},

@ -107,7 +107,7 @@ class _AppointmentDetailsState extends State<AppointmentDetails> with SingleTick
"",
//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,
buttonIcon: 'assets/images/new/Boo_ Appointment.svg',
showConfirmMessageDialog: false,
@ -136,7 +136,7 @@ class _AppointmentDetailsState extends State<AppointmentDetails> with SingleTick
onTap: (index) {
setState(() {
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;
AppointmentDetails.showFooterButton = false;
} else {
@ -147,7 +147,7 @@ class _AppointmentDetailsState extends State<AppointmentDetails> with SingleTick
},
tabs: [
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(
child: Text(TranslationBase.of(context).availableAppo, style: TextStyle(color: Colors.grey)),
)

@ -121,7 +121,8 @@ class _ToDoState extends State<ToDo> {
DateUtil.getWeekDayMonthDayYearDateFormatted(
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)),
),
!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);
getPatientAppointmentHistory();

@ -9,7 +9,9 @@ import 'package:flutter_svg/flutter_svg.dart';
class PaymentMethod extends StatefulWidget {
Function onSelectedMethod;
PaymentMethod({this.onSelectedMethod});
@override
_PaymentMethodState createState() => _PaymentMethodState();
}
@ -56,13 +58,13 @@ class _PaymentMethodState extends State<PaymentMethod> {
children: [
Container(
height: 60.0,
width:60,
width: 60,
padding: EdgeInsets.all(7.0),
child: Image.asset("assets/images/new-design/mada.png"),
),
mWidth(12),
Text(
"MADA",
"Mada",
style: TextStyle(
color: Colors.black,
fontSize: 14,
@ -96,7 +98,8 @@ class _PaymentMethodState extends State<PaymentMethod> {
width: 60,
child: Image.asset("assets/images/new-design/visa.png"),
),
mWidth(12),Text(
mWidth(12),
Text(
"VISA",
style: TextStyle(
color: Colors.black,
@ -133,7 +136,7 @@ class _PaymentMethodState extends State<PaymentMethod> {
),
mWidth(12),
Text(
"MASTER CARD",
"MasterCard",
style: TextStyle(
color: Colors.black,
fontSize: 14,
@ -169,7 +172,7 @@ class _PaymentMethodState extends State<PaymentMethod> {
),
mWidth(12),
Text(
"INSTALLMENT",
"Installments",
style: TextStyle(
color: Colors.black,
fontSize: 14,
@ -183,39 +186,75 @@ class _PaymentMethodState extends State<PaymentMethod> {
),
Platform.isIOS
? 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"),
),
),
),
),
width: double.infinity,
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),
),
Expanded(
child: Container(),
child: Row(
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(),
SizedBox(
height: 150.0,
@ -264,7 +303,6 @@ class _PaymentMethodState extends State<PaymentMethod> {
updateSelectedPaymentMethod(String selectedMethod) {
setState(() {
selectedPaymentMethod = selectedMethod;
});
}
}

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

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