UI Fixes in LiveCare

merge-update-with-lab-changes
haroon amjad 5 years ago
parent 5f36c900a4
commit 7edb6fd179

@ -36,13 +36,13 @@ class _State extends State<ClinicCard> {
return Row(
children: <Widget>[
Card(
margin: EdgeInsets.fromLTRB(13.0, 10.0, 8.0, 8.0),
margin: EdgeInsets.fromLTRB(15.0, 10.0, 8.0, 8.0),
color: widget.isSelected ? Colors.blue : Colors.white,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10),
),
child: Container(
width: MediaQuery.of(context).size.width * 0.8,
width: MediaQuery.of(context).size.width * 0.75,
padding: EdgeInsets.all(12.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,

@ -17,8 +17,11 @@ import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart'
import 'package:diplomaticquarterapp/services/livecare_services/livecare_provider.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart';
import 'package:diplomaticquarterapp/widgets/in_app_browser/InAppBrowser.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:smart_progress_bar/smart_progress_bar.dart';
@ -81,7 +84,13 @@ class _clinic_listState extends State<ClinicList> {
service
.getERAppointmentFees(selectedClinicID, context)
.then((res) {
erAppointmentFeesResponse = ERAppointmentFeesResponse.fromJson(res);
if (res['HasAppointment'] == true) {
isError = true;
showLiveCareCancelDialog(res['ErrorEndUserMessage'], res);
} else {
erAppointmentFeesResponse = ERAppointmentFeesResponse.fromJson(res);
isError = false;
}
})
.catchError((err) {
print(err);
@ -97,10 +106,57 @@ class _clinic_listState extends State<ClinicList> {
});
}
showLiveCareCancelDialog(String msg, res) {
ConfirmDialog dialog = new ConfirmDialog(
context: context,
confirmMessage: msg,
okText: TranslationBase.of(context).confirm,
cancelText: TranslationBase.of(context).cancel_nocaps,
okFunction: () =>
{cancelAppointment(res)},
cancelFunction: () => {});
dialog.showAlertDialog(context);
}
cancelAppointment(res) {
AppoitmentAllHistoryResultList appo = AppoitmentAllHistoryResultList();
appo.clinicID = res['ClinicID'];
appo.doctorID = res['DoctorID'];
appo.endTime = res['EndTime'];
appo.projectID = res['ProjectID'];
appo.startTime = res['StrAppointmentDate'];
appo.appointmentNo = res['AppointmentID'];
appo.isLiveCareAppointment = true;
appo.originalClinicID = 0;
appo.originalProjectID = res['ProjectID'];
appo.appointmentDate = res['AppointmentDate'];
ConfirmDialog.closeAlertDialog(context);
DoctorsListService service = new DoctorsListService();
service
.cancelAppointment(appo, context)
.then((res) {
print(res);
if (res['MessageStatus'] == 1) {
AppToast.showSuccessToast(message: res['ErrorEndUserMessage']);
} else {
AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
}
})
.catchError((err) {
print(err);
})
.showProgressBar(
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6))
.then((value) {
startLiveCare();
});
}
getERAppointmentTime(GetERAppointmentFeesList getERAppointmentFeesList) {
LiveCareService service = new LiveCareService();
service.getERAppointmentTime(selectedClinicID, context).then((res) {
print(res['WatingtimeInteger']);
print(res);
showLiveCarePaymentDialog(
getERAppointmentFeesList, res['WatingtimeInteger']);
}).catchError((err) {

Loading…
Cancel
Save