merge-update-with-lab-changes
haroon amjad 2 years ago
parent cb2bacf539
commit c7ee76d816

@ -455,10 +455,10 @@ class _BookConfirmState extends State<BookConfirm> {
isCash = res["IsCash"]; isCash = res["IsCash"];
if (isCash) { if (isCash) {
navigateToBookSuccess(context, docObject, widget.patientShareResponse); navigateToBookSuccess(context, docObject, widget.patientShareResponse, isCash);
} else { } else {
if (isInsured && isEligible) { if (isInsured && isEligible) {
navigateToBookSuccess(context, docObject, widget.patientShareResponse); navigateToBookSuccess(context, docObject, widget.patientShareResponse, isCash);
} else { } else {
if (isInsured && !isEligible) { if (isInsured && !isEligible) {
errorMsg = TranslationBase.of(context).invalidEligibility; errorMsg = TranslationBase.of(context).invalidEligibility;
@ -490,7 +490,7 @@ class _BookConfirmState extends State<BookConfirm> {
widget.service.getLiveCareAppointmentPatientShare(appointmentNo, clinicID, projectID, context).then((res) { widget.service.getLiveCareAppointmentPatientShare(appointmentNo, clinicID, projectID, context).then((res) {
widget.patientShareResponse = new PatientShareResponse.fromJson(res); widget.patientShareResponse = new PatientShareResponse.fromJson(res);
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
navigateToBookSuccess(context, docObject, widget.patientShareResponse); navigateToBookSuccess(context, docObject, widget.patientShareResponse, false);
}).catchError((err) { }).catchError((err) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: err); AppToast.showErrorToast(message: err);
@ -554,7 +554,7 @@ class _BookConfirmState extends State<BookConfirm> {
Navigator.of(context).popAndPushNamed(HOME); Navigator.of(context).popAndPushNamed(HOME);
} }
Future navigateToBookSuccess(context, DoctorList docObject, PatientShareResponse patientShareResponse) async { Future navigateToBookSuccess(context, DoctorList docObject, PatientShareResponse patientShareResponse, bool isCash) async {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
this.sharedPref.remove(IS_LIVECARE_APPOINTMENT); this.sharedPref.remove(IS_LIVECARE_APPOINTMENT);
Navigator.push( Navigator.push(
@ -566,6 +566,7 @@ class _BookConfirmState extends State<BookConfirm> {
appoDateFormatted: widget.appoDateFormatted, appoDateFormatted: widget.appoDateFormatted,
appoTimeFormatted: widget.selectedTime, appoTimeFormatted: widget.selectedTime,
dateTime: getDateTime(), dateTime: getDateTime(),
isCash: isCash,
), ),
), ),
); );

@ -7,6 +7,8 @@ import 'package:diplomaticquarterapp/models/Appointments/PatientShareResposne.da
import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart';
import 'package:diplomaticquarterapp/models/header_model.dart'; import 'package:diplomaticquarterapp/models/header_model.dart';
import 'package:diplomaticquarterapp/pages/ToDoList/payment_method_select.dart'; import 'package:diplomaticquarterapp/pages/ToDoList/payment_method_select.dart';
import 'package:diplomaticquarterapp/pages/insurance/insurance_update_screen.dart';
import 'package:diplomaticquarterapp/pages/landing/landing_page.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/theme/colors.dart'; import 'package:diplomaticquarterapp/theme/colors.dart';
@ -17,6 +19,7 @@ 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/custom_text_button.dart'; import 'package:diplomaticquarterapp/widgets/buttons/custom_text_button.dart';
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
import 'package:diplomaticquarterapp/widgets/in_app_browser/InAppBrowser.dart'; import 'package:diplomaticquarterapp/widgets/in_app_browser/InAppBrowser.dart';
import 'package:diplomaticquarterapp/widgets/new_design/doctor_header.dart'; import 'package:diplomaticquarterapp/widgets/new_design/doctor_header.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
@ -36,8 +39,9 @@ class BookSuccess extends StatefulWidget {
String appoDateFormatted; String appoDateFormatted;
String appoTimeFormatted; String appoTimeFormatted;
bool isCash;
BookSuccess({@required this.patientShareResponse, @required this.docObject, @required this.appoDateFormatted, @required this.appoTimeFormatted}); BookSuccess({@required this.patientShareResponse, @required this.docObject, @required this.appoDateFormatted, @required this.appoTimeFormatted, this.isCash = false});
@override @override
_BookSuccessState createState() => _BookSuccessState(); _BookSuccessState createState() => _BookSuccessState();
@ -186,51 +190,79 @@ class _BookSuccessState extends State<BookSuccess> {
child: Container( child: Container(
color: CustomColors.appBackgroudGreyColor, color: CustomColors.appBackgroudGreyColor,
margin: EdgeInsets.all(14), margin: EdgeInsets.all(14),
height: 45.0, height: 150.0,
child: Row( child: Column(
mainAxisAlignment: MainAxisAlignment.end, children: [
children: <Widget>[ Row(
Expanded( mainAxisAlignment: MainAxisAlignment.end,
flex: 1, children: <Widget>[
child: ButtonTheme( Expanded(
shape: RoundedRectangleBorder( flex: 1,
borderRadius: BorderRadius.circular(10.0), child: ButtonTheme(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10.0),
),
height: 45.0,
child: CustomTextButton(
backgroundColor: CustomColors.green,
elevation: 0,
onPressed: () {
startPaymentProcess();
projectViewModel.analytics.appointment.pay_now_for_appointment(appointment_type: 'regular', doctorDetail: widget.docObject, payNow: true);
},
child: Text(TranslationBase.of(context).payNow.toUpperCase(),
style: TextStyle(
fontSize: 18.0,
color: Colors.white,
)),
),
),
), ),
height: 45.0, mWidth(7),
child: CustomTextButton( Expanded(
backgroundColor: CustomColors.green, flex: 1,
elevation: 0, child: ButtonTheme(
onPressed: () { shape: RoundedRectangleBorder(
startPaymentProcess(); borderRadius: BorderRadius.circular(10.0),
projectViewModel.analytics.appointment.pay_now_for_appointment(appointment_type: 'regular', doctorDetail: widget.docObject, payNow: true); ),
}, height: 45.0,
child: Text(TranslationBase.of(context).payNow.toUpperCase(), child: CustomTextButton(
style: TextStyle( backgroundColor: Color(0xffc5272d),
fontSize: 18.0, elevation: 0,
color: Colors.white, onPressed: () {
)), navigateToHome(context);
projectViewModel.analytics.appointment.pay_now_for_appointment(appointment_type: 'regular', doctorDetail: widget.docObject, payNow: false);
},
child: Text(TranslationBase.of(context).payLater.toUpperCase(), style: TextStyle(fontSize: 18.0, color: Colors.white)),
),
),
), ),
), ],
), ),
mWidth(7), mHeight(10.0),
Expanded( Text(
flex: 1, TranslationBase.of(context).cashAmountUpdateInsurance,
child: ButtonTheme( style: TextStyle(
shape: RoundedRectangleBorder( fontSize: 14.0,
borderRadius: BorderRadius.circular(10.0), fontWeight: FontWeight.w600,
), color: Color(0xff2E303A),
height: 45.0,
child: CustomTextButton(
backgroundColor: Color(0xffc5272d),
elevation: 0,
onPressed: () {
navigateToHome(context);
projectViewModel.analytics.appointment.pay_now_for_appointment(appointment_type: 'regular', doctorDetail: widget.docObject, payNow: false);
},
child: Text(TranslationBase.of(context).payLater.toUpperCase(), style: TextStyle(fontSize: 18.0, color: Colors.white)),
),
), ),
), ),
mHeight(5.0),
DefaultButton(
TranslationBase.of(context).updateInsuranceText,
() {
Navigator.pop(context, null);
Navigator.pushAndRemoveUntil(
context,
MaterialPageRoute(builder: (context) => LandingPage()),
(Route<dynamic> route) => false,
);
Navigator.push(context, FadePage(page: InsuranceUpdate()));
},
color: CustomColors.accentColor,
textColor: Colors.white,
),
], ],
), ),
), ),

@ -27,8 +27,9 @@ class BookReminderPage extends StatefulWidget {
String appoDateFormatted; String appoDateFormatted;
String appoTimeFormatted; String appoTimeFormatted;
DateTime dateTime; DateTime dateTime;
bool isCash;
BookReminderPage({@required this.patientShareResponse, @required this.docObject, @required this.appoDateFormatted, @required this.appoTimeFormatted, this.dateTime}); BookReminderPage({@required this.patientShareResponse, @required this.docObject, @required this.appoDateFormatted, @required this.appoTimeFormatted, this.dateTime, this.isCash = false});
@override @override
_BookReminderPageState createState() => _BookReminderPageState(); _BookReminderPageState createState() => _BookReminderPageState();
@ -184,8 +185,8 @@ class _BookReminderPageState extends State<BookReminderPage> {
), ),
height: 45.0, height: 45.0,
child: CustomTextButton( child: CustomTextButton(
backgroundColor: CustomColors.green, backgroundColor: CustomColors.green,
elevation: 0, elevation: 0,
onPressed: () async { onPressed: () async {
print(widget.patientShareResponse.appointmentNo); print(widget.patientShareResponse.appointmentNo);
showReminderDialog( showReminderDialog(
@ -215,10 +216,17 @@ class _BookReminderPageState extends State<BookReminderPage> {
Future navigateToBookSuccess(BuildContext context) async { Future navigateToBookSuccess(BuildContext context) async {
Navigator.push( Navigator.push(
context, context,
FadePage( FadePage(
page: page: BookSuccess(
BookSuccess(docObject: widget.docObject, patientShareResponse: widget.patientShareResponse, appoDateFormatted: widget.appoDateFormatted, appoTimeFormatted: widget.appoTimeFormatted))); docObject: widget.docObject,
patientShareResponse: widget.patientShareResponse,
appoDateFormatted: widget.appoDateFormatted,
appoTimeFormatted: widget.appoTimeFormatted,
isCash: widget.isCash,
),
),
);
} }
Future<Map<Permission, PermissionStatus>> requestPermissions() async { Future<Map<Permission, PermissionStatus>> requestPermissions() async {

Loading…
Cancel
Save